Skip to content

Commit 15bd3e6

Browse files
committed
docs(rfcs): update bun command mappings for PR review fixes
- dlx: bun supports --package flag (before package spec) - install: bun supports --lockfile-only - outdated: bun supports --production and --omit optional - pm-command-group: view uses native `bun info` instead of npm fallback
1 parent 052e465 commit 15bd3e6

6 files changed

Lines changed: 18 additions & 33 deletions

File tree

packages/cli/snap-tests-global/command-view-bun/snap.txt

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,8 @@ Options:
1717
Documentation: https://viteplus.dev/guide/install
1818

1919

20-
> vp pm view testnpm2 # should view package information
21-
testnpm2@<semver> | ISC | deps: 0 | versions: 2
22-
23-
24-
dist
20+
> vp pm view testnpm2 | grep 'registry' # should view package information
2521
.tarball: https://registry.<domain>/testnpm2/-/testnpm2-1.0.1.tgz
26-
.shasum: <hash>
27-
.integrity: sha512-<hash>
28-
29-
dist-tags:
30-
latest: <semver>
31-
release-1: <semver>
32-
33-
maintainers:
34-
- fengmk2 <fengmk2@gmail.com>
35-
36-
Published: <date>T<date>.560Z
3722

3823
> vp pm view testnpm2 version # should view version field
3924
1.0.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"commands": [
33
"vp pm view --help # should show help",
4-
"vp pm view testnpm2 # should view package information",
4+
"vp pm view testnpm2 | grep 'registry' # should view package information",
55
"vp pm view testnpm2 version # should view version field"
66
]
77
}

rfcs/dlx-command.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ vp dlx -p typescript -p @types/node -c 'tsc --init && node -e "console.log(123)"
106106
- yarn: https://yarnpkg.com/cli/dlx
107107
- bun: https://bun.sh/docs/pm/bunx
108108

109-
| Vite+ Flag | pnpm | npm | yarn@1 | yarn@2+ | bun | Description |
110-
| ------------------------------- | ------------------ | ------------------- | ----------- | ---------------- | ------------- | -------------------------- |
111-
| `vp dlx <pkg>` | `pnpm dlx <pkg>` | `npm exec <pkg>` | `npx <pkg>` | `yarn dlx <pkg>` | `bun x <pkg>` | Execute package binary |
112-
| `--package <name>`, `-p <name>` | `--package <name>` | `--package=<name>` | N/A | `-p <name>` | N/A | Specify package to install |
113-
| `--shell-mode`, `-c` | `-c` | `-c` | N/A | N/A | N/A | Execute in shell |
114-
| `--silent`, `-s` | `--silent` | `--loglevel silent` | `--quiet` | `--quiet` | N/A | Suppress output |
109+
| Vite+ Flag | pnpm | npm | yarn@1 | yarn@2+ | bun | Description |
110+
| ------------------------------- | ------------------ | ------------------- | ----------- | ---------------- | ------------------ | -------------------------- |
111+
| `vp dlx <pkg>` | `pnpm dlx <pkg>` | `npm exec <pkg>` | `npx <pkg>` | `yarn dlx <pkg>` | `bun x <pkg>` | Execute package binary |
112+
| `--package <name>`, `-p <name>` | `--package <name>` | `--package=<name>` | N/A | `-p <name>` | `--package <name>` | Specify package to install |
113+
| `--shell-mode`, `-c` | `-c` | `-c` | N/A | N/A | N/A | Execute in shell |
114+
| `--silent`, `-s` | `--silent` | `--loglevel silent` | `--quiet` | `--quiet` | N/A | Suppress output |
115115

116116
**Notes:**
117117

@@ -120,7 +120,7 @@ vp dlx -p typescript -p @types/node -c 'tsc --init && node -e "console.log(123)"
120120
- **Shell mode**: Yarn 2+ does not support shell mode (`-c`), command will print a warning and try to execute anyway.
121121
- **--package flag position**: For pnpm, `--package` comes before `dlx`. For npm, `--package` can be anywhere. For yarn, `-p` comes after `dlx`.
122122
- **Auto-confirm prompts**: For npm and npx (yarn@1 fallback), `--yes` is automatically added to align with pnpm's behavior which doesn't require confirmation.
123-
- **bun**: Uses `bun x` subcommand (preferred over the `bunx` standalone binary for better cross-platform compatibility). It does not support `--package`, `--shell-mode`, or `--silent` flags.
123+
- **bun**: Uses `bun x` subcommand (preferred over the `bunx` standalone binary for better cross-platform compatibility). It supports `--package` but does not support `--shell-mode` or `--silent` flags. The `--package` flag must come before the package spec.
124124

125125
### Argument Handling
126126

@@ -894,7 +894,7 @@ Examples:
894894
| ----------------- | ------- | ------- | ------- | ------- | ---------- | ------------------------- |
895895
| Basic execution | ✅ Full | ✅ Full | ⚠️ npx | ✅ Full | ✅ `bun x` | yarn@1 uses npx fallback |
896896
| Version specifier | ✅ Full | ✅ Full | ⚠️ npx | ✅ Full | ✅ Full | |
897-
| --package flag | ✅ Full | ✅ Full | ⚠️ npx | ✅ Full | ❌ N/A | `bun x` doesn't support |
897+
| --package flag | ✅ Full | ✅ Full | ⚠️ npx | ✅ Full | ✅ Full | |
898898
| Shell mode (-c) | ✅ Full | ✅ Full | ⚠️ npx | ❌ N/A | ❌ N/A | yarn@2+/bun don't support |
899899
| Silent mode | ✅ Full | ✅ Full | ⚠️ npx | ✅ Full | ❌ N/A | `bun x` doesn't support |
900900
| Auto-confirm | ✅ N/A | ✅ Auto | ⚠️ Auto | ✅ N/A | ✅ N/A | --yes added for npm/npx |

rfcs/install-command.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ vp install --filter app # Install for specific package
131131
| `--no-optional` | `--no-optional` | `--ignore-optional` | N/A | `--omit=optional` | `--omit optional` | Skip optionalDependencies |
132132
| `--frozen-lockfile` | `--frozen-lockfile` | `--frozen-lockfile` | `--immutable` | `ci` (use `npm ci`) | `--frozen-lockfile` | Fail if lockfile outdated |
133133
| `--no-frozen-lockfile` | `--no-frozen-lockfile` | `--no-frozen-lockfile` | `--no-immutable` | `install` (not `ci`) | `--no-frozen-lockfile` | Allow lockfile updates |
134-
| `--lockfile-only` | `--lockfile-only` | N/A | `--mode update-lockfile` | `--package-lock-only` | N/A | Only update lockfile |
134+
| `--lockfile-only` | `--lockfile-only` | N/A | `--mode update-lockfile` | `--package-lock-only` | `--lockfile-only` | Only update lockfile |
135135
| `--prefer-offline` | `--prefer-offline` | `--prefer-offline` | N/A | `--prefer-offline` | N/A | Prefer cached packages |
136136
| `--offline` | `--offline` | `--offline` | N/A | `--offline` | N/A | Only use cache |
137137
| `--force, -f` | `--force` | `--force` | N/A | `--force` | `--force` | Force reinstall |
@@ -1014,7 +1014,7 @@ This is a new feature with no breaking changes:
10141014
| `--no-optional` | ✅ | ✅ | ⚠️ | ✅ | ✅ | yarn@2+ needs .yarnrc.yml |
10151015
| `--frozen-lockfile` | ✅ | ✅ | ✅ `--immutable` | ✅ `ci` | ✅ | npm uses `npm ci` |
10161016
| `--no-frozen-lockfile` | ✅ | ✅ | ✅ `--no-immutable` | ✅ `install` | ✅ | Pass through to PM |
1017-
| `--lockfile-only` | ✅ | ❌ | ✅ | ✅ | | yarn@1, bun not supported |
1017+
| `--lockfile-only` | ✅ | ❌ | ✅ | ✅ | | yarn@1 not supported |
10181018
| `--prefer-offline` | ✅ | ✅ | ❌ | ✅ | ❌ | yarn@2+, bun not supported |
10191019
| `--offline` | ✅ | ✅ | ❌ | ✅ | ❌ | yarn@2+, bun not supported |
10201020
| `--force` | ✅ | ✅ | ❌ | ✅ | ✅ | yarn@2+ not supported |

rfcs/outdated-package-command.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ vite outdated -g # Check globally installed packages
161161
| `-r, --recursive` | `-r, --recursive` | `--all` | N/A | N/A | `-r` / `--recursive` | Check across all workspaces |
162162
| `--filter <pattern>` | `--filter <pattern>` | `--workspace <pattern>` | N/A | N/A | `--filter` / `-F` | Target specific workspace |
163163
| `-w, --workspace-root` | `-w, --workspace-root` | `--include-workspace-root` | N/A | N/A | N/A | Include workspace root |
164-
| `-P, --prod` | `-P, --prod` | N/A | N/A | N/A | N/A | Only production dependencies (pnpm-specific) |
164+
| `-P, --prod` | `-P, --prod` | N/A | N/A | N/A | `--production` | Only production dependencies |
165165
| `-D, --dev` | `-D, --dev` | N/A | N/A | N/A | N/A | Only dev dependencies (pnpm-specific) |
166-
| `--no-optional` | `--no-optional` | N/A | N/A | N/A | N/A | Exclude optional dependencies (pnpm-specific) |
166+
| `--no-optional` | `--no-optional` | N/A | N/A | N/A | `--omit optional` | Exclude optional dependencies |
167167
| `--compatible` | `--compatible` | N/A | N/A | N/A | N/A | Only show compatible versions (pnpm-specific) |
168168
| `--sort-by <field>` | `--sort-by <field>` | N/A | N/A | N/A | N/A | Sort results by field (pnpm-specific) |
169169
| `-g, --global` | `-g, --global` | `-g, --global` | N/A | N/A | N/A | Check globally installed packages |
@@ -175,7 +175,7 @@ vite outdated -g # Check globally installed packages
175175
- yarn@1 accepts package names but limited filtering options
176176
- yarn@2+ uses interactive mode (`upgrade-interactive`) instead of traditional `outdated`
177177
- pnpm has the most comprehensive filtering and output options
178-
- bun supports `--filter` / `-F` for workspace filtering and `-r` / `--recursive` for checking across all workspaces
178+
- bun supports `--filter` / `-F` for workspace filtering, `-r` / `--recursive` for checking across all workspaces, `--production` for production-only, and `--omit optional` for excluding optional dependencies
179179
- bun does not support JSON output format (`--format json`)
180180

181181
### Outdated Behavior Differences Across Package Managers

rfcs/pm-command-group.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -921,13 +921,13 @@ Bun provides several `bun pm` subcommands that may not have direct equivalents i
921921

922922
| Vite+ Flag | pnpm | npm | yarn@1 | yarn@2+ | bun | Description |
923923
| ------------ | ---------- | ---------- | ---------- | ---------- | ---------- | ----------------- |
924-
| `vp pm view` | `npm view` | `npm view` | `npm view` | `npm view` | `npm view` | View package info |
924+
| `vp pm view` | `npm view` | `npm view` | `npm view` | `npm view` | `bun info` | View package info |
925925
| `--json` | `--json` | `--json` | `--json` | `--json` | `--json` | JSON output |
926926

927927
**Note:**
928928

929-
- All package managers delegate to `npm view` for viewing package information
930-
- pnpm and yarn both use npm's view/info functionality internally
929+
- pnpm and yarn delegate to `npm view` for viewing package information
930+
- bun has a native `bun info` command for viewing package information
931931
- Aliases: `vp pm info` and `vp pm show` work the same as `vp pm view`
932932

933933
#### Publish Command

0 commit comments

Comments
 (0)