@rollipop/rolldown 1.0.24 → 1.0.26
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.
- package/THIRD-PARTY-LICENSE +33 -0
- package/dist/cli.mjs +9 -10
- package/dist/config.d.mts +16 -17
- package/dist/config.mjs +2 -2
- package/dist/experimental-default-runtime.mjs +116 -0
- package/dist/experimental-index.d.mts +220 -205
- package/dist/experimental-index.mjs +47 -22
- package/dist/experimental-runtime-base.mjs +95 -0
- package/dist/experimental-runtime-types.d.ts +111 -41
- package/dist/experimental-runtime.d.ts +177 -0
- package/dist/experimental-runtime.mjs +257 -0
- package/dist/filter-index.d.mts +6 -5
- package/dist/filter-index.mjs +1 -3
- package/dist/get-log-filter.d.mts +2 -2
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +4 -4
- package/dist/parallel-plugin-worker.mjs +2 -2
- package/dist/parallel-plugin.d.mts +3 -4
- package/dist/parse-ast-index.d.mts +19 -20
- package/dist/parse-ast-index.mjs +2 -2
- package/dist/plugins-index.d.mts +27 -28
- package/dist/plugins-index.mjs +2 -2
- package/dist/shared/{binding-DLP3kSP5.mjs → binding-D_XVvOPT.mjs} +124 -50
- package/dist/shared/{binding-FraDreAW.d.mts → binding-We_IfeZk.d.mts} +48 -25
- package/dist/shared/{bindingify-input-options-DQnooxIa.mjs → bindingify-input-options-BXQG8xz-.mjs} +213 -262
- package/dist/shared/{constructors-CXtPAgZN.d.mts → constructors-BIHQ8UmW.d.mts} +9 -10
- package/dist/shared/{constructors-DpCCe7z3.mjs → constructors-CNB5XL7Q.mjs} +10 -6
- package/dist/shared/{rolldown-build-Blclcr5k.mjs → create-bundler-option-Be4KJzGL.mjs} +39 -156
- package/dist/shared/define-config-thpMQ05a.d.mts +4096 -0
- package/dist/shared/{error-CIdnbKmG.mjs → error-bm-jLrD1.mjs} +1 -1
- package/dist/shared/get-log-filter-B6CU6b90.d.mts +34 -0
- package/dist/shared/{load-config-5r6l-9qr.mjs → load-config-Bu7-JwX4.mjs} +2 -2
- package/dist/shared/{logging-BSNejiLS.d.mts → logging-xuHO4mAy.d.mts} +6 -6
- package/dist/shared/{logs-ZGEh6uhb.mjs → logs-DmYCAKcW.mjs} +8 -1
- package/dist/shared/{misc-CoQm4NHO.mjs → misc-DOSKtd97.mjs} +9 -1
- package/dist/shared/{normalize-string-or-regex-oITfWWWc.mjs → normalize-string-or-regex-CiPu-0L6.mjs} +2 -2
- package/dist/shared/{parse-CI_bqXWS.mjs → parse-DFZrcERz.mjs} +2 -2
- package/dist/shared/{prompt--dNycKSZ.mjs → prompt-CH6TK0bC.mjs} +2 -6
- package/dist/shared/{resolve-tsconfig-9cpL_qUM.mjs → resolve-tsconfig-CsDgQmsO.mjs} +2 -2
- package/dist/shared/rolldown-CnVo3ESi.mjs +178 -0
- package/dist/shared/transform-CsZGbS4Q.d.mts +148 -0
- package/dist/shared/{watch-DElgNTzo.mjs → watch-WV6bq5kw.mjs} +16 -13
- package/dist/utils-index.d.mts +29 -30
- package/dist/utils-index.mjs +6 -8
- package/package.json +25 -16
- package/dist/shared/define-config-oNOGrLUX.d.mts +0 -4008
- package/dist/shared/get-log-filter-B4LpBryx.d.mts +0 -35
- package/dist/shared/rolldown-DBxQ1pTJ.mjs +0 -40
- package/dist/shared/transform-DmrnpNrQ.d.mts +0 -149
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
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-
|
|
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-
|
|
5
|
-
|
|
1
|
+
import { $ as isolatedDeclarationSync, E as BindingViteManifestPluginConfig, F as IsolatedDeclarationsResult, G as ResolveResult, K as ResolverFactory, P as IsolatedDeclarationsOptions, Q as isolatedDeclaration, X as clearCache, Z as clearCacheById, _ as BindingRollipopReactRefreshWrapperPluginConfig, b as BindingTsconfigRawOptions, et as moduleRunnerTransform, g as BindingRollipopReactNativeTransformResult, i as BindingClientHmrUpdate, j as BindingViteTransformPluginConfig, n as BindingBundleAnalyzerPluginConfig, p as BindingRebuildStrategy, r as BindingBundleState, u as BindingLazyChunkOutput, y as BindingTsconfigCompilerOptions, z as NapiResolveOptions } from "./shared/binding-We_IfeZk.mjs";
|
|
2
|
+
import { $ as defineParallelPlugin, Gt as StringOrRegExp, I as BuiltinPlugin, Qt as freeExternalMemory, Vt as OutputOptions, Xt as RolldownOutput, l as InputOptions, ut as NormalizedOutputOptions } from "./shared/define-config-thpMQ05a.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-CsZGbS4Q.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-BIHQ8UmW.mjs";
|
|
6
5
|
//#region src/api/dev/dev-options.d.ts
|
|
7
6
|
type DevOnHmrUpdates = (result: Error | {
|
|
8
7
|
updates: BindingClientHmrUpdate[];
|
|
@@ -12,80 +11,87 @@ type DevOnOutput = (result: Error | RolldownOutput) => void | Promise<void>;
|
|
|
12
11
|
type DevOnAdditionalAssets = (output: RolldownOutput) => void | Promise<void>;
|
|
13
12
|
interface DevWatchOptions {
|
|
14
13
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
* If `false`, no file system watcher is started, so file changes are never
|
|
15
|
+
* picked up and no rebuild or HMR update is triggered on their own.
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If `true`, files are not written to disk.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
18
23
|
skipWrite?: boolean;
|
|
19
24
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
* If `true`, use polling instead of native file system events for watching.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
23
28
|
usePolling?: boolean;
|
|
24
29
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
* Poll interval in milliseconds (only used when usePolling is true).
|
|
31
|
+
* @default 100
|
|
32
|
+
*/
|
|
28
33
|
pollInterval?: number;
|
|
29
34
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
* If `true`, use debounced watcher. If `false`, use non-debounced watcher for immediate responses.
|
|
36
|
+
* @default true
|
|
37
|
+
*/
|
|
33
38
|
useDebounce?: boolean;
|
|
34
39
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
* Debounce duration in milliseconds (only used when useDebounce is true).
|
|
41
|
+
* @default 10
|
|
42
|
+
*/
|
|
38
43
|
debounceDuration?: number;
|
|
39
44
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
* Whether to compare file contents for poll-based watchers (only used when usePolling is true).
|
|
46
|
+
* When enabled, poll watchers will check file contents to determine if they actually changed.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
44
49
|
compareContentsForPolling?: boolean;
|
|
45
50
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
* Tick rate in milliseconds for debounced watchers (only used when useDebounce is true).
|
|
52
|
+
* Controls how frequently the debouncer checks for events to process.
|
|
53
|
+
* When not specified, the debouncer will auto-select an appropriate tick rate (1/4 of the debounce duration).
|
|
54
|
+
* @default undefined (auto-select)
|
|
55
|
+
*/
|
|
51
56
|
debounceTickRate?: number;
|
|
52
57
|
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
* Filter to limit which discovered files are registered with the file watcher.
|
|
59
|
+
*
|
|
60
|
+
* Strings are treated as glob patterns.
|
|
61
|
+
*
|
|
62
|
+
* @default []
|
|
63
|
+
*/
|
|
59
64
|
include?: StringOrRegExp | StringOrRegExp[];
|
|
60
65
|
/**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
* Filter to prevent discovered files from being registered with the file watcher.
|
|
67
|
+
*
|
|
68
|
+
* Strings are treated as glob patterns.
|
|
69
|
+
*
|
|
70
|
+
* @default []
|
|
71
|
+
*/
|
|
67
72
|
exclude?: StringOrRegExp | StringOrRegExp[];
|
|
68
73
|
}
|
|
69
74
|
interface DevOptions {
|
|
70
75
|
onHmrUpdates?: DevOnHmrUpdates;
|
|
71
76
|
onOutput?: DevOnOutput;
|
|
72
77
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
* Called with assets emitted while generating an HMR patch or compiling a
|
|
79
|
+
* lazy entry (e.g. an image newly imported by the changed/lazy module).
|
|
80
|
+
*
|
|
81
|
+
* These never go through {@link onOutput}, so a consumer that serves built
|
|
82
|
+
* files (e.g. Vite's bundled dev server) must register this to receive them
|
|
83
|
+
* and write them to its in-memory file store before the client requests them.
|
|
84
|
+
*/
|
|
80
85
|
onAdditionalAssets?: DevOnAdditionalAssets;
|
|
81
86
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
* Strategy for triggering rebuilds after HMR updates.
|
|
88
|
+
* - `'always'`: Always trigger a rebuild after HMR updates
|
|
89
|
+
* - `'never'`: Never trigger rebuild after HMR updates. The server no longer
|
|
90
|
+
* decides full reloads, so there is no `'auto'` upgrade anymore; pull fresh
|
|
91
|
+
* bundle output explicitly (e.g. `ensureLatestBuildOutput`) when needed.
|
|
92
|
+
* @default 'never'
|
|
93
|
+
*/
|
|
94
|
+
rebuildStrategy?: "always" | "never";
|
|
89
95
|
watch?: DevWatchOptions;
|
|
90
96
|
}
|
|
91
97
|
//#endregion
|
|
@@ -99,22 +105,31 @@ declare class DevEngine {
|
|
|
99
105
|
getBundleState(): Promise<BindingBundleState>;
|
|
100
106
|
ensureLatestBuildOutput(): Promise<void>;
|
|
101
107
|
triggerFullBuild(): void;
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Client-connect signal (the clientId hello): creates the per-client session
|
|
110
|
+
* with an empty ship map. Reconnects arrive as fresh clientIds.
|
|
111
|
+
*/
|
|
112
|
+
registerClient(clientId: string): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Delivery notification from the serving middleware: the response for
|
|
115
|
+
* `filename` completed, so record its modules as shipped to that client.
|
|
116
|
+
*/
|
|
117
|
+
notifyPayloadDelivered(filename: string): Promise<void>;
|
|
104
118
|
removeClient(clientId: string): Promise<void>;
|
|
105
119
|
close(): Promise<void>;
|
|
106
120
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
* Compile a lazy entry module and return HMR-style patch code.
|
|
122
|
+
*
|
|
123
|
+
* This is called when a dynamically imported module is first requested at runtime.
|
|
124
|
+
* The module was previously stubbed with a proxy, and now we need to compile the
|
|
125
|
+
* actual module and its dependencies.
|
|
126
|
+
*
|
|
127
|
+
* @param moduleId - The absolute file path of the module to compile
|
|
128
|
+
* @param clientId - The client ID requesting this compilation
|
|
129
|
+
* @returns The compiled chunk: its code plus the filename whose delivery the
|
|
130
|
+
* serving middleware reports via {@link notifyPayloadDelivered}
|
|
131
|
+
*/
|
|
132
|
+
compileEntry(moduleId: string, clientId: string): Promise<BindingLazyChunkOutput>;
|
|
118
133
|
}
|
|
119
134
|
//#endregion
|
|
120
135
|
//#region src/api/dev/index.d.ts
|
|
@@ -122,20 +137,20 @@ declare const dev: typeof DevEngine.create;
|
|
|
122
137
|
//#endregion
|
|
123
138
|
//#region src/api/experimental.d.ts
|
|
124
139
|
/**
|
|
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 '@rollipop/rolldown/api/experimental';
|
|
133
|
-
*
|
|
134
|
-
* const cleanupPromise = await scan(...);
|
|
135
|
-
* await cleanupPromise;
|
|
136
|
-
* // Now all resources have been cleaned up.
|
|
137
|
-
* ```
|
|
138
|
-
*/
|
|
140
|
+
* This is an experimental API. Its behavior may change in the future.
|
|
141
|
+
*
|
|
142
|
+
* - Calling this API will only execute the `scan/build` stage of rolldown.
|
|
143
|
+
* - `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.
|
|
144
|
+
*
|
|
145
|
+
* @example To ensure cleanup of resources, use the returned promise to wait for the scan to complete.
|
|
146
|
+
* ```ts
|
|
147
|
+
* import { scan } from '@rollipop/rolldown/api/experimental';
|
|
148
|
+
*
|
|
149
|
+
* const cleanupPromise = await scan(...);
|
|
150
|
+
* await cleanupPromise;
|
|
151
|
+
* // Now all resources have been cleaned up.
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
139
154
|
declare const scan: (rawInputOptions: InputOptions, rawOutputOptions?: {}) => Promise<Promise<void>>;
|
|
140
155
|
//#endregion
|
|
141
156
|
//#region src/builtin-plugin/alias-plugin.d.ts
|
|
@@ -149,53 +164,53 @@ declare function viteAliasPlugin(config: ViteAliasPluginConfig): BuiltinPlugin;
|
|
|
149
164
|
//#endregion
|
|
150
165
|
//#region src/builtin-plugin/bundle-analyzer-plugin.d.ts
|
|
151
166
|
/**
|
|
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 '@rollipop/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 '@rollipop/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 '@rollipop/rolldown/experimental';
|
|
189
|
-
*
|
|
190
|
-
* export default {
|
|
191
|
-
* plugins: [
|
|
192
|
-
* bundleAnalyzerPlugin({
|
|
193
|
-
* format: 'md'
|
|
194
|
-
* })
|
|
195
|
-
* ]
|
|
196
|
-
* }
|
|
197
|
-
* ```
|
|
198
|
-
*/
|
|
167
|
+
* A plugin that analyzes bundle composition and generates detailed reports.
|
|
168
|
+
*
|
|
169
|
+
* The plugin outputs a file containing detailed information about:
|
|
170
|
+
* - All chunks and their relationships
|
|
171
|
+
* - Modules bundled in each chunk
|
|
172
|
+
* - Import dependencies between chunks
|
|
173
|
+
* - Reachable modules from each entry point
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```js
|
|
177
|
+
* import { bundleAnalyzerPlugin } from '@rollipop/rolldown/experimental';
|
|
178
|
+
*
|
|
179
|
+
* export default {
|
|
180
|
+
* plugins: [
|
|
181
|
+
* bundleAnalyzerPlugin()
|
|
182
|
+
* ]
|
|
183
|
+
* }
|
|
184
|
+
* ```
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* **Custom filename**
|
|
188
|
+
* ```js
|
|
189
|
+
* import { bundleAnalyzerPlugin } from '@rollipop/rolldown/experimental';
|
|
190
|
+
*
|
|
191
|
+
* export default {
|
|
192
|
+
* plugins: [
|
|
193
|
+
* bundleAnalyzerPlugin({
|
|
194
|
+
* fileName: 'bundle-analysis.json'
|
|
195
|
+
* })
|
|
196
|
+
* ]
|
|
197
|
+
* }
|
|
198
|
+
* ```
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* **LLM-friendly markdown output**
|
|
202
|
+
* ```js
|
|
203
|
+
* import { bundleAnalyzerPlugin } from '@rollipop/rolldown/experimental';
|
|
204
|
+
*
|
|
205
|
+
* export default {
|
|
206
|
+
* plugins: [
|
|
207
|
+
* bundleAnalyzerPlugin({
|
|
208
|
+
* format: 'md'
|
|
209
|
+
* })
|
|
210
|
+
* ]
|
|
211
|
+
* }
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
199
214
|
declare function bundleAnalyzerPlugin(config?: BindingBundleAnalyzerPluginConfig): BuiltinPlugin;
|
|
200
215
|
//#endregion
|
|
201
216
|
//#region src/builtin-plugin/transform-plugin.d.ts
|
|
@@ -221,11 +236,11 @@ declare function rollipopReactRefreshWrapperPlugin(config: BindingRollipopReactR
|
|
|
221
236
|
type RollipopReactNativeRuntimeTarget = "hermes" | "hermes-v1";
|
|
222
237
|
type RollipopReactNativeModuleType = "unambiguous" | "commonjs";
|
|
223
238
|
/**
|
|
224
|
-
* `react-native-worklets` transform configuration. Field semantics mirror
|
|
225
|
-
* the upstream Babel plugin's `WorkletsOptions`, minus the rolldown-managed
|
|
226
|
-
* fields (`filename`, `cwd`). Pass `worklets: {}` to opt in with defaults;
|
|
227
|
-
* omit the field entirely to skip the visitor.
|
|
228
|
-
*/
|
|
239
|
+
* `react-native-worklets` transform configuration. Field semantics mirror
|
|
240
|
+
* the upstream Babel plugin's `WorkletsOptions`, minus the rolldown-managed
|
|
241
|
+
* fields (`filename`, `cwd`). Pass `worklets: {}` to opt in with defaults;
|
|
242
|
+
* omit the field entirely to skip the visitor.
|
|
243
|
+
*/
|
|
229
244
|
interface RollipopReactNativeWorkletsConfig {
|
|
230
245
|
/** Identifiers treated as globals — never captured into worklet closures. */
|
|
231
246
|
globals?: string[];
|
|
@@ -249,29 +264,29 @@ interface RollipopReactNativeWorkletsConfig {
|
|
|
249
264
|
pluginVersion?: string;
|
|
250
265
|
}
|
|
251
266
|
/**
|
|
252
|
-
* Flow handling configuration. Mirrors Babel's
|
|
253
|
-
* `@babel/plugin-transform-flow-strip-types` semantics.
|
|
254
|
-
*/
|
|
267
|
+
* Flow handling configuration. Mirrors Babel's
|
|
268
|
+
* `@babel/plugin-transform-flow-strip-types` semantics.
|
|
269
|
+
*/
|
|
255
270
|
interface RollipopReactNativeFlowConfig {
|
|
256
271
|
/**
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
272
|
+
* When `true`, only files containing `@flow` or `@noflow` directive comments are parsed as Flow (Babel `requireDirective: true`).
|
|
273
|
+
* When `false` (default), every JS module is parsed as Flow regardless of directive — matches Metro / Babel default behavior.
|
|
274
|
+
*/
|
|
260
275
|
requireDirective?: boolean;
|
|
261
276
|
}
|
|
262
277
|
/**
|
|
263
|
-
* React (JSX) transform configuration. Mirrors Babel's
|
|
264
|
-
* `@babel/plugin-transform-react-jsx`, minus dev-server-only knobs
|
|
265
|
-
* (fast refresh) — those belong to a bundler, not a precompile/test path.
|
|
266
|
-
*/
|
|
278
|
+
* React (JSX) transform configuration. Mirrors Babel's
|
|
279
|
+
* `@babel/plugin-transform-react-jsx`, minus dev-server-only knobs
|
|
280
|
+
* (fast refresh) — those belong to a bundler, not a precompile/test path.
|
|
281
|
+
*/
|
|
267
282
|
interface RollipopReactNativeReactConfig {
|
|
268
283
|
/**
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
284
|
+
* JSX runtime.
|
|
285
|
+
* - `"Preserve"` (default): leave JSX untouched — downstream bundler owns it.
|
|
286
|
+
* - `"Automatic"`: compile to `_jsx` / `_jsxs` / `Fragment` imports from
|
|
287
|
+
* `react/jsx-runtime` (or `react/jsx-dev-runtime` when `development`).
|
|
288
|
+
* - `"Classic"`: compile to `React.createElement` calls.
|
|
289
|
+
*/
|
|
275
290
|
runtime?: "Preserve" | "Automatic" | "Classic";
|
|
276
291
|
/** Import source for the automatic runtime. Defaults to `"react"`. */
|
|
277
292
|
importSource?: string;
|
|
@@ -282,31 +297,31 @@ interface RollipopReactNativeReactConfig {
|
|
|
282
297
|
/** Throw on XML namespace prefixes (e.g. `<svg:path>`). */
|
|
283
298
|
throwIfNamespace?: boolean;
|
|
284
299
|
/**
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
300
|
+
* When `true`, emits the development runtime (`__source` / `__self` debug
|
|
301
|
+
* props for automatic, `react/jsx-dev-runtime` import).
|
|
302
|
+
*/
|
|
288
303
|
development?: boolean;
|
|
289
304
|
}
|
|
290
305
|
interface RollipopReactNativeModuleConfig {
|
|
291
306
|
/**
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
307
|
+
* Module transform type.
|
|
308
|
+
* - `"unambiguous"` (default): preserve the input module shape.
|
|
309
|
+
* - `"commonjs"`: transform ESM syntax to CommonJS.
|
|
310
|
+
*/
|
|
296
311
|
type?: RollipopReactNativeModuleType;
|
|
297
312
|
}
|
|
298
313
|
/**
|
|
299
|
-
* SWC pipeline configuration — wasm plugins, helper emission, React transform.
|
|
300
|
-
*/
|
|
314
|
+
* SWC pipeline configuration — wasm plugins, helper emission, React transform.
|
|
315
|
+
*/
|
|
301
316
|
interface RollipopReactNativeSwcConfig {
|
|
302
317
|
/** SWC `.wasm` plugins to load. Each entry is `[pluginPath, pluginConfig]`. */
|
|
303
318
|
plugins?: [string, Record<string, unknown>][];
|
|
304
319
|
/**
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
320
|
+
* When `true`, runtime helpers are emitted as imports of `@swc/helpers` so
|
|
321
|
+
* a downstream bundler can deduplicate them. When `false` (default), helpers
|
|
322
|
+
* are inlined into each transformed file — preferred when feeding the
|
|
323
|
+
* output to a runtime (e.g. jest) without a bundle step in between.
|
|
324
|
+
*/
|
|
310
325
|
externalHelpers?: boolean;
|
|
311
326
|
/** React (JSX) transform configuration. Skipped when `runtime` is `"Preserve"`. */
|
|
312
327
|
react?: RollipopReactNativeReactConfig;
|
|
@@ -318,9 +333,9 @@ interface RollipopReactNativeSwcConfig {
|
|
|
318
333
|
interface RollipopReactNativePluginConfig {
|
|
319
334
|
runtimeTarget?: RollipopReactNativeRuntimeTarget;
|
|
320
335
|
/**
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
336
|
+
* The name of the `env` to use when loading configs and plugins. Defaults
|
|
337
|
+
* to the value of `SWC_ENV`, or else `NODE_ENV`, or else `"development"`.
|
|
338
|
+
*/
|
|
324
339
|
envName?: string;
|
|
325
340
|
/** `react-native-worklets` transform. Visitor is skipped when omitted. */
|
|
326
341
|
worklets?: RollipopReactNativeWorkletsConfig;
|
|
@@ -335,18 +350,18 @@ declare function rollipopReactNativePlugin(config?: RollipopReactNativePluginCon
|
|
|
335
350
|
type RollipopReactNativeTransformerConfig = RollipopReactNativePluginConfig;
|
|
336
351
|
type RollipopReactNativeTransformResult = BindingRollipopReactNativeTransformResult;
|
|
337
352
|
/**
|
|
338
|
-
* Standalone React Native SWC transform pipeline.
|
|
339
|
-
*
|
|
340
|
-
* Mirrors the behavior of {@link rollipopReactNativePlugin} but can be
|
|
341
|
-
* invoked directly outside of a rolldown build (e.g. from Metro adapters,
|
|
342
|
-
* test harnesses, or precompile steps). SWC `.wasm` plugins listed in the
|
|
343
|
-
* config are read from disk and compiled exactly once at construction
|
|
344
|
-
* time — call `transform` / `transformSync` repeatedly without reloading.
|
|
345
|
-
*
|
|
346
|
-
* All options pass through unchanged — `swc.externalHelpers` defaults to
|
|
347
|
-
* `false` (helpers inlined) and `swc.react.runtime` to `"Preserve"`, both
|
|
348
|
-
* matching the underlying Rust defaults. Set them explicitly when needed.
|
|
349
|
-
*/
|
|
353
|
+
* Standalone React Native SWC transform pipeline.
|
|
354
|
+
*
|
|
355
|
+
* Mirrors the behavior of {@link rollipopReactNativePlugin} but can be
|
|
356
|
+
* invoked directly outside of a rolldown build (e.g. from Metro adapters,
|
|
357
|
+
* test harnesses, or precompile steps). SWC `.wasm` plugins listed in the
|
|
358
|
+
* config are read from disk and compiled exactly once at construction
|
|
359
|
+
* time — call `transform` / `transformSync` repeatedly without reloading.
|
|
360
|
+
*
|
|
361
|
+
* All options pass through unchanged — `swc.externalHelpers` defaults to
|
|
362
|
+
* `false` (helpers inlined) and `swc.react.runtime` to `"Preserve"`, both
|
|
363
|
+
* matching the underlying Rust defaults. Set them explicitly when needed.
|
|
364
|
+
*/
|
|
350
365
|
declare class RollipopReactNativeTransformer {
|
|
351
366
|
private inner;
|
|
352
367
|
constructor(config?: RollipopReactNativeTransformerConfig);
|
|
@@ -356,32 +371,32 @@ declare class RollipopReactNativeTransformer {
|
|
|
356
371
|
//#endregion
|
|
357
372
|
//#region src/experimental-index.d.ts
|
|
358
373
|
/**
|
|
359
|
-
* In-memory file system for browser builds.
|
|
360
|
-
*
|
|
361
|
-
* This is a re-export of the {@link https://github.com/streamich/memfs | memfs} package used by the WASI runtime.
|
|
362
|
-
* It allows you to read and write files to a virtual filesystem when using rolldown in browser environments.
|
|
363
|
-
*
|
|
364
|
-
* - `fs`: A Node.js-compatible filesystem API (`IFs` from memfs)
|
|
365
|
-
* - `volume`: The underlying `Volume` instance that stores the filesystem state
|
|
366
|
-
*
|
|
367
|
-
* Returns `undefined` in Node.js builds (only available in browser builds via `@rolldown/browser`).
|
|
368
|
-
*
|
|
369
|
-
* @example
|
|
370
|
-
* ```typescript
|
|
371
|
-
* import { memfs } from '@rollipop/rolldown/experimental';
|
|
372
|
-
*
|
|
373
|
-
* // Write files to virtual filesystem before bundling
|
|
374
|
-
* memfs?.volume.fromJSON({
|
|
375
|
-
* '/src/index.js': 'export const foo = 42;',
|
|
376
|
-
* '/package.json': '{"name": "my-app"}'
|
|
377
|
-
* });
|
|
378
|
-
*
|
|
379
|
-
* // Read files from the virtual filesystem
|
|
380
|
-
* const content = memfs?.fs.readFileSync('/src/index.js', 'utf8');
|
|
381
|
-
* ```
|
|
382
|
-
*
|
|
383
|
-
* @see {@link https://github.com/streamich/memfs} for more information on the memfs API.
|
|
384
|
-
*/
|
|
374
|
+
* In-memory file system for browser builds.
|
|
375
|
+
*
|
|
376
|
+
* This is a re-export of the {@link https://github.com/streamich/memfs | memfs} package used by the WASI runtime.
|
|
377
|
+
* It allows you to read and write files to a virtual filesystem when using rolldown in browser environments.
|
|
378
|
+
*
|
|
379
|
+
* - `fs`: A Node.js-compatible filesystem API (`IFs` from memfs)
|
|
380
|
+
* - `volume`: The underlying `Volume` instance that stores the filesystem state
|
|
381
|
+
*
|
|
382
|
+
* Returns `undefined` in Node.js builds (only available in browser builds via `@rolldown/browser`).
|
|
383
|
+
*
|
|
384
|
+
* @example
|
|
385
|
+
* ```typescript
|
|
386
|
+
* import { memfs } from '@rollipop/rolldown/experimental';
|
|
387
|
+
*
|
|
388
|
+
* // Write files to virtual filesystem before bundling
|
|
389
|
+
* memfs?.volume.fromJSON({
|
|
390
|
+
* '/src/index.js': 'export const foo = 42;',
|
|
391
|
+
* '/package.json': '{"name": "my-app"}'
|
|
392
|
+
* });
|
|
393
|
+
*
|
|
394
|
+
* // Read files from the virtual filesystem
|
|
395
|
+
* const content = memfs?.fs.readFileSync('/src/index.js', 'utf8');
|
|
396
|
+
* ```
|
|
397
|
+
*
|
|
398
|
+
* @see {@link https://github.com/streamich/memfs} for more information on the memfs API.
|
|
399
|
+
*/
|
|
385
400
|
declare const memfs: {
|
|
386
401
|
fs: any;
|
|
387
402
|
volume: any;
|