Skip to content

Commit 155a35d

Browse files
committed
test(snap): add pnpm v11 snap tests for command adaptation coverage
Add 26 snap test cases for pnpm@11.0.0-beta.6, mirroring the existing pnpm10 test suite, to ensure command adaptation stability as pnpm v11 approaches release. Notable differences captured: - link/unlink fails with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH - `pnpm why` output format restructured - `packageManagerDependencies` now appear in install output - cache, dlx, owner, view, vpx output remain identical
1 parent f1f6016 commit 155a35d

99 files changed

Lines changed: 3767 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "command-add-pnpm11-with-workspace",
3+
"version": "1.0.0",
4+
"packageManager": "pnpm@11.0.0-beta.6"
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "app"
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "@vite-plus-test/utils",
3+
"version": "1.0.0",
4+
"private": true
5+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
packages:
2+
- packages/*
Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
> vp add testnpm2 -D -w && cat package.json # should add package to workspace root
2+
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
3+
4+
dependencies:
5+
+ @pnpm/exe <semver>
6+
+ pnpm <semver>
7+
8+
Packages: +<variable>
9+
+<repeat>
10+
Done in <variable>ms using pnpm v<semver>
11+
{
12+
"name": "command-add-pnpm11-with-workspace",
13+
"version": "1.0.0",
14+
"packageManager": "pnpm@<semver>
15+
"devDependencies": {
16+
"testnpm2": "^1.0.1"
17+
}
18+
}
19+
20+
> vp add @vite-plus-test/utils --workspace && cat package.json # should add @vite-plus-test/utils to workspace root
21+
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
22+
23+
dependencies:
24+
+ @vite-plus-test/utils workspace:*
25+
26+
Already up to date
27+
Done in <variable>ms using pnpm v<semver>
28+
{
29+
"name": "command-add-pnpm11-with-workspace",
30+
"version": "1.0.0",
31+
"packageManager": "pnpm@<semver>
32+
"devDependencies": {
33+
"testnpm2": "^1.0.1"
34+
},
35+
"dependencies": {
36+
"@vite-plus-test/utils": "workspace:*"
37+
}
38+
}
39+
40+
> vp add testnpm2 test-vite-plus-install@1.0.0 --filter app && cat package.json packages/app/package.json packages/utils/package.json # should add packages to packages/app
41+
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
42+
. | +1 +<repeat>
43+
Done in <variable>ms using pnpm v<semver>
44+
{
45+
"name": "command-add-pnpm11-with-workspace",
46+
"version": "1.0.0",
47+
"packageManager": "pnpm@<semver>
48+
"devDependencies": {
49+
"testnpm2": "^1.0.1"
50+
},
51+
"dependencies": {
52+
"@vite-plus-test/utils": "workspace:*"
53+
}
54+
}
55+
{
56+
"name": "app",
57+
"dependencies": {
58+
"test-vite-plus-install": "1.0.0",
59+
"testnpm2": "^1.0.1"
60+
}
61+
}
62+
{
63+
"name": "@vite-plus-test/utils",
64+
"version": "1.0.0",
65+
"private": true
66+
}
67+
68+
> vp add @vite-plus-test/utils --workspace --filter app && cat package.json packages/app/package.json packages/utils/package.json # should add @vite-plus-test/utils to packages/app
69+
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
70+
Done in <variable>ms using pnpm v<semver>
71+
{
72+
"name": "command-add-pnpm11-with-workspace",
73+
"version": "1.0.0",
74+
"packageManager": "pnpm@<semver>
75+
"devDependencies": {
76+
"testnpm2": "^1.0.1"
77+
},
78+
"dependencies": {
79+
"@vite-plus-test/utils": "workspace:*"
80+
}
81+
}
82+
{
83+
"name": "app",
84+
"dependencies": {
85+
"@vite-plus-test/utils": "workspace:*",
86+
"test-vite-plus-install": "1.0.0",
87+
"testnpm2": "^1.0.1"
88+
}
89+
}
90+
{
91+
"name": "@vite-plus-test/utils",
92+
"version": "1.0.0",
93+
"private": true
94+
}
95+
96+
> vp add -E testnpm2 test-vite-plus-install --filter "*" && cat package.json packages/app/package.json packages/utils/package.json # should add testnpm2 test-vite-plus-install to all packages except workspace root
97+
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
98+
Done in <variable>ms using pnpm v<semver>
99+
{
100+
"name": "command-add-pnpm11-with-workspace",
101+
"version": "1.0.0",
102+
"packageManager": "pnpm@<semver>
103+
"devDependencies": {
104+
"testnpm2": "^1.0.1"
105+
},
106+
"dependencies": {
107+
"@vite-plus-test/utils": "workspace:*",
108+
"test-vite-plus-install": "1.0.0"
109+
}
110+
}
111+
{
112+
"name": "app",
113+
"dependencies": {
114+
"@vite-plus-test/utils": "workspace:*",
115+
"test-vite-plus-install": "1.0.0",
116+
"testnpm2": "^1.0.1"
117+
}
118+
}
119+
{
120+
"name": "@vite-plus-test/utils",
121+
"version": "1.0.0",
122+
"private": true,
123+
"dependencies": {
124+
"test-vite-plus-install": "1.0.0",
125+
"testnpm2": "^1.0.1"
126+
}
127+
}
128+
129+
> vp install test-vite-plus-package@1.0.0 --filter "*" --workspace-root --save-catalog && cat package.json packages/app/package.json packages/utils/package.json pnpm-workspace.yaml # should install packages alias for add command
130+
VITE+ - The Unified Toolchain for the Web
131+
132+
. | +1 +<repeat>
133+
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
134+
Done in <variable>ms using pnpm v<semver>
135+
{
136+
"name": "command-add-pnpm11-with-workspace",
137+
"version": "1.0.0",
138+
"packageManager": "pnpm@<semver>
139+
"devDependencies": {
140+
"testnpm2": "^1.0.1"
141+
},
142+
"dependencies": {
143+
"@vite-plus-test/utils": "workspace:*",
144+
"test-vite-plus-install": "1.0.0",
145+
"test-vite-plus-package": "catalog:"
146+
}
147+
}
148+
{
149+
"name": "app",
150+
"dependencies": {
151+
"@vite-plus-test/utils": "workspace:*",
152+
"test-vite-plus-install": "1.0.0",
153+
"test-vite-plus-package": "catalog:",
154+
"testnpm2": "^1.0.1"
155+
}
156+
}
157+
{
158+
"name": "@vite-plus-test/utils",
159+
"version": "1.0.0",
160+
"private": true,
161+
"dependencies": {
162+
"test-vite-plus-install": "1.0.0",
163+
"test-vite-plus-package": "catalog:",
164+
"testnpm2": "^1.0.1"
165+
}
166+
}
167+
packages:
168+
- packages/*
169+
catalog:
170+
test-vite-plus-package: <semver>
171+
172+
> vp add --filter app test-vite-plus-package-optional --save-catalog-name v1 && cat packages/app/package.json pnpm-workspace.yaml # should add with save-catalog-name
173+
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
174+
. | +1 +<repeat>
175+
Done in <variable>ms using pnpm v<semver>
176+
{
177+
"name": "app",
178+
"dependencies": {
179+
"@vite-plus-test/utils": "workspace:*",
180+
"test-vite-plus-install": "1.0.0",
181+
"test-vite-plus-package": "catalog:",
182+
"test-vite-plus-package-optional": "catalog:v1",
183+
"testnpm2": "^1.0.1"
184+
}
185+
}
186+
packages:
187+
- packages/*
188+
catalog:
189+
test-vite-plus-package: <semver>
190+
catalogs:
191+
v1:
192+
test-vite-plus-package-optional: ^1.0.0
193+
194+
> vp add --filter=./packages/utils test-vite-plus-package-optional -O --save-catalog-name v2 && cat packages/utils/package.json pnpm-workspace.yaml # should add other with save-catalog-name
195+
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
196+
Done in <variable>ms using pnpm v<semver>
197+
{
198+
"name": "@vite-plus-test/utils",
199+
"version": "1.0.0",
200+
"private": true,
201+
"dependencies": {
202+
"test-vite-plus-install": "1.0.0",
203+
"test-vite-plus-package": "catalog:",
204+
"testnpm2": "^1.0.1"
205+
},
206+
"optionalDependencies": {
207+
"test-vite-plus-package-optional": "catalog:v2"
208+
}
209+
}
210+
packages:
211+
- packages/*
212+
catalog:
213+
test-vite-plus-package: <semver>
214+
catalogs:
215+
v1:
216+
test-vite-plus-package-optional: ^1.0.0
217+
v2:
218+
test-vite-plus-package-optional: ^1.0.0
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"ignoredPlatforms": ["win32"],
3+
"commands": [
4+
"vp add testnpm2 -D -w && cat package.json # should add package to workspace root",
5+
"vp add @vite-plus-test/utils --workspace && cat package.json # should add @vite-plus-test/utils to workspace root",
6+
"vp add testnpm2 test-vite-plus-install@1.0.0 --filter app && cat package.json packages/app/package.json packages/utils/package.json # should add packages to packages/app",
7+
"vp add @vite-plus-test/utils --workspace --filter app && cat package.json packages/app/package.json packages/utils/package.json # should add @vite-plus-test/utils to packages/app",
8+
"vp add -E testnpm2 test-vite-plus-install --filter \"*\" && cat package.json packages/app/package.json packages/utils/package.json # should add testnpm2 test-vite-plus-install to all packages except workspace root",
9+
"vp install test-vite-plus-package@1.0.0 --filter \"*\" --workspace-root --save-catalog && cat package.json packages/app/package.json packages/utils/package.json pnpm-workspace.yaml # should install packages alias for add command",
10+
"vp add --filter app test-vite-plus-package-optional --save-catalog-name v1 && cat packages/app/package.json pnpm-workspace.yaml # should add with save-catalog-name",
11+
"vp add --filter=./packages/utils test-vite-plus-package-optional -O --save-catalog-name v2 && cat packages/utils/package.json pnpm-workspace.yaml # should add other with save-catalog-name"
12+
]
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "command-add-pnpm11",
3+
"version": "1.0.0",
4+
"packageManager": "pnpm@11.0.0-beta.6"
5+
}

0 commit comments

Comments
 (0)