@storm-software/workspace-tools 1.49.12 → 1.49.13
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/CHANGELOG.md +12 -0
- package/index.js +573 -587
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/tsup/executor.js +260 -270
- package/src/executors/tsup-browser/executor.js +684 -692
- package/src/executors/tsup-neutral/executor.js +684 -692
- package/src/executors/tsup-node/executor.js +684 -692
- package/src/utils/index.js +2418 -8784
|
@@ -25284,7 +25284,7 @@ var require_fill_range = __commonJS({
|
|
|
25284
25284
|
let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
|
25285
25285
|
let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
|
25286
25286
|
let toNumber = padded === false && stringify(start, end, options) === false;
|
|
25287
|
-
let
|
|
25287
|
+
let format2 = options.transform || transform(toNumber);
|
|
25288
25288
|
if (options.toRegex && step === 1) {
|
|
25289
25289
|
return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
|
|
25290
25290
|
}
|
|
@@ -25296,7 +25296,7 @@ var require_fill_range = __commonJS({
|
|
|
25296
25296
|
if (options.toRegex === true && step > 1) {
|
|
25297
25297
|
push(a);
|
|
25298
25298
|
} else {
|
|
25299
|
-
range.push(pad(
|
|
25299
|
+
range.push(pad(format2(a, index), maxLen, toNumber));
|
|
25300
25300
|
}
|
|
25301
25301
|
a = descending ? a - step : a + step;
|
|
25302
25302
|
index++;
|
|
@@ -25310,7 +25310,7 @@ var require_fill_range = __commonJS({
|
|
|
25310
25310
|
if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
|
|
25311
25311
|
return invalidRange(start, end, options);
|
|
25312
25312
|
}
|
|
25313
|
-
let
|
|
25313
|
+
let format2 = options.transform || ((val) => String.fromCharCode(val));
|
|
25314
25314
|
let a = `${start}`.charCodeAt(0);
|
|
25315
25315
|
let b = `${end}`.charCodeAt(0);
|
|
25316
25316
|
let descending = a > b;
|
|
@@ -25322,7 +25322,7 @@ var require_fill_range = __commonJS({
|
|
|
25322
25322
|
let range = [];
|
|
25323
25323
|
let index = 0;
|
|
25324
25324
|
while (descending ? a >= b : a <= b) {
|
|
25325
|
-
range.push(
|
|
25325
|
+
range.push(format2(a, index));
|
|
25326
25326
|
a = descending ? a - step : a + step;
|
|
25327
25327
|
index++;
|
|
25328
25328
|
}
|
|
@@ -27364,11 +27364,11 @@ var require_picomatch = __commonJS({
|
|
|
27364
27364
|
return { isMatch: false, output: "" };
|
|
27365
27365
|
}
|
|
27366
27366
|
const opts = options || {};
|
|
27367
|
-
const
|
|
27367
|
+
const format2 = opts.format || (posix2 ? utils.toPosixSlashes : null);
|
|
27368
27368
|
let match2 = input === glob2;
|
|
27369
|
-
let output = match2 &&
|
|
27369
|
+
let output = match2 && format2 ? format2(input) : input;
|
|
27370
27370
|
if (match2 === false) {
|
|
27371
|
-
output =
|
|
27371
|
+
output = format2 ? format2(input) : input;
|
|
27372
27372
|
match2 = output === glob2;
|
|
27373
27373
|
}
|
|
27374
27374
|
if (match2 === false || opts.capture === true) {
|
|
@@ -31447,8 +31447,8 @@ var require_prompt = __commonJS({
|
|
|
31447
31447
|
return this.skipped;
|
|
31448
31448
|
}
|
|
31449
31449
|
async initialize() {
|
|
31450
|
-
let { format:
|
|
31451
|
-
this.format = () =>
|
|
31450
|
+
let { format: format2, options, result } = this;
|
|
31451
|
+
this.format = () => format2.call(this, this.value);
|
|
31452
31452
|
this.result = () => result.call(this, this.value);
|
|
31453
31453
|
if (typeof options.initial === "function") {
|
|
31454
31454
|
this.initial = await options.initial.call(this, this);
|
|
@@ -32362,8 +32362,8 @@ var require_select = __commonJS({
|
|
|
32362
32362
|
separator() {
|
|
32363
32363
|
if (this.options.separator)
|
|
32364
32364
|
return super.separator();
|
|
32365
|
-
let
|
|
32366
|
-
return this.state.submitted ? super.separator() :
|
|
32365
|
+
let sep3 = this.styles.muted(this.symbols.ellipsis);
|
|
32366
|
+
return this.state.submitted ? super.separator() : sep3;
|
|
32367
32367
|
}
|
|
32368
32368
|
pointer(choice, i) {
|
|
32369
32369
|
return !this.multiple || this.options.pointer ? super.pointer(choice, i) : "";
|
|
@@ -32727,8 +32727,8 @@ var require_form = __commonJS({
|
|
|
32727
32727
|
return choice.input ? "\u29BF" : "\u2299";
|
|
32728
32728
|
}
|
|
32729
32729
|
async choiceSeparator(choice, i) {
|
|
32730
|
-
let
|
|
32731
|
-
return
|
|
32730
|
+
let sep3 = await this.resolve(choice.separator, this.state, choice, i) || ":";
|
|
32731
|
+
return sep3 ? " " + this.styles.disabled(sep3) : "";
|
|
32732
32732
|
}
|
|
32733
32733
|
async renderChoice(choice, i) {
|
|
32734
32734
|
await this.onChoice(choice, i);
|
|
@@ -32738,7 +32738,7 @@ var require_form = __commonJS({
|
|
|
32738
32738
|
let help = hint;
|
|
32739
32739
|
let focused = this.index === i;
|
|
32740
32740
|
let validate = choice.validate || (() => true);
|
|
32741
|
-
let
|
|
32741
|
+
let sep3 = await this.choiceSeparator(choice, i);
|
|
32742
32742
|
let msg = choice.message;
|
|
32743
32743
|
if (this.align === "right")
|
|
32744
32744
|
msg = msg.padStart(this.longest + 1, " ");
|
|
@@ -32752,7 +32752,7 @@ var require_form = __commonJS({
|
|
|
32752
32752
|
let style = styles[color];
|
|
32753
32753
|
let indicator = style(await this.indicator(choice, i)) + (choice.pad || "");
|
|
32754
32754
|
let indent = this.indent(choice);
|
|
32755
|
-
let line = () => [indent, indicator, msg +
|
|
32755
|
+
let line = () => [indent, indicator, msg + sep3, input, help].filter(Boolean).join(" ");
|
|
32756
32756
|
if (state.submitted) {
|
|
32757
32757
|
msg = colors.unstyle(msg);
|
|
32758
32758
|
input = submitted(input);
|
|
@@ -32908,10 +32908,10 @@ var require_boolean = __commonJS({
|
|
|
32908
32908
|
async render() {
|
|
32909
32909
|
let { input, size } = this.state;
|
|
32910
32910
|
let prefix = await this.prefix();
|
|
32911
|
-
let
|
|
32911
|
+
let sep3 = await this.separator();
|
|
32912
32912
|
let msg = await this.message();
|
|
32913
32913
|
let hint = this.styles.muted(this.default);
|
|
32914
|
-
let promptLine = [prefix, msg, hint,
|
|
32914
|
+
let promptLine = [prefix, msg, hint, sep3].filter(Boolean).join(" ");
|
|
32915
32915
|
this.state.prompt = promptLine;
|
|
32916
32916
|
let header = await this.header();
|
|
32917
32917
|
let value = this.value = this.cast(input);
|
|
@@ -33836,7 +33836,7 @@ var require_interpolate = __commonJS({
|
|
|
33836
33836
|
let defaults2 = { ...options.values, ...options.initial };
|
|
33837
33837
|
let { tabstops, items, keys } = await tokenize(options, defaults2);
|
|
33838
33838
|
let result = createFn("result", prompt, options);
|
|
33839
|
-
let
|
|
33839
|
+
let format2 = createFn("format", prompt, options);
|
|
33840
33840
|
let isValid2 = createFn("validate", prompt, options, true);
|
|
33841
33841
|
let isVal = prompt.isValue.bind(prompt);
|
|
33842
33842
|
return async (state = {}, submitted = false) => {
|
|
@@ -33881,7 +33881,7 @@ var require_interpolate = __commonJS({
|
|
|
33881
33881
|
}
|
|
33882
33882
|
item.placeholder = false;
|
|
33883
33883
|
let before = value;
|
|
33884
|
-
value = await
|
|
33884
|
+
value = await format2(value, state, item, index);
|
|
33885
33885
|
if (val !== value) {
|
|
33886
33886
|
state.values[key] = val;
|
|
33887
33887
|
value = prompt.styles.typing(val);
|
|
@@ -34714,13 +34714,13 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
34714
34714
|
}
|
|
34715
34715
|
validateName(options.name, options.projectNameAndRootFormat);
|
|
34716
34716
|
const formats = getProjectNameAndRootFormats(tree, options);
|
|
34717
|
-
const
|
|
34718
|
-
if (
|
|
34717
|
+
const format2 = options.projectNameAndRootFormat ?? await determineFormat(formats);
|
|
34718
|
+
if (format2 === "derived" && options.callingGenerator) {
|
|
34719
34719
|
logDeprecationMessage(options.callingGenerator, formats);
|
|
34720
34720
|
}
|
|
34721
34721
|
return {
|
|
34722
|
-
...formats[
|
|
34723
|
-
projectNameAndRootFormat:
|
|
34722
|
+
...formats[format2],
|
|
34723
|
+
projectNameAndRootFormat: format2
|
|
34724
34724
|
};
|
|
34725
34725
|
}
|
|
34726
34726
|
exports.determineProjectNameAndRootOptions = determineProjectNameAndRootOptions;
|
|
@@ -34771,7 +34771,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
34771
34771
|
}
|
|
34772
34772
|
],
|
|
34773
34773
|
initial: "as-provided"
|
|
34774
|
-
}).then(({ format:
|
|
34774
|
+
}).then(({ format: format2 }) => format2 === asProvidedSelectedValue ? "as-provided" : "derived");
|
|
34775
34775
|
return result;
|
|
34776
34776
|
}
|
|
34777
34777
|
function getProjectNameAndRootFormats(tree, options) {
|
|
@@ -45941,21 +45941,21 @@ var require_chunk_GQ77QZBO = __commonJS({
|
|
|
45941
45941
|
}
|
|
45942
45942
|
}
|
|
45943
45943
|
function defaultOutExtension({
|
|
45944
|
-
format:
|
|
45944
|
+
format: format2,
|
|
45945
45945
|
pkgType
|
|
45946
45946
|
}) {
|
|
45947
45947
|
let jsExtension = ".js";
|
|
45948
45948
|
let dtsExtension = ".d.ts";
|
|
45949
45949
|
const isModule = pkgType === "module";
|
|
45950
|
-
if (isModule &&
|
|
45950
|
+
if (isModule && format2 === "cjs") {
|
|
45951
45951
|
jsExtension = ".cjs";
|
|
45952
45952
|
dtsExtension = ".d.cts";
|
|
45953
45953
|
}
|
|
45954
|
-
if (!isModule &&
|
|
45954
|
+
if (!isModule && format2 === "esm") {
|
|
45955
45955
|
jsExtension = ".mjs";
|
|
45956
45956
|
dtsExtension = ".d.mts";
|
|
45957
45957
|
}
|
|
45958
|
-
if (
|
|
45958
|
+
if (format2 === "iife") {
|
|
45959
45959
|
jsExtension = ".global.js";
|
|
45960
45960
|
}
|
|
45961
45961
|
return {
|
|
@@ -46780,8 +46780,8 @@ var require_dist3 = __commonJS({
|
|
|
46780
46780
|
return "cjs";
|
|
46781
46781
|
}
|
|
46782
46782
|
var usingDynamicImport = typeof jest === "undefined";
|
|
46783
|
-
var dynamicImport = async (id, { format:
|
|
46784
|
-
const fn =
|
|
46783
|
+
var dynamicImport = async (id, { format: format2 }) => {
|
|
46784
|
+
const fn = format2 === "esm" ? (file) => import(file) : false ? createRequire(import_meta.url) : require;
|
|
46785
46785
|
return fn(id);
|
|
46786
46786
|
};
|
|
46787
46787
|
var getRandomId = () => {
|
|
@@ -46798,9 +46798,9 @@ var require_dist3 = __commonJS({
|
|
|
46798
46798
|
return "ts";
|
|
46799
46799
|
return ext2.slice(1);
|
|
46800
46800
|
}
|
|
46801
|
-
var defaultGetOutputFile = (filepath,
|
|
46801
|
+
var defaultGetOutputFile = (filepath, format2) => filepath.replace(
|
|
46802
46802
|
JS_EXT_RE,
|
|
46803
|
-
`.bundled_${getRandomId()}.${
|
|
46803
|
+
`.bundled_${getRandomId()}.${format2 === "esm" ? "mjs" : "cjs"}`
|
|
46804
46804
|
);
|
|
46805
46805
|
var tsconfigPathsToRegExp = (paths) => {
|
|
46806
46806
|
return Object.keys(paths || {}).map((key) => {
|
|
@@ -46880,7 +46880,7 @@ var require_dist3 = __commonJS({
|
|
|
46880
46880
|
}
|
|
46881
46881
|
const preserveTemporaryFile = (_a = options.preserveTemporaryFile) != null ? _a : !!process.env.BUNDLE_REQUIRE_PRESERVE;
|
|
46882
46882
|
const cwd = options.cwd || process.cwd();
|
|
46883
|
-
const
|
|
46883
|
+
const format2 = (_b = options.format) != null ? _b : guessFormat(options.filepath);
|
|
46884
46884
|
const tsconfig = (0, import_load_tsconfig.loadTsConfig)(cwd, options.tsconfig);
|
|
46885
46885
|
const resolvePaths = tsconfigPathsToRegExp(
|
|
46886
46886
|
((_c = tsconfig == null ? void 0 : tsconfig.data.compilerOptions) == null ? void 0 : _c.paths) || {}
|
|
@@ -46891,14 +46891,14 @@ var require_dist3 = __commonJS({
|
|
|
46891
46891
|
}
|
|
46892
46892
|
const { text } = result.outputFiles[0];
|
|
46893
46893
|
const getOutputFile = options.getOutputFile || defaultGetOutputFile;
|
|
46894
|
-
const outfile = getOutputFile(options.filepath,
|
|
46894
|
+
const outfile = getOutputFile(options.filepath, format2);
|
|
46895
46895
|
await import_fs2.default.promises.writeFile(outfile, text, "utf8");
|
|
46896
46896
|
let mod;
|
|
46897
46897
|
const req = options.require || dynamicImport;
|
|
46898
46898
|
try {
|
|
46899
46899
|
mod = await req(
|
|
46900
|
-
|
|
46901
|
-
{ format:
|
|
46900
|
+
format2 === "esm" ? (0, import_url3.pathToFileURL)(outfile).href : outfile,
|
|
46901
|
+
{ format: format2 }
|
|
46902
46902
|
);
|
|
46903
46903
|
} finally {
|
|
46904
46904
|
if (!preserveTemporaryFile) {
|
|
@@ -46916,7 +46916,7 @@ var require_dist3 = __commonJS({
|
|
|
46916
46916
|
entryPoints: [options.filepath],
|
|
46917
46917
|
absWorkingDir: cwd,
|
|
46918
46918
|
outfile: "out.js",
|
|
46919
|
-
format:
|
|
46919
|
+
format: format2,
|
|
46920
46920
|
platform: "node",
|
|
46921
46921
|
sourcemap: "inline",
|
|
46922
46922
|
bundle: true,
|
|
@@ -47185,12 +47185,12 @@ var require_chunk_7G76EW2R = __commonJS({
|
|
|
47185
47185
|
var padRight = (str, maxLength) => {
|
|
47186
47186
|
return str + " ".repeat(maxLength - str.length);
|
|
47187
47187
|
};
|
|
47188
|
-
var reportSize = (logger,
|
|
47188
|
+
var reportSize = (logger, format2, files) => {
|
|
47189
47189
|
const filenames = Object.keys(files);
|
|
47190
47190
|
const maxLength = getLengthOfLongestString(filenames) + 1;
|
|
47191
47191
|
for (const name of filenames) {
|
|
47192
47192
|
logger.success(
|
|
47193
|
-
|
|
47193
|
+
format2,
|
|
47194
47194
|
`${_chunkUIX4URMVjs.bold.call(void 0, padRight(name, maxLength))}${_chunkUIX4URMVjs.green.call(
|
|
47195
47195
|
void 0,
|
|
47196
47196
|
prettyBytes(files[name])
|
|
@@ -74506,11 +74506,11 @@ Original error: ${originalError.message}`,
|
|
|
74506
74506
|
message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`
|
|
74507
74507
|
};
|
|
74508
74508
|
}
|
|
74509
|
-
function logInvalidFormatForTopLevelAwait(id,
|
|
74509
|
+
function logInvalidFormatForTopLevelAwait(id, format2) {
|
|
74510
74510
|
return {
|
|
74511
74511
|
code: INVALID_TLA_FORMAT,
|
|
74512
74512
|
id,
|
|
74513
|
-
message: `Module format "${
|
|
74513
|
+
message: `Module format "${format2}" does not support top-level await. Use the "es" or "system" output formats rather.`
|
|
74514
74514
|
};
|
|
74515
74515
|
}
|
|
74516
74516
|
function logMissingConfig() {
|
|
@@ -80784,11 +80784,11 @@ var require_rollup = __commonJS({
|
|
|
80784
80784
|
return { isMatch: false, output: "" };
|
|
80785
80785
|
}
|
|
80786
80786
|
const opts = options || {};
|
|
80787
|
-
const
|
|
80787
|
+
const format2 = opts.format || (posix2 ? utils.toPosixSlashes : null);
|
|
80788
80788
|
let match2 = input === glob2;
|
|
80789
|
-
let output = match2 &&
|
|
80789
|
+
let output = match2 && format2 ? format2(input) : input;
|
|
80790
80790
|
if (match2 === false) {
|
|
80791
|
-
output =
|
|
80791
|
+
output = format2 ? format2(input) : input;
|
|
80792
80792
|
match2 = output === glob2;
|
|
80793
80793
|
}
|
|
80794
80794
|
if (match2 === false || opts.capture === true) {
|
|
@@ -82351,11 +82351,11 @@ var require_rollup = __commonJS({
|
|
|
82351
82351
|
addReturnExpression(expression) {
|
|
82352
82352
|
this.parent instanceof _ChildScope && this.parent.addReturnExpression(expression);
|
|
82353
82353
|
}
|
|
82354
|
-
addUsedOutsideNames(usedNames,
|
|
82354
|
+
addUsedOutsideNames(usedNames, format2, exportNamesByVariable, accessedGlobalsByScope) {
|
|
82355
82355
|
for (const variable of this.accessedOutsideVariables.values()) {
|
|
82356
82356
|
if (variable.included) {
|
|
82357
82357
|
usedNames.add(variable.getBaseVariableName());
|
|
82358
|
-
if (
|
|
82358
|
+
if (format2 === "system" && exportNamesByVariable.has(variable)) {
|
|
82359
82359
|
usedNames.add("exports");
|
|
82360
82360
|
}
|
|
82361
82361
|
}
|
|
@@ -82370,9 +82370,9 @@ var require_rollup = __commonJS({
|
|
|
82370
82370
|
contains(name) {
|
|
82371
82371
|
return this.variables.has(name) || this.parent.contains(name);
|
|
82372
82372
|
}
|
|
82373
|
-
deconflict(
|
|
82373
|
+
deconflict(format2, exportNamesByVariable, accessedGlobalsByScope) {
|
|
82374
82374
|
const usedNames = /* @__PURE__ */ new Set();
|
|
82375
|
-
this.addUsedOutsideNames(usedNames,
|
|
82375
|
+
this.addUsedOutsideNames(usedNames, format2, exportNamesByVariable, accessedGlobalsByScope);
|
|
82376
82376
|
if (this.accessedDynamicImports) {
|
|
82377
82377
|
for (const importExpression of this.accessedDynamicImports) {
|
|
82378
82378
|
if (importExpression.inlineNamespace) {
|
|
@@ -82386,7 +82386,7 @@ var require_rollup = __commonJS({
|
|
|
82386
82386
|
}
|
|
82387
82387
|
}
|
|
82388
82388
|
for (const scope of this.children) {
|
|
82389
|
-
scope.deconflict(
|
|
82389
|
+
scope.deconflict(format2, exportNamesByVariable, accessedGlobalsByScope);
|
|
82390
82390
|
}
|
|
82391
82391
|
}
|
|
82392
82392
|
findLexicalBoundary() {
|
|
@@ -85483,10 +85483,10 @@ var require_rollup = __commonJS({
|
|
|
85483
85483
|
super.parseNode(esTreeNode);
|
|
85484
85484
|
}
|
|
85485
85485
|
render(code, options) {
|
|
85486
|
-
const { exportNamesByVariable, format:
|
|
85486
|
+
const { exportNamesByVariable, format: format2, snippets: { _, getPropertyAccess } } = options;
|
|
85487
85487
|
if (this.id) {
|
|
85488
85488
|
const { variable, name } = this.id;
|
|
85489
|
-
if (
|
|
85489
|
+
if (format2 === "system" && exportNamesByVariable.has(variable)) {
|
|
85490
85490
|
code.appendLeft(this.end, `${_}${getSystemExportStatement([variable], options)};`);
|
|
85491
85491
|
}
|
|
85492
85492
|
const renderedVariable = variable.getName(getPropertyAccess);
|
|
@@ -85833,19 +85833,19 @@ var require_rollup = __commonJS({
|
|
|
85833
85833
|
applyDeoptimizations() {
|
|
85834
85834
|
}
|
|
85835
85835
|
renderNamedDeclaration(code, declarationStart, idInsertPosition, options) {
|
|
85836
|
-
const { exportNamesByVariable, format:
|
|
85836
|
+
const { exportNamesByVariable, format: format2, snippets: { getPropertyAccess } } = options;
|
|
85837
85837
|
const name = this.variable.getName(getPropertyAccess);
|
|
85838
85838
|
code.remove(this.start, declarationStart);
|
|
85839
85839
|
if (idInsertPosition !== null) {
|
|
85840
85840
|
code.appendLeft(idInsertPosition, ` ${name}`);
|
|
85841
85841
|
}
|
|
85842
|
-
if (
|
|
85842
|
+
if (format2 === "system" && this.declaration instanceof ClassDeclaration && exportNamesByVariable.has(this.variable)) {
|
|
85843
85843
|
code.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`);
|
|
85844
85844
|
}
|
|
85845
85845
|
}
|
|
85846
|
-
renderVariableDeclaration(code, declarationStart, { format:
|
|
85846
|
+
renderVariableDeclaration(code, declarationStart, { format: format2, exportNamesByVariable, snippets: { cnst, getPropertyAccess } }) {
|
|
85847
85847
|
const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59;
|
|
85848
|
-
const systemExportNames =
|
|
85848
|
+
const systemExportNames = format2 === "system" && exportNamesByVariable.get(this.variable);
|
|
85849
85849
|
if (systemExportNames) {
|
|
85850
85850
|
code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = exports('${systemExportNames[0]}', `);
|
|
85851
85851
|
code.appendRight(hasTrailingSemicolon ? this.end - 1 : this.end, ")" + (hasTrailingSemicolon ? "" : ";"));
|
|
@@ -86549,13 +86549,13 @@ var require_rollup = __commonJS({
|
|
|
86549
86549
|
}
|
|
86550
86550
|
}
|
|
86551
86551
|
setExternalResolution(exportMode, resolution, options, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, namespaceExportName, attributes) {
|
|
86552
|
-
const { format:
|
|
86552
|
+
const { format: format2 } = options;
|
|
86553
86553
|
this.inlineNamespace = null;
|
|
86554
86554
|
this.resolution = resolution;
|
|
86555
86555
|
this.resolutionString = resolutionString;
|
|
86556
86556
|
this.namespaceExportName = namespaceExportName;
|
|
86557
86557
|
this.attributes = attributes;
|
|
86558
|
-
const accessedGlobals = [...accessedImportGlobals[
|
|
86558
|
+
const accessedGlobals = [...accessedImportGlobals[format2] || []];
|
|
86559
86559
|
let helper;
|
|
86560
86560
|
({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(resolution, exportMode, options, snippets, pluginDriver));
|
|
86561
86561
|
if (helper) {
|
|
@@ -86570,11 +86570,11 @@ var require_rollup = __commonJS({
|
|
|
86570
86570
|
}
|
|
86571
86571
|
applyDeoptimizations() {
|
|
86572
86572
|
}
|
|
86573
|
-
getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportInCjs, format:
|
|
86573
|
+
getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportInCjs, format: format2, generatedCode: { arrowFunctions }, interop }, { _, getDirectReturnFunction, getDirectReturnIifeLeft }, pluginDriver) {
|
|
86574
86574
|
const mechanism = pluginDriver.hookFirstSync("renderDynamicImport", [
|
|
86575
86575
|
{
|
|
86576
86576
|
customResolution: typeof this.resolution === "string" ? this.resolution : null,
|
|
86577
|
-
format:
|
|
86577
|
+
format: format2,
|
|
86578
86578
|
moduleId: this.scope.context.module.id,
|
|
86579
86579
|
targetModuleId: this.resolution && typeof this.resolution !== "string" ? this.resolution.id : null
|
|
86580
86580
|
}
|
|
@@ -86583,7 +86583,7 @@ var require_rollup = __commonJS({
|
|
|
86583
86583
|
return { helper: null, mechanism };
|
|
86584
86584
|
}
|
|
86585
86585
|
const hasDynamicTarget = !this.resolution || typeof this.resolution === "string";
|
|
86586
|
-
switch (
|
|
86586
|
+
switch (format2) {
|
|
86587
86587
|
case "cjs": {
|
|
86588
86588
|
if (dynamicImportInCjs && (!resolution || typeof resolution === "string" || resolution instanceof ExternalModule)) {
|
|
86589
86589
|
return { helper: null, mechanism: null };
|
|
@@ -86881,7 +86881,7 @@ var require_rollup = __commonJS({
|
|
|
86881
86881
|
}
|
|
86882
86882
|
}
|
|
86883
86883
|
render(code, renderOptions) {
|
|
86884
|
-
const { format:
|
|
86884
|
+
const { format: format2, pluginDriver, snippets } = renderOptions;
|
|
86885
86885
|
const { scope: { context: { module: module3 } }, meta: { name }, metaProperty, parent, preliminaryChunkId, referenceId, start, end } = this;
|
|
86886
86886
|
const { id: moduleId } = module3;
|
|
86887
86887
|
if (name !== IMPORT)
|
|
@@ -86891,18 +86891,18 @@ var require_rollup = __commonJS({
|
|
|
86891
86891
|
const fileName = pluginDriver.getFileName(referenceId);
|
|
86892
86892
|
const relativePath = parseAst_js.normalize(node_path.relative(node_path.dirname(chunkId), fileName));
|
|
86893
86893
|
const replacement2 = pluginDriver.hookFirstSync("resolveFileUrl", [
|
|
86894
|
-
{ chunkId, fileName, format:
|
|
86895
|
-
]) || relativeUrlMechanisms[
|
|
86894
|
+
{ chunkId, fileName, format: format2, moduleId, referenceId, relativePath }
|
|
86895
|
+
]) || relativeUrlMechanisms[format2](relativePath);
|
|
86896
86896
|
code.overwrite(parent.start, parent.end, replacement2, { contentOnly: true });
|
|
86897
86897
|
return;
|
|
86898
86898
|
}
|
|
86899
86899
|
let replacement = pluginDriver.hookFirstSync("resolveImportMeta", [
|
|
86900
86900
|
metaProperty,
|
|
86901
|
-
{ chunkId, format:
|
|
86901
|
+
{ chunkId, format: format2, moduleId }
|
|
86902
86902
|
]);
|
|
86903
86903
|
if (!replacement) {
|
|
86904
|
-
replacement = importMetaMechanisms[
|
|
86905
|
-
renderOptions.accessedDocumentCurrentScript ||= formatsMaybeAccessDocumentCurrentScript.includes(
|
|
86904
|
+
replacement = importMetaMechanisms[format2]?.(metaProperty, { chunkId, snippets });
|
|
86905
|
+
renderOptions.accessedDocumentCurrentScript ||= formatsMaybeAccessDocumentCurrentScript.includes(format2) && replacement !== "undefined";
|
|
86906
86906
|
}
|
|
86907
86907
|
if (typeof replacement === "string") {
|
|
86908
86908
|
if (parent instanceof MemberExpression) {
|
|
@@ -86912,9 +86912,9 @@ var require_rollup = __commonJS({
|
|
|
86912
86912
|
}
|
|
86913
86913
|
}
|
|
86914
86914
|
}
|
|
86915
|
-
setResolution(
|
|
86915
|
+
setResolution(format2, accessedGlobalsByScope, preliminaryChunkId) {
|
|
86916
86916
|
this.preliminaryChunkId = preliminaryChunkId;
|
|
86917
|
-
const accessedGlobals = (this.metaProperty?.startsWith(FILE_PREFIX) ? accessedFileUrlGlobals : accessedMetaUrlGlobals)[
|
|
86917
|
+
const accessedGlobals = (this.metaProperty?.startsWith(FILE_PREFIX) ? accessedFileUrlGlobals : accessedMetaUrlGlobals)[format2];
|
|
86918
86918
|
if (accessedGlobals.length > 0) {
|
|
86919
86919
|
this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope);
|
|
86920
86920
|
}
|
|
@@ -87677,9 +87677,9 @@ var require_rollup = __commonJS({
|
|
|
87677
87677
|
}
|
|
87678
87678
|
addNamespaceMemberAccess() {
|
|
87679
87679
|
}
|
|
87680
|
-
deconflict(
|
|
87680
|
+
deconflict(format2, exportNamesByVariable, accessedGlobalsByScope) {
|
|
87681
87681
|
for (const scope of this.children)
|
|
87682
|
-
scope.deconflict(
|
|
87682
|
+
scope.deconflict(format2, exportNamesByVariable, accessedGlobalsByScope);
|
|
87683
87683
|
}
|
|
87684
87684
|
findLexicalBoundary() {
|
|
87685
87685
|
return this;
|
|
@@ -87854,9 +87854,9 @@ var require_rollup = __commonJS({
|
|
|
87854
87854
|
this.argument.setAssignedValue(UNKNOWN_EXPRESSION);
|
|
87855
87855
|
}
|
|
87856
87856
|
render(code, options) {
|
|
87857
|
-
const { exportNamesByVariable, format:
|
|
87857
|
+
const { exportNamesByVariable, format: format2, snippets: { _ } } = options;
|
|
87858
87858
|
this.argument.render(code, options);
|
|
87859
|
-
if (
|
|
87859
|
+
if (format2 === "system") {
|
|
87860
87860
|
const variable = this.argument.variable;
|
|
87861
87861
|
const exportNames = exportNamesByVariable.get(variable);
|
|
87862
87862
|
if (exportNames) {
|
|
@@ -88233,7 +88233,7 @@ var require_rollup = __commonJS({
|
|
|
88233
88233
|
}
|
|
88234
88234
|
}
|
|
88235
88235
|
renderBlock(options) {
|
|
88236
|
-
const { exportNamesByVariable, format:
|
|
88236
|
+
const { exportNamesByVariable, format: format2, freeze, indent: t, symbols, snippets: { _, cnst, getObject, getPropertyAccess, n: n2, s } } = options;
|
|
88237
88237
|
const memberVariables = this.getMemberVariables();
|
|
88238
88238
|
const members = Object.entries(memberVariables).filter(([_2, variable]) => variable.included).map(([name2, variable]) => {
|
|
88239
88239
|
if (this.referencedEarly || variable.isReassigned || variable === this) {
|
|
@@ -88259,7 +88259,7 @@ var require_rollup = __commonJS({
|
|
|
88259
88259
|
}
|
|
88260
88260
|
const name = this.getName(getPropertyAccess);
|
|
88261
88261
|
output = `${cnst} ${name}${_}=${_}${output};`;
|
|
88262
|
-
if (
|
|
88262
|
+
if (format2 === "system" && exportNamesByVariable.has(this)) {
|
|
88263
88263
|
output += `${n2}${getSystemExportStatement([this], options)};`;
|
|
88264
88264
|
}
|
|
88265
88265
|
return output;
|
|
@@ -90155,15 +90155,15 @@ ${outro}`;
|
|
|
90155
90155
|
system: deconflictImportsEsmOrSystem,
|
|
90156
90156
|
umd: deconflictImportsOther
|
|
90157
90157
|
};
|
|
90158
|
-
function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames,
|
|
90158
|
+
function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format2, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) {
|
|
90159
90159
|
const reversedModules = [...modules].reverse();
|
|
90160
90160
|
for (const module3 of reversedModules) {
|
|
90161
|
-
module3.scope.addUsedOutsideNames(usedNames,
|
|
90161
|
+
module3.scope.addUsedOutsideNames(usedNames, format2, exportNamesByVariable, accessedGlobalsByScope);
|
|
90162
90162
|
}
|
|
90163
90163
|
deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces);
|
|
90164
|
-
DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[
|
|
90164
|
+
DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format2](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports);
|
|
90165
90165
|
for (const module3 of reversedModules) {
|
|
90166
|
-
module3.scope.deconflict(
|
|
90166
|
+
module3.scope.deconflict(format2, exportNamesByVariable, accessedGlobalsByScope);
|
|
90167
90167
|
}
|
|
90168
90168
|
}
|
|
90169
90169
|
function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop, preserveModules, _externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports) {
|
|
@@ -90269,7 +90269,7 @@ ${outro}`;
|
|
|
90269
90269
|
exportNamesByVariable.set(variable, [exportName]);
|
|
90270
90270
|
}
|
|
90271
90271
|
}
|
|
90272
|
-
function getExportMode(chunk, { exports: exportMode, name, format:
|
|
90272
|
+
function getExportMode(chunk, { exports: exportMode, name, format: format2 }, facadeModuleId, log) {
|
|
90273
90273
|
const exportKeys = chunk.getExportNames();
|
|
90274
90274
|
if (exportMode === "default") {
|
|
90275
90275
|
if (exportKeys.length !== 1 || exportKeys[0] !== "default") {
|
|
@@ -90284,7 +90284,7 @@ ${outro}`;
|
|
|
90284
90284
|
} else if (exportKeys.length === 1 && exportKeys[0] === "default") {
|
|
90285
90285
|
exportMode = "default";
|
|
90286
90286
|
} else {
|
|
90287
|
-
if (
|
|
90287
|
+
if (format2 !== "es" && format2 !== "system" && exportKeys.includes("default")) {
|
|
90288
90288
|
log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMixedExport(facadeModuleId, name));
|
|
90289
90289
|
}
|
|
90290
90290
|
exportMode = "named";
|
|
@@ -90604,13 +90604,13 @@ ${outro}`;
|
|
|
90604
90604
|
}
|
|
90605
90605
|
let fileName;
|
|
90606
90606
|
let hashPlaceholder = null;
|
|
90607
|
-
const { chunkFileNames, entryFileNames, file, format:
|
|
90607
|
+
const { chunkFileNames, entryFileNames, file, format: format2, preserveModules } = this.outputOptions;
|
|
90608
90608
|
if (file) {
|
|
90609
90609
|
fileName = node_path.basename(file);
|
|
90610
90610
|
} else if (this.fileName === null) {
|
|
90611
90611
|
const [pattern, patternName] = preserveModules || this.facadeModule?.isUserDefinedEntryPoint ? [entryFileNames, "output.entryFileNames"] : [chunkFileNames, "output.chunkFileNames"];
|
|
90612
90612
|
fileName = renderNamePattern(typeof pattern === "function" ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, {
|
|
90613
|
-
format: () =>
|
|
90613
|
+
format: () => format2,
|
|
90614
90614
|
hash: (size) => hashPlaceholder || (hashPlaceholder = this.getPlaceholder(patternName, size)),
|
|
90615
90615
|
name: () => this.getChunkName()
|
|
90616
90616
|
});
|
|
@@ -90631,12 +90631,12 @@ ${outro}`;
|
|
|
90631
90631
|
}
|
|
90632
90632
|
let sourcemapFileName = null;
|
|
90633
90633
|
let hashPlaceholder = null;
|
|
90634
|
-
const { sourcemapFileNames, format:
|
|
90634
|
+
const { sourcemapFileNames, format: format2 } = this.outputOptions;
|
|
90635
90635
|
if (sourcemapFileNames) {
|
|
90636
90636
|
const [pattern, patternName] = [sourcemapFileNames, "output.sourcemapFileNames"];
|
|
90637
90637
|
sourcemapFileName = renderNamePattern(typeof pattern === "function" ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, {
|
|
90638
90638
|
chunkhash: () => this.getPreliminaryFileName().hashPlaceholder || "",
|
|
90639
|
-
format: () =>
|
|
90639
|
+
format: () => format2,
|
|
90640
90640
|
hash: (size) => hashPlaceholder || (hashPlaceholder = this.getPlaceholder(patternName, size)),
|
|
90641
90641
|
name: () => this.getChunkName()
|
|
90642
90642
|
});
|
|
@@ -90680,7 +90680,7 @@ ${outro}`;
|
|
|
90680
90680
|
}
|
|
90681
90681
|
async render() {
|
|
90682
90682
|
const { dependencies, exportMode, facadeModule, inputOptions: { onLog }, outputOptions, pluginDriver, snippets } = this;
|
|
90683
|
-
const { format:
|
|
90683
|
+
const { format: format2, hoistTransitiveImports, preserveModules } = outputOptions;
|
|
90684
90684
|
if (hoistTransitiveImports && !preserveModules && facadeModule !== null) {
|
|
90685
90685
|
for (const dep of dependencies) {
|
|
90686
90686
|
if (dep instanceof _Chunk)
|
|
@@ -90691,7 +90691,7 @@ ${outro}`;
|
|
|
90691
90691
|
const preliminarySourcemapFileName = this.getPreliminarySourcemapFileName();
|
|
90692
90692
|
const { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait } = this.renderModules(preliminaryFileName.fileName);
|
|
90693
90693
|
const renderedDependencies = [...this.getRenderedDependencies().values()];
|
|
90694
|
-
const renderedExports = exportMode === "none" ? [] : this.getChunkExportDeclarations(
|
|
90694
|
+
const renderedExports = exportMode === "none" ? [] : this.getChunkExportDeclarations(format2);
|
|
90695
90695
|
let hasExports = renderedExports.length > 0;
|
|
90696
90696
|
let hasDefaultExport = false;
|
|
90697
90697
|
for (const renderedDependence of renderedDependencies) {
|
|
@@ -90701,7 +90701,7 @@ ${outro}`;
|
|
|
90701
90701
|
if (!hasDefaultExport && reexports.some((reexport) => reexport.reexported === "default")) {
|
|
90702
90702
|
hasDefaultExport = true;
|
|
90703
90703
|
}
|
|
90704
|
-
if (
|
|
90704
|
+
if (format2 === "es") {
|
|
90705
90705
|
renderedDependence.reexports = reexports.filter(
|
|
90706
90706
|
// eslint-disable-next-line unicorn/prefer-array-some
|
|
90707
90707
|
({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported)
|
|
@@ -90718,7 +90718,7 @@ ${outro}`;
|
|
|
90718
90718
|
}
|
|
90719
90719
|
}
|
|
90720
90720
|
const { intro, outro, banner, footer } = await createAddons(outputOptions, pluginDriver, this.getRenderedChunkInfo());
|
|
90721
|
-
finalisers[
|
|
90721
|
+
finalisers[format2](renderedSource, {
|
|
90722
90722
|
accessedGlobals,
|
|
90723
90723
|
dependencies: renderedDependencies,
|
|
90724
90724
|
exports: renderedExports,
|
|
@@ -90737,7 +90737,7 @@ ${outro}`;
|
|
|
90737
90737
|
}, outputOptions);
|
|
90738
90738
|
if (banner)
|
|
90739
90739
|
magicString.prepend(banner);
|
|
90740
|
-
if (
|
|
90740
|
+
if (format2 === "es" || format2 === "cjs") {
|
|
90741
90741
|
const shebang = facadeModule !== null && facadeModule.info.isEntry && facadeModule.shebang;
|
|
90742
90742
|
shebang && magicString.prepend(`#!${shebang}
|
|
90743
90743
|
`);
|
|
@@ -90836,7 +90836,7 @@ ${outro}`;
|
|
|
90836
90836
|
}
|
|
90837
90837
|
return "chunk";
|
|
90838
90838
|
}
|
|
90839
|
-
getChunkExportDeclarations(
|
|
90839
|
+
getChunkExportDeclarations(format2) {
|
|
90840
90840
|
const exports2 = [];
|
|
90841
90841
|
for (const exportName of this.getExportNames()) {
|
|
90842
90842
|
if (exportName[0] === "*")
|
|
@@ -90847,7 +90847,7 @@ ${outro}`;
|
|
|
90847
90847
|
if (module3) {
|
|
90848
90848
|
const chunk = this.chunkByModule.get(module3);
|
|
90849
90849
|
if (chunk !== this) {
|
|
90850
|
-
if (!chunk ||
|
|
90850
|
+
if (!chunk || format2 !== "es") {
|
|
90851
90851
|
continue;
|
|
90852
90852
|
}
|
|
90853
90853
|
const chunkDep = this.renderedDependencies.get(chunk);
|
|
@@ -90875,7 +90875,7 @@ ${outro}`;
|
|
|
90875
90875
|
}
|
|
90876
90876
|
} else if (variable instanceof SyntheticNamedExportVariable) {
|
|
90877
90877
|
expression = local;
|
|
90878
|
-
if (
|
|
90878
|
+
if (format2 === "es") {
|
|
90879
90879
|
local = variable.renderName;
|
|
90880
90880
|
}
|
|
90881
90881
|
}
|
|
@@ -91127,7 +91127,7 @@ ${outro}`;
|
|
|
91127
91127
|
// This method changes properties on the AST before rendering and must not be async
|
|
91128
91128
|
renderModules(fileName) {
|
|
91129
91129
|
const { accessedGlobalsByScope, dependencies, exportNamesByVariable, includedNamespaces, inputOptions: { onLog }, isEmpty, orderedModules, outputOptions, pluginDriver, renderedModules, snippets } = this;
|
|
91130
|
-
const { compact, format:
|
|
91130
|
+
const { compact, format: format2, freeze, generatedCode: { symbols } } = outputOptions;
|
|
91131
91131
|
const { _, cnst, n: n2 } = snippets;
|
|
91132
91132
|
this.setDynamicImportResolutions(fileName);
|
|
91133
91133
|
this.setImportMetaResolutions(fileName);
|
|
@@ -91141,7 +91141,7 @@ ${outro}`;
|
|
|
91141
91141
|
const renderOptions = {
|
|
91142
91142
|
accessedDocumentCurrentScript: false,
|
|
91143
91143
|
exportNamesByVariable,
|
|
91144
|
-
format:
|
|
91144
|
+
format: format2,
|
|
91145
91145
|
freeze,
|
|
91146
91146
|
indent,
|
|
91147
91147
|
pluginDriver,
|
|
@@ -91155,7 +91155,7 @@ ${outro}`;
|
|
|
91155
91155
|
let source;
|
|
91156
91156
|
if (module3.isIncluded() || includedNamespaces.has(module3)) {
|
|
91157
91157
|
const rendered = module3.render(renderOptions);
|
|
91158
|
-
if (!renderOptions.accessedDocumentCurrentScript && formatsMaybeAccessDocumentCurrentScript.includes(
|
|
91158
|
+
if (!renderOptions.accessedDocumentCurrentScript && formatsMaybeAccessDocumentCurrentScript.includes(format2)) {
|
|
91159
91159
|
this.accessedGlobalsByScope.get(module3.scope)?.delete(DOCUMENT_CURRENT_SCRIPT);
|
|
91160
91160
|
}
|
|
91161
91161
|
renderOptions.accessedDocumentCurrentScript = false;
|
|
@@ -91224,11 +91224,11 @@ ${outro}`;
|
|
|
91224
91224
|
}
|
|
91225
91225
|
}
|
|
91226
91226
|
setIdentifierRenderResolutions() {
|
|
91227
|
-
const { format:
|
|
91227
|
+
const { format: format2, generatedCode: { symbols }, interop, preserveModules, externalLiveBindings } = this.outputOptions;
|
|
91228
91228
|
const syntheticExports = /* @__PURE__ */ new Set();
|
|
91229
91229
|
for (const exportName of this.getExportNames()) {
|
|
91230
91230
|
const exportVariable = this.exportsByName.get(exportName);
|
|
91231
|
-
if (
|
|
91231
|
+
if (format2 !== "es" && format2 !== "system" && exportVariable.isReassigned && !exportVariable.isId) {
|
|
91232
91232
|
exportVariable.setRenderNames("exports", exportName);
|
|
91233
91233
|
} else if (exportVariable instanceof SyntheticNamedExportVariable) {
|
|
91234
91234
|
syntheticExports.add(exportVariable);
|
|
@@ -91249,7 +91249,7 @@ ${outro}`;
|
|
|
91249
91249
|
if (symbols) {
|
|
91250
91250
|
usedNames.add("Symbol");
|
|
91251
91251
|
}
|
|
91252
|
-
switch (
|
|
91252
|
+
switch (format2) {
|
|
91253
91253
|
case "system": {
|
|
91254
91254
|
usedNames.add("module").add("exports");
|
|
91255
91255
|
break;
|
|
@@ -91267,13 +91267,13 @@ ${outro}`;
|
|
|
91267
91267
|
}
|
|
91268
91268
|
}
|
|
91269
91269
|
}
|
|
91270
|
-
deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(
|
|
91270
|
+
deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(format2 !== "es" && format2 !== "system", format2 === "amd" || format2 === "umd" || format2 === "iife", interop), this.imports, usedNames, format2, interop, preserveModules, externalLiveBindings, this.chunkByModule, this.externalChunkByModule, syntheticExports, this.exportNamesByVariable, this.accessedGlobalsByScope, this.includedNamespaces);
|
|
91271
91271
|
}
|
|
91272
91272
|
setImportMetaResolutions(fileName) {
|
|
91273
|
-
const { accessedGlobalsByScope, includedNamespaces, orderedModules, outputOptions: { format:
|
|
91273
|
+
const { accessedGlobalsByScope, includedNamespaces, orderedModules, outputOptions: { format: format2 } } = this;
|
|
91274
91274
|
for (const module3 of orderedModules) {
|
|
91275
91275
|
for (const importMeta of module3.importMetas) {
|
|
91276
|
-
importMeta.setResolution(
|
|
91276
|
+
importMeta.setResolution(format2, accessedGlobalsByScope, fileName);
|
|
91277
91277
|
}
|
|
91278
91278
|
if (includedNamespaces.has(module3)) {
|
|
91279
91279
|
module3.namespace.prepare(accessedGlobalsByScope);
|
|
@@ -93340,7 +93340,7 @@ ${outro}`;
|
|
|
93340
93340
|
async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
|
|
93341
93341
|
const unsetOptions = new Set(unsetInputOptions);
|
|
93342
93342
|
const compact = config.compact || false;
|
|
93343
|
-
const
|
|
93343
|
+
const format2 = getFormat(config);
|
|
93344
93344
|
const inlineDynamicImports = getInlineDynamicImports(config, inputOptions);
|
|
93345
93345
|
const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions);
|
|
93346
93346
|
const file = getFile(config, preserveModules, inputOptions);
|
|
@@ -93364,7 +93364,7 @@ ${outro}`;
|
|
|
93364
93364
|
externalLiveBindings: config.externalLiveBindings ?? true,
|
|
93365
93365
|
file,
|
|
93366
93366
|
footer: getAddon(config, "footer"),
|
|
93367
|
-
format:
|
|
93367
|
+
format: format2,
|
|
93368
93368
|
freeze: config.freeze ?? true,
|
|
93369
93369
|
generatedCode,
|
|
93370
93370
|
globals: config.globals || {},
|
|
@@ -93374,7 +93374,7 @@ ${outro}`;
|
|
|
93374
93374
|
interop: getInterop(config),
|
|
93375
93375
|
intro: getAddon(config, "intro"),
|
|
93376
93376
|
manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules),
|
|
93377
|
-
minifyInternalExports: getMinifyInternalExports(config,
|
|
93377
|
+
minifyInternalExports: getMinifyInternalExports(config, format2, compact),
|
|
93378
93378
|
name: config.name,
|
|
93379
93379
|
noConflict: config.noConflict || false,
|
|
93380
93380
|
outro: getAddon(config, "outro"),
|
|
@@ -93581,7 +93581,7 @@ ${outro}`;
|
|
|
93581
93581
|
}
|
|
93582
93582
|
return configManualChunks || {};
|
|
93583
93583
|
};
|
|
93584
|
-
var getMinifyInternalExports = (config,
|
|
93584
|
+
var getMinifyInternalExports = (config, format2, compact) => config.minifyInternalExports ?? (compact || format2 === "es" || format2 === "system");
|
|
93585
93585
|
var getSourcemapFileNames = (config, unsetOptions) => {
|
|
93586
93586
|
const configSourcemapFileNames = config.sourcemapFileNames;
|
|
93587
93587
|
if (configSourcemapFileNames == null) {
|
|
@@ -94743,7 +94743,7 @@ var require_shared = __commonJS({
|
|
|
94743
94743
|
let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
|
94744
94744
|
let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
|
94745
94745
|
let toNumber = padded === false && stringify$3(start, end, options) === false;
|
|
94746
|
-
let
|
|
94746
|
+
let format2 = options.transform || transform(toNumber);
|
|
94747
94747
|
if (options.toRegex && step === 1) {
|
|
94748
94748
|
return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
|
|
94749
94749
|
}
|
|
@@ -94755,7 +94755,7 @@ var require_shared = __commonJS({
|
|
|
94755
94755
|
if (options.toRegex === true && step > 1) {
|
|
94756
94756
|
push(a);
|
|
94757
94757
|
} else {
|
|
94758
|
-
range.push(pad(
|
|
94758
|
+
range.push(pad(format2(a, index), maxLen, toNumber));
|
|
94759
94759
|
}
|
|
94760
94760
|
a = descending ? a - step : a + step;
|
|
94761
94761
|
index++;
|
|
@@ -94769,7 +94769,7 @@ var require_shared = __commonJS({
|
|
|
94769
94769
|
if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
|
|
94770
94770
|
return invalidRange(start, end, options);
|
|
94771
94771
|
}
|
|
94772
|
-
let
|
|
94772
|
+
let format2 = options.transform || ((val) => String.fromCharCode(val));
|
|
94773
94773
|
let a = `${start}`.charCodeAt(0);
|
|
94774
94774
|
let b = `${end}`.charCodeAt(0);
|
|
94775
94775
|
let descending = a > b;
|
|
@@ -94781,7 +94781,7 @@ var require_shared = __commonJS({
|
|
|
94781
94781
|
let range = [];
|
|
94782
94782
|
let index = 0;
|
|
94783
94783
|
while (descending ? a >= b : a <= b) {
|
|
94784
|
-
range.push(
|
|
94784
|
+
range.push(format2(a, index));
|
|
94785
94785
|
a = descending ? a - step : a + step;
|
|
94786
94786
|
index++;
|
|
94787
94787
|
}
|
|
@@ -95604,7 +95604,7 @@ var require_shared = __commonJS({
|
|
|
95604
95604
|
var isBinaryPath$1 = (filePath) => extensions.has(path4.extname(filePath).slice(1).toLowerCase());
|
|
95605
95605
|
var constants3 = {};
|
|
95606
95606
|
(function(exports2) {
|
|
95607
|
-
const { sep:
|
|
95607
|
+
const { sep: sep3 } = require$$0$2;
|
|
95608
95608
|
const { platform } = process;
|
|
95609
95609
|
const os2 = require$$2$1;
|
|
95610
95610
|
exports2.EV_ALL = "all";
|
|
@@ -95632,7 +95632,7 @@ var require_shared = __commonJS({
|
|
|
95632
95632
|
exports2.KEY_ERR = "errHandlers";
|
|
95633
95633
|
exports2.KEY_RAW = "rawEmitters";
|
|
95634
95634
|
exports2.HANDLER_KEYS = [exports2.KEY_LISTENERS, exports2.KEY_ERR, exports2.KEY_RAW];
|
|
95635
|
-
exports2.DOT_SLASH = `.${
|
|
95635
|
+
exports2.DOT_SLASH = `.${sep3}`;
|
|
95636
95636
|
exports2.BACK_SLASH_RE = /\\/g;
|
|
95637
95637
|
exports2.DOUBLE_SLASH_RE = /\/\//;
|
|
95638
95638
|
exports2.SLASH_OR_BACK_SLASH_RE = /[/\\]/;
|
|
@@ -98390,7 +98390,7 @@ var require_is_binary_path = __commonJS({
|
|
|
98390
98390
|
var require_constants5 = __commonJS({
|
|
98391
98391
|
"node_modules/.pnpm/chokidar@3.5.3/node_modules/chokidar/lib/constants.js"(exports) {
|
|
98392
98392
|
"use strict";
|
|
98393
|
-
var { sep:
|
|
98393
|
+
var { sep: sep3 } = require("path");
|
|
98394
98394
|
var { platform } = process;
|
|
98395
98395
|
var os2 = require("os");
|
|
98396
98396
|
exports.EV_ALL = "all";
|
|
@@ -98418,7 +98418,7 @@ var require_constants5 = __commonJS({
|
|
|
98418
98418
|
exports.KEY_ERR = "errHandlers";
|
|
98419
98419
|
exports.KEY_RAW = "rawEmitters";
|
|
98420
98420
|
exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW];
|
|
98421
|
-
exports.DOT_SLASH = `.${
|
|
98421
|
+
exports.DOT_SLASH = `.${sep3}`;
|
|
98422
98422
|
exports.BACK_SLASH_RE = /\\/g;
|
|
98423
98423
|
exports.DOUBLE_SLASH_RE = /\/\//;
|
|
98424
98424
|
exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/;
|
|
@@ -101781,10 +101781,10 @@ var require_dist6 = __commonJS({
|
|
|
101781
101781
|
}
|
|
101782
101782
|
};
|
|
101783
101783
|
};
|
|
101784
|
-
var getOutputExtensionMap = (options,
|
|
101784
|
+
var getOutputExtensionMap = (options, format2, pkgType) => {
|
|
101785
101785
|
const outExtension2 = options.outExtension || _chunkGQ77QZBOjs.defaultOutExtension;
|
|
101786
|
-
const defaultExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format:
|
|
101787
|
-
const extension = outExtension2({ options, format:
|
|
101786
|
+
const defaultExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format: format2, pkgType });
|
|
101787
|
+
const extension = outExtension2({ options, format: format2, pkgType });
|
|
101788
101788
|
return {
|
|
101789
101789
|
".js": extension.js || defaultExtension.js
|
|
101790
101790
|
};
|
|
@@ -101803,9 +101803,9 @@ var require_dist6 = __commonJS({
|
|
|
101803
101803
|
}
|
|
101804
101804
|
return result;
|
|
101805
101805
|
};
|
|
101806
|
-
var packageJsonSearch = (outDir, silent,
|
|
101806
|
+
var packageJsonSearch = (outDir, silent, format2, logger3) => {
|
|
101807
101807
|
let pkgPath = outDir ? outDir : process.cwd();
|
|
101808
|
-
!silent && logger3 && logger3.info(
|
|
101808
|
+
!silent && logger3 && logger3.info(format2, `\u26A1 Beginning search for package.json file: ${pkgPath}`);
|
|
101809
101809
|
if (pkgPath) {
|
|
101810
101810
|
const splits = pkgPath.includes("\\") ? pkgPath.split("\\") : pkgPath.split("/");
|
|
101811
101811
|
if (splits.length > 0) {
|
|
@@ -101818,12 +101818,12 @@ var require_dist6 = __commonJS({
|
|
|
101818
101818
|
"package.json"
|
|
101819
101819
|
);
|
|
101820
101820
|
!silent && logger3 && logger3.info(
|
|
101821
|
-
|
|
101821
|
+
format2,
|
|
101822
101822
|
`\u26A1 Searching for package.json file in ${packageJsonPath} (index: ${i})`
|
|
101823
101823
|
);
|
|
101824
101824
|
if (_fs2.default.existsSync(packageJsonPath)) {
|
|
101825
101825
|
!silent && logger3 && logger3.info(
|
|
101826
|
-
|
|
101826
|
+
format2,
|
|
101827
101827
|
`\u26A1 Found the package.json file in ${packageJsonPath} (index: ${i})`
|
|
101828
101828
|
);
|
|
101829
101829
|
pkgPath = packageJsonPath.replace("package.json", "");
|
|
@@ -101834,21 +101834,21 @@ var require_dist6 = __commonJS({
|
|
|
101834
101834
|
}
|
|
101835
101835
|
if (pkgPath === outDir) {
|
|
101836
101836
|
!silent && logger3 && logger3.info(
|
|
101837
|
-
|
|
101837
|
+
format2,
|
|
101838
101838
|
`\u26A1 No package.json file found, using ${pkgPath} as the output directory`
|
|
101839
101839
|
);
|
|
101840
101840
|
}
|
|
101841
101841
|
return pkgPath;
|
|
101842
101842
|
};
|
|
101843
101843
|
async function runEsbuild(options, {
|
|
101844
|
-
format:
|
|
101844
|
+
format: format2,
|
|
101845
101845
|
css,
|
|
101846
101846
|
logger: logger3,
|
|
101847
101847
|
buildDependencies,
|
|
101848
101848
|
pluginContainer
|
|
101849
101849
|
}) {
|
|
101850
|
-
const pkgPath = packageJsonSearch(options.outDir, options.silent,
|
|
101851
|
-
logger3.info(
|
|
101850
|
+
const pkgPath = packageJsonSearch(options.outDir, options.silent, format2, logger3);
|
|
101851
|
+
logger3.info(format2, `\u26A1 Running ESBuild: ${pkgPath}`);
|
|
101852
101852
|
const pkg = await _chunk7G76EW2Rjs.loadPkg.call(void 0, pkgPath);
|
|
101853
101853
|
const deps = await _chunk7G76EW2Rjs.getProductionDeps.call(void 0, pkgPath);
|
|
101854
101854
|
const external = [
|
|
@@ -101857,41 +101857,41 @@ var require_dist6 = __commonJS({
|
|
|
101857
101857
|
...await generateExternal(options.external || [], options, logger3)
|
|
101858
101858
|
];
|
|
101859
101859
|
const outDir = options.outDir;
|
|
101860
|
-
const outExtension2 = getOutputExtensionMap(options,
|
|
101860
|
+
const outExtension2 = getOutputExtensionMap(options, format2, pkg.type);
|
|
101861
101861
|
const env = {
|
|
101862
101862
|
...options.env
|
|
101863
101863
|
};
|
|
101864
101864
|
if (options.replaceNodeEnv) {
|
|
101865
101865
|
env.NODE_ENV = options.minify || options.minifyWhitespace ? "production" : "development";
|
|
101866
101866
|
}
|
|
101867
|
-
logger3.info(
|
|
101867
|
+
logger3.info(format2, "Build start");
|
|
101868
101868
|
const startTime = Date.now();
|
|
101869
101869
|
let result;
|
|
101870
|
-
const splitting =
|
|
101870
|
+
const splitting = format2 === "iife" ? false : typeof options.splitting === "boolean" ? options.splitting : format2 === "esm";
|
|
101871
101871
|
const platform = options.platform || "node";
|
|
101872
101872
|
const loader = options.loader || {};
|
|
101873
101873
|
const injectShims = options.shims;
|
|
101874
101874
|
pluginContainer.setContext({
|
|
101875
|
-
format:
|
|
101875
|
+
format: format2,
|
|
101876
101876
|
splitting,
|
|
101877
101877
|
options,
|
|
101878
101878
|
logger: logger3
|
|
101879
101879
|
});
|
|
101880
101880
|
await pluginContainer.buildStarted();
|
|
101881
101881
|
const esbuildPlugins = [
|
|
101882
|
-
|
|
101882
|
+
format2 === "cjs" && nodeProtocolPlugin(),
|
|
101883
101883
|
{
|
|
101884
101884
|
name: "modify-options",
|
|
101885
101885
|
setup(build22) {
|
|
101886
101886
|
pluginContainer.modifyEsbuildOptions(build22.initialOptions);
|
|
101887
101887
|
if (options.esbuildOptions) {
|
|
101888
|
-
options.esbuildOptions(build22.initialOptions, { format:
|
|
101888
|
+
options.esbuildOptions(build22.initialOptions, { format: format2 });
|
|
101889
101889
|
}
|
|
101890
101890
|
}
|
|
101891
101891
|
},
|
|
101892
101892
|
// esbuild's `external` option doesn't support RegExp
|
|
101893
101893
|
// So here we use a custom plugin to implement it
|
|
101894
|
-
|
|
101894
|
+
format2 !== "iife" && externalPlugin({
|
|
101895
101895
|
external,
|
|
101896
101896
|
noExternal: options.noExternal,
|
|
101897
101897
|
skipNodeModulesBundle: options.skipNodeModulesBundle,
|
|
@@ -101909,12 +101909,12 @@ var require_dist6 = __commonJS({
|
|
|
101909
101909
|
if (options.skipNativeModulesPlugin !== true) {
|
|
101910
101910
|
esbuildPlugins.push(nativeNodeModulesPlugin());
|
|
101911
101911
|
}
|
|
101912
|
-
const banner = typeof options.banner === "function" ? options.banner({ format:
|
|
101913
|
-
const footer = typeof options.footer === "function" ? options.footer({ format:
|
|
101912
|
+
const banner = typeof options.banner === "function" ? options.banner({ format: format2 }) : options.banner;
|
|
101913
|
+
const footer = typeof options.footer === "function" ? options.footer({ format: format2 }) : options.footer;
|
|
101914
101914
|
try {
|
|
101915
101915
|
result = await _esbuild.build.call(void 0, {
|
|
101916
101916
|
entryPoints: options.entry,
|
|
101917
|
-
format:
|
|
101917
|
+
format: format2 === "cjs" && splitting || options.treeshake ? "esm" : format2,
|
|
101918
101918
|
bundle: typeof options.bundle === "undefined" ? true : options.bundle,
|
|
101919
101919
|
platform,
|
|
101920
101920
|
globalName: options.globalName,
|
|
@@ -101953,8 +101953,8 @@ var require_dist6 = __commonJS({
|
|
|
101953
101953
|
mainFields: platform === "node" ? ["module", "main"] : ["browser", "module", "main"],
|
|
101954
101954
|
plugins: esbuildPlugins.filter(_chunkGQ77QZBOjs.truthy),
|
|
101955
101955
|
define: {
|
|
101956
|
-
TSUP_FORMAT: JSON.stringify(
|
|
101957
|
-
...
|
|
101956
|
+
TSUP_FORMAT: JSON.stringify(format2),
|
|
101957
|
+
...format2 === "cjs" && injectShims ? {
|
|
101958
101958
|
"import.meta.url": "importMetaUrl"
|
|
101959
101959
|
} : {},
|
|
101960
101960
|
...options.define,
|
|
@@ -101968,11 +101968,11 @@ var require_dist6 = __commonJS({
|
|
|
101968
101968
|
}, {})
|
|
101969
101969
|
},
|
|
101970
101970
|
inject: [
|
|
101971
|
-
|
|
101972
|
-
|
|
101971
|
+
format2 === "cjs" && injectShims ? _path2.default.join(__dirname, "../../../assets/cjs_shims.js") : "",
|
|
101972
|
+
format2 === "esm" && injectShims && platform === "node" ? _path2.default.join(__dirname, "../../../assets/esm_shims.js") : "",
|
|
101973
101973
|
...options.inject || []
|
|
101974
101974
|
].filter(Boolean),
|
|
101975
|
-
outdir: options.legacyOutput &&
|
|
101975
|
+
outdir: options.legacyOutput && format2 !== "cjs" ? _path2.default.join(outDir, format2) : outDir,
|
|
101976
101976
|
outExtension: options.legacyOutput ? void 0 : outExtension2,
|
|
101977
101977
|
write: false,
|
|
101978
101978
|
splitting,
|
|
@@ -101988,7 +101988,7 @@ var require_dist6 = __commonJS({
|
|
|
101988
101988
|
});
|
|
101989
101989
|
await new Promise((r) => setTimeout(r, 100));
|
|
101990
101990
|
} catch (error) {
|
|
101991
|
-
logger3.error(
|
|
101991
|
+
logger3.error(format2, "Build failed");
|
|
101992
101992
|
throw error;
|
|
101993
101993
|
}
|
|
101994
101994
|
if (result && result.warnings && !_chunk7G76EW2Rjs.getSilent.call(void 0)) {
|
|
@@ -102013,14 +102013,14 @@ var require_dist6 = __commonJS({
|
|
|
102013
102013
|
metafile: result.metafile
|
|
102014
102014
|
});
|
|
102015
102015
|
const timeInMs = Date.now() - startTime;
|
|
102016
|
-
logger3.success(
|
|
102016
|
+
logger3.success(format2, `\u26A1\uFE0F Build success in ${Math.floor(timeInMs)}ms`);
|
|
102017
102017
|
}
|
|
102018
102018
|
if (result.metafile) {
|
|
102019
102019
|
for (const file of Object.keys(result.metafile.inputs)) {
|
|
102020
102020
|
buildDependencies.add(file);
|
|
102021
102021
|
}
|
|
102022
102022
|
if (options.metafile) {
|
|
102023
|
-
const outPath = _path2.default.resolve(outDir, `metafile-${
|
|
102023
|
+
const outPath = _path2.default.resolve(outDir, `metafile-${format2}.json`);
|
|
102024
102024
|
await _fs2.default.promises.mkdir(_path2.default.dirname(outPath), { recursive: true });
|
|
102025
102025
|
await _fs2.default.promises.writeFile(
|
|
102026
102026
|
outPath,
|
|
@@ -102353,7 +102353,7 @@ var require_dist6 = __commonJS({
|
|
|
102353
102353
|
};
|
|
102354
102354
|
var terserPlugin = ({
|
|
102355
102355
|
minifyOptions,
|
|
102356
|
-
format:
|
|
102356
|
+
format: format2,
|
|
102357
102357
|
terserOptions = {},
|
|
102358
102358
|
globalName,
|
|
102359
102359
|
logger: logger3
|
|
@@ -102371,9 +102371,9 @@ var require_dist6 = __commonJS({
|
|
|
102371
102371
|
}
|
|
102372
102372
|
const { minify } = terser;
|
|
102373
102373
|
const defaultOptions = {};
|
|
102374
|
-
if (
|
|
102374
|
+
if (format2 === "esm") {
|
|
102375
102375
|
defaultOptions.module = true;
|
|
102376
|
-
} else if (!(
|
|
102376
|
+
} else if (!(format2 === "iife" && globalName !== void 0)) {
|
|
102377
102377
|
defaultOptions.toplevel = true;
|
|
102378
102378
|
}
|
|
102379
102379
|
try {
|
|
@@ -102689,14 +102689,14 @@ var require_dist6 = __commonJS({
|
|
|
102689
102689
|
);
|
|
102690
102690
|
}
|
|
102691
102691
|
}
|
|
102692
|
-
async function rollupDtsFiles(options, exports2,
|
|
102692
|
+
async function rollupDtsFiles(options, exports2, format2) {
|
|
102693
102693
|
let declarationDir = _chunkGQ77QZBOjs.ensureTempDeclarationDir.call(void 0, options);
|
|
102694
102694
|
let outDir = options.outDir || "dist";
|
|
102695
102695
|
let pkgPath = packageJsonSearch(outDir, options.silent, "dts", logger2);
|
|
102696
102696
|
!options.silent && logger2.info("dts", `\u26A1 Preparing to run Rollup (DTS generate): ${pkgPath}`);
|
|
102697
102697
|
!options.silent && logger2.info("dts", `\u26A1 Exports list to use in generation: ${exports2.map((e) => JSON.stringify(e)).join("\n")}`);
|
|
102698
102698
|
let pkg = await _chunk7G76EW2Rjs.loadPkg.call(void 0, pkgPath);
|
|
102699
|
-
let dtsExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format:
|
|
102699
|
+
let dtsExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format: format2, pkgType: pkg.type }).dts;
|
|
102700
102700
|
let dtsInputFilePath = _path2.default.join(
|
|
102701
102701
|
declarationDir,
|
|
102702
102702
|
"_tsup-dts-aggregation" + dtsExtension
|
|
@@ -102724,8 +102724,8 @@ var require_dist6 = __commonJS({
|
|
|
102724
102724
|
if (!exports2) {
|
|
102725
102725
|
throw new Error("Unexpected internal error: dts exports is not define");
|
|
102726
102726
|
}
|
|
102727
|
-
for (const
|
|
102728
|
-
await rollupDtsFiles(options, exports2,
|
|
102727
|
+
for (const format2 of options.format) {
|
|
102728
|
+
await rollupDtsFiles(options, exports2, format2);
|
|
102729
102729
|
}
|
|
102730
102730
|
logger2.success("dts", `\u26A1\uFE0F Build success in ${getDuration()}`);
|
|
102731
102731
|
} catch (error) {
|
|
@@ -102939,7 +102939,7 @@ var require_dist6 = __commonJS({
|
|
|
102939
102939
|
}
|
|
102940
102940
|
const css = /* @__PURE__ */ new Map();
|
|
102941
102941
|
await Promise.all([
|
|
102942
|
-
...options.format.map(async (
|
|
102942
|
+
...options.format.map(async (format2, index) => {
|
|
102943
102943
|
const pluginContainer = new PluginContainer([
|
|
102944
102944
|
shebang(),
|
|
102945
102945
|
...options.plugins || [],
|
|
@@ -102954,7 +102954,7 @@ var require_dist6 = __commonJS({
|
|
|
102954
102954
|
sizeReporter(),
|
|
102955
102955
|
terserPlugin({
|
|
102956
102956
|
minifyOptions: options.minify,
|
|
102957
|
-
format:
|
|
102957
|
+
format: format2,
|
|
102958
102958
|
terserOptions: options.terserOptions,
|
|
102959
102959
|
globalName: options.globalName,
|
|
102960
102960
|
logger: logger3
|
|
@@ -102962,7 +102962,7 @@ var require_dist6 = __commonJS({
|
|
|
102962
102962
|
]);
|
|
102963
102963
|
await runEsbuild(options, {
|
|
102964
102964
|
pluginContainer,
|
|
102965
|
-
format:
|
|
102965
|
+
format: format2,
|
|
102966
102966
|
css: index === 0 || options.injectStyle ? css : void 0,
|
|
102967
102967
|
logger: logger3,
|
|
102968
102968
|
buildDependencies
|
|
@@ -103063,7 +103063,8 @@ __export(executor_exports, {
|
|
|
103063
103063
|
tsupExecutorFn: () => tsupExecutorFn
|
|
103064
103064
|
});
|
|
103065
103065
|
module.exports = __toCommonJS(executor_exports);
|
|
103066
|
-
var
|
|
103066
|
+
var import_node_fs5 = require("node:fs");
|
|
103067
|
+
var import_promises3 = require("node:fs/promises");
|
|
103067
103068
|
var import_devkit3 = __toESM(require_devkit());
|
|
103068
103069
|
var import_js = __toESM(require_src());
|
|
103069
103070
|
|
|
@@ -113391,7 +113392,7 @@ var PathScurryBase = class {
|
|
|
113391
113392
|
*
|
|
113392
113393
|
* @internal
|
|
113393
113394
|
*/
|
|
113394
|
-
constructor(cwd = process.cwd(), pathImpl,
|
|
113395
|
+
constructor(cwd = process.cwd(), pathImpl, sep3, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS } = {}) {
|
|
113395
113396
|
this.#fs = fsFromOption(fs);
|
|
113396
113397
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
113397
113398
|
cwd = (0, import_url.fileURLToPath)(cwd);
|
|
@@ -113402,7 +113403,7 @@ var PathScurryBase = class {
|
|
|
113402
113403
|
this.#resolveCache = new ResolveCache();
|
|
113403
113404
|
this.#resolvePosixCache = new ResolveCache();
|
|
113404
113405
|
this.#children = new ChildrenCache(childrenCacheSize);
|
|
113405
|
-
const split = cwdPath.substring(this.rootPath.length).split(
|
|
113406
|
+
const split = cwdPath.substring(this.rootPath.length).split(sep3);
|
|
113406
113407
|
if (split.length === 1 && !split[0]) {
|
|
113407
113408
|
split.pop();
|
|
113408
113409
|
}
|
|
@@ -115025,7 +115026,7 @@ glob.glob = glob;
|
|
|
115025
115026
|
|
|
115026
115027
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
115027
115028
|
var import_fileutils = require("nx/src/utils/fileutils");
|
|
115028
|
-
var
|
|
115029
|
+
var import_prettier = require("prettier");
|
|
115029
115030
|
|
|
115030
115031
|
// packages/workspace-tools/src/utils/get-workspace-root.ts
|
|
115031
115032
|
var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
|
|
@@ -115200,9 +115201,15 @@ ${Object.keys(options).map((key) => ` - ${key}=${JSON.stringify(options[key])}`)
|
|
|
115200
115201
|
};
|
|
115201
115202
|
|
|
115202
115203
|
// packages/workspace-tools/src/utils/file-path-utils.ts
|
|
115204
|
+
var import_node_path5 = require("node:path");
|
|
115203
115205
|
var removeExtension = (filePath) => {
|
|
115204
115206
|
return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
|
|
115205
115207
|
};
|
|
115208
|
+
function findFileName(filePath) {
|
|
115209
|
+
return filePath?.split(
|
|
115210
|
+
filePath?.includes(import_node_path5.sep) ? import_node_path5.sep : filePath?.includes("/") ? "/" : "\\"
|
|
115211
|
+
)?.pop() ?? "";
|
|
115212
|
+
}
|
|
115206
115213
|
|
|
115207
115214
|
// packages/workspace-tools/src/utils/get-project-configurations.ts
|
|
115208
115215
|
var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
|
|
@@ -115222,9 +115229,7 @@ function getExternalDependencies(projectName, graph) {
|
|
|
115222
115229
|
}
|
|
115223
115230
|
|
|
115224
115231
|
// packages/workspace-tools/src/utils/run-tsup-build.ts
|
|
115225
|
-
var
|
|
115226
|
-
var import_promises3 = require("node:fs/promises");
|
|
115227
|
-
var import_node_path5 = require("node:path");
|
|
115232
|
+
var import_node_path6 = require("node:path");
|
|
115228
115233
|
var import_esbuild_decorators = __toESM(require_src2());
|
|
115229
115234
|
var import_devkit2 = __toESM(require_devkit());
|
|
115230
115235
|
var import_get_custom_transformers_factory = __toESM(require_get_custom_transformers_factory());
|
|
@@ -115272,7 +115277,6 @@ var environmentPlugin = (data) => ({
|
|
|
115272
115277
|
});
|
|
115273
115278
|
|
|
115274
115279
|
// packages/workspace-tools/src/utils/run-tsup-build.ts
|
|
115275
|
-
var import_prettier = require("prettier");
|
|
115276
115280
|
var import_tsup = __toESM(require_dist6());
|
|
115277
115281
|
var ts = __toESM(require("typescript"));
|
|
115278
115282
|
|
|
@@ -115286,7 +115290,7 @@ function defaultConfig({
|
|
|
115286
115290
|
tsconfig = "tsconfig.json",
|
|
115287
115291
|
splitting,
|
|
115288
115292
|
treeshake,
|
|
115289
|
-
format:
|
|
115293
|
+
format: format2 = ["cjs", "esm"],
|
|
115290
115294
|
debug = false,
|
|
115291
115295
|
shims = true,
|
|
115292
115296
|
external,
|
|
@@ -115309,7 +115313,7 @@ function defaultConfig({
|
|
|
115309
115313
|
return {
|
|
115310
115314
|
name: "default",
|
|
115311
115315
|
entry,
|
|
115312
|
-
format:
|
|
115316
|
+
format: format2,
|
|
115313
115317
|
target: platform !== "node" ? ["chrome91", "firefox90", "edge91", "safari15", "ios15", "opera77", "esnext"] : ["esnext", "node20"],
|
|
115314
115318
|
tsconfig,
|
|
115315
115319
|
splitting,
|
|
@@ -115363,18 +115367,18 @@ function getConfig(workspaceRoot, projectRoot, getConfigFn, { outputPath, tsConf
|
|
|
115363
115367
|
platform
|
|
115364
115368
|
});
|
|
115365
115369
|
}
|
|
115366
|
-
var outExtension = ({ format:
|
|
115370
|
+
var outExtension = ({ format: format2 }) => {
|
|
115367
115371
|
let jsExtension = ".js";
|
|
115368
115372
|
let dtsExtension = ".d.ts";
|
|
115369
|
-
if (
|
|
115373
|
+
if (format2 === "cjs") {
|
|
115370
115374
|
jsExtension = ".cjs";
|
|
115371
115375
|
dtsExtension = ".d.cts";
|
|
115372
115376
|
}
|
|
115373
|
-
if (
|
|
115377
|
+
if (format2 === "esm") {
|
|
115374
115378
|
jsExtension = ".js";
|
|
115375
115379
|
dtsExtension = ".d.ts";
|
|
115376
115380
|
}
|
|
115377
|
-
if (
|
|
115381
|
+
if (format2 === "iife") {
|
|
115378
115382
|
jsExtension = ".global.js";
|
|
115379
115383
|
}
|
|
115380
115384
|
return {
|
|
@@ -115416,44 +115420,6 @@ var applyDefaultOptions = (options) => {
|
|
|
115416
115420
|
return options;
|
|
115417
115421
|
};
|
|
115418
115422
|
var runTsupBuild = async (context, config, options) => {
|
|
115419
|
-
if (options.includeSrc === true) {
|
|
115420
|
-
const files = globSync([
|
|
115421
|
-
(0, import_devkit2.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.ts"),
|
|
115422
|
-
(0, import_devkit2.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.tsx"),
|
|
115423
|
-
(0, import_devkit2.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.js"),
|
|
115424
|
-
(0, import_devkit2.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.jsx")
|
|
115425
|
-
]);
|
|
115426
|
-
await Promise.allSettled(
|
|
115427
|
-
files.map(
|
|
115428
|
-
async (file) => (0, import_promises3.writeFile)(
|
|
115429
|
-
file,
|
|
115430
|
-
await (0, import_prettier.format)(
|
|
115431
|
-
`${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
|
|
115432
|
-
|
|
115433
|
-
${(0, import_node_fs5.readFileSync)(file, "utf-8")}`,
|
|
115434
|
-
{
|
|
115435
|
-
...{
|
|
115436
|
-
plugins: ["prettier-plugin-packagejson"],
|
|
115437
|
-
trailingComma: "none",
|
|
115438
|
-
tabWidth: 2,
|
|
115439
|
-
semi: true,
|
|
115440
|
-
singleQuote: false,
|
|
115441
|
-
quoteProps: "preserve",
|
|
115442
|
-
insertPragma: false,
|
|
115443
|
-
bracketSameLine: true,
|
|
115444
|
-
printWidth: 80,
|
|
115445
|
-
bracketSpacing: true,
|
|
115446
|
-
arrowParens: "avoid",
|
|
115447
|
-
endOfLine: "lf"
|
|
115448
|
-
},
|
|
115449
|
-
parser: "typescript"
|
|
115450
|
-
}
|
|
115451
|
-
),
|
|
115452
|
-
"utf-8"
|
|
115453
|
-
)
|
|
115454
|
-
)
|
|
115455
|
-
);
|
|
115456
|
-
}
|
|
115457
115423
|
const stormEnv = Object.keys(options.env).filter((key) => key.startsWith("STORM_")).reduce((ret, key) => {
|
|
115458
115424
|
ret[key] = options.env[key];
|
|
115459
115425
|
return ret;
|
|
@@ -115482,7 +115448,7 @@ ${(0, import_node_fs5.readFileSync)(file, "utf-8")}`,
|
|
|
115482
115448
|
{
|
|
115483
115449
|
...options,
|
|
115484
115450
|
watch: false,
|
|
115485
|
-
main:
|
|
115451
|
+
main: context.entry,
|
|
115486
115452
|
transformers: []
|
|
115487
115453
|
},
|
|
115488
115454
|
config.workspaceRoot,
|
|
@@ -115548,7 +115514,7 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
115548
115514
|
}
|
|
115549
115515
|
},
|
|
115550
115516
|
ts.sys,
|
|
115551
|
-
(0,
|
|
115517
|
+
(0, import_node_path6.dirname)(options.tsConfig)
|
|
115552
115518
|
);
|
|
115553
115519
|
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
115554
115520
|
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|
|
@@ -115729,41 +115695,40 @@ ${externalDependencies.map((dep) => {
|
|
|
115729
115695
|
arrowParens: "avoid",
|
|
115730
115696
|
endOfLine: "lf"
|
|
115731
115697
|
};
|
|
115732
|
-
|
|
115698
|
+
let entryPoints = [];
|
|
115733
115699
|
if (options.entry) {
|
|
115734
115700
|
entryPoints.push(options.entry);
|
|
115735
115701
|
}
|
|
115736
115702
|
if (options.emitOnAll === true) {
|
|
115737
|
-
entryPoints
|
|
115703
|
+
entryPoints = globSync((0, import_devkit3.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"), {
|
|
115704
|
+
withFileTypes: true
|
|
115705
|
+
}).reduce((ret, filePath) => {
|
|
115706
|
+
let formattedPath = workspaceRoot.replaceAll("\\", "/");
|
|
115707
|
+
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
115708
|
+
formattedPath = formattedPath.substring(2);
|
|
115709
|
+
}
|
|
115710
|
+
let propertyKey = (0, import_devkit3.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
115711
|
+
if (propertyKey) {
|
|
115712
|
+
while (propertyKey.startsWith("/")) {
|
|
115713
|
+
propertyKey = propertyKey.substring(1);
|
|
115714
|
+
}
|
|
115715
|
+
writeDebug(
|
|
115716
|
+
config,
|
|
115717
|
+
`Trying to add entry point ${propertyKey} at "${(0, import_devkit3.joinPathFragments)(
|
|
115718
|
+
filePath.path,
|
|
115719
|
+
filePath.name
|
|
115720
|
+
)}"`
|
|
115721
|
+
);
|
|
115722
|
+
if (!ret.includes(propertyKey)) {
|
|
115723
|
+
ret.push((0, import_devkit3.joinPathFragments)(filePath.path, filePath.name));
|
|
115724
|
+
}
|
|
115725
|
+
}
|
|
115726
|
+
return ret;
|
|
115727
|
+
}, entryPoints);
|
|
115738
115728
|
}
|
|
115739
115729
|
if (options.additionalEntryPoints) {
|
|
115740
115730
|
entryPoints.push(...options.additionalEntryPoints);
|
|
115741
115731
|
}
|
|
115742
|
-
const entry = globSync(entryPoints, {
|
|
115743
|
-
withFileTypes: true
|
|
115744
|
-
}).reduce((ret, filePath) => {
|
|
115745
|
-
let formattedPath = workspaceRoot.replaceAll("\\", "/");
|
|
115746
|
-
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
115747
|
-
formattedPath = formattedPath.substring(2);
|
|
115748
|
-
}
|
|
115749
|
-
let propertyKey = (0, import_devkit3.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
115750
|
-
if (propertyKey) {
|
|
115751
|
-
while (propertyKey.startsWith("/")) {
|
|
115752
|
-
propertyKey = propertyKey.substring(1);
|
|
115753
|
-
}
|
|
115754
|
-
writeDebug(
|
|
115755
|
-
config,
|
|
115756
|
-
`Trying to add entry point ${propertyKey} at "${(0, import_devkit3.joinPathFragments)(
|
|
115757
|
-
filePath.path,
|
|
115758
|
-
filePath.name
|
|
115759
|
-
)}"`
|
|
115760
|
-
);
|
|
115761
|
-
if (!(propertyKey in ret)) {
|
|
115762
|
-
ret[propertyKey] = (0, import_devkit3.joinPathFragments)(filePath.path, filePath.name);
|
|
115763
|
-
}
|
|
115764
|
-
}
|
|
115765
|
-
return ret;
|
|
115766
|
-
}, {});
|
|
115767
115732
|
if (options.generatePackageJson !== false) {
|
|
115768
115733
|
const projectGraph = (0, import_devkit3.readCachedProjectGraph)();
|
|
115769
115734
|
packageJson.dependencies = void 0;
|
|
@@ -115803,37 +115768,26 @@ ${externalDependencies.map((dep) => {
|
|
|
115803
115768
|
},
|
|
115804
115769
|
"./package.json": "./package.json"
|
|
115805
115770
|
};
|
|
115806
|
-
for (const
|
|
115807
|
-
|
|
115771
|
+
for (const entryPoint of entryPoints) {
|
|
115772
|
+
let formattedEntryPoint = removeExtension(entryPoint).replace(sourceRoot, "");
|
|
115773
|
+
if (formattedEntryPoint.startsWith(".")) {
|
|
115774
|
+
formattedEntryPoint = formattedEntryPoint.substring(1);
|
|
115775
|
+
}
|
|
115776
|
+
if (formattedEntryPoint.startsWith("/")) {
|
|
115777
|
+
formattedEntryPoint = formattedEntryPoint.substring(1);
|
|
115778
|
+
}
|
|
115779
|
+
packageJson.exports[`./${formattedEntryPoint}`] = {
|
|
115808
115780
|
import: {
|
|
115809
|
-
types: `./${(0, import_devkit3.joinPathFragments)(
|
|
115810
|
-
|
|
115811
|
-
removeExtension(additionalEntryPoint).replace(sourceRoot, "")
|
|
115812
|
-
)}.d.ts`,
|
|
115813
|
-
default: `./${(0, import_devkit3.joinPathFragments)(
|
|
115814
|
-
distPaths[0],
|
|
115815
|
-
removeExtension(additionalEntryPoint).replace(sourceRoot, "")
|
|
115816
|
-
)}.js`
|
|
115781
|
+
types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.ts`,
|
|
115782
|
+
default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.js`
|
|
115817
115783
|
},
|
|
115818
115784
|
require: {
|
|
115819
|
-
types: `./${(0, import_devkit3.joinPathFragments)(
|
|
115820
|
-
|
|
115821
|
-
removeExtension(additionalEntryPoint).replace(sourceRoot, "")
|
|
115822
|
-
)}.d.cts`,
|
|
115823
|
-
default: `./${(0, import_devkit3.joinPathFragments)(
|
|
115824
|
-
distPaths[0],
|
|
115825
|
-
removeExtension(additionalEntryPoint).replace(sourceRoot, "")
|
|
115826
|
-
)}.cjs`
|
|
115785
|
+
types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.cts`,
|
|
115786
|
+
default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.cjs`
|
|
115827
115787
|
},
|
|
115828
115788
|
default: {
|
|
115829
|
-
types: `./${(0, import_devkit3.joinPathFragments)(
|
|
115830
|
-
|
|
115831
|
-
removeExtension(additionalEntryPoint).replace(sourceRoot, "")
|
|
115832
|
-
)}.d.ts`,
|
|
115833
|
-
default: `./${(0, import_devkit3.joinPathFragments)(
|
|
115834
|
-
distPaths[0],
|
|
115835
|
-
removeExtension(additionalEntryPoint).replace(sourceRoot, "")
|
|
115836
|
-
)}.js`
|
|
115789
|
+
types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.ts`,
|
|
115790
|
+
default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.js`
|
|
115837
115791
|
}
|
|
115838
115792
|
};
|
|
115839
115793
|
}
|
|
@@ -115874,9 +115828,9 @@ ${externalDependencies.map((dep) => {
|
|
|
115874
115828
|
packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_devkit3.joinPathFragments)("packages", context.projectName);
|
|
115875
115829
|
const packageJsonPath = (0, import_devkit3.joinPathFragments)(context.root, options.outputPath, "package.json");
|
|
115876
115830
|
writeDebug(config, `\u26A1 Writing package.json file to: ${packageJsonPath}`);
|
|
115877
|
-
(0,
|
|
115831
|
+
(0, import_node_fs5.writeFileSync)(
|
|
115878
115832
|
packageJsonPath,
|
|
115879
|
-
await (0,
|
|
115833
|
+
await (0, import_prettier.format)(JSON.stringify(packageJson), {
|
|
115880
115834
|
...prettierOptions,
|
|
115881
115835
|
parser: "json"
|
|
115882
115836
|
})
|
|
@@ -115884,15 +115838,51 @@ ${externalDependencies.map((dep) => {
|
|
|
115884
115838
|
} else {
|
|
115885
115839
|
writeWarning(config, "Skipping writing to package.json file");
|
|
115886
115840
|
}
|
|
115887
|
-
|
|
115888
|
-
|
|
115889
|
-
|
|
115890
|
-
|
|
115891
|
-
|
|
115892
|
-
|
|
115893
|
-
|
|
115894
|
-
|
|
115895
|
-
|
|
115841
|
+
if (options.includeSrc === true) {
|
|
115842
|
+
const files = globSync([
|
|
115843
|
+
(0, import_devkit3.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.ts"),
|
|
115844
|
+
(0, import_devkit3.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.tsx"),
|
|
115845
|
+
(0, import_devkit3.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.js"),
|
|
115846
|
+
(0, import_devkit3.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.jsx")
|
|
115847
|
+
]);
|
|
115848
|
+
await Promise.allSettled(
|
|
115849
|
+
files.map(
|
|
115850
|
+
async (file) => (0, import_promises3.writeFile)(
|
|
115851
|
+
file,
|
|
115852
|
+
await (0, import_prettier.format)(
|
|
115853
|
+
`${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
|
|
115854
|
+
|
|
115855
|
+
${(0, import_node_fs5.readFileSync)(file, "utf-8")}`,
|
|
115856
|
+
{
|
|
115857
|
+
...prettierOptions,
|
|
115858
|
+
parser: "typescript"
|
|
115859
|
+
}
|
|
115860
|
+
),
|
|
115861
|
+
"utf-8"
|
|
115862
|
+
)
|
|
115863
|
+
)
|
|
115864
|
+
);
|
|
115865
|
+
}
|
|
115866
|
+
Promise.all(
|
|
115867
|
+
entryPoints.map(
|
|
115868
|
+
(entryPoint) => runTsupBuild(
|
|
115869
|
+
{
|
|
115870
|
+
entry: entryPoint,
|
|
115871
|
+
projectRoot,
|
|
115872
|
+
projectName: context.projectName,
|
|
115873
|
+
sourceRoot
|
|
115874
|
+
},
|
|
115875
|
+
config,
|
|
115876
|
+
{
|
|
115877
|
+
...options,
|
|
115878
|
+
outputPath: (0, import_devkit3.joinPathFragments)(
|
|
115879
|
+
config.workspaceRoot,
|
|
115880
|
+
options.outputPath,
|
|
115881
|
+
removeExtension(entryPoint).replace(sourceRoot, "").replace(findFileName(entryPoint), "")
|
|
115882
|
+
)
|
|
115883
|
+
}
|
|
115884
|
+
)
|
|
115885
|
+
)
|
|
115896
115886
|
);
|
|
115897
115887
|
writeSuccess(config, "\u26A1 The Build process has completed successfully");
|
|
115898
115888
|
return {
|