@storm-software/workspace-tools 1.263.1 → 1.264.0

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 (146) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +12 -30
  3. package/dist/{chunk-G6GGPUG7.mjs → chunk-267XQYEI.mjs} +4 -4
  4. package/dist/{chunk-2WTKQCPA.mjs → chunk-2BPV2XV2.mjs} +1 -1
  5. package/dist/{chunk-GCN3NUF6.mjs → chunk-3FTFBAIV.mjs} +1 -1
  6. package/dist/{chunk-OQ32KFGA.mjs → chunk-3PWCELL5.mjs} +2 -2
  7. package/dist/{chunk-IT3ENPW3.mjs → chunk-3RLLSZI3.mjs} +3 -3
  8. package/dist/{chunk-XEHJM6RO.mjs → chunk-5CZXBNEE.mjs} +1 -1
  9. package/dist/{chunk-VOIYJ67D.mjs → chunk-5DWBECCN.mjs} +4 -4
  10. package/dist/{chunk-GPOYI6OO.mjs → chunk-77KNPIOO.mjs} +3 -3
  11. package/dist/{chunk-4PDLEPIC.mjs → chunk-7ENGREV2.mjs} +1 -1
  12. package/dist/{chunk-IGJN2SBZ.mjs → chunk-AD4BVP7F.mjs} +2 -2
  13. package/dist/{chunk-HASYGI6W.mjs → chunk-ATIBREWM.mjs} +1 -1
  14. package/dist/{chunk-5JPH5VCU.mjs → chunk-AWKIWCLR.mjs} +2 -2
  15. package/dist/{chunk-GRU4UEE7.mjs → chunk-BMNXBEWE.mjs} +3 -3
  16. package/dist/{chunk-BV32SZPV.mjs → chunk-EVQJFIA7.mjs} +3 -3
  17. package/dist/{chunk-3I74ESKM.mjs → chunk-FIJJTQKT.mjs} +3 -3
  18. package/dist/{chunk-2PKZRCQJ.mjs → chunk-FR3YQN55.mjs} +2 -2
  19. package/dist/{chunk-U6DRC3BT.mjs → chunk-G6VTRIV6.mjs} +4 -4
  20. package/dist/{chunk-STVTZJIX.mjs → chunk-GKFEPODO.mjs} +3 -3
  21. package/dist/{chunk-6YMGUA6X.mjs → chunk-H5VTYV4U.mjs} +2 -2
  22. package/dist/{chunk-J53HKGFM.mjs → chunk-HUVBVDJ7.mjs} +1 -1
  23. package/dist/{chunk-L6CV744X.mjs → chunk-IXZ3PGBP.mjs} +3 -3
  24. package/dist/{chunk-GHJGKUBW.mjs → chunk-JIAGNEII.mjs} +1 -1
  25. package/dist/{chunk-H4RWKANW.mjs → chunk-KTJM6G4K.mjs} +1 -1
  26. package/dist/{chunk-TAJU54DW.mjs → chunk-LZ4WXOF5.mjs} +3 -3
  27. package/dist/{chunk-RGZAGFUD.mjs → chunk-MDK5L6VS.mjs} +4 -4
  28. package/dist/{chunk-3ABED6KX.mjs → chunk-NZAGHP4Q.mjs} +4 -4
  29. package/dist/{chunk-6QKCP4DS.js → chunk-PD4CDI7L.js} +296 -41
  30. package/dist/{chunk-R2BMSX6J.mjs → chunk-RLG36VMZ.mjs} +3 -3
  31. package/dist/{chunk-XIS3TY42.mjs → chunk-RMNEVFW4.mjs} +4 -4
  32. package/dist/{chunk-3XR4FSEA.mjs → chunk-V4QUJRZH.mjs} +4 -4
  33. package/dist/{chunk-AOOHLS72.mjs → chunk-VJJBBVYU.mjs} +3 -3
  34. package/dist/{chunk-EF7U4632.mjs → chunk-VYHRGNJQ.mjs} +306 -51
  35. package/dist/{chunk-OBUTMEEY.mjs → chunk-XB6ATVWM.mjs} +3 -3
  36. package/dist/{chunk-OVLYU6HE.mjs → chunk-XBRJIYCS.mjs} +2 -2
  37. package/dist/{chunk-HY43JWZ7.mjs → chunk-XDVGK64G.mjs} +2 -2
  38. package/dist/{chunk-RULS5ZOT.mjs → chunk-YBDZ7EWU.mjs} +2 -2
  39. package/dist/{chunk-BGSGM2KX.mjs → chunk-YPUNRGTW.mjs} +3 -3
  40. package/dist/{chunk-SF477J3B.mjs → chunk-YZLAY7R4.mjs} +3 -3
  41. package/dist/{chunk-WJTTZD3M.mjs → chunk-ZETTXDZO.mjs} +1 -1
  42. package/dist/{chunk-DGI7OQYG.mjs → chunk-ZPN57TH7.mjs} +4 -4
  43. package/dist/{chunk-B5OPGMAP.mjs → chunk-ZUYLHO4U.mjs} +1 -1
  44. package/dist/executors.d.mts +0 -1
  45. package/dist/executors.d.ts +0 -1
  46. package/dist/executors.js +5 -10
  47. package/dist/executors.mjs +23 -28
  48. package/dist/generators.js +5 -5
  49. package/dist/generators.mjs +20 -20
  50. package/dist/index.d.mts +0 -1
  51. package/dist/index.d.ts +0 -1
  52. package/dist/index.js +10 -15
  53. package/dist/index.mjs +45 -50
  54. package/dist/src/base/base-executor.mjs +6 -6
  55. package/dist/src/base/base-executor.untyped.mjs +1 -1
  56. package/dist/src/base/base-generator.mjs +6 -6
  57. package/dist/src/base/base-generator.untyped.mjs +1 -1
  58. package/dist/src/base/cargo-base-executor.untyped.mjs +1 -1
  59. package/dist/src/base/index.mjs +10 -10
  60. package/dist/src/base/typescript-build-executor.untyped.mjs +2 -2
  61. package/dist/src/base/typescript-library-generator.untyped.mjs +1 -1
  62. package/dist/src/executors/cargo-build/executor.mjs +8 -8
  63. package/dist/src/executors/cargo-build/untyped.mjs +1 -1
  64. package/dist/src/executors/cargo-check/executor.mjs +8 -8
  65. package/dist/src/executors/cargo-check/untyped.mjs +1 -1
  66. package/dist/src/executors/cargo-clippy/executor.mjs +8 -8
  67. package/dist/src/executors/cargo-clippy/untyped.mjs +1 -1
  68. package/dist/src/executors/cargo-doc/executor.mjs +8 -8
  69. package/dist/src/executors/cargo-doc/untyped.mjs +1 -1
  70. package/dist/src/executors/cargo-format/executor.mjs +8 -8
  71. package/dist/src/executors/cargo-format/untyped.mjs +1 -1
  72. package/dist/src/executors/cargo-publish/executor.mjs +3 -3
  73. package/dist/src/executors/cargo-publish/untyped.mjs +1 -1
  74. package/dist/src/executors/clean-package/executor.mjs +6 -6
  75. package/dist/src/executors/clean-package/untyped.mjs +1 -1
  76. package/dist/src/executors/esbuild/executor.js +2 -3
  77. package/dist/src/executors/esbuild/executor.mjs +7 -8
  78. package/dist/src/executors/esbuild/untyped.mjs +2 -2
  79. package/dist/src/executors/npm-publish/executor.mjs +4 -4
  80. package/dist/src/executors/npm-publish/untyped.mjs +1 -1
  81. package/dist/src/executors/size-limit/executor.mjs +7 -7
  82. package/dist/src/executors/size-limit/untyped.mjs +1 -1
  83. package/dist/src/executors/typia/executor.mjs +7 -7
  84. package/dist/src/executors/typia/untyped.mjs +1 -1
  85. package/dist/src/executors/unbuild/executor.mjs +7 -7
  86. package/dist/src/executors/unbuild/untyped.mjs +2 -2
  87. package/dist/src/generators/browser-library/generator.mjs +9 -9
  88. package/dist/src/generators/browser-library/untyped.mjs +1 -1
  89. package/dist/src/generators/config-schema/generator.mjs +7 -7
  90. package/dist/src/generators/config-schema/untyped.mjs +1 -1
  91. package/dist/src/generators/init/init.mjs +2 -2
  92. package/dist/src/generators/init/untyped.mjs +1 -1
  93. package/dist/src/generators/neutral-library/generator.mjs +9 -9
  94. package/dist/src/generators/neutral-library/untyped.mjs +1 -1
  95. package/dist/src/generators/node-library/generator.mjs +9 -9
  96. package/dist/src/generators/node-library/untyped.mjs +1 -1
  97. package/dist/src/generators/preset/generator.mjs +7 -7
  98. package/dist/src/generators/preset/untyped.mjs +1 -1
  99. package/dist/src/generators/release-version/generator.mjs +6 -6
  100. package/dist/src/generators/release-version/untyped.mjs +1 -1
  101. package/dist/src/plugins/rust/cargo-toml.mjs +4 -4
  102. package/dist/src/plugins/rust/index.mjs +4 -4
  103. package/dist/src/plugins/typescript/index.mjs +4 -4
  104. package/dist/src/plugins/typescript/project-config.mjs +4 -4
  105. package/dist/src/plugins/typescript/tsup.mjs +2 -2
  106. package/dist/src/plugins/typescript/untyped-schema.mjs +2 -2
  107. package/dist/src/types.mjs +1 -1
  108. package/dist/src/utils/apply-workspace-tokens.mjs +4 -4
  109. package/dist/src/utils/cargo.mjs +2 -2
  110. package/dist/src/utils/create-cli-options.mjs +2 -2
  111. package/dist/src/utils/get-project-configurations.mjs +4 -4
  112. package/dist/src/utils/index.mjs +14 -14
  113. package/dist/src/utils/lock-file.mjs +2 -2
  114. package/dist/src/utils/package-helpers.mjs +4 -4
  115. package/dist/src/utils/plugin-helpers.mjs +3 -3
  116. package/dist/src/utils/pnpm-deps-update.mjs +3 -3
  117. package/dist/src/utils/project-tags.mjs +2 -2
  118. package/dist/src/utils/toml.mjs +2 -2
  119. package/dist/src/utils/typia-transform.mjs +2 -2
  120. package/dist/src/utils/versions.mjs +1 -1
  121. package/executors.json +0 -5
  122. package/package.json +3 -6
  123. package/dist/chunk-55IQXVOQ.js +0 -308
  124. package/dist/chunk-IFSORSAN.js +0 -304
  125. package/dist/chunk-SE2XSR7P.mjs +0 -304
  126. package/dist/chunk-UFPTODUJ.mjs +0 -308
  127. package/dist/executor-BDvqiAmr.d.ts +0 -144
  128. package/dist/executor-KAQdKP88.d.mts +0 -144
  129. package/dist/src/executors/tsdown/executor.d.mts +0 -4
  130. package/dist/src/executors/tsdown/executor.d.ts +0 -4
  131. package/dist/src/executors/tsdown/executor.js +0 -15
  132. package/dist/src/executors/tsdown/executor.mjs +0 -15
  133. package/dist/src/executors/tsdown/schema.d.ts +0 -135
  134. package/dist/src/executors/tsdown/schema.json +0 -174
  135. package/dist/src/executors/tsdown/schema.md +0 -126
  136. package/dist/src/executors/tsdown/untyped.d.mts +0 -5
  137. package/dist/src/executors/tsdown/untyped.d.ts +0 -5
  138. package/dist/src/executors/tsdown/untyped.js +0 -19
  139. package/dist/src/executors/tsdown/untyped.mjs +0 -19
  140. package/dist/src/plugins/typescript/tsdown.d.mts +0 -7
  141. package/dist/src/plugins/typescript/tsdown.d.ts +0 -7
  142. package/dist/src/plugins/typescript/tsdown.js +0 -159
  143. package/dist/src/plugins/typescript/tsdown.mjs +0 -159
  144. package/docs/api/executors/tsdown/schema.md +0 -126
  145. /package/dist/{chunk-3J53KHVV.js → chunk-7VDOGZYO.js} +0 -0
  146. /package/dist/{chunk-V7YZ3666.mjs → chunk-BLX5SLPC.mjs} +0 -0
@@ -1,308 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
- var _chunkIFSORSANjs = require('./chunk-IFSORSAN.js');
10
-
11
-
12
- var _chunkFGMOZZ77js = require('./chunk-FGMOZZ77.js');
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
- var _chunkNG6GE2YZjs = require('./chunk-NG6GE2YZ.js');
23
-
24
-
25
- var _chunkJTAXCQX6js = require('./chunk-JTAXCQX6.js');
26
-
27
-
28
- var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
29
-
30
- // ../tsdown/src/build.ts
31
- var _devkit = require('@nx/devkit');
32
- var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
33
- var _fs = require('fs');
34
- var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
35
- var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
36
- var _tsdown = require('tsdown');
37
-
38
- // ../tsdown/src/clean.ts
39
-
40
- async function cleanDirectories(name = "TSDown", directory, config) {
41
- await _promises.rm.call(void 0, directory, {
42
- recursive: true,
43
- force: true
44
- });
45
- }
46
- _chunk3GQAWCBQjs.__name.call(void 0, cleanDirectories, "cleanDirectories");
47
-
48
- // ../tsdown/src/config.ts
49
- var DEFAULT_BUILD_OPTIONS = {
50
- platform: "node",
51
- target: "node22",
52
- format: [
53
- "esm",
54
- "cjs"
55
- ],
56
- tsconfig: "tsconfig.json",
57
- mode: "production",
58
- globalName: "globalThis",
59
- unused: {
60
- level: "error"
61
- },
62
- injectShims: true,
63
- watch: false,
64
- bundle: true,
65
- treeshake: true,
66
- clean: true,
67
- debug: false
68
- };
69
-
70
- // ../tsdown/src/build.ts
71
- var resolveOptions = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (userOptions) => {
72
- const projectRoot = userOptions.projectRoot;
73
- const workspaceRoot = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
74
- if (!workspaceRoot) {
75
- throw new Error("Cannot find Nx workspace root");
76
- }
77
- const config = await _chunkNG6GE2YZjs.getConfig.call(void 0, workspaceRoot.dir);
78
- _chunkNG6GE2YZjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
79
- const stopwatch = _chunkNG6GE2YZjs.getStopwatch.call(void 0, "Build options resolution");
80
- const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
81
- exitOnError: true
82
- });
83
- const projectJsonPath = _chunkJTAXCQX6js.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "project.json");
84
- if (!_fs.existsSync.call(void 0, projectJsonPath)) {
85
- throw new Error("Cannot find project.json configuration");
86
- }
87
- const projectJsonFile = await _promises2.default.readFile(projectJsonPath, "utf8");
88
- const projectJson = JSON.parse(projectJsonFile);
89
- const projectName = projectJson.name;
90
- const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
91
- if (!_optionalChain([projectConfigurations, 'optionalAccess', _ => _.projects, 'optionalAccess', _2 => _2[projectName]])) {
92
- 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.");
93
- }
94
- const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
95
- options.name ??= `${projectName}-${options.format}`;
96
- options.target ??= _chunkIFSORSANjs.DEFAULT_TARGET;
97
- const packageJsonPath = _chunkJTAXCQX6js.joinPaths.call(void 0, workspaceRoot.dir, options.projectRoot, "package.json");
98
- if (!_fs.existsSync.call(void 0, packageJsonPath)) {
99
- throw new Error("Cannot find package.json configuration");
100
- }
101
- const env = _chunkIFSORSANjs.getEnv.call(void 0, "tsdown", options);
102
- const result = {
103
- ...options,
104
- config,
105
- ...userOptions,
106
- tsconfig: _chunkJTAXCQX6js.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
107
- format: options.format || "cjs",
108
- entryPoints: await _chunkIFSORSANjs.getEntryPoints.call(void 0, config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
109
- "./src/index.ts"
110
- ], userOptions.emitOnAll),
111
- outdir: userOptions.outputPath || _chunkJTAXCQX6js.joinPaths.call(void 0, "dist", projectRoot),
112
- plugins: [],
113
- name: userOptions.name || projectName,
114
- projectConfigurations,
115
- projectName,
116
- projectGraph,
117
- sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkJTAXCQX6js.joinPaths.call(void 0, projectRoot, "src"),
118
- minify: userOptions.minify || !userOptions.debug,
119
- verbose: userOptions.verbose || _chunkNG6GE2YZjs.isVerbose.call(void 0, ) || userOptions.debug === true,
120
- includeSrc: userOptions.includeSrc === true,
121
- metafile: userOptions.metafile !== false,
122
- generatePackageJson: userOptions.generatePackageJson !== false,
123
- clean: userOptions.clean !== false,
124
- emitOnAll: userOptions.emitOnAll === true,
125
- dts: userOptions.emitTypes === true ? {
126
- transformer: "oxc"
127
- } : userOptions.emitTypes,
128
- bundleDts: userOptions.emitTypes,
129
- assets: _nullishCoalesce(userOptions.assets, () => ( [])),
130
- shims: userOptions.injectShims !== true,
131
- bundle: userOptions.bundle !== false,
132
- watch: userOptions.watch === true,
133
- define: {
134
- STORM_FORMAT: JSON.stringify(options.format || "cjs"),
135
- ...options.format === "cjs" && options.injectShims ? {
136
- "import.meta.url": "importMetaUrl"
137
- } : {},
138
- ...Object.keys(env || {}).reduce((res, key) => {
139
- const value = JSON.stringify(env[key]);
140
- return {
141
- ...res,
142
- [`process.env.${key}`]: value,
143
- [`import.meta.env.${key}`]: value
144
- };
145
- }, {}),
146
- ...options.define
147
- }
148
- };
149
- stopwatch();
150
- return result;
151
- }, "resolveOptions");
152
- async function generatePackageJson(options) {
153
- if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkJTAXCQX6js.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
154
- _chunkNG6GE2YZjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
155
- const stopwatch = _chunkNG6GE2YZjs.getStopwatch.call(void 0, "Write package.json file");
156
- const packageJsonPath = _chunkJTAXCQX6js.joinPaths.call(void 0, options.projectRoot, "project.json");
157
- if (!_fs.existsSync.call(void 0, packageJsonPath)) {
158
- throw new Error("Cannot find package.json configuration");
159
- }
160
- const packageJsonFile = await _promises2.default.readFile(_chunkJTAXCQX6js.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
161
- if (!packageJsonFile) {
162
- throw new Error("Cannot find package.json configuration file");
163
- }
164
- let packageJson = JSON.parse(packageJsonFile);
165
- packageJson = await _chunkIFSORSANjs.addPackageDependencies.call(void 0, options.config.workspaceRoot, options.projectRoot, options.projectName, packageJson);
166
- packageJson = await _chunkIFSORSANjs.addWorkspacePackageJsonFields.call(void 0, options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
167
- packageJson.exports ??= {};
168
- packageJson.exports["./package.json"] ??= "./package.json";
169
- packageJson.exports["."] ??= _chunkIFSORSANjs.addPackageJsonExport.call(void 0, "index", packageJson.type, options.sourceRoot);
170
- let entryPoints = [
171
- {
172
- in: "./src/index.ts",
173
- out: "./src/index.ts"
174
- }
175
- ];
176
- if (options.entryPoints) {
177
- if (Array.isArray(options.entryPoints)) {
178
- entryPoints = options.entryPoints.map((entryPoint) => typeof entryPoint === "string" ? {
179
- in: entryPoint,
180
- out: entryPoint
181
- } : entryPoint);
182
- }
183
- for (const entryPoint of entryPoints) {
184
- const split = entryPoint.out.split(".");
185
- split.pop();
186
- const entry = split.join(".").replaceAll("\\", "/");
187
- packageJson.exports[`./${entry}`] ??= _chunkIFSORSANjs.addPackageJsonExport.call(void 0, entry, packageJson.type, options.sourceRoot);
188
- }
189
- }
190
- packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
191
- packageJson.module = packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
192
- packageJson.types = "./dist/index.d.ts";
193
- packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
194
- if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
195
- ret[key.replace("/index", "")] = packageJson.exports[key];
196
- }
197
- return ret;
198
- }, packageJson.exports);
199
- await _devkit.writeJsonFile.call(void 0, _chunkJTAXCQX6js.joinPaths.call(void 0, options.outdir, "package.json"), packageJson);
200
- stopwatch();
201
- }
202
- return options;
203
- }
204
- _chunk3GQAWCBQjs.__name.call(void 0, generatePackageJson, "generatePackageJson");
205
- async function executeTSDown(options) {
206
- _chunkNG6GE2YZjs.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} build`, options.config);
207
- const stopwatch = _chunkNG6GE2YZjs.getStopwatch.call(void 0, `${options.name} build`);
208
- await _tsdown.build.call(void 0, {
209
- ...options,
210
- entry: options.entryPoints,
211
- outDir: options.outdir,
212
- config: false
213
- });
214
- stopwatch();
215
- return options;
216
- }
217
- _chunk3GQAWCBQjs.__name.call(void 0, executeTSDown, "executeTSDown");
218
- async function copyBuildAssets(options) {
219
- _chunkNG6GE2YZjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${options.outdir}`, options.config);
220
- const stopwatch = _chunkNG6GE2YZjs.getStopwatch.call(void 0, `${options.name} asset copy`);
221
- await _chunkIFSORSANjs.copyAssets.call(void 0, options.config, _nullishCoalesce(options.assets, () => ( [])), options.outdir, options.projectRoot, options.sourceRoot, true, false);
222
- stopwatch();
223
- return options;
224
- }
225
- _chunk3GQAWCBQjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
226
- async function reportResults(options) {
227
- _chunkNG6GE2YZjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${options.name} build completed successfully`, options.config);
228
- }
229
- _chunk3GQAWCBQjs.__name.call(void 0, reportResults, "reportResults");
230
- async function cleanOutputPath(options) {
231
- if (options.clean !== false && options.outdir) {
232
- _chunkNG6GE2YZjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${options.name} output path: ${options.outdir}`, options.config);
233
- const stopwatch = _chunkNG6GE2YZjs.getStopwatch.call(void 0, `${options.name} output clean`);
234
- await cleanDirectories(options.name, options.outdir, options.config);
235
- stopwatch();
236
- }
237
- return options;
238
- }
239
- _chunk3GQAWCBQjs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
240
- async function build(options) {
241
- _chunkNG6GE2YZjs.writeDebug.call(void 0, ` \u26A1 Executing Storm TSDown pipeline`);
242
- const stopwatch = _chunkNG6GE2YZjs.getStopwatch.call(void 0, "TSDown pipeline");
243
- try {
244
- const opts = Array.isArray(options) ? options : [
245
- options
246
- ];
247
- if (opts.length === 0) {
248
- throw new Error("No build options were provided");
249
- }
250
- const resolved = await Promise.all(opts.map(async (opt) => await resolveOptions(opt)));
251
- if (resolved.length > 0) {
252
- await cleanOutputPath(resolved[0]);
253
- await generatePackageJson(resolved[0]);
254
- await Promise.all(resolved.map(async (opt) => {
255
- await executeTSDown(opt);
256
- await copyBuildAssets(opt);
257
- await reportResults(opt);
258
- }));
259
- } else {
260
- _chunkNG6GE2YZjs.writeWarning.call(void 0, " \u{1F6A7} No options were passed to TSBuild. Please check the parameters passed to the `build` function.");
261
- }
262
- _chunkNG6GE2YZjs.writeSuccess.call(void 0, " \u{1F3C1} TSDown pipeline build completed successfully");
263
- } catch (error) {
264
- _chunkNG6GE2YZjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
265
- throw error;
266
- } finally {
267
- stopwatch();
268
- }
269
- }
270
- _chunk3GQAWCBQjs.__name.call(void 0, build, "build");
271
-
272
- // src/executors/tsdown/executor.ts
273
- async function tsdownExecutorFn(options, context, config) {
274
- _chunkNG6GE2YZjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm TSDown build executor on the workspace", config);
275
- if (!_optionalChain([context, 'access', _3 => _3.projectsConfigurations, 'optionalAccess', _4 => _4.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _5 => _5.projectsConfigurations, 'access', _6 => _6.projects, 'access', _7 => _7[context.projectName], 'optionalAccess', _8 => _8.root])) {
276
- throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
277
- }
278
- await build({
279
- ...options,
280
- projectRoot: _optionalChain([context, 'access', _9 => _9.projectsConfigurations, 'access', _10 => _10.projects, 'optionalAccess', _11 => _11[context.projectName], 'access', _12 => _12.root]),
281
- projectName: context.projectName,
282
- sourceRoot: _optionalChain([context, 'access', _13 => _13.projectsConfigurations, 'access', _14 => _14.projects, 'optionalAccess', _15 => _15[context.projectName], 'optionalAccess', _16 => _16.sourceRoot]),
283
- format: options.format,
284
- platform: options.platform
285
- });
286
- return {
287
- success: true
288
- };
289
- }
290
- _chunk3GQAWCBQjs.__name.call(void 0, tsdownExecutorFn, "tsdownExecutorFn");
291
- var executor_default = _chunkFGMOZZ77js.withRunExecutor.call(void 0, "Storm TSDown build executor", tsdownExecutorFn, {
292
- skipReadingConfig: false,
293
- hooks: {
294
- applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, config) => {
295
- options.entry ??= [
296
- "src/index.ts"
297
- ];
298
- options.outputPath ??= "dist/{projectRoot}";
299
- options.tsconfig ??= "{projectRoot}/tsconfig.json";
300
- return options;
301
- }, "applyDefaultOptions")
302
- }
303
- });
304
-
305
-
306
-
307
-
308
- exports.tsdownExecutorFn = tsdownExecutorFn; exports.executor_default = executor_default;
@@ -1,304 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
-
4
- var _chunkNG6GE2YZjs = require('./chunk-NG6GE2YZ.js');
5
-
6
-
7
- var _chunk4JOIS7WWjs = require('./chunk-4JOIS7WW.js');
8
-
9
-
10
-
11
- var _chunkJTAXCQX6js = require('./chunk-JTAXCQX6.js');
12
-
13
-
14
- var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
15
-
16
- // ../build-tools/src/config.ts
17
- var DEFAULT_COMPILED_BANNER = `/*****************************************
18
- *
19
- * \u26A1 Built by Storm Software
20
- *
21
- *****************************************/
22
- `;
23
- var DEFAULT_ENVIRONMENT = "production";
24
- var DEFAULT_TARGET = "esnext";
25
- var DEFAULT_ORGANIZATION = "storm-software";
26
-
27
- // ../build-tools/src/utilities/copy-assets.ts
28
- var _copyassetshandler = require('@nx/js/src/utils/assets/copy-assets-handler');
29
- var _glob = require('glob');
30
- var _promises = require('fs/promises');
31
- var copyAssets = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson = true, includeSrc = false, banner, footer) => {
32
- const pendingAssets = Array.from(_nullishCoalesce(assets, () => ( [])));
33
- pendingAssets.push({
34
- input: projectRoot,
35
- glob: "*.md",
36
- output: "."
37
- });
38
- pendingAssets.push({
39
- input: ".",
40
- glob: "LICENSE",
41
- output: "."
42
- });
43
- if (generatePackageJson === false) {
44
- pendingAssets.push({
45
- input: projectRoot,
46
- glob: "package.json",
47
- output: "."
48
- });
49
- }
50
- if (includeSrc === true) {
51
- pendingAssets.push({
52
- input: sourceRoot,
53
- glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
54
- output: "src/"
55
- });
56
- }
57
- _chunkNG6GE2YZjs.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
58
- ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkJTAXCQX6js.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`, config);
59
- const assetHandler = new (0, _copyassetshandler.CopyAssetsHandler)({
60
- projectDir: projectRoot,
61
- rootDir: config.workspaceRoot,
62
- outputDir: outputPath,
63
- assets: pendingAssets
64
- });
65
- await assetHandler.processAllAssetsOnce();
66
- if (includeSrc === true) {
67
- _chunkNG6GE2YZjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkJTAXCQX6js.joinPaths.call(void 0, outputPath, "src")}`, config);
68
- const files = await _glob.glob.call(void 0, [
69
- _chunkJTAXCQX6js.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
70
- _chunkJTAXCQX6js.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
71
- _chunkJTAXCQX6js.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
72
- _chunkJTAXCQX6js.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
73
- ]);
74
- await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
75
-
76
- ${await _promises.readFile.call(void 0, file, "utf8")}
77
-
78
- ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
79
- }
80
- }, "copyAssets");
81
-
82
- // ../build-tools/src/utilities/generate-package-json.ts
83
- var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
84
-
85
- var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
86
-
87
- var _projectgraph = require('nx/src/project-graph/project-graph');
88
- var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (workspaceRoot, projectRoot, projectName, packageJson) => {
89
- const projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
90
- const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
91
- const localPackages = [];
92
- for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
93
- const projectNode = project.node;
94
- if (projectNode.data.root) {
95
- const projectPackageJsonPath = _chunkJTAXCQX6js.joinPaths.call(void 0, workspaceRoot, projectNode.data.root, "package.json");
96
- if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
97
- const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
98
- const projectPackageJson = JSON.parse(projectPackageJsonContent);
99
- if (projectPackageJson.private !== true) {
100
- localPackages.push(projectPackageJson);
101
- }
102
- }
103
- }
104
- }
105
- if (localPackages.length > 0) {
106
- _chunkNG6GE2YZjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
107
- const projectJsonFile = await _promises.readFile.call(void 0, _chunkJTAXCQX6js.joinPaths.call(void 0, projectRoot, "project.json"), "utf8");
108
- const projectJson = JSON.parse(projectJsonFile);
109
- const projectName2 = projectJson.name;
110
- const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
111
- if (!_optionalChain([projectConfigurations, 'optionalAccess', _ => _.projects, 'optionalAccess', _2 => _2[projectName2]])) {
112
- 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.");
113
- }
114
- const implicitDependencies = _optionalChain([projectConfigurations, 'access', _3 => _3.projects, 'optionalAccess', _4 => _4[projectName2], 'access', _5 => _5.implicitDependencies, 'optionalAccess', _6 => _6.reduce, 'call', _7 => _7((ret, dep) => {
115
- if (_optionalChain([projectConfigurations, 'access', _8 => _8.projects, 'optionalAccess', _9 => _9[dep]])) {
116
- const depPackageJsonPath = _chunkJTAXCQX6js.joinPaths.call(void 0, workspaceRoot, projectConfigurations.projects[dep].root, "package.json");
117
- if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
118
- const depPackageJsonContent = _fs.readFileSync.call(void 0, depPackageJsonPath, "utf8");
119
- const depPackageJson = JSON.parse(depPackageJsonContent);
120
- if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
121
- ret.push(depPackageJson.name);
122
- }
123
- }
124
- }
125
- return ret;
126
- }, [])]);
127
- packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
128
- if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess', _10 => _10.includes, 'call', _11 => _11(localPackage.name)])) {
129
- ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
130
- }
131
- return ret;
132
- }, _nullishCoalesce(packageJson.dependencies, () => ( {})));
133
- packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
134
- if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess', _12 => _12.includes, 'call', _13 => _13(localPackage.name)])) {
135
- ret[localPackage.name] = localPackage.version || "0.0.1";
136
- }
137
- return ret;
138
- }, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
139
- } else {
140
- _chunkNG6GE2YZjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
141
- }
142
- return packageJson;
143
- }, "addPackageDependencies");
144
- var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
145
- const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunk4JOIS7WWjs.findWorkspaceRoot.call(void 0, );
146
- const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkJTAXCQX6js.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
147
- const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
148
- packageJson.type ??= "module";
149
- packageJson.sideEffects ??= false;
150
- if (includeSrc === true) {
151
- let distSrc = sourceRoot.replace(projectRoot, "");
152
- if (distSrc.startsWith("/")) {
153
- distSrc = distSrc.substring(1);
154
- }
155
- packageJson.source ??= `${_chunkJTAXCQX6js.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
156
- }
157
- packageJson.files ??= [
158
- "dist/**/*"
159
- ];
160
- if (includeSrc === true && !packageJson.files.includes("src")) {
161
- packageJson.files.push("src/**/*");
162
- }
163
- packageJson.publishConfig ??= {
164
- access: "public"
165
- };
166
- packageJson.description ??= workspacePackageJson.description;
167
- packageJson.homepage ??= workspacePackageJson.homepage;
168
- packageJson.bugs ??= workspacePackageJson.bugs;
169
- packageJson.license ??= workspacePackageJson.license;
170
- packageJson.keywords ??= workspacePackageJson.keywords;
171
- packageJson.funding ??= workspacePackageJson.funding;
172
- packageJson.author ??= workspacePackageJson.author;
173
- packageJson.maintainers ??= workspacePackageJson.maintainers;
174
- if (!packageJson.maintainers && packageJson.author) {
175
- packageJson.maintainers = [
176
- packageJson.author
177
- ];
178
- }
179
- packageJson.contributors ??= workspacePackageJson.contributors;
180
- if (!packageJson.contributors && packageJson.author) {
181
- packageJson.contributors = [
182
- packageJson.author
183
- ];
184
- }
185
- packageJson.repository ??= workspacePackageJson.repository;
186
- packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkJTAXCQX6js.joinPaths.call(void 0, "packages", projectName);
187
- return packageJson;
188
- }, "addWorkspacePackageJsonFields");
189
- var addPackageJsonExport = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (file, type = "module", sourceRoot) => {
190
- let entry = file.replaceAll("\\", "/");
191
- if (sourceRoot) {
192
- entry = entry.replace(sourceRoot, "");
193
- }
194
- return {
195
- import: {
196
- types: `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
197
- default: `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
198
- },
199
- require: {
200
- types: `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
201
- default: `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
202
- },
203
- default: {
204
- types: `./dist/${entry}.d.ts`,
205
- default: `./dist/${entry}.js`
206
- }
207
- };
208
- }, "addPackageJsonExport");
209
-
210
- // ../build-tools/src/utilities/get-entry-points.ts
211
-
212
- var getEntryPoints = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
213
- const workspaceRoot = config.workspaceRoot || _chunk4JOIS7WWjs.findWorkspaceRoot.call(void 0, );
214
- const entryPoints = [];
215
- if (entry) {
216
- if (typeof entry === "string") {
217
- entryPoints.push(entry);
218
- } else if (Array.isArray(entry)) {
219
- entryPoints.push(...entry);
220
- } else {
221
- entryPoints.push(...Object.values(entry));
222
- }
223
- }
224
- if (emitOnAll) {
225
- entryPoints.push(_chunkJTAXCQX6js.joinPaths.call(void 0, workspaceRoot, sourceRoot || projectRoot, "**/*.{ts,tsx}"));
226
- }
227
- const results = await Promise.all(entryPoints.map(async (entryPoint) => {
228
- const paths = [];
229
- if (entryPoint.includes("*")) {
230
- const files = await _glob.glob.call(void 0, entryPoint, {
231
- withFileTypes: true,
232
- ignore: [
233
- "**/node_modules/**"
234
- ]
235
- });
236
- paths.push(...files.reduce((ret, filePath) => {
237
- const result = _chunkJTAXCQX6js.correctPaths.call(void 0, _chunkJTAXCQX6js.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunkJTAXCQX6js.correctPaths.call(void 0, workspaceRoot), "").replaceAll(_chunkJTAXCQX6js.correctPaths.call(void 0, projectRoot), ""));
238
- if (result) {
239
- _chunkNG6GE2YZjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkJTAXCQX6js.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
240
- if (!paths.includes(result)) {
241
- paths.push(result);
242
- }
243
- }
244
- return ret;
245
- }, []));
246
- } else {
247
- paths.push(entryPoint);
248
- }
249
- return paths;
250
- }));
251
- return results.filter(Boolean).reduce((ret, result) => {
252
- result.forEach((res) => {
253
- if (res && !ret.includes(res)) {
254
- ret.push(res);
255
- }
256
- });
257
- return ret;
258
- }, []);
259
- }, "getEntryPoints");
260
-
261
- // ../build-tools/src/utilities/get-env.ts
262
- var getEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (builder, options) => {
263
- return {
264
- STORM_BUILD: builder,
265
- STORM_ORG: options.orgName || DEFAULT_ORGANIZATION,
266
- STORM_NAME: options.name,
267
- STORM_MODE: options.mode || DEFAULT_ENVIRONMENT,
268
- STORM_PLATFORM: options.platform,
269
- STORM_FORMAT: JSON.stringify(options.format),
270
- STORM_TARGET: JSON.stringify(options.target),
271
- ...options.env
272
- };
273
- }, "getEnv");
274
-
275
- // ../build-tools/src/plugins/swc.ts
276
- var _core = require('@swc/core');
277
-
278
- // ../build-tools/src/plugins/ts-resolve.ts
279
-
280
- var _module = require('module');
281
- var _path = require('path'); var _path2 = _interopRequireDefault(_path);
282
- var _resolve2 = require('resolve'); var _resolve3 = _interopRequireDefault(_resolve2);
283
-
284
- // ../build-tools/src/plugins/type-definitions.ts
285
- var _devkit = require('@nx/devkit');
286
-
287
-
288
- // ../build-tools/src/utilities/read-nx-config.ts
289
-
290
-
291
-
292
- // ../build-tools/src/utilities/task-graph.ts
293
- var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
-
303
-
304
- 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.getEntryPoints = getEntryPoints; exports.getEnv = getEnv;