发布

  • fix(core): convert-to-monorepo support for root project without project.json (#26507)

    frostbyte_neo 发布于 2024-06-12 22:24:32 +00:00

    This PR fixes convert-to-monorepo generator, so it works after nx init on a single project.

    Current Behavior

    If you use :

    npm create vite react-app -- --template=react-ts
    cd react-app
    npx nx init
    

    Then, you'll get an error when running nx g convert-to-monorepo.

     NX   The following projects are defined in multiple locations:
    
    - react-app:
      - .
      - packages/react-app
    
    To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
    
    MultipleProjectsWithSameNameError: The following projects are defined in multiple locations:
    - react-app:
      - .
      - packages/react-app
      - 
    

    Expected Behavior

    The generator should work, and you can run commands successfully
    afterwards (e.g. nx serve react-app).

    Related Issue(s)

    Fixes #

    下载附件