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

add package-lock modes to query and audit #6732

Merged
merged 2 commits into from
Sep 11, 2023
Merged

Conversation

wraithgar
Copy link
Member

  • feat: add package-lock-only mode to npm query
  • feat: add no-package-lock mode to npm audit

@wraithgar wraithgar requested a review from a team as a code owner August 24, 2023 15:45
@wraithgar
Copy link
Member Author

Folks have been asking for this for a LONG time (the audit feature), this should definitely be backported to npm 9.

@npm-cli-bot
Copy link
Collaborator

npm-cli-bot commented Aug 24, 2023

found 18 benchmarks with statistically significant performance improvements

  • app-large: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
  • app-medium: cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
timing results
app-large clean lock-only cache-only cache-only
peer-deps
modules-only no-lock no-cache no-modules no-clean no-clean
audit
show-version run-script
npm@9 35.348 ±2.17 18.932 ±0.13 18.377 ±0.17 21.134 ±0.98 2.949 ±0.14 2.844 ±0.04 2.424 ±0.07 12.404 ±0.15 2.383 ±0.02 3.518 ±0.15 0.420 ±0.01 0.465 ±0.01
#6732 0.100 ±0.00 0.103 ±0.01 0.100 ±0.00 0.100 ±0.00 0.103 ±0.00 0.109 ±0.01 0.102 ±0.00 0.102 ±0.00 0.106 ±0.01 0.103 ±0.00 0.412 ±0.00 0.462 ±0.01
app-medium clean lock-only cache-only cache-only
peer-deps
modules-only no-lock no-cache no-modules no-clean no-clean
audit
show-version run-script
npm@9 24.474 ±1.27 14.102 ±0.08 13.704 ±0.01 14.704 ±0.08 2.567 ±0.02 2.565 ±0.00 2.346 ±0.02 9.200 ±0.03 2.213 ±0.02 3.159 ±0.10 0.417 ±0.01 0.469 ±0.00
#6732 N/A N/A 0.102 ±0.00 0.104 ±0.00 0.101 ±0.00 0.104 ±0.00 0.102 ±0.00 0.104 ±0.00 0.102 ±0.00 0.103 ±0.00 0.413 ±0.01 0.456 ±0.00

Copy link
Contributor

@bdehamer bdehamer left a comment

Choose a reason for hiding this comment

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

For the query command, I noticed that you added the loadVirtual support to the exec function, but not the execWorkspaces function. Was that an oversight, or does the --package-lock-only option not work when using workspaces?

@wraithgar
Copy link
Member Author

That's an oversight. A lot of other commands' execWorkspaces just iterate workspaces and call exec directly. I'll update.

@wraithgar
Copy link
Member Author

Workspaces mode for npm query does not work as expected to begin with and I think adding this mode there gives a false sense of it working. Fixing npm query for workspace mode should be a separate PR.

@wraithgar wraithgar merged commit 81a460f into latest Sep 11, 2023
35 of 38 checks passed
@wraithgar wraithgar deleted the gar/query-package-lock branch September 11, 2023 18:29
@github-actions github-actions bot mentioned this pull request Sep 11, 2023
@lorand-horvath
Copy link

NICE !

ljharb added a commit to ljharb/aud that referenced this pull request Jul 31, 2024
Thanks for npm/cli#6732 !
@ljharb
Copy link
Contributor

ljharb commented Jul 31, 2024

Thanks for this; I've now end-of-lifed https://npmjs.com/aud since it's no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants