-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Generate minimal component in app, with defaultProject lib #20666
Comments
Hi @krbaio3, \this is because minimal only effects application projects. It is important to mention that minimal projects only meant to be used for testing / prototyping and are to be considered as throw away projects. What is the user-case here to have minimal respected in a library project? |
Hi @alan-agius4,, My intention is to make a library and then, a minimal project with a small example (demo) of how to use it. This way, I avoid having in the demo everything related to testing, linter, etc., since it is just that, a small example. I understand that I may be wrong, but I like to have inside the projects folder the library, and separately, in another folder, the demo of using the library. Thank you very much! |
Hi @krbaio3, Thanks for getting back, however the above doesn't answer my question to why you need a library project to support the That said, you can use disable these either by passing the following CLI arguments This can be done by using
More information about these options can be found https://angular.io/cli/generate#component-command |
Hi!, My demo project has this config: ▶ ng config projects.demo.schematics
{
"@schematics/angular:component": {
"inlineTemplate": true,
"inlineStyle": true,
"style": "scss",
"skipTests": true
},
"@schematics/angular:class": {
"skipTests": true
},
"@schematics/angular:directive": {
"skipTests": true
},
"@schematics/angular:guard": {
"skipTests": true
},
"@schematics/angular:interceptor": {
"skipTests": true
},
"@schematics/angular:module": {
"skipTests": true
},
"@schematics/angular:pipe": {
"skipTests": true
},
"@schematics/angular:service": {
"skipTests": true
}
} and my library has this config: ▶ ng config projects.auth
{
"projectType": "library",
"schematics": {
"@schematics/angular:component": {
"inlineTemplate": true,
"inlineStyle": true,
"style": "scss",
"skipTests": true
}
},
"root": "projects/auth",
"sourceRoot": "projects/auth/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/auth/tsconfig.lib.json",
"project": "projects/auth/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/auth/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/auth/src/test.ts",
"tsConfig": "projects/auth/tsconfig.spec.json",
"karmaConfig": "projects/auth/karma.conf.js"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"projects/auth/**/*.ts",
"projects/auth/**/*.html"
]
}
}
}
} My minimal project is "demo". That is, I build my library with my logic, and I want to use it in my demo project. The demo project is an example of using the library. The --minimal flag is in the demo project, not the library. My main project is the library, so I change the defaultProject from demo to auth. When I generate the components like this: |
@krbaio3, thanks for the above explanation. Managed to find the issue. |
…roject` Previously, the `--project` flag was ignored when gathering and merging the schematics defaults from the angular workspace configuration file. Closes #20666
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Yes, the previous version in which this bug was not present was: ....Description
When I generate a component, with
--minimal
( inlineTemplate, inlineStyle, skipTests => true, style: scss), it is generated with test, template and css.🔬 Minimal Reproduction
I created a NG app with
ng new bug-ng-cli --create-application false --strict false
.I run
ng add @angular-eslint/schematics
I run
ng g application demo --minimal --minimal --routing --style scss
I run
ng g @angular-eslint/schematics:convert-tslint-to-eslint --remove-tslint-if-no-more-tslint-targets --ignore-existing-tslint-config demo
I run
ng g library foo
If i run:
It is Ok.
But, If I change my defaultProject from demo to foo (library)
The repository example is: https://github.com/krbaio3/bug-ng-cli.git
Thanks!
The text was updated successfully, but these errors were encountered: