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

Trailing slash in generated Angular library directory produces invalid selector #9263

Closed
miluoshi opened this issue Mar 10, 2022 · 1 comment · Fixed by #9314
Closed

Trailing slash in generated Angular library directory produces invalid selector #9263

miluoshi opened this issue Mar 10, 2022 · 1 comment · Fixed by #9314
Assignees
Labels
outdated scope: angular Issues related to Angular support in Nx type: bug

Comments

@miluoshi
Copy link
Contributor

Current Behavior

Directory path with trailing / character is valid path, but it causes @nrwl/angular:library generator to throw error:

Selector (workspace-libs--some-lib) is invalid.

Expected Behavior

Trailing slash should be trimmed before converting non-alphabetical characters to selector name to prevent double -- in selector name.

I'm not aware if this used to work before.

Steps to Reproduce

  1. run yarn nx generate @nrwl/angular:library --name=some-lib --directory=libs/ --no-interactive --dry-run
  2. generator throws error Selector (workspace-libs--some-lib) is invalid.

Environment

Click to expand
Node : 16.13.2
   OS   : darwin x64
   yarn : 1.22.17
   
   nx : 13.8.1
   @nrwl/angular : 13.8.1
   @nrwl/cli : 13.8.1
   @nrwl/cypress : 13.8.1
   @nrwl/detox : undefined
   @nrwl/devkit : 13.8.1
   @nrwl/eslint-plugin-nx : 13.8.1
   @nrwl/express : undefined
   @nrwl/jest : 13.8.1
   @nrwl/js : 13.8.1
   @nrwl/linter : 13.8.1
   @nrwl/nest : undefined
   @nrwl/next : undefined
   @nrwl/node : undefined
   @nrwl/nx-cloud : 13.1.4
   @nrwl/react : 13.8.1
   @nrwl/react-native : undefined
   @nrwl/schematics : undefined
   @nrwl/storybook : 13.8.1
   @nrwl/tao : 13.8.1
   @nrwl/web : 13.8.1
   @nrwl/workspace : 13.8.1
   typescript : 4.5.5
   rxjs : 7.5.4
   ---------------------------------------
   Community plugins:
         @angular/animations: 13.2.2
         @angular/cdk: 13.1.2
         @angular/common: 13.2.2
         @angular/core: 13.2.2
         @angular/elements: 13.2.2
         @angular/forms: 13.2.2
         @angular/material: 13.1.2
         @angular/material-moment-adapter: 13.1.2
         @angular/platform-browser: 13.2.2
         @angular/platform-browser-dynamic: 13.2.2
         @angular/router: 13.2.2
         @ngrx/component-store: 13.0.2
         @ngrx/effects: 13.0.2
         @ngrx/entity: 13.0.2
         @ngrx/schematics: 13.0.2
         @ngrx/store: 13.0.2
         @nx-tools/nx-docker: 1.0.5
         @angular-devkit/build-angular: 13.2.3
         @angular/cli: 13.2.3
         @angular/compiler: 13.2.2
         @angular/compiler-cli: 13.2.2
         @angular/language-service: 13.2.2
         @storybook/angular: 6.4.18
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: angular Issues related to Angular support in Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants