@storm-software/workspace-tools 1.49.9 → 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.
@@ -578,238 +578,6 @@ var init_tslib_es6 = __esm({
578
578
  }
579
579
  });
580
580
 
581
- // node_modules/.pnpm/@anatine+esbuild-decorators@0.2.19_esbuild@0.19.5/node_modules/@anatine/esbuild-decorators/src/lib/strip-it.js
582
- var require_strip_it = __commonJS({
583
- "node_modules/.pnpm/@anatine+esbuild-decorators@0.2.19_esbuild@0.19.5/node_modules/@anatine/esbuild-decorators/src/lib/strip-it.js"(exports) {
584
- "use strict";
585
- Object.defineProperty(exports, "__esModule", { value: true });
586
- exports.strip = void 0;
587
- var TextNode = class {
588
- constructor(node) {
589
- this.type = node.type;
590
- this.value = node.value;
591
- this.match = node.match;
592
- this.newline = node.newline || "";
593
- }
594
- get protected() {
595
- return Boolean(this.match) && this.match[1] === "!";
596
- }
597
- };
598
- var TextBlock = class extends TextNode {
599
- constructor(node) {
600
- super(node);
601
- this.nodes = node.nodes || [];
602
- }
603
- push(node) {
604
- this.nodes.push(node);
605
- }
606
- get protected() {
607
- return this.nodes.length > 0 && this.nodes[0].protected === true;
608
- }
609
- };
610
- var constants3 = {
611
- ESCAPED_CHAR_REGEX: /^\\./,
612
- QUOTED_STRING_REGEX: /^(['"`])((?:\\.|[^\1])+?)(\1)/,
613
- NEWLINE_REGEX: /^\r*\n/,
614
- BLOCK_OPEN_REGEX: /^\/\*\*?(!?)/,
615
- BLOCK_CLOSE_REGEX: /^\*\/(\n?)/,
616
- LINE_REGEX: /^\/\/(!?).*/
617
- };
618
- var parse = (input) => {
619
- const cst = new TextBlock({ type: "root", nodes: [] });
620
- const stack = [cst];
621
- const { ESCAPED_CHAR_REGEX, QUOTED_STRING_REGEX, NEWLINE_REGEX, BLOCK_CLOSE_REGEX, BLOCK_OPEN_REGEX, LINE_REGEX } = constants3;
622
- let block = cst;
623
- let remaining = input;
624
- let token;
625
- let prev;
626
- const consume = (value = remaining[0] || "") => {
627
- remaining = remaining.slice(value.length);
628
- return value;
629
- };
630
- const scan = (regex, type = "text") => {
631
- const match2 = regex.exec(remaining);
632
- if (match2) {
633
- consume(match2[0]);
634
- return { type, value: match2[0], match: match2 };
635
- }
636
- };
637
- const push = (node) => {
638
- if (prev && prev.type === "text" && node.type === "text") {
639
- prev.value += node.value;
640
- return;
641
- }
642
- block.push(node);
643
- if (node.nodes) {
644
- stack.push(node);
645
- block = node;
646
- }
647
- prev = node;
648
- };
649
- const pop = () => {
650
- if (block.type === "root") {
651
- throw new SyntaxError("Unclosed block comment");
652
- }
653
- stack.pop();
654
- block = stack[stack.length - 1];
655
- };
656
- while (remaining !== "") {
657
- if (token = scan(ESCAPED_CHAR_REGEX, "text")) {
658
- push(new TextNode(token));
659
- continue;
660
- }
661
- if (block.type !== "block" && (!prev || !/\w$/.test(prev.value))) {
662
- if (token = scan(QUOTED_STRING_REGEX, "line")) {
663
- push(new TextNode(token));
664
- continue;
665
- }
666
- }
667
- if (token = scan(NEWLINE_REGEX, "newline")) {
668
- push(new TextNode(token));
669
- continue;
670
- }
671
- if (token = scan(BLOCK_OPEN_REGEX, "open")) {
672
- push(new TextBlock({ type: "block" }));
673
- push(new TextNode(token));
674
- continue;
675
- }
676
- if (block.type === "block") {
677
- if (token = scan(BLOCK_CLOSE_REGEX, "close")) {
678
- token.newline = token.match[1] || "";
679
- push(new TextNode(token));
680
- pop();
681
- continue;
682
- }
683
- }
684
- if (block.type !== "block") {
685
- if (token = scan(LINE_REGEX, "line")) {
686
- push(new TextNode(token));
687
- continue;
688
- }
689
- }
690
- push(new TextNode({ type: "text", value: consume(remaining[0]) }));
691
- }
692
- return cst;
693
- };
694
- var compile = (cst) => {
695
- const walk = (node) => {
696
- let output = "";
697
- for (const child of node.nodes) {
698
- switch (child.type) {
699
- case "block":
700
- break;
701
- case "line":
702
- break;
703
- case "open":
704
- case "close":
705
- case "text":
706
- case "newline":
707
- default: {
708
- output += child.value || "";
709
- break;
710
- }
711
- }
712
- }
713
- return output;
714
- };
715
- return walk(cst);
716
- };
717
- var strip = (input) => compile(parse(input));
718
- exports.strip = strip;
719
- }
720
- });
721
-
722
- // node_modules/.pnpm/@anatine+esbuild-decorators@0.2.19_esbuild@0.19.5/node_modules/@anatine/esbuild-decorators/src/lib/esbuild-decorators.js
723
- var require_esbuild_decorators = __commonJS({
724
- "node_modules/.pnpm/@anatine+esbuild-decorators@0.2.19_esbuild@0.19.5/node_modules/@anatine/esbuild-decorators/src/lib/esbuild-decorators.js"(exports) {
725
- "use strict";
726
- Object.defineProperty(exports, "__esModule", { value: true });
727
- exports.esbuildDecorators = void 0;
728
- var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
729
- var fs_1 = require("fs");
730
- var path_1 = require("path");
731
- var typescript_1 = require("typescript");
732
- var util_1 = require("util");
733
- var strip_it_1 = require_strip_it();
734
- var { readFile } = fs_1.promises;
735
- var theFinder = new RegExp(/((?<![(\s]\s*['"])@\w[.[\]\w\d]*\s*(?![;])[((?=\s)])/);
736
- var findDecorators = (fileContent) => theFinder.test((0, strip_it_1.strip)(fileContent));
737
- var esbuildDecorators2 = (options = {}) => ({
738
- name: "tsc",
739
- setup(build2) {
740
- var _a, _b, _c;
741
- const cwd = options.cwd || process.cwd();
742
- const tsconfigPath = options.tsconfig || ((_a = build2.initialOptions) === null || _a === void 0 ? void 0 : _a.tsconfig) || (0, path_1.join)(cwd, "./tsconfig.json");
743
- const forceTsc = (_b = options.force) !== null && _b !== void 0 ? _b : false;
744
- const tsx = (_c = options.tsx) !== null && _c !== void 0 ? _c : true;
745
- let parsedTsConfig = null;
746
- build2.onLoad({ filter: tsx ? /\.tsx?$/ : /\.ts$/ }, (args) => tslib_1.__awaiter(this, void 0, void 0, function* () {
747
- if (!parsedTsConfig) {
748
- parsedTsConfig = parseTsConfig(tsconfigPath, cwd);
749
- if (parsedTsConfig.options.sourcemap) {
750
- parsedTsConfig.options.sourcemap = false;
751
- parsedTsConfig.options.inlineSources = true;
752
- parsedTsConfig.options.inlineSourceMap = true;
753
- }
754
- }
755
- if (!forceTsc && (!parsedTsConfig || !parsedTsConfig.options || !parsedTsConfig.options.emitDecoratorMetadata)) {
756
- return;
757
- }
758
- const ts2 = yield readFile(args.path, "utf8").catch((err) => printDiagnostics({ file: args.path, err }));
759
- const hasDecorator = findDecorators(ts2);
760
- if (!ts2 || !hasDecorator) {
761
- return;
762
- }
763
- const program = (0, typescript_1.transpileModule)(ts2, {
764
- compilerOptions: parsedTsConfig.options
765
- });
766
- return { contents: program.outputText };
767
- }));
768
- }
769
- });
770
- exports.esbuildDecorators = esbuildDecorators2;
771
- function parseTsConfig(tsconfig, cwd = process.cwd()) {
772
- const fileName = (0, typescript_1.findConfigFile)(cwd, typescript_1.sys.fileExists, tsconfig);
773
- if (tsconfig !== void 0 && !fileName)
774
- throw new Error(`failed to open '${fileName}'`);
775
- let loadedConfig = {};
776
- let baseDir = cwd;
777
- if (fileName) {
778
- const text = typescript_1.sys.readFile(fileName);
779
- if (text === void 0)
780
- throw new Error(`failed to read '${fileName}'`);
781
- const result = (0, typescript_1.parseConfigFileTextToJson)(fileName, text);
782
- if (result.error !== void 0) {
783
- printDiagnostics(result.error);
784
- throw new Error(`failed to parse '${fileName}'`);
785
- }
786
- loadedConfig = result.config;
787
- baseDir = (0, path_1.dirname)(fileName);
788
- }
789
- const parsedTsConfig = (0, typescript_1.parseJsonConfigFileContent)(loadedConfig, typescript_1.sys, baseDir);
790
- if (parsedTsConfig.errors[0])
791
- printDiagnostics(parsedTsConfig.errors);
792
- return parsedTsConfig;
793
- }
794
- function printDiagnostics(...args) {
795
- console.log((0, util_1.inspect)(args, false, 10, true));
796
- }
797
- }
798
- });
799
-
800
- // node_modules/.pnpm/@anatine+esbuild-decorators@0.2.19_esbuild@0.19.5/node_modules/@anatine/esbuild-decorators/src/index.js
801
- var require_src = __commonJS({
802
- "node_modules/.pnpm/@anatine+esbuild-decorators@0.2.19_esbuild@0.19.5/node_modules/@anatine/esbuild-decorators/src/index.js"(exports) {
803
- "use strict";
804
- Object.defineProperty(exports, "__esModule", { value: true });
805
- exports.esbuildDecorators = void 0;
806
- var esbuild_decorators_1 = require_esbuild_decorators();
807
- Object.defineProperty(exports, "esbuildDecorators", { enumerable: true, get: function() {
808
- return esbuild_decorators_1.esbuildDecorators;
809
- } });
810
- }
811
- });
812
-
813
581
  // node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/nx.js
814
582
  var require_nx = __commonJS({
815
583
  "node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/nx.js"(exports) {
@@ -4438,12 +4206,12 @@ var require_install_packages_task = __commonJS({
4438
4206
  var child_process_1 = require("child_process");
4439
4207
  var path_1 = require("path");
4440
4208
  var nx_1 = require_nx();
4441
- var { detectPackageManager, getPackageManagerCommand, joinPathFragments: joinPathFragments3 } = (0, nx_1.requireNx)();
4209
+ var { detectPackageManager, getPackageManagerCommand, joinPathFragments: joinPathFragments4 } = (0, nx_1.requireNx)();
4442
4210
  function installPackagesTask(tree, alwaysRun = false, cwd = "", packageManager = detectPackageManager(cwd)) {
4443
- if (!tree.listChanges().find((f) => f.path === joinPathFragments3(cwd, "package.json")) && !alwaysRun) {
4211
+ if (!tree.listChanges().find((f) => f.path === joinPathFragments4(cwd, "package.json")) && !alwaysRun) {
4444
4212
  return;
4445
4213
  }
4446
- const packageJsonValue = tree.read(joinPathFragments3(cwd, "package.json"), "utf-8");
4214
+ const packageJsonValue = tree.read(joinPathFragments4(cwd, "package.json"), "utf-8");
4447
4215
  let storedPackageJsonValue = global["__packageJsonInstallCache__"];
4448
4216
  if (storedPackageJsonValue != packageJsonValue || alwaysRun) {
4449
4217
  global["__packageJsonInstallCache__"] = packageJsonValue;
@@ -25516,7 +25284,7 @@ var require_fill_range = __commonJS({
25516
25284
  let padded = zeros(startString) || zeros(endString) || zeros(stepString);
25517
25285
  let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
25518
25286
  let toNumber = padded === false && stringify(start, end, options) === false;
25519
- let format2 = options.transform || transform(toNumber);
25287
+ let format3 = options.transform || transform(toNumber);
25520
25288
  if (options.toRegex && step === 1) {
25521
25289
  return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
25522
25290
  }
@@ -25528,7 +25296,7 @@ var require_fill_range = __commonJS({
25528
25296
  if (options.toRegex === true && step > 1) {
25529
25297
  push(a);
25530
25298
  } else {
25531
- range.push(pad(format2(a, index), maxLen, toNumber));
25299
+ range.push(pad(format3(a, index), maxLen, toNumber));
25532
25300
  }
25533
25301
  a = descending ? a - step : a + step;
25534
25302
  index++;
@@ -25542,7 +25310,7 @@ var require_fill_range = __commonJS({
25542
25310
  if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
25543
25311
  return invalidRange(start, end, options);
25544
25312
  }
25545
- let format2 = options.transform || ((val) => String.fromCharCode(val));
25313
+ let format3 = options.transform || ((val) => String.fromCharCode(val));
25546
25314
  let a = `${start}`.charCodeAt(0);
25547
25315
  let b = `${end}`.charCodeAt(0);
25548
25316
  let descending = a > b;
@@ -25554,7 +25322,7 @@ var require_fill_range = __commonJS({
25554
25322
  let range = [];
25555
25323
  let index = 0;
25556
25324
  while (descending ? a >= b : a <= b) {
25557
- range.push(format2(a, index));
25325
+ range.push(format3(a, index));
25558
25326
  a = descending ? a - step : a + step;
25559
25327
  index++;
25560
25328
  }
@@ -27596,11 +27364,11 @@ var require_picomatch = __commonJS({
27596
27364
  return { isMatch: false, output: "" };
27597
27365
  }
27598
27366
  const opts = options || {};
27599
- const format2 = opts.format || (posix2 ? utils.toPosixSlashes : null);
27367
+ const format3 = opts.format || (posix2 ? utils.toPosixSlashes : null);
27600
27368
  let match2 = input === glob2;
27601
- let output = match2 && format2 ? format2(input) : input;
27369
+ let output = match2 && format3 ? format3(input) : input;
27602
27370
  if (match2 === false) {
27603
- output = format2 ? format2(input) : input;
27371
+ output = format3 ? format3(input) : input;
27604
27372
  match2 = output === glob2;
27605
27373
  }
27606
27374
  if (match2 === false || opts.capture === true) {
@@ -31679,8 +31447,8 @@ var require_prompt = __commonJS({
31679
31447
  return this.skipped;
31680
31448
  }
31681
31449
  async initialize() {
31682
- let { format: format2, options, result } = this;
31683
- this.format = () => format2.call(this, this.value);
31450
+ let { format: format3, options, result } = this;
31451
+ this.format = () => format3.call(this, this.value);
31684
31452
  this.result = () => result.call(this, this.value);
31685
31453
  if (typeof options.initial === "function") {
31686
31454
  this.initial = await options.initial.call(this, this);
@@ -34068,7 +33836,7 @@ var require_interpolate = __commonJS({
34068
33836
  let defaults2 = { ...options.values, ...options.initial };
34069
33837
  let { tabstops, items, keys } = await tokenize(options, defaults2);
34070
33838
  let result = createFn("result", prompt, options);
34071
- let format2 = createFn("format", prompt, options);
33839
+ let format3 = createFn("format", prompt, options);
34072
33840
  let isValid2 = createFn("validate", prompt, options, true);
34073
33841
  let isVal = prompt.isValue.bind(prompt);
34074
33842
  return async (state = {}, submitted = false) => {
@@ -34113,7 +33881,7 @@ var require_interpolate = __commonJS({
34113
33881
  }
34114
33882
  item.placeholder = false;
34115
33883
  let before = value;
34116
- value = await format2(value, state, item, index);
33884
+ value = await format3(value, state, item, index);
34117
33885
  if (val !== value) {
34118
33886
  state.values[key] = val;
34119
33887
  value = prompt.styles.typing(val);
@@ -34939,20 +34707,20 @@ var require_project_name_and_root_utils = __commonJS({
34939
34707
  var nx_1 = require_nx();
34940
34708
  var get_workspace_layout_1 = require_get_workspace_layout();
34941
34709
  var names_1 = require_names();
34942
- var { joinPathFragments: joinPathFragments3, logger, normalizePath, output, readJson, stripIndents, workspaceRoot } = (0, nx_1.requireNx)();
34710
+ var { joinPathFragments: joinPathFragments4, logger, normalizePath, output, readJson, stripIndents, workspaceRoot } = (0, nx_1.requireNx)();
34943
34711
  async function determineProjectNameAndRootOptions(tree, options) {
34944
34712
  if (!options.projectNameAndRootFormat && (process.env.NX_INTERACTIVE !== "true" || !isTTY())) {
34945
34713
  options.projectNameAndRootFormat = "derived";
34946
34714
  }
34947
34715
  validateName(options.name, options.projectNameAndRootFormat);
34948
34716
  const formats = getProjectNameAndRootFormats(tree, options);
34949
- const format2 = options.projectNameAndRootFormat ?? await determineFormat(formats);
34950
- if (format2 === "derived" && options.callingGenerator) {
34717
+ const format3 = options.projectNameAndRootFormat ?? await determineFormat(formats);
34718
+ if (format3 === "derived" && options.callingGenerator) {
34951
34719
  logDeprecationMessage(options.callingGenerator, formats);
34952
34720
  }
34953
34721
  return {
34954
- ...formats[format2],
34955
- projectNameAndRootFormat: format2
34722
+ ...formats[format3],
34723
+ projectNameAndRootFormat: format3
34956
34724
  };
34957
34725
  }
34958
34726
  exports.determineProjectNameAndRootOptions = determineProjectNameAndRootOptions;
@@ -35003,7 +34771,7 @@ var require_project_name_and_root_utils = __commonJS({
35003
34771
  }
35004
34772
  ],
35005
34773
  initial: "as-provided"
35006
- }).then(({ format: format2 }) => format2 === asProvidedSelectedValue ? "as-provided" : "derived");
34774
+ }).then(({ format: format3 }) => format3 === asProvidedSelectedValue ? "as-provided" : "derived");
35007
34775
  return result;
35008
34776
  }
35009
34777
  function getProjectNameAndRootFormats(tree, options) {
@@ -35066,14 +34834,14 @@ var require_project_name_and_root_utils = __commonJS({
35066
34834
  if (options.directory === relativeCwd || options.directory.startsWith(`${relativeCwd}/`)) {
35067
34835
  projectRoot = options.directory;
35068
34836
  } else {
35069
- projectRoot = joinPathFragments3(relativeCwd, options.directory);
34837
+ projectRoot = joinPathFragments4(relativeCwd, options.directory);
35070
34838
  }
35071
34839
  } else if (options.rootProject) {
35072
34840
  projectRoot = ".";
35073
34841
  } else {
35074
34842
  projectRoot = relativeCwd;
35075
34843
  if (!relativeCwd.endsWith(options.name)) {
35076
- projectRoot = joinPathFragments3(relativeCwd, options.name);
34844
+ projectRoot = joinPathFragments4(relativeCwd, options.name);
35077
34845
  }
35078
34846
  }
35079
34847
  let importPath = void 0;
@@ -35106,7 +34874,7 @@ var require_project_name_and_root_utils = __commonJS({
35106
34874
  const projectSimpleName = name;
35107
34875
  let projectRoot = projectDirectoryWithoutLayout;
35108
34876
  if (projectDirectoryWithoutLayout !== ".") {
35109
- projectRoot = joinPathFragments3(layoutDirectory, projectRoot);
34877
+ projectRoot = joinPathFragments4(layoutDirectory, projectRoot);
35110
34878
  }
35111
34879
  let importPath;
35112
34880
  if (options.projectType === "library") {
@@ -36874,7 +36642,7 @@ var require_library = __commonJS({
36874
36642
  });
36875
36643
 
36876
36644
  // 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/index.js
36877
- var require_src2 = __commonJS({
36645
+ var require_src = __commonJS({
36878
36646
  "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/index.js"(exports) {
36879
36647
  "use strict";
36880
36648
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -36915,979 +36683,6 @@ var require_src2 = __commonJS({
36915
36683
  }
36916
36684
  });
36917
36685
 
36918
- // 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
36919
- var require_assets2 = __commonJS({
36920
- "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) {
36921
- "use strict";
36922
- Object.defineProperty(exports, "__esModule", { value: true });
36923
- exports.assetGlobsToFiles = void 0;
36924
- var fastGlob = require_out4();
36925
- var path_1 = require("path");
36926
- function assetGlobsToFiles(assets, rootDir, outDir) {
36927
- const files = [];
36928
- const globbedFiles = (pattern, input = "", ignore = [], dot = false) => {
36929
- return fastGlob.sync(pattern, {
36930
- cwd: input,
36931
- onlyFiles: true,
36932
- dot,
36933
- ignore
36934
- });
36935
- };
36936
- assets.forEach((asset) => {
36937
- if (typeof asset === "string") {
36938
- globbedFiles(asset, rootDir).forEach((globbedFile) => {
36939
- files.push({
36940
- input: (0, path_1.join)(rootDir, globbedFile),
36941
- output: (0, path_1.join)(outDir, (0, path_1.basename)(globbedFile))
36942
- });
36943
- });
36944
- } else {
36945
- globbedFiles(asset.glob, (0, path_1.join)(rootDir, asset.input), asset.ignore, asset.dot ?? false).forEach((globbedFile) => {
36946
- files.push({
36947
- input: (0, path_1.join)(rootDir, asset.input, globbedFile),
36948
- output: (0, path_1.join)(outDir, asset.output, globbedFile)
36949
- });
36950
- });
36951
- }
36952
- });
36953
- return files;
36954
- }
36955
- exports.assetGlobsToFiles = assetGlobsToFiles;
36956
- }
36957
- });
36958
-
36959
- // 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/normalize-options.js
36960
- var require_normalize_options = __commonJS({
36961
- "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/normalize-options.js"(exports) {
36962
- "use strict";
36963
- Object.defineProperty(exports, "__esModule", { value: true });
36964
- exports.normalizeOptions = void 0;
36965
- var path_1 = require("path");
36966
- var assets_1 = require_assets2();
36967
- function normalizeOptions2(options, contextRoot, sourceRoot, projectRoot) {
36968
- const outputPath = (0, path_1.join)(contextRoot, options.outputPath);
36969
- const rootDir = options.rootDir ? (0, path_1.join)(contextRoot, options.rootDir) : (0, path_1.join)(contextRoot, projectRoot);
36970
- if (options.watch == null) {
36971
- options.watch = false;
36972
- }
36973
- if (Array.isArray(options.external) && options.external.length > 0) {
36974
- const firstItem = options.external[0];
36975
- if (firstItem === "all" || firstItem === "none") {
36976
- options.external = firstItem;
36977
- }
36978
- }
36979
- const files = (0, assets_1.assetGlobsToFiles)(options.assets, contextRoot, outputPath);
36980
- return {
36981
- ...options,
36982
- root: contextRoot,
36983
- sourceRoot,
36984
- projectRoot,
36985
- files,
36986
- outputPath,
36987
- tsConfig: (0, path_1.join)(contextRoot, options.tsConfig),
36988
- rootDir,
36989
- mainOutputPath: (0, path_1.resolve)(outputPath, options.main.replace(`${projectRoot}/`, "").replace(".ts", ".js"))
36990
- };
36991
- }
36992
- exports.normalizeOptions = normalizeOptions2;
36993
- }
36994
- });
36995
-
36996
- // 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
36997
- var require_inline = __commonJS({
36998
- "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) {
36999
- "use strict";
37000
- Object.defineProperty(exports, "__esModule", { value: true });
37001
- exports.getRootTsConfigPath = exports.postProcessInlinedDependencies = exports.handleInliningBuild = exports.isInlineGraphEmpty = void 0;
37002
- var devkit_1 = require_devkit();
37003
- var fs_extra_1 = require_lib();
37004
- var path_1 = require("path");
37005
- var fs_1 = require("fs");
37006
- function isInlineGraphEmpty(inlineGraph) {
37007
- return Object.keys(inlineGraph.nodes).length === 0;
37008
- }
37009
- exports.isInlineGraphEmpty = isInlineGraphEmpty;
37010
- function handleInliningBuild(context, options, tsConfigPath, projectName = context.projectName) {
37011
- const tsConfigJson = (0, devkit_1.readJsonFile)(tsConfigPath);
37012
- const pathAliases = tsConfigJson["compilerOptions"]?.["paths"] || readBasePathAliases(context);
37013
- const inlineGraph = createInlineGraph(context, options, pathAliases, projectName);
37014
- if (isInlineGraphEmpty(inlineGraph)) {
37015
- return inlineGraph;
37016
- }
37017
- buildInlineGraphExternals(context, inlineGraph, pathAliases);
37018
- return inlineGraph;
37019
- }
37020
- exports.handleInliningBuild = handleInliningBuild;
37021
- function postProcessInlinedDependencies(outputPath, parentOutputPath, inlineGraph) {
37022
- if (isInlineGraphEmpty(inlineGraph)) {
37023
- return;
37024
- }
37025
- const parentDistPath = (0, path_1.join)(outputPath, parentOutputPath);
37026
- const markedForDeletion = /* @__PURE__ */ new Set();
37027
- movePackage(parentDistPath, outputPath);
37028
- markedForDeletion.add(parentDistPath);
37029
- const inlinedDepsDestOutputRecord = {};
37030
- for (const inlineDependenciesNames of Object.values(inlineGraph.dependencies)) {
37031
- for (const inlineDependenciesName of inlineDependenciesNames) {
37032
- const inlineDependency = inlineGraph.nodes[inlineDependenciesName];
37033
- const depOutputPath = inlineDependency.buildOutputPath || (0, path_1.join)(outputPath, inlineDependency.root);
37034
- const destDepOutputPath = (0, path_1.join)(outputPath, inlineDependency.name);
37035
- const isBuildable = !!inlineDependency.buildOutputPath;
37036
- if (isBuildable) {
37037
- (0, fs_extra_1.copySync)(depOutputPath, destDepOutputPath, { overwrite: true });
37038
- } else {
37039
- movePackage(depOutputPath, destDepOutputPath);
37040
- markedForDeletion.add(depOutputPath);
37041
- }
37042
- inlinedDepsDestOutputRecord[inlineDependency.pathAlias] = destDepOutputPath + "/src";
37043
- }
37044
- }
37045
- markedForDeletion.forEach((path4) => (0, fs_extra_1.removeSync)(path4));
37046
- updateImports(outputPath, inlinedDepsDestOutputRecord);
37047
- }
37048
- exports.postProcessInlinedDependencies = postProcessInlinedDependencies;
37049
- function readBasePathAliases(context) {
37050
- return (0, devkit_1.readJsonFile)(getRootTsConfigPath(context))?.["compilerOptions"]["paths"];
37051
- }
37052
- function getRootTsConfigPath(context) {
37053
- for (const tsConfigName of ["tsconfig.base.json", "tsconfig.json"]) {
37054
- const tsConfigPath = (0, path_1.join)(context.root, tsConfigName);
37055
- if ((0, fs_1.existsSync)(tsConfigPath)) {
37056
- return tsConfigPath;
37057
- }
37058
- }
37059
- throw new Error("Could not find a root tsconfig.json or tsconfig.base.json file.");
37060
- }
37061
- exports.getRootTsConfigPath = getRootTsConfigPath;
37062
- function emptyInlineGraph() {
37063
- return { nodes: {}, externals: {}, dependencies: {} };
37064
- }
37065
- function projectNodeToInlineProjectNode(projectNode, pathAlias = "", buildOutputPath = "") {
37066
- return {
37067
- name: projectNode.name,
37068
- root: projectNode.data.root,
37069
- sourceRoot: projectNode.data.sourceRoot,
37070
- pathAlias,
37071
- buildOutputPath
37072
- };
37073
- }
37074
- function createInlineGraph(context, options, pathAliases, projectName, inlineGraph = emptyInlineGraph()) {
37075
- if (options.external == null)
37076
- return inlineGraph;
37077
- const projectDependencies = context.projectGraph.dependencies[projectName] || [];
37078
- if (projectDependencies.length === 0)
37079
- return inlineGraph;
37080
- if (!inlineGraph.nodes[projectName]) {
37081
- inlineGraph.nodes[projectName] = projectNodeToInlineProjectNode(context.projectGraph.nodes[projectName]);
37082
- }
37083
- const implicitDependencies = context.projectGraph.nodes[projectName].data.implicitDependencies || [];
37084
- for (const projectDependency of projectDependencies) {
37085
- if (projectDependency.target.startsWith("npm")) {
37086
- continue;
37087
- }
37088
- if (implicitDependencies.includes(projectDependency.target)) {
37089
- continue;
37090
- }
37091
- const pathAlias = getPathAliasForPackage(context.projectGraph.nodes[projectDependency.target], pathAliases);
37092
- const buildOutputPath = getBuildOutputPath(projectDependency.target, context, options);
37093
- const shouldInline = (
37094
- /**
37095
- * if all buildable libraries are marked as external,
37096
- * then push the project dependency that doesn't have a build target
37097
- */
37098
- options.external === "all" && !buildOutputPath || /**
37099
- * if all buildable libraries are marked as internal,
37100
- * then push every project dependency to be inlined
37101
- */
37102
- options.external === "none" || /**
37103
- * if some buildable libraries are marked as external,
37104
- * then push the project dependency that IS NOT marked as external OR doesn't have a build target
37105
- */
37106
- Array.isArray(options.external) && options.external.length > 0 && !options.external.includes(projectDependency.target) || !buildOutputPath
37107
- );
37108
- if (shouldInline) {
37109
- inlineGraph.dependencies[projectName] ??= [];
37110
- inlineGraph.dependencies[projectName].push(projectDependency.target);
37111
- }
37112
- inlineGraph.nodes[projectDependency.target] = projectNodeToInlineProjectNode(context.projectGraph.nodes[projectDependency.target], pathAlias, buildOutputPath);
37113
- if (context.projectGraph.dependencies[projectDependency.target].length > 0) {
37114
- inlineGraph = createInlineGraph(context, options, pathAliases, projectDependency.target, inlineGraph);
37115
- }
37116
- }
37117
- return inlineGraph;
37118
- }
37119
- function buildInlineGraphExternals(context, inlineProjectGraph, pathAliases) {
37120
- const allNodes = { ...context.projectGraph.nodes };
37121
- for (const [parent, dependencies] of Object.entries(inlineProjectGraph.dependencies)) {
37122
- if (allNodes[parent]) {
37123
- delete allNodes[parent];
37124
- }
37125
- for (const dependencyName of dependencies) {
37126
- const dependencyNode = inlineProjectGraph.nodes[dependencyName];
37127
- if (dependencyNode.buildOutputPath) {
37128
- continue;
37129
- }
37130
- if (allNodes[dependencyName]) {
37131
- delete allNodes[dependencyName];
37132
- }
37133
- }
37134
- }
37135
- for (const [projectName, projectNode] of Object.entries(allNodes)) {
37136
- if (!inlineProjectGraph.externals[projectName]) {
37137
- inlineProjectGraph.externals[projectName] = projectNodeToInlineProjectNode(projectNode, getPathAliasForPackage(projectNode, pathAliases));
37138
- }
37139
- }
37140
- }
37141
- function movePackage(from, to) {
37142
- if (from === to)
37143
- return;
37144
- (0, fs_extra_1.copySync)(from, to, { overwrite: true });
37145
- }
37146
- function updateImports(destOutputPath, inlinedDepsDestOutputRecord) {
37147
- const importRegex = new RegExp(Object.keys(inlinedDepsDestOutputRecord).map((pathAlias) => `["'](${pathAlias})["']`).join("|"), "g");
37148
- recursiveUpdateImport(destOutputPath, importRegex, inlinedDepsDestOutputRecord);
37149
- }
37150
- function recursiveUpdateImport(dirPath, importRegex, inlinedDepsDestOutputRecord, rootParentDir) {
37151
- const files = (0, fs_extra_1.readdirSync)(dirPath, { withFileTypes: true });
37152
- for (const file of files) {
37153
- if (file.isFile() && (file.name.endsWith(".js") || file.name.endsWith(".d.ts"))) {
37154
- const filePath = (0, path_1.join)(dirPath, file.name);
37155
- const fileContent = (0, fs_extra_1.readFileSync)(filePath, "utf-8");
37156
- const updatedContent = fileContent.replace(importRegex, (matched) => {
37157
- const result = matched.replace(/['"]/g, "");
37158
- if (result === rootParentDir)
37159
- return matched;
37160
- const importPath = `"${(0, path_1.relative)(dirPath, inlinedDepsDestOutputRecord[result])}"`;
37161
- return (0, devkit_1.normalizePath)(importPath);
37162
- });
37163
- (0, fs_extra_1.writeFileSync)(filePath, updatedContent);
37164
- } else if (file.isDirectory()) {
37165
- recursiveUpdateImport((0, path_1.join)(dirPath, file.name), importRegex, inlinedDepsDestOutputRecord, rootParentDir || file.name);
37166
- }
37167
- }
37168
- }
37169
- function getPathAliasForPackage(packageNode, pathAliases) {
37170
- if (!packageNode)
37171
- return "";
37172
- for (const [alias, paths] of Object.entries(pathAliases)) {
37173
- if (paths.some((path4) => path4.includes(packageNode.data.root))) {
37174
- return alias;
37175
- }
37176
- }
37177
- return "";
37178
- }
37179
- function getBuildOutputPath(projectName, context, options) {
37180
- const projectTargets = context.projectGraph.nodes[projectName]?.data?.targets;
37181
- if (!projectTargets)
37182
- return "";
37183
- const buildTarget = options.externalBuildTargets.find((buildTarget2) => projectTargets[buildTarget2]);
37184
- return buildTarget ? projectTargets[buildTarget].options["outputPath"] : "";
37185
- }
37186
- }
37187
- });
37188
-
37189
- // node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/create-async-iterable.js
37190
- var require_create_async_iterable = __commonJS({
37191
- "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) {
37192
- "use strict";
37193
- Object.defineProperty(exports, "__esModule", { value: true });
37194
- exports.createAsyncIterable = void 0;
37195
- function createAsyncIterable(listener) {
37196
- let done = false;
37197
- let error = null;
37198
- const pushQueue = [];
37199
- const pullQueue = [];
37200
- return {
37201
- [Symbol.asyncIterator]() {
37202
- listener({
37203
- next: (value) => {
37204
- if (done || error)
37205
- return;
37206
- if (pullQueue.length > 0) {
37207
- pullQueue.shift()?.[0]({ value, done: false });
37208
- } else {
37209
- pushQueue.push(value);
37210
- }
37211
- },
37212
- error: (err) => {
37213
- if (done || error)
37214
- return;
37215
- if (pullQueue.length > 0) {
37216
- pullQueue.shift()?.[1](err);
37217
- }
37218
- error = err;
37219
- },
37220
- done: () => {
37221
- if (pullQueue.length > 0) {
37222
- pullQueue.shift()?.[0]({ value: void 0, done: true });
37223
- }
37224
- done = true;
37225
- }
37226
- });
37227
- return {
37228
- next() {
37229
- return new Promise((resolve, reject) => {
37230
- if (pushQueue.length > 0) {
37231
- resolve({ value: pushQueue.shift(), done: false });
37232
- } else if (done) {
37233
- resolve({ value: void 0, done: true });
37234
- } else if (error) {
37235
- reject(error);
37236
- } else {
37237
- pullQueue.push([resolve, reject]);
37238
- }
37239
- });
37240
- }
37241
- };
37242
- }
37243
- };
37244
- }
37245
- exports.createAsyncIterable = createAsyncIterable;
37246
- }
37247
- });
37248
-
37249
- // node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/combine-async-iterables.js
37250
- var require_combine_async_iterables = __commonJS({
37251
- "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) {
37252
- "use strict";
37253
- Object.defineProperty(exports, "__esModule", { value: true });
37254
- exports.combineAsyncIterables = void 0;
37255
- async function* combineAsyncIterables(..._iterators) {
37256
- const iterators = _iterators.map((it) => {
37257
- if (typeof it["next"] === "function") {
37258
- return it;
37259
- } else {
37260
- return async function* wrapped() {
37261
- for await (const val of it) {
37262
- yield val;
37263
- }
37264
- }();
37265
- }
37266
- });
37267
- let [options] = iterators;
37268
- if (typeof options.next === "function") {
37269
- options = /* @__PURE__ */ Object.create(null);
37270
- } else {
37271
- iterators.shift();
37272
- }
37273
- const getNextAsyncIteratorValue = getNextAsyncIteratorFactory(options);
37274
- try {
37275
- const asyncIteratorsValues = new Map(iterators.map((it, idx) => [idx, getNextAsyncIteratorValue(it, idx)]));
37276
- do {
37277
- const { iterator, index } = await Promise.race(asyncIteratorsValues.values());
37278
- if (iterator.done) {
37279
- asyncIteratorsValues.delete(index);
37280
- } else {
37281
- yield iterator.value;
37282
- asyncIteratorsValues.set(index, getNextAsyncIteratorValue(iterators[index], index));
37283
- }
37284
- } while (asyncIteratorsValues.size > 0);
37285
- } finally {
37286
- await Promise.allSettled(iterators.map((it) => it["return"]?.()));
37287
- }
37288
- }
37289
- exports.combineAsyncIterables = combineAsyncIterables;
37290
- function getNextAsyncIteratorFactory(options) {
37291
- return async (asyncIterator, index) => {
37292
- try {
37293
- const iterator = await asyncIterator.next();
37294
- return { index, iterator };
37295
- } catch (err) {
37296
- if (options.errorCallback) {
37297
- options.errorCallback(err, index);
37298
- }
37299
- return Promise.reject(err);
37300
- }
37301
- };
37302
- }
37303
- }
37304
- });
37305
-
37306
- // node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/map-async-iteratable.js
37307
- var require_map_async_iteratable = __commonJS({
37308
- "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) {
37309
- "use strict";
37310
- Object.defineProperty(exports, "__esModule", { value: true });
37311
- exports.mapAsyncIterable = void 0;
37312
- async function* mapAsyncIterable(data, transform) {
37313
- async function* f() {
37314
- const generator = data[Symbol.asyncIterator] || data[Symbol.iterator];
37315
- const iterator = generator.call(data);
37316
- let index = 0;
37317
- let item = await iterator.next();
37318
- while (!item.done) {
37319
- yield await transform(await item.value, index, data);
37320
- index++;
37321
- item = await iterator.next();
37322
- }
37323
- }
37324
- return yield* f();
37325
- }
37326
- exports.mapAsyncIterable = mapAsyncIterable;
37327
- }
37328
- });
37329
-
37330
- // node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/tap-async-iteratable.js
37331
- var require_tap_async_iteratable = __commonJS({
37332
- "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) {
37333
- "use strict";
37334
- Object.defineProperty(exports, "__esModule", { value: true });
37335
- exports.tapAsyncIterable = void 0;
37336
- var map_async_iteratable_1 = require_map_async_iteratable();
37337
- async function* tapAsyncIterable(data, fn) {
37338
- return yield* (0, map_async_iteratable_1.mapAsyncIterable)(data, (x) => {
37339
- fn(x);
37340
- return x;
37341
- });
37342
- }
37343
- exports.tapAsyncIterable = tapAsyncIterable;
37344
- }
37345
- });
37346
-
37347
- // node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/index.js
37348
- var require_async_iterable = __commonJS({
37349
- "node_modules/.pnpm/@nx+devkit@17.2.8_nx@17.2.8/node_modules/@nx/devkit/src/utils/async-iterable/index.js"(exports) {
37350
- "use strict";
37351
- Object.defineProperty(exports, "__esModule", { value: true });
37352
- var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
37353
- tslib_1.__exportStar(require_create_async_iterable(), exports);
37354
- tslib_1.__exportStar(require_combine_async_iterables(), exports);
37355
- tslib_1.__exportStar(require_map_async_iteratable(), exports);
37356
- tslib_1.__exportStar(require_tap_async_iteratable(), exports);
37357
- }
37358
- });
37359
-
37360
- // 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
37361
- var require_compile_typescript_files = __commonJS({
37362
- "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) {
37363
- "use strict";
37364
- Object.defineProperty(exports, "__esModule", { value: true });
37365
- exports.compileTypeScriptFiles = void 0;
37366
- var compilation_1 = require_compilation();
37367
- var async_iterable_1 = require_async_iterable();
37368
- var TYPESCRIPT_FOUND_N_ERRORS_WATCHING_FOR_FILE_CHANGES = 6194;
37369
- var ERROR_COUNT_REGEX = /Found (\d+) errors/;
37370
- function getErrorCountFromMessage(messageText) {
37371
- return Number.parseInt(ERROR_COUNT_REGEX.exec(messageText)[1]);
37372
- }
37373
- function compileTypeScriptFiles(normalizedOptions, tscOptions, postCompilationCallback) {
37374
- const getResult = (success) => ({
37375
- success,
37376
- outfile: normalizedOptions.mainOutputPath
37377
- });
37378
- let tearDown;
37379
- return {
37380
- iterator: (0, async_iterable_1.createAsyncIterable)(async ({ next, done }) => {
37381
- if (normalizedOptions.watch) {
37382
- const host = (0, compilation_1.compileTypeScriptWatcher)(tscOptions, async (d) => {
37383
- if (d.code === TYPESCRIPT_FOUND_N_ERRORS_WATCHING_FOR_FILE_CHANGES) {
37384
- await postCompilationCallback();
37385
- next(getResult(getErrorCountFromMessage(d.messageText) === 0));
37386
- }
37387
- });
37388
- tearDown = () => {
37389
- host.close();
37390
- done();
37391
- };
37392
- } else {
37393
- const { success } = (0, compilation_1.compileTypeScript)(tscOptions);
37394
- await postCompilationCallback();
37395
- next(getResult(success));
37396
- done();
37397
- }
37398
- }),
37399
- close: () => tearDown?.()
37400
- };
37401
- }
37402
- exports.compileTypeScriptFiles = compileTypeScriptFiles;
37403
- }
37404
- });
37405
-
37406
- // 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
37407
- var require_get_custom_transformers_factory = __commonJS({
37408
- "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) {
37409
- "use strict";
37410
- Object.defineProperty(exports, "__esModule", { value: true });
37411
- exports.getCustomTrasformersFactory = void 0;
37412
- var load_ts_transformers_1 = require_load_ts_transformers();
37413
- function getCustomTrasformersFactory(transformers) {
37414
- const { compilerPluginHooks } = (0, load_ts_transformers_1.loadTsTransformers)(transformers);
37415
- return (program) => ({
37416
- before: compilerPluginHooks.beforeHooks.map((hook) => hook(program)),
37417
- after: compilerPluginHooks.afterHooks.map((hook) => hook(program)),
37418
- afterDeclarations: compilerPluginHooks.afterDeclarationsHooks.map((hook) => hook(program))
37419
- });
37420
- }
37421
- exports.getCustomTrasformersFactory = getCustomTrasformersFactory;
37422
- }
37423
- });
37424
-
37425
- // 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
37426
- var require_get_task_options = __commonJS({
37427
- "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) {
37428
- "use strict";
37429
- Object.defineProperty(exports, "__esModule", { value: true });
37430
- exports.getTaskOptions = void 0;
37431
- var normalize_options_1 = require_normalize_options();
37432
- var tasksOptionsCache = /* @__PURE__ */ new Map();
37433
- function getTaskOptions(taskName, context) {
37434
- if (tasksOptionsCache.has(taskName)) {
37435
- return tasksOptionsCache.get(taskName);
37436
- }
37437
- try {
37438
- const { taskOptions, sourceRoot, root } = parseTaskInfo(taskName, context);
37439
- const normalizedTaskOptions = (0, normalize_options_1.normalizeOptions)(taskOptions, context.root, sourceRoot, root);
37440
- tasksOptionsCache.set(taskName, normalizedTaskOptions);
37441
- return normalizedTaskOptions;
37442
- } catch {
37443
- tasksOptionsCache.set(taskName, null);
37444
- return null;
37445
- }
37446
- }
37447
- exports.getTaskOptions = getTaskOptions;
37448
- function parseTaskInfo(taskName, context) {
37449
- const target = context.taskGraph.tasks[taskName].target;
37450
- const projectNode = context.projectGraph.nodes[target.project];
37451
- const targetConfig = projectNode.data.targets?.[target.target];
37452
- const { sourceRoot, root } = projectNode.data;
37453
- const taskOptions = {
37454
- ...targetConfig.options,
37455
- ...target.configuration ? targetConfig.configurations?.[target.configuration] : {}
37456
- };
37457
- return { taskOptions, root, sourceRoot, projectNode, target };
37458
- }
37459
- }
37460
- });
37461
-
37462
- // 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
37463
- var require_get_tsconfig = __commonJS({
37464
- "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) {
37465
- "use strict";
37466
- Object.defineProperty(exports, "__esModule", { value: true });
37467
- exports.getProcessedTaskTsConfigs = void 0;
37468
- var devkit_1 = require_devkit();
37469
- var path_1 = require("path");
37470
- var get_task_options_1 = require_get_task_options();
37471
- function getProcessedTaskTsConfigs(tasks, tasksOptions, context) {
37472
- const taskInMemoryTsConfigMap = {};
37473
- for (const task of tasks) {
37474
- generateTaskProjectTsConfig(task, tasksOptions, context, taskInMemoryTsConfigMap);
37475
- }
37476
- return taskInMemoryTsConfigMap;
37477
- }
37478
- exports.getProcessedTaskTsConfigs = getProcessedTaskTsConfigs;
37479
- var projectTsConfigCache = /* @__PURE__ */ new Map();
37480
- function generateTaskProjectTsConfig(task, tasksOptions, context, taskInMemoryTsConfigMap) {
37481
- const { project } = (0, devkit_1.parseTargetString)(task, context);
37482
- if (projectTsConfigCache.has(project)) {
37483
- const { tsConfig, tsConfigPath: tsConfigPath2 } = projectTsConfigCache.get(project);
37484
- taskInMemoryTsConfigMap[task] = tsConfig;
37485
- return tsConfigPath2;
37486
- }
37487
- const tasksInProject = [
37488
- task,
37489
- ...getDependencyTasksInSameProject(task, context)
37490
- ];
37491
- const taskWithTscExecutor = tasksInProject.find((t) => hasTscExecutor(t, context));
37492
- if (!taskWithTscExecutor) {
37493
- throw new Error((0, devkit_1.stripIndents)`The "@nx/js:tsc" batch executor requires all dependencies to use the "@nx/js:tsc" executor.
37494
- None of the following tasks in the "${project}" project use the "@nx/js:tsc" executor:
37495
- ${tasksInProject.map((t) => `- ${t}`).join("\n")}`);
37496
- }
37497
- const projectReferences = [];
37498
- for (const task2 of tasksInProject) {
37499
- for (const depTask of getDependencyTasksInOtherProjects(task2, project, context)) {
37500
- const tsConfigPath2 = generateTaskProjectTsConfig(depTask, tasksOptions, context, taskInMemoryTsConfigMap);
37501
- projectReferences.push(tsConfigPath2);
37502
- }
37503
- }
37504
- const taskOptions = tasksOptions[taskWithTscExecutor] ?? (0, get_task_options_1.getTaskOptions)(taskWithTscExecutor, context);
37505
- const tsConfigPath = taskOptions.tsConfig;
37506
- taskInMemoryTsConfigMap[taskWithTscExecutor] = getInMemoryTsConfig(tsConfigPath, taskOptions, projectReferences);
37507
- projectTsConfigCache.set(project, {
37508
- tsConfigPath,
37509
- tsConfig: taskInMemoryTsConfigMap[taskWithTscExecutor]
37510
- });
37511
- return tsConfigPath;
37512
- }
37513
- function getDependencyTasksInOtherProjects(task, project, context) {
37514
- return context.taskGraph.dependencies[task].filter((t) => t !== task && (0, devkit_1.parseTargetString)(t, context).project !== project);
37515
- }
37516
- function getDependencyTasksInSameProject(task, context) {
37517
- const { project: taskProject } = (0, devkit_1.parseTargetString)(task, context);
37518
- return Object.keys(context.taskGraph.tasks).filter((t) => t !== task && (0, devkit_1.parseTargetString)(t, context).project === taskProject);
37519
- }
37520
- function getInMemoryTsConfig(tsConfig, taskOptions, projectReferences) {
37521
- const originalTsConfig = (0, devkit_1.readJsonFile)(tsConfig, {
37522
- allowTrailingComma: true,
37523
- disallowComments: false
37524
- });
37525
- const allProjectReferences = Array.from(new Set((originalTsConfig.references ?? []).map((r) => r.path).concat(projectReferences)));
37526
- return {
37527
- content: JSON.stringify({
37528
- ...originalTsConfig,
37529
- compilerOptions: {
37530
- ...originalTsConfig.compilerOptions,
37531
- rootDir: taskOptions.rootDir,
37532
- outDir: taskOptions.outputPath,
37533
- composite: true,
37534
- declaration: true,
37535
- declarationMap: true,
37536
- tsBuildInfoFile: (0, path_1.join)(taskOptions.outputPath, "tsconfig.tsbuildinfo")
37537
- },
37538
- references: allProjectReferences.map((pr) => ({ path: pr }))
37539
- }),
37540
- path: tsConfig.replace(/\\/g, "/")
37541
- };
37542
- }
37543
- function hasTscExecutor(task, context) {
37544
- const { project, target } = (0, devkit_1.parseTargetString)(task, context);
37545
- return context.projectGraph.nodes[project].data.targets[target].executor === "@nx/js:tsc";
37546
- }
37547
- }
37548
- });
37549
-
37550
- // 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
37551
- var require_typescript_diagnostic_reporters = __commonJS({
37552
- "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) {
37553
- "use strict";
37554
- Object.defineProperty(exports, "__esModule", { value: true });
37555
- exports.formatSolutionBuilderStatusReport = exports.formatDiagnosticReport = void 0;
37556
- var ts2 = require("typescript");
37557
- function formatDiagnosticReport(diagnostic, host) {
37558
- const diagnostics = new Array(1);
37559
- diagnostics[0] = diagnostic;
37560
- const formattedDiagnostic = "\n" + ts2.formatDiagnosticsWithColorAndContext(diagnostics, host) + host.getNewLine();
37561
- diagnostics[0] = void 0;
37562
- return formattedDiagnostic;
37563
- }
37564
- exports.formatDiagnosticReport = formatDiagnosticReport;
37565
- function formatSolutionBuilderStatusReport(diagnostic) {
37566
- let formattedDiagnostic = `[${formatColorAndReset(getLocaleTimeString(), ForegroundColorEscapeSequences.Grey)}] `;
37567
- formattedDiagnostic += `${ts2.flattenDiagnosticMessageText(diagnostic.messageText, ts2.sys.newLine)}${ts2.sys.newLine + ts2.sys.newLine}`;
37568
- return formattedDiagnostic;
37569
- }
37570
- exports.formatSolutionBuilderStatusReport = formatSolutionBuilderStatusReport;
37571
- function formatColorAndReset(text, formatStyle) {
37572
- const resetEscapeSequence = "\x1B[0m";
37573
- return formatStyle + text + resetEscapeSequence;
37574
- }
37575
- function getLocaleTimeString() {
37576
- return (/* @__PURE__ */ new Date()).toLocaleTimeString();
37577
- }
37578
- var ForegroundColorEscapeSequences;
37579
- (function(ForegroundColorEscapeSequences2) {
37580
- ForegroundColorEscapeSequences2["Grey"] = "\x1B[90m";
37581
- ForegroundColorEscapeSequences2["Red"] = "\x1B[91m";
37582
- ForegroundColorEscapeSequences2["Yellow"] = "\x1B[93m";
37583
- ForegroundColorEscapeSequences2["Blue"] = "\x1B[94m";
37584
- ForegroundColorEscapeSequences2["Cyan"] = "\x1B[96m";
37585
- })(ForegroundColorEscapeSequences || (ForegroundColorEscapeSequences = {}));
37586
- }
37587
- });
37588
-
37589
- // 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
37590
- var require_typescript_compilation = __commonJS({
37591
- "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) {
37592
- "use strict";
37593
- Object.defineProperty(exports, "__esModule", { value: true });
37594
- exports.compileTypescriptSolution = void 0;
37595
- var async_iterable_1 = require_async_iterable();
37596
- var ts2 = require("typescript");
37597
- var get_custom_transformers_factory_1 = require_get_custom_transformers_factory();
37598
- var typescript_diagnostic_reporters_1 = require_typescript_diagnostic_reporters();
37599
- var TYPESCRIPT_CANNOT_READ_FILE = 5083;
37600
- var TYPESCRIPT_FILE_CHANGE_DETECTED_STARTING_INCREMENTAL_COMPILATION = 6032;
37601
- function compileTypescriptSolution(context, watch, logger, hooks, reporters) {
37602
- if (watch) {
37603
- return (0, async_iterable_1.createAsyncIterable)(async ({ next }) => {
37604
- hooks ??= {};
37605
- const callerAfterProjectCompilationCallback = hooks.afterProjectCompilationCallback;
37606
- hooks.afterProjectCompilationCallback = (tsConfig, success) => {
37607
- callerAfterProjectCompilationCallback?.(tsConfig, success);
37608
- next({ tsConfig, success });
37609
- };
37610
- compileTSWithWatch(context, logger, hooks, reporters);
37611
- });
37612
- }
37613
- const compilationGenerator = compileTS(context, logger, hooks, reporters);
37614
- return {
37615
- [Symbol.asyncIterator]() {
37616
- return {
37617
- next() {
37618
- return Promise.resolve(compilationGenerator.next());
37619
- }
37620
- };
37621
- }
37622
- };
37623
- }
37624
- exports.compileTypescriptSolution = compileTypescriptSolution;
37625
- function* compileTS(context, logger, hooks, reporters) {
37626
- let project;
37627
- const formatDiagnosticsHost = {
37628
- getCurrentDirectory: () => ts2.sys.getCurrentDirectory(),
37629
- getNewLine: () => ts2.sys.newLine,
37630
- getCanonicalFileName: (filename) => ts2.sys.useCaseSensitiveFileNames ? filename : filename.toLowerCase()
37631
- };
37632
- const solutionBuilderHost = ts2.createSolutionBuilderHost(
37633
- getSystem(context),
37634
- /*createProgram*/
37635
- void 0,
37636
- (diagnostic) => {
37637
- const formattedDiagnostic = (0, typescript_diagnostic_reporters_1.formatDiagnosticReport)(diagnostic, formatDiagnosticsHost);
37638
- if (diagnostic.code === TYPESCRIPT_CANNOT_READ_FILE) {
37639
- throw new Error(formattedDiagnostic);
37640
- }
37641
- logger.info(formattedDiagnostic, project.project);
37642
- reporters?.diagnosticReporter?.(project.project, diagnostic);
37643
- },
37644
- (diagnostic) => {
37645
- const formattedDiagnostic = (0, typescript_diagnostic_reporters_1.formatSolutionBuilderStatusReport)(diagnostic);
37646
- logger.info(formattedDiagnostic, project.project);
37647
- reporters?.solutionBuilderStatusReporter?.(project.project, diagnostic);
37648
- }
37649
- );
37650
- const rootNames = Object.keys(context);
37651
- const solutionBuilder = ts2.createSolutionBuilder(solutionBuilderHost, rootNames, {});
37652
- while (true) {
37653
- project = solutionBuilder.getNextInvalidatedProject();
37654
- if (!project) {
37655
- break;
37656
- }
37657
- const projectContext = context[project.project];
37658
- const projectName = projectContext?.project;
37659
- if (project.kind === ts2.InvalidatedProjectKind.UpdateBundle) {
37660
- 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.
37661
- `, project.project);
37662
- continue;
37663
- }
37664
- hooks?.beforeProjectCompilationCallback?.(project.project);
37665
- if (project.kind === ts2.InvalidatedProjectKind.UpdateOutputFileStamps) {
37666
- logger.info(`Updating output timestamps of project "${projectName}"...
37667
- `, project.project);
37668
- const status2 = project.done();
37669
- const success2 = status2 === ts2.ExitStatus.Success;
37670
- if (success2) {
37671
- logger.info(`Done updating output timestamps of project "${projectName}"...
37672
- `, project.project);
37673
- }
37674
- hooks?.afterProjectCompilationCallback?.(project.project, success2);
37675
- yield { success: success2, tsConfig: project.project };
37676
- continue;
37677
- }
37678
- logger.info(`Compiling TypeScript files for project "${projectName}"...
37679
- `, project.project);
37680
- const status = project.done(void 0, void 0, (0, get_custom_transformers_factory_1.getCustomTrasformersFactory)(projectContext.transformers)(project.getProgram()));
37681
- const success = status === ts2.ExitStatus.Success;
37682
- if (success) {
37683
- logger.info(`Done compiling TypeScript files for project "${projectName}".
37684
- `, project.project);
37685
- }
37686
- hooks?.afterProjectCompilationCallback?.(project.project, success);
37687
- yield {
37688
- success: status === ts2.ExitStatus.Success,
37689
- tsConfig: project.project
37690
- };
37691
- }
37692
- }
37693
- function compileTSWithWatch(context, logger, hooks, reporters) {
37694
- let project;
37695
- const solutionHost = ts2.createSolutionBuilderWithWatchHost(
37696
- getSystem(context),
37697
- /*createProgram*/
37698
- void 0
37699
- );
37700
- if (reporters?.diagnosticReporter) {
37701
- const originalDiagnosticReporter = solutionHost.reportDiagnostic;
37702
- solutionHost.reportDiagnostic = (diagnostic) => {
37703
- originalDiagnosticReporter(diagnostic);
37704
- reporters.diagnosticReporter(project.project, diagnostic);
37705
- };
37706
- }
37707
- if (reporters?.solutionBuilderStatusReporter) {
37708
- const originalSolutionBuilderStatusReporter = solutionHost.reportSolutionBuilderStatus;
37709
- solutionHost.reportDiagnostic = (diagnostic) => {
37710
- originalSolutionBuilderStatusReporter(diagnostic);
37711
- reporters.solutionBuilderStatusReporter(project.project, diagnostic);
37712
- };
37713
- }
37714
- const originalWatchStatusReporter = solutionHost.onWatchStatusChange;
37715
- solutionHost.onWatchStatusChange = (diagnostic, newLine, options, errorCount) => {
37716
- originalWatchStatusReporter(diagnostic, newLine, options, errorCount);
37717
- if (diagnostic.code === TYPESCRIPT_FILE_CHANGE_DETECTED_STARTING_INCREMENTAL_COMPILATION) {
37718
- build2();
37719
- }
37720
- reporters?.watchStatusReporter?.(project?.project, diagnostic, newLine, options, errorCount);
37721
- };
37722
- const rootNames = Object.keys(context);
37723
- const solutionBuilder = ts2.createSolutionBuilderWithWatch(solutionHost, rootNames, {});
37724
- const build2 = () => {
37725
- while (true) {
37726
- project = solutionBuilder.getNextInvalidatedProject();
37727
- if (!project) {
37728
- break;
37729
- }
37730
- const projectContext = context[project.project];
37731
- const projectName = projectContext.project;
37732
- if (project.kind === ts2.InvalidatedProjectKind.UpdateBundle) {
37733
- 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.`);
37734
- continue;
37735
- }
37736
- hooks?.beforeProjectCompilationCallback(project.project);
37737
- if (project.kind === ts2.InvalidatedProjectKind.UpdateOutputFileStamps) {
37738
- if (projectName) {
37739
- logger.info(`Updating output timestamps of project "${projectName}"...
37740
- `, project.project);
37741
- }
37742
- const status2 = project.done();
37743
- const success2 = status2 === ts2.ExitStatus.Success;
37744
- if (projectName && success2) {
37745
- logger.info(`Done updating output timestamps of project "${projectName}"...
37746
- `, project.project);
37747
- }
37748
- hooks?.afterProjectCompilationCallback?.(project.project, success2);
37749
- continue;
37750
- }
37751
- logger.info(`Compiling TypeScript files for project "${projectName}"...
37752
- `, project.project);
37753
- const status = project.done(void 0, void 0, (0, get_custom_transformers_factory_1.getCustomTrasformersFactory)(projectContext.transformers)(project.getProgram()));
37754
- const success = status === ts2.ExitStatus.Success;
37755
- if (success) {
37756
- logger.info(`Done compiling TypeScript files for project "${projectName}".
37757
- `, project.project);
37758
- }
37759
- hooks?.afterProjectCompilationCallback?.(project.project, success);
37760
- }
37761
- };
37762
- build2();
37763
- solutionBuilder.build();
37764
- }
37765
- function getSystem(context) {
37766
- return {
37767
- ...ts2.sys,
37768
- readFile(path4, encoding) {
37769
- if (context[path4]) {
37770
- return context[path4].tsConfig.content;
37771
- }
37772
- return ts2.sys.readFile(path4, encoding);
37773
- }
37774
- };
37775
- }
37776
- }
37777
- });
37778
-
37779
- // 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
37780
- var require_lib2 = __commonJS({
37781
- "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) {
37782
- "use strict";
37783
- Object.defineProperty(exports, "__esModule", { value: true });
37784
- var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
37785
- tslib_1.__exportStar(require_get_custom_transformers_factory(), exports);
37786
- tslib_1.__exportStar(require_get_tsconfig(), exports);
37787
- tslib_1.__exportStar(require_normalize_options(), exports);
37788
- tslib_1.__exportStar(require_typescript_compilation(), exports);
37789
- }
37790
- });
37791
-
37792
- // 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
37793
- var require_tsc_impl = __commonJS({
37794
- "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) {
37795
- "use strict";
37796
- Object.defineProperty(exports, "__esModule", { value: true });
37797
- exports.tscExecutor = exports.createTypeScriptCompilationOptions = exports.determineModuleFormatFromTsConfig = void 0;
37798
- var ts2 = require("typescript");
37799
- var copy_assets_handler_1 = require_copy_assets_handler();
37800
- var check_dependencies_1 = require_check_dependencies();
37801
- var compiler_helper_dependency_1 = require_compiler_helper_dependency();
37802
- var inline_1 = require_inline();
37803
- var update_package_json_1 = require_update_package_json();
37804
- var compile_typescript_files_1 = require_compile_typescript_files();
37805
- var watch_for_single_file_changes_1 = require_watch_for_single_file_changes();
37806
- var lib_1 = require_lib2();
37807
- var ts_config_1 = require_ts_config();
37808
- var create_entry_points_1 = require_create_entry_points();
37809
- function determineModuleFormatFromTsConfig(absolutePathToTsConfig) {
37810
- const tsConfig = (0, ts_config_1.readTsConfig)(absolutePathToTsConfig);
37811
- 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) {
37812
- return "esm";
37813
- } else {
37814
- return "cjs";
37815
- }
37816
- }
37817
- exports.determineModuleFormatFromTsConfig = determineModuleFormatFromTsConfig;
37818
- function createTypeScriptCompilationOptions2(normalizedOptions, context) {
37819
- return {
37820
- outputPath: normalizedOptions.outputPath,
37821
- projectName: context.projectName,
37822
- projectRoot: normalizedOptions.projectRoot,
37823
- rootDir: normalizedOptions.rootDir,
37824
- tsConfig: normalizedOptions.tsConfig,
37825
- watch: normalizedOptions.watch,
37826
- deleteOutputPath: normalizedOptions.clean,
37827
- getCustomTransformers: (0, lib_1.getCustomTrasformersFactory)(normalizedOptions.transformers)
37828
- };
37829
- }
37830
- exports.createTypeScriptCompilationOptions = createTypeScriptCompilationOptions2;
37831
- async function* tscExecutor(_options, context) {
37832
- const { sourceRoot, root } = context.projectsConfigurations.projects[context.projectName];
37833
- const options = (0, lib_1.normalizeOptions)(_options, context.root, sourceRoot, root);
37834
- const { projectRoot, tmpTsConfig, target, dependencies } = (0, check_dependencies_1.checkDependencies)(context, options.tsConfig);
37835
- if (tmpTsConfig) {
37836
- options.tsConfig = tmpTsConfig;
37837
- }
37838
- const tsLibDependency = (0, compiler_helper_dependency_1.getHelperDependency)(compiler_helper_dependency_1.HelperDependency.tsc, options.tsConfig, dependencies, context.projectGraph);
37839
- if (tsLibDependency) {
37840
- dependencies.push(tsLibDependency);
37841
- }
37842
- const assetHandler = new copy_assets_handler_1.CopyAssetsHandler({
37843
- projectDir: projectRoot,
37844
- rootDir: context.root,
37845
- outputDir: _options.outputPath,
37846
- assets: _options.assets
37847
- });
37848
- const tsCompilationOptions = createTypeScriptCompilationOptions2(options, context);
37849
- const inlineProjectGraph = (0, inline_1.handleInliningBuild)(context, options, tsCompilationOptions.tsConfig);
37850
- if (!(0, inline_1.isInlineGraphEmpty)(inlineProjectGraph)) {
37851
- tsCompilationOptions.rootDir = ".";
37852
- }
37853
- const typescriptCompilation = (0, compile_typescript_files_1.compileTypeScriptFiles)(options, tsCompilationOptions, async () => {
37854
- await assetHandler.processAllAssetsOnce();
37855
- (0, update_package_json_1.updatePackageJson)({
37856
- ...options,
37857
- additionalEntryPoints: (0, create_entry_points_1.createEntryPoints)(options.additionalEntryPoints, context.root),
37858
- format: [determineModuleFormatFromTsConfig(options.tsConfig)],
37859
- // As long as d.ts files match their .js counterparts, we don't need to emit them.
37860
- // TSC can match them correctly based on file names.
37861
- skipTypings: true
37862
- }, context, target, dependencies);
37863
- (0, inline_1.postProcessInlinedDependencies)(tsCompilationOptions.outputPath, tsCompilationOptions.projectRoot, inlineProjectGraph);
37864
- });
37865
- if (options.watch) {
37866
- const disposeWatchAssetChanges = await assetHandler.watchAndProcessOnAssetChange();
37867
- const disposePackageJsonChanges = await (0, watch_for_single_file_changes_1.watchForSingleFileChanges)(context.projectName, options.projectRoot, "package.json", () => (0, update_package_json_1.updatePackageJson)({
37868
- ...options,
37869
- additionalEntryPoints: (0, create_entry_points_1.createEntryPoints)(options.additionalEntryPoints, context.root),
37870
- // As long as d.ts files match their .js counterparts, we don't need to emit them.
37871
- // TSC can match them correctly based on file names.
37872
- skipTypings: true,
37873
- format: [determineModuleFormatFromTsConfig(options.tsConfig)]
37874
- }, context, target, dependencies));
37875
- const handleTermination = async (exitCode) => {
37876
- await typescriptCompilation.close();
37877
- disposeWatchAssetChanges();
37878
- disposePackageJsonChanges();
37879
- process.exit(exitCode);
37880
- };
37881
- process.on("SIGINT", () => handleTermination(128 + 2));
37882
- process.on("SIGTERM", () => handleTermination(128 + 15));
37883
- }
37884
- return yield* typescriptCompilation.iterator;
37885
- }
37886
- exports.tscExecutor = tscExecutor;
37887
- exports.default = tscExecutor;
37888
- }
37889
- });
37890
-
37891
36686
  // node_modules/.pnpm/resolve-from@4.0.0/node_modules/resolve-from/index.js
37892
36687
  var require_resolve_from = __commonJS({
37893
36688
  "node_modules/.pnpm/resolve-from@4.0.0/node_modules/resolve-from/index.js"(exports, module2) {
@@ -38420,7 +37215,7 @@ var require_keyword = __commonJS({
38420
37215
  });
38421
37216
 
38422
37217
  // node_modules/.pnpm/@babel+helper-validator-identifier@7.22.20/node_modules/@babel/helper-validator-identifier/lib/index.js
38423
- var require_lib3 = __commonJS({
37218
+ var require_lib2 = __commonJS({
38424
37219
  "node_modules/.pnpm/@babel+helper-validator-identifier@7.22.20/node_modules/@babel/helper-validator-identifier/lib/index.js"(exports) {
38425
37220
  "use strict";
38426
37221
  Object.defineProperty(exports, "__esModule", {
@@ -40023,7 +38818,7 @@ var require_chalk = __commonJS({
40023
38818
  });
40024
38819
 
40025
38820
  // node_modules/.pnpm/@babel+highlight@7.23.4/node_modules/@babel/highlight/lib/index.js
40026
- var require_lib4 = __commonJS({
38821
+ var require_lib3 = __commonJS({
40027
38822
  "node_modules/.pnpm/@babel+highlight@7.23.4/node_modules/@babel/highlight/lib/index.js"(exports) {
40028
38823
  "use strict";
40029
38824
  Object.defineProperty(exports, "__esModule", {
@@ -40032,7 +38827,7 @@ var require_lib4 = __commonJS({
40032
38827
  exports.default = highlight;
40033
38828
  exports.shouldHighlight = shouldHighlight;
40034
38829
  var _jsTokens = require_js_tokens();
40035
- var _helperValidatorIdentifier = require_lib3();
38830
+ var _helperValidatorIdentifier = require_lib2();
40036
38831
  var _chalk = _interopRequireWildcard(require_chalk(), true);
40037
38832
  function _getRequireWildcardCache(e) {
40038
38833
  if ("function" != typeof WeakMap)
@@ -40153,7 +38948,7 @@ var require_lib4 = __commonJS({
40153
38948
  });
40154
38949
 
40155
38950
  // node_modules/.pnpm/@babel+code-frame@7.23.5/node_modules/@babel/code-frame/lib/index.js
40156
- var require_lib5 = __commonJS({
38951
+ var require_lib4 = __commonJS({
40157
38952
  "node_modules/.pnpm/@babel+code-frame@7.23.5/node_modules/@babel/code-frame/lib/index.js"(exports) {
40158
38953
  "use strict";
40159
38954
  Object.defineProperty(exports, "__esModule", {
@@ -40161,7 +38956,7 @@ var require_lib5 = __commonJS({
40161
38956
  });
40162
38957
  exports.codeFrameColumns = codeFrameColumns;
40163
38958
  exports.default = _default;
40164
- var _highlight = require_lib4();
38959
+ var _highlight = require_lib3();
40165
38960
  var _chalk = _interopRequireWildcard(require_chalk(), true);
40166
38961
  function _getRequireWildcardCache(e) {
40167
38962
  if ("function" != typeof WeakMap)
@@ -40342,7 +39137,7 @@ var require_parse_json = __commonJS({
40342
39137
  var errorEx = require_error_ex();
40343
39138
  var fallback = require_json_parse_even_better_errors();
40344
39139
  var { default: LinesAndColumns } = require_build();
40345
- var { codeFrameColumns } = require_lib5();
39140
+ var { codeFrameColumns } = require_lib4();
40346
39141
  var JSONError = errorEx("JSONError", {
40347
39142
  fileName: errorEx.append("in %s"),
40348
39143
  codeFrame: errorEx.append("\n\n%s\n")
@@ -44991,6 +43786,335 @@ var require_brace_expansion2 = __commonJS({
44991
43786
  }
44992
43787
  });
44993
43788
 
43789
+ // node_modules/.pnpm/@anatine+esbuild-decorators@0.2.19_esbuild@0.19.5/node_modules/@anatine/esbuild-decorators/src/lib/strip-it.js
43790
+ var require_strip_it = __commonJS({
43791
+ "node_modules/.pnpm/@anatine+esbuild-decorators@0.2.19_esbuild@0.19.5/node_modules/@anatine/esbuild-decorators/src/lib/strip-it.js"(exports) {
43792
+ "use strict";
43793
+ Object.defineProperty(exports, "__esModule", { value: true });
43794
+ exports.strip = void 0;
43795
+ var TextNode = class {
43796
+ constructor(node) {
43797
+ this.type = node.type;
43798
+ this.value = node.value;
43799
+ this.match = node.match;
43800
+ this.newline = node.newline || "";
43801
+ }
43802
+ get protected() {
43803
+ return Boolean(this.match) && this.match[1] === "!";
43804
+ }
43805
+ };
43806
+ var TextBlock = class extends TextNode {
43807
+ constructor(node) {
43808
+ super(node);
43809
+ this.nodes = node.nodes || [];
43810
+ }
43811
+ push(node) {
43812
+ this.nodes.push(node);
43813
+ }
43814
+ get protected() {
43815
+ return this.nodes.length > 0 && this.nodes[0].protected === true;
43816
+ }
43817
+ };
43818
+ var constants3 = {
43819
+ ESCAPED_CHAR_REGEX: /^\\./,
43820
+ QUOTED_STRING_REGEX: /^(['"`])((?:\\.|[^\1])+?)(\1)/,
43821
+ NEWLINE_REGEX: /^\r*\n/,
43822
+ BLOCK_OPEN_REGEX: /^\/\*\*?(!?)/,
43823
+ BLOCK_CLOSE_REGEX: /^\*\/(\n?)/,
43824
+ LINE_REGEX: /^\/\/(!?).*/
43825
+ };
43826
+ var parse = (input) => {
43827
+ const cst = new TextBlock({ type: "root", nodes: [] });
43828
+ const stack = [cst];
43829
+ const { ESCAPED_CHAR_REGEX, QUOTED_STRING_REGEX, NEWLINE_REGEX, BLOCK_CLOSE_REGEX, BLOCK_OPEN_REGEX, LINE_REGEX } = constants3;
43830
+ let block = cst;
43831
+ let remaining = input;
43832
+ let token;
43833
+ let prev;
43834
+ const consume = (value = remaining[0] || "") => {
43835
+ remaining = remaining.slice(value.length);
43836
+ return value;
43837
+ };
43838
+ const scan = (regex, type = "text") => {
43839
+ const match2 = regex.exec(remaining);
43840
+ if (match2) {
43841
+ consume(match2[0]);
43842
+ return { type, value: match2[0], match: match2 };
43843
+ }
43844
+ };
43845
+ const push = (node) => {
43846
+ if (prev && prev.type === "text" && node.type === "text") {
43847
+ prev.value += node.value;
43848
+ return;
43849
+ }
43850
+ block.push(node);
43851
+ if (node.nodes) {
43852
+ stack.push(node);
43853
+ block = node;
43854
+ }
43855
+ prev = node;
43856
+ };
43857
+ const pop = () => {
43858
+ if (block.type === "root") {
43859
+ throw new SyntaxError("Unclosed block comment");
43860
+ }
43861
+ stack.pop();
43862
+ block = stack[stack.length - 1];
43863
+ };
43864
+ while (remaining !== "") {
43865
+ if (token = scan(ESCAPED_CHAR_REGEX, "text")) {
43866
+ push(new TextNode(token));
43867
+ continue;
43868
+ }
43869
+ if (block.type !== "block" && (!prev || !/\w$/.test(prev.value))) {
43870
+ if (token = scan(QUOTED_STRING_REGEX, "line")) {
43871
+ push(new TextNode(token));
43872
+ continue;
43873
+ }
43874
+ }
43875
+ if (token = scan(NEWLINE_REGEX, "newline")) {
43876
+ push(new TextNode(token));
43877
+ continue;
43878
+ }
43879
+ if (token = scan(BLOCK_OPEN_REGEX, "open")) {
43880
+ push(new TextBlock({ type: "block" }));
43881
+ push(new TextNode(token));
43882
+ continue;
43883
+ }
43884
+ if (block.type === "block") {
43885
+ if (token = scan(BLOCK_CLOSE_REGEX, "close")) {
43886
+ token.newline = token.match[1] || "";
43887
+ push(new TextNode(token));
43888
+ pop();
43889
+ continue;
43890
+ }
43891
+ }
43892
+ if (block.type !== "block") {
43893
+ if (token = scan(LINE_REGEX, "line")) {
43894
+ push(new TextNode(token));
43895
+ continue;
43896
+ }
43897
+ }
43898
+ push(new TextNode({ type: "text", value: consume(remaining[0]) }));
43899
+ }
43900
+ return cst;
43901
+ };
43902
+ var compile = (cst) => {
43903
+ const walk = (node) => {
43904
+ let output = "";
43905
+ for (const child of node.nodes) {
43906
+ switch (child.type) {
43907
+ case "block":
43908
+ break;
43909
+ case "line":
43910
+ break;
43911
+ case "open":
43912
+ case "close":
43913
+ case "text":
43914
+ case "newline":
43915
+ default: {
43916
+ output += child.value || "";
43917
+ break;
43918
+ }
43919
+ }
43920
+ }
43921
+ return output;
43922
+ };
43923
+ return walk(cst);
43924
+ };
43925
+ var strip = (input) => compile(parse(input));
43926
+ exports.strip = strip;
43927
+ }
43928
+ });
43929
+
43930
+ // node_modules/.pnpm/@anatine+esbuild-decorators@0.2.19_esbuild@0.19.5/node_modules/@anatine/esbuild-decorators/src/lib/esbuild-decorators.js
43931
+ var require_esbuild_decorators = __commonJS({
43932
+ "node_modules/.pnpm/@anatine+esbuild-decorators@0.2.19_esbuild@0.19.5/node_modules/@anatine/esbuild-decorators/src/lib/esbuild-decorators.js"(exports) {
43933
+ "use strict";
43934
+ Object.defineProperty(exports, "__esModule", { value: true });
43935
+ exports.esbuildDecorators = void 0;
43936
+ var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
43937
+ var fs_1 = require("fs");
43938
+ var path_1 = require("path");
43939
+ var typescript_1 = require("typescript");
43940
+ var util_1 = require("util");
43941
+ var strip_it_1 = require_strip_it();
43942
+ var { readFile } = fs_1.promises;
43943
+ var theFinder = new RegExp(/((?<![(\s]\s*['"])@\w[.[\]\w\d]*\s*(?![;])[((?=\s)])/);
43944
+ var findDecorators = (fileContent) => theFinder.test((0, strip_it_1.strip)(fileContent));
43945
+ var esbuildDecorators2 = (options = {}) => ({
43946
+ name: "tsc",
43947
+ setup(build2) {
43948
+ var _a, _b, _c;
43949
+ const cwd = options.cwd || process.cwd();
43950
+ const tsconfigPath = options.tsconfig || ((_a = build2.initialOptions) === null || _a === void 0 ? void 0 : _a.tsconfig) || (0, path_1.join)(cwd, "./tsconfig.json");
43951
+ const forceTsc = (_b = options.force) !== null && _b !== void 0 ? _b : false;
43952
+ const tsx = (_c = options.tsx) !== null && _c !== void 0 ? _c : true;
43953
+ let parsedTsConfig = null;
43954
+ build2.onLoad({ filter: tsx ? /\.tsx?$/ : /\.ts$/ }, (args) => tslib_1.__awaiter(this, void 0, void 0, function* () {
43955
+ if (!parsedTsConfig) {
43956
+ parsedTsConfig = parseTsConfig(tsconfigPath, cwd);
43957
+ if (parsedTsConfig.options.sourcemap) {
43958
+ parsedTsConfig.options.sourcemap = false;
43959
+ parsedTsConfig.options.inlineSources = true;
43960
+ parsedTsConfig.options.inlineSourceMap = true;
43961
+ }
43962
+ }
43963
+ if (!forceTsc && (!parsedTsConfig || !parsedTsConfig.options || !parsedTsConfig.options.emitDecoratorMetadata)) {
43964
+ return;
43965
+ }
43966
+ const ts2 = yield readFile(args.path, "utf8").catch((err) => printDiagnostics({ file: args.path, err }));
43967
+ const hasDecorator = findDecorators(ts2);
43968
+ if (!ts2 || !hasDecorator) {
43969
+ return;
43970
+ }
43971
+ const program = (0, typescript_1.transpileModule)(ts2, {
43972
+ compilerOptions: parsedTsConfig.options
43973
+ });
43974
+ return { contents: program.outputText };
43975
+ }));
43976
+ }
43977
+ });
43978
+ exports.esbuildDecorators = esbuildDecorators2;
43979
+ function parseTsConfig(tsconfig, cwd = process.cwd()) {
43980
+ const fileName = (0, typescript_1.findConfigFile)(cwd, typescript_1.sys.fileExists, tsconfig);
43981
+ if (tsconfig !== void 0 && !fileName)
43982
+ throw new Error(`failed to open '${fileName}'`);
43983
+ let loadedConfig = {};
43984
+ let baseDir = cwd;
43985
+ if (fileName) {
43986
+ const text = typescript_1.sys.readFile(fileName);
43987
+ if (text === void 0)
43988
+ throw new Error(`failed to read '${fileName}'`);
43989
+ const result = (0, typescript_1.parseConfigFileTextToJson)(fileName, text);
43990
+ if (result.error !== void 0) {
43991
+ printDiagnostics(result.error);
43992
+ throw new Error(`failed to parse '${fileName}'`);
43993
+ }
43994
+ loadedConfig = result.config;
43995
+ baseDir = (0, path_1.dirname)(fileName);
43996
+ }
43997
+ const parsedTsConfig = (0, typescript_1.parseJsonConfigFileContent)(loadedConfig, typescript_1.sys, baseDir);
43998
+ if (parsedTsConfig.errors[0])
43999
+ printDiagnostics(parsedTsConfig.errors);
44000
+ return parsedTsConfig;
44001
+ }
44002
+ function printDiagnostics(...args) {
44003
+ console.log((0, util_1.inspect)(args, false, 10, true));
44004
+ }
44005
+ }
44006
+ });
44007
+
44008
+ // node_modules/.pnpm/@anatine+esbuild-decorators@0.2.19_esbuild@0.19.5/node_modules/@anatine/esbuild-decorators/src/index.js
44009
+ var require_src2 = __commonJS({
44010
+ "node_modules/.pnpm/@anatine+esbuild-decorators@0.2.19_esbuild@0.19.5/node_modules/@anatine/esbuild-decorators/src/index.js"(exports) {
44011
+ "use strict";
44012
+ Object.defineProperty(exports, "__esModule", { value: true });
44013
+ exports.esbuildDecorators = void 0;
44014
+ var esbuild_decorators_1 = require_esbuild_decorators();
44015
+ Object.defineProperty(exports, "esbuildDecorators", { enumerable: true, get: function() {
44016
+ return esbuild_decorators_1.esbuildDecorators;
44017
+ } });
44018
+ }
44019
+ });
44020
+
44021
+ // 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
44022
+ var require_get_custom_transformers_factory = __commonJS({
44023
+ "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) {
44024
+ "use strict";
44025
+ Object.defineProperty(exports, "__esModule", { value: true });
44026
+ exports.getCustomTrasformersFactory = void 0;
44027
+ var load_ts_transformers_1 = require_load_ts_transformers();
44028
+ function getCustomTrasformersFactory2(transformers) {
44029
+ const { compilerPluginHooks } = (0, load_ts_transformers_1.loadTsTransformers)(transformers);
44030
+ return (program) => ({
44031
+ before: compilerPluginHooks.beforeHooks.map((hook) => hook(program)),
44032
+ after: compilerPluginHooks.afterHooks.map((hook) => hook(program)),
44033
+ afterDeclarations: compilerPluginHooks.afterDeclarationsHooks.map((hook) => hook(program))
44034
+ });
44035
+ }
44036
+ exports.getCustomTrasformersFactory = getCustomTrasformersFactory2;
44037
+ }
44038
+ });
44039
+
44040
+ // 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
44041
+ var require_assets2 = __commonJS({
44042
+ "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) {
44043
+ "use strict";
44044
+ Object.defineProperty(exports, "__esModule", { value: true });
44045
+ exports.assetGlobsToFiles = void 0;
44046
+ var fastGlob = require_out4();
44047
+ var path_1 = require("path");
44048
+ function assetGlobsToFiles(assets, rootDir, outDir) {
44049
+ const files = [];
44050
+ const globbedFiles = (pattern, input = "", ignore = [], dot = false) => {
44051
+ return fastGlob.sync(pattern, {
44052
+ cwd: input,
44053
+ onlyFiles: true,
44054
+ dot,
44055
+ ignore
44056
+ });
44057
+ };
44058
+ assets.forEach((asset) => {
44059
+ if (typeof asset === "string") {
44060
+ globbedFiles(asset, rootDir).forEach((globbedFile) => {
44061
+ files.push({
44062
+ input: (0, path_1.join)(rootDir, globbedFile),
44063
+ output: (0, path_1.join)(outDir, (0, path_1.basename)(globbedFile))
44064
+ });
44065
+ });
44066
+ } else {
44067
+ globbedFiles(asset.glob, (0, path_1.join)(rootDir, asset.input), asset.ignore, asset.dot ?? false).forEach((globbedFile) => {
44068
+ files.push({
44069
+ input: (0, path_1.join)(rootDir, asset.input, globbedFile),
44070
+ output: (0, path_1.join)(outDir, asset.output, globbedFile)
44071
+ });
44072
+ });
44073
+ }
44074
+ });
44075
+ return files;
44076
+ }
44077
+ exports.assetGlobsToFiles = assetGlobsToFiles;
44078
+ }
44079
+ });
44080
+
44081
+ // 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/normalize-options.js
44082
+ var require_normalize_options = __commonJS({
44083
+ "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/normalize-options.js"(exports) {
44084
+ "use strict";
44085
+ Object.defineProperty(exports, "__esModule", { value: true });
44086
+ exports.normalizeOptions = void 0;
44087
+ var path_1 = require("path");
44088
+ var assets_1 = require_assets2();
44089
+ function normalizeOptions2(options, contextRoot, sourceRoot, projectRoot) {
44090
+ const outputPath = (0, path_1.join)(contextRoot, options.outputPath);
44091
+ const rootDir = options.rootDir ? (0, path_1.join)(contextRoot, options.rootDir) : (0, path_1.join)(contextRoot, projectRoot);
44092
+ if (options.watch == null) {
44093
+ options.watch = false;
44094
+ }
44095
+ if (Array.isArray(options.external) && options.external.length > 0) {
44096
+ const firstItem = options.external[0];
44097
+ if (firstItem === "all" || firstItem === "none") {
44098
+ options.external = firstItem;
44099
+ }
44100
+ }
44101
+ const files = (0, assets_1.assetGlobsToFiles)(options.assets, contextRoot, outputPath);
44102
+ return {
44103
+ ...options,
44104
+ root: contextRoot,
44105
+ sourceRoot,
44106
+ projectRoot,
44107
+ files,
44108
+ outputPath,
44109
+ tsConfig: (0, path_1.join)(contextRoot, options.tsConfig),
44110
+ rootDir,
44111
+ mainOutputPath: (0, path_1.resolve)(outputPath, options.main.replace(`${projectRoot}/`, "").replace(".ts", ".js"))
44112
+ };
44113
+ }
44114
+ exports.normalizeOptions = normalizeOptions2;
44115
+ }
44116
+ });
44117
+
44994
44118
  // node_modules/.pnpm/tsup@8.0.0_patch_hash=fecszixvz36nsmruxbct32ggt4_@microsoft+api-extractor@7.38.3_@swc+core@1._obsfvncdmdnopsocrl4rw2efcm/node_modules/tsup/dist/chunk-EPAEWGCP.js
44995
44119
  var require_chunk_EPAEWGCP = __commonJS({
44996
44120
  "node_modules/.pnpm/tsup@8.0.0_patch_hash=fecszixvz36nsmruxbct32ggt4_@microsoft+api-extractor@7.38.3_@swc+core@1._obsfvncdmdnopsocrl4rw2efcm/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
@@ -46817,21 +45941,21 @@ var require_chunk_GQ77QZBO = __commonJS({
46817
45941
  }
46818
45942
  }
46819
45943
  function defaultOutExtension({
46820
- format: format2,
45944
+ format: format3,
46821
45945
  pkgType
46822
45946
  }) {
46823
45947
  let jsExtension = ".js";
46824
45948
  let dtsExtension = ".d.ts";
46825
45949
  const isModule = pkgType === "module";
46826
- if (isModule && format2 === "cjs") {
45950
+ if (isModule && format3 === "cjs") {
46827
45951
  jsExtension = ".cjs";
46828
45952
  dtsExtension = ".d.cts";
46829
45953
  }
46830
- if (!isModule && format2 === "esm") {
45954
+ if (!isModule && format3 === "esm") {
46831
45955
  jsExtension = ".mjs";
46832
45956
  dtsExtension = ".d.mts";
46833
45957
  }
46834
- if (format2 === "iife") {
45958
+ if (format3 === "iife") {
46835
45959
  jsExtension = ".global.js";
46836
45960
  }
46837
45961
  return {
@@ -47146,7 +46270,7 @@ var require_chunk_UIX4URMV = __commonJS({
47146
46270
  });
47147
46271
 
47148
46272
  // node_modules/.pnpm/joycon@3.1.1/node_modules/joycon/lib/index.js
47149
- var require_lib6 = __commonJS({
46273
+ var require_lib5 = __commonJS({
47150
46274
  "node_modules/.pnpm/joycon@3.1.1/node_modules/joycon/lib/index.js"(exports, module2) {
47151
46275
  "use strict";
47152
46276
  Object.defineProperty(exports, "__esModule", {
@@ -47656,8 +46780,8 @@ var require_dist3 = __commonJS({
47656
46780
  return "cjs";
47657
46781
  }
47658
46782
  var usingDynamicImport = typeof jest === "undefined";
47659
- var dynamicImport = async (id, { format: format2 }) => {
47660
- const fn = format2 === "esm" ? (file) => import(file) : false ? createRequire(import_meta.url) : require;
46783
+ var dynamicImport = async (id, { format: format3 }) => {
46784
+ const fn = format3 === "esm" ? (file) => import(file) : false ? createRequire(import_meta.url) : require;
47661
46785
  return fn(id);
47662
46786
  };
47663
46787
  var getRandomId = () => {
@@ -47674,9 +46798,9 @@ var require_dist3 = __commonJS({
47674
46798
  return "ts";
47675
46799
  return ext2.slice(1);
47676
46800
  }
47677
- var defaultGetOutputFile = (filepath, format2) => filepath.replace(
46801
+ var defaultGetOutputFile = (filepath, format3) => filepath.replace(
47678
46802
  JS_EXT_RE,
47679
- `.bundled_${getRandomId()}.${format2 === "esm" ? "mjs" : "cjs"}`
46803
+ `.bundled_${getRandomId()}.${format3 === "esm" ? "mjs" : "cjs"}`
47680
46804
  );
47681
46805
  var tsconfigPathsToRegExp = (paths) => {
47682
46806
  return Object.keys(paths || {}).map((key) => {
@@ -47756,7 +46880,7 @@ var require_dist3 = __commonJS({
47756
46880
  }
47757
46881
  const preserveTemporaryFile = (_a = options.preserveTemporaryFile) != null ? _a : !!process.env.BUNDLE_REQUIRE_PRESERVE;
47758
46882
  const cwd = options.cwd || process.cwd();
47759
- const format2 = (_b = options.format) != null ? _b : guessFormat(options.filepath);
46883
+ const format3 = (_b = options.format) != null ? _b : guessFormat(options.filepath);
47760
46884
  const tsconfig = (0, import_load_tsconfig.loadTsConfig)(cwd, options.tsconfig);
47761
46885
  const resolvePaths = tsconfigPathsToRegExp(
47762
46886
  ((_c = tsconfig == null ? void 0 : tsconfig.data.compilerOptions) == null ? void 0 : _c.paths) || {}
@@ -47767,14 +46891,14 @@ var require_dist3 = __commonJS({
47767
46891
  }
47768
46892
  const { text } = result.outputFiles[0];
47769
46893
  const getOutputFile = options.getOutputFile || defaultGetOutputFile;
47770
- const outfile = getOutputFile(options.filepath, format2);
46894
+ const outfile = getOutputFile(options.filepath, format3);
47771
46895
  await import_fs2.default.promises.writeFile(outfile, text, "utf8");
47772
46896
  let mod;
47773
46897
  const req = options.require || dynamicImport;
47774
46898
  try {
47775
46899
  mod = await req(
47776
- format2 === "esm" ? (0, import_url3.pathToFileURL)(outfile).href : outfile,
47777
- { format: format2 }
46900
+ format3 === "esm" ? (0, import_url3.pathToFileURL)(outfile).href : outfile,
46901
+ { format: format3 }
47778
46902
  );
47779
46903
  } finally {
47780
46904
  if (!preserveTemporaryFile) {
@@ -47792,7 +46916,7 @@ var require_dist3 = __commonJS({
47792
46916
  entryPoints: [options.filepath],
47793
46917
  absWorkingDir: cwd,
47794
46918
  outfile: "out.js",
47795
- format: format2,
46919
+ format: format3,
47796
46920
  platform: "node",
47797
46921
  sourcemap: "inline",
47798
46922
  bundle: true,
@@ -47889,7 +47013,7 @@ var require_chunk_7G76EW2R = __commonJS({
47889
47013
  var _chunkGQ77QZBOjs = require_chunk_GQ77QZBO();
47890
47014
  var _fs = require("fs");
47891
47015
  var _fs2 = _interopRequireDefault(_fs);
47892
- var _joycon = require_lib6();
47016
+ var _joycon = require_lib5();
47893
47017
  var _joycon2 = _interopRequireDefault(_joycon);
47894
47018
  var _path = require("path");
47895
47019
  var _path2 = _interopRequireDefault(_path);
@@ -48061,12 +47185,12 @@ var require_chunk_7G76EW2R = __commonJS({
48061
47185
  var padRight = (str, maxLength) => {
48062
47186
  return str + " ".repeat(maxLength - str.length);
48063
47187
  };
48064
- var reportSize = (logger, format2, files) => {
47188
+ var reportSize = (logger, format3, files) => {
48065
47189
  const filenames = Object.keys(files);
48066
47190
  const maxLength = getLengthOfLongestString(filenames) + 1;
48067
47191
  for (const name of filenames) {
48068
47192
  logger.success(
48069
- format2,
47193
+ format3,
48070
47194
  `${_chunkUIX4URMVjs.bold.call(void 0, padRight(name, maxLength))}${_chunkUIX4URMVjs.green.call(
48071
47195
  void 0,
48072
47196
  prettyBytes(files[name])
@@ -75382,11 +74506,11 @@ Original error: ${originalError.message}`,
75382
74506
  message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`
75383
74507
  };
75384
74508
  }
75385
- function logInvalidFormatForTopLevelAwait(id, format2) {
74509
+ function logInvalidFormatForTopLevelAwait(id, format3) {
75386
74510
  return {
75387
74511
  code: INVALID_TLA_FORMAT,
75388
74512
  id,
75389
- message: `Module format "${format2}" does not support top-level await. Use the "es" or "system" output formats rather.`
74513
+ message: `Module format "${format3}" does not support top-level await. Use the "es" or "system" output formats rather.`
75390
74514
  };
75391
74515
  }
75392
74516
  function logMissingConfig() {
@@ -81660,11 +80784,11 @@ var require_rollup = __commonJS({
81660
80784
  return { isMatch: false, output: "" };
81661
80785
  }
81662
80786
  const opts = options || {};
81663
- const format2 = opts.format || (posix2 ? utils.toPosixSlashes : null);
80787
+ const format3 = opts.format || (posix2 ? utils.toPosixSlashes : null);
81664
80788
  let match2 = input === glob2;
81665
- let output = match2 && format2 ? format2(input) : input;
80789
+ let output = match2 && format3 ? format3(input) : input;
81666
80790
  if (match2 === false) {
81667
- output = format2 ? format2(input) : input;
80791
+ output = format3 ? format3(input) : input;
81668
80792
  match2 = output === glob2;
81669
80793
  }
81670
80794
  if (match2 === false || opts.capture === true) {
@@ -83227,11 +82351,11 @@ var require_rollup = __commonJS({
83227
82351
  addReturnExpression(expression) {
83228
82352
  this.parent instanceof _ChildScope && this.parent.addReturnExpression(expression);
83229
82353
  }
83230
- addUsedOutsideNames(usedNames, format2, exportNamesByVariable, accessedGlobalsByScope) {
82354
+ addUsedOutsideNames(usedNames, format3, exportNamesByVariable, accessedGlobalsByScope) {
83231
82355
  for (const variable of this.accessedOutsideVariables.values()) {
83232
82356
  if (variable.included) {
83233
82357
  usedNames.add(variable.getBaseVariableName());
83234
- if (format2 === "system" && exportNamesByVariable.has(variable)) {
82358
+ if (format3 === "system" && exportNamesByVariable.has(variable)) {
83235
82359
  usedNames.add("exports");
83236
82360
  }
83237
82361
  }
@@ -83246,9 +82370,9 @@ var require_rollup = __commonJS({
83246
82370
  contains(name) {
83247
82371
  return this.variables.has(name) || this.parent.contains(name);
83248
82372
  }
83249
- deconflict(format2, exportNamesByVariable, accessedGlobalsByScope) {
82373
+ deconflict(format3, exportNamesByVariable, accessedGlobalsByScope) {
83250
82374
  const usedNames = /* @__PURE__ */ new Set();
83251
- this.addUsedOutsideNames(usedNames, format2, exportNamesByVariable, accessedGlobalsByScope);
82375
+ this.addUsedOutsideNames(usedNames, format3, exportNamesByVariable, accessedGlobalsByScope);
83252
82376
  if (this.accessedDynamicImports) {
83253
82377
  for (const importExpression of this.accessedDynamicImports) {
83254
82378
  if (importExpression.inlineNamespace) {
@@ -83262,7 +82386,7 @@ var require_rollup = __commonJS({
83262
82386
  }
83263
82387
  }
83264
82388
  for (const scope of this.children) {
83265
- scope.deconflict(format2, exportNamesByVariable, accessedGlobalsByScope);
82389
+ scope.deconflict(format3, exportNamesByVariable, accessedGlobalsByScope);
83266
82390
  }
83267
82391
  }
83268
82392
  findLexicalBoundary() {
@@ -86359,10 +85483,10 @@ var require_rollup = __commonJS({
86359
85483
  super.parseNode(esTreeNode);
86360
85484
  }
86361
85485
  render(code, options) {
86362
- const { exportNamesByVariable, format: format2, snippets: { _, getPropertyAccess } } = options;
85486
+ const { exportNamesByVariable, format: format3, snippets: { _, getPropertyAccess } } = options;
86363
85487
  if (this.id) {
86364
85488
  const { variable, name } = this.id;
86365
- if (format2 === "system" && exportNamesByVariable.has(variable)) {
85489
+ if (format3 === "system" && exportNamesByVariable.has(variable)) {
86366
85490
  code.appendLeft(this.end, `${_}${getSystemExportStatement([variable], options)};`);
86367
85491
  }
86368
85492
  const renderedVariable = variable.getName(getPropertyAccess);
@@ -86709,19 +85833,19 @@ var require_rollup = __commonJS({
86709
85833
  applyDeoptimizations() {
86710
85834
  }
86711
85835
  renderNamedDeclaration(code, declarationStart, idInsertPosition, options) {
86712
- const { exportNamesByVariable, format: format2, snippets: { getPropertyAccess } } = options;
85836
+ const { exportNamesByVariable, format: format3, snippets: { getPropertyAccess } } = options;
86713
85837
  const name = this.variable.getName(getPropertyAccess);
86714
85838
  code.remove(this.start, declarationStart);
86715
85839
  if (idInsertPosition !== null) {
86716
85840
  code.appendLeft(idInsertPosition, ` ${name}`);
86717
85841
  }
86718
- if (format2 === "system" && this.declaration instanceof ClassDeclaration && exportNamesByVariable.has(this.variable)) {
85842
+ if (format3 === "system" && this.declaration instanceof ClassDeclaration && exportNamesByVariable.has(this.variable)) {
86719
85843
  code.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`);
86720
85844
  }
86721
85845
  }
86722
- renderVariableDeclaration(code, declarationStart, { format: format2, exportNamesByVariable, snippets: { cnst, getPropertyAccess } }) {
85846
+ renderVariableDeclaration(code, declarationStart, { format: format3, exportNamesByVariable, snippets: { cnst, getPropertyAccess } }) {
86723
85847
  const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59;
86724
- const systemExportNames = format2 === "system" && exportNamesByVariable.get(this.variable);
85848
+ const systemExportNames = format3 === "system" && exportNamesByVariable.get(this.variable);
86725
85849
  if (systemExportNames) {
86726
85850
  code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = exports('${systemExportNames[0]}', `);
86727
85851
  code.appendRight(hasTrailingSemicolon ? this.end - 1 : this.end, ")" + (hasTrailingSemicolon ? "" : ";"));
@@ -87425,13 +86549,13 @@ var require_rollup = __commonJS({
87425
86549
  }
87426
86550
  }
87427
86551
  setExternalResolution(exportMode, resolution, options, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, namespaceExportName, attributes) {
87428
- const { format: format2 } = options;
86552
+ const { format: format3 } = options;
87429
86553
  this.inlineNamespace = null;
87430
86554
  this.resolution = resolution;
87431
86555
  this.resolutionString = resolutionString;
87432
86556
  this.namespaceExportName = namespaceExportName;
87433
86557
  this.attributes = attributes;
87434
- const accessedGlobals = [...accessedImportGlobals[format2] || []];
86558
+ const accessedGlobals = [...accessedImportGlobals[format3] || []];
87435
86559
  let helper;
87436
86560
  ({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(resolution, exportMode, options, snippets, pluginDriver));
87437
86561
  if (helper) {
@@ -87446,11 +86570,11 @@ var require_rollup = __commonJS({
87446
86570
  }
87447
86571
  applyDeoptimizations() {
87448
86572
  }
87449
- getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportInCjs, format: format2, generatedCode: { arrowFunctions }, interop }, { _, getDirectReturnFunction, getDirectReturnIifeLeft }, pluginDriver) {
86573
+ getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportInCjs, format: format3, generatedCode: { arrowFunctions }, interop }, { _, getDirectReturnFunction, getDirectReturnIifeLeft }, pluginDriver) {
87450
86574
  const mechanism = pluginDriver.hookFirstSync("renderDynamicImport", [
87451
86575
  {
87452
86576
  customResolution: typeof this.resolution === "string" ? this.resolution : null,
87453
- format: format2,
86577
+ format: format3,
87454
86578
  moduleId: this.scope.context.module.id,
87455
86579
  targetModuleId: this.resolution && typeof this.resolution !== "string" ? this.resolution.id : null
87456
86580
  }
@@ -87459,7 +86583,7 @@ var require_rollup = __commonJS({
87459
86583
  return { helper: null, mechanism };
87460
86584
  }
87461
86585
  const hasDynamicTarget = !this.resolution || typeof this.resolution === "string";
87462
- switch (format2) {
86586
+ switch (format3) {
87463
86587
  case "cjs": {
87464
86588
  if (dynamicImportInCjs && (!resolution || typeof resolution === "string" || resolution instanceof ExternalModule)) {
87465
86589
  return { helper: null, mechanism: null };
@@ -87757,7 +86881,7 @@ var require_rollup = __commonJS({
87757
86881
  }
87758
86882
  }
87759
86883
  render(code, renderOptions) {
87760
- const { format: format2, pluginDriver, snippets } = renderOptions;
86884
+ const { format: format3, pluginDriver, snippets } = renderOptions;
87761
86885
  const { scope: { context: { module: module3 } }, meta: { name }, metaProperty, parent, preliminaryChunkId, referenceId, start, end } = this;
87762
86886
  const { id: moduleId } = module3;
87763
86887
  if (name !== IMPORT)
@@ -87767,18 +86891,18 @@ var require_rollup = __commonJS({
87767
86891
  const fileName = pluginDriver.getFileName(referenceId);
87768
86892
  const relativePath = parseAst_js.normalize(node_path.relative(node_path.dirname(chunkId), fileName));
87769
86893
  const replacement2 = pluginDriver.hookFirstSync("resolveFileUrl", [
87770
- { chunkId, fileName, format: format2, moduleId, referenceId, relativePath }
87771
- ]) || relativeUrlMechanisms[format2](relativePath);
86894
+ { chunkId, fileName, format: format3, moduleId, referenceId, relativePath }
86895
+ ]) || relativeUrlMechanisms[format3](relativePath);
87772
86896
  code.overwrite(parent.start, parent.end, replacement2, { contentOnly: true });
87773
86897
  return;
87774
86898
  }
87775
86899
  let replacement = pluginDriver.hookFirstSync("resolveImportMeta", [
87776
86900
  metaProperty,
87777
- { chunkId, format: format2, moduleId }
86901
+ { chunkId, format: format3, moduleId }
87778
86902
  ]);
87779
86903
  if (!replacement) {
87780
- replacement = importMetaMechanisms[format2]?.(metaProperty, { chunkId, snippets });
87781
- renderOptions.accessedDocumentCurrentScript ||= formatsMaybeAccessDocumentCurrentScript.includes(format2) && replacement !== "undefined";
86904
+ replacement = importMetaMechanisms[format3]?.(metaProperty, { chunkId, snippets });
86905
+ renderOptions.accessedDocumentCurrentScript ||= formatsMaybeAccessDocumentCurrentScript.includes(format3) && replacement !== "undefined";
87782
86906
  }
87783
86907
  if (typeof replacement === "string") {
87784
86908
  if (parent instanceof MemberExpression) {
@@ -87788,9 +86912,9 @@ var require_rollup = __commonJS({
87788
86912
  }
87789
86913
  }
87790
86914
  }
87791
- setResolution(format2, accessedGlobalsByScope, preliminaryChunkId) {
86915
+ setResolution(format3, accessedGlobalsByScope, preliminaryChunkId) {
87792
86916
  this.preliminaryChunkId = preliminaryChunkId;
87793
- const accessedGlobals = (this.metaProperty?.startsWith(FILE_PREFIX) ? accessedFileUrlGlobals : accessedMetaUrlGlobals)[format2];
86917
+ const accessedGlobals = (this.metaProperty?.startsWith(FILE_PREFIX) ? accessedFileUrlGlobals : accessedMetaUrlGlobals)[format3];
87794
86918
  if (accessedGlobals.length > 0) {
87795
86919
  this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope);
87796
86920
  }
@@ -88553,9 +87677,9 @@ var require_rollup = __commonJS({
88553
87677
  }
88554
87678
  addNamespaceMemberAccess() {
88555
87679
  }
88556
- deconflict(format2, exportNamesByVariable, accessedGlobalsByScope) {
87680
+ deconflict(format3, exportNamesByVariable, accessedGlobalsByScope) {
88557
87681
  for (const scope of this.children)
88558
- scope.deconflict(format2, exportNamesByVariable, accessedGlobalsByScope);
87682
+ scope.deconflict(format3, exportNamesByVariable, accessedGlobalsByScope);
88559
87683
  }
88560
87684
  findLexicalBoundary() {
88561
87685
  return this;
@@ -88730,9 +87854,9 @@ var require_rollup = __commonJS({
88730
87854
  this.argument.setAssignedValue(UNKNOWN_EXPRESSION);
88731
87855
  }
88732
87856
  render(code, options) {
88733
- const { exportNamesByVariable, format: format2, snippets: { _ } } = options;
87857
+ const { exportNamesByVariable, format: format3, snippets: { _ } } = options;
88734
87858
  this.argument.render(code, options);
88735
- if (format2 === "system") {
87859
+ if (format3 === "system") {
88736
87860
  const variable = this.argument.variable;
88737
87861
  const exportNames = exportNamesByVariable.get(variable);
88738
87862
  if (exportNames) {
@@ -89109,7 +88233,7 @@ var require_rollup = __commonJS({
89109
88233
  }
89110
88234
  }
89111
88235
  renderBlock(options) {
89112
- const { exportNamesByVariable, format: format2, freeze, indent: t, symbols, snippets: { _, cnst, getObject, getPropertyAccess, n: n2, s } } = options;
88236
+ const { exportNamesByVariable, format: format3, freeze, indent: t, symbols, snippets: { _, cnst, getObject, getPropertyAccess, n: n2, s } } = options;
89113
88237
  const memberVariables = this.getMemberVariables();
89114
88238
  const members = Object.entries(memberVariables).filter(([_2, variable]) => variable.included).map(([name2, variable]) => {
89115
88239
  if (this.referencedEarly || variable.isReassigned || variable === this) {
@@ -89135,7 +88259,7 @@ var require_rollup = __commonJS({
89135
88259
  }
89136
88260
  const name = this.getName(getPropertyAccess);
89137
88261
  output = `${cnst} ${name}${_}=${_}${output};`;
89138
- if (format2 === "system" && exportNamesByVariable.has(this)) {
88262
+ if (format3 === "system" && exportNamesByVariable.has(this)) {
89139
88263
  output += `${n2}${getSystemExportStatement([this], options)};`;
89140
88264
  }
89141
88265
  return output;
@@ -91031,15 +90155,15 @@ ${outro}`;
91031
90155
  system: deconflictImportsEsmOrSystem,
91032
90156
  umd: deconflictImportsOther
91033
90157
  };
91034
- function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format2, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) {
90158
+ function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format3, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) {
91035
90159
  const reversedModules = [...modules].reverse();
91036
90160
  for (const module3 of reversedModules) {
91037
- module3.scope.addUsedOutsideNames(usedNames, format2, exportNamesByVariable, accessedGlobalsByScope);
90161
+ module3.scope.addUsedOutsideNames(usedNames, format3, exportNamesByVariable, accessedGlobalsByScope);
91038
90162
  }
91039
90163
  deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces);
91040
- DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format2](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports);
90164
+ DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format3](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports);
91041
90165
  for (const module3 of reversedModules) {
91042
- module3.scope.deconflict(format2, exportNamesByVariable, accessedGlobalsByScope);
90166
+ module3.scope.deconflict(format3, exportNamesByVariable, accessedGlobalsByScope);
91043
90167
  }
91044
90168
  }
91045
90169
  function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop, preserveModules, _externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports) {
@@ -91145,7 +90269,7 @@ ${outro}`;
91145
90269
  exportNamesByVariable.set(variable, [exportName]);
91146
90270
  }
91147
90271
  }
91148
- function getExportMode(chunk, { exports: exportMode, name, format: format2 }, facadeModuleId, log) {
90272
+ function getExportMode(chunk, { exports: exportMode, name, format: format3 }, facadeModuleId, log) {
91149
90273
  const exportKeys = chunk.getExportNames();
91150
90274
  if (exportMode === "default") {
91151
90275
  if (exportKeys.length !== 1 || exportKeys[0] !== "default") {
@@ -91160,7 +90284,7 @@ ${outro}`;
91160
90284
  } else if (exportKeys.length === 1 && exportKeys[0] === "default") {
91161
90285
  exportMode = "default";
91162
90286
  } else {
91163
- if (format2 !== "es" && format2 !== "system" && exportKeys.includes("default")) {
90287
+ if (format3 !== "es" && format3 !== "system" && exportKeys.includes("default")) {
91164
90288
  log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMixedExport(facadeModuleId, name));
91165
90289
  }
91166
90290
  exportMode = "named";
@@ -91480,13 +90604,13 @@ ${outro}`;
91480
90604
  }
91481
90605
  let fileName;
91482
90606
  let hashPlaceholder = null;
91483
- const { chunkFileNames, entryFileNames, file, format: format2, preserveModules } = this.outputOptions;
90607
+ const { chunkFileNames, entryFileNames, file, format: format3, preserveModules } = this.outputOptions;
91484
90608
  if (file) {
91485
90609
  fileName = node_path.basename(file);
91486
90610
  } else if (this.fileName === null) {
91487
90611
  const [pattern, patternName] = preserveModules || this.facadeModule?.isUserDefinedEntryPoint ? [entryFileNames, "output.entryFileNames"] : [chunkFileNames, "output.chunkFileNames"];
91488
90612
  fileName = renderNamePattern(typeof pattern === "function" ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, {
91489
- format: () => format2,
90613
+ format: () => format3,
91490
90614
  hash: (size) => hashPlaceholder || (hashPlaceholder = this.getPlaceholder(patternName, size)),
91491
90615
  name: () => this.getChunkName()
91492
90616
  });
@@ -91507,12 +90631,12 @@ ${outro}`;
91507
90631
  }
91508
90632
  let sourcemapFileName = null;
91509
90633
  let hashPlaceholder = null;
91510
- const { sourcemapFileNames, format: format2 } = this.outputOptions;
90634
+ const { sourcemapFileNames, format: format3 } = this.outputOptions;
91511
90635
  if (sourcemapFileNames) {
91512
90636
  const [pattern, patternName] = [sourcemapFileNames, "output.sourcemapFileNames"];
91513
90637
  sourcemapFileName = renderNamePattern(typeof pattern === "function" ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, {
91514
90638
  chunkhash: () => this.getPreliminaryFileName().hashPlaceholder || "",
91515
- format: () => format2,
90639
+ format: () => format3,
91516
90640
  hash: (size) => hashPlaceholder || (hashPlaceholder = this.getPlaceholder(patternName, size)),
91517
90641
  name: () => this.getChunkName()
91518
90642
  });
@@ -91556,7 +90680,7 @@ ${outro}`;
91556
90680
  }
91557
90681
  async render() {
91558
90682
  const { dependencies, exportMode, facadeModule, inputOptions: { onLog }, outputOptions, pluginDriver, snippets } = this;
91559
- const { format: format2, hoistTransitiveImports, preserveModules } = outputOptions;
90683
+ const { format: format3, hoistTransitiveImports, preserveModules } = outputOptions;
91560
90684
  if (hoistTransitiveImports && !preserveModules && facadeModule !== null) {
91561
90685
  for (const dep of dependencies) {
91562
90686
  if (dep instanceof _Chunk)
@@ -91567,7 +90691,7 @@ ${outro}`;
91567
90691
  const preliminarySourcemapFileName = this.getPreliminarySourcemapFileName();
91568
90692
  const { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait } = this.renderModules(preliminaryFileName.fileName);
91569
90693
  const renderedDependencies = [...this.getRenderedDependencies().values()];
91570
- const renderedExports = exportMode === "none" ? [] : this.getChunkExportDeclarations(format2);
90694
+ const renderedExports = exportMode === "none" ? [] : this.getChunkExportDeclarations(format3);
91571
90695
  let hasExports = renderedExports.length > 0;
91572
90696
  let hasDefaultExport = false;
91573
90697
  for (const renderedDependence of renderedDependencies) {
@@ -91577,7 +90701,7 @@ ${outro}`;
91577
90701
  if (!hasDefaultExport && reexports.some((reexport) => reexport.reexported === "default")) {
91578
90702
  hasDefaultExport = true;
91579
90703
  }
91580
- if (format2 === "es") {
90704
+ if (format3 === "es") {
91581
90705
  renderedDependence.reexports = reexports.filter(
91582
90706
  // eslint-disable-next-line unicorn/prefer-array-some
91583
90707
  ({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported)
@@ -91594,7 +90718,7 @@ ${outro}`;
91594
90718
  }
91595
90719
  }
91596
90720
  const { intro, outro, banner, footer } = await createAddons(outputOptions, pluginDriver, this.getRenderedChunkInfo());
91597
- finalisers[format2](renderedSource, {
90721
+ finalisers[format3](renderedSource, {
91598
90722
  accessedGlobals,
91599
90723
  dependencies: renderedDependencies,
91600
90724
  exports: renderedExports,
@@ -91613,7 +90737,7 @@ ${outro}`;
91613
90737
  }, outputOptions);
91614
90738
  if (banner)
91615
90739
  magicString.prepend(banner);
91616
- if (format2 === "es" || format2 === "cjs") {
90740
+ if (format3 === "es" || format3 === "cjs") {
91617
90741
  const shebang = facadeModule !== null && facadeModule.info.isEntry && facadeModule.shebang;
91618
90742
  shebang && magicString.prepend(`#!${shebang}
91619
90743
  `);
@@ -91712,7 +90836,7 @@ ${outro}`;
91712
90836
  }
91713
90837
  return "chunk";
91714
90838
  }
91715
- getChunkExportDeclarations(format2) {
90839
+ getChunkExportDeclarations(format3) {
91716
90840
  const exports2 = [];
91717
90841
  for (const exportName of this.getExportNames()) {
91718
90842
  if (exportName[0] === "*")
@@ -91723,7 +90847,7 @@ ${outro}`;
91723
90847
  if (module3) {
91724
90848
  const chunk = this.chunkByModule.get(module3);
91725
90849
  if (chunk !== this) {
91726
- if (!chunk || format2 !== "es") {
90850
+ if (!chunk || format3 !== "es") {
91727
90851
  continue;
91728
90852
  }
91729
90853
  const chunkDep = this.renderedDependencies.get(chunk);
@@ -91751,7 +90875,7 @@ ${outro}`;
91751
90875
  }
91752
90876
  } else if (variable instanceof SyntheticNamedExportVariable) {
91753
90877
  expression = local;
91754
- if (format2 === "es") {
90878
+ if (format3 === "es") {
91755
90879
  local = variable.renderName;
91756
90880
  }
91757
90881
  }
@@ -92003,7 +91127,7 @@ ${outro}`;
92003
91127
  // This method changes properties on the AST before rendering and must not be async
92004
91128
  renderModules(fileName) {
92005
91129
  const { accessedGlobalsByScope, dependencies, exportNamesByVariable, includedNamespaces, inputOptions: { onLog }, isEmpty, orderedModules, outputOptions, pluginDriver, renderedModules, snippets } = this;
92006
- const { compact, format: format2, freeze, generatedCode: { symbols } } = outputOptions;
91130
+ const { compact, format: format3, freeze, generatedCode: { symbols } } = outputOptions;
92007
91131
  const { _, cnst, n: n2 } = snippets;
92008
91132
  this.setDynamicImportResolutions(fileName);
92009
91133
  this.setImportMetaResolutions(fileName);
@@ -92017,7 +91141,7 @@ ${outro}`;
92017
91141
  const renderOptions = {
92018
91142
  accessedDocumentCurrentScript: false,
92019
91143
  exportNamesByVariable,
92020
- format: format2,
91144
+ format: format3,
92021
91145
  freeze,
92022
91146
  indent,
92023
91147
  pluginDriver,
@@ -92031,7 +91155,7 @@ ${outro}`;
92031
91155
  let source;
92032
91156
  if (module3.isIncluded() || includedNamespaces.has(module3)) {
92033
91157
  const rendered = module3.render(renderOptions);
92034
- if (!renderOptions.accessedDocumentCurrentScript && formatsMaybeAccessDocumentCurrentScript.includes(format2)) {
91158
+ if (!renderOptions.accessedDocumentCurrentScript && formatsMaybeAccessDocumentCurrentScript.includes(format3)) {
92035
91159
  this.accessedGlobalsByScope.get(module3.scope)?.delete(DOCUMENT_CURRENT_SCRIPT);
92036
91160
  }
92037
91161
  renderOptions.accessedDocumentCurrentScript = false;
@@ -92100,11 +91224,11 @@ ${outro}`;
92100
91224
  }
92101
91225
  }
92102
91226
  setIdentifierRenderResolutions() {
92103
- const { format: format2, generatedCode: { symbols }, interop, preserveModules, externalLiveBindings } = this.outputOptions;
91227
+ const { format: format3, generatedCode: { symbols }, interop, preserveModules, externalLiveBindings } = this.outputOptions;
92104
91228
  const syntheticExports = /* @__PURE__ */ new Set();
92105
91229
  for (const exportName of this.getExportNames()) {
92106
91230
  const exportVariable = this.exportsByName.get(exportName);
92107
- if (format2 !== "es" && format2 !== "system" && exportVariable.isReassigned && !exportVariable.isId) {
91231
+ if (format3 !== "es" && format3 !== "system" && exportVariable.isReassigned && !exportVariable.isId) {
92108
91232
  exportVariable.setRenderNames("exports", exportName);
92109
91233
  } else if (exportVariable instanceof SyntheticNamedExportVariable) {
92110
91234
  syntheticExports.add(exportVariable);
@@ -92125,7 +91249,7 @@ ${outro}`;
92125
91249
  if (symbols) {
92126
91250
  usedNames.add("Symbol");
92127
91251
  }
92128
- switch (format2) {
91252
+ switch (format3) {
92129
91253
  case "system": {
92130
91254
  usedNames.add("module").add("exports");
92131
91255
  break;
@@ -92143,13 +91267,13 @@ ${outro}`;
92143
91267
  }
92144
91268
  }
92145
91269
  }
92146
- 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);
91270
+ 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);
92147
91271
  }
92148
91272
  setImportMetaResolutions(fileName) {
92149
- const { accessedGlobalsByScope, includedNamespaces, orderedModules, outputOptions: { format: format2 } } = this;
91273
+ const { accessedGlobalsByScope, includedNamespaces, orderedModules, outputOptions: { format: format3 } } = this;
92150
91274
  for (const module3 of orderedModules) {
92151
91275
  for (const importMeta of module3.importMetas) {
92152
- importMeta.setResolution(format2, accessedGlobalsByScope, fileName);
91276
+ importMeta.setResolution(format3, accessedGlobalsByScope, fileName);
92153
91277
  }
92154
91278
  if (includedNamespaces.has(module3)) {
92155
91279
  module3.namespace.prepare(accessedGlobalsByScope);
@@ -94216,7 +93340,7 @@ ${outro}`;
94216
93340
  async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
94217
93341
  const unsetOptions = new Set(unsetInputOptions);
94218
93342
  const compact = config.compact || false;
94219
- const format2 = getFormat(config);
93343
+ const format3 = getFormat(config);
94220
93344
  const inlineDynamicImports = getInlineDynamicImports(config, inputOptions);
94221
93345
  const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions);
94222
93346
  const file = getFile(config, preserveModules, inputOptions);
@@ -94240,7 +93364,7 @@ ${outro}`;
94240
93364
  externalLiveBindings: config.externalLiveBindings ?? true,
94241
93365
  file,
94242
93366
  footer: getAddon(config, "footer"),
94243
- format: format2,
93367
+ format: format3,
94244
93368
  freeze: config.freeze ?? true,
94245
93369
  generatedCode,
94246
93370
  globals: config.globals || {},
@@ -94250,7 +93374,7 @@ ${outro}`;
94250
93374
  interop: getInterop(config),
94251
93375
  intro: getAddon(config, "intro"),
94252
93376
  manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules),
94253
- minifyInternalExports: getMinifyInternalExports(config, format2, compact),
93377
+ minifyInternalExports: getMinifyInternalExports(config, format3, compact),
94254
93378
  name: config.name,
94255
93379
  noConflict: config.noConflict || false,
94256
93380
  outro: getAddon(config, "outro"),
@@ -94457,7 +93581,7 @@ ${outro}`;
94457
93581
  }
94458
93582
  return configManualChunks || {};
94459
93583
  };
94460
- var getMinifyInternalExports = (config, format2, compact) => config.minifyInternalExports ?? (compact || format2 === "es" || format2 === "system");
93584
+ var getMinifyInternalExports = (config, format3, compact) => config.minifyInternalExports ?? (compact || format3 === "es" || format3 === "system");
94461
93585
  var getSourcemapFileNames = (config, unsetOptions) => {
94462
93586
  const configSourcemapFileNames = config.sourcemapFileNames;
94463
93587
  if (configSourcemapFileNames == null) {
@@ -95619,7 +94743,7 @@ var require_shared = __commonJS({
95619
94743
  let padded = zeros(startString) || zeros(endString) || zeros(stepString);
95620
94744
  let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
95621
94745
  let toNumber = padded === false && stringify$3(start, end, options) === false;
95622
- let format2 = options.transform || transform(toNumber);
94746
+ let format3 = options.transform || transform(toNumber);
95623
94747
  if (options.toRegex && step === 1) {
95624
94748
  return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
95625
94749
  }
@@ -95631,7 +94755,7 @@ var require_shared = __commonJS({
95631
94755
  if (options.toRegex === true && step > 1) {
95632
94756
  push(a);
95633
94757
  } else {
95634
- range.push(pad(format2(a, index), maxLen, toNumber));
94758
+ range.push(pad(format3(a, index), maxLen, toNumber));
95635
94759
  }
95636
94760
  a = descending ? a - step : a + step;
95637
94761
  index++;
@@ -95645,7 +94769,7 @@ var require_shared = __commonJS({
95645
94769
  if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
95646
94770
  return invalidRange(start, end, options);
95647
94771
  }
95648
- let format2 = options.transform || ((val) => String.fromCharCode(val));
94772
+ let format3 = options.transform || ((val) => String.fromCharCode(val));
95649
94773
  let a = `${start}`.charCodeAt(0);
95650
94774
  let b = `${end}`.charCodeAt(0);
95651
94775
  let descending = a > b;
@@ -95657,7 +94781,7 @@ var require_shared = __commonJS({
95657
94781
  let range = [];
95658
94782
  let index = 0;
95659
94783
  while (descending ? a >= b : a <= b) {
95660
- range.push(format2(a, index));
94784
+ range.push(format3(a, index));
95661
94785
  a = descending ? a - step : a + step;
95662
94786
  index++;
95663
94787
  }
@@ -102657,10 +101781,10 @@ var require_dist6 = __commonJS({
102657
101781
  }
102658
101782
  };
102659
101783
  };
102660
- var getOutputExtensionMap = (options, format2, pkgType) => {
101784
+ var getOutputExtensionMap = (options, format3, pkgType) => {
102661
101785
  const outExtension2 = options.outExtension || _chunkGQ77QZBOjs.defaultOutExtension;
102662
- const defaultExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format: format2, pkgType });
102663
- const extension = outExtension2({ options, format: format2, pkgType });
101786
+ const defaultExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format: format3, pkgType });
101787
+ const extension = outExtension2({ options, format: format3, pkgType });
102664
101788
  return {
102665
101789
  ".js": extension.js || defaultExtension.js
102666
101790
  };
@@ -102679,9 +101803,9 @@ var require_dist6 = __commonJS({
102679
101803
  }
102680
101804
  return result;
102681
101805
  };
102682
- var packageJsonSearch = (outDir, silent, format2, logger3) => {
101806
+ var packageJsonSearch = (outDir, silent, format3, logger3) => {
102683
101807
  let pkgPath = outDir ? outDir : process.cwd();
102684
- !silent && logger3 && logger3.info(format2, `\u26A1 Beginning search for package.json file: ${pkgPath}`);
101808
+ !silent && logger3 && logger3.info(format3, `\u26A1 Beginning search for package.json file: ${pkgPath}`);
102685
101809
  if (pkgPath) {
102686
101810
  const splits = pkgPath.includes("\\") ? pkgPath.split("\\") : pkgPath.split("/");
102687
101811
  if (splits.length > 0) {
@@ -102694,12 +101818,12 @@ var require_dist6 = __commonJS({
102694
101818
  "package.json"
102695
101819
  );
102696
101820
  !silent && logger3 && logger3.info(
102697
- format2,
101821
+ format3,
102698
101822
  `\u26A1 Searching for package.json file in ${packageJsonPath} (index: ${i})`
102699
101823
  );
102700
101824
  if (_fs2.default.existsSync(packageJsonPath)) {
102701
101825
  !silent && logger3 && logger3.info(
102702
- format2,
101826
+ format3,
102703
101827
  `\u26A1 Found the package.json file in ${packageJsonPath} (index: ${i})`
102704
101828
  );
102705
101829
  pkgPath = packageJsonPath.replace("package.json", "");
@@ -102710,21 +101834,21 @@ var require_dist6 = __commonJS({
102710
101834
  }
102711
101835
  if (pkgPath === outDir) {
102712
101836
  !silent && logger3 && logger3.info(
102713
- format2,
101837
+ format3,
102714
101838
  `\u26A1 No package.json file found, using ${pkgPath} as the output directory`
102715
101839
  );
102716
101840
  }
102717
101841
  return pkgPath;
102718
101842
  };
102719
101843
  async function runEsbuild(options, {
102720
- format: format2,
101844
+ format: format3,
102721
101845
  css,
102722
101846
  logger: logger3,
102723
101847
  buildDependencies,
102724
101848
  pluginContainer
102725
101849
  }) {
102726
- const pkgPath = packageJsonSearch(options.outDir, options.silent, format2, logger3);
102727
- logger3.info(format2, `\u26A1 Running ESBuild: ${pkgPath}`);
101850
+ const pkgPath = packageJsonSearch(options.outDir, options.silent, format3, logger3);
101851
+ logger3.info(format3, `\u26A1 Running ESBuild: ${pkgPath}`);
102728
101852
  const pkg = await _chunk7G76EW2Rjs.loadPkg.call(void 0, pkgPath);
102729
101853
  const deps = await _chunk7G76EW2Rjs.getProductionDeps.call(void 0, pkgPath);
102730
101854
  const external = [
@@ -102733,41 +101857,41 @@ var require_dist6 = __commonJS({
102733
101857
  ...await generateExternal(options.external || [], options, logger3)
102734
101858
  ];
102735
101859
  const outDir = options.outDir;
102736
- const outExtension2 = getOutputExtensionMap(options, format2, pkg.type);
101860
+ const outExtension2 = getOutputExtensionMap(options, format3, pkg.type);
102737
101861
  const env = {
102738
101862
  ...options.env
102739
101863
  };
102740
101864
  if (options.replaceNodeEnv) {
102741
101865
  env.NODE_ENV = options.minify || options.minifyWhitespace ? "production" : "development";
102742
101866
  }
102743
- logger3.info(format2, "Build start");
101867
+ logger3.info(format3, "Build start");
102744
101868
  const startTime = Date.now();
102745
101869
  let result;
102746
- const splitting = format2 === "iife" ? false : typeof options.splitting === "boolean" ? options.splitting : format2 === "esm";
101870
+ const splitting = format3 === "iife" ? false : typeof options.splitting === "boolean" ? options.splitting : format3 === "esm";
102747
101871
  const platform = options.platform || "node";
102748
101872
  const loader = options.loader || {};
102749
101873
  const injectShims = options.shims;
102750
101874
  pluginContainer.setContext({
102751
- format: format2,
101875
+ format: format3,
102752
101876
  splitting,
102753
101877
  options,
102754
101878
  logger: logger3
102755
101879
  });
102756
101880
  await pluginContainer.buildStarted();
102757
101881
  const esbuildPlugins = [
102758
- format2 === "cjs" && nodeProtocolPlugin(),
101882
+ format3 === "cjs" && nodeProtocolPlugin(),
102759
101883
  {
102760
101884
  name: "modify-options",
102761
101885
  setup(build22) {
102762
101886
  pluginContainer.modifyEsbuildOptions(build22.initialOptions);
102763
101887
  if (options.esbuildOptions) {
102764
- options.esbuildOptions(build22.initialOptions, { format: format2 });
101888
+ options.esbuildOptions(build22.initialOptions, { format: format3 });
102765
101889
  }
102766
101890
  }
102767
101891
  },
102768
101892
  // esbuild's `external` option doesn't support RegExp
102769
101893
  // So here we use a custom plugin to implement it
102770
- format2 !== "iife" && externalPlugin({
101894
+ format3 !== "iife" && externalPlugin({
102771
101895
  external,
102772
101896
  noExternal: options.noExternal,
102773
101897
  skipNodeModulesBundle: options.skipNodeModulesBundle,
@@ -102785,12 +101909,12 @@ var require_dist6 = __commonJS({
102785
101909
  if (options.skipNativeModulesPlugin !== true) {
102786
101910
  esbuildPlugins.push(nativeNodeModulesPlugin());
102787
101911
  }
102788
- const banner = typeof options.banner === "function" ? options.banner({ format: format2 }) : options.banner;
102789
- const footer = typeof options.footer === "function" ? options.footer({ format: format2 }) : options.footer;
101912
+ const banner = typeof options.banner === "function" ? options.banner({ format: format3 }) : options.banner;
101913
+ const footer = typeof options.footer === "function" ? options.footer({ format: format3 }) : options.footer;
102790
101914
  try {
102791
101915
  result = await _esbuild.build.call(void 0, {
102792
101916
  entryPoints: options.entry,
102793
- format: format2 === "cjs" && splitting || options.treeshake ? "esm" : format2,
101917
+ format: format3 === "cjs" && splitting || options.treeshake ? "esm" : format3,
102794
101918
  bundle: typeof options.bundle === "undefined" ? true : options.bundle,
102795
101919
  platform,
102796
101920
  globalName: options.globalName,
@@ -102829,8 +101953,8 @@ var require_dist6 = __commonJS({
102829
101953
  mainFields: platform === "node" ? ["module", "main"] : ["browser", "module", "main"],
102830
101954
  plugins: esbuildPlugins.filter(_chunkGQ77QZBOjs.truthy),
102831
101955
  define: {
102832
- TSUP_FORMAT: JSON.stringify(format2),
102833
- ...format2 === "cjs" && injectShims ? {
101956
+ TSUP_FORMAT: JSON.stringify(format3),
101957
+ ...format3 === "cjs" && injectShims ? {
102834
101958
  "import.meta.url": "importMetaUrl"
102835
101959
  } : {},
102836
101960
  ...options.define,
@@ -102844,11 +101968,11 @@ var require_dist6 = __commonJS({
102844
101968
  }, {})
102845
101969
  },
102846
101970
  inject: [
102847
- format2 === "cjs" && injectShims ? _path2.default.join(__dirname, "../../../assets/cjs_shims.js") : "",
102848
- format2 === "esm" && injectShims && platform === "node" ? _path2.default.join(__dirname, "../../../assets/esm_shims.js") : "",
101971
+ format3 === "cjs" && injectShims ? _path2.default.join(__dirname, "../../../assets/cjs_shims.js") : "",
101972
+ format3 === "esm" && injectShims && platform === "node" ? _path2.default.join(__dirname, "../../../assets/esm_shims.js") : "",
102849
101973
  ...options.inject || []
102850
101974
  ].filter(Boolean),
102851
- outdir: options.legacyOutput && format2 !== "cjs" ? _path2.default.join(outDir, format2) : outDir,
101975
+ outdir: options.legacyOutput && format3 !== "cjs" ? _path2.default.join(outDir, format3) : outDir,
102852
101976
  outExtension: options.legacyOutput ? void 0 : outExtension2,
102853
101977
  write: false,
102854
101978
  splitting,
@@ -102864,7 +101988,7 @@ var require_dist6 = __commonJS({
102864
101988
  });
102865
101989
  await new Promise((r) => setTimeout(r, 100));
102866
101990
  } catch (error) {
102867
- logger3.error(format2, "Build failed");
101991
+ logger3.error(format3, "Build failed");
102868
101992
  throw error;
102869
101993
  }
102870
101994
  if (result && result.warnings && !_chunk7G76EW2Rjs.getSilent.call(void 0)) {
@@ -102889,14 +102013,14 @@ var require_dist6 = __commonJS({
102889
102013
  metafile: result.metafile
102890
102014
  });
102891
102015
  const timeInMs = Date.now() - startTime;
102892
- logger3.success(format2, `\u26A1\uFE0F Build success in ${Math.floor(timeInMs)}ms`);
102016
+ logger3.success(format3, `\u26A1\uFE0F Build success in ${Math.floor(timeInMs)}ms`);
102893
102017
  }
102894
102018
  if (result.metafile) {
102895
102019
  for (const file of Object.keys(result.metafile.inputs)) {
102896
102020
  buildDependencies.add(file);
102897
102021
  }
102898
102022
  if (options.metafile) {
102899
- const outPath = _path2.default.resolve(outDir, `metafile-${format2}.json`);
102023
+ const outPath = _path2.default.resolve(outDir, `metafile-${format3}.json`);
102900
102024
  await _fs2.default.promises.mkdir(_path2.default.dirname(outPath), { recursive: true });
102901
102025
  await _fs2.default.promises.writeFile(
102902
102026
  outPath,
@@ -103229,7 +102353,7 @@ var require_dist6 = __commonJS({
103229
102353
  };
103230
102354
  var terserPlugin = ({
103231
102355
  minifyOptions,
103232
- format: format2,
102356
+ format: format3,
103233
102357
  terserOptions = {},
103234
102358
  globalName,
103235
102359
  logger: logger3
@@ -103247,9 +102371,9 @@ var require_dist6 = __commonJS({
103247
102371
  }
103248
102372
  const { minify } = terser;
103249
102373
  const defaultOptions = {};
103250
- if (format2 === "esm") {
102374
+ if (format3 === "esm") {
103251
102375
  defaultOptions.module = true;
103252
- } else if (!(format2 === "iife" && globalName !== void 0)) {
102376
+ } else if (!(format3 === "iife" && globalName !== void 0)) {
103253
102377
  defaultOptions.toplevel = true;
103254
102378
  }
103255
102379
  try {
@@ -103565,14 +102689,14 @@ var require_dist6 = __commonJS({
103565
102689
  );
103566
102690
  }
103567
102691
  }
103568
- async function rollupDtsFiles(options, exports2, format2) {
102692
+ async function rollupDtsFiles(options, exports2, format3) {
103569
102693
  let declarationDir = _chunkGQ77QZBOjs.ensureTempDeclarationDir.call(void 0, options);
103570
102694
  let outDir = options.outDir || "dist";
103571
102695
  let pkgPath = packageJsonSearch(outDir, options.silent, "dts", logger2);
103572
102696
  !options.silent && logger2.info("dts", `\u26A1 Preparing to run Rollup (DTS generate): ${pkgPath}`);
103573
102697
  !options.silent && logger2.info("dts", `\u26A1 Exports list to use in generation: ${exports2.map((e) => JSON.stringify(e)).join("\n")}`);
103574
102698
  let pkg = await _chunk7G76EW2Rjs.loadPkg.call(void 0, pkgPath);
103575
- let dtsExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format: format2, pkgType: pkg.type }).dts;
102699
+ let dtsExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format: format3, pkgType: pkg.type }).dts;
103576
102700
  let dtsInputFilePath = _path2.default.join(
103577
102701
  declarationDir,
103578
102702
  "_tsup-dts-aggregation" + dtsExtension
@@ -103600,8 +102724,8 @@ var require_dist6 = __commonJS({
103600
102724
  if (!exports2) {
103601
102725
  throw new Error("Unexpected internal error: dts exports is not define");
103602
102726
  }
103603
- for (const format2 of options.format) {
103604
- await rollupDtsFiles(options, exports2, format2);
102727
+ for (const format3 of options.format) {
102728
+ await rollupDtsFiles(options, exports2, format3);
103605
102729
  }
103606
102730
  logger2.success("dts", `\u26A1\uFE0F Build success in ${getDuration()}`);
103607
102731
  } catch (error) {
@@ -103815,7 +102939,7 @@ var require_dist6 = __commonJS({
103815
102939
  }
103816
102940
  const css = /* @__PURE__ */ new Map();
103817
102941
  await Promise.all([
103818
- ...options.format.map(async (format2, index) => {
102942
+ ...options.format.map(async (format3, index) => {
103819
102943
  const pluginContainer = new PluginContainer([
103820
102944
  shebang(),
103821
102945
  ...options.plugins || [],
@@ -103830,7 +102954,7 @@ var require_dist6 = __commonJS({
103830
102954
  sizeReporter(),
103831
102955
  terserPlugin({
103832
102956
  minifyOptions: options.minify,
103833
- format: format2,
102957
+ format: format3,
103834
102958
  terserOptions: options.terserOptions,
103835
102959
  globalName: options.globalName,
103836
102960
  logger: logger3
@@ -103838,7 +102962,7 @@ var require_dist6 = __commonJS({
103838
102962
  ]);
103839
102963
  await runEsbuild(options, {
103840
102964
  pluginContainer,
103841
- format: format2,
102965
+ format: format3,
103842
102966
  css: index === 0 || options.injectStyle ? css : void 0,
103843
102967
  logger: logger3,
103844
102968
  buildDependencies
@@ -103935,19 +103059,13 @@ var require_dist6 = __commonJS({
103935
103059
  // packages/workspace-tools/src/executors/tsup/executor.ts
103936
103060
  var executor_exports = {};
103937
103061
  __export(executor_exports, {
103938
- applyDefaultOptions: () => applyDefaultOptions,
103939
103062
  default: () => executor_default,
103940
103063
  tsupExecutorFn: () => tsupExecutorFn
103941
103064
  });
103942
103065
  module.exports = __toCommonJS(executor_exports);
103943
- var import_node_fs5 = require("node:fs");
103944
- var import_promises3 = require("node:fs/promises");
103945
- var import_node_path5 = require("node:path");
103946
- var import_esbuild_decorators = __toESM(require_src());
103947
- var import_devkit2 = __toESM(require_devkit());
103948
- var import_js = __toESM(require_src2());
103949
- var import_normalize_options = __toESM(require_normalize_options());
103950
- var import_tsc = __toESM(require_tsc_impl());
103066
+ var import_node_fs6 = require("node:fs");
103067
+ var import_devkit3 = __toESM(require_devkit());
103068
+ var import_js = __toESM(require_src());
103951
103069
 
103952
103070
  // packages/config-tools/src/config-file/get-config-file.ts
103953
103071
  var import_cosmiconfig = __toESM(require_dist(), 1);
@@ -107888,7 +107006,7 @@ ${chalk.bold.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(">")} ${
107888
107006
  return (message) => {
107889
107007
  console.info(
107890
107008
  `
107891
- ${chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")(">")} ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").white(" \u221A Success ")} ${chalk.hex(
107009
+ ${chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")(">")} ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").white(" \u2713 Success ")} ${chalk.hex(
107892
107010
  config?.colors?.success ? config.colors.success : "#087f5b"
107893
107011
  )(message)}
107894
107012
  `
@@ -107899,7 +107017,7 @@ ${chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")(">
107899
107017
  return (message) => {
107900
107018
  console.debug(
107901
107019
  `
107902
- ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" ! Debug ")} ${chalk.hex(
107020
+ ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F6E0} Debug ")} ${chalk.hex(
107903
107021
  config?.colors?.primary ? config.colors.primary : "#1fb2a6"
107904
107022
  )(message)}
107905
107023
  `
@@ -107909,7 +107027,7 @@ ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">
107909
107027
  return (message) => {
107910
107028
  console.log(
107911
107029
  `
107912
- ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" ! System ")} ${chalk.hex(
107030
+ ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u2709 System ")} ${chalk.hex(
107913
107031
  config?.colors?.primary ? config.colors.primary : "#1fb2a6"
107914
107032
  )(message)}
107915
107033
  `
@@ -107929,9 +107047,12 @@ var getStopwatch = (name) => {
107929
107047
  const end = process.hrtime(start);
107930
107048
  console.info(
107931
107049
  chalk.dim(
107932
- `\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
107050
+ `
107051
+ \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
107933
107052
  end[0] * 1e3 + end[1] / 1e6
107934
- )}ms to complete`
107053
+ )}ms to complete
107054
+
107055
+ `
107935
107056
  )
107936
107057
  );
107937
107058
  };
@@ -109725,47 +108846,6 @@ var loadStormConfig = async (workspaceRoot) => {
109725
108846
  return config;
109726
108847
  };
109727
108848
 
109728
- // node_modules/.pnpm/esbuild-plugin-define@0.4.0_esbuild@0.19.5/node_modules/esbuild-plugin-define/dist/mjs/utils.js
109729
- var makeKey = (...inputs) => inputs.filter((input) => !!input).join(".");
109730
- function convertToDefineObject(data) {
109731
- const convertToEntries = (data2, prefix = "") => {
109732
- return Object.entries(data2).reduce((entries, [key, value]) => {
109733
- const newKey = makeKey(prefix, key);
109734
- if (value && typeof value === "object" && !Array.isArray(value)) {
109735
- entries.push(...convertToEntries(value, newKey));
109736
- } else {
109737
- entries.push([newKey, JSON.stringify(value) ?? String(void 0)]);
109738
- }
109739
- return entries;
109740
- }, []);
109741
- };
109742
- return Object.fromEntries(convertToEntries(data));
109743
- }
109744
-
109745
- // node_modules/.pnpm/esbuild-plugin-define@0.4.0_esbuild@0.19.5/node_modules/esbuild-plugin-define/dist/mjs/plugin.js
109746
- var PLUGIN_NAME = "define-plugin";
109747
- var definePlugin = (data) => {
109748
- return {
109749
- name: PLUGIN_NAME,
109750
- setup(build2) {
109751
- Object.assign(build2.initialOptions.define ??= {}, convertToDefineObject(data));
109752
- }
109753
- };
109754
- };
109755
-
109756
- // node_modules/.pnpm/esbuild-plugin-environment@0.3.0_esbuild@0.19.5/node_modules/esbuild-plugin-environment/dist/mjs/plugin.js
109757
- var PLUGIN_NAME2 = "environment-plugin";
109758
- var environmentPlugin = (data) => ({
109759
- name: PLUGIN_NAME2,
109760
- async setup(build2) {
109761
- const entries = Array.isArray(data) ? data.map((key) => [key, ""]) : Object.entries(data);
109762
- const env = Object.fromEntries(entries.map(([key, defaultValue]) => {
109763
- return [key, String(process.env[key] ?? defaultValue)];
109764
- }));
109765
- await definePlugin({ process: { env } }).setup(build2);
109766
- }
109767
- });
109768
-
109769
108849
  // packages/workspace-tools/src/executors/tsup/executor.ts
109770
108850
  var import_fs_extra = __toESM(require_lib());
109771
108851
 
@@ -115945,9 +115025,7 @@ glob.glob = glob;
115945
115025
 
115946
115026
  // packages/workspace-tools/src/executors/tsup/executor.ts
115947
115027
  var import_fileutils = require("nx/src/utils/fileutils");
115948
- var import_prettier = require("prettier");
115949
- var import_tsup = __toESM(require_dist6());
115950
- var ts = __toESM(require("typescript"));
115028
+ var import_prettier2 = require("prettier");
115951
115029
 
115952
115030
  // packages/workspace-tools/src/utils/get-workspace-root.ts
115953
115031
  var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
@@ -116121,6 +115199,83 @@ ${Object.keys(options).map((key) => ` - ${key}=${JSON.stringify(options[key])}`)
116121
115199
  }
116122
115200
  };
116123
115201
 
115202
+ // packages/workspace-tools/src/utils/file-path-utils.ts
115203
+ var removeExtension = (filePath) => {
115204
+ return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
115205
+ };
115206
+
115207
+ // packages/workspace-tools/src/utils/get-project-configurations.ts
115208
+ var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
115209
+ var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(getWorkspaceRoot());
115210
+
115211
+ // packages/workspace-tools/src/utils/get-project-deps.ts
115212
+ function getExternalDependencies(projectName, graph) {
115213
+ const allDeps = graph.dependencies[projectName];
115214
+ return Array.from(
115215
+ allDeps.reduce((acc, node) => {
115216
+ const found = graph.externalNodes[node.target];
115217
+ if (found)
115218
+ acc.push(found);
115219
+ return acc;
115220
+ }, [])
115221
+ );
115222
+ }
115223
+
115224
+ // packages/workspace-tools/src/utils/run-tsup-build.ts
115225
+ var import_node_fs5 = require("node:fs");
115226
+ var import_promises3 = require("node:fs/promises");
115227
+ var import_node_path5 = require("node:path");
115228
+ var import_esbuild_decorators = __toESM(require_src2());
115229
+ var import_devkit2 = __toESM(require_devkit());
115230
+ var import_get_custom_transformers_factory = __toESM(require_get_custom_transformers_factory());
115231
+ var import_normalize_options = __toESM(require_normalize_options());
115232
+
115233
+ // node_modules/.pnpm/esbuild-plugin-define@0.4.0_esbuild@0.19.5/node_modules/esbuild-plugin-define/dist/mjs/utils.js
115234
+ var makeKey = (...inputs) => inputs.filter((input) => !!input).join(".");
115235
+ function convertToDefineObject(data) {
115236
+ const convertToEntries = (data2, prefix = "") => {
115237
+ return Object.entries(data2).reduce((entries, [key, value]) => {
115238
+ const newKey = makeKey(prefix, key);
115239
+ if (value && typeof value === "object" && !Array.isArray(value)) {
115240
+ entries.push(...convertToEntries(value, newKey));
115241
+ } else {
115242
+ entries.push([newKey, JSON.stringify(value) ?? String(void 0)]);
115243
+ }
115244
+ return entries;
115245
+ }, []);
115246
+ };
115247
+ return Object.fromEntries(convertToEntries(data));
115248
+ }
115249
+
115250
+ // node_modules/.pnpm/esbuild-plugin-define@0.4.0_esbuild@0.19.5/node_modules/esbuild-plugin-define/dist/mjs/plugin.js
115251
+ var PLUGIN_NAME = "define-plugin";
115252
+ var definePlugin = (data) => {
115253
+ return {
115254
+ name: PLUGIN_NAME,
115255
+ setup(build2) {
115256
+ Object.assign(build2.initialOptions.define ??= {}, convertToDefineObject(data));
115257
+ }
115258
+ };
115259
+ };
115260
+
115261
+ // node_modules/.pnpm/esbuild-plugin-environment@0.3.0_esbuild@0.19.5/node_modules/esbuild-plugin-environment/dist/mjs/plugin.js
115262
+ var PLUGIN_NAME2 = "environment-plugin";
115263
+ var environmentPlugin = (data) => ({
115264
+ name: PLUGIN_NAME2,
115265
+ async setup(build2) {
115266
+ const entries = Array.isArray(data) ? data.map((key) => [key, ""]) : Object.entries(data);
115267
+ const env = Object.fromEntries(entries.map(([key, defaultValue]) => {
115268
+ return [key, String(process.env[key] ?? defaultValue)];
115269
+ }));
115270
+ await definePlugin({ process: { env } }).setup(build2);
115271
+ }
115272
+ });
115273
+
115274
+ // packages/workspace-tools/src/utils/run-tsup-build.ts
115275
+ var import_prettier = require("prettier");
115276
+ var import_tsup = __toESM(require_dist6());
115277
+ var ts = __toESM(require("typescript"));
115278
+
116124
115279
  // packages/workspace-tools/src/base/get-tsup-config.ts
116125
115280
  var import_devkit = __toESM(require_devkit());
116126
115281
  function defaultConfig({
@@ -116131,7 +115286,7 @@ function defaultConfig({
116131
115286
  tsconfig = "tsconfig.json",
116132
115287
  splitting,
116133
115288
  treeshake,
116134
- format: format2 = ["cjs", "esm"],
115289
+ format: format3 = ["cjs", "esm"],
116135
115290
  debug = false,
116136
115291
  shims = true,
116137
115292
  external,
@@ -116154,7 +115309,7 @@ function defaultConfig({
116154
115309
  return {
116155
115310
  name: "default",
116156
115311
  entry,
116157
- format: format2,
115312
+ format: format3,
116158
115313
  target: platform !== "node" ? ["chrome91", "firefox90", "edge91", "safari15", "ios15", "opera77", "esnext"] : ["esnext", "node20"],
116159
115314
  tsconfig,
116160
115315
  splitting,
@@ -116208,18 +115363,18 @@ function getConfig(workspaceRoot, projectRoot, getConfigFn, { outputPath, tsConf
116208
115363
  platform
116209
115364
  });
116210
115365
  }
116211
- var outExtension = ({ format: format2 }) => {
115366
+ var outExtension = ({ format: format3 }) => {
116212
115367
  let jsExtension = ".js";
116213
115368
  let dtsExtension = ".d.ts";
116214
- if (format2 === "cjs") {
115369
+ if (format3 === "cjs") {
116215
115370
  jsExtension = ".cjs";
116216
115371
  dtsExtension = ".d.cts";
116217
115372
  }
116218
- if (format2 === "esm") {
115373
+ if (format3 === "esm") {
116219
115374
  jsExtension = ".js";
116220
115375
  dtsExtension = ".d.ts";
116221
115376
  }
116222
- if (format2 === "iife") {
115377
+ if (format3 === "iife") {
116223
115378
  jsExtension = ".global.js";
116224
115379
  }
116225
115380
  return {
@@ -116228,27 +115383,209 @@ var outExtension = ({ format: format2 }) => {
116228
115383
  };
116229
115384
  };
116230
115385
 
116231
- // packages/workspace-tools/src/utils/file-path-utils.ts
116232
- var removeExtension = (filePath) => {
116233
- return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
115386
+ // packages/workspace-tools/src/utils/run-tsup-build.ts
115387
+ var applyDefaultOptions = (options) => {
115388
+ options.entry ??= "{sourceRoot}/index.ts";
115389
+ options.outputPath ??= "dist/{projectRoot}";
115390
+ options.tsConfig ??= "tsconfig.json";
115391
+ options.generatePackageJson ??= true;
115392
+ options.splitting ??= true;
115393
+ options.treeshake ??= true;
115394
+ options.platform ??= "neutral";
115395
+ options.format ??= ["cjs", "esm"];
115396
+ options.verbose ??= false;
115397
+ options.external ??= [];
115398
+ options.additionalEntryPoints ??= [];
115399
+ options.assets ??= [];
115400
+ options.plugins ??= [];
115401
+ options.includeSrc ??= false;
115402
+ options.minify ??= false;
115403
+ options.clean ??= true;
115404
+ options.bundle ??= true;
115405
+ options.debug ??= false;
115406
+ options.watch ??= false;
115407
+ options.apiReport ??= true;
115408
+ options.docModel ??= true;
115409
+ options.tsdocMetadata ??= true;
115410
+ options.emitOnAll ??= false;
115411
+ options.metafile ??= true;
115412
+ options.skipNativeModulesPlugin ??= false;
115413
+ options.define ??= {};
115414
+ options.env ??= {};
115415
+ options.getConfig ??= { dist: defaultConfig };
115416
+ return options;
116234
115417
  };
115418
+ var runTsupBuild = async (context, config, options) => {
115419
+ if (options.includeSrc === true) {
115420
+ const files = globSync([
115421
+ (0, import_devkit2.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.ts"),
115422
+ (0, import_devkit2.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.tsx"),
115423
+ (0, import_devkit2.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.js"),
115424
+ (0, import_devkit2.joinPathFragments)(config.workspaceRoot, options.outputPath, "src/**/*.jsx")
115425
+ ]);
115426
+ await Promise.allSettled(
115427
+ files.map(
115428
+ async (file) => (0, import_promises3.writeFile)(
115429
+ file,
115430
+ await (0, import_prettier.format)(
115431
+ `${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
116235
115432
 
116236
- // packages/workspace-tools/src/utils/get-project-configurations.ts
116237
- var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
116238
- var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(getWorkspaceRoot());
115433
+ ${(0, import_node_fs5.readFileSync)(file, "utf-8")}`,
115434
+ {
115435
+ ...{
115436
+ plugins: ["prettier-plugin-packagejson"],
115437
+ trailingComma: "none",
115438
+ tabWidth: 2,
115439
+ semi: true,
115440
+ singleQuote: false,
115441
+ quoteProps: "preserve",
115442
+ insertPragma: false,
115443
+ bracketSameLine: true,
115444
+ printWidth: 80,
115445
+ bracketSpacing: true,
115446
+ arrowParens: "avoid",
115447
+ endOfLine: "lf"
115448
+ },
115449
+ parser: "typescript"
115450
+ }
115451
+ ),
115452
+ "utf-8"
115453
+ )
115454
+ )
115455
+ );
115456
+ }
115457
+ const stormEnv = Object.keys(options.env).filter((key) => key.startsWith("STORM_")).reduce((ret, key) => {
115458
+ ret[key] = options.env[key];
115459
+ return ret;
115460
+ }, {});
115461
+ options.plugins.push(
115462
+ (0, import_esbuild_decorators.esbuildDecorators)({
115463
+ tsconfig: options.tsConfig,
115464
+ cwd: config.workspaceRoot
115465
+ })
115466
+ );
115467
+ options.plugins.push(environmentPlugin(stormEnv));
115468
+ const getConfigOptions = {
115469
+ ...options,
115470
+ define: {
115471
+ __STORM_CONFIG: JSON.stringify(stormEnv)
115472
+ },
115473
+ env: {
115474
+ __STORM_CONFIG: JSON.stringify(stormEnv),
115475
+ ...stormEnv
115476
+ },
115477
+ dtsTsConfig: getNormalizedTsConfig(
115478
+ config.workspaceRoot,
115479
+ options.outputPath,
115480
+ createTypeScriptCompilationOptions(
115481
+ (0, import_normalize_options.normalizeOptions)(
115482
+ {
115483
+ ...options,
115484
+ watch: false,
115485
+ main: options.entry,
115486
+ transformers: []
115487
+ },
115488
+ config.workspaceRoot,
115489
+ context.sourceRoot,
115490
+ config.workspaceRoot
115491
+ ),
115492
+ context.projectName
115493
+ )
115494
+ ),
115495
+ banner: options.banner ? {
115496
+ js: `${options.banner}
116239
115497
 
116240
- // packages/workspace-tools/src/utils/get-project-deps.ts
116241
- function getExternalDependencies(projectName, graph) {
116242
- const allDeps = graph.dependencies[projectName];
116243
- return Array.from(
116244
- allDeps.reduce((acc, node) => {
116245
- const found = graph.externalNodes[node.target];
116246
- if (found)
116247
- acc.push(found);
116248
- return acc;
116249
- }, [])
115498
+ `,
115499
+ css: `/*
115500
+ ${options.banner}
115501
+
115502
+
115503
+
115504
+ */`
115505
+ } : void 0,
115506
+ outputPath: options.outputPath,
115507
+ entry: context.entry
115508
+ };
115509
+ if (options.getConfig) {
115510
+ writeInfo(config, "\u26A1 Running the Build process");
115511
+ const getConfigFns = _isFunction(options.getConfig) ? [options.getConfig] : Object.keys(options.getConfig).map((key) => options.getConfig[key]);
115512
+ const tsupConfig = (0, import_tsup.defineConfig)(
115513
+ getConfigFns.map(
115514
+ (getConfigFn) => getConfig(config.workspaceRoot, context.projectRoot, getConfigFn, getConfigOptions)
115515
+ )
115516
+ );
115517
+ if (_isFunction(tsupConfig)) {
115518
+ await build(await Promise.resolve(tsupConfig({})), config);
115519
+ } else {
115520
+ await build(tsupConfig, config);
115521
+ }
115522
+ } else if (getLogLevel(config?.logLevel) >= LogLevel.WARN) {
115523
+ writeWarning(
115524
+ config,
115525
+ "The Build process did not run because no `getConfig` parameter was provided"
115526
+ );
115527
+ }
115528
+ };
115529
+ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
115530
+ const config = ts.readConfigFile(options.tsConfig, ts.sys.readFile).config;
115531
+ const tsConfig = ts.parseJsonConfigFileContent(
115532
+ {
115533
+ ...config,
115534
+ compilerOptions: {
115535
+ ...config.compilerOptions,
115536
+ outDir: outputPath,
115537
+ rootDir: workspaceRoot,
115538
+ baseUrl: workspaceRoot,
115539
+ allowJs: true,
115540
+ noEmit: false,
115541
+ esModuleInterop: true,
115542
+ downlevelIteration: true,
115543
+ forceConsistentCasingInFileNames: true,
115544
+ emitDeclarationOnly: true,
115545
+ declaration: true,
115546
+ declarationMap: true,
115547
+ declarationDir: (0, import_devkit2.joinPathFragments)(workspaceRoot, "tmp", ".tsup", "declaration")
115548
+ }
115549
+ },
115550
+ ts.sys,
115551
+ (0, import_node_path5.dirname)(options.tsConfig)
116250
115552
  );
115553
+ tsConfig.options.pathsBasePath = workspaceRoot;
115554
+ if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
115555
+ tsConfig.options.tsBuildInfoFile = (0, import_devkit2.joinPathFragments)(outputPath, "tsconfig.tsbuildinfo");
115556
+ }
115557
+ return tsConfig;
116251
115558
  }
115559
+ var build = async (options, config) => {
115560
+ if (Array.isArray(options)) {
115561
+ await Promise.all(options.map((buildOptions) => build(buildOptions, config)));
115562
+ } else {
115563
+ if (getLogLevel(config?.logLevel) >= LogLevel.TRACE && !options.silent) {
115564
+ console.log("\u2699\uFE0F Tsup build config: \n", options, "\n");
115565
+ }
115566
+ await (0, import_tsup.build)(options);
115567
+ await new Promise((r) => setTimeout(r, 100));
115568
+ }
115569
+ };
115570
+ var _isFunction = (value) => {
115571
+ try {
115572
+ return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
115573
+ } catch (e) {
115574
+ return false;
115575
+ }
115576
+ };
115577
+ var createTypeScriptCompilationOptions = (normalizedOptions, projectName) => {
115578
+ return {
115579
+ outputPath: normalizedOptions.outputPath,
115580
+ projectName,
115581
+ projectRoot: normalizedOptions.projectRoot,
115582
+ rootDir: normalizedOptions.rootDir,
115583
+ tsConfig: normalizedOptions.tsConfig,
115584
+ watch: normalizedOptions.watch,
115585
+ deleteOutputPath: normalizedOptions.clean,
115586
+ getCustomTransformers: (0, import_get_custom_transformers_factory.getCustomTrasformersFactory)(normalizedOptions.transformers)
115587
+ };
115588
+ };
116252
115589
 
116253
115590
  // packages/workspace-tools/src/executors/tsup/executor.ts
116254
115591
  async function tsupExecutorFn(options, context, config) {
@@ -116305,9 +115642,9 @@ ${Object.keys(options).map(
116305
115642
  if (!result.success) {
116306
115643
  throw new Error("The Build process failed trying to copy assets");
116307
115644
  }
116308
- const pathToPackageJson = (0, import_devkit2.joinPathFragments)(context.root, projectRoot, "package.json");
116309
- const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit2.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
116310
- const workspacePackageJson = (0, import_devkit2.readJsonFile)((0, import_devkit2.joinPathFragments)(workspaceRoot, "package.json"));
115645
+ const pathToPackageJson = (0, import_devkit3.joinPathFragments)(context.root, projectRoot, "package.json");
115646
+ const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit3.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
115647
+ const workspacePackageJson = (0, import_devkit3.readJsonFile)((0, import_devkit3.joinPathFragments)(workspaceRoot, "package.json"));
116311
115648
  options.external = options.external || [];
116312
115649
  if (workspacePackageJson?.dependencies) {
116313
115650
  options.external = Object.keys(workspacePackageJson?.dependencies).reduce(
@@ -116348,7 +115685,7 @@ ${Object.keys(options).map(
116348
115685
  writeDebug(config, `\u26A1 Adding implicit dependency: ${key}`);
116349
115686
  const projectConfig = projectConfigs[key];
116350
115687
  if (projectConfig?.targets?.build) {
116351
- const projectPackageJson = (0, import_devkit2.readJsonFile)(projectConfig.targets?.build.options.project);
115688
+ const projectPackageJson = (0, import_devkit3.readJsonFile)(projectConfig.targets?.build.options.project);
116352
115689
  if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
116353
115690
  ret.push(projectPackageJson.name);
116354
115691
  internalDependencies.push(projectPackageJson.name);
@@ -116397,7 +115734,7 @@ ${externalDependencies.map((dep) => {
116397
115734
  entryPoints.push(options.entry);
116398
115735
  }
116399
115736
  if (options.emitOnAll === true) {
116400
- entryPoints.push((0, import_devkit2.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
115737
+ entryPoints.push((0, import_devkit3.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
116401
115738
  }
116402
115739
  if (options.additionalEntryPoints) {
116403
115740
  entryPoints.push(...options.additionalEntryPoints);
@@ -116409,26 +115746,26 @@ ${externalDependencies.map((dep) => {
116409
115746
  if (formattedPath.toUpperCase().startsWith("C:")) {
116410
115747
  formattedPath = formattedPath.substring(2);
116411
115748
  }
116412
- let propertyKey = (0, import_devkit2.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
115749
+ let propertyKey = (0, import_devkit3.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
116413
115750
  if (propertyKey) {
116414
115751
  while (propertyKey.startsWith("/")) {
116415
115752
  propertyKey = propertyKey.substring(1);
116416
115753
  }
116417
115754
  writeDebug(
116418
115755
  config,
116419
- `Trying to add entry point ${propertyKey} at "${(0, import_devkit2.joinPathFragments)(
115756
+ `Trying to add entry point ${propertyKey} at "${(0, import_devkit3.joinPathFragments)(
116420
115757
  filePath.path,
116421
115758
  filePath.name
116422
115759
  )}"`
116423
115760
  );
116424
115761
  if (!(propertyKey in ret)) {
116425
- ret[propertyKey] = (0, import_devkit2.joinPathFragments)(filePath.path, filePath.name);
115762
+ ret[propertyKey] = (0, import_devkit3.joinPathFragments)(filePath.path, filePath.name);
116426
115763
  }
116427
115764
  }
116428
115765
  return ret;
116429
115766
  }, {});
116430
115767
  if (options.generatePackageJson !== false) {
116431
- const projectGraph = (0, import_devkit2.readCachedProjectGraph)();
115768
+ const projectGraph = (0, import_devkit3.readCachedProjectGraph)();
116432
115769
  packageJson.dependencies = void 0;
116433
115770
  for (const externalDependency of externalDependencies) {
116434
115771
  const packageConfig = externalDependency.node.data;
@@ -116446,7 +115783,7 @@ ${externalDependencies.map((dep) => {
116446
115783
  packageJson.dependencies[packageName] = "latest";
116447
115784
  }
116448
115785
  }
116449
- const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? ["dist/"] : Object.keys(options.getConfig).map((key) => `${key}/`);
115786
+ const distPaths = !options?.getConfig || _isFunction2(options.getConfig) ? ["dist/"] : Object.keys(options.getConfig).map((key) => `${key}/`);
116450
115787
  packageJson.type = "module";
116451
115788
  if (distPaths.length > 0) {
116452
115789
  packageJson.exports ??= {
@@ -116462,22 +115799,47 @@ ${externalDependencies.map((dep) => {
116462
115799
  default: {
116463
115800
  types: `./${distPaths[0]}index.d.ts`,
116464
115801
  default: `./${distPaths[0]}index.js`
116465
- },
116466
- ...(options.additionalEntryPoints ?? []).map((entryPoint) => ({
116467
- [removeExtension(entryPoint).replace(sourceRoot, "")]: {
116468
- types: (0, import_devkit2.joinPathFragments)(
116469
- `./${distPaths[0]}`,
116470
- `${removeExtension(entryPoint.replace(sourceRoot, ""))}.d.ts`
116471
- ),
116472
- default: (0, import_devkit2.joinPathFragments)(
116473
- `./${distPaths[0]}`,
116474
- `${removeExtension(entryPoint.replace(sourceRoot, ""))}.js`
116475
- )
116476
- }
116477
- }))
115802
+ }
116478
115803
  },
116479
115804
  "./package.json": "./package.json"
116480
115805
  };
115806
+ for (const additionalEntryPoint of options.additionalEntryPoints) {
115807
+ packageJson.exports[`./${(0, import_devkit3.joinPathFragments)(
115808
+ distPaths[0],
115809
+ removeExtension(additionalEntryPoint).replace(sourceRoot, "")
115810
+ )}`] = {
115811
+ import: {
115812
+ types: `./${(0, import_devkit3.joinPathFragments)(
115813
+ distPaths[0],
115814
+ removeExtension(additionalEntryPoint).replace(sourceRoot, "")
115815
+ )}.d.ts`,
115816
+ default: `./${(0, import_devkit3.joinPathFragments)(
115817
+ distPaths[0],
115818
+ removeExtension(additionalEntryPoint).replace(sourceRoot, "")
115819
+ )}.js`
115820
+ },
115821
+ require: {
115822
+ types: `./${(0, import_devkit3.joinPathFragments)(
115823
+ distPaths[0],
115824
+ removeExtension(additionalEntryPoint).replace(sourceRoot, "")
115825
+ )}.d.cts`,
115826
+ default: `./${(0, import_devkit3.joinPathFragments)(
115827
+ distPaths[0],
115828
+ removeExtension(additionalEntryPoint).replace(sourceRoot, "")
115829
+ )}.cjs`
115830
+ },
115831
+ default: {
115832
+ types: `./${(0, import_devkit3.joinPathFragments)(
115833
+ distPaths[0],
115834
+ removeExtension(additionalEntryPoint).replace(sourceRoot, "")
115835
+ )}.d.ts`,
115836
+ default: `./${(0, import_devkit3.joinPathFragments)(
115837
+ distPaths[0],
115838
+ removeExtension(additionalEntryPoint).replace(sourceRoot, "")
115839
+ )}.js`
115840
+ }
115841
+ };
115842
+ }
116481
115843
  packageJson.exports = Object.keys(entry).reduce((ret, key) => {
116482
115844
  let packageJsonKey = key.startsWith("./") ? key : `./${key}`;
116483
115845
  packageJsonKey = packageJsonKey.replaceAll("/index", "");
@@ -116515,7 +115877,7 @@ ${externalDependencies.map((dep) => {
116515
115877
  if (distSrc.startsWith("/")) {
116516
115878
  distSrc = distSrc.substring(1);
116517
115879
  }
116518
- packageJson.source ??= `${(0, import_devkit2.joinPathFragments)(distSrc, "index.ts").replaceAll("\\", "/")}`;
115880
+ packageJson.source ??= `${(0, import_devkit3.joinPathFragments)(distSrc, "index.ts").replaceAll("\\", "/")}`;
116519
115881
  }
116520
115882
  packageJson.sideEffects ??= false;
116521
115883
  packageJson.files ??= ["dist/**/*"];
@@ -116533,12 +115895,12 @@ ${externalDependencies.map((dep) => {
116533
115895
  packageJson.license ??= workspacePackageJson.license;
116534
115896
  packageJson.keywords ??= workspacePackageJson.keywords;
116535
115897
  packageJson.repository ??= workspacePackageJson.repository;
116536
- packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_devkit2.joinPathFragments)("packages", context.projectName);
116537
- const packageJsonPath = (0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "package.json");
115898
+ packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_devkit3.joinPathFragments)("packages", context.projectName);
115899
+ const packageJsonPath = (0, import_devkit3.joinPathFragments)(context.root, options.outputPath, "package.json");
116538
115900
  writeDebug(config, `\u26A1 Writing package.json file to: ${packageJsonPath}`);
116539
- (0, import_node_fs5.writeFileSync)(
115901
+ (0, import_node_fs6.writeFileSync)(
116540
115902
  packageJsonPath,
116541
- await (0, import_prettier.format)(JSON.stringify(packageJson), {
115903
+ await (0, import_prettier2.format)(JSON.stringify(packageJson), {
116542
115904
  ...prettierOptions,
116543
115905
  parser: "json"
116544
115906
  })
@@ -116546,179 +115908,21 @@ ${externalDependencies.map((dep) => {
116546
115908
  } else {
116547
115909
  writeWarning(config, "Skipping writing to package.json file");
116548
115910
  }
116549
- if (options.includeSrc === true) {
116550
- const files = globSync([
116551
- (0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.ts"),
116552
- (0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.tsx"),
116553
- (0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.js"),
116554
- (0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.jsx")
116555
- ]);
116556
- await Promise.allSettled(
116557
- files.map(
116558
- async (file) => (0, import_promises3.writeFile)(
116559
- file,
116560
- await (0, import_prettier.format)(
116561
- `${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
116562
-
116563
- ${(0, import_node_fs5.readFileSync)(file, "utf-8")}`,
116564
- {
116565
- ...prettierOptions,
116566
- parser: "typescript"
116567
- }
116568
- ),
116569
- "utf-8"
116570
- )
116571
- )
116572
- );
116573
- }
116574
- const stormEnv = Object.keys(options.env).filter((key) => key.startsWith("STORM_")).reduce((ret, key) => {
116575
- ret[key] = options.env[key];
116576
- return ret;
116577
- }, {});
116578
- options.plugins.push(
116579
- (0, import_esbuild_decorators.esbuildDecorators)({
116580
- tsconfig: options.tsConfig,
116581
- cwd: workspaceRoot
116582
- })
116583
- );
116584
- options.plugins.push(environmentPlugin(stormEnv));
116585
- const getConfigOptions = {
116586
- ...options,
116587
- define: {
116588
- __STORM_CONFIG: JSON.stringify(stormEnv)
116589
- },
116590
- env: {
116591
- __STORM_CONFIG: JSON.stringify(stormEnv),
116592
- ...stormEnv
115911
+ await runTsupBuild(
115912
+ {
115913
+ entry,
115914
+ projectRoot,
115915
+ projectName: context.projectName,
115916
+ sourceRoot
116593
115917
  },
116594
- dtsTsConfig: getNormalizedTsConfig(
116595
- context.root,
116596
- options.outputPath,
116597
- (0, import_tsc.createTypeScriptCompilationOptions)(
116598
- (0, import_normalize_options.normalizeOptions)(
116599
- {
116600
- ...options,
116601
- watch: false,
116602
- main: options.entry,
116603
- transformers: []
116604
- },
116605
- context.root,
116606
- sourceRoot,
116607
- workspaceRoot
116608
- ),
116609
- context
116610
- )
116611
- ),
116612
- banner: options.banner ? {
116613
- js: `${options.banner}
116614
-
116615
- `,
116616
- css: `/*
116617
- ${options.banner}
116618
-
116619
-
116620
-
116621
- */`
116622
- } : void 0,
116623
- outputPath: options.outputPath,
116624
- entry
116625
- };
116626
- if (options.getConfig) {
116627
- writeInfo(config, "\u26A1 Running the Build process");
116628
- const getConfigFns = _isFunction(options.getConfig) ? [options.getConfig] : Object.keys(options.getConfig).map((key) => options.getConfig[key]);
116629
- const tsupConfig = (0, import_tsup.defineConfig)(
116630
- getConfigFns.map(
116631
- (getConfigFn) => getConfig(context.root, projectRoot, getConfigFn, getConfigOptions)
116632
- )
116633
- );
116634
- if (_isFunction(tsupConfig)) {
116635
- await build(await Promise.resolve(tsupConfig({})), config);
116636
- } else {
116637
- await build(tsupConfig, config);
116638
- }
116639
- } else if (getLogLevel(config?.logLevel) >= LogLevel.WARN) {
116640
- writeWarning(
116641
- config,
116642
- "The Build process did not run because no `getConfig` parameter was provided"
116643
- );
116644
- }
115918
+ config,
115919
+ options
115920
+ );
116645
115921
  writeSuccess(config, "\u26A1 The Build process has completed successfully");
116646
115922
  return {
116647
115923
  success: true
116648
115924
  };
116649
115925
  }
116650
- function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
116651
- const config = ts.readConfigFile(options.tsConfig, ts.sys.readFile).config;
116652
- const tsConfig = ts.parseJsonConfigFileContent(
116653
- {
116654
- ...config,
116655
- compilerOptions: {
116656
- ...config.compilerOptions,
116657
- outDir: outputPath,
116658
- rootDir: workspaceRoot,
116659
- baseUrl: workspaceRoot,
116660
- allowJs: true,
116661
- noEmit: false,
116662
- esModuleInterop: true,
116663
- downlevelIteration: true,
116664
- forceConsistentCasingInFileNames: true,
116665
- emitDeclarationOnly: true,
116666
- declaration: true,
116667
- declarationMap: true,
116668
- declarationDir: (0, import_devkit2.joinPathFragments)(workspaceRoot, "tmp", ".tsup", "declaration")
116669
- }
116670
- },
116671
- ts.sys,
116672
- (0, import_node_path5.dirname)(options.tsConfig)
116673
- );
116674
- tsConfig.options.pathsBasePath = workspaceRoot;
116675
- if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
116676
- tsConfig.options.tsBuildInfoFile = (0, import_devkit2.joinPathFragments)(outputPath, "tsconfig.tsbuildinfo");
116677
- }
116678
- return tsConfig;
116679
- }
116680
- var build = async (options, config) => {
116681
- if (Array.isArray(options)) {
116682
- await Promise.all(options.map((buildOptions) => build(buildOptions, config)));
116683
- } else {
116684
- if (getLogLevel(config?.logLevel) >= LogLevel.TRACE && !options.silent) {
116685
- console.log("\u2699\uFE0F Tsup build config: \n", options, "\n");
116686
- }
116687
- await (0, import_tsup.build)(options);
116688
- await new Promise((r) => setTimeout(r, 100));
116689
- }
116690
- };
116691
- var applyDefaultOptions = (options) => {
116692
- options.entry ??= "{sourceRoot}/index.ts";
116693
- options.outputPath ??= "dist/{projectRoot}";
116694
- options.tsConfig ??= "tsconfig.json";
116695
- options.generatePackageJson ??= true;
116696
- options.splitting ??= true;
116697
- options.treeshake ??= true;
116698
- options.platform ??= "neutral";
116699
- options.format ??= ["cjs", "esm"];
116700
- options.verbose ??= false;
116701
- options.external ??= [];
116702
- options.additionalEntryPoints ??= [];
116703
- options.assets ??= [];
116704
- options.plugins ??= [];
116705
- options.includeSrc ??= false;
116706
- options.minify ??= false;
116707
- options.clean ??= true;
116708
- options.bundle ??= true;
116709
- options.debug ??= false;
116710
- options.watch ??= false;
116711
- options.apiReport ??= true;
116712
- options.docModel ??= true;
116713
- options.tsdocMetadata ??= true;
116714
- options.emitOnAll ??= false;
116715
- options.metafile ??= true;
116716
- options.skipNativeModulesPlugin ??= false;
116717
- options.define ??= {};
116718
- options.env ??= {};
116719
- options.getConfig ??= { dist: defaultConfig };
116720
- return options;
116721
- };
116722
115926
  var executor_default = withRunExecutor("TypeScript Build using tsup", tsupExecutorFn, {
116723
115927
  skipReadingConfig: false,
116724
115928
  hooks: {
@@ -116732,7 +115936,7 @@ var _isPrimitive = (value) => {
116732
115936
  return false;
116733
115937
  }
116734
115938
  };
116735
- var _isFunction = (value) => {
115939
+ var _isFunction2 = (value) => {
116736
115940
  try {
116737
115941
  return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
116738
115942
  } catch (e) {
@@ -116741,7 +115945,6 @@ var _isFunction = (value) => {
116741
115945
  };
116742
115946
  // Annotate the CommonJS export names for ESM import in node:
116743
115947
  0 && (module.exports = {
116744
- applyDefaultOptions,
116745
115948
  tsupExecutorFn
116746
115949
  });
116747
115950
  /*! Bundled license information: