Skip to content

Commit 1242c08

Browse files
authored
feat(deps): upgrade upstream dependencies (#810)
Automated daily upgrade of upstream dependencies: - rolldown (latest tag) - rolldown-vite (latest tag) - vitest (latest npm version) - tsdown (latest npm version) Build status: success <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Mostly dependency bumps, but it changes published `exports` surface and build-time patching around Vitest internals, which could break consumers or test behavior if upstream structure shifts again. > > **Overview** > Upgrades upstream dependencies, notably moving Vitest from `4.0.18` to `4.1.0` (including `vitest-dev` overrides) and updating the pinned `rolldown-vite` commit; `@voidzero-dev/vite-plus-core` now bundles Vite `8.0.0` (from `8.0.0-beta.18`). > > Updates the test/CLI packaging to match new Vitest module layout: removes `module-runner`/`mocker` exports, adds `runtime` and new plugin/module exports (e.g. `utils-source-map-node`, `mocker-transforms`), and extends the build-time Vitest patching to search multiple candidate files for the hoistMocks check. > > Refreshes `pnpm-lock.yaml` and CLI snapshot outputs to reflect new dependency versions and updated CLI/build output lines. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c3a38fc. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 2255532 commit 1242c08

11 files changed

Lines changed: 459 additions & 399 deletions

File tree

.github/scripts/upgrade-deps.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ async function updatePnpmWorkspace(versions) {
6161
let content = fs.readFileSync(filePath, 'utf8');
6262

6363
// Update vitest-dev override (handle pre-release versions like -beta.1, -rc.0)
64+
// Handle both quoted ('npm:vitest@^...') and unquoted (npm:vitest@^...) forms
6465
content = content.replace(
65-
/vitest-dev: 'npm:vitest@\^[\d.]+(-[\w.]+)?'/,
66+
/vitest-dev: '?npm:vitest@\^[\d.]+(-[\w.]+)?'?/,
6667
`vitest-dev: 'npm:vitest@^${versions.vitest}'`,
6768
);
6869

packages/cli/package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@
102102
"types": "./dist/test/internal/browser.d.ts",
103103
"default": "./dist/test/internal/browser.js"
104104
},
105-
"./test/internal/module-runner": {
106-
"types": "./dist/test/internal/module-runner.d.ts",
107-
"default": "./dist/test/internal/module-runner.js"
108-
},
109105
"./test/runners": {
110106
"types": "./dist/test/runners.d.ts",
111107
"default": "./dist/test/runners.js"
@@ -135,9 +131,9 @@
135131
"types": "./dist/test/snapshot.d.ts",
136132
"default": "./dist/test/snapshot.js"
137133
},
138-
"./test/mocker": {
139-
"types": "./dist/test/mocker.d.ts",
140-
"default": "./dist/test/mocker.js"
134+
"./test/runtime": {
135+
"types": "./dist/test/runtime.d.ts",
136+
"default": "./dist/test/runtime.js"
141137
},
142138
"./test/worker": {
143139
"types": "./dist/test/worker.d.ts",
@@ -205,6 +201,9 @@
205201
"./test/plugins/utils-source-map": {
206202
"default": "./dist/test/plugins/utils-source-map.js"
207203
},
204+
"./test/plugins/utils-source-map-node": {
205+
"default": "./dist/test/plugins/utils-source-map-node.js"
206+
},
208207
"./test/plugins/utils-error": {
209208
"default": "./dist/test/plugins/utils-error.js"
210209
},
@@ -262,6 +261,9 @@
262261
"./test/plugins/mocker-redirect": {
263262
"default": "./dist/test/plugins/mocker-redirect.js"
264263
},
264+
"./test/plugins/mocker-transforms": {
265+
"default": "./dist/test/plugins/mocker-transforms.js"
266+
},
265267
"./test/plugins/mocker-automock": {
266268
"default": "./dist/test/plugins/mocker-automock.js"
267269
},

packages/cli/snap-tests/build-vite-env/snap.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
> VITE_MY_VAR=1 vp run build
22
$ vp build
3+
vite v<semver> building client environment for production...
34
transforming...✓ <variable> modules transformed.
45
rendering chunks...
56
computing gzip size...
@@ -11,6 +12,7 @@ dist/assets/index-BnIqjoTZ.js <variable> kB │ gzip: <variable> kB
1112

1213
> VITE_MY_VAR=1 vp run build # should hit cache
1314
$ vp build ✓ cache hit, replaying
15+
vite v<semver> building client environment for production...
1416
transforming...✓ <variable> modules transformed.
1517
rendering chunks...
1618
computing gzip size...
@@ -24,6 +26,7 @@ vp run: cache hit, <variable>ms saved.
2426

2527
> VITE_MY_VAR=2 vp run build # env changed, should miss cache
2628
$ vp build ✗ cache miss: envs changed, executing
29+
vite v<semver> building client environment for production...
2730
transforming...✓ <variable> modules transformed.
2831
rendering chunks...
2932
computing gzip size...

packages/cli/snap-tests/command-helper/snap.txt

Lines changed: 68 additions & 62 deletions
Large diffs are not rendered by default.

packages/cli/snap-tests/synthetic-build-cache-disabled/snap.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
> vp run build # synthetic build (vp build) should have cache disabled without cacheScripts
22
$ vp build ⊘ cache disabled
3+
vite v<semver> building client environment for production...
34
transforming...✓ <variable> modules transformed.
45
rendering chunks...
56
computing gzip size...

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
"node": "^20.19.0 || >=22.12.0"
207207
},
208208
"bundledVersions": {
209-
"vite": "8.0.0-beta.18",
209+
"vite": "8.0.0",
210210
"rolldown": "1.0.0-rc.9",
211211
"tsdown": "0.21.2"
212212
}

packages/test/build.ts

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ const VITEST_PACKAGE_TO_PATH: Record<string, string> = {
9393
// @vitest/utils
9494
'@vitest/utils': '@vitest/utils/index.js',
9595
'@vitest/utils/source-map': '@vitest/utils/source-map.js',
96+
'@vitest/utils/source-map/node': '@vitest/utils/source-map/node.js',
9697
'@vitest/utils/error': '@vitest/utils/error.js',
9798
'@vitest/utils/helpers': '@vitest/utils/helpers.js',
9899
'@vitest/utils/display': '@vitest/utils/display.js',
@@ -116,6 +117,7 @@ const VITEST_PACKAGE_TO_PATH: Record<string, string> = {
116117
'@vitest/mocker/node': '@vitest/mocker/node.js',
117118
'@vitest/mocker/browser': '@vitest/mocker/browser.js',
118119
'@vitest/mocker/redirect': '@vitest/mocker/redirect.js',
120+
'@vitest/mocker/transforms': '@vitest/mocker/transforms.js',
119121
'@vitest/mocker/automock': '@vitest/mocker/automock.js',
120122
'@vitest/mocker/register': '@vitest/mocker/register.js',
121123
// @vitest/pretty-format
@@ -2171,8 +2173,11 @@ async function patchChaiTypeReference() {
21712173
async function patchMockerHoistedModule() {
21722174
console.log('\nPatching vitest mocker to recognize @voidzero-dev packages...');
21732175

2174-
const mockerPath = join(distDir, '@vitest/mocker/node.js');
2175-
let content = await readFile(mockerPath, 'utf-8');
2176+
// The hoistedModule check may be in node.js or chunk-hoistMocks.js depending on the vitest version
2177+
const candidateFiles = [
2178+
join(distDir, '@vitest/mocker/node.js'),
2179+
join(distDir, '@vitest/mocker/chunk-hoistMocks.js'),
2180+
];
21762181

21772182
// Find and replace the hoistedModule check
21782183
// Original: if (hoistedModule === source) {
@@ -2181,17 +2186,29 @@ async function patchMockerHoistedModule() {
21812186
const newCheck =
21822187
'if (hoistedModule === source || source === "vite-plus/test" || source === "@voidzero-dev/vite-plus-test") {';
21832188

2184-
if (!content.includes(originalCheck)) {
2189+
let patched = false;
2190+
for (const candidatePath of candidateFiles) {
2191+
let content: string;
2192+
try {
2193+
content = await readFile(candidatePath, 'utf-8');
2194+
} catch {
2195+
continue;
2196+
}
2197+
if (content.includes(originalCheck)) {
2198+
content = content.replace(originalCheck, newCheck);
2199+
await writeFile(candidatePath, content, 'utf-8');
2200+
console.log(` Patched hoistMocks to recognize @voidzero-dev packages in ${candidatePath}`);
2201+
patched = true;
2202+
break;
2203+
}
2204+
}
2205+
2206+
if (!patched) {
21852207
throw new Error(
21862208
'Could not find hoistedModule check to patch in @vitest/mocker. ' +
21872209
'This likely means vitest code has changed and the patch needs to be updated.',
21882210
);
21892211
}
2190-
2191-
content = content.replace(originalCheck, newCheck);
2192-
2193-
await writeFile(mockerPath, content, 'utf-8');
2194-
console.log(' Patched hoistMocks to recognize @voidzero-dev packages');
21952212
}
21962213

21972214
/**
@@ -2216,7 +2233,8 @@ async function createPluginExports() {
22162233
continue;
22172234
}
22182235
// Convert @vitest/runner -> runner, @vitest/utils/error -> utils-error
2219-
const exportName = pkg.replace('@vitest/', '').replace('/', '-');
2236+
// @vitest/utils/source-map/node -> utils-source-map-node
2237+
const exportName = pkg.replace('@vitest/', '').replaceAll('/', '-');
22202238
const shimFileName = `${exportName}.mjs`;
22212239
const shimPath = join(pluginsDir, shimFileName);
22222240

packages/test/package.json

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"#module-evaluator": {
2020
"types": "./dist/module-evaluator.d.ts",
2121
"default": "./dist/module-evaluator.js"
22-
}
22+
},
23+
"#nodejs-worker-loader": "./dist/nodejs-worker-loader.js"
2324
},
2425
"exports": {
2526
".": {
@@ -62,10 +63,6 @@
6263
"types": "./dist/browser.d.ts",
6364
"default": "./dist/browser.js"
6465
},
65-
"./internal/module-runner": {
66-
"types": "./dist/module-runner.d.ts",
67-
"default": "./dist/module-runner.js"
68-
},
6966
"./runners": {
7067
"types": "./dist/runners.d.ts",
7168
"default": "./dist/runners.js"
@@ -95,9 +92,9 @@
9592
"types": "./dist/snapshot.d.ts",
9693
"default": "./dist/snapshot.js"
9794
},
98-
"./mocker": {
99-
"types": "./dist/mocker.d.ts",
100-
"default": "./dist/mocker.js"
95+
"./runtime": {
96+
"types": "./dist/runtime.d.ts",
97+
"default": "./dist/runtime.js"
10198
},
10299
"./worker": {
103100
"types": "./worker.d.ts",
@@ -165,6 +162,9 @@
165162
"./plugins/utils-source-map": {
166163
"default": "./dist/plugins/utils-source-map.mjs"
167164
},
165+
"./plugins/utils-source-map-node": {
166+
"default": "./dist/plugins/utils-source-map-node.mjs"
167+
},
168168
"./plugins/utils-error": {
169169
"default": "./dist/plugins/utils-error.mjs"
170170
},
@@ -222,6 +222,9 @@
222222
"./plugins/mocker-redirect": {
223223
"default": "./dist/plugins/mocker-redirect.mjs"
224224
},
225+
"./plugins/mocker-transforms": {
226+
"default": "./dist/plugins/mocker-transforms.mjs"
227+
},
225228
"./plugins/mocker-automock": {
226229
"default": "./dist/plugins/mocker-automock.mjs"
227230
},
@@ -265,27 +268,29 @@
265268
"pixelmatch": "^7.1.0",
266269
"pngjs": "^7.0.0",
267270
"sirv": "^3.0.2",
268-
"std-env": "^3.10.0",
271+
"std-env": "^4.0.0",
269272
"tinybench": "^2.9.0",
270273
"tinyexec": "^1.0.2",
271274
"tinyglobby": "^0.2.15",
272275
"ws": "^8.18.3"
273276
},
274277
"devDependencies": {
278+
"@blazediff/core": "1.9.1",
275279
"@oxc-node/cli": "catalog:",
276280
"@oxc-node/core": "catalog:",
277-
"@vitest/browser": "4.0.18",
278-
"@vitest/browser-playwright": "4.0.18",
279-
"@vitest/browser-preview": "4.0.18",
280-
"@vitest/browser-webdriverio": "4.0.18",
281-
"@vitest/expect": "4.0.18",
282-
"@vitest/mocker": "4.0.18",
283-
"@vitest/pretty-format": "4.0.18",
284-
"@vitest/runner": "4.0.18",
285-
"@vitest/snapshot": "4.0.18",
286-
"@vitest/spy": "4.0.18",
287-
"@vitest/utils": "4.0.18",
281+
"@vitest/browser": "4.1.0",
282+
"@vitest/browser-playwright": "4.1.0",
283+
"@vitest/browser-preview": "4.1.0",
284+
"@vitest/browser-webdriverio": "4.1.0",
285+
"@vitest/expect": "4.1.0",
286+
"@vitest/mocker": "4.1.0",
287+
"@vitest/pretty-format": "4.1.0",
288+
"@vitest/runner": "4.1.0",
289+
"@vitest/snapshot": "4.1.0",
290+
"@vitest/spy": "4.1.0",
291+
"@vitest/utils": "4.1.0",
288292
"chai": "^6.2.1",
293+
"convert-source-map": "^2.0.0",
289294
"estree-walker": "^3.0.3",
290295
"expect-type": "^1.2.2",
291296
"magic-string": "^0.30.21",
@@ -296,16 +301,17 @@
296301
"rolldown": "workspace:*",
297302
"rolldown-plugin-dts": "catalog:",
298303
"tinyrainbow": "^3.0.3",
299-
"vitest-dev": "^4.0.18",
304+
"vitest-dev": "^4.1.0",
300305
"why-is-node-running": "^2.3.0"
301306
},
302307
"peerDependencies": {
303308
"@edge-runtime/vm": "*",
304309
"@opentelemetry/api": "^1.9.0",
305310
"@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
306-
"@vitest/ui": "4.0.18",
311+
"@vitest/ui": "4.1.0",
307312
"happy-dom": "*",
308-
"jsdom": "*"
313+
"jsdom": "*",
314+
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0-0"
309315
},
310316
"peerDependenciesMeta": {
311317
"@edge-runtime/vm": {
@@ -325,12 +331,15 @@
325331
},
326332
"jsdom": {
327333
"optional": true
334+
},
335+
"vite": {
336+
"optional": false
328337
}
329338
},
330339
"engines": {
331340
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
332341
},
333342
"bundledVersions": {
334-
"vitest": "4.0.18"
343+
"vitest": "4.1.0"
335344
}
336345
}

packages/tools/.upstream-versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"rolldown-vite": {
88
"repo": "https://github.com/vitejs/vite.git",
99
"branch": "main",
10-
"hash": "1ee5372e80c23be3c17cf6d09d58c25ccd62531f"
10+
"hash": "b565af6f1123a62b3058253b2147574b8515e89f"
1111
}
1212
}

0 commit comments

Comments
 (0)