@storm-software/esbuild 0.35.11 → 0.35.13
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.
- package/README.md +1 -2
- package/bin/esbuild.cjs +1225 -2788
- package/dist/assets.cjs +6 -6
- package/dist/assets.js +5 -5
- package/dist/build.cjs +13 -14
- package/dist/build.js +12 -13
- package/dist/{chunk-C5UZWWWR.js → chunk-2LYIFO7K.js} +3 -9
- package/dist/{chunk-KXCV2R7J.cjs → chunk-55UPQQ65.cjs} +288 -179
- package/dist/{chunk-INQXL7FE.js → chunk-72UBXZRO.js} +4 -6
- package/dist/{chunk-RMRB7CWQ.js → chunk-7KIT5JE6.js} +36 -30
- package/dist/{chunk-OHH3RWRK.cjs → chunk-B3MHVZOK.cjs} +10 -12
- package/dist/{chunk-NNO5TTNR.cjs → chunk-BK5GLVSJ.cjs} +47 -21
- package/dist/{chunk-J3XDBU5Z.cjs → chunk-BWMW4ZUS.cjs} +46 -40
- package/dist/{chunk-VITVYHJG.cjs → chunk-C25ALB4J.cjs} +975 -1209
- package/dist/chunk-CEJM5IFH.js +37 -0
- package/dist/{chunk-ICKIIBXC.js → chunk-FHHEEOIV.js} +2 -2
- package/dist/{chunk-PHC57UZZ.cjs → chunk-H7NSISN4.cjs} +33 -24
- package/dist/{chunk-QAYURSX7.cjs → chunk-IULOZ7MO.cjs} +5 -5
- package/dist/{chunk-QTR5272S.cjs → chunk-JCICRU7K.cjs} +3 -5
- package/dist/{chunk-OZEWXLIK.js → chunk-KV6GNLVF.js} +8 -10
- package/dist/{chunk-TULJZS5M.js → chunk-KXZCIMKJ.js} +149 -265
- package/dist/{chunk-T4UMKHLQ.cjs → chunk-LBRDOW2V.cjs} +18 -9
- package/dist/{chunk-5P6GWVMJ.js → chunk-NACKZM5D.js} +189 -116
- package/dist/chunk-NLIYZM5H.cjs +25 -0
- package/dist/{chunk-WHHAD2OY.js → chunk-Q3WZPCLD.js} +232 -123
- package/dist/{chunk-7ESNPD46.js → chunk-QOTJTLX7.js} +1 -1
- package/dist/{chunk-J5J57SEI.cjs → chunk-RBXXACL5.cjs} +204 -131
- package/dist/{chunk-KYRZY7X7.js → chunk-RNXNYWO3.js} +28 -19
- package/dist/{chunk-H35FAHLW.cjs → chunk-T4N45NGL.cjs} +17 -26
- package/dist/{chunk-66VO6PT4.js → chunk-VLK67MTI.js} +43 -17
- package/dist/{chunk-SR4MG2LN.js → chunk-VNLMOUVN.js} +15 -24
- package/dist/chunk-XHTD4QDZ.cjs +6 -0
- package/dist/clean.cjs +5 -5
- package/dist/clean.js +4 -4
- package/dist/config.cjs +6 -6
- package/dist/config.js +5 -5
- package/dist/context.cjs +7 -8
- package/dist/context.js +6 -7
- package/dist/index.cjs +15 -16
- package/dist/index.js +13 -14
- package/dist/package-json.cjs +6 -6
- package/dist/package-json.js +5 -5
- package/dist/plugins/deps-check.cjs +5 -5
- package/dist/plugins/deps-check.js +4 -4
- package/dist/plugins/resolve-paths.cjs +82 -5
- package/dist/plugins/resolve-paths.js +81 -4
- package/dist/tsup.cjs +5 -5
- package/dist/tsup.js +4 -4
- package/dist/types.cjs +2 -2
- package/dist/types.js +2 -2
- package/dist/watch.cjs +19 -29
- package/dist/watch.js +15 -25
- package/package.json +4 -4
- package/dist/chunk-AF5YHP7E.cjs +0 -57
- package/dist/chunk-BWCGRWHA.cjs +0 -6
- package/dist/chunk-ELF4S3RR.cjs +0 -31
- package/dist/chunk-IL6FCY37.js +0 -57
- package/dist/chunk-LQIX6FZY.js +0 -28
|
@@ -13,15 +13,14 @@ import {
|
|
|
13
13
|
writeDebug,
|
|
14
14
|
writeTrace,
|
|
15
15
|
writeWarning
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NACKZM5D.js";
|
|
17
17
|
import {
|
|
18
18
|
correctPaths,
|
|
19
19
|
joinPaths
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-KV6GNLVF.js";
|
|
21
21
|
import {
|
|
22
|
-
__name,
|
|
23
22
|
init_esm_shims
|
|
24
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-72UBXZRO.js";
|
|
25
24
|
|
|
26
25
|
// ../build-tools/src/config.ts
|
|
27
26
|
init_esm_shims();
|
|
@@ -39,7 +38,7 @@ init_esm_shims();
|
|
|
39
38
|
import { CopyAssetsHandler } from "@nx/js/src/utils/assets/copy-assets-handler";
|
|
40
39
|
import { glob } from "glob";
|
|
41
40
|
import { readFile, writeFile } from "node:fs/promises";
|
|
42
|
-
var copyAssets =
|
|
41
|
+
var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson = true, includeSrc = false, banner, footer) => {
|
|
43
42
|
const pendingAssets = Array.from(assets ?? []);
|
|
44
43
|
pendingAssets.push({
|
|
45
44
|
input: projectRoot,
|
|
@@ -65,8 +64,11 @@ var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, proje
|
|
|
65
64
|
output: "src/"
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
|
-
writeTrace(
|
|
69
|
-
|
|
67
|
+
writeTrace(
|
|
68
|
+
`\u{1F4DD} Copying the following assets to the output directory:
|
|
69
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${joinPaths(outputPath, pendingAsset.output)}`).join("\n")}`,
|
|
70
|
+
config
|
|
71
|
+
);
|
|
70
72
|
const assetHandler = new CopyAssetsHandler({
|
|
71
73
|
projectDir: projectRoot,
|
|
72
74
|
rootDir: config.workspaceRoot,
|
|
@@ -75,20 +77,33 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
|
|
|
75
77
|
});
|
|
76
78
|
await assetHandler.processAllAssetsOnce();
|
|
77
79
|
if (includeSrc === true) {
|
|
78
|
-
writeDebug(
|
|
80
|
+
writeDebug(
|
|
81
|
+
`\u{1F4DD} Adding banner and writing source files: ${joinPaths(
|
|
82
|
+
outputPath,
|
|
83
|
+
"src"
|
|
84
|
+
)}`,
|
|
85
|
+
config
|
|
86
|
+
);
|
|
79
87
|
const files = await glob([
|
|
80
88
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
81
89
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
82
90
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
83
91
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
84
92
|
]);
|
|
85
|
-
await Promise.allSettled(
|
|
93
|
+
await Promise.allSettled(
|
|
94
|
+
files.map(
|
|
95
|
+
async (file) => writeFile(
|
|
96
|
+
file,
|
|
97
|
+
`${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
86
98
|
|
|
87
99
|
${await readFile(file, "utf8")}
|
|
88
100
|
|
|
89
|
-
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
|
|
101
|
+
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
|
|
102
|
+
)
|
|
103
|
+
)
|
|
104
|
+
);
|
|
90
105
|
}
|
|
91
|
-
}
|
|
106
|
+
};
|
|
92
107
|
|
|
93
108
|
// ../build-tools/src/utilities/generate-package-json.ts
|
|
94
109
|
init_esm_shims();
|
|
@@ -96,8 +111,12 @@ import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildabl
|
|
|
96
111
|
import { Glob } from "glob";
|
|
97
112
|
import { existsSync, readFileSync } from "node:fs";
|
|
98
113
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
99
|
-
import {
|
|
100
|
-
|
|
114
|
+
import {
|
|
115
|
+
createProjectGraphAsync,
|
|
116
|
+
readCachedProjectGraph,
|
|
117
|
+
readProjectsConfigurationFromProjectGraph
|
|
118
|
+
} from "nx/src/project-graph/project-graph";
|
|
119
|
+
var addPackageDependencies = async (workspaceRoot, projectRoot, projectName, packageJson) => {
|
|
101
120
|
let projectGraph;
|
|
102
121
|
try {
|
|
103
122
|
projectGraph = readCachedProjectGraph();
|
|
@@ -106,16 +125,35 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
|
|
|
106
125
|
projectGraph = readCachedProjectGraph();
|
|
107
126
|
}
|
|
108
127
|
if (!projectGraph) {
|
|
109
|
-
throw new Error(
|
|
110
|
-
|
|
111
|
-
|
|
128
|
+
throw new Error(
|
|
129
|
+
"The Build process failed because the project graph is not available. Please run the build command again."
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
const projectDependencies = calculateProjectBuildableDependencies(
|
|
133
|
+
void 0,
|
|
134
|
+
projectGraph,
|
|
135
|
+
workspaceRoot,
|
|
136
|
+
projectName,
|
|
137
|
+
process.env.NX_TASK_TARGET_TARGET || "build",
|
|
138
|
+
process.env.NX_TASK_TARGET_CONFIGURATION || "production",
|
|
139
|
+
true
|
|
140
|
+
);
|
|
112
141
|
const localPackages = [];
|
|
113
|
-
for (const project of projectDependencies.dependencies.filter(
|
|
142
|
+
for (const project of projectDependencies.dependencies.filter(
|
|
143
|
+
(dep) => dep.node.type === "lib" && dep.node.data?.root !== projectRoot && dep.node.data?.root !== workspaceRoot
|
|
144
|
+
)) {
|
|
114
145
|
const projectNode = project.node;
|
|
115
146
|
if (projectNode.data.root) {
|
|
116
|
-
const projectPackageJsonPath = joinPaths(
|
|
147
|
+
const projectPackageJsonPath = joinPaths(
|
|
148
|
+
workspaceRoot,
|
|
149
|
+
projectNode.data.root,
|
|
150
|
+
"package.json"
|
|
151
|
+
);
|
|
117
152
|
if (existsSync(projectPackageJsonPath)) {
|
|
118
|
-
const projectPackageJsonContent = await readFile2(
|
|
153
|
+
const projectPackageJsonContent = await readFile2(
|
|
154
|
+
projectPackageJsonPath,
|
|
155
|
+
"utf8"
|
|
156
|
+
);
|
|
119
157
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
120
158
|
if (projectPackageJson.private !== true) {
|
|
121
159
|
localPackages.push(projectPackageJson);
|
|
@@ -124,19 +162,33 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
|
|
|
124
162
|
}
|
|
125
163
|
}
|
|
126
164
|
if (localPackages.length > 0) {
|
|
127
|
-
writeTrace(
|
|
128
|
-
|
|
165
|
+
writeTrace(
|
|
166
|
+
`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`
|
|
167
|
+
);
|
|
168
|
+
const projectJsonFile = await readFile2(
|
|
169
|
+
joinPaths(projectRoot, "project.json"),
|
|
170
|
+
"utf8"
|
|
171
|
+
);
|
|
129
172
|
const projectJson = JSON.parse(projectJsonFile);
|
|
130
173
|
const projectName2 = projectJson.name;
|
|
131
174
|
const projectConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
|
|
132
175
|
if (!projectConfigurations?.projects?.[projectName2]) {
|
|
133
|
-
throw new Error(
|
|
176
|
+
throw new Error(
|
|
177
|
+
"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."
|
|
178
|
+
);
|
|
134
179
|
}
|
|
135
180
|
const implicitDependencies = projectConfigurations.projects?.[projectName2].implicitDependencies?.reduce((ret, dep) => {
|
|
136
181
|
if (projectConfigurations.projects?.[dep]) {
|
|
137
|
-
const depPackageJsonPath = joinPaths(
|
|
182
|
+
const depPackageJsonPath = joinPaths(
|
|
183
|
+
workspaceRoot,
|
|
184
|
+
projectConfigurations.projects[dep].root,
|
|
185
|
+
"package.json"
|
|
186
|
+
);
|
|
138
187
|
if (existsSync(depPackageJsonPath)) {
|
|
139
|
-
const depPackageJsonContent = readFileSync(
|
|
188
|
+
const depPackageJsonContent = readFileSync(
|
|
189
|
+
depPackageJsonPath,
|
|
190
|
+
"utf8"
|
|
191
|
+
);
|
|
140
192
|
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
141
193
|
if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
|
|
142
194
|
ret.push(depPackageJson.name);
|
|
@@ -161,10 +213,13 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
|
|
|
161
213
|
writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
|
|
162
214
|
}
|
|
163
215
|
return packageJson;
|
|
164
|
-
}
|
|
165
|
-
var addWorkspacePackageJsonFields =
|
|
216
|
+
};
|
|
217
|
+
var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
166
218
|
const workspaceRoot = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : findWorkspaceRoot();
|
|
167
|
-
const workspacePackageJsonContent = await readFile2(
|
|
219
|
+
const workspacePackageJsonContent = await readFile2(
|
|
220
|
+
joinPaths(workspaceRoot, "package.json"),
|
|
221
|
+
"utf8"
|
|
222
|
+
);
|
|
168
223
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
169
224
|
packageJson.type ??= "module";
|
|
170
225
|
packageJson.sideEffects ??= false;
|
|
@@ -175,9 +230,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (workspaceConfi
|
|
|
175
230
|
}
|
|
176
231
|
packageJson.source ??= `${joinPaths(distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
177
232
|
}
|
|
178
|
-
packageJson.files ??= [
|
|
179
|
-
"dist/**/*"
|
|
180
|
-
];
|
|
233
|
+
packageJson.files ??= ["dist/**/*"];
|
|
181
234
|
if (includeSrc === true && !packageJson.files.includes("src")) {
|
|
182
235
|
packageJson.files.push("src/**/*");
|
|
183
236
|
}
|
|
@@ -193,20 +246,16 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (workspaceConfi
|
|
|
193
246
|
packageJson.author ??= workspacePackageJson.author;
|
|
194
247
|
packageJson.maintainers ??= workspacePackageJson.maintainers;
|
|
195
248
|
if (!packageJson.maintainers && packageJson.author) {
|
|
196
|
-
packageJson.maintainers = [
|
|
197
|
-
packageJson.author
|
|
198
|
-
];
|
|
249
|
+
packageJson.maintainers = [packageJson.author];
|
|
199
250
|
}
|
|
200
251
|
packageJson.contributors ??= workspacePackageJson.contributors;
|
|
201
252
|
if (!packageJson.contributors && packageJson.author) {
|
|
202
|
-
packageJson.contributors = [
|
|
203
|
-
packageJson.author
|
|
204
|
-
];
|
|
253
|
+
packageJson.contributors = [packageJson.author];
|
|
205
254
|
}
|
|
206
255
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
207
256
|
packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
|
|
208
257
|
return packageJson;
|
|
209
|
-
}
|
|
258
|
+
};
|
|
210
259
|
|
|
211
260
|
// ../config-tools/src/get-config.ts
|
|
212
261
|
init_esm_shims();
|
|
@@ -219,7 +268,7 @@ import defu2 from "defu";
|
|
|
219
268
|
init_esm_shims();
|
|
220
269
|
import { loadConfig } from "c12";
|
|
221
270
|
import defu from "defu";
|
|
222
|
-
var getConfigFileByName =
|
|
271
|
+
var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
223
272
|
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
224
273
|
const configs = await Promise.all([
|
|
225
274
|
loadConfig({
|
|
@@ -229,7 +278,10 @@ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, opti
|
|
|
229
278
|
envName: fileName?.toUpperCase(),
|
|
230
279
|
jitiOptions: {
|
|
231
280
|
debug: false,
|
|
232
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
281
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
282
|
+
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
283
|
+
"jiti"
|
|
284
|
+
)
|
|
233
285
|
},
|
|
234
286
|
...options
|
|
235
287
|
}),
|
|
@@ -240,32 +292,45 @@ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, opti
|
|
|
240
292
|
envName: fileName?.toUpperCase(),
|
|
241
293
|
jitiOptions: {
|
|
242
294
|
debug: false,
|
|
243
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
295
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
296
|
+
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
297
|
+
"jiti"
|
|
298
|
+
)
|
|
244
299
|
},
|
|
245
300
|
configFile: fileName,
|
|
246
301
|
...options
|
|
247
302
|
})
|
|
248
303
|
]);
|
|
249
304
|
return defu(configs[0] ?? {}, configs[1] ?? {});
|
|
250
|
-
}
|
|
251
|
-
var getConfigFile =
|
|
305
|
+
};
|
|
306
|
+
var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
252
307
|
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
253
308
|
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
254
309
|
let config = result.config;
|
|
255
310
|
const configFile = result.configFile;
|
|
256
311
|
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
257
|
-
writeTrace(
|
|
258
|
-
|
|
259
|
-
|
|
312
|
+
writeTrace(
|
|
313
|
+
`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
|
|
314
|
+
{
|
|
315
|
+
logLevel: "all"
|
|
316
|
+
}
|
|
317
|
+
);
|
|
260
318
|
}
|
|
261
319
|
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
262
|
-
const results = await Promise.all(
|
|
320
|
+
const results = await Promise.all(
|
|
321
|
+
additionalFileNames.map(
|
|
322
|
+
(fileName) => getConfigFileByName(fileName, workspacePath)
|
|
323
|
+
)
|
|
324
|
+
);
|
|
263
325
|
for (const result2 of results) {
|
|
264
326
|
if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
|
|
265
327
|
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
266
|
-
writeTrace(
|
|
267
|
-
|
|
268
|
-
|
|
328
|
+
writeTrace(
|
|
329
|
+
`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
|
|
330
|
+
{
|
|
331
|
+
logLevel: "all"
|
|
332
|
+
}
|
|
333
|
+
);
|
|
269
334
|
}
|
|
270
335
|
config = defu(result2.config ?? {}, config ?? {});
|
|
271
336
|
}
|
|
@@ -276,21 +341,23 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
|
|
|
276
341
|
}
|
|
277
342
|
config.configFile = configFile;
|
|
278
343
|
return config;
|
|
279
|
-
}
|
|
344
|
+
};
|
|
280
345
|
|
|
281
346
|
// ../config-tools/src/env/get-env.ts
|
|
282
347
|
init_esm_shims();
|
|
283
|
-
var getExtensionEnv =
|
|
348
|
+
var getExtensionEnv = (extensionName) => {
|
|
284
349
|
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
285
350
|
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
286
|
-
const name = key.replace(prefix, "").split("_").map(
|
|
351
|
+
const name = key.replace(prefix, "").split("_").map(
|
|
352
|
+
(i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : ""
|
|
353
|
+
).join("");
|
|
287
354
|
if (name) {
|
|
288
355
|
ret[name] = process.env[key];
|
|
289
356
|
}
|
|
290
357
|
return ret;
|
|
291
358
|
}, {});
|
|
292
|
-
}
|
|
293
|
-
var getConfigEnv =
|
|
359
|
+
};
|
|
360
|
+
var getConfigEnv = () => {
|
|
294
361
|
const prefix = "STORM_";
|
|
295
362
|
let config = {
|
|
296
363
|
extends: process.env[`${prefix}EXTENDS`] || void 0,
|
|
@@ -358,14 +425,25 @@ var getConfigEnv = /* @__PURE__ */ __name(() => {
|
|
|
358
425
|
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
359
426
|
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
360
427
|
},
|
|
361
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
428
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
429
|
+
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
430
|
+
) ? getLogLevelLabel(
|
|
431
|
+
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
432
|
+
) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
362
433
|
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
363
434
|
};
|
|
364
|
-
const themeNames = Object.keys(process.env).filter(
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
435
|
+
const themeNames = Object.keys(process.env).filter(
|
|
436
|
+
(envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
|
|
437
|
+
(colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
|
|
438
|
+
)
|
|
439
|
+
);
|
|
440
|
+
config.colors = themeNames.length > 0 ? themeNames.reduce(
|
|
441
|
+
(ret, themeName) => {
|
|
442
|
+
ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
|
|
443
|
+
return ret;
|
|
444
|
+
},
|
|
445
|
+
{}
|
|
446
|
+
) : getThemeColorConfigEnv(prefix);
|
|
369
447
|
if (config.docs === STORM_DEFAULT_DOCS) {
|
|
370
448
|
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
371
449
|
config.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
@@ -386,23 +464,17 @@ var getConfigEnv = /* @__PURE__ */ __name(() => {
|
|
|
386
464
|
config = {
|
|
387
465
|
...config,
|
|
388
466
|
...parsed,
|
|
389
|
-
colors: {
|
|
390
|
-
|
|
391
|
-
...parsed.colors
|
|
392
|
-
},
|
|
393
|
-
extensions: {
|
|
394
|
-
...config.extensions,
|
|
395
|
-
...parsed.extensions
|
|
396
|
-
}
|
|
467
|
+
colors: { ...config.colors, ...parsed.colors },
|
|
468
|
+
extensions: { ...config.extensions, ...parsed.extensions }
|
|
397
469
|
};
|
|
398
470
|
}
|
|
399
471
|
return config;
|
|
400
|
-
}
|
|
401
|
-
var getThemeColorConfigEnv =
|
|
472
|
+
};
|
|
473
|
+
var getThemeColorConfigEnv = (prefix, theme) => {
|
|
402
474
|
const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
|
|
403
475
|
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
|
|
404
|
-
}
|
|
405
|
-
var getSingleThemeColorConfigEnv =
|
|
476
|
+
};
|
|
477
|
+
var getSingleThemeColorConfigEnv = (prefix) => {
|
|
406
478
|
return {
|
|
407
479
|
dark: process.env[`${prefix}DARK`],
|
|
408
480
|
light: process.env[`${prefix}LIGHT`],
|
|
@@ -419,14 +491,16 @@ var getSingleThemeColorConfigEnv = /* @__PURE__ */ __name((prefix) => {
|
|
|
419
491
|
positive: process.env[`${prefix}POSITIVE`],
|
|
420
492
|
negative: process.env[`${prefix}NEGATIVE`]
|
|
421
493
|
};
|
|
422
|
-
}
|
|
423
|
-
var getMultiThemeColorConfigEnv =
|
|
494
|
+
};
|
|
495
|
+
var getMultiThemeColorConfigEnv = (prefix) => {
|
|
424
496
|
return {
|
|
425
|
-
light: getBaseThemeColorConfigEnv(
|
|
497
|
+
light: getBaseThemeColorConfigEnv(
|
|
498
|
+
`${prefix}_LIGHT_`
|
|
499
|
+
),
|
|
426
500
|
dark: getBaseThemeColorConfigEnv(`${prefix}_DARK_`)
|
|
427
501
|
};
|
|
428
|
-
}
|
|
429
|
-
var getBaseThemeColorConfigEnv =
|
|
502
|
+
};
|
|
503
|
+
var getBaseThemeColorConfigEnv = (prefix) => {
|
|
430
504
|
return {
|
|
431
505
|
foreground: process.env[`${prefix}FOREGROUND`],
|
|
432
506
|
background: process.env[`${prefix}BACKGROUND`],
|
|
@@ -443,14 +517,17 @@ var getBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix) => {
|
|
|
443
517
|
positive: process.env[`${prefix}POSITIVE`],
|
|
444
518
|
negative: process.env[`${prefix}NEGATIVE`]
|
|
445
519
|
};
|
|
446
|
-
}
|
|
520
|
+
};
|
|
447
521
|
|
|
448
522
|
// ../config-tools/src/env/set-env.ts
|
|
449
523
|
init_esm_shims();
|
|
450
|
-
var setExtensionEnv =
|
|
524
|
+
var setExtensionEnv = (extensionName, extension) => {
|
|
451
525
|
for (const key of Object.keys(extension ?? {})) {
|
|
452
526
|
if (extension[key]) {
|
|
453
|
-
const result = key?.replace(
|
|
527
|
+
const result = key?.replace(
|
|
528
|
+
/([A-Z])+/g,
|
|
529
|
+
(input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
|
|
530
|
+
).split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
454
531
|
let extensionKey;
|
|
455
532
|
if (result.length === 0) {
|
|
456
533
|
return;
|
|
@@ -465,8 +542,8 @@ var setExtensionEnv = /* @__PURE__ */ __name((extensionName, extension) => {
|
|
|
465
542
|
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
466
543
|
}
|
|
467
544
|
}
|
|
468
|
-
}
|
|
469
|
-
var setConfigEnv =
|
|
545
|
+
};
|
|
546
|
+
var setConfigEnv = (config) => {
|
|
470
547
|
const prefix = "STORM_";
|
|
471
548
|
if (config.extends) {
|
|
472
549
|
process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
|
|
@@ -555,7 +632,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
555
632
|
}
|
|
556
633
|
if (config.directories) {
|
|
557
634
|
if (!config.skipCache && config.directories.cache) {
|
|
558
|
-
process.env[`${prefix}CACHE_DIR`] = correctPaths(
|
|
635
|
+
process.env[`${prefix}CACHE_DIR`] = correctPaths(
|
|
636
|
+
config.directories.cache
|
|
637
|
+
);
|
|
559
638
|
process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
|
|
560
639
|
}
|
|
561
640
|
if (config.directories.data) {
|
|
@@ -563,7 +642,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
563
642
|
process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
|
|
564
643
|
}
|
|
565
644
|
if (config.directories.config) {
|
|
566
|
-
process.env[`${prefix}CONFIG_DIR`] = correctPaths(
|
|
645
|
+
process.env[`${prefix}CONFIG_DIR`] = correctPaths(
|
|
646
|
+
config.directories.config
|
|
647
|
+
);
|
|
567
648
|
process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
|
|
568
649
|
}
|
|
569
650
|
if (config.directories.temp) {
|
|
@@ -575,7 +656,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
575
656
|
process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
|
|
576
657
|
}
|
|
577
658
|
if (config.directories.build) {
|
|
578
|
-
process.env[`${prefix}BUILD_DIR`] = correctPaths(
|
|
659
|
+
process.env[`${prefix}BUILD_DIR`] = correctPaths(
|
|
660
|
+
config.directories.build
|
|
661
|
+
);
|
|
579
662
|
process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
|
|
580
663
|
}
|
|
581
664
|
}
|
|
@@ -596,7 +679,10 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
596
679
|
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
597
680
|
}
|
|
598
681
|
} else {
|
|
599
|
-
setThemeColorConfigEnv(
|
|
682
|
+
setThemeColorConfigEnv(
|
|
683
|
+
`${prefix}COLOR_`,
|
|
684
|
+
config.colors
|
|
685
|
+
);
|
|
600
686
|
}
|
|
601
687
|
if (config.repository) {
|
|
602
688
|
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
@@ -608,7 +694,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
608
694
|
process.env[`${prefix}PRE_ID`] = String(config.preid);
|
|
609
695
|
}
|
|
610
696
|
if (config.externalPackagePatterns) {
|
|
611
|
-
process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] = JSON.stringify(
|
|
697
|
+
process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] = JSON.stringify(
|
|
698
|
+
config.externalPackagePatterns
|
|
699
|
+
);
|
|
612
700
|
}
|
|
613
701
|
if (config.registry) {
|
|
614
702
|
if (config.registry.github) {
|
|
@@ -621,20 +709,28 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
621
709
|
process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
|
|
622
710
|
}
|
|
623
711
|
if (config.registry.cyclone) {
|
|
624
|
-
process.env[`${prefix}REGISTRY_CYCLONE`] = String(
|
|
712
|
+
process.env[`${prefix}REGISTRY_CYCLONE`] = String(
|
|
713
|
+
config.registry.cyclone
|
|
714
|
+
);
|
|
625
715
|
}
|
|
626
716
|
if (config.registry.container) {
|
|
627
|
-
process.env[`${prefix}REGISTRY_CONTAINER`] = String(
|
|
717
|
+
process.env[`${prefix}REGISTRY_CONTAINER`] = String(
|
|
718
|
+
config.registry.container
|
|
719
|
+
);
|
|
628
720
|
}
|
|
629
721
|
}
|
|
630
722
|
if (config.logLevel) {
|
|
631
723
|
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
632
724
|
process.env.LOG_LEVEL = String(config.logLevel);
|
|
633
|
-
process.env.NX_VERBOSE_LOGGING = String(
|
|
725
|
+
process.env.NX_VERBOSE_LOGGING = String(
|
|
726
|
+
getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
|
|
727
|
+
);
|
|
634
728
|
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
635
729
|
}
|
|
636
730
|
if (config.skipConfigLogging !== void 0) {
|
|
637
|
-
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
|
|
731
|
+
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
|
|
732
|
+
config.skipConfigLogging
|
|
733
|
+
);
|
|
638
734
|
}
|
|
639
735
|
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
640
736
|
for (const key of Object.keys(config.extensions ?? {})) {
|
|
@@ -642,11 +738,11 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
642
738
|
setExtensionEnv(key, config.extensions[key]);
|
|
643
739
|
}
|
|
644
740
|
}
|
|
645
|
-
}
|
|
646
|
-
var setThemeColorConfigEnv =
|
|
741
|
+
};
|
|
742
|
+
var setThemeColorConfigEnv = (prefix, config) => {
|
|
647
743
|
return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
648
|
-
}
|
|
649
|
-
var setSingleThemeColorConfigEnv =
|
|
744
|
+
};
|
|
745
|
+
var setSingleThemeColorConfigEnv = (prefix, config) => {
|
|
650
746
|
if (config.dark) {
|
|
651
747
|
process.env[`${prefix}DARK`] = config.dark;
|
|
652
748
|
}
|
|
@@ -689,14 +785,14 @@ var setSingleThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
|
689
785
|
if (config.negative) {
|
|
690
786
|
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
691
787
|
}
|
|
692
|
-
}
|
|
693
|
-
var setMultiThemeColorConfigEnv =
|
|
788
|
+
};
|
|
789
|
+
var setMultiThemeColorConfigEnv = (prefix, config) => {
|
|
694
790
|
return {
|
|
695
791
|
light: setBaseThemeColorConfigEnv(`${prefix}LIGHT_`, config.light),
|
|
696
792
|
dark: setBaseThemeColorConfigEnv(`${prefix}DARK_`, config.dark)
|
|
697
793
|
};
|
|
698
|
-
}
|
|
699
|
-
var setBaseThemeColorConfigEnv =
|
|
794
|
+
};
|
|
795
|
+
var setBaseThemeColorConfigEnv = (prefix, config) => {
|
|
700
796
|
if (config.foreground) {
|
|
701
797
|
process.env[`${prefix}FOREGROUND`] = config.foreground;
|
|
702
798
|
}
|
|
@@ -739,12 +835,12 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
|
739
835
|
if (config.negative) {
|
|
740
836
|
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
741
837
|
}
|
|
742
|
-
}
|
|
838
|
+
};
|
|
743
839
|
|
|
744
840
|
// ../config-tools/src/create-storm-config.ts
|
|
745
841
|
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
746
842
|
var _static_cache = void 0;
|
|
747
|
-
var createStormWorkspaceConfig =
|
|
843
|
+
var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
|
|
748
844
|
let result;
|
|
749
845
|
if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
|
|
750
846
|
let _workspaceRoot = workspaceRoot;
|
|
@@ -755,16 +851,19 @@ var createStormWorkspaceConfig = /* @__PURE__ */ __name(async (extensionName, sc
|
|
|
755
851
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
756
852
|
if (!configFile) {
|
|
757
853
|
if (!skipLogs) {
|
|
758
|
-
writeWarning(
|
|
759
|
-
|
|
760
|
-
|
|
854
|
+
writeWarning(
|
|
855
|
+
"No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n",
|
|
856
|
+
{ logLevel: "all" }
|
|
857
|
+
);
|
|
761
858
|
}
|
|
762
859
|
if (useDefault === false) {
|
|
763
860
|
return void 0;
|
|
764
861
|
}
|
|
765
862
|
}
|
|
766
863
|
const defaultConfig = await getDefaultConfig(_workspaceRoot);
|
|
767
|
-
result = await stormWorkspaceConfigSchema.parseAsync(
|
|
864
|
+
result = await stormWorkspaceConfigSchema.parseAsync(
|
|
865
|
+
defu2(configEnv, configFile, defaultConfig)
|
|
866
|
+
);
|
|
768
867
|
result.workspaceRoot ??= _workspaceRoot;
|
|
769
868
|
} else {
|
|
770
869
|
result = _static_cache.data;
|
|
@@ -780,11 +879,9 @@ var createStormWorkspaceConfig = /* @__PURE__ */ __name(async (extensionName, sc
|
|
|
780
879
|
data: result
|
|
781
880
|
};
|
|
782
881
|
return result;
|
|
783
|
-
}
|
|
784
|
-
var createConfigExtension =
|
|
785
|
-
const extension_cache_key = {
|
|
786
|
-
extensionName
|
|
787
|
-
};
|
|
882
|
+
};
|
|
883
|
+
var createConfigExtension = (extensionName, schema) => {
|
|
884
|
+
const extension_cache_key = { extensionName };
|
|
788
885
|
if (_extension_cache.has(extension_cache_key)) {
|
|
789
886
|
return _extension_cache.get(extension_cache_key);
|
|
790
887
|
}
|
|
@@ -794,32 +891,41 @@ var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
|
|
|
794
891
|
}
|
|
795
892
|
_extension_cache.set(extension_cache_key, extension);
|
|
796
893
|
return extension;
|
|
797
|
-
}
|
|
798
|
-
var loadStormWorkspaceConfig =
|
|
799
|
-
const config = await createStormWorkspaceConfig(
|
|
894
|
+
};
|
|
895
|
+
var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
|
|
896
|
+
const config = await createStormWorkspaceConfig(
|
|
897
|
+
void 0,
|
|
898
|
+
void 0,
|
|
899
|
+
workspaceRoot,
|
|
900
|
+
skipLogs,
|
|
901
|
+
true
|
|
902
|
+
);
|
|
800
903
|
setConfigEnv(config);
|
|
801
904
|
if (!skipLogs && !config.skipConfigLogging) {
|
|
802
|
-
writeTrace(
|
|
803
|
-
|
|
905
|
+
writeTrace(
|
|
906
|
+
`\u2699\uFE0F Using Storm Workspace configuration:
|
|
907
|
+
${formatLogMessage(config)}`,
|
|
908
|
+
config
|
|
909
|
+
);
|
|
804
910
|
}
|
|
805
911
|
return config;
|
|
806
|
-
}
|
|
912
|
+
};
|
|
807
913
|
|
|
808
914
|
// ../config-tools/src/get-config.ts
|
|
809
|
-
var getConfig =
|
|
915
|
+
var getConfig = (workspaceRoot, skipLogs = false) => {
|
|
810
916
|
return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
|
|
811
|
-
}
|
|
812
|
-
var getWorkspaceConfig =
|
|
917
|
+
};
|
|
918
|
+
var getWorkspaceConfig = (skipLogs = false, options = {}) => {
|
|
813
919
|
let workspaceRoot = options.workspaceRoot;
|
|
814
920
|
if (!workspaceRoot) {
|
|
815
921
|
workspaceRoot = findWorkspaceRoot(options.cwd);
|
|
816
922
|
}
|
|
817
923
|
return getConfig(workspaceRoot, skipLogs);
|
|
818
|
-
}
|
|
924
|
+
};
|
|
819
925
|
|
|
820
926
|
// ../build-tools/src/utilities/get-env.ts
|
|
821
927
|
init_esm_shims();
|
|
822
|
-
var getEnv =
|
|
928
|
+
var getEnv = (builder, options) => {
|
|
823
929
|
return {
|
|
824
930
|
STORM_BUILD: builder,
|
|
825
931
|
STORM_ORG: options.orgName || DEFAULT_ORGANIZATION,
|
|
@@ -830,7 +936,7 @@ var getEnv = /* @__PURE__ */ __name((builder, options) => {
|
|
|
830
936
|
STORM_TARGET: JSON.stringify(options.target),
|
|
831
937
|
...options.env
|
|
832
938
|
};
|
|
833
|
-
}
|
|
939
|
+
};
|
|
834
940
|
|
|
835
941
|
// ../build-tools/src/index.ts
|
|
836
942
|
init_esm_shims();
|
|
@@ -883,7 +989,10 @@ import { readFile as readFile3 } from "node:fs/promises";
|
|
|
883
989
|
|
|
884
990
|
// ../build-tools/src/utilities/task-graph.ts
|
|
885
991
|
init_esm_shims();
|
|
886
|
-
import {
|
|
992
|
+
import {
|
|
993
|
+
createTaskGraph,
|
|
994
|
+
mapTargetDefaultsToDependencies
|
|
995
|
+
} from "nx/src/tasks-runner/create-task-graph";
|
|
887
996
|
|
|
888
997
|
export {
|
|
889
998
|
DEFAULT_COMPILED_BANNER,
|