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

feat(schematics): allow 'prefix' when creating a lib #193

Closed
wvanderdeijl opened this issue Jan 10, 2018 · 5 comments
Closed

feat(schematics): allow 'prefix' when creating a lib #193

wvanderdeijl opened this issue Jan 10, 2018 · 5 comments
Labels
community This is a good first issue for contributing outdated type: feature

Comments

@wvanderdeijl
Copy link

It would be nice if --prefix would be supported when generating a new library with ng generate lib hello --prefix hello. Currently we have instructions to add the prefix manually in the apps section of the .angular-cli.json. This allows us to have unique prefixes for all libraries.

@vsavkin vsavkin added the community This is a good first issue for contributing label Jan 21, 2018
@ball6847
Copy link

When I create a lib and then create component with --prefix

ng g lib foo-layout
ng g component layout --app=foo-layout --prefix=foo

but when i run ng lint it keep saying

The selector of the component "LayoutComponent" should have prefix "app"

I tried editing .angular-cli.json to manually set the prefix but got no luck.

It would be nice if ng g lib supports --prefix

@wvanderdeijl
Copy link
Author

The trick to making this work is to add the prefix to the generated apps section in .angular-cli.json and also adding the prefix to two tslint rules in tslint.json that have the list of allowed prefixes. Hopefully I can find the time to create a PR to add these steps to the nx schematics

@ThomasBurleson ThomasBurleson changed the title feature req: --prefix when creating a lib feat(schematics): allow 'prefix' when creating a lib Apr 6, 2018
@vsavkin
Copy link
Member

vsavkin commented May 29, 2018

It has been implemented in Nx 6. Pass --prefix when creating a library, and it will be set in the tslint.json file of that library.

@vsavkin vsavkin closed this as completed May 29, 2018
@sutin1234
Copy link

we can disabled prefix at angular.json

@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 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community This is a good first issue for contributing outdated type: feature
Projects
None yet
Development

No branches or pull requests

5 participants