@voidzero-dev/vite-plus-core 0.2.4 → 0.2.6

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 (88) hide show
  1. package/LICENSE +36 -120
  2. package/dist/rolldown/cli.d.mts +1 -1
  3. package/dist/rolldown/cli.mjs +11 -8
  4. package/dist/rolldown/config.d.mts +22 -10
  5. package/dist/rolldown/config.mjs +2 -2
  6. package/dist/rolldown/experimental-index.d.mts +164 -155
  7. package/dist/rolldown/experimental-index.mjs +23 -14
  8. package/dist/rolldown/experimental-runtime-types.d.ts +111 -41
  9. package/dist/rolldown/filter-index.d.mts +6 -5
  10. package/dist/rolldown/get-log-filter.d.mts +2 -2
  11. package/dist/rolldown/index.d.mts +4 -4
  12. package/dist/rolldown/index.mjs +10 -4
  13. package/dist/rolldown/parallel-plugin-worker.d.mts +1 -1
  14. package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
  15. package/dist/rolldown/parallel-plugin.d.mts +3 -4
  16. package/dist/rolldown/parse-ast-index.d.mts +19 -20
  17. package/dist/rolldown/parse-ast-index.mjs +2 -2
  18. package/dist/rolldown/plugins-index.d.mts +27 -28
  19. package/dist/rolldown/plugins-index.mjs +2 -2
  20. package/dist/rolldown/shared/{binding-B1q9aYT-.d.mts → binding-Dbbi0RbO.d.mts} +49 -25
  21. package/dist/rolldown/shared/{binding-BmkJW3Wy.mjs → binding-Dby9rwGk.mjs} +26 -26
  22. package/dist/rolldown/shared/{bindingify-input-options-Cmm60vfj.mjs → bindingify-input-options-DVQ4K-zY.mjs} +11 -13
  23. package/dist/rolldown/shared/{constructors-2i1T9YcF.d.mts → constructors-CSWbNgBZ.d.mts} +9 -10
  24. package/dist/rolldown/shared/{constructors-CE6zZSUt.mjs → constructors-CuGa75s-.mjs} +1 -1
  25. package/dist/rolldown/shared/define-config-B-IDOhDz.d.mts +4003 -0
  26. package/dist/rolldown/shared/dist-DX3cAjHx.mjs +154 -0
  27. package/dist/rolldown/shared/{error-BlQ0-ek7.mjs → error-DFGNOCle.mjs} +1 -1
  28. package/dist/rolldown/shared/get-log-filter-AjBknEEO.d.mts +34 -0
  29. package/dist/rolldown/shared/{load-config-CVVMWSlg.mjs → load-config-R0z2olkB.mjs} +19 -2
  30. package/dist/rolldown/shared/{logging-BSNejiLS.d.mts → logging-xuHO4mAy.d.mts} +6 -6
  31. package/dist/rolldown/shared/{logs-aMKUxRpj.mjs → logs-ZGEh6uhb.mjs} +6 -1
  32. package/dist/rolldown/shared/{normalize-string-or-regex-BYkbbGqQ.mjs → normalize-string-or-regex-SiXbePVH.mjs} +2 -2
  33. package/dist/rolldown/shared/{parse-Dphnedsw.mjs → parse-D5dkElpf.mjs} +2 -2
  34. package/dist/rolldown/shared/{prompt-Bgj-uEyc.mjs → prompt-pZFoa1TT.mjs} +59 -17
  35. package/dist/rolldown/shared/{resolve-tsconfig-CdIAR1Eb.mjs → resolve-tsconfig-2TXRF_zr.mjs} +2 -2
  36. package/dist/rolldown/shared/{rolldown-Bnp916iM.mjs → rolldown-BnV7isAX.mjs} +1 -1
  37. package/dist/rolldown/shared/{rolldown-build-Cs2iVJuw.mjs → rolldown-build-BGXNOfvH.mjs} +33 -13
  38. package/dist/rolldown/shared/transform-Cs2bUDRH.d.mts +148 -0
  39. package/dist/rolldown/shared/{watch-ECGr-_QS.mjs → watch-DVucf-VG.mjs} +5 -5
  40. package/dist/rolldown/utils-index.d.mts +29 -30
  41. package/dist/rolldown/utils-index.mjs +9 -9
  42. package/dist/tsdown/{build-B_nvJe4A-CvbtVBxy.js → build-oq13wECG-Bymq3jT5.js} +210 -1229
  43. package/dist/tsdown/debug-BntVTkRq-BGIoAiTa.js +159 -0
  44. package/dist/tsdown/{detect-B97OSl92-BJPZyIKJ.js → detect-DGhJGEqb-S-tkSzpt.js} +13 -2
  45. package/dist/tsdown/dist-CxIM8o7n.js +2613 -0
  46. package/dist/tsdown/dist-DCMiHFrJ.js +1061 -0
  47. package/dist/tsdown/index-types.d.ts +2106 -1895
  48. package/dist/tsdown/index.js +7 -4
  49. package/dist/tsdown/internal-C7ewSPAZ.js +3 -0
  50. package/dist/tsdown/load-tsc-BKULZsrs-BFmeD6Bu.js +18 -0
  51. package/dist/tsdown/{main-BlTcyuFi.js → main-BdzlWPt6.js} +214 -9
  52. package/dist/tsdown/npm_entry_picomatch.cjs +44 -15
  53. package/dist/tsdown/{resolver-DtsKFXi2-B8Z3WwZh.js → resolver-cwLsPb2o-oj1hqxK6.js} +4 -3
  54. package/dist/tsdown/run.js +4 -4
  55. package/dist/tsdown/{src-CISfE_A0.js → src-BV-UJr_R.js} +5 -5
  56. package/dist/tsdown/target-CNxIDvSz-eoHNdJNs.js +576 -0
  57. package/dist/tsdown/{tsc-context-CX_GXdyS.js → tsc-context-CA76SkkZ.js} +2 -2
  58. package/dist/tsdown/{tsc-CdZE7QwS.js → tsc-zcbB6ZVY.js} +58 -117
  59. package/dist/tsdown/tsdown-css.js +74 -23
  60. package/dist/tsdown/tsdown-exe.js +129 -876
  61. package/dist/vite/client/client.mjs +5 -5
  62. package/dist/vite/node/chunks/build.js +204 -94
  63. package/dist/vite/node/chunks/dist2.js +1 -1
  64. package/dist/vite/node/chunks/lib.js +1 -1
  65. package/dist/vite/node/chunks/moduleRunnerTransport.d.ts +25 -26
  66. package/dist/vite/node/chunks/node.js +552 -104
  67. package/dist/vite/node/chunks/postcss-import.js +11 -11
  68. package/dist/vite/node/cli.js +3 -4
  69. package/dist/vite/node/index.d.ts +1284 -1285
  70. package/dist/vite/node/index.js +1 -2
  71. package/dist/vite/node/module-runner.d.ts +76 -77
  72. package/dist/vite/node/module-runner.js +6 -7
  73. package/package.json +20 -18
  74. package/dist/rolldown/shared/define-config-BBz954-q.d.mts +0 -3901
  75. package/dist/rolldown/shared/get-log-filter-BpNVNJ5-.d.mts +0 -35
  76. package/dist/rolldown/shared/transform-CEmFsvJW.d.mts +0 -149
  77. package/dist/tsdown/debug-DLdR-9XB-DQZ6QLC0.js +0 -250
  78. package/dist/tsdown/dist-CZtGyfn3.js +0 -200
  79. package/dist/tsdown/dist-CqbVlnVq.js +0 -32057
  80. package/dist/tsdown/general-Cp4NiJNK-CbyrS9q1.js +0 -97
  81. package/dist/tsdown/internal-bfoxcI4F.js +0 -3
  82. package/dist/tsdown/npm_cjs_chunk_range.cjs +0 -474
  83. package/dist/tsdown/npm_cjs_chunk_semver.cjs +0 -357
  84. package/dist/tsdown/npm_entry_semver_functions_coerce.cjs +0 -52
  85. package/dist/tsdown/npm_entry_semver_functions_satisfies.cjs +0 -19
  86. package/dist/tsdown/npm_entry_semver_ranges_min-version.cjs +0 -46
  87. package/dist/tsdown/target-CqeSqtms-FAqYuGyB.js +0 -79
  88. package/dist/vite/node/chunks/logger.js +0 -361
@@ -1,8 +1,7 @@
1
- import { B as ResolveResult, C as BindingViteManifestPluginConfig, G as isolatedDeclaration, I as NapiResolveOptions, K as isolatedDeclarationSync, M as IsolatedDeclarationsResult, O as BindingViteTransformPluginConfig, V as ResolverFactory, _ as BindingTsconfigRawOptions, f as BindingRebuildStrategy, g as BindingTsconfigCompilerOptions, i as BindingClientHmrUpdate, j as IsolatedDeclarationsOptions, n as BindingBundleAnalyzerPluginConfig, q as moduleRunnerTransform, r as BindingBundleState } from "./shared/binding-B1q9aYT-.mjs";
2
- import { Jt as RolldownOutput, P as BuiltinPlugin, Ut as StringOrRegExp, Xt as freeExternalMemory, Z as defineParallelPlugin, ct as NormalizedOutputOptions, l as InputOptions, zt as OutputOptions } from "./shared/define-config-BBz954-q.mjs";
3
- import { a as MinifyOptions$1, c as minifySync$1, d as parse$1, f as parseSync$1, i as transformSync$1, l as ParseResult$1, m as resolveTsconfig, n as TransformResult$1, o as MinifyResult$1, p as TsconfigCache$1, r as transform$1, s as minify$1, t as TransformOptions$1, u as ParserOptions$1 } from "./shared/transform-CEmFsvJW.mjs";
4
- import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-2i1T9YcF.mjs";
5
-
1
+ import { H as ResolverFactory, J as moduleRunnerTransform, K as isolatedDeclaration, L as NapiResolveOptions, M as IsolatedDeclarationsOptions, N as IsolatedDeclarationsResult, V as ResolveResult, _ as BindingTsconfigCompilerOptions, i as BindingClientHmrUpdate, k as BindingViteTransformPluginConfig, n as BindingBundleAnalyzerPluginConfig, p as BindingRebuildStrategy, q as isolatedDeclarationSync, r as BindingBundleState, u as BindingLazyChunkOutput, v as BindingTsconfigRawOptions, w as BindingViteManifestPluginConfig } from "./shared/binding-Dbbi0RbO.mjs";
2
+ import { Bt as OutputOptions, F as BuiltinPlugin, Q as defineParallelPlugin, Wt as StringOrRegExp, Yt as RolldownOutput, Zt as freeExternalMemory, l as InputOptions, lt as NormalizedOutputOptions } from "./shared/define-config-B-IDOhDz.mjs";
3
+ import { a as MinifyOptions$1, c as minifySync$1, d as parse$1, f as parseSync$1, i as transformSync$1, l as ParseResult$1, m as resolveTsconfig, n as TransformResult$1, o as MinifyResult$1, p as TsconfigCache$1, r as transform$1, s as minify$1, t as TransformOptions$1, u as ParserOptions$1 } from "./shared/transform-Cs2bUDRH.mjs";
4
+ import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-CSWbNgBZ.mjs";
6
5
  //#region src/api/dev/dev-options.d.ts
7
6
  type DevOnHmrUpdates = (result: Error | {
8
7
  updates: BindingClientHmrUpdate[];
@@ -12,80 +11,81 @@ type DevOnOutput = (result: Error | RolldownOutput) => void | Promise<void>;
12
11
  type DevOnAdditionalAssets = (output: RolldownOutput) => void | Promise<void>;
13
12
  interface DevWatchOptions {
14
13
  /**
15
- * If `true`, files are not written to disk.
16
- * @default false
17
- */
14
+ * If `true`, files are not written to disk.
15
+ * @default false
16
+ */
18
17
  skipWrite?: boolean;
19
18
  /**
20
- * If `true`, use polling instead of native file system events for watching.
21
- * @default false
22
- */
19
+ * If `true`, use polling instead of native file system events for watching.
20
+ * @default false
21
+ */
23
22
  usePolling?: boolean;
24
23
  /**
25
- * Poll interval in milliseconds (only used when usePolling is true).
26
- * @default 100
27
- */
24
+ * Poll interval in milliseconds (only used when usePolling is true).
25
+ * @default 100
26
+ */
28
27
  pollInterval?: number;
29
28
  /**
30
- * If `true`, use debounced watcher. If `false`, use non-debounced watcher for immediate responses.
31
- * @default true
32
- */
29
+ * If `true`, use debounced watcher. If `false`, use non-debounced watcher for immediate responses.
30
+ * @default true
31
+ */
33
32
  useDebounce?: boolean;
34
33
  /**
35
- * Debounce duration in milliseconds (only used when useDebounce is true).
36
- * @default 10
37
- */
34
+ * Debounce duration in milliseconds (only used when useDebounce is true).
35
+ * @default 10
36
+ */
38
37
  debounceDuration?: number;
39
38
  /**
40
- * Whether to compare file contents for poll-based watchers (only used when usePolling is true).
41
- * When enabled, poll watchers will check file contents to determine if they actually changed.
42
- * @default false
43
- */
39
+ * Whether to compare file contents for poll-based watchers (only used when usePolling is true).
40
+ * When enabled, poll watchers will check file contents to determine if they actually changed.
41
+ * @default false
42
+ */
44
43
  compareContentsForPolling?: boolean;
45
44
  /**
46
- * Tick rate in milliseconds for debounced watchers (only used when useDebounce is true).
47
- * Controls how frequently the debouncer checks for events to process.
48
- * When not specified, the debouncer will auto-select an appropriate tick rate (1/4 of the debounce duration).
49
- * @default undefined (auto-select)
50
- */
45
+ * Tick rate in milliseconds for debounced watchers (only used when useDebounce is true).
46
+ * Controls how frequently the debouncer checks for events to process.
47
+ * When not specified, the debouncer will auto-select an appropriate tick rate (1/4 of the debounce duration).
48
+ * @default undefined (auto-select)
49
+ */
51
50
  debounceTickRate?: number;
52
51
  /**
53
- * Filter to limit which discovered files are registered with the file watcher.
54
- *
55
- * Strings are treated as glob patterns.
56
- *
57
- * @default []
58
- */
52
+ * Filter to limit which discovered files are registered with the file watcher.
53
+ *
54
+ * Strings are treated as glob patterns.
55
+ *
56
+ * @default []
57
+ */
59
58
  include?: StringOrRegExp | StringOrRegExp[];
60
59
  /**
61
- * Filter to prevent discovered files from being registered with the file watcher.
62
- *
63
- * Strings are treated as glob patterns.
64
- *
65
- * @default []
66
- */
60
+ * Filter to prevent discovered files from being registered with the file watcher.
61
+ *
62
+ * Strings are treated as glob patterns.
63
+ *
64
+ * @default []
65
+ */
67
66
  exclude?: StringOrRegExp | StringOrRegExp[];
68
67
  }
69
68
  interface DevOptions {
70
69
  onHmrUpdates?: DevOnHmrUpdates;
71
70
  onOutput?: DevOnOutput;
72
71
  /**
73
- * Called with assets emitted while generating an HMR patch or compiling a
74
- * lazy entry (e.g. an image newly imported by the changed/lazy module).
75
- *
76
- * These never go through {@link onOutput}, so a consumer that serves built
77
- * files (e.g. Vite's bundled dev server) must register this to receive them
78
- * and write them to its in-memory file store before the client requests them.
79
- */
72
+ * Called with assets emitted while generating an HMR patch or compiling a
73
+ * lazy entry (e.g. an image newly imported by the changed/lazy module).
74
+ *
75
+ * These never go through {@link onOutput}, so a consumer that serves built
76
+ * files (e.g. Vite's bundled dev server) must register this to receive them
77
+ * and write them to its in-memory file store before the client requests them.
78
+ */
80
79
  onAdditionalAssets?: DevOnAdditionalAssets;
81
80
  /**
82
- * Strategy for triggering rebuilds after HMR updates.
83
- * - `'always'`: Always trigger a rebuild after HMR updates
84
- * - `'auto'`: Trigger rebuild only if HMR updates contain full reload updates
85
- * - `'never'`: Never trigger rebuild after HMR updates (default)
86
- * @default 'auto'
87
- */
88
- rebuildStrategy?: "always" | "auto" | "never";
81
+ * Strategy for triggering rebuilds after HMR updates.
82
+ * - `'always'`: Always trigger a rebuild after HMR updates
83
+ * - `'never'`: Never trigger rebuild after HMR updates. The server no longer
84
+ * decides full reloads, so there is no `'auto'` upgrade anymore; pull fresh
85
+ * bundle output explicitly (e.g. `ensureLatestBuildOutput`) when needed.
86
+ * @default 'never'
87
+ */
88
+ rebuildStrategy?: "always" | "never";
89
89
  watch?: DevWatchOptions;
90
90
  }
91
91
  //#endregion
@@ -99,22 +99,31 @@ declare class DevEngine {
99
99
  getBundleState(): Promise<BindingBundleState>;
100
100
  ensureLatestBuildOutput(): Promise<void>;
101
101
  triggerFullBuild(): void;
102
- invalidate(file: string, firstInvalidatedBy?: string): Promise<BindingClientHmrUpdate[]>;
103
- registerModules(clientId: string, modules: string[]): Promise<void>;
102
+ /**
103
+ * Client-connect signal (the clientId hello): creates the per-client session
104
+ * with an empty ship map. Reconnects arrive as fresh clientIds.
105
+ */
106
+ registerClient(clientId: string): Promise<void>;
107
+ /**
108
+ * Delivery notification from the serving middleware: the response for
109
+ * `filename` completed, so record its modules as shipped to that client.
110
+ */
111
+ notifyPayloadDelivered(filename: string): Promise<void>;
104
112
  removeClient(clientId: string): Promise<void>;
105
113
  close(): Promise<void>;
106
114
  /**
107
- * Compile a lazy entry module and return HMR-style patch code.
108
- *
109
- * This is called when a dynamically imported module is first requested at runtime.
110
- * The module was previously stubbed with a proxy, and now we need to compile the
111
- * actual module and its dependencies.
112
- *
113
- * @param moduleId - The absolute file path of the module to compile
114
- * @param clientId - The client ID requesting this compilation
115
- * @returns The compiled JavaScript code as a string (HMR patch format)
116
- */
117
- compileEntry(moduleId: string, clientId: string): Promise<string>;
115
+ * Compile a lazy entry module and return HMR-style patch code.
116
+ *
117
+ * This is called when a dynamically imported module is first requested at runtime.
118
+ * The module was previously stubbed with a proxy, and now we need to compile the
119
+ * actual module and its dependencies.
120
+ *
121
+ * @param moduleId - The absolute file path of the module to compile
122
+ * @param clientId - The client ID requesting this compilation
123
+ * @returns The compiled chunk: its code plus the filename whose delivery the
124
+ * serving middleware reports via {@link notifyPayloadDelivered}
125
+ */
126
+ compileEntry(moduleId: string, clientId: string): Promise<BindingLazyChunkOutput>;
118
127
  }
119
128
  //#endregion
120
129
  //#region src/api/dev/index.d.ts
@@ -122,20 +131,20 @@ declare const dev: typeof DevEngine.create;
122
131
  //#endregion
123
132
  //#region src/api/experimental.d.ts
124
133
  /**
125
- * This is an experimental API. Its behavior may change in the future.
126
- *
127
- * - Calling this API will only execute the `scan/build` stage of rolldown.
128
- * - `scan` will clean up all resources automatically, but if you want to ensure timely cleanup, you need to wait for the returned promise to resolve.
129
- *
130
- * @example To ensure cleanup of resources, use the returned promise to wait for the scan to complete.
131
- * ```ts
132
- * import { scan } from 'rolldown/api/experimental';
133
- *
134
- * const cleanupPromise = await scan(...);
135
- * await cleanupPromise;
136
- * // Now all resources have been cleaned up.
137
- * ```
138
- */
134
+ * This is an experimental API. Its behavior may change in the future.
135
+ *
136
+ * - Calling this API will only execute the `scan/build` stage of rolldown.
137
+ * - `scan` will clean up all resources automatically, but if you want to ensure timely cleanup, you need to wait for the returned promise to resolve.
138
+ *
139
+ * @example To ensure cleanup of resources, use the returned promise to wait for the scan to complete.
140
+ * ```ts
141
+ * import { scan } from 'rolldown/api/experimental';
142
+ *
143
+ * const cleanupPromise = await scan(...);
144
+ * await cleanupPromise;
145
+ * // Now all resources have been cleaned up.
146
+ * ```
147
+ */
139
148
  declare const scan: (rawInputOptions: InputOptions, rawOutputOptions?: {}) => Promise<Promise<void>>;
140
149
  //#endregion
141
150
  //#region src/builtin-plugin/alias-plugin.d.ts
@@ -149,53 +158,53 @@ declare function viteAliasPlugin(config: ViteAliasPluginConfig): BuiltinPlugin;
149
158
  //#endregion
150
159
  //#region src/builtin-plugin/bundle-analyzer-plugin.d.ts
151
160
  /**
152
- * A plugin that analyzes bundle composition and generates detailed reports.
153
- *
154
- * The plugin outputs a file containing detailed information about:
155
- * - All chunks and their relationships
156
- * - Modules bundled in each chunk
157
- * - Import dependencies between chunks
158
- * - Reachable modules from each entry point
159
- *
160
- * @example
161
- * ```js
162
- * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
163
- *
164
- * export default {
165
- * plugins: [
166
- * bundleAnalyzerPlugin()
167
- * ]
168
- * }
169
- * ```
170
- *
171
- * @example
172
- * **Custom filename**
173
- * ```js
174
- * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
175
- *
176
- * export default {
177
- * plugins: [
178
- * bundleAnalyzerPlugin({
179
- * fileName: 'bundle-analysis.json'
180
- * })
181
- * ]
182
- * }
183
- * ```
184
- *
185
- * @example
186
- * **LLM-friendly markdown output**
187
- * ```js
188
- * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
189
- *
190
- * export default {
191
- * plugins: [
192
- * bundleAnalyzerPlugin({
193
- * format: 'md'
194
- * })
195
- * ]
196
- * }
197
- * ```
198
- */
161
+ * A plugin that analyzes bundle composition and generates detailed reports.
162
+ *
163
+ * The plugin outputs a file containing detailed information about:
164
+ * - All chunks and their relationships
165
+ * - Modules bundled in each chunk
166
+ * - Import dependencies between chunks
167
+ * - Reachable modules from each entry point
168
+ *
169
+ * @example
170
+ * ```js
171
+ * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
172
+ *
173
+ * export default {
174
+ * plugins: [
175
+ * bundleAnalyzerPlugin()
176
+ * ]
177
+ * }
178
+ * ```
179
+ *
180
+ * @example
181
+ * **Custom filename**
182
+ * ```js
183
+ * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
184
+ *
185
+ * export default {
186
+ * plugins: [
187
+ * bundleAnalyzerPlugin({
188
+ * fileName: 'bundle-analysis.json'
189
+ * })
190
+ * ]
191
+ * }
192
+ * ```
193
+ *
194
+ * @example
195
+ * **LLM-friendly markdown output**
196
+ * ```js
197
+ * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
198
+ *
199
+ * export default {
200
+ * plugins: [
201
+ * bundleAnalyzerPlugin({
202
+ * format: 'md'
203
+ * })
204
+ * ]
205
+ * }
206
+ * ```
207
+ */
199
208
  declare function bundleAnalyzerPlugin(config?: BindingBundleAnalyzerPluginConfig): BuiltinPlugin;
200
209
  //#endregion
201
210
  //#region src/builtin-plugin/transform-plugin.d.ts
@@ -216,32 +225,32 @@ declare function viteManifestPlugin(config: ViteManifestPluginConfig): BuiltinPl
216
225
  //#endregion
217
226
  //#region src/experimental-index.d.ts
218
227
  /**
219
- * In-memory file system for browser builds.
220
- *
221
- * This is a re-export of the {@link https://github.com/streamich/memfs | memfs} package used by the WASI runtime.
222
- * It allows you to read and write files to a virtual filesystem when using rolldown in browser environments.
223
- *
224
- * - `fs`: A Node.js-compatible filesystem API (`IFs` from memfs)
225
- * - `volume`: The underlying `Volume` instance that stores the filesystem state
226
- *
227
- * Returns `undefined` in Node.js builds (only available in browser builds via `@rolldown/browser`).
228
- *
229
- * @example
230
- * ```typescript
231
- * import { memfs } from 'rolldown/experimental';
232
- *
233
- * // Write files to virtual filesystem before bundling
234
- * memfs?.volume.fromJSON({
235
- * '/src/index.js': 'export const foo = 42;',
236
- * '/package.json': '{"name": "my-app"}'
237
- * });
238
- *
239
- * // Read files from the virtual filesystem
240
- * const content = memfs?.fs.readFileSync('/src/index.js', 'utf8');
241
- * ```
242
- *
243
- * @see {@link https://github.com/streamich/memfs} for more information on the memfs API.
244
- */
228
+ * In-memory file system for browser builds.
229
+ *
230
+ * This is a re-export of the {@link https://github.com/streamich/memfs | memfs} package used by the WASI runtime.
231
+ * It allows you to read and write files to a virtual filesystem when using rolldown in browser environments.
232
+ *
233
+ * - `fs`: A Node.js-compatible filesystem API (`IFs` from memfs)
234
+ * - `volume`: The underlying `Volume` instance that stores the filesystem state
235
+ *
236
+ * Returns `undefined` in Node.js builds (only available in browser builds via `@rolldown/browser`).
237
+ *
238
+ * @example
239
+ * ```typescript
240
+ * import { memfs } from 'rolldown/experimental';
241
+ *
242
+ * // Write files to virtual filesystem before bundling
243
+ * memfs?.volume.fromJSON({
244
+ * '/src/index.js': 'export const foo = 42;',
245
+ * '/package.json': '{"name": "my-app"}'
246
+ * });
247
+ *
248
+ * // Read files from the virtual filesystem
249
+ * const content = memfs?.fs.readFileSync('/src/index.js', 'utf8');
250
+ * ```
251
+ *
252
+ * @see {@link https://github.com/streamich/memfs} for more information on the memfs API.
253
+ */
245
254
  declare const memfs: {
246
255
  fs: any;
247
256
  volume: any;
@@ -1,11 +1,11 @@
1
- import { n as __toESM, t as require_binding } from "./shared/binding-BmkJW3Wy.mjs";
2
- import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-BYkbbGqQ.mjs";
3
- import { o as transformToRollupOutput } from "./shared/bindingify-input-options-Cmm60vfj.mjs";
4
- import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-Cs2iVJuw.mjs";
5
- import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-BlQ0-ek7.mjs";
6
- import { n as parseSync$1, t as parse$1 } from "./shared/parse-Dphnedsw.mjs";
7
- import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-CE6zZSUt.mjs";
8
- import { a as minify$1, i as transformSync$1, n as resolveTsconfig, o as minifySync$1, r as transform$1, t as TsconfigCache$1 } from "./shared/resolve-tsconfig-CdIAR1Eb.mjs";
1
+ import { n as __toESM, t as require_binding } from "./shared/binding-Dby9rwGk.mjs";
2
+ import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-SiXbePVH.mjs";
3
+ import { o as transformToRollupOutput } from "./shared/bindingify-input-options-DVQ4K-zY.mjs";
4
+ import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-BGXNOfvH.mjs";
5
+ import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-DFGNOCle.mjs";
6
+ import { n as parseSync$1, t as parse$1 } from "./shared/parse-D5dkElpf.mjs";
7
+ import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-CuGa75s-.mjs";
8
+ import { a as minify$1, i as transformSync$1, n as resolveTsconfig, o as minifySync$1, r as transform$1, t as TsconfigCache$1 } from "./shared/resolve-tsconfig-2TXRF_zr.mjs";
9
9
  import { pathToFileURL } from "node:url";
10
10
  //#region src/api/dev/dev-engine.ts
11
11
  var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
@@ -44,7 +44,7 @@ var DevEngine = class DevEngine {
44
44
  onAdditionalAssets: userOnAdditionalAssets ? function(output) {
45
45
  userOnAdditionalAssets(transformToRollupOutput(output));
46
46
  } : void 0,
47
- rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? import_binding.BindingRebuildStrategy.Always : devOptions.rebuildStrategy === "auto" ? import_binding.BindingRebuildStrategy.Auto : import_binding.BindingRebuildStrategy.Never : void 0,
47
+ rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? import_binding.BindingRebuildStrategy.Always : import_binding.BindingRebuildStrategy.Never : void 0,
48
48
  watch: devOptions.watch && {
49
49
  skipWrite: devOptions.watch.skipWrite,
50
50
  usePolling: devOptions.watch.usePolling,
@@ -83,11 +83,19 @@ var DevEngine = class DevEngine {
83
83
  triggerFullBuild() {
84
84
  this.#inner.triggerFullBuild();
85
85
  }
86
- async invalidate(file, firstInvalidatedBy) {
87
- return unwrapBindingResult(await this.#inner.invalidate(file, firstInvalidatedBy));
86
+ /**
87
+ * Client-connect signal (the clientId hello): creates the per-client session
88
+ * with an empty ship map. Reconnects arrive as fresh clientIds.
89
+ */
90
+ async registerClient(clientId) {
91
+ await this.#inner.registerClient(clientId);
88
92
  }
89
- async registerModules(clientId, modules) {
90
- await this.#inner.registerModules(clientId, modules);
93
+ /**
94
+ * Delivery notification from the serving middleware: the response for
95
+ * `filename` completed, so record its modules as shipped to that client.
96
+ */
97
+ async notifyPayloadDelivered(filename) {
98
+ await this.#inner.notifyPayloadDelivered(filename);
91
99
  }
92
100
  async removeClient(clientId) {
93
101
  await this.#inner.removeClient(clientId);
@@ -104,7 +112,8 @@ var DevEngine = class DevEngine {
104
112
  *
105
113
  * @param moduleId - The absolute file path of the module to compile
106
114
  * @param clientId - The client ID requesting this compilation
107
- * @returns The compiled JavaScript code as a string (HMR patch format)
115
+ * @returns The compiled chunk: its code plus the filename whose delivery the
116
+ * serving middleware reports via {@link notifyPayloadDelivered}
108
117
  */
109
118
  async compileEntry(moduleId, clientId) {
110
119
  return this.#inner.compileEntry(moduleId, clientId);
@@ -1,31 +1,87 @@
1
1
  /**
2
- * @typedef {{ type: 'hmr:module-registered', modules: string[] }} DevRuntimeMessage
3
- * @typedef {{ send(message: DevRuntimeMessage): void }} Messenger
2
+ * Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
3
+ * `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
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
6
+ * @typedef {{ createModuleHotContext(moduleId: string): any, onModuleCacheRemoval(moduleId: string): void }} DevRuntimeHooks
4
7
  */
8
+ export class MissingFactoryError {
9
+ /**
10
+ * @param {string} id
11
+ */
12
+ constructor(id: string);
13
+ id: string;
14
+ }
5
15
  export class DevRuntime {
6
16
  /**
7
- * @param {Messenger} messenger
8
17
  * @param {string} clientId
9
18
  */
10
- constructor(messenger: Messenger, clientId: string);
19
+ constructor(clientId: string);
11
20
  /**
12
21
  * Client ID generated at runtime initialization, used for lazy compilation requests.
13
22
  * @type {string}
14
23
  */
15
24
  clientId: string;
16
- messenger: Messenger;
17
25
  /**
18
- * @type {Record<string, Module>}
26
+ * Static import edges from `registerGraph` — entries persist across `removeModuleCache`
27
+ * and change only by replacement from a newer payload (last write wins).
28
+ * @type {Map<string, { edges: string[] }>}
19
29
  */
20
- modules: Record<string, Module>;
30
+ staticImports: Map<string, {
31
+ edges: string[];
32
+ }>;
21
33
  /**
22
- * @param {string} _moduleId
34
+ * Reverse index over the static imports.
35
+ * @type {Map<string, Set<string>>}
23
36
  */
24
- createModuleHotContext(_moduleId: string): void;
37
+ importers: Map<string, Set<string>>;
25
38
  /**
26
- * @param {[string, string][]} _boundaries
39
+ * Dynamic `import()` edges from `registerGraph`, keyed by importer — mirror of
40
+ * `staticImports` for the dynamic reverse index.
41
+ * @type {Map<string, { edges: string[] }>}
27
42
  */
28
- applyUpdates(_boundaries: [string, string][]): void;
43
+ dynamicImports: Map<string, {
44
+ edges: string[];
45
+ }>;
46
+ /**
47
+ * Reverse index over the dynamic imports.
48
+ * @type {Map<string, Set<string>>}
49
+ */
50
+ dynamicImporters: Map<string, Set<string>>;
51
+ /**
52
+ * The module cache. Membership means "this module's side effects ran in this tab" —
53
+ * registration is emitted ahead of every module body, and nothing un-registers on
54
+ * unwind, so a factory that throws mid-body stays registered. A `Map` rather than a
55
+ * plain object: HMR eviction deletes entries, and a `delete` on an object drops V8
56
+ * into dictionary mode, taxing every later lookup on the hottest read path.
57
+ * @type {Map<string, Module>}
58
+ */
59
+ moduleCache: Map<string, Module>;
60
+ /**
61
+ * Re-runnable factories from HMR patches and lazy chunks. The initial bundle stays
62
+ * scope-hoisted and contributes none.
63
+ * @type {Map<string, { kind: 'esm' | 'cjs', fn: (id: string) => void }>}
64
+ */
65
+ factories: Map<string, {
66
+ kind: "esm" | "cjs";
67
+ fn: (id: string) => void;
68
+ }>;
69
+ /**
70
+ * Installed by the dev client at boot. The runtime is a store + executor and makes
71
+ * no HMR decisions; accepting, disposing, and reloading live behind these hooks.
72
+ * @type {DevRuntimeHooks | null}
73
+ */
74
+ hooks: DevRuntimeHooks | null;
75
+ /**
76
+ * @param {ModuleGraphDelta} delta
77
+ */
78
+ registerGraph(delta: ModuleGraphDelta): void;
79
+ /**
80
+ * @param {string} id
81
+ * @param {'esm' | 'cjs'} kind
82
+ * @param {(id: string) => void} fn
83
+ */
84
+ registerFactory(id: string, kind: "esm" | "cjs", fn: (id: string) => void): void;
29
85
  /**
30
86
  * @param {string} id
31
87
  * @param {{ exports: any }} exportsHolder
@@ -35,35 +91,37 @@ export class DevRuntime {
35
91
  }): void;
36
92
  /**
37
93
  * @param {string} id
94
+ * @returns {string[]}
38
95
  */
39
- loadExports(id: string): any;
96
+ getImporters(id: string): string[];
40
97
  /**
41
- * __esmMin
42
- *
43
- * When `dedup` is truthy and `id` is already registered on the runtime,
44
- * skip the factory: another lazy blob got there first. HMR patches pass
45
- * no `dedup` so they always re-run the factory and replace the registered
46
- * exports.
47
- *
48
- * @type {<T>(id: string, fn: any, dedup: any, res: T) => () => T}
49
- * @internal
98
+ * @param {string} id
50
99
  */
51
- createEsmInitializer: <T>(id: string, fn: any, dedup: any, res: T) => () => T;
100
+ isExecuted(id: string): any;
52
101
  /**
53
- * __commonJSMin
54
- *
55
- * Same dedup gate as createEsmInitializer. With `dedup` truthy and `id`
56
- * registered, reuse the registered exports object; otherwise run the
57
- * factory.
58
- *
59
- * @type {<T extends { exports: any }>(id: string, cb: any, dedup: any, mod: { exports: any }, registered: any) => () => T}
60
- * @internal
102
+ * @param {string} id
61
103
  */
62
- createCjsInitializer: <T extends {
63
- exports: any;
64
- }>(id: string, cb: any, dedup: any, mod: {
65
- exports: any;
66
- }, registered: any) => () => T;
104
+ hasFactory(id: string): any;
105
+ /**
106
+ * Module-cache delete only — static imports and factories persist. Removal is what
107
+ * re-arms a cache-gated factory for `initModule`.
108
+ * @param {string} id
109
+ */
110
+ removeModuleCache(id: string): void;
111
+ /**
112
+ * The one re-execution gate: registered → return the live exports; otherwise run the
113
+ * mapped factory (which registers itself first, then runs the body).
114
+ * @param {string} id
115
+ */
116
+ initModule(id: string): any;
117
+ /**
118
+ * @param {string} id
119
+ */
120
+ loadExports(id: string): any;
121
+ /**
122
+ * @param {string} moduleId
123
+ */
124
+ createModuleHotContext(moduleId: string): any;
67
125
  /** @internal */
68
126
  __toESM: any;
69
127
  /** @internal */
@@ -78,14 +136,26 @@ export class DevRuntime {
78
136
  __toDynamicImportESM: (isNodeMode?: boolean) => (mod: any) => any;
79
137
  /** @internal */
80
138
  __reExport: any;
81
- sendModuleRegisteredMessage: (module: string) => void;
82
139
  }
83
- export type DevRuntimeMessage = {
84
- type: "hmr:module-registered";
85
- modules: string[];
140
+ /**
141
+ * Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
142
+ * `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
143
+ * `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
144
+ */
145
+ export type ModuleGraphDelta = {
146
+ ids: string[];
147
+ localCount: number;
148
+ edges: number[][];
149
+ dynamicEdges?: number[][];
86
150
  };
87
- export type Messenger = {
88
- send(message: DevRuntimeMessage): void;
151
+ /**
152
+ * Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
153
+ * `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
154
+ * `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
155
+ */
156
+ export type DevRuntimeHooks = {
157
+ createModuleHotContext(moduleId: string): any;
158
+ onModuleCacheRemoval(moduleId: string): void;
89
159
  };
90
160
  declare class Module {
91
161
  /**