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

fix(@angular/cli): use correct schematic defaults considering workspace #15041

Merged
merged 1 commit into from
Jul 16, 2019

Conversation

mgechev
Copy link
Member

@mgechev mgechev commented Jul 10, 2019

Fix #14986

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

We were registering redundant addPostTransforms. 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 mgechev force-pushed the minko/fix-schematics branch 4 times, most recently from 833b495 to a1d3501 Compare July 12, 2019 01:59
@mgechev mgechev marked this pull request as ready for review July 12, 2019 02:00
@mgechev mgechev added the target: patch This PR is targeted for the next patch release label Jul 12, 2019
@mgechev mgechev force-pushed the minko/fix-schematics branch from a1d3501 to 6edcb94 Compare July 12, 2019 02:48
@mgechev mgechev added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Jul 12, 2019
@mgechev mgechev force-pushed the minko/fix-schematics branch 2 times, most recently from ffbef51 to e67470b Compare July 12, 2019 03:04
@alan-agius4 alan-agius4 requested a review from clydin July 15, 2019 16:52
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 mgechev force-pushed the minko/fix-schematics branch from b89fad9 to a21d38a Compare July 16, 2019 04:01
@@ -6,6 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
// tslint:disable:no-implicit-dependencies
import { schema } from '@angular-devkit/core';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: unused import?

Copy link
Member

@clydin clydin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should also fix a variety of other open issues regarding defaults not being used for some schematics.

@mgechev mgechev merged commit d274add into angular:master Jul 16, 2019
@mgechev mgechev deleted the minko/fix-schematics branch July 16, 2019 16:58
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 3, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 3, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 3, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 3, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 3, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 3, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 3, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 3, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 3, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 5, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 5, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 5, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 5, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 6, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 6, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 6, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 6, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 6, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
brandonroberts added a commit to brandonroberts/nx that referenced this pull request Sep 6, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
vsavkin pushed a commit to nrwl/nx that referenced this pull request Sep 7, 2019
Incorporates fix from angular/angular-cli#15041
which changed the behavior of registering schematic defaults
@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 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"module" schematic does not respect style setting for "component"
4 participants