Skip to content

"module" schematic does not respect style setting for "component" #14986

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

Closed
fmalcher opened this issue Jul 3, 2019 · 2 comments · Fixed by #15041
Closed

"module" schematic does not respect style setting for "component" #14986

fmalcher opened this issue Jul 3, 2019 · 2 comments · Fixed by #15041

Comments

@fmalcher
Copy link
Contributor

fmalcher commented Jul 3, 2019

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

No, because this is about a newly introduced feature.

Description

When generating a new module with lazy loading by

ng g m admin --route admin --module app

it will also generate a component within the new module.
However, the style for this component is always css, even if we have this setting in our angular.json:

"schematics": {
  "@schematics/angular:component": {
    "style": "scss"
  }
},

🔬 Minimal Reproduction

ng new my-app --style=scss --routing
ng g m admin --route admin --module app

Newly generated AdminComponent will have a admin.component.css instead of scss.

🌍 Your Environment


Angular CLI: 8.1.0
Node: 10.15.1
OS: darwin x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.801.0
@angular-devkit/core         8.1.0
@angular-devkit/schematics   8.1.0
@schematics/angular          8.1.0
@schematics/update           0.801.0
rxjs                         6.4.0

@JosepAlacid
Copy link

Maybe I should open a new issue, but I think it could be a clue.
generating a component doesn't respect skipTests option on schematics...

mgechev added a commit to mgechev/angular-cli that referenced this issue Jul 12, 2019
Fix angular#14986

This PR includes some refactoring to simplify the interaction
of the `NodeWorkflow` and the `BaseWorkflow` with the registry.

We were registering redundant `addPostTransform`s. Some of them in
the constructor of the `BaseWorkflow`, which did not allow us to
intercept `addUndefinedDefaults`.

Additionally, we were setting the `validateOptionsWithSchema` transform
multiple times unnecessarily.

An issue left to fix is support for the `--project` option in
schematic commands. Currently, `getProjectName` does not know about
this option, since `createWorkflow` does not know how to parse the
command line arguments. The parsing logic is implemented partially
by the concrete implementation of the `SchematicCommand` template
method.
mgechev added a commit to mgechev/angular-cli that referenced this issue Jul 12, 2019
Fix angular#14986

This PR includes some refactoring to simplify the interaction
of the `NodeWorkflow` and the `BaseWorkflow` with the registry.

We were registering redundant `addPostTransform`s. Some of them in
the constructor of the `BaseWorkflow`, which did not allow us to
intercept `addUndefinedDefaults`.

Additionally, we were setting the `validateOptionsWithSchema` transform
multiple times unnecessarily.

An issue left to fix is support for the `--project` option in
schematic commands. Currently, `getProjectName` does not know about
this option, since `createWorkflow` does not know how to parse the
command line arguments. The parsing logic is implemented partially
by the concrete implementation of the `SchematicCommand` template
method.
mgechev added a commit to mgechev/angular-cli that referenced this issue Jul 12, 2019
Fix angular#14986

This PR includes some refactoring to simplify the interaction
of the `NodeWorkflow` and the `BaseWorkflow` with the registry.

We were registering redundant `addPostTransform`s. Some of them in
the constructor of the `BaseWorkflow`, which did not allow us to
intercept `addUndefinedDefaults`.

Additionally, we were setting the `validateOptionsWithSchema` transform
multiple times unnecessarily.

An issue left to fix is support for the `--project` option in
schematic commands. Currently, `getProjectName` does not know about
this option, since `createWorkflow` does not know how to parse the
command line arguments. The parsing logic is implemented partially
by the concrete implementation of the `SchematicCommand` template
method.
mgechev added a commit to mgechev/angular-cli that referenced this issue Jul 12, 2019
Fix angular#14986

This PR includes some refactoring to simplify the interaction
of the `NodeWorkflow` and the `BaseWorkflow` with the registry.

We were registering redundant `addPostTransform`s. Some of them in
the constructor of the `BaseWorkflow`, which did not allow us to
intercept `addUndefinedDefaults`.

Additionally, we were setting the `validateOptionsWithSchema` transform
multiple times unnecessarily.

An issue left to fix is support for the `--project` option in
schematic commands. Currently, `getProjectName` does not know about
this option, since `createWorkflow` does not know how to parse the
command line arguments. The parsing logic is implemented partially
by the concrete implementation of the `SchematicCommand` template
method.
mgechev added a commit to mgechev/angular-cli that referenced this issue Jul 16, 2019
Fix angular#14986

This PR includes some refactoring to simplify the interaction
of the `NodeWorkflow` and the `BaseWorkflow` with the registry.

We were registering redundant `addPostTransform`s. Some of them in
the constructor of the `BaseWorkflow`, which did not allow us to
intercept `addUndefinedDefaults`.

Additionally, we were setting the `validateOptionsWithSchema` transform
multiple times unnecessarily.

An issue left to fix is support for the `--project` option in
schematic commands. Currently, `getProjectName` does not know about
this option, since `createWorkflow` does not know how to parse the
command line arguments. The parsing logic is implemented partially
by the concrete implementation of the `SchematicCommand` template
method.
mgechev added a commit that referenced this issue Jul 16, 2019
…ce (#15041)

Fix #14986

This PR includes some refactoring to simplify the interaction
of the `NodeWorkflow` and the `BaseWorkflow` with the registry.

We were registering redundant `addPostTransform`s. Some of them in
the constructor of the `BaseWorkflow`, which did not allow us to
intercept `addUndefinedDefaults`.

Additionally, we were setting the `validateOptionsWithSchema` transform
multiple times unnecessarily.

An issue left to fix is support for the `--project` option in
schematic commands. Currently, `getProjectName` does not know about
this option, since `createWorkflow` does not know how to parse the
command line arguments. The parsing logic is implemented partially
by the concrete implementation of the `SchematicCommand` template
method.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.