@storm-software/workspace-tools 1.296.66 → 1.296.69

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 (183) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-JSF2U5XJ.mjs → chunk-5HFH7JXU.mjs} +1 -1
  3. package/dist/chunk-6JPLZS7V.js +63 -0
  4. package/dist/{chunk-33X22YHZ.js → chunk-6SGLYIAR.js} +38 -62
  5. package/dist/{chunk-7GR34ULJ.mjs → chunk-DWFH4BRZ.mjs} +1 -1
  6. package/dist/{chunk-HHIEI52S.mjs → chunk-F2YQJNBF.mjs} +1 -1
  7. package/dist/{chunk-ZLMX7HR5.mjs → chunk-LWUEYMYK.mjs} +1 -1
  8. package/dist/chunk-NVQEK4YA.mjs +63 -0
  9. package/dist/{chunk-PVNPMJZX.mjs → chunk-QJ7X75J7.mjs} +18 -42
  10. package/dist/chunk-QTRRVFW3.js +646 -0
  11. package/dist/{chunk-26UFEUQD.mjs → chunk-TCAUYQGJ.mjs} +1 -1
  12. package/dist/chunk-WCG3YZT5.mjs +646 -0
  13. package/dist/{executor-C5219i5t.d.ts → executor-Bvhe30H9.d.mts} +1 -1
  14. package/dist/{executor-DadFjUp3.d.mts → executor-Bvhe30H9.d.ts} +1 -1
  15. package/dist/{executor-CIWrRfZk.d.ts → executor-ByqK10v5.d.mts} +1 -1
  16. package/dist/{executor-CG97uTCS.d.mts → executor-ByqK10v5.d.ts} +1 -1
  17. package/dist/{executor-k7EKIXAK.d.ts → executor-CfRFawOI.d.mts} +1 -1
  18. package/dist/{executor-CMTGEhxz.d.mts → executor-CfRFawOI.d.ts} +1 -1
  19. package/dist/{executor-DwZoSq9d.d.mts → executor-DGBYJ2e9.d.mts} +2 -2
  20. package/dist/{executor-ClfwHhlC.d.ts → executor-DGBYJ2e9.d.ts} +2 -2
  21. package/dist/{executor-Dy3y0dK8.d.ts → executor-DnAgSSQo.d.mts} +1 -1
  22. package/dist/{executor-BvyV-AUf.d.mts → executor-DnAgSSQo.d.ts} +1 -1
  23. package/dist/{executor-J46dd9vs.d.ts → executor-gZ6drqad.d.mts} +1 -1
  24. package/dist/{executor-BIJn8SVe.d.mts → executor-gZ6drqad.d.ts} +1 -1
  25. package/dist/executors.d.mts +8 -9
  26. package/dist/executors.d.ts +8 -9
  27. package/dist/executors.js +6 -7
  28. package/dist/executors.mjs +9 -10
  29. package/dist/{generator-pH8SQ4XZ.d.ts → generator-B84zOfal.d.ts} +1 -1
  30. package/dist/{generator-DKHHWoGN.d.mts → generator-B8e9I6Mc.d.mts} +1 -1
  31. package/dist/{generator-COkrr-Oe.d.ts → generator-BC0IbdKh.d.ts} +2 -2
  32. package/dist/{generator-B5dG5dVY.d.ts → generator-BIDPDi0P.d.ts} +2 -2
  33. package/dist/{generator-Dmk05ap8.d.mts → generator-BS0iminO.d.mts} +2 -2
  34. package/dist/{generator-CXLEWJAF.d.ts → generator-Bg8GF2dN.d.mts} +2 -2
  35. package/dist/{generator-RLXG3OeQ.d.ts → generator-CPtINS_d.d.mts} +2 -2
  36. package/dist/{generator-C3dM_v6y.d.mts → generator-D7IL5mT3.d.ts} +2 -2
  37. package/dist/{generator-BKQGstaG.d.mts → generator-DZxxv_h5.d.mts} +2 -2
  38. package/dist/{generator-OpEc9gcp.d.mts → generator-Dq3a21FT.d.ts} +2 -2
  39. package/dist/generators.d.mts +9 -10
  40. package/dist/generators.d.ts +9 -10
  41. package/dist/generators.mjs +5 -5
  42. package/dist/index.d.mts +17 -16
  43. package/dist/index.d.ts +17 -16
  44. package/dist/index.js +6 -7
  45. package/dist/index.mjs +13 -14
  46. package/dist/src/base/base-executor.d.mts +3 -5
  47. package/dist/src/base/base-executor.d.ts +3 -5
  48. package/dist/src/base/base-executor.mjs +1 -1
  49. package/dist/src/base/base-executor.untyped.mjs +1 -1
  50. package/dist/src/base/base-generator.d.mts +3 -5
  51. package/dist/src/base/base-generator.d.ts +3 -5
  52. package/dist/src/base/base-generator.mjs +1 -1
  53. package/dist/src/base/base-generator.untyped.mjs +1 -1
  54. package/dist/src/base/cargo-base-executor.untyped.mjs +1 -1
  55. package/dist/src/base/index.d.mts +3 -5
  56. package/dist/src/base/index.d.ts +3 -5
  57. package/dist/src/base/index.mjs +1 -1
  58. package/dist/src/base/typescript-build-executor.untyped.mjs +1 -1
  59. package/dist/src/base/typescript-library-generator.untyped.mjs +1 -1
  60. package/dist/src/executors/cargo-build/executor.mjs +1 -1
  61. package/dist/src/executors/cargo-build/untyped.mjs +1 -1
  62. package/dist/src/executors/cargo-check/executor.mjs +1 -1
  63. package/dist/src/executors/cargo-check/untyped.mjs +1 -1
  64. package/dist/src/executors/cargo-clippy/executor.mjs +1 -1
  65. package/dist/src/executors/cargo-clippy/untyped.mjs +1 -1
  66. package/dist/src/executors/cargo-doc/executor.mjs +1 -1
  67. package/dist/src/executors/cargo-doc/untyped.mjs +1 -1
  68. package/dist/src/executors/cargo-format/executor.mjs +1 -1
  69. package/dist/src/executors/cargo-format/untyped.mjs +1 -1
  70. package/dist/src/executors/cargo-publish/executor.mjs +1 -1
  71. package/dist/src/executors/cargo-publish/untyped.mjs +1 -1
  72. package/dist/src/executors/clean-package/executor.d.mts +1 -3
  73. package/dist/src/executors/clean-package/executor.d.ts +1 -3
  74. package/dist/src/executors/clean-package/executor.mjs +1 -1
  75. package/dist/src/executors/clean-package/untyped.mjs +1 -1
  76. package/dist/src/executors/esbuild/executor.d.mts +2 -4
  77. package/dist/src/executors/esbuild/executor.d.ts +2 -4
  78. package/dist/src/executors/esbuild/executor.js +2 -3
  79. package/dist/src/executors/esbuild/executor.mjs +2 -3
  80. package/dist/src/executors/esbuild/untyped.mjs +1 -1
  81. package/dist/src/executors/napi/executor.d.mts +2 -4
  82. package/dist/src/executors/napi/executor.d.ts +2 -4
  83. package/dist/src/executors/napi/executor.mjs +1 -1
  84. package/dist/src/executors/napi/untyped.mjs +1 -1
  85. package/dist/src/executors/npm-publish/executor.js +2 -2
  86. package/dist/src/executors/npm-publish/executor.mjs +2 -2
  87. package/dist/src/executors/npm-publish/untyped.mjs +1 -1
  88. package/dist/src/executors/size-limit/executor.d.mts +2 -4
  89. package/dist/src/executors/size-limit/executor.d.ts +2 -4
  90. package/dist/src/executors/size-limit/executor.mjs +1 -1
  91. package/dist/src/executors/size-limit/untyped.mjs +1 -1
  92. package/dist/src/executors/tsdown/executor.d.mts +2 -4
  93. package/dist/src/executors/tsdown/executor.d.ts +2 -4
  94. package/dist/src/executors/tsdown/executor.js +2 -3
  95. package/dist/src/executors/tsdown/executor.mjs +2 -3
  96. package/dist/src/executors/tsdown/untyped.mjs +1 -1
  97. package/dist/src/executors/typia/executor.d.mts +2 -4
  98. package/dist/src/executors/typia/executor.d.ts +2 -4
  99. package/dist/src/executors/typia/executor.mjs +1 -1
  100. package/dist/src/executors/typia/untyped.mjs +1 -1
  101. package/dist/src/executors/unbuild/executor.d.mts +2 -4
  102. package/dist/src/executors/unbuild/executor.d.ts +2 -4
  103. package/dist/src/executors/unbuild/executor.mjs +1 -1
  104. package/dist/src/executors/unbuild/untyped.mjs +1 -1
  105. package/dist/src/generators/browser-library/generator.d.mts +4 -6
  106. package/dist/src/generators/browser-library/generator.d.ts +4 -6
  107. package/dist/src/generators/browser-library/generator.mjs +2 -2
  108. package/dist/src/generators/browser-library/untyped.mjs +1 -1
  109. package/dist/src/generators/config-schema/generator.d.mts +4 -5
  110. package/dist/src/generators/config-schema/generator.d.ts +4 -5
  111. package/dist/src/generators/config-schema/generator.mjs +1 -1
  112. package/dist/src/generators/config-schema/untyped.mjs +1 -1
  113. package/dist/src/generators/init/init.mjs +1 -1
  114. package/dist/src/generators/init/untyped.mjs +1 -1
  115. package/dist/src/generators/neutral-library/generator.d.mts +4 -6
  116. package/dist/src/generators/neutral-library/generator.d.ts +4 -6
  117. package/dist/src/generators/neutral-library/generator.mjs +2 -2
  118. package/dist/src/generators/neutral-library/untyped.mjs +1 -1
  119. package/dist/src/generators/node-library/generator.d.mts +4 -6
  120. package/dist/src/generators/node-library/generator.d.ts +4 -6
  121. package/dist/src/generators/node-library/generator.mjs +2 -2
  122. package/dist/src/generators/node-library/untyped.mjs +1 -1
  123. package/dist/src/generators/preset/generator.d.mts +4 -6
  124. package/dist/src/generators/preset/generator.d.ts +4 -6
  125. package/dist/src/generators/preset/generator.mjs +2 -2
  126. package/dist/src/generators/preset/untyped.mjs +1 -1
  127. package/dist/src/plugins/rust/cargo-toml.mjs +1 -1
  128. package/dist/src/plugins/rust/index.mjs +1 -1
  129. package/dist/src/plugins/typescript/index.d.mts +3 -5
  130. package/dist/src/plugins/typescript/index.d.ts +3 -5
  131. package/dist/src/plugins/typescript/index.mjs +1 -1
  132. package/dist/src/plugins/typescript/tsdown.d.mts +3 -5
  133. package/dist/src/plugins/typescript/tsdown.d.ts +3 -5
  134. package/dist/src/plugins/typescript/tsdown.mjs +1 -1
  135. package/dist/src/plugins/typescript/tsup.d.mts +3 -5
  136. package/dist/src/plugins/typescript/tsup.d.ts +3 -5
  137. package/dist/src/plugins/typescript/tsup.mjs +1 -1
  138. package/dist/src/plugins/typescript/untyped-schema.mjs +1 -1
  139. package/dist/src/release/index.d.mts +2 -3
  140. package/dist/src/release/index.d.ts +2 -3
  141. package/dist/src/release/index.mjs +1 -1
  142. package/dist/src/release/js-version-actions.d.mts +1 -3
  143. package/dist/src/release/js-version-actions.d.ts +1 -3
  144. package/dist/src/release/js-version-actions.mjs +1 -1
  145. package/dist/src/release/rust-version-actions.d.mts +1 -3
  146. package/dist/src/release/rust-version-actions.d.ts +1 -3
  147. package/dist/src/release/rust-version-actions.mjs +1 -1
  148. package/dist/src/types.d.mts +77 -6
  149. package/dist/src/types.d.ts +77 -6
  150. package/dist/src/types.mjs +1 -1
  151. package/dist/src/utils/apply-workspace-tokens.mjs +1 -1
  152. package/dist/src/utils/cargo.mjs +1 -1
  153. package/dist/src/utils/create-cli-options.mjs +1 -1
  154. package/dist/src/utils/get-project-configurations.mjs +1 -1
  155. package/dist/src/utils/github.d.mts +1 -3
  156. package/dist/src/utils/github.d.ts +1 -3
  157. package/dist/src/utils/github.mjs +1 -1
  158. package/dist/src/utils/index.d.mts +4 -5
  159. package/dist/src/utils/index.d.ts +4 -5
  160. package/dist/src/utils/index.mjs +1 -1
  161. package/dist/src/utils/lock-file.mjs +1 -1
  162. package/dist/src/utils/nx-json.mjs +1 -1
  163. package/dist/src/utils/package-helpers.mjs +1 -1
  164. package/dist/src/utils/plugin-helpers.mjs +1 -1
  165. package/dist/src/utils/project-tags.d.mts +3 -57
  166. package/dist/src/utils/project-tags.d.ts +3 -57
  167. package/dist/src/utils/project-tags.mjs +1 -1
  168. package/dist/src/utils/registry-helpers.mjs +1 -1
  169. package/dist/src/utils/typia-transform.mjs +1 -1
  170. package/dist/src/utils/versions.mjs +1 -1
  171. package/package.json +11 -11
  172. package/dist/chunk-BCJOE7LL.mjs +0 -469
  173. package/dist/chunk-CX7LLOXP.js +0 -363
  174. package/dist/chunk-F4NO6JZL.mjs +0 -319
  175. package/dist/chunk-MI4DOBNH.js +0 -319
  176. package/dist/chunk-TFGZLFCS.mjs +0 -363
  177. package/dist/chunk-UCM45E6T.js +0 -469
  178. package/dist/types-CHANfFBa.d.ts +0 -77
  179. package/dist/types-D2zxYEAh.d.mts +0 -41
  180. package/dist/types-D2zxYEAh.d.ts +0 -41
  181. package/dist/types-DI57BUsw.d.mts +0 -243
  182. package/dist/types-DI57BUsw.d.ts +0 -243
  183. package/dist/types-E53OUdCr.d.mts +0 -77
@@ -1,363 +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
- var _chunkMI4DOBNHjs = require('./chunk-MI4DOBNH.js');
9
-
10
-
11
- var _chunk3QCVXOSBjs = require('./chunk-3QCVXOSB.js');
12
-
13
-
14
- var _chunkLQ4UTUAFjs = require('./chunk-LQ4UTUAF.js');
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
- var _chunkCLKU7UMGjs = require('./chunk-CLKU7UMG.js');
24
-
25
-
26
- var _chunkLMYTVXGXjs = require('./chunk-LMYTVXGX.js');
27
-
28
-
29
- var _chunkCQDBLKPFjs = require('./chunk-CQDBLKPF.js');
30
-
31
- // ../tsdown/src/build.ts
32
-
33
-
34
-
35
-
36
- var _devkit = require('@nx/devkit');
37
- var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
38
- var _fs = require('fs');
39
- var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
40
- var _tsdown = require('tsdown');
41
-
42
- // ../tsdown/src/clean.ts
43
-
44
- async function cleanDirectories(name = "TSDown", directory, config) {
45
- await _promises.rm.call(void 0, directory, { recursive: true, force: true });
46
- }
47
-
48
- // ../tsdown/src/config.ts
49
- function getDefaultOptions(config) {
50
- return {
51
- entry: ["./src/*.ts"],
52
- platform: "node",
53
- target: "esnext",
54
- mode: "production",
55
- dts: true,
56
- unused: {
57
- level: "error",
58
- ignore: ["typescript"]
59
- },
60
- publint: true,
61
- fixedExtension: true,
62
- ...config
63
- };
64
- }
65
- function toTSDownFormat(format) {
66
- if (!format || Array.isArray(format) && format.length === 0) {
67
- return ["cjs", "es"];
68
- } else if (format === "esm") {
69
- return "es";
70
- } else if (Array.isArray(format)) {
71
- return format.map((f) => f === "esm" ? "es" : f);
72
- }
73
- return format;
74
- }
75
-
76
- // ../tsdown/src/build.ts
77
- var resolveOptions = async (userOptions) => {
78
- const options = getDefaultOptions(userOptions);
79
- const workspaceRoot = _chunkLMYTVXGXjs.findWorkspaceRoot.call(void 0, options.projectRoot);
80
- if (!workspaceRoot) {
81
- throw new Error("Cannot find Nx workspace root");
82
- }
83
- const workspaceConfig = await _chunkLQ4UTUAFjs.getWorkspaceConfig.call(void 0, options.debug === true, {
84
- workspaceRoot
85
- });
86
- _chunkCLKU7UMGjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", workspaceConfig);
87
- const stopwatch = _chunkCLKU7UMGjs.getStopwatch.call(void 0, "Build options resolution");
88
- const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
89
- exitOnError: true
90
- });
91
- const projectJsonPath = _chunkCQDBLKPFjs.joinPaths.call(void 0,
92
- workspaceRoot,
93
- options.projectRoot,
94
- "project.json"
95
- );
96
- if (!_fs.existsSync.call(void 0, projectJsonPath)) {
97
- throw new Error("Cannot find project.json configuration");
98
- }
99
- const projectJsonFile = await _promises2.default.readFile(projectJsonPath, "utf8");
100
- const projectJson = JSON.parse(projectJsonFile);
101
- const projectName = projectJson.name;
102
- const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
103
- if (!_optionalChain([projectConfigurations, 'optionalAccess', _ => _.projects, 'optionalAccess', _2 => _2[projectName]])) {
104
- throw new Error(
105
- "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."
106
- );
107
- }
108
- const packageJsonPath = _chunkCQDBLKPFjs.joinPaths.call(void 0,
109
- workspaceRoot,
110
- options.projectRoot,
111
- "package.json"
112
- );
113
- if (!_fs.existsSync.call(void 0, packageJsonPath)) {
114
- throw new Error("Cannot find package.json configuration");
115
- }
116
- const debug = _nullishCoalesce(options.debug, () => ( (options.mode || workspaceConfig.mode) === "development"));
117
- const sourceRoot = projectJson.sourceRoot || _chunkCQDBLKPFjs.joinPaths.call(void 0, options.projectRoot, "src");
118
- const result = {
119
- name: projectName,
120
- mode: "production",
121
- target: _chunkMI4DOBNHjs.DEFAULT_TARGET,
122
- generatePackageJson: true,
123
- outDir: _chunkCQDBLKPFjs.joinPaths.call(void 0, "dist", options.projectRoot),
124
- minify: !debug,
125
- plugins: [],
126
- assets: [],
127
- dts: true,
128
- shims: true,
129
- logLevel: workspaceConfig.logLevel === "success" || workspaceConfig.logLevel === "performance" || workspaceConfig.logLevel === "debug" || workspaceConfig.logLevel === "trace" || workspaceConfig.logLevel === "all" ? "info" : workspaceConfig.logLevel === "fatal" ? "error" : workspaceConfig.logLevel,
130
- sourcemap: debug ? "inline" : false,
131
- clean: false,
132
- fixedExtension: true,
133
- nodeProtocol: true,
134
- tsconfig: _chunkCQDBLKPFjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"),
135
- debug,
136
- sourceRoot,
137
- cwd: workspaceConfig.workspaceRoot,
138
- entry: {
139
- ["index"]: _chunkCQDBLKPFjs.joinPaths.call(void 0, sourceRoot, "index.ts")
140
- },
141
- workspace: true,
142
- ...options,
143
- treeshake: options.treeShaking !== false,
144
- format: toTSDownFormat(options.format),
145
- workspaceConfig,
146
- projectName,
147
- projectGraph,
148
- projectConfigurations
149
- };
150
- result.env = _defu2.default.call(void 0,
151
- options.env,
152
- _chunkMI4DOBNHjs.getEnv.call(void 0, "tsdown", result)
153
- );
154
- stopwatch();
155
- return result;
156
- };
157
- async function generatePackageJson(options) {
158
- if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkCQDBLKPFjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
159
- _chunkCLKU7UMGjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.workspaceConfig);
160
- const stopwatch = _chunkCLKU7UMGjs.getStopwatch.call(void 0, "Write package.json file");
161
- const packageJsonPath = _chunkCQDBLKPFjs.joinPaths.call(void 0, options.projectRoot, "project.json");
162
- if (!_fs.existsSync.call(void 0, packageJsonPath)) {
163
- throw new Error("Cannot find package.json configuration");
164
- }
165
- const packageJsonFile = await _promises2.default.readFile(
166
- _chunkCQDBLKPFjs.joinPaths.call(void 0,
167
- options.workspaceConfig.workspaceRoot,
168
- options.projectRoot,
169
- "package.json"
170
- ),
171
- "utf8"
172
- );
173
- if (!packageJsonFile) {
174
- throw new Error("Cannot find package.json configuration file");
175
- }
176
- let packageJson = JSON.parse(packageJsonFile);
177
- packageJson = await _chunkMI4DOBNHjs.addPackageDependencies.call(void 0,
178
- options.workspaceConfig.workspaceRoot,
179
- options.projectRoot,
180
- options.projectName,
181
- packageJson
182
- );
183
- packageJson = await _chunkMI4DOBNHjs.addWorkspacePackageJsonFields.call(void 0,
184
- options.workspaceConfig,
185
- options.projectRoot,
186
- options.sourceRoot,
187
- options.projectName,
188
- false,
189
- packageJson
190
- );
191
- packageJson.exports ??= {};
192
- packageJson.exports["./package.json"] ??= "./package.json";
193
- packageJson.exports["."] ??= _chunkMI4DOBNHjs.addPackageJsonExport.call(void 0,
194
- "index",
195
- packageJson.type,
196
- options.sourceRoot
197
- );
198
- let entry = [{ in: "./src/index.ts", out: "./src/index.ts" }];
199
- if (options.entry) {
200
- if (Array.isArray(options.entry)) {
201
- entry = options.entry.map(
202
- (entryPoint) => typeof entryPoint === "string" ? { in: entryPoint, out: entryPoint } : entryPoint
203
- );
204
- }
205
- for (const entryPoint of entry) {
206
- const split = entryPoint.out.split(".");
207
- split.pop();
208
- const entry2 = split.join(".").replaceAll("\\", "/");
209
- packageJson.exports[`./${entry2}`] ??= _chunkMI4DOBNHjs.addPackageJsonExport.call(void 0,
210
- entry2,
211
- options.fixedExtension ? "fixed" : packageJson.type,
212
- options.sourceRoot
213
- );
214
- }
215
- }
216
- packageJson.main = !options.fixedExtension && packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
217
- packageJson.module = !options.fixedExtension && packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
218
- packageJson.types = `./dist/index.d.${!options.fixedExtension ? "ts" : "mts"}`;
219
- packageJson.exports = Object.keys(packageJson.exports).reduce(
220
- (ret, key) => {
221
- if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
222
- ret[key.replace("/index", "")] = packageJson.exports[key];
223
- }
224
- return ret;
225
- },
226
- packageJson.exports
227
- );
228
- await _devkit.writeJsonFile.call(void 0, _chunkCQDBLKPFjs.joinPaths.call(void 0, options.outDir, "package.json"), packageJson);
229
- stopwatch();
230
- }
231
- return options;
232
- }
233
- async function executeTSDown(options) {
234
- _chunkCLKU7UMGjs.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} build`, options.workspaceConfig);
235
- const stopwatch = _chunkCLKU7UMGjs.getStopwatch.call(void 0, `${options.name} build`);
236
- await _tsdown.build.call(void 0, {
237
- ...options,
238
- entry: options.entry,
239
- config: false
240
- });
241
- stopwatch();
242
- return options;
243
- }
244
- async function copyBuildAssets(options) {
245
- _chunkCLKU7UMGjs.writeDebug.call(void 0,
246
- ` \u{1F4CB} Copying asset files to output directory: ${options.outDir}`,
247
- options.workspaceConfig
248
- );
249
- const stopwatch = _chunkCLKU7UMGjs.getStopwatch.call(void 0, `${options.name} asset copy`);
250
- await _chunkMI4DOBNHjs.copyAssets.call(void 0,
251
- options.workspaceConfig,
252
- _nullishCoalesce(options.assets, () => ( [])),
253
- options.outDir,
254
- options.projectRoot,
255
- options.sourceRoot,
256
- true,
257
- false
258
- );
259
- stopwatch();
260
- return options;
261
- }
262
- async function reportResults(options) {
263
- _chunkCLKU7UMGjs.writeSuccess.call(void 0,
264
- ` \u{1F4E6} The ${options.name} build completed successfully`,
265
- options.workspaceConfig
266
- );
267
- }
268
- async function cleanOutputPath(options) {
269
- if (options.clean !== false && options.workspaceConfig) {
270
- _chunkCLKU7UMGjs.writeDebug.call(void 0,
271
- ` \u{1F9F9} Cleaning ${options.name} output path: ${options.workspaceConfig}`,
272
- options.workspaceConfig
273
- );
274
- const stopwatch = _chunkCLKU7UMGjs.getStopwatch.call(void 0, `${options.name} output clean`);
275
- await cleanDirectories(
276
- options.name,
277
- options.outDir,
278
- options.workspaceConfig
279
- );
280
- stopwatch();
281
- }
282
- return options;
283
- }
284
- async function build(options) {
285
- _chunkCLKU7UMGjs.writeDebug.call(void 0, ` ${_chunkCLKU7UMGjs.brandIcon.call(void 0, )} Executing Storm TSDown pipeline`);
286
- const stopwatch = _chunkCLKU7UMGjs.getStopwatch.call(void 0, "TSDown pipeline");
287
- try {
288
- const opts = Array.isArray(options) ? options : [options];
289
- if (opts.length === 0) {
290
- throw new Error("No build options were provided");
291
- }
292
- const resolved = await Promise.all(
293
- opts.map(async (opt) => await resolveOptions(opt))
294
- );
295
- if (resolved.length > 0) {
296
- await cleanOutputPath(resolved[0]);
297
- await generatePackageJson(resolved[0]);
298
- await Promise.all(
299
- resolved.map(async (opt) => {
300
- await executeTSDown(opt);
301
- await copyBuildAssets(opt);
302
- await reportResults(opt);
303
- })
304
- );
305
- } else {
306
- _chunkCLKU7UMGjs.writeWarning.call(void 0,
307
- " \u{1F6A7} No options were passed to TSBuild. Please check the parameters passed to the `build` function."
308
- );
309
- }
310
- _chunkCLKU7UMGjs.writeSuccess.call(void 0, " \u{1F3C1} TSDown pipeline build completed successfully");
311
- } catch (error) {
312
- _chunkCLKU7UMGjs.writeFatal.call(void 0,
313
- "Fatal errors that the build process could not recover from have occured. The build process has been terminated."
314
- );
315
- throw error;
316
- } finally {
317
- stopwatch();
318
- }
319
- }
320
-
321
- // src/executors/tsdown/executor.ts
322
- async function tsdownExecutorFn(options, context, config) {
323
- _chunkCLKU7UMGjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm TSDown executor on the workspace", config);
324
- 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])) {
325
- throw new Error(
326
- "The Build process failed because the context is not valid. Please run this command from a workspace."
327
- );
328
- }
329
- await build({
330
- ...options,
331
- projectRoot: (
332
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
333
- _optionalChain([context, 'access', _9 => _9.projectsConfigurations, 'access', _10 => _10.projects, 'optionalAccess', _11 => _11[context.projectName], 'access', _12 => _12.root])
334
- ),
335
- name: context.projectName,
336
- sourceRoot: _optionalChain([context, 'access', _13 => _13.projectsConfigurations, 'access', _14 => _14.projects, 'optionalAccess', _15 => _15[context.projectName], 'optionalAccess', _16 => _16.sourceRoot]),
337
- format: options.format,
338
- platform: options.platform
339
- });
340
- return {
341
- success: true
342
- };
343
- }
344
- var executor_default = _chunk3QCVXOSBjs.withRunExecutor.call(void 0,
345
- "Storm TSDown build",
346
- tsdownExecutorFn,
347
- {
348
- skipReadingConfig: false,
349
- hooks: {
350
- applyDefaultOptions: async (options) => {
351
- options.entry ??= ["src/index.ts"];
352
- options.outputPath ??= "dist/{projectRoot}";
353
- options.tsconfig ??= "{projectRoot}/tsconfig.json";
354
- return options;
355
- }
356
- }
357
- }
358
- );
359
-
360
-
361
-
362
-
363
- exports.tsdownExecutorFn = tsdownExecutorFn; exports.executor_default = executor_default;
@@ -1,319 +0,0 @@
1
- import {
2
- writeDebug,
3
- writeTrace
4
- } from "./chunk-45CW7OJB.mjs";
5
- import {
6
- findWorkspaceRoot
7
- } from "./chunk-3J2CP54B.mjs";
8
- import {
9
- joinPaths
10
- } from "./chunk-TBW5MCN6.mjs";
11
-
12
- // ../build-tools/src/config.ts
13
- var DEFAULT_JS_BANNER = `
14
- // ---------------------------------------
15
- // \u{1F5F2} Built by Storm Software
16
- // ---------------------------------------
17
- `;
18
- var DEFAULT_CSS_BANNER = `
19
- /* ---------------------------------------
20
- \u{1F5F2} Built by Storm Software
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
- import { CopyAssetsHandler } from "@nx/js/internal";
29
- import { glob } from "glob";
30
- import { readFile, writeFile } from "node:fs/promises";
31
- var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson = true, includeSrc = false, banner, footer) => {
32
- const pendingAssets = Array.from(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
- writeTrace(
58
- `\u{1F4DD} Copying the following assets to the output directory:
59
- ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${joinPaths(outputPath, pendingAsset.output)}`).join("\n")}`,
60
- config
61
- );
62
- const assetHandler = new CopyAssetsHandler({
63
- projectDir: projectRoot,
64
- rootDir: config.workspaceRoot,
65
- outputDir: outputPath,
66
- assets: pendingAssets
67
- });
68
- await assetHandler.processAllAssetsOnce();
69
- writeTrace("Completed copying assets to the output directory", config);
70
- if (includeSrc === true) {
71
- writeDebug(
72
- `\u{1F4DD} Adding banner and writing source files: ${joinPaths(
73
- outputPath,
74
- "src"
75
- )}`,
76
- config
77
- );
78
- const files = await glob([
79
- joinPaths(config.workspaceRoot, outputPath, "src/**/*.ts"),
80
- joinPaths(config.workspaceRoot, outputPath, "src/**/*.tsx"),
81
- joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
82
- joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
83
- ]);
84
- await Promise.allSettled(
85
- files.map(
86
- async (file) => writeFile(
87
- file,
88
- `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
89
-
90
- ${await readFile(file, "utf8")}
91
-
92
- ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
93
- )
94
- )
95
- );
96
- }
97
- };
98
-
99
- // ../build-tools/src/utilities/generate-package-json.ts
100
- import { calculateProjectBuildableDependencies } from "@nx/js/internal";
101
- import { Glob } from "glob";
102
- import { existsSync, readFileSync } from "node:fs";
103
- import { readFile as readFile2 } from "node:fs/promises";
104
- import {
105
- createProjectGraphAsync,
106
- readCachedProjectGraph,
107
- readProjectsConfigurationFromProjectGraph
108
- } from "nx/src/project-graph/project-graph";
109
- var addPackageDependencies = async (workspaceRoot, projectRoot, projectName, packageJson) => {
110
- let projectGraph;
111
- try {
112
- projectGraph = readCachedProjectGraph();
113
- } catch {
114
- await createProjectGraphAsync();
115
- projectGraph = readCachedProjectGraph();
116
- }
117
- if (!projectGraph) {
118
- throw new Error(
119
- "The Build process failed because the project graph is not available. Please run the build command again."
120
- );
121
- }
122
- const projectDependencies = calculateProjectBuildableDependencies(
123
- void 0,
124
- projectGraph,
125
- workspaceRoot,
126
- projectName,
127
- process.env.NX_TASK_TARGET_TARGET || "build",
128
- process.env.NX_TASK_TARGET_CONFIGURATION || "production",
129
- true
130
- );
131
- const localPackages = [];
132
- for (const project of projectDependencies.dependencies.filter(
133
- (dep) => dep.node.type === "lib" && dep.node.data?.root !== projectRoot && dep.node.data?.root !== workspaceRoot
134
- )) {
135
- const projectNode = project.node;
136
- if (projectNode.data.root) {
137
- const projectPackageJsonPath = joinPaths(
138
- workspaceRoot,
139
- projectNode.data.root,
140
- "package.json"
141
- );
142
- if (existsSync(projectPackageJsonPath)) {
143
- const projectPackageJsonContent = await readFile2(
144
- projectPackageJsonPath,
145
- "utf8"
146
- );
147
- const projectPackageJson = JSON.parse(projectPackageJsonContent);
148
- if (projectPackageJson.private !== true) {
149
- localPackages.push(projectPackageJson);
150
- }
151
- }
152
- }
153
- }
154
- if (localPackages.length > 0) {
155
- writeTrace(
156
- `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`
157
- );
158
- const projectJsonFile = await readFile2(
159
- joinPaths(projectRoot, "project.json"),
160
- "utf8"
161
- );
162
- const projectJson = JSON.parse(projectJsonFile);
163
- const projectName2 = projectJson.name;
164
- const projectConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
165
- if (!projectConfigurations?.projects?.[projectName2]) {
166
- throw new Error(
167
- "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."
168
- );
169
- }
170
- const implicitDependencies = projectConfigurations.projects?.[projectName2].implicitDependencies?.reduce((ret, dep) => {
171
- if (projectConfigurations.projects?.[dep]) {
172
- const depPackageJsonPath = joinPaths(
173
- workspaceRoot,
174
- projectConfigurations.projects[dep].root,
175
- "package.json"
176
- );
177
- if (existsSync(depPackageJsonPath)) {
178
- const depPackageJsonContent = readFileSync(
179
- depPackageJsonPath,
180
- "utf8"
181
- );
182
- const depPackageJson = JSON.parse(depPackageJsonContent);
183
- if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
184
- ret.push(depPackageJson.name);
185
- }
186
- }
187
- }
188
- return ret;
189
- }, []);
190
- packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
191
- if (!ret[localPackage.name] && !implicitDependencies?.includes(localPackage.name) && packageJson.devDependencies?.[localPackage.name] === void 0) {
192
- ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
193
- }
194
- return ret;
195
- }, packageJson.dependencies ?? {});
196
- packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
197
- if (!ret[localPackage.name] && implicitDependencies?.includes(localPackage.name) && packageJson.dependencies?.[localPackage.name] === void 0) {
198
- ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
199
- }
200
- return ret;
201
- }, packageJson.devDependencies ?? {});
202
- } else {
203
- writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
204
- }
205
- return packageJson;
206
- };
207
- var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
208
- const workspaceRoot = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : findWorkspaceRoot();
209
- const workspacePackageJsonContent = await readFile2(
210
- joinPaths(workspaceRoot, "package.json"),
211
- "utf8"
212
- );
213
- const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
214
- packageJson.type ??= "module";
215
- packageJson.sideEffects ??= false;
216
- if (includeSrc === true) {
217
- let distSrc = sourceRoot.replace(projectRoot, "");
218
- if (distSrc.startsWith("/")) {
219
- distSrc = distSrc.substring(1);
220
- }
221
- packageJson.source ??= `${joinPaths(distSrc, "index.ts").replaceAll("\\", "/")}`;
222
- }
223
- packageJson.files ??= ["dist/**/*"];
224
- if (includeSrc === true && !packageJson.files.includes("src")) {
225
- packageJson.files.push("src/**/*");
226
- }
227
- packageJson.publishConfig ??= {
228
- access: "public"
229
- };
230
- packageJson.description ??= workspacePackageJson.description;
231
- packageJson.homepage ??= workspacePackageJson.homepage;
232
- packageJson.bugs ??= workspacePackageJson.bugs;
233
- packageJson.license ??= workspacePackageJson.license;
234
- packageJson.keywords ??= workspacePackageJson.keywords;
235
- packageJson.funding ??= workspacePackageJson.funding;
236
- packageJson.author ??= workspacePackageJson.author;
237
- packageJson.maintainers ??= workspacePackageJson.maintainers;
238
- if (!packageJson.maintainers && packageJson.author) {
239
- packageJson.maintainers = [packageJson.author];
240
- }
241
- packageJson.contributors ??= workspacePackageJson.contributors;
242
- if (!packageJson.contributors && packageJson.author) {
243
- packageJson.contributors = [packageJson.author];
244
- }
245
- packageJson.repository ??= workspacePackageJson.repository;
246
- packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
247
- return packageJson;
248
- };
249
- var addPackageJsonExport = (file, type = "module", sourceRoot) => {
250
- let entry = file.replaceAll("\\", "/");
251
- if (sourceRoot) {
252
- entry = entry.replace(sourceRoot, "");
253
- }
254
- return {
255
- import: {
256
- types: `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
257
- default: `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
258
- },
259
- require: {
260
- types: `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
261
- default: `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
262
- },
263
- default: {
264
- types: `./dist/${entry}.d.${type !== "fixed" ? "ts" : "mts"}`,
265
- default: `./dist/${entry}.${type !== "fixed" ? "js" : "mjs"}`
266
- }
267
- };
268
- };
269
-
270
- // ../build-tools/src/utilities/get-env.ts
271
- var getEnv = (builder, options) => {
272
- return {
273
- STORM_BUILD: builder,
274
- STORM_ORG: options.orgName || DEFAULT_ORGANIZATION,
275
- STORM_NAME: options.name,
276
- STORM_MODE: options.mode || DEFAULT_ENVIRONMENT,
277
- STORM_PLATFORM: options.platform,
278
- STORM_FORMAT: JSON.stringify(options.format),
279
- STORM_TARGET: JSON.stringify(options.target),
280
- ...options.env
281
- };
282
- };
283
-
284
- // ../build-tools/src/plugins/swc.ts
285
- import { transform } from "@swc/core";
286
-
287
- // ../build-tools/src/plugins/ts-resolve.ts
288
- import fs from "node:fs";
289
- import { builtinModules } from "node:module";
290
- import path from "node:path";
291
- import _resolve from "resolve";
292
-
293
- // ../build-tools/src/plugins/type-definitions.ts
294
- import { stripIndents } from "@nx/devkit";
295
- import { relative } from "path";
296
-
297
- // ../build-tools/src/utilities/get-entry-points.ts
298
- import { glob as glob2 } from "glob";
299
-
300
- // ../build-tools/src/utilities/read-nx-config.ts
301
- import { existsSync as existsSync2 } from "node:fs";
302
- import { readFile as readFile3 } from "node:fs/promises";
303
-
304
- // ../build-tools/src/utilities/task-graph.ts
305
- import {
306
- createTaskGraph,
307
- mapTargetDefaultsToDependencies
308
- } from "nx/src/tasks-runner/create-task-graph";
309
-
310
- export {
311
- DEFAULT_JS_BANNER,
312
- DEFAULT_CSS_BANNER,
313
- DEFAULT_TARGET,
314
- copyAssets,
315
- addPackageDependencies,
316
- addWorkspacePackageJsonFields,
317
- addPackageJsonExport,
318
- getEnv
319
- };