rolldown 1.0.0-beta.7-commit.25f3c61 → 1.0.0-beta.7-commit.170d158
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/bin/cli.mjs +2 -0
- package/dist/{cjs/cli.cjs → cli.cjs} +4 -5
- package/dist/cli.mjs +1829 -0
- package/dist/{cjs/experimental-index.cjs → experimental-index.cjs} +3 -3
- package/dist/{esm/experimental-index.mjs → experimental-index.mjs} +13 -2
- package/dist/{cjs/index.cjs → index.cjs} +2 -2
- package/dist/index.mjs +5 -0
- package/dist/{cjs/parallel-plugin-worker.cjs → parallel-plugin-worker.cjs} +3 -4
- package/dist/parallel-plugin-worker.mjs +47 -0
- package/dist/parse-ast-index.cjs +4 -0
- package/dist/parse-ast-index.mjs +4 -0
- package/dist/shared/chunk-DUYDk_2O.mjs +33 -0
- package/dist/shared/{parse-ast-index-DNOUVcBy.mjs → parse-ast-index-5U4JtZBO.mjs} +108 -110
- package/dist/shared/{parse-ast-index-0ei4fTjl.cjs → parse-ast-index-BfKb9n4T.cjs} +1 -1
- package/dist/shared/prompt-W5YHe0v6.mjs +854 -0
- package/dist/shared/{src-BPcsb-4N.cjs → src-B0nHUJsv.cjs} +26 -7
- package/dist/shared/src-kyIoH7SP.mjs +4319 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/api/rolldown/rolldown-build.d.ts +1 -0
- package/dist/types/binding.d.ts +8 -2
- package/dist/types/options/input-options.d.ts +5 -1
- package/package.json +32 -31
- package/bin/cli.js +0 -2
- package/dist/cjs/parse-ast-index.cjs +0 -4
- package/dist/esm/cli.mjs +0 -1755
- package/dist/esm/index.mjs +0 -4
- package/dist/esm/parallel-plugin-worker.mjs +0 -41
- package/dist/esm/parse-ast-index.mjs +0 -3
- package/dist/shared/prompt-C6jWWCza.mjs +0 -852
- package/dist/shared/src-DllTyFDp.mjs +0 -2888
- /package/dist/{cjs/parallel-plugin.cjs → parallel-plugin.cjs} +0 -0
- /package/dist/{esm/parallel-plugin.mjs → parallel-plugin.mjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_chunk = require('
|
|
3
|
-
const require_src = require('
|
|
4
|
-
const require_parse_ast_index = require('
|
|
2
|
+
const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
|
|
3
|
+
const require_src = require('./shared/src-B0nHUJsv.cjs');
|
|
4
|
+
const require_parse_ast_index = require('./shared/parse-ast-index-BfKb9n4T.cjs');
|
|
5
5
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
6
6
|
|
|
7
7
|
//#region src/api/experimental.ts
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, init_compose_js_plugins, init_constructors, init_create_bundler, init_normalize_string_or_regex, init_transform_to_rollup_output, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/src-kyIoH7SP.mjs";
|
|
2
|
+
import { import_binding } from "./shared/parse-ast-index-5U4JtZBO.mjs";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
|
|
5
5
|
//#region src/api/experimental.ts
|
|
6
|
+
init_create_bundler();
|
|
7
|
+
init_transform_to_rollup_output();
|
|
6
8
|
const experimental_scan = async (input) => {
|
|
7
9
|
const { bundler, stopWorkers } = await createBundler(input, {});
|
|
8
10
|
const output = await bundler.scan();
|
|
@@ -23,12 +25,14 @@ function defineParallelPlugin(pluginPath) {
|
|
|
23
25
|
|
|
24
26
|
//#endregion
|
|
25
27
|
//#region src/builtin-plugin/alias-plugin.ts
|
|
28
|
+
init_constructors();
|
|
26
29
|
function aliasPlugin(config) {
|
|
27
30
|
return new BuiltinPlugin("builtin:alias", config);
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
//#endregion
|
|
31
34
|
//#region src/builtin-plugin/replace-plugin.ts
|
|
35
|
+
init_constructors();
|
|
32
36
|
function replacePlugin(values = {}, options = {}) {
|
|
33
37
|
return new BuiltinPlugin("builtin:replace", {
|
|
34
38
|
...options,
|
|
@@ -38,6 +42,8 @@ function replacePlugin(values = {}, options = {}) {
|
|
|
38
42
|
|
|
39
43
|
//#endregion
|
|
40
44
|
//#region src/builtin-plugin/transform-plugin.ts
|
|
45
|
+
init_constructors();
|
|
46
|
+
init_normalize_string_or_regex();
|
|
41
47
|
function normalizeEcmaTransformPluginConfig(config) {
|
|
42
48
|
if (!config) return void 0;
|
|
43
49
|
let normalizedConfig = {
|
|
@@ -51,6 +57,11 @@ function transformPlugin(config) {
|
|
|
51
57
|
return new BuiltinPlugin("builtin:transform", normalizeEcmaTransformPluginConfig(config));
|
|
52
58
|
}
|
|
53
59
|
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/experimental-index.ts
|
|
62
|
+
init_compose_js_plugins();
|
|
63
|
+
init_constructors();
|
|
64
|
+
|
|
54
65
|
//#endregion
|
|
55
66
|
var moduleRunnerTransform = import_binding.moduleRunnerTransform;
|
|
56
67
|
var transform = import_binding.transform;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_src = require('
|
|
2
|
-
require('
|
|
1
|
+
const require_src = require('./shared/src-B0nHUJsv.cjs');
|
|
2
|
+
require('./shared/parse-ast-index-BfKb9n4T.cjs');
|
|
3
3
|
|
|
4
4
|
exports.VERSION = require_src.VERSION
|
|
5
5
|
exports.build = require_src.build
|
package/dist/index.mjs
ADDED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const require_parse_ast_index = require('../shared/parse-ast-index-0ei4fTjl.cjs');
|
|
1
|
+
const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
|
|
2
|
+
const require_src = require('./shared/src-B0nHUJsv.cjs');
|
|
3
|
+
const require_parse_ast_index = require('./shared/parse-ast-index-BfKb9n4T.cjs');
|
|
5
4
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
6
5
|
|
|
7
6
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { __commonJS } from "./shared/chunk-DUYDk_2O.mjs";
|
|
2
|
+
import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-kyIoH7SP.mjs";
|
|
3
|
+
import { import_binding } from "./shared/parse-ast-index-5U4JtZBO.mjs";
|
|
4
|
+
import { parentPort, workerData } from "node:worker_threads";
|
|
5
|
+
|
|
6
|
+
//#region src/parallel-plugin-worker.ts
|
|
7
|
+
var require_parallel_plugin_worker = __commonJS({ "src/parallel-plugin-worker.ts"() {
|
|
8
|
+
init_bindingify_plugin();
|
|
9
|
+
init_plugin_context_data();
|
|
10
|
+
const { registryId, pluginInfos, threadNumber } = workerData;
|
|
11
|
+
(async () => {
|
|
12
|
+
try {
|
|
13
|
+
const plugins = await Promise.all(pluginInfos.map(async (pluginInfo) => {
|
|
14
|
+
const pluginModule = await import(pluginInfo.fileUrl);
|
|
15
|
+
const definePluginImpl = pluginModule.default;
|
|
16
|
+
const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
|
|
17
|
+
return {
|
|
18
|
+
index: pluginInfo.index,
|
|
19
|
+
plugin: bindingifyPlugin(
|
|
20
|
+
plugin,
|
|
21
|
+
{},
|
|
22
|
+
{},
|
|
23
|
+
// TODO need to find a way to share pluginContextData
|
|
24
|
+
new PluginContextData(),
|
|
25
|
+
[],
|
|
26
|
+
() => {},
|
|
27
|
+
"info",
|
|
28
|
+
// TODO: support this.meta.watchMode
|
|
29
|
+
false
|
|
30
|
+
)
|
|
31
|
+
};
|
|
32
|
+
}));
|
|
33
|
+
(0, import_binding.registerPlugins)(registryId, plugins);
|
|
34
|
+
parentPort.postMessage({ type: "success" });
|
|
35
|
+
} catch (error) {
|
|
36
|
+
parentPort.postMessage({
|
|
37
|
+
type: "error",
|
|
38
|
+
error
|
|
39
|
+
});
|
|
40
|
+
} finally {
|
|
41
|
+
parentPort.unref();
|
|
42
|
+
}
|
|
43
|
+
})();
|
|
44
|
+
} });
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
export default require_parallel_plugin_worker();
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createRequire } from "module";
|
|
2
|
+
|
|
3
|
+
//#region rolldown:runtime
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __esm = (fn, res) => function() {
|
|
11
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
12
|
+
};
|
|
13
|
+
var __commonJS = (cb, mod) => function() {
|
|
14
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
18
|
+
key = keys[i];
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
20
|
+
get: ((k) => from[k]).bind(null, key),
|
|
21
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
27
|
+
value: mod,
|
|
28
|
+
enumerable: true
|
|
29
|
+
}) : target, mod));
|
|
30
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { __commonJS, __esm, __require, __toESM };
|
|
@@ -1,34 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __commonJS, __esm, __require, __toESM } from "./chunk-DUYDk_2O.mjs";
|
|
2
2
|
import * as tty from "tty";
|
|
3
3
|
import { env } from "node:process";
|
|
4
4
|
|
|
5
|
-
//#region rolldown:runtime
|
|
6
|
-
var __create = Object.create;
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __commonJS = (cb, mod) => function() {
|
|
13
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
17
|
-
key = keys[i];
|
|
18
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
-
get: ((k) => from[k]).bind(null, key),
|
|
20
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
return to;
|
|
24
|
-
};
|
|
25
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
-
value: mod,
|
|
27
|
-
enumerable: true
|
|
28
|
-
}) : target, mod));
|
|
29
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
5
|
//#region src/webcontainer-fallback.js
|
|
33
6
|
var require_webcontainer_fallback = __commonJS({ "src/webcontainer-fallback.js"(exports, module) {
|
|
34
7
|
const fs = __require("node:fs");
|
|
@@ -56,7 +29,7 @@ var require_webcontainer_fallback = __commonJS({ "src/webcontainer-fallback.js"(
|
|
|
56
29
|
//#endregion
|
|
57
30
|
//#region src/binding.js
|
|
58
31
|
var require_binding = __commonJS({ "src/binding.js"(exports, module) {
|
|
59
|
-
const { createRequire
|
|
32
|
+
const { createRequire } = __require("node:module");
|
|
60
33
|
const { readFileSync } = __require("node:fs");
|
|
61
34
|
let nativeBinding = null;
|
|
62
35
|
const loadErrors = [];
|
|
@@ -397,80 +370,87 @@ var import_binding = __toESM(require_binding());
|
|
|
397
370
|
|
|
398
371
|
//#endregion
|
|
399
372
|
//#region ../../node_modules/.pnpm/colorette@2.0.20/node_modules/colorette/index.js
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
373
|
+
var env$1, argv, platform, isDisabled, isForced, isWindows, isDumbTerminal, isCompatibleTerminal, isCI, isColorSupported, replaceClose, clearBleed, filterEmpty, init, colors$1, createColors, reset, bold$1, dim$1, italic, underline$1, inverse, hidden, strikethrough, black, red$1, green$1, yellow$1, blue, magenta, cyan$1, white, gray$1, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, blackBright, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlackBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright;
|
|
374
|
+
var init_colorette = __esm({ "../../node_modules/.pnpm/colorette@2.0.20/node_modules/colorette/index.js"() {
|
|
375
|
+
({env: env$1 = {}, argv = [], platform = ""} = typeof process === "undefined" ? {} : process);
|
|
376
|
+
isDisabled = "NO_COLOR" in env$1 || argv.includes("--no-color");
|
|
377
|
+
isForced = "FORCE_COLOR" in env$1 || argv.includes("--color");
|
|
378
|
+
isWindows = platform === "win32";
|
|
379
|
+
isDumbTerminal = env$1.TERM === "dumb";
|
|
380
|
+
isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env$1.TERM && !isDumbTerminal;
|
|
381
|
+
isCI = "CI" in env$1 && ("GITHUB_ACTIONS" in env$1 || "GITLAB_CI" in env$1 || "CIRCLECI" in env$1);
|
|
382
|
+
isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
383
|
+
replaceClose = (index, string, close, replace, head = string.substring(0, index) + replace, tail = string.substring(index + close.length), next = tail.indexOf(close)) => head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
384
|
+
clearBleed = (index, string, open, close, replace) => index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
385
|
+
filterEmpty = (open, close, replace = open, at = open.length + 1) => (string) => string || !(string === "" || string === void 0) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
386
|
+
init = (open, close, replace) => filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
|
|
387
|
+
colors$1 = {
|
|
388
|
+
reset: init(0, 0),
|
|
389
|
+
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
390
|
+
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
391
|
+
italic: init(3, 23),
|
|
392
|
+
underline: init(4, 24),
|
|
393
|
+
inverse: init(7, 27),
|
|
394
|
+
hidden: init(8, 28),
|
|
395
|
+
strikethrough: init(9, 29),
|
|
396
|
+
black: init(30, 39),
|
|
397
|
+
red: init(31, 39),
|
|
398
|
+
green: init(32, 39),
|
|
399
|
+
yellow: init(33, 39),
|
|
400
|
+
blue: init(34, 39),
|
|
401
|
+
magenta: init(35, 39),
|
|
402
|
+
cyan: init(36, 39),
|
|
403
|
+
white: init(37, 39),
|
|
404
|
+
gray: init(90, 39),
|
|
405
|
+
bgBlack: init(40, 49),
|
|
406
|
+
bgRed: init(41, 49),
|
|
407
|
+
bgGreen: init(42, 49),
|
|
408
|
+
bgYellow: init(43, 49),
|
|
409
|
+
bgBlue: init(44, 49),
|
|
410
|
+
bgMagenta: init(45, 49),
|
|
411
|
+
bgCyan: init(46, 49),
|
|
412
|
+
bgWhite: init(47, 49),
|
|
413
|
+
blackBright: init(90, 39),
|
|
414
|
+
redBright: init(91, 39),
|
|
415
|
+
greenBright: init(92, 39),
|
|
416
|
+
yellowBright: init(93, 39),
|
|
417
|
+
blueBright: init(94, 39),
|
|
418
|
+
magentaBright: init(95, 39),
|
|
419
|
+
cyanBright: init(96, 39),
|
|
420
|
+
whiteBright: init(97, 39),
|
|
421
|
+
bgBlackBright: init(100, 49),
|
|
422
|
+
bgRedBright: init(101, 49),
|
|
423
|
+
bgGreenBright: init(102, 49),
|
|
424
|
+
bgYellowBright: init(103, 49),
|
|
425
|
+
bgBlueBright: init(104, 49),
|
|
426
|
+
bgMagentaBright: init(105, 49),
|
|
427
|
+
bgCyanBright: init(106, 49),
|
|
428
|
+
bgWhiteBright: init(107, 49)
|
|
429
|
+
};
|
|
430
|
+
createColors = ({ useColor = isColorSupported } = {}) => useColor ? colors$1 : Object.keys(colors$1).reduce((colors$2, key) => ({
|
|
431
|
+
...colors$2,
|
|
432
|
+
[key]: String
|
|
433
|
+
}), {});
|
|
434
|
+
({reset, bold: bold$1, dim: dim$1, italic, underline: underline$1, inverse, hidden, strikethrough, black, red: red$1, green: green$1, yellow: yellow$1, blue, magenta, cyan: cyan$1, white, gray: gray$1, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, blackBright, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlackBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright} = createColors());
|
|
435
|
+
} });
|
|
460
436
|
|
|
461
437
|
//#endregion
|
|
462
438
|
//#region src/cli/colors.ts
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
cyan,
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
439
|
+
var bold, cyan, dim, gray, green, red, underline, yellow, colors;
|
|
440
|
+
var init_colors = __esm({ "src/cli/colors.ts"() {
|
|
441
|
+
init_colorette();
|
|
442
|
+
({bold, cyan, dim, gray, green, red, underline, yellow} = createColors({ useColor: env.FORCE_COLOR !== "0" && !env.NO_COLOR }));
|
|
443
|
+
colors = {
|
|
444
|
+
bold,
|
|
445
|
+
cyan,
|
|
446
|
+
dim,
|
|
447
|
+
gray,
|
|
448
|
+
green,
|
|
449
|
+
red,
|
|
450
|
+
underline,
|
|
451
|
+
yellow
|
|
452
|
+
};
|
|
453
|
+
} });
|
|
474
454
|
|
|
475
455
|
//#endregion
|
|
476
456
|
//#region src/utils/code-frame.ts
|
|
@@ -482,9 +462,6 @@ function spaces(index) {
|
|
|
482
462
|
function tabsToSpaces(value) {
|
|
483
463
|
return value.replace(/^\t+/, (match) => match.split(" ").join(" "));
|
|
484
464
|
}
|
|
485
|
-
const LINE_TRUNCATE_LENGTH = 120;
|
|
486
|
-
const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
|
487
|
-
const ELLIPSIS = "...";
|
|
488
465
|
function getCodeFrame(source, line, column) {
|
|
489
466
|
let lines = source.split("\n");
|
|
490
467
|
if (line > lines.length) return "";
|
|
@@ -510,6 +487,12 @@ function getCodeFrame(source, line, column) {
|
|
|
510
487
|
return `${lineNumber}: ${displayedLine}`;
|
|
511
488
|
}).join("\n");
|
|
512
489
|
}
|
|
490
|
+
var LINE_TRUNCATE_LENGTH, MIN_CHARACTERS_SHOWN_AFTER_LOCATION, ELLIPSIS;
|
|
491
|
+
var init_code_frame = __esm({ "src/utils/code-frame.ts"() {
|
|
492
|
+
LINE_TRUNCATE_LENGTH = 120;
|
|
493
|
+
MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
|
494
|
+
ELLIPSIS = "...";
|
|
495
|
+
} });
|
|
513
496
|
|
|
514
497
|
//#endregion
|
|
515
498
|
//#region src/log/locate-character/index.js
|
|
@@ -561,10 +544,10 @@ function getLocator(source, options = {}) {
|
|
|
561
544
|
function locate(source, search, options) {
|
|
562
545
|
return getLocator(source, options)(search, options && options.startIndex);
|
|
563
546
|
}
|
|
547
|
+
var init_locate_character = __esm({ "src/log/locate-character/index.js"() {} });
|
|
564
548
|
|
|
565
549
|
//#endregion
|
|
566
550
|
//#region src/log/logs.ts
|
|
567
|
-
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", MINIFY_WARNING = "MINIFY_WARNING", PARSE_ERROR = "PARSE_ERROR";
|
|
568
551
|
function logParseError(message) {
|
|
569
552
|
return {
|
|
570
553
|
code: PARSE_ERROR,
|
|
@@ -644,9 +627,16 @@ function augmentCodeLocation(properties, pos, source, id) {
|
|
|
644
627
|
properties.frame = getCodeFrame(source, line, column);
|
|
645
628
|
}
|
|
646
629
|
}
|
|
630
|
+
var INVALID_LOG_POSITION, PLUGIN_ERROR, INPUT_HOOK_IN_OUTPUT_PLUGIN, CYCLE_LOADING, MULTIPLY_NOTIFY_OPTION, MINIFY_WARNING, PARSE_ERROR;
|
|
631
|
+
var init_logs = __esm({ "src/log/logs.ts"() {
|
|
632
|
+
init_colors();
|
|
633
|
+
init_code_frame();
|
|
634
|
+
init_locate_character();
|
|
635
|
+
INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", MINIFY_WARNING = "MINIFY_WARNING", PARSE_ERROR = "PARSE_ERROR";
|
|
636
|
+
} });
|
|
647
637
|
|
|
648
638
|
//#endregion
|
|
649
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
639
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.63.0/node_modules/oxc-parser/wrap.mjs
|
|
650
640
|
function wrap$1(result) {
|
|
651
641
|
let program, module$1, comments, errors;
|
|
652
642
|
return {
|
|
@@ -682,6 +672,7 @@ function jsonParseAst(ast) {
|
|
|
682
672
|
return value;
|
|
683
673
|
});
|
|
684
674
|
}
|
|
675
|
+
var init_wrap = __esm({ "../../node_modules/.pnpm/oxc-parser@0.63.0/node_modules/oxc-parser/wrap.mjs"() {} });
|
|
685
676
|
|
|
686
677
|
//#endregion
|
|
687
678
|
//#region src/parse-ast-index.ts
|
|
@@ -706,10 +697,6 @@ function normalizeParseError(sourceText, errors) {
|
|
|
706
697
|
}
|
|
707
698
|
return error(logParseError(message));
|
|
708
699
|
}
|
|
709
|
-
const defaultParserOptions = {
|
|
710
|
-
lang: "js",
|
|
711
|
-
preserveParens: false
|
|
712
|
-
};
|
|
713
700
|
function parseAst(sourceText, options, filename) {
|
|
714
701
|
return wrap((0, import_binding.parseSync)(filename ?? "file.js", sourceText, {
|
|
715
702
|
...defaultParserOptions,
|
|
@@ -722,6 +709,17 @@ async function parseAstAsync(sourceText, options, filename) {
|
|
|
722
709
|
...options
|
|
723
710
|
}), sourceText);
|
|
724
711
|
}
|
|
712
|
+
var defaultParserOptions;
|
|
713
|
+
var init_parse_ast_index = __esm({ "src/parse-ast-index.ts"() {
|
|
714
|
+
init_locate_character();
|
|
715
|
+
init_logs();
|
|
716
|
+
init_code_frame();
|
|
717
|
+
init_wrap();
|
|
718
|
+
defaultParserOptions = {
|
|
719
|
+
lang: "js",
|
|
720
|
+
preserveParens: false
|
|
721
|
+
};
|
|
722
|
+
} });
|
|
725
723
|
|
|
726
724
|
//#endregion
|
|
727
|
-
export { augmentCodeLocation, colors, error, import_binding, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, parseAst, parseAstAsync };
|
|
725
|
+
export { augmentCodeLocation, colors, error, import_binding, init_colors, init_logs, init_parse_ast_index, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, parseAst, parseAstAsync };
|
|
@@ -619,7 +619,7 @@ function augmentCodeLocation(properties, pos, source, id) {
|
|
|
619
619
|
}
|
|
620
620
|
|
|
621
621
|
//#endregion
|
|
622
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
622
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.63.0/node_modules/oxc-parser/wrap.mjs
|
|
623
623
|
function wrap$1(result) {
|
|
624
624
|
let program, module$1, comments, errors;
|
|
625
625
|
return {
|