Skip to content

Commit fbfc9eb

Browse files
committed
fix(pm): default to pnpm without prompting
1 parent f7bcb03 commit fbfc9eb

20 files changed

Lines changed: 133 additions & 277 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[[case]]
2+
name = "command_dlx_no_package_json"
3+
vp = "global"
4+
serial = true
5+
skip-platforms = ["windows"]
6+
steps = [
7+
{ argv = ["vp", "dlx", "-s", "cowsay", "hello"], comment = "should work without package.json", continue-on-failure = true },
8+
]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# command_dlx_no_package_json
2+
3+
## `vp dlx -s cowsay hello`
4+
5+
should work without package.json
6+
7+
```
8+
_______
9+
< hello >
10+
-------
11+
\ ^__^
12+
\ (oo)\_______
13+
(__)\ )\/\
14+
||----w |
15+
|| ||
16+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[[case]]
2+
name = "command_info_no_package_json"
3+
vp = ["local", "global"]
4+
local-registry = true
5+
steps = [
6+
{ argv = ["vp", "info", "vite@2.0.0", "version"], comment = "should work without package.json", continue-on-failure = true },
7+
{ argv = ["vp", "pm", "view", "vite@2.0.0", "version"], comment = "should work without package.json", continue-on-failure = true },
8+
]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# command_info_no_package_json
2+
3+
## `vp info vite@2.0.0 version`
4+
5+
should work without package.json
6+
7+
```
8+
2.0.0
9+
```
10+
11+
## `vp pm view vite@2.0.0 version`
12+
13+
should work without package.json
14+
15+
```
16+
2.0.0
17+
```
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# command_info_no_package_json
2+
3+
## `vp info vite@2.0.0 version`
4+
5+
should work without package.json
6+
7+
```
8+
2.0.0
9+
```
10+
11+
## `vp pm view vite@2.0.0 version`
12+
13+
should work without package.json
14+
15+
```
16+
2.0.0
17+
```

crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_vpx_no_package_json/snapshots.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,5 @@ serial = true
55
local-registry = true
66
skip-platforms = ["windows"]
77
steps = [
8-
{ argv = ["vpx", "-s", "cowsay", "hello"], comment = "default to pnpm without prompting outside a project", continue-on-failure = true },
9-
{ argv = ["vp", "info", "vite@2.0.0", "version"], comment = "registry queries also run without prompting", continue-on-failure = true },
10-
["vpt", "stat-file", "package.json", "--assert", "missing"],
8+
{ argv = ["vpx", "-s", "cowsay", "hello"], comment = "should work without package.json", continue-on-failure = true },
119
]

crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_vpx_no_package_json/snapshots/command_vpx_no_package_json.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## `vpx -s cowsay hello`
44

5-
default to pnpm without prompting outside a project
5+
should work without package.json
66

77
```
88
_______
@@ -14,17 +14,3 @@ default to pnpm without prompting outside a project
1414
||----w |
1515
|| ||
1616
```
17-
18-
## `vp info vite@2.0.0 version`
19-
20-
registry queries also run without prompting
21-
22-
```
23-
2.0.0
24-
```
25-
26-
## `vpt stat-file package.json --assert missing`
27-
28-
```
29-
package.json: missing
30-
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name":"install-package-manager-default","private":true}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[[case]]
2+
name = "install_package_manager_default"
3+
vp = ["local", "global"]
4+
comment = "An unconfigured project installs with pnpm without prompting or pinning the manager."
5+
steps = [
6+
["vp", "install", "--lockfile-only"],
7+
["vpt", "stat-file", "pnpm-lock.yaml", "--assert", "file"],
8+
["vpt", "print-file", "package.json"],
9+
]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# install_package_manager_default
2+
3+
An unconfigured project installs with pnpm without prompting or pinning the manager.
4+
5+
## `vp install --lockfile-only`
6+
7+
```
8+
VITE+ - The Unified Toolchain for the Web
9+
10+
Done in <duration> using pnpm <version>
11+
```
12+
13+
## `vpt stat-file pnpm-lock.yaml --assert file`
14+
15+
```
16+
pnpm-lock.yaml: file
17+
```
18+
19+
## `vpt print-file package.json`
20+
21+
```
22+
{"name":"install-package-manager-default","private":true}
23+
```

0 commit comments

Comments
 (0)