Skip to content

Commit f10170d

Browse files
committed
test(snap): add pnpm-workspace.yaml output to standalone migration snap tests
Print pnpm-workspace.yaml contents in all standalone pnpm migration snap tests so the overrides and catalog info previously visible in package.json is still captured in the snapshots.
1 parent 92afbdd commit f10170d

110 files changed

Lines changed: 1060 additions & 51 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.

packages/cli/snap-tests-global/migration-add-git-hooks/snap.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@ VITE+ - The Unified Toolchain for the Web
2020
}
2121
}
2222

23+
> cat pnpm-workspace.yaml # check pnpm-workspace.yaml has overrides and catalog
24+
catalog:
25+
vite: npm:@voidzero-dev/vite-plus-core@latest
26+
vitest: npm:@voidzero-dev/vite-plus-test@latest
27+
vite-plus: latest
28+
overrides:
29+
vite: 'catalog:'
30+
vitest: 'catalog:'
31+
peerDependencyRules:
32+
allowAny:
33+
- vite
34+
- vitest
35+
allowedVersions:
36+
vite: '*'
37+
vitest: '*'
38+
2339
> cat .vite-hooks/pre-commit # check pre-commit hook
2440
vp staged
2541

packages/cli/snap-tests-global/migration-add-git-hooks/steps.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"commands": [
3-
{ "command": "git init", "ignoreOutput": true },
3+
{
4+
"command": "git init",
5+
"ignoreOutput": true
6+
},
47
"vp migrate --no-interactive # migration should add git hooks setup",
58
"cat package.json # check package.json has prepare script and lint-staged config",
9+
"cat pnpm-workspace.yaml # check pnpm-workspace.yaml has overrides and catalog",
610
"cat .vite-hooks/pre-commit # check pre-commit hook",
711
"test -d .vite-hooks/_ && echo 'hook shims exist' || echo 'no hook shims' # check vp config ran",
812
"git config --local core.hooksPath # should be set to .vite-hooks/_",

packages/cli/snap-tests-global/migration-auto-create-vite-config/snap.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,19 @@ export default defineConfig({
4242
"prepare": "vp config"
4343
}
4444
}
45+
46+
> cat pnpm-workspace.yaml # check pnpm-workspace.yaml has overrides and catalog
47+
catalog:
48+
vite: npm:@voidzero-dev/vite-plus-core@latest
49+
vitest: npm:@voidzero-dev/vite-plus-test@latest
50+
vite-plus: latest
51+
overrides:
52+
vite: 'catalog:'
53+
vitest: 'catalog:'
54+
peerDependencyRules:
55+
allowAny:
56+
- vite
57+
- vitest
58+
allowedVersions:
59+
vite: '*'
60+
vitest: '*'

packages/cli/snap-tests-global/migration-auto-create-vite-config/steps.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"cat vite.config.ts # check vite.config.ts",
55
"test ! -f .oxlintrc.json # check .oxlintrc.json is removed",
66
"test ! -f .oxfmtrc.json # check .oxfmtrc.json is removed",
7-
"cat package.json # check package.json"
7+
"cat package.json # check package.json",
8+
"cat pnpm-workspace.yaml # check pnpm-workspace.yaml has overrides and catalog"
89
]
910
}

packages/cli/snap-tests-global/migration-baseurl-tsconfig/snap.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,19 @@ export default defineConfig({
3535
"prepare": "vp config"
3636
}
3737
}
38+
39+
> cat pnpm-workspace.yaml # check pnpm-workspace.yaml has overrides and catalog
40+
catalog:
41+
vite: npm:@voidzero-dev/vite-plus-core@latest
42+
vitest: npm:@voidzero-dev/vite-plus-test@latest
43+
vite-plus: latest
44+
overrides:
45+
vite: 'catalog:'
46+
vitest: 'catalog:'
47+
peerDependencyRules:
48+
allowAny:
49+
- vite
50+
- vitest
51+
allowedVersions:
52+
vite: '*'
53+
vitest: '*'
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"commands": [
33
"vp migrate --no-interactive # migration should skip typeAware/typeCheck when tsconfig has baseUrl",
4-
"cat vite.config.ts # check vite.config.ts should NOT have typeAware or typeCheck",
4+
"cat vite.config.ts # check vite.config.ts \u2014 should NOT have typeAware or typeCheck",
55
"test ! -f .oxlintrc.json # check .oxlintrc.json is removed",
6-
"cat package.json # check package.json"
6+
"cat package.json # check package.json",
7+
"cat pnpm-workspace.yaml # check pnpm-workspace.yaml has overrides and catalog"
78
]
89
}

packages/cli/snap-tests-global/migration-chained-lint-staged-pre-commit/snap.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@ VITE+ - The Unified Toolchain for the Web
2020
"packageManager": "pnpm@<semver>"
2121
}
2222

23+
> cat pnpm-workspace.yaml # check pnpm-workspace.yaml has overrides and catalog
24+
catalog:
25+
vite: npm:@voidzero-dev/vite-plus-core@latest
26+
vitest: npm:@voidzero-dev/vite-plus-test@latest
27+
vite-plus: latest
28+
overrides:
29+
vite: 'catalog:'
30+
vitest: 'catalog:'
31+
peerDependencyRules:
32+
allowAny:
33+
- vite
34+
- vitest
35+
allowedVersions:
36+
vite: '*'
37+
vitest: '*'
38+
2339
> cat vite.config.ts # check staged config migrated to vite.config.ts
2440
import { defineConfig } from 'vite-plus';
2541

packages/cli/snap-tests-global/migration-chained-lint-staged-pre-commit/steps.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"commands": [
3-
{ "command": "git init", "ignoreOutput": true },
3+
{
4+
"command": "git init",
5+
"ignoreOutput": true
6+
},
47
"vp migrate --no-interactive # migration should preserve chained commands after lint-staged",
58
"cat package.json # check prepare rewritten and husky/lint-staged removed",
9+
"cat pnpm-workspace.yaml # check pnpm-workspace.yaml has overrides and catalog",
610
"cat vite.config.ts # check staged config migrated to vite.config.ts",
711
"cat .vite-hooks/pre-commit # check npx lint-staged replaced but --diff HEAD~1 && npm test preserved"
812
]

packages/cli/snap-tests-global/migration-composed-husky-custom-dir/snap.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@ VITE+ - The Unified Toolchain for the Web
2020
"packageManager": "pnpm@<semver>"
2121
}
2222

23+
> cat pnpm-workspace.yaml # check pnpm-workspace.yaml has overrides and catalog
24+
catalog:
25+
vite: npm:@voidzero-dev/vite-plus-core@latest
26+
vitest: npm:@voidzero-dev/vite-plus-test@latest
27+
vite-plus: latest
28+
overrides:
29+
vite: 'catalog:'
30+
vitest: 'catalog:'
31+
peerDependencyRules:
32+
allowAny:
33+
- vite
34+
- vitest
35+
allowedVersions:
36+
vite: '*'
37+
vitest: '*'
38+
2339
> cat .config/husky/pre-commit # pre-commit hook should be in custom dir
2440
vp staged
2541

packages/cli/snap-tests-global/migration-composed-husky-custom-dir/steps.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"commands": [
3-
{ "command": "git init", "ignoreOutput": true },
3+
{
4+
"command": "git init",
5+
"ignoreOutput": true
6+
},
47
"vp migrate --no-interactive # migration should preserve custom husky dir in composed prepare",
58
"cat package.json # prepare should be 'vp config --hooks-dir .config/husky && npm run build'",
9+
"cat pnpm-workspace.yaml # check pnpm-workspace.yaml has overrides and catalog",
610
"cat .config/husky/pre-commit # pre-commit hook should be in custom dir",
711
"cat .config/husky/_/h # hook dispatcher should resolve repo root correctly for nested dirs"
812
]

0 commit comments

Comments
 (0)