File tree Expand file tree Collapse file tree
packages/cli/snap-tests-global
command-config-prepare-auto-hooks
migration-lint-staged-merge-fail
migration-lintstagedrc-merge-fail Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,3 +15,17 @@ export default defineConfig({
1515 },
1616
1717});
18+
19+ > vp config # run again to ensure idempotent
20+ > cat .vite-hooks/pre-commit # should remain unchanged
21+ vp staged
22+
23+ > cat vite.config.ts # should remain unchanged
24+ import { defineConfig } from 'vite-plus';
25+
26+ export default defineConfig({
27+ staged: {
28+ "*": "vp check --fix"
29+ },
30+
31+ });
Original file line number Diff line number Diff line change 77 " vp config # should install hooks automatically without prompting" ,
88 " git config --local core.hooksPath # should be .vite-hooks/_" ,
99 " cat .vite-hooks/pre-commit # should have vp staged" ,
10- " cat vite.config.ts # should have staged config"
10+ " cat vite.config.ts # should have staged config" ,
11+ " vp config # run again to ensure idempotent" ,
12+ " cat .vite-hooks/pre-commit # should remain unchanged" ,
13+ " cat vite.config.ts # should remain unchanged"
1114 ]
1215}
Original file line number Diff line number Diff line change @@ -4,16 +4,19 @@ VITE+ - The Unified Toolchain for the Web
44
55◇ Migrated . to Vite+<repeat>
66• Node <semver> pnpm <semver>
7- • Git hooks configured
87! Warnings:
98 - Failed to merge staged config into vite.config.ts
9+ - Git hooks not configured — Failed to merge staged config into vite.config.ts
10+
11+ Please add staged config to vite.config.ts manually, see https://viteplus.dev/guide/migrate#lint-staged
1012→ Manual follow-up:
1113 - Please add staged config to vite.config.ts manually, see https://viteplus.dev/guide/migrate#lint-staged
1214
1315> cat package.json # lint-staged config should be preserved when merge fails
1416{
1517 "name": "migration-lint-staged-merge-fail",
1618 "devDependencies": {
19+ "lint-staged": "^16.2.6",
1720 "vite": "npm:@voidzero-dev/vite-plus-core@latest",
1821 "vite-plus": "latest"
1922 },
@@ -37,4 +40,4 @@ const config = { plugins: [] };
3740module.exports = config;
3841
3942> test -f .vite-hooks/pre-commit && echo 'pre-commit hook exists' || echo 'no pre-commit hook' # should NOT exist when merge fails
40- no pre-commit hook
43+ pre-commit hook exists
Original file line number Diff line number Diff line change @@ -4,16 +4,19 @@ VITE+ - The Unified Toolchain for the Web
44
55◇ Migrated . to Vite+<repeat>
66• Node <semver> pnpm <semver>
7- • Git hooks configured
87! Warnings:
98 - Failed to merge staged config into vite.config.ts
9+ - Git hooks not configured — Failed to merge staged config into vite.config.ts
10+
11+ Please add staged config to vite.config.ts manually, see https://viteplus.dev/guide/migrate#lint-staged
1012→ Manual follow-up:
1113 - Please add staged config to vite.config.ts manually, see https://viteplus.dev/guide/migrate#lint-staged
1214
1315> cat package.json # check package.json
1416{
1517 "name": "migration-lintstagedrc-merge-fail",
1618 "devDependencies": {
19+ "lint-staged": "^16.2.6",
1720 "vite": "npm:@voidzero-dev/vite-plus-core@latest",
1821 "vite-plus": "latest"
1922 },
@@ -39,4 +42,4 @@ const config = { plugins: [] };
3942module.exports = config;
4043
4144> test -f .vite-hooks/pre-commit && echo 'pre-commit hook exists' || echo 'no pre-commit hook' # should NOT exist when merge fails
42- no pre-commit hook
45+ pre-commit hook exists
You can’t perform that action at this time.
0 commit comments