You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(migrate): keep declare module 'vite' augmentations on 'vite'
Partially reverts e29973c. Through the core alias a preserved
declare module 'vite' augmentation reaches the same
@voidzero-dev/vite-plus-core module whose UserConfig types defineConfig
from vite-plus, so it keeps working after migration. vite-plus exports
no UserConfig symbol, so the rewritten declare module 'vite-plus'
augmentation merged with nothing and silently stopped applying. Users
extending vite-plus's own surface write declare module 'vite-plus'
directly.
Restores the #2004 config-files-only scoping for all vite specifiers,
flips the regression test to assert preservation, regenerates the
migration-rewrite-declare-module snapshot, and documents the rationale
in migrate-rules.md.
Copy file name to clipboardExpand all lines: packages/cli/snap-tests-global/migration-rewrite-declare-module/snap.txt
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
> vp migrate --no-interactive # retained vitest augmentations should keep a package-local vitest
2
2
◇ Migrated . to Vite+ <semver>
3
3
• Node <semver> pnpm <semver>
4
-
• 2 config updates applied, 1 file had imports rewritten
4
+
• 2 config updates applied
5
5
6
-
> cat src/index.ts # declare module 'vite' follows the rewritten config import; 'vitest' augmentations keep the upstream identity
6
+
> cat src/index.ts # declare module 'vite'/'vitest' outside config files are preserved: through the core alias a 'vite' augmentation reaches the UserConfig that types vite-plus defineConfig, while vite-plus exports no UserConfig symbol to merge a rewritten augmentation with
7
7
import type { RuntimeEnvConfig } from './runtime.env.config.js';
8
8
import type { RuntimeHtmlConfig } from './runtime.html.config.js';
Copy file name to clipboardExpand all lines: packages/cli/snap-tests-global/migration-rewrite-declare-module/steps.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
{
2
2
"commands": [
3
3
"vp migrate --no-interactive # retained vitest augmentations should keep a package-local vitest",
4
-
"cat src/index.ts # declare module 'vite' follows the rewritten config import; 'vitest' augmentations keep the upstream identity",
4
+
"cat src/index.ts # declare module 'vite'/'vitest' outside config files are preserved: through the core alias a 'vite' augmentation reaches the UserConfig that types vite-plus defineConfig, while vite-plus exports no UserConfig symbol to merge a rewritten augmentation with",
5
5
"cat package.json # check package.json",
6
6
"cat pnpm-workspace.yaml # check pnpm-workspace.yaml has overrides and catalog"
0 commit comments