rolldown 1.0.0-beta.44 → 1.0.0-beta.46
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/dist/cli-setup.mjs +4 -3
- package/dist/cli.mjs +7 -7
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -4
- package/dist/experimental-index.d.mts +4 -4
- package/dist/experimental-index.mjs +60 -9
- package/dist/experimental-runtime-types.d.ts +16 -5
- package/dist/filter-index.d.mts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +4 -3
- package/dist/parallel-plugin-worker.mjs +5 -4
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +3 -3
- package/dist/parse-ast-index.mjs +2 -2
- package/dist/shared/{binding-QBosa6N8.d.mts → binding-CCMrV5an.d.mts} +48 -32
- package/dist/shared/binding-DOZoR4bu.mjs +578 -0
- package/dist/shared/{define-config-D9LwN_tW.d.mts → define-config-Czc1YEBi.d.mts} +83 -17
- package/dist/shared/{load-config-BwIN-FIB.mjs → load-config-Brje6-4J.mjs} +3 -3
- package/dist/shared/{parse-ast-index-Dee9Dv5S.mjs → parse-ast-index-oPgrkdqc.mjs} +11 -5
- package/dist/shared/{src-DY4_vVWu.mjs → src-D1weNlnG.mjs} +558 -298
- package/package.json +26 -26
- package/dist/shared/binding-DkR1uPxc.mjs +0 -10681
package/dist/cli-setup.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-DOZoR4bu.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cli/setup-index.ts
|
|
4
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
4
5
|
let isWatchMode = false;
|
|
5
6
|
for (let i = 0; i < process.argv.length; i++) {
|
|
6
7
|
const arg = process.argv[i];
|
|
@@ -9,8 +10,8 @@ for (let i = 0; i < process.argv.length; i++) {
|
|
|
9
10
|
break;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
|
-
if (isWatchMode) createTokioRuntime(32);
|
|
13
|
-
else createTokioRuntime(4);
|
|
13
|
+
if (isWatchMode) (0, import_binding.createTokioRuntime)(32);
|
|
14
|
+
else (0, import_binding.createTokioRuntime)(4);
|
|
14
15
|
|
|
15
16
|
//#endregion
|
|
16
17
|
export { };
|
package/dist/cli.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { C as
|
|
3
|
-
import { h as styleText$1 } from "./shared/parse-ast-index-
|
|
1
|
+
import "./shared/binding-DOZoR4bu.mjs";
|
|
2
|
+
import { C as version, S as description, _ as getOutputCliKeys, g as getInputCliKeys, h as getCliSchemaInfo, i as watch, o as rolldown, v as validateCliOptions, w as onExit } from "./shared/src-D1weNlnG.mjs";
|
|
3
|
+
import { h as styleText$1 } from "./shared/parse-ast-index-oPgrkdqc.mjs";
|
|
4
4
|
import { t as arraify } from "./shared/misc-usdOVIou.mjs";
|
|
5
|
-
import { t as loadConfig } from "./shared/load-config-
|
|
6
|
-
import path, { sep } from "node:path";
|
|
5
|
+
import { t as loadConfig } from "./shared/load-config-Brje6-4J.mjs";
|
|
7
6
|
import { formatWithOptions, parseArgs } from "node:util";
|
|
7
|
+
import path, { sep } from "node:path";
|
|
8
8
|
import process$1 from "node:process";
|
|
9
9
|
import * as tty from "node:tty";
|
|
10
10
|
import { performance } from "node:perf_hooks";
|
|
@@ -1223,7 +1223,7 @@ function getClearScreenFunction(options$1) {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
|
|
1225
1225
|
//#endregion
|
|
1226
|
-
//#region \0@oxc-project+runtime@0.
|
|
1226
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/usingCtx.js
|
|
1227
1227
|
function _usingCtx() {
|
|
1228
1228
|
var r$1 = "function" == typeof SuppressedError ? SuppressedError : function(r$2, e$1) {
|
|
1229
1229
|
var n$2 = Error();
|
|
@@ -1288,7 +1288,7 @@ async function bundleWithConfig(configPath, cliOptions, rawArgs = {}) {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
const config = await loadConfig(configPath);
|
|
1290
1290
|
if (!config) {
|
|
1291
|
-
logger.error(`No configuration found at ${
|
|
1291
|
+
logger.error(`No configuration found at ${configPath}`);
|
|
1292
1292
|
process.exit(1);
|
|
1293
1293
|
}
|
|
1294
1294
|
const resolvedConfig = typeof config === "function" ? await config(rawArgs) : config;
|
package/dist/config.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ConfigExport, t as defineConfig } from "./shared/define-config-
|
|
2
|
-
import "./shared/binding-
|
|
1
|
+
import { n as ConfigExport, t as defineConfig } from "./shared/define-config-Czc1YEBi.mjs";
|
|
2
|
+
import "./shared/binding-CCMrV5an.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/load-config.d.ts
|
|
5
5
|
declare function loadConfig(configPath: string): Promise<ConfigExport>;
|
package/dist/config.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import {
|
|
3
|
-
import "./shared/parse-ast-index-
|
|
1
|
+
import "./shared/binding-DOZoR4bu.mjs";
|
|
2
|
+
import { C as version, r as defineConfig } from "./shared/src-D1weNlnG.mjs";
|
|
3
|
+
import "./shared/parse-ast-index-oPgrkdqc.mjs";
|
|
4
4
|
import "./shared/misc-usdOVIou.mjs";
|
|
5
|
-
import { t as loadConfig } from "./shared/load-config-
|
|
5
|
+
import { t as loadConfig } from "./shared/load-config-Brje6-4J.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/config.ts
|
|
8
8
|
const VERSION = version;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as BuiltinPlugin, N as SourceMapInput, U as defineParallelPlugin, bt as OutputOptions, kt as RolldownOutput, o as InputOptions, wt as StringOrRegExp } from "./shared/define-config-
|
|
2
|
-
import { A as
|
|
1
|
+
import { A as BuiltinPlugin, N as SourceMapInput, U as defineParallelPlugin, bt as OutputOptions, jt as freeExternalMemory, kt as RolldownOutput, o as InputOptions, wt as StringOrRegExp } from "./shared/define-config-Czc1YEBi.mjs";
|
|
2
|
+
import { A as IsolatedDeclarationsOptions, B as TransformOptions, C as BindingViteCssPluginConfig, D as BindingWasmHelperPluginConfig, E as BindingViteResolvePluginConfig, H as isolatedDeclaration, P as NapiResolveOptions, R as ResolveResult, S as BindingUrlResolver, T as BindingViteHtmlPluginConfig, U as moduleRunnerTransform, V as TransformResult, W as transform, a as BindingClientHmrUpdate, d as BindingJsonPluginConfig, g as BindingRebuildStrategy, h as BindingReactRefreshWrapperPluginConfig, j as IsolatedDeclarationsResult, l as BindingImportGlobPluginConfig, m as BindingModulePreloadPolyfillPluginConfig, n as BindingBuildImportAnalysisPluginConfig, o as BindingDynamicImportVarsPluginConfig, p as BindingManifestPluginConfig, s as BindingEsmExternalRequirePluginConfig, t as BindingAssetPluginConfig, u as BindingIsolatedDeclarationPluginConfig, v as BindingReplacePluginConfig, w as BindingViteCssPostPluginConfig, x as BindingTransformPluginConfig, y as BindingReporterPluginConfig, z as ResolverFactory } from "./shared/binding-CCMrV5an.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/api/dev/dev-options.d.ts
|
|
5
5
|
type DevOnHmrUpdates = (result: Error | {
|
|
@@ -77,7 +77,7 @@ declare class DevEngine {
|
|
|
77
77
|
}
|
|
78
78
|
//#endregion
|
|
79
79
|
//#region src/api/dev/index.d.ts
|
|
80
|
-
declare
|
|
80
|
+
declare const dev: typeof DevEngine.create;
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region src/api/experimental.d.ts
|
|
83
83
|
/**
|
|
@@ -173,4 +173,4 @@ type ViteCssPluginConfig = Omit<BindingViteCssPluginConfig, "compileCSS"> & {
|
|
|
173
173
|
};
|
|
174
174
|
declare function viteCSSPlugin(config?: ViteCssPluginConfig): BuiltinPlugin;
|
|
175
175
|
//#endregion
|
|
176
|
-
export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
176
|
+
export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, freeExternalMemory, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { b as
|
|
3
|
-
import "./shared/parse-ast-index-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-DOZoR4bu.mjs";
|
|
2
|
+
import { b as BuiltinPlugin, c as createBundlerOptions, f as normalizeBindingResult, l as normalizedStringOrRegex, m as bindingifySourcemap, p as transformToRollupOutput, s as RolldownBuild, x as makeBuiltinPluginCallable, y as PluginDriver } from "./shared/src-D1weNlnG.mjs";
|
|
3
|
+
import "./shared/parse-ast-index-oPgrkdqc.mjs";
|
|
4
4
|
import "./shared/misc-usdOVIou.mjs";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
6
6
|
|
|
7
7
|
//#region src/api/dev/dev-engine.ts
|
|
8
|
+
var import_binding$1 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
8
9
|
var DevEngine = class DevEngine {
|
|
9
10
|
#inner;
|
|
10
11
|
#cachedBuildFinishPromise = null;
|
|
@@ -35,7 +36,7 @@ var DevEngine = class DevEngine {
|
|
|
35
36
|
}
|
|
36
37
|
userOnOutput(transformToRollupOutput(result));
|
|
37
38
|
} : void 0,
|
|
38
|
-
rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? BindingRebuildStrategy.Always : devOptions.rebuildStrategy === "auto" ? BindingRebuildStrategy.Auto : BindingRebuildStrategy.Never : void 0,
|
|
39
|
+
rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? import_binding$1.BindingRebuildStrategy.Always : devOptions.rebuildStrategy === "auto" ? import_binding$1.BindingRebuildStrategy.Auto : import_binding$1.BindingRebuildStrategy.Never : void 0,
|
|
39
40
|
watch: devOptions.watch && {
|
|
40
41
|
skipWrite: devOptions.watch.skipWrite,
|
|
41
42
|
usePolling: devOptions.watch.usePolling,
|
|
@@ -46,7 +47,7 @@ var DevEngine = class DevEngine {
|
|
|
46
47
|
debounceTickRate: devOptions.watch.debounceTickRate
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
|
-
return new DevEngine(new BindingDevEngine(options.bundlerOptions, bindingDevOptions));
|
|
50
|
+
return new DevEngine(new import_binding$1.BindingDevEngine(options.bundlerOptions, bindingDevOptions));
|
|
50
51
|
}
|
|
51
52
|
constructor(inner) {
|
|
52
53
|
this.#inner = inner;
|
|
@@ -84,7 +85,48 @@ var DevEngine = class DevEngine {
|
|
|
84
85
|
|
|
85
86
|
//#endregion
|
|
86
87
|
//#region src/api/dev/index.ts
|
|
87
|
-
|
|
88
|
+
const dev = (...args) => DevEngine.create(...args);
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/types/external-memory-handle.ts
|
|
92
|
+
const symbolForExternalMemoryHandle = "__rolldown_external_memory_handle__";
|
|
93
|
+
/**
|
|
94
|
+
* Frees the external memory held by the given handle.
|
|
95
|
+
*
|
|
96
|
+
* This is useful when you want to manually release memory held by Rust objects
|
|
97
|
+
* (like `OutputChunk` or `OutputAsset`) before they are garbage collected.
|
|
98
|
+
*
|
|
99
|
+
* @param handle - The object with external memory to free
|
|
100
|
+
* @param keepDataAlive - If true, evaluates all lazy fields before freeing memory (default: false).
|
|
101
|
+
* This will take time to copy data from Rust to JavaScript, but prevents errors
|
|
102
|
+
* when accessing properties after the memory is freed.
|
|
103
|
+
* @returns Status object with `freed` boolean and optional `reason` string.
|
|
104
|
+
* - `{ freed: true }` if memory was successfully freed
|
|
105
|
+
* - `{ freed: false, reason: "..." }` if memory couldn't be freed (e.g., already freed or other references exist)
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* import { freeExternalMemory } from 'rolldown/experimental';
|
|
110
|
+
*
|
|
111
|
+
* const output = await bundle.generate();
|
|
112
|
+
* const chunk = output.output[0];
|
|
113
|
+
*
|
|
114
|
+
* // Use the chunk...
|
|
115
|
+
*
|
|
116
|
+
* // Manually free the memory (fast, but accessing properties after will throw)
|
|
117
|
+
* const status = freeExternalMemory(chunk); // { freed: true }
|
|
118
|
+
* const statusAgain = freeExternalMemory(chunk); // { freed: false, reason: "Memory has already been freed" }
|
|
119
|
+
*
|
|
120
|
+
* // Keep data alive before freeing (slower, but data remains accessible)
|
|
121
|
+
* freeExternalMemory(chunk, true); // Evaluates all lazy fields first
|
|
122
|
+
* console.log(chunk.code); // OK - data was copied to JavaScript before freeing
|
|
123
|
+
*
|
|
124
|
+
* // Without keepDataAlive, accessing chunk properties after freeing will throw an error
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
function freeExternalMemory(handle, keepDataAlive = false) {
|
|
128
|
+
return handle[symbolForExternalMemoryHandle](keepDataAlive);
|
|
129
|
+
}
|
|
88
130
|
|
|
89
131
|
//#endregion
|
|
90
132
|
//#region src/api/experimental.ts
|
|
@@ -216,10 +258,10 @@ function replacePlugin(values = {}, options = {}) {
|
|
|
216
258
|
const value = values[key];
|
|
217
259
|
if (typeof value !== "string") values[key] = String(value);
|
|
218
260
|
});
|
|
219
|
-
return new BuiltinPlugin("builtin:replace", {
|
|
261
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:replace", {
|
|
220
262
|
...options,
|
|
221
263
|
values
|
|
222
|
-
});
|
|
264
|
+
}));
|
|
223
265
|
}
|
|
224
266
|
|
|
225
267
|
//#endregion
|
|
@@ -251,4 +293,13 @@ function viteCSSPlugin(config) {
|
|
|
251
293
|
}
|
|
252
294
|
|
|
253
295
|
//#endregion
|
|
254
|
-
|
|
296
|
+
//#region src/experimental-index.ts
|
|
297
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
298
|
+
|
|
299
|
+
//#endregion
|
|
300
|
+
var BindingRebuildStrategy = import_binding.BindingRebuildStrategy;
|
|
301
|
+
var ResolverFactory = import_binding.ResolverFactory;
|
|
302
|
+
var isolatedDeclaration = import_binding.isolatedDeclaration;
|
|
303
|
+
var moduleRunnerTransform = import_binding.moduleRunnerTransform;
|
|
304
|
+
var transform = import_binding.transform;
|
|
305
|
+
export { BindingRebuildStrategy, DevEngine, ResolverFactory, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, freeExternalMemory, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {{ type: 'hmr:module-registered', modules: string[] }} DevRuntimeMessage
|
|
3
|
+
* @typedef {{ send(message: DevRuntimeMessage): void }} Messenger
|
|
4
|
+
*/
|
|
1
5
|
export class DevRuntime {
|
|
2
6
|
/**
|
|
3
|
-
* @param {
|
|
7
|
+
* @param {Messenger} messenger
|
|
4
8
|
*/
|
|
5
|
-
constructor(
|
|
6
|
-
|
|
9
|
+
constructor(messenger: Messenger);
|
|
10
|
+
messenger: Messenger;
|
|
7
11
|
/**
|
|
8
12
|
* @type {Record<string, Module>}
|
|
9
13
|
*/
|
|
@@ -13,9 +17,9 @@ export class DevRuntime {
|
|
|
13
17
|
*/
|
|
14
18
|
createModuleHotContext(_moduleId: string): void;
|
|
15
19
|
/**
|
|
16
|
-
* @param {string[]} _boundaries
|
|
20
|
+
* @param {[string, string][]} _boundaries
|
|
17
21
|
*/
|
|
18
|
-
applyUpdates(_boundaries: string[]): void;
|
|
22
|
+
applyUpdates(_boundaries: [string, string][]): void;
|
|
19
23
|
/**
|
|
20
24
|
* @param {string} id
|
|
21
25
|
* @param {{ exports: any }} exportsHolder
|
|
@@ -57,6 +61,13 @@ export class DevRuntime {
|
|
|
57
61
|
__reExport: any;
|
|
58
62
|
sendModuleRegisteredMessage: (module: string) => void;
|
|
59
63
|
}
|
|
64
|
+
export type DevRuntimeMessage = {
|
|
65
|
+
type: "hmr:module-registered";
|
|
66
|
+
modules: string[];
|
|
67
|
+
};
|
|
68
|
+
export type Messenger = {
|
|
69
|
+
send(message: DevRuntimeMessage): void;
|
|
70
|
+
};
|
|
60
71
|
declare class Module {
|
|
61
72
|
/**
|
|
62
73
|
* @param {string} id
|
package/dist/filter-index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as withFilter } from "./shared/define-config-
|
|
2
|
-
import "./shared/binding-
|
|
1
|
+
import { k as withFilter } from "./shared/define-config-Czc1YEBi.mjs";
|
|
2
|
+
import "./shared/binding-CCMrV5an.mjs";
|
|
3
3
|
import { and, code, exclude, id, include, moduleType, not, or, queries, query } from "@rolldown/pluginutils";
|
|
4
4
|
export { and, code, exclude, id, include, moduleType, not, or, queries, query, withFilter };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as InternalModuleFormat, At as SourceMap, B as GetModuleInfo, C as ResolveIdResult, Ct as PartialNull, D as SourceDescription, Dt as RenderedChunk, E as RolldownPluginOption, Et as OutputChunk, F as OutputBundle, Ft as
|
|
2
|
-
import {
|
|
1
|
+
import { $ as InternalModuleFormat, At as SourceMap, B as GetModuleInfo, C as ResolveIdResult, Ct as PartialNull, D as SourceDescription, Dt as RenderedChunk, E as RolldownPluginOption, Et as OutputChunk, F as OutputBundle, Ft as LogLevelOption, G as PluginContextMeta, H as DefineParallelPluginResult, I as TreeshakingOptions, It as LogOrStringHandler, J as ModuleTypeFilter, K as GeneralHookFilter, L as TransformPluginContext, Lt as RollupError, M as ExistingRawSourceMap, Mt as ModuleInfo, N as SourceMapInput, Nt as SourcemapIgnoreListOption, O as TransformResult, Ot as RenderedModule, P as RolldownOptionsFunction, Pt as LogLevel, Q as RolldownFsModule, R as EmittedAsset, Rt as RollupLog, S as ResolveIdExtraOptions, T as RolldownPlugin, Tt as OutputAsset, V as PluginContext, W as MinimalPluginContext, X as RolldownDirectoryEntry, Y as BufferEncoding, Z as RolldownFileStats, _ as ModuleType, _t as GlobalsFunction, a as InputOption, at as RolldownWatcher, b as PartialResolvedId, bt as OutputOptions, c as OptimizationOptions, ct as rolldown, d as CustomPluginOptions, dt as build, et as NormalizedOutputOptions, f as FunctionPluginHooks, ft as AddonFunction, g as ModuleOptions, gt as GeneratedCodePreset, h as LoadResult, ht as GeneratedCodeOptions, i as ExternalOption, it as watch, j as VERSION, kt as RolldownOutput, l as WatcherOptions, lt as RolldownBuild, m as ImportKind, mt as ChunkingContext, n as ConfigExport, nt as LoggingFunction, o as InputOptions, ot as RolldownWatcherEvent, p as HookFilterExtension, pt as ChunkFileNamesFunction, q as HookFilter, r as RolldownOptions, rt as WarningHandlerWithDefault, s as ModuleTypes, st as WatchOptions, t as defineConfig, tt as NormalizedInputOptions, u as AsyncPluginHooks, ut as BuildOptions, v as ObjectHook, vt as MinifyOptions, w as ResolvedId, x as Plugin, xt as PreRenderedAsset, y as ParallelPluginHooks, yt as ModuleFormat, z as EmittedFile, zt as RollupLogWithString } from "./shared/define-config-Czc1YEBi.mjs";
|
|
2
|
+
import { L as PreRenderedChunk, f as BindingMagicString } from "./shared/binding-CCMrV5an.mjs";
|
|
3
3
|
export { AddonFunction, AsyncPluginHooks, BindingMagicString, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownFileStats, RolldownFsModule, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { a as
|
|
3
|
-
import "./shared/parse-ast-index-
|
|
1
|
+
import "./shared/binding-DOZoR4bu.mjs";
|
|
2
|
+
import { a as build, i as watch, n as import_binding, o as rolldown, r as defineConfig, t as VERSION } from "./shared/src-D1weNlnG.mjs";
|
|
3
|
+
import "./shared/parse-ast-index-oPgrkdqc.mjs";
|
|
4
4
|
import "./shared/misc-usdOVIou.mjs";
|
|
5
5
|
|
|
6
|
+
var BindingMagicString = import_binding.BindingMagicString;
|
|
6
7
|
export { BindingMagicString, VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "./shared/parse-ast-index-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-DOZoR4bu.mjs";
|
|
2
|
+
import { d as bindingifyPlugin, u as PluginContextData } from "./shared/src-D1weNlnG.mjs";
|
|
3
|
+
import "./shared/parse-ast-index-oPgrkdqc.mjs";
|
|
4
4
|
import "./shared/misc-usdOVIou.mjs";
|
|
5
5
|
import { parentPort, workerData } from "node:worker_threads";
|
|
6
6
|
|
|
7
7
|
//#region src/parallel-plugin-worker.ts
|
|
8
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
8
9
|
const { registryId, pluginInfos, threadNumber } = workerData;
|
|
9
10
|
(async () => {
|
|
10
11
|
try {
|
|
11
|
-
registerPlugins(registryId, await Promise.all(pluginInfos.map(async (pluginInfo) => {
|
|
12
|
+
(0, import_binding.registerPlugins)(registryId, await Promise.all(pluginInfos.map(async (pluginInfo) => {
|
|
12
13
|
const definePluginImpl = (await import(pluginInfo.fileUrl)).default;
|
|
13
14
|
const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
|
|
14
15
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { St as MaybePromise, x as Plugin } from "./shared/define-config-
|
|
2
|
-
import "./shared/binding-
|
|
1
|
+
import { St as MaybePromise, x as Plugin } from "./shared/define-config-Czc1YEBi.mjs";
|
|
2
|
+
import "./shared/binding-CCMrV5an.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/parallel-plugin-implementation.d.ts
|
|
5
5
|
type ParallelPluginImplementation = Plugin;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { F as
|
|
1
|
+
import { F as ParseResult, I as ParserOptions } from "./shared/binding-CCMrV5an.mjs";
|
|
2
2
|
import { Program } from "@oxc-project/types";
|
|
3
3
|
|
|
4
4
|
//#region src/parse-ast-index.d.ts
|
|
5
|
-
declare function parseAst(sourceText: string, options?: ParserOptions |
|
|
6
|
-
declare function parseAstAsync(sourceText: string, options?: ParserOptions |
|
|
5
|
+
declare function parseAst(sourceText: string, options?: ParserOptions | null, filename?: string): Program;
|
|
6
|
+
declare function parseAstAsync(sourceText: string, options?: ParserOptions | null, filename?: string): Promise<Program>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { type ParseResult, type ParserOptions, parseAst, parseAstAsync };
|
package/dist/parse-ast-index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { n as parseAstAsync, t as parseAst } from "./shared/parse-ast-index-
|
|
1
|
+
import "./shared/binding-DOZoR4bu.mjs";
|
|
2
|
+
import { n as parseAstAsync, t as parseAst } from "./shared/parse-ast-index-oPgrkdqc.mjs";
|
|
3
3
|
|
|
4
4
|
export { parseAst, parseAstAsync };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _oxc_project_types0 from "@oxc-project/types";
|
|
2
2
|
|
|
3
|
-
//#region src/binding.d.
|
|
3
|
+
//#region src/binding.d.cts
|
|
4
4
|
type MaybePromise<T> = T | Promise<T>;
|
|
5
5
|
type VoidNullable<T = void> = T | null | undefined | void;
|
|
6
6
|
type BindingStringOrRegex = string | RegExp;
|
|
@@ -67,6 +67,14 @@ interface CompressOptions {
|
|
|
67
67
|
* @default true
|
|
68
68
|
*/
|
|
69
69
|
sequences?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Set of label names to drop from the code.
|
|
72
|
+
*
|
|
73
|
+
* Labeled statements matching these names will be removed during minification.
|
|
74
|
+
*
|
|
75
|
+
* @default []
|
|
76
|
+
*/
|
|
77
|
+
dropLabels?: Array<string>;
|
|
70
78
|
/** Limit the maximum number of iterations for debugging purpose. */
|
|
71
79
|
maxIterations?: number;
|
|
72
80
|
}
|
|
@@ -394,11 +402,11 @@ type ModuleType = 'module' | 'commonjs' | 'json' | 'wasm' | 'addon';
|
|
|
394
402
|
*/
|
|
395
403
|
interface NapiResolveOptions {
|
|
396
404
|
/**
|
|
397
|
-
*
|
|
405
|
+
* Discover tsconfig automatically or use the specified tsconfig.json path.
|
|
398
406
|
*
|
|
399
407
|
* Default `None`
|
|
400
408
|
*/
|
|
401
|
-
tsconfig?: TsconfigOptions;
|
|
409
|
+
tsconfig?: 'auto' | TsconfigOptions;
|
|
402
410
|
/**
|
|
403
411
|
* Alias for [ResolveOptions::alias] and [ResolveOptions::fallback].
|
|
404
412
|
*
|
|
@@ -1198,32 +1206,30 @@ declare class BindingMagicString {
|
|
|
1198
1206
|
isEmpty(): boolean;
|
|
1199
1207
|
}
|
|
1200
1208
|
declare class BindingOutputAsset {
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1209
|
+
dropInner(): ExternalMemoryStatus;
|
|
1210
|
+
getFileName(): string;
|
|
1211
|
+
getOriginalFileName(): string | null;
|
|
1212
|
+
getOriginalFileNames(): Array<string>;
|
|
1213
|
+
getSource(): BindingAssetSource;
|
|
1214
|
+
getName(): string | null;
|
|
1215
|
+
getNames(): Array<string>;
|
|
1207
1216
|
}
|
|
1208
1217
|
declare class BindingOutputChunk {
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
declare class BindingOutputs {
|
|
1225
|
-
get chunks(): Array<BindingOutputChunk>;
|
|
1226
|
-
get assets(): Array<BindingOutputAsset>;
|
|
1218
|
+
dropInner(): ExternalMemoryStatus;
|
|
1219
|
+
getIsEntry(): boolean;
|
|
1220
|
+
getIsDynamicEntry(): boolean;
|
|
1221
|
+
getFacadeModuleId(): string | null;
|
|
1222
|
+
getModuleIds(): Array<string>;
|
|
1223
|
+
getExports(): Array<string>;
|
|
1224
|
+
getFileName(): string;
|
|
1225
|
+
getModules(): BindingModules;
|
|
1226
|
+
getImports(): Array<string>;
|
|
1227
|
+
getDynamicImports(): Array<string>;
|
|
1228
|
+
getCode(): string;
|
|
1229
|
+
getMap(): string | null;
|
|
1230
|
+
getSourcemapFileName(): string | null;
|
|
1231
|
+
getPreliminaryFileName(): string;
|
|
1232
|
+
getName(): string;
|
|
1227
1233
|
}
|
|
1228
1234
|
declare class BindingRenderedChunk {
|
|
1229
1235
|
get name(): string;
|
|
@@ -1265,7 +1271,7 @@ interface BindingAssetPluginConfig {
|
|
|
1265
1271
|
isSkipAssets: boolean;
|
|
1266
1272
|
assetsInclude: Array<BindingStringOrRegex>;
|
|
1267
1273
|
assetInlineLimit: number | ((file: string, content: Buffer) => boolean | undefined);
|
|
1268
|
-
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) =>
|
|
1274
|
+
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => Promise<undefined | string | BindingRenderBuiltUrlRet>;
|
|
1269
1275
|
}
|
|
1270
1276
|
interface BindingAssetSource {
|
|
1271
1277
|
inner: string | Uint8Array;
|
|
@@ -1276,6 +1282,7 @@ interface BindingBuildImportAnalysisPluginConfig {
|
|
|
1276
1282
|
optimizeModulePreloadRelativePaths: boolean;
|
|
1277
1283
|
renderBuiltUrl: boolean;
|
|
1278
1284
|
isRelativeBase: boolean;
|
|
1285
|
+
isTestV2?: boolean;
|
|
1279
1286
|
}
|
|
1280
1287
|
type BindingBuiltinPluginName = 'builtin:alias' | 'builtin:asset' | 'builtin:asset-import-meta-url' | 'builtin:build-import-analysis' | 'builtin:dynamic-import-vars' | 'builtin:esm-external-require' | 'builtin:import-glob' | 'builtin:isolated-declaration' | 'builtin:json' | 'builtin:load-fallback' | 'builtin:manifest' | 'builtin:module-preload-polyfill' | 'builtin:react-refresh-wrapper' | 'builtin:reporter' | 'builtin:replace' | 'builtin:transform' | 'builtin:vite-css' | 'builtin:vite-css-post' | 'builtin:vite-html' | 'builtin:vite-resolve' | 'builtin:wasm-fallback' | 'builtin:wasm-helper' | 'builtin:web-worker-post';
|
|
1281
1288
|
interface BindingClientHmrUpdate {
|
|
@@ -1356,7 +1363,7 @@ interface BindingManifestPluginConfig {
|
|
|
1356
1363
|
root: string;
|
|
1357
1364
|
outPath: string;
|
|
1358
1365
|
isLegacy?: () => boolean;
|
|
1359
|
-
cssEntries: () =>
|
|
1366
|
+
cssEntries: () => Record<string, string>;
|
|
1360
1367
|
}
|
|
1361
1368
|
interface BindingModulePreloadPolyfillPluginConfig {
|
|
1362
1369
|
isServer?: boolean;
|
|
@@ -1365,6 +1372,10 @@ interface BindingModules {
|
|
|
1365
1372
|
values: Array<BindingRenderedModule>;
|
|
1366
1373
|
keys: Array<string>;
|
|
1367
1374
|
}
|
|
1375
|
+
interface BindingOutputs {
|
|
1376
|
+
chunks: Array<BindingOutputChunk>;
|
|
1377
|
+
assets: Array<BindingOutputAsset>;
|
|
1378
|
+
}
|
|
1368
1379
|
interface BindingReactRefreshWrapperPluginConfig {
|
|
1369
1380
|
cwd: string;
|
|
1370
1381
|
include?: Array<BindingStringOrRegex>;
|
|
@@ -1443,7 +1454,7 @@ interface BindingViteCssPostPluginConfig {
|
|
|
1443
1454
|
libCssFilename?: string;
|
|
1444
1455
|
isLegacy?: () => boolean;
|
|
1445
1456
|
cssMinify?: (css: string) => Promise<string>;
|
|
1446
|
-
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) =>
|
|
1457
|
+
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => Promise<undefined | string | BindingRenderBuiltUrlRet>;
|
|
1447
1458
|
}
|
|
1448
1459
|
interface BindingViteHtmlPluginConfig {
|
|
1449
1460
|
isLib: boolean;
|
|
@@ -1454,7 +1465,7 @@ interface BindingViteHtmlPluginConfig {
|
|
|
1454
1465
|
cssCodeSplit: boolean;
|
|
1455
1466
|
modulePreloadPolyfill: boolean;
|
|
1456
1467
|
assetInlineLimit: number | ((file: string, content: Buffer) => boolean | undefined);
|
|
1457
|
-
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) =>
|
|
1468
|
+
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => Promise<undefined | string | BindingRenderBuiltUrlRet>;
|
|
1458
1469
|
resolveDependencies?: boolean | ((filename: string, dependencies: string[], context: {
|
|
1459
1470
|
hostId: string;
|
|
1460
1471
|
hostType: 'html' | 'js';
|
|
@@ -1468,6 +1479,7 @@ interface BindingViteResolvePluginConfig {
|
|
|
1468
1479
|
external: true | string[];
|
|
1469
1480
|
noExternal: true | Array<string | RegExp>;
|
|
1470
1481
|
dedupe: Array<string>;
|
|
1482
|
+
legacyInconsistentCjsInterop?: boolean;
|
|
1471
1483
|
finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string>;
|
|
1472
1484
|
finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string>;
|
|
1473
1485
|
resolveSubpathImports: (id: string, importer: string, isRequire: boolean, scan: boolean) => VoidNullable<string>;
|
|
@@ -1494,6 +1506,10 @@ interface BindingViteResolvePluginResolveOptions {
|
|
|
1494
1506
|
interface BindingWasmHelperPluginConfig {
|
|
1495
1507
|
decodedBase: string;
|
|
1496
1508
|
}
|
|
1509
|
+
interface ExternalMemoryStatus {
|
|
1510
|
+
freed: boolean;
|
|
1511
|
+
reason?: string;
|
|
1512
|
+
}
|
|
1497
1513
|
/** Error emitted from native side, it only contains kind and message, no stack trace. */
|
|
1498
1514
|
interface NativeError {
|
|
1499
1515
|
kind: string;
|
|
@@ -1508,4 +1524,4 @@ interface PreRenderedChunk {
|
|
|
1508
1524
|
exports: Array<string>;
|
|
1509
1525
|
}
|
|
1510
1526
|
//#endregion
|
|
1511
|
-
export {
|
|
1527
|
+
export { IsolatedDeclarationsOptions as A, TransformOptions as B, BindingViteCssPluginConfig as C, BindingWasmHelperPluginConfig as D, BindingViteResolvePluginConfig as E, ParseResult as F, isolatedDeclaration as H, ParserOptions as I, PreRenderedChunk as L, JsxOptions as M, MinifyOptions as N, BindingWatcherEvent as O, NapiResolveOptions as P, ResolveResult as R, BindingUrlResolver as S, BindingViteHtmlPluginConfig as T, moduleRunnerTransform as U, TransformResult as V, transform as W, BindingRenderedChunk as _, BindingClientHmrUpdate as a, BindingTransformHookExtraArgs as b, BindingHookResolveIdExtraArgs as c, BindingJsonPluginConfig as d, BindingMagicString as f, BindingRebuildStrategy as g, BindingReactRefreshWrapperPluginConfig as h, BindingBundlerImpl as i, IsolatedDeclarationsResult as j, ExternalMemoryStatus as k, BindingImportGlobPluginConfig as l, BindingModulePreloadPolyfillPluginConfig as m, BindingBuildImportAnalysisPluginConfig as n, BindingDynamicImportVarsPluginConfig as o, BindingManifestPluginConfig as p, BindingBuiltinPluginName as r, BindingEsmExternalRequirePluginConfig as s, BindingAssetPluginConfig as t, BindingIsolatedDeclarationPluginConfig as u, BindingReplacePluginConfig as v, BindingViteCssPostPluginConfig as w, BindingTransformPluginConfig as x, BindingReporterPluginConfig as y, ResolverFactory as z };
|