-
Notifications
You must be signed in to change notification settings - Fork 192
feat(pm): add vp pm approve-builds subcommand
#1662
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
Draft
fengmk2
wants to merge
6
commits into
main
Choose a base branch
from
feat/pm-approve-builds
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3e82e10
feat(pm): add `vp pm approve-builds` subcommand
fengmk2 9da36c7
fix(pm): rename `unparseable` to `unparsable` (typos CI)
fengmk2 7fc5b2e
fix(pm): use `ignore-scripts=true` in yarn v1 hint
fengmk2 d5fb0c8
fix(pm): address PR review findings on approve-builds
fengmk2 e01ace8
refactor(pm): use node-semver Range for approve-builds version gates
fengmk2 7d975a4
fix(snap-tests): regenerate bun + no-package-json snaps; add pnpm11 f…
fengmk2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| pub mod add; | ||
| pub mod approve_builds; | ||
| pub mod audit; | ||
| pub mod cache; | ||
| pub mod config; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/cli/snap-tests-global/command-pm-approve-builds-bun/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "command-pm-approve-builds-bun", | ||
| "version": "1.0.0", | ||
| "packageManager": "bun@1.3.11" | ||
| } |
25 changes: 25 additions & 0 deletions
25
packages/cli/snap-tests-global/command-pm-approve-builds-bun/snap.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| > vp pm approve-builds --help # should show help with --all caveat | ||
| Usage: vp pm approve-builds [OPTIONS] [PACKAGES]... [-- <PASS_THROUGH_ARGS>...] | ||
|
|
||
| Approve dependency lifecycle scripts (install/postinstall) to run | ||
|
|
||
| Arguments: | ||
| [PACKAGES]... Packages to approve. Prefix with `!` to deny (pnpm >= <semver> only). Omit to launch interactive mode (pnpm only) | ||
| [PASS_THROUGH_ARGS]... Additional arguments to pass through to the package manager | ||
|
|
||
| Options: | ||
| --all Approve every package currently pending approval (pnpm >= <semver>). Mutually exclusive with positional packages | ||
| -h, --help Print help | ||
|
|
||
| Documentation: https://viteplus.dev/guide/install | ||
|
|
||
|
|
||
| > vp pm approve-builds # bun no-args: prints contextual note, exit 0 | ||
| note: bun pm trust requires package names. Run `bun pm untrusted` to see which packages are pending, then pass them explicitly: `vp pm approve-builds <pkg> [<pkg>...]` or `vp pm approve-builds --all`. | ||
|
|
||
| > vp pm approve-builds '!core-js' # deny-only: prints deny warn, no redundant note | ||
| warn: bun does not support denylisting build scripts. Packages outside `trustedDependencies` in package.json are already denied by default. Skipping: core-js | ||
|
|
||
| [1]> vp pm approve-builds --all # forwards bun pm trust --all (errors on empty project — no lockfile) | ||
| bun pm trust v<semver> (<hash>) | ||
| error: Lockfile not found |
9 changes: 9 additions & 0 deletions
9
packages/cli/snap-tests-global/command-pm-approve-builds-bun/steps.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "ignoredPlatforms": ["win32"], | ||
| "commands": [ | ||
| "vp pm approve-builds --help # should show help with --all caveat", | ||
| "vp pm approve-builds # bun no-args: prints contextual note, exit 0", | ||
| "vp pm approve-builds '!core-js' # deny-only: prints deny warn, no redundant note", | ||
| "vp pm approve-builds --all # forwards bun pm trust --all (errors on empty project — no lockfile)" | ||
| ] | ||
| } |
5 changes: 5 additions & 0 deletions
5
packages/cli/snap-tests-global/command-pm-approve-builds-pnpm10-old/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "command-pm-approve-builds-pnpm10-old", | ||
| "version": "1.0.0", | ||
| "packageManager": "pnpm@10.31.0" | ||
| } |
8 changes: 8 additions & 0 deletions
8
packages/cli/snap-tests-global/command-pm-approve-builds-pnpm10-old/snap.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| [1]> vp pm approve-builds --all # pnpm 10.31.0 < 10.32.0 → rejected with friendly UserMessage (no `error:` prefix) | ||
| `--all` requires pnpm >= <semver>. Upgrade pnpm or pass package names explicitly. | ||
|
|
||
| [1]> vp pm approve-builds esbuild '!core-js' # pnpm 10.31.0 < 11.0.0 → !pkg deny syntax rejected | ||
| `!<pkg>` deny syntax requires pnpm >= <semver>. Upgrade pnpm or omit the `!` entries. | ||
|
|
||
| > vp pm approve-builds esbuild # plain positional still works on old pnpm | ||
| There are no packages awaiting approval |
7 changes: 7 additions & 0 deletions
7
packages/cli/snap-tests-global/command-pm-approve-builds-pnpm10-old/steps.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "commands": [ | ||
| "vp pm approve-builds --all # pnpm 10.31.0 < 10.32.0 → rejected with friendly UserMessage (no `error:` prefix)", | ||
| "vp pm approve-builds esbuild '!core-js' # pnpm 10.31.0 < 11.0.0 → !pkg deny syntax rejected", | ||
| "vp pm approve-builds esbuild # plain positional still works on old pnpm" | ||
| ] | ||
| } |
6 changes: 6 additions & 0 deletions
6
packages/cli/snap-tests-global/command-pm-approve-builds-pnpm11/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "name": "command-pm-approve-builds-pnpm11", | ||
| "version": "1.0.0", | ||
| "private": true, | ||
| "packageManager": "pnpm@11.0.0" | ||
| } |
5 changes: 5 additions & 0 deletions
5
packages/cli/snap-tests-global/command-pm-approve-builds-pnpm11/snap.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| > vp pm approve-builds --all # forwards pnpm approve-builds --all (nothing to approve) | ||
| There are no packages awaiting approval | ||
|
|
||
| > vp pm approve-builds esbuild '!core-js' # pnpm 11.x supports !pkg deny syntax — forwarded as positional args | ||
| There are no packages awaiting approval |
6 changes: 6 additions & 0 deletions
6
packages/cli/snap-tests-global/command-pm-approve-builds-pnpm11/steps.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "commands": [ | ||
| "vp pm approve-builds --all # forwards pnpm approve-builds --all (nothing to approve)", | ||
| "vp pm approve-builds esbuild '!core-js' # pnpm 11.x supports !pkg deny syntax — forwarded as positional args" | ||
| ] | ||
| } |
6 changes: 6 additions & 0 deletions
6
packages/cli/snap-tests-global/command-pm-approve-builds-yarn4/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "name": "command-pm-approve-builds-yarn4", | ||
| "version": "1.0.0", | ||
| "private": true, | ||
| "packageManager": "yarn@4.10.3" | ||
| } |
9 changes: 9 additions & 0 deletions
9
packages/cli/snap-tests-global/command-pm-approve-builds-yarn4/snap.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| > vp pm approve-builds # yarn Berry warn — points at dependenciesMeta["<pkg>"].built | ||
| warn: yarn does not run third-party build scripts by default. To allow a package, set `dependenciesMeta["<package>"].built: true` in package.json. | ||
|
|
||
| > vp pm approve-builds esbuild # same warn (no native command on yarn) | ||
| warn: yarn does not run third-party build scripts by default. To allow a package, set `dependenciesMeta["<package>"].built: true` in package.json. | ||
|
|
||
| > vp pm approve-builds esbuild -- --silent # extras trigger the dropped-pass-through warn | ||
| warn: yarn does not run third-party build scripts by default. To allow a package, set `dependenciesMeta["<package>"].built: true` in package.json. | ||
| warn: Ignoring pass-through args (--silent): this package manager has no native approve-builds command to forward them to. |
8 changes: 8 additions & 0 deletions
8
packages/cli/snap-tests-global/command-pm-approve-builds-yarn4/steps.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "ignoredPlatforms": ["win32"], | ||
| "commands": [ | ||
| "vp pm approve-builds # yarn Berry warn — points at dependenciesMeta[\"<pkg>\"].built", | ||
| "vp pm approve-builds esbuild # same warn (no native command on yarn)", | ||
| "vp pm approve-builds esbuild -- --silent # extras trigger the dropped-pass-through warn" | ||
| ] | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.