rolldown 1.0.0-beta.1-commit.298dd8b → 1.0.0-beta.1-commit.7c52c94
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/cjs/cli.cjs +2 -2
- package/dist/cjs/experimental-index.cjs +2 -6
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/parallel-plugin-worker.cjs +3 -4
- package/dist/cjs/parse-ast-index.cjs +6 -8
- package/dist/esm/cli.mjs +2 -2
- package/dist/esm/experimental-index.mjs +2 -6
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/parallel-plugin-worker.mjs +2 -3
- package/dist/esm/parse-ast-index.mjs +1 -2
- package/dist/shared/{binding-DLjQWzkm.mjs → binding-Bl7VQy7c.mjs} +2 -1
- package/dist/shared/{binding-D5MBYAdC.cjs → binding-fhgdIkpS.cjs} +7 -6
- package/dist/shared/{src-BiKHJ1rU.mjs → src-CPCP99Z9.mjs} +27 -24
- package/dist/shared/{src-BYsFiN-a.cjs → src-lBcHSsjm.cjs} +47 -44
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/binding.d.ts +3 -2
- package/package.json +16 -16
package/dist/cjs/cli.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
4
|
-
const require_binding = require('../shared/binding-
|
|
3
|
+
const require_src = require('../shared/src-lBcHSsjm.cjs');
|
|
4
|
+
const require_binding = require('../shared/binding-fhgdIkpS.cjs');
|
|
5
5
|
const require_consola_36c0034f = require('../shared/consola_36c0034f-CynBWXXO.cjs');
|
|
6
6
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
7
7
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
4
|
-
const require_binding
|
|
3
|
+
const require_src = require('../shared/src-lBcHSsjm.cjs');
|
|
4
|
+
const require_binding = require('../shared/binding-fhgdIkpS.cjs');
|
|
5
5
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
6
6
|
|
|
7
7
|
//#region src/plugin/parallel-plugin.ts
|
|
@@ -53,10 +53,6 @@ function aliasPlugin(config) {
|
|
|
53
53
|
return new require_src.BuiltinPlugin("builtin:alias", config);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/experimental-index.ts
|
|
58
|
-
var import_binding = require_chunk.__toESM(require_binding$1.require_binding());
|
|
59
|
-
|
|
60
56
|
//#endregion
|
|
61
57
|
exports.aliasPlugin = aliasPlugin
|
|
62
58
|
exports.buildImportAnalysisPlugin = require_src.buildImportAnalysisPlugin
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_src = require('../shared/src-
|
|
2
|
-
require('../shared/binding-
|
|
1
|
+
const require_src = require('../shared/src-lBcHSsjm.cjs');
|
|
2
|
+
require('../shared/binding-fhgdIkpS.cjs');
|
|
3
3
|
|
|
4
4
|
exports.VERSION = require_src.VERSION
|
|
5
5
|
exports.build = require_src.build
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
4
|
-
const require_binding
|
|
3
|
+
const require_src = require('../shared/src-lBcHSsjm.cjs');
|
|
4
|
+
const require_binding = require('../shared/binding-fhgdIkpS.cjs');
|
|
5
5
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
6
6
|
|
|
7
7
|
//#region src/parallel-plugin-worker.ts
|
|
8
|
-
var import_binding = require_chunk.__toESM(require_binding$1.require_binding());
|
|
9
8
|
const { registryId, pluginInfos, threadNumber } = node_worker_threads.workerData;
|
|
10
9
|
(async () => {
|
|
11
10
|
try {
|
|
@@ -26,7 +25,7 @@ const { registryId, pluginInfos, threadNumber } = node_worker_threads.workerData
|
|
|
26
25
|
)
|
|
27
26
|
};
|
|
28
27
|
}));
|
|
29
|
-
(0, import_binding.registerPlugins)(registryId, plugins);
|
|
28
|
+
(0, require_binding.import_binding.registerPlugins)(registryId, plugins);
|
|
30
29
|
node_worker_threads.parentPort.postMessage({ type: "success" });
|
|
31
30
|
} catch (error) {
|
|
32
31
|
node_worker_threads.parentPort.postMessage({
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
const require_binding$1 = require('../shared/binding-D5MBYAdC.cjs');
|
|
2
|
+
const require_binding = require('../shared/binding-fhgdIkpS.cjs');
|
|
4
3
|
|
|
5
4
|
//#region src/parse-ast-index.ts
|
|
6
|
-
var import_binding = require_chunk.__toESM(require_binding$1.require_binding());
|
|
7
5
|
function wrap(result, sourceText) {
|
|
8
6
|
let program, module$1, comments, errors, magicString;
|
|
9
7
|
return {
|
|
@@ -40,18 +38,18 @@ function normalizeParseError(sourceText, errors) {
|
|
|
40
38
|
}
|
|
41
39
|
const e = errors[i];
|
|
42
40
|
message += e.message + "\n" + e.labels.map((label) => {
|
|
43
|
-
const location = require_binding
|
|
41
|
+
const location = require_binding.locate(sourceText, label.start, { offsetLine: 1 });
|
|
44
42
|
if (!location) return;
|
|
45
|
-
return require_binding
|
|
43
|
+
return require_binding.getCodeFrame(sourceText, location.line, location.column);
|
|
46
44
|
}).filter(Boolean).join("\n");
|
|
47
45
|
}
|
|
48
|
-
return require_binding
|
|
46
|
+
return require_binding.error(require_binding.logParseError(message));
|
|
49
47
|
}
|
|
50
48
|
function parseAst(filename, sourceText, options) {
|
|
51
|
-
return wrap((0, import_binding.parseSync)(filename, sourceText, options), sourceText);
|
|
49
|
+
return wrap((0, require_binding.import_binding.parseSync)(filename, sourceText, options), sourceText);
|
|
52
50
|
}
|
|
53
51
|
async function parseAstAsync(filename, sourceText, options) {
|
|
54
|
-
return wrap(await (0, import_binding.parseAsync)(filename, sourceText, options), sourceText);
|
|
52
|
+
return wrap(await (0, require_binding.import_binding.parseAsync)(filename, sourceText, options), sourceText);
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
//#endregion
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { colors } from "../shared/binding-
|
|
2
|
-
import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-
|
|
1
|
+
import { colors } from "../shared/binding-Bl7VQy7c.mjs";
|
|
2
|
+
import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-CPCP99Z9.mjs";
|
|
3
3
|
import { createConsola } from "../shared/consola_36c0034f-Cx52UqEq.mjs";
|
|
4
4
|
import process$1, { cwd } from "node:process";
|
|
5
5
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-
|
|
1
|
+
import { import_binding } from "../shared/binding-Bl7VQy7c.mjs";
|
|
2
|
+
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-CPCP99Z9.mjs";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
|
|
5
5
|
//#region src/plugin/parallel-plugin.ts
|
|
@@ -51,10 +51,6 @@ function aliasPlugin(config) {
|
|
|
51
51
|
return new BuiltinPlugin("builtin:alias", config);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/experimental-index.ts
|
|
56
|
-
var import_binding = __toESM(require_binding());
|
|
57
|
-
|
|
58
54
|
//#endregion
|
|
59
55
|
var transform = import_binding.transform;
|
|
60
56
|
export { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins as composePlugins, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, replacePlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../shared/binding-
|
|
2
|
-
import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-
|
|
1
|
+
import "../shared/binding-Bl7VQy7c.mjs";
|
|
2
|
+
import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-CPCP99Z9.mjs";
|
|
3
3
|
|
|
4
4
|
export { VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PluginContextData, bindingifyPlugin } from "../shared/src-
|
|
1
|
+
import { import_binding } from "../shared/binding-Bl7VQy7c.mjs";
|
|
2
|
+
import { PluginContextData, bindingifyPlugin } from "../shared/src-CPCP99Z9.mjs";
|
|
3
3
|
import { parentPort, workerData } from "node:worker_threads";
|
|
4
4
|
|
|
5
5
|
//#region src/parallel-plugin-worker.ts
|
|
6
|
-
var import_binding = __toESM(require_binding());
|
|
7
6
|
const { registryId, pluginInfos, threadNumber } = workerData;
|
|
8
7
|
(async () => {
|
|
9
8
|
try {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { error, getCodeFrame, import_binding, locate, logParseError } from "../shared/binding-Bl7VQy7c.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/parse-ast-index.ts
|
|
4
|
-
var import_binding = __toESM(require_binding());
|
|
5
4
|
function wrap(result, sourceText) {
|
|
6
5
|
let program, module, comments, errors, magicString;
|
|
7
6
|
return {
|
|
@@ -604,6 +604,7 @@ var require_binding = __commonJS({ "src/binding.js"(exports, module) {
|
|
|
604
604
|
module.exports.Severity = nativeBinding.Severity;
|
|
605
605
|
module.exports.transform = nativeBinding.transform;
|
|
606
606
|
} });
|
|
607
|
+
var import_binding = __toESM(require_binding());
|
|
607
608
|
|
|
608
609
|
//#endregion
|
|
609
|
-
export {
|
|
610
|
+
export { augmentCodeLocation, colors, error, getCodeFrame, import_binding, locate, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logParseError, logPluginError };
|
|
@@ -578,6 +578,7 @@ var require_binding = require_chunk.__commonJS({ "src/binding.js"(exports, modul
|
|
|
578
578
|
module.exports.Severity = nativeBinding.Severity;
|
|
579
579
|
module.exports.transform = nativeBinding.transform;
|
|
580
580
|
} });
|
|
581
|
+
var import_binding = require_chunk.__toESM(require_binding());
|
|
581
582
|
|
|
582
583
|
//#endregion
|
|
583
584
|
Object.defineProperty(exports, 'augmentCodeLocation', {
|
|
@@ -604,6 +605,12 @@ Object.defineProperty(exports, 'getCodeFrame', {
|
|
|
604
605
|
return getCodeFrame;
|
|
605
606
|
}
|
|
606
607
|
});
|
|
608
|
+
Object.defineProperty(exports, 'import_binding', {
|
|
609
|
+
enumerable: true,
|
|
610
|
+
get: function () {
|
|
611
|
+
return import_binding;
|
|
612
|
+
}
|
|
613
|
+
});
|
|
607
614
|
Object.defineProperty(exports, 'locate', {
|
|
608
615
|
enumerable: true,
|
|
609
616
|
get: function () {
|
|
@@ -651,10 +658,4 @@ Object.defineProperty(exports, 'logPluginError', {
|
|
|
651
658
|
get: function () {
|
|
652
659
|
return logPluginError;
|
|
653
660
|
}
|
|
654
|
-
});
|
|
655
|
-
Object.defineProperty(exports, 'require_binding', {
|
|
656
|
-
enumerable: true,
|
|
657
|
-
get: function () {
|
|
658
|
-
return require_binding;
|
|
659
|
-
}
|
|
660
661
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { augmentCodeLocation, colors, error, import_binding, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError } from "./binding-Bl7VQy7c.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Buffer } from "node:buffer";
|
|
4
4
|
import { Worker } from "node:worker_threads";
|
|
@@ -158,9 +158,8 @@ function relativeId(id) {
|
|
|
158
158
|
|
|
159
159
|
//#endregion
|
|
160
160
|
//#region src/builtin-plugin/utils.ts
|
|
161
|
-
var import_binding$6 = __toESM(require_binding());
|
|
162
161
|
function makeBuiltinPluginCallable(plugin) {
|
|
163
|
-
let callablePlugin = new import_binding
|
|
162
|
+
let callablePlugin = new import_binding.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
164
163
|
const wrappedPlugin = plugin;
|
|
165
164
|
for (const key in callablePlugin) wrappedPlugin[key] = function(...args) {
|
|
166
165
|
return callablePlugin[key](...args);
|
|
@@ -221,9 +220,19 @@ function viteResolvePlugin(config) {
|
|
|
221
220
|
function moduleFederationPlugin(config) {
|
|
222
221
|
return new BuiltinPlugin("builtin:module-federation", {
|
|
223
222
|
...config,
|
|
224
|
-
remotes: config.remotes && Object.
|
|
225
|
-
if (typeof
|
|
226
|
-
|
|
223
|
+
remotes: config.remotes && Object.entries(config.remotes).map(([name, remote]) => {
|
|
224
|
+
if (typeof remote === "string") {
|
|
225
|
+
const [entryGlobalName] = remote.split("@");
|
|
226
|
+
const entry = remote.replace(entryGlobalName + "@", "");
|
|
227
|
+
return {
|
|
228
|
+
entry,
|
|
229
|
+
name
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
return {
|
|
233
|
+
...remote,
|
|
234
|
+
name: remote.name ?? name
|
|
235
|
+
};
|
|
227
236
|
})
|
|
228
237
|
});
|
|
229
238
|
}
|
|
@@ -719,12 +728,11 @@ var MinimalPluginContext = class {
|
|
|
719
728
|
|
|
720
729
|
//#endregion
|
|
721
730
|
//#region src/utils/transform-side-effects.ts
|
|
722
|
-
var import_binding$5 = __toESM(require_binding());
|
|
723
731
|
function bindingifySideEffects(sideEffects) {
|
|
724
732
|
switch (sideEffects) {
|
|
725
|
-
case true: return import_binding
|
|
726
|
-
case false: return import_binding
|
|
727
|
-
case "no-treeshake": return import_binding
|
|
733
|
+
case true: return import_binding.BindingHookSideEffects.True;
|
|
734
|
+
case false: return import_binding.BindingHookSideEffects.False;
|
|
735
|
+
case "no-treeshake": return import_binding.BindingHookSideEffects.NoTreeshake;
|
|
728
736
|
case null:
|
|
729
737
|
case undefined: return undefined;
|
|
730
738
|
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
@@ -846,14 +854,13 @@ var TransformPluginContext = class extends PluginContext {
|
|
|
846
854
|
|
|
847
855
|
//#endregion
|
|
848
856
|
//#region src/plugin/bindingify-plugin-hook-meta.ts
|
|
849
|
-
var import_binding$4 = __toESM(require_binding());
|
|
850
857
|
function bindingifyPluginHookMeta(options) {
|
|
851
858
|
return { order: bindingPluginOrder(options.order) };
|
|
852
859
|
}
|
|
853
860
|
function bindingPluginOrder(order) {
|
|
854
861
|
switch (order) {
|
|
855
|
-
case "post": return import_binding
|
|
856
|
-
case "pre": return import_binding
|
|
862
|
+
case "post": return import_binding.BindingPluginOrder.Post;
|
|
863
|
+
case "pre": return import_binding.BindingPluginOrder.Pre;
|
|
857
864
|
case null:
|
|
858
865
|
case undefined: return undefined;
|
|
859
866
|
default: throw new Error(`Unknown plugin order: ${order}`);
|
|
@@ -1517,7 +1524,6 @@ function normalizedStringOrRegex(pattern) {
|
|
|
1517
1524
|
|
|
1518
1525
|
//#endregion
|
|
1519
1526
|
//#region src/utils/bindingify-input-options.ts
|
|
1520
|
-
var import_binding$3 = __toESM(require_binding());
|
|
1521
1527
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, onLog, logLevel) {
|
|
1522
1528
|
const pluginContextData = new PluginContextData();
|
|
1523
1529
|
const plugins = rawPlugins.map((plugin) => {
|
|
@@ -1608,10 +1614,10 @@ function bindingifyInject(inject) {
|
|
|
1608
1614
|
}
|
|
1609
1615
|
function bindingifyLogLevel(logLevel) {
|
|
1610
1616
|
switch (logLevel) {
|
|
1611
|
-
case "silent": return import_binding
|
|
1612
|
-
case "debug": return import_binding
|
|
1613
|
-
case "warn": return import_binding
|
|
1614
|
-
case "info": return import_binding
|
|
1617
|
+
case "silent": return import_binding.BindingLogLevel.Silent;
|
|
1618
|
+
case "debug": return import_binding.BindingLogLevel.Debug;
|
|
1619
|
+
case "warn": return import_binding.BindingLogLevel.Warn;
|
|
1620
|
+
case "info": return import_binding.BindingLogLevel.Info;
|
|
1615
1621
|
default: throw new Error(`Unexpected log level: ${logLevel}`);
|
|
1616
1622
|
}
|
|
1617
1623
|
}
|
|
@@ -2088,7 +2094,6 @@ function composeJsPlugins(plugins) {
|
|
|
2088
2094
|
|
|
2089
2095
|
//#endregion
|
|
2090
2096
|
//#region src/utils/initialize-parallel-plugins.ts
|
|
2091
|
-
var import_binding$2 = __toESM(require_binding());
|
|
2092
2097
|
async function initializeParallelPlugins(plugins) {
|
|
2093
2098
|
const pluginInfos = [];
|
|
2094
2099
|
for (const [index, plugin] of plugins.entries()) if ("_parallel" in plugin) {
|
|
@@ -2101,7 +2106,7 @@ async function initializeParallelPlugins(plugins) {
|
|
|
2101
2106
|
}
|
|
2102
2107
|
if (pluginInfos.length <= 0) return undefined;
|
|
2103
2108
|
const count = Math.min(availableParallelism(), 8);
|
|
2104
|
-
const parallelJsPluginRegistry = new import_binding
|
|
2109
|
+
const parallelJsPluginRegistry = new import_binding.ParallelJsPluginRegistry(count);
|
|
2105
2110
|
const registryId = parallelJsPluginRegistry.id;
|
|
2106
2111
|
const workers = await initializeWorkers(registryId, count, pluginInfos);
|
|
2107
2112
|
const stopWorkers = async () => {
|
|
@@ -2429,12 +2434,11 @@ async function createBundlerOptions(inputOptions, outputOptions) {
|
|
|
2429
2434
|
|
|
2430
2435
|
//#endregion
|
|
2431
2436
|
//#region src/utils/create-bundler.ts
|
|
2432
|
-
var import_binding$1 = __toESM(require_binding());
|
|
2433
2437
|
async function createBundler(inputOptions, outputOptions) {
|
|
2434
2438
|
const option = await createBundlerOptions(inputOptions, outputOptions);
|
|
2435
2439
|
try {
|
|
2436
2440
|
return {
|
|
2437
|
-
bundler: new import_binding
|
|
2441
|
+
bundler: new import_binding.Bundler(option.bundlerOptions),
|
|
2438
2442
|
stopWorkers: option.stopWorkers
|
|
2439
2443
|
};
|
|
2440
2444
|
} catch (e) {
|
|
@@ -2552,7 +2556,6 @@ var WatcherEmitter = class {
|
|
|
2552
2556
|
|
|
2553
2557
|
//#endregion
|
|
2554
2558
|
//#region src/api/watch/watcher.ts
|
|
2555
|
-
var import_binding = __toESM(require_binding());
|
|
2556
2559
|
var Watcher = class {
|
|
2557
2560
|
closed;
|
|
2558
2561
|
inner;
|
|
@@ -2611,7 +2614,7 @@ const watch = (input) => {
|
|
|
2611
2614
|
|
|
2612
2615
|
//#endregion
|
|
2613
2616
|
//#region package.json
|
|
2614
|
-
var version = "1.0.0-beta.1-commit.
|
|
2617
|
+
var version = "1.0.0-beta.1-commit.7c52c94";
|
|
2615
2618
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
2616
2619
|
|
|
2617
2620
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('./chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_binding
|
|
3
|
+
const require_binding = require('./binding-fhgdIkpS.cjs');
|
|
4
4
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
5
5
|
const node_buffer = require_chunk.__toESM(require("node:buffer"));
|
|
6
6
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
@@ -54,7 +54,7 @@ const normalizeLog = (log) => typeof log === "string" ? { message: log } : typeo
|
|
|
54
54
|
function getLogHandler(level, code, logger, pluginName, logLevel) {
|
|
55
55
|
if (logLevelPriority[level] < logLevelPriority[logLevel]) return noop;
|
|
56
56
|
return (log, pos) => {
|
|
57
|
-
if (pos != null) logger(LOG_LEVEL_WARN, require_binding
|
|
57
|
+
if (pos != null) logger(LOG_LEVEL_WARN, require_binding.logInvalidLogPosition(pluginName));
|
|
58
58
|
log = normalizeLog(log);
|
|
59
59
|
if (log.code && !log.pluginCode) log.pluginCode = log.code;
|
|
60
60
|
log.code = code;
|
|
@@ -100,7 +100,7 @@ function getLogger(plugins, onLog, logLevel) {
|
|
|
100
100
|
const handler = "handler" in pluginOnLog ? pluginOnLog.handler : pluginOnLog;
|
|
101
101
|
if (handler.call({
|
|
102
102
|
debug: getLogHandler$1(LOG_LEVEL_DEBUG),
|
|
103
|
-
error: (log$1) => require_binding
|
|
103
|
+
error: (log$1) => require_binding.error(normalizeLog(log$1)),
|
|
104
104
|
info: getLogHandler$1(LOG_LEVEL_INFO),
|
|
105
105
|
meta: {
|
|
106
106
|
rollupVersion: "4.23.0",
|
|
@@ -122,7 +122,7 @@ const getOnLog = (config, logLevel, printLog = defaultPrintLog) => {
|
|
|
122
122
|
if (onLog) {
|
|
123
123
|
const minimalPriority = logLevelPriority[logLevel];
|
|
124
124
|
return (level, log) => onLog(level, addLogToString(log), (level$1, handledLog) => {
|
|
125
|
-
if (level$1 === LOG_LEVEL_ERROR) return require_binding
|
|
125
|
+
if (level$1 === LOG_LEVEL_ERROR) return require_binding.error(normalizeLog(handledLog));
|
|
126
126
|
if (logLevelPriority[level$1] >= minimalPriority) defaultOnLog(level$1, normalizeLog(handledLog));
|
|
127
127
|
});
|
|
128
128
|
}
|
|
@@ -160,9 +160,8 @@ function relativeId(id) {
|
|
|
160
160
|
|
|
161
161
|
//#endregion
|
|
162
162
|
//#region src/builtin-plugin/utils.ts
|
|
163
|
-
var import_binding$6 = require_chunk.__toESM(require_binding$1.require_binding());
|
|
164
163
|
function makeBuiltinPluginCallable(plugin) {
|
|
165
|
-
let callablePlugin = new import_binding
|
|
164
|
+
let callablePlugin = new require_binding.import_binding.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
166
165
|
const wrappedPlugin = plugin;
|
|
167
166
|
for (const key in callablePlugin) wrappedPlugin[key] = function(...args) {
|
|
168
167
|
return callablePlugin[key](...args);
|
|
@@ -223,9 +222,19 @@ function viteResolvePlugin(config) {
|
|
|
223
222
|
function moduleFederationPlugin(config) {
|
|
224
223
|
return new BuiltinPlugin("builtin:module-federation", {
|
|
225
224
|
...config,
|
|
226
|
-
remotes: config.remotes && Object.
|
|
227
|
-
if (typeof
|
|
228
|
-
|
|
225
|
+
remotes: config.remotes && Object.entries(config.remotes).map(([name, remote]) => {
|
|
226
|
+
if (typeof remote === "string") {
|
|
227
|
+
const [entryGlobalName] = remote.split("@");
|
|
228
|
+
const entry = remote.replace(entryGlobalName + "@", "");
|
|
229
|
+
return {
|
|
230
|
+
entry,
|
|
231
|
+
name
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
return {
|
|
235
|
+
...remote,
|
|
236
|
+
name: remote.name ?? name
|
|
237
|
+
};
|
|
229
238
|
})
|
|
230
239
|
});
|
|
231
240
|
}
|
|
@@ -304,7 +313,7 @@ const normalizePluginOption = async (plugins) => (await asyncFlatten([plugins]))
|
|
|
304
313
|
function checkOutputPluginOption(plugins, onLog) {
|
|
305
314
|
for (const plugin of plugins) for (const hook of ENUMERATED_INPUT_PLUGIN_HOOK_NAMES) if (hook in plugin) {
|
|
306
315
|
delete plugin[hook];
|
|
307
|
-
onLog(LOG_LEVEL_WARN, require_binding
|
|
316
|
+
onLog(LOG_LEVEL_WARN, require_binding.logInputHookInOutputPlugin(plugin.name, hook));
|
|
308
317
|
}
|
|
309
318
|
return plugins;
|
|
310
319
|
}
|
|
@@ -333,7 +342,7 @@ var PluginDriver = class {
|
|
|
333
342
|
const { handler } = normalizeHook(options);
|
|
334
343
|
const result = await handler.call({
|
|
335
344
|
debug: getLogHandler(LOG_LEVEL_DEBUG, "PLUGIN_LOG", logger, name, logLevel),
|
|
336
|
-
error: (e) => require_binding
|
|
345
|
+
error: (e) => require_binding.error(require_binding.logPluginError(normalizeLog(e), name, { hook: "onLog" })),
|
|
337
346
|
info: getLogHandler(LOG_LEVEL_INFO, "PLUGIN_LOG", logger, name, logLevel),
|
|
338
347
|
meta: {
|
|
339
348
|
rollupVersion: "4.23.0",
|
|
@@ -715,18 +724,17 @@ var MinimalPluginContext = class {
|
|
|
715
724
|
};
|
|
716
725
|
}
|
|
717
726
|
error(e) {
|
|
718
|
-
return require_binding
|
|
727
|
+
return require_binding.error(require_binding.logPluginError(normalizeLog(e), this.pluginName));
|
|
719
728
|
}
|
|
720
729
|
};
|
|
721
730
|
|
|
722
731
|
//#endregion
|
|
723
732
|
//#region src/utils/transform-side-effects.ts
|
|
724
|
-
var import_binding$5 = require_chunk.__toESM(require_binding$1.require_binding());
|
|
725
733
|
function bindingifySideEffects(sideEffects) {
|
|
726
734
|
switch (sideEffects) {
|
|
727
|
-
case true: return import_binding
|
|
728
|
-
case false: return import_binding
|
|
729
|
-
case "no-treeshake": return import_binding
|
|
735
|
+
case true: return require_binding.import_binding.BindingHookSideEffects.True;
|
|
736
|
+
case false: return require_binding.import_binding.BindingHookSideEffects.False;
|
|
737
|
+
case "no-treeshake": return require_binding.import_binding.BindingHookSideEffects.NoTreeshake;
|
|
730
738
|
case null:
|
|
731
739
|
case undefined: return undefined;
|
|
732
740
|
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
@@ -745,7 +753,7 @@ var PluginContext = class extends MinimalPluginContext {
|
|
|
745
753
|
}
|
|
746
754
|
async load(options) {
|
|
747
755
|
const id = options.id;
|
|
748
|
-
if (id === this.currentLoadingModule) this.onLog(LOG_LEVEL_WARN, require_binding
|
|
756
|
+
if (id === this.currentLoadingModule) this.onLog(LOG_LEVEL_WARN, require_binding.logCycleLoading(this.pluginName, this.currentLoadingModule));
|
|
749
757
|
const moduleInfo = this.data.getModuleInfo(id, this.context);
|
|
750
758
|
if (moduleInfo && moduleInfo.code !== null) return moduleInfo;
|
|
751
759
|
const rawOptions = {
|
|
@@ -825,7 +833,7 @@ var TransformPluginContext = class extends PluginContext {
|
|
|
825
833
|
this.moduleSource = moduleSource;
|
|
826
834
|
const getLogHandler$1 = (handler) => (log, pos) => {
|
|
827
835
|
log = normalizeLog(log);
|
|
828
|
-
if (pos) require_binding
|
|
836
|
+
if (pos) require_binding.augmentCodeLocation(log, pos, moduleSource, moduleId);
|
|
829
837
|
log.id = moduleId;
|
|
830
838
|
log.hook = "transform";
|
|
831
839
|
handler(log);
|
|
@@ -836,10 +844,10 @@ var TransformPluginContext = class extends PluginContext {
|
|
|
836
844
|
}
|
|
837
845
|
error(e, pos) {
|
|
838
846
|
if (typeof e === "string") e = { message: e };
|
|
839
|
-
if (pos) require_binding
|
|
847
|
+
if (pos) require_binding.augmentCodeLocation(e, pos, this.moduleSource, this.moduleId);
|
|
840
848
|
e.id = this.moduleId;
|
|
841
849
|
e.hook = "transform";
|
|
842
|
-
return require_binding
|
|
850
|
+
return require_binding.error(require_binding.logPluginError(normalizeLog(e), this.pluginName));
|
|
843
851
|
}
|
|
844
852
|
getCombinedSourcemap() {
|
|
845
853
|
return JSON.parse(this.inner.getCombinedSourcemap());
|
|
@@ -848,14 +856,13 @@ var TransformPluginContext = class extends PluginContext {
|
|
|
848
856
|
|
|
849
857
|
//#endregion
|
|
850
858
|
//#region src/plugin/bindingify-plugin-hook-meta.ts
|
|
851
|
-
var import_binding$4 = require_chunk.__toESM(require_binding$1.require_binding());
|
|
852
859
|
function bindingifyPluginHookMeta(options) {
|
|
853
860
|
return { order: bindingPluginOrder(options.order) };
|
|
854
861
|
}
|
|
855
862
|
function bindingPluginOrder(order) {
|
|
856
863
|
switch (order) {
|
|
857
|
-
case "post": return import_binding
|
|
858
|
-
case "pre": return import_binding
|
|
864
|
+
case "post": return require_binding.import_binding.BindingPluginOrder.Post;
|
|
865
|
+
case "pre": return require_binding.import_binding.BindingPluginOrder.Pre;
|
|
859
866
|
case null:
|
|
860
867
|
case undefined: return undefined;
|
|
861
868
|
default: throw new Error(`Unknown plugin order: ${order}`);
|
|
@@ -1449,7 +1456,7 @@ function wrapHandlers(plugin) {
|
|
|
1449
1456
|
try {
|
|
1450
1457
|
return await handler(...args);
|
|
1451
1458
|
} catch (e) {
|
|
1452
|
-
return require_binding
|
|
1459
|
+
return require_binding.error(require_binding.logPluginError(e, plugin.name, {
|
|
1453
1460
|
hook: hookName,
|
|
1454
1461
|
id: hookName === "transform" ? args[2] : undefined
|
|
1455
1462
|
}));
|
|
@@ -1519,7 +1526,6 @@ function normalizedStringOrRegex(pattern) {
|
|
|
1519
1526
|
|
|
1520
1527
|
//#endregion
|
|
1521
1528
|
//#region src/utils/bindingify-input-options.ts
|
|
1522
|
-
var import_binding$3 = require_chunk.__toESM(require_binding$1.require_binding());
|
|
1523
1529
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, onLog, logLevel) {
|
|
1524
1530
|
const pluginContextData = new PluginContextData();
|
|
1525
1531
|
const plugins = rawPlugins.map((plugin) => {
|
|
@@ -1610,10 +1616,10 @@ function bindingifyInject(inject) {
|
|
|
1610
1616
|
}
|
|
1611
1617
|
function bindingifyLogLevel(logLevel) {
|
|
1612
1618
|
switch (logLevel) {
|
|
1613
|
-
case "silent": return import_binding
|
|
1614
|
-
case "debug": return import_binding
|
|
1615
|
-
case "warn": return import_binding
|
|
1616
|
-
case "info": return import_binding
|
|
1619
|
+
case "silent": return require_binding.import_binding.BindingLogLevel.Silent;
|
|
1620
|
+
case "debug": return require_binding.import_binding.BindingLogLevel.Debug;
|
|
1621
|
+
case "warn": return require_binding.import_binding.BindingLogLevel.Warn;
|
|
1622
|
+
case "info": return require_binding.import_binding.BindingLogLevel.Info;
|
|
1617
1623
|
default: throw new Error(`Unexpected log level: ${logLevel}`);
|
|
1618
1624
|
}
|
|
1619
1625
|
}
|
|
@@ -2090,7 +2096,6 @@ function composeJsPlugins(plugins) {
|
|
|
2090
2096
|
|
|
2091
2097
|
//#endregion
|
|
2092
2098
|
//#region src/utils/initialize-parallel-plugins.ts
|
|
2093
|
-
var import_binding$2 = require_chunk.__toESM(require_binding$1.require_binding());
|
|
2094
2099
|
async function initializeParallelPlugins(plugins) {
|
|
2095
2100
|
const pluginInfos = [];
|
|
2096
2101
|
for (const [index, plugin] of plugins.entries()) if ("_parallel" in plugin) {
|
|
@@ -2103,7 +2108,7 @@ async function initializeParallelPlugins(plugins) {
|
|
|
2103
2108
|
}
|
|
2104
2109
|
if (pluginInfos.length <= 0) return undefined;
|
|
2105
2110
|
const count = Math.min((0, node_os.availableParallelism)(), 8);
|
|
2106
|
-
const parallelJsPluginRegistry = new import_binding
|
|
2111
|
+
const parallelJsPluginRegistry = new require_binding.import_binding.ParallelJsPluginRegistry(count);
|
|
2107
2112
|
const registryId = parallelJsPluginRegistry.id;
|
|
2108
2113
|
const workers = await initializeWorkers(registryId, count, pluginInfos);
|
|
2109
2114
|
const stopWorkers = async () => {
|
|
@@ -2230,10 +2235,10 @@ const InputOptionsSchema = valibot.strictObject({
|
|
|
2230
2235
|
valibot.literal("browser"),
|
|
2231
2236
|
valibot.literal("neutral"),
|
|
2232
2237
|
valibot.literal("node")
|
|
2233
|
-
])), valibot.description(`Platform for which the code should be generated (node, ${require_binding
|
|
2238
|
+
])), valibot.description(`Platform for which the code should be generated (node, ${require_binding.colors.underline("browser")}, neutral)`)),
|
|
2234
2239
|
shimMissingExports: valibot.pipe(valibot.optional(valibot.boolean()), valibot.description("Create shim variables for missing exports")),
|
|
2235
2240
|
treeshake: valibot.optional(TreeshakingOptionsSchema),
|
|
2236
|
-
logLevel: valibot.pipe(valibot.optional(LogLevelOptionSchema), valibot.description(`Log level (${require_binding
|
|
2241
|
+
logLevel: valibot.pipe(valibot.optional(LogLevelOptionSchema), valibot.description(`Log level (${require_binding.colors.dim("silent")}, ${require_binding.colors.underline(require_binding.colors.gray("info"))}, debug, ${require_binding.colors.yellow("warn")})`)),
|
|
2237
2242
|
onLog: valibot.optional(OnLogSchema),
|
|
2238
2243
|
onwarn: valibot.optional(OnwarnSchema),
|
|
2239
2244
|
moduleTypes: valibot.pipe(valibot.optional(ModuleTypesSchema), valibot.description("Module types for customized extensions")),
|
|
@@ -2315,18 +2320,18 @@ const OutputOptionsSchema = valibot.strictObject({
|
|
|
2315
2320
|
valibot.literal("named"),
|
|
2316
2321
|
valibot.literal("default"),
|
|
2317
2322
|
valibot.literal("none")
|
|
2318
|
-
])), valibot.description(`Specify a export mode (${require_binding
|
|
2323
|
+
])), valibot.description(`Specify a export mode (${require_binding.colors.underline("auto")}, named, default, none)`)),
|
|
2319
2324
|
hashCharacters: valibot.pipe(valibot.optional(valibot.union([
|
|
2320
2325
|
valibot.literal("base64"),
|
|
2321
2326
|
valibot.literal("base36"),
|
|
2322
2327
|
valibot.literal("hex")
|
|
2323
2328
|
])), valibot.description("Use the specified character set for file hashes")),
|
|
2324
|
-
format: valibot.pipe(valibot.optional(ModuleFormatSchema), valibot.description(`Output format of the generated bundle (supports ${require_binding
|
|
2329
|
+
format: valibot.pipe(valibot.optional(ModuleFormatSchema), valibot.description(`Output format of the generated bundle (supports ${require_binding.colors.underline("esm")}, cjs, and iife)`)),
|
|
2325
2330
|
sourcemap: valibot.pipe(valibot.optional(valibot.union([
|
|
2326
2331
|
valibot.boolean(),
|
|
2327
2332
|
valibot.literal("inline"),
|
|
2328
2333
|
valibot.literal("hidden")
|
|
2329
|
-
])), valibot.description(`Generate sourcemap (\`-s inline\` for inline, or ${require_binding
|
|
2334
|
+
])), valibot.description(`Generate sourcemap (\`-s inline\` for inline, or ${require_binding.colors.bold("pass the `-s` on the last argument if you want to generate `.map` file")})`)),
|
|
2330
2335
|
sourcemapIgnoreList: valibot.optional(valibot.union([valibot.boolean(), valibot.custom(() => true)])),
|
|
2331
2336
|
sourcemapPathTransform: valibot.optional(valibot.custom(() => true)),
|
|
2332
2337
|
banner: valibot.optional(valibot.union([valibot.string(), AddonFunctionSchema])),
|
|
@@ -2350,7 +2355,7 @@ const OutputOptionsSchema = valibot.strictObject({
|
|
|
2350
2355
|
target: valibot.pipe(valibot.optional(valibot.enum(ESTarget)), valibot.description("The JavaScript target environment"))
|
|
2351
2356
|
});
|
|
2352
2357
|
const getAddonDescription = (placement, wrapper) => {
|
|
2353
|
-
return `Code to insert the ${require_binding
|
|
2358
|
+
return `Code to insert the ${require_binding.colors.bold(placement)} of the bundled file (${require_binding.colors.bold(wrapper)} the wrapper function)`;
|
|
2354
2359
|
};
|
|
2355
2360
|
const OutputCliOverrideSchema = valibot.strictObject({
|
|
2356
2361
|
entryFileNames: valibot.pipe(valibot.optional(valibot.string()), valibot.description("Name pattern for emitted entry chunks")),
|
|
@@ -2406,7 +2411,7 @@ async function createBundlerOptions(inputOptions, outputOptions) {
|
|
|
2406
2411
|
const logLevel = inputOptions.logLevel || LOG_LEVEL_INFO;
|
|
2407
2412
|
const onLog = getLogger(getObjectPlugins(inputPlugins), getOnLog(inputOptions, logLevel), logLevel);
|
|
2408
2413
|
outputOptions = PluginDriver.callOutputOptionsHook([...inputPlugins, ...outputPlugins], outputOptions);
|
|
2409
|
-
if (outputOptions.minify === true) onLog(LOG_LEVEL_WARN, require_binding
|
|
2414
|
+
if (outputOptions.minify === true) onLog(LOG_LEVEL_WARN, require_binding.logMinifyWarning());
|
|
2410
2415
|
let plugins = [...normalizePlugins(inputPlugins, ANONYMOUS_PLUGIN_PREFIX), ...checkOutputPluginOption(normalizePlugins(await normalizePluginOption(outputOptions.plugins), ANONYMOUS_OUTPUT_PLUGIN_PREFIX), onLog)];
|
|
2411
2416
|
if (inputOptions.experimental?.enableComposingJsPlugins ?? false) plugins = composeJsPlugins(plugins);
|
|
2412
2417
|
const parallelPluginInitResult = await initializeParallelPlugins(plugins);
|
|
@@ -2431,12 +2436,11 @@ async function createBundlerOptions(inputOptions, outputOptions) {
|
|
|
2431
2436
|
|
|
2432
2437
|
//#endregion
|
|
2433
2438
|
//#region src/utils/create-bundler.ts
|
|
2434
|
-
var import_binding$1 = require_chunk.__toESM(require_binding$1.require_binding());
|
|
2435
2439
|
async function createBundler(inputOptions, outputOptions) {
|
|
2436
2440
|
const option = await createBundlerOptions(inputOptions, outputOptions);
|
|
2437
2441
|
try {
|
|
2438
2442
|
return {
|
|
2439
|
-
bundler: new import_binding
|
|
2443
|
+
bundler: new require_binding.import_binding.Bundler(option.bundlerOptions),
|
|
2440
2444
|
stopWorkers: option.stopWorkers
|
|
2441
2445
|
};
|
|
2442
2446
|
} catch (e) {
|
|
@@ -2554,7 +2558,6 @@ var WatcherEmitter = class {
|
|
|
2554
2558
|
|
|
2555
2559
|
//#endregion
|
|
2556
2560
|
//#region src/api/watch/watcher.ts
|
|
2557
|
-
var import_binding = require_chunk.__toESM(require_binding$1.require_binding());
|
|
2558
2561
|
var Watcher = class {
|
|
2559
2562
|
closed;
|
|
2560
2563
|
inner;
|
|
@@ -2588,7 +2591,7 @@ async function createWatcher(emitter, input) {
|
|
|
2588
2591
|
return createBundlerOptions(inputOptions, output);
|
|
2589
2592
|
})).flat());
|
|
2590
2593
|
const notifyOptions = getValidNotifyOption(bundlerOptions);
|
|
2591
|
-
const bindingWatcher = new import_binding.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions);
|
|
2594
|
+
const bindingWatcher = new require_binding.import_binding.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions);
|
|
2592
2595
|
const watcher = new Watcher(emitter, bindingWatcher, bundlerOptions.map((option) => option.stopWorkers));
|
|
2593
2596
|
watcher.start();
|
|
2594
2597
|
}
|
|
@@ -2597,7 +2600,7 @@ function getValidNotifyOption(bundlerOptions) {
|
|
|
2597
2600
|
for (const option of bundlerOptions) if (option.inputOptions.watch) {
|
|
2598
2601
|
const notifyOption = option.inputOptions.watch.notify;
|
|
2599
2602
|
if (notifyOption) if (result) {
|
|
2600
|
-
option.onLog(LOG_LEVEL_WARN, require_binding
|
|
2603
|
+
option.onLog(LOG_LEVEL_WARN, require_binding.logMultiplyNotifyOption());
|
|
2601
2604
|
return result;
|
|
2602
2605
|
} else result = notifyOption;
|
|
2603
2606
|
}
|
|
@@ -2613,7 +2616,7 @@ const watch = (input) => {
|
|
|
2613
2616
|
|
|
2614
2617
|
//#endregion
|
|
2615
2618
|
//#region package.json
|
|
2616
|
-
var version = "1.0.0-beta.1-commit.
|
|
2619
|
+
var version = "1.0.0-beta.1-commit.7c52c94";
|
|
2617
2620
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
2618
2621
|
|
|
2619
2622
|
//#endregion
|