rolldown 1.2.0 → 1.2.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/THIRD-PARTY-LICENSE +33 -0
- package/dist/cli.mjs +9 -10
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +2 -2
- package/dist/experimental-default-runtime.mjs +116 -0
- package/dist/experimental-index.d.mts +10 -4
- package/dist/experimental-index.mjs +32 -16
- package/dist/experimental-runtime-base.mjs +95 -0
- package/dist/experimental-runtime.d.ts +177 -0
- package/dist/experimental-runtime.mjs +257 -0
- package/dist/filter-index.d.mts +1 -1
- package/dist/filter-index.mjs +1 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -4
- package/dist/parallel-plugin-worker.mjs +2 -2
- package/dist/parallel-plugin.d.mts +1 -1
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +2 -2
- package/dist/plugins-index.d.mts +3 -3
- package/dist/plugins-index.mjs +2 -2
- package/dist/shared/{binding-Dbbi0RbO.d.mts → binding-CVtkJvyl.d.mts} +11 -0
- package/dist/shared/{binding-Dby9rwGk.mjs → binding-Cv62mM1i.mjs} +124 -50
- package/dist/shared/{bindingify-input-options-_ppP73I9.mjs → bindingify-input-options-EnUlEF0T.mjs} +209 -252
- package/dist/shared/{constructors-CSWbNgBZ.d.mts → constructors-ALilxAii.d.mts} +2 -2
- package/dist/shared/{constructors-CuGa75s-.mjs → constructors-CuqzPFxJ.mjs} +10 -6
- package/dist/shared/{rolldown-build-CdF8HAHX.mjs → create-bundler-option-4QtiLLuz.mjs} +39 -156
- package/dist/shared/{define-config-B-IDOhDz.d.mts → define-config-DSMNXceb.d.mts} +85 -22
- package/dist/shared/{error-DFGNOCle.mjs → error-BgfXq0Tb.mjs} +1 -1
- package/dist/shared/{load-config-C6UyiS41.mjs → load-config-DsMzOVzu.mjs} +2 -2
- 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-SiXbePVH.mjs → normalize-string-or-regex-BVNGzRe4.mjs} +2 -2
- package/dist/shared/{parse-BFj5G_7i.mjs → parse-DQIYJwT4.mjs} +2 -2
- package/dist/shared/{prompt--dNycKSZ.mjs → prompt-CH6TK0bC.mjs} +2 -6
- package/dist/shared/{resolve-tsconfig-2TXRF_zr.mjs → resolve-tsconfig-CQndqeLj.mjs} +2 -2
- package/dist/shared/rolldown-DP_p9pd3.mjs +178 -0
- package/dist/shared/{transform-Cs2bUDRH.d.mts → transform-WmU_cI8e.d.mts} +1 -1
- package/dist/shared/{watch-WnrlHRS0.mjs → watch-Cwq-cFUy.mjs} +16 -13
- package/dist/utils-index.d.mts +3 -3
- package/dist/utils-index.mjs +6 -8
- package/package.json +31 -24
- package/dist/shared/rolldown-951h_1lf.mjs +0 -40
|
@@ -17,5 +17,13 @@ function unsupported(info) {
|
|
|
17
17
|
throw new Error(`UNSUPPORTED: ${info}`);
|
|
18
18
|
}
|
|
19
19
|
function noop(..._args) {}
|
|
20
|
+
const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Za-z]:)?[/\\|])/;
|
|
21
|
+
/**
|
|
22
|
+
* Whether `name` is a path fragment — an absolute or relative path. Emitted file
|
|
23
|
+
* names, `[name]` substitutions and file-name patterns can be neither.
|
|
24
|
+
*/
|
|
25
|
+
function isPathFragment(name) {
|
|
26
|
+
return name[0] === "/" || name[0] === "." && (name[1] === "/" || name[1] === ".") || ABSOLUTE_PATH_REGEX.test(name);
|
|
27
|
+
}
|
|
20
28
|
//#endregion
|
|
21
|
-
export {
|
|
29
|
+
export { unimplemented as a, noop as i, isPathFragment as n, unreachable as o, isPromiseLike as r, unsupported as s, arraify as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
import {
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-Cv62mM1i.mjs";
|
|
2
|
+
import { l as logPluginError, n as error } from "./logs-DmYCAKcW.mjs";
|
|
3
3
|
//#region src/builtin-plugin/utils.ts
|
|
4
4
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
5
5
|
var BuiltinPlugin = class {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-Cv62mM1i.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.142.0/node_modules/oxc-parser/src-js/wrap.js
|
|
3
3
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
4
4
|
function wrap(result) {
|
|
5
5
|
let program, module, comments, errors;
|
|
@@ -604,9 +604,7 @@ let wD = class extends x {
|
|
|
604
604
|
case "right":
|
|
605
605
|
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
606
606
|
break;
|
|
607
|
-
case "space":
|
|
608
|
-
this.toggleValue();
|
|
609
|
-
break;
|
|
607
|
+
case "space": this.toggleValue();
|
|
610
608
|
}
|
|
611
609
|
});
|
|
612
610
|
}
|
|
@@ -639,9 +637,7 @@ var jD = class extends x {
|
|
|
639
637
|
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
640
638
|
break;
|
|
641
639
|
case "down":
|
|
642
|
-
case "right":
|
|
643
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
644
|
-
break;
|
|
640
|
+
case "right": this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
645
641
|
}
|
|
646
642
|
this.changeValue();
|
|
647
643
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-Cv62mM1i.mjs";
|
|
2
|
+
import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-BgfXq0Tb.mjs";
|
|
3
3
|
//#region src/utils/minify.ts
|
|
4
4
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
5
5
|
/**
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-Cv62mM1i.mjs";
|
|
2
|
+
import { c as __decorate, d as PlainObjectLike, o as transformToRollupOutput, u as lazyProp } from "./bindingify-input-options-EnUlEF0T.mjs";
|
|
3
|
+
import { l as PluginDriver, s as validateOption, t as createBundlerOptions } from "./create-bundler-option-4QtiLLuz.mjs";
|
|
4
|
+
import { i as unwrapBindingResult } from "./error-BgfXq0Tb.mjs";
|
|
5
|
+
//#region src/types/rolldown-output-impl.ts
|
|
6
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
7
|
+
var RolldownOutputImpl = class extends PlainObjectLike {
|
|
8
|
+
bindingOutputs;
|
|
9
|
+
constructor(bindingOutputs) {
|
|
10
|
+
super();
|
|
11
|
+
this.bindingOutputs = bindingOutputs;
|
|
12
|
+
}
|
|
13
|
+
get output() {
|
|
14
|
+
return transformToRollupOutput(this.bindingOutputs).output;
|
|
15
|
+
}
|
|
16
|
+
__rolldown_external_memory_handle__(keepDataAlive) {
|
|
17
|
+
const results = this.output.map((item) => item.__rolldown_external_memory_handle__(keepDataAlive));
|
|
18
|
+
if (!results.every((r) => r.freed)) {
|
|
19
|
+
const reasons = results.filter((r) => !r.freed).map((r) => r.reason).filter(Boolean);
|
|
20
|
+
return {
|
|
21
|
+
freed: false,
|
|
22
|
+
reason: `Failed to free ${reasons.length} item(s): ${reasons.join("; ")}`
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return { freed: true };
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
__decorate([lazyProp], RolldownOutputImpl.prototype, "output", null);
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/api/rolldown/rolldown-build.ts
|
|
31
|
+
Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
|
|
32
|
+
/**
|
|
33
|
+
* The bundle object returned by {@linkcode rolldown} function.
|
|
34
|
+
*
|
|
35
|
+
* @category Programmatic APIs
|
|
36
|
+
*/
|
|
37
|
+
var RolldownBuild = class {
|
|
38
|
+
#inputOptions;
|
|
39
|
+
#bundler;
|
|
40
|
+
#stopWorkers;
|
|
41
|
+
#asyncRuntimeReleased = false;
|
|
42
|
+
/** @hidden should not be used directly */
|
|
43
|
+
constructor(inputOptions) {
|
|
44
|
+
this.#inputOptions = inputOptions;
|
|
45
|
+
this.#bundler = new import_binding.BindingBundler();
|
|
46
|
+
(0, import_binding.startAsyncRuntime)();
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Whether the bundle has been closed.
|
|
50
|
+
*
|
|
51
|
+
* If the bundle is closed, calling other methods will throw an error.
|
|
52
|
+
*/
|
|
53
|
+
get closed() {
|
|
54
|
+
return this.#bundler.closed;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Generate bundles in-memory.
|
|
58
|
+
*
|
|
59
|
+
* If you directly want to write bundles to disk, use the {@linkcode write} method instead.
|
|
60
|
+
*
|
|
61
|
+
* @param outputOptions The output options.
|
|
62
|
+
* @returns The generated bundle.
|
|
63
|
+
* @throws {@linkcode BundleError} When an error occurs during the build.
|
|
64
|
+
*/
|
|
65
|
+
async generate(outputOptions = {}) {
|
|
66
|
+
return this.#build(false, outputOptions);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Generate and write bundles to disk.
|
|
70
|
+
*
|
|
71
|
+
* If you want to generate bundles in-memory, use the {@linkcode generate} method instead.
|
|
72
|
+
*
|
|
73
|
+
* @param outputOptions The output options.
|
|
74
|
+
* @returns The generated bundle.
|
|
75
|
+
* @throws {@linkcode BundleError} When an error occurs during the build.
|
|
76
|
+
*/
|
|
77
|
+
async write(outputOptions = {}) {
|
|
78
|
+
return this.#build(true, outputOptions);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Close the bundle and free resources.
|
|
82
|
+
*
|
|
83
|
+
* This method should be called even if the {@linkcode generate} method
|
|
84
|
+
* or the {@linkcode write} method threw an error. It should be called
|
|
85
|
+
* even if neither of the methods are called.
|
|
86
|
+
*
|
|
87
|
+
* This method is called automatically when using `using` syntax.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```js
|
|
91
|
+
* import { rolldown } from 'rolldown';
|
|
92
|
+
*
|
|
93
|
+
* {
|
|
94
|
+
* using bundle = await rolldown({ input: 'src/main.js' });
|
|
95
|
+
* const output = await bundle.generate({ format: 'esm' });
|
|
96
|
+
* console.log(output);
|
|
97
|
+
* // bundle.close() is called automatically here
|
|
98
|
+
* }
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
async close() {
|
|
102
|
+
const shouldRelease = !this.#asyncRuntimeReleased;
|
|
103
|
+
this.#asyncRuntimeReleased = true;
|
|
104
|
+
try {
|
|
105
|
+
await this.#stopWorkers?.();
|
|
106
|
+
await this.#bundler.close();
|
|
107
|
+
this.#stopWorkers = void 0;
|
|
108
|
+
} finally {
|
|
109
|
+
if (shouldRelease) (0, import_binding.shutdownAsyncRuntime)();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/** @hidden documented in close method */
|
|
113
|
+
async [Symbol.asyncDispose]() {
|
|
114
|
+
await this.close();
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* @experimental
|
|
118
|
+
* @hidden not ready for public usage yet
|
|
119
|
+
*/
|
|
120
|
+
get watchFiles() {
|
|
121
|
+
return Promise.resolve(this.#bundler.getWatchFiles());
|
|
122
|
+
}
|
|
123
|
+
async #build(isWrite, outputOptions) {
|
|
124
|
+
validateOption("output", outputOptions);
|
|
125
|
+
await this.#stopWorkers?.();
|
|
126
|
+
const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
|
|
127
|
+
try {
|
|
128
|
+
this.#stopWorkers = option.stopWorkers;
|
|
129
|
+
let output;
|
|
130
|
+
if (isWrite) output = await this.#bundler.write(option.bundlerOptions);
|
|
131
|
+
else output = await this.#bundler.generate(option.bundlerOptions);
|
|
132
|
+
return new RolldownOutputImpl(unwrapBindingResult(output));
|
|
133
|
+
} catch (e) {
|
|
134
|
+
await option.stopWorkers?.();
|
|
135
|
+
throw e;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region src/api/rolldown/index.ts
|
|
141
|
+
/**
|
|
142
|
+
* The API compatible with Rollup's `rollup` function.
|
|
143
|
+
*
|
|
144
|
+
* Unlike Rollup, the module graph is not built until the methods of the bundle object are called.
|
|
145
|
+
*
|
|
146
|
+
* @param input The input options object.
|
|
147
|
+
* @returns A Promise that resolves to a bundle object.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```js
|
|
151
|
+
* import { rolldown } from 'rolldown';
|
|
152
|
+
*
|
|
153
|
+
* let bundle, failed = false;
|
|
154
|
+
* try {
|
|
155
|
+
* bundle = await rolldown({
|
|
156
|
+
* input: 'src/main.js',
|
|
157
|
+
* });
|
|
158
|
+
* await bundle.write({
|
|
159
|
+
* format: 'esm',
|
|
160
|
+
* });
|
|
161
|
+
* } catch (e) {
|
|
162
|
+
* console.error(e);
|
|
163
|
+
* failed = true;
|
|
164
|
+
* }
|
|
165
|
+
* if (bundle) {
|
|
166
|
+
* await bundle.close();
|
|
167
|
+
* }
|
|
168
|
+
* process.exitCode = failed ? 1 : 0;
|
|
169
|
+
* ```
|
|
170
|
+
*
|
|
171
|
+
* @category Programmatic APIs
|
|
172
|
+
*/
|
|
173
|
+
const rolldown = async (input) => {
|
|
174
|
+
validateOption("input", input);
|
|
175
|
+
return new RolldownBuild(await PluginDriver.callOptionsHook(input));
|
|
176
|
+
};
|
|
177
|
+
//#endregion
|
|
178
|
+
export { rolldown as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as RolldownLog } from "./logging-xuHO4mAy.mjs";
|
|
2
|
-
import { F as MinifyOptions$1, G as TsconfigCache$1, I as MinifyResult$1, R as ParseResult$1, U as SourceMap, a as BindingEnhancedTransformOptions, o as BindingEnhancedTransformResult, y as BindingTsconfigResult, z as ParserOptions$1 } from "./binding-
|
|
2
|
+
import { F as MinifyOptions$1, G as TsconfigCache$1, I as MinifyResult$1, R as ParseResult$1, U as SourceMap, a as BindingEnhancedTransformOptions, o as BindingEnhancedTransformResult, y as BindingTsconfigResult, z as ParserOptions$1 } from "./binding-CVtkJvyl.mjs";
|
|
3
3
|
//#region src/utils/resolve-tsconfig.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Cache for tsconfig resolution to avoid redundant file system operations.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as arraify } from "./misc-
|
|
5
|
-
import {
|
|
6
|
-
import { t as aggregateBindingErrorsIntoJsError } from "./error-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-Cv62mM1i.mjs";
|
|
2
|
+
import { s as logMultipleWatcherOption } from "./logs-DmYCAKcW.mjs";
|
|
3
|
+
import { y as LOG_LEVEL_WARN } from "./bindingify-input-options-EnUlEF0T.mjs";
|
|
4
|
+
import { t as arraify } from "./misc-DOSKtd97.mjs";
|
|
5
|
+
import { l as PluginDriver, t as createBundlerOptions } from "./create-bundler-option-4QtiLLuz.mjs";
|
|
6
|
+
import { t as aggregateBindingErrorsIntoJsError } from "./error-BgfXq0Tb.mjs";
|
|
7
7
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
8
8
|
/**
|
|
9
9
|
* This is not the set of all possible signals.
|
|
@@ -276,9 +276,7 @@ function createEventCallback(emitter) {
|
|
|
276
276
|
case "restart":
|
|
277
277
|
await emitter.emit("restart");
|
|
278
278
|
break;
|
|
279
|
-
case "close":
|
|
280
|
-
await emitter.emit("close");
|
|
281
|
-
break;
|
|
279
|
+
case "close": await emitter.emit("close");
|
|
282
280
|
}
|
|
283
281
|
};
|
|
284
282
|
}
|
|
@@ -291,6 +289,7 @@ var Watcher = class {
|
|
|
291
289
|
this.closed = false;
|
|
292
290
|
this.inner = inner;
|
|
293
291
|
this.emitter = emitter;
|
|
292
|
+
(0, import_binding.startAsyncRuntime)();
|
|
294
293
|
const originClose = emitter.close.bind(emitter);
|
|
295
294
|
emitter.close = async () => {
|
|
296
295
|
await this.close();
|
|
@@ -302,9 +301,12 @@ var Watcher = class {
|
|
|
302
301
|
async close() {
|
|
303
302
|
if (this.closed) return;
|
|
304
303
|
this.closed = true;
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
304
|
+
try {
|
|
305
|
+
for (const stop of this.stopWorkers) await stop?.();
|
|
306
|
+
await this.inner.close();
|
|
307
|
+
} finally {
|
|
308
|
+
(0, import_binding.shutdownAsyncRuntime)();
|
|
309
|
+
}
|
|
308
310
|
}
|
|
309
311
|
async run() {
|
|
310
312
|
await this.inner.run();
|
|
@@ -314,7 +316,8 @@ var Watcher = class {
|
|
|
314
316
|
async function createWatcher(emitter, input) {
|
|
315
317
|
const options = arraify(input);
|
|
316
318
|
const bundlerOptions = await Promise.all(options.map((option) => arraify(option.output || {}).map(async (output) => {
|
|
317
|
-
|
|
319
|
+
const inputOptions = await PluginDriver.callOptionsHook(option, true);
|
|
320
|
+
return createBundlerOptions(inputOptions, output, true);
|
|
318
321
|
})).flat());
|
|
319
322
|
warnMultiplePollingOptions(bundlerOptions);
|
|
320
323
|
const callback = createEventCallback(emitter);
|
package/dist/utils-index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as BindingTsconfigCompilerOptions, v as BindingTsconfigRawOptions } from "./shared/binding-
|
|
2
|
-
import { a as MinifyOptions, c as minifySync, d as parse, f as parseSync, i as transformSync, l as ParseResult, n as TransformResult, o as MinifyResult, p as TsconfigCache, r as transform, s as minify, t as TransformOptions, u as ParserOptions } from "./shared/transform-
|
|
1
|
+
import { _ as BindingTsconfigCompilerOptions, v as BindingTsconfigRawOptions } from "./shared/binding-CVtkJvyl.mjs";
|
|
2
|
+
import { a as MinifyOptions, c as minifySync, d as parse, f as parseSync, i as transformSync, l as ParseResult, n as TransformResult, o as MinifyResult, p as TsconfigCache, r as transform, s as minify, t as TransformOptions, u as ParserOptions } from "./shared/transform-WmU_cI8e.mjs";
|
|
3
3
|
import * as ESTree from "@oxc-project/types";
|
|
4
4
|
import { Program } from "@oxc-project/types";
|
|
5
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
5
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.142.0/node_modules/oxc-parser/src-js/generated/visit/visitor.d.ts
|
|
6
6
|
interface VisitorObject$1 {
|
|
7
7
|
DebuggerStatement?: (node: ESTree.DebuggerStatement) => void;
|
|
8
8
|
"DebuggerStatement:exit"?: (node: ESTree.DebuggerStatement) => void;
|
package/dist/utils-index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as parseSync, t as parse } from "./shared/parse-
|
|
2
|
-
import { a as minify, i as transformSync, o as minifySync, r as transform, t as TsconfigCache } from "./shared/resolve-tsconfig-
|
|
3
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
1
|
+
import { n as parseSync, t as parse } from "./shared/parse-DQIYJwT4.mjs";
|
|
2
|
+
import { a as minify, i as transformSync, o as minifySync, r as transform, t as TsconfigCache } from "./shared/resolve-tsconfig-CQndqeLj.mjs";
|
|
3
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.142.0/node_modules/oxc-parser/src-js/generated/visit/walk.js
|
|
4
4
|
function walkNode(node, visitors) {
|
|
5
5
|
if (node == null) return;
|
|
6
6
|
if (Array.isArray(node)) {
|
|
@@ -499,9 +499,7 @@ function walkNode(node, visitors) {
|
|
|
499
499
|
case "TSTypeReference":
|
|
500
500
|
walkTSTypeReference(node, visitors);
|
|
501
501
|
break;
|
|
502
|
-
case "TSUnionType":
|
|
503
|
-
walkTSUnionType(node, visitors);
|
|
504
|
-
break;
|
|
502
|
+
case "TSUnionType": walkTSUnionType(node, visitors);
|
|
505
503
|
}
|
|
506
504
|
}
|
|
507
505
|
function walkDebuggerStatement(node, visitors) {
|
|
@@ -2010,7 +2008,7 @@ function walkTSUnionType(node, visitors) {
|
|
|
2010
2008
|
exit !== null && exit(node);
|
|
2011
2009
|
}
|
|
2012
2010
|
//#endregion
|
|
2013
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
2011
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.142.0/node_modules/oxc-parser/src-js/generated/visit/type_ids.js
|
|
2014
2012
|
/** Mapping from node type name to node type ID */
|
|
2015
2013
|
const NODE_TYPE_IDS_MAP = /* @__PURE__ */ new Map([
|
|
2016
2014
|
["DebuggerStatement", 0],
|
|
@@ -2180,7 +2178,7 @@ const NODE_TYPE_IDS_MAP = /* @__PURE__ */ new Map([
|
|
|
2180
2178
|
["TSUnionType", 164]
|
|
2181
2179
|
]);
|
|
2182
2180
|
//#endregion
|
|
2183
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
2181
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.142.0/node_modules/oxc-parser/src-js/visit/visitor.js
|
|
2184
2182
|
let compiledVisitor;
|
|
2185
2183
|
function createCompiledVisitor() {
|
|
2186
2184
|
compiledVisitor = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bundler",
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
"bin",
|
|
25
25
|
"cli",
|
|
26
26
|
"dist",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"THIRD-PARTY-LICENSE",
|
|
27
29
|
"!dist/*.node"
|
|
28
30
|
],
|
|
29
31
|
"type": "module",
|
|
@@ -31,6 +33,7 @@
|
|
|
31
33
|
"module": "./dist/index.mjs",
|
|
32
34
|
"types": "./dist/index.d.mts",
|
|
33
35
|
"imports": {
|
|
36
|
+
"#default-runtime": "./dist/experimental-default-runtime.mjs",
|
|
34
37
|
"#parallel-plugin-worker": "./dist/parallel-plugin-worker.mjs"
|
|
35
38
|
},
|
|
36
39
|
"exports": {
|
|
@@ -40,6 +43,10 @@
|
|
|
40
43
|
"./experimental/runtime-types": {
|
|
41
44
|
"types": "./dist/experimental-runtime-types.d.ts"
|
|
42
45
|
},
|
|
46
|
+
"./experimental/runtime": {
|
|
47
|
+
"types": "./dist/experimental-runtime.d.ts",
|
|
48
|
+
"default": "./dist/experimental-runtime.mjs"
|
|
49
|
+
},
|
|
43
50
|
"./filter": "./dist/filter-index.mjs",
|
|
44
51
|
"./getLogFilter": "./dist/get-log-filter.mjs",
|
|
45
52
|
"./parallelPlugin": "./dist/parallel-plugin.mjs",
|
|
@@ -53,30 +60,30 @@
|
|
|
53
60
|
"registry": "https://registry.npmjs.org/"
|
|
54
61
|
},
|
|
55
62
|
"dependencies": {
|
|
56
|
-
"@oxc-project/types": "=0.
|
|
63
|
+
"@oxc-project/types": "=0.142.0",
|
|
57
64
|
"@rolldown/pluginutils": "^1.0.0"
|
|
58
65
|
},
|
|
59
66
|
"devDependencies": {
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
67
|
+
"@emnapi/core": "2.0.0-alpha.3",
|
|
68
|
+
"@emnapi/runtime": "2.0.0-alpha.3",
|
|
69
|
+
"@napi-rs/cli": "^3.8.0",
|
|
70
|
+
"@napi-rs/wasm-runtime": "^1.2.0",
|
|
62
71
|
"@oxc-node/cli": "^0.1.0",
|
|
63
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
64
|
-
"buble": "^0.20.0",
|
|
65
72
|
"cac": "^7.0.0",
|
|
66
73
|
"consola": "^3.4.2",
|
|
67
74
|
"execa": "^9.2.0",
|
|
68
75
|
"fresh-import": "^0.2.1",
|
|
69
76
|
"glob": "^13.0.0",
|
|
70
|
-
"oxc-parser": "=0.
|
|
77
|
+
"oxc-parser": "=0.142.0",
|
|
71
78
|
"pathe": "^2.0.3",
|
|
72
79
|
"remeda": "^2.34.1",
|
|
73
80
|
"rolldown-plugin-dts": "^0.27.0",
|
|
74
81
|
"rollup": "^4.60.4",
|
|
75
82
|
"signal-exit": "4.1.0",
|
|
76
|
-
"source-map": "0.
|
|
83
|
+
"source-map": "0.8.0",
|
|
77
84
|
"typescript": "^6.0.0",
|
|
78
85
|
"valibot": "1.4.2",
|
|
79
|
-
"rolldown": "1.2.
|
|
86
|
+
"rolldown": "1.2.1"
|
|
80
87
|
},
|
|
81
88
|
"napi": {
|
|
82
89
|
"binaryName": "rolldown-binding",
|
|
@@ -112,21 +119,21 @@
|
|
|
112
119
|
"node": "^20.19.0 || >=22.12.0"
|
|
113
120
|
},
|
|
114
121
|
"optionalDependencies": {
|
|
115
|
-
"@rolldown/binding-darwin-x64": "1.2.
|
|
116
|
-
"@rolldown/binding-win32-x64-msvc": "1.2.
|
|
117
|
-
"@rolldown/binding-linux-x64-gnu": "1.2.
|
|
118
|
-
"@rolldown/binding-linux-x64-musl": "1.2.
|
|
119
|
-
"@rolldown/binding-freebsd-x64": "1.2.
|
|
120
|
-
"@rolldown/binding-linux-arm-gnueabihf": "1.2.
|
|
121
|
-
"@rolldown/binding-linux-arm64-gnu": "1.2.
|
|
122
|
-
"@rolldown/binding-darwin-arm64": "1.2.
|
|
123
|
-
"@rolldown/binding-linux-arm64-musl": "1.2.
|
|
124
|
-
"@rolldown/binding-openharmony-arm64": "1.2.
|
|
125
|
-
"@rolldown/binding-win32-arm64-msvc": "1.2.
|
|
126
|
-
"@rolldown/binding-android-arm64": "1.2.
|
|
127
|
-
"@rolldown/binding-wasm32-wasi": "1.2.
|
|
128
|
-
"@rolldown/binding-linux-s390x-gnu": "1.2.
|
|
129
|
-
"@rolldown/binding-linux-ppc64-gnu": "1.2.
|
|
122
|
+
"@rolldown/binding-darwin-x64": "1.2.1",
|
|
123
|
+
"@rolldown/binding-win32-x64-msvc": "1.2.1",
|
|
124
|
+
"@rolldown/binding-linux-x64-gnu": "1.2.1",
|
|
125
|
+
"@rolldown/binding-linux-x64-musl": "1.2.1",
|
|
126
|
+
"@rolldown/binding-freebsd-x64": "1.2.1",
|
|
127
|
+
"@rolldown/binding-linux-arm-gnueabihf": "1.2.1",
|
|
128
|
+
"@rolldown/binding-linux-arm64-gnu": "1.2.1",
|
|
129
|
+
"@rolldown/binding-darwin-arm64": "1.2.1",
|
|
130
|
+
"@rolldown/binding-linux-arm64-musl": "1.2.1",
|
|
131
|
+
"@rolldown/binding-openharmony-arm64": "1.2.1",
|
|
132
|
+
"@rolldown/binding-win32-arm64-msvc": "1.2.1",
|
|
133
|
+
"@rolldown/binding-android-arm64": "1.2.1",
|
|
134
|
+
"@rolldown/binding-wasm32-wasi": "1.2.1",
|
|
135
|
+
"@rolldown/binding-linux-s390x-gnu": "1.2.1",
|
|
136
|
+
"@rolldown/binding-linux-ppc64-gnu": "1.2.1"
|
|
130
137
|
},
|
|
131
138
|
"scripts": {
|
|
132
139
|
"# Scrips for binding #": "_",
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { c as validateOption, t as RolldownBuild, u as PluginDriver } from "./rolldown-build-CdF8HAHX.mjs";
|
|
2
|
-
//#region src/api/rolldown/index.ts
|
|
3
|
-
/**
|
|
4
|
-
* The API compatible with Rollup's `rollup` function.
|
|
5
|
-
*
|
|
6
|
-
* Unlike Rollup, the module graph is not built until the methods of the bundle object are called.
|
|
7
|
-
*
|
|
8
|
-
* @param input The input options object.
|
|
9
|
-
* @returns A Promise that resolves to a bundle object.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```js
|
|
13
|
-
* import { rolldown } from 'rolldown';
|
|
14
|
-
*
|
|
15
|
-
* let bundle, failed = false;
|
|
16
|
-
* try {
|
|
17
|
-
* bundle = await rolldown({
|
|
18
|
-
* input: 'src/main.js',
|
|
19
|
-
* });
|
|
20
|
-
* await bundle.write({
|
|
21
|
-
* format: 'esm',
|
|
22
|
-
* });
|
|
23
|
-
* } catch (e) {
|
|
24
|
-
* console.error(e);
|
|
25
|
-
* failed = true;
|
|
26
|
-
* }
|
|
27
|
-
* if (bundle) {
|
|
28
|
-
* await bundle.close();
|
|
29
|
-
* }
|
|
30
|
-
* process.exitCode = failed ? 1 : 0;
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* @category Programmatic APIs
|
|
34
|
-
*/
|
|
35
|
-
const rolldown = async (input) => {
|
|
36
|
-
validateOption("input", input);
|
|
37
|
-
return new RolldownBuild(await PluginDriver.callOptionsHook(input));
|
|
38
|
-
};
|
|
39
|
-
//#endregion
|
|
40
|
-
export { rolldown as t };
|