Skip to content

Generate minimal component in app, with defaultProject lib #20666

Closed
@krbaio3

Description

@krbaio3

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

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:

▶ ng g c components/authComponent --project=demo -d
CREATE projects/demo/src/app/components/auth-component/auth-component.component.ts (288 bytes)
UPDATE projects/demo/src/app/app.module.ts (516 bytes)

It is Ok.

But, If I change my defaultProject from demo to foo (library)

▶ ng g c components/authComponent --project=demo -d
CREATE projects/demo/src/app/components/auth-component/auth-component.component.css (0 bytes)
CREATE projects/demo/src/app/components/auth-component/auth-component.component.html (29 bytes)
CREATE projects/demo/src/app/components/auth-component/auth-component.component.spec.ts (676 bytes)
CREATE projects/demo/src/app/components/auth-component/auth-component.component.ts (306 bytes)
UPDATE projects/demo/src/app/app.module.ts (516 bytes)

The repository example is: https://github.com/krbaio3/bug-ng-cli.git

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions