@voidzero-dev/vite-plus-core 1.0.0-rc.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE +29 -176
  2. package/dist/rolldown/cli.mjs +9 -8
  3. package/dist/rolldown/config.d.mts +1 -1
  4. package/dist/rolldown/config.mjs +2 -2
  5. package/dist/rolldown/experimental-index.d.mts +4 -4
  6. package/dist/rolldown/experimental-index.mjs +8 -8
  7. package/dist/rolldown/experimental-runtime-types.d.ts +25 -6
  8. package/dist/rolldown/experimental-runtime.d.ts +25 -6
  9. package/dist/rolldown/experimental-runtime.mjs +267 -255
  10. package/dist/rolldown/filter-index.d.mts +1 -1
  11. package/dist/rolldown/index.d.mts +3 -3
  12. package/dist/rolldown/index.mjs +4 -4
  13. package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
  14. package/dist/rolldown/parallel-plugin.d.mts +1 -1
  15. package/dist/rolldown/parse-ast-index.d.mts +1 -1
  16. package/dist/rolldown/parse-ast-index.mjs +1 -1
  17. package/dist/rolldown/plugins-index.d.mts +3 -3
  18. package/dist/rolldown/plugins-index.mjs +2 -2
  19. package/dist/rolldown/shared/{binding-BY0qR5iS.mjs → binding-B4m_2rFW.mjs} +27 -28
  20. package/dist/rolldown/shared/{binding-BTa6BPQe.d.mts → binding-tzp6Hc_3.d.mts} +1 -1
  21. package/dist/rolldown/shared/{bindingify-input-options-B8JHmN6_.mjs → bindingify-input-options-YtcpaV3r.mjs} +196 -13
  22. package/dist/rolldown/shared/{constructors-DuOq7MqW.d.mts → constructors-CGQ9ItSV.d.mts} +2 -2
  23. package/dist/rolldown/shared/{constructors-xEvVj3lN.mjs → constructors-DDRbtWM1.mjs} +1 -1
  24. package/dist/rolldown/shared/{create-bundler-option-COco-7P6.mjs → create-bundler-option-CFtx335R.mjs} +17 -8
  25. package/dist/rolldown/shared/{define-config-C7HCoqY8.d.mts → define-config-kIZKjX8Q.d.mts} +72 -2
  26. package/dist/rolldown/shared/{error-C7pxws0W.mjs → error-Bj1xBdEY.mjs} +2 -1
  27. package/dist/rolldown/shared/{load-config-DkUBnDsI.mjs → load-config-CiFPv7UH.mjs} +2 -2
  28. package/dist/rolldown/shared/{normalize-string-or-regex-F14uvr6D.mjs → normalize-string-or-regex-xyy0kCQR.mjs} +1 -1
  29. package/dist/rolldown/shared/{parse-BWeE7Vr9.mjs → parse-Zii6QoPp.mjs} +2 -2
  30. package/dist/rolldown/shared/{resolve-tsconfig-DHwpIs5e.mjs → resolve-tsconfig-DRWFAQ3v.mjs} +2 -2
  31. package/dist/rolldown/shared/{rolldown-Bue0gNT5.mjs → rolldown-BCQsxZbq.mjs} +4 -4
  32. package/dist/rolldown/shared/{transform-DK_nCt9j.d.mts → transform-D4RDjIPI.d.mts} +1 -1
  33. package/dist/rolldown/shared/{watch-RXhXN1aG.mjs → watch-CXhrnblH.mjs} +4 -4
  34. package/dist/rolldown/utils-index.d.mts +3 -3
  35. package/dist/rolldown/utils-index.mjs +5 -5
  36. package/dist/tsdown/{build-JVmLFaZt-DRlLhpV3.js → build-JVmLFaZt-k6Y-YuG9.js} +8 -8
  37. package/dist/tsdown/{debug-CpC4hV25-C-OYr2iI.js → debug-CpC4hV25-D_60QWpz.js} +2 -2
  38. package/dist/tsdown/{detect-Bg-d8iUV-Du8LljhG.js → detect-Bg-d8iUV--_V5C4Db.js} +1 -1
  39. package/dist/tsdown/{dist-VDcV1Qyy.js → dist-DquISSoY.js} +8 -8
  40. package/dist/tsdown/index-types.d.ts +5 -5
  41. package/dist/tsdown/index.js +4 -4
  42. package/dist/tsdown/{require-BbBF8Ii0-BDaWJgzA.js → require-BbBF8Ii0-S6Y65RhW.js} +1 -1
  43. package/dist/tsdown/{resolver-DE0_sy8o-Bi3xbRxi.js → resolver-DE0_sy8o-Pz8aksn9.js} +2 -2
  44. package/dist/tsdown/run.js +3 -3
  45. package/dist/tsdown/{target-DgdLrXba-DpO9JXxB.js → target-DgdLrXba-BygiKCU8.js} +3 -3
  46. package/dist/tsdown/{tsc-BLb4pSBY.js → tsc-2xhsE0Bf.js} +4 -4
  47. package/dist/tsdown/tsdown-css.js +1 -1
  48. package/dist/tsdown/tsdown-exe.js +3 -3
  49. package/dist/tsdown/{version-CQ98ZBpL-D6GAHapk.js → version-CQ98ZBpL-CKvh-HCu.js} +1 -1
  50. package/dist/vite/client/bundledDevClient.mjs +75 -329
  51. package/dist/vite/client/client.mjs +74 -23
  52. package/dist/vite/node/chunks/node.js +883 -666
  53. package/dist/vite/node/index.d.ts +3 -1
  54. package/dist/vite/node/module-runner.js +16 -2
  55. package/package.json +38 -21
  56. package/dist/rolldown/experimental-default-runtime.mjs +0 -116
  57. package/dist/rolldown/experimental-runtime-base.mjs +0 -95
@@ -1112,7 +1112,8 @@ declare class MemoryFiles {
1112
1112
  declare class BundledDev {
1113
1113
  private environment;
1114
1114
  private _devEngine;
1115
- private viteRuntime?;
1115
+ /** the vite client and the rolldown runtime; set before the first build so `hasBuildOutput` can count them */
1116
+ private staticFiles;
1116
1117
  private initialBuildCompleted;
1117
1118
  private _closed;
1118
1119
  private clients;
@@ -1144,6 +1145,7 @@ declare class BundledDev {
1144
1145
  */
1145
1146
  markPayloadDelivered(filename: string): void;
1146
1147
  close(): Promise<void>;
1148
+ private storeStaticFiles;
1147
1149
  private storeOutputFiles;
1148
1150
  private getRolldownOptions;
1149
1151
  private handleHmrOutput;
@@ -39,6 +39,19 @@ function promiseWithResolvers() {
39
39
  reject
40
40
  };
41
41
  }
42
+ const percentEncodedRE = /(?:%[0-9a-f]{2})+/gi, whitespaceOnlyRE = /^\s+$/;
43
+ /** Reverses {@link encodeSourceURL}. */
44
+ function decodeSourceURL(url) {
45
+ return url.replace(percentEncodedRE, (match) => {
46
+ let decoded;
47
+ try {
48
+ decoded = decodeURIComponent(match);
49
+ } catch {
50
+ return match;
51
+ }
52
+ return whitespaceOnlyRE.test(decoded) ? decoded : match;
53
+ });
54
+ }
42
55
  //#endregion
43
56
  //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.6.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
44
57
  var comma = 44, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = /* @__PURE__ */ new Uint8Array(64), charToInt = /* @__PURE__ */ new Uint8Array(128);
@@ -940,10 +953,11 @@ function supportRelativeURL(file, url) {
940
953
  return protocol && /^\/\w:/.test(startPath) ? (protocol += "/", protocol + slash(posixResolve(startPath, url))) : protocol + posixResolve(startPath, url);
941
954
  }
942
955
  function getRunnerSourceMap(position) {
956
+ let id = decodeSourceURL(position.source);
943
957
  for (let moduleGraph of evaluatedModulesCache) {
944
- let sourceMap = moduleGraph.getModuleSourceMapById(position.source);
958
+ let sourceMap = moduleGraph.getModuleSourceMapById(id);
945
959
  if (sourceMap) return {
946
- url: position.source,
960
+ url: id,
947
961
  map: sourceMap,
948
962
  vite: !0
949
963
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidzero-dev/vite-plus-core",
3
- "version": "1.0.0-rc.1",
3
+ "version": "1.1.0",
4
4
  "description": "The Unified Toolchain for the Web",
5
5
  "homepage": "https://viteplus.dev/guide",
6
6
  "bugs": {
@@ -107,8 +107,8 @@
107
107
  "./types/internal/*": null
108
108
  },
109
109
  "dependencies": {
110
- "@oxc-project/runtime": "=0.151.0",
111
- "@oxc-project/types": "=0.151.0",
110
+ "@oxc-project/runtime": "=0.153.0",
111
+ "@oxc-project/types": "=0.153.0",
112
112
  "lightningcss": "^1.33.0",
113
113
  "postcss": "^8.5.6",
114
114
  "yuku-codegen": "^0.9.3",
@@ -122,16 +122,17 @@
122
122
  "@oxc-node/cli": "^0.1.3",
123
123
  "@tsdown/css": "^0.23.0",
124
124
  "@tsdown/exe": "^0.23.0",
125
- "@vitejs/devtools": "^0.7.5",
125
+ "@typescript/native-preview": "7.0.0-dev.20260605.1",
126
+ "@vitejs/devtools": "^0.7.6",
126
127
  "es-module-lexer": "^1.7.0",
127
128
  "hookable": "^6.0.1",
128
129
  "magic-string": "^0.30.21",
129
- "oxc-parser": "=0.151.0",
130
- "oxfmt": "=0.70.0",
130
+ "oxc-parser": "=0.153.0",
131
+ "oxfmt": "=0.72.0",
131
132
  "picocolors": "^1.1.1",
132
133
  "picomatch": "^4.0.2",
133
134
  "pkg-types": "^2.3.0",
134
- "rolldown": "1.2.11",
135
+ "rolldown": "1.2.12",
135
136
  "rolldown-plugin-dts": "^0.28.0",
136
137
  "rollup": "^4.63.0",
137
138
  "rollup-plugin-license": "^3.6.0",
@@ -139,12 +140,15 @@
139
140
  "tinyglobby": "^0.2.15",
140
141
  "tree-kill": "^1.2.2",
141
142
  "tsdown": "^0.23.0",
142
- "vite": "npm:@voidzero-dev/vite-plus-core@1.0.0-rc.1"
143
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.1.0"
143
144
  },
144
145
  "peerDependencies": {
145
146
  "@arethetypeswrong/core": "^0.18.1",
146
147
  "@types/node": "^20.19.0 || >=22.12.0",
148
+ "@typescript/native-preview": "*",
147
149
  "@vitejs/devtools": "^0.7.1",
150
+ "@volar/typescript": "~2.4.0",
151
+ "@vue/language-core": "~3.2.0 || ~3.3.0",
148
152
  "esbuild": "^0.27.0 || ^0.28.0",
149
153
  "jiti": ">=1.21.0",
150
154
  "less": "^4.0.0",
@@ -158,9 +162,25 @@
158
162
  "typescript": "^5.0.0 || ^6.0.0 || ^7.0.0",
159
163
  "unplugin-unused": ">=0.5.0",
160
164
  "unrun": "*",
165
+ "vue-tsc": "~3.2.0 || ~3.3.0",
161
166
  "yaml": "^2.4.2"
162
167
  },
163
168
  "peerDependenciesMeta": {
169
+ "@typescript/native-preview": {
170
+ "optional": true
171
+ },
172
+ "@volar/typescript": {
173
+ "optional": true
174
+ },
175
+ "@vue/language-core": {
176
+ "optional": true
177
+ },
178
+ "typescript": {
179
+ "optional": true
180
+ },
181
+ "vue-tsc": {
182
+ "optional": true
183
+ },
164
184
  "@arethetypeswrong/core": {
165
185
  "optional": true
166
186
  },
@@ -173,9 +193,6 @@
173
193
  "tsx": {
174
194
  "optional": true
175
195
  },
176
- "typescript": {
177
- "optional": true
178
- },
179
196
  "unplugin-unused": {
180
197
  "optional": true
181
198
  },
@@ -215,21 +232,21 @@
215
232
  },
216
233
  "optionalDependencies": {
217
234
  "fsevents": "~2.3.3",
218
- "@voidzero-dev/vite-plus-darwin-arm64": "1.0.0-rc.1",
219
- "@voidzero-dev/vite-plus-darwin-x64": "1.0.0-rc.1",
220
- "@voidzero-dev/vite-plus-linux-arm64-gnu": "1.0.0-rc.1",
221
- "@voidzero-dev/vite-plus-linux-arm64-musl": "1.0.0-rc.1",
222
- "@voidzero-dev/vite-plus-linux-x64-gnu": "1.0.0-rc.1",
223
- "@voidzero-dev/vite-plus-linux-x64-musl": "1.0.0-rc.1",
224
- "@voidzero-dev/vite-plus-win32-x64-msvc": "1.0.0-rc.1",
225
- "@voidzero-dev/vite-plus-win32-arm64-msvc": "1.0.0-rc.1"
235
+ "@voidzero-dev/vite-plus-darwin-arm64": "1.1.0",
236
+ "@voidzero-dev/vite-plus-darwin-x64": "1.1.0",
237
+ "@voidzero-dev/vite-plus-linux-arm64-gnu": "1.1.0",
238
+ "@voidzero-dev/vite-plus-linux-arm64-musl": "1.1.0",
239
+ "@voidzero-dev/vite-plus-linux-x64-gnu": "1.1.0",
240
+ "@voidzero-dev/vite-plus-linux-x64-musl": "1.1.0",
241
+ "@voidzero-dev/vite-plus-win32-x64-msvc": "1.1.0",
242
+ "@voidzero-dev/vite-plus-win32-arm64-msvc": "1.1.0"
226
243
  },
227
244
  "engines": {
228
245
  "node": "^20.19.0 || ^22.18.0 || >=24.11.0"
229
246
  },
230
247
  "bundledVersions": {
231
- "vite": "8.3.1",
232
- "rolldown": "1.2.11",
248
+ "vite": "8.3.3",
249
+ "rolldown": "1.2.12",
233
250
  "tsdown": "0.23.0"
234
251
  },
235
252
  "scripts": {
@@ -1,116 +0,0 @@
1
- // @ts-check
2
-
3
- /** @import { DevRuntime } from './runtime-extra-dev-common.js' */
4
-
5
- /** @type {typeof DevRuntime} */
6
- // @ts-expect-error -- there's no way to declare a variable by JSDoc
7
- var BaseDevRuntime = DevRuntime;
8
-
9
- class ModuleHotContext {
10
- /**
11
- * @type {{ deps: [string], fn: (moduleExports: Record<string, any>[]) => void }[]}
12
- */
13
- acceptCallbacks = [];
14
- /**
15
- * @param {string} moduleId
16
- * @param {InstanceType<BaseDevRuntime>} devRuntime
17
- */
18
- constructor(moduleId, devRuntime) {
19
- this.moduleId = moduleId;
20
- this.devRuntime = devRuntime;
21
- }
22
-
23
- /**
24
- * @overload
25
- * @param {(mod: Record<string, any>) => void} cb
26
- * @returns {void}
27
- */
28
- /**
29
- * @param {...any} args
30
- * @returns {void}
31
- */
32
- accept(...args) {
33
- if (args.length === 1) {
34
- const [cb] = /** @type {[(mod: Record<string, any>) => void]} */ (args);
35
- const acceptingPath = this.moduleId;
36
- this.acceptCallbacks.push({
37
- deps: [acceptingPath],
38
- fn: cb,
39
- });
40
- } else if (args.length === 0) {}
41
- else {
42
- throw new Error('Invalid arguments for `import.meta.hot.accept`');
43
- }
44
- }
45
-
46
- invalidate() {
47
- socket.send(JSON.stringify({
48
- type: 'hmr:invalidate',
49
- moduleId: this.moduleId,
50
- }));
51
- }
52
- }
53
-
54
- class DefaultDevRuntime extends BaseDevRuntime {
55
- /**
56
- * @type {Map<string, ModuleHotContext>}
57
- */
58
- moduleHotContexts = new Map();
59
- /**
60
- * @override
61
- * @param {string} moduleId
62
- */
63
- createModuleHotContext(moduleId) {
64
- const hotContext = new ModuleHotContext(moduleId, this);
65
- this.moduleHotContexts.set(moduleId, hotContext);
66
- return hotContext;
67
- }
68
- }
69
-
70
- /** @param {string} url */
71
- function loadScript(url) {
72
- var script = document.createElement('script');
73
- script.src = url;
74
- script.type = 'module';
75
- script.onerror = function() {
76
- console.error('Failed to load script: ' + url);
77
- };
78
- document.body.appendChild(script);
79
- }
80
-
81
- console.debug('HMR runtime loaded', '$ADDR');
82
- // Generate client ID immediately at runtime initialization
83
- // This ensures the client ID is available before any lazy imports
84
- const clientId = crypto.randomUUID();
85
- const addr = new URL('ws://$ADDR');
86
- addr.searchParams.set('clientId', clientId);
87
-
88
- const socket = new WebSocket(addr);
89
-
90
- (/** @type {any} */ (globalThis)).__rolldown_runtime__ ??=
91
- new DefaultDevRuntime(clientId);
92
-
93
- /** @param {MessageEvent} event */
94
- socket.onmessage = function(event) {
95
- const data = JSON.parse(event.data);
96
- console.debug('Received message:', data);
97
- if (data.type === 'connected') {
98
- // Server acknowledged the connection
99
- console.debug('[hmr]: Connection established with server');
100
- } else if (data.type === 'hmr:update') {
101
- if (typeof process === 'object') {
102
- import(data.path);
103
- console.debug(`[hmr]: Importing HMR patch: ${data.path}`);
104
- } else {
105
- console.debug(`[hmr]: Loading HMR patch: ${data.path}`);
106
- loadScript(data.url);
107
- }
108
- } else if (data.type === 'hmr:reload') {
109
- console.log('[hmr]: Full reload required, reloading page');
110
- if (typeof location !== 'undefined') {
111
- location.reload();
112
- } else {
113
- console.log('[hmr]: location is undefined, cannot reload page');
114
- }
115
- }
116
- };
@@ -1,95 +0,0 @@
1
- export var __create = Object.create;
2
- export var __defProp = Object.defineProperty;
3
- export var __name = (target, value) => __defProp(target, 'name', { value, configurable: true });
4
- export var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- export var __getOwnPropNames = Object.getOwnPropertyNames;
6
- export var __getProtoOf = Object.getPrototypeOf;
7
- export var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- export var __esm = (fn, res, err) =>
9
- function () {
10
- if (err) throw err[0];
11
- try {
12
- return (fn && (res = (0, fn[__getOwnPropNames(fn)[0]])((fn = 0))), res);
13
- } catch (e) {
14
- throw ((err = [e]), e);
15
- }
16
- };
17
- export var __esmMin = (fn, res, err) => () => {
18
- if (err) throw err[0];
19
- try {
20
- return (fn && (res = fn((fn = 0))), res);
21
- } catch (e) {
22
- throw ((err = [e]), e);
23
- }
24
- };
25
- export var __commonJS = (cb, mod) =>
26
- function () {
27
- return (
28
- mod || ((0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), cb = null), mod.exports
29
- );
30
- };
31
- export var __commonJSMin = (cb, mod) => () => (
32
- mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports
33
- );
34
- export var __exportAll = (all, no_symbols) => {
35
- let target = {};
36
- for (var name in all) {
37
- __defProp(target, name, { get: all[name], enumerable: true });
38
- }
39
- if (!no_symbols) {
40
- __defProp(target, Symbol.toStringTag, { value: 'Module' });
41
- }
42
- return target;
43
- };
44
- export var __copyProps = (to, from, except, desc) => {
45
- if ((from && typeof from === 'object') || typeof from === 'function') {
46
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
47
- key = keys[i];
48
- if (!__hasOwnProp.call(to, key) && key !== except) {
49
- __defProp(to, key, {
50
- get: ((k) => from[k]).bind(null, key),
51
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
52
- });
53
- }
54
- }
55
- }
56
- return to;
57
- };
58
- export var __reExport = (target, mod, secondTarget) => (
59
- __copyProps(target, mod, 'default'), secondTarget && __copyProps(secondTarget, mod, 'default')
60
- );
61
- export var __toESM = (mod, isNodeMode, target) => (
62
- (target = mod != null ? __create(__getProtoOf(mod)) : {}),
63
- __copyProps(
64
- // `__esModule` alone is not enough: the module must own a `default` (#10360).
65
- isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, 'default')
66
- ? __defProp(target, 'default', { value: mod, enumerable: true })
67
- : target,
68
- mod,
69
- )
70
- );
71
- export var __toCommonJS = (mod) =>
72
- __hasOwnProp.call(mod, 'module.exports')
73
- ? mod['module.exports']
74
- : __copyProps(__defProp({}, '__esModule', { value: true }), mod);
75
- export var __toBinaryNode = (base64) => new Uint8Array(Buffer.from(base64, 'base64'));
76
- export var __toBinary = /* @__PURE__ */ (() => {
77
- var table = new Uint8Array(128);
78
- for (var i = 0; i < 64; i++) {
79
- table[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i * 4 - 205] = i;
80
- }
81
- return (base64) => {
82
- var n = base64.length,
83
- bytes = new Uint8Array((((n - (base64[n - 1] == '=') - (base64[n - 2] == '=')) * 3) / 4) | 0);
84
- for (var i = 0, j = 0; i < n; ) {
85
- var c0 = table[base64.charCodeAt(i++)],
86
- c1 = table[base64.charCodeAt(i++)];
87
- var c2 = table[base64.charCodeAt(i++)],
88
- c3 = table[base64.charCodeAt(i++)];
89
- bytes[j++] = (c0 << 2) | (c1 >> 4);
90
- bytes[j++] = (c1 << 4) | (c2 >> 2);
91
- bytes[j++] = (c2 << 6) | c3;
92
- }
93
- return bytes;
94
- };
95
- })();