rolldown 1.0.0-beta.7-commit.a1a360c → 1.0.0-beta.7-commit.a0a7d95
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/cli.cjs +29 -28
- package/dist/cli.mjs +14 -15
- package/dist/experimental-index.cjs +2 -2
- package/dist/experimental-index.mjs +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/parallel-plugin-worker.cjs +2 -2
- package/dist/parallel-plugin-worker.mjs +2 -2
- package/dist/parse-ast-index.cjs +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/shared/{parse-ast-index-5U4JtZBO.mjs → parse-ast-index-CDR5KnLL.mjs} +12 -89
- package/dist/shared/{parse-ast-index-BfKb9n4T.cjs → parse-ast-index-Uch8iMoV.cjs} +12 -87
- package/dist/shared/{prompt-W5YHe0v6.mjs → prompt-V-Wm9PcC.mjs} +2 -2
- package/dist/shared/{src-DobjSb9g.cjs → src-CWP8w1F4.cjs} +38 -16
- package/dist/shared/{src-DAi_EMVt.mjs → src-DnxTBFq6.mjs} +34 -11
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/api/rolldown/rolldown-build.d.ts +2 -1
- package/dist/types/binding.d.ts +12 -1
- package/dist/types/options/input-options.d.ts +1 -0
- package/dist/types/plugin/with-filter.d.ts +4 -2
- package/dist/types/types.d.ts +7 -0
- package/dist/types/utils/initialize-parallel-plugins.d.ts +0 -2
- package/dist/types/utils/misc.d.ts +1 -0
- package/package.json +22 -20
- package/dist/types/cli/colors.d.ts +0 -11
package/dist/cli.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
|
|
2
|
-
const require_src = require('./shared/src-
|
|
3
|
-
|
|
2
|
+
const require_src = require('./shared/src-CWP8w1F4.cjs');
|
|
3
|
+
require('./shared/parse-ast-index-Uch8iMoV.cjs');
|
|
4
4
|
const node_fs = require_chunk.__toESM(require("node:fs"));
|
|
5
5
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
6
|
+
const ansis = require_chunk.__toESM(require("ansis"));
|
|
6
7
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
7
8
|
const node_util = require_chunk.__toESM(require("node:util"));
|
|
8
9
|
const node_tty = require_chunk.__toESM(require("node:tty"));
|
|
@@ -527,9 +528,9 @@ const colorDefs = {
|
|
|
527
528
|
function createColors(useColor = isColorSupported) {
|
|
528
529
|
return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
|
|
529
530
|
}
|
|
530
|
-
const colors$
|
|
531
|
+
const colors$2 = createColors();
|
|
531
532
|
function getColor$1(color, fallback = "reset") {
|
|
532
|
-
return colors$
|
|
533
|
+
return colors$2[color] || colors$2[fallback];
|
|
533
534
|
}
|
|
534
535
|
const ansiRegex$1 = [String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`, String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");
|
|
535
536
|
function stripAnsi$1(text) {
|
|
@@ -906,12 +907,12 @@ var FancyReporter = class extends BasicReporter {
|
|
|
906
907
|
formatStack(stack, message, opts) {
|
|
907
908
|
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
908
909
|
return `
|
|
909
|
-
${indent}` + parseStack(stack, message).map((line) => " " + line.replace(/^at +/, (m) => colors$
|
|
910
|
+
${indent}` + parseStack(stack, message).map((line) => " " + line.replace(/^at +/, (m) => colors$2.gray(m)).replace(/\((.+)\)/, (_$1, m) => `(${colors$2.cyan(m)})`)).join(`
|
|
910
911
|
${indent}`);
|
|
911
912
|
}
|
|
912
913
|
formatType(logObj, isBadge, opts) {
|
|
913
914
|
const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
|
|
914
|
-
if (isBadge) return getBgColor(typeColor)(colors$
|
|
915
|
+
if (isBadge) return getBgColor(typeColor)(colors$2.black(` ${logObj.type.toUpperCase()} `));
|
|
915
916
|
const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
|
|
916
917
|
return _type ? getColor(typeColor)(_type) : "";
|
|
917
918
|
}
|
|
@@ -922,15 +923,15 @@ ${indent}`);
|
|
|
922
923
|
style: logObj.style
|
|
923
924
|
});
|
|
924
925
|
const date = this.formatDate(logObj.date, opts);
|
|
925
|
-
const coloredDate = date && colors$
|
|
926
|
+
const coloredDate = date && colors$2.gray(date);
|
|
926
927
|
const isBadge = logObj.badge ?? logObj.level < 2;
|
|
927
928
|
const type = this.formatType(logObj, isBadge, opts);
|
|
928
|
-
const tag = logObj.tag ? colors$
|
|
929
|
+
const tag = logObj.tag ? colors$2.gray(logObj.tag) : "";
|
|
929
930
|
let line;
|
|
930
931
|
const left = this.filterAndJoin([type, characterFormat(message)]);
|
|
931
932
|
const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
|
|
932
933
|
const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
|
|
933
|
-
line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors$
|
|
934
|
+
line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors$2.gray(`[${right}]`)} ` : "") + left;
|
|
934
935
|
line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
|
|
935
936
|
if (logObj.type === "trace") {
|
|
936
937
|
const _err = new Error("Trace: " + logObj.message);
|
|
@@ -940,13 +941,13 @@ ${indent}`);
|
|
|
940
941
|
}
|
|
941
942
|
};
|
|
942
943
|
function characterFormat(str) {
|
|
943
|
-
return str.replace(/`([^`]+)`/gm, (_$1, m) => colors$
|
|
944
|
+
return str.replace(/`([^`]+)`/gm, (_$1, m) => colors$2.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_$1, m) => ` ${colors$2.underline(m)} `);
|
|
944
945
|
}
|
|
945
946
|
function getColor(color = "white") {
|
|
946
|
-
return colors$
|
|
947
|
+
return colors$2[color] || colors$2.white;
|
|
947
948
|
}
|
|
948
949
|
function getBgColor(color = "bgWhite") {
|
|
949
|
-
return colors$
|
|
950
|
+
return colors$2[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors$2.bgWhite;
|
|
950
951
|
}
|
|
951
952
|
function createConsola(options$1 = {}) {
|
|
952
953
|
let level = _getDefaultLogLevel();
|
|
@@ -1526,7 +1527,7 @@ async function bundleWithCliOptions(cliOptions) {
|
|
|
1526
1527
|
process.exit(1);
|
|
1527
1528
|
}
|
|
1528
1529
|
for (const file of outputs) {
|
|
1529
|
-
if (outputs.length > 1) logger.log(`\n${
|
|
1530
|
+
if (outputs.length > 1) logger.log(`\n${ansis.default.cyan(ansis.default.bold(`|→ ${file.fileName}:`))}\n`);
|
|
1530
1531
|
console.log(file.type === "asset" ? file.source : file.code);
|
|
1531
1532
|
}
|
|
1532
1533
|
} finally {
|
|
@@ -1562,11 +1563,11 @@ async function watchInner(config, cliOptions) {
|
|
|
1562
1563
|
watcher.on("event", (event) => {
|
|
1563
1564
|
switch (event.code) {
|
|
1564
1565
|
case "BUNDLE_START":
|
|
1565
|
-
if (changedFile.length > 0) logger.log(`Found ${
|
|
1566
|
+
if (changedFile.length > 0) logger.log(`Found ${ansis.default.bold(changedFile.map(relativeId).join(", "))} changed, rebuilding...`);
|
|
1566
1567
|
changedFile.length = 0;
|
|
1567
1568
|
break;
|
|
1568
1569
|
case "BUNDLE_END":
|
|
1569
|
-
logger.success(`Rebuilt ${
|
|
1570
|
+
logger.success(`Rebuilt ${ansis.default.bold(relativeId(event.output[0]))} in ${ansis.default.bold(ms(event.duration))}.`);
|
|
1570
1571
|
break;
|
|
1571
1572
|
case "ERROR":
|
|
1572
1573
|
logger.error(event.error);
|
|
@@ -1599,7 +1600,7 @@ async function bundleInner(config, cliOptions) {
|
|
|
1599
1600
|
logger.log(``);
|
|
1600
1601
|
const endTime = node_perf_hooks.performance.now();
|
|
1601
1602
|
const duration = endTime - startTime;
|
|
1602
|
-
logger.success(`Finished in ${
|
|
1603
|
+
logger.success(`Finished in ${ansis.default.bold(ms(duration))}`);
|
|
1603
1604
|
}
|
|
1604
1605
|
function printBundleOutputPretty(output) {
|
|
1605
1606
|
const outputEntries = collectOutputEntries(output.output);
|
|
@@ -1646,10 +1647,10 @@ function printOutputEntries(entries, sizeAdjustment, distPath) {
|
|
|
1646
1647
|
const filtered = entries.filter((e) => e.type === group.type);
|
|
1647
1648
|
if (!filtered.length) continue;
|
|
1648
1649
|
for (const entry of filtered.sort((a$1, z) => a$1.size - z.size)) {
|
|
1649
|
-
let log =
|
|
1650
|
-
log +=
|
|
1651
|
-
log +=
|
|
1652
|
-
log +=
|
|
1650
|
+
let log = ansis.default.dim(withTrailingSlash(distPath));
|
|
1651
|
+
log += ansis.default[group.color](entry.fileName.padEnd(sizeAdjustment.longest + 2));
|
|
1652
|
+
log += ansis.default.dim(entry.type);
|
|
1653
|
+
log += ansis.default.dim(` │ size: ${displaySize(entry.size).padStart(sizeAdjustment.sizePad)}`);
|
|
1653
1654
|
logger.log(log);
|
|
1654
1655
|
}
|
|
1655
1656
|
}
|
|
@@ -1668,9 +1669,9 @@ function relativeId(id) {
|
|
|
1668
1669
|
|
|
1669
1670
|
//#endregion
|
|
1670
1671
|
//#region src/cli/commands/help.ts
|
|
1671
|
-
const introduction = `${
|
|
1672
|
+
const introduction = `${ansis.default.gray(`${require_src.description} (rolldown v${require_src.version})`)}
|
|
1672
1673
|
|
|
1673
|
-
${
|
|
1674
|
+
${ansis.default.bold(ansis.default.underline("USAGE"))} ${ansis.default.cyan("rolldown -c <config>")} or ${ansis.default.cyan("rolldown <input> <options>")}`;
|
|
1674
1675
|
const examples = [
|
|
1675
1676
|
{
|
|
1676
1677
|
title: "Bundle with a config file `rolldown.config.mjs`",
|
|
@@ -1702,7 +1703,7 @@ const notes = [
|
|
|
1702
1703
|
function showHelp() {
|
|
1703
1704
|
logger.log(introduction);
|
|
1704
1705
|
logger.log("");
|
|
1705
|
-
logger.log(`${
|
|
1706
|
+
logger.log(`${ansis.default.bold(ansis.default.underline("OPTIONS"))}`);
|
|
1706
1707
|
logger.log("");
|
|
1707
1708
|
logger.log(Object.entries(options).sort(([a$1], [b$1]) => {
|
|
1708
1709
|
if (options[a$1].short && !options[b$1].short) return -1;
|
|
@@ -1715,20 +1716,20 @@ function showHelp() {
|
|
|
1715
1716
|
if (short) optionStr += `-${short}, `;
|
|
1716
1717
|
if (type === "string") optionStr += `<${hint ?? option}>`;
|
|
1717
1718
|
if (description$1 && description$1.length > 0) description$1 = description$1[0].toUpperCase() + description$1.slice(1);
|
|
1718
|
-
return
|
|
1719
|
+
return ansis.default.cyan(optionStr.padEnd(30)) + description$1 + (description$1 && description$1?.endsWith(".") ? "" : ".");
|
|
1719
1720
|
}).join("\n"));
|
|
1720
1721
|
logger.log("");
|
|
1721
|
-
logger.log(`${
|
|
1722
|
+
logger.log(`${ansis.default.bold(ansis.default.underline("EXAMPLES"))}`);
|
|
1722
1723
|
logger.log("");
|
|
1723
1724
|
examples.forEach(({ title, command }, ord) => {
|
|
1724
1725
|
logger.log(` ${ord + 1}. ${title}:`);
|
|
1725
|
-
logger.log(` ${
|
|
1726
|
+
logger.log(` ${ansis.default.cyan(command)}`);
|
|
1726
1727
|
logger.log("");
|
|
1727
1728
|
});
|
|
1728
|
-
logger.log(`${
|
|
1729
|
+
logger.log(`${ansis.default.bold(ansis.default.underline("NOTES"))}`);
|
|
1729
1730
|
logger.log("");
|
|
1730
1731
|
notes.forEach((note) => {
|
|
1731
|
-
logger.log(` * ${
|
|
1732
|
+
logger.log(` * ${ansis.default.gray(note)}`);
|
|
1732
1733
|
});
|
|
1733
1734
|
}
|
|
1734
1735
|
|
package/dist/cli.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { __commonJS, __esm } from "./shared/chunk-DUYDk_2O.mjs";
|
|
2
|
-
import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_misc, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-
|
|
3
|
-
import
|
|
2
|
+
import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_misc, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-DnxTBFq6.mjs";
|
|
3
|
+
import "./shared/parse-ast-index-CDR5KnLL.mjs";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path, { sep } from "node:path";
|
|
6
|
+
import colors from "ansis";
|
|
6
7
|
import process$1, { cwd } from "node:process";
|
|
7
8
|
import { formatWithOptions, parseArgs } from "node:util";
|
|
8
9
|
import * as tty from "node:tty";
|
|
@@ -525,15 +526,15 @@ function box(text, _opts = {}) {
|
|
|
525
526
|
if (opts.style.marginBottom > 0) boxLines.push("".repeat(opts.style.marginBottom));
|
|
526
527
|
return boxLines.join("\n");
|
|
527
528
|
}
|
|
528
|
-
var env
|
|
529
|
+
var env, argv, platform, isDisabled, isForced, isWindows, isDumbTerminal, isCompatibleTerminal, isCI, isColorSupported, colorDefs, colors$1, ansiRegex$1, boxStylePresets, defaultStyle;
|
|
529
530
|
var init_consola_DXBYu_KD = __esm({ "../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs"() {
|
|
530
|
-
({env
|
|
531
|
-
isDisabled = "NO_COLOR" in env
|
|
532
|
-
isForced = "FORCE_COLOR" in env
|
|
531
|
+
({env = {}, argv = [], platform = ""} = typeof process === "undefined" ? {} : process);
|
|
532
|
+
isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
|
|
533
|
+
isForced = "FORCE_COLOR" in env || argv.includes("--color");
|
|
533
534
|
isWindows = platform === "win32";
|
|
534
|
-
isDumbTerminal = env
|
|
535
|
-
isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env
|
|
536
|
-
isCI = "CI" in env
|
|
535
|
+
isDumbTerminal = env.TERM === "dumb";
|
|
536
|
+
isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
|
|
537
|
+
isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
|
|
537
538
|
isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
538
539
|
colorDefs = {
|
|
539
540
|
reset: init(0, 0),
|
|
@@ -732,10 +733,10 @@ function stringWidth$1(string, options$1 = {}) {
|
|
|
732
733
|
return width;
|
|
733
734
|
}
|
|
734
735
|
function isUnicodeSupported() {
|
|
735
|
-
const { env: env$
|
|
736
|
-
const { TERM, TERM_PROGRAM } = env$
|
|
736
|
+
const { env: env$1 } = process$1;
|
|
737
|
+
const { TERM, TERM_PROGRAM } = env$1;
|
|
737
738
|
if (process$1.platform !== "win32") return TERM !== "linux";
|
|
738
|
-
return Boolean(env$
|
|
739
|
+
return Boolean(env$1.WT_SESSION) || Boolean(env$1.TERMINUS_SUBLIME) || env$1.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env$1.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
739
740
|
}
|
|
740
741
|
function stringWidth(str) {
|
|
741
742
|
const hasICU = typeof Intl === "object";
|
|
@@ -759,7 +760,7 @@ function createConsola(options$1 = {}) {
|
|
|
759
760
|
defaults: { level },
|
|
760
761
|
stdout: process.stdout,
|
|
761
762
|
stderr: process.stderr,
|
|
762
|
-
prompt: (...args) => import("./shared/prompt-
|
|
763
|
+
prompt: (...args) => import("./shared/prompt-V-Wm9PcC.mjs").then((m) => m.prompt(...args)),
|
|
763
764
|
reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
764
765
|
...options$1
|
|
765
766
|
});
|
|
@@ -1707,7 +1708,6 @@ var init_bundle = __esm({ "src/cli/commands/bundle.ts"() {
|
|
|
1707
1708
|
init_rolldown();
|
|
1708
1709
|
init_watch();
|
|
1709
1710
|
init_misc();
|
|
1710
|
-
init_colors();
|
|
1711
1711
|
init_load_config();
|
|
1712
1712
|
init_logger();
|
|
1713
1713
|
numberFormatter = new Intl.NumberFormat("en", {
|
|
@@ -1761,7 +1761,6 @@ var introduction, examples, notes;
|
|
|
1761
1761
|
var init_help = __esm({ "src/cli/commands/help.ts"() {
|
|
1762
1762
|
init_arguments();
|
|
1763
1763
|
init_utils();
|
|
1764
|
-
init_colors();
|
|
1765
1764
|
init_logger();
|
|
1766
1765
|
introduction = `${colors.gray(`${description} (rolldown v${version})`)}
|
|
1767
1766
|
|
|
@@ -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_parse_ast_index = require('./shared/parse-ast-index-
|
|
3
|
+
const require_src = require('./shared/src-CWP8w1F4.cjs');
|
|
4
|
+
const require_parse_ast_index = require('./shared/parse-ast-index-Uch8iMoV.cjs');
|
|
5
5
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
6
6
|
|
|
7
7
|
//#region src/api/experimental.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
import { import_binding } from "./shared/parse-ast-index-
|
|
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-DnxTBFq6.mjs";
|
|
2
|
+
import { import_binding } from "./shared/parse-ast-index-CDR5KnLL.mjs";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
|
|
5
5
|
//#region src/api/experimental.ts
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_src = require('./shared/src-
|
|
2
|
-
require('./shared/parse-ast-index-
|
|
1
|
+
const require_src = require('./shared/src-CWP8w1F4.cjs');
|
|
2
|
+
require('./shared/parse-ast-index-Uch8iMoV.cjs');
|
|
3
3
|
|
|
4
4
|
exports.VERSION = require_src.VERSION
|
|
5
5
|
exports.build = require_src.build
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VERSION, build, defineConfig, init_src, rolldown, watch, withFilter } from "./shared/src-
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
1
|
+
import { VERSION, build, defineConfig, init_src, rolldown, watch, withFilter } from "./shared/src-DnxTBFq6.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-CDR5KnLL.mjs";
|
|
3
3
|
|
|
4
4
|
init_src();
|
|
5
5
|
export { VERSION, build, defineConfig, rolldown, watch, withFilter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
|
|
2
|
-
const require_src = require('./shared/src-
|
|
3
|
-
const require_parse_ast_index = require('./shared/parse-ast-index-
|
|
2
|
+
const require_src = require('./shared/src-CWP8w1F4.cjs');
|
|
3
|
+
const require_parse_ast_index = require('./shared/parse-ast-index-Uch8iMoV.cjs');
|
|
4
4
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
5
5
|
|
|
6
6
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __commonJS } from "./shared/chunk-DUYDk_2O.mjs";
|
|
2
|
-
import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-
|
|
3
|
-
import { import_binding } from "./shared/parse-ast-index-
|
|
2
|
+
import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-DnxTBFq6.mjs";
|
|
3
|
+
import { import_binding } from "./shared/parse-ast-index-CDR5KnLL.mjs";
|
|
4
4
|
import { parentPort, workerData } from "node:worker_threads";
|
|
5
5
|
|
|
6
6
|
//#region src/parallel-plugin-worker.ts
|
package/dist/parse-ast-index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_parse_ast_index = require('./shared/parse-ast-index-
|
|
1
|
+
const require_parse_ast_index = require('./shared/parse-ast-index-Uch8iMoV.cjs');
|
|
2
2
|
|
|
3
3
|
exports.parseAst = require_parse_ast_index.parseAst
|
|
4
4
|
exports.parseAstAsync = require_parse_ast_index.parseAstAsync
|
package/dist/parse-ast-index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { init_parse_ast_index, parseAst, parseAstAsync } from "./shared/parse-ast-index-
|
|
1
|
+
import { init_parse_ast_index, parseAst, parseAstAsync } from "./shared/parse-ast-index-CDR5KnLL.mjs";
|
|
2
2
|
|
|
3
3
|
init_parse_ast_index();
|
|
4
4
|
export { parseAst, parseAstAsync };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __commonJS, __esm, __require, __toESM } from "./chunk-DUYDk_2O.mjs";
|
|
2
|
-
import
|
|
3
|
-
import { env } from "node:process";
|
|
2
|
+
import colors from "ansis";
|
|
4
3
|
|
|
5
4
|
//#region src/webcontainer-fallback.js
|
|
6
5
|
var require_webcontainer_fallback = __commonJS({ "src/webcontainer-fallback.js"(exports, module) {
|
|
@@ -51,7 +50,11 @@ var require_binding = __commonJS({ "src/binding.js"(exports, module) {
|
|
|
51
50
|
}
|
|
52
51
|
};
|
|
53
52
|
const isMuslFromReport = () => {
|
|
54
|
-
|
|
53
|
+
let report = null;
|
|
54
|
+
if (typeof process.report?.getReport === "function") {
|
|
55
|
+
process.report.excludeNetwork = true;
|
|
56
|
+
report = process.report.getReport();
|
|
57
|
+
}
|
|
55
58
|
if (!report) return null;
|
|
56
59
|
if (report.header && report.header.glibcVersionRuntime) return false;
|
|
57
60
|
if (Array.isArray(report.sharedObjects)) {
|
|
@@ -321,6 +324,11 @@ var require_binding = __commonJS({ "src/binding.js"(exports, module) {
|
|
|
321
324
|
} catch (err) {
|
|
322
325
|
loadErrors.push(err);
|
|
323
326
|
}
|
|
327
|
+
if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) try {
|
|
328
|
+
nativeBinding = require_webcontainer_fallback();
|
|
329
|
+
} catch (err) {
|
|
330
|
+
loadErrors.push(err);
|
|
331
|
+
}
|
|
324
332
|
if (!nativeBinding) {
|
|
325
333
|
if (loadErrors.length > 0) throw new Error("Failed to load native binding", { cause: loadErrors });
|
|
326
334
|
throw new Error(`Failed to load native binding`);
|
|
@@ -368,90 +376,6 @@ var require_binding = __commonJS({ "src/binding.js"(exports, module) {
|
|
|
368
376
|
} });
|
|
369
377
|
var import_binding = __toESM(require_binding());
|
|
370
378
|
|
|
371
|
-
//#endregion
|
|
372
|
-
//#region ../../node_modules/.pnpm/colorette@2.0.20/node_modules/colorette/index.js
|
|
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
|
-
} });
|
|
436
|
-
|
|
437
|
-
//#endregion
|
|
438
|
-
//#region src/cli/colors.ts
|
|
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
|
-
} });
|
|
454
|
-
|
|
455
379
|
//#endregion
|
|
456
380
|
//#region src/utils/code-frame.ts
|
|
457
381
|
function spaces(index) {
|
|
@@ -629,7 +553,6 @@ function augmentCodeLocation(properties, pos, source, id) {
|
|
|
629
553
|
}
|
|
630
554
|
var INVALID_LOG_POSITION, PLUGIN_ERROR, INPUT_HOOK_IN_OUTPUT_PLUGIN, CYCLE_LOADING, MULTIPLY_NOTIFY_OPTION, MINIFY_WARNING, PARSE_ERROR;
|
|
631
555
|
var init_logs = __esm({ "src/log/logs.ts"() {
|
|
632
|
-
init_colors();
|
|
633
556
|
init_code_frame();
|
|
634
557
|
init_locate_character();
|
|
635
558
|
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";
|
|
@@ -722,4 +645,4 @@ var init_parse_ast_index = __esm({ "src/parse-ast-index.ts"() {
|
|
|
722
645
|
} });
|
|
723
646
|
|
|
724
647
|
//#endregion
|
|
725
|
-
export { augmentCodeLocation,
|
|
648
|
+
export { augmentCodeLocation, error, import_binding, init_logs, init_parse_ast_index, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, parseAst, parseAstAsync };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-qZFfknuJ.cjs');
|
|
2
|
-
const
|
|
3
|
-
const node_process = require_chunk.__toESM(require("node:process"));
|
|
2
|
+
const ansis = require_chunk.__toESM(require("ansis"));
|
|
4
3
|
|
|
5
4
|
//#region src/webcontainer-fallback.js
|
|
6
5
|
var require_webcontainer_fallback = require_chunk.__commonJS({ "src/webcontainer-fallback.js"(exports, module) {
|
|
@@ -51,7 +50,11 @@ var require_binding = require_chunk.__commonJS({ "src/binding.js"(exports, modul
|
|
|
51
50
|
}
|
|
52
51
|
};
|
|
53
52
|
const isMuslFromReport = () => {
|
|
54
|
-
|
|
53
|
+
let report = null;
|
|
54
|
+
if (typeof process.report?.getReport === "function") {
|
|
55
|
+
process.report.excludeNetwork = true;
|
|
56
|
+
report = process.report.getReport();
|
|
57
|
+
}
|
|
55
58
|
if (!report) return null;
|
|
56
59
|
if (report.header && report.header.glibcVersionRuntime) return false;
|
|
57
60
|
if (Array.isArray(report.sharedObjects)) {
|
|
@@ -321,6 +324,11 @@ var require_binding = require_chunk.__commonJS({ "src/binding.js"(exports, modul
|
|
|
321
324
|
} catch (err) {
|
|
322
325
|
loadErrors.push(err);
|
|
323
326
|
}
|
|
327
|
+
if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) try {
|
|
328
|
+
nativeBinding = require_webcontainer_fallback();
|
|
329
|
+
} catch (err) {
|
|
330
|
+
loadErrors.push(err);
|
|
331
|
+
}
|
|
324
332
|
if (!nativeBinding) {
|
|
325
333
|
if (loadErrors.length > 0) throw new Error("Failed to load native binding", { cause: loadErrors });
|
|
326
334
|
throw new Error(`Failed to load native binding`);
|
|
@@ -368,83 +376,6 @@ var require_binding = require_chunk.__commonJS({ "src/binding.js"(exports, modul
|
|
|
368
376
|
} });
|
|
369
377
|
var import_binding = require_chunk.__toESM(require_binding());
|
|
370
378
|
|
|
371
|
-
//#endregion
|
|
372
|
-
//#region ../../node_modules/.pnpm/colorette@2.0.20/node_modules/colorette/index.js
|
|
373
|
-
const { env: env$1 = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
|
|
374
|
-
const isDisabled = "NO_COLOR" in env$1 || argv.includes("--no-color");
|
|
375
|
-
const isForced = "FORCE_COLOR" in env$1 || argv.includes("--color");
|
|
376
|
-
const isWindows = platform === "win32";
|
|
377
|
-
const isDumbTerminal = env$1.TERM === "dumb";
|
|
378
|
-
const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env$1.TERM && !isDumbTerminal;
|
|
379
|
-
const isCI = "CI" in env$1 && ("GITHUB_ACTIONS" in env$1 || "GITLAB_CI" in env$1 || "CIRCLECI" in env$1);
|
|
380
|
-
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
381
|
-
const 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));
|
|
382
|
-
const clearBleed = (index, string, open, close, replace) => index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
383
|
-
const filterEmpty = (open, close, replace = open, at = open.length + 1) => (string) => string || !(string === "" || string === void 0) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
384
|
-
const init = (open, close, replace) => filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
|
|
385
|
-
const colors$1 = {
|
|
386
|
-
reset: init(0, 0),
|
|
387
|
-
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
388
|
-
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
389
|
-
italic: init(3, 23),
|
|
390
|
-
underline: init(4, 24),
|
|
391
|
-
inverse: init(7, 27),
|
|
392
|
-
hidden: init(8, 28),
|
|
393
|
-
strikethrough: init(9, 29),
|
|
394
|
-
black: init(30, 39),
|
|
395
|
-
red: init(31, 39),
|
|
396
|
-
green: init(32, 39),
|
|
397
|
-
yellow: init(33, 39),
|
|
398
|
-
blue: init(34, 39),
|
|
399
|
-
magenta: init(35, 39),
|
|
400
|
-
cyan: init(36, 39),
|
|
401
|
-
white: init(37, 39),
|
|
402
|
-
gray: init(90, 39),
|
|
403
|
-
bgBlack: init(40, 49),
|
|
404
|
-
bgRed: init(41, 49),
|
|
405
|
-
bgGreen: init(42, 49),
|
|
406
|
-
bgYellow: init(43, 49),
|
|
407
|
-
bgBlue: init(44, 49),
|
|
408
|
-
bgMagenta: init(45, 49),
|
|
409
|
-
bgCyan: init(46, 49),
|
|
410
|
-
bgWhite: init(47, 49),
|
|
411
|
-
blackBright: init(90, 39),
|
|
412
|
-
redBright: init(91, 39),
|
|
413
|
-
greenBright: init(92, 39),
|
|
414
|
-
yellowBright: init(93, 39),
|
|
415
|
-
blueBright: init(94, 39),
|
|
416
|
-
magentaBright: init(95, 39),
|
|
417
|
-
cyanBright: init(96, 39),
|
|
418
|
-
whiteBright: init(97, 39),
|
|
419
|
-
bgBlackBright: init(100, 49),
|
|
420
|
-
bgRedBright: init(101, 49),
|
|
421
|
-
bgGreenBright: init(102, 49),
|
|
422
|
-
bgYellowBright: init(103, 49),
|
|
423
|
-
bgBlueBright: init(104, 49),
|
|
424
|
-
bgMagentaBright: init(105, 49),
|
|
425
|
-
bgCyanBright: init(106, 49),
|
|
426
|
-
bgWhiteBright: init(107, 49)
|
|
427
|
-
};
|
|
428
|
-
const createColors = ({ useColor = isColorSupported } = {}) => useColor ? colors$1 : Object.keys(colors$1).reduce((colors$2, key) => ({
|
|
429
|
-
...colors$2,
|
|
430
|
-
[key]: String
|
|
431
|
-
}), {});
|
|
432
|
-
const { 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();
|
|
433
|
-
|
|
434
|
-
//#endregion
|
|
435
|
-
//#region src/cli/colors.ts
|
|
436
|
-
const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({ useColor: node_process.env.FORCE_COLOR !== "0" && !node_process.env.NO_COLOR });
|
|
437
|
-
const colors = {
|
|
438
|
-
bold,
|
|
439
|
-
cyan,
|
|
440
|
-
dim,
|
|
441
|
-
gray,
|
|
442
|
-
green,
|
|
443
|
-
red,
|
|
444
|
-
underline,
|
|
445
|
-
yellow
|
|
446
|
-
};
|
|
447
|
-
|
|
448
379
|
//#endregion
|
|
449
380
|
//#region src/utils/code-frame.ts
|
|
450
381
|
function spaces(index) {
|
|
@@ -547,7 +478,7 @@ function logParseError(message) {
|
|
|
547
478
|
function logMinifyWarning() {
|
|
548
479
|
return {
|
|
549
480
|
code: MINIFY_WARNING,
|
|
550
|
-
message:
|
|
481
|
+
message: ansis.default.yellow("The built-in minifier is still under development. Setting \"minify: true\" is not recommended for production use.")
|
|
551
482
|
};
|
|
552
483
|
}
|
|
553
484
|
function logInvalidLogPosition(pluginName) {
|
|
@@ -703,12 +634,6 @@ Object.defineProperty(exports, 'augmentCodeLocation', {
|
|
|
703
634
|
return augmentCodeLocation;
|
|
704
635
|
}
|
|
705
636
|
});
|
|
706
|
-
Object.defineProperty(exports, 'colors', {
|
|
707
|
-
enumerable: true,
|
|
708
|
-
get: function () {
|
|
709
|
-
return colors;
|
|
710
|
-
}
|
|
711
|
-
});
|
|
712
637
|
Object.defineProperty(exports, 'error', {
|
|
713
638
|
enumerable: true,
|
|
714
639
|
get: function () {
|
|
@@ -67,8 +67,8 @@ function requireSrc() {
|
|
|
67
67
|
function requirePicocolors() {
|
|
68
68
|
if (hasRequiredPicocolors) return picocolors.exports;
|
|
69
69
|
hasRequiredPicocolors = 1;
|
|
70
|
-
let p = process || {}, argv = p.argv || [], env
|
|
71
|
-
let isColorSupported = !(!!env
|
|
70
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
71
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
72
72
|
let formatter = (open, close, replace = open) => (input) => {
|
|
73
73
|
let string = "" + input, index = string.indexOf(close, open.length);
|
|
74
74
|
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|