@storm-software/esbuild 0.4.1 → 0.14.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 (89) hide show
  1. package/README.md +1 -1
  2. package/dist/build.cjs +15 -11
  3. package/dist/build.d.cts +3 -3
  4. package/dist/build.d.ts +3 -3
  5. package/dist/build.js +14 -10
  6. package/dist/{chunk-WCQVDF3K.js → chunk-3GQAWCBQ.js} +0 -1
  7. package/dist/chunk-4JLYXTKD.cjs +26 -0
  8. package/dist/chunk-5I2MGPRN.cjs +919 -0
  9. package/dist/{chunk-CMWXE5MF.js → chunk-7KR3YBS6.js} +5 -3
  10. package/dist/chunk-7MDMXJ5V.js +26 -0
  11. package/dist/{chunk-WGEGR3DF.cjs → chunk-BGYQAVKQ.cjs} +0 -1
  12. package/dist/{chunk-J34FQYKV.cjs → chunk-CGFDQ5AJ.cjs} +8 -5
  13. package/dist/{chunk-TTHABTDU.js → chunk-DAGDNKO5.js} +8 -6
  14. package/dist/{chunk-DFGHPRBD.cjs → chunk-EZGTDCYM.cjs} +6 -6
  15. package/dist/chunk-GGNOJ77I.js +0 -0
  16. package/dist/{chunk-YQBU3FSL.js → chunk-GWG4HOQ6.js} +4 -4
  17. package/dist/chunk-HQGUIF4U.js +537 -0
  18. package/dist/{chunk-X5TLV7MF.js → chunk-KE5DL2BG.js} +11 -6
  19. package/dist/{chunk-KJ7ZHAFS.js → chunk-KOK4WCHS.js} +52 -28
  20. package/dist/chunk-LVWQSCJM.cjs +26 -0
  21. package/dist/chunk-LYDEMC26.js +23 -0
  22. package/dist/chunk-MAMLS55E.js +582 -0
  23. package/dist/chunk-NVWDQVN6.js +21 -0
  24. package/dist/chunk-PQ6YIJ72.cjs +136 -0
  25. package/dist/{chunk-BF5W6GVP.cjs → chunk-RMB62XEL.cjs} +10 -8
  26. package/dist/chunk-S6M44SSZ.cjs +60 -0
  27. package/dist/chunk-SFZRYJZ2.cjs +1 -0
  28. package/dist/chunk-T5272PC2.js +60 -0
  29. package/dist/chunk-TP5EOMRD.cjs +21 -0
  30. package/dist/chunk-VBINBV4Z.cjs +537 -0
  31. package/dist/chunk-VLP3P6HF.js +919 -0
  32. package/dist/{chunk-KVBDKVBU.cjs → chunk-VZBOWHCM.cjs} +9 -7
  33. package/dist/chunk-WRBUO7H6.cjs +23 -0
  34. package/dist/chunk-WYMD6YG2.cjs +582 -0
  35. package/dist/{chunk-437F3SFI.js → chunk-YNQ45EAM.js} +7 -4
  36. package/dist/clean.cjs +9 -0
  37. package/dist/clean.d.cts +1194 -0
  38. package/dist/clean.d.ts +1194 -0
  39. package/dist/clean.js +9 -0
  40. package/dist/config.cjs +14 -4
  41. package/dist/config.d.cts +8 -13
  42. package/dist/config.d.ts +8 -13
  43. package/dist/config.js +15 -5
  44. package/dist/esbuild.cjs +1185 -0
  45. package/dist/index.cjs +21 -12
  46. package/dist/index.d.cts +7 -5
  47. package/dist/index.d.ts +7 -5
  48. package/dist/index.js +22 -13
  49. package/dist/types.cjs +1 -2
  50. package/dist/types.d.cts +84 -1177
  51. package/dist/types.d.ts +84 -1177
  52. package/dist/types.js +1 -2
  53. package/package.json +1 -222
  54. package/dist/build.cjs.map +0 -1
  55. package/dist/build.js.map +0 -1
  56. package/dist/chunk-263L44RM.cjs +0 -112
  57. package/dist/chunk-263L44RM.cjs.map +0 -1
  58. package/dist/chunk-437F3SFI.js.map +0 -1
  59. package/dist/chunk-BF5W6GVP.cjs.map +0 -1
  60. package/dist/chunk-CMEDJ4L4.js +0 -352
  61. package/dist/chunk-CMEDJ4L4.js.map +0 -1
  62. package/dist/chunk-CMWXE5MF.js.map +0 -1
  63. package/dist/chunk-D5PRB2E2.cjs +0 -40
  64. package/dist/chunk-D5PRB2E2.cjs.map +0 -1
  65. package/dist/chunk-DFGHPRBD.cjs.map +0 -1
  66. package/dist/chunk-DRRPNILS.js +0 -40
  67. package/dist/chunk-DRRPNILS.js.map +0 -1
  68. package/dist/chunk-J34FQYKV.cjs.map +0 -1
  69. package/dist/chunk-KJ7ZHAFS.js.map +0 -1
  70. package/dist/chunk-KVBDKVBU.cjs.map +0 -1
  71. package/dist/chunk-MUYXFAKB.cjs +0 -1
  72. package/dist/chunk-MUYXFAKB.cjs.map +0 -1
  73. package/dist/chunk-MVLEDP7K.cjs +0 -21
  74. package/dist/chunk-MVLEDP7K.cjs.map +0 -1
  75. package/dist/chunk-PBHOTQGA.cjs +0 -352
  76. package/dist/chunk-PBHOTQGA.cjs.map +0 -1
  77. package/dist/chunk-QNDLJ2W7.js +0 -1
  78. package/dist/chunk-QNDLJ2W7.js.map +0 -1
  79. package/dist/chunk-TTHABTDU.js.map +0 -1
  80. package/dist/chunk-WCQVDF3K.js.map +0 -1
  81. package/dist/chunk-WGEGR3DF.cjs.map +0 -1
  82. package/dist/chunk-X5TLV7MF.js.map +0 -1
  83. package/dist/chunk-YQBU3FSL.js.map +0 -1
  84. package/dist/config.cjs.map +0 -1
  85. package/dist/config.js.map +0 -1
  86. package/dist/index.cjs.map +0 -1
  87. package/dist/index.js.map +0 -1
  88. package/dist/types.cjs.map +0 -1
  89. package/dist/types.js.map +0 -1
@@ -0,0 +1,919 @@
1
+ import {
2
+ nativeNodeModulesPlugin
3
+ } from "./chunk-T5272PC2.js";
4
+ import {
5
+ nodeProtocolPlugin
6
+ } from "./chunk-LYDEMC26.js";
7
+ import {
8
+ onErrorPlugin
9
+ } from "./chunk-KE5DL2BG.js";
10
+ import {
11
+ resolvePathsPlugin
12
+ } from "./chunk-DAGDNKO5.js";
13
+ import {
14
+ tscPlugin
15
+ } from "./chunk-KOK4WCHS.js";
16
+ import {
17
+ COLOR_KEYS,
18
+ LogLevel,
19
+ STORM_DEFAULT_DOCS,
20
+ STORM_DEFAULT_HOMEPAGE,
21
+ STORM_DEFAULT_LICENSING,
22
+ findWorkspaceRoot,
23
+ formatLogMessage,
24
+ getDefaultConfig,
25
+ getLogLevel,
26
+ getLogLevelLabel,
27
+ isVerbose,
28
+ writeDebug,
29
+ writeSystem,
30
+ writeTrace,
31
+ writeWarning
32
+ } from "./chunk-HQGUIF4U.js";
33
+ import {
34
+ correctPaths,
35
+ joinPaths
36
+ } from "./chunk-7MDMXJ5V.js";
37
+ import {
38
+ esmSplitCodeToCjsPlugin
39
+ } from "./chunk-YNQ45EAM.js";
40
+ import {
41
+ fixImportsPlugin
42
+ } from "./chunk-GWG4HOQ6.js";
43
+ import {
44
+ __name
45
+ } from "./chunk-3GQAWCBQ.js";
46
+
47
+ // ../build-tools/src/config.ts
48
+ var DEFAULT_COMPILED_BANNER = `
49
+ /**
50
+ * \u26A1 Built by Storm Software
51
+ */
52
+
53
+ `;
54
+ var DEFAULT_ENVIRONMENT = "production";
55
+ var DEFAULT_TARGET = "esnext";
56
+ var DEFAULT_ORGANIZATION = "storm-software";
57
+
58
+ // ../build-tools/src/plugins/swc.ts
59
+ import { transform } from "@swc/core";
60
+
61
+ // ../build-tools/src/plugins/ts-resolve.ts
62
+ import fs from "node:fs";
63
+ import { builtinModules } from "node:module";
64
+ import path from "node:path";
65
+ import _resolve from "resolve";
66
+
67
+ // ../build-tools/src/plugins/type-definitions.ts
68
+ import { stripIndents } from "@nx/devkit";
69
+ import { relative } from "path";
70
+
71
+ // ../build-tools/src/utilities/copy-assets.ts
72
+ import { hfs as hfs2 } from "@humanfs/node";
73
+ import { createProjectGraphAsync, readProjectsConfigurationFromProjectGraph } from "@nx/devkit";
74
+ import { copyAssets as copyAssetsBase } from "@nx/js";
75
+ import { glob } from "glob";
76
+
77
+ // ../build-tools/src/utilities/read-nx-config.ts
78
+ import { hfs } from "@humanfs/node";
79
+
80
+ // ../config-tools/src/config-file/get-config-file.ts
81
+ import { loadConfig } from "c12";
82
+ import defu from "defu";
83
+ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, options = {}) => {
84
+ const workspacePath = filePath || findWorkspaceRoot(filePath);
85
+ let config = loadConfig({
86
+ cwd: workspacePath,
87
+ packageJson: true,
88
+ name: fileName,
89
+ envName: fileName?.toUpperCase(),
90
+ jitiOptions: {
91
+ debug: false,
92
+ cache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache", "storm")
93
+ },
94
+ ...options
95
+ });
96
+ if (!config || Object.keys(config).length === 0) {
97
+ config = loadConfig({
98
+ cwd: workspacePath,
99
+ packageJson: true,
100
+ name: fileName,
101
+ envName: fileName?.toUpperCase(),
102
+ jitiOptions: {
103
+ debug: false,
104
+ cache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache", "storm")
105
+ },
106
+ configFile: fileName,
107
+ ...options
108
+ });
109
+ }
110
+ return config;
111
+ }, "getConfigFileByName");
112
+ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames = []) => {
113
+ const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
114
+ const result = await getConfigFileByName("storm", workspacePath);
115
+ let config = result.config;
116
+ const configFile = result.configFile;
117
+ if (config && configFile && Object.keys(config).length > 0) {
118
+ writeSystem(`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
119
+ logLevel: "all"
120
+ });
121
+ }
122
+ if (additionalFileNames && additionalFileNames.length > 0) {
123
+ const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
124
+ for (const result2 of results) {
125
+ if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
126
+ writeSystem(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
127
+ logLevel: "all"
128
+ });
129
+ config = defu(result2.config ?? {}, config ?? {});
130
+ }
131
+ }
132
+ }
133
+ if (!config) {
134
+ return void 0;
135
+ }
136
+ config.configFile = configFile;
137
+ return config;
138
+ }, "getConfigFile");
139
+
140
+ // ../config-tools/src/create-storm-config.ts
141
+ import defu2 from "defu";
142
+
143
+ // ../config-tools/src/env/get-env.ts
144
+ var getConfigEnv = /* @__PURE__ */ __name(() => {
145
+ const prefix = "STORM_";
146
+ let config = {
147
+ extends: process.env[`${prefix}EXTENDS`] || void 0,
148
+ name: process.env[`${prefix}NAME`] || void 0,
149
+ namespace: process.env[`${prefix}NAMESPACE`] || void 0,
150
+ owner: process.env[`${prefix}OWNER`] || void 0,
151
+ bot: {
152
+ name: process.env[`${prefix}BOT_NAME`] || void 0,
153
+ email: process.env[`${prefix}BOT_EMAIL`] || void 0
154
+ },
155
+ organization: process.env[`${prefix}ORGANIZATION`] || void 0,
156
+ packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
157
+ license: process.env[`${prefix}LICENSE`] || void 0,
158
+ homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
159
+ docs: process.env[`${prefix}DOCS`] || void 0,
160
+ licensing: process.env[`${prefix}LICENSING`] || void 0,
161
+ timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
162
+ locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
163
+ configFile: process.env[`${prefix}CONFIG_FILE`] ? correctPaths(process.env[`${prefix}CONFIG_FILE`]) : void 0,
164
+ workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
165
+ directories: {
166
+ cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths(process.env[`${prefix}CACHE_DIR`]) : void 0,
167
+ data: process.env[`${prefix}DATA_DIR`] ? correctPaths(process.env[`${prefix}DATA_DIR`]) : void 0,
168
+ config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths(process.env[`${prefix}CONFIG_DIR`]) : void 0,
169
+ temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths(process.env[`${prefix}TEMP_DIR`]) : void 0,
170
+ log: process.env[`${prefix}LOG_DIR`] ? correctPaths(process.env[`${prefix}LOG_DIR`]) : void 0,
171
+ build: process.env[`${prefix}BUILD_DIR`] ? correctPaths(process.env[`${prefix}BUILD_DIR`]) : void 0
172
+ },
173
+ skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
174
+ env: (process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
175
+ // ci:
176
+ // process.env[`${prefix}CI`] !== undefined
177
+ // ? Boolean(
178
+ // process.env[`${prefix}CI`] ??
179
+ // process.env.CI ??
180
+ // process.env.CONTINUOUS_INTEGRATION
181
+ // )
182
+ // : undefined,
183
+ repository: process.env[`${prefix}REPOSITORY`] || void 0,
184
+ branch: process.env[`${prefix}BRANCH`] || void 0,
185
+ preid: process.env[`${prefix}PRE_ID`] || void 0,
186
+ externalPackagePatterns: process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] ? JSON.parse(process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`]) : [],
187
+ registry: {
188
+ github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
189
+ npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
190
+ cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
191
+ cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
192
+ container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
193
+ },
194
+ logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
195
+ };
196
+ const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
197
+ config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
198
+ ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
199
+ return ret;
200
+ }, {}) : getThemeColorConfigEnv(prefix);
201
+ if (config.docs === STORM_DEFAULT_DOCS) {
202
+ if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
203
+ config.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
204
+ } else {
205
+ config.docs = `${config.homepage}/docs`;
206
+ }
207
+ }
208
+ if (config.licensing === STORM_DEFAULT_LICENSING) {
209
+ if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
210
+ config.licensing = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
211
+ } else {
212
+ config.licensing = `${config.homepage}/docs`;
213
+ }
214
+ }
215
+ const serializedConfig = process.env[`${prefix}CONFIG`];
216
+ if (serializedConfig) {
217
+ const parsed = JSON.parse(serializedConfig);
218
+ config = {
219
+ ...config,
220
+ ...parsed,
221
+ colors: {
222
+ ...config.colors,
223
+ ...parsed.colors
224
+ },
225
+ extensions: {
226
+ ...config.extensions,
227
+ ...parsed.extensions
228
+ }
229
+ };
230
+ }
231
+ return config;
232
+ }, "getConfigEnv");
233
+ var getThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, theme) => {
234
+ const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
235
+ return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
236
+ }, "getThemeColorConfigEnv");
237
+ var getSingleThemeColorConfigEnv = /* @__PURE__ */ __name((prefix) => {
238
+ return {
239
+ dark: process.env[`${prefix}DARK`],
240
+ light: process.env[`${prefix}LIGHT`],
241
+ brand: process.env[`${prefix}BRAND`],
242
+ alternate: process.env[`${prefix}ALTERNATE`],
243
+ accent: process.env[`${prefix}ACCENT`],
244
+ link: process.env[`${prefix}LINK`],
245
+ help: process.env[`${prefix}HELP`],
246
+ success: process.env[`${prefix}SUCCESS`],
247
+ info: process.env[`${prefix}INFO`],
248
+ warning: process.env[`${prefix}WARNING`],
249
+ danger: process.env[`${prefix}DANGER`],
250
+ fatal: process.env[`${prefix}FATAL`],
251
+ positive: process.env[`${prefix}POSITIVE`],
252
+ negative: process.env[`${prefix}NEGATIVE`]
253
+ };
254
+ }, "getSingleThemeColorConfigEnv");
255
+ var getMultiThemeColorConfigEnv = /* @__PURE__ */ __name((prefix) => {
256
+ return {
257
+ light: getBaseThemeColorConfigEnv(`${prefix}_LIGHT_`),
258
+ dark: getBaseThemeColorConfigEnv(`${prefix}_DARK_`)
259
+ };
260
+ }, "getMultiThemeColorConfigEnv");
261
+ var getBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix) => {
262
+ return {
263
+ foreground: process.env[`${prefix}FOREGROUND`],
264
+ background: process.env[`${prefix}BACKGROUND`],
265
+ brand: process.env[`${prefix}BRAND`],
266
+ alternate: process.env[`${prefix}ALTERNATE`],
267
+ accent: process.env[`${prefix}ACCENT`],
268
+ link: process.env[`${prefix}LINK`],
269
+ help: process.env[`${prefix}HELP`],
270
+ success: process.env[`${prefix}SUCCESS`],
271
+ info: process.env[`${prefix}INFO`],
272
+ warning: process.env[`${prefix}WARNING`],
273
+ danger: process.env[`${prefix}DANGER`],
274
+ fatal: process.env[`${prefix}FATAL`],
275
+ positive: process.env[`${prefix}POSITIVE`],
276
+ negative: process.env[`${prefix}NEGATIVE`]
277
+ };
278
+ }, "getBaseThemeColorConfigEnv");
279
+
280
+ // ../config-tools/src/env/set-env.ts
281
+ var setExtensionEnv = /* @__PURE__ */ __name((extensionName, extension) => {
282
+ for (const key of Object.keys(extension ?? {})) {
283
+ if (extension[key]) {
284
+ const result = key?.replace(/([A-Z])+/g, (input) => input ? input[0]?.toUpperCase() + input.slice(1) : "").split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
285
+ let extensionKey;
286
+ if (result.length === 0) {
287
+ return;
288
+ }
289
+ if (result.length === 1) {
290
+ extensionKey = result[0]?.toUpperCase() ?? "";
291
+ } else {
292
+ extensionKey = result.reduce((ret, part) => {
293
+ return `${ret}_${part.toLowerCase()}`;
294
+ });
295
+ }
296
+ process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
297
+ }
298
+ }
299
+ }, "setExtensionEnv");
300
+ var setConfigEnv = /* @__PURE__ */ __name((config) => {
301
+ const prefix = "STORM_";
302
+ if (config.extends) {
303
+ process.env[`${prefix}EXTENDS`] = config.extends;
304
+ }
305
+ if (config.name) {
306
+ process.env[`${prefix}NAME`] = config.name;
307
+ }
308
+ if (config.namespace) {
309
+ process.env[`${prefix}NAMESPACE`] = config.namespace;
310
+ }
311
+ if (config.owner) {
312
+ process.env[`${prefix}OWNER`] = config.owner;
313
+ }
314
+ if (config.bot) {
315
+ process.env[`${prefix}BOT_NAME`] = config.bot.name;
316
+ process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
317
+ }
318
+ if (config.organization) {
319
+ process.env[`${prefix}ORGANIZATION`] = config.organization;
320
+ }
321
+ if (config.packageManager) {
322
+ process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
323
+ }
324
+ if (config.license) {
325
+ process.env[`${prefix}LICENSE`] = config.license;
326
+ }
327
+ if (config.homepage) {
328
+ process.env[`${prefix}HOMEPAGE`] = config.homepage;
329
+ }
330
+ if (config.docs) {
331
+ process.env[`${prefix}DOCS`] = config.docs;
332
+ }
333
+ if (config.licensing) {
334
+ process.env[`${prefix}LICENSING`] = config.licensing;
335
+ }
336
+ if (config.timezone) {
337
+ process.env[`${prefix}TIMEZONE`] = config.timezone;
338
+ process.env.TZ = config.timezone;
339
+ process.env.DEFAULT_TIMEZONE = config.timezone;
340
+ }
341
+ if (config.locale) {
342
+ process.env[`${prefix}LOCALE`] = config.locale;
343
+ process.env.LOCALE = config.locale;
344
+ process.env.DEFAULT_LOCALE = config.locale;
345
+ process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
346
+ }
347
+ if (config.configFile) {
348
+ process.env[`${prefix}CONFIG_FILE`] = correctPaths(config.configFile);
349
+ }
350
+ if (config.workspaceRoot) {
351
+ process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config.workspaceRoot);
352
+ process.env.NX_WORKSPACE_ROOT = correctPaths(config.workspaceRoot);
353
+ process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
354
+ }
355
+ if (config.directories) {
356
+ if (!config.skipCache && config.directories.cache) {
357
+ process.env[`${prefix}CACHE_DIR`] = correctPaths(config.directories.cache);
358
+ }
359
+ if (config.directories.data) {
360
+ process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
361
+ }
362
+ if (config.directories.config) {
363
+ process.env[`${prefix}CONFIG_DIR`] = correctPaths(config.directories.config);
364
+ }
365
+ if (config.directories.temp) {
366
+ process.env[`${prefix}TEMP_DIR`] = correctPaths(config.directories.temp);
367
+ }
368
+ if (config.directories.log) {
369
+ process.env[`${prefix}LOG_DIR`] = correctPaths(config.directories.log);
370
+ }
371
+ if (config.directories.build) {
372
+ process.env[`${prefix}BUILD_DIR`] = correctPaths(config.directories.build);
373
+ }
374
+ }
375
+ if (config.skipCache !== void 0) {
376
+ process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
377
+ if (config.skipCache) {
378
+ process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
379
+ process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
380
+ }
381
+ }
382
+ if (config.env) {
383
+ process.env[`${prefix}ENV`] = config.env;
384
+ process.env.NODE_ENV = config.env;
385
+ process.env.ENVIRONMENT = config.env;
386
+ }
387
+ if (config.colors?.base?.light || config.colors?.base?.dark) {
388
+ for (const key of Object.keys(config.colors)) {
389
+ setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
390
+ }
391
+ } else {
392
+ setThemeColorConfigEnv(`${prefix}COLOR_`, config.colors);
393
+ }
394
+ if (config.repository) {
395
+ process.env[`${prefix}REPOSITORY`] = config.repository;
396
+ }
397
+ if (config.branch) {
398
+ process.env[`${prefix}BRANCH`] = config.branch;
399
+ }
400
+ if (config.preid) {
401
+ process.env[`${prefix}PRE_ID`] = String(config.preid);
402
+ }
403
+ if (config.externalPackagePatterns) {
404
+ process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] = JSON.stringify(config.externalPackagePatterns);
405
+ }
406
+ if (config.registry) {
407
+ if (config.registry.github) {
408
+ process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
409
+ }
410
+ if (config.registry.npm) {
411
+ process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
412
+ }
413
+ if (config.registry.cargo) {
414
+ process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
415
+ }
416
+ if (config.registry.cyclone) {
417
+ process.env[`${prefix}REGISTRY_CYCLONE`] = String(config.registry.cyclone);
418
+ }
419
+ if (config.registry.container) {
420
+ process.env[`${prefix}REGISTRY_CONTAINER`] = String(config.registry.cyclone);
421
+ }
422
+ }
423
+ if (config.logLevel) {
424
+ process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
425
+ process.env.LOG_LEVEL = String(config.logLevel);
426
+ process.env.NX_VERBOSE_LOGGING = String(getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false);
427
+ process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
428
+ }
429
+ process.env[`${prefix}CONFIG`] = JSON.stringify(config);
430
+ for (const key of Object.keys(config.extensions ?? {})) {
431
+ config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
432
+ }
433
+ }, "setConfigEnv");
434
+ var setThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
435
+ return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
436
+ }, "setThemeColorConfigEnv");
437
+ var setSingleThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
438
+ if (config.dark) {
439
+ process.env[`${prefix}DARK`] = config.dark;
440
+ }
441
+ if (config.light) {
442
+ process.env[`${prefix}LIGHT`] = config.light;
443
+ }
444
+ if (config.brand) {
445
+ process.env[`${prefix}BRAND`] = config.brand;
446
+ }
447
+ if (config.alternate) {
448
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
449
+ }
450
+ if (config.accent) {
451
+ process.env[`${prefix}ACCENT`] = config.accent;
452
+ }
453
+ if (config.link) {
454
+ process.env[`${prefix}LINK`] = config.link;
455
+ }
456
+ if (config.help) {
457
+ process.env[`${prefix}HELP`] = config.help;
458
+ }
459
+ if (config.success) {
460
+ process.env[`${prefix}SUCCESS`] = config.success;
461
+ }
462
+ if (config.info) {
463
+ process.env[`${prefix}INFO`] = config.info;
464
+ }
465
+ if (config.warning) {
466
+ process.env[`${prefix}WARNING`] = config.warning;
467
+ }
468
+ if (config.danger) {
469
+ process.env[`${prefix}DANGER`] = config.danger;
470
+ }
471
+ if (config.fatal) {
472
+ process.env[`${prefix}FATAL`] = config.fatal;
473
+ }
474
+ if (config.positive) {
475
+ process.env[`${prefix}POSITIVE`] = config.positive;
476
+ }
477
+ if (config.negative) {
478
+ process.env[`${prefix}NEGATIVE`] = config.negative;
479
+ }
480
+ }, "setSingleThemeColorConfigEnv");
481
+ var setMultiThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
482
+ return {
483
+ light: setBaseThemeColorConfigEnv(`${prefix}LIGHT_`, config.light),
484
+ dark: setBaseThemeColorConfigEnv(`${prefix}DARK_`, config.dark)
485
+ };
486
+ }, "setMultiThemeColorConfigEnv");
487
+ var setBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
488
+ if (config.foreground) {
489
+ process.env[`${prefix}FOREGROUND`] = config.foreground;
490
+ }
491
+ if (config.background) {
492
+ process.env[`${prefix}BACKGROUND`] = config.background;
493
+ }
494
+ if (config.brand) {
495
+ process.env[`${prefix}BRAND`] = config.brand;
496
+ }
497
+ if (config.alternate) {
498
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
499
+ }
500
+ if (config.accent) {
501
+ process.env[`${prefix}ACCENT`] = config.accent;
502
+ }
503
+ if (config.link) {
504
+ process.env[`${prefix}LINK`] = config.link;
505
+ }
506
+ if (config.help) {
507
+ process.env[`${prefix}HELP`] = config.help;
508
+ }
509
+ if (config.success) {
510
+ process.env[`${prefix}SUCCESS`] = config.success;
511
+ }
512
+ if (config.info) {
513
+ process.env[`${prefix}INFO`] = config.info;
514
+ }
515
+ if (config.warning) {
516
+ process.env[`${prefix}WARNING`] = config.warning;
517
+ }
518
+ if (config.danger) {
519
+ process.env[`${prefix}DANGER`] = config.danger;
520
+ }
521
+ if (config.fatal) {
522
+ process.env[`${prefix}FATAL`] = config.fatal;
523
+ }
524
+ if (config.positive) {
525
+ process.env[`${prefix}POSITIVE`] = config.positive;
526
+ }
527
+ if (config.negative) {
528
+ process.env[`${prefix}NEGATIVE`] = config.negative;
529
+ }
530
+ }, "setBaseThemeColorConfigEnv");
531
+
532
+ // ../config-tools/src/create-storm-config.ts
533
+ var _static_cache = void 0;
534
+ var loadStormConfig = /* @__PURE__ */ __name(async (workspaceRoot) => {
535
+ let config = {};
536
+ if (_static_cache?.data && _static_cache?.timestamp && _static_cache.timestamp >= Date.now() + 3e4) {
537
+ writeTrace(`Configuration cache hit - ${_static_cache.timestamp}`, _static_cache.data);
538
+ return _static_cache.data;
539
+ }
540
+ let _workspaceRoot = workspaceRoot;
541
+ if (!_workspaceRoot) {
542
+ _workspaceRoot = findWorkspaceRoot();
543
+ }
544
+ const configFile = await getConfigFile(_workspaceRoot);
545
+ if (!configFile) {
546
+ writeWarning("No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n", {
547
+ logLevel: "all"
548
+ });
549
+ }
550
+ config = defu2(getConfigEnv(), configFile, getDefaultConfig(_workspaceRoot));
551
+ setConfigEnv(config);
552
+ writeTrace(`\u2699\uFE0F Using Storm configuration:
553
+ ${formatLogMessage(config)}`, config);
554
+ return config;
555
+ }, "loadStormConfig");
556
+
557
+ // ../build-tools/src/utilities/read-nx-config.ts
558
+ var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot) => {
559
+ let rootDir = workspaceRoot;
560
+ if (!rootDir) {
561
+ const config = await loadStormConfig();
562
+ rootDir = config.workspaceRoot;
563
+ }
564
+ const nxJsonPath = joinPaths(rootDir, "nx.json");
565
+ if (!await hfs.isFile(nxJsonPath)) {
566
+ throw new Error("Cannot find project.json configuration");
567
+ }
568
+ return hfs.json(nxJsonPath);
569
+ }, "readNxConfig");
570
+
571
+ // ../build-tools/src/utilities/copy-assets.ts
572
+ var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, projectRoot, projectName, sourceRoot, generatePackageJson = true, includeSrc = false, banner, footer) => {
573
+ const pendingAssets = Array.from(assets ?? []);
574
+ if (!pendingAssets?.some((asset) => asset?.glob === "*.md")) {
575
+ pendingAssets.push({
576
+ input: projectRoot,
577
+ glob: "*.md",
578
+ output: "/"
579
+ });
580
+ }
581
+ if (generatePackageJson === false) {
582
+ pendingAssets.push({
583
+ input: sourceRoot,
584
+ glob: "package.json",
585
+ output: "."
586
+ });
587
+ }
588
+ if (!pendingAssets?.some((asset) => asset?.glob === "LICENSE")) {
589
+ pendingAssets.push({
590
+ input: "",
591
+ glob: "LICENSE",
592
+ output: "."
593
+ });
594
+ }
595
+ if (includeSrc === true) {
596
+ pendingAssets.push({
597
+ input: sourceRoot,
598
+ glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
599
+ output: "src/"
600
+ });
601
+ }
602
+ const nxJson = readNxConfig(config.workspaceRoot);
603
+ const projectGraph = await createProjectGraphAsync({
604
+ exitOnError: true
605
+ });
606
+ const projectsConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
607
+ if (!projectsConfigurations?.projects?.[projectName]) {
608
+ 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.");
609
+ }
610
+ const buildTarget = projectsConfigurations.projects[projectName]?.targets?.build;
611
+ if (!buildTarget) {
612
+ throw new Error(`The Build process failed because the project does not have a valid build target in the project.json file. Check if the file exists in the root of the project at ${joinPaths(projectRoot, "project.json")}`);
613
+ }
614
+ const result = await copyAssetsBase({
615
+ assets,
616
+ watch: false,
617
+ outputPath
618
+ }, {
619
+ root: config.workspaceRoot,
620
+ targetName: "build",
621
+ target: buildTarget,
622
+ projectName,
623
+ projectGraph,
624
+ projectsConfigurations,
625
+ nxJsonConfiguration: nxJson,
626
+ cwd: config.workspaceRoot,
627
+ isVerbose: isVerbose(config.logLevel)
628
+ });
629
+ if (!result.success) {
630
+ throw new Error("The Build process failed trying to copy assets");
631
+ }
632
+ if (includeSrc === true) {
633
+ writeDebug(`\u{1F4DD} Adding banner and writing source files: ${joinPaths(outputPath, "src")}`, config);
634
+ const files = await glob([
635
+ joinPaths(config.workspaceRoot, outputPath, "src/**/*.ts"),
636
+ joinPaths(config.workspaceRoot, outputPath, "src/**/*.tsx"),
637
+ joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
638
+ joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
639
+ ]);
640
+ await Promise.allSettled(files.map(async (file) => hfs2.write(file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
641
+
642
+ ${await hfs2.text(file)}
643
+
644
+ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
645
+ }
646
+ }, "copyAssets");
647
+
648
+ // ../build-tools/src/utilities/generate-package-json.ts
649
+ import { hfs as hfs3 } from "@humanfs/node";
650
+ import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
651
+ import { Glob } from "glob";
652
+ import { createProjectGraphAsync as createProjectGraphAsync2, readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph2 } from "nx/src/project-graph/project-graph";
653
+ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
654
+ const projectGraph = await createProjectGraphAsync2({
655
+ exitOnError: true
656
+ });
657
+ const projectConfigurations = readProjectsConfigurationFromProjectGraph2(projectGraph);
658
+ if (!projectConfigurations?.projects?.[projectName]) {
659
+ 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.");
660
+ }
661
+ const projectJsonPath = joinPaths(workspaceRoot, projectRoot, "project.json");
662
+ if (!await hfs3.isFile(projectJsonPath)) {
663
+ throw new Error("Cannot find project.json configuration");
664
+ }
665
+ if (!projectConfigurations?.projects?.[projectName]) {
666
+ 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.");
667
+ }
668
+ const projectDependencies = calculateProjectBuildableDependencies(void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
669
+ const localPackages = [];
670
+ for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
671
+ const projectNode = project.node;
672
+ if (projectNode.data.root) {
673
+ const projectPackageJsonPath = joinPaths(workspaceRoot, projectNode.data.root, "package.json");
674
+ if (await hfs3.isFile(projectPackageJsonPath)) {
675
+ const projectPackageJson = await hfs3.json(projectPackageJsonPath);
676
+ if (projectPackageJson.private !== false) {
677
+ localPackages.push(projectPackageJson);
678
+ }
679
+ }
680
+ }
681
+ }
682
+ if (localPackages.length > 0) {
683
+ writeTrace(`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
684
+ packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
685
+ if (!ret[localPackage.name]) {
686
+ ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
687
+ }
688
+ return ret;
689
+ }, packageJson.peerDependencies ?? {});
690
+ packageJson.peerDependenciesMeta = localPackages.reduce((ret, localPackage) => {
691
+ if (!ret[localPackage.name]) {
692
+ ret[localPackage.name] = {
693
+ optional: false
694
+ };
695
+ }
696
+ return ret;
697
+ }, packageJson.peerDependenciesMeta ?? {});
698
+ packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
699
+ if (!ret[localPackage.name]) {
700
+ ret[localPackage.name] = localPackage.version || "0.0.1";
701
+ }
702
+ return ret;
703
+ }, packageJson.peerDependencies ?? {});
704
+ } else {
705
+ writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
706
+ }
707
+ return packageJson;
708
+ }, "addPackageDependencies");
709
+ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
710
+ const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : findWorkspaceRoot();
711
+ const workspacePackageJson = await hfs3.json(joinPaths(workspaceRoot, "package.json"));
712
+ packageJson.type ??= "module";
713
+ packageJson.sideEffects ??= false;
714
+ if (includeSrc === true) {
715
+ let distSrc = sourceRoot.replace(projectRoot, "");
716
+ if (distSrc.startsWith("/")) {
717
+ distSrc = distSrc.substring(1);
718
+ }
719
+ packageJson.source ??= `${joinPaths(distSrc, "index.ts").replaceAll("\\", "/")}`;
720
+ }
721
+ packageJson.files ??= [
722
+ "dist/**/*"
723
+ ];
724
+ if (includeSrc === true && !packageJson.files.includes("src")) {
725
+ packageJson.files.push("src/**/*");
726
+ }
727
+ packageJson.publishConfig ??= {
728
+ access: "public"
729
+ };
730
+ packageJson.description ??= workspacePackageJson.description;
731
+ packageJson.homepage ??= workspacePackageJson.homepage;
732
+ packageJson.bugs ??= workspacePackageJson.bugs;
733
+ packageJson.license ??= workspacePackageJson.license;
734
+ packageJson.keywords ??= workspacePackageJson.keywords;
735
+ packageJson.funding ??= workspacePackageJson.funding;
736
+ packageJson.author ??= workspacePackageJson.author;
737
+ packageJson.maintainers ??= workspacePackageJson.maintainers;
738
+ if (!packageJson.maintainers && packageJson.author) {
739
+ packageJson.maintainers = [
740
+ packageJson.author
741
+ ];
742
+ }
743
+ packageJson.contributors ??= workspacePackageJson.contributors;
744
+ if (!packageJson.contributors && packageJson.author) {
745
+ packageJson.contributors = [
746
+ packageJson.author
747
+ ];
748
+ }
749
+ packageJson.repository ??= workspacePackageJson.repository;
750
+ packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
751
+ return packageJson;
752
+ }, "addWorkspacePackageJsonFields");
753
+ var addPackageJsonExport = /* @__PURE__ */ __name((file, type = "module", sourceRoot) => {
754
+ let entry = file.replaceAll("\\", "/");
755
+ if (sourceRoot) {
756
+ entry = entry.replace(sourceRoot, "");
757
+ }
758
+ return {
759
+ "import": {
760
+ "types": `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
761
+ "default": `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
762
+ },
763
+ "require": {
764
+ "types": `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
765
+ "default": `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
766
+ },
767
+ "default": {
768
+ "types": `./dist/${entry}.d.ts`,
769
+ "default": `./dist/${entry}.js`
770
+ }
771
+ };
772
+ }, "addPackageJsonExport");
773
+
774
+ // ../build-tools/src/utilities/get-entry-points.ts
775
+ import { glob as glob2 } from "glob";
776
+ var getEntryPoints = /* @__PURE__ */ __name(async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
777
+ const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : findWorkspaceRoot();
778
+ const entryPoints = [];
779
+ if (entry) {
780
+ if (Array.isArray(entry)) {
781
+ entryPoints.push(...entry);
782
+ } else if (typeof entry === "string") {
783
+ entryPoints.push(entry);
784
+ } else {
785
+ entryPoints.push(...Object.values(entry));
786
+ }
787
+ }
788
+ if (emitOnAll) {
789
+ entryPoints.push(joinPaths(workspaceRoot, sourceRoot || projectRoot, "**/*.{ts,tsx}"));
790
+ }
791
+ const results = [];
792
+ for (const entryPoint in entryPoints) {
793
+ if (entryPoint.includes("*")) {
794
+ const files = await glob2(entryPoint, {
795
+ withFileTypes: true
796
+ });
797
+ results.push(...files.reduce((ret, filePath) => {
798
+ const result = correctPaths(joinPaths(filePath.path, filePath.name).replaceAll(correctPaths(workspaceRoot), "").replaceAll(correctPaths(projectRoot), ""));
799
+ if (result) {
800
+ writeDebug(`Trying to add entry point ${result} at "${joinPaths(filePath.path, filePath.name)}"`, config);
801
+ if (!results.includes(result)) {
802
+ results.push(result);
803
+ }
804
+ }
805
+ return ret;
806
+ }, []));
807
+ } else {
808
+ results.push(entryPoint);
809
+ }
810
+ }
811
+ return results;
812
+ }, "getEntryPoints");
813
+
814
+ // ../build-tools/src/utilities/get-env.ts
815
+ var getEnv = /* @__PURE__ */ __name((builder, options) => {
816
+ return {
817
+ STORM_BUILD: builder,
818
+ STORM_ORGANIZATION: options.organization || DEFAULT_ORGANIZATION,
819
+ STORM_NAME: options.name,
820
+ STORM_ENV: options.environment || DEFAULT_ENVIRONMENT,
821
+ STORM_PLATFORM: options.platform,
822
+ STORM_FORMAT: JSON.stringify(options.format),
823
+ STORM_TARGET: JSON.stringify(options.target),
824
+ ...options.env
825
+ };
826
+ }, "getEnv");
827
+
828
+ // ../build-tools/src/utilities/get-out-extension.ts
829
+ function getOutExtension(format, pkgType) {
830
+ let jsExtension = ".js";
831
+ let dtsExtension = ".d.ts";
832
+ if (pkgType === "module" && format === "cjs") {
833
+ jsExtension = ".cjs";
834
+ dtsExtension = ".d.cts";
835
+ }
836
+ if (pkgType !== "module" && format === "esm") {
837
+ jsExtension = ".mjs";
838
+ dtsExtension = ".d.mts";
839
+ }
840
+ if (format === "iife") {
841
+ jsExtension = ".global.js";
842
+ }
843
+ return {
844
+ js: jsExtension,
845
+ dts: dtsExtension
846
+ };
847
+ }
848
+ __name(getOutExtension, "getOutExtension");
849
+
850
+ // ../build-tools/src/utilities/task-graph.ts
851
+ import { createTaskGraph, mapTargetDefaultsToDependencies } from "nx/src/tasks-runner/create-task-graph";
852
+
853
+ // src/config.ts
854
+ var getOutputExtensionMap = /* @__PURE__ */ __name((options, pkgType) => {
855
+ return options.outExtension ? options.outExtension(options.format, pkgType) : getOutExtension(options.format, pkgType);
856
+ }, "getOutputExtensionMap");
857
+ var getDefaultBuildPlugins = /* @__PURE__ */ __name((options, resolvedOptions) => [
858
+ nodeProtocolPlugin(options, resolvedOptions),
859
+ resolvePathsPlugin(options, resolvedOptions),
860
+ fixImportsPlugin(options, resolvedOptions),
861
+ nativeNodeModulesPlugin(options, resolvedOptions),
862
+ esmSplitCodeToCjsPlugin(options, resolvedOptions),
863
+ tscPlugin(options, resolvedOptions),
864
+ onErrorPlugin(options, resolvedOptions)
865
+ ], "getDefaultBuildPlugins");
866
+ var DEFAULT_BUILD_OPTIONS = {
867
+ platform: "node",
868
+ target: "node22",
869
+ format: "cjs",
870
+ external: [],
871
+ logLevel: "error",
872
+ tsconfig: "tsconfig.json",
873
+ environment: "production",
874
+ keepNames: true,
875
+ metafile: true,
876
+ injectShims: true,
877
+ color: true,
878
+ watch: false,
879
+ bundle: true,
880
+ clean: true,
881
+ debug: false,
882
+ loader: {
883
+ ".aac": "file",
884
+ ".css": "file",
885
+ ".eot": "file",
886
+ ".flac": "file",
887
+ ".gif": "file",
888
+ ".jpeg": "file",
889
+ ".jpg": "file",
890
+ ".mp3": "file",
891
+ ".mp4": "file",
892
+ ".ogg": "file",
893
+ ".otf": "file",
894
+ ".png": "file",
895
+ ".svg": "file",
896
+ ".ttf": "file",
897
+ ".wav": "file",
898
+ ".webm": "file",
899
+ ".webp": "file",
900
+ ".woff": "file",
901
+ ".woff2": "file"
902
+ },
903
+ banner: DEFAULT_COMPILED_BANNER
904
+ };
905
+
906
+ export {
907
+ DEFAULT_COMPILED_BANNER,
908
+ DEFAULT_TARGET,
909
+ loadStormConfig,
910
+ copyAssets,
911
+ addPackageDependencies,
912
+ addWorkspacePackageJsonFields,
913
+ addPackageJsonExport,
914
+ getEntryPoints,
915
+ getEnv,
916
+ getOutputExtensionMap,
917
+ getDefaultBuildPlugins,
918
+ DEFAULT_BUILD_OPTIONS
919
+ };