@storm-software/workspace-tools 1.49.11 → 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 +24 -0
- package/index.js +576 -614
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/tsup/executor.js +260 -294
- package/src/executors/tsup-browser/executor.js +684 -716
- package/src/executors/tsup-neutral/executor.js +684 -716
- package/src/executors/tsup-node/executor.js +684 -716
- package/src/utils/index.js +2418 -8784
package/index.js
CHANGED
|
@@ -28113,8 +28113,8 @@ var require_prompt = __commonJS({
|
|
|
28113
28113
|
return this.skipped;
|
|
28114
28114
|
}
|
|
28115
28115
|
async initialize() {
|
|
28116
|
-
let { format:
|
|
28117
|
-
this.format = () =>
|
|
28116
|
+
let { format: format2, options, result } = this;
|
|
28117
|
+
this.format = () => format2.call(this, this.value);
|
|
28118
28118
|
this.result = () => result.call(this, this.value);
|
|
28119
28119
|
if (typeof options.initial === "function") {
|
|
28120
28120
|
this.initial = await options.initial.call(this, this);
|
|
@@ -30502,7 +30502,7 @@ var require_interpolate = __commonJS({
|
|
|
30502
30502
|
let defaults2 = { ...options.values, ...options.initial };
|
|
30503
30503
|
let { tabstops, items, keys } = await tokenize(options, defaults2);
|
|
30504
30504
|
let result = createFn("result", prompt, options);
|
|
30505
|
-
let
|
|
30505
|
+
let format2 = createFn("format", prompt, options);
|
|
30506
30506
|
let isValid2 = createFn("validate", prompt, options, true);
|
|
30507
30507
|
let isVal = prompt.isValue.bind(prompt);
|
|
30508
30508
|
return async (state = {}, submitted = false) => {
|
|
@@ -30547,7 +30547,7 @@ var require_interpolate = __commonJS({
|
|
|
30547
30547
|
}
|
|
30548
30548
|
item.placeholder = false;
|
|
30549
30549
|
let before = value;
|
|
30550
|
-
value = await
|
|
30550
|
+
value = await format2(value, state, item, index);
|
|
30551
30551
|
if (val !== value) {
|
|
30552
30552
|
state.values[key] = val;
|
|
30553
30553
|
value = prompt.styles.typing(val);
|
|
@@ -31380,13 +31380,13 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
31380
31380
|
}
|
|
31381
31381
|
validateName(options.name, options.projectNameAndRootFormat);
|
|
31382
31382
|
const formats = getProjectNameAndRootFormats(tree, options);
|
|
31383
|
-
const
|
|
31384
|
-
if (
|
|
31383
|
+
const format2 = options.projectNameAndRootFormat ?? await determineFormat(formats);
|
|
31384
|
+
if (format2 === "derived" && options.callingGenerator) {
|
|
31385
31385
|
logDeprecationMessage(options.callingGenerator, formats);
|
|
31386
31386
|
}
|
|
31387
31387
|
return {
|
|
31388
|
-
...formats[
|
|
31389
|
-
projectNameAndRootFormat:
|
|
31388
|
+
...formats[format2],
|
|
31389
|
+
projectNameAndRootFormat: format2
|
|
31390
31390
|
};
|
|
31391
31391
|
}
|
|
31392
31392
|
exports.determineProjectNameAndRootOptions = determineProjectNameAndRootOptions2;
|
|
@@ -31437,7 +31437,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
31437
31437
|
}
|
|
31438
31438
|
],
|
|
31439
31439
|
initial: "as-provided"
|
|
31440
|
-
}).then(({ format:
|
|
31440
|
+
}).then(({ format: format2 }) => format2 === asProvidedSelectedValue ? "as-provided" : "derived");
|
|
31441
31441
|
return result;
|
|
31442
31442
|
}
|
|
31443
31443
|
function getProjectNameAndRootFormats(tree, options) {
|
|
@@ -37089,7 +37089,7 @@ var require_fill_range = __commonJS({
|
|
|
37089
37089
|
let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
|
37090
37090
|
let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
|
37091
37091
|
let toNumber = padded === false && stringify(start, end, options) === false;
|
|
37092
|
-
let
|
|
37092
|
+
let format2 = options.transform || transform2(toNumber);
|
|
37093
37093
|
if (options.toRegex && step === 1) {
|
|
37094
37094
|
return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
|
|
37095
37095
|
}
|
|
@@ -37101,7 +37101,7 @@ var require_fill_range = __commonJS({
|
|
|
37101
37101
|
if (options.toRegex === true && step > 1) {
|
|
37102
37102
|
push(a);
|
|
37103
37103
|
} else {
|
|
37104
|
-
range.push(pad(
|
|
37104
|
+
range.push(pad(format2(a, index), maxLen, toNumber));
|
|
37105
37105
|
}
|
|
37106
37106
|
a = descending ? a - step : a + step;
|
|
37107
37107
|
index++;
|
|
@@ -37115,7 +37115,7 @@ var require_fill_range = __commonJS({
|
|
|
37115
37115
|
if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
|
|
37116
37116
|
return invalidRange(start, end, options);
|
|
37117
37117
|
}
|
|
37118
|
-
let
|
|
37118
|
+
let format2 = options.transform || ((val) => String.fromCharCode(val));
|
|
37119
37119
|
let a = `${start}`.charCodeAt(0);
|
|
37120
37120
|
let b = `${end}`.charCodeAt(0);
|
|
37121
37121
|
let descending = a > b;
|
|
@@ -37127,7 +37127,7 @@ var require_fill_range = __commonJS({
|
|
|
37127
37127
|
let range = [];
|
|
37128
37128
|
let index = 0;
|
|
37129
37129
|
while (descending ? a >= b : a <= b) {
|
|
37130
|
-
range.push(
|
|
37130
|
+
range.push(format2(a, index));
|
|
37131
37131
|
a = descending ? a - step : a + step;
|
|
37132
37132
|
index++;
|
|
37133
37133
|
}
|
|
@@ -39169,11 +39169,11 @@ var require_picomatch = __commonJS({
|
|
|
39169
39169
|
return { isMatch: false, output: "" };
|
|
39170
39170
|
}
|
|
39171
39171
|
const opts = options || {};
|
|
39172
|
-
const
|
|
39172
|
+
const format2 = opts.format || (posix2 ? utils.toPosixSlashes : null);
|
|
39173
39173
|
let match2 = input === glob2;
|
|
39174
|
-
let output = match2 &&
|
|
39174
|
+
let output = match2 && format2 ? format2(input) : input;
|
|
39175
39175
|
if (match2 === false) {
|
|
39176
|
-
output =
|
|
39176
|
+
output = format2 ? format2(input) : input;
|
|
39177
39177
|
match2 = output === glob2;
|
|
39178
39178
|
}
|
|
39179
39179
|
if (match2 === false || opts.capture === true) {
|
|
@@ -44530,157 +44530,6 @@ var require_normalize_options = __commonJS({
|
|
|
44530
44530
|
}
|
|
44531
44531
|
});
|
|
44532
44532
|
|
|
44533
|
-
// node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js
|
|
44534
|
-
var require_brace_expansion2 = __commonJS({
|
|
44535
|
-
"node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(exports, module2) {
|
|
44536
|
-
var balanced = require_balanced_match();
|
|
44537
|
-
module2.exports = expandTop;
|
|
44538
|
-
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
44539
|
-
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
44540
|
-
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
44541
|
-
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
44542
|
-
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
44543
|
-
function numeric(str) {
|
|
44544
|
-
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
|
44545
|
-
}
|
|
44546
|
-
function escapeBraces(str) {
|
|
44547
|
-
return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
|
44548
|
-
}
|
|
44549
|
-
function unescapeBraces(str) {
|
|
44550
|
-
return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
|
44551
|
-
}
|
|
44552
|
-
function parseCommaParts(str) {
|
|
44553
|
-
if (!str)
|
|
44554
|
-
return [""];
|
|
44555
|
-
var parts = [];
|
|
44556
|
-
var m = balanced("{", "}", str);
|
|
44557
|
-
if (!m)
|
|
44558
|
-
return str.split(",");
|
|
44559
|
-
var pre = m.pre;
|
|
44560
|
-
var body = m.body;
|
|
44561
|
-
var post = m.post;
|
|
44562
|
-
var p = pre.split(",");
|
|
44563
|
-
p[p.length - 1] += "{" + body + "}";
|
|
44564
|
-
var postParts = parseCommaParts(post);
|
|
44565
|
-
if (post.length) {
|
|
44566
|
-
p[p.length - 1] += postParts.shift();
|
|
44567
|
-
p.push.apply(p, postParts);
|
|
44568
|
-
}
|
|
44569
|
-
parts.push.apply(parts, p);
|
|
44570
|
-
return parts;
|
|
44571
|
-
}
|
|
44572
|
-
function expandTop(str) {
|
|
44573
|
-
if (!str)
|
|
44574
|
-
return [];
|
|
44575
|
-
if (str.substr(0, 2) === "{}") {
|
|
44576
|
-
str = "\\{\\}" + str.substr(2);
|
|
44577
|
-
}
|
|
44578
|
-
return expand2(escapeBraces(str), true).map(unescapeBraces);
|
|
44579
|
-
}
|
|
44580
|
-
function embrace(str) {
|
|
44581
|
-
return "{" + str + "}";
|
|
44582
|
-
}
|
|
44583
|
-
function isPadded(el) {
|
|
44584
|
-
return /^-?0\d/.test(el);
|
|
44585
|
-
}
|
|
44586
|
-
function lte(i, y) {
|
|
44587
|
-
return i <= y;
|
|
44588
|
-
}
|
|
44589
|
-
function gte(i, y) {
|
|
44590
|
-
return i >= y;
|
|
44591
|
-
}
|
|
44592
|
-
function expand2(str, isTop) {
|
|
44593
|
-
var expansions = [];
|
|
44594
|
-
var m = balanced("{", "}", str);
|
|
44595
|
-
if (!m)
|
|
44596
|
-
return [str];
|
|
44597
|
-
var pre = m.pre;
|
|
44598
|
-
var post = m.post.length ? expand2(m.post, false) : [""];
|
|
44599
|
-
if (/\$$/.test(m.pre)) {
|
|
44600
|
-
for (var k = 0; k < post.length; k++) {
|
|
44601
|
-
var expansion = pre + "{" + m.body + "}" + post[k];
|
|
44602
|
-
expansions.push(expansion);
|
|
44603
|
-
}
|
|
44604
|
-
} else {
|
|
44605
|
-
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
44606
|
-
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
44607
|
-
var isSequence = isNumericSequence || isAlphaSequence;
|
|
44608
|
-
var isOptions = m.body.indexOf(",") >= 0;
|
|
44609
|
-
if (!isSequence && !isOptions) {
|
|
44610
|
-
if (m.post.match(/,.*\}/)) {
|
|
44611
|
-
str = m.pre + "{" + m.body + escClose + m.post;
|
|
44612
|
-
return expand2(str);
|
|
44613
|
-
}
|
|
44614
|
-
return [str];
|
|
44615
|
-
}
|
|
44616
|
-
var n;
|
|
44617
|
-
if (isSequence) {
|
|
44618
|
-
n = m.body.split(/\.\./);
|
|
44619
|
-
} else {
|
|
44620
|
-
n = parseCommaParts(m.body);
|
|
44621
|
-
if (n.length === 1) {
|
|
44622
|
-
n = expand2(n[0], false).map(embrace);
|
|
44623
|
-
if (n.length === 1) {
|
|
44624
|
-
return post.map(function(p) {
|
|
44625
|
-
return m.pre + n[0] + p;
|
|
44626
|
-
});
|
|
44627
|
-
}
|
|
44628
|
-
}
|
|
44629
|
-
}
|
|
44630
|
-
var N;
|
|
44631
|
-
if (isSequence) {
|
|
44632
|
-
var x = numeric(n[0]);
|
|
44633
|
-
var y = numeric(n[1]);
|
|
44634
|
-
var width = Math.max(n[0].length, n[1].length);
|
|
44635
|
-
var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
|
|
44636
|
-
var test = lte;
|
|
44637
|
-
var reverse = y < x;
|
|
44638
|
-
if (reverse) {
|
|
44639
|
-
incr *= -1;
|
|
44640
|
-
test = gte;
|
|
44641
|
-
}
|
|
44642
|
-
var pad = n.some(isPadded);
|
|
44643
|
-
N = [];
|
|
44644
|
-
for (var i = x; test(i, y); i += incr) {
|
|
44645
|
-
var c;
|
|
44646
|
-
if (isAlphaSequence) {
|
|
44647
|
-
c = String.fromCharCode(i);
|
|
44648
|
-
if (c === "\\")
|
|
44649
|
-
c = "";
|
|
44650
|
-
} else {
|
|
44651
|
-
c = String(i);
|
|
44652
|
-
if (pad) {
|
|
44653
|
-
var need = width - c.length;
|
|
44654
|
-
if (need > 0) {
|
|
44655
|
-
var z = new Array(need + 1).join("0");
|
|
44656
|
-
if (i < 0)
|
|
44657
|
-
c = "-" + z + c.slice(1);
|
|
44658
|
-
else
|
|
44659
|
-
c = z + c;
|
|
44660
|
-
}
|
|
44661
|
-
}
|
|
44662
|
-
}
|
|
44663
|
-
N.push(c);
|
|
44664
|
-
}
|
|
44665
|
-
} else {
|
|
44666
|
-
N = [];
|
|
44667
|
-
for (var j = 0; j < n.length; j++) {
|
|
44668
|
-
N.push.apply(N, expand2(n[j], false));
|
|
44669
|
-
}
|
|
44670
|
-
}
|
|
44671
|
-
for (var j = 0; j < N.length; j++) {
|
|
44672
|
-
for (var k = 0; k < post.length; k++) {
|
|
44673
|
-
var expansion = pre + N[j] + post[k];
|
|
44674
|
-
if (!isTop || isSequence || expansion)
|
|
44675
|
-
expansions.push(expansion);
|
|
44676
|
-
}
|
|
44677
|
-
}
|
|
44678
|
-
}
|
|
44679
|
-
return expansions;
|
|
44680
|
-
}
|
|
44681
|
-
}
|
|
44682
|
-
});
|
|
44683
|
-
|
|
44684
44533
|
// node_modules/.pnpm/tsup@8.0.0_patch_hash=fecszixvz36nsmruxbct32ggt4_@microsoft+api-extractor@7.38.3_@swc+core@1._obsfvncdmdnopsocrl4rw2efcm/node_modules/tsup/dist/chunk-EPAEWGCP.js
|
|
44685
44534
|
var require_chunk_EPAEWGCP = __commonJS({
|
|
44686
44535
|
"node_modules/.pnpm/tsup@8.0.0_patch_hash=fecszixvz36nsmruxbct32ggt4_@microsoft+api-extractor@7.38.3_@swc+core@1._obsfvncdmdnopsocrl4rw2efcm/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
|
|
@@ -46507,21 +46356,21 @@ var require_chunk_GQ77QZBO = __commonJS({
|
|
|
46507
46356
|
}
|
|
46508
46357
|
}
|
|
46509
46358
|
function defaultOutExtension({
|
|
46510
|
-
format:
|
|
46359
|
+
format: format2,
|
|
46511
46360
|
pkgType
|
|
46512
46361
|
}) {
|
|
46513
46362
|
let jsExtension = ".js";
|
|
46514
46363
|
let dtsExtension = ".d.ts";
|
|
46515
46364
|
const isModule = pkgType === "module";
|
|
46516
|
-
if (isModule &&
|
|
46365
|
+
if (isModule && format2 === "cjs") {
|
|
46517
46366
|
jsExtension = ".cjs";
|
|
46518
46367
|
dtsExtension = ".d.cts";
|
|
46519
46368
|
}
|
|
46520
|
-
if (!isModule &&
|
|
46369
|
+
if (!isModule && format2 === "esm") {
|
|
46521
46370
|
jsExtension = ".mjs";
|
|
46522
46371
|
dtsExtension = ".d.mts";
|
|
46523
46372
|
}
|
|
46524
|
-
if (
|
|
46373
|
+
if (format2 === "iife") {
|
|
46525
46374
|
jsExtension = ".global.js";
|
|
46526
46375
|
}
|
|
46527
46376
|
return {
|
|
@@ -47346,8 +47195,8 @@ var require_dist3 = __commonJS({
|
|
|
47346
47195
|
return "cjs";
|
|
47347
47196
|
}
|
|
47348
47197
|
var usingDynamicImport = typeof jest === "undefined";
|
|
47349
|
-
var dynamicImport = async (id, { format:
|
|
47350
|
-
const fn =
|
|
47198
|
+
var dynamicImport = async (id, { format: format2 }) => {
|
|
47199
|
+
const fn = format2 === "esm" ? (file) => import(file) : false ? createRequire(import_meta.url) : require;
|
|
47351
47200
|
return fn(id);
|
|
47352
47201
|
};
|
|
47353
47202
|
var getRandomId = () => {
|
|
@@ -47364,9 +47213,9 @@ var require_dist3 = __commonJS({
|
|
|
47364
47213
|
return "ts";
|
|
47365
47214
|
return ext2.slice(1);
|
|
47366
47215
|
}
|
|
47367
|
-
var defaultGetOutputFile = (filepath,
|
|
47216
|
+
var defaultGetOutputFile = (filepath, format2) => filepath.replace(
|
|
47368
47217
|
JS_EXT_RE,
|
|
47369
|
-
`.bundled_${getRandomId()}.${
|
|
47218
|
+
`.bundled_${getRandomId()}.${format2 === "esm" ? "mjs" : "cjs"}`
|
|
47370
47219
|
);
|
|
47371
47220
|
var tsconfigPathsToRegExp = (paths) => {
|
|
47372
47221
|
return Object.keys(paths || {}).map((key) => {
|
|
@@ -47446,7 +47295,7 @@ var require_dist3 = __commonJS({
|
|
|
47446
47295
|
}
|
|
47447
47296
|
const preserveTemporaryFile = (_a = options.preserveTemporaryFile) != null ? _a : !!process.env.BUNDLE_REQUIRE_PRESERVE;
|
|
47448
47297
|
const cwd = options.cwd || process.cwd();
|
|
47449
|
-
const
|
|
47298
|
+
const format2 = (_b = options.format) != null ? _b : guessFormat(options.filepath);
|
|
47450
47299
|
const tsconfig = (0, import_load_tsconfig.loadTsConfig)(cwd, options.tsconfig);
|
|
47451
47300
|
const resolvePaths = tsconfigPathsToRegExp(
|
|
47452
47301
|
((_c = tsconfig == null ? void 0 : tsconfig.data.compilerOptions) == null ? void 0 : _c.paths) || {}
|
|
@@ -47457,14 +47306,14 @@ var require_dist3 = __commonJS({
|
|
|
47457
47306
|
}
|
|
47458
47307
|
const { text } = result.outputFiles[0];
|
|
47459
47308
|
const getOutputFile = options.getOutputFile || defaultGetOutputFile;
|
|
47460
|
-
const outfile = getOutputFile(options.filepath,
|
|
47309
|
+
const outfile = getOutputFile(options.filepath, format2);
|
|
47461
47310
|
await import_fs22.default.promises.writeFile(outfile, text, "utf8");
|
|
47462
47311
|
let mod;
|
|
47463
47312
|
const req = options.require || dynamicImport;
|
|
47464
47313
|
try {
|
|
47465
47314
|
mod = await req(
|
|
47466
|
-
|
|
47467
|
-
{ format:
|
|
47315
|
+
format2 === "esm" ? (0, import_url3.pathToFileURL)(outfile).href : outfile,
|
|
47316
|
+
{ format: format2 }
|
|
47468
47317
|
);
|
|
47469
47318
|
} finally {
|
|
47470
47319
|
if (!preserveTemporaryFile) {
|
|
@@ -47482,7 +47331,7 @@ var require_dist3 = __commonJS({
|
|
|
47482
47331
|
entryPoints: [options.filepath],
|
|
47483
47332
|
absWorkingDir: cwd,
|
|
47484
47333
|
outfile: "out.js",
|
|
47485
|
-
format:
|
|
47334
|
+
format: format2,
|
|
47486
47335
|
platform: "node",
|
|
47487
47336
|
sourcemap: "inline",
|
|
47488
47337
|
bundle: true,
|
|
@@ -47751,12 +47600,12 @@ var require_chunk_7G76EW2R = __commonJS({
|
|
|
47751
47600
|
var padRight = (str, maxLength) => {
|
|
47752
47601
|
return str + " ".repeat(maxLength - str.length);
|
|
47753
47602
|
};
|
|
47754
|
-
var reportSize = (logger,
|
|
47603
|
+
var reportSize = (logger, format2, files) => {
|
|
47755
47604
|
const filenames = Object.keys(files);
|
|
47756
47605
|
const maxLength = getLengthOfLongestString(filenames) + 1;
|
|
47757
47606
|
for (const name of filenames) {
|
|
47758
47607
|
logger.success(
|
|
47759
|
-
|
|
47608
|
+
format2,
|
|
47760
47609
|
`${_chunkUIX4URMVjs.bold.call(void 0, padRight(name, maxLength))}${_chunkUIX4URMVjs.green.call(
|
|
47761
47610
|
void 0,
|
|
47762
47611
|
prettyBytes(files[name])
|
|
@@ -75072,11 +74921,11 @@ Original error: ${originalError.message}`,
|
|
|
75072
74921
|
message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`
|
|
75073
74922
|
};
|
|
75074
74923
|
}
|
|
75075
|
-
function logInvalidFormatForTopLevelAwait(id,
|
|
74924
|
+
function logInvalidFormatForTopLevelAwait(id, format2) {
|
|
75076
74925
|
return {
|
|
75077
74926
|
code: INVALID_TLA_FORMAT,
|
|
75078
74927
|
id,
|
|
75079
|
-
message: `Module format "${
|
|
74928
|
+
message: `Module format "${format2}" does not support top-level await. Use the "es" or "system" output formats rather.`
|
|
75080
74929
|
};
|
|
75081
74930
|
}
|
|
75082
74931
|
function logMissingConfig() {
|
|
@@ -81350,11 +81199,11 @@ var require_rollup = __commonJS({
|
|
|
81350
81199
|
return { isMatch: false, output: "" };
|
|
81351
81200
|
}
|
|
81352
81201
|
const opts = options || {};
|
|
81353
|
-
const
|
|
81202
|
+
const format2 = opts.format || (posix2 ? utils.toPosixSlashes : null);
|
|
81354
81203
|
let match2 = input === glob2;
|
|
81355
|
-
let output = match2 &&
|
|
81204
|
+
let output = match2 && format2 ? format2(input) : input;
|
|
81356
81205
|
if (match2 === false) {
|
|
81357
|
-
output =
|
|
81206
|
+
output = format2 ? format2(input) : input;
|
|
81358
81207
|
match2 = output === glob2;
|
|
81359
81208
|
}
|
|
81360
81209
|
if (match2 === false || opts.capture === true) {
|
|
@@ -82917,11 +82766,11 @@ var require_rollup = __commonJS({
|
|
|
82917
82766
|
addReturnExpression(expression) {
|
|
82918
82767
|
this.parent instanceof _ChildScope && this.parent.addReturnExpression(expression);
|
|
82919
82768
|
}
|
|
82920
|
-
addUsedOutsideNames(usedNames,
|
|
82769
|
+
addUsedOutsideNames(usedNames, format2, exportNamesByVariable, accessedGlobalsByScope) {
|
|
82921
82770
|
for (const variable of this.accessedOutsideVariables.values()) {
|
|
82922
82771
|
if (variable.included) {
|
|
82923
82772
|
usedNames.add(variable.getBaseVariableName());
|
|
82924
|
-
if (
|
|
82773
|
+
if (format2 === "system" && exportNamesByVariable.has(variable)) {
|
|
82925
82774
|
usedNames.add("exports");
|
|
82926
82775
|
}
|
|
82927
82776
|
}
|
|
@@ -82936,9 +82785,9 @@ var require_rollup = __commonJS({
|
|
|
82936
82785
|
contains(name) {
|
|
82937
82786
|
return this.variables.has(name) || this.parent.contains(name);
|
|
82938
82787
|
}
|
|
82939
|
-
deconflict(
|
|
82788
|
+
deconflict(format2, exportNamesByVariable, accessedGlobalsByScope) {
|
|
82940
82789
|
const usedNames = /* @__PURE__ */ new Set();
|
|
82941
|
-
this.addUsedOutsideNames(usedNames,
|
|
82790
|
+
this.addUsedOutsideNames(usedNames, format2, exportNamesByVariable, accessedGlobalsByScope);
|
|
82942
82791
|
if (this.accessedDynamicImports) {
|
|
82943
82792
|
for (const importExpression of this.accessedDynamicImports) {
|
|
82944
82793
|
if (importExpression.inlineNamespace) {
|
|
@@ -82952,7 +82801,7 @@ var require_rollup = __commonJS({
|
|
|
82952
82801
|
}
|
|
82953
82802
|
}
|
|
82954
82803
|
for (const scope of this.children) {
|
|
82955
|
-
scope.deconflict(
|
|
82804
|
+
scope.deconflict(format2, exportNamesByVariable, accessedGlobalsByScope);
|
|
82956
82805
|
}
|
|
82957
82806
|
}
|
|
82958
82807
|
findLexicalBoundary() {
|
|
@@ -86049,10 +85898,10 @@ var require_rollup = __commonJS({
|
|
|
86049
85898
|
super.parseNode(esTreeNode);
|
|
86050
85899
|
}
|
|
86051
85900
|
render(code, options) {
|
|
86052
|
-
const { exportNamesByVariable, format:
|
|
85901
|
+
const { exportNamesByVariable, format: format2, snippets: { _, getPropertyAccess } } = options;
|
|
86053
85902
|
if (this.id) {
|
|
86054
85903
|
const { variable, name } = this.id;
|
|
86055
|
-
if (
|
|
85904
|
+
if (format2 === "system" && exportNamesByVariable.has(variable)) {
|
|
86056
85905
|
code.appendLeft(this.end, `${_}${getSystemExportStatement([variable], options)};`);
|
|
86057
85906
|
}
|
|
86058
85907
|
const renderedVariable = variable.getName(getPropertyAccess);
|
|
@@ -86399,19 +86248,19 @@ var require_rollup = __commonJS({
|
|
|
86399
86248
|
applyDeoptimizations() {
|
|
86400
86249
|
}
|
|
86401
86250
|
renderNamedDeclaration(code, declarationStart, idInsertPosition, options) {
|
|
86402
|
-
const { exportNamesByVariable, format:
|
|
86251
|
+
const { exportNamesByVariable, format: format2, snippets: { getPropertyAccess } } = options;
|
|
86403
86252
|
const name = this.variable.getName(getPropertyAccess);
|
|
86404
86253
|
code.remove(this.start, declarationStart);
|
|
86405
86254
|
if (idInsertPosition !== null) {
|
|
86406
86255
|
code.appendLeft(idInsertPosition, ` ${name}`);
|
|
86407
86256
|
}
|
|
86408
|
-
if (
|
|
86257
|
+
if (format2 === "system" && this.declaration instanceof ClassDeclaration && exportNamesByVariable.has(this.variable)) {
|
|
86409
86258
|
code.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`);
|
|
86410
86259
|
}
|
|
86411
86260
|
}
|
|
86412
|
-
renderVariableDeclaration(code, declarationStart, { format:
|
|
86261
|
+
renderVariableDeclaration(code, declarationStart, { format: format2, exportNamesByVariable, snippets: { cnst, getPropertyAccess } }) {
|
|
86413
86262
|
const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59;
|
|
86414
|
-
const systemExportNames =
|
|
86263
|
+
const systemExportNames = format2 === "system" && exportNamesByVariable.get(this.variable);
|
|
86415
86264
|
if (systemExportNames) {
|
|
86416
86265
|
code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = exports('${systemExportNames[0]}', `);
|
|
86417
86266
|
code.appendRight(hasTrailingSemicolon ? this.end - 1 : this.end, ")" + (hasTrailingSemicolon ? "" : ";"));
|
|
@@ -87115,13 +86964,13 @@ var require_rollup = __commonJS({
|
|
|
87115
86964
|
}
|
|
87116
86965
|
}
|
|
87117
86966
|
setExternalResolution(exportMode, resolution, options, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, namespaceExportName, attributes) {
|
|
87118
|
-
const { format:
|
|
86967
|
+
const { format: format2 } = options;
|
|
87119
86968
|
this.inlineNamespace = null;
|
|
87120
86969
|
this.resolution = resolution;
|
|
87121
86970
|
this.resolutionString = resolutionString;
|
|
87122
86971
|
this.namespaceExportName = namespaceExportName;
|
|
87123
86972
|
this.attributes = attributes;
|
|
87124
|
-
const accessedGlobals = [...accessedImportGlobals[
|
|
86973
|
+
const accessedGlobals = [...accessedImportGlobals[format2] || []];
|
|
87125
86974
|
let helper;
|
|
87126
86975
|
({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(resolution, exportMode, options, snippets, pluginDriver));
|
|
87127
86976
|
if (helper) {
|
|
@@ -87136,11 +86985,11 @@ var require_rollup = __commonJS({
|
|
|
87136
86985
|
}
|
|
87137
86986
|
applyDeoptimizations() {
|
|
87138
86987
|
}
|
|
87139
|
-
getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportInCjs, format:
|
|
86988
|
+
getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportInCjs, format: format2, generatedCode: { arrowFunctions }, interop }, { _, getDirectReturnFunction, getDirectReturnIifeLeft }, pluginDriver) {
|
|
87140
86989
|
const mechanism = pluginDriver.hookFirstSync("renderDynamicImport", [
|
|
87141
86990
|
{
|
|
87142
86991
|
customResolution: typeof this.resolution === "string" ? this.resolution : null,
|
|
87143
|
-
format:
|
|
86992
|
+
format: format2,
|
|
87144
86993
|
moduleId: this.scope.context.module.id,
|
|
87145
86994
|
targetModuleId: this.resolution && typeof this.resolution !== "string" ? this.resolution.id : null
|
|
87146
86995
|
}
|
|
@@ -87149,7 +86998,7 @@ var require_rollup = __commonJS({
|
|
|
87149
86998
|
return { helper: null, mechanism };
|
|
87150
86999
|
}
|
|
87151
87000
|
const hasDynamicTarget = !this.resolution || typeof this.resolution === "string";
|
|
87152
|
-
switch (
|
|
87001
|
+
switch (format2) {
|
|
87153
87002
|
case "cjs": {
|
|
87154
87003
|
if (dynamicImportInCjs && (!resolution || typeof resolution === "string" || resolution instanceof ExternalModule)) {
|
|
87155
87004
|
return { helper: null, mechanism: null };
|
|
@@ -87447,7 +87296,7 @@ var require_rollup = __commonJS({
|
|
|
87447
87296
|
}
|
|
87448
87297
|
}
|
|
87449
87298
|
render(code, renderOptions) {
|
|
87450
|
-
const { format:
|
|
87299
|
+
const { format: format2, pluginDriver, snippets } = renderOptions;
|
|
87451
87300
|
const { scope: { context: { module: module3 } }, meta: { name }, metaProperty, parent, preliminaryChunkId, referenceId, start, end } = this;
|
|
87452
87301
|
const { id: moduleId } = module3;
|
|
87453
87302
|
if (name !== IMPORT)
|
|
@@ -87457,18 +87306,18 @@ var require_rollup = __commonJS({
|
|
|
87457
87306
|
const fileName = pluginDriver.getFileName(referenceId);
|
|
87458
87307
|
const relativePath = parseAst_js.normalize(node_path.relative(node_path.dirname(chunkId), fileName));
|
|
87459
87308
|
const replacement2 = pluginDriver.hookFirstSync("resolveFileUrl", [
|
|
87460
|
-
{ chunkId, fileName, format:
|
|
87461
|
-
]) || relativeUrlMechanisms[
|
|
87309
|
+
{ chunkId, fileName, format: format2, moduleId, referenceId, relativePath }
|
|
87310
|
+
]) || relativeUrlMechanisms[format2](relativePath);
|
|
87462
87311
|
code.overwrite(parent.start, parent.end, replacement2, { contentOnly: true });
|
|
87463
87312
|
return;
|
|
87464
87313
|
}
|
|
87465
87314
|
let replacement = pluginDriver.hookFirstSync("resolveImportMeta", [
|
|
87466
87315
|
metaProperty,
|
|
87467
|
-
{ chunkId, format:
|
|
87316
|
+
{ chunkId, format: format2, moduleId }
|
|
87468
87317
|
]);
|
|
87469
87318
|
if (!replacement) {
|
|
87470
|
-
replacement = importMetaMechanisms[
|
|
87471
|
-
renderOptions.accessedDocumentCurrentScript ||= formatsMaybeAccessDocumentCurrentScript.includes(
|
|
87319
|
+
replacement = importMetaMechanisms[format2]?.(metaProperty, { chunkId, snippets });
|
|
87320
|
+
renderOptions.accessedDocumentCurrentScript ||= formatsMaybeAccessDocumentCurrentScript.includes(format2) && replacement !== "undefined";
|
|
87472
87321
|
}
|
|
87473
87322
|
if (typeof replacement === "string") {
|
|
87474
87323
|
if (parent instanceof MemberExpression) {
|
|
@@ -87478,9 +87327,9 @@ var require_rollup = __commonJS({
|
|
|
87478
87327
|
}
|
|
87479
87328
|
}
|
|
87480
87329
|
}
|
|
87481
|
-
setResolution(
|
|
87330
|
+
setResolution(format2, accessedGlobalsByScope, preliminaryChunkId) {
|
|
87482
87331
|
this.preliminaryChunkId = preliminaryChunkId;
|
|
87483
|
-
const accessedGlobals = (this.metaProperty?.startsWith(FILE_PREFIX) ? accessedFileUrlGlobals : accessedMetaUrlGlobals)[
|
|
87332
|
+
const accessedGlobals = (this.metaProperty?.startsWith(FILE_PREFIX) ? accessedFileUrlGlobals : accessedMetaUrlGlobals)[format2];
|
|
87484
87333
|
if (accessedGlobals.length > 0) {
|
|
87485
87334
|
this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope);
|
|
87486
87335
|
}
|
|
@@ -88243,9 +88092,9 @@ var require_rollup = __commonJS({
|
|
|
88243
88092
|
}
|
|
88244
88093
|
addNamespaceMemberAccess() {
|
|
88245
88094
|
}
|
|
88246
|
-
deconflict(
|
|
88095
|
+
deconflict(format2, exportNamesByVariable, accessedGlobalsByScope) {
|
|
88247
88096
|
for (const scope of this.children)
|
|
88248
|
-
scope.deconflict(
|
|
88097
|
+
scope.deconflict(format2, exportNamesByVariable, accessedGlobalsByScope);
|
|
88249
88098
|
}
|
|
88250
88099
|
findLexicalBoundary() {
|
|
88251
88100
|
return this;
|
|
@@ -88420,9 +88269,9 @@ var require_rollup = __commonJS({
|
|
|
88420
88269
|
this.argument.setAssignedValue(UNKNOWN_EXPRESSION);
|
|
88421
88270
|
}
|
|
88422
88271
|
render(code, options) {
|
|
88423
|
-
const { exportNamesByVariable, format:
|
|
88272
|
+
const { exportNamesByVariable, format: format2, snippets: { _ } } = options;
|
|
88424
88273
|
this.argument.render(code, options);
|
|
88425
|
-
if (
|
|
88274
|
+
if (format2 === "system") {
|
|
88426
88275
|
const variable = this.argument.variable;
|
|
88427
88276
|
const exportNames = exportNamesByVariable.get(variable);
|
|
88428
88277
|
if (exportNames) {
|
|
@@ -88799,7 +88648,7 @@ var require_rollup = __commonJS({
|
|
|
88799
88648
|
}
|
|
88800
88649
|
}
|
|
88801
88650
|
renderBlock(options) {
|
|
88802
|
-
const { exportNamesByVariable, format:
|
|
88651
|
+
const { exportNamesByVariable, format: format2, freeze, indent: t, symbols, snippets: { _, cnst, getObject, getPropertyAccess, n: n2, s } } = options;
|
|
88803
88652
|
const memberVariables = this.getMemberVariables();
|
|
88804
88653
|
const members = Object.entries(memberVariables).filter(([_2, variable]) => variable.included).map(([name2, variable]) => {
|
|
88805
88654
|
if (this.referencedEarly || variable.isReassigned || variable === this) {
|
|
@@ -88825,7 +88674,7 @@ var require_rollup = __commonJS({
|
|
|
88825
88674
|
}
|
|
88826
88675
|
const name = this.getName(getPropertyAccess);
|
|
88827
88676
|
output = `${cnst} ${name}${_}=${_}${output};`;
|
|
88828
|
-
if (
|
|
88677
|
+
if (format2 === "system" && exportNamesByVariable.has(this)) {
|
|
88829
88678
|
output += `${n2}${getSystemExportStatement([this], options)};`;
|
|
88830
88679
|
}
|
|
88831
88680
|
return output;
|
|
@@ -90721,15 +90570,15 @@ ${outro}`;
|
|
|
90721
90570
|
system: deconflictImportsEsmOrSystem,
|
|
90722
90571
|
umd: deconflictImportsOther
|
|
90723
90572
|
};
|
|
90724
|
-
function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames,
|
|
90573
|
+
function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format2, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) {
|
|
90725
90574
|
const reversedModules = [...modules].reverse();
|
|
90726
90575
|
for (const module3 of reversedModules) {
|
|
90727
|
-
module3.scope.addUsedOutsideNames(usedNames,
|
|
90576
|
+
module3.scope.addUsedOutsideNames(usedNames, format2, exportNamesByVariable, accessedGlobalsByScope);
|
|
90728
90577
|
}
|
|
90729
90578
|
deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces);
|
|
90730
|
-
DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[
|
|
90579
|
+
DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format2](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports);
|
|
90731
90580
|
for (const module3 of reversedModules) {
|
|
90732
|
-
module3.scope.deconflict(
|
|
90581
|
+
module3.scope.deconflict(format2, exportNamesByVariable, accessedGlobalsByScope);
|
|
90733
90582
|
}
|
|
90734
90583
|
}
|
|
90735
90584
|
function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop, preserveModules, _externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports) {
|
|
@@ -90835,7 +90684,7 @@ ${outro}`;
|
|
|
90835
90684
|
exportNamesByVariable.set(variable, [exportName]);
|
|
90836
90685
|
}
|
|
90837
90686
|
}
|
|
90838
|
-
function getExportMode(chunk, { exports: exportMode, name, format:
|
|
90687
|
+
function getExportMode(chunk, { exports: exportMode, name, format: format2 }, facadeModuleId, log) {
|
|
90839
90688
|
const exportKeys = chunk.getExportNames();
|
|
90840
90689
|
if (exportMode === "default") {
|
|
90841
90690
|
if (exportKeys.length !== 1 || exportKeys[0] !== "default") {
|
|
@@ -90850,7 +90699,7 @@ ${outro}`;
|
|
|
90850
90699
|
} else if (exportKeys.length === 1 && exportKeys[0] === "default") {
|
|
90851
90700
|
exportMode = "default";
|
|
90852
90701
|
} else {
|
|
90853
|
-
if (
|
|
90702
|
+
if (format2 !== "es" && format2 !== "system" && exportKeys.includes("default")) {
|
|
90854
90703
|
log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMixedExport(facadeModuleId, name));
|
|
90855
90704
|
}
|
|
90856
90705
|
exportMode = "named";
|
|
@@ -91170,13 +91019,13 @@ ${outro}`;
|
|
|
91170
91019
|
}
|
|
91171
91020
|
let fileName;
|
|
91172
91021
|
let hashPlaceholder = null;
|
|
91173
|
-
const { chunkFileNames, entryFileNames, file, format:
|
|
91022
|
+
const { chunkFileNames, entryFileNames, file, format: format2, preserveModules } = this.outputOptions;
|
|
91174
91023
|
if (file) {
|
|
91175
91024
|
fileName = node_path.basename(file);
|
|
91176
91025
|
} else if (this.fileName === null) {
|
|
91177
91026
|
const [pattern, patternName] = preserveModules || this.facadeModule?.isUserDefinedEntryPoint ? [entryFileNames, "output.entryFileNames"] : [chunkFileNames, "output.chunkFileNames"];
|
|
91178
91027
|
fileName = renderNamePattern(typeof pattern === "function" ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, {
|
|
91179
|
-
format: () =>
|
|
91028
|
+
format: () => format2,
|
|
91180
91029
|
hash: (size) => hashPlaceholder || (hashPlaceholder = this.getPlaceholder(patternName, size)),
|
|
91181
91030
|
name: () => this.getChunkName()
|
|
91182
91031
|
});
|
|
@@ -91197,12 +91046,12 @@ ${outro}`;
|
|
|
91197
91046
|
}
|
|
91198
91047
|
let sourcemapFileName = null;
|
|
91199
91048
|
let hashPlaceholder = null;
|
|
91200
|
-
const { sourcemapFileNames, format:
|
|
91049
|
+
const { sourcemapFileNames, format: format2 } = this.outputOptions;
|
|
91201
91050
|
if (sourcemapFileNames) {
|
|
91202
91051
|
const [pattern, patternName] = [sourcemapFileNames, "output.sourcemapFileNames"];
|
|
91203
91052
|
sourcemapFileName = renderNamePattern(typeof pattern === "function" ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, {
|
|
91204
91053
|
chunkhash: () => this.getPreliminaryFileName().hashPlaceholder || "",
|
|
91205
|
-
format: () =>
|
|
91054
|
+
format: () => format2,
|
|
91206
91055
|
hash: (size) => hashPlaceholder || (hashPlaceholder = this.getPlaceholder(patternName, size)),
|
|
91207
91056
|
name: () => this.getChunkName()
|
|
91208
91057
|
});
|
|
@@ -91246,7 +91095,7 @@ ${outro}`;
|
|
|
91246
91095
|
}
|
|
91247
91096
|
async render() {
|
|
91248
91097
|
const { dependencies, exportMode, facadeModule, inputOptions: { onLog }, outputOptions, pluginDriver, snippets } = this;
|
|
91249
|
-
const { format:
|
|
91098
|
+
const { format: format2, hoistTransitiveImports, preserveModules } = outputOptions;
|
|
91250
91099
|
if (hoistTransitiveImports && !preserveModules && facadeModule !== null) {
|
|
91251
91100
|
for (const dep of dependencies) {
|
|
91252
91101
|
if (dep instanceof _Chunk)
|
|
@@ -91257,7 +91106,7 @@ ${outro}`;
|
|
|
91257
91106
|
const preliminarySourcemapFileName = this.getPreliminarySourcemapFileName();
|
|
91258
91107
|
const { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait } = this.renderModules(preliminaryFileName.fileName);
|
|
91259
91108
|
const renderedDependencies = [...this.getRenderedDependencies().values()];
|
|
91260
|
-
const renderedExports = exportMode === "none" ? [] : this.getChunkExportDeclarations(
|
|
91109
|
+
const renderedExports = exportMode === "none" ? [] : this.getChunkExportDeclarations(format2);
|
|
91261
91110
|
let hasExports = renderedExports.length > 0;
|
|
91262
91111
|
let hasDefaultExport = false;
|
|
91263
91112
|
for (const renderedDependence of renderedDependencies) {
|
|
@@ -91267,7 +91116,7 @@ ${outro}`;
|
|
|
91267
91116
|
if (!hasDefaultExport && reexports.some((reexport) => reexport.reexported === "default")) {
|
|
91268
91117
|
hasDefaultExport = true;
|
|
91269
91118
|
}
|
|
91270
|
-
if (
|
|
91119
|
+
if (format2 === "es") {
|
|
91271
91120
|
renderedDependence.reexports = reexports.filter(
|
|
91272
91121
|
// eslint-disable-next-line unicorn/prefer-array-some
|
|
91273
91122
|
({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported)
|
|
@@ -91284,7 +91133,7 @@ ${outro}`;
|
|
|
91284
91133
|
}
|
|
91285
91134
|
}
|
|
91286
91135
|
const { intro, outro, banner, footer } = await createAddons(outputOptions, pluginDriver, this.getRenderedChunkInfo());
|
|
91287
|
-
finalisers[
|
|
91136
|
+
finalisers[format2](renderedSource, {
|
|
91288
91137
|
accessedGlobals,
|
|
91289
91138
|
dependencies: renderedDependencies,
|
|
91290
91139
|
exports: renderedExports,
|
|
@@ -91303,7 +91152,7 @@ ${outro}`;
|
|
|
91303
91152
|
}, outputOptions);
|
|
91304
91153
|
if (banner)
|
|
91305
91154
|
magicString.prepend(banner);
|
|
91306
|
-
if (
|
|
91155
|
+
if (format2 === "es" || format2 === "cjs") {
|
|
91307
91156
|
const shebang = facadeModule !== null && facadeModule.info.isEntry && facadeModule.shebang;
|
|
91308
91157
|
shebang && magicString.prepend(`#!${shebang}
|
|
91309
91158
|
`);
|
|
@@ -91402,7 +91251,7 @@ ${outro}`;
|
|
|
91402
91251
|
}
|
|
91403
91252
|
return "chunk";
|
|
91404
91253
|
}
|
|
91405
|
-
getChunkExportDeclarations(
|
|
91254
|
+
getChunkExportDeclarations(format2) {
|
|
91406
91255
|
const exports2 = [];
|
|
91407
91256
|
for (const exportName of this.getExportNames()) {
|
|
91408
91257
|
if (exportName[0] === "*")
|
|
@@ -91413,7 +91262,7 @@ ${outro}`;
|
|
|
91413
91262
|
if (module3) {
|
|
91414
91263
|
const chunk = this.chunkByModule.get(module3);
|
|
91415
91264
|
if (chunk !== this) {
|
|
91416
|
-
if (!chunk ||
|
|
91265
|
+
if (!chunk || format2 !== "es") {
|
|
91417
91266
|
continue;
|
|
91418
91267
|
}
|
|
91419
91268
|
const chunkDep = this.renderedDependencies.get(chunk);
|
|
@@ -91441,7 +91290,7 @@ ${outro}`;
|
|
|
91441
91290
|
}
|
|
91442
91291
|
} else if (variable instanceof SyntheticNamedExportVariable) {
|
|
91443
91292
|
expression = local;
|
|
91444
|
-
if (
|
|
91293
|
+
if (format2 === "es") {
|
|
91445
91294
|
local = variable.renderName;
|
|
91446
91295
|
}
|
|
91447
91296
|
}
|
|
@@ -91693,7 +91542,7 @@ ${outro}`;
|
|
|
91693
91542
|
// This method changes properties on the AST before rendering and must not be async
|
|
91694
91543
|
renderModules(fileName) {
|
|
91695
91544
|
const { accessedGlobalsByScope, dependencies, exportNamesByVariable, includedNamespaces, inputOptions: { onLog }, isEmpty, orderedModules, outputOptions, pluginDriver, renderedModules, snippets } = this;
|
|
91696
|
-
const { compact, format:
|
|
91545
|
+
const { compact, format: format2, freeze, generatedCode: { symbols } } = outputOptions;
|
|
91697
91546
|
const { _, cnst, n: n2 } = snippets;
|
|
91698
91547
|
this.setDynamicImportResolutions(fileName);
|
|
91699
91548
|
this.setImportMetaResolutions(fileName);
|
|
@@ -91707,7 +91556,7 @@ ${outro}`;
|
|
|
91707
91556
|
const renderOptions = {
|
|
91708
91557
|
accessedDocumentCurrentScript: false,
|
|
91709
91558
|
exportNamesByVariable,
|
|
91710
|
-
format:
|
|
91559
|
+
format: format2,
|
|
91711
91560
|
freeze,
|
|
91712
91561
|
indent,
|
|
91713
91562
|
pluginDriver,
|
|
@@ -91721,7 +91570,7 @@ ${outro}`;
|
|
|
91721
91570
|
let source;
|
|
91722
91571
|
if (module3.isIncluded() || includedNamespaces.has(module3)) {
|
|
91723
91572
|
const rendered = module3.render(renderOptions);
|
|
91724
|
-
if (!renderOptions.accessedDocumentCurrentScript && formatsMaybeAccessDocumentCurrentScript.includes(
|
|
91573
|
+
if (!renderOptions.accessedDocumentCurrentScript && formatsMaybeAccessDocumentCurrentScript.includes(format2)) {
|
|
91725
91574
|
this.accessedGlobalsByScope.get(module3.scope)?.delete(DOCUMENT_CURRENT_SCRIPT);
|
|
91726
91575
|
}
|
|
91727
91576
|
renderOptions.accessedDocumentCurrentScript = false;
|
|
@@ -91790,11 +91639,11 @@ ${outro}`;
|
|
|
91790
91639
|
}
|
|
91791
91640
|
}
|
|
91792
91641
|
setIdentifierRenderResolutions() {
|
|
91793
|
-
const { format:
|
|
91642
|
+
const { format: format2, generatedCode: { symbols }, interop, preserveModules, externalLiveBindings } = this.outputOptions;
|
|
91794
91643
|
const syntheticExports = /* @__PURE__ */ new Set();
|
|
91795
91644
|
for (const exportName of this.getExportNames()) {
|
|
91796
91645
|
const exportVariable = this.exportsByName.get(exportName);
|
|
91797
|
-
if (
|
|
91646
|
+
if (format2 !== "es" && format2 !== "system" && exportVariable.isReassigned && !exportVariable.isId) {
|
|
91798
91647
|
exportVariable.setRenderNames("exports", exportName);
|
|
91799
91648
|
} else if (exportVariable instanceof SyntheticNamedExportVariable) {
|
|
91800
91649
|
syntheticExports.add(exportVariable);
|
|
@@ -91815,7 +91664,7 @@ ${outro}`;
|
|
|
91815
91664
|
if (symbols) {
|
|
91816
91665
|
usedNames.add("Symbol");
|
|
91817
91666
|
}
|
|
91818
|
-
switch (
|
|
91667
|
+
switch (format2) {
|
|
91819
91668
|
case "system": {
|
|
91820
91669
|
usedNames.add("module").add("exports");
|
|
91821
91670
|
break;
|
|
@@ -91833,13 +91682,13 @@ ${outro}`;
|
|
|
91833
91682
|
}
|
|
91834
91683
|
}
|
|
91835
91684
|
}
|
|
91836
|
-
deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(
|
|
91685
|
+
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);
|
|
91837
91686
|
}
|
|
91838
91687
|
setImportMetaResolutions(fileName) {
|
|
91839
|
-
const { accessedGlobalsByScope, includedNamespaces, orderedModules, outputOptions: { format:
|
|
91688
|
+
const { accessedGlobalsByScope, includedNamespaces, orderedModules, outputOptions: { format: format2 } } = this;
|
|
91840
91689
|
for (const module3 of orderedModules) {
|
|
91841
91690
|
for (const importMeta of module3.importMetas) {
|
|
91842
|
-
importMeta.setResolution(
|
|
91691
|
+
importMeta.setResolution(format2, accessedGlobalsByScope, fileName);
|
|
91843
91692
|
}
|
|
91844
91693
|
if (includedNamespaces.has(module3)) {
|
|
91845
91694
|
module3.namespace.prepare(accessedGlobalsByScope);
|
|
@@ -93906,7 +93755,7 @@ ${outro}`;
|
|
|
93906
93755
|
async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
|
|
93907
93756
|
const unsetOptions = new Set(unsetInputOptions);
|
|
93908
93757
|
const compact = config.compact || false;
|
|
93909
|
-
const
|
|
93758
|
+
const format2 = getFormat(config);
|
|
93910
93759
|
const inlineDynamicImports = getInlineDynamicImports(config, inputOptions);
|
|
93911
93760
|
const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions);
|
|
93912
93761
|
const file = getFile(config, preserveModules, inputOptions);
|
|
@@ -93930,7 +93779,7 @@ ${outro}`;
|
|
|
93930
93779
|
externalLiveBindings: config.externalLiveBindings ?? true,
|
|
93931
93780
|
file,
|
|
93932
93781
|
footer: getAddon(config, "footer"),
|
|
93933
|
-
format:
|
|
93782
|
+
format: format2,
|
|
93934
93783
|
freeze: config.freeze ?? true,
|
|
93935
93784
|
generatedCode,
|
|
93936
93785
|
globals: config.globals || {},
|
|
@@ -93940,7 +93789,7 @@ ${outro}`;
|
|
|
93940
93789
|
interop: getInterop(config),
|
|
93941
93790
|
intro: getAddon(config, "intro"),
|
|
93942
93791
|
manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules),
|
|
93943
|
-
minifyInternalExports: getMinifyInternalExports(config,
|
|
93792
|
+
minifyInternalExports: getMinifyInternalExports(config, format2, compact),
|
|
93944
93793
|
name: config.name,
|
|
93945
93794
|
noConflict: config.noConflict || false,
|
|
93946
93795
|
outro: getAddon(config, "outro"),
|
|
@@ -94147,7 +93996,7 @@ ${outro}`;
|
|
|
94147
93996
|
}
|
|
94148
93997
|
return configManualChunks || {};
|
|
94149
93998
|
};
|
|
94150
|
-
var getMinifyInternalExports = (config,
|
|
93999
|
+
var getMinifyInternalExports = (config, format2, compact) => config.minifyInternalExports ?? (compact || format2 === "es" || format2 === "system");
|
|
94151
94000
|
var getSourcemapFileNames = (config, unsetOptions) => {
|
|
94152
94001
|
const configSourcemapFileNames = config.sourcemapFileNames;
|
|
94153
94002
|
if (configSourcemapFileNames == null) {
|
|
@@ -95309,7 +95158,7 @@ var require_shared = __commonJS({
|
|
|
95309
95158
|
let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
|
95310
95159
|
let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
|
95311
95160
|
let toNumber = padded === false && stringify$3(start, end, options) === false;
|
|
95312
|
-
let
|
|
95161
|
+
let format2 = options.transform || transform2(toNumber);
|
|
95313
95162
|
if (options.toRegex && step === 1) {
|
|
95314
95163
|
return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
|
|
95315
95164
|
}
|
|
@@ -95321,7 +95170,7 @@ var require_shared = __commonJS({
|
|
|
95321
95170
|
if (options.toRegex === true && step > 1) {
|
|
95322
95171
|
push(a);
|
|
95323
95172
|
} else {
|
|
95324
|
-
range.push(pad(
|
|
95173
|
+
range.push(pad(format2(a, index), maxLen, toNumber));
|
|
95325
95174
|
}
|
|
95326
95175
|
a = descending ? a - step : a + step;
|
|
95327
95176
|
index++;
|
|
@@ -95335,7 +95184,7 @@ var require_shared = __commonJS({
|
|
|
95335
95184
|
if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
|
|
95336
95185
|
return invalidRange(start, end, options);
|
|
95337
95186
|
}
|
|
95338
|
-
let
|
|
95187
|
+
let format2 = options.transform || ((val) => String.fromCharCode(val));
|
|
95339
95188
|
let a = `${start}`.charCodeAt(0);
|
|
95340
95189
|
let b = `${end}`.charCodeAt(0);
|
|
95341
95190
|
let descending = a > b;
|
|
@@ -95347,7 +95196,7 @@ var require_shared = __commonJS({
|
|
|
95347
95196
|
let range = [];
|
|
95348
95197
|
let index = 0;
|
|
95349
95198
|
while (descending ? a >= b : a <= b) {
|
|
95350
|
-
range.push(
|
|
95199
|
+
range.push(format2(a, index));
|
|
95351
95200
|
a = descending ? a - step : a + step;
|
|
95352
95201
|
index++;
|
|
95353
95202
|
}
|
|
@@ -102347,10 +102196,10 @@ var require_dist6 = __commonJS({
|
|
|
102347
102196
|
}
|
|
102348
102197
|
};
|
|
102349
102198
|
};
|
|
102350
|
-
var getOutputExtensionMap = (options,
|
|
102199
|
+
var getOutputExtensionMap = (options, format2, pkgType) => {
|
|
102351
102200
|
const outExtension2 = options.outExtension || _chunkGQ77QZBOjs.defaultOutExtension;
|
|
102352
|
-
const defaultExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format:
|
|
102353
|
-
const extension = outExtension2({ options, format:
|
|
102201
|
+
const defaultExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format: format2, pkgType });
|
|
102202
|
+
const extension = outExtension2({ options, format: format2, pkgType });
|
|
102354
102203
|
return {
|
|
102355
102204
|
".js": extension.js || defaultExtension.js
|
|
102356
102205
|
};
|
|
@@ -102369,9 +102218,9 @@ var require_dist6 = __commonJS({
|
|
|
102369
102218
|
}
|
|
102370
102219
|
return result;
|
|
102371
102220
|
};
|
|
102372
|
-
var packageJsonSearch = (outDir, silent,
|
|
102221
|
+
var packageJsonSearch = (outDir, silent, format2, logger3) => {
|
|
102373
102222
|
let pkgPath = outDir ? outDir : process.cwd();
|
|
102374
|
-
!silent && logger3 && logger3.info(
|
|
102223
|
+
!silent && logger3 && logger3.info(format2, `\u26A1 Beginning search for package.json file: ${pkgPath}`);
|
|
102375
102224
|
if (pkgPath) {
|
|
102376
102225
|
const splits = pkgPath.includes("\\") ? pkgPath.split("\\") : pkgPath.split("/");
|
|
102377
102226
|
if (splits.length > 0) {
|
|
@@ -102384,12 +102233,12 @@ var require_dist6 = __commonJS({
|
|
|
102384
102233
|
"package.json"
|
|
102385
102234
|
);
|
|
102386
102235
|
!silent && logger3 && logger3.info(
|
|
102387
|
-
|
|
102236
|
+
format2,
|
|
102388
102237
|
`\u26A1 Searching for package.json file in ${packageJsonPath} (index: ${i})`
|
|
102389
102238
|
);
|
|
102390
102239
|
if (_fs2.default.existsSync(packageJsonPath)) {
|
|
102391
102240
|
!silent && logger3 && logger3.info(
|
|
102392
|
-
|
|
102241
|
+
format2,
|
|
102393
102242
|
`\u26A1 Found the package.json file in ${packageJsonPath} (index: ${i})`
|
|
102394
102243
|
);
|
|
102395
102244
|
pkgPath = packageJsonPath.replace("package.json", "");
|
|
@@ -102400,21 +102249,21 @@ var require_dist6 = __commonJS({
|
|
|
102400
102249
|
}
|
|
102401
102250
|
if (pkgPath === outDir) {
|
|
102402
102251
|
!silent && logger3 && logger3.info(
|
|
102403
|
-
|
|
102252
|
+
format2,
|
|
102404
102253
|
`\u26A1 No package.json file found, using ${pkgPath} as the output directory`
|
|
102405
102254
|
);
|
|
102406
102255
|
}
|
|
102407
102256
|
return pkgPath;
|
|
102408
102257
|
};
|
|
102409
102258
|
async function runEsbuild(options, {
|
|
102410
|
-
format:
|
|
102259
|
+
format: format2,
|
|
102411
102260
|
css,
|
|
102412
102261
|
logger: logger3,
|
|
102413
102262
|
buildDependencies,
|
|
102414
102263
|
pluginContainer
|
|
102415
102264
|
}) {
|
|
102416
|
-
const pkgPath = packageJsonSearch(options.outDir, options.silent,
|
|
102417
|
-
logger3.info(
|
|
102265
|
+
const pkgPath = packageJsonSearch(options.outDir, options.silent, format2, logger3);
|
|
102266
|
+
logger3.info(format2, `\u26A1 Running ESBuild: ${pkgPath}`);
|
|
102418
102267
|
const pkg = await _chunk7G76EW2Rjs.loadPkg.call(void 0, pkgPath);
|
|
102419
102268
|
const deps = await _chunk7G76EW2Rjs.getProductionDeps.call(void 0, pkgPath);
|
|
102420
102269
|
const external = [
|
|
@@ -102423,41 +102272,41 @@ var require_dist6 = __commonJS({
|
|
|
102423
102272
|
...await generateExternal(options.external || [], options, logger3)
|
|
102424
102273
|
];
|
|
102425
102274
|
const outDir = options.outDir;
|
|
102426
|
-
const outExtension2 = getOutputExtensionMap(options,
|
|
102275
|
+
const outExtension2 = getOutputExtensionMap(options, format2, pkg.type);
|
|
102427
102276
|
const env2 = {
|
|
102428
102277
|
...options.env
|
|
102429
102278
|
};
|
|
102430
102279
|
if (options.replaceNodeEnv) {
|
|
102431
102280
|
env2.NODE_ENV = options.minify || options.minifyWhitespace ? "production" : "development";
|
|
102432
102281
|
}
|
|
102433
|
-
logger3.info(
|
|
102282
|
+
logger3.info(format2, "Build start");
|
|
102434
102283
|
const startTime = Date.now();
|
|
102435
102284
|
let result;
|
|
102436
|
-
const splitting =
|
|
102285
|
+
const splitting = format2 === "iife" ? false : typeof options.splitting === "boolean" ? options.splitting : format2 === "esm";
|
|
102437
102286
|
const platform = options.platform || "node";
|
|
102438
102287
|
const loader = options.loader || {};
|
|
102439
102288
|
const injectShims = options.shims;
|
|
102440
102289
|
pluginContainer.setContext({
|
|
102441
|
-
format:
|
|
102290
|
+
format: format2,
|
|
102442
102291
|
splitting,
|
|
102443
102292
|
options,
|
|
102444
102293
|
logger: logger3
|
|
102445
102294
|
});
|
|
102446
102295
|
await pluginContainer.buildStarted();
|
|
102447
102296
|
const esbuildPlugins = [
|
|
102448
|
-
|
|
102297
|
+
format2 === "cjs" && nodeProtocolPlugin(),
|
|
102449
102298
|
{
|
|
102450
102299
|
name: "modify-options",
|
|
102451
102300
|
setup(build22) {
|
|
102452
102301
|
pluginContainer.modifyEsbuildOptions(build22.initialOptions);
|
|
102453
102302
|
if (options.esbuildOptions) {
|
|
102454
|
-
options.esbuildOptions(build22.initialOptions, { format:
|
|
102303
|
+
options.esbuildOptions(build22.initialOptions, { format: format2 });
|
|
102455
102304
|
}
|
|
102456
102305
|
}
|
|
102457
102306
|
},
|
|
102458
102307
|
// esbuild's `external` option doesn't support RegExp
|
|
102459
102308
|
// So here we use a custom plugin to implement it
|
|
102460
|
-
|
|
102309
|
+
format2 !== "iife" && externalPlugin({
|
|
102461
102310
|
external,
|
|
102462
102311
|
noExternal: options.noExternal,
|
|
102463
102312
|
skipNodeModulesBundle: options.skipNodeModulesBundle,
|
|
@@ -102475,12 +102324,12 @@ var require_dist6 = __commonJS({
|
|
|
102475
102324
|
if (options.skipNativeModulesPlugin !== true) {
|
|
102476
102325
|
esbuildPlugins.push(nativeNodeModulesPlugin());
|
|
102477
102326
|
}
|
|
102478
|
-
const banner = typeof options.banner === "function" ? options.banner({ format:
|
|
102479
|
-
const footer = typeof options.footer === "function" ? options.footer({ format:
|
|
102327
|
+
const banner = typeof options.banner === "function" ? options.banner({ format: format2 }) : options.banner;
|
|
102328
|
+
const footer = typeof options.footer === "function" ? options.footer({ format: format2 }) : options.footer;
|
|
102480
102329
|
try {
|
|
102481
102330
|
result = await _esbuild.build.call(void 0, {
|
|
102482
102331
|
entryPoints: options.entry,
|
|
102483
|
-
format:
|
|
102332
|
+
format: format2 === "cjs" && splitting || options.treeshake ? "esm" : format2,
|
|
102484
102333
|
bundle: typeof options.bundle === "undefined" ? true : options.bundle,
|
|
102485
102334
|
platform,
|
|
102486
102335
|
globalName: options.globalName,
|
|
@@ -102519,8 +102368,8 @@ var require_dist6 = __commonJS({
|
|
|
102519
102368
|
mainFields: platform === "node" ? ["module", "main"] : ["browser", "module", "main"],
|
|
102520
102369
|
plugins: esbuildPlugins.filter(_chunkGQ77QZBOjs.truthy),
|
|
102521
102370
|
define: {
|
|
102522
|
-
TSUP_FORMAT: JSON.stringify(
|
|
102523
|
-
...
|
|
102371
|
+
TSUP_FORMAT: JSON.stringify(format2),
|
|
102372
|
+
...format2 === "cjs" && injectShims ? {
|
|
102524
102373
|
"import.meta.url": "importMetaUrl"
|
|
102525
102374
|
} : {},
|
|
102526
102375
|
...options.define,
|
|
@@ -102534,11 +102383,11 @@ var require_dist6 = __commonJS({
|
|
|
102534
102383
|
}, {})
|
|
102535
102384
|
},
|
|
102536
102385
|
inject: [
|
|
102537
|
-
|
|
102538
|
-
|
|
102386
|
+
format2 === "cjs" && injectShims ? _path2.default.join(__dirname, "../../../assets/cjs_shims.js") : "",
|
|
102387
|
+
format2 === "esm" && injectShims && platform === "node" ? _path2.default.join(__dirname, "../../../assets/esm_shims.js") : "",
|
|
102539
102388
|
...options.inject || []
|
|
102540
102389
|
].filter(Boolean),
|
|
102541
|
-
outdir: options.legacyOutput &&
|
|
102390
|
+
outdir: options.legacyOutput && format2 !== "cjs" ? _path2.default.join(outDir, format2) : outDir,
|
|
102542
102391
|
outExtension: options.legacyOutput ? void 0 : outExtension2,
|
|
102543
102392
|
write: false,
|
|
102544
102393
|
splitting,
|
|
@@ -102554,7 +102403,7 @@ var require_dist6 = __commonJS({
|
|
|
102554
102403
|
});
|
|
102555
102404
|
await new Promise((r) => setTimeout(r, 100));
|
|
102556
102405
|
} catch (error) {
|
|
102557
|
-
logger3.error(
|
|
102406
|
+
logger3.error(format2, "Build failed");
|
|
102558
102407
|
throw error;
|
|
102559
102408
|
}
|
|
102560
102409
|
if (result && result.warnings && !_chunk7G76EW2Rjs.getSilent.call(void 0)) {
|
|
@@ -102579,14 +102428,14 @@ var require_dist6 = __commonJS({
|
|
|
102579
102428
|
metafile: result.metafile
|
|
102580
102429
|
});
|
|
102581
102430
|
const timeInMs = Date.now() - startTime;
|
|
102582
|
-
logger3.success(
|
|
102431
|
+
logger3.success(format2, `\u26A1\uFE0F Build success in ${Math.floor(timeInMs)}ms`);
|
|
102583
102432
|
}
|
|
102584
102433
|
if (result.metafile) {
|
|
102585
102434
|
for (const file of Object.keys(result.metafile.inputs)) {
|
|
102586
102435
|
buildDependencies.add(file);
|
|
102587
102436
|
}
|
|
102588
102437
|
if (options.metafile) {
|
|
102589
|
-
const outPath = _path2.default.resolve(outDir, `metafile-${
|
|
102438
|
+
const outPath = _path2.default.resolve(outDir, `metafile-${format2}.json`);
|
|
102590
102439
|
await _fs2.default.promises.mkdir(_path2.default.dirname(outPath), { recursive: true });
|
|
102591
102440
|
await _fs2.default.promises.writeFile(
|
|
102592
102441
|
outPath,
|
|
@@ -102919,7 +102768,7 @@ var require_dist6 = __commonJS({
|
|
|
102919
102768
|
};
|
|
102920
102769
|
var terserPlugin = ({
|
|
102921
102770
|
minifyOptions,
|
|
102922
|
-
format:
|
|
102771
|
+
format: format2,
|
|
102923
102772
|
terserOptions = {},
|
|
102924
102773
|
globalName,
|
|
102925
102774
|
logger: logger3
|
|
@@ -102937,9 +102786,9 @@ var require_dist6 = __commonJS({
|
|
|
102937
102786
|
}
|
|
102938
102787
|
const { minify } = terser;
|
|
102939
102788
|
const defaultOptions2 = {};
|
|
102940
|
-
if (
|
|
102789
|
+
if (format2 === "esm") {
|
|
102941
102790
|
defaultOptions2.module = true;
|
|
102942
|
-
} else if (!(
|
|
102791
|
+
} else if (!(format2 === "iife" && globalName !== void 0)) {
|
|
102943
102792
|
defaultOptions2.toplevel = true;
|
|
102944
102793
|
}
|
|
102945
102794
|
try {
|
|
@@ -103255,14 +103104,14 @@ var require_dist6 = __commonJS({
|
|
|
103255
103104
|
);
|
|
103256
103105
|
}
|
|
103257
103106
|
}
|
|
103258
|
-
async function rollupDtsFiles(options, exports2,
|
|
103107
|
+
async function rollupDtsFiles(options, exports2, format2) {
|
|
103259
103108
|
let declarationDir = _chunkGQ77QZBOjs.ensureTempDeclarationDir.call(void 0, options);
|
|
103260
103109
|
let outDir = options.outDir || "dist";
|
|
103261
103110
|
let pkgPath = packageJsonSearch(outDir, options.silent, "dts", logger2);
|
|
103262
103111
|
!options.silent && logger2.info("dts", `\u26A1 Preparing to run Rollup (DTS generate): ${pkgPath}`);
|
|
103263
103112
|
!options.silent && logger2.info("dts", `\u26A1 Exports list to use in generation: ${exports2.map((e) => JSON.stringify(e)).join("\n")}`);
|
|
103264
103113
|
let pkg = await _chunk7G76EW2Rjs.loadPkg.call(void 0, pkgPath);
|
|
103265
|
-
let dtsExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format:
|
|
103114
|
+
let dtsExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format: format2, pkgType: pkg.type }).dts;
|
|
103266
103115
|
let dtsInputFilePath = _path2.default.join(
|
|
103267
103116
|
declarationDir,
|
|
103268
103117
|
"_tsup-dts-aggregation" + dtsExtension
|
|
@@ -103290,8 +103139,8 @@ var require_dist6 = __commonJS({
|
|
|
103290
103139
|
if (!exports2) {
|
|
103291
103140
|
throw new Error("Unexpected internal error: dts exports is not define");
|
|
103292
103141
|
}
|
|
103293
|
-
for (const
|
|
103294
|
-
await rollupDtsFiles(options, exports2,
|
|
103142
|
+
for (const format2 of options.format) {
|
|
103143
|
+
await rollupDtsFiles(options, exports2, format2);
|
|
103295
103144
|
}
|
|
103296
103145
|
logger2.success("dts", `\u26A1\uFE0F Build success in ${getDuration()}`);
|
|
103297
103146
|
} catch (error) {
|
|
@@ -103505,7 +103354,7 @@ var require_dist6 = __commonJS({
|
|
|
103505
103354
|
}
|
|
103506
103355
|
const css = /* @__PURE__ */ new Map();
|
|
103507
103356
|
await Promise.all([
|
|
103508
|
-
...options.format.map(async (
|
|
103357
|
+
...options.format.map(async (format2, index) => {
|
|
103509
103358
|
const pluginContainer = new PluginContainer([
|
|
103510
103359
|
shebang(),
|
|
103511
103360
|
...options.plugins || [],
|
|
@@ -103520,7 +103369,7 @@ var require_dist6 = __commonJS({
|
|
|
103520
103369
|
sizeReporter(),
|
|
103521
103370
|
terserPlugin({
|
|
103522
103371
|
minifyOptions: options.minify,
|
|
103523
|
-
format:
|
|
103372
|
+
format: format2,
|
|
103524
103373
|
terserOptions: options.terserOptions,
|
|
103525
103374
|
globalName: options.globalName,
|
|
103526
103375
|
logger: logger3
|
|
@@ -103528,7 +103377,7 @@ var require_dist6 = __commonJS({
|
|
|
103528
103377
|
]);
|
|
103529
103378
|
await runEsbuild(options, {
|
|
103530
103379
|
pluginContainer,
|
|
103531
|
-
format:
|
|
103380
|
+
format: format2,
|
|
103532
103381
|
css: index === 0 || options.injectStyle ? css : void 0,
|
|
103533
103382
|
logger: logger3,
|
|
103534
103383
|
buildDependencies
|
|
@@ -103622,6 +103471,157 @@ var require_dist6 = __commonJS({
|
|
|
103622
103471
|
}
|
|
103623
103472
|
});
|
|
103624
103473
|
|
|
103474
|
+
// node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js
|
|
103475
|
+
var require_brace_expansion2 = __commonJS({
|
|
103476
|
+
"node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(exports, module2) {
|
|
103477
|
+
var balanced = require_balanced_match();
|
|
103478
|
+
module2.exports = expandTop;
|
|
103479
|
+
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
103480
|
+
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
103481
|
+
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
103482
|
+
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
103483
|
+
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
103484
|
+
function numeric(str) {
|
|
103485
|
+
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
|
103486
|
+
}
|
|
103487
|
+
function escapeBraces(str) {
|
|
103488
|
+
return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
|
103489
|
+
}
|
|
103490
|
+
function unescapeBraces(str) {
|
|
103491
|
+
return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
|
103492
|
+
}
|
|
103493
|
+
function parseCommaParts(str) {
|
|
103494
|
+
if (!str)
|
|
103495
|
+
return [""];
|
|
103496
|
+
var parts = [];
|
|
103497
|
+
var m = balanced("{", "}", str);
|
|
103498
|
+
if (!m)
|
|
103499
|
+
return str.split(",");
|
|
103500
|
+
var pre = m.pre;
|
|
103501
|
+
var body = m.body;
|
|
103502
|
+
var post = m.post;
|
|
103503
|
+
var p = pre.split(",");
|
|
103504
|
+
p[p.length - 1] += "{" + body + "}";
|
|
103505
|
+
var postParts = parseCommaParts(post);
|
|
103506
|
+
if (post.length) {
|
|
103507
|
+
p[p.length - 1] += postParts.shift();
|
|
103508
|
+
p.push.apply(p, postParts);
|
|
103509
|
+
}
|
|
103510
|
+
parts.push.apply(parts, p);
|
|
103511
|
+
return parts;
|
|
103512
|
+
}
|
|
103513
|
+
function expandTop(str) {
|
|
103514
|
+
if (!str)
|
|
103515
|
+
return [];
|
|
103516
|
+
if (str.substr(0, 2) === "{}") {
|
|
103517
|
+
str = "\\{\\}" + str.substr(2);
|
|
103518
|
+
}
|
|
103519
|
+
return expand2(escapeBraces(str), true).map(unescapeBraces);
|
|
103520
|
+
}
|
|
103521
|
+
function embrace(str) {
|
|
103522
|
+
return "{" + str + "}";
|
|
103523
|
+
}
|
|
103524
|
+
function isPadded(el) {
|
|
103525
|
+
return /^-?0\d/.test(el);
|
|
103526
|
+
}
|
|
103527
|
+
function lte(i, y) {
|
|
103528
|
+
return i <= y;
|
|
103529
|
+
}
|
|
103530
|
+
function gte(i, y) {
|
|
103531
|
+
return i >= y;
|
|
103532
|
+
}
|
|
103533
|
+
function expand2(str, isTop) {
|
|
103534
|
+
var expansions = [];
|
|
103535
|
+
var m = balanced("{", "}", str);
|
|
103536
|
+
if (!m)
|
|
103537
|
+
return [str];
|
|
103538
|
+
var pre = m.pre;
|
|
103539
|
+
var post = m.post.length ? expand2(m.post, false) : [""];
|
|
103540
|
+
if (/\$$/.test(m.pre)) {
|
|
103541
|
+
for (var k = 0; k < post.length; k++) {
|
|
103542
|
+
var expansion = pre + "{" + m.body + "}" + post[k];
|
|
103543
|
+
expansions.push(expansion);
|
|
103544
|
+
}
|
|
103545
|
+
} else {
|
|
103546
|
+
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
103547
|
+
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
103548
|
+
var isSequence = isNumericSequence || isAlphaSequence;
|
|
103549
|
+
var isOptions = m.body.indexOf(",") >= 0;
|
|
103550
|
+
if (!isSequence && !isOptions) {
|
|
103551
|
+
if (m.post.match(/,.*\}/)) {
|
|
103552
|
+
str = m.pre + "{" + m.body + escClose + m.post;
|
|
103553
|
+
return expand2(str);
|
|
103554
|
+
}
|
|
103555
|
+
return [str];
|
|
103556
|
+
}
|
|
103557
|
+
var n;
|
|
103558
|
+
if (isSequence) {
|
|
103559
|
+
n = m.body.split(/\.\./);
|
|
103560
|
+
} else {
|
|
103561
|
+
n = parseCommaParts(m.body);
|
|
103562
|
+
if (n.length === 1) {
|
|
103563
|
+
n = expand2(n[0], false).map(embrace);
|
|
103564
|
+
if (n.length === 1) {
|
|
103565
|
+
return post.map(function(p) {
|
|
103566
|
+
return m.pre + n[0] + p;
|
|
103567
|
+
});
|
|
103568
|
+
}
|
|
103569
|
+
}
|
|
103570
|
+
}
|
|
103571
|
+
var N;
|
|
103572
|
+
if (isSequence) {
|
|
103573
|
+
var x = numeric(n[0]);
|
|
103574
|
+
var y = numeric(n[1]);
|
|
103575
|
+
var width = Math.max(n[0].length, n[1].length);
|
|
103576
|
+
var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
|
|
103577
|
+
var test = lte;
|
|
103578
|
+
var reverse = y < x;
|
|
103579
|
+
if (reverse) {
|
|
103580
|
+
incr *= -1;
|
|
103581
|
+
test = gte;
|
|
103582
|
+
}
|
|
103583
|
+
var pad = n.some(isPadded);
|
|
103584
|
+
N = [];
|
|
103585
|
+
for (var i = x; test(i, y); i += incr) {
|
|
103586
|
+
var c;
|
|
103587
|
+
if (isAlphaSequence) {
|
|
103588
|
+
c = String.fromCharCode(i);
|
|
103589
|
+
if (c === "\\")
|
|
103590
|
+
c = "";
|
|
103591
|
+
} else {
|
|
103592
|
+
c = String(i);
|
|
103593
|
+
if (pad) {
|
|
103594
|
+
var need = width - c.length;
|
|
103595
|
+
if (need > 0) {
|
|
103596
|
+
var z = new Array(need + 1).join("0");
|
|
103597
|
+
if (i < 0)
|
|
103598
|
+
c = "-" + z + c.slice(1);
|
|
103599
|
+
else
|
|
103600
|
+
c = z + c;
|
|
103601
|
+
}
|
|
103602
|
+
}
|
|
103603
|
+
}
|
|
103604
|
+
N.push(c);
|
|
103605
|
+
}
|
|
103606
|
+
} else {
|
|
103607
|
+
N = [];
|
|
103608
|
+
for (var j = 0; j < n.length; j++) {
|
|
103609
|
+
N.push.apply(N, expand2(n[j], false));
|
|
103610
|
+
}
|
|
103611
|
+
}
|
|
103612
|
+
for (var j = 0; j < N.length; j++) {
|
|
103613
|
+
for (var k = 0; k < post.length; k++) {
|
|
103614
|
+
var expansion = pre + N[j] + post[k];
|
|
103615
|
+
if (!isTop || isSequence || expansion)
|
|
103616
|
+
expansions.push(expansion);
|
|
103617
|
+
}
|
|
103618
|
+
}
|
|
103619
|
+
}
|
|
103620
|
+
return expansions;
|
|
103621
|
+
}
|
|
103622
|
+
}
|
|
103623
|
+
});
|
|
103624
|
+
|
|
103625
103625
|
// node_modules/.pnpm/typia@5.3.9_typescript@5.2.2/node_modules/typia/lib/transformers/ImportTransformer.js
|
|
103626
103626
|
var require_ImportTransformer = __commonJS({
|
|
103627
103627
|
"node_modules/.pnpm/typia@5.3.9_typescript@5.2.2/node_modules/typia/lib/transformers/ImportTransformer.js"(exports) {
|
|
@@ -132237,7 +132237,7 @@ function defaultConfig({
|
|
|
132237
132237
|
tsconfig = "tsconfig.json",
|
|
132238
132238
|
splitting,
|
|
132239
132239
|
treeshake,
|
|
132240
|
-
format:
|
|
132240
|
+
format: format2 = ["cjs", "esm"],
|
|
132241
132241
|
debug = false,
|
|
132242
132242
|
shims = true,
|
|
132243
132243
|
external,
|
|
@@ -132260,7 +132260,7 @@ function defaultConfig({
|
|
|
132260
132260
|
return {
|
|
132261
132261
|
name: "default",
|
|
132262
132262
|
entry,
|
|
132263
|
-
format:
|
|
132263
|
+
format: format2,
|
|
132264
132264
|
target: platform !== "node" ? ["chrome91", "firefox90", "edge91", "safari15", "ios15", "opera77", "esnext"] : ["esnext", "node20"],
|
|
132265
132265
|
tsconfig,
|
|
132266
132266
|
splitting,
|
|
@@ -132314,18 +132314,18 @@ function getConfig(workspaceRoot, projectRoot, getConfigFn, { outputPath, tsConf
|
|
|
132314
132314
|
platform
|
|
132315
132315
|
});
|
|
132316
132316
|
}
|
|
132317
|
-
var outExtension = ({ format:
|
|
132317
|
+
var outExtension = ({ format: format2 }) => {
|
|
132318
132318
|
let jsExtension = ".js";
|
|
132319
132319
|
let dtsExtension = ".d.ts";
|
|
132320
|
-
if (
|
|
132320
|
+
if (format2 === "cjs") {
|
|
132321
132321
|
jsExtension = ".cjs";
|
|
132322
132322
|
dtsExtension = ".d.cts";
|
|
132323
132323
|
}
|
|
132324
|
-
if (
|
|
132324
|
+
if (format2 === "esm") {
|
|
132325
132325
|
jsExtension = ".js";
|
|
132326
132326
|
dtsExtension = ".d.ts";
|
|
132327
132327
|
}
|
|
132328
|
-
if (
|
|
132328
|
+
if (format2 === "iife") {
|
|
132329
132329
|
jsExtension = ".global.js";
|
|
132330
132330
|
}
|
|
132331
132331
|
return {
|
|
@@ -132726,8 +132726,6 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
132726
132726
|
};
|
|
132727
132727
|
|
|
132728
132728
|
// packages/workspace-tools/src/utils/run-tsup-build.ts
|
|
132729
|
-
var import_node_fs5 = require("node:fs");
|
|
132730
|
-
var import_promises3 = require("node:fs/promises");
|
|
132731
132729
|
var import_node_path5 = require("node:path");
|
|
132732
132730
|
var import_esbuild_decorators = __toESM(require_src2());
|
|
132733
132731
|
var import_devkit3 = __toESM(require_devkit());
|
|
@@ -132775,6 +132773,181 @@ var environmentPlugin = (data) => ({
|
|
|
132775
132773
|
}
|
|
132776
132774
|
});
|
|
132777
132775
|
|
|
132776
|
+
// packages/workspace-tools/src/utils/run-tsup-build.ts
|
|
132777
|
+
var import_tsup = __toESM(require_dist6());
|
|
132778
|
+
var ts = __toESM(require("typescript"));
|
|
132779
|
+
var applyDefaultOptions = (options) => {
|
|
132780
|
+
options.entry ??= "{sourceRoot}/index.ts";
|
|
132781
|
+
options.outputPath ??= "dist/{projectRoot}";
|
|
132782
|
+
options.tsConfig ??= "tsconfig.json";
|
|
132783
|
+
options.generatePackageJson ??= true;
|
|
132784
|
+
options.splitting ??= true;
|
|
132785
|
+
options.treeshake ??= true;
|
|
132786
|
+
options.platform ??= "neutral";
|
|
132787
|
+
options.format ??= ["cjs", "esm"];
|
|
132788
|
+
options.verbose ??= false;
|
|
132789
|
+
options.external ??= [];
|
|
132790
|
+
options.additionalEntryPoints ??= [];
|
|
132791
|
+
options.assets ??= [];
|
|
132792
|
+
options.plugins ??= [];
|
|
132793
|
+
options.includeSrc ??= false;
|
|
132794
|
+
options.minify ??= false;
|
|
132795
|
+
options.clean ??= true;
|
|
132796
|
+
options.bundle ??= true;
|
|
132797
|
+
options.debug ??= false;
|
|
132798
|
+
options.watch ??= false;
|
|
132799
|
+
options.apiReport ??= true;
|
|
132800
|
+
options.docModel ??= true;
|
|
132801
|
+
options.tsdocMetadata ??= true;
|
|
132802
|
+
options.emitOnAll ??= false;
|
|
132803
|
+
options.metafile ??= true;
|
|
132804
|
+
options.skipNativeModulesPlugin ??= false;
|
|
132805
|
+
options.define ??= {};
|
|
132806
|
+
options.env ??= {};
|
|
132807
|
+
options.getConfig ??= { dist: defaultConfig };
|
|
132808
|
+
return options;
|
|
132809
|
+
};
|
|
132810
|
+
var runTsupBuild = async (context, config, options) => {
|
|
132811
|
+
const stormEnv = Object.keys(options.env).filter((key) => key.startsWith("STORM_")).reduce((ret, key) => {
|
|
132812
|
+
ret[key] = options.env[key];
|
|
132813
|
+
return ret;
|
|
132814
|
+
}, {});
|
|
132815
|
+
options.plugins.push(
|
|
132816
|
+
(0, import_esbuild_decorators.esbuildDecorators)({
|
|
132817
|
+
tsconfig: options.tsConfig,
|
|
132818
|
+
cwd: config.workspaceRoot
|
|
132819
|
+
})
|
|
132820
|
+
);
|
|
132821
|
+
options.plugins.push(environmentPlugin(stormEnv));
|
|
132822
|
+
const getConfigOptions = {
|
|
132823
|
+
...options,
|
|
132824
|
+
define: {
|
|
132825
|
+
__STORM_CONFIG: JSON.stringify(stormEnv)
|
|
132826
|
+
},
|
|
132827
|
+
env: {
|
|
132828
|
+
__STORM_CONFIG: JSON.stringify(stormEnv),
|
|
132829
|
+
...stormEnv
|
|
132830
|
+
},
|
|
132831
|
+
dtsTsConfig: getNormalizedTsConfig(
|
|
132832
|
+
config.workspaceRoot,
|
|
132833
|
+
options.outputPath,
|
|
132834
|
+
createTypeScriptCompilationOptions(
|
|
132835
|
+
(0, import_normalize_options.normalizeOptions)(
|
|
132836
|
+
{
|
|
132837
|
+
...options,
|
|
132838
|
+
watch: false,
|
|
132839
|
+
main: context.entry,
|
|
132840
|
+
transformers: []
|
|
132841
|
+
},
|
|
132842
|
+
config.workspaceRoot,
|
|
132843
|
+
context.sourceRoot,
|
|
132844
|
+
config.workspaceRoot
|
|
132845
|
+
),
|
|
132846
|
+
context.projectName
|
|
132847
|
+
)
|
|
132848
|
+
),
|
|
132849
|
+
banner: options.banner ? {
|
|
132850
|
+
js: `${options.banner}
|
|
132851
|
+
|
|
132852
|
+
`,
|
|
132853
|
+
css: `/*
|
|
132854
|
+
${options.banner}
|
|
132855
|
+
|
|
132856
|
+
|
|
132857
|
+
|
|
132858
|
+
*/`
|
|
132859
|
+
} : void 0,
|
|
132860
|
+
outputPath: options.outputPath,
|
|
132861
|
+
entry: context.entry
|
|
132862
|
+
};
|
|
132863
|
+
if (options.getConfig) {
|
|
132864
|
+
writeInfo(config, "\u26A1 Running the Build process");
|
|
132865
|
+
const getConfigFns = _isFunction(options.getConfig) ? [options.getConfig] : Object.keys(options.getConfig).map((key) => options.getConfig[key]);
|
|
132866
|
+
const tsupConfig = (0, import_tsup.defineConfig)(
|
|
132867
|
+
getConfigFns.map(
|
|
132868
|
+
(getConfigFn) => getConfig(config.workspaceRoot, context.projectRoot, getConfigFn, getConfigOptions)
|
|
132869
|
+
)
|
|
132870
|
+
);
|
|
132871
|
+
if (_isFunction(tsupConfig)) {
|
|
132872
|
+
await build(await Promise.resolve(tsupConfig({})), config);
|
|
132873
|
+
} else {
|
|
132874
|
+
await build(tsupConfig, config);
|
|
132875
|
+
}
|
|
132876
|
+
} else if (getLogLevel(config?.logLevel) >= LogLevel.WARN) {
|
|
132877
|
+
writeWarning(
|
|
132878
|
+
config,
|
|
132879
|
+
"The Build process did not run because no `getConfig` parameter was provided"
|
|
132880
|
+
);
|
|
132881
|
+
}
|
|
132882
|
+
};
|
|
132883
|
+
function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
132884
|
+
const config = ts.readConfigFile(options.tsConfig, ts.sys.readFile).config;
|
|
132885
|
+
const tsConfig = ts.parseJsonConfigFileContent(
|
|
132886
|
+
{
|
|
132887
|
+
...config,
|
|
132888
|
+
compilerOptions: {
|
|
132889
|
+
...config.compilerOptions,
|
|
132890
|
+
outDir: outputPath,
|
|
132891
|
+
rootDir: workspaceRoot,
|
|
132892
|
+
baseUrl: workspaceRoot,
|
|
132893
|
+
allowJs: true,
|
|
132894
|
+
noEmit: false,
|
|
132895
|
+
esModuleInterop: true,
|
|
132896
|
+
downlevelIteration: true,
|
|
132897
|
+
forceConsistentCasingInFileNames: true,
|
|
132898
|
+
emitDeclarationOnly: true,
|
|
132899
|
+
declaration: true,
|
|
132900
|
+
declarationMap: true,
|
|
132901
|
+
declarationDir: (0, import_devkit3.joinPathFragments)(workspaceRoot, "tmp", ".tsup", "declaration")
|
|
132902
|
+
}
|
|
132903
|
+
},
|
|
132904
|
+
ts.sys,
|
|
132905
|
+
(0, import_node_path5.dirname)(options.tsConfig)
|
|
132906
|
+
);
|
|
132907
|
+
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
132908
|
+
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|
|
132909
|
+
tsConfig.options.tsBuildInfoFile = (0, import_devkit3.joinPathFragments)(outputPath, "tsconfig.tsbuildinfo");
|
|
132910
|
+
}
|
|
132911
|
+
return tsConfig;
|
|
132912
|
+
}
|
|
132913
|
+
var build = async (options, config) => {
|
|
132914
|
+
if (Array.isArray(options)) {
|
|
132915
|
+
await Promise.all(options.map((buildOptions) => build(buildOptions, config)));
|
|
132916
|
+
} else {
|
|
132917
|
+
if (getLogLevel(config?.logLevel) >= LogLevel.TRACE && !options.silent) {
|
|
132918
|
+
console.log("\u2699\uFE0F Tsup build config: \n", options, "\n");
|
|
132919
|
+
}
|
|
132920
|
+
await (0, import_tsup.build)(options);
|
|
132921
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
132922
|
+
}
|
|
132923
|
+
};
|
|
132924
|
+
var _isFunction = (value) => {
|
|
132925
|
+
try {
|
|
132926
|
+
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
132927
|
+
} catch (e) {
|
|
132928
|
+
return false;
|
|
132929
|
+
}
|
|
132930
|
+
};
|
|
132931
|
+
var createTypeScriptCompilationOptions = (normalizedOptions, projectName) => {
|
|
132932
|
+
return {
|
|
132933
|
+
outputPath: normalizedOptions.outputPath,
|
|
132934
|
+
projectName,
|
|
132935
|
+
projectRoot: normalizedOptions.projectRoot,
|
|
132936
|
+
rootDir: normalizedOptions.rootDir,
|
|
132937
|
+
tsConfig: normalizedOptions.tsConfig,
|
|
132938
|
+
watch: normalizedOptions.watch,
|
|
132939
|
+
deleteOutputPath: normalizedOptions.clean,
|
|
132940
|
+
getCustomTransformers: (0, import_get_custom_transformers_factory.getCustomTrasformersFactory)(normalizedOptions.transformers)
|
|
132941
|
+
};
|
|
132942
|
+
};
|
|
132943
|
+
|
|
132944
|
+
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
132945
|
+
var import_node_fs5 = require("node:fs");
|
|
132946
|
+
var import_promises3 = require("node:fs/promises");
|
|
132947
|
+
var import_devkit4 = __toESM(require_devkit());
|
|
132948
|
+
var import_js2 = __toESM(require_src());
|
|
132949
|
+
var import_fs_extra = __toESM(require_lib4());
|
|
132950
|
+
|
|
132778
132951
|
// node_modules/.pnpm/minimatch@9.0.3/node_modules/minimatch/dist/mjs/index.js
|
|
132779
132952
|
var import_brace_expansion = __toESM(require_brace_expansion2(), 1);
|
|
132780
132953
|
|
|
@@ -138949,220 +139122,9 @@ var glob = Object.assign(glob_, {
|
|
|
138949
139122
|
});
|
|
138950
139123
|
glob.glob = glob;
|
|
138951
139124
|
|
|
138952
|
-
// packages/workspace-tools/src/utils/run-tsup-build.ts
|
|
138953
|
-
var import_prettier = require("prettier");
|
|
138954
|
-
var import_tsup = __toESM(require_dist6());
|
|
138955
|
-
var ts = __toESM(require("typescript"));
|
|
138956
|
-
var applyDefaultOptions = (options) => {
|
|
138957
|
-
options.entry ??= "{sourceRoot}/index.ts";
|
|
138958
|
-
options.outputPath ??= "dist/{projectRoot}";
|
|
138959
|
-
options.tsConfig ??= "tsconfig.json";
|
|
138960
|
-
options.generatePackageJson ??= true;
|
|
138961
|
-
options.splitting ??= true;
|
|
138962
|
-
options.treeshake ??= true;
|
|
138963
|
-
options.platform ??= "neutral";
|
|
138964
|
-
options.format ??= ["cjs", "esm"];
|
|
138965
|
-
options.verbose ??= false;
|
|
138966
|
-
options.external ??= [];
|
|
138967
|
-
options.additionalEntryPoints ??= [];
|
|
138968
|
-
options.assets ??= [];
|
|
138969
|
-
options.plugins ??= [];
|
|
138970
|
-
options.includeSrc ??= false;
|
|
138971
|
-
options.minify ??= false;
|
|
138972
|
-
options.clean ??= true;
|
|
138973
|
-
options.bundle ??= true;
|
|
138974
|
-
options.debug ??= false;
|
|
138975
|
-
options.watch ??= false;
|
|
138976
|
-
options.apiReport ??= true;
|
|
138977
|
-
options.docModel ??= true;
|
|
138978
|
-
options.tsdocMetadata ??= true;
|
|
138979
|
-
options.emitOnAll ??= false;
|
|
138980
|
-
options.metafile ??= true;
|
|
138981
|
-
options.skipNativeModulesPlugin ??= false;
|
|
138982
|
-
options.define ??= {};
|
|
138983
|
-
options.env ??= {};
|
|
138984
|
-
options.getConfig ??= { dist: defaultConfig };
|
|
138985
|
-
return options;
|
|
138986
|
-
};
|
|
138987
|
-
var runTsupBuild = async (context, config, options) => {
|
|
138988
|
-
if (options.includeSrc === true) {
|
|
138989
|
-
const files = globSync([
|
|
138990
|
-
(0, import_devkit3.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.ts"),
|
|
138991
|
-
(0, import_devkit3.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.tsx"),
|
|
138992
|
-
(0, import_devkit3.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.js"),
|
|
138993
|
-
(0, import_devkit3.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.jsx")
|
|
138994
|
-
]);
|
|
138995
|
-
await Promise.allSettled(
|
|
138996
|
-
files.map(
|
|
138997
|
-
async (file) => (0, import_promises3.writeFile)(
|
|
138998
|
-
file,
|
|
138999
|
-
await (0, import_prettier.format)(
|
|
139000
|
-
`${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
|
|
139001
|
-
|
|
139002
|
-
${(0, import_node_fs5.readFileSync)(file, "utf-8")}`,
|
|
139003
|
-
{
|
|
139004
|
-
...{
|
|
139005
|
-
plugins: ["prettier-plugin-packagejson"],
|
|
139006
|
-
trailingComma: "none",
|
|
139007
|
-
tabWidth: 2,
|
|
139008
|
-
semi: true,
|
|
139009
|
-
singleQuote: false,
|
|
139010
|
-
quoteProps: "preserve",
|
|
139011
|
-
insertPragma: false,
|
|
139012
|
-
bracketSameLine: true,
|
|
139013
|
-
printWidth: 80,
|
|
139014
|
-
bracketSpacing: true,
|
|
139015
|
-
arrowParens: "avoid",
|
|
139016
|
-
endOfLine: "lf"
|
|
139017
|
-
},
|
|
139018
|
-
parser: "typescript"
|
|
139019
|
-
}
|
|
139020
|
-
),
|
|
139021
|
-
"utf-8"
|
|
139022
|
-
)
|
|
139023
|
-
)
|
|
139024
|
-
);
|
|
139025
|
-
}
|
|
139026
|
-
const stormEnv = Object.keys(options.env).filter((key) => key.startsWith("STORM_")).reduce((ret, key) => {
|
|
139027
|
-
ret[key] = options.env[key];
|
|
139028
|
-
return ret;
|
|
139029
|
-
}, {});
|
|
139030
|
-
options.plugins.push(
|
|
139031
|
-
(0, import_esbuild_decorators.esbuildDecorators)({
|
|
139032
|
-
tsconfig: options.tsConfig,
|
|
139033
|
-
cwd: config.workspaceRoot
|
|
139034
|
-
})
|
|
139035
|
-
);
|
|
139036
|
-
options.plugins.push(environmentPlugin(stormEnv));
|
|
139037
|
-
const getConfigOptions = {
|
|
139038
|
-
...options,
|
|
139039
|
-
define: {
|
|
139040
|
-
__STORM_CONFIG: JSON.stringify(stormEnv)
|
|
139041
|
-
},
|
|
139042
|
-
env: {
|
|
139043
|
-
__STORM_CONFIG: JSON.stringify(stormEnv),
|
|
139044
|
-
...stormEnv
|
|
139045
|
-
},
|
|
139046
|
-
dtsTsConfig: getNormalizedTsConfig(
|
|
139047
|
-
config.workspaceRoot,
|
|
139048
|
-
options.outputPath,
|
|
139049
|
-
createTypeScriptCompilationOptions(
|
|
139050
|
-
(0, import_normalize_options.normalizeOptions)(
|
|
139051
|
-
{
|
|
139052
|
-
...options,
|
|
139053
|
-
watch: false,
|
|
139054
|
-
main: options.entry,
|
|
139055
|
-
transformers: []
|
|
139056
|
-
},
|
|
139057
|
-
config.workspaceRoot,
|
|
139058
|
-
context.sourceRoot,
|
|
139059
|
-
config.workspaceRoot
|
|
139060
|
-
),
|
|
139061
|
-
context.projectName
|
|
139062
|
-
)
|
|
139063
|
-
),
|
|
139064
|
-
banner: options.banner ? {
|
|
139065
|
-
js: `${options.banner}
|
|
139066
|
-
|
|
139067
|
-
`,
|
|
139068
|
-
css: `/*
|
|
139069
|
-
${options.banner}
|
|
139070
|
-
|
|
139071
|
-
|
|
139072
|
-
|
|
139073
|
-
*/`
|
|
139074
|
-
} : void 0,
|
|
139075
|
-
outputPath: options.outputPath,
|
|
139076
|
-
entry: context.entry
|
|
139077
|
-
};
|
|
139078
|
-
if (options.getConfig) {
|
|
139079
|
-
writeInfo(config, "\u26A1 Running the Build process");
|
|
139080
|
-
const getConfigFns = _isFunction(options.getConfig) ? [options.getConfig] : Object.keys(options.getConfig).map((key) => options.getConfig[key]);
|
|
139081
|
-
const tsupConfig = (0, import_tsup.defineConfig)(
|
|
139082
|
-
getConfigFns.map(
|
|
139083
|
-
(getConfigFn) => getConfig(config.workspaceRoot, context.projectRoot, getConfigFn, getConfigOptions)
|
|
139084
|
-
)
|
|
139085
|
-
);
|
|
139086
|
-
if (_isFunction(tsupConfig)) {
|
|
139087
|
-
await build(await Promise.resolve(tsupConfig({})), config);
|
|
139088
|
-
} else {
|
|
139089
|
-
await build(tsupConfig, config);
|
|
139090
|
-
}
|
|
139091
|
-
} else if (getLogLevel(config?.logLevel) >= LogLevel.WARN) {
|
|
139092
|
-
writeWarning(
|
|
139093
|
-
config,
|
|
139094
|
-
"The Build process did not run because no `getConfig` parameter was provided"
|
|
139095
|
-
);
|
|
139096
|
-
}
|
|
139097
|
-
};
|
|
139098
|
-
function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
139099
|
-
const config = ts.readConfigFile(options.tsConfig, ts.sys.readFile).config;
|
|
139100
|
-
const tsConfig = ts.parseJsonConfigFileContent(
|
|
139101
|
-
{
|
|
139102
|
-
...config,
|
|
139103
|
-
compilerOptions: {
|
|
139104
|
-
...config.compilerOptions,
|
|
139105
|
-
outDir: outputPath,
|
|
139106
|
-
rootDir: workspaceRoot,
|
|
139107
|
-
baseUrl: workspaceRoot,
|
|
139108
|
-
allowJs: true,
|
|
139109
|
-
noEmit: false,
|
|
139110
|
-
esModuleInterop: true,
|
|
139111
|
-
downlevelIteration: true,
|
|
139112
|
-
forceConsistentCasingInFileNames: true,
|
|
139113
|
-
emitDeclarationOnly: true,
|
|
139114
|
-
declaration: true,
|
|
139115
|
-
declarationMap: true,
|
|
139116
|
-
declarationDir: (0, import_devkit3.joinPathFragments)(workspaceRoot, "tmp", ".tsup", "declaration")
|
|
139117
|
-
}
|
|
139118
|
-
},
|
|
139119
|
-
ts.sys,
|
|
139120
|
-
(0, import_node_path5.dirname)(options.tsConfig)
|
|
139121
|
-
);
|
|
139122
|
-
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
139123
|
-
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|
|
139124
|
-
tsConfig.options.tsBuildInfoFile = (0, import_devkit3.joinPathFragments)(outputPath, "tsconfig.tsbuildinfo");
|
|
139125
|
-
}
|
|
139126
|
-
return tsConfig;
|
|
139127
|
-
}
|
|
139128
|
-
var build = async (options, config) => {
|
|
139129
|
-
if (Array.isArray(options)) {
|
|
139130
|
-
await Promise.all(options.map((buildOptions) => build(buildOptions, config)));
|
|
139131
|
-
} else {
|
|
139132
|
-
if (getLogLevel(config?.logLevel) >= LogLevel.TRACE && !options.silent) {
|
|
139133
|
-
console.log("\u2699\uFE0F Tsup build config: \n", options, "\n");
|
|
139134
|
-
}
|
|
139135
|
-
await (0, import_tsup.build)(options);
|
|
139136
|
-
await new Promise((r) => setTimeout(r, 100));
|
|
139137
|
-
}
|
|
139138
|
-
};
|
|
139139
|
-
var _isFunction = (value) => {
|
|
139140
|
-
try {
|
|
139141
|
-
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
139142
|
-
} catch (e) {
|
|
139143
|
-
return false;
|
|
139144
|
-
}
|
|
139145
|
-
};
|
|
139146
|
-
var createTypeScriptCompilationOptions = (normalizedOptions, projectName) => {
|
|
139147
|
-
return {
|
|
139148
|
-
outputPath: normalizedOptions.outputPath,
|
|
139149
|
-
projectName,
|
|
139150
|
-
projectRoot: normalizedOptions.projectRoot,
|
|
139151
|
-
rootDir: normalizedOptions.rootDir,
|
|
139152
|
-
tsConfig: normalizedOptions.tsConfig,
|
|
139153
|
-
watch: normalizedOptions.watch,
|
|
139154
|
-
deleteOutputPath: normalizedOptions.clean,
|
|
139155
|
-
getCustomTransformers: (0, import_get_custom_transformers_factory.getCustomTrasformersFactory)(normalizedOptions.transformers)
|
|
139156
|
-
};
|
|
139157
|
-
};
|
|
139158
|
-
|
|
139159
139125
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
139160
|
-
var import_node_fs6 = require("node:fs");
|
|
139161
|
-
var import_devkit4 = __toESM(require_devkit());
|
|
139162
|
-
var import_js2 = __toESM(require_src());
|
|
139163
|
-
var import_fs_extra = __toESM(require_lib4());
|
|
139164
139126
|
var import_fileutils = require("nx/src/utils/fileutils");
|
|
139165
|
-
var
|
|
139127
|
+
var import_prettier = require("prettier");
|
|
139166
139128
|
|
|
139167
139129
|
// packages/workspace-tools/src/utils/file-path-utils.ts
|
|
139168
139130
|
var import_node_path6 = require("node:path");
|
|
@@ -139376,41 +139338,40 @@ ${externalDependencies.map((dep) => {
|
|
|
139376
139338
|
arrowParens: "avoid",
|
|
139377
139339
|
endOfLine: "lf"
|
|
139378
139340
|
};
|
|
139379
|
-
|
|
139341
|
+
let entryPoints = [];
|
|
139380
139342
|
if (options.entry) {
|
|
139381
139343
|
entryPoints.push(options.entry);
|
|
139382
139344
|
}
|
|
139383
139345
|
if (options.emitOnAll === true) {
|
|
139384
|
-
entryPoints
|
|
139346
|
+
entryPoints = globSync((0, import_devkit4.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"), {
|
|
139347
|
+
withFileTypes: true
|
|
139348
|
+
}).reduce((ret, filePath) => {
|
|
139349
|
+
let formattedPath = workspaceRoot.replaceAll("\\", "/");
|
|
139350
|
+
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
139351
|
+
formattedPath = formattedPath.substring(2);
|
|
139352
|
+
}
|
|
139353
|
+
let propertyKey = (0, import_devkit4.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
139354
|
+
if (propertyKey) {
|
|
139355
|
+
while (propertyKey.startsWith("/")) {
|
|
139356
|
+
propertyKey = propertyKey.substring(1);
|
|
139357
|
+
}
|
|
139358
|
+
writeDebug(
|
|
139359
|
+
config,
|
|
139360
|
+
`Trying to add entry point ${propertyKey} at "${(0, import_devkit4.joinPathFragments)(
|
|
139361
|
+
filePath.path,
|
|
139362
|
+
filePath.name
|
|
139363
|
+
)}"`
|
|
139364
|
+
);
|
|
139365
|
+
if (!ret.includes(propertyKey)) {
|
|
139366
|
+
ret.push((0, import_devkit4.joinPathFragments)(filePath.path, filePath.name));
|
|
139367
|
+
}
|
|
139368
|
+
}
|
|
139369
|
+
return ret;
|
|
139370
|
+
}, entryPoints);
|
|
139385
139371
|
}
|
|
139386
139372
|
if (options.additionalEntryPoints) {
|
|
139387
139373
|
entryPoints.push(...options.additionalEntryPoints);
|
|
139388
139374
|
}
|
|
139389
|
-
const entry = globSync(entryPoints, {
|
|
139390
|
-
withFileTypes: true
|
|
139391
|
-
}).reduce((ret, filePath) => {
|
|
139392
|
-
let formattedPath = workspaceRoot.replaceAll("\\", "/");
|
|
139393
|
-
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
139394
|
-
formattedPath = formattedPath.substring(2);
|
|
139395
|
-
}
|
|
139396
|
-
let propertyKey = (0, import_devkit4.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
139397
|
-
if (propertyKey) {
|
|
139398
|
-
while (propertyKey.startsWith("/")) {
|
|
139399
|
-
propertyKey = propertyKey.substring(1);
|
|
139400
|
-
}
|
|
139401
|
-
writeDebug(
|
|
139402
|
-
config,
|
|
139403
|
-
`Trying to add entry point ${propertyKey} at "${(0, import_devkit4.joinPathFragments)(
|
|
139404
|
-
filePath.path,
|
|
139405
|
-
filePath.name
|
|
139406
|
-
)}"`
|
|
139407
|
-
);
|
|
139408
|
-
if (!(propertyKey in ret)) {
|
|
139409
|
-
ret[propertyKey] = (0, import_devkit4.joinPathFragments)(filePath.path, filePath.name);
|
|
139410
|
-
}
|
|
139411
|
-
}
|
|
139412
|
-
return ret;
|
|
139413
|
-
}, {});
|
|
139414
139375
|
if (options.generatePackageJson !== false) {
|
|
139415
139376
|
const projectGraph = (0, import_devkit4.readCachedProjectGraph)();
|
|
139416
139377
|
packageJson.dependencies = void 0;
|
|
@@ -139450,64 +139411,29 @@ ${externalDependencies.map((dep) => {
|
|
|
139450
139411
|
},
|
|
139451
139412
|
"./package.json": "./package.json"
|
|
139452
139413
|
};
|
|
139453
|
-
for (const
|
|
139454
|
-
|
|
139455
|
-
|
|
139456
|
-
|
|
139457
|
-
|
|
139414
|
+
for (const entryPoint of entryPoints) {
|
|
139415
|
+
let formattedEntryPoint = removeExtension(entryPoint).replace(sourceRoot, "");
|
|
139416
|
+
if (formattedEntryPoint.startsWith(".")) {
|
|
139417
|
+
formattedEntryPoint = formattedEntryPoint.substring(1);
|
|
139418
|
+
}
|
|
139419
|
+
if (formattedEntryPoint.startsWith("/")) {
|
|
139420
|
+
formattedEntryPoint = formattedEntryPoint.substring(1);
|
|
139421
|
+
}
|
|
139422
|
+
packageJson.exports[`./${formattedEntryPoint}`] = {
|
|
139458
139423
|
import: {
|
|
139459
|
-
types: `./${(0, import_devkit4.joinPathFragments)(
|
|
139460
|
-
|
|
139461
|
-
removeExtension(additionalEntryPoint).replace(sourceRoot, "")
|
|
139462
|
-
)}.d.ts`,
|
|
139463
|
-
default: `./${(0, import_devkit4.joinPathFragments)(
|
|
139464
|
-
distPaths[0],
|
|
139465
|
-
removeExtension(additionalEntryPoint).replace(sourceRoot, "")
|
|
139466
|
-
)}.js`
|
|
139424
|
+
types: `./${(0, import_devkit4.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.ts`,
|
|
139425
|
+
default: `./${(0, import_devkit4.joinPathFragments)(distPaths[0], formattedEntryPoint)}.js`
|
|
139467
139426
|
},
|
|
139468
139427
|
require: {
|
|
139469
|
-
types: `./${(0, import_devkit4.joinPathFragments)(
|
|
139470
|
-
|
|
139471
|
-
removeExtension(additionalEntryPoint).replace(sourceRoot, "")
|
|
139472
|
-
)}.d.cts`,
|
|
139473
|
-
default: `./${(0, import_devkit4.joinPathFragments)(
|
|
139474
|
-
distPaths[0],
|
|
139475
|
-
removeExtension(additionalEntryPoint).replace(sourceRoot, "")
|
|
139476
|
-
)}.cjs`
|
|
139428
|
+
types: `./${(0, import_devkit4.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.cts`,
|
|
139429
|
+
default: `./${(0, import_devkit4.joinPathFragments)(distPaths[0], formattedEntryPoint)}.cjs`
|
|
139477
139430
|
},
|
|
139478
139431
|
default: {
|
|
139479
|
-
types: `./${(0, import_devkit4.joinPathFragments)(
|
|
139480
|
-
|
|
139481
|
-
|
|
139482
|
-
|
|
139483
|
-
|
|
139484
|
-
distPaths[0],
|
|
139485
|
-
removeExtension(additionalEntryPoint).replace(sourceRoot, "")
|
|
139486
|
-
)}.js`
|
|
139487
|
-
}
|
|
139488
|
-
};
|
|
139489
|
-
}
|
|
139490
|
-
packageJson.exports = Object.keys(entry).reduce((ret, key) => {
|
|
139491
|
-
let packageJsonKey = key.startsWith("./") ? key : `./${key}`;
|
|
139492
|
-
packageJsonKey = packageJsonKey.replaceAll("/index", "");
|
|
139493
|
-
if (!ret[packageJsonKey]) {
|
|
139494
|
-
ret[packageJsonKey] = {
|
|
139495
|
-
import: {
|
|
139496
|
-
types: `./${distPaths[0]}index.d.ts`,
|
|
139497
|
-
default: `./${distPaths[0]}${key}.js`
|
|
139498
|
-
},
|
|
139499
|
-
require: {
|
|
139500
|
-
types: `./${distPaths[0]}index.d.cts`,
|
|
139501
|
-
default: `./${distPaths[0]}${key}.cjs`
|
|
139502
|
-
},
|
|
139503
|
-
default: {
|
|
139504
|
-
types: `./${distPaths[0]}index.d.ts`,
|
|
139505
|
-
default: `./${distPaths[0]}${key}.js`
|
|
139506
|
-
}
|
|
139507
|
-
};
|
|
139508
|
-
}
|
|
139509
|
-
return ret;
|
|
139510
|
-
}, packageJson.exports);
|
|
139432
|
+
types: `./${(0, import_devkit4.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.ts`,
|
|
139433
|
+
default: `./${(0, import_devkit4.joinPathFragments)(distPaths[0], formattedEntryPoint)}.js`
|
|
139434
|
+
}
|
|
139435
|
+
};
|
|
139436
|
+
}
|
|
139511
139437
|
packageJson.funding ??= workspacePackageJson.funding;
|
|
139512
139438
|
packageJson.types ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
139513
139439
|
packageJson.typings ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
@@ -139545,9 +139471,9 @@ ${externalDependencies.map((dep) => {
|
|
|
139545
139471
|
packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_devkit4.joinPathFragments)("packages", context.projectName);
|
|
139546
139472
|
const packageJsonPath = (0, import_devkit4.joinPathFragments)(context.root, options.outputPath, "package.json");
|
|
139547
139473
|
writeDebug(config, `\u26A1 Writing package.json file to: ${packageJsonPath}`);
|
|
139548
|
-
(0,
|
|
139474
|
+
(0, import_node_fs5.writeFileSync)(
|
|
139549
139475
|
packageJsonPath,
|
|
139550
|
-
await (0,
|
|
139476
|
+
await (0, import_prettier.format)(JSON.stringify(packageJson), {
|
|
139551
139477
|
...prettierOptions,
|
|
139552
139478
|
parser: "json"
|
|
139553
139479
|
})
|
|
@@ -139555,15 +139481,51 @@ ${externalDependencies.map((dep) => {
|
|
|
139555
139481
|
} else {
|
|
139556
139482
|
writeWarning(config, "Skipping writing to package.json file");
|
|
139557
139483
|
}
|
|
139558
|
-
|
|
139559
|
-
|
|
139560
|
-
|
|
139561
|
-
|
|
139562
|
-
|
|
139563
|
-
|
|
139564
|
-
|
|
139565
|
-
|
|
139566
|
-
|
|
139484
|
+
if (options.includeSrc === true) {
|
|
139485
|
+
const files = globSync([
|
|
139486
|
+
(0, import_devkit4.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.ts"),
|
|
139487
|
+
(0, import_devkit4.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.tsx"),
|
|
139488
|
+
(0, import_devkit4.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.js"),
|
|
139489
|
+
(0, import_devkit4.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.jsx")
|
|
139490
|
+
]);
|
|
139491
|
+
await Promise.allSettled(
|
|
139492
|
+
files.map(
|
|
139493
|
+
async (file) => (0, import_promises3.writeFile)(
|
|
139494
|
+
file,
|
|
139495
|
+
await (0, import_prettier.format)(
|
|
139496
|
+
`${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
|
|
139497
|
+
|
|
139498
|
+
${(0, import_node_fs5.readFileSync)(file, "utf-8")}`,
|
|
139499
|
+
{
|
|
139500
|
+
...prettierOptions,
|
|
139501
|
+
parser: "typescript"
|
|
139502
|
+
}
|
|
139503
|
+
),
|
|
139504
|
+
"utf-8"
|
|
139505
|
+
)
|
|
139506
|
+
)
|
|
139507
|
+
);
|
|
139508
|
+
}
|
|
139509
|
+
Promise.all(
|
|
139510
|
+
entryPoints.map(
|
|
139511
|
+
(entryPoint) => runTsupBuild(
|
|
139512
|
+
{
|
|
139513
|
+
entry: entryPoint,
|
|
139514
|
+
projectRoot,
|
|
139515
|
+
projectName: context.projectName,
|
|
139516
|
+
sourceRoot
|
|
139517
|
+
},
|
|
139518
|
+
config,
|
|
139519
|
+
{
|
|
139520
|
+
...options,
|
|
139521
|
+
outputPath: (0, import_devkit4.joinPathFragments)(
|
|
139522
|
+
config.workspaceRoot,
|
|
139523
|
+
options.outputPath,
|
|
139524
|
+
removeExtension(entryPoint).replace(sourceRoot, "").replace(findFileName(entryPoint), "")
|
|
139525
|
+
)
|
|
139526
|
+
}
|
|
139527
|
+
)
|
|
139528
|
+
)
|
|
139567
139529
|
);
|
|
139568
139530
|
writeSuccess(config, "\u26A1 The Build process has completed successfully");
|
|
139569
139531
|
return {
|
|
@@ -141443,12 +141405,12 @@ var generator_default3 = withRunGenerator(
|
|
|
141443
141405
|
);
|
|
141444
141406
|
|
|
141445
141407
|
// packages/workspace-tools/src/utils/find-cache-dir.ts
|
|
141446
|
-
var
|
|
141408
|
+
var import_node_fs6 = require("node:fs");
|
|
141447
141409
|
var import_node_path7 = require("node:path");
|
|
141448
141410
|
var import_node_process5 = require("node:process");
|
|
141449
141411
|
var isWritable2 = (path5) => {
|
|
141450
141412
|
try {
|
|
141451
|
-
(0,
|
|
141413
|
+
(0, import_node_fs6.accessSync)(path5, import_node_fs6.constants.W_OK);
|
|
141452
141414
|
return true;
|
|
141453
141415
|
} catch {
|
|
141454
141416
|
return false;
|
|
@@ -141456,13 +141418,13 @@ var isWritable2 = (path5) => {
|
|
|
141456
141418
|
};
|
|
141457
141419
|
function useDirectory(directory, { create = true }) {
|
|
141458
141420
|
if (create) {
|
|
141459
|
-
(0,
|
|
141421
|
+
(0, import_node_fs6.mkdirSync)(directory, { recursive: true });
|
|
141460
141422
|
}
|
|
141461
141423
|
return directory;
|
|
141462
141424
|
}
|
|
141463
141425
|
function getNodeModuleDirectory(workspaceRoot) {
|
|
141464
141426
|
const nodeModules = (0, import_node_path7.join)(workspaceRoot, "node_modules");
|
|
141465
|
-
if ((0,
|
|
141427
|
+
if ((0, import_node_fs6.existsSync)(nodeModules) && !isWritable2(nodeModules)) {
|
|
141466
141428
|
throw new Error("Cannot write to node_modules directory");
|
|
141467
141429
|
}
|
|
141468
141430
|
return nodeModules;
|
|
@@ -141500,7 +141462,7 @@ var import_transform = __toESM(require_transform());
|
|
|
141500
141462
|
var getTypiaTransform = (program, diagnostics) => (0, import_transform.default)(program, {}, { addDiagnostic: (input) => diagnostics.push(input) });
|
|
141501
141463
|
|
|
141502
141464
|
// packages/workspace-tools/src/utils/workspace-storage.ts
|
|
141503
|
-
var
|
|
141465
|
+
var import_node_fs7 = require("node:fs");
|
|
141504
141466
|
var import_node_path8 = require("node:path");
|
|
141505
141467
|
var WorkspaceStorage = class {
|
|
141506
141468
|
constructor({
|
|
@@ -141522,8 +141484,8 @@ var WorkspaceStorage = class {
|
|
|
141522
141484
|
*/
|
|
141523
141485
|
getItem(key) {
|
|
141524
141486
|
const cacheFile = (0, import_node_path8.join)(this.cacheDir, key);
|
|
141525
|
-
if ((0,
|
|
141526
|
-
return (0,
|
|
141487
|
+
if ((0, import_node_fs7.existsSync)(cacheFile)) {
|
|
141488
|
+
return (0, import_node_fs7.readFileSync)(cacheFile, "utf-8");
|
|
141527
141489
|
}
|
|
141528
141490
|
return void 0;
|
|
141529
141491
|
}
|
|
@@ -141534,7 +141496,7 @@ var WorkspaceStorage = class {
|
|
|
141534
141496
|
* @param value - The value to set
|
|
141535
141497
|
*/
|
|
141536
141498
|
setItem(key, value) {
|
|
141537
|
-
(0,
|
|
141499
|
+
(0, import_node_fs7.writeFileSync)((0, import_node_path8.join)(this.cacheDir, key), value, { encoding: "utf-8" });
|
|
141538
141500
|
}
|
|
141539
141501
|
/**
|
|
141540
141502
|
* Remove item from cache
|
|
@@ -141542,14 +141504,14 @@ var WorkspaceStorage = class {
|
|
|
141542
141504
|
* @param key - The key to remove
|
|
141543
141505
|
*/
|
|
141544
141506
|
removeItem(key) {
|
|
141545
|
-
(0,
|
|
141507
|
+
(0, import_node_fs7.rmSync)((0, import_node_path8.join)(this.cacheDir, key), { force: true, recursive: true });
|
|
141546
141508
|
}
|
|
141547
141509
|
/**
|
|
141548
141510
|
* Clear the cache
|
|
141549
141511
|
*/
|
|
141550
141512
|
clear() {
|
|
141551
|
-
(0,
|
|
141552
|
-
(0,
|
|
141513
|
+
(0, import_node_fs7.readdirSync)(this.cacheDir).forEach((cacheFile) => {
|
|
141514
|
+
(0, import_node_fs7.rmSync)(cacheFile, { force: true, recursive: true });
|
|
141553
141515
|
});
|
|
141554
141516
|
}
|
|
141555
141517
|
/**
|
|
@@ -141559,7 +141521,7 @@ var WorkspaceStorage = class {
|
|
|
141559
141521
|
* @returns The key at the index
|
|
141560
141522
|
*/
|
|
141561
141523
|
key(index) {
|
|
141562
|
-
const files = (0,
|
|
141524
|
+
const files = (0, import_node_fs7.readdirSync)(this.cacheDir);
|
|
141563
141525
|
if (index < files.length && index >= 0) {
|
|
141564
141526
|
return files[index];
|
|
141565
141527
|
}
|