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(nx): npm scripts documentation generation #1568

Closed
wants to merge 1 commit into from

Conversation

BuckyMaler
Copy link
Contributor

@BuckyMaler BuckyMaler commented Jul 7, 2019

Before, a single instance of yargs was accumulating options, so commands parsed later would have options from prior commands. That's because all yargs options are global by default. Now, a new instance of yargs is required before each command is parsed, so global options aren't accumulated.

I initially added global: false to all options in nx-commands.ts, but that didn't work because some yargs methods such as implies set globals. Since options being global doesn't seem to be an issue except with the docs gen, I chose to make the change there.

👉 lint-files, update, update:check, and update:skip now only document help and version because the docs are based on yargs options and those commands don't have specific yargs options. How would you like to handle these? We can leave them as is, filter them out, or add code to the docs gen to handle them? Removing them makes sense to me since lint-files and update:skip aren't npm scripts, and update and update:check are handled by Angular CLI.

fixes #1567 #1535

@vsavkin
Copy link
Member

vsavkin commented Jul 7, 2019

Thank you for your work on this!

update, update:check, and update:skip

I'd leave them as is

@BuckyMaler BuckyMaler force-pushed the fix-docs-gen branch 2 times, most recently from cb920b6 to b811ad7 Compare July 8, 2019 05:15
Before, a single instance of yargs was accumulating options, so commands parsed later would have options from prior commands. That's because all yargs options are global by default. Now, a new instance of yargs is required before each command is parsed, so global options aren't accumulated.

fixes nrwl#1567
@vsavkin
Copy link
Member

vsavkin commented Aug 6, 2019

Rebased and merged it here: #1690

Thank you!

@vsavkin vsavkin closed this Aug 6, 2019
@BuckyMaler BuckyMaler deleted the fix-docs-gen branch November 29, 2019 23:37
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npm scripts documentation is incorrect
2 participants