@storm-software/workspace-tools 1.233.0 → 1.233.2

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 (91) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-OCXXIUSC.mjs → chunk-2DNLATEG.mjs} +1 -30
  4. package/dist/{chunk-MA2QNKZ7.js → chunk-2E2DXYRF.js} +2 -2
  5. package/dist/{chunk-LEHZZU32.js → chunk-2NYBFBUU.js} +2 -2
  6. package/dist/{chunk-T5XCHBCB.mjs → chunk-3GQ6H7GF.mjs} +3 -3
  7. package/dist/{chunk-GVBCN2FA.mjs → chunk-4G35AYIJ.mjs} +1 -1
  8. package/dist/{chunk-UPMKBKEN.js → chunk-5Z7CCIIJ.js} +2 -2
  9. package/dist/{chunk-ZMA37UYA.js → chunk-7PETCK66.js} +41 -41
  10. package/dist/{chunk-DM2FMT3G.mjs → chunk-7TEC757Y.mjs} +0 -1
  11. package/dist/{chunk-QA6M5DEJ.js → chunk-A3SB76KG.js} +2 -2
  12. package/dist/{chunk-NHSJQ3KY.mjs → chunk-AKLDSJTD.mjs} +1 -1
  13. package/dist/{chunk-HIBDVUQ5.js → chunk-BANJXE74.js} +2 -2
  14. package/dist/{chunk-5FCVQVIS.mjs → chunk-BARR5D5N.mjs} +1 -1
  15. package/dist/{chunk-5KPWW65X.mjs → chunk-CNX755OY.mjs} +1 -1
  16. package/dist/{chunk-EECNVIFZ.js → chunk-DOQEFB3U.js} +5 -5
  17. package/dist/{chunk-FHRBHQ5D.js → chunk-ENBOBX3C.js} +2 -2
  18. package/dist/{chunk-AX4OFOSN.js → chunk-FE52EM76.js} +8 -37
  19. package/dist/{chunk-VOPIMPWA.js → chunk-FQCHDI2P.js} +11 -11
  20. package/dist/{chunk-OJV4NKCZ.js → chunk-IIMNDUXX.js} +9 -9
  21. package/dist/{chunk-DNUDJEZX.mjs → chunk-IVRCEWW4.mjs} +2 -2
  22. package/dist/{chunk-SZJOJ773.mjs → chunk-KZGWRL4P.mjs} +1 -1
  23. package/dist/{chunk-4EO5ZWLS.js → chunk-MVCUW6FQ.js} +31 -31
  24. package/dist/{chunk-OFSUFHFM.mjs → chunk-N4J73OER.mjs} +2 -2
  25. package/dist/{chunk-ZYC7FHCD.js → chunk-OH2QVCID.js} +5 -5
  26. package/dist/{chunk-A4DWQQ6J.mjs → chunk-PKR4QUWJ.mjs} +1 -1
  27. package/dist/{chunk-OE5KYONM.mjs → chunk-PSMBZ5DR.mjs} +1 -1
  28. package/dist/{chunk-FZ3N3UJ5.mjs → chunk-QQHYWAVX.mjs} +3 -3
  29. package/dist/{chunk-SQHYP2JD.mjs → chunk-THMXFMSK.mjs} +1 -1
  30. package/dist/{chunk-UA7PFIEF.mjs → chunk-UROGF3KF.mjs} +1 -1
  31. package/dist/{chunk-5Q3LI7CF.js → chunk-UW6T77HF.js} +15 -15
  32. package/dist/{chunk-T2CG5RNT.js → chunk-VQMSXER7.js} +2 -2
  33. package/dist/{chunk-QCAF5WDF.mjs → chunk-VVHGKFCB.mjs} +2 -2
  34. package/dist/chunk-VWJEKC3P.mjs +83 -0
  35. package/dist/{chunk-WKYE64AL.mjs → chunk-WWSP3KEN.mjs} +1 -1
  36. package/dist/{chunk-FDI6QWNH.mjs → chunk-XOIDDNCA.mjs} +1 -1
  37. package/dist/chunk-XWYXKDH2.js +83 -0
  38. package/dist/{chunk-L2KYX6WC.js → chunk-Y2LDGJCA.js} +2 -2
  39. package/dist/{chunk-2AQPTJLC.js → chunk-YFIHF222.js} +2 -2
  40. package/dist/{chunk-CDOWHRVE.js → chunk-YO7MVS4A.js} +17 -17
  41. package/dist/{chunk-GRBZKMJI.js → chunk-ZJXBN32W.js} +1 -2
  42. package/dist/{chunk-QTW54PBD.mjs → chunk-ZPQJ7P6C.mjs} +1 -1
  43. package/dist/executors.js +16 -16
  44. package/dist/executors.mjs +21 -21
  45. package/dist/generators.js +9 -9
  46. package/dist/generators.mjs +8 -8
  47. package/dist/index.js +23 -23
  48. package/dist/index.mjs +28 -28
  49. package/dist/src/base/base-executor.js +3 -3
  50. package/dist/src/base/base-executor.mjs +2 -2
  51. package/dist/src/base/base-generator.js +3 -3
  52. package/dist/src/base/base-generator.mjs +2 -2
  53. package/dist/src/base/index.js +4 -4
  54. package/dist/src/base/index.mjs +3 -3
  55. package/dist/src/executors/cargo-build/executor.js +4 -4
  56. package/dist/src/executors/cargo-build/executor.mjs +3 -3
  57. package/dist/src/executors/cargo-check/executor.js +4 -4
  58. package/dist/src/executors/cargo-check/executor.mjs +3 -3
  59. package/dist/src/executors/cargo-clippy/executor.js +4 -4
  60. package/dist/src/executors/cargo-clippy/executor.mjs +3 -3
  61. package/dist/src/executors/cargo-doc/executor.js +4 -4
  62. package/dist/src/executors/cargo-doc/executor.mjs +3 -3
  63. package/dist/src/executors/cargo-format/executor.js +4 -4
  64. package/dist/src/executors/cargo-format/executor.mjs +3 -3
  65. package/dist/src/executors/clean-package/executor.js +5 -5
  66. package/dist/src/executors/clean-package/executor.mjs +2 -2
  67. package/dist/src/executors/esbuild/executor.js +5 -5
  68. package/dist/src/executors/esbuild/executor.mjs +4 -4
  69. package/dist/src/executors/size-limit/executor.js +4 -4
  70. package/dist/src/executors/size-limit/executor.mjs +3 -3
  71. package/dist/src/executors/tsdown/executor.js +5 -5
  72. package/dist/src/executors/tsdown/executor.mjs +4 -4
  73. package/dist/src/executors/typia/executor.js +4 -4
  74. package/dist/src/executors/typia/executor.mjs +3 -3
  75. package/dist/src/executors/unbuild/executor.js +4 -5
  76. package/dist/src/executors/unbuild/executor.mjs +3 -4
  77. package/dist/src/generators/browser-library/generator.js +4 -4
  78. package/dist/src/generators/browser-library/generator.mjs +3 -3
  79. package/dist/src/generators/config-schema/generator.js +4 -4
  80. package/dist/src/generators/config-schema/generator.mjs +3 -3
  81. package/dist/src/generators/neutral-library/generator.js +4 -4
  82. package/dist/src/generators/neutral-library/generator.mjs +3 -3
  83. package/dist/src/generators/node-library/generator.js +4 -4
  84. package/dist/src/generators/node-library/generator.mjs +3 -3
  85. package/dist/src/generators/preset/generator.js +4 -4
  86. package/dist/src/generators/preset/generator.mjs +3 -3
  87. package/dist/src/generators/release-version/generator.js +3 -3
  88. package/dist/src/generators/release-version/generator.mjs +2 -2
  89. package/package.json +6 -5
  90. package/dist/chunk-JHP7QOI4.js +0 -507
  91. package/dist/chunk-TSTK2BD6.mjs +0 -507
@@ -1,507 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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
- var _chunkAX4OFOSNjs = require('./chunk-AX4OFOSN.js');
7
-
8
-
9
- var _chunkCDOWHRVEjs = require('./chunk-CDOWHRVE.js');
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
- var _chunkGRBZKMJIjs = require('./chunk-GRBZKMJI.js');
22
-
23
-
24
- var _chunkXCSSYTCUjs = require('./chunk-XCSSYTCU.js');
25
-
26
-
27
- var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
28
-
29
- // ../unbuild/src/build.ts
30
- var _devkit = require('@nx/devkit');
31
- var _js = require('@nx/js');
32
- var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
33
- var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
34
- var _jiti = require('jiti');
35
- var _fs = require('fs');
36
- var _promises = require('fs/promises');
37
- var _path = require('path');
38
- var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
39
-
40
- // ../unbuild/src/clean.ts
41
-
42
- async function clean(name = "Unbuild", directory, config) {
43
- _chunkGRBZKMJIjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
44
- const stopwatch = _chunkGRBZKMJIjs.getStopwatch.call(void 0, `${name} output clean`);
45
- await _promises.rm.call(void 0, directory, {
46
- recursive: true,
47
- force: true
48
- });
49
- stopwatch();
50
- }
51
- _chunk3GQAWCBQjs.__name.call(void 0, clean, "clean");
52
-
53
- // ../unbuild/src/plugins/analyze.ts
54
- var formatBytes = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (bytes) => {
55
- if (bytes === 0) return "0 Byte";
56
- const k = 1e3;
57
- const dm = 3;
58
- const sizes = [
59
- "Bytes",
60
- "KB",
61
- "MB",
62
- "GB"
63
- ];
64
- const i = Math.floor(Math.log(bytes) / Math.log(k));
65
- return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
66
- }, "formatBytes");
67
- var analyzePlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, resolvedOptions) => {
68
- return {
69
- name: "storm:analyzer",
70
- renderChunk(source, chunk) {
71
- const sourceBytes = formatBytes(source.length);
72
- const fileName = chunk.fileName;
73
- _chunkGRBZKMJIjs.writeInfo.call(void 0, ` - ${fileName} ${sourceBytes}`, resolvedOptions.config);
74
- }
75
- };
76
- }, "analyzePlugin");
77
-
78
- // ../unbuild/src/plugins/on-error.ts
79
- var onErrorPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, resolvedOptions) => ({
80
- name: "storm:on-error",
81
- buildEnd(error) {
82
- if (error) {
83
- _chunkGRBZKMJIjs.writeError.call(void 0, `The following errors occurred during the build:
84
- ${error ? error.message : "Unknown build error"}
85
-
86
- `, resolvedOptions.config);
87
- throw new Error("Storm unbuild process failed with errors.");
88
- }
89
- },
90
- renderError(error) {
91
- _chunkGRBZKMJIjs.writeError.call(void 0, `The following errors occurred during the build:
92
- ${error ? error.message : "Unknown build error"}
93
-
94
- `, resolvedOptions.config);
95
- throw new Error("Storm unbuild process failed with errors.");
96
- }
97
- }), "onErrorPlugin");
98
-
99
- // ../unbuild/src/plugins/tsc.ts
100
-
101
-
102
- var _compilerhelperdependency = require('@nx/js/src/utils/compiler-helper-dependency');
103
- var _rollupplugintypescript2 = require('rollup-plugin-typescript2'); var _rollupplugintypescript22 = _interopRequireDefault(_rollupplugintypescript2);
104
-
105
- // ../unbuild/src/utilities/helpers.ts
106
-
107
-
108
-
109
- var _url = require('url');
110
- var _typescript = require('typescript'); var _typescript2 = _interopRequireDefault(_typescript);
111
- async function loadConfig(configPath) {
112
- if (!/\.(js|mjs)$/.test(_path.extname.call(void 0, configPath))) {
113
- throw new Error("Unsupported config file format");
114
- }
115
- return Promise.resolve().then(() => _interopRequireWildcard(require(_url.pathToFileURL.call(void 0, configPath).toString()))).then((config) => config.default);
116
- }
117
- _chunk3GQAWCBQjs.__name.call(void 0, loadConfig, "loadConfig");
118
- async function createTsCompilerOptions(config, tsConfigPath, projectRoot, dependencies) {
119
- const tsConfigFile = _typescript2.default.readConfigFile(_devkit.joinPathFragments.call(void 0, config.workspaceRoot, projectRoot, tsConfigPath), _typescript2.default.sys.readFile);
120
- const tsConfig = _typescript2.default.parseJsonConfigFileContent(tsConfigFile.config, _typescript2.default.sys, _path.dirname.call(void 0, _devkit.joinPathFragments.call(void 0, config.workspaceRoot, projectRoot, tsConfigPath)));
121
- const compilerOptions = {
122
- rootDir: projectRoot,
123
- declaration: true,
124
- paths: _buildablelibsutils.computeCompilerOptionsPaths.call(void 0, tsConfig, _nullishCoalesce(dependencies, () => ( [])))
125
- };
126
- _chunkGRBZKMJIjs.writeTrace.call(void 0, compilerOptions, config);
127
- return compilerOptions;
128
- }
129
- _chunk3GQAWCBQjs.__name.call(void 0, createTsCompilerOptions, "createTsCompilerOptions");
130
-
131
- // ../unbuild/src/plugins/tsc.ts
132
- var tscPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, resolvedOptions) => {
133
- const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
134
- const result = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, resolvedOptions.config.workspaceRoot, resolvedOptions.projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
135
- let dependencies = result.dependencies;
136
- const tsLibDependency = _compilerhelperdependency.getHelperDependency.call(void 0, _compilerhelperdependency.HelperDependency.tsc, resolvedOptions.tsconfig, dependencies, projectGraph, true);
137
- if (tsLibDependency) {
138
- dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
139
- dependencies.push(tsLibDependency);
140
- }
141
- return _rollupplugintypescript22.default.call(void 0, {
142
- check: options.emitTypes !== false,
143
- tsconfig: resolvedOptions.tsconfig,
144
- tsconfigOverride: {
145
- compilerOptions: await createTsCompilerOptions(resolvedOptions.config, resolvedOptions.tsconfig, resolvedOptions.projectRoot, dependencies)
146
- }
147
- });
148
- }, "tscPlugin");
149
-
150
- // ../unbuild/src/plugins/type-definitions.ts
151
-
152
- function typeDefinitions(projectRoot) {
153
- return {
154
- name: "storm:dts-bundle",
155
- async generateBundle(_opts, bundle) {
156
- for (const file of Object.values(bundle)) {
157
- if (file.type === "asset" || !file.isEntry || file.facadeModuleId == null) {
158
- continue;
159
- }
160
- const hasDefaultExport = file.exports.includes("default");
161
- const entrySourceFileName = _path.relative.call(void 0, projectRoot, file.facadeModuleId);
162
- const entrySourceDtsName = entrySourceFileName.replace(/\.[cm]?[jt]sx?$/, "");
163
- const dtsFileName = file.fileName.replace(/\.[cm]?js$/, ".d.ts");
164
- const relativeSourceDtsName = JSON.stringify("./" + entrySourceDtsName);
165
- const dtsFileSource = hasDefaultExport ? `
166
- export * from ${relativeSourceDtsName};
167
- export { default } from ${relativeSourceDtsName};
168
- ` : `export * from ${relativeSourceDtsName};
169
- `;
170
- this.emitFile({
171
- type: "asset",
172
- fileName: dtsFileName,
173
- source: dtsFileSource
174
- });
175
- }
176
- }
177
- };
178
- }
179
- _chunk3GQAWCBQjs.__name.call(void 0, typeDefinitions, "typeDefinitions");
180
-
181
- // ../unbuild/src/config.ts
182
- var getDefaultBuildPlugins = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, resolvedOptions) => Promise.all([
183
- analyzePlugin(options, resolvedOptions),
184
- typeDefinitions(resolvedOptions.projectRoot),
185
- tscPlugin(options, resolvedOptions),
186
- onErrorPlugin(options, resolvedOptions)
187
- ].map((plugin) => Promise.resolve(plugin))), "getDefaultBuildPlugins");
188
-
189
- // ../unbuild/src/build.ts
190
- async function resolveOptions(options) {
191
- const projectRoot = options.projectRoot;
192
- if (!projectRoot) {
193
- throw new Error("Cannot find project root");
194
- }
195
- const outputPath = options.outputPath || _chunkXCSSYTCUjs.joinPaths.call(void 0, "dist", projectRoot);
196
- const workspaceRoot = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
197
- if (!workspaceRoot) {
198
- throw new Error("Cannot find workspace root");
199
- }
200
- const config = await _chunkGRBZKMJIjs.loadStormConfig.call(void 0, workspaceRoot.dir);
201
- _chunkGRBZKMJIjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
202
- const stopwatch = _chunkGRBZKMJIjs.getStopwatch.call(void 0, "Build options resolution");
203
- if (options.configPath) {
204
- const configFile = await loadConfig(options.configPath);
205
- if (configFile) {
206
- options = _defu2.default.call(void 0, options, configFile);
207
- }
208
- }
209
- const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
210
- const projectJsonPath = _chunkXCSSYTCUjs.joinPaths.call(void 0, config.workspaceRoot, projectRoot, "project.json");
211
- if (!_fs.existsSync.call(void 0, projectJsonPath)) {
212
- throw new Error("Cannot find project.json configuration");
213
- }
214
- const projectJsonContent = await _promises.readFile.call(void 0, projectJsonPath, "utf8");
215
- const projectJson = JSON.parse(projectJsonContent);
216
- const projectName = projectJson.name;
217
- const packageJsonPath = _chunkXCSSYTCUjs.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "package.json");
218
- if (!_fs.existsSync.call(void 0, packageJsonPath)) {
219
- throw new Error("Cannot find package.json configuration");
220
- }
221
- const packageJsonContent = await _promises.readFile.call(void 0, packageJsonPath, "utf8");
222
- const packageJson = JSON.parse(packageJsonContent);
223
- let tsconfig = options.tsconfig;
224
- if (!tsconfig) {
225
- tsconfig = _chunkXCSSYTCUjs.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "tsconfig.json");
226
- }
227
- if (!_fs.existsSync.call(void 0, tsconfig)) {
228
- throw new Error("Cannot find tsconfig.json configuration");
229
- }
230
- let sourceRoot = projectJson.sourceRoot;
231
- if (!sourceRoot) {
232
- sourceRoot = _chunkXCSSYTCUjs.joinPaths.call(void 0, projectRoot, "src");
233
- }
234
- if (!_fs.existsSync.call(void 0, sourceRoot)) {
235
- throw new Error("Cannot find sourceRoot directory");
236
- }
237
- const result = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot.dir, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
238
- let dependencies = result.dependencies;
239
- const tsLibDependency = _js.getHelperDependency.call(void 0, _js.HelperDependency.tsc, tsconfig, dependencies, projectGraph, true);
240
- if (tsLibDependency) {
241
- dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
242
- dependencies.push(tsLibDependency);
243
- }
244
- const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
245
- cache: true,
246
- fsCache: config.skipCache ? false : _chunkXCSSYTCUjs.joinPaths.call(void 0, config.directories.cache || "node_modules/.cache/storm", "jiti"),
247
- interopDefault: true
248
- });
249
- const resolvedOptions = {
250
- name: projectName,
251
- config,
252
- projectRoot,
253
- sourceRoot,
254
- projectName,
255
- tsconfig,
256
- jiti,
257
- clean: false,
258
- entries: [
259
- {
260
- builder: "mkdist",
261
- input: `.${sourceRoot.replace(projectRoot, "")}`,
262
- outDir: _chunkXCSSYTCUjs.joinPaths.call(void 0, _path.relative.call(void 0, _chunkXCSSYTCUjs.joinPaths.call(void 0, config.workspaceRoot, projectRoot), config.workspaceRoot).replaceAll("\\", "/"), outputPath, "dist").replaceAll("\\", "/"),
263
- declaration: options.emitTypes !== false,
264
- format: "esm"
265
- },
266
- {
267
- builder: "mkdist",
268
- input: `.${sourceRoot.replace(projectRoot, "")}`,
269
- outDir: _chunkXCSSYTCUjs.joinPaths.call(void 0, _path.relative.call(void 0, _chunkXCSSYTCUjs.joinPaths.call(void 0, config.workspaceRoot, projectRoot), config.workspaceRoot).replaceAll("\\", "/"), outputPath, "dist").replaceAll("\\", "/"),
270
- declaration: options.emitTypes !== false,
271
- format: "cjs",
272
- ext: "cjs"
273
- }
274
- ],
275
- declaration: options.emitTypes !== false ? "compatible" : false,
276
- failOnWarn: false,
277
- sourcemap: _nullishCoalesce(options.sourcemap, () => ( !!options.debug)),
278
- outDir: outputPath,
279
- parallel: true,
280
- stub: false,
281
- stubOptions: {
282
- jiti: {}
283
- },
284
- externals: _nullishCoalesce(options.external, () => ( [])),
285
- dependencies: [],
286
- peerDependencies: [],
287
- devDependencies: [],
288
- hooks: {},
289
- alias: {},
290
- replace: {},
291
- rollup: {
292
- replace: {},
293
- alias: {},
294
- json: {},
295
- commonjs: {
296
- sourceMap: _nullishCoalesce(options.sourcemap, () => ( true))
297
- },
298
- emitCJS: true,
299
- cjsBridge: true,
300
- dts: {
301
- respectExternal: true,
302
- tsconfig
303
- },
304
- output: {
305
- banner: options.banner || `
306
- // \u26A1 Built by Storm Software
307
- `,
308
- footer: options.footer
309
- },
310
- resolve: {
311
- preferBuiltins: true,
312
- extensions: [
313
- ".cjs",
314
- ".mjs",
315
- ".js",
316
- ".jsx",
317
- ".ts",
318
- ".tsx",
319
- ".json"
320
- ]
321
- },
322
- esbuild: {
323
- minify: options.minify !== false,
324
- splitting: options.splitting !== false,
325
- treeShaking: options.treeShaking !== false,
326
- color: true,
327
- logLevel: config.logLevel === _chunkGRBZKMJIjs.LogLevelLabel.FATAL ? _chunkGRBZKMJIjs.LogLevelLabel.ERROR : _chunkGRBZKMJIjs.isVerbose.call(void 0, ) ? "verbose" : config.logLevel
328
- }
329
- }
330
- };
331
- dependencies = dependencies.filter((dep) => dep.node.type === "npm" || dep.node.type === "lib" || dep.node.type === "app");
332
- if (dependencies.length > 0) {
333
- resolvedOptions.dependencies = dependencies.map((dep) => dep.name);
334
- }
335
- if (packageJson.devDependencies) {
336
- resolvedOptions.devDependencies = Object.keys(packageJson.devDependencies);
337
- }
338
- if (packageJson.peerDependencies) {
339
- resolvedOptions.peerDependencies = Object.keys(packageJson.peerDependencies);
340
- }
341
- if (options.rollup) {
342
- let rollup = {};
343
- if (typeof options.rollup === "string") {
344
- const rollupFile = await loadConfig(options.rollup);
345
- if (rollupFile) {
346
- rollup = rollupFile;
347
- }
348
- } else {
349
- rollup = options.rollup;
350
- }
351
- resolvedOptions.rollup = _defu2.default.call(void 0, _nullishCoalesce(resolvedOptions.rollup, () => ( {})), rollup);
352
- }
353
- resolvedOptions.hooks = {
354
- "rollup:options": /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (ctx, opts) => {
355
- opts.plugins = await _asyncNullishCoalesce(options.plugins, async () => ( await getDefaultBuildPlugins(options, resolvedOptions)));
356
- }, "rollup:options")
357
- };
358
- stopwatch();
359
- return resolvedOptions;
360
- }
361
- _chunk3GQAWCBQjs.__name.call(void 0, resolveOptions, "resolveOptions");
362
- async function generatePackageJson(options) {
363
- if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkXCSSYTCUjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
364
- _chunkGRBZKMJIjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
365
- const stopwatch = _chunkGRBZKMJIjs.getStopwatch.call(void 0, "Write package.json file");
366
- const packageJsonPath = _chunkXCSSYTCUjs.joinPaths.call(void 0, options.projectRoot, "project.json");
367
- if (!_fs.existsSync.call(void 0, packageJsonPath)) {
368
- throw new Error("Cannot find package.json configuration");
369
- }
370
- let packageJsonContent = await _promises.readFile.call(void 0, _chunkXCSSYTCUjs.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
371
- if (!packageJsonContent) {
372
- throw new Error("Cannot find package.json configuration file");
373
- }
374
- let packageJson = JSON.parse(packageJsonContent);
375
- packageJson = await _chunkAX4OFOSNjs.addPackageDependencies.call(void 0, options.config.workspaceRoot, options.projectRoot, options.projectName, packageJson);
376
- packageJson = await _chunkAX4OFOSNjs.addWorkspacePackageJsonFields.call(void 0, options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
377
- await _devkit.writeJsonFile.call(void 0, _chunkXCSSYTCUjs.joinPaths.call(void 0, options.outDir, "package.json"), await _chunkAX4OFOSNjs.addPackageJsonExports.call(void 0, options.sourceRoot, packageJson));
378
- stopwatch();
379
- }
380
- return options;
381
- }
382
- _chunk3GQAWCBQjs.__name.call(void 0, generatePackageJson, "generatePackageJson");
383
- async function resolveUnbuild(options) {
384
- _chunkGRBZKMJIjs.writeTrace.call(void 0, `Resolving Unbuild package with Jiti`, options.config);
385
- try {
386
- return options.jiti.import("unbuild");
387
- } catch (error) {
388
- _chunkGRBZKMJIjs.writeError.call(void 0, " \u274C An error occurred while resolving the Unbuild package", options.config);
389
- throw new Error("An error occurred while resolving the Unbuild package", {
390
- cause: error
391
- });
392
- }
393
- }
394
- _chunk3GQAWCBQjs.__name.call(void 0, resolveUnbuild, "resolveUnbuild");
395
- async function executeUnbuild(options) {
396
- _chunkGRBZKMJIjs.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} (${options.projectRoot}) build`, options.config);
397
- const stopwatch = _chunkGRBZKMJIjs.getStopwatch.call(void 0, `${options.name} (${options.projectRoot}) build`);
398
- try {
399
- const unbuild = await resolveUnbuild(options);
400
- await unbuild.build(options.projectRoot, false, {
401
- ...options,
402
- rootDir: options.projectRoot
403
- });
404
- } finally {
405
- stopwatch();
406
- }
407
- return options;
408
- }
409
- _chunk3GQAWCBQjs.__name.call(void 0, executeUnbuild, "executeUnbuild");
410
- async function copyBuildAssets(options) {
411
- _chunkGRBZKMJIjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${options.outDir}`, options.config);
412
- const stopwatch = _chunkGRBZKMJIjs.getStopwatch.call(void 0, `${options.name} asset copy`);
413
- await _chunkAX4OFOSNjs.copyAssets.call(void 0, options.config, _nullishCoalesce(options.assets, () => ( [])), options.outDir, options.projectRoot, options.projectName, options.sourceRoot, options.generatePackageJson, options.includeSrc);
414
- stopwatch();
415
- return options;
416
- }
417
- _chunk3GQAWCBQjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
418
- async function cleanOutputPath(options) {
419
- if (options.clean !== false && options.outDir) {
420
- await clean(options.name, options.outDir, options.config);
421
- }
422
- return options;
423
- }
424
- _chunk3GQAWCBQjs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
425
- async function build(options) {
426
- _chunkGRBZKMJIjs.writeDebug.call(void 0, ` \u26A1 Executing Storm Unbuild pipeline`);
427
- const stopwatch = _chunkGRBZKMJIjs.getStopwatch.call(void 0, "Unbuild pipeline");
428
- try {
429
- const resolvedOptions = await resolveOptions(options);
430
- await cleanOutputPath(resolvedOptions);
431
- await generatePackageJson(resolvedOptions);
432
- await executeUnbuild(resolvedOptions);
433
- await copyBuildAssets(resolvedOptions);
434
- _chunkGRBZKMJIjs.writeSuccess.call(void 0, ` \u{1F3C1} The ${resolvedOptions.name} build completed successfully`, resolvedOptions.config);
435
- } catch (error) {
436
- _chunkGRBZKMJIjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
437
- throw error;
438
- } finally {
439
- stopwatch();
440
- }
441
- }
442
- _chunk3GQAWCBQjs.__name.call(void 0, build, "build");
443
-
444
- // src/executors/unbuild/executor.ts
445
-
446
- async function unbuildExecutorFn(options, context, config) {
447
- _chunkGRBZKMJIjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
448
- if (!_optionalChain([context, 'access', _ => _.projectsConfigurations, 'optionalAccess', _2 => _2.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _3 => _3.projectsConfigurations, 'access', _4 => _4.projects, 'access', _5 => _5[context.projectName], 'optionalAccess', _6 => _6.root])) {
449
- throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
450
- }
451
- await build(_defu.defu.call(void 0, {
452
- ...options,
453
- projectRoot: _optionalChain([context, 'access', _7 => _7.projectsConfigurations, 'access', _8 => _8.projects, 'optionalAccess', _9 => _9[context.projectName], 'access', _10 => _10.root]),
454
- projectName: context.projectName,
455
- sourceRoot: _optionalChain([context, 'access', _11 => _11.projectsConfigurations, 'access', _12 => _12.projects, 'optionalAccess', _13 => _13[context.projectName], 'optionalAccess', _14 => _14.sourceRoot]),
456
- platform: options.platform,
457
- name: context.projectName
458
- }, {
459
- stubOptions: {
460
- jiti: {
461
- cache: "node_modules/.cache/storm"
462
- }
463
- },
464
- rollup: {
465
- emitCJS: true,
466
- watch: false,
467
- cjsBridge: false,
468
- dts: {
469
- respectExternal: true
470
- },
471
- replace: {},
472
- alias: {},
473
- resolve: {},
474
- json: {},
475
- commonjs: {},
476
- esbuild: {
477
- target: options.target,
478
- format: "esm",
479
- platform: options.platform,
480
- minify: options.minify,
481
- treeShaking: options.treeShaking
482
- }
483
- }
484
- }));
485
- return {
486
- success: true
487
- };
488
- }
489
- _chunk3GQAWCBQjs.__name.call(void 0, unbuildExecutorFn, "unbuildExecutorFn");
490
- var executor_default = _chunkCDOWHRVEjs.withRunExecutor.call(void 0, "TypeScript Unbuild build", unbuildExecutorFn, {
491
- skipReadingConfig: false,
492
- hooks: {
493
- applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, config) => {
494
- options.entry ??= [
495
- "{sourceRoot}"
496
- ];
497
- options.outputPath ??= "dist/{projectRoot}";
498
- options.tsconfig ??= "{projectRoot}/tsconfig.json";
499
- return options;
500
- }, "applyDefaultOptions")
501
- }
502
- });
503
-
504
-
505
-
506
-
507
- exports.unbuildExecutorFn = unbuildExecutorFn; exports.executor_default = executor_default;