-
Notifications
You must be signed in to change notification settings - Fork 12k
Regression on command line arguments parser #23397
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
Comments
Negation was always possible with boolean options even prior to version 14. This can also be seen in older versions of the docs https://v8.angular.io/cli#boolean-and-enumerated-options In this case, the option was named The correct to define that option would be "build": {
"type": "boolean",
"default": true,
"description": "Build process during deployment."
} We could add a middleware to handle options which are defined with |
From my point of view, this is a breaking change. Therefore, I would be happy if the old behaviour would be restored and a warning would be displayed. For the next version of Angular you could then drop this workaround. |
…d with `no` With this commit we introduce an interm solution for options prefixed with `no` in `schema.json` Previously, such options were handled as normal boolean option, but yargs handles options prefixed with `no` as negatations of the original option. Example with yargs, an option `noWatch` is will registered as `watch`. Closes angular#23397
…d with `no` With this commit we introduce an interim solution for options prefixed with `no` in `schema.json` Previously, such options were handled as normal boolean option, but yargs handles options prefixed with `no` as negatations of the original option. Example with yargs, an option `noWatch` is will registered as `watch`. Closes angular#23397
…xed with `no` With this commit we introduce an interim solution for options prefixed with `no` in `schema.json` Previously, such options were handled as normal boolean option, but yargs handles options prefixed with `no` as negatations of the original option. Example with yargs, an option `noWatch` is will registered as `watch`. Closes angular#23397
…xed with `no` With this commit we introduce an interim solution for options prefixed with `no` in `schema.json` Previously, such options were handled as normal boolean option, but yargs handles options prefixed with `no` as negatations of the original option. Example with yargs, an option `noWatch` is will registered as `watch`. Closes #23397
…xed with `no` With this commit we introduce an interim solution for options prefixed with `no` in `schema.json` Previously, such options were handled as normal boolean option, but yargs handles options prefixed with `no` as negatations of the original option. Example with yargs, an option `noWatch` is will registered as `watch`. Closes #23397 (cherry picked from commit ba3f671)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
This worked in v13 of the CLI
Description
We are working on updating our ng deploy schematic for Angular 14, unfortunately some command line arguments are no longer detected correctly. Arguments like
noBuild
,noSilent
,noDotFiles
no longer work, butbuildTarget
anddryRun
do. I assume this is related with #22778 and the fact that Yargs supports--no-flags
. In the past, the wordno
had no meaning, now it has one: https://github.com/yargs/yargs/blob/main/docs/tricks.md#negateIn Angular 13 i was able write
no-build
as an argument and it was used as it-is, but now this is interpreted as the negation ofbuild
– which is an unknown argument. This breaks a couple of builders that all share some code/ideas and use the same argument calledno-build
.🔬 Minimal Reproduction
Please follow our README for contributors, which is essentially:
Clone the project
git clone https://github.com/angular-schule/angular-cli-ghpages.git cd angular-cli-ghpages
Install the dependencies
cd src npm install
Build the project:
Create a local npm link:
cd dist npm link
Go to a new folder and create a fresh angular project:
Add the local version of
angular-cli-ghpages
.Now execute the
ng-add
schematic.This will work, but will complain about a missing git configuration (which is fine here)
But this will NOT work, same for all other arguments with a "no" in the name
🔥 Exception or Error
🌍 Your Environment
The text was updated successfully, but these errors were encountered: