Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nx generates invalid names for remote projects with multi-word names #27901

Open
1 of 4 tasks
stacho91 opened this issue Sep 13, 2024 · 0 comments
Open
1 of 4 tasks

Nx generates invalid names for remote projects with multi-word names #27901

stacho91 opened this issue Sep 13, 2024 · 0 comments
Assignees

Comments

@stacho91
Copy link

stacho91 commented Sep 13, 2024

Current Behavior

When creating a new remote project with a multi-word name using the Nx CLI (as the --name argument), regardless of the notation used (camelCase, underscore, or dot notation), Nx generates a hyphenated name, leading to a validation conflict.

nx g @nx/react:remote --name=myRemote --directory="apps/myRemote" --dynamic=true

NX Generating @nx/react:remote

✔ Which stylesheet format would you like to use? · none
✔ Which E2E test runner would you like to use? · none
✔ Which bundler do you want to use to build the application? · webpack
✔ What should be the project name and where should it be generated? · myRemote @ apps/myRemote

NX Invalid remote name provided: my-remote. The name can only contain letters, digits, underscores, and dollar signs.

Expected Behavior

The Nx CLI should correctly handle multi-word names for remote projects, generating valid names regardless of the notation used.

GitHub Repo

No response

Steps to Reproduce

  1. Install the latest Nx CLI using npm install -g nx
  2. Generate a new workspace with npx create-nx-workspace@latest
  3. Attempt to generate a new 'remote' project with a multi-word name, like so:
    nx g @nx/react:remote --name=myRemote --directory="apps/myRemote" --dynamic=true

Nx Report

Node           : 18.19.0
OS             : darwin-arm64
Native Target  : aarch64-macos
npm            : 10.8.3

nx (global)        : 19.7.3
nx                 : 19.7.3
@nx/js             : 19.7.3
@nx/jest           : 19.7.3
@nx/linter         : 19.7.3
@nx/eslint         : 19.7.3
@nx/workspace      : 19.7.3
@nx/cypress        : 19.7.3
@nx/devkit         : 19.7.3
@nx/eslint-plugin  : 19.7.3
@nx/react          : 19.7.3
@nrwl/tao          : 19.7.3
@nx/web            : 19.7.3
@nx/webpack        : 19.7.3
typescript         : 5.5.4

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@Coly010 Coly010 self-assigned this Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants