Open dgp1130 opened 2 years ago
In schematics CLI we don’t really configure the parser based on the schematics schema.
We could probably port this logic from the Angular CLI. (Maybe have the logic in a shared ts_libraary
) when the legacy build system is removed.
Yeah, I know minimist
doesn't work that way. We'd probably have to change argument parser to actually declare specific options with specific types based on the schematics schema for the ideal solution. Not sure if there's a simpler fix worth exploring, but it's a relatively minor bug so I'm not too worried.
Just for the record we no longer use minimist. We use yargs-parser.
Note: this would also solve https://github.com/angular/angular-cli/issues/12152
Same root cause/resolution of https://github.com/angular/angular-cli/issues/16320.
We could combine these issues.
Command
generate
Is this a regression?
The previous version in which this bug was not present was
No response
Description
From http://b/196605664.
Apparently you can't pass in a numeric value into a string argument in schematics. This appears to be interpreted as number and leads to a validation error.
Minimal Reproduction
Minimist seems to interpret "1234" as a number instead of a string, and schematics treats that as a type mismatch.
Exception or Error
No response
Your Environment
Anything else relevant?
No response