@storm-software/build-tools 0.144.20 → 0.144.22

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.
Files changed (73) hide show
  1. package/README.md +1 -2
  2. package/dist/{chunk-6KESXKM3.mjs → chunk-2IACGL5A.mjs} +69 -34
  3. package/dist/{chunk-XLAPHZPX.mjs → chunk-3VZVP5XV.mjs} +0 -5
  4. package/dist/{chunk-MY55IIR6.js → chunk-673CAI2G.js} +5 -14
  5. package/dist/{chunk-M5AC3COW.mjs → chunk-7NL4YIH3.mjs} +4 -13
  6. package/dist/{chunk-LCPSDCDB.mjs → chunk-7YKXR5JJ.mjs} +1 -8
  7. package/dist/{chunk-F7WSCB6H.js → chunk-A75DEKU5.js} +1 -6
  8. package/dist/{chunk-H2MR24BL.mjs → chunk-BKMDH7XQ.mjs} +10 -16
  9. package/dist/chunk-D7ZBIHS7.mjs +76 -0
  10. package/dist/{chunk-STJ5NLSZ.mjs → chunk-DLSOQQ2X.mjs} +24 -11
  11. package/dist/{chunk-LWYVLXCJ.js → chunk-ECGZDTG2.js} +72 -37
  12. package/dist/{chunk-NSNKG4UV.js → chunk-EGKFW7BM.js} +168 -114
  13. package/dist/{chunk-T2R2KKTW.mjs → chunk-HGTDDXA5.mjs} +2 -5
  14. package/dist/{chunk-2TV7ZJSK.js → chunk-HQD5ZBIU.js} +2 -9
  15. package/dist/{chunk-A6F6NNS6.mjs → chunk-JJQN3HTQ.mjs} +183 -119
  16. package/dist/{chunk-CNURHK3D.mjs → chunk-KUEYIH7W.mjs} +2 -6
  17. package/dist/{chunk-Y3HRAWPU.js → chunk-N7HP2YYE.js} +9 -8
  18. package/dist/chunk-ODQKLK6L.mjs +69 -0
  19. package/dist/{chunk-CNKJQMCL.js → chunk-TABRPMJB.js} +28 -15
  20. package/dist/{chunk-JP4YIUPA.js → chunk-TQIOTV5X.js} +25 -21
  21. package/dist/{chunk-4Y7DUAMQ.js → chunk-TSUTFOQG.js} +17 -23
  22. package/dist/{chunk-PBTSVWXL.js → chunk-UHJ5ACWH.js} +3 -7
  23. package/dist/chunk-UNY7ZVZF.js +76 -0
  24. package/dist/{chunk-VQUREEMI.mjs → chunk-VGLIZ2H3.mjs} +8 -7
  25. package/dist/{chunk-QKEUU3L3.mjs → chunk-VWJLKDCB.mjs} +141 -87
  26. package/dist/{chunk-5HOBE4TZ.js → chunk-WLW3DA6X.js} +2 -5
  27. package/dist/{chunk-VSAQXEXD.js → chunk-WNMPQTPH.js} +39 -31
  28. package/dist/{chunk-QCTHJR6E.js → chunk-XXESPGZP.js} +184 -120
  29. package/dist/{chunk-67VZRCF5.mjs → chunk-YZ6ZTM5M.mjs} +27 -23
  30. package/dist/config.js +0 -1
  31. package/dist/config.mjs +0 -1
  32. package/dist/index.js +16 -17
  33. package/dist/index.mjs +15 -16
  34. package/dist/plugins/analyze.js +3 -4
  35. package/dist/plugins/analyze.mjs +2 -3
  36. package/dist/plugins/index.js +6 -7
  37. package/dist/plugins/index.mjs +5 -6
  38. package/dist/plugins/swc.js +2 -3
  39. package/dist/plugins/swc.mjs +1 -2
  40. package/dist/plugins/ts-resolve.js +3 -4
  41. package/dist/plugins/ts-resolve.mjs +2 -3
  42. package/dist/plugins/type-definitions.js +2 -3
  43. package/dist/plugins/type-definitions.mjs +1 -2
  44. package/dist/types.js +1 -1
  45. package/dist/types.mjs +1 -1
  46. package/dist/utilities/copy-assets.js +3 -4
  47. package/dist/utilities/copy-assets.mjs +2 -3
  48. package/dist/utilities/generate-package-json.js +3 -4
  49. package/dist/utilities/generate-package-json.mjs +2 -3
  50. package/dist/utilities/get-entry-points.js +3 -4
  51. package/dist/utilities/get-entry-points.mjs +2 -3
  52. package/dist/utilities/get-env.js +2 -3
  53. package/dist/utilities/get-env.mjs +1 -2
  54. package/dist/utilities/get-file-banner.js +2 -3
  55. package/dist/utilities/get-file-banner.mjs +1 -2
  56. package/dist/utilities/get-out-extension.js +2 -3
  57. package/dist/utilities/get-out-extension.mjs +1 -2
  58. package/dist/utilities/get-project-deps.js +2 -3
  59. package/dist/utilities/get-project-deps.mjs +1 -2
  60. package/dist/utilities/index.js +11 -12
  61. package/dist/utilities/index.mjs +10 -11
  62. package/dist/utilities/read-nx-config.js +3 -4
  63. package/dist/utilities/read-nx-config.mjs +2 -3
  64. package/dist/utilities/task-graph.js +2 -3
  65. package/dist/utilities/task-graph.mjs +1 -2
  66. package/package.json +1 -1
  67. package/dist/chunk-O6YSETKJ.mjs +0 -6
  68. package/dist/chunk-S5V4ROWC.js +0 -67
  69. package/dist/chunk-S7LT43EW.mjs +0 -67
  70. package/dist/chunk-SHUYVCID.js +0 -6
  71. package/dist/chunk-ZW5JWBA4.mjs +0 -61
  72. /package/dist/{chunk-GGNOJ77I.js → chunk-6F4PWJZI.js} +0 -0
  73. /package/dist/{chunk-WAXGOBY2.mjs → chunk-WBQAMGXK.mjs} +0 -0
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.144.19-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.144.21-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 -->
@@ -40,7 +40,6 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
40
40
 
41
41
  <!-- START doctoc -->
42
42
  <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
43
-
44
43
  ## Table of Contents
45
44
 
46
45
  - [Storm Build Tools](#storm-build-tools)
@@ -2,18 +2,19 @@ import {
2
2
  findWorkspaceRoot,
3
3
  joinPaths,
4
4
  writeTrace
5
- } from "./chunk-A6F6NNS6.mjs";
6
- import {
7
- __name
8
- } from "./chunk-O6YSETKJ.mjs";
5
+ } from "./chunk-JJQN3HTQ.mjs";
9
6
 
10
7
  // src/utilities/generate-package-json.ts
11
8
  import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
12
9
  import { Glob } from "glob";
13
10
  import { existsSync, readFileSync } from "node:fs";
14
11
  import { readFile } from "node:fs/promises";
15
- import { createProjectGraphAsync, readCachedProjectGraph, readProjectsConfigurationFromProjectGraph } from "nx/src/project-graph/project-graph";
16
- var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
12
+ import {
13
+ createProjectGraphAsync,
14
+ readCachedProjectGraph,
15
+ readProjectsConfigurationFromProjectGraph
16
+ } from "nx/src/project-graph/project-graph";
17
+ var addPackageDependencies = async (workspaceRoot, projectRoot, projectName, packageJson) => {
17
18
  let projectGraph;
18
19
  try {
19
20
  projectGraph = readCachedProjectGraph();
@@ -22,16 +23,35 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
22
23
  projectGraph = readCachedProjectGraph();
23
24
  }
24
25
  if (!projectGraph) {
25
- throw new Error("The Build process failed because the project graph is not available. Please run the build command again.");
26
+ throw new Error(
27
+ "The Build process failed because the project graph is not available. Please run the build command again."
28
+ );
26
29
  }
27
- const projectDependencies = calculateProjectBuildableDependencies(void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
30
+ const projectDependencies = calculateProjectBuildableDependencies(
31
+ void 0,
32
+ projectGraph,
33
+ workspaceRoot,
34
+ projectName,
35
+ process.env.NX_TASK_TARGET_TARGET || "build",
36
+ process.env.NX_TASK_TARGET_CONFIGURATION || "production",
37
+ true
38
+ );
28
39
  const localPackages = [];
29
- for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data?.root !== projectRoot && dep.node.data?.root !== workspaceRoot)) {
40
+ for (const project of projectDependencies.dependencies.filter(
41
+ (dep) => dep.node.type === "lib" && dep.node.data?.root !== projectRoot && dep.node.data?.root !== workspaceRoot
42
+ )) {
30
43
  const projectNode = project.node;
31
44
  if (projectNode.data.root) {
32
- const projectPackageJsonPath = joinPaths(workspaceRoot, projectNode.data.root, "package.json");
45
+ const projectPackageJsonPath = joinPaths(
46
+ workspaceRoot,
47
+ projectNode.data.root,
48
+ "package.json"
49
+ );
33
50
  if (existsSync(projectPackageJsonPath)) {
34
- const projectPackageJsonContent = await readFile(projectPackageJsonPath, "utf8");
51
+ const projectPackageJsonContent = await readFile(
52
+ projectPackageJsonPath,
53
+ "utf8"
54
+ );
35
55
  const projectPackageJson = JSON.parse(projectPackageJsonContent);
36
56
  if (projectPackageJson.private !== true) {
37
57
  localPackages.push(projectPackageJson);
@@ -40,19 +60,33 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
40
60
  }
41
61
  }
42
62
  if (localPackages.length > 0) {
43
- writeTrace(`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
44
- const projectJsonFile = await readFile(joinPaths(projectRoot, "project.json"), "utf8");
63
+ writeTrace(
64
+ `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`
65
+ );
66
+ const projectJsonFile = await readFile(
67
+ joinPaths(projectRoot, "project.json"),
68
+ "utf8"
69
+ );
45
70
  const projectJson = JSON.parse(projectJsonFile);
46
71
  const projectName2 = projectJson.name;
47
72
  const projectConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
48
73
  if (!projectConfigurations?.projects?.[projectName2]) {
49
- 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.");
74
+ throw new Error(
75
+ "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."
76
+ );
50
77
  }
51
78
  const implicitDependencies = projectConfigurations.projects?.[projectName2].implicitDependencies?.reduce((ret, dep) => {
52
79
  if (projectConfigurations.projects?.[dep]) {
53
- const depPackageJsonPath = joinPaths(workspaceRoot, projectConfigurations.projects[dep].root, "package.json");
80
+ const depPackageJsonPath = joinPaths(
81
+ workspaceRoot,
82
+ projectConfigurations.projects[dep].root,
83
+ "package.json"
84
+ );
54
85
  if (existsSync(depPackageJsonPath)) {
55
- const depPackageJsonContent = readFileSync(depPackageJsonPath, "utf8");
86
+ const depPackageJsonContent = readFileSync(
87
+ depPackageJsonPath,
88
+ "utf8"
89
+ );
56
90
  const depPackageJson = JSON.parse(depPackageJsonContent);
57
91
  if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
58
92
  ret.push(depPackageJson.name);
@@ -77,10 +111,13 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
77
111
  writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
78
112
  }
79
113
  return packageJson;
80
- }, "addPackageDependencies");
81
- var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
114
+ };
115
+ var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
82
116
  const workspaceRoot = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : findWorkspaceRoot();
83
- const workspacePackageJsonContent = await readFile(joinPaths(workspaceRoot, "package.json"), "utf8");
117
+ const workspacePackageJsonContent = await readFile(
118
+ joinPaths(workspaceRoot, "package.json"),
119
+ "utf8"
120
+ );
84
121
  const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
85
122
  packageJson.type ??= "module";
86
123
  packageJson.sideEffects ??= false;
@@ -91,9 +128,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (workspaceConfi
91
128
  }
92
129
  packageJson.source ??= `${joinPaths(distSrc, "index.ts").replaceAll("\\", "/")}`;
93
130
  }
94
- packageJson.files ??= [
95
- "dist/**/*"
96
- ];
131
+ packageJson.files ??= ["dist/**/*"];
97
132
  if (includeSrc === true && !packageJson.files.includes("src")) {
98
133
  packageJson.files.push("src/**/*");
99
134
  }
@@ -109,21 +144,17 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (workspaceConfi
109
144
  packageJson.author ??= workspacePackageJson.author;
110
145
  packageJson.maintainers ??= workspacePackageJson.maintainers;
111
146
  if (!packageJson.maintainers && packageJson.author) {
112
- packageJson.maintainers = [
113
- packageJson.author
114
- ];
147
+ packageJson.maintainers = [packageJson.author];
115
148
  }
116
149
  packageJson.contributors ??= workspacePackageJson.contributors;
117
150
  if (!packageJson.contributors && packageJson.author) {
118
- packageJson.contributors = [
119
- packageJson.author
120
- ];
151
+ packageJson.contributors = [packageJson.author];
121
152
  }
122
153
  packageJson.repository ??= workspacePackageJson.repository;
123
154
  packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
124
155
  return packageJson;
125
- }, "addWorkspacePackageJsonFields");
126
- var addPackageJsonExport = /* @__PURE__ */ __name((file, type = "module", sourceRoot) => {
156
+ };
157
+ var addPackageJsonExport = (file, type = "module", sourceRoot) => {
127
158
  let entry = file.replaceAll("\\", "/");
128
159
  if (sourceRoot) {
129
160
  entry = entry.replace(sourceRoot, "");
@@ -142,8 +173,8 @@ var addPackageJsonExport = /* @__PURE__ */ __name((file, type = "module", source
142
173
  default: `./dist/${entry}.js`
143
174
  }
144
175
  };
145
- }, "addPackageJsonExport");
146
- var addPackageJsonExports = /* @__PURE__ */ __name(async (sourceRoot, packageJson) => {
176
+ };
177
+ var addPackageJsonExports = async (sourceRoot, packageJson) => {
147
178
  packageJson.exports ??= {};
148
179
  const files = await new Glob("**/*.{ts,tsx}", {
149
180
  absolute: false,
@@ -155,7 +186,11 @@ var addPackageJsonExports = /* @__PURE__ */ __name(async (sourceRoot, packageJso
155
186
  const split = file.split(".");
156
187
  split.pop();
157
188
  const entry = split.join(".").replaceAll("\\", "/");
158
- packageJson.exports[`./${entry}`] ??= addPackageJsonExport(entry, packageJson.type, sourceRoot);
189
+ packageJson.exports[`./${entry}`] ??= addPackageJsonExport(
190
+ entry,
191
+ packageJson.type,
192
+ sourceRoot
193
+ );
159
194
  });
160
195
  packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
161
196
  packageJson.module = packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
@@ -170,7 +205,7 @@ var addPackageJsonExports = /* @__PURE__ */ __name(async (sourceRoot, packageJso
170
205
  packageJson.exports["./package.json"] ??= "./package.json";
171
206
  packageJson.exports["."] = packageJson.exports["."] ?? addPackageJsonExport("index", packageJson.type, sourceRoot);
172
207
  return packageJson;
173
- }, "addPackageJsonExports");
208
+ };
174
209
 
175
210
  export {
176
211
  addPackageDependencies,
@@ -1,7 +1,3 @@
1
- import {
2
- __name
3
- } from "./chunk-O6YSETKJ.mjs";
4
-
5
1
  // src/utilities/get-out-extension.ts
6
2
  function getOutExtension(format, pkgType) {
7
3
  let jsExtension = ".js";
@@ -20,7 +16,6 @@ function getOutExtension(format, pkgType) {
20
16
  dts: dtsExtension
21
17
  };
22
18
  }
23
- __name(getOutExtension, "getOutExtension");
24
19
 
25
20
  export {
26
21
  getOutExtension
@@ -1,12 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkQCTHJR6Ejs = require('./chunk-QCTHJR6E.js');
4
-
5
-
6
- var _chunkSHUYVCIDjs = require('./chunk-SHUYVCID.js');
3
+ var _chunkXXESPGZPjs = require('./chunk-XXESPGZP.js');
7
4
 
8
5
  // src/plugins/analyze.ts
9
- var formatBytes = /* @__PURE__ */ _chunkSHUYVCIDjs.__name.call(void 0, (bytes) => {
6
+ var formatBytes = (bytes) => {
10
7
  if (bytes === 0) {
11
8
  return "0 Bytes";
12
9
  }
@@ -15,26 +12,20 @@ var formatBytes = /* @__PURE__ */ _chunkSHUYVCIDjs.__name.call(void 0, (bytes) =
15
12
  }
16
13
  const k = 1e3;
17
14
  const dm = 3;
18
- const sizes = [
19
- "Bytes",
20
- "KB",
21
- "MB",
22
- "GB"
23
- ];
15
+ const sizes = ["Bytes", "KB", "MB", "GB"];
24
16
  const i = Math.floor(Math.log(bytes) / Math.log(k));
25
17
  return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
26
- }, "formatBytes");
18
+ };
27
19
  function analyze() {
28
20
  return {
29
21
  name: "storm:plugin-analyzer",
30
22
  renderChunk(source, chunk) {
31
23
  const sourceBytes = formatBytes(source.length);
32
24
  const fileName = chunk.fileName;
33
- _chunkQCTHJR6Ejs.writeInfo.call(void 0, ` - ${fileName} ${sourceBytes}`);
25
+ _chunkXXESPGZPjs.writeInfo.call(void 0, ` - ${fileName} ${sourceBytes}`);
34
26
  }
35
27
  };
36
28
  }
37
- _chunkSHUYVCIDjs.__name.call(void 0, analyze, "analyze");
38
29
 
39
30
 
40
31
 
@@ -1,12 +1,9 @@
1
1
  import {
2
2
  writeInfo
3
- } from "./chunk-A6F6NNS6.mjs";
4
- import {
5
- __name
6
- } from "./chunk-O6YSETKJ.mjs";
3
+ } from "./chunk-JJQN3HTQ.mjs";
7
4
 
8
5
  // src/plugins/analyze.ts
9
- var formatBytes = /* @__PURE__ */ __name((bytes) => {
6
+ var formatBytes = (bytes) => {
10
7
  if (bytes === 0) {
11
8
  return "0 Bytes";
12
9
  }
@@ -15,15 +12,10 @@ var formatBytes = /* @__PURE__ */ __name((bytes) => {
15
12
  }
16
13
  const k = 1e3;
17
14
  const dm = 3;
18
- const sizes = [
19
- "Bytes",
20
- "KB",
21
- "MB",
22
- "GB"
23
- ];
15
+ const sizes = ["Bytes", "KB", "MB", "GB"];
24
16
  const i = Math.floor(Math.log(bytes) / Math.log(k));
25
17
  return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
26
- }, "formatBytes");
18
+ };
27
19
  function analyze() {
28
20
  return {
29
21
  name: "storm:plugin-analyzer",
@@ -34,7 +26,6 @@ function analyze() {
34
26
  }
35
27
  };
36
28
  }
37
- __name(analyze, "analyze");
38
29
 
39
30
  export {
40
31
  analyze
@@ -1,7 +1,3 @@
1
- import {
2
- __name
3
- } from "./chunk-O6YSETKJ.mjs";
4
-
5
1
  // src/plugins/swc.ts
6
2
  import { transform } from "@swc/core";
7
3
  function swc() {
@@ -12,16 +8,13 @@ function swc() {
12
8
  filename,
13
9
  jsc: {
14
10
  transform: {
15
- react: {
16
- runtime: "automatic"
17
- }
11
+ react: { runtime: "automatic" }
18
12
  }
19
13
  }
20
14
  });
21
15
  }
22
16
  };
23
17
  }
24
- __name(swc, "swc");
25
18
 
26
19
  export {
27
20
  swc
@@ -1,8 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkSHUYVCIDjs = require('./chunk-SHUYVCID.js');
4
-
5
- // src/utilities/get-out-extension.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utilities/get-out-extension.ts
6
2
  function getOutExtension(format, pkgType) {
7
3
  let jsExtension = ".js";
8
4
  const dtsExtension = ".d.ts";
@@ -20,7 +16,6 @@ function getOutExtension(format, pkgType) {
20
16
  dts: dtsExtension
21
17
  };
22
18
  }
23
- _chunkSHUYVCIDjs.__name.call(void 0, getOutExtension, "getOutExtension");
24
19
 
25
20
 
26
21
 
@@ -1,16 +1,13 @@
1
1
  import {
2
2
  writeDebug
3
- } from "./chunk-A6F6NNS6.mjs";
4
- import {
5
- __name
6
- } from "./chunk-O6YSETKJ.mjs";
3
+ } from "./chunk-JJQN3HTQ.mjs";
7
4
 
8
5
  // src/plugins/ts-resolve.ts
9
6
  import fs from "node:fs";
10
7
  import { builtinModules } from "node:module";
11
8
  import path from "node:path";
12
9
  import _resolve from "resolve";
13
- var resolveModule = /* @__PURE__ */ __name((id, opts) => new Promise((resolve, reject) => {
10
+ var resolveModule = (id, opts) => new Promise((resolve, reject) => {
14
11
  _resolve(id, opts, (err, res) => {
15
12
  if (err?.code === "MODULE_NOT_FOUND") {
16
13
  return resolve(null);
@@ -20,12 +17,12 @@ var resolveModule = /* @__PURE__ */ __name((id, opts) => new Promise((resolve, r
20
17
  }
21
18
  resolve(res || null);
22
19
  });
23
- }), "resolveModule");
24
- var tsResolvePlugin = /* @__PURE__ */ __name(({ resolveOnly, ignore } = {}) => {
25
- const resolveExtensions = [
26
- ".d.ts",
27
- ".ts"
28
- ];
20
+ });
21
+ var tsResolvePlugin = ({
22
+ resolveOnly,
23
+ ignore
24
+ } = {}) => {
25
+ const resolveExtensions = [".d.ts", ".ts"];
29
26
  return {
30
27
  name: `storm:ts-resolve`,
31
28
  async resolveId(source, importer) {
@@ -80,10 +77,7 @@ var tsResolvePlugin = /* @__PURE__ */ __name(({ resolveOnly, ignore } = {}) => {
80
77
  pkg.main = pkg.types || pkg.typings;
81
78
  return pkg;
82
79
  },
83
- paths: [
84
- "node_modules",
85
- "node_modules/@types"
86
- ]
80
+ paths: ["node_modules", "node_modules/@types"]
87
81
  });
88
82
  }
89
83
  if (id) {
@@ -94,7 +88,7 @@ var tsResolvePlugin = /* @__PURE__ */ __name(({ resolveOnly, ignore } = {}) => {
94
88
  return false;
95
89
  }
96
90
  };
97
- }, "tsResolvePlugin");
91
+ };
98
92
 
99
93
  export {
100
94
  tsResolvePlugin
@@ -0,0 +1,76 @@
1
+ import {
2
+ correctPaths,
3
+ findWorkspaceRoot,
4
+ joinPaths,
5
+ writeDebug
6
+ } from "./chunk-JJQN3HTQ.mjs";
7
+
8
+ // src/utilities/get-entry-points.ts
9
+ import { glob } from "glob";
10
+ var getEntryPoints = async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
11
+ const workspaceRoot = config.workspaceRoot || findWorkspaceRoot();
12
+ const entryPoints = [];
13
+ if (entry) {
14
+ if (typeof entry === "string") {
15
+ entryPoints.push(entry);
16
+ } else if (Array.isArray(entry)) {
17
+ entryPoints.push(...entry);
18
+ } else {
19
+ entryPoints.push(...Object.values(entry));
20
+ }
21
+ }
22
+ if (emitOnAll) {
23
+ entryPoints.push(
24
+ joinPaths(workspaceRoot, sourceRoot || projectRoot, "**/*.{ts,tsx}")
25
+ );
26
+ }
27
+ const results = await Promise.all(
28
+ entryPoints.map(async (entryPoint) => {
29
+ const paths = [];
30
+ if (entryPoint.includes("*")) {
31
+ const files = await glob(entryPoint, {
32
+ withFileTypes: true,
33
+ ignore: ["**/node_modules/**"]
34
+ });
35
+ paths.push(
36
+ ...files.reduce((ret, filePath) => {
37
+ const result = correctPaths(
38
+ joinPaths(filePath.path, filePath.name).replaceAll(correctPaths(workspaceRoot), "").replaceAll(correctPaths(projectRoot), "")
39
+ );
40
+ if (result) {
41
+ writeDebug(
42
+ `Trying to add entry point ${result} at "${joinPaths(
43
+ filePath.path,
44
+ filePath.name
45
+ )}"`,
46
+ config
47
+ );
48
+ if (!paths.includes(result)) {
49
+ paths.push(result);
50
+ }
51
+ }
52
+ return ret;
53
+ }, [])
54
+ );
55
+ } else {
56
+ writeDebug(`Trying to add entry point ${entryPoint}"`, config);
57
+ if (!paths.includes(entryPoint)) {
58
+ paths.push(entryPoint);
59
+ }
60
+ }
61
+ return paths;
62
+ })
63
+ );
64
+ return results.filter(Boolean).reduce((ret, result) => {
65
+ result.forEach((res) => {
66
+ if (res && !ret.includes(res)) {
67
+ ret.push(res);
68
+ }
69
+ });
70
+ return ret;
71
+ }, []);
72
+ };
73
+
74
+ export {
75
+ getEntryPoints
76
+ };
@@ -2,16 +2,13 @@ import {
2
2
  joinPaths,
3
3
  writeDebug,
4
4
  writeTrace
5
- } from "./chunk-A6F6NNS6.mjs";
6
- import {
7
- __name
8
- } from "./chunk-O6YSETKJ.mjs";
5
+ } from "./chunk-JJQN3HTQ.mjs";
9
6
 
10
7
  // src/utilities/copy-assets.ts
11
8
  import { CopyAssetsHandler } from "@nx/js/src/utils/assets/copy-assets-handler";
12
9
  import { glob } from "glob";
13
10
  import { readFile, writeFile } from "node:fs/promises";
14
- var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson = true, includeSrc = false, banner, footer) => {
11
+ var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson = true, includeSrc = false, banner, footer) => {
15
12
  const pendingAssets = Array.from(assets ?? []);
16
13
  pendingAssets.push({
17
14
  input: projectRoot,
@@ -37,8 +34,11 @@ var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, proje
37
34
  output: "src/"
38
35
  });
39
36
  }
40
- writeTrace(`\u{1F4DD} Copying the following assets to the output directory:
41
- ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${joinPaths(outputPath, pendingAsset.output)}`).join("\n")}`, config);
37
+ writeTrace(
38
+ `\u{1F4DD} Copying the following assets to the output directory:
39
+ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${joinPaths(outputPath, pendingAsset.output)}`).join("\n")}`,
40
+ config
41
+ );
42
42
  const assetHandler = new CopyAssetsHandler({
43
43
  projectDir: projectRoot,
44
44
  rootDir: config.workspaceRoot,
@@ -47,20 +47,33 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
47
47
  });
48
48
  await assetHandler.processAllAssetsOnce();
49
49
  if (includeSrc === true) {
50
- writeDebug(`\u{1F4DD} Adding banner and writing source files: ${joinPaths(outputPath, "src")}`, config);
50
+ writeDebug(
51
+ `\u{1F4DD} Adding banner and writing source files: ${joinPaths(
52
+ outputPath,
53
+ "src"
54
+ )}`,
55
+ config
56
+ );
51
57
  const files = await glob([
52
58
  joinPaths(config.workspaceRoot, outputPath, "src/**/*.ts"),
53
59
  joinPaths(config.workspaceRoot, outputPath, "src/**/*.tsx"),
54
60
  joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
55
61
  joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
56
62
  ]);
57
- await Promise.allSettled(files.map(async (file) => writeFile(file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
63
+ await Promise.allSettled(
64
+ files.map(
65
+ async (file) => writeFile(
66
+ file,
67
+ `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
58
68
 
59
69
  ${await readFile(file, "utf8")}
60
70
 
61
- ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
71
+ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
72
+ )
73
+ )
74
+ );
62
75
  }
63
- }, "copyAssets");
76
+ };
64
77
 
65
78
  export {
66
79
  copyAssets