@voidzero-dev/vite-plus-core 1.0.0 → 1.2.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 (68) hide show
  1. package/LICENSE +36 -177
  2. package/dist/rolldown/cli.mjs +33 -29
  3. package/dist/rolldown/config.d.mts +3 -3
  4. package/dist/rolldown/config.mjs +2 -2
  5. package/dist/rolldown/experimental-index.d.mts +29 -29
  6. package/dist/rolldown/experimental-index.mjs +8 -8
  7. package/dist/rolldown/experimental-runtime-types.d.ts +39 -7
  8. package/dist/rolldown/experimental-runtime.d.ts +39 -7
  9. package/dist/rolldown/experimental-runtime.mjs +284 -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 +3 -3
  15. package/dist/rolldown/parse-ast-index.d.mts +6 -7
  16. package/dist/rolldown/parse-ast-index.mjs +1 -1
  17. package/dist/rolldown/plugins-index.d.mts +5 -5
  18. package/dist/rolldown/plugins-index.mjs +2 -2
  19. package/dist/rolldown/shared/{binding-BY0qR5iS.mjs → binding-DlR5d34p.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-DhjlrWZE.mjs} +203 -20
  22. package/dist/rolldown/shared/{constructors-xEvVj3lN.mjs → constructors-B2hkJoIA.mjs} +1 -1
  23. package/dist/rolldown/shared/{constructors-DuOq7MqW.d.mts → constructors-Dw9H1IvX.d.mts} +2 -2
  24. package/dist/rolldown/shared/{create-bundler-option-COco-7P6.mjs → create-bundler-option-1AEe_J0o.mjs} +36 -10
  25. package/dist/rolldown/shared/{define-config-C7HCoqY8.d.mts → define-config-CGhm2DU-.d.mts} +94 -5
  26. package/dist/rolldown/shared/{error-C7pxws0W.mjs → error-Dsqzw0Oa.mjs} +2 -1
  27. package/dist/rolldown/shared/{load-config-DkUBnDsI.mjs → load-config-bvw8z7Ft.mjs} +2 -2
  28. package/dist/rolldown/shared/{normalize-string-or-regex-F14uvr6D.mjs → normalize-string-or-regex-B7Gsiuz7.mjs} +1 -1
  29. package/dist/rolldown/shared/{parse-BWeE7Vr9.mjs → parse-BCSSrLHf.mjs} +2 -2
  30. package/dist/rolldown/shared/{resolve-tsconfig-DHwpIs5e.mjs → resolve-tsconfig-DyR2RUTm.mjs} +2 -2
  31. package/dist/rolldown/shared/{rolldown-Bue0gNT5.mjs → rolldown-C8QomUuX.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-CPI70Lkn.mjs} +4 -4
  34. package/dist/rolldown/utils-index.d.mts +5 -5
  35. package/dist/rolldown/utils-index.mjs +5 -5
  36. package/dist/tsdown/{build-JVmLFaZt-DRlLhpV3.js → build-KEepWO_k-BOsPZ2cH.js} +26 -25
  37. package/dist/tsdown/{debug-CpC4hV25-C-OYr2iI.js → debug-DKTolR2K-BMJOFfj2.js} +4 -5
  38. package/dist/tsdown/{detect-Bg-d8iUV-Du8LljhG.js → detect-DHDepxVX-CpWW52Jd.js} +38 -34
  39. package/dist/tsdown/dist-BebyOHRu.js +6224 -0
  40. package/dist/tsdown/index-types.d.ts +216 -216
  41. package/dist/tsdown/index.js +4 -4
  42. package/dist/tsdown/{main-CyNcZUzu.js → main-Du9xCnhX.js} +105 -19
  43. package/dist/tsdown/npm_entry_picomatch.cjs +36 -25
  44. package/dist/tsdown/{resolver-DE0_sy8o-Bi3xbRxi.js → resolver-DE0_sy8o-DNoi-dFQ.js} +3 -2
  45. package/dist/tsdown/run.js +28 -26
  46. package/dist/tsdown/{src-pN7Bl6zo.js → src-CBWRkeF5.js} +4 -4
  47. package/dist/tsdown/{target-DgdLrXba-DpO9JXxB.js → target-HZbF5Cux-Cmv1LI5D.js} +175 -9
  48. package/dist/tsdown/{tsc-BLb4pSBY.js → tsc-YwU2b8yT.js} +4 -4
  49. package/dist/tsdown/tsdown-css.js +4 -4
  50. package/dist/tsdown/tsdown-exe.js +5 -43
  51. package/dist/vite/client/bundledDevClient.mjs +109 -345
  52. package/dist/vite/client/client.mjs +80 -28
  53. package/dist/vite/node/chunks/build.js +19 -19
  54. package/dist/vite/node/chunks/node.js +5210 -4942
  55. package/dist/vite/node/chunks/postcss-import.js +10 -10
  56. package/dist/vite/node/cli.js +24 -21
  57. package/dist/vite/node/index.d.ts +5 -2
  58. package/dist/vite/node/index.js +1 -2
  59. package/dist/vite/node/internal.js +1 -2
  60. package/dist/vite/node/module-runner.d.ts +1 -0
  61. package/dist/vite/node/module-runner.js +32 -27
  62. package/package.json +46 -30
  63. package/dist/rolldown/experimental-default-runtime.mjs +0 -116
  64. package/dist/rolldown/experimental-runtime-base.mjs +0 -95
  65. package/dist/tsdown/dist-VDcV1Qyy.js +0 -2952
  66. package/dist/tsdown/require-BbBF8Ii0-BDaWJgzA.js +0 -320
  67. package/dist/tsdown/style-DiMP8pYv-DIC5PXeH.js +0 -88
  68. package/dist/tsdown/version-CQ98ZBpL-D6GAHapk.js +0 -169
@@ -1,8 +1,12 @@
1
1
  /**
2
- * Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
2
+ * Compiler-emitted module-graph delta — topology (static + dynamic edges).
3
3
  * `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
4
4
  * `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
5
- * @typedef {{ ids: string[], localCount: number, edges: number[][], dynamicEdges?: number[][] }} ModuleGraphDelta
5
+ * `bindings[i][j]` are the export names `ids[i]` imports through `edges[i][j]`. `bindings` holds
6
+ * only some rows; a missing row, or a missing or `null` entry, means the whole namespace.
7
+ * `dynamicEdges` also holds only some rows; a missing row means no dynamic edges.
8
+ * `stamps[i]` is the rebuild stamp of `ids[i]`; a missing row means 0.
9
+ * @typedef {{ ids: string[], localCount: number, edges: number[][], bindings?: Record<number, (string[] | null)[]>, dynamicEdges?: Record<number, number[]>, stamps?: Record<number, number> }} ModuleGraphDelta
6
10
  * @typedef {{ createModuleHotContext(moduleId: string): any, onModuleCacheRemoval(moduleId: string): void }} DevRuntimeHooks
7
11
  */
8
12
  export class MissingFactoryError {
@@ -25,10 +29,12 @@ export class DevRuntime {
25
29
  /**
26
30
  * Static import edges from `registerGraph` — entries persist across `removeModuleCache`
27
31
  * and change only by replacement from a newer payload (last write wins).
28
- * @type {Map<string, { edges: string[] }>}
32
+ * `bindings` is the payload row as sent; `getImportedBindings` resolves a missing entry.
33
+ * @type {Map<string, { edges: string[], bindings: (string[] | null)[] | undefined }>}
29
34
  */
30
35
  staticImports: Map<string, {
31
36
  edges: string[];
37
+ bindings: (string[] | null)[] | undefined;
32
38
  }>;
33
39
  /**
34
40
  * Reverse index over the static imports.
@@ -63,6 +69,14 @@ export class DevRuntime {
63
69
  * @type {Map<string, (id: string) => void>}
64
70
  */
65
71
  factories: Map<string, (id: string) => void>;
72
+ /**
73
+ * A late payload (a slow lazy chunk after an HMR patch) must not replace newer rows or
74
+ * factories.
75
+ * @type {Map<string, number>}
76
+ */
77
+ rowStamps: Map<string, number>;
78
+ /** @type {Map<string, number>} */
79
+ factoryStamps: Map<string, number>;
66
80
  /**
67
81
  * Installed by the dev client at boot. The runtime is a store + executor and makes
68
82
  * no HMR decisions; accepting, disposing, and reloading live behind these hooks.
@@ -76,8 +90,9 @@ export class DevRuntime {
76
90
  /**
77
91
  * @param {string} id
78
92
  * @param {(id: string) => void} fn
93
+ * @param {number} [stamp]
79
94
  */
80
- registerFactory(id: string, fn: (id: string) => void): void;
95
+ registerFactory(id: string, fn: (id: string) => void, stamp?: number): void;
81
96
  /**
82
97
  * @param {string} id
83
98
  * @param {{ exports: any }} [exportsHolder]
@@ -90,6 +105,13 @@ export class DevRuntime {
90
105
  * @returns {string[]}
91
106
  */
92
107
  getImporters(id: string): string[];
108
+ /**
109
+ * `"*"` means the whole namespace, an empty list a side-effect-only import, `undefined` no edge.
110
+ * @param {string} importer
111
+ * @param {string} id
112
+ * @returns {string[] | undefined}
113
+ */
114
+ getImportedBindings(importer: string, id: string): string[] | undefined;
93
115
  /**
94
116
  * @param {string} id
95
117
  */
@@ -134,20 +156,30 @@ export class DevRuntime {
134
156
  __reExport: any;
135
157
  }
136
158
  /**
137
- * Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
159
+ * Compiler-emitted module-graph delta — topology (static + dynamic edges).
138
160
  * `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
139
161
  * `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
162
+ * `bindings[i][j]` are the export names `ids[i]` imports through `edges[i][j]`. `bindings` holds
163
+ * only some rows; a missing row, or a missing or `null` entry, means the whole namespace.
164
+ * `dynamicEdges` also holds only some rows; a missing row means no dynamic edges.
165
+ * `stamps[i]` is the rebuild stamp of `ids[i]`; a missing row means 0.
140
166
  */
141
167
  export type ModuleGraphDelta = {
142
168
  ids: string[];
143
169
  localCount: number;
144
170
  edges: number[][];
145
- dynamicEdges?: number[][];
171
+ bindings?: Record<number, (string[] | null)[]>;
172
+ dynamicEdges?: Record<number, number[]>;
173
+ stamps?: Record<number, number>;
146
174
  };
147
175
  /**
148
- * Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
176
+ * Compiler-emitted module-graph delta — topology (static + dynamic edges).
149
177
  * `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
150
178
  * `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
179
+ * `bindings[i][j]` are the export names `ids[i]` imports through `edges[i][j]`. `bindings` holds
180
+ * only some rows; a missing row, or a missing or `null` entry, means the whole namespace.
181
+ * `dynamicEdges` also holds only some rows; a missing row means no dynamic edges.
182
+ * `stamps[i]` is the rebuild stamp of `ids[i]`; a missing row means 0.
151
183
  */
152
184
  export type DevRuntimeHooks = {
153
185
  createModuleHotContext(moduleId: string): any;
@@ -1,8 +1,12 @@
1
1
  /**
2
- * Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
2
+ * Compiler-emitted module-graph delta — topology (static + dynamic edges).
3
3
  * `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
4
4
  * `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
5
- * @typedef {{ ids: string[], localCount: number, edges: number[][], dynamicEdges?: number[][] }} ModuleGraphDelta
5
+ * `bindings[i][j]` are the export names `ids[i]` imports through `edges[i][j]`. `bindings` holds
6
+ * only some rows; a missing row, or a missing or `null` entry, means the whole namespace.
7
+ * `dynamicEdges` also holds only some rows; a missing row means no dynamic edges.
8
+ * `stamps[i]` is the rebuild stamp of `ids[i]`; a missing row means 0.
9
+ * @typedef {{ ids: string[], localCount: number, edges: number[][], bindings?: Record<number, (string[] | null)[]>, dynamicEdges?: Record<number, number[]>, stamps?: Record<number, number> }} ModuleGraphDelta
6
10
  * @typedef {{ createModuleHotContext(moduleId: string): any, onModuleCacheRemoval(moduleId: string): void }} DevRuntimeHooks
7
11
  */
8
12
  export class MissingFactoryError {
@@ -25,10 +29,12 @@ export class DevRuntime {
25
29
  /**
26
30
  * Static import edges from `registerGraph` — entries persist across `removeModuleCache`
27
31
  * and change only by replacement from a newer payload (last write wins).
28
- * @type {Map<string, { edges: string[] }>}
32
+ * `bindings` is the payload row as sent; `getImportedBindings` resolves a missing entry.
33
+ * @type {Map<string, { edges: string[], bindings: (string[] | null)[] | undefined }>}
29
34
  */
30
35
  staticImports: Map<string, {
31
36
  edges: string[];
37
+ bindings: (string[] | null)[] | undefined;
32
38
  }>;
33
39
  /**
34
40
  * Reverse index over the static imports.
@@ -63,6 +69,14 @@ export class DevRuntime {
63
69
  * @type {Map<string, (id: string) => void>}
64
70
  */
65
71
  factories: Map<string, (id: string) => void>;
72
+ /**
73
+ * A late payload (a slow lazy chunk after an HMR patch) must not replace newer rows or
74
+ * factories.
75
+ * @type {Map<string, number>}
76
+ */
77
+ rowStamps: Map<string, number>;
78
+ /** @type {Map<string, number>} */
79
+ factoryStamps: Map<string, number>;
66
80
  /**
67
81
  * Installed by the dev client at boot. The runtime is a store + executor and makes
68
82
  * no HMR decisions; accepting, disposing, and reloading live behind these hooks.
@@ -76,8 +90,9 @@ export class DevRuntime {
76
90
  /**
77
91
  * @param {string} id
78
92
  * @param {(id: string) => void} fn
93
+ * @param {number} [stamp]
79
94
  */
80
- registerFactory(id: string, fn: (id: string) => void): void;
95
+ registerFactory(id: string, fn: (id: string) => void, stamp?: number): void;
81
96
  /**
82
97
  * @param {string} id
83
98
  * @param {{ exports: any }} [exportsHolder]
@@ -90,6 +105,13 @@ export class DevRuntime {
90
105
  * @returns {string[]}
91
106
  */
92
107
  getImporters(id: string): string[];
108
+ /**
109
+ * `"*"` means the whole namespace, an empty list a side-effect-only import, `undefined` no edge.
110
+ * @param {string} importer
111
+ * @param {string} id
112
+ * @returns {string[] | undefined}
113
+ */
114
+ getImportedBindings(importer: string, id: string): string[] | undefined;
93
115
  /**
94
116
  * @param {string} id
95
117
  */
@@ -134,20 +156,30 @@ export class DevRuntime {
134
156
  __reExport: any;
135
157
  }
136
158
  /**
137
- * Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
159
+ * Compiler-emitted module-graph delta — topology (static + dynamic edges).
138
160
  * `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
139
161
  * `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
162
+ * `bindings[i][j]` are the export names `ids[i]` imports through `edges[i][j]`. `bindings` holds
163
+ * only some rows; a missing row, or a missing or `null` entry, means the whole namespace.
164
+ * `dynamicEdges` also holds only some rows; a missing row means no dynamic edges.
165
+ * `stamps[i]` is the rebuild stamp of `ids[i]`; a missing row means 0.
140
166
  */
141
167
  export type ModuleGraphDelta = {
142
168
  ids: string[];
143
169
  localCount: number;
144
170
  edges: number[][];
145
- dynamicEdges?: number[][];
171
+ bindings?: Record<number, (string[] | null)[]>;
172
+ dynamicEdges?: Record<number, number[]>;
173
+ stamps?: Record<number, number>;
146
174
  };
147
175
  /**
148
- * Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
176
+ * Compiler-emitted module-graph delta — topology (static + dynamic edges).
149
177
  * `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
150
178
  * `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
179
+ * `bindings[i][j]` are the export names `ids[i]` imports through `edges[i][j]`. `bindings` holds
180
+ * only some rows; a missing row, or a missing or `null` entry, means the whole namespace.
181
+ * `dynamicEdges` also holds only some rows; a missing row means no dynamic edges.
182
+ * `stamps[i]` is the rebuild stamp of `ids[i]`; a missing row means 0.
151
183
  */
152
184
  export type DevRuntimeHooks = {
153
185
  createModuleHotContext(moduleId: string): any;