Skip to content

ng add options, other than --help, are not supported #13479

Closed
@timsitzer

Description

@timsitzer

🐞 Bug report

Command (mark with an x)

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

Is this a regression?

No

Description

The ng add command does not support listed options, other than '--help'.

V6 of the CLI didn't support any options, beyond help, with add. After a little investigation into the code, it appears the add.json schema was updated to utilize the schematic definitions from definitions.json but it doesn't appear that add-impl.ts was fully updated to support them.

From what I can tell, with my limited exploration into the code, add-impl.ts has hard-coded values for dryRun and force within the defined "runOptions" object. I am currently unaware of a package that utilizes interactive prompts so I could not validate if the defaults or interactive options are working or not but I do not see any additional interrogation of options object to look for them either.

🔬 Minimal Reproduction

ng new my-app --defaults
cd my-app
ng add --help
ng add @angular/pwa --dry-run

Since this package performs modifications, I would have expected to see a listing of those changes with the typical "dryRun" message.

🔥 Exception or Error





🌍 Your Environment




Angular CLI: 7.2.2
Node: 10.15.0
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.12.2
@angular-devkit/core         7.2.2
@angular-devkit/schematics   7.2.2
@schematics/angular          7.2.2
@schematics/update           0.12.2
rxjs                         6.3.3
typescript                   3.2.2

Anything else relevant?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions