rolldown 1.0.0-beta.9-commit.0ec9e7d → 1.0.0-rc.1
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/README.md +11 -0
- package/bin/cli.mjs +1 -0
- package/dist/cli-setup.mjs +17 -0
- package/dist/cli.mjs +1085 -1281
- package/dist/config.d.mts +2 -4
- package/dist/config.mjs +8 -5
- package/dist/experimental-index.d.mts +161 -76
- package/dist/experimental-index.mjs +227 -61
- package/dist/experimental-runtime-types.d.ts +98 -0
- package/dist/filter-index.d.mts +196 -4
- package/dist/filter-index.mjs +328 -4
- package/dist/get-log-filter.d.mts +7 -0
- package/dist/get-log-filter.mjs +48 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +56 -5
- package/dist/parallel-plugin-worker.mjs +27 -33
- package/dist/parallel-plugin.d.mts +7 -8
- package/dist/parse-ast-index.d.mts +4 -5
- package/dist/parse-ast-index.mjs +2 -2
- package/dist/plugins-index.d.mts +30 -0
- package/dist/plugins-index.mjs +40 -0
- package/dist/shared/binding-B92Lq__Q.d.mts +1687 -0
- package/dist/shared/binding-C-UNREnT.mjs +585 -0
- package/dist/shared/bindingify-input-options-Cb-01HR1.mjs +2233 -0
- package/dist/shared/constructors-D_KFsTQ-.d.mts +28 -0
- package/dist/shared/constructors-aZ82R2dj.mjs +61 -0
- package/dist/shared/define-config-BVG4QvnP.mjs +7 -0
- package/dist/shared/define-config-DO4TBkJV.d.mts +3457 -0
- package/dist/shared/{load-config-Dll-92l5.mjs → load-config-D6cey0o1.mjs} +23 -33
- package/dist/shared/logging-wIy4zY9I.d.mts +50 -0
- package/dist/shared/logs-NH298mHo.mjs +183 -0
- package/dist/shared/{misc-DGAe2XOW.mjs → misc-CCZIsXVO.mjs} +1 -7
- package/dist/shared/normalize-string-or-regex-Dq50a7l9.mjs +61 -0
- package/dist/shared/parse-ast-index-B6LAhWD8.mjs +99 -0
- package/dist/shared/{prompt-CxjDC0Gn.cjs → prompt-tlfjalEt.mjs} +301 -308
- package/dist/shared/rolldown-CIC_OHw3.mjs +42 -0
- package/dist/shared/rolldown-build-KB1YaNe-.mjs +2369 -0
- package/dist/shared/watch-B2WRkpw2.mjs +379 -0
- package/package.json +86 -98
- package/dist/cli.cjs +0 -1748
- package/dist/config.cjs +0 -12
- package/dist/config.d.cts +0 -12
- package/dist/experimental-index.cjs +0 -132
- package/dist/experimental-index.d.cts +0 -96
- package/dist/filter-index.cjs +0 -105
- package/dist/filter-index.d.cts +0 -5
- package/dist/index.cjs +0 -9
- package/dist/index.d.cts +0 -4
- package/dist/parallel-plugin-worker.cjs +0 -33
- package/dist/parallel-plugin-worker.d.cts +0 -1
- package/dist/parallel-plugin.cjs +0 -8
- package/dist/parallel-plugin.d.cts +0 -15
- package/dist/parse-ast-index.cjs +0 -4
- package/dist/parse-ast-index.d.cts +0 -9
- package/dist/shared/binding.d-Dz3qQrbl.d.mts +0 -1682
- package/dist/shared/binding.d-QXzDcVmm.d.cts +0 -1682
- package/dist/shared/chunk--iN_1bjD.mjs +0 -33
- package/dist/shared/chunk-DDkG_k5U.cjs +0 -39
- package/dist/shared/define-config.d-CUcDq_vm.d.cts +0 -1080
- package/dist/shared/define-config.d-qV1PzX_C.d.mts +0 -1080
- package/dist/shared/load-config-Bx9W9x2a.cjs +0 -125
- package/dist/shared/misc-BKp5iIef.cjs +0 -67
- package/dist/shared/parse-ast-index-0m6JgGc9.mjs +0 -655
- package/dist/shared/parse-ast-index-Cn_efzjO.cjs +0 -697
- package/dist/shared/prompt-uGrwvyp0.mjs +0 -854
- package/dist/shared/src-B4EklR3U.mjs +0 -4704
- package/dist/shared/src-BzFe16tX.cjs +0 -4654
- /package/dist/{cli.d.cts → cli-setup.d.mts} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent,
|
|
1
|
+
import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./shared/logging-wIy4zY9I.mjs";
|
|
2
|
+
import { P as PreRenderedChunk, s as BindingMagicString } from "./shared/binding-B92Lq__Q.mjs";
|
|
3
|
+
import { $ as BufferEncoding, A as TransformResult, At as MinifyOptions, B as EmittedChunk, Bt as RenderedModule, C as Plugin, Ct as ChunkingContext, D as RolldownPlugin, Dt as GeneratedCodeOptions, E as ResolvedId, Et as CodeSplittingOptions, F as SourceMapInput, Ft as PartialNull, G as PluginContextResolveOptions, Gt as SourcemapIgnoreListOption, H as EmittedPrebuiltChunk, Ht as SourceMap, I as OutputBundle, J as MinimalPluginContext, K as DefineParallelPluginResult, L as TreeshakingOptions, Lt as OutputAsset, Mt as OutputOptions, N as VERSION, Nt as PreRenderedAsset, O as RolldownPluginOption, Ot as GeneratedCodePreset, P as ExistingRawSourceMap, Q as ModuleTypeFilter, R as TransformPluginContext, Rt as OutputChunk, S as PartialResolvedId, St as ChunkFileNamesFunction, T as ResolveIdResult, Tt as CodeSplittingNameFunction, U as GetModuleInfo, V as EmittedFile, Vt as RolldownOutput, W as PluginContext, Wt as ModuleInfo, X as GeneralHookFilter, Y as PluginContextMeta, Z as HookFilter, _ as LoadResult, _t as BuildOptions, a as ExternalOption, at as NormalizedInputOptions, b as ObjectHook, bt as AdvancedChunksGroup, c as InputOptions, ct as LoggingFunction, d as WatcherOptions, dt as RolldownWatcher, et as RolldownDirectoryEntry, f as AsyncPluginHooks, ft as RolldownWatcherEvent, g as ImportKind, gt as RolldownBuild, h as HookFilterExtension, ht as rolldown, i as RolldownOptions, it as NormalizedOutputOptions, jt as ModuleFormat, k as SourceDescription, kt as GlobalsFunction, l as ModuleTypes, lt as WarningHandlerWithDefault, m as FunctionPluginHooks, mt as WatchOptions, n as RolldownOptionsFunction, nt as RolldownFsModule, o as ExternalOptionFunction, ot as TransformOptions, p as CustomPluginOptions, pt as RolldownWatcherWatcherEventMap, r as defineConfig, rt as InternalModuleFormat, s as InputOption, st as ChecksOptions, t as ConfigExport, tt as RolldownFileStats, u as OptimizationOptions, ut as watch, v as ModuleOptions, vt as build, w as ResolveIdExtraOptions, wt as CodeSplittingGroup, x as ParallelPluginHooks, xt as AdvancedChunksOptions, y as ModuleType, yt as AddonFunction, z as EmittedAsset, zt as RenderedChunk } from "./shared/define-config-DO4TBkJV.mjs";
|
|
4
|
+
export { AddonFunction, AdvancedChunksGroup, AdvancedChunksOptions, AsyncPluginHooks, BindingMagicString, BufferEncoding, BuildOptions, ChecksOptions, ChunkFileNamesFunction, ChunkingContext, CodeSplittingGroup, CodeSplittingNameFunction, CodeSplittingOptions, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedChunk, EmittedFile, EmittedPrebuiltChunk, ExistingRawSourceMap, ExternalOption, ExternalOptionFunction, 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, PluginContextResolveOptions, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownError, RolldownError as RollupError, RolldownFileStats, RolldownFsModule, RolldownLog, RolldownLog as RollupLog, RolldownLogWithString, RolldownLogWithString as RollupLogWithString, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RolldownWatcherWatcherEventMap, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformOptions, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./shared/
|
|
3
|
-
import "./shared/
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-C-UNREnT.mjs";
|
|
2
|
+
import { n as onExit, t as watch } from "./shared/watch-B2WRkpw2.mjs";
|
|
3
|
+
import "./shared/normalize-string-or-regex-Dq50a7l9.mjs";
|
|
4
|
+
import { S as VERSION } from "./shared/bindingify-input-options-Cb-01HR1.mjs";
|
|
5
|
+
import "./shared/rolldown-build-KB1YaNe-.mjs";
|
|
6
|
+
import "./shared/parse-ast-index-B6LAhWD8.mjs";
|
|
7
|
+
import { t as rolldown } from "./shared/rolldown-CIC_OHw3.mjs";
|
|
8
|
+
import { t as defineConfig } from "./shared/define-config-BVG4QvnP.mjs";
|
|
9
|
+
import { isMainThread } from "node:worker_threads";
|
|
4
10
|
|
|
5
|
-
|
|
6
|
-
|
|
11
|
+
//#region src/setup.ts
|
|
12
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
13
|
+
if (isMainThread) {
|
|
14
|
+
const subscriberGuard = (0, import_binding.initTraceSubscriber)();
|
|
15
|
+
onExit(() => {
|
|
16
|
+
subscriberGuard?.close();
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/api/build.ts
|
|
22
|
+
/**
|
|
23
|
+
* The API similar to esbuild's `build` function.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```js
|
|
27
|
+
* import { build } from 'rolldown';
|
|
28
|
+
*
|
|
29
|
+
* const result = await build({
|
|
30
|
+
* input: 'src/main.js',
|
|
31
|
+
* output: {
|
|
32
|
+
* file: 'bundle.js',
|
|
33
|
+
* },
|
|
34
|
+
* });
|
|
35
|
+
* console.log(result);
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @experimental
|
|
39
|
+
* @category Programmatic APIs
|
|
40
|
+
*/
|
|
41
|
+
async function build(options) {
|
|
42
|
+
if (Array.isArray(options)) return Promise.all(options.map((opts) => build(opts)));
|
|
43
|
+
else {
|
|
44
|
+
const { output, write = true, ...inputOptions } = options;
|
|
45
|
+
const build = await rolldown(inputOptions);
|
|
46
|
+
try {
|
|
47
|
+
if (write) return await build.write(output);
|
|
48
|
+
else return await build.generate(output);
|
|
49
|
+
} finally {
|
|
50
|
+
await build.close();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
var BindingMagicString = import_binding.BindingMagicString;
|
|
57
|
+
export { BindingMagicString, VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,38 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import "./shared/
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-C-UNREnT.mjs";
|
|
2
|
+
import "./shared/normalize-string-or-regex-Dq50a7l9.mjs";
|
|
3
|
+
import { n as PluginContextData, r as bindingifyPlugin } from "./shared/bindingify-input-options-Cb-01HR1.mjs";
|
|
4
|
+
import "./shared/parse-ast-index-B6LAhWD8.mjs";
|
|
5
5
|
import { parentPort, workerData } from "node:worker_threads";
|
|
6
6
|
|
|
7
7
|
//#region src/parallel-plugin-worker.ts
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
} finally {
|
|
32
|
-
parentPort.unref();
|
|
33
|
-
}
|
|
34
|
-
})();
|
|
35
|
-
} });
|
|
8
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
9
|
+
const { registryId, pluginInfos, threadNumber } = workerData;
|
|
10
|
+
(async () => {
|
|
11
|
+
try {
|
|
12
|
+
(0, import_binding.registerPlugins)(registryId, await Promise.all(pluginInfos.map(async (pluginInfo) => {
|
|
13
|
+
const definePluginImpl = (await import(pluginInfo.fileUrl)).default;
|
|
14
|
+
const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
|
|
15
|
+
return {
|
|
16
|
+
index: pluginInfo.index,
|
|
17
|
+
plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, []), [], () => {}, "info", false)
|
|
18
|
+
};
|
|
19
|
+
})));
|
|
20
|
+
parentPort.postMessage({ type: "success" });
|
|
21
|
+
} catch (error) {
|
|
22
|
+
parentPort.postMessage({
|
|
23
|
+
type: "error",
|
|
24
|
+
error
|
|
25
|
+
});
|
|
26
|
+
} finally {
|
|
27
|
+
parentPort.unref();
|
|
28
|
+
}
|
|
29
|
+
})();
|
|
36
30
|
|
|
37
31
|
//#endregion
|
|
38
|
-
export
|
|
32
|
+
export { };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import "./shared/binding
|
|
2
|
-
import {
|
|
1
|
+
import "./shared/binding-B92Lq__Q.mjs";
|
|
2
|
+
import { C as Plugin, Pt as MaybePromise } from "./shared/define-config-DO4TBkJV.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/parallel-plugin-implementation.d.ts
|
|
5
5
|
type ParallelPluginImplementation = Plugin;
|
|
6
6
|
type Context = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Thread number
|
|
9
|
+
*/
|
|
10
|
+
threadNumber: number;
|
|
11
11
|
};
|
|
12
12
|
declare function defineParallelPluginImplementation<Options>(plugin: (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>): (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>;
|
|
13
|
-
|
|
14
13
|
//#endregion
|
|
15
|
-
export { Context, ParallelPluginImplementation, defineParallelPluginImplementation };
|
|
14
|
+
export { type Context, type ParallelPluginImplementation, defineParallelPluginImplementation };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ParseResult, ParserOptions } from "./shared/binding
|
|
1
|
+
import { M as ParseResult, N as ParserOptions } from "./shared/binding-B92Lq__Q.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 |
|
|
7
|
-
|
|
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>;
|
|
8
7
|
//#endregion
|
|
9
|
-
export { ParseResult, ParserOptions, parseAst, parseAstAsync };
|
|
8
|
+
export { type ParseResult, type ParserOptions, parseAst, parseAstAsync };
|
package/dist/parse-ast-index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./shared/binding-C-UNREnT.mjs";
|
|
2
|
+
import { n as parseAstAsync, t as parseAst } from "./shared/parse-ast-index-B6LAhWD8.mjs";
|
|
2
3
|
|
|
3
|
-
init_parse_ast_index();
|
|
4
4
|
export { parseAst, parseAstAsync };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { d as BindingReplacePluginConfig } from "./shared/binding-B92Lq__Q.mjs";
|
|
2
|
+
import { M as BuiltinPlugin } from "./shared/define-config-DO4TBkJV.mjs";
|
|
3
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors-D_KFsTQ-.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/builtin-plugin/replace-plugin.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Replaces targeted strings in files while bundling.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Basic usage
|
|
11
|
+
* ```js
|
|
12
|
+
* replacePlugin({
|
|
13
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
14
|
+
* __buildVersion: 15
|
|
15
|
+
* })
|
|
16
|
+
* ```
|
|
17
|
+
* @example
|
|
18
|
+
* // With options
|
|
19
|
+
* ```js
|
|
20
|
+
* replacePlugin({
|
|
21
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
22
|
+
* __buildVersion: 15
|
|
23
|
+
* }, {
|
|
24
|
+
* preventAssignment: false,
|
|
25
|
+
* })
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare function replacePlugin(values?: BindingReplacePluginConfig["values"], options?: Omit<BindingReplacePluginConfig, "values">): BuiltinPlugin;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { esmExternalRequirePlugin, replacePlugin };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "./shared/binding-C-UNREnT.mjs";
|
|
2
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-Dq50a7l9.mjs";
|
|
3
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors-aZ82R2dj.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/builtin-plugin/replace-plugin.ts
|
|
6
|
+
/**
|
|
7
|
+
* Replaces targeted strings in files while bundling.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Basic usage
|
|
11
|
+
* ```js
|
|
12
|
+
* replacePlugin({
|
|
13
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
14
|
+
* __buildVersion: 15
|
|
15
|
+
* })
|
|
16
|
+
* ```
|
|
17
|
+
* @example
|
|
18
|
+
* // With options
|
|
19
|
+
* ```js
|
|
20
|
+
* replacePlugin({
|
|
21
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
22
|
+
* __buildVersion: 15
|
|
23
|
+
* }, {
|
|
24
|
+
* preventAssignment: false,
|
|
25
|
+
* })
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
function replacePlugin(values = {}, options = {}) {
|
|
29
|
+
Object.keys(values).forEach((key) => {
|
|
30
|
+
const value = values[key];
|
|
31
|
+
if (typeof value !== "string") values[key] = String(value);
|
|
32
|
+
});
|
|
33
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:replace", {
|
|
34
|
+
...options,
|
|
35
|
+
values
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { esmExternalRequirePlugin, replacePlugin };
|