@storm-software/workspace-tools 1.49.10 → 1.49.11

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/index.js CHANGED
@@ -12735,12 +12735,12 @@ var require_install_packages_task = __commonJS({
12735
12735
  var child_process_1 = require("child_process");
12736
12736
  var path_1 = require("path");
12737
12737
  var nx_1 = require_nx();
12738
- var { detectPackageManager, getPackageManagerCommand, joinPathFragments: joinPathFragments9 } = (0, nx_1.requireNx)();
12738
+ var { detectPackageManager, getPackageManagerCommand, joinPathFragments: joinPathFragments10 } = (0, nx_1.requireNx)();
12739
12739
  function installPackagesTask(tree, alwaysRun = false, cwd = "", packageManager = detectPackageManager(cwd)) {
12740
- if (!tree.listChanges().find((f) => f.path === joinPathFragments9(cwd, "package.json")) && !alwaysRun) {
12740
+ if (!tree.listChanges().find((f) => f.path === joinPathFragments10(cwd, "package.json")) && !alwaysRun) {
12741
12741
  return;
12742
12742
  }
12743
- const packageJsonValue = tree.read(joinPathFragments9(cwd, "package.json"), "utf-8");
12743
+ const packageJsonValue = tree.read(joinPathFragments10(cwd, "package.json"), "utf-8");
12744
12744
  let storedPackageJsonValue = global["__packageJsonInstallCache__"];
12745
12745
  if (storedPackageJsonValue != packageJsonValue || alwaysRun) {
12746
12746
  global["__packageJsonInstallCache__"] = packageJsonValue;
@@ -28113,8 +28113,8 @@ var require_prompt = __commonJS({
28113
28113
  return this.skipped;
28114
28114
  }
28115
28115
  async initialize() {
28116
- let { format: format2, options, result } = this;
28117
- this.format = () => format2.call(this, this.value);
28116
+ let { format: format3, options, result } = this;
28117
+ this.format = () => format3.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 format2 = createFn("format", prompt, options);
30505
+ let format3 = 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 format2(value, state, item, index);
30550
+ value = await format3(value, state, item, index);
30551
30551
  if (val !== value) {
30552
30552
  state.values[key] = val;
30553
30553
  value = prompt.styles.typing(val);
@@ -31373,20 +31373,20 @@ var require_project_name_and_root_utils = __commonJS({
31373
31373
  var nx_1 = require_nx();
31374
31374
  var get_workspace_layout_1 = require_get_workspace_layout();
31375
31375
  var names_1 = require_names();
31376
- var { joinPathFragments: joinPathFragments9, logger, normalizePath, output, readJson: readJson2, stripIndents, workspaceRoot } = (0, nx_1.requireNx)();
31376
+ var { joinPathFragments: joinPathFragments10, logger, normalizePath, output, readJson: readJson2, stripIndents, workspaceRoot } = (0, nx_1.requireNx)();
31377
31377
  async function determineProjectNameAndRootOptions2(tree, options) {
31378
31378
  if (!options.projectNameAndRootFormat && (process.env.NX_INTERACTIVE !== "true" || !isTTY())) {
31379
31379
  options.projectNameAndRootFormat = "derived";
31380
31380
  }
31381
31381
  validateName(options.name, options.projectNameAndRootFormat);
31382
31382
  const formats = getProjectNameAndRootFormats(tree, options);
31383
- const format2 = options.projectNameAndRootFormat ?? await determineFormat(formats);
31384
- if (format2 === "derived" && options.callingGenerator) {
31383
+ const format3 = options.projectNameAndRootFormat ?? await determineFormat(formats);
31384
+ if (format3 === "derived" && options.callingGenerator) {
31385
31385
  logDeprecationMessage(options.callingGenerator, formats);
31386
31386
  }
31387
31387
  return {
31388
- ...formats[format2],
31389
- projectNameAndRootFormat: format2
31388
+ ...formats[format3],
31389
+ projectNameAndRootFormat: format3
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: format2 }) => format2 === asProvidedSelectedValue ? "as-provided" : "derived");
31440
+ }).then(({ format: format3 }) => format3 === asProvidedSelectedValue ? "as-provided" : "derived");
31441
31441
  return result;
31442
31442
  }
31443
31443
  function getProjectNameAndRootFormats(tree, options) {
@@ -31500,14 +31500,14 @@ var require_project_name_and_root_utils = __commonJS({
31500
31500
  if (options.directory === relativeCwd || options.directory.startsWith(`${relativeCwd}/`)) {
31501
31501
  projectRoot = options.directory;
31502
31502
  } else {
31503
- projectRoot = joinPathFragments9(relativeCwd, options.directory);
31503
+ projectRoot = joinPathFragments10(relativeCwd, options.directory);
31504
31504
  }
31505
31505
  } else if (options.rootProject) {
31506
31506
  projectRoot = ".";
31507
31507
  } else {
31508
31508
  projectRoot = relativeCwd;
31509
31509
  if (!relativeCwd.endsWith(options.name)) {
31510
- projectRoot = joinPathFragments9(relativeCwd, options.name);
31510
+ projectRoot = joinPathFragments10(relativeCwd, options.name);
31511
31511
  }
31512
31512
  }
31513
31513
  let importPath = void 0;
@@ -31540,7 +31540,7 @@ var require_project_name_and_root_utils = __commonJS({
31540
31540
  const projectSimpleName = name;
31541
31541
  let projectRoot = projectDirectoryWithoutLayout;
31542
31542
  if (projectDirectoryWithoutLayout !== ".") {
31543
- projectRoot = joinPathFragments9(layoutDirectory, projectRoot);
31543
+ projectRoot = joinPathFragments10(layoutDirectory, projectRoot);
31544
31544
  }
31545
31545
  let importPath;
31546
31546
  if (options.projectType === "library") {
@@ -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 format2 = options.transform || transform2(toNumber);
37092
+ let format3 = 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(format2(a, index), maxLen, toNumber));
37104
+ range.push(pad(format3(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 format2 = options.transform || ((val) => String.fromCharCode(val));
37118
+ let format3 = 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(format2(a, index));
37130
+ range.push(format3(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 format2 = opts.format || (posix2 ? utils.toPosixSlashes : null);
39172
+ const format3 = opts.format || (posix2 ? utils.toPosixSlashes : null);
39173
39173
  let match2 = input === glob2;
39174
- let output = match2 && format2 ? format2(input) : input;
39174
+ let output = match2 && format3 ? format3(input) : input;
39175
39175
  if (match2 === false) {
39176
- output = format2 ? format2(input) : input;
39176
+ output = format3 ? format3(input) : input;
39177
39177
  match2 = output === glob2;
39178
39178
  }
39179
39179
  if (match2 === false || opts.capture === true) {
@@ -44433,6 +44433,25 @@ var require_src2 = __commonJS({
44433
44433
  }
44434
44434
  });
44435
44435
 
44436
+ // node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/get-custom-transformers-factory.js
44437
+ var require_get_custom_transformers_factory = __commonJS({
44438
+ "node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/get-custom-transformers-factory.js"(exports) {
44439
+ "use strict";
44440
+ Object.defineProperty(exports, "__esModule", { value: true });
44441
+ exports.getCustomTrasformersFactory = void 0;
44442
+ var load_ts_transformers_1 = require_load_ts_transformers();
44443
+ function getCustomTrasformersFactory2(transformers) {
44444
+ const { compilerPluginHooks } = (0, load_ts_transformers_1.loadTsTransformers)(transformers);
44445
+ return (program) => ({
44446
+ before: compilerPluginHooks.beforeHooks.map((hook) => hook(program)),
44447
+ after: compilerPluginHooks.afterHooks.map((hook) => hook(program)),
44448
+ afterDeclarations: compilerPluginHooks.afterDeclarationsHooks.map((hook) => hook(program))
44449
+ });
44450
+ }
44451
+ exports.getCustomTrasformersFactory = getCustomTrasformersFactory2;
44452
+ }
44453
+ });
44454
+
44436
44455
  // node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/utils/assets/assets.js
44437
44456
  var require_assets2 = __commonJS({
44438
44457
  "node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/utils/assets/assets.js"(exports) {
@@ -44511,901 +44530,6 @@ var require_normalize_options = __commonJS({
44511
44530
  }
44512
44531
  });
44513
44532
 
44514
- // node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/utils/inline.js
44515
- var require_inline = __commonJS({
44516
- "node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/utils/inline.js"(exports) {
44517
- "use strict";
44518
- Object.defineProperty(exports, "__esModule", { value: true });
44519
- exports.getRootTsConfigPath = exports.postProcessInlinedDependencies = exports.handleInliningBuild = exports.isInlineGraphEmpty = void 0;
44520
- var devkit_1 = require_devkit();
44521
- var fs_extra_1 = require_lib4();
44522
- var path_1 = require("path");
44523
- var fs_1 = require("fs");
44524
- function isInlineGraphEmpty(inlineGraph) {
44525
- return Object.keys(inlineGraph.nodes).length === 0;
44526
- }
44527
- exports.isInlineGraphEmpty = isInlineGraphEmpty;
44528
- function handleInliningBuild(context, options, tsConfigPath, projectName = context.projectName) {
44529
- const tsConfigJson = (0, devkit_1.readJsonFile)(tsConfigPath);
44530
- const pathAliases = tsConfigJson["compilerOptions"]?.["paths"] || readBasePathAliases(context);
44531
- const inlineGraph = createInlineGraph(context, options, pathAliases, projectName);
44532
- if (isInlineGraphEmpty(inlineGraph)) {
44533
- return inlineGraph;
44534
- }
44535
- buildInlineGraphExternals(context, inlineGraph, pathAliases);
44536
- return inlineGraph;
44537
- }
44538
- exports.handleInliningBuild = handleInliningBuild;
44539
- function postProcessInlinedDependencies(outputPath, parentOutputPath, inlineGraph) {
44540
- if (isInlineGraphEmpty(inlineGraph)) {
44541
- return;
44542
- }
44543
- const parentDistPath = (0, path_1.join)(outputPath, parentOutputPath);
44544
- const markedForDeletion = /* @__PURE__ */ new Set();
44545
- movePackage(parentDistPath, outputPath);
44546
- markedForDeletion.add(parentDistPath);
44547
- const inlinedDepsDestOutputRecord = {};
44548
- for (const inlineDependenciesNames of Object.values(inlineGraph.dependencies)) {
44549
- for (const inlineDependenciesName of inlineDependenciesNames) {
44550
- const inlineDependency = inlineGraph.nodes[inlineDependenciesName];
44551
- const depOutputPath = inlineDependency.buildOutputPath || (0, path_1.join)(outputPath, inlineDependency.root);
44552
- const destDepOutputPath = (0, path_1.join)(outputPath, inlineDependency.name);
44553
- const isBuildable = !!inlineDependency.buildOutputPath;
44554
- if (isBuildable) {
44555
- (0, fs_extra_1.copySync)(depOutputPath, destDepOutputPath, { overwrite: true });
44556
- } else {
44557
- movePackage(depOutputPath, destDepOutputPath);
44558
- markedForDeletion.add(depOutputPath);
44559
- }
44560
- inlinedDepsDestOutputRecord[inlineDependency.pathAlias] = destDepOutputPath + "/src";
44561
- }
44562
- }
44563
- markedForDeletion.forEach((path5) => (0, fs_extra_1.removeSync)(path5));
44564
- updateImports(outputPath, inlinedDepsDestOutputRecord);
44565
- }
44566
- exports.postProcessInlinedDependencies = postProcessInlinedDependencies;
44567
- function readBasePathAliases(context) {
44568
- return (0, devkit_1.readJsonFile)(getRootTsConfigPath(context))?.["compilerOptions"]["paths"];
44569
- }
44570
- function getRootTsConfigPath(context) {
44571
- for (const tsConfigName of ["tsconfig.base.json", "tsconfig.json"]) {
44572
- const tsConfigPath = (0, path_1.join)(context.root, tsConfigName);
44573
- if ((0, fs_1.existsSync)(tsConfigPath)) {
44574
- return tsConfigPath;
44575
- }
44576
- }
44577
- throw new Error("Could not find a root tsconfig.json or tsconfig.base.json file.");
44578
- }
44579
- exports.getRootTsConfigPath = getRootTsConfigPath;
44580
- function emptyInlineGraph() {
44581
- return { nodes: {}, externals: {}, dependencies: {} };
44582
- }
44583
- function projectNodeToInlineProjectNode(projectNode, pathAlias = "", buildOutputPath = "") {
44584
- return {
44585
- name: projectNode.name,
44586
- root: projectNode.data.root,
44587
- sourceRoot: projectNode.data.sourceRoot,
44588
- pathAlias,
44589
- buildOutputPath
44590
- };
44591
- }
44592
- function createInlineGraph(context, options, pathAliases, projectName, inlineGraph = emptyInlineGraph()) {
44593
- if (options.external == null)
44594
- return inlineGraph;
44595
- const projectDependencies = context.projectGraph.dependencies[projectName] || [];
44596
- if (projectDependencies.length === 0)
44597
- return inlineGraph;
44598
- if (!inlineGraph.nodes[projectName]) {
44599
- inlineGraph.nodes[projectName] = projectNodeToInlineProjectNode(context.projectGraph.nodes[projectName]);
44600
- }
44601
- const implicitDependencies = context.projectGraph.nodes[projectName].data.implicitDependencies || [];
44602
- for (const projectDependency of projectDependencies) {
44603
- if (projectDependency.target.startsWith("npm")) {
44604
- continue;
44605
- }
44606
- if (implicitDependencies.includes(projectDependency.target)) {
44607
- continue;
44608
- }
44609
- const pathAlias = getPathAliasForPackage(context.projectGraph.nodes[projectDependency.target], pathAliases);
44610
- const buildOutputPath = getBuildOutputPath(projectDependency.target, context, options);
44611
- const shouldInline = (
44612
- /**
44613
- * if all buildable libraries are marked as external,
44614
- * then push the project dependency that doesn't have a build target
44615
- */
44616
- options.external === "all" && !buildOutputPath || /**
44617
- * if all buildable libraries are marked as internal,
44618
- * then push every project dependency to be inlined
44619
- */
44620
- options.external === "none" || /**
44621
- * if some buildable libraries are marked as external,
44622
- * then push the project dependency that IS NOT marked as external OR doesn't have a build target
44623
- */
44624
- Array.isArray(options.external) && options.external.length > 0 && !options.external.includes(projectDependency.target) || !buildOutputPath
44625
- );
44626
- if (shouldInline) {
44627
- inlineGraph.dependencies[projectName] ??= [];
44628
- inlineGraph.dependencies[projectName].push(projectDependency.target);
44629
- }
44630
- inlineGraph.nodes[projectDependency.target] = projectNodeToInlineProjectNode(context.projectGraph.nodes[projectDependency.target], pathAlias, buildOutputPath);
44631
- if (context.projectGraph.dependencies[projectDependency.target].length > 0) {
44632
- inlineGraph = createInlineGraph(context, options, pathAliases, projectDependency.target, inlineGraph);
44633
- }
44634
- }
44635
- return inlineGraph;
44636
- }
44637
- function buildInlineGraphExternals(context, inlineProjectGraph, pathAliases) {
44638
- const allNodes = { ...context.projectGraph.nodes };
44639
- for (const [parent, dependencies] of Object.entries(inlineProjectGraph.dependencies)) {
44640
- if (allNodes[parent]) {
44641
- delete allNodes[parent];
44642
- }
44643
- for (const dependencyName of dependencies) {
44644
- const dependencyNode = inlineProjectGraph.nodes[dependencyName];
44645
- if (dependencyNode.buildOutputPath) {
44646
- continue;
44647
- }
44648
- if (allNodes[dependencyName]) {
44649
- delete allNodes[dependencyName];
44650
- }
44651
- }
44652
- }
44653
- for (const [projectName, projectNode] of Object.entries(allNodes)) {
44654
- if (!inlineProjectGraph.externals[projectName]) {
44655
- inlineProjectGraph.externals[projectName] = projectNodeToInlineProjectNode(projectNode, getPathAliasForPackage(projectNode, pathAliases));
44656
- }
44657
- }
44658
- }
44659
- function movePackage(from, to) {
44660
- if (from === to)
44661
- return;
44662
- (0, fs_extra_1.copySync)(from, to, { overwrite: true });
44663
- }
44664
- function updateImports(destOutputPath, inlinedDepsDestOutputRecord) {
44665
- const importRegex = new RegExp(Object.keys(inlinedDepsDestOutputRecord).map((pathAlias) => `["'](${pathAlias})["']`).join("|"), "g");
44666
- recursiveUpdateImport(destOutputPath, importRegex, inlinedDepsDestOutputRecord);
44667
- }
44668
- function recursiveUpdateImport(dirPath, importRegex, inlinedDepsDestOutputRecord, rootParentDir) {
44669
- const files = (0, fs_extra_1.readdirSync)(dirPath, { withFileTypes: true });
44670
- for (const file of files) {
44671
- if (file.isFile() && (file.name.endsWith(".js") || file.name.endsWith(".d.ts"))) {
44672
- const filePath = (0, path_1.join)(dirPath, file.name);
44673
- const fileContent = (0, fs_extra_1.readFileSync)(filePath, "utf-8");
44674
- const updatedContent = fileContent.replace(importRegex, (matched) => {
44675
- const result = matched.replace(/['"]/g, "");
44676
- if (result === rootParentDir)
44677
- return matched;
44678
- const importPath = `"${(0, path_1.relative)(dirPath, inlinedDepsDestOutputRecord[result])}"`;
44679
- return (0, devkit_1.normalizePath)(importPath);
44680
- });
44681
- (0, fs_extra_1.writeFileSync)(filePath, updatedContent);
44682
- } else if (file.isDirectory()) {
44683
- recursiveUpdateImport((0, path_1.join)(dirPath, file.name), importRegex, inlinedDepsDestOutputRecord, rootParentDir || file.name);
44684
- }
44685
- }
44686
- }
44687
- function getPathAliasForPackage(packageNode, pathAliases) {
44688
- if (!packageNode)
44689
- return "";
44690
- for (const [alias, paths] of Object.entries(pathAliases)) {
44691
- if (paths.some((path5) => path5.includes(packageNode.data.root))) {
44692
- return alias;
44693
- }
44694
- }
44695
- return "";
44696
- }
44697
- function getBuildOutputPath(projectName, context, options) {
44698
- const projectTargets = context.projectGraph.nodes[projectName]?.data?.targets;
44699
- if (!projectTargets)
44700
- return "";
44701
- const buildTarget = options.externalBuildTargets.find((buildTarget2) => projectTargets[buildTarget2]);
44702
- return buildTarget ? projectTargets[buildTarget].options["outputPath"] : "";
44703
- }
44704
- }
44705
- });
44706
-
44707
- // node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/create-async-iterable.js
44708
- var require_create_async_iterable = __commonJS({
44709
- "node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/create-async-iterable.js"(exports) {
44710
- "use strict";
44711
- Object.defineProperty(exports, "__esModule", { value: true });
44712
- exports.createAsyncIterable = void 0;
44713
- function createAsyncIterable(listener) {
44714
- let done = false;
44715
- let error = null;
44716
- const pushQueue = [];
44717
- const pullQueue = [];
44718
- return {
44719
- [Symbol.asyncIterator]() {
44720
- listener({
44721
- next: (value) => {
44722
- if (done || error)
44723
- return;
44724
- if (pullQueue.length > 0) {
44725
- pullQueue.shift()?.[0]({ value, done: false });
44726
- } else {
44727
- pushQueue.push(value);
44728
- }
44729
- },
44730
- error: (err) => {
44731
- if (done || error)
44732
- return;
44733
- if (pullQueue.length > 0) {
44734
- pullQueue.shift()?.[1](err);
44735
- }
44736
- error = err;
44737
- },
44738
- done: () => {
44739
- if (pullQueue.length > 0) {
44740
- pullQueue.shift()?.[0]({ value: void 0, done: true });
44741
- }
44742
- done = true;
44743
- }
44744
- });
44745
- return {
44746
- next() {
44747
- return new Promise((resolve, reject) => {
44748
- if (pushQueue.length > 0) {
44749
- resolve({ value: pushQueue.shift(), done: false });
44750
- } else if (done) {
44751
- resolve({ value: void 0, done: true });
44752
- } else if (error) {
44753
- reject(error);
44754
- } else {
44755
- pullQueue.push([resolve, reject]);
44756
- }
44757
- });
44758
- }
44759
- };
44760
- }
44761
- };
44762
- }
44763
- exports.createAsyncIterable = createAsyncIterable;
44764
- }
44765
- });
44766
-
44767
- // node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/combine-async-iterables.js
44768
- var require_combine_async_iterables = __commonJS({
44769
- "node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/combine-async-iterables.js"(exports) {
44770
- "use strict";
44771
- Object.defineProperty(exports, "__esModule", { value: true });
44772
- exports.combineAsyncIterables = void 0;
44773
- async function* combineAsyncIterables(..._iterators) {
44774
- const iterators = _iterators.map((it) => {
44775
- if (typeof it["next"] === "function") {
44776
- return it;
44777
- } else {
44778
- return async function* wrapped() {
44779
- for await (const val of it) {
44780
- yield val;
44781
- }
44782
- }();
44783
- }
44784
- });
44785
- let [options] = iterators;
44786
- if (typeof options.next === "function") {
44787
- options = /* @__PURE__ */ Object.create(null);
44788
- } else {
44789
- iterators.shift();
44790
- }
44791
- const getNextAsyncIteratorValue = getNextAsyncIteratorFactory(options);
44792
- try {
44793
- const asyncIteratorsValues = new Map(iterators.map((it, idx) => [idx, getNextAsyncIteratorValue(it, idx)]));
44794
- do {
44795
- const { iterator, index } = await Promise.race(asyncIteratorsValues.values());
44796
- if (iterator.done) {
44797
- asyncIteratorsValues.delete(index);
44798
- } else {
44799
- yield iterator.value;
44800
- asyncIteratorsValues.set(index, getNextAsyncIteratorValue(iterators[index], index));
44801
- }
44802
- } while (asyncIteratorsValues.size > 0);
44803
- } finally {
44804
- await Promise.allSettled(iterators.map((it) => it["return"]?.()));
44805
- }
44806
- }
44807
- exports.combineAsyncIterables = combineAsyncIterables;
44808
- function getNextAsyncIteratorFactory(options) {
44809
- return async (asyncIterator, index) => {
44810
- try {
44811
- const iterator = await asyncIterator.next();
44812
- return { index, iterator };
44813
- } catch (err) {
44814
- if (options.errorCallback) {
44815
- options.errorCallback(err, index);
44816
- }
44817
- return Promise.reject(err);
44818
- }
44819
- };
44820
- }
44821
- }
44822
- });
44823
-
44824
- // node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/map-async-iteratable.js
44825
- var require_map_async_iteratable = __commonJS({
44826
- "node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/map-async-iteratable.js"(exports) {
44827
- "use strict";
44828
- Object.defineProperty(exports, "__esModule", { value: true });
44829
- exports.mapAsyncIterable = void 0;
44830
- async function* mapAsyncIterable(data, transform2) {
44831
- async function* f() {
44832
- const generator = data[Symbol.asyncIterator] || data[Symbol.iterator];
44833
- const iterator = generator.call(data);
44834
- let index = 0;
44835
- let item = await iterator.next();
44836
- while (!item.done) {
44837
- yield await transform2(await item.value, index, data);
44838
- index++;
44839
- item = await iterator.next();
44840
- }
44841
- }
44842
- return yield* f();
44843
- }
44844
- exports.mapAsyncIterable = mapAsyncIterable;
44845
- }
44846
- });
44847
-
44848
- // node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/tap-async-iteratable.js
44849
- var require_tap_async_iteratable = __commonJS({
44850
- "node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/tap-async-iteratable.js"(exports) {
44851
- "use strict";
44852
- Object.defineProperty(exports, "__esModule", { value: true });
44853
- exports.tapAsyncIterable = void 0;
44854
- var map_async_iteratable_1 = require_map_async_iteratable();
44855
- async function* tapAsyncIterable(data, fn) {
44856
- return yield* (0, map_async_iteratable_1.mapAsyncIterable)(data, (x) => {
44857
- fn(x);
44858
- return x;
44859
- });
44860
- }
44861
- exports.tapAsyncIterable = tapAsyncIterable;
44862
- }
44863
- });
44864
-
44865
- // node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/index.js
44866
- var require_async_iterable = __commonJS({
44867
- "node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/index.js"(exports) {
44868
- "use strict";
44869
- Object.defineProperty(exports, "__esModule", { value: true });
44870
- var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
44871
- tslib_1.__exportStar(require_create_async_iterable(), exports);
44872
- tslib_1.__exportStar(require_combine_async_iterables(), exports);
44873
- tslib_1.__exportStar(require_map_async_iteratable(), exports);
44874
- tslib_1.__exportStar(require_tap_async_iteratable(), exports);
44875
- }
44876
- });
44877
-
44878
- // node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/utils/typescript/compile-typescript-files.js
44879
- var require_compile_typescript_files = __commonJS({
44880
- "node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/utils/typescript/compile-typescript-files.js"(exports) {
44881
- "use strict";
44882
- Object.defineProperty(exports, "__esModule", { value: true });
44883
- exports.compileTypeScriptFiles = void 0;
44884
- var compilation_1 = require_compilation();
44885
- var async_iterable_1 = require_async_iterable();
44886
- var TYPESCRIPT_FOUND_N_ERRORS_WATCHING_FOR_FILE_CHANGES = 6194;
44887
- var ERROR_COUNT_REGEX = /Found (\d+) errors/;
44888
- function getErrorCountFromMessage(messageText) {
44889
- return Number.parseInt(ERROR_COUNT_REGEX.exec(messageText)[1]);
44890
- }
44891
- function compileTypeScriptFiles(normalizedOptions, tscOptions, postCompilationCallback) {
44892
- const getResult = (success) => ({
44893
- success,
44894
- outfile: normalizedOptions.mainOutputPath
44895
- });
44896
- let tearDown;
44897
- return {
44898
- iterator: (0, async_iterable_1.createAsyncIterable)(async ({ next, done }) => {
44899
- if (normalizedOptions.watch) {
44900
- const host = (0, compilation_1.compileTypeScriptWatcher)(tscOptions, async (d) => {
44901
- if (d.code === TYPESCRIPT_FOUND_N_ERRORS_WATCHING_FOR_FILE_CHANGES) {
44902
- await postCompilationCallback();
44903
- next(getResult(getErrorCountFromMessage(d.messageText) === 0));
44904
- }
44905
- });
44906
- tearDown = () => {
44907
- host.close();
44908
- done();
44909
- };
44910
- } else {
44911
- const { success } = (0, compilation_1.compileTypeScript)(tscOptions);
44912
- await postCompilationCallback();
44913
- next(getResult(success));
44914
- done();
44915
- }
44916
- }),
44917
- close: () => tearDown?.()
44918
- };
44919
- }
44920
- exports.compileTypeScriptFiles = compileTypeScriptFiles;
44921
- }
44922
- });
44923
-
44924
- // node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/get-custom-transformers-factory.js
44925
- var require_get_custom_transformers_factory = __commonJS({
44926
- "node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/get-custom-transformers-factory.js"(exports) {
44927
- "use strict";
44928
- Object.defineProperty(exports, "__esModule", { value: true });
44929
- exports.getCustomTrasformersFactory = void 0;
44930
- var load_ts_transformers_1 = require_load_ts_transformers();
44931
- function getCustomTrasformersFactory(transformers) {
44932
- const { compilerPluginHooks } = (0, load_ts_transformers_1.loadTsTransformers)(transformers);
44933
- return (program) => ({
44934
- before: compilerPluginHooks.beforeHooks.map((hook) => hook(program)),
44935
- after: compilerPluginHooks.afterHooks.map((hook) => hook(program)),
44936
- afterDeclarations: compilerPluginHooks.afterDeclarationsHooks.map((hook) => hook(program))
44937
- });
44938
- }
44939
- exports.getCustomTrasformersFactory = getCustomTrasformersFactory;
44940
- }
44941
- });
44942
-
44943
- // node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/get-task-options.js
44944
- var require_get_task_options = __commonJS({
44945
- "node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/get-task-options.js"(exports) {
44946
- "use strict";
44947
- Object.defineProperty(exports, "__esModule", { value: true });
44948
- exports.getTaskOptions = void 0;
44949
- var normalize_options_1 = require_normalize_options();
44950
- var tasksOptionsCache = /* @__PURE__ */ new Map();
44951
- function getTaskOptions(taskName, context) {
44952
- if (tasksOptionsCache.has(taskName)) {
44953
- return tasksOptionsCache.get(taskName);
44954
- }
44955
- try {
44956
- const { taskOptions, sourceRoot, root } = parseTaskInfo(taskName, context);
44957
- const normalizedTaskOptions = (0, normalize_options_1.normalizeOptions)(taskOptions, context.root, sourceRoot, root);
44958
- tasksOptionsCache.set(taskName, normalizedTaskOptions);
44959
- return normalizedTaskOptions;
44960
- } catch {
44961
- tasksOptionsCache.set(taskName, null);
44962
- return null;
44963
- }
44964
- }
44965
- exports.getTaskOptions = getTaskOptions;
44966
- function parseTaskInfo(taskName, context) {
44967
- const target = context.taskGraph.tasks[taskName].target;
44968
- const projectNode = context.projectGraph.nodes[target.project];
44969
- const targetConfig = projectNode.data.targets?.[target.target];
44970
- const { sourceRoot, root } = projectNode.data;
44971
- const taskOptions = {
44972
- ...targetConfig.options,
44973
- ...target.configuration ? targetConfig.configurations?.[target.configuration] : {}
44974
- };
44975
- return { taskOptions, root, sourceRoot, projectNode, target };
44976
- }
44977
- }
44978
- });
44979
-
44980
- // node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/get-tsconfig.js
44981
- var require_get_tsconfig = __commonJS({
44982
- "node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/get-tsconfig.js"(exports) {
44983
- "use strict";
44984
- Object.defineProperty(exports, "__esModule", { value: true });
44985
- exports.getProcessedTaskTsConfigs = void 0;
44986
- var devkit_1 = require_devkit();
44987
- var path_1 = require("path");
44988
- var get_task_options_1 = require_get_task_options();
44989
- function getProcessedTaskTsConfigs(tasks, tasksOptions, context) {
44990
- const taskInMemoryTsConfigMap = {};
44991
- for (const task of tasks) {
44992
- generateTaskProjectTsConfig(task, tasksOptions, context, taskInMemoryTsConfigMap);
44993
- }
44994
- return taskInMemoryTsConfigMap;
44995
- }
44996
- exports.getProcessedTaskTsConfigs = getProcessedTaskTsConfigs;
44997
- var projectTsConfigCache = /* @__PURE__ */ new Map();
44998
- function generateTaskProjectTsConfig(task, tasksOptions, context, taskInMemoryTsConfigMap) {
44999
- const { project } = (0, devkit_1.parseTargetString)(task, context);
45000
- if (projectTsConfigCache.has(project)) {
45001
- const { tsConfig, tsConfigPath: tsConfigPath2 } = projectTsConfigCache.get(project);
45002
- taskInMemoryTsConfigMap[task] = tsConfig;
45003
- return tsConfigPath2;
45004
- }
45005
- const tasksInProject = [
45006
- task,
45007
- ...getDependencyTasksInSameProject(task, context)
45008
- ];
45009
- const taskWithTscExecutor = tasksInProject.find((t) => hasTscExecutor(t, context));
45010
- if (!taskWithTscExecutor) {
45011
- throw new Error((0, devkit_1.stripIndents)`The "@nx/js:tsc" batch executor requires all dependencies to use the "@nx/js:tsc" executor.
45012
- None of the following tasks in the "${project}" project use the "@nx/js:tsc" executor:
45013
- ${tasksInProject.map((t) => `- ${t}`).join("\n")}`);
45014
- }
45015
- const projectReferences = [];
45016
- for (const task2 of tasksInProject) {
45017
- for (const depTask of getDependencyTasksInOtherProjects(task2, project, context)) {
45018
- const tsConfigPath2 = generateTaskProjectTsConfig(depTask, tasksOptions, context, taskInMemoryTsConfigMap);
45019
- projectReferences.push(tsConfigPath2);
45020
- }
45021
- }
45022
- const taskOptions = tasksOptions[taskWithTscExecutor] ?? (0, get_task_options_1.getTaskOptions)(taskWithTscExecutor, context);
45023
- const tsConfigPath = taskOptions.tsConfig;
45024
- taskInMemoryTsConfigMap[taskWithTscExecutor] = getInMemoryTsConfig(tsConfigPath, taskOptions, projectReferences);
45025
- projectTsConfigCache.set(project, {
45026
- tsConfigPath,
45027
- tsConfig: taskInMemoryTsConfigMap[taskWithTscExecutor]
45028
- });
45029
- return tsConfigPath;
45030
- }
45031
- function getDependencyTasksInOtherProjects(task, project, context) {
45032
- return context.taskGraph.dependencies[task].filter((t) => t !== task && (0, devkit_1.parseTargetString)(t, context).project !== project);
45033
- }
45034
- function getDependencyTasksInSameProject(task, context) {
45035
- const { project: taskProject } = (0, devkit_1.parseTargetString)(task, context);
45036
- return Object.keys(context.taskGraph.tasks).filter((t) => t !== task && (0, devkit_1.parseTargetString)(t, context).project === taskProject);
45037
- }
45038
- function getInMemoryTsConfig(tsConfig, taskOptions, projectReferences) {
45039
- const originalTsConfig = (0, devkit_1.readJsonFile)(tsConfig, {
45040
- allowTrailingComma: true,
45041
- disallowComments: false
45042
- });
45043
- const allProjectReferences = Array.from(new Set((originalTsConfig.references ?? []).map((r) => r.path).concat(projectReferences)));
45044
- return {
45045
- content: JSON.stringify({
45046
- ...originalTsConfig,
45047
- compilerOptions: {
45048
- ...originalTsConfig.compilerOptions,
45049
- rootDir: taskOptions.rootDir,
45050
- outDir: taskOptions.outputPath,
45051
- composite: true,
45052
- declaration: true,
45053
- declarationMap: true,
45054
- tsBuildInfoFile: (0, path_1.join)(taskOptions.outputPath, "tsconfig.tsbuildinfo")
45055
- },
45056
- references: allProjectReferences.map((pr) => ({ path: pr }))
45057
- }),
45058
- path: tsConfig.replace(/\\/g, "/")
45059
- };
45060
- }
45061
- function hasTscExecutor(task, context) {
45062
- const { project, target } = (0, devkit_1.parseTargetString)(task, context);
45063
- return context.projectGraph.nodes[project].data.targets[target].executor === "@nx/js:tsc";
45064
- }
45065
- }
45066
- });
45067
-
45068
- // node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/typescript-diagnostic-reporters.js
45069
- var require_typescript_diagnostic_reporters = __commonJS({
45070
- "node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/typescript-diagnostic-reporters.js"(exports) {
45071
- "use strict";
45072
- Object.defineProperty(exports, "__esModule", { value: true });
45073
- exports.formatSolutionBuilderStatusReport = exports.formatDiagnosticReport = void 0;
45074
- var ts2 = require("typescript");
45075
- function formatDiagnosticReport(diagnostic, host) {
45076
- const diagnostics = new Array(1);
45077
- diagnostics[0] = diagnostic;
45078
- const formattedDiagnostic = "\n" + ts2.formatDiagnosticsWithColorAndContext(diagnostics, host) + host.getNewLine();
45079
- diagnostics[0] = void 0;
45080
- return formattedDiagnostic;
45081
- }
45082
- exports.formatDiagnosticReport = formatDiagnosticReport;
45083
- function formatSolutionBuilderStatusReport(diagnostic) {
45084
- let formattedDiagnostic = `[${formatColorAndReset(getLocaleTimeString(), ForegroundColorEscapeSequences.Grey)}] `;
45085
- formattedDiagnostic += `${ts2.flattenDiagnosticMessageText(diagnostic.messageText, ts2.sys.newLine)}${ts2.sys.newLine + ts2.sys.newLine}`;
45086
- return formattedDiagnostic;
45087
- }
45088
- exports.formatSolutionBuilderStatusReport = formatSolutionBuilderStatusReport;
45089
- function formatColorAndReset(text, formatStyle) {
45090
- const resetEscapeSequence = "\x1B[0m";
45091
- return formatStyle + text + resetEscapeSequence;
45092
- }
45093
- function getLocaleTimeString() {
45094
- return (/* @__PURE__ */ new Date()).toLocaleTimeString();
45095
- }
45096
- var ForegroundColorEscapeSequences;
45097
- (function(ForegroundColorEscapeSequences2) {
45098
- ForegroundColorEscapeSequences2["Grey"] = "\x1B[90m";
45099
- ForegroundColorEscapeSequences2["Red"] = "\x1B[91m";
45100
- ForegroundColorEscapeSequences2["Yellow"] = "\x1B[93m";
45101
- ForegroundColorEscapeSequences2["Blue"] = "\x1B[94m";
45102
- ForegroundColorEscapeSequences2["Cyan"] = "\x1B[96m";
45103
- })(ForegroundColorEscapeSequences || (ForegroundColorEscapeSequences = {}));
45104
- }
45105
- });
45106
-
45107
- // node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/typescript-compilation.js
45108
- var require_typescript_compilation = __commonJS({
45109
- "node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/typescript-compilation.js"(exports) {
45110
- "use strict";
45111
- Object.defineProperty(exports, "__esModule", { value: true });
45112
- exports.compileTypescriptSolution = void 0;
45113
- var async_iterable_1 = require_async_iterable();
45114
- var ts2 = require("typescript");
45115
- var get_custom_transformers_factory_1 = require_get_custom_transformers_factory();
45116
- var typescript_diagnostic_reporters_1 = require_typescript_diagnostic_reporters();
45117
- var TYPESCRIPT_CANNOT_READ_FILE = 5083;
45118
- var TYPESCRIPT_FILE_CHANGE_DETECTED_STARTING_INCREMENTAL_COMPILATION = 6032;
45119
- function compileTypescriptSolution(context, watch, logger, hooks, reporters) {
45120
- if (watch) {
45121
- return (0, async_iterable_1.createAsyncIterable)(async ({ next }) => {
45122
- hooks ??= {};
45123
- const callerAfterProjectCompilationCallback = hooks.afterProjectCompilationCallback;
45124
- hooks.afterProjectCompilationCallback = (tsConfig, success) => {
45125
- callerAfterProjectCompilationCallback?.(tsConfig, success);
45126
- next({ tsConfig, success });
45127
- };
45128
- compileTSWithWatch(context, logger, hooks, reporters);
45129
- });
45130
- }
45131
- const compilationGenerator = compileTS(context, logger, hooks, reporters);
45132
- return {
45133
- [Symbol.asyncIterator]() {
45134
- return {
45135
- next() {
45136
- return Promise.resolve(compilationGenerator.next());
45137
- }
45138
- };
45139
- }
45140
- };
45141
- }
45142
- exports.compileTypescriptSolution = compileTypescriptSolution;
45143
- function* compileTS(context, logger, hooks, reporters) {
45144
- let project;
45145
- const formatDiagnosticsHost = {
45146
- getCurrentDirectory: () => ts2.sys.getCurrentDirectory(),
45147
- getNewLine: () => ts2.sys.newLine,
45148
- getCanonicalFileName: (filename) => ts2.sys.useCaseSensitiveFileNames ? filename : filename.toLowerCase()
45149
- };
45150
- const solutionBuilderHost = ts2.createSolutionBuilderHost(
45151
- getSystem(context),
45152
- /*createProgram*/
45153
- void 0,
45154
- (diagnostic) => {
45155
- const formattedDiagnostic = (0, typescript_diagnostic_reporters_1.formatDiagnosticReport)(diagnostic, formatDiagnosticsHost);
45156
- if (diagnostic.code === TYPESCRIPT_CANNOT_READ_FILE) {
45157
- throw new Error(formattedDiagnostic);
45158
- }
45159
- logger.info(formattedDiagnostic, project.project);
45160
- reporters?.diagnosticReporter?.(project.project, diagnostic);
45161
- },
45162
- (diagnostic) => {
45163
- const formattedDiagnostic = (0, typescript_diagnostic_reporters_1.formatSolutionBuilderStatusReport)(diagnostic);
45164
- logger.info(formattedDiagnostic, project.project);
45165
- reporters?.solutionBuilderStatusReporter?.(project.project, diagnostic);
45166
- }
45167
- );
45168
- const rootNames = Object.keys(context);
45169
- const solutionBuilder = ts2.createSolutionBuilder(solutionBuilderHost, rootNames, {});
45170
- while (true) {
45171
- project = solutionBuilder.getNextInvalidatedProject();
45172
- if (!project) {
45173
- break;
45174
- }
45175
- const projectContext = context[project.project];
45176
- const projectName = projectContext?.project;
45177
- if (project.kind === ts2.InvalidatedProjectKind.UpdateBundle) {
45178
- logger.warn(`The project ${projectName} is using the deprecated "prepend" Typescript compiler option. This option is not supported by the batch executor and it's ignored.
45179
- `, project.project);
45180
- continue;
45181
- }
45182
- hooks?.beforeProjectCompilationCallback?.(project.project);
45183
- if (project.kind === ts2.InvalidatedProjectKind.UpdateOutputFileStamps) {
45184
- logger.info(`Updating output timestamps of project "${projectName}"...
45185
- `, project.project);
45186
- const status2 = project.done();
45187
- const success2 = status2 === ts2.ExitStatus.Success;
45188
- if (success2) {
45189
- logger.info(`Done updating output timestamps of project "${projectName}"...
45190
- `, project.project);
45191
- }
45192
- hooks?.afterProjectCompilationCallback?.(project.project, success2);
45193
- yield { success: success2, tsConfig: project.project };
45194
- continue;
45195
- }
45196
- logger.info(`Compiling TypeScript files for project "${projectName}"...
45197
- `, project.project);
45198
- const status = project.done(void 0, void 0, (0, get_custom_transformers_factory_1.getCustomTrasformersFactory)(projectContext.transformers)(project.getProgram()));
45199
- const success = status === ts2.ExitStatus.Success;
45200
- if (success) {
45201
- logger.info(`Done compiling TypeScript files for project "${projectName}".
45202
- `, project.project);
45203
- }
45204
- hooks?.afterProjectCompilationCallback?.(project.project, success);
45205
- yield {
45206
- success: status === ts2.ExitStatus.Success,
45207
- tsConfig: project.project
45208
- };
45209
- }
45210
- }
45211
- function compileTSWithWatch(context, logger, hooks, reporters) {
45212
- let project;
45213
- const solutionHost = ts2.createSolutionBuilderWithWatchHost(
45214
- getSystem(context),
45215
- /*createProgram*/
45216
- void 0
45217
- );
45218
- if (reporters?.diagnosticReporter) {
45219
- const originalDiagnosticReporter = solutionHost.reportDiagnostic;
45220
- solutionHost.reportDiagnostic = (diagnostic) => {
45221
- originalDiagnosticReporter(diagnostic);
45222
- reporters.diagnosticReporter(project.project, diagnostic);
45223
- };
45224
- }
45225
- if (reporters?.solutionBuilderStatusReporter) {
45226
- const originalSolutionBuilderStatusReporter = solutionHost.reportSolutionBuilderStatus;
45227
- solutionHost.reportDiagnostic = (diagnostic) => {
45228
- originalSolutionBuilderStatusReporter(diagnostic);
45229
- reporters.solutionBuilderStatusReporter(project.project, diagnostic);
45230
- };
45231
- }
45232
- const originalWatchStatusReporter = solutionHost.onWatchStatusChange;
45233
- solutionHost.onWatchStatusChange = (diagnostic, newLine, options, errorCount) => {
45234
- originalWatchStatusReporter(diagnostic, newLine, options, errorCount);
45235
- if (diagnostic.code === TYPESCRIPT_FILE_CHANGE_DETECTED_STARTING_INCREMENTAL_COMPILATION) {
45236
- build2();
45237
- }
45238
- reporters?.watchStatusReporter?.(project?.project, diagnostic, newLine, options, errorCount);
45239
- };
45240
- const rootNames = Object.keys(context);
45241
- const solutionBuilder = ts2.createSolutionBuilderWithWatch(solutionHost, rootNames, {});
45242
- const build2 = () => {
45243
- while (true) {
45244
- project = solutionBuilder.getNextInvalidatedProject();
45245
- if (!project) {
45246
- break;
45247
- }
45248
- const projectContext = context[project.project];
45249
- const projectName = projectContext.project;
45250
- if (project.kind === ts2.InvalidatedProjectKind.UpdateBundle) {
45251
- logger.warn(`The project ${projectName} is using the deprecated "prepend" Typescript compiler option. This option is not supported by the batch executor and it's ignored.`);
45252
- continue;
45253
- }
45254
- hooks?.beforeProjectCompilationCallback(project.project);
45255
- if (project.kind === ts2.InvalidatedProjectKind.UpdateOutputFileStamps) {
45256
- if (projectName) {
45257
- logger.info(`Updating output timestamps of project "${projectName}"...
45258
- `, project.project);
45259
- }
45260
- const status2 = project.done();
45261
- const success2 = status2 === ts2.ExitStatus.Success;
45262
- if (projectName && success2) {
45263
- logger.info(`Done updating output timestamps of project "${projectName}"...
45264
- `, project.project);
45265
- }
45266
- hooks?.afterProjectCompilationCallback?.(project.project, success2);
45267
- continue;
45268
- }
45269
- logger.info(`Compiling TypeScript files for project "${projectName}"...
45270
- `, project.project);
45271
- const status = project.done(void 0, void 0, (0, get_custom_transformers_factory_1.getCustomTrasformersFactory)(projectContext.transformers)(project.getProgram()));
45272
- const success = status === ts2.ExitStatus.Success;
45273
- if (success) {
45274
- logger.info(`Done compiling TypeScript files for project "${projectName}".
45275
- `, project.project);
45276
- }
45277
- hooks?.afterProjectCompilationCallback?.(project.project, success);
45278
- }
45279
- };
45280
- build2();
45281
- solutionBuilder.build();
45282
- }
45283
- function getSystem(context) {
45284
- return {
45285
- ...ts2.sys,
45286
- readFile(path5, encoding) {
45287
- if (context[path5]) {
45288
- return context[path5].tsConfig.content;
45289
- }
45290
- return ts2.sys.readFile(path5, encoding);
45291
- }
45292
- };
45293
- }
45294
- }
45295
- });
45296
-
45297
- // node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/index.js
45298
- var require_lib5 = __commonJS({
45299
- "node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/lib/index.js"(exports) {
45300
- "use strict";
45301
- Object.defineProperty(exports, "__esModule", { value: true });
45302
- var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
45303
- tslib_1.__exportStar(require_get_custom_transformers_factory(), exports);
45304
- tslib_1.__exportStar(require_get_tsconfig(), exports);
45305
- tslib_1.__exportStar(require_normalize_options(), exports);
45306
- tslib_1.__exportStar(require_typescript_compilation(), exports);
45307
- }
45308
- });
45309
-
45310
- // node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/tsc.impl.js
45311
- var require_tsc_impl = __commonJS({
45312
- "node_modules/.pnpm/@nx+js@17.2.8_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.2.8_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/src/executors/tsc/tsc.impl.js"(exports) {
45313
- "use strict";
45314
- Object.defineProperty(exports, "__esModule", { value: true });
45315
- exports.tscExecutor = exports.createTypeScriptCompilationOptions = exports.determineModuleFormatFromTsConfig = void 0;
45316
- var ts2 = require("typescript");
45317
- var copy_assets_handler_1 = require_copy_assets_handler();
45318
- var check_dependencies_1 = require_check_dependencies();
45319
- var compiler_helper_dependency_1 = require_compiler_helper_dependency();
45320
- var inline_1 = require_inline();
45321
- var update_package_json_1 = require_update_package_json();
45322
- var compile_typescript_files_1 = require_compile_typescript_files();
45323
- var watch_for_single_file_changes_1 = require_watch_for_single_file_changes();
45324
- var lib_1 = require_lib5();
45325
- var ts_config_1 = require_ts_config();
45326
- var create_entry_points_1 = require_create_entry_points();
45327
- function determineModuleFormatFromTsConfig(absolutePathToTsConfig) {
45328
- const tsConfig = (0, ts_config_1.readTsConfig)(absolutePathToTsConfig);
45329
- if (tsConfig.options.module === ts2.ModuleKind.ES2015 || tsConfig.options.module === ts2.ModuleKind.ES2020 || tsConfig.options.module === ts2.ModuleKind.ES2022 || tsConfig.options.module === ts2.ModuleKind.ESNext) {
45330
- return "esm";
45331
- } else {
45332
- return "cjs";
45333
- }
45334
- }
45335
- exports.determineModuleFormatFromTsConfig = determineModuleFormatFromTsConfig;
45336
- function createTypeScriptCompilationOptions2(normalizedOptions, context) {
45337
- return {
45338
- outputPath: normalizedOptions.outputPath,
45339
- projectName: context.projectName,
45340
- projectRoot: normalizedOptions.projectRoot,
45341
- rootDir: normalizedOptions.rootDir,
45342
- tsConfig: normalizedOptions.tsConfig,
45343
- watch: normalizedOptions.watch,
45344
- deleteOutputPath: normalizedOptions.clean,
45345
- getCustomTransformers: (0, lib_1.getCustomTrasformersFactory)(normalizedOptions.transformers)
45346
- };
45347
- }
45348
- exports.createTypeScriptCompilationOptions = createTypeScriptCompilationOptions2;
45349
- async function* tscExecutor(_options, context) {
45350
- const { sourceRoot, root } = context.projectsConfigurations.projects[context.projectName];
45351
- const options = (0, lib_1.normalizeOptions)(_options, context.root, sourceRoot, root);
45352
- const { projectRoot, tmpTsConfig, target, dependencies } = (0, check_dependencies_1.checkDependencies)(context, options.tsConfig);
45353
- if (tmpTsConfig) {
45354
- options.tsConfig = tmpTsConfig;
45355
- }
45356
- const tsLibDependency = (0, compiler_helper_dependency_1.getHelperDependency)(compiler_helper_dependency_1.HelperDependency.tsc, options.tsConfig, dependencies, context.projectGraph);
45357
- if (tsLibDependency) {
45358
- dependencies.push(tsLibDependency);
45359
- }
45360
- const assetHandler = new copy_assets_handler_1.CopyAssetsHandler({
45361
- projectDir: projectRoot,
45362
- rootDir: context.root,
45363
- outputDir: _options.outputPath,
45364
- assets: _options.assets
45365
- });
45366
- const tsCompilationOptions = createTypeScriptCompilationOptions2(options, context);
45367
- const inlineProjectGraph = (0, inline_1.handleInliningBuild)(context, options, tsCompilationOptions.tsConfig);
45368
- if (!(0, inline_1.isInlineGraphEmpty)(inlineProjectGraph)) {
45369
- tsCompilationOptions.rootDir = ".";
45370
- }
45371
- const typescriptCompilation = (0, compile_typescript_files_1.compileTypeScriptFiles)(options, tsCompilationOptions, async () => {
45372
- await assetHandler.processAllAssetsOnce();
45373
- (0, update_package_json_1.updatePackageJson)({
45374
- ...options,
45375
- additionalEntryPoints: (0, create_entry_points_1.createEntryPoints)(options.additionalEntryPoints, context.root),
45376
- format: [determineModuleFormatFromTsConfig(options.tsConfig)],
45377
- // As long as d.ts files match their .js counterparts, we don't need to emit them.
45378
- // TSC can match them correctly based on file names.
45379
- skipTypings: true
45380
- }, context, target, dependencies);
45381
- (0, inline_1.postProcessInlinedDependencies)(tsCompilationOptions.outputPath, tsCompilationOptions.projectRoot, inlineProjectGraph);
45382
- });
45383
- if (options.watch) {
45384
- const disposeWatchAssetChanges = await assetHandler.watchAndProcessOnAssetChange();
45385
- const disposePackageJsonChanges = await (0, watch_for_single_file_changes_1.watchForSingleFileChanges)(context.projectName, options.projectRoot, "package.json", () => (0, update_package_json_1.updatePackageJson)({
45386
- ...options,
45387
- additionalEntryPoints: (0, create_entry_points_1.createEntryPoints)(options.additionalEntryPoints, context.root),
45388
- // As long as d.ts files match their .js counterparts, we don't need to emit them.
45389
- // TSC can match them correctly based on file names.
45390
- skipTypings: true,
45391
- format: [determineModuleFormatFromTsConfig(options.tsConfig)]
45392
- }, context, target, dependencies));
45393
- const handleTermination = async (exitCode) => {
45394
- await typescriptCompilation.close();
45395
- disposeWatchAssetChanges();
45396
- disposePackageJsonChanges();
45397
- process.exit(exitCode);
45398
- };
45399
- process.on("SIGINT", () => handleTermination(128 + 2));
45400
- process.on("SIGTERM", () => handleTermination(128 + 15));
45401
- }
45402
- return yield* typescriptCompilation.iterator;
45403
- }
45404
- exports.tscExecutor = tscExecutor;
45405
- exports.default = tscExecutor;
45406
- }
45407
- });
45408
-
45409
44533
  // node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js
45410
44534
  var require_brace_expansion2 = __commonJS({
45411
44535
  "node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(exports, module2) {
@@ -47383,21 +46507,21 @@ var require_chunk_GQ77QZBO = __commonJS({
47383
46507
  }
47384
46508
  }
47385
46509
  function defaultOutExtension({
47386
- format: format2,
46510
+ format: format3,
47387
46511
  pkgType
47388
46512
  }) {
47389
46513
  let jsExtension = ".js";
47390
46514
  let dtsExtension = ".d.ts";
47391
46515
  const isModule = pkgType === "module";
47392
- if (isModule && format2 === "cjs") {
46516
+ if (isModule && format3 === "cjs") {
47393
46517
  jsExtension = ".cjs";
47394
46518
  dtsExtension = ".d.cts";
47395
46519
  }
47396
- if (!isModule && format2 === "esm") {
46520
+ if (!isModule && format3 === "esm") {
47397
46521
  jsExtension = ".mjs";
47398
46522
  dtsExtension = ".d.mts";
47399
46523
  }
47400
- if (format2 === "iife") {
46524
+ if (format3 === "iife") {
47401
46525
  jsExtension = ".global.js";
47402
46526
  }
47403
46527
  return {
@@ -47712,7 +46836,7 @@ var require_chunk_UIX4URMV = __commonJS({
47712
46836
  });
47713
46837
 
47714
46838
  // node_modules/.pnpm/joycon@3.1.1/node_modules/joycon/lib/index.js
47715
- var require_lib6 = __commonJS({
46839
+ var require_lib5 = __commonJS({
47716
46840
  "node_modules/.pnpm/joycon@3.1.1/node_modules/joycon/lib/index.js"(exports, module2) {
47717
46841
  "use strict";
47718
46842
  Object.defineProperty(exports, "__esModule", {
@@ -48222,8 +47346,8 @@ var require_dist3 = __commonJS({
48222
47346
  return "cjs";
48223
47347
  }
48224
47348
  var usingDynamicImport = typeof jest === "undefined";
48225
- var dynamicImport = async (id, { format: format2 }) => {
48226
- const fn = format2 === "esm" ? (file) => import(file) : false ? createRequire(import_meta.url) : require;
47349
+ var dynamicImport = async (id, { format: format3 }) => {
47350
+ const fn = format3 === "esm" ? (file) => import(file) : false ? createRequire(import_meta.url) : require;
48227
47351
  return fn(id);
48228
47352
  };
48229
47353
  var getRandomId = () => {
@@ -48240,9 +47364,9 @@ var require_dist3 = __commonJS({
48240
47364
  return "ts";
48241
47365
  return ext2.slice(1);
48242
47366
  }
48243
- var defaultGetOutputFile = (filepath, format2) => filepath.replace(
47367
+ var defaultGetOutputFile = (filepath, format3) => filepath.replace(
48244
47368
  JS_EXT_RE,
48245
- `.bundled_${getRandomId()}.${format2 === "esm" ? "mjs" : "cjs"}`
47369
+ `.bundled_${getRandomId()}.${format3 === "esm" ? "mjs" : "cjs"}`
48246
47370
  );
48247
47371
  var tsconfigPathsToRegExp = (paths) => {
48248
47372
  return Object.keys(paths || {}).map((key) => {
@@ -48322,7 +47446,7 @@ var require_dist3 = __commonJS({
48322
47446
  }
48323
47447
  const preserveTemporaryFile = (_a = options.preserveTemporaryFile) != null ? _a : !!process.env.BUNDLE_REQUIRE_PRESERVE;
48324
47448
  const cwd = options.cwd || process.cwd();
48325
- const format2 = (_b = options.format) != null ? _b : guessFormat(options.filepath);
47449
+ const format3 = (_b = options.format) != null ? _b : guessFormat(options.filepath);
48326
47450
  const tsconfig = (0, import_load_tsconfig.loadTsConfig)(cwd, options.tsconfig);
48327
47451
  const resolvePaths = tsconfigPathsToRegExp(
48328
47452
  ((_c = tsconfig == null ? void 0 : tsconfig.data.compilerOptions) == null ? void 0 : _c.paths) || {}
@@ -48333,14 +47457,14 @@ var require_dist3 = __commonJS({
48333
47457
  }
48334
47458
  const { text } = result.outputFiles[0];
48335
47459
  const getOutputFile = options.getOutputFile || defaultGetOutputFile;
48336
- const outfile = getOutputFile(options.filepath, format2);
47460
+ const outfile = getOutputFile(options.filepath, format3);
48337
47461
  await import_fs22.default.promises.writeFile(outfile, text, "utf8");
48338
47462
  let mod;
48339
47463
  const req = options.require || dynamicImport;
48340
47464
  try {
48341
47465
  mod = await req(
48342
- format2 === "esm" ? (0, import_url3.pathToFileURL)(outfile).href : outfile,
48343
- { format: format2 }
47466
+ format3 === "esm" ? (0, import_url3.pathToFileURL)(outfile).href : outfile,
47467
+ { format: format3 }
48344
47468
  );
48345
47469
  } finally {
48346
47470
  if (!preserveTemporaryFile) {
@@ -48358,7 +47482,7 @@ var require_dist3 = __commonJS({
48358
47482
  entryPoints: [options.filepath],
48359
47483
  absWorkingDir: cwd,
48360
47484
  outfile: "out.js",
48361
- format: format2,
47485
+ format: format3,
48362
47486
  platform: "node",
48363
47487
  sourcemap: "inline",
48364
47488
  bundle: true,
@@ -48455,7 +47579,7 @@ var require_chunk_7G76EW2R = __commonJS({
48455
47579
  var _chunkGQ77QZBOjs = require_chunk_GQ77QZBO();
48456
47580
  var _fs = require("fs");
48457
47581
  var _fs2 = _interopRequireDefault(_fs);
48458
- var _joycon = require_lib6();
47582
+ var _joycon = require_lib5();
48459
47583
  var _joycon2 = _interopRequireDefault(_joycon);
48460
47584
  var _path = require("path");
48461
47585
  var _path2 = _interopRequireDefault(_path);
@@ -48627,12 +47751,12 @@ var require_chunk_7G76EW2R = __commonJS({
48627
47751
  var padRight = (str, maxLength) => {
48628
47752
  return str + " ".repeat(maxLength - str.length);
48629
47753
  };
48630
- var reportSize = (logger, format2, files) => {
47754
+ var reportSize = (logger, format3, files) => {
48631
47755
  const filenames = Object.keys(files);
48632
47756
  const maxLength = getLengthOfLongestString(filenames) + 1;
48633
47757
  for (const name of filenames) {
48634
47758
  logger.success(
48635
- format2,
47759
+ format3,
48636
47760
  `${_chunkUIX4URMVjs.bold.call(void 0, padRight(name, maxLength))}${_chunkUIX4URMVjs.green.call(
48637
47761
  void 0,
48638
47762
  prettyBytes(files[name])
@@ -75948,11 +75072,11 @@ Original error: ${originalError.message}`,
75948
75072
  message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`
75949
75073
  };
75950
75074
  }
75951
- function logInvalidFormatForTopLevelAwait(id, format2) {
75075
+ function logInvalidFormatForTopLevelAwait(id, format3) {
75952
75076
  return {
75953
75077
  code: INVALID_TLA_FORMAT,
75954
75078
  id,
75955
- message: `Module format "${format2}" does not support top-level await. Use the "es" or "system" output formats rather.`
75079
+ message: `Module format "${format3}" does not support top-level await. Use the "es" or "system" output formats rather.`
75956
75080
  };
75957
75081
  }
75958
75082
  function logMissingConfig() {
@@ -82226,11 +81350,11 @@ var require_rollup = __commonJS({
82226
81350
  return { isMatch: false, output: "" };
82227
81351
  }
82228
81352
  const opts = options || {};
82229
- const format2 = opts.format || (posix2 ? utils.toPosixSlashes : null);
81353
+ const format3 = opts.format || (posix2 ? utils.toPosixSlashes : null);
82230
81354
  let match2 = input === glob2;
82231
- let output = match2 && format2 ? format2(input) : input;
81355
+ let output = match2 && format3 ? format3(input) : input;
82232
81356
  if (match2 === false) {
82233
- output = format2 ? format2(input) : input;
81357
+ output = format3 ? format3(input) : input;
82234
81358
  match2 = output === glob2;
82235
81359
  }
82236
81360
  if (match2 === false || opts.capture === true) {
@@ -83793,11 +82917,11 @@ var require_rollup = __commonJS({
83793
82917
  addReturnExpression(expression) {
83794
82918
  this.parent instanceof _ChildScope && this.parent.addReturnExpression(expression);
83795
82919
  }
83796
- addUsedOutsideNames(usedNames, format2, exportNamesByVariable, accessedGlobalsByScope) {
82920
+ addUsedOutsideNames(usedNames, format3, exportNamesByVariable, accessedGlobalsByScope) {
83797
82921
  for (const variable of this.accessedOutsideVariables.values()) {
83798
82922
  if (variable.included) {
83799
82923
  usedNames.add(variable.getBaseVariableName());
83800
- if (format2 === "system" && exportNamesByVariable.has(variable)) {
82924
+ if (format3 === "system" && exportNamesByVariable.has(variable)) {
83801
82925
  usedNames.add("exports");
83802
82926
  }
83803
82927
  }
@@ -83812,9 +82936,9 @@ var require_rollup = __commonJS({
83812
82936
  contains(name) {
83813
82937
  return this.variables.has(name) || this.parent.contains(name);
83814
82938
  }
83815
- deconflict(format2, exportNamesByVariable, accessedGlobalsByScope) {
82939
+ deconflict(format3, exportNamesByVariable, accessedGlobalsByScope) {
83816
82940
  const usedNames = /* @__PURE__ */ new Set();
83817
- this.addUsedOutsideNames(usedNames, format2, exportNamesByVariable, accessedGlobalsByScope);
82941
+ this.addUsedOutsideNames(usedNames, format3, exportNamesByVariable, accessedGlobalsByScope);
83818
82942
  if (this.accessedDynamicImports) {
83819
82943
  for (const importExpression of this.accessedDynamicImports) {
83820
82944
  if (importExpression.inlineNamespace) {
@@ -83828,7 +82952,7 @@ var require_rollup = __commonJS({
83828
82952
  }
83829
82953
  }
83830
82954
  for (const scope of this.children) {
83831
- scope.deconflict(format2, exportNamesByVariable, accessedGlobalsByScope);
82955
+ scope.deconflict(format3, exportNamesByVariable, accessedGlobalsByScope);
83832
82956
  }
83833
82957
  }
83834
82958
  findLexicalBoundary() {
@@ -86925,10 +86049,10 @@ var require_rollup = __commonJS({
86925
86049
  super.parseNode(esTreeNode);
86926
86050
  }
86927
86051
  render(code, options) {
86928
- const { exportNamesByVariable, format: format2, snippets: { _, getPropertyAccess } } = options;
86052
+ const { exportNamesByVariable, format: format3, snippets: { _, getPropertyAccess } } = options;
86929
86053
  if (this.id) {
86930
86054
  const { variable, name } = this.id;
86931
- if (format2 === "system" && exportNamesByVariable.has(variable)) {
86055
+ if (format3 === "system" && exportNamesByVariable.has(variable)) {
86932
86056
  code.appendLeft(this.end, `${_}${getSystemExportStatement([variable], options)};`);
86933
86057
  }
86934
86058
  const renderedVariable = variable.getName(getPropertyAccess);
@@ -87275,19 +86399,19 @@ var require_rollup = __commonJS({
87275
86399
  applyDeoptimizations() {
87276
86400
  }
87277
86401
  renderNamedDeclaration(code, declarationStart, idInsertPosition, options) {
87278
- const { exportNamesByVariable, format: format2, snippets: { getPropertyAccess } } = options;
86402
+ const { exportNamesByVariable, format: format3, snippets: { getPropertyAccess } } = options;
87279
86403
  const name = this.variable.getName(getPropertyAccess);
87280
86404
  code.remove(this.start, declarationStart);
87281
86405
  if (idInsertPosition !== null) {
87282
86406
  code.appendLeft(idInsertPosition, ` ${name}`);
87283
86407
  }
87284
- if (format2 === "system" && this.declaration instanceof ClassDeclaration && exportNamesByVariable.has(this.variable)) {
86408
+ if (format3 === "system" && this.declaration instanceof ClassDeclaration && exportNamesByVariable.has(this.variable)) {
87285
86409
  code.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`);
87286
86410
  }
87287
86411
  }
87288
- renderVariableDeclaration(code, declarationStart, { format: format2, exportNamesByVariable, snippets: { cnst, getPropertyAccess } }) {
86412
+ renderVariableDeclaration(code, declarationStart, { format: format3, exportNamesByVariable, snippets: { cnst, getPropertyAccess } }) {
87289
86413
  const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59;
87290
- const systemExportNames = format2 === "system" && exportNamesByVariable.get(this.variable);
86414
+ const systemExportNames = format3 === "system" && exportNamesByVariable.get(this.variable);
87291
86415
  if (systemExportNames) {
87292
86416
  code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = exports('${systemExportNames[0]}', `);
87293
86417
  code.appendRight(hasTrailingSemicolon ? this.end - 1 : this.end, ")" + (hasTrailingSemicolon ? "" : ";"));
@@ -87991,13 +87115,13 @@ var require_rollup = __commonJS({
87991
87115
  }
87992
87116
  }
87993
87117
  setExternalResolution(exportMode, resolution, options, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, namespaceExportName, attributes) {
87994
- const { format: format2 } = options;
87118
+ const { format: format3 } = options;
87995
87119
  this.inlineNamespace = null;
87996
87120
  this.resolution = resolution;
87997
87121
  this.resolutionString = resolutionString;
87998
87122
  this.namespaceExportName = namespaceExportName;
87999
87123
  this.attributes = attributes;
88000
- const accessedGlobals = [...accessedImportGlobals[format2] || []];
87124
+ const accessedGlobals = [...accessedImportGlobals[format3] || []];
88001
87125
  let helper;
88002
87126
  ({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(resolution, exportMode, options, snippets, pluginDriver));
88003
87127
  if (helper) {
@@ -88012,11 +87136,11 @@ var require_rollup = __commonJS({
88012
87136
  }
88013
87137
  applyDeoptimizations() {
88014
87138
  }
88015
- getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportInCjs, format: format2, generatedCode: { arrowFunctions }, interop }, { _, getDirectReturnFunction, getDirectReturnIifeLeft }, pluginDriver) {
87139
+ getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportInCjs, format: format3, generatedCode: { arrowFunctions }, interop }, { _, getDirectReturnFunction, getDirectReturnIifeLeft }, pluginDriver) {
88016
87140
  const mechanism = pluginDriver.hookFirstSync("renderDynamicImport", [
88017
87141
  {
88018
87142
  customResolution: typeof this.resolution === "string" ? this.resolution : null,
88019
- format: format2,
87143
+ format: format3,
88020
87144
  moduleId: this.scope.context.module.id,
88021
87145
  targetModuleId: this.resolution && typeof this.resolution !== "string" ? this.resolution.id : null
88022
87146
  }
@@ -88025,7 +87149,7 @@ var require_rollup = __commonJS({
88025
87149
  return { helper: null, mechanism };
88026
87150
  }
88027
87151
  const hasDynamicTarget = !this.resolution || typeof this.resolution === "string";
88028
- switch (format2) {
87152
+ switch (format3) {
88029
87153
  case "cjs": {
88030
87154
  if (dynamicImportInCjs && (!resolution || typeof resolution === "string" || resolution instanceof ExternalModule)) {
88031
87155
  return { helper: null, mechanism: null };
@@ -88323,7 +87447,7 @@ var require_rollup = __commonJS({
88323
87447
  }
88324
87448
  }
88325
87449
  render(code, renderOptions) {
88326
- const { format: format2, pluginDriver, snippets } = renderOptions;
87450
+ const { format: format3, pluginDriver, snippets } = renderOptions;
88327
87451
  const { scope: { context: { module: module3 } }, meta: { name }, metaProperty, parent, preliminaryChunkId, referenceId, start, end } = this;
88328
87452
  const { id: moduleId } = module3;
88329
87453
  if (name !== IMPORT)
@@ -88333,18 +87457,18 @@ var require_rollup = __commonJS({
88333
87457
  const fileName = pluginDriver.getFileName(referenceId);
88334
87458
  const relativePath = parseAst_js.normalize(node_path.relative(node_path.dirname(chunkId), fileName));
88335
87459
  const replacement2 = pluginDriver.hookFirstSync("resolveFileUrl", [
88336
- { chunkId, fileName, format: format2, moduleId, referenceId, relativePath }
88337
- ]) || relativeUrlMechanisms[format2](relativePath);
87460
+ { chunkId, fileName, format: format3, moduleId, referenceId, relativePath }
87461
+ ]) || relativeUrlMechanisms[format3](relativePath);
88338
87462
  code.overwrite(parent.start, parent.end, replacement2, { contentOnly: true });
88339
87463
  return;
88340
87464
  }
88341
87465
  let replacement = pluginDriver.hookFirstSync("resolveImportMeta", [
88342
87466
  metaProperty,
88343
- { chunkId, format: format2, moduleId }
87467
+ { chunkId, format: format3, moduleId }
88344
87468
  ]);
88345
87469
  if (!replacement) {
88346
- replacement = importMetaMechanisms[format2]?.(metaProperty, { chunkId, snippets });
88347
- renderOptions.accessedDocumentCurrentScript ||= formatsMaybeAccessDocumentCurrentScript.includes(format2) && replacement !== "undefined";
87470
+ replacement = importMetaMechanisms[format3]?.(metaProperty, { chunkId, snippets });
87471
+ renderOptions.accessedDocumentCurrentScript ||= formatsMaybeAccessDocumentCurrentScript.includes(format3) && replacement !== "undefined";
88348
87472
  }
88349
87473
  if (typeof replacement === "string") {
88350
87474
  if (parent instanceof MemberExpression) {
@@ -88354,9 +87478,9 @@ var require_rollup = __commonJS({
88354
87478
  }
88355
87479
  }
88356
87480
  }
88357
- setResolution(format2, accessedGlobalsByScope, preliminaryChunkId) {
87481
+ setResolution(format3, accessedGlobalsByScope, preliminaryChunkId) {
88358
87482
  this.preliminaryChunkId = preliminaryChunkId;
88359
- const accessedGlobals = (this.metaProperty?.startsWith(FILE_PREFIX) ? accessedFileUrlGlobals : accessedMetaUrlGlobals)[format2];
87483
+ const accessedGlobals = (this.metaProperty?.startsWith(FILE_PREFIX) ? accessedFileUrlGlobals : accessedMetaUrlGlobals)[format3];
88360
87484
  if (accessedGlobals.length > 0) {
88361
87485
  this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope);
88362
87486
  }
@@ -89119,9 +88243,9 @@ var require_rollup = __commonJS({
89119
88243
  }
89120
88244
  addNamespaceMemberAccess() {
89121
88245
  }
89122
- deconflict(format2, exportNamesByVariable, accessedGlobalsByScope) {
88246
+ deconflict(format3, exportNamesByVariable, accessedGlobalsByScope) {
89123
88247
  for (const scope of this.children)
89124
- scope.deconflict(format2, exportNamesByVariable, accessedGlobalsByScope);
88248
+ scope.deconflict(format3, exportNamesByVariable, accessedGlobalsByScope);
89125
88249
  }
89126
88250
  findLexicalBoundary() {
89127
88251
  return this;
@@ -89296,9 +88420,9 @@ var require_rollup = __commonJS({
89296
88420
  this.argument.setAssignedValue(UNKNOWN_EXPRESSION);
89297
88421
  }
89298
88422
  render(code, options) {
89299
- const { exportNamesByVariable, format: format2, snippets: { _ } } = options;
88423
+ const { exportNamesByVariable, format: format3, snippets: { _ } } = options;
89300
88424
  this.argument.render(code, options);
89301
- if (format2 === "system") {
88425
+ if (format3 === "system") {
89302
88426
  const variable = this.argument.variable;
89303
88427
  const exportNames = exportNamesByVariable.get(variable);
89304
88428
  if (exportNames) {
@@ -89675,7 +88799,7 @@ var require_rollup = __commonJS({
89675
88799
  }
89676
88800
  }
89677
88801
  renderBlock(options) {
89678
- const { exportNamesByVariable, format: format2, freeze, indent: t, symbols, snippets: { _, cnst, getObject, getPropertyAccess, n: n2, s } } = options;
88802
+ const { exportNamesByVariable, format: format3, freeze, indent: t, symbols, snippets: { _, cnst, getObject, getPropertyAccess, n: n2, s } } = options;
89679
88803
  const memberVariables = this.getMemberVariables();
89680
88804
  const members = Object.entries(memberVariables).filter(([_2, variable]) => variable.included).map(([name2, variable]) => {
89681
88805
  if (this.referencedEarly || variable.isReassigned || variable === this) {
@@ -89701,7 +88825,7 @@ var require_rollup = __commonJS({
89701
88825
  }
89702
88826
  const name = this.getName(getPropertyAccess);
89703
88827
  output = `${cnst} ${name}${_}=${_}${output};`;
89704
- if (format2 === "system" && exportNamesByVariable.has(this)) {
88828
+ if (format3 === "system" && exportNamesByVariable.has(this)) {
89705
88829
  output += `${n2}${getSystemExportStatement([this], options)};`;
89706
88830
  }
89707
88831
  return output;
@@ -91597,15 +90721,15 @@ ${outro}`;
91597
90721
  system: deconflictImportsEsmOrSystem,
91598
90722
  umd: deconflictImportsOther
91599
90723
  };
91600
- function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format2, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) {
90724
+ function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format3, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) {
91601
90725
  const reversedModules = [...modules].reverse();
91602
90726
  for (const module3 of reversedModules) {
91603
- module3.scope.addUsedOutsideNames(usedNames, format2, exportNamesByVariable, accessedGlobalsByScope);
90727
+ module3.scope.addUsedOutsideNames(usedNames, format3, exportNamesByVariable, accessedGlobalsByScope);
91604
90728
  }
91605
90729
  deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces);
91606
- DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format2](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports);
90730
+ DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format3](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports);
91607
90731
  for (const module3 of reversedModules) {
91608
- module3.scope.deconflict(format2, exportNamesByVariable, accessedGlobalsByScope);
90732
+ module3.scope.deconflict(format3, exportNamesByVariable, accessedGlobalsByScope);
91609
90733
  }
91610
90734
  }
91611
90735
  function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop, preserveModules, _externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports) {
@@ -91711,7 +90835,7 @@ ${outro}`;
91711
90835
  exportNamesByVariable.set(variable, [exportName]);
91712
90836
  }
91713
90837
  }
91714
- function getExportMode(chunk, { exports: exportMode, name, format: format2 }, facadeModuleId, log) {
90838
+ function getExportMode(chunk, { exports: exportMode, name, format: format3 }, facadeModuleId, log) {
91715
90839
  const exportKeys = chunk.getExportNames();
91716
90840
  if (exportMode === "default") {
91717
90841
  if (exportKeys.length !== 1 || exportKeys[0] !== "default") {
@@ -91726,7 +90850,7 @@ ${outro}`;
91726
90850
  } else if (exportKeys.length === 1 && exportKeys[0] === "default") {
91727
90851
  exportMode = "default";
91728
90852
  } else {
91729
- if (format2 !== "es" && format2 !== "system" && exportKeys.includes("default")) {
90853
+ if (format3 !== "es" && format3 !== "system" && exportKeys.includes("default")) {
91730
90854
  log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMixedExport(facadeModuleId, name));
91731
90855
  }
91732
90856
  exportMode = "named";
@@ -92046,13 +91170,13 @@ ${outro}`;
92046
91170
  }
92047
91171
  let fileName;
92048
91172
  let hashPlaceholder = null;
92049
- const { chunkFileNames, entryFileNames, file, format: format2, preserveModules } = this.outputOptions;
91173
+ const { chunkFileNames, entryFileNames, file, format: format3, preserveModules } = this.outputOptions;
92050
91174
  if (file) {
92051
91175
  fileName = node_path.basename(file);
92052
91176
  } else if (this.fileName === null) {
92053
91177
  const [pattern, patternName] = preserveModules || this.facadeModule?.isUserDefinedEntryPoint ? [entryFileNames, "output.entryFileNames"] : [chunkFileNames, "output.chunkFileNames"];
92054
91178
  fileName = renderNamePattern(typeof pattern === "function" ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, {
92055
- format: () => format2,
91179
+ format: () => format3,
92056
91180
  hash: (size) => hashPlaceholder || (hashPlaceholder = this.getPlaceholder(patternName, size)),
92057
91181
  name: () => this.getChunkName()
92058
91182
  });
@@ -92073,12 +91197,12 @@ ${outro}`;
92073
91197
  }
92074
91198
  let sourcemapFileName = null;
92075
91199
  let hashPlaceholder = null;
92076
- const { sourcemapFileNames, format: format2 } = this.outputOptions;
91200
+ const { sourcemapFileNames, format: format3 } = this.outputOptions;
92077
91201
  if (sourcemapFileNames) {
92078
91202
  const [pattern, patternName] = [sourcemapFileNames, "output.sourcemapFileNames"];
92079
91203
  sourcemapFileName = renderNamePattern(typeof pattern === "function" ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, {
92080
91204
  chunkhash: () => this.getPreliminaryFileName().hashPlaceholder || "",
92081
- format: () => format2,
91205
+ format: () => format3,
92082
91206
  hash: (size) => hashPlaceholder || (hashPlaceholder = this.getPlaceholder(patternName, size)),
92083
91207
  name: () => this.getChunkName()
92084
91208
  });
@@ -92122,7 +91246,7 @@ ${outro}`;
92122
91246
  }
92123
91247
  async render() {
92124
91248
  const { dependencies, exportMode, facadeModule, inputOptions: { onLog }, outputOptions, pluginDriver, snippets } = this;
92125
- const { format: format2, hoistTransitiveImports, preserveModules } = outputOptions;
91249
+ const { format: format3, hoistTransitiveImports, preserveModules } = outputOptions;
92126
91250
  if (hoistTransitiveImports && !preserveModules && facadeModule !== null) {
92127
91251
  for (const dep of dependencies) {
92128
91252
  if (dep instanceof _Chunk)
@@ -92133,7 +91257,7 @@ ${outro}`;
92133
91257
  const preliminarySourcemapFileName = this.getPreliminarySourcemapFileName();
92134
91258
  const { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait } = this.renderModules(preliminaryFileName.fileName);
92135
91259
  const renderedDependencies = [...this.getRenderedDependencies().values()];
92136
- const renderedExports = exportMode === "none" ? [] : this.getChunkExportDeclarations(format2);
91260
+ const renderedExports = exportMode === "none" ? [] : this.getChunkExportDeclarations(format3);
92137
91261
  let hasExports = renderedExports.length > 0;
92138
91262
  let hasDefaultExport = false;
92139
91263
  for (const renderedDependence of renderedDependencies) {
@@ -92143,7 +91267,7 @@ ${outro}`;
92143
91267
  if (!hasDefaultExport && reexports.some((reexport) => reexport.reexported === "default")) {
92144
91268
  hasDefaultExport = true;
92145
91269
  }
92146
- if (format2 === "es") {
91270
+ if (format3 === "es") {
92147
91271
  renderedDependence.reexports = reexports.filter(
92148
91272
  // eslint-disable-next-line unicorn/prefer-array-some
92149
91273
  ({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported)
@@ -92160,7 +91284,7 @@ ${outro}`;
92160
91284
  }
92161
91285
  }
92162
91286
  const { intro, outro, banner, footer } = await createAddons(outputOptions, pluginDriver, this.getRenderedChunkInfo());
92163
- finalisers[format2](renderedSource, {
91287
+ finalisers[format3](renderedSource, {
92164
91288
  accessedGlobals,
92165
91289
  dependencies: renderedDependencies,
92166
91290
  exports: renderedExports,
@@ -92179,7 +91303,7 @@ ${outro}`;
92179
91303
  }, outputOptions);
92180
91304
  if (banner)
92181
91305
  magicString.prepend(banner);
92182
- if (format2 === "es" || format2 === "cjs") {
91306
+ if (format3 === "es" || format3 === "cjs") {
92183
91307
  const shebang = facadeModule !== null && facadeModule.info.isEntry && facadeModule.shebang;
92184
91308
  shebang && magicString.prepend(`#!${shebang}
92185
91309
  `);
@@ -92278,7 +91402,7 @@ ${outro}`;
92278
91402
  }
92279
91403
  return "chunk";
92280
91404
  }
92281
- getChunkExportDeclarations(format2) {
91405
+ getChunkExportDeclarations(format3) {
92282
91406
  const exports2 = [];
92283
91407
  for (const exportName of this.getExportNames()) {
92284
91408
  if (exportName[0] === "*")
@@ -92289,7 +91413,7 @@ ${outro}`;
92289
91413
  if (module3) {
92290
91414
  const chunk = this.chunkByModule.get(module3);
92291
91415
  if (chunk !== this) {
92292
- if (!chunk || format2 !== "es") {
91416
+ if (!chunk || format3 !== "es") {
92293
91417
  continue;
92294
91418
  }
92295
91419
  const chunkDep = this.renderedDependencies.get(chunk);
@@ -92317,7 +91441,7 @@ ${outro}`;
92317
91441
  }
92318
91442
  } else if (variable instanceof SyntheticNamedExportVariable) {
92319
91443
  expression = local;
92320
- if (format2 === "es") {
91444
+ if (format3 === "es") {
92321
91445
  local = variable.renderName;
92322
91446
  }
92323
91447
  }
@@ -92569,7 +91693,7 @@ ${outro}`;
92569
91693
  // This method changes properties on the AST before rendering and must not be async
92570
91694
  renderModules(fileName) {
92571
91695
  const { accessedGlobalsByScope, dependencies, exportNamesByVariable, includedNamespaces, inputOptions: { onLog }, isEmpty, orderedModules, outputOptions, pluginDriver, renderedModules, snippets } = this;
92572
- const { compact, format: format2, freeze, generatedCode: { symbols } } = outputOptions;
91696
+ const { compact, format: format3, freeze, generatedCode: { symbols } } = outputOptions;
92573
91697
  const { _, cnst, n: n2 } = snippets;
92574
91698
  this.setDynamicImportResolutions(fileName);
92575
91699
  this.setImportMetaResolutions(fileName);
@@ -92583,7 +91707,7 @@ ${outro}`;
92583
91707
  const renderOptions = {
92584
91708
  accessedDocumentCurrentScript: false,
92585
91709
  exportNamesByVariable,
92586
- format: format2,
91710
+ format: format3,
92587
91711
  freeze,
92588
91712
  indent,
92589
91713
  pluginDriver,
@@ -92597,7 +91721,7 @@ ${outro}`;
92597
91721
  let source;
92598
91722
  if (module3.isIncluded() || includedNamespaces.has(module3)) {
92599
91723
  const rendered = module3.render(renderOptions);
92600
- if (!renderOptions.accessedDocumentCurrentScript && formatsMaybeAccessDocumentCurrentScript.includes(format2)) {
91724
+ if (!renderOptions.accessedDocumentCurrentScript && formatsMaybeAccessDocumentCurrentScript.includes(format3)) {
92601
91725
  this.accessedGlobalsByScope.get(module3.scope)?.delete(DOCUMENT_CURRENT_SCRIPT);
92602
91726
  }
92603
91727
  renderOptions.accessedDocumentCurrentScript = false;
@@ -92666,11 +91790,11 @@ ${outro}`;
92666
91790
  }
92667
91791
  }
92668
91792
  setIdentifierRenderResolutions() {
92669
- const { format: format2, generatedCode: { symbols }, interop, preserveModules, externalLiveBindings } = this.outputOptions;
91793
+ const { format: format3, generatedCode: { symbols }, interop, preserveModules, externalLiveBindings } = this.outputOptions;
92670
91794
  const syntheticExports = /* @__PURE__ */ new Set();
92671
91795
  for (const exportName of this.getExportNames()) {
92672
91796
  const exportVariable = this.exportsByName.get(exportName);
92673
- if (format2 !== "es" && format2 !== "system" && exportVariable.isReassigned && !exportVariable.isId) {
91797
+ if (format3 !== "es" && format3 !== "system" && exportVariable.isReassigned && !exportVariable.isId) {
92674
91798
  exportVariable.setRenderNames("exports", exportName);
92675
91799
  } else if (exportVariable instanceof SyntheticNamedExportVariable) {
92676
91800
  syntheticExports.add(exportVariable);
@@ -92691,7 +91815,7 @@ ${outro}`;
92691
91815
  if (symbols) {
92692
91816
  usedNames.add("Symbol");
92693
91817
  }
92694
- switch (format2) {
91818
+ switch (format3) {
92695
91819
  case "system": {
92696
91820
  usedNames.add("module").add("exports");
92697
91821
  break;
@@ -92709,13 +91833,13 @@ ${outro}`;
92709
91833
  }
92710
91834
  }
92711
91835
  }
92712
- 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);
91836
+ deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(format3 !== "es" && format3 !== "system", format3 === "amd" || format3 === "umd" || format3 === "iife", interop), this.imports, usedNames, format3, interop, preserveModules, externalLiveBindings, this.chunkByModule, this.externalChunkByModule, syntheticExports, this.exportNamesByVariable, this.accessedGlobalsByScope, this.includedNamespaces);
92713
91837
  }
92714
91838
  setImportMetaResolutions(fileName) {
92715
- const { accessedGlobalsByScope, includedNamespaces, orderedModules, outputOptions: { format: format2 } } = this;
91839
+ const { accessedGlobalsByScope, includedNamespaces, orderedModules, outputOptions: { format: format3 } } = this;
92716
91840
  for (const module3 of orderedModules) {
92717
91841
  for (const importMeta of module3.importMetas) {
92718
- importMeta.setResolution(format2, accessedGlobalsByScope, fileName);
91842
+ importMeta.setResolution(format3, accessedGlobalsByScope, fileName);
92719
91843
  }
92720
91844
  if (includedNamespaces.has(module3)) {
92721
91845
  module3.namespace.prepare(accessedGlobalsByScope);
@@ -94782,7 +93906,7 @@ ${outro}`;
94782
93906
  async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
94783
93907
  const unsetOptions = new Set(unsetInputOptions);
94784
93908
  const compact = config.compact || false;
94785
- const format2 = getFormat(config);
93909
+ const format3 = getFormat(config);
94786
93910
  const inlineDynamicImports = getInlineDynamicImports(config, inputOptions);
94787
93911
  const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions);
94788
93912
  const file = getFile(config, preserveModules, inputOptions);
@@ -94806,7 +93930,7 @@ ${outro}`;
94806
93930
  externalLiveBindings: config.externalLiveBindings ?? true,
94807
93931
  file,
94808
93932
  footer: getAddon(config, "footer"),
94809
- format: format2,
93933
+ format: format3,
94810
93934
  freeze: config.freeze ?? true,
94811
93935
  generatedCode,
94812
93936
  globals: config.globals || {},
@@ -94816,7 +93940,7 @@ ${outro}`;
94816
93940
  interop: getInterop(config),
94817
93941
  intro: getAddon(config, "intro"),
94818
93942
  manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules),
94819
- minifyInternalExports: getMinifyInternalExports(config, format2, compact),
93943
+ minifyInternalExports: getMinifyInternalExports(config, format3, compact),
94820
93944
  name: config.name,
94821
93945
  noConflict: config.noConflict || false,
94822
93946
  outro: getAddon(config, "outro"),
@@ -95023,7 +94147,7 @@ ${outro}`;
95023
94147
  }
95024
94148
  return configManualChunks || {};
95025
94149
  };
95026
- var getMinifyInternalExports = (config, format2, compact) => config.minifyInternalExports ?? (compact || format2 === "es" || format2 === "system");
94150
+ var getMinifyInternalExports = (config, format3, compact) => config.minifyInternalExports ?? (compact || format3 === "es" || format3 === "system");
95027
94151
  var getSourcemapFileNames = (config, unsetOptions) => {
95028
94152
  const configSourcemapFileNames = config.sourcemapFileNames;
95029
94153
  if (configSourcemapFileNames == null) {
@@ -96185,7 +95309,7 @@ var require_shared = __commonJS({
96185
95309
  let padded = zeros(startString) || zeros(endString) || zeros(stepString);
96186
95310
  let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
96187
95311
  let toNumber = padded === false && stringify$3(start, end, options) === false;
96188
- let format2 = options.transform || transform2(toNumber);
95312
+ let format3 = options.transform || transform2(toNumber);
96189
95313
  if (options.toRegex && step === 1) {
96190
95314
  return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
96191
95315
  }
@@ -96197,7 +95321,7 @@ var require_shared = __commonJS({
96197
95321
  if (options.toRegex === true && step > 1) {
96198
95322
  push(a);
96199
95323
  } else {
96200
- range.push(pad(format2(a, index), maxLen, toNumber));
95324
+ range.push(pad(format3(a, index), maxLen, toNumber));
96201
95325
  }
96202
95326
  a = descending ? a - step : a + step;
96203
95327
  index++;
@@ -96211,7 +95335,7 @@ var require_shared = __commonJS({
96211
95335
  if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
96212
95336
  return invalidRange(start, end, options);
96213
95337
  }
96214
- let format2 = options.transform || ((val) => String.fromCharCode(val));
95338
+ let format3 = options.transform || ((val) => String.fromCharCode(val));
96215
95339
  let a = `${start}`.charCodeAt(0);
96216
95340
  let b = `${end}`.charCodeAt(0);
96217
95341
  let descending = a > b;
@@ -96223,7 +95347,7 @@ var require_shared = __commonJS({
96223
95347
  let range = [];
96224
95348
  let index = 0;
96225
95349
  while (descending ? a >= b : a <= b) {
96226
- range.push(format2(a, index));
95350
+ range.push(format3(a, index));
96227
95351
  a = descending ? a - step : a + step;
96228
95352
  index++;
96229
95353
  }
@@ -103223,10 +102347,10 @@ var require_dist6 = __commonJS({
103223
102347
  }
103224
102348
  };
103225
102349
  };
103226
- var getOutputExtensionMap = (options, format2, pkgType) => {
102350
+ var getOutputExtensionMap = (options, format3, pkgType) => {
103227
102351
  const outExtension2 = options.outExtension || _chunkGQ77QZBOjs.defaultOutExtension;
103228
- const defaultExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format: format2, pkgType });
103229
- const extension = outExtension2({ options, format: format2, pkgType });
102352
+ const defaultExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format: format3, pkgType });
102353
+ const extension = outExtension2({ options, format: format3, pkgType });
103230
102354
  return {
103231
102355
  ".js": extension.js || defaultExtension.js
103232
102356
  };
@@ -103245,9 +102369,9 @@ var require_dist6 = __commonJS({
103245
102369
  }
103246
102370
  return result;
103247
102371
  };
103248
- var packageJsonSearch = (outDir, silent, format2, logger3) => {
102372
+ var packageJsonSearch = (outDir, silent, format3, logger3) => {
103249
102373
  let pkgPath = outDir ? outDir : process.cwd();
103250
- !silent && logger3 && logger3.info(format2, `\u26A1 Beginning search for package.json file: ${pkgPath}`);
102374
+ !silent && logger3 && logger3.info(format3, `\u26A1 Beginning search for package.json file: ${pkgPath}`);
103251
102375
  if (pkgPath) {
103252
102376
  const splits = pkgPath.includes("\\") ? pkgPath.split("\\") : pkgPath.split("/");
103253
102377
  if (splits.length > 0) {
@@ -103260,12 +102384,12 @@ var require_dist6 = __commonJS({
103260
102384
  "package.json"
103261
102385
  );
103262
102386
  !silent && logger3 && logger3.info(
103263
- format2,
102387
+ format3,
103264
102388
  `\u26A1 Searching for package.json file in ${packageJsonPath} (index: ${i})`
103265
102389
  );
103266
102390
  if (_fs2.default.existsSync(packageJsonPath)) {
103267
102391
  !silent && logger3 && logger3.info(
103268
- format2,
102392
+ format3,
103269
102393
  `\u26A1 Found the package.json file in ${packageJsonPath} (index: ${i})`
103270
102394
  );
103271
102395
  pkgPath = packageJsonPath.replace("package.json", "");
@@ -103276,21 +102400,21 @@ var require_dist6 = __commonJS({
103276
102400
  }
103277
102401
  if (pkgPath === outDir) {
103278
102402
  !silent && logger3 && logger3.info(
103279
- format2,
102403
+ format3,
103280
102404
  `\u26A1 No package.json file found, using ${pkgPath} as the output directory`
103281
102405
  );
103282
102406
  }
103283
102407
  return pkgPath;
103284
102408
  };
103285
102409
  async function runEsbuild(options, {
103286
- format: format2,
102410
+ format: format3,
103287
102411
  css,
103288
102412
  logger: logger3,
103289
102413
  buildDependencies,
103290
102414
  pluginContainer
103291
102415
  }) {
103292
- const pkgPath = packageJsonSearch(options.outDir, options.silent, format2, logger3);
103293
- logger3.info(format2, `\u26A1 Running ESBuild: ${pkgPath}`);
102416
+ const pkgPath = packageJsonSearch(options.outDir, options.silent, format3, logger3);
102417
+ logger3.info(format3, `\u26A1 Running ESBuild: ${pkgPath}`);
103294
102418
  const pkg = await _chunk7G76EW2Rjs.loadPkg.call(void 0, pkgPath);
103295
102419
  const deps = await _chunk7G76EW2Rjs.getProductionDeps.call(void 0, pkgPath);
103296
102420
  const external = [
@@ -103299,41 +102423,41 @@ var require_dist6 = __commonJS({
103299
102423
  ...await generateExternal(options.external || [], options, logger3)
103300
102424
  ];
103301
102425
  const outDir = options.outDir;
103302
- const outExtension2 = getOutputExtensionMap(options, format2, pkg.type);
102426
+ const outExtension2 = getOutputExtensionMap(options, format3, pkg.type);
103303
102427
  const env2 = {
103304
102428
  ...options.env
103305
102429
  };
103306
102430
  if (options.replaceNodeEnv) {
103307
102431
  env2.NODE_ENV = options.minify || options.minifyWhitespace ? "production" : "development";
103308
102432
  }
103309
- logger3.info(format2, "Build start");
102433
+ logger3.info(format3, "Build start");
103310
102434
  const startTime = Date.now();
103311
102435
  let result;
103312
- const splitting = format2 === "iife" ? false : typeof options.splitting === "boolean" ? options.splitting : format2 === "esm";
102436
+ const splitting = format3 === "iife" ? false : typeof options.splitting === "boolean" ? options.splitting : format3 === "esm";
103313
102437
  const platform = options.platform || "node";
103314
102438
  const loader = options.loader || {};
103315
102439
  const injectShims = options.shims;
103316
102440
  pluginContainer.setContext({
103317
- format: format2,
102441
+ format: format3,
103318
102442
  splitting,
103319
102443
  options,
103320
102444
  logger: logger3
103321
102445
  });
103322
102446
  await pluginContainer.buildStarted();
103323
102447
  const esbuildPlugins = [
103324
- format2 === "cjs" && nodeProtocolPlugin(),
102448
+ format3 === "cjs" && nodeProtocolPlugin(),
103325
102449
  {
103326
102450
  name: "modify-options",
103327
102451
  setup(build22) {
103328
102452
  pluginContainer.modifyEsbuildOptions(build22.initialOptions);
103329
102453
  if (options.esbuildOptions) {
103330
- options.esbuildOptions(build22.initialOptions, { format: format2 });
102454
+ options.esbuildOptions(build22.initialOptions, { format: format3 });
103331
102455
  }
103332
102456
  }
103333
102457
  },
103334
102458
  // esbuild's `external` option doesn't support RegExp
103335
102459
  // So here we use a custom plugin to implement it
103336
- format2 !== "iife" && externalPlugin({
102460
+ format3 !== "iife" && externalPlugin({
103337
102461
  external,
103338
102462
  noExternal: options.noExternal,
103339
102463
  skipNodeModulesBundle: options.skipNodeModulesBundle,
@@ -103351,12 +102475,12 @@ var require_dist6 = __commonJS({
103351
102475
  if (options.skipNativeModulesPlugin !== true) {
103352
102476
  esbuildPlugins.push(nativeNodeModulesPlugin());
103353
102477
  }
103354
- const banner = typeof options.banner === "function" ? options.banner({ format: format2 }) : options.banner;
103355
- const footer = typeof options.footer === "function" ? options.footer({ format: format2 }) : options.footer;
102478
+ const banner = typeof options.banner === "function" ? options.banner({ format: format3 }) : options.banner;
102479
+ const footer = typeof options.footer === "function" ? options.footer({ format: format3 }) : options.footer;
103356
102480
  try {
103357
102481
  result = await _esbuild.build.call(void 0, {
103358
102482
  entryPoints: options.entry,
103359
- format: format2 === "cjs" && splitting || options.treeshake ? "esm" : format2,
102483
+ format: format3 === "cjs" && splitting || options.treeshake ? "esm" : format3,
103360
102484
  bundle: typeof options.bundle === "undefined" ? true : options.bundle,
103361
102485
  platform,
103362
102486
  globalName: options.globalName,
@@ -103395,8 +102519,8 @@ var require_dist6 = __commonJS({
103395
102519
  mainFields: platform === "node" ? ["module", "main"] : ["browser", "module", "main"],
103396
102520
  plugins: esbuildPlugins.filter(_chunkGQ77QZBOjs.truthy),
103397
102521
  define: {
103398
- TSUP_FORMAT: JSON.stringify(format2),
103399
- ...format2 === "cjs" && injectShims ? {
102522
+ TSUP_FORMAT: JSON.stringify(format3),
102523
+ ...format3 === "cjs" && injectShims ? {
103400
102524
  "import.meta.url": "importMetaUrl"
103401
102525
  } : {},
103402
102526
  ...options.define,
@@ -103410,11 +102534,11 @@ var require_dist6 = __commonJS({
103410
102534
  }, {})
103411
102535
  },
103412
102536
  inject: [
103413
- format2 === "cjs" && injectShims ? _path2.default.join(__dirname, "../../../assets/cjs_shims.js") : "",
103414
- format2 === "esm" && injectShims && platform === "node" ? _path2.default.join(__dirname, "../../../assets/esm_shims.js") : "",
102537
+ format3 === "cjs" && injectShims ? _path2.default.join(__dirname, "../../../assets/cjs_shims.js") : "",
102538
+ format3 === "esm" && injectShims && platform === "node" ? _path2.default.join(__dirname, "../../../assets/esm_shims.js") : "",
103415
102539
  ...options.inject || []
103416
102540
  ].filter(Boolean),
103417
- outdir: options.legacyOutput && format2 !== "cjs" ? _path2.default.join(outDir, format2) : outDir,
102541
+ outdir: options.legacyOutput && format3 !== "cjs" ? _path2.default.join(outDir, format3) : outDir,
103418
102542
  outExtension: options.legacyOutput ? void 0 : outExtension2,
103419
102543
  write: false,
103420
102544
  splitting,
@@ -103430,7 +102554,7 @@ var require_dist6 = __commonJS({
103430
102554
  });
103431
102555
  await new Promise((r) => setTimeout(r, 100));
103432
102556
  } catch (error) {
103433
- logger3.error(format2, "Build failed");
102557
+ logger3.error(format3, "Build failed");
103434
102558
  throw error;
103435
102559
  }
103436
102560
  if (result && result.warnings && !_chunk7G76EW2Rjs.getSilent.call(void 0)) {
@@ -103455,14 +102579,14 @@ var require_dist6 = __commonJS({
103455
102579
  metafile: result.metafile
103456
102580
  });
103457
102581
  const timeInMs = Date.now() - startTime;
103458
- logger3.success(format2, `\u26A1\uFE0F Build success in ${Math.floor(timeInMs)}ms`);
102582
+ logger3.success(format3, `\u26A1\uFE0F Build success in ${Math.floor(timeInMs)}ms`);
103459
102583
  }
103460
102584
  if (result.metafile) {
103461
102585
  for (const file of Object.keys(result.metafile.inputs)) {
103462
102586
  buildDependencies.add(file);
103463
102587
  }
103464
102588
  if (options.metafile) {
103465
- const outPath = _path2.default.resolve(outDir, `metafile-${format2}.json`);
102589
+ const outPath = _path2.default.resolve(outDir, `metafile-${format3}.json`);
103466
102590
  await _fs2.default.promises.mkdir(_path2.default.dirname(outPath), { recursive: true });
103467
102591
  await _fs2.default.promises.writeFile(
103468
102592
  outPath,
@@ -103795,7 +102919,7 @@ var require_dist6 = __commonJS({
103795
102919
  };
103796
102920
  var terserPlugin = ({
103797
102921
  minifyOptions,
103798
- format: format2,
102922
+ format: format3,
103799
102923
  terserOptions = {},
103800
102924
  globalName,
103801
102925
  logger: logger3
@@ -103813,9 +102937,9 @@ var require_dist6 = __commonJS({
103813
102937
  }
103814
102938
  const { minify } = terser;
103815
102939
  const defaultOptions2 = {};
103816
- if (format2 === "esm") {
102940
+ if (format3 === "esm") {
103817
102941
  defaultOptions2.module = true;
103818
- } else if (!(format2 === "iife" && globalName !== void 0)) {
102942
+ } else if (!(format3 === "iife" && globalName !== void 0)) {
103819
102943
  defaultOptions2.toplevel = true;
103820
102944
  }
103821
102945
  try {
@@ -104131,14 +103255,14 @@ var require_dist6 = __commonJS({
104131
103255
  );
104132
103256
  }
104133
103257
  }
104134
- async function rollupDtsFiles(options, exports2, format2) {
103258
+ async function rollupDtsFiles(options, exports2, format3) {
104135
103259
  let declarationDir = _chunkGQ77QZBOjs.ensureTempDeclarationDir.call(void 0, options);
104136
103260
  let outDir = options.outDir || "dist";
104137
103261
  let pkgPath = packageJsonSearch(outDir, options.silent, "dts", logger2);
104138
103262
  !options.silent && logger2.info("dts", `\u26A1 Preparing to run Rollup (DTS generate): ${pkgPath}`);
104139
103263
  !options.silent && logger2.info("dts", `\u26A1 Exports list to use in generation: ${exports2.map((e) => JSON.stringify(e)).join("\n")}`);
104140
103264
  let pkg = await _chunk7G76EW2Rjs.loadPkg.call(void 0, pkgPath);
104141
- let dtsExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format: format2, pkgType: pkg.type }).dts;
103265
+ let dtsExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format: format3, pkgType: pkg.type }).dts;
104142
103266
  let dtsInputFilePath = _path2.default.join(
104143
103267
  declarationDir,
104144
103268
  "_tsup-dts-aggregation" + dtsExtension
@@ -104166,8 +103290,8 @@ var require_dist6 = __commonJS({
104166
103290
  if (!exports2) {
104167
103291
  throw new Error("Unexpected internal error: dts exports is not define");
104168
103292
  }
104169
- for (const format2 of options.format) {
104170
- await rollupDtsFiles(options, exports2, format2);
103293
+ for (const format3 of options.format) {
103294
+ await rollupDtsFiles(options, exports2, format3);
104171
103295
  }
104172
103296
  logger2.success("dts", `\u26A1\uFE0F Build success in ${getDuration()}`);
104173
103297
  } catch (error) {
@@ -104381,7 +103505,7 @@ var require_dist6 = __commonJS({
104381
103505
  }
104382
103506
  const css = /* @__PURE__ */ new Map();
104383
103507
  await Promise.all([
104384
- ...options.format.map(async (format2, index) => {
103508
+ ...options.format.map(async (format3, index) => {
104385
103509
  const pluginContainer = new PluginContainer([
104386
103510
  shebang(),
104387
103511
  ...options.plugins || [],
@@ -104396,7 +103520,7 @@ var require_dist6 = __commonJS({
104396
103520
  sizeReporter(),
104397
103521
  terserPlugin({
104398
103522
  minifyOptions: options.minify,
104399
- format: format2,
103523
+ format: format3,
104400
103524
  terserOptions: options.terserOptions,
104401
103525
  globalName: options.globalName,
104402
103526
  logger: logger3
@@ -104404,7 +103528,7 @@ var require_dist6 = __commonJS({
104404
103528
  ]);
104405
103529
  await runEsbuild(options, {
104406
103530
  pluginContainer,
104407
- format: format2,
103531
+ format: format3,
104408
103532
  css: index === 0 || options.injectStyle ? css : void 0,
104409
103533
  logger: logger3,
104410
103534
  buildDependencies
@@ -105116,7 +104240,7 @@ var require_positions = __commonJS({
105116
104240
  });
105117
104241
 
105118
104242
  // node_modules/.pnpm/ret@0.2.2/node_modules/ret/lib/index.js
105119
- var require_lib7 = __commonJS({
104243
+ var require_lib6 = __commonJS({
105120
104244
  "node_modules/.pnpm/ret@0.2.2/node_modules/ret/lib/index.js"(exports, module2) {
105121
104245
  var util2 = require_util6();
105122
104246
  var types2 = require_types6();
@@ -105307,7 +104431,7 @@ var require_lib7 = __commonJS({
105307
104431
  });
105308
104432
 
105309
104433
  // node_modules/.pnpm/drange@1.1.1/node_modules/drange/lib/index.js
105310
- var require_lib8 = __commonJS({
104434
+ var require_lib7 = __commonJS({
105311
104435
  "node_modules/.pnpm/drange@1.1.1/node_modules/drange/lib/index.js"(exports, module2) {
105312
104436
  "use strict";
105313
104437
  var SubRange = class _SubRange {
@@ -105472,8 +104596,8 @@ var require_lib8 = __commonJS({
105472
104596
  // node_modules/.pnpm/randexp@0.5.3/node_modules/randexp/lib/randexp.js
105473
104597
  var require_randexp = __commonJS({
105474
104598
  "node_modules/.pnpm/randexp@0.5.3/node_modules/randexp/lib/randexp.js"(exports, module2) {
105475
- var ret = require_lib7();
105476
- var DRange = require_lib8();
104599
+ var ret = require_lib6();
104600
+ var DRange = require_lib7();
105477
104601
  var types2 = ret.types;
105478
104602
  module2.exports = class RandExp {
105479
104603
  /**
@@ -127024,6 +126148,7 @@ __export(workspace_tools_exports, {
127024
126148
  prettierPrismaVersion: () => prettierPrismaVersion,
127025
126149
  prettierVersion: () => prettierVersion,
127026
126150
  removeExtension: () => removeExtension,
126151
+ runTsupBuild: () => runTsupBuild,
127027
126152
  semanticReleaseVersion: () => semanticReleaseVersion,
127028
126153
  stormInitGenerator: () => stormInitGenerator,
127029
126154
  swcCliVersion: () => swcCliVersion,
@@ -133112,7 +132237,7 @@ function defaultConfig({
133112
132237
  tsconfig = "tsconfig.json",
133113
132238
  splitting,
133114
132239
  treeshake,
133115
- format: format2 = ["cjs", "esm"],
132240
+ format: format3 = ["cjs", "esm"],
133116
132241
  debug = false,
133117
132242
  shims = true,
133118
132243
  external,
@@ -133135,7 +132260,7 @@ function defaultConfig({
133135
132260
  return {
133136
132261
  name: "default",
133137
132262
  entry,
133138
- format: format2,
132263
+ format: format3,
133139
132264
  target: platform !== "node" ? ["chrome91", "firefox90", "edge91", "safari15", "ios15", "opera77", "esnext"] : ["esnext", "node20"],
133140
132265
  tsconfig,
133141
132266
  splitting,
@@ -133189,18 +132314,18 @@ function getConfig(workspaceRoot, projectRoot, getConfigFn, { outputPath, tsConf
133189
132314
  platform
133190
132315
  });
133191
132316
  }
133192
- var outExtension = ({ format: format2 }) => {
132317
+ var outExtension = ({ format: format3 }) => {
133193
132318
  let jsExtension = ".js";
133194
132319
  let dtsExtension = ".d.ts";
133195
- if (format2 === "cjs") {
132320
+ if (format3 === "cjs") {
133196
132321
  jsExtension = ".cjs";
133197
132322
  dtsExtension = ".d.cts";
133198
132323
  }
133199
- if (format2 === "esm") {
132324
+ if (format3 === "esm") {
133200
132325
  jsExtension = ".js";
133201
132326
  dtsExtension = ".d.ts";
133202
132327
  }
133203
- if (format2 === "iife") {
132328
+ if (format3 === "iife") {
133204
132329
  jsExtension = ".global.js";
133205
132330
  }
133206
132331
  return {
@@ -133600,15 +132725,14 @@ ${commentStart} ----------------------------------------------------------------
133600
132725
  `;
133601
132726
  };
133602
132727
 
133603
- // packages/workspace-tools/src/executors/tsup/executor.ts
132728
+ // packages/workspace-tools/src/utils/run-tsup-build.ts
133604
132729
  var import_node_fs5 = require("node:fs");
133605
132730
  var import_promises3 = require("node:fs/promises");
133606
- var import_node_path6 = require("node:path");
132731
+ var import_node_path5 = require("node:path");
133607
132732
  var import_esbuild_decorators = __toESM(require_src2());
133608
132733
  var import_devkit3 = __toESM(require_devkit());
133609
- var import_js2 = __toESM(require_src());
132734
+ var import_get_custom_transformers_factory = __toESM(require_get_custom_transformers_factory());
133610
132735
  var import_normalize_options = __toESM(require_normalize_options());
133611
- var import_tsc = __toESM(require_tsc_impl());
133612
132736
 
133613
132737
  // node_modules/.pnpm/esbuild-plugin-define@0.4.0_esbuild@0.19.5/node_modules/esbuild-plugin-define/dist/mjs/utils.js
133614
132738
  var makeKey = (...inputs) => inputs.filter((input) => !!input).join(".");
@@ -133651,9 +132775,6 @@ var environmentPlugin = (data) => ({
133651
132775
  }
133652
132776
  });
133653
132777
 
133654
- // packages/workspace-tools/src/executors/tsup/executor.ts
133655
- var import_fs_extra = __toESM(require_lib4());
133656
-
133657
132778
  // node_modules/.pnpm/minimatch@9.0.3/node_modules/minimatch/dist/mjs/index.js
133658
132779
  var import_brace_expansion = __toESM(require_brace_expansion2(), 1);
133659
132780
 
@@ -139828,20 +138949,229 @@ var glob = Object.assign(glob_, {
139828
138949
  });
139829
138950
  glob.glob = glob;
139830
138951
 
139831
- // packages/workspace-tools/src/executors/tsup/executor.ts
139832
- var import_fileutils = require("nx/src/utils/fileutils");
138952
+ // packages/workspace-tools/src/utils/run-tsup-build.ts
139833
138953
  var import_prettier = require("prettier");
139834
138954
  var import_tsup = __toESM(require_dist6());
139835
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
+ // 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
+ var import_fileutils = require("nx/src/utils/fileutils");
139165
+ var import_prettier2 = require("prettier");
139836
139166
 
139837
139167
  // packages/workspace-tools/src/utils/file-path-utils.ts
139838
- var import_node_path5 = require("node:path");
139168
+ var import_node_path6 = require("node:path");
139839
139169
  var removeExtension = (filePath) => {
139840
139170
  return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
139841
139171
  };
139842
139172
  function findFileName(filePath) {
139843
139173
  return filePath?.split(
139844
- filePath?.includes(import_node_path5.sep) ? import_node_path5.sep : filePath?.includes("/") ? "/" : "\\"
139174
+ filePath?.includes(import_node_path6.sep) ? import_node_path6.sep : filePath?.includes("/") ? "/" : "\\"
139845
139175
  )?.pop() ?? "";
139846
139176
  }
139847
139177
 
@@ -139959,9 +139289,9 @@ ${Object.keys(options).map(
139959
139289
  if (!result.success) {
139960
139290
  throw new Error("The Build process failed trying to copy assets");
139961
139291
  }
139962
- const pathToPackageJson = (0, import_devkit3.joinPathFragments)(context.root, projectRoot, "package.json");
139963
- const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit3.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
139964
- const workspacePackageJson = (0, import_devkit3.readJsonFile)((0, import_devkit3.joinPathFragments)(workspaceRoot, "package.json"));
139292
+ const pathToPackageJson = (0, import_devkit4.joinPathFragments)(context.root, projectRoot, "package.json");
139293
+ const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit4.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
139294
+ const workspacePackageJson = (0, import_devkit4.readJsonFile)((0, import_devkit4.joinPathFragments)(workspaceRoot, "package.json"));
139965
139295
  options.external = options.external || [];
139966
139296
  if (workspacePackageJson?.dependencies) {
139967
139297
  options.external = Object.keys(workspacePackageJson?.dependencies).reduce(
@@ -140002,7 +139332,7 @@ ${Object.keys(options).map(
140002
139332
  writeDebug(config, `\u26A1 Adding implicit dependency: ${key}`);
140003
139333
  const projectConfig = projectConfigs[key];
140004
139334
  if (projectConfig?.targets?.build) {
140005
- const projectPackageJson = (0, import_devkit3.readJsonFile)(projectConfig.targets?.build.options.project);
139335
+ const projectPackageJson = (0, import_devkit4.readJsonFile)(projectConfig.targets?.build.options.project);
140006
139336
  if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
140007
139337
  ret.push(projectPackageJson.name);
140008
139338
  internalDependencies.push(projectPackageJson.name);
@@ -140051,7 +139381,7 @@ ${externalDependencies.map((dep) => {
140051
139381
  entryPoints.push(options.entry);
140052
139382
  }
140053
139383
  if (options.emitOnAll === true) {
140054
- entryPoints.push((0, import_devkit3.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
139384
+ entryPoints.push((0, import_devkit4.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
140055
139385
  }
140056
139386
  if (options.additionalEntryPoints) {
140057
139387
  entryPoints.push(...options.additionalEntryPoints);
@@ -140063,26 +139393,26 @@ ${externalDependencies.map((dep) => {
140063
139393
  if (formattedPath.toUpperCase().startsWith("C:")) {
140064
139394
  formattedPath = formattedPath.substring(2);
140065
139395
  }
140066
- let propertyKey = (0, import_devkit3.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
139396
+ let propertyKey = (0, import_devkit4.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
140067
139397
  if (propertyKey) {
140068
139398
  while (propertyKey.startsWith("/")) {
140069
139399
  propertyKey = propertyKey.substring(1);
140070
139400
  }
140071
139401
  writeDebug(
140072
139402
  config,
140073
- `Trying to add entry point ${propertyKey} at "${(0, import_devkit3.joinPathFragments)(
139403
+ `Trying to add entry point ${propertyKey} at "${(0, import_devkit4.joinPathFragments)(
140074
139404
  filePath.path,
140075
139405
  filePath.name
140076
139406
  )}"`
140077
139407
  );
140078
139408
  if (!(propertyKey in ret)) {
140079
- ret[propertyKey] = (0, import_devkit3.joinPathFragments)(filePath.path, filePath.name);
139409
+ ret[propertyKey] = (0, import_devkit4.joinPathFragments)(filePath.path, filePath.name);
140080
139410
  }
140081
139411
  }
140082
139412
  return ret;
140083
139413
  }, {});
140084
139414
  if (options.generatePackageJson !== false) {
140085
- const projectGraph = (0, import_devkit3.readCachedProjectGraph)();
139415
+ const projectGraph = (0, import_devkit4.readCachedProjectGraph)();
140086
139416
  packageJson.dependencies = void 0;
140087
139417
  for (const externalDependency of externalDependencies) {
140088
139418
  const packageConfig = externalDependency.node.data;
@@ -140100,7 +139430,7 @@ ${externalDependencies.map((dep) => {
140100
139430
  packageJson.dependencies[packageName] = "latest";
140101
139431
  }
140102
139432
  }
140103
- const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? ["dist/"] : Object.keys(options.getConfig).map((key) => `${key}/`);
139433
+ const distPaths = !options?.getConfig || _isFunction2(options.getConfig) ? ["dist/"] : Object.keys(options.getConfig).map((key) => `${key}/`);
140104
139434
  packageJson.type = "module";
140105
139435
  if (distPaths.length > 0) {
140106
139436
  packageJson.exports ??= {
@@ -140116,22 +139446,47 @@ ${externalDependencies.map((dep) => {
140116
139446
  default: {
140117
139447
  types: `./${distPaths[0]}index.d.ts`,
140118
139448
  default: `./${distPaths[0]}index.js`
140119
- },
140120
- ...(options.additionalEntryPoints ?? []).map((entryPoint) => ({
140121
- [removeExtension(entryPoint).replace(sourceRoot, "")]: {
140122
- types: (0, import_devkit3.joinPathFragments)(
140123
- `./${distPaths[0]}`,
140124
- `${removeExtension(entryPoint.replace(sourceRoot, ""))}.d.ts`
140125
- ),
140126
- default: (0, import_devkit3.joinPathFragments)(
140127
- `./${distPaths[0]}`,
140128
- `${removeExtension(entryPoint.replace(sourceRoot, ""))}.js`
140129
- )
140130
- }
140131
- }))
139449
+ }
140132
139450
  },
140133
139451
  "./package.json": "./package.json"
140134
139452
  };
139453
+ for (const additionalEntryPoint of options.additionalEntryPoints) {
139454
+ packageJson.exports[`./${(0, import_devkit4.joinPathFragments)(
139455
+ distPaths[0],
139456
+ removeExtension(additionalEntryPoint).replace(sourceRoot, "")
139457
+ )}`] = {
139458
+ import: {
139459
+ types: `./${(0, import_devkit4.joinPathFragments)(
139460
+ distPaths[0],
139461
+ removeExtension(additionalEntryPoint).replace(sourceRoot, "")
139462
+ )}.d.ts`,
139463
+ default: `./${(0, import_devkit4.joinPathFragments)(
139464
+ distPaths[0],
139465
+ removeExtension(additionalEntryPoint).replace(sourceRoot, "")
139466
+ )}.js`
139467
+ },
139468
+ require: {
139469
+ types: `./${(0, import_devkit4.joinPathFragments)(
139470
+ distPaths[0],
139471
+ removeExtension(additionalEntryPoint).replace(sourceRoot, "")
139472
+ )}.d.cts`,
139473
+ default: `./${(0, import_devkit4.joinPathFragments)(
139474
+ distPaths[0],
139475
+ removeExtension(additionalEntryPoint).replace(sourceRoot, "")
139476
+ )}.cjs`
139477
+ },
139478
+ default: {
139479
+ types: `./${(0, import_devkit4.joinPathFragments)(
139480
+ distPaths[0],
139481
+ removeExtension(additionalEntryPoint).replace(sourceRoot, "")
139482
+ )}.d.ts`,
139483
+ default: `./${(0, import_devkit4.joinPathFragments)(
139484
+ distPaths[0],
139485
+ removeExtension(additionalEntryPoint).replace(sourceRoot, "")
139486
+ )}.js`
139487
+ }
139488
+ };
139489
+ }
140135
139490
  packageJson.exports = Object.keys(entry).reduce((ret, key) => {
140136
139491
  let packageJsonKey = key.startsWith("./") ? key : `./${key}`;
140137
139492
  packageJsonKey = packageJsonKey.replaceAll("/index", "");
@@ -140169,7 +139524,7 @@ ${externalDependencies.map((dep) => {
140169
139524
  if (distSrc.startsWith("/")) {
140170
139525
  distSrc = distSrc.substring(1);
140171
139526
  }
140172
- packageJson.source ??= `${(0, import_devkit3.joinPathFragments)(distSrc, "index.ts").replaceAll("\\", "/")}`;
139527
+ packageJson.source ??= `${(0, import_devkit4.joinPathFragments)(distSrc, "index.ts").replaceAll("\\", "/")}`;
140173
139528
  }
140174
139529
  packageJson.sideEffects ??= false;
140175
139530
  packageJson.files ??= ["dist/**/*"];
@@ -140187,12 +139542,12 @@ ${externalDependencies.map((dep) => {
140187
139542
  packageJson.license ??= workspacePackageJson.license;
140188
139543
  packageJson.keywords ??= workspacePackageJson.keywords;
140189
139544
  packageJson.repository ??= workspacePackageJson.repository;
140190
- packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_devkit3.joinPathFragments)("packages", context.projectName);
140191
- const packageJsonPath = (0, import_devkit3.joinPathFragments)(context.root, options.outputPath, "package.json");
139545
+ packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_devkit4.joinPathFragments)("packages", context.projectName);
139546
+ const packageJsonPath = (0, import_devkit4.joinPathFragments)(context.root, options.outputPath, "package.json");
140192
139547
  writeDebug(config, `\u26A1 Writing package.json file to: ${packageJsonPath}`);
140193
- (0, import_node_fs5.writeFileSync)(
139548
+ (0, import_node_fs6.writeFileSync)(
140194
139549
  packageJsonPath,
140195
- await (0, import_prettier.format)(JSON.stringify(packageJson), {
139550
+ await (0, import_prettier2.format)(JSON.stringify(packageJson), {
140196
139551
  ...prettierOptions,
140197
139552
  parser: "json"
140198
139553
  })
@@ -140200,179 +139555,21 @@ ${externalDependencies.map((dep) => {
140200
139555
  } else {
140201
139556
  writeWarning(config, "Skipping writing to package.json file");
140202
139557
  }
140203
- if (options.includeSrc === true) {
140204
- const files = globSync([
140205
- (0, import_devkit3.joinPathFragments)(context.root, options.outputPath, "src/**/*.ts"),
140206
- (0, import_devkit3.joinPathFragments)(context.root, options.outputPath, "src/**/*.tsx"),
140207
- (0, import_devkit3.joinPathFragments)(context.root, options.outputPath, "src/**/*.js"),
140208
- (0, import_devkit3.joinPathFragments)(context.root, options.outputPath, "src/**/*.jsx")
140209
- ]);
140210
- await Promise.allSettled(
140211
- files.map(
140212
- async (file) => (0, import_promises3.writeFile)(
140213
- file,
140214
- await (0, import_prettier.format)(
140215
- `${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
140216
-
140217
- ${(0, import_node_fs5.readFileSync)(file, "utf-8")}`,
140218
- {
140219
- ...prettierOptions,
140220
- parser: "typescript"
140221
- }
140222
- ),
140223
- "utf-8"
140224
- )
140225
- )
140226
- );
140227
- }
140228
- const stormEnv = Object.keys(options.env).filter((key) => key.startsWith("STORM_")).reduce((ret, key) => {
140229
- ret[key] = options.env[key];
140230
- return ret;
140231
- }, {});
140232
- options.plugins.push(
140233
- (0, import_esbuild_decorators.esbuildDecorators)({
140234
- tsconfig: options.tsConfig,
140235
- cwd: workspaceRoot
140236
- })
140237
- );
140238
- options.plugins.push(environmentPlugin(stormEnv));
140239
- const getConfigOptions = {
140240
- ...options,
140241
- define: {
140242
- __STORM_CONFIG: JSON.stringify(stormEnv)
140243
- },
140244
- env: {
140245
- __STORM_CONFIG: JSON.stringify(stormEnv),
140246
- ...stormEnv
139558
+ await runTsupBuild(
139559
+ {
139560
+ entry,
139561
+ projectRoot,
139562
+ projectName: context.projectName,
139563
+ sourceRoot
140247
139564
  },
140248
- dtsTsConfig: getNormalizedTsConfig(
140249
- context.root,
140250
- options.outputPath,
140251
- (0, import_tsc.createTypeScriptCompilationOptions)(
140252
- (0, import_normalize_options.normalizeOptions)(
140253
- {
140254
- ...options,
140255
- watch: false,
140256
- main: options.entry,
140257
- transformers: []
140258
- },
140259
- context.root,
140260
- sourceRoot,
140261
- workspaceRoot
140262
- ),
140263
- context
140264
- )
140265
- ),
140266
- banner: options.banner ? {
140267
- js: `${options.banner}
140268
-
140269
- `,
140270
- css: `/*
140271
- ${options.banner}
140272
-
140273
-
140274
-
140275
- */`
140276
- } : void 0,
140277
- outputPath: options.outputPath,
140278
- entry
140279
- };
140280
- if (options.getConfig) {
140281
- writeInfo(config, "\u26A1 Running the Build process");
140282
- const getConfigFns = _isFunction(options.getConfig) ? [options.getConfig] : Object.keys(options.getConfig).map((key) => options.getConfig[key]);
140283
- const tsupConfig = (0, import_tsup.defineConfig)(
140284
- getConfigFns.map(
140285
- (getConfigFn) => getConfig(context.root, projectRoot, getConfigFn, getConfigOptions)
140286
- )
140287
- );
140288
- if (_isFunction(tsupConfig)) {
140289
- await build(await Promise.resolve(tsupConfig({})), config);
140290
- } else {
140291
- await build(tsupConfig, config);
140292
- }
140293
- } else if (getLogLevel(config?.logLevel) >= LogLevel.WARN) {
140294
- writeWarning(
140295
- config,
140296
- "The Build process did not run because no `getConfig` parameter was provided"
140297
- );
140298
- }
139565
+ config,
139566
+ options
139567
+ );
140299
139568
  writeSuccess(config, "\u26A1 The Build process has completed successfully");
140300
139569
  return {
140301
139570
  success: true
140302
139571
  };
140303
139572
  }
140304
- function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
140305
- const config = ts.readConfigFile(options.tsConfig, ts.sys.readFile).config;
140306
- const tsConfig = ts.parseJsonConfigFileContent(
140307
- {
140308
- ...config,
140309
- compilerOptions: {
140310
- ...config.compilerOptions,
140311
- outDir: outputPath,
140312
- rootDir: workspaceRoot,
140313
- baseUrl: workspaceRoot,
140314
- allowJs: true,
140315
- noEmit: false,
140316
- esModuleInterop: true,
140317
- downlevelIteration: true,
140318
- forceConsistentCasingInFileNames: true,
140319
- emitDeclarationOnly: true,
140320
- declaration: true,
140321
- declarationMap: true,
140322
- declarationDir: (0, import_devkit3.joinPathFragments)(workspaceRoot, "tmp", ".tsup", "declaration")
140323
- }
140324
- },
140325
- ts.sys,
140326
- (0, import_node_path6.dirname)(options.tsConfig)
140327
- );
140328
- tsConfig.options.pathsBasePath = workspaceRoot;
140329
- if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
140330
- tsConfig.options.tsBuildInfoFile = (0, import_devkit3.joinPathFragments)(outputPath, "tsconfig.tsbuildinfo");
140331
- }
140332
- return tsConfig;
140333
- }
140334
- var build = async (options, config) => {
140335
- if (Array.isArray(options)) {
140336
- await Promise.all(options.map((buildOptions) => build(buildOptions, config)));
140337
- } else {
140338
- if (getLogLevel(config?.logLevel) >= LogLevel.TRACE && !options.silent) {
140339
- console.log("\u2699\uFE0F Tsup build config: \n", options, "\n");
140340
- }
140341
- await (0, import_tsup.build)(options);
140342
- await new Promise((r) => setTimeout(r, 100));
140343
- }
140344
- };
140345
- var applyDefaultOptions = (options) => {
140346
- options.entry ??= "{sourceRoot}/index.ts";
140347
- options.outputPath ??= "dist/{projectRoot}";
140348
- options.tsConfig ??= "tsconfig.json";
140349
- options.generatePackageJson ??= true;
140350
- options.splitting ??= true;
140351
- options.treeshake ??= true;
140352
- options.platform ??= "neutral";
140353
- options.format ??= ["cjs", "esm"];
140354
- options.verbose ??= false;
140355
- options.external ??= [];
140356
- options.additionalEntryPoints ??= [];
140357
- options.assets ??= [];
140358
- options.plugins ??= [];
140359
- options.includeSrc ??= false;
140360
- options.minify ??= false;
140361
- options.clean ??= true;
140362
- options.bundle ??= true;
140363
- options.debug ??= false;
140364
- options.watch ??= false;
140365
- options.apiReport ??= true;
140366
- options.docModel ??= true;
140367
- options.tsdocMetadata ??= true;
140368
- options.emitOnAll ??= false;
140369
- options.metafile ??= true;
140370
- options.skipNativeModulesPlugin ??= false;
140371
- options.define ??= {};
140372
- options.env ??= {};
140373
- options.getConfig ??= { dist: defaultConfig };
140374
- return options;
140375
- };
140376
139573
  var executor_default = withRunExecutor("TypeScript Build using tsup", tsupExecutorFn, {
140377
139574
  skipReadingConfig: false,
140378
139575
  hooks: {
@@ -140386,7 +139583,7 @@ var _isPrimitive = (value) => {
140386
139583
  return false;
140387
139584
  }
140388
139585
  };
140389
- var _isFunction = (value) => {
139586
+ var _isFunction2 = (value) => {
140390
139587
  try {
140391
139588
  return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
140392
139589
  } catch (e) {
@@ -140395,7 +139592,7 @@ var _isFunction = (value) => {
140395
139592
  };
140396
139593
 
140397
139594
  // packages/workspace-tools/src/executors/tsup-neutral/get-config.ts
140398
- var import_devkit4 = __toESM(require_devkit());
139595
+ var import_devkit5 = __toESM(require_devkit());
140399
139596
  var neutralConfig = ({
140400
139597
  entry,
140401
139598
  outDir,
@@ -140423,7 +139620,7 @@ var neutralConfig = ({
140423
139620
  minify = false,
140424
139621
  getTransform
140425
139622
  }) => {
140426
- const outputPath = (0, import_devkit4.joinPathFragments)(outDir, "dist");
139623
+ const outputPath = (0, import_devkit5.joinPathFragments)(outDir, "dist");
140427
139624
  const options = {
140428
139625
  name: "neutral",
140429
139626
  entry,
@@ -140525,7 +139722,7 @@ var executor_default2 = withRunExecutor(
140525
139722
  );
140526
139723
 
140527
139724
  // packages/workspace-tools/src/executors/tsup-node/get-config.ts
140528
- var import_devkit5 = __toESM(require_devkit());
139725
+ var import_devkit6 = __toESM(require_devkit());
140529
139726
  function nodeConfig({
140530
139727
  entry,
140531
139728
  outDir,
@@ -140566,7 +139763,7 @@ function nodeConfig({
140566
139763
  } : false,
140567
139764
  projectRoot,
140568
139765
  workspaceRoot,
140569
- outDir: (0, import_devkit5.joinPathFragments)(outDir, "dist"),
139766
+ outDir: (0, import_devkit6.joinPathFragments)(outDir, "dist"),
140570
139767
  silent: !verbose,
140571
139768
  metafile,
140572
139769
  shims,
@@ -140583,7 +139780,7 @@ function nodeConfig({
140583
139780
  ...dtsTsConfig,
140584
139781
  options: {
140585
139782
  ...dtsTsConfig.options,
140586
- outDir: (0, import_devkit5.joinPathFragments)(outDir, "dist")
139783
+ outDir: (0, import_devkit6.joinPathFragments)(outDir, "dist")
140587
139784
  }
140588
139785
  }
140589
139786
  },
@@ -140651,7 +139848,7 @@ var executor_default3 = withRunExecutor(
140651
139848
  );
140652
139849
 
140653
139850
  // packages/workspace-tools/src/executors/tsup-browser/get-config.ts
140654
- var import_devkit6 = __toESM(require_devkit());
139851
+ var import_devkit7 = __toESM(require_devkit());
140655
139852
  var modernBrowserConfig = ({
140656
139853
  entry,
140657
139854
  outDir,
@@ -140676,7 +139873,7 @@ var modernBrowserConfig = ({
140676
139873
  minify = false,
140677
139874
  getTransform
140678
139875
  }) => {
140679
- const outputPath = (0, import_devkit6.joinPathFragments)(outDir, "dist", "modern");
139876
+ const outputPath = (0, import_devkit7.joinPathFragments)(outDir, "dist", "modern");
140680
139877
  const options = {
140681
139878
  name: "modern",
140682
139879
  entry,
@@ -140760,7 +139957,7 @@ var legacyBrowserConfig = ({
140760
139957
  minify = false,
140761
139958
  getTransform
140762
139959
  }) => {
140763
- const outputPath = (0, import_devkit6.joinPathFragments)(outDir, "dist", "legacy");
139960
+ const outputPath = (0, import_devkit7.joinPathFragments)(outDir, "dist", "legacy");
140764
139961
  const options = {
140765
139962
  name: "legacy",
140766
139963
  entry,
@@ -140893,7 +140090,7 @@ var executor_default5 = withRunExecutor(
140893
140090
  );
140894
140091
 
140895
140092
  // packages/workspace-tools/src/generators/config-schema/generator.ts
140896
- var import_devkit7 = __toESM(require_devkit());
140093
+ var import_devkit8 = __toESM(require_devkit());
140897
140094
  var import_fs2 = require("fs");
140898
140095
  var import_path2 = require("path");
140899
140096
 
@@ -141945,12 +141142,12 @@ async function configSchemaGeneratorFn(tree, options) {
141945
141142
  const ModulesSchema = unionType([workspaceSchema, StormConfigSchema]).describe(
141946
141143
  "The values set in the Storm config file. This file is expected to be named `storm.config.js` and be located in the root of the workspace"
141947
141144
  );
141948
- (0, import_devkit7.writeJson)(
141145
+ (0, import_devkit8.writeJson)(
141949
141146
  tree,
141950
141147
  options.outputFile ? (0, import_path2.join)(workspaceRoot, options.outputFile) : (0, import_path2.join)(workspaceRoot, "storm.schema.json"),
141951
141148
  zodToJsonSchema(ModulesSchema, "StormConfig")
141952
141149
  );
141953
- await (0, import_devkit7.formatFiles)(tree);
141150
+ await (0, import_devkit8.formatFiles)(tree);
141954
141151
  return null;
141955
141152
  }
141956
141153
  var generator_default = withRunGenerator(
@@ -141959,9 +141156,9 @@ var generator_default = withRunGenerator(
141959
141156
  );
141960
141157
 
141961
141158
  // packages/workspace-tools/src/generators/init/init.ts
141962
- var import_devkit8 = __toESM(require_devkit());
141159
+ var import_devkit9 = __toESM(require_devkit());
141963
141160
  async function stormInitGenerator(tree, schema) {
141964
- const task = (0, import_devkit8.addDependenciesToPackageJson)(
141161
+ const task = (0, import_devkit9.addDependenciesToPackageJson)(
141965
141162
  tree,
141966
141163
  {
141967
141164
  "nx": nxVersion,
@@ -141974,15 +141171,15 @@ async function stormInitGenerator(tree, schema) {
141974
141171
  {}
141975
141172
  );
141976
141173
  if (!schema.skipFormat) {
141977
- await (0, import_devkit8.formatFiles)(tree);
141174
+ await (0, import_devkit9.formatFiles)(tree);
141978
141175
  }
141979
141176
  return task;
141980
141177
  }
141981
141178
 
141982
141179
  // packages/workspace-tools/src/generators/node-library/generator.ts
141983
- var import_devkit9 = __toESM(require_devkit());
141180
+ var import_devkit10 = __toESM(require_devkit());
141984
141181
  async function nodeLibraryGeneratorFn(tree, schema) {
141985
- const filesDir = (0, import_devkit9.joinPathFragments)(__dirname, "./files");
141182
+ const filesDir = (0, import_devkit10.joinPathFragments)(__dirname, "./files");
141986
141183
  const tsLibraryGeneratorOptions = {
141987
141184
  ...schema,
141988
141185
  platform: "node",
@@ -141992,10 +141189,10 @@ async function nodeLibraryGeneratorFn(tree, schema) {
141992
141189
  buildExecutor: "@storm-software/workspace-tools:tsup-node"
141993
141190
  };
141994
141191
  const options = await normalizeOptions(tree, tsLibraryGeneratorOptions);
141995
- const { className, name, propertyName } = (0, import_devkit9.names)(
141192
+ const { className, name, propertyName } = (0, import_devkit10.names)(
141996
141193
  options.projectNames.projectFileName
141997
141194
  );
141998
- (0, import_devkit9.generateFiles)(tree, filesDir, options.projectRoot, {
141195
+ (0, import_devkit10.generateFiles)(tree, filesDir, options.projectRoot, {
141999
141196
  ...schema,
142000
141197
  dot: ".",
142001
141198
  className,
@@ -142007,12 +141204,12 @@ async function nodeLibraryGeneratorFn(tree, schema) {
142007
141204
  cliCommand: "nx",
142008
141205
  strict: void 0,
142009
141206
  tmpl: "",
142010
- offsetFromRoot: (0, import_devkit9.offsetFromRoot)(options.projectRoot),
141207
+ offsetFromRoot: (0, import_devkit10.offsetFromRoot)(options.projectRoot),
142011
141208
  buildable: options.bundler && options.bundler !== "none",
142012
141209
  hasUnitTestRunner: options.unitTestRunner !== "none"
142013
141210
  });
142014
141211
  await typeScriptLibraryGeneratorFn(tree, tsLibraryGeneratorOptions);
142015
- await (0, import_devkit9.formatFiles)(tree);
141212
+ await (0, import_devkit10.formatFiles)(tree);
142016
141213
  return null;
142017
141214
  }
142018
141215
  var generator_default2 = withRunGenerator(
@@ -142022,12 +141219,12 @@ var generator_default2 = withRunGenerator(
142022
141219
 
142023
141220
  // packages/workspace-tools/src/generators/preset/generator.ts
142024
141221
  var path4 = __toESM(require("node:path"));
142025
- var import_devkit10 = __toESM(require_devkit());
141222
+ var import_devkit11 = __toESM(require_devkit());
142026
141223
  async function presetGeneratorFn(tree, options) {
142027
141224
  const projectRoot = ".";
142028
141225
  options.description ??= `\u26A1The ${options.namespace ? options.namespace : options.name} monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.`;
142029
141226
  options.namespace ??= options.organization;
142030
- (0, import_devkit10.addProjectConfiguration)(tree, `@${options.namespace}/${options.name}`, {
141227
+ (0, import_devkit11.addProjectConfiguration)(tree, `@${options.namespace}/${options.name}`, {
142031
141228
  root: projectRoot,
142032
141229
  projectType: "application",
142033
141230
  targets: {
@@ -142041,7 +141238,7 @@ async function presetGeneratorFn(tree, options) {
142041
141238
  }
142042
141239
  }
142043
141240
  });
142044
- (0, import_devkit10.updateJson)(tree, "package.json", (json) => {
141241
+ (0, import_devkit11.updateJson)(tree, "package.json", (json) => {
142045
141242
  json.scripts = json.scripts || {};
142046
141243
  json.version = "0.0.0";
142047
141244
  json.triggerEmptyDevReleaseByIncrementingThisNumber = 0;
@@ -142165,12 +141362,12 @@ async function presetGeneratorFn(tree, options) {
142165
141362
  };
142166
141363
  return json;
142167
141364
  });
142168
- (0, import_devkit10.generateFiles)(tree, path4.join(__dirname, "files"), projectRoot, {
141365
+ (0, import_devkit11.generateFiles)(tree, path4.join(__dirname, "files"), projectRoot, {
142169
141366
  ...options,
142170
141367
  pnpmVersion,
142171
141368
  nodeVersion
142172
141369
  });
142173
- await (0, import_devkit10.formatFiles)(tree);
141370
+ await (0, import_devkit11.formatFiles)(tree);
142174
141371
  let dependencies = {
142175
141372
  "@nx/devkit": "^17.2.8",
142176
141373
  "@nx/jest": "^17.2.8",
@@ -142231,11 +141428,11 @@ async function presetGeneratorFn(tree, options) {
142231
141428
  };
142232
141429
  }
142233
141430
  await Promise.resolve(
142234
- (0, import_devkit10.addDependenciesToPackageJson)(
141431
+ (0, import_devkit11.addDependenciesToPackageJson)(
142235
141432
  tree,
142236
141433
  dependencies,
142237
141434
  {},
142238
- (0, import_devkit10.joinPathFragments)(projectRoot, "package.json")
141435
+ (0, import_devkit11.joinPathFragments)(projectRoot, "package.json")
142239
141436
  )
142240
141437
  );
142241
141438
  return null;
@@ -142246,12 +141443,12 @@ var generator_default3 = withRunGenerator(
142246
141443
  );
142247
141444
 
142248
141445
  // packages/workspace-tools/src/utils/find-cache-dir.ts
142249
- var import_node_fs6 = require("node:fs");
141446
+ var import_node_fs7 = require("node:fs");
142250
141447
  var import_node_path7 = require("node:path");
142251
141448
  var import_node_process5 = require("node:process");
142252
141449
  var isWritable2 = (path5) => {
142253
141450
  try {
142254
- (0, import_node_fs6.accessSync)(path5, import_node_fs6.constants.W_OK);
141451
+ (0, import_node_fs7.accessSync)(path5, import_node_fs7.constants.W_OK);
142255
141452
  return true;
142256
141453
  } catch {
142257
141454
  return false;
@@ -142259,13 +141456,13 @@ var isWritable2 = (path5) => {
142259
141456
  };
142260
141457
  function useDirectory(directory, { create = true }) {
142261
141458
  if (create) {
142262
- (0, import_node_fs6.mkdirSync)(directory, { recursive: true });
141459
+ (0, import_node_fs7.mkdirSync)(directory, { recursive: true });
142263
141460
  }
142264
141461
  return directory;
142265
141462
  }
142266
141463
  function getNodeModuleDirectory(workspaceRoot) {
142267
141464
  const nodeModules = (0, import_node_path7.join)(workspaceRoot, "node_modules");
142268
- if ((0, import_node_fs6.existsSync)(nodeModules) && !isWritable2(nodeModules)) {
141465
+ if ((0, import_node_fs7.existsSync)(nodeModules) && !isWritable2(nodeModules)) {
142269
141466
  throw new Error("Cannot write to node_modules directory");
142270
141467
  }
142271
141468
  return nodeModules;
@@ -142303,7 +141500,7 @@ var import_transform = __toESM(require_transform());
142303
141500
  var getTypiaTransform = (program, diagnostics) => (0, import_transform.default)(program, {}, { addDiagnostic: (input) => diagnostics.push(input) });
142304
141501
 
142305
141502
  // packages/workspace-tools/src/utils/workspace-storage.ts
142306
- var import_node_fs7 = require("node:fs");
141503
+ var import_node_fs8 = require("node:fs");
142307
141504
  var import_node_path8 = require("node:path");
142308
141505
  var WorkspaceStorage = class {
142309
141506
  constructor({
@@ -142325,8 +141522,8 @@ var WorkspaceStorage = class {
142325
141522
  */
142326
141523
  getItem(key) {
142327
141524
  const cacheFile = (0, import_node_path8.join)(this.cacheDir, key);
142328
- if ((0, import_node_fs7.existsSync)(cacheFile)) {
142329
- return (0, import_node_fs7.readFileSync)(cacheFile, "utf-8");
141525
+ if ((0, import_node_fs8.existsSync)(cacheFile)) {
141526
+ return (0, import_node_fs8.readFileSync)(cacheFile, "utf-8");
142330
141527
  }
142331
141528
  return void 0;
142332
141529
  }
@@ -142337,7 +141534,7 @@ var WorkspaceStorage = class {
142337
141534
  * @param value - The value to set
142338
141535
  */
142339
141536
  setItem(key, value) {
142340
- (0, import_node_fs7.writeFileSync)((0, import_node_path8.join)(this.cacheDir, key), value, { encoding: "utf-8" });
141537
+ (0, import_node_fs8.writeFileSync)((0, import_node_path8.join)(this.cacheDir, key), value, { encoding: "utf-8" });
142341
141538
  }
142342
141539
  /**
142343
141540
  * Remove item from cache
@@ -142345,14 +141542,14 @@ var WorkspaceStorage = class {
142345
141542
  * @param key - The key to remove
142346
141543
  */
142347
141544
  removeItem(key) {
142348
- (0, import_node_fs7.rmSync)((0, import_node_path8.join)(this.cacheDir, key), { force: true, recursive: true });
141545
+ (0, import_node_fs8.rmSync)((0, import_node_path8.join)(this.cacheDir, key), { force: true, recursive: true });
142349
141546
  }
142350
141547
  /**
142351
141548
  * Clear the cache
142352
141549
  */
142353
141550
  clear() {
142354
- (0, import_node_fs7.readdirSync)(this.cacheDir).forEach((cacheFile) => {
142355
- (0, import_node_fs7.rmSync)(cacheFile, { force: true, recursive: true });
141551
+ (0, import_node_fs8.readdirSync)(this.cacheDir).forEach((cacheFile) => {
141552
+ (0, import_node_fs8.rmSync)(cacheFile, { force: true, recursive: true });
142356
141553
  });
142357
141554
  }
142358
141555
  /**
@@ -142362,7 +141559,7 @@ var WorkspaceStorage = class {
142362
141559
  * @returns The key at the index
142363
141560
  */
142364
141561
  key(index) {
142365
- const files = (0, import_node_fs7.readdirSync)(this.cacheDir);
141562
+ const files = (0, import_node_fs8.readdirSync)(this.cacheDir);
142366
141563
  if (index < files.length && index >= 0) {
142367
141564
  return files[index];
142368
141565
  }
@@ -142405,6 +141602,7 @@ var WorkspaceStorage = class {
142405
141602
  prettierPrismaVersion,
142406
141603
  prettierVersion,
142407
141604
  removeExtension,
141605
+ runTsupBuild,
142408
141606
  semanticReleaseVersion,
142409
141607
  stormInitGenerator,
142410
141608
  swcCliVersion,