When creating a project with Nx react. It requires the project names to be kebab-case
sceptre12 opened this issue · 2 comments
Current Behavior
I am unable to create any project where the project name has the following format:
- camelCase
- snake_case
Attempting to set the value through the CLI also fails:
pnpm nx g @nx/react:application --directory apps/web/tempProject --name tempSpace
Expected Behavior
As a user I should be able to set a project name as camelCase, snake_case, or kebab-case.
GitHub Repo
No response
Steps to Reproduce
- Execute:
npx create-nx-workspace --name {MONOREPO_NAME} --pm pnpm --workspaceType package-based --preset ts --formatter prettier --nxCloud skip
- Execute:
pnpm nx add @nx/react && pnpm nx add @nx/nest && pnpm nx add @nx/playwright && pnpm nx add @nx/eslint && pnpm nx add @nx/jest && pnpm nx add @nx/eslint-plugin
- Execute:
pnpm nx g @nx/react:application --directory apps/web/tempProject --name tempSpace
- Should see failure in the terminal
Nx Report
Node : 22.11.0
OS : darwin-arm64
Native Target : aarch64-macos
pnpm : 9.14.4
nx (global) : 20.0.0
nx : 20.2.1
@nx/js : 20.2.1
@nx/jest : 20.2.1
@nx/eslint : 20.2.1
@nx/devkit : 20.2.1
@nx/eslint-plugin : 20.2.1
@nx/nest : 20.2.1
@nx/playwright : 20.2.1
@nx/react : 20.2.1
@nx/rspack : 20.2.1
typescript : 5.6.3
---------------------------------------
Registered Plugins:
@nx/js/typescript
@nx/playwright/plugin
@nx/eslint/plugin
@nx/jest/plugin
---------------------------------------
Community plugins:
@koliveira15/nx-sonarqube : 4.2.1
Failure Logs
Package Manager Version
No response
Operating System
- macOS
- Linux
- Windows
- Other (Please specify)
Additional Information
A similar issue appears when a user generates a remote executing this command:
pnpm nx g @nx/react:remote apps/web/remote1Project --bundler rspack --host hostProject --linter eslint --unitTestRunner jest --e2eTestRunner playwright --style tailwind --verbose
Inside of the package.json file of the generated project this is how the project name looks:
I have to manually update the project name to match the folder name to get the build working properly.
Build error: