@storm-software/esbuild 0.21.3 → 0.21.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-0.21.2-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-0.21.4-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
package/dist/build.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkE435TS4Gcjs = require('./chunk-E435TS4G.cjs');
3
+ var _chunkTBU55QYVcjs = require('./chunk-TBU55QYV.cjs');
4
4
  require('./chunk-GZKDEX4I.cjs');
5
- require('./chunk-DF6PHIIP.cjs');
5
+ require('./chunk-NWSAHFK5.cjs');
6
6
  require('./chunk-S6M44SSZ.cjs');
7
7
  require('./chunk-WRBUO7H6.cjs');
8
8
  require('./chunk-GQTYEGCT.cjs');
@@ -16,4 +16,4 @@ require('./chunk-EZGTDCYM.cjs');
16
16
  require('./chunk-BGYQAVKQ.cjs');
17
17
 
18
18
 
19
- exports.build = _chunkE435TS4Gcjs.build;
19
+ exports.build = _chunkTBU55QYVcjs.build;
package/dist/build.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  build
3
- } from "./chunk-C2VCPXPU.js";
3
+ } from "./chunk-3MVHCPXF.js";
4
4
  import "./chunk-KE7NROKH.js";
5
- import "./chunk-5KKE2KOP.js";
5
+ import "./chunk-CD57N3DC.js";
6
6
  import "./chunk-T5272PC2.js";
7
7
  import "./chunk-LYDEMC26.js";
8
8
  import "./chunk-W5YHMJLR.js";
@@ -14,7 +14,7 @@ import {
14
14
  getEntryPoints,
15
15
  getEnv,
16
16
  getOutputExtensionMap
17
- } from "./chunk-5KKE2KOP.js";
17
+ } from "./chunk-CD57N3DC.js";
18
18
  import {
19
19
  depsCheckPlugin
20
20
  } from "./chunk-KJJEF47Z.js";
@@ -469,7 +469,7 @@ async function copyBuildAssets(context2) {
469
469
  if (context2.result?.errors.length === 0) {
470
470
  writeDebug(` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
471
471
  const stopwatch = getStopwatch(`${context2.options.name} asset copy`);
472
- await copyAssets(context2.options.config, context2.options.assets ?? [], context2.options.outdir, context2.options.projectRoot, context2.options.projectName, context2.options.sourceRoot, true, false);
472
+ await copyAssets(context2.options.config, context2.options.assets ?? [], context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
473
473
  stopwatch();
474
474
  }
475
475
  return context2;
@@ -25,7 +25,6 @@ import {
25
25
  getDefaultConfig,
26
26
  getLogLevel,
27
27
  getLogLevelLabel,
28
- isVerbose,
29
28
  writeDebug,
30
29
  writeTrace,
31
30
  writeWarning
@@ -69,10 +68,174 @@ import { stripIndents } from "@nx/devkit";
69
68
  import { relative } from "path";
70
69
 
71
70
  // ../build-tools/src/utilities/copy-assets.ts
72
- import { readCachedProjectGraph, readProjectsConfigurationFromProjectGraph } from "@nx/devkit";
73
- import { copyAssets as copyAssetsBase } from "@nx/js";
71
+ import { CopyAssetsHandler } from "@nx/js/src/utils/assets/copy-assets-handler";
74
72
  import { glob } from "glob";
75
- import { readFile as readFile2, writeFile } from "node:fs/promises";
73
+ import { readFile, writeFile } from "node:fs/promises";
74
+ var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson = true, includeSrc = false, banner, footer) => {
75
+ const pendingAssets = Array.from(assets ?? []);
76
+ pendingAssets.push({
77
+ input: projectRoot,
78
+ glob: "*.md",
79
+ output: "."
80
+ });
81
+ pendingAssets.push({
82
+ input: ".",
83
+ glob: "LICENSE",
84
+ output: "."
85
+ });
86
+ if (generatePackageJson === false) {
87
+ pendingAssets.push({
88
+ input: projectRoot,
89
+ glob: "package.json",
90
+ output: "."
91
+ });
92
+ }
93
+ if (includeSrc === true) {
94
+ pendingAssets.push({
95
+ input: sourceRoot,
96
+ glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
97
+ output: "src/"
98
+ });
99
+ }
100
+ writeTrace(`\u{1F4DD} Copying the following assets to the output directory:
101
+ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${joinPaths(outputPath, pendingAsset.output)}`).join("\n")}`, config);
102
+ const assetHandler = new CopyAssetsHandler({
103
+ projectDir: projectRoot,
104
+ rootDir: config.workspaceRoot,
105
+ outputDir: outputPath,
106
+ assets: pendingAssets
107
+ });
108
+ await assetHandler.processAllAssetsOnce();
109
+ if (includeSrc === true) {
110
+ writeDebug(`\u{1F4DD} Adding banner and writing source files: ${joinPaths(outputPath, "src")}`, config);
111
+ const files = await glob([
112
+ joinPaths(config.workspaceRoot, outputPath, "src/**/*.ts"),
113
+ joinPaths(config.workspaceRoot, outputPath, "src/**/*.tsx"),
114
+ joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
115
+ joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
116
+ ]);
117
+ await Promise.allSettled(files.map(async (file) => writeFile(file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
118
+
119
+ ${await readFile(file, "utf8")}
120
+
121
+ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
122
+ }
123
+ }, "copyAssets");
124
+
125
+ // ../build-tools/src/utilities/generate-package-json.ts
126
+ import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
127
+ import { Glob } from "glob";
128
+ import { existsSync } from "node:fs";
129
+ import { readFile as readFile2 } from "node:fs/promises";
130
+ import { readCachedProjectGraph } from "nx/src/project-graph/project-graph";
131
+ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
132
+ const projectDependencies = calculateProjectBuildableDependencies(void 0, readCachedProjectGraph(), workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
133
+ const localPackages = [];
134
+ for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
135
+ const projectNode = project.node;
136
+ if (projectNode.data.root) {
137
+ const projectPackageJsonPath = joinPaths(workspaceRoot, projectNode.data.root, "package.json");
138
+ if (existsSync(projectPackageJsonPath)) {
139
+ const projectPackageJsonContent = await readFile2(projectPackageJsonPath, "utf8");
140
+ const projectPackageJson = JSON.parse(projectPackageJsonContent);
141
+ if (projectPackageJson.private !== false) {
142
+ localPackages.push(projectPackageJson);
143
+ }
144
+ }
145
+ }
146
+ }
147
+ if (localPackages.length > 0) {
148
+ writeTrace(`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
149
+ packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
150
+ if (!ret[localPackage.name]) {
151
+ ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
152
+ }
153
+ return ret;
154
+ }, packageJson.peerDependencies ?? {});
155
+ packageJson.peerDependenciesMeta = localPackages.reduce((ret, localPackage) => {
156
+ if (!ret[localPackage.name]) {
157
+ ret[localPackage.name] = {
158
+ optional: false
159
+ };
160
+ }
161
+ return ret;
162
+ }, packageJson.peerDependenciesMeta ?? {});
163
+ packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
164
+ if (!ret[localPackage.name]) {
165
+ ret[localPackage.name] = localPackage.version || "0.0.1";
166
+ }
167
+ return ret;
168
+ }, packageJson.peerDependencies ?? {});
169
+ } else {
170
+ writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
171
+ }
172
+ return packageJson;
173
+ }, "addPackageDependencies");
174
+ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
175
+ const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : findWorkspaceRoot();
176
+ const workspacePackageJsonContent = await readFile2(joinPaths(workspaceRoot, "package.json"), "utf8");
177
+ const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
178
+ packageJson.type ??= "module";
179
+ packageJson.sideEffects ??= false;
180
+ if (includeSrc === true) {
181
+ let distSrc = sourceRoot.replace(projectRoot, "");
182
+ if (distSrc.startsWith("/")) {
183
+ distSrc = distSrc.substring(1);
184
+ }
185
+ packageJson.source ??= `${joinPaths(distSrc, "index.ts").replaceAll("\\", "/")}`;
186
+ }
187
+ packageJson.files ??= [
188
+ "dist/**/*"
189
+ ];
190
+ if (includeSrc === true && !packageJson.files.includes("src")) {
191
+ packageJson.files.push("src/**/*");
192
+ }
193
+ packageJson.publishConfig ??= {
194
+ access: "public"
195
+ };
196
+ packageJson.description ??= workspacePackageJson.description;
197
+ packageJson.homepage ??= workspacePackageJson.homepage;
198
+ packageJson.bugs ??= workspacePackageJson.bugs;
199
+ packageJson.license ??= workspacePackageJson.license;
200
+ packageJson.keywords ??= workspacePackageJson.keywords;
201
+ packageJson.funding ??= workspacePackageJson.funding;
202
+ packageJson.author ??= workspacePackageJson.author;
203
+ packageJson.maintainers ??= workspacePackageJson.maintainers;
204
+ if (!packageJson.maintainers && packageJson.author) {
205
+ packageJson.maintainers = [
206
+ packageJson.author
207
+ ];
208
+ }
209
+ packageJson.contributors ??= workspacePackageJson.contributors;
210
+ if (!packageJson.contributors && packageJson.author) {
211
+ packageJson.contributors = [
212
+ packageJson.author
213
+ ];
214
+ }
215
+ packageJson.repository ??= workspacePackageJson.repository;
216
+ packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
217
+ return packageJson;
218
+ }, "addWorkspacePackageJsonFields");
219
+ var addPackageJsonExport = /* @__PURE__ */ __name((file, type = "module", sourceRoot) => {
220
+ let entry = file.replaceAll("\\", "/");
221
+ if (sourceRoot) {
222
+ entry = entry.replace(sourceRoot, "");
223
+ }
224
+ return {
225
+ "import": {
226
+ "types": `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
227
+ "default": `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
228
+ },
229
+ "require": {
230
+ "types": `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
231
+ "default": `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
232
+ },
233
+ "default": {
234
+ "types": `./dist/${entry}.d.ts`,
235
+ "default": `./dist/${entry}.js`
236
+ }
237
+ };
238
+ }, "addPackageJsonExport");
76
239
 
77
240
  // ../config-tools/src/config-file/get-config-file.ts
78
241
  import { loadConfig } from "c12";
@@ -600,211 +763,6 @@ var getConfig = /* @__PURE__ */ __name((workspaceRoot, skipLogs = false) => {
600
763
  return loadStormConfig(workspaceRoot, skipLogs);
601
764
  }, "getConfig");
602
765
 
603
- // ../build-tools/src/utilities/read-nx-config.ts
604
- import { existsSync } from "node:fs";
605
- import { readFile } from "node:fs/promises";
606
- var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot) => {
607
- let rootDir = workspaceRoot;
608
- if (!rootDir) {
609
- const config = await getConfig();
610
- rootDir = config.workspaceRoot;
611
- }
612
- const nxJsonPath = joinPaths(rootDir, "nx.json");
613
- if (!existsSync(nxJsonPath)) {
614
- throw new Error("Cannot find project.json configuration");
615
- }
616
- const configContent = await readFile(nxJsonPath, "utf8");
617
- return JSON.parse(configContent);
618
- }, "readNxConfig");
619
-
620
- // ../build-tools/src/utilities/copy-assets.ts
621
- var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, projectRoot, projectName, sourceRoot, generatePackageJson = true, includeSrc = false, banner, footer) => {
622
- const pendingAssets = Array.from(assets ?? []);
623
- pendingAssets.push({
624
- input: joinPaths(config.workspaceRoot, projectRoot),
625
- glob: "*.md",
626
- output: "."
627
- });
628
- pendingAssets.push({
629
- input: config.workspaceRoot,
630
- glob: "LICENSE",
631
- output: "."
632
- });
633
- if (generatePackageJson === false) {
634
- pendingAssets.push({
635
- input: projectRoot,
636
- glob: "package.json",
637
- output: "."
638
- });
639
- }
640
- if (includeSrc === true) {
641
- pendingAssets.push({
642
- input: sourceRoot,
643
- glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
644
- output: "src/"
645
- });
646
- }
647
- const nxJson = readNxConfig(config.workspaceRoot);
648
- const projectGraph = readCachedProjectGraph();
649
- const projectsConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
650
- if (!projectsConfigurations?.projects?.[projectName]) {
651
- throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
652
- }
653
- const buildTarget = projectsConfigurations.projects[projectName].targets?.build;
654
- if (!buildTarget) {
655
- throw new Error(`The Build process failed because the project does not have a valid build target in the project.json file. Check if the file exists in the root of the project at ${joinPaths(projectRoot, "project.json")}`);
656
- }
657
- writeTrace(`\u{1F4DD} Copying the following assets to the output directory:
658
- ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${joinPaths(outputPath, pendingAsset.output)}`).join("\n")}`, config);
659
- const result = await copyAssetsBase({
660
- assets: pendingAssets,
661
- watch: false,
662
- outputPath
663
- }, {
664
- root: config.workspaceRoot,
665
- targetName: "build",
666
- target: buildTarget,
667
- projectName,
668
- projectGraph,
669
- projectsConfigurations,
670
- nxJsonConfiguration: nxJson,
671
- cwd: config.workspaceRoot,
672
- isVerbose: isVerbose(config.logLevel)
673
- });
674
- if (!result.success) {
675
- throw new Error("The Build process failed trying to copy assets");
676
- }
677
- if (includeSrc === true) {
678
- writeDebug(`\u{1F4DD} Adding banner and writing source files: ${joinPaths(outputPath, "src")}`, config);
679
- const files = await glob([
680
- joinPaths(config.workspaceRoot, outputPath, "src/**/*.ts"),
681
- joinPaths(config.workspaceRoot, outputPath, "src/**/*.tsx"),
682
- joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
683
- joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
684
- ]);
685
- await Promise.allSettled(files.map(async (file) => writeFile(file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
686
-
687
- ${await readFile2(file, "utf8")}
688
-
689
- ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
690
- }
691
- }, "copyAssets");
692
-
693
- // ../build-tools/src/utilities/generate-package-json.ts
694
- import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
695
- import { Glob } from "glob";
696
- import { existsSync as existsSync2 } from "node:fs";
697
- import { readFile as readFile3 } from "node:fs/promises";
698
- import { readCachedProjectGraph as readCachedProjectGraph2 } from "nx/src/project-graph/project-graph";
699
- var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
700
- const projectDependencies = calculateProjectBuildableDependencies(void 0, readCachedProjectGraph2(), workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
701
- const localPackages = [];
702
- for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
703
- const projectNode = project.node;
704
- if (projectNode.data.root) {
705
- const projectPackageJsonPath = joinPaths(workspaceRoot, projectNode.data.root, "package.json");
706
- if (existsSync2(projectPackageJsonPath)) {
707
- const projectPackageJsonContent = await readFile3(projectPackageJsonPath, "utf8");
708
- const projectPackageJson = JSON.parse(projectPackageJsonContent);
709
- if (projectPackageJson.private !== false) {
710
- localPackages.push(projectPackageJson);
711
- }
712
- }
713
- }
714
- }
715
- if (localPackages.length > 0) {
716
- writeTrace(`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
717
- packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
718
- if (!ret[localPackage.name]) {
719
- ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
720
- }
721
- return ret;
722
- }, packageJson.peerDependencies ?? {});
723
- packageJson.peerDependenciesMeta = localPackages.reduce((ret, localPackage) => {
724
- if (!ret[localPackage.name]) {
725
- ret[localPackage.name] = {
726
- optional: false
727
- };
728
- }
729
- return ret;
730
- }, packageJson.peerDependenciesMeta ?? {});
731
- packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
732
- if (!ret[localPackage.name]) {
733
- ret[localPackage.name] = localPackage.version || "0.0.1";
734
- }
735
- return ret;
736
- }, packageJson.peerDependencies ?? {});
737
- } else {
738
- writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
739
- }
740
- return packageJson;
741
- }, "addPackageDependencies");
742
- var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
743
- const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : findWorkspaceRoot();
744
- const workspacePackageJsonContent = await readFile3(joinPaths(workspaceRoot, "package.json"), "utf8");
745
- const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
746
- packageJson.type ??= "module";
747
- packageJson.sideEffects ??= false;
748
- if (includeSrc === true) {
749
- let distSrc = sourceRoot.replace(projectRoot, "");
750
- if (distSrc.startsWith("/")) {
751
- distSrc = distSrc.substring(1);
752
- }
753
- packageJson.source ??= `${joinPaths(distSrc, "index.ts").replaceAll("\\", "/")}`;
754
- }
755
- packageJson.files ??= [
756
- "dist/**/*"
757
- ];
758
- if (includeSrc === true && !packageJson.files.includes("src")) {
759
- packageJson.files.push("src/**/*");
760
- }
761
- packageJson.publishConfig ??= {
762
- access: "public"
763
- };
764
- packageJson.description ??= workspacePackageJson.description;
765
- packageJson.homepage ??= workspacePackageJson.homepage;
766
- packageJson.bugs ??= workspacePackageJson.bugs;
767
- packageJson.license ??= workspacePackageJson.license;
768
- packageJson.keywords ??= workspacePackageJson.keywords;
769
- packageJson.funding ??= workspacePackageJson.funding;
770
- packageJson.author ??= workspacePackageJson.author;
771
- packageJson.maintainers ??= workspacePackageJson.maintainers;
772
- if (!packageJson.maintainers && packageJson.author) {
773
- packageJson.maintainers = [
774
- packageJson.author
775
- ];
776
- }
777
- packageJson.contributors ??= workspacePackageJson.contributors;
778
- if (!packageJson.contributors && packageJson.author) {
779
- packageJson.contributors = [
780
- packageJson.author
781
- ];
782
- }
783
- packageJson.repository ??= workspacePackageJson.repository;
784
- packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
785
- return packageJson;
786
- }, "addWorkspacePackageJsonFields");
787
- var addPackageJsonExport = /* @__PURE__ */ __name((file, type = "module", sourceRoot) => {
788
- let entry = file.replaceAll("\\", "/");
789
- if (sourceRoot) {
790
- entry = entry.replace(sourceRoot, "");
791
- }
792
- return {
793
- "import": {
794
- "types": `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
795
- "default": `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
796
- },
797
- "require": {
798
- "types": `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
799
- "default": `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
800
- },
801
- "default": {
802
- "types": `./dist/${entry}.d.ts`,
803
- "default": `./dist/${entry}.js`
804
- }
805
- };
806
- }, "addPackageJsonExport");
807
-
808
766
  // ../build-tools/src/utilities/get-entry-points.ts
809
767
  import { glob as glob2 } from "glob";
810
768
  var getEntryPoints = /* @__PURE__ */ __name(async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
@@ -881,6 +839,10 @@ function getOutExtension(format, pkgType) {
881
839
  }
882
840
  __name(getOutExtension, "getOutExtension");
883
841
 
842
+ // ../build-tools/src/utilities/read-nx-config.ts
843
+ import { existsSync as existsSync2 } from "node:fs";
844
+ import { readFile as readFile3 } from "node:fs/promises";
845
+
884
846
  // ../build-tools/src/utilities/task-graph.ts
885
847
  import { createTaskGraph, mapTargetDefaultsToDependencies } from "nx/src/tasks-runner/create-task-graph";
886
848
 
@@ -940,11 +902,11 @@ var DEFAULT_BUILD_OPTIONS = {
940
902
  export {
941
903
  DEFAULT_COMPILED_BANNER,
942
904
  DEFAULT_TARGET,
943
- getConfig,
944
905
  copyAssets,
945
906
  addPackageDependencies,
946
907
  addWorkspacePackageJsonFields,
947
908
  addPackageJsonExport,
909
+ getConfig,
948
910
  getEntryPoints,
949
911
  getEnv,
950
912
  getOutputExtensionMap,
@@ -28,7 +28,6 @@ var _chunk42FF63OOcjs = require('./chunk-42FF63OO.cjs');
28
28
 
29
29
 
30
30
 
31
-
32
31
  var _chunkZKT6GJKVcjs = require('./chunk-ZKT6GJKV.cjs');
33
32
 
34
33
 
@@ -69,10 +68,174 @@ var _devkit = require('@nx/devkit');
69
68
 
70
69
 
71
70
  // ../build-tools/src/utilities/copy-assets.ts
72
-
73
- var _js = require('@nx/js');
71
+ var _copyassetshandler = require('@nx/js/src/utils/assets/copy-assets-handler');
74
72
  var _glob = require('glob');
75
73
  var _promises = require('fs/promises');
74
+ var copyAssets = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson = true, includeSrc = false, banner, footer) => {
75
+ const pendingAssets = Array.from(_nullishCoalesce(assets, () => ( [])));
76
+ pendingAssets.push({
77
+ input: projectRoot,
78
+ glob: "*.md",
79
+ output: "."
80
+ });
81
+ pendingAssets.push({
82
+ input: ".",
83
+ glob: "LICENSE",
84
+ output: "."
85
+ });
86
+ if (generatePackageJson === false) {
87
+ pendingAssets.push({
88
+ input: projectRoot,
89
+ glob: "package.json",
90
+ output: "."
91
+ });
92
+ }
93
+ if (includeSrc === true) {
94
+ pendingAssets.push({
95
+ input: sourceRoot,
96
+ glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
97
+ output: "src/"
98
+ });
99
+ }
100
+ _chunkZKT6GJKVcjs.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
101
+ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkLVWQSCJMcjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`, config);
102
+ const assetHandler = new (0, _copyassetshandler.CopyAssetsHandler)({
103
+ projectDir: projectRoot,
104
+ rootDir: config.workspaceRoot,
105
+ outputDir: outputPath,
106
+ assets: pendingAssets
107
+ });
108
+ await assetHandler.processAllAssetsOnce();
109
+ if (includeSrc === true) {
110
+ _chunkZKT6GJKVcjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkLVWQSCJMcjs.joinPaths.call(void 0, outputPath, "src")}`, config);
111
+ const files = await _glob.glob.call(void 0, [
112
+ _chunkLVWQSCJMcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
113
+ _chunkLVWQSCJMcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
114
+ _chunkLVWQSCJMcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
115
+ _chunkLVWQSCJMcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
116
+ ]);
117
+ await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
118
+
119
+ ${await _promises.readFile.call(void 0, file, "utf8")}
120
+
121
+ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
122
+ }
123
+ }, "copyAssets");
124
+
125
+ // ../build-tools/src/utilities/generate-package-json.ts
126
+ var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
127
+
128
+
129
+
130
+ var _projectgraph = require('nx/src/project-graph/project-graph');
131
+ var addPackageDependencies = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (workspaceRoot, projectRoot, projectName, packageJson) => {
132
+ const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, _projectgraph.readCachedProjectGraph.call(void 0, ), workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
133
+ const localPackages = [];
134
+ for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
135
+ const projectNode = project.node;
136
+ if (projectNode.data.root) {
137
+ const projectPackageJsonPath = _chunkLVWQSCJMcjs.joinPaths.call(void 0, workspaceRoot, projectNode.data.root, "package.json");
138
+ if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
139
+ const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
140
+ const projectPackageJson = JSON.parse(projectPackageJsonContent);
141
+ if (projectPackageJson.private !== false) {
142
+ localPackages.push(projectPackageJson);
143
+ }
144
+ }
145
+ }
146
+ }
147
+ if (localPackages.length > 0) {
148
+ _chunkZKT6GJKVcjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
149
+ packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
150
+ if (!ret[localPackage.name]) {
151
+ ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
152
+ }
153
+ return ret;
154
+ }, _nullishCoalesce(packageJson.peerDependencies, () => ( {})));
155
+ packageJson.peerDependenciesMeta = localPackages.reduce((ret, localPackage) => {
156
+ if (!ret[localPackage.name]) {
157
+ ret[localPackage.name] = {
158
+ optional: false
159
+ };
160
+ }
161
+ return ret;
162
+ }, _nullishCoalesce(packageJson.peerDependenciesMeta, () => ( {})));
163
+ packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
164
+ if (!ret[localPackage.name]) {
165
+ ret[localPackage.name] = localPackage.version || "0.0.1";
166
+ }
167
+ return ret;
168
+ }, _nullishCoalesce(packageJson.peerDependencies, () => ( {})));
169
+ } else {
170
+ _chunkZKT6GJKVcjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
171
+ }
172
+ return packageJson;
173
+ }, "addPackageDependencies");
174
+ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
175
+ const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunkZKT6GJKVcjs.findWorkspaceRoot.call(void 0, );
176
+ const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkLVWQSCJMcjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
177
+ const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
178
+ packageJson.type ??= "module";
179
+ packageJson.sideEffects ??= false;
180
+ if (includeSrc === true) {
181
+ let distSrc = sourceRoot.replace(projectRoot, "");
182
+ if (distSrc.startsWith("/")) {
183
+ distSrc = distSrc.substring(1);
184
+ }
185
+ packageJson.source ??= `${_chunkLVWQSCJMcjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
186
+ }
187
+ packageJson.files ??= [
188
+ "dist/**/*"
189
+ ];
190
+ if (includeSrc === true && !packageJson.files.includes("src")) {
191
+ packageJson.files.push("src/**/*");
192
+ }
193
+ packageJson.publishConfig ??= {
194
+ access: "public"
195
+ };
196
+ packageJson.description ??= workspacePackageJson.description;
197
+ packageJson.homepage ??= workspacePackageJson.homepage;
198
+ packageJson.bugs ??= workspacePackageJson.bugs;
199
+ packageJson.license ??= workspacePackageJson.license;
200
+ packageJson.keywords ??= workspacePackageJson.keywords;
201
+ packageJson.funding ??= workspacePackageJson.funding;
202
+ packageJson.author ??= workspacePackageJson.author;
203
+ packageJson.maintainers ??= workspacePackageJson.maintainers;
204
+ if (!packageJson.maintainers && packageJson.author) {
205
+ packageJson.maintainers = [
206
+ packageJson.author
207
+ ];
208
+ }
209
+ packageJson.contributors ??= workspacePackageJson.contributors;
210
+ if (!packageJson.contributors && packageJson.author) {
211
+ packageJson.contributors = [
212
+ packageJson.author
213
+ ];
214
+ }
215
+ packageJson.repository ??= workspacePackageJson.repository;
216
+ packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkLVWQSCJMcjs.joinPaths.call(void 0, "packages", projectName);
217
+ return packageJson;
218
+ }, "addWorkspacePackageJsonFields");
219
+ var addPackageJsonExport = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (file, type = "module", sourceRoot) => {
220
+ let entry = file.replaceAll("\\", "/");
221
+ if (sourceRoot) {
222
+ entry = entry.replace(sourceRoot, "");
223
+ }
224
+ return {
225
+ "import": {
226
+ "types": `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
227
+ "default": `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
228
+ },
229
+ "require": {
230
+ "types": `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
231
+ "default": `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
232
+ },
233
+ "default": {
234
+ "types": `./dist/${entry}.d.ts`,
235
+ "default": `./dist/${entry}.js`
236
+ }
237
+ };
238
+ }, "addPackageJsonExport");
76
239
 
77
240
  // ../config-tools/src/config-file/get-config-file.ts
78
241
  var _c12 = require('c12');
@@ -600,211 +763,6 @@ var getConfig = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (workspace
600
763
  return loadStormConfig(workspaceRoot, skipLogs);
601
764
  }, "getConfig");
602
765
 
603
- // ../build-tools/src/utilities/read-nx-config.ts
604
-
605
-
606
- var readNxConfig = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (workspaceRoot) => {
607
- let rootDir = workspaceRoot;
608
- if (!rootDir) {
609
- const config = await getConfig();
610
- rootDir = config.workspaceRoot;
611
- }
612
- const nxJsonPath = _chunkLVWQSCJMcjs.joinPaths.call(void 0, rootDir, "nx.json");
613
- if (!_fs.existsSync.call(void 0, nxJsonPath)) {
614
- throw new Error("Cannot find project.json configuration");
615
- }
616
- const configContent = await _promises.readFile.call(void 0, nxJsonPath, "utf8");
617
- return JSON.parse(configContent);
618
- }, "readNxConfig");
619
-
620
- // ../build-tools/src/utilities/copy-assets.ts
621
- var copyAssets = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (config, assets, outputPath, projectRoot, projectName, sourceRoot, generatePackageJson = true, includeSrc = false, banner, footer) => {
622
- const pendingAssets = Array.from(_nullishCoalesce(assets, () => ( [])));
623
- pendingAssets.push({
624
- input: _chunkLVWQSCJMcjs.joinPaths.call(void 0, config.workspaceRoot, projectRoot),
625
- glob: "*.md",
626
- output: "."
627
- });
628
- pendingAssets.push({
629
- input: config.workspaceRoot,
630
- glob: "LICENSE",
631
- output: "."
632
- });
633
- if (generatePackageJson === false) {
634
- pendingAssets.push({
635
- input: projectRoot,
636
- glob: "package.json",
637
- output: "."
638
- });
639
- }
640
- if (includeSrc === true) {
641
- pendingAssets.push({
642
- input: sourceRoot,
643
- glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
644
- output: "src/"
645
- });
646
- }
647
- const nxJson = readNxConfig(config.workspaceRoot);
648
- const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
649
- const projectsConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
650
- if (!_optionalChain([projectsConfigurations, 'optionalAccess', _31 => _31.projects, 'optionalAccess', _32 => _32[projectName]])) {
651
- throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
652
- }
653
- const buildTarget = _optionalChain([projectsConfigurations, 'access', _33 => _33.projects, 'access', _34 => _34[projectName], 'access', _35 => _35.targets, 'optionalAccess', _36 => _36.build]);
654
- if (!buildTarget) {
655
- throw new Error(`The Build process failed because the project does not have a valid build target in the project.json file. Check if the file exists in the root of the project at ${_chunkLVWQSCJMcjs.joinPaths.call(void 0, projectRoot, "project.json")}`);
656
- }
657
- _chunkZKT6GJKVcjs.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
658
- ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkLVWQSCJMcjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`, config);
659
- const result = await _js.copyAssets.call(void 0, {
660
- assets: pendingAssets,
661
- watch: false,
662
- outputPath
663
- }, {
664
- root: config.workspaceRoot,
665
- targetName: "build",
666
- target: buildTarget,
667
- projectName,
668
- projectGraph,
669
- projectsConfigurations,
670
- nxJsonConfiguration: nxJson,
671
- cwd: config.workspaceRoot,
672
- isVerbose: _chunkZKT6GJKVcjs.isVerbose.call(void 0, config.logLevel)
673
- });
674
- if (!result.success) {
675
- throw new Error("The Build process failed trying to copy assets");
676
- }
677
- if (includeSrc === true) {
678
- _chunkZKT6GJKVcjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkLVWQSCJMcjs.joinPaths.call(void 0, outputPath, "src")}`, config);
679
- const files = await _glob.glob.call(void 0, [
680
- _chunkLVWQSCJMcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
681
- _chunkLVWQSCJMcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
682
- _chunkLVWQSCJMcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
683
- _chunkLVWQSCJMcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
684
- ]);
685
- await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
686
-
687
- ${await _promises.readFile.call(void 0, file, "utf8")}
688
-
689
- ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
690
- }
691
- }, "copyAssets");
692
-
693
- // ../build-tools/src/utilities/generate-package-json.ts
694
- var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
695
-
696
-
697
-
698
- var _projectgraph = require('nx/src/project-graph/project-graph');
699
- var addPackageDependencies = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (workspaceRoot, projectRoot, projectName, packageJson) => {
700
- const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, _projectgraph.readCachedProjectGraph.call(void 0, ), workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
701
- const localPackages = [];
702
- for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
703
- const projectNode = project.node;
704
- if (projectNode.data.root) {
705
- const projectPackageJsonPath = _chunkLVWQSCJMcjs.joinPaths.call(void 0, workspaceRoot, projectNode.data.root, "package.json");
706
- if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
707
- const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
708
- const projectPackageJson = JSON.parse(projectPackageJsonContent);
709
- if (projectPackageJson.private !== false) {
710
- localPackages.push(projectPackageJson);
711
- }
712
- }
713
- }
714
- }
715
- if (localPackages.length > 0) {
716
- _chunkZKT6GJKVcjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
717
- packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
718
- if (!ret[localPackage.name]) {
719
- ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
720
- }
721
- return ret;
722
- }, _nullishCoalesce(packageJson.peerDependencies, () => ( {})));
723
- packageJson.peerDependenciesMeta = localPackages.reduce((ret, localPackage) => {
724
- if (!ret[localPackage.name]) {
725
- ret[localPackage.name] = {
726
- optional: false
727
- };
728
- }
729
- return ret;
730
- }, _nullishCoalesce(packageJson.peerDependenciesMeta, () => ( {})));
731
- packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
732
- if (!ret[localPackage.name]) {
733
- ret[localPackage.name] = localPackage.version || "0.0.1";
734
- }
735
- return ret;
736
- }, _nullishCoalesce(packageJson.peerDependencies, () => ( {})));
737
- } else {
738
- _chunkZKT6GJKVcjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
739
- }
740
- return packageJson;
741
- }, "addPackageDependencies");
742
- var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
743
- const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunkZKT6GJKVcjs.findWorkspaceRoot.call(void 0, );
744
- const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkLVWQSCJMcjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
745
- const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
746
- packageJson.type ??= "module";
747
- packageJson.sideEffects ??= false;
748
- if (includeSrc === true) {
749
- let distSrc = sourceRoot.replace(projectRoot, "");
750
- if (distSrc.startsWith("/")) {
751
- distSrc = distSrc.substring(1);
752
- }
753
- packageJson.source ??= `${_chunkLVWQSCJMcjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
754
- }
755
- packageJson.files ??= [
756
- "dist/**/*"
757
- ];
758
- if (includeSrc === true && !packageJson.files.includes("src")) {
759
- packageJson.files.push("src/**/*");
760
- }
761
- packageJson.publishConfig ??= {
762
- access: "public"
763
- };
764
- packageJson.description ??= workspacePackageJson.description;
765
- packageJson.homepage ??= workspacePackageJson.homepage;
766
- packageJson.bugs ??= workspacePackageJson.bugs;
767
- packageJson.license ??= workspacePackageJson.license;
768
- packageJson.keywords ??= workspacePackageJson.keywords;
769
- packageJson.funding ??= workspacePackageJson.funding;
770
- packageJson.author ??= workspacePackageJson.author;
771
- packageJson.maintainers ??= workspacePackageJson.maintainers;
772
- if (!packageJson.maintainers && packageJson.author) {
773
- packageJson.maintainers = [
774
- packageJson.author
775
- ];
776
- }
777
- packageJson.contributors ??= workspacePackageJson.contributors;
778
- if (!packageJson.contributors && packageJson.author) {
779
- packageJson.contributors = [
780
- packageJson.author
781
- ];
782
- }
783
- packageJson.repository ??= workspacePackageJson.repository;
784
- packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkLVWQSCJMcjs.joinPaths.call(void 0, "packages", projectName);
785
- return packageJson;
786
- }, "addWorkspacePackageJsonFields");
787
- var addPackageJsonExport = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (file, type = "module", sourceRoot) => {
788
- let entry = file.replaceAll("\\", "/");
789
- if (sourceRoot) {
790
- entry = entry.replace(sourceRoot, "");
791
- }
792
- return {
793
- "import": {
794
- "types": `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
795
- "default": `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
796
- },
797
- "require": {
798
- "types": `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
799
- "default": `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
800
- },
801
- "default": {
802
- "types": `./dist/${entry}.d.ts`,
803
- "default": `./dist/${entry}.js`
804
- }
805
- };
806
- }, "addPackageJsonExport");
807
-
808
766
  // ../build-tools/src/utilities/get-entry-points.ts
809
767
 
810
768
  var getEntryPoints = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
@@ -881,6 +839,10 @@ function getOutExtension(format, pkgType) {
881
839
  }
882
840
  _chunkBGYQAVKQcjs.__name.call(void 0, getOutExtension, "getOutExtension");
883
841
 
842
+ // ../build-tools/src/utilities/read-nx-config.ts
843
+
844
+
845
+
884
846
  // ../build-tools/src/utilities/task-graph.ts
885
847
  var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
886
848
 
@@ -950,4 +912,4 @@ var DEFAULT_BUILD_OPTIONS = {
950
912
 
951
913
 
952
914
 
953
- exports.DEFAULT_COMPILED_BANNER = DEFAULT_COMPILED_BANNER; exports.DEFAULT_TARGET = DEFAULT_TARGET; exports.getConfig = getConfig; exports.copyAssets = copyAssets; exports.addPackageDependencies = addPackageDependencies; exports.addWorkspacePackageJsonFields = addWorkspacePackageJsonFields; exports.addPackageJsonExport = addPackageJsonExport; exports.getEntryPoints = getEntryPoints; exports.getEnv = getEnv; exports.getOutputExtensionMap = getOutputExtensionMap; exports.getDefaultBuildPlugins = getDefaultBuildPlugins; exports.DEFAULT_BUILD_OPTIONS = DEFAULT_BUILD_OPTIONS;
915
+ exports.DEFAULT_COMPILED_BANNER = DEFAULT_COMPILED_BANNER; exports.DEFAULT_TARGET = DEFAULT_TARGET; exports.copyAssets = copyAssets; exports.addPackageDependencies = addPackageDependencies; exports.addWorkspacePackageJsonFields = addWorkspacePackageJsonFields; exports.addPackageJsonExport = addPackageJsonExport; exports.getConfig = getConfig; exports.getEntryPoints = getEntryPoints; exports.getEnv = getEnv; exports.getOutputExtensionMap = getOutputExtensionMap; exports.getDefaultBuildPlugins = getDefaultBuildPlugins; exports.DEFAULT_BUILD_OPTIONS = DEFAULT_BUILD_OPTIONS;
@@ -14,7 +14,7 @@ var _chunkGZKDEX4Icjs = require('./chunk-GZKDEX4I.cjs');
14
14
 
15
15
 
16
16
 
17
- var _chunkDF6PHIIPcjs = require('./chunk-DF6PHIIP.cjs');
17
+ var _chunkNWSAHFK5cjs = require('./chunk-NWSAHFK5.cjs');
18
18
 
19
19
 
20
20
  var _chunkGD4U35FZcjs = require('./chunk-GD4U35FZ.cjs');
@@ -277,7 +277,7 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
277
277
  if (!workspaceRoot) {
278
278
  throw new Error("Cannot find Nx workspace root");
279
279
  }
280
- const config = await _chunkDF6PHIIPcjs.getConfig.call(void 0, workspaceRoot.dir);
280
+ const config = await _chunkNWSAHFK5cjs.getConfig.call(void 0, workspaceRoot.dir);
281
281
  _chunkZKT6GJKVcjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
282
282
  const stopwatch = _chunkZKT6GJKVcjs.getStopwatch.call(void 0, "Build options resolution");
283
283
  const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
@@ -293,16 +293,16 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
293
293
  if (!_optionalChain([projectConfigurations, 'optionalAccess', _14 => _14.projects, 'optionalAccess', _15 => _15[projectName]])) {
294
294
  throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
295
295
  }
296
- const options = _defu2.default.call(void 0, userOptions, _chunkDF6PHIIPcjs.DEFAULT_BUILD_OPTIONS);
296
+ const options = _defu2.default.call(void 0, userOptions, _chunkNWSAHFK5cjs.DEFAULT_BUILD_OPTIONS);
297
297
  options.name ??= `${projectName}-${options.format}`;
298
- options.target ??= _chunkDF6PHIIPcjs.DEFAULT_TARGET;
298
+ options.target ??= _chunkNWSAHFK5cjs.DEFAULT_TARGET;
299
299
  const packageJsonPath = _chunkLVWQSCJMcjs.joinPaths.call(void 0, workspaceRoot.dir, options.projectRoot, "package.json");
300
300
  if (!await _node.hfs.isFile(packageJsonPath)) {
301
301
  throw new Error("Cannot find package.json configuration");
302
302
  }
303
303
  const packageJson = await _node.hfs.json(packageJsonPath);
304
- const outExtension = _chunkDF6PHIIPcjs.getOutputExtensionMap.call(void 0, options, packageJson.type);
305
- const env = _chunkDF6PHIIPcjs.getEnv.call(void 0, "esbuild", options);
304
+ const outExtension = _chunkNWSAHFK5cjs.getOutputExtensionMap.call(void 0, options, packageJson.type);
305
+ const env = _chunkNWSAHFK5cjs.getEnv.call(void 0, "esbuild", options);
306
306
  const result = {
307
307
  ...options,
308
308
  config,
@@ -322,7 +322,7 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
322
322
  ...userOptions,
323
323
  tsconfig: _chunkLVWQSCJMcjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
324
324
  format: options.format || "cjs",
325
- entryPoints: await _chunkDF6PHIIPcjs.getEntryPoints.call(void 0, config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
325
+ entryPoints: await _chunkNWSAHFK5cjs.getEntryPoints.call(void 0, config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
326
326
  "./src/index.ts"
327
327
  ], userOptions.emitOnAll),
328
328
  outdir: userOptions.outputPath || _chunkLVWQSCJMcjs.joinPaths.call(void 0, "dist", projectRoot),
@@ -347,8 +347,8 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
347
347
  outExtension,
348
348
  footer: userOptions.footer,
349
349
  banner: {
350
- js: options.banner || _chunkDF6PHIIPcjs.DEFAULT_COMPILED_BANNER,
351
- css: options.banner || _chunkDF6PHIIPcjs.DEFAULT_COMPILED_BANNER
350
+ js: options.banner || _chunkNWSAHFK5cjs.DEFAULT_COMPILED_BANNER,
351
+ css: options.banner || _chunkNWSAHFK5cjs.DEFAULT_COMPILED_BANNER
352
352
  },
353
353
  splitting: options.format === "iife" ? false : typeof options.splitting === "boolean" ? options.splitting : options.format === "esm",
354
354
  treeShaking: options.format === "esm",
@@ -374,7 +374,7 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
374
374
  ..._nullishCoalesce(options.inject, () => ( []))
375
375
  ].filter(Boolean)
376
376
  };
377
- result.plugins = _nullishCoalesce(userOptions.plugins, () => ( _chunkDF6PHIIPcjs.getDefaultBuildPlugins.call(void 0, userOptions, result)));
377
+ result.plugins = _nullishCoalesce(userOptions.plugins, () => ( _chunkNWSAHFK5cjs.getDefaultBuildPlugins.call(void 0, userOptions, result)));
378
378
  stopwatch();
379
379
  return result;
380
380
  }, "resolveOptions");
@@ -390,11 +390,11 @@ async function generatePackageJson(context2) {
390
390
  if (!packageJson) {
391
391
  throw new Error("Cannot find package.json configuration file");
392
392
  }
393
- packageJson = await _chunkDF6PHIIPcjs.addPackageDependencies.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, context2.options.projectName, packageJson);
394
- packageJson = await _chunkDF6PHIIPcjs.addWorkspacePackageJsonFields.call(void 0, context2.options.config, context2.options.projectRoot, context2.options.sourceRoot, context2.options.projectName, false, packageJson);
393
+ packageJson = await _chunkNWSAHFK5cjs.addPackageDependencies.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, context2.options.projectName, packageJson);
394
+ packageJson = await _chunkNWSAHFK5cjs.addWorkspacePackageJsonFields.call(void 0, context2.options.config, context2.options.projectRoot, context2.options.sourceRoot, context2.options.projectName, false, packageJson);
395
395
  packageJson.exports ??= {};
396
396
  packageJson.exports["./package.json"] ??= "./package.json";
397
- packageJson.exports["."] ??= _chunkDF6PHIIPcjs.addPackageJsonExport.call(void 0, "index", packageJson.type, context2.options.sourceRoot);
397
+ packageJson.exports["."] ??= _chunkNWSAHFK5cjs.addPackageJsonExport.call(void 0, "index", packageJson.type, context2.options.sourceRoot);
398
398
  let entryPoints = [
399
399
  {
400
400
  in: "./src/index.ts",
@@ -412,7 +412,7 @@ async function generatePackageJson(context2) {
412
412
  const split = entryPoint.out.split(".");
413
413
  split.pop();
414
414
  const entry = split.join(".").replaceAll("\\", "/");
415
- packageJson.exports[`./${entry}`] ??= _chunkDF6PHIIPcjs.addPackageJsonExport.call(void 0, entry, packageJson.type, context2.options.sourceRoot);
415
+ packageJson.exports[`./${entry}`] ??= _chunkNWSAHFK5cjs.addPackageJsonExport.call(void 0, entry, packageJson.type, context2.options.sourceRoot);
416
416
  }
417
417
  }
418
418
  packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
@@ -469,7 +469,7 @@ async function copyBuildAssets(context2) {
469
469
  if (_optionalChain([context2, 'access', _16 => _16.result, 'optionalAccess', _17 => _17.errors, 'access', _18 => _18.length]) === 0) {
470
470
  _chunkZKT6GJKVcjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
471
471
  const stopwatch = _chunkZKT6GJKVcjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
472
- await _chunkDF6PHIIPcjs.copyAssets.call(void 0, context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.projectName, context2.options.sourceRoot, true, false);
472
+ await _chunkNWSAHFK5cjs.copyAssets.call(void 0, context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
473
473
  stopwatch();
474
474
  }
475
475
  return context2;
package/dist/config.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkDF6PHIIPcjs = require('./chunk-DF6PHIIP.cjs');
5
+ var _chunkNWSAHFK5cjs = require('./chunk-NWSAHFK5.cjs');
6
6
  require('./chunk-S6M44SSZ.cjs');
7
7
  require('./chunk-WRBUO7H6.cjs');
8
8
  require('./chunk-GQTYEGCT.cjs');
@@ -17,4 +17,4 @@ require('./chunk-BGYQAVKQ.cjs');
17
17
 
18
18
 
19
19
 
20
- exports.DEFAULT_BUILD_OPTIONS = _chunkDF6PHIIPcjs.DEFAULT_BUILD_OPTIONS; exports.getDefaultBuildPlugins = _chunkDF6PHIIPcjs.getDefaultBuildPlugins; exports.getOutputExtensionMap = _chunkDF6PHIIPcjs.getOutputExtensionMap;
20
+ exports.DEFAULT_BUILD_OPTIONS = _chunkNWSAHFK5cjs.DEFAULT_BUILD_OPTIONS; exports.getDefaultBuildPlugins = _chunkNWSAHFK5cjs.getDefaultBuildPlugins; exports.getOutputExtensionMap = _chunkNWSAHFK5cjs.getOutputExtensionMap;
package/dist/config.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  DEFAULT_BUILD_OPTIONS,
3
3
  getDefaultBuildPlugins,
4
4
  getOutputExtensionMap
5
- } from "./chunk-5KKE2KOP.js";
5
+ } from "./chunk-CD57N3DC.js";
6
6
  import "./chunk-T5272PC2.js";
7
7
  import "./chunk-LYDEMC26.js";
8
8
  import "./chunk-W5YHMJLR.js";
package/dist/esbuild.cjs CHANGED
@@ -966,7 +966,7 @@ async function copyBuildAssets(context2) {
966
966
  if (context2.result?.errors.length === 0) {
967
967
  (0, import_console2.writeDebug)(` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
968
968
  const stopwatch = (0, import_console2.getStopwatch)(`${context2.options.name} asset copy`);
969
- await (0, import_build_tools.copyAssets)(context2.options.config, context2.options.assets ?? [], context2.options.outdir, context2.options.projectRoot, context2.options.projectName, context2.options.sourceRoot, true, false);
969
+ await (0, import_build_tools.copyAssets)(context2.options.config, context2.options.assets ?? [], context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
970
970
  stopwatch();
971
971
  }
972
972
  return context2;
package/dist/index.cjs CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkE435TS4Gcjs = require('./chunk-E435TS4G.cjs');
9
+ var _chunkTBU55QYVcjs = require('./chunk-TBU55QYV.cjs');
10
10
 
11
11
 
12
12
  var _chunkGZKDEX4Icjs = require('./chunk-GZKDEX4I.cjs');
@@ -14,7 +14,7 @@ var _chunkGZKDEX4Icjs = require('./chunk-GZKDEX4I.cjs');
14
14
 
15
15
 
16
16
 
17
- var _chunkDF6PHIIPcjs = require('./chunk-DF6PHIIP.cjs');
17
+ var _chunkNWSAHFK5cjs = require('./chunk-NWSAHFK5.cjs');
18
18
  require('./chunk-S6M44SSZ.cjs');
19
19
  require('./chunk-WRBUO7H6.cjs');
20
20
  require('./chunk-GQTYEGCT.cjs');
@@ -39,4 +39,4 @@ require('./chunk-BGYQAVKQ.cjs');
39
39
 
40
40
 
41
41
 
42
- exports.DEFAULT_BUILD_OPTIONS = _chunkDF6PHIIPcjs.DEFAULT_BUILD_OPTIONS; exports.Filter = _chunkE435TS4Gcjs.Filter; exports.Mapper = _chunkE435TS4Gcjs.Mapper; exports.build = _chunkE435TS4Gcjs.build; exports.clean = _chunkGZKDEX4Icjs.clean; exports.getDefaultBuildPlugins = _chunkDF6PHIIPcjs.getDefaultBuildPlugins; exports.getOutputExtensionMap = _chunkDF6PHIIPcjs.getOutputExtensionMap; exports.handle = _chunkE435TS4Gcjs.handle; exports.pipe = _chunkE435TS4Gcjs.pipe; exports.skip = _chunkE435TS4Gcjs.skip; exports.transduce = _chunkE435TS4Gcjs.transduce;
42
+ exports.DEFAULT_BUILD_OPTIONS = _chunkNWSAHFK5cjs.DEFAULT_BUILD_OPTIONS; exports.Filter = _chunkTBU55QYVcjs.Filter; exports.Mapper = _chunkTBU55QYVcjs.Mapper; exports.build = _chunkTBU55QYVcjs.build; exports.clean = _chunkGZKDEX4Icjs.clean; exports.getDefaultBuildPlugins = _chunkNWSAHFK5cjs.getDefaultBuildPlugins; exports.getOutputExtensionMap = _chunkNWSAHFK5cjs.getOutputExtensionMap; exports.handle = _chunkTBU55QYVcjs.handle; exports.pipe = _chunkTBU55QYVcjs.pipe; exports.skip = _chunkTBU55QYVcjs.skip; exports.transduce = _chunkTBU55QYVcjs.transduce;
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  pipe,
7
7
  skip,
8
8
  transduce
9
- } from "./chunk-C2VCPXPU.js";
9
+ } from "./chunk-3MVHCPXF.js";
10
10
  import {
11
11
  clean
12
12
  } from "./chunk-KE7NROKH.js";
@@ -14,7 +14,7 @@ import {
14
14
  DEFAULT_BUILD_OPTIONS,
15
15
  getDefaultBuildPlugins,
16
16
  getOutputExtensionMap
17
- } from "./chunk-5KKE2KOP.js";
17
+ } from "./chunk-CD57N3DC.js";
18
18
  import "./chunk-T5272PC2.js";
19
19
  import "./chunk-LYDEMC26.js";
20
20
  import "./chunk-W5YHMJLR.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/esbuild",
3
- "version": "0.21.3",
3
+ "version": "0.21.5",
4
4
  "type": "module",
5
5
  "description": "A package containing `esbuild` utilities for building Storm Software libraries and applications",
6
6
  "repository": {
@@ -172,9 +172,9 @@
172
172
  "@microsoft/api-extractor": "^7.48.1",
173
173
  "@nx/devkit": "^20.3.1",
174
174
  "@nx/js": "^20.3.1",
175
- "@storm-software/build-tools": "0.135.6",
176
- "@storm-software/config": "1.98.3",
177
- "@storm-software/config-tools": "1.141.6",
175
+ "@storm-software/build-tools": "0.136.1",
176
+ "@storm-software/config": "1.99.1",
177
+ "@storm-software/config-tools": "1.142.1",
178
178
  "@types/node": "^22.10.2",
179
179
  "defu": "6.1.4",
180
180
  "esbuild": "^0.24.0",