rolldown 1.0.0-beta.1-commit.298dd8b → 1.0.0-beta.1-commit.35fb1f8
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-BYsFiN-a.cjs → src-Busnx6mE.cjs} +34 -41
- package/dist/shared/{src-BiKHJ1rU.mjs → src-DNOXsZr0.mjs} +14 -21
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/binding.d.ts +1 -1
- 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-Busnx6mE.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-Busnx6mE.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-Busnx6mE.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-Busnx6mE.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-DNOXsZr0.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-DNOXsZr0.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-DNOXsZr0.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-DNOXsZr0.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,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);
|
|
@@ -304,7 +303,7 @@ const normalizePluginOption = async (plugins) => (await asyncFlatten([plugins]))
|
|
|
304
303
|
function checkOutputPluginOption(plugins, onLog) {
|
|
305
304
|
for (const plugin of plugins) for (const hook of ENUMERATED_INPUT_PLUGIN_HOOK_NAMES) if (hook in plugin) {
|
|
306
305
|
delete plugin[hook];
|
|
307
|
-
onLog(LOG_LEVEL_WARN, require_binding
|
|
306
|
+
onLog(LOG_LEVEL_WARN, require_binding.logInputHookInOutputPlugin(plugin.name, hook));
|
|
308
307
|
}
|
|
309
308
|
return plugins;
|
|
310
309
|
}
|
|
@@ -333,7 +332,7 @@ var PluginDriver = class {
|
|
|
333
332
|
const { handler } = normalizeHook(options);
|
|
334
333
|
const result = await handler.call({
|
|
335
334
|
debug: getLogHandler(LOG_LEVEL_DEBUG, "PLUGIN_LOG", logger, name, logLevel),
|
|
336
|
-
error: (e) => require_binding
|
|
335
|
+
error: (e) => require_binding.error(require_binding.logPluginError(normalizeLog(e), name, { hook: "onLog" })),
|
|
337
336
|
info: getLogHandler(LOG_LEVEL_INFO, "PLUGIN_LOG", logger, name, logLevel),
|
|
338
337
|
meta: {
|
|
339
338
|
rollupVersion: "4.23.0",
|
|
@@ -715,18 +714,17 @@ var MinimalPluginContext = class {
|
|
|
715
714
|
};
|
|
716
715
|
}
|
|
717
716
|
error(e) {
|
|
718
|
-
return require_binding
|
|
717
|
+
return require_binding.error(require_binding.logPluginError(normalizeLog(e), this.pluginName));
|
|
719
718
|
}
|
|
720
719
|
};
|
|
721
720
|
|
|
722
721
|
//#endregion
|
|
723
722
|
//#region src/utils/transform-side-effects.ts
|
|
724
|
-
var import_binding$5 = require_chunk.__toESM(require_binding$1.require_binding());
|
|
725
723
|
function bindingifySideEffects(sideEffects) {
|
|
726
724
|
switch (sideEffects) {
|
|
727
|
-
case true: return import_binding
|
|
728
|
-
case false: return import_binding
|
|
729
|
-
case "no-treeshake": return import_binding
|
|
725
|
+
case true: return require_binding.import_binding.BindingHookSideEffects.True;
|
|
726
|
+
case false: return require_binding.import_binding.BindingHookSideEffects.False;
|
|
727
|
+
case "no-treeshake": return require_binding.import_binding.BindingHookSideEffects.NoTreeshake;
|
|
730
728
|
case null:
|
|
731
729
|
case undefined: return undefined;
|
|
732
730
|
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
@@ -745,7 +743,7 @@ var PluginContext = class extends MinimalPluginContext {
|
|
|
745
743
|
}
|
|
746
744
|
async load(options) {
|
|
747
745
|
const id = options.id;
|
|
748
|
-
if (id === this.currentLoadingModule) this.onLog(LOG_LEVEL_WARN, require_binding
|
|
746
|
+
if (id === this.currentLoadingModule) this.onLog(LOG_LEVEL_WARN, require_binding.logCycleLoading(this.pluginName, this.currentLoadingModule));
|
|
749
747
|
const moduleInfo = this.data.getModuleInfo(id, this.context);
|
|
750
748
|
if (moduleInfo && moduleInfo.code !== null) return moduleInfo;
|
|
751
749
|
const rawOptions = {
|
|
@@ -825,7 +823,7 @@ var TransformPluginContext = class extends PluginContext {
|
|
|
825
823
|
this.moduleSource = moduleSource;
|
|
826
824
|
const getLogHandler$1 = (handler) => (log, pos) => {
|
|
827
825
|
log = normalizeLog(log);
|
|
828
|
-
if (pos) require_binding
|
|
826
|
+
if (pos) require_binding.augmentCodeLocation(log, pos, moduleSource, moduleId);
|
|
829
827
|
log.id = moduleId;
|
|
830
828
|
log.hook = "transform";
|
|
831
829
|
handler(log);
|
|
@@ -836,10 +834,10 @@ var TransformPluginContext = class extends PluginContext {
|
|
|
836
834
|
}
|
|
837
835
|
error(e, pos) {
|
|
838
836
|
if (typeof e === "string") e = { message: e };
|
|
839
|
-
if (pos) require_binding
|
|
837
|
+
if (pos) require_binding.augmentCodeLocation(e, pos, this.moduleSource, this.moduleId);
|
|
840
838
|
e.id = this.moduleId;
|
|
841
839
|
e.hook = "transform";
|
|
842
|
-
return require_binding
|
|
840
|
+
return require_binding.error(require_binding.logPluginError(normalizeLog(e), this.pluginName));
|
|
843
841
|
}
|
|
844
842
|
getCombinedSourcemap() {
|
|
845
843
|
return JSON.parse(this.inner.getCombinedSourcemap());
|
|
@@ -848,14 +846,13 @@ var TransformPluginContext = class extends PluginContext {
|
|
|
848
846
|
|
|
849
847
|
//#endregion
|
|
850
848
|
//#region src/plugin/bindingify-plugin-hook-meta.ts
|
|
851
|
-
var import_binding$4 = require_chunk.__toESM(require_binding$1.require_binding());
|
|
852
849
|
function bindingifyPluginHookMeta(options) {
|
|
853
850
|
return { order: bindingPluginOrder(options.order) };
|
|
854
851
|
}
|
|
855
852
|
function bindingPluginOrder(order) {
|
|
856
853
|
switch (order) {
|
|
857
|
-
case "post": return import_binding
|
|
858
|
-
case "pre": return import_binding
|
|
854
|
+
case "post": return require_binding.import_binding.BindingPluginOrder.Post;
|
|
855
|
+
case "pre": return require_binding.import_binding.BindingPluginOrder.Pre;
|
|
859
856
|
case null:
|
|
860
857
|
case undefined: return undefined;
|
|
861
858
|
default: throw new Error(`Unknown plugin order: ${order}`);
|
|
@@ -1449,7 +1446,7 @@ function wrapHandlers(plugin) {
|
|
|
1449
1446
|
try {
|
|
1450
1447
|
return await handler(...args);
|
|
1451
1448
|
} catch (e) {
|
|
1452
|
-
return require_binding
|
|
1449
|
+
return require_binding.error(require_binding.logPluginError(e, plugin.name, {
|
|
1453
1450
|
hook: hookName,
|
|
1454
1451
|
id: hookName === "transform" ? args[2] : undefined
|
|
1455
1452
|
}));
|
|
@@ -1519,7 +1516,6 @@ function normalizedStringOrRegex(pattern) {
|
|
|
1519
1516
|
|
|
1520
1517
|
//#endregion
|
|
1521
1518
|
//#region src/utils/bindingify-input-options.ts
|
|
1522
|
-
var import_binding$3 = require_chunk.__toESM(require_binding$1.require_binding());
|
|
1523
1519
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, onLog, logLevel) {
|
|
1524
1520
|
const pluginContextData = new PluginContextData();
|
|
1525
1521
|
const plugins = rawPlugins.map((plugin) => {
|
|
@@ -1610,10 +1606,10 @@ function bindingifyInject(inject) {
|
|
|
1610
1606
|
}
|
|
1611
1607
|
function bindingifyLogLevel(logLevel) {
|
|
1612
1608
|
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
|
|
1609
|
+
case "silent": return require_binding.import_binding.BindingLogLevel.Silent;
|
|
1610
|
+
case "debug": return require_binding.import_binding.BindingLogLevel.Debug;
|
|
1611
|
+
case "warn": return require_binding.import_binding.BindingLogLevel.Warn;
|
|
1612
|
+
case "info": return require_binding.import_binding.BindingLogLevel.Info;
|
|
1617
1613
|
default: throw new Error(`Unexpected log level: ${logLevel}`);
|
|
1618
1614
|
}
|
|
1619
1615
|
}
|
|
@@ -2090,7 +2086,6 @@ function composeJsPlugins(plugins) {
|
|
|
2090
2086
|
|
|
2091
2087
|
//#endregion
|
|
2092
2088
|
//#region src/utils/initialize-parallel-plugins.ts
|
|
2093
|
-
var import_binding$2 = require_chunk.__toESM(require_binding$1.require_binding());
|
|
2094
2089
|
async function initializeParallelPlugins(plugins) {
|
|
2095
2090
|
const pluginInfos = [];
|
|
2096
2091
|
for (const [index, plugin] of plugins.entries()) if ("_parallel" in plugin) {
|
|
@@ -2103,7 +2098,7 @@ async function initializeParallelPlugins(plugins) {
|
|
|
2103
2098
|
}
|
|
2104
2099
|
if (pluginInfos.length <= 0) return undefined;
|
|
2105
2100
|
const count = Math.min((0, node_os.availableParallelism)(), 8);
|
|
2106
|
-
const parallelJsPluginRegistry = new import_binding
|
|
2101
|
+
const parallelJsPluginRegistry = new require_binding.import_binding.ParallelJsPluginRegistry(count);
|
|
2107
2102
|
const registryId = parallelJsPluginRegistry.id;
|
|
2108
2103
|
const workers = await initializeWorkers(registryId, count, pluginInfos);
|
|
2109
2104
|
const stopWorkers = async () => {
|
|
@@ -2230,10 +2225,10 @@ const InputOptionsSchema = valibot.strictObject({
|
|
|
2230
2225
|
valibot.literal("browser"),
|
|
2231
2226
|
valibot.literal("neutral"),
|
|
2232
2227
|
valibot.literal("node")
|
|
2233
|
-
])), valibot.description(`Platform for which the code should be generated (node, ${require_binding
|
|
2228
|
+
])), valibot.description(`Platform for which the code should be generated (node, ${require_binding.colors.underline("browser")}, neutral)`)),
|
|
2234
2229
|
shimMissingExports: valibot.pipe(valibot.optional(valibot.boolean()), valibot.description("Create shim variables for missing exports")),
|
|
2235
2230
|
treeshake: valibot.optional(TreeshakingOptionsSchema),
|
|
2236
|
-
logLevel: valibot.pipe(valibot.optional(LogLevelOptionSchema), valibot.description(`Log level (${require_binding
|
|
2231
|
+
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
2232
|
onLog: valibot.optional(OnLogSchema),
|
|
2238
2233
|
onwarn: valibot.optional(OnwarnSchema),
|
|
2239
2234
|
moduleTypes: valibot.pipe(valibot.optional(ModuleTypesSchema), valibot.description("Module types for customized extensions")),
|
|
@@ -2315,18 +2310,18 @@ const OutputOptionsSchema = valibot.strictObject({
|
|
|
2315
2310
|
valibot.literal("named"),
|
|
2316
2311
|
valibot.literal("default"),
|
|
2317
2312
|
valibot.literal("none")
|
|
2318
|
-
])), valibot.description(`Specify a export mode (${require_binding
|
|
2313
|
+
])), valibot.description(`Specify a export mode (${require_binding.colors.underline("auto")}, named, default, none)`)),
|
|
2319
2314
|
hashCharacters: valibot.pipe(valibot.optional(valibot.union([
|
|
2320
2315
|
valibot.literal("base64"),
|
|
2321
2316
|
valibot.literal("base36"),
|
|
2322
2317
|
valibot.literal("hex")
|
|
2323
2318
|
])), 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
|
|
2319
|
+
format: valibot.pipe(valibot.optional(ModuleFormatSchema), valibot.description(`Output format of the generated bundle (supports ${require_binding.colors.underline("esm")}, cjs, and iife)`)),
|
|
2325
2320
|
sourcemap: valibot.pipe(valibot.optional(valibot.union([
|
|
2326
2321
|
valibot.boolean(),
|
|
2327
2322
|
valibot.literal("inline"),
|
|
2328
2323
|
valibot.literal("hidden")
|
|
2329
|
-
])), valibot.description(`Generate sourcemap (\`-s inline\` for inline, or ${require_binding
|
|
2324
|
+
])), 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
2325
|
sourcemapIgnoreList: valibot.optional(valibot.union([valibot.boolean(), valibot.custom(() => true)])),
|
|
2331
2326
|
sourcemapPathTransform: valibot.optional(valibot.custom(() => true)),
|
|
2332
2327
|
banner: valibot.optional(valibot.union([valibot.string(), AddonFunctionSchema])),
|
|
@@ -2350,7 +2345,7 @@ const OutputOptionsSchema = valibot.strictObject({
|
|
|
2350
2345
|
target: valibot.pipe(valibot.optional(valibot.enum(ESTarget)), valibot.description("The JavaScript target environment"))
|
|
2351
2346
|
});
|
|
2352
2347
|
const getAddonDescription = (placement, wrapper) => {
|
|
2353
|
-
return `Code to insert the ${require_binding
|
|
2348
|
+
return `Code to insert the ${require_binding.colors.bold(placement)} of the bundled file (${require_binding.colors.bold(wrapper)} the wrapper function)`;
|
|
2354
2349
|
};
|
|
2355
2350
|
const OutputCliOverrideSchema = valibot.strictObject({
|
|
2356
2351
|
entryFileNames: valibot.pipe(valibot.optional(valibot.string()), valibot.description("Name pattern for emitted entry chunks")),
|
|
@@ -2406,7 +2401,7 @@ async function createBundlerOptions(inputOptions, outputOptions) {
|
|
|
2406
2401
|
const logLevel = inputOptions.logLevel || LOG_LEVEL_INFO;
|
|
2407
2402
|
const onLog = getLogger(getObjectPlugins(inputPlugins), getOnLog(inputOptions, logLevel), logLevel);
|
|
2408
2403
|
outputOptions = PluginDriver.callOutputOptionsHook([...inputPlugins, ...outputPlugins], outputOptions);
|
|
2409
|
-
if (outputOptions.minify === true) onLog(LOG_LEVEL_WARN, require_binding
|
|
2404
|
+
if (outputOptions.minify === true) onLog(LOG_LEVEL_WARN, require_binding.logMinifyWarning());
|
|
2410
2405
|
let plugins = [...normalizePlugins(inputPlugins, ANONYMOUS_PLUGIN_PREFIX), ...checkOutputPluginOption(normalizePlugins(await normalizePluginOption(outputOptions.plugins), ANONYMOUS_OUTPUT_PLUGIN_PREFIX), onLog)];
|
|
2411
2406
|
if (inputOptions.experimental?.enableComposingJsPlugins ?? false) plugins = composeJsPlugins(plugins);
|
|
2412
2407
|
const parallelPluginInitResult = await initializeParallelPlugins(plugins);
|
|
@@ -2431,12 +2426,11 @@ async function createBundlerOptions(inputOptions, outputOptions) {
|
|
|
2431
2426
|
|
|
2432
2427
|
//#endregion
|
|
2433
2428
|
//#region src/utils/create-bundler.ts
|
|
2434
|
-
var import_binding$1 = require_chunk.__toESM(require_binding$1.require_binding());
|
|
2435
2429
|
async function createBundler(inputOptions, outputOptions) {
|
|
2436
2430
|
const option = await createBundlerOptions(inputOptions, outputOptions);
|
|
2437
2431
|
try {
|
|
2438
2432
|
return {
|
|
2439
|
-
bundler: new import_binding
|
|
2433
|
+
bundler: new require_binding.import_binding.Bundler(option.bundlerOptions),
|
|
2440
2434
|
stopWorkers: option.stopWorkers
|
|
2441
2435
|
};
|
|
2442
2436
|
} catch (e) {
|
|
@@ -2554,7 +2548,6 @@ var WatcherEmitter = class {
|
|
|
2554
2548
|
|
|
2555
2549
|
//#endregion
|
|
2556
2550
|
//#region src/api/watch/watcher.ts
|
|
2557
|
-
var import_binding = require_chunk.__toESM(require_binding$1.require_binding());
|
|
2558
2551
|
var Watcher = class {
|
|
2559
2552
|
closed;
|
|
2560
2553
|
inner;
|
|
@@ -2588,7 +2581,7 @@ async function createWatcher(emitter, input) {
|
|
|
2588
2581
|
return createBundlerOptions(inputOptions, output);
|
|
2589
2582
|
})).flat());
|
|
2590
2583
|
const notifyOptions = getValidNotifyOption(bundlerOptions);
|
|
2591
|
-
const bindingWatcher = new import_binding.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions);
|
|
2584
|
+
const bindingWatcher = new require_binding.import_binding.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions);
|
|
2592
2585
|
const watcher = new Watcher(emitter, bindingWatcher, bundlerOptions.map((option) => option.stopWorkers));
|
|
2593
2586
|
watcher.start();
|
|
2594
2587
|
}
|
|
@@ -2597,7 +2590,7 @@ function getValidNotifyOption(bundlerOptions) {
|
|
|
2597
2590
|
for (const option of bundlerOptions) if (option.inputOptions.watch) {
|
|
2598
2591
|
const notifyOption = option.inputOptions.watch.notify;
|
|
2599
2592
|
if (notifyOption) if (result) {
|
|
2600
|
-
option.onLog(LOG_LEVEL_WARN, require_binding
|
|
2593
|
+
option.onLog(LOG_LEVEL_WARN, require_binding.logMultiplyNotifyOption());
|
|
2601
2594
|
return result;
|
|
2602
2595
|
} else result = notifyOption;
|
|
2603
2596
|
}
|
|
@@ -2613,7 +2606,7 @@ const watch = (input) => {
|
|
|
2613
2606
|
|
|
2614
2607
|
//#endregion
|
|
2615
2608
|
//#region package.json
|
|
2616
|
-
var version = "1.0.0-beta.1-commit.
|
|
2609
|
+
var version = "1.0.0-beta.1-commit.35fb1f8";
|
|
2617
2610
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
2618
2611
|
|
|
2619
2612
|
//#endregion
|
|
@@ -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);
|
|
@@ -719,12 +718,11 @@ var MinimalPluginContext = class {
|
|
|
719
718
|
|
|
720
719
|
//#endregion
|
|
721
720
|
//#region src/utils/transform-side-effects.ts
|
|
722
|
-
var import_binding$5 = __toESM(require_binding());
|
|
723
721
|
function bindingifySideEffects(sideEffects) {
|
|
724
722
|
switch (sideEffects) {
|
|
725
|
-
case true: return import_binding
|
|
726
|
-
case false: return import_binding
|
|
727
|
-
case "no-treeshake": return import_binding
|
|
723
|
+
case true: return import_binding.BindingHookSideEffects.True;
|
|
724
|
+
case false: return import_binding.BindingHookSideEffects.False;
|
|
725
|
+
case "no-treeshake": return import_binding.BindingHookSideEffects.NoTreeshake;
|
|
728
726
|
case null:
|
|
729
727
|
case undefined: return undefined;
|
|
730
728
|
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
@@ -846,14 +844,13 @@ var TransformPluginContext = class extends PluginContext {
|
|
|
846
844
|
|
|
847
845
|
//#endregion
|
|
848
846
|
//#region src/plugin/bindingify-plugin-hook-meta.ts
|
|
849
|
-
var import_binding$4 = __toESM(require_binding());
|
|
850
847
|
function bindingifyPluginHookMeta(options) {
|
|
851
848
|
return { order: bindingPluginOrder(options.order) };
|
|
852
849
|
}
|
|
853
850
|
function bindingPluginOrder(order) {
|
|
854
851
|
switch (order) {
|
|
855
|
-
case "post": return import_binding
|
|
856
|
-
case "pre": return import_binding
|
|
852
|
+
case "post": return import_binding.BindingPluginOrder.Post;
|
|
853
|
+
case "pre": return import_binding.BindingPluginOrder.Pre;
|
|
857
854
|
case null:
|
|
858
855
|
case undefined: return undefined;
|
|
859
856
|
default: throw new Error(`Unknown plugin order: ${order}`);
|
|
@@ -1517,7 +1514,6 @@ function normalizedStringOrRegex(pattern) {
|
|
|
1517
1514
|
|
|
1518
1515
|
//#endregion
|
|
1519
1516
|
//#region src/utils/bindingify-input-options.ts
|
|
1520
|
-
var import_binding$3 = __toESM(require_binding());
|
|
1521
1517
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, onLog, logLevel) {
|
|
1522
1518
|
const pluginContextData = new PluginContextData();
|
|
1523
1519
|
const plugins = rawPlugins.map((plugin) => {
|
|
@@ -1608,10 +1604,10 @@ function bindingifyInject(inject) {
|
|
|
1608
1604
|
}
|
|
1609
1605
|
function bindingifyLogLevel(logLevel) {
|
|
1610
1606
|
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
|
|
1607
|
+
case "silent": return import_binding.BindingLogLevel.Silent;
|
|
1608
|
+
case "debug": return import_binding.BindingLogLevel.Debug;
|
|
1609
|
+
case "warn": return import_binding.BindingLogLevel.Warn;
|
|
1610
|
+
case "info": return import_binding.BindingLogLevel.Info;
|
|
1615
1611
|
default: throw new Error(`Unexpected log level: ${logLevel}`);
|
|
1616
1612
|
}
|
|
1617
1613
|
}
|
|
@@ -2088,7 +2084,6 @@ function composeJsPlugins(plugins) {
|
|
|
2088
2084
|
|
|
2089
2085
|
//#endregion
|
|
2090
2086
|
//#region src/utils/initialize-parallel-plugins.ts
|
|
2091
|
-
var import_binding$2 = __toESM(require_binding());
|
|
2092
2087
|
async function initializeParallelPlugins(plugins) {
|
|
2093
2088
|
const pluginInfos = [];
|
|
2094
2089
|
for (const [index, plugin] of plugins.entries()) if ("_parallel" in plugin) {
|
|
@@ -2101,7 +2096,7 @@ async function initializeParallelPlugins(plugins) {
|
|
|
2101
2096
|
}
|
|
2102
2097
|
if (pluginInfos.length <= 0) return undefined;
|
|
2103
2098
|
const count = Math.min(availableParallelism(), 8);
|
|
2104
|
-
const parallelJsPluginRegistry = new import_binding
|
|
2099
|
+
const parallelJsPluginRegistry = new import_binding.ParallelJsPluginRegistry(count);
|
|
2105
2100
|
const registryId = parallelJsPluginRegistry.id;
|
|
2106
2101
|
const workers = await initializeWorkers(registryId, count, pluginInfos);
|
|
2107
2102
|
const stopWorkers = async () => {
|
|
@@ -2429,12 +2424,11 @@ async function createBundlerOptions(inputOptions, outputOptions) {
|
|
|
2429
2424
|
|
|
2430
2425
|
//#endregion
|
|
2431
2426
|
//#region src/utils/create-bundler.ts
|
|
2432
|
-
var import_binding$1 = __toESM(require_binding());
|
|
2433
2427
|
async function createBundler(inputOptions, outputOptions) {
|
|
2434
2428
|
const option = await createBundlerOptions(inputOptions, outputOptions);
|
|
2435
2429
|
try {
|
|
2436
2430
|
return {
|
|
2437
|
-
bundler: new import_binding
|
|
2431
|
+
bundler: new import_binding.Bundler(option.bundlerOptions),
|
|
2438
2432
|
stopWorkers: option.stopWorkers
|
|
2439
2433
|
};
|
|
2440
2434
|
} catch (e) {
|
|
@@ -2552,7 +2546,6 @@ var WatcherEmitter = class {
|
|
|
2552
2546
|
|
|
2553
2547
|
//#endregion
|
|
2554
2548
|
//#region src/api/watch/watcher.ts
|
|
2555
|
-
var import_binding = __toESM(require_binding());
|
|
2556
2549
|
var Watcher = class {
|
|
2557
2550
|
closed;
|
|
2558
2551
|
inner;
|
|
@@ -2611,7 +2604,7 @@ const watch = (input) => {
|
|
|
2611
2604
|
|
|
2612
2605
|
//#endregion
|
|
2613
2606
|
//#region package.json
|
|
2614
|
-
var version = "1.0.0-beta.1-commit.
|
|
2607
|
+
var version = "1.0.0-beta.1-commit.35fb1f8";
|
|
2615
2608
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
2616
2609
|
|
|
2617
2610
|
//#endregion
|