@storm-software/cloudflare-tools 0.55.86 → 0.55.88
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/CHANGELOG.md +21 -0
- package/README.md +1 -2
- package/dist/{chunk-PWYTCJYX.js → chunk-4WULYLQ3.js} +881 -650
- package/dist/{chunk-VTHBMY4B.js → chunk-6XDOBG77.js} +39 -28
- package/dist/{chunk-2XOEHMET.js → chunk-7JQIASJ7.js} +93 -58
- package/dist/{chunk-FQ33YTDR.mjs → chunk-ABAI6EPS.mjs} +806 -575
- package/dist/{chunk-BNJGOSXD.mjs → chunk-FABNT5TZ.mjs} +15 -13
- package/dist/{chunk-XCERLTLT.mjs → chunk-GPAI4NHQ.mjs} +141 -87
- package/dist/{chunk-IVLCYFXD.js → chunk-HBASMEU5.js} +168 -114
- package/dist/{chunk-6B5PUF7X.js → chunk-HIUZ6UL7.js} +97 -47
- package/dist/{chunk-R7AIVBS7.js → chunk-I4P7DVDN.js} +19 -24
- package/dist/{chunk-QOSOXTAS.mjs → chunk-ISGKIYF5.mjs} +92 -42
- package/dist/{chunk-GDWUA3BY.mjs → chunk-L4WFYC7K.mjs} +39 -28
- package/dist/{chunk-J5SB6L2L.js → chunk-MCKGQKYU.js} +2 -5
- package/dist/{chunk-UVPHL2U4.mjs → chunk-MV24QW26.mjs} +195 -127
- package/dist/{chunk-W7HOEYL6.mjs → chunk-NEMOTOHF.mjs} +93 -56
- package/dist/{chunk-V7LBWOVV.js → chunk-PZ5CI56F.js} +196 -128
- package/dist/{chunk-Z56LURRT.mjs → chunk-QPABB45G.mjs} +19 -24
- package/dist/{chunk-G2K6R4CT.mjs → chunk-QQ22YQSB.mjs} +3 -6
- package/dist/{chunk-QGRENI3O.js → chunk-RIUVF72K.js} +17 -15
- package/dist/{chunk-JFSRBSF6.mjs → chunk-SKMJXTAG.mjs} +27 -21
- package/dist/{chunk-XZ5IJXEB.js → chunk-ZBQZJEOG.js} +26 -20
- package/dist/executors.js +8 -8
- package/dist/executors.mjs +8 -8
- package/dist/generators.js +6 -6
- package/dist/generators.mjs +5 -5
- package/dist/index.js +41 -49
- package/dist/index.mjs +40 -48
- package/dist/src/executors/cloudflare-publish/executor.js +7 -7
- package/dist/src/executors/cloudflare-publish/executor.mjs +6 -6
- package/dist/src/executors/r2-upload-publish/executor.js +7 -7
- package/dist/src/executors/r2-upload-publish/executor.mjs +6 -6
- package/dist/src/executors/serve/executor.js +49 -50
- package/dist/src/executors/serve/executor.mjs +48 -49
- package/dist/src/generators/init/generator.js +3 -3
- package/dist/src/generators/init/generator.mjs +2 -2
- package/dist/src/generators/worker/generator.js +6 -6
- package/dist/src/generators/worker/generator.mjs +5 -5
- package/dist/src/utils/index.js +4 -4
- package/dist/src/utils/index.mjs +3 -3
- package/dist/src/utils/r2-bucket-helpers.js +4 -4
- package/dist/src/utils/r2-bucket-helpers.mjs +3 -3
- package/dist/tsup.config.js +3 -8
- package/dist/tsup.config.mjs +3 -8
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProjectTagConstants,
|
|
3
3
|
addProjectTag
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-L4WFYC7K.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getConfig,
|
|
7
7
|
getWorkspaceConfig
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GPAI4NHQ.mjs";
|
|
9
9
|
import {
|
|
10
10
|
findWorkspaceRoot,
|
|
11
11
|
formatLogMessage,
|
|
@@ -19,15 +19,14 @@ import {
|
|
|
19
19
|
writeSuccess,
|
|
20
20
|
writeTrace,
|
|
21
21
|
writeWarning
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-MV24QW26.mjs";
|
|
23
23
|
import {
|
|
24
24
|
__dirname,
|
|
25
|
-
__name,
|
|
26
25
|
__require
|
|
27
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-QQ22YQSB.mjs";
|
|
28
27
|
|
|
29
28
|
// ../config-tools/src/utilities/apply-workspace-tokens.ts
|
|
30
|
-
var applyWorkspaceBaseTokens =
|
|
29
|
+
var applyWorkspaceBaseTokens = async (option, tokenParams) => {
|
|
31
30
|
let result = option;
|
|
32
31
|
if (!result) {
|
|
33
32
|
return result;
|
|
@@ -37,7 +36,10 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option, tokenParams
|
|
|
37
36
|
if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
|
|
38
37
|
for (const optionKey of optionKeys) {
|
|
39
38
|
if (result.includes(`{${optionKey}}`)) {
|
|
40
|
-
result = result.replaceAll(
|
|
39
|
+
result = result.replaceAll(
|
|
40
|
+
`{${optionKey}}`,
|
|
41
|
+
tokenParams?.[optionKey] || ""
|
|
42
|
+
);
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
}
|
|
@@ -47,47 +49,65 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option, tokenParams
|
|
|
47
49
|
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
48
50
|
for (const configKey of configKeys) {
|
|
49
51
|
if (result.includes(`{${configKey}}`)) {
|
|
50
|
-
result = result.replaceAll(
|
|
52
|
+
result = result.replaceAll(
|
|
53
|
+
`{${configKey}}`,
|
|
54
|
+
tokenParams.config[configKey] || ""
|
|
55
|
+
);
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
}
|
|
54
59
|
}
|
|
55
60
|
if (result.includes("{workspaceRoot}")) {
|
|
56
|
-
result = result.replaceAll(
|
|
61
|
+
result = result.replaceAll(
|
|
62
|
+
"{workspaceRoot}",
|
|
63
|
+
tokenParams.workspaceRoot ?? tokenParams.config?.workspaceRoot ?? findWorkspaceRoot()
|
|
64
|
+
);
|
|
57
65
|
}
|
|
58
66
|
return result;
|
|
59
|
-
}
|
|
60
|
-
var applyWorkspaceProjectTokens =
|
|
67
|
+
};
|
|
68
|
+
var applyWorkspaceProjectTokens = (option, tokenParams) => {
|
|
61
69
|
return applyWorkspaceBaseTokens(option, tokenParams);
|
|
62
|
-
}
|
|
63
|
-
var applyWorkspaceTokens =
|
|
70
|
+
};
|
|
71
|
+
var applyWorkspaceTokens = async (options, tokenParams, tokenizerFn) => {
|
|
64
72
|
if (!options) {
|
|
65
73
|
return {};
|
|
66
74
|
}
|
|
67
75
|
const result = {};
|
|
68
76
|
for (const option of Object.keys(options)) {
|
|
69
77
|
if (typeof options[option] === "string") {
|
|
70
|
-
result[option] = await Promise.resolve(
|
|
78
|
+
result[option] = await Promise.resolve(
|
|
79
|
+
tokenizerFn(options[option], tokenParams)
|
|
80
|
+
);
|
|
71
81
|
} else if (Array.isArray(options[option])) {
|
|
72
|
-
result[option] = await Promise.all(
|
|
82
|
+
result[option] = await Promise.all(
|
|
83
|
+
options[option].map(
|
|
84
|
+
async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item
|
|
85
|
+
)
|
|
86
|
+
);
|
|
73
87
|
} else if (typeof options[option] === "object") {
|
|
74
|
-
result[option] = await applyWorkspaceTokens(
|
|
88
|
+
result[option] = await applyWorkspaceTokens(
|
|
89
|
+
options[option],
|
|
90
|
+
tokenParams,
|
|
91
|
+
tokenizerFn
|
|
92
|
+
);
|
|
75
93
|
} else {
|
|
76
94
|
result[option] = options[option];
|
|
77
95
|
}
|
|
78
96
|
}
|
|
79
97
|
return result;
|
|
80
|
-
}
|
|
98
|
+
};
|
|
81
99
|
|
|
82
100
|
// ../workspace-tools/src/base/base-executor.ts
|
|
83
101
|
import { defu } from "defu";
|
|
84
|
-
var withRunExecutor =
|
|
102
|
+
var withRunExecutor = (name, executorFn, executorOptions = {}) => async (_options, context) => {
|
|
85
103
|
const stopwatch = getStopwatch(name);
|
|
86
104
|
let options = _options;
|
|
87
105
|
let config = {};
|
|
88
106
|
try {
|
|
89
107
|
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
90
|
-
throw new Error(
|
|
108
|
+
throw new Error(
|
|
109
|
+
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
110
|
+
);
|
|
91
111
|
}
|
|
92
112
|
const workspaceRoot3 = findWorkspaceRoot();
|
|
93
113
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root || workspaceRoot3;
|
|
@@ -96,35 +116,50 @@ var withRunExecutor = /* @__PURE__ */ __name((name, executorFn, executorOptions
|
|
|
96
116
|
config.workspaceRoot = workspaceRoot3;
|
|
97
117
|
writeInfo(`\u26A1 Running the ${name} executor for ${projectName} `, config);
|
|
98
118
|
if (!executorOptions.skipReadingConfig) {
|
|
99
|
-
writeTrace(
|
|
119
|
+
writeTrace(
|
|
120
|
+
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
100
121
|
- workspaceRoot: ${workspaceRoot3}
|
|
101
122
|
- projectRoot: ${projectRoot}
|
|
102
123
|
- sourceRoot: ${sourceRoot}
|
|
103
124
|
- projectName: ${projectName}
|
|
104
|
-
`,
|
|
125
|
+
`,
|
|
126
|
+
config
|
|
127
|
+
);
|
|
105
128
|
config = await getConfig(workspaceRoot3);
|
|
106
129
|
}
|
|
107
130
|
if (executorOptions?.hooks?.applyDefaultOptions) {
|
|
108
131
|
writeDebug("Running the applyDefaultOptions hook...", config);
|
|
109
|
-
options = await Promise.resolve(
|
|
132
|
+
options = await Promise.resolve(
|
|
133
|
+
executorOptions.hooks.applyDefaultOptions(options, config)
|
|
134
|
+
);
|
|
110
135
|
writeDebug("Completed the applyDefaultOptions hook", config);
|
|
111
136
|
}
|
|
112
|
-
writeTrace(
|
|
137
|
+
writeTrace(
|
|
138
|
+
`Executor schema options \u2699\uFE0F
|
|
113
139
|
${formatLogMessage(options)}
|
|
114
|
-
`,
|
|
115
|
-
const tokenized = await applyWorkspaceTokens(options, defu({
|
|
116
|
-
workspaceRoot: workspaceRoot3,
|
|
117
|
-
projectRoot,
|
|
118
|
-
sourceRoot,
|
|
119
|
-
projectName,
|
|
140
|
+
`,
|
|
120
141
|
config
|
|
121
|
-
|
|
122
|
-
|
|
142
|
+
);
|
|
143
|
+
const tokenized = await applyWorkspaceTokens(
|
|
144
|
+
options,
|
|
145
|
+
defu(
|
|
146
|
+
{ workspaceRoot: workspaceRoot3, projectRoot, sourceRoot, projectName, config },
|
|
147
|
+
config,
|
|
148
|
+
context.projectsConfigurations.projects[context.projectName]
|
|
149
|
+
),
|
|
150
|
+
applyWorkspaceProjectTokens
|
|
151
|
+
);
|
|
152
|
+
writeTrace(
|
|
153
|
+
`Executor schema tokenized options \u2699\uFE0F
|
|
123
154
|
${formatLogMessage(tokenized)}
|
|
124
|
-
`,
|
|
155
|
+
`,
|
|
156
|
+
config
|
|
157
|
+
);
|
|
125
158
|
if (executorOptions?.hooks?.preProcess) {
|
|
126
159
|
writeDebug("Running the preProcess hook...", config);
|
|
127
|
-
await Promise.resolve(
|
|
160
|
+
await Promise.resolve(
|
|
161
|
+
executorOptions.hooks.preProcess(tokenized, config)
|
|
162
|
+
);
|
|
128
163
|
writeDebug("Completed the preProcess hook", config);
|
|
129
164
|
}
|
|
130
165
|
const ret = executorFn(tokenized, context, config);
|
|
@@ -134,10 +169,15 @@ ${formatLogMessage(tokenized)}
|
|
|
134
169
|
void iter;
|
|
135
170
|
}
|
|
136
171
|
}
|
|
137
|
-
const result = await Promise.resolve(
|
|
172
|
+
const result = await Promise.resolve(
|
|
173
|
+
ret
|
|
174
|
+
);
|
|
138
175
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
139
|
-
writeTrace(
|
|
140
|
-
${
|
|
176
|
+
writeTrace(
|
|
177
|
+
`Failure determined by the ${name} executor
|
|
178
|
+
${formatLogMessage(result)}`,
|
|
179
|
+
config
|
|
180
|
+
);
|
|
141
181
|
console.error(result);
|
|
142
182
|
throw new Error(`The ${name} executor failed to run`, {
|
|
143
183
|
cause: result?.error
|
|
@@ -154,28 +194,37 @@ ${formatLogMessage(result)}`, config);
|
|
|
154
194
|
success: true
|
|
155
195
|
};
|
|
156
196
|
} catch (error) {
|
|
157
|
-
writeFatal(
|
|
158
|
-
|
|
197
|
+
writeFatal(
|
|
198
|
+
"A fatal error occurred while running the executor - the process was forced to terminate",
|
|
199
|
+
config
|
|
200
|
+
);
|
|
201
|
+
writeError(
|
|
202
|
+
`An exception was thrown in the executor's process
|
|
159
203
|
- Details: ${error.message}
|
|
160
|
-
- Stacktrace: ${error.stack}`,
|
|
204
|
+
- Stacktrace: ${error.stack}`,
|
|
205
|
+
config
|
|
206
|
+
);
|
|
161
207
|
return {
|
|
162
208
|
success: false
|
|
163
209
|
};
|
|
164
210
|
} finally {
|
|
165
211
|
stopwatch();
|
|
166
212
|
}
|
|
167
|
-
}
|
|
168
|
-
var _isFunction =
|
|
213
|
+
};
|
|
214
|
+
var _isFunction = (value) => {
|
|
169
215
|
try {
|
|
170
216
|
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
171
217
|
} catch (e) {
|
|
172
218
|
return false;
|
|
173
219
|
}
|
|
174
|
-
}
|
|
220
|
+
};
|
|
175
221
|
|
|
176
222
|
// ../workspace-tools/src/utils/cargo.ts
|
|
177
223
|
import { joinPathFragments, workspaceRoot } from "@nx/devkit";
|
|
178
|
-
import {
|
|
224
|
+
import {
|
|
225
|
+
execSync,
|
|
226
|
+
spawn
|
|
227
|
+
} from "node:child_process";
|
|
179
228
|
import { relative } from "node:path";
|
|
180
229
|
var INVALID_CARGO_ARGS = [
|
|
181
230
|
"allFeatures",
|
|
@@ -185,7 +234,7 @@ var INVALID_CARGO_ARGS = [
|
|
|
185
234
|
"package",
|
|
186
235
|
"tsConfig"
|
|
187
236
|
];
|
|
188
|
-
var buildCargoCommand =
|
|
237
|
+
var buildCargoCommand = (baseCommand, options, context) => {
|
|
189
238
|
const args = [];
|
|
190
239
|
if (options.toolchain && options.toolchain !== "stable") {
|
|
191
240
|
args.push(`+${options.toolchain}`);
|
|
@@ -223,13 +272,12 @@ var buildCargoCommand = /* @__PURE__ */ __name((baseCommand, options, context) =
|
|
|
223
272
|
args.push("--target-dir", options.outputPath);
|
|
224
273
|
}
|
|
225
274
|
return args;
|
|
226
|
-
}
|
|
275
|
+
};
|
|
227
276
|
async function cargoCommand(...args) {
|
|
228
277
|
console.log(`> cargo ${args.join(" ")}`);
|
|
229
278
|
args.push("--color", "always");
|
|
230
279
|
return await Promise.resolve(runProcess("cargo", ...args));
|
|
231
280
|
}
|
|
232
|
-
__name(cargoCommand, "cargoCommand");
|
|
233
281
|
function cargoCommandSync(args = "", options) {
|
|
234
282
|
const normalizedOptions = {
|
|
235
283
|
stdio: options?.stdio ?? "inherit",
|
|
@@ -256,7 +304,6 @@ function cargoCommandSync(args = "", options) {
|
|
|
256
304
|
};
|
|
257
305
|
}
|
|
258
306
|
}
|
|
259
|
-
__name(cargoCommandSync, "cargoCommandSync");
|
|
260
307
|
function cargoMetadata() {
|
|
261
308
|
const output3 = cargoCommandSync("metadata --format-version=1", {
|
|
262
309
|
stdio: "pipe"
|
|
@@ -267,15 +314,12 @@ function cargoMetadata() {
|
|
|
267
314
|
}
|
|
268
315
|
return JSON.parse(output3.output);
|
|
269
316
|
}
|
|
270
|
-
__name(cargoMetadata, "cargoMetadata");
|
|
271
317
|
function runProcess(processCmd, ...args) {
|
|
272
318
|
const metadata = cargoMetadata();
|
|
273
319
|
const targetDir = metadata?.target_directory ?? joinPathFragments(workspaceRoot, "dist", "cargo");
|
|
274
320
|
return new Promise((resolve) => {
|
|
275
321
|
if (process.env.VERCEL) {
|
|
276
|
-
return resolve({
|
|
277
|
-
success: true
|
|
278
|
-
});
|
|
322
|
+
return resolve({ success: true });
|
|
279
323
|
}
|
|
280
324
|
execSync(`${processCmd} ${args.join(" ")}`, {
|
|
281
325
|
cwd: process.cwd(),
|
|
@@ -286,113 +330,119 @@ function runProcess(processCmd, ...args) {
|
|
|
286
330
|
CARGO_BUILD_TARGET_DIR: targetDir
|
|
287
331
|
},
|
|
288
332
|
windowsHide: true,
|
|
289
|
-
stdio: [
|
|
290
|
-
"inherit",
|
|
291
|
-
"inherit",
|
|
292
|
-
"inherit"
|
|
293
|
-
]
|
|
294
|
-
});
|
|
295
|
-
resolve({
|
|
296
|
-
success: true
|
|
333
|
+
stdio: ["inherit", "inherit", "inherit"]
|
|
297
334
|
});
|
|
335
|
+
resolve({ success: true });
|
|
298
336
|
});
|
|
299
337
|
}
|
|
300
|
-
__name(runProcess, "runProcess");
|
|
301
338
|
|
|
302
339
|
// ../workspace-tools/src/executors/cargo-build/executor.ts
|
|
303
340
|
async function cargoBuildExecutor(options, context) {
|
|
304
341
|
const command = buildCargoCommand("build", options, context);
|
|
305
342
|
return await cargoCommand(...command);
|
|
306
343
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
options
|
|
314
|
-
|
|
315
|
-
|
|
344
|
+
var executor_default = withRunExecutor(
|
|
345
|
+
"Cargo Build",
|
|
346
|
+
cargoBuildExecutor,
|
|
347
|
+
{
|
|
348
|
+
skipReadingConfig: false,
|
|
349
|
+
hooks: {
|
|
350
|
+
applyDefaultOptions: (options) => {
|
|
351
|
+
options.outputPath ??= "dist/target/{projectRoot}";
|
|
352
|
+
options.toolchain ??= "stable";
|
|
353
|
+
return options;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
316
356
|
}
|
|
317
|
-
|
|
357
|
+
);
|
|
318
358
|
|
|
319
359
|
// ../workspace-tools/src/executors/cargo-check/executor.ts
|
|
320
360
|
async function cargoCheckExecutor(options, context) {
|
|
321
361
|
const command = buildCargoCommand("check", options, context);
|
|
322
362
|
return await cargoCommand(...command);
|
|
323
363
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
364
|
+
var executor_default2 = withRunExecutor(
|
|
365
|
+
"Cargo Check",
|
|
366
|
+
cargoCheckExecutor,
|
|
367
|
+
{
|
|
368
|
+
skipReadingConfig: false,
|
|
369
|
+
hooks: {
|
|
370
|
+
applyDefaultOptions: (options) => {
|
|
371
|
+
options.toolchain ??= "stable";
|
|
372
|
+
return options;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
332
375
|
}
|
|
333
|
-
|
|
376
|
+
);
|
|
334
377
|
|
|
335
378
|
// ../workspace-tools/src/executors/cargo-clippy/executor.ts
|
|
336
379
|
async function cargoClippyExecutor(options, context) {
|
|
337
380
|
const command = buildCargoCommand("clippy", options, context);
|
|
338
381
|
return await cargoCommand(...command);
|
|
339
382
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
options
|
|
347
|
-
|
|
348
|
-
|
|
383
|
+
var executor_default3 = withRunExecutor(
|
|
384
|
+
"Cargo Clippy",
|
|
385
|
+
cargoClippyExecutor,
|
|
386
|
+
{
|
|
387
|
+
skipReadingConfig: false,
|
|
388
|
+
hooks: {
|
|
389
|
+
applyDefaultOptions: (options) => {
|
|
390
|
+
options.toolchain ??= "stable";
|
|
391
|
+
options.fix ??= false;
|
|
392
|
+
return options;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
349
395
|
}
|
|
350
|
-
|
|
396
|
+
);
|
|
351
397
|
|
|
352
398
|
// ../workspace-tools/src/executors/cargo-doc/executor.ts
|
|
353
399
|
async function cargoDocExecutor(options, context) {
|
|
354
|
-
const opts = {
|
|
355
|
-
...options
|
|
356
|
-
};
|
|
400
|
+
const opts = { ...options };
|
|
357
401
|
opts["no-deps"] = opts.noDeps;
|
|
358
402
|
delete opts.noDeps;
|
|
359
403
|
const command = buildCargoCommand("doc", options, context);
|
|
360
404
|
return await cargoCommand(...command);
|
|
361
405
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
options
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
406
|
+
var executor_default4 = withRunExecutor(
|
|
407
|
+
"Cargo Doc",
|
|
408
|
+
cargoDocExecutor,
|
|
409
|
+
{
|
|
410
|
+
skipReadingConfig: false,
|
|
411
|
+
hooks: {
|
|
412
|
+
applyDefaultOptions: (options) => {
|
|
413
|
+
options.outputPath ??= "dist/docs/{projectRoot}";
|
|
414
|
+
options.toolchain ??= "stable";
|
|
415
|
+
options.release ??= options.profile ? false : true;
|
|
416
|
+
options.allFeatures ??= true;
|
|
417
|
+
options.lib ??= true;
|
|
418
|
+
options.bins ??= true;
|
|
419
|
+
options.examples ??= true;
|
|
420
|
+
options.noDeps ??= false;
|
|
421
|
+
return options;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
377
424
|
}
|
|
378
|
-
|
|
425
|
+
);
|
|
379
426
|
|
|
380
427
|
// ../workspace-tools/src/executors/cargo-format/executor.ts
|
|
381
428
|
async function cargoFormatExecutor(options, context) {
|
|
382
429
|
const command = buildCargoCommand("fmt", options, context);
|
|
383
430
|
return await cargoCommand(...command);
|
|
384
431
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
options
|
|
392
|
-
|
|
393
|
-
|
|
432
|
+
var executor_default5 = withRunExecutor(
|
|
433
|
+
"Cargo Format",
|
|
434
|
+
cargoFormatExecutor,
|
|
435
|
+
{
|
|
436
|
+
skipReadingConfig: false,
|
|
437
|
+
hooks: {
|
|
438
|
+
applyDefaultOptions: (options) => {
|
|
439
|
+
options.outputPath ??= "dist/target/{projectRoot}";
|
|
440
|
+
options.toolchain ??= "stable";
|
|
441
|
+
return options;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
394
444
|
}
|
|
395
|
-
|
|
445
|
+
);
|
|
396
446
|
|
|
397
447
|
// ../workspace-tools/src/executors/cargo-publish/executor.ts
|
|
398
448
|
import { joinPathFragments as joinPathFragments2 } from "@nx/devkit";
|
|
@@ -432,7 +482,7 @@ import { relative as relative2 } from "path";
|
|
|
432
482
|
import { CopyAssetsHandler } from "@nx/js/src/utils/assets/copy-assets-handler";
|
|
433
483
|
import { glob } from "glob";
|
|
434
484
|
import { readFile, writeFile } from "node:fs/promises";
|
|
435
|
-
var copyAssets =
|
|
485
|
+
var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
|
|
436
486
|
const pendingAssets = Array.from(assets ?? []);
|
|
437
487
|
pendingAssets.push({
|
|
438
488
|
input: projectRoot,
|
|
@@ -458,8 +508,11 @@ var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, proje
|
|
|
458
508
|
output: "src/"
|
|
459
509
|
});
|
|
460
510
|
}
|
|
461
|
-
writeTrace(
|
|
462
|
-
|
|
511
|
+
writeTrace(
|
|
512
|
+
`\u{1F4DD} Copying the following assets to the output directory:
|
|
513
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${joinPaths(outputPath, pendingAsset.output)}`).join("\n")}`,
|
|
514
|
+
config
|
|
515
|
+
);
|
|
463
516
|
const assetHandler = new CopyAssetsHandler({
|
|
464
517
|
projectDir: projectRoot,
|
|
465
518
|
rootDir: config.workspaceRoot,
|
|
@@ -468,28 +521,45 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
|
|
|
468
521
|
});
|
|
469
522
|
await assetHandler.processAllAssetsOnce();
|
|
470
523
|
if (includeSrc === true) {
|
|
471
|
-
writeDebug(
|
|
524
|
+
writeDebug(
|
|
525
|
+
`\u{1F4DD} Adding banner and writing source files: ${joinPaths(
|
|
526
|
+
outputPath,
|
|
527
|
+
"src"
|
|
528
|
+
)}`,
|
|
529
|
+
config
|
|
530
|
+
);
|
|
472
531
|
const files = await glob([
|
|
473
532
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
474
533
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
475
534
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
476
535
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
477
536
|
]);
|
|
478
|
-
await Promise.allSettled(
|
|
537
|
+
await Promise.allSettled(
|
|
538
|
+
files.map(
|
|
539
|
+
async (file) => writeFile(
|
|
540
|
+
file,
|
|
541
|
+
`${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
479
542
|
|
|
480
543
|
${await readFile(file, "utf8")}
|
|
481
544
|
|
|
482
|
-
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
|
|
545
|
+
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
|
|
546
|
+
)
|
|
547
|
+
)
|
|
548
|
+
);
|
|
483
549
|
}
|
|
484
|
-
}
|
|
550
|
+
};
|
|
485
551
|
|
|
486
552
|
// ../build-tools/src/utilities/generate-package-json.ts
|
|
487
553
|
import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
|
|
488
554
|
import { Glob } from "glob";
|
|
489
555
|
import { existsSync, readFileSync as readFileSync2 } from "node:fs";
|
|
490
556
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
491
|
-
import {
|
|
492
|
-
|
|
557
|
+
import {
|
|
558
|
+
createProjectGraphAsync,
|
|
559
|
+
readCachedProjectGraph,
|
|
560
|
+
readProjectsConfigurationFromProjectGraph
|
|
561
|
+
} from "nx/src/project-graph/project-graph";
|
|
562
|
+
var addPackageDependencies = async (workspaceRoot3, projectRoot, projectName, packageJson) => {
|
|
493
563
|
let projectGraph;
|
|
494
564
|
try {
|
|
495
565
|
projectGraph = readCachedProjectGraph();
|
|
@@ -498,16 +568,35 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot3, proje
|
|
|
498
568
|
projectGraph = readCachedProjectGraph();
|
|
499
569
|
}
|
|
500
570
|
if (!projectGraph) {
|
|
501
|
-
throw new Error(
|
|
571
|
+
throw new Error(
|
|
572
|
+
"The Build process failed because the project graph is not available. Please run the build command again."
|
|
573
|
+
);
|
|
502
574
|
}
|
|
503
|
-
const projectDependencies = calculateProjectBuildableDependencies(
|
|
575
|
+
const projectDependencies = calculateProjectBuildableDependencies(
|
|
576
|
+
void 0,
|
|
577
|
+
projectGraph,
|
|
578
|
+
workspaceRoot3,
|
|
579
|
+
projectName,
|
|
580
|
+
process.env.NX_TASK_TARGET_TARGET || "build",
|
|
581
|
+
process.env.NX_TASK_TARGET_CONFIGURATION || "production",
|
|
582
|
+
true
|
|
583
|
+
);
|
|
504
584
|
const localPackages = [];
|
|
505
|
-
for (const project of projectDependencies.dependencies.filter(
|
|
585
|
+
for (const project of projectDependencies.dependencies.filter(
|
|
586
|
+
(dep) => dep.node.type === "lib" && dep.node.data?.root !== projectRoot && dep.node.data?.root !== workspaceRoot3
|
|
587
|
+
)) {
|
|
506
588
|
const projectNode = project.node;
|
|
507
589
|
if (projectNode.data.root) {
|
|
508
|
-
const projectPackageJsonPath = joinPaths(
|
|
590
|
+
const projectPackageJsonPath = joinPaths(
|
|
591
|
+
workspaceRoot3,
|
|
592
|
+
projectNode.data.root,
|
|
593
|
+
"package.json"
|
|
594
|
+
);
|
|
509
595
|
if (existsSync(projectPackageJsonPath)) {
|
|
510
|
-
const projectPackageJsonContent = await readFile2(
|
|
596
|
+
const projectPackageJsonContent = await readFile2(
|
|
597
|
+
projectPackageJsonPath,
|
|
598
|
+
"utf8"
|
|
599
|
+
);
|
|
511
600
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
512
601
|
if (projectPackageJson.private !== true) {
|
|
513
602
|
localPackages.push(projectPackageJson);
|
|
@@ -516,19 +605,33 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot3, proje
|
|
|
516
605
|
}
|
|
517
606
|
}
|
|
518
607
|
if (localPackages.length > 0) {
|
|
519
|
-
writeTrace(
|
|
520
|
-
|
|
608
|
+
writeTrace(
|
|
609
|
+
`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`
|
|
610
|
+
);
|
|
611
|
+
const projectJsonFile = await readFile2(
|
|
612
|
+
joinPaths(projectRoot, "project.json"),
|
|
613
|
+
"utf8"
|
|
614
|
+
);
|
|
521
615
|
const projectJson = JSON.parse(projectJsonFile);
|
|
522
616
|
const projectName2 = projectJson.name;
|
|
523
617
|
const projectConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
|
|
524
618
|
if (!projectConfigurations?.projects?.[projectName2]) {
|
|
525
|
-
throw new Error(
|
|
619
|
+
throw new Error(
|
|
620
|
+
"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."
|
|
621
|
+
);
|
|
526
622
|
}
|
|
527
623
|
const implicitDependencies = projectConfigurations.projects?.[projectName2].implicitDependencies?.reduce((ret, dep) => {
|
|
528
624
|
if (projectConfigurations.projects?.[dep]) {
|
|
529
|
-
const depPackageJsonPath = joinPaths(
|
|
625
|
+
const depPackageJsonPath = joinPaths(
|
|
626
|
+
workspaceRoot3,
|
|
627
|
+
projectConfigurations.projects[dep].root,
|
|
628
|
+
"package.json"
|
|
629
|
+
);
|
|
530
630
|
if (existsSync(depPackageJsonPath)) {
|
|
531
|
-
const depPackageJsonContent = readFileSync2(
|
|
631
|
+
const depPackageJsonContent = readFileSync2(
|
|
632
|
+
depPackageJsonPath,
|
|
633
|
+
"utf8"
|
|
634
|
+
);
|
|
532
635
|
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
533
636
|
if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
|
|
534
637
|
ret.push(depPackageJson.name);
|
|
@@ -553,10 +656,13 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot3, proje
|
|
|
553
656
|
writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
|
|
554
657
|
}
|
|
555
658
|
return packageJson;
|
|
556
|
-
}
|
|
557
|
-
var addWorkspacePackageJsonFields =
|
|
659
|
+
};
|
|
660
|
+
var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
558
661
|
const workspaceRoot3 = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : findWorkspaceRoot();
|
|
559
|
-
const workspacePackageJsonContent = await readFile2(
|
|
662
|
+
const workspacePackageJsonContent = await readFile2(
|
|
663
|
+
joinPaths(workspaceRoot3, "package.json"),
|
|
664
|
+
"utf8"
|
|
665
|
+
);
|
|
560
666
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
561
667
|
packageJson.type ??= "module";
|
|
562
668
|
packageJson.sideEffects ??= false;
|
|
@@ -567,9 +673,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (workspaceConfi
|
|
|
567
673
|
}
|
|
568
674
|
packageJson.source ??= `${joinPaths(distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
569
675
|
}
|
|
570
|
-
packageJson.files ??= [
|
|
571
|
-
"dist/**/*"
|
|
572
|
-
];
|
|
676
|
+
packageJson.files ??= ["dist/**/*"];
|
|
573
677
|
if (includeSrc === true && !packageJson.files.includes("src")) {
|
|
574
678
|
packageJson.files.push("src/**/*");
|
|
575
679
|
}
|
|
@@ -585,26 +689,22 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (workspaceConfi
|
|
|
585
689
|
packageJson.author ??= workspacePackageJson.author;
|
|
586
690
|
packageJson.maintainers ??= workspacePackageJson.maintainers;
|
|
587
691
|
if (!packageJson.maintainers && packageJson.author) {
|
|
588
|
-
packageJson.maintainers = [
|
|
589
|
-
packageJson.author
|
|
590
|
-
];
|
|
692
|
+
packageJson.maintainers = [packageJson.author];
|
|
591
693
|
}
|
|
592
694
|
packageJson.contributors ??= workspacePackageJson.contributors;
|
|
593
695
|
if (!packageJson.contributors && packageJson.author) {
|
|
594
|
-
packageJson.contributors = [
|
|
595
|
-
packageJson.author
|
|
596
|
-
];
|
|
696
|
+
packageJson.contributors = [packageJson.author];
|
|
597
697
|
}
|
|
598
698
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
599
699
|
packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
|
|
600
700
|
return packageJson;
|
|
601
|
-
}
|
|
701
|
+
};
|
|
602
702
|
|
|
603
703
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
604
704
|
import { glob as glob2 } from "glob";
|
|
605
705
|
|
|
606
706
|
// ../build-tools/src/utilities/get-env.ts
|
|
607
|
-
var getEnv =
|
|
707
|
+
var getEnv = (builder, options) => {
|
|
608
708
|
return {
|
|
609
709
|
STORM_BUILD: builder,
|
|
610
710
|
STORM_ORG: options.orgName || DEFAULT_ORGANIZATION,
|
|
@@ -615,39 +715,51 @@ var getEnv = /* @__PURE__ */ __name((builder, options) => {
|
|
|
615
715
|
STORM_TARGET: JSON.stringify(options.target),
|
|
616
716
|
...options.env
|
|
617
717
|
};
|
|
618
|
-
}
|
|
718
|
+
};
|
|
619
719
|
|
|
620
720
|
// ../build-tools/src/utilities/read-nx-config.ts
|
|
621
721
|
import { existsSync as existsSync2 } from "node:fs";
|
|
622
722
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
623
723
|
|
|
624
724
|
// ../build-tools/src/utilities/task-graph.ts
|
|
625
|
-
import {
|
|
725
|
+
import {
|
|
726
|
+
createTaskGraph,
|
|
727
|
+
mapTargetDefaultsToDependencies
|
|
728
|
+
} from "nx/src/tasks-runner/create-task-graph";
|
|
626
729
|
|
|
627
730
|
// ../esbuild/src/assets.ts
|
|
628
731
|
async function copyBuildAssets(context) {
|
|
629
732
|
if (context.result?.errors.length === 0) {
|
|
630
|
-
writeDebug(
|
|
733
|
+
writeDebug(
|
|
734
|
+
` \u{1F4CB} Copying asset files to output directory: ${context.outputPath}`,
|
|
735
|
+
context.workspaceConfig
|
|
736
|
+
);
|
|
631
737
|
const stopwatch = getStopwatch(`${context.options.name} asset copy`);
|
|
632
|
-
await copyAssets(
|
|
738
|
+
await copyAssets(
|
|
739
|
+
context.workspaceConfig,
|
|
740
|
+
context.options.assets ?? [],
|
|
741
|
+
context.outputPath,
|
|
742
|
+
context.options.projectRoot,
|
|
743
|
+
context.sourceRoot,
|
|
744
|
+
true,
|
|
745
|
+
false
|
|
746
|
+
);
|
|
633
747
|
stopwatch();
|
|
634
748
|
}
|
|
635
749
|
return context;
|
|
636
750
|
}
|
|
637
|
-
__name(copyBuildAssets, "copyBuildAssets");
|
|
638
751
|
|
|
639
752
|
// ../esbuild/src/clean.ts
|
|
640
753
|
import { rm } from "node:fs/promises";
|
|
641
754
|
async function cleanDirectories(directory) {
|
|
642
|
-
await rm(directory, {
|
|
643
|
-
recursive: true,
|
|
644
|
-
force: true
|
|
645
|
-
});
|
|
755
|
+
await rm(directory, { recursive: true, force: true });
|
|
646
756
|
}
|
|
647
|
-
__name(cleanDirectories, "cleanDirectories");
|
|
648
757
|
|
|
649
758
|
// ../esbuild/src/context.ts
|
|
650
|
-
import {
|
|
759
|
+
import {
|
|
760
|
+
createProjectGraphAsync as createProjectGraphAsync2,
|
|
761
|
+
readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph2
|
|
762
|
+
} from "@nx/devkit";
|
|
651
763
|
import defu2 from "defu";
|
|
652
764
|
import { existsSync as existsSync3 } from "node:fs";
|
|
653
765
|
import hf from "node:fs/promises";
|
|
@@ -698,50 +810,6 @@ var DEFAULT_BUILD_OPTIONS = {
|
|
|
698
810
|
}
|
|
699
811
|
};
|
|
700
812
|
|
|
701
|
-
// ../esbuild/src/plugins/resolve-paths.ts
|
|
702
|
-
import path2 from "node:path";
|
|
703
|
-
function resolvePathsConfig(options, cwd, projectRoot) {
|
|
704
|
-
if (options?.compilerOptions?.paths) {
|
|
705
|
-
const paths = Object.entries(options.compilerOptions.paths);
|
|
706
|
-
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
707
|
-
return [
|
|
708
|
-
key,
|
|
709
|
-
paths2.map((v) => path2.resolve(cwd, v))
|
|
710
|
-
];
|
|
711
|
-
});
|
|
712
|
-
return Object.fromEntries(resolvedPaths);
|
|
713
|
-
}
|
|
714
|
-
if (options.extends) {
|
|
715
|
-
const extendsPath = path2.resolve(projectRoot ? joinPaths(cwd, projectRoot, options.extends) : joinPaths(cwd, options.extends));
|
|
716
|
-
const extendsDir = path2.dirname(extendsPath);
|
|
717
|
-
const extendsConfig = __require(extendsPath);
|
|
718
|
-
return resolvePathsConfig(extendsConfig, extendsDir);
|
|
719
|
-
}
|
|
720
|
-
return [];
|
|
721
|
-
}
|
|
722
|
-
__name(resolvePathsConfig, "resolvePathsConfig");
|
|
723
|
-
var resolvePathsPlugin = /* @__PURE__ */ __name((context) => ({
|
|
724
|
-
name: "storm:resolve-paths",
|
|
725
|
-
setup(build3) {
|
|
726
|
-
const parentTsConfig = build3.initialOptions.tsconfig ? __require(joinPaths(context.workspaceConfig.workspaceRoot, build3.initialOptions.tsconfig.replace(context.workspaceConfig.workspaceRoot, ""))) : __require(joinPaths(context.workspaceConfig.workspaceRoot, "tsconfig.json"));
|
|
727
|
-
const resolvedTsPaths = resolvePathsConfig(parentTsConfig, context.workspaceConfig.workspaceRoot, context.options.projectRoot);
|
|
728
|
-
const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
|
|
729
|
-
build3.onResolve({
|
|
730
|
-
filter: packagesRegex
|
|
731
|
-
}, (args) => {
|
|
732
|
-
if (build3.initialOptions.external?.includes(args.path)) {
|
|
733
|
-
return {
|
|
734
|
-
path: args.path,
|
|
735
|
-
external: true
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
return {
|
|
739
|
-
path: `${resolvedTsPaths[args.path][0]}/index.ts`
|
|
740
|
-
};
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
}), "resolvePathsPlugin");
|
|
744
|
-
|
|
745
813
|
// ../esbuild/src/context.ts
|
|
746
814
|
async function resolveContext(userOptions) {
|
|
747
815
|
const projectRoot = userOptions.projectRoot;
|
|
@@ -757,7 +825,11 @@ async function resolveContext(userOptions) {
|
|
|
757
825
|
const projectGraph = await createProjectGraphAsync2({
|
|
758
826
|
exitOnError: true
|
|
759
827
|
});
|
|
760
|
-
const projectJsonPath = joinPaths(
|
|
828
|
+
const projectJsonPath = joinPaths(
|
|
829
|
+
workspaceRoot3.dir,
|
|
830
|
+
projectRoot,
|
|
831
|
+
"project.json"
|
|
832
|
+
);
|
|
761
833
|
if (!existsSync3(projectJsonPath)) {
|
|
762
834
|
throw new Error("Cannot find project.json configuration");
|
|
763
835
|
}
|
|
@@ -766,11 +838,17 @@ async function resolveContext(userOptions) {
|
|
|
766
838
|
const projectName = projectJson.name || userOptions.name;
|
|
767
839
|
const projectConfigurations = readProjectsConfigurationFromProjectGraph2(projectGraph);
|
|
768
840
|
if (!projectConfigurations?.projects?.[projectName]) {
|
|
769
|
-
throw new Error(
|
|
841
|
+
throw new Error(
|
|
842
|
+
"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."
|
|
843
|
+
);
|
|
770
844
|
}
|
|
771
845
|
const options = defu2(userOptions, DEFAULT_BUILD_OPTIONS);
|
|
772
846
|
options.name ??= projectName;
|
|
773
|
-
const packageJsonPath = joinPaths(
|
|
847
|
+
const packageJsonPath = joinPaths(
|
|
848
|
+
workspaceRoot3.dir,
|
|
849
|
+
options.projectRoot,
|
|
850
|
+
"package.json"
|
|
851
|
+
);
|
|
774
852
|
if (!existsSync3(packageJsonPath)) {
|
|
775
853
|
throw new Error("Cannot find package.json configuration");
|
|
776
854
|
}
|
|
@@ -804,16 +882,16 @@ async function resolveContext(userOptions) {
|
|
|
804
882
|
projectName,
|
|
805
883
|
projectGraph,
|
|
806
884
|
sourceRoot: resolvedOptions.sourceRoot || projectJson.sourceRoot || joinPaths(resolvedOptions.projectRoot, "src"),
|
|
807
|
-
outputPath: resolvedOptions.outputPath || joinPaths(
|
|
885
|
+
outputPath: resolvedOptions.outputPath || joinPaths(
|
|
886
|
+
workspaceConfig.workspaceRoot,
|
|
887
|
+
"dist",
|
|
888
|
+
resolvedOptions.projectRoot
|
|
889
|
+
),
|
|
808
890
|
minify: resolvedOptions.minify || resolvedOptions.mode === "production"
|
|
809
891
|
};
|
|
810
|
-
context.options.esbuildPlugins = [
|
|
811
|
-
resolvePathsPlugin(context),
|
|
812
|
-
...context.options.esbuildPlugins ?? []
|
|
813
|
-
];
|
|
892
|
+
context.options.esbuildPlugins = [...context.options.esbuildPlugins ?? []];
|
|
814
893
|
return context;
|
|
815
894
|
}
|
|
816
|
-
__name(resolveContext, "resolveContext");
|
|
817
895
|
|
|
818
896
|
// ../esbuild/src/package-json.ts
|
|
819
897
|
import { writeJsonFile } from "@nx/devkit";
|
|
@@ -823,17 +901,39 @@ async function generatePackageJson(context) {
|
|
|
823
901
|
if (context.options.generatePackageJson !== false && existsSync4(joinPaths(context.options.projectRoot, "package.json"))) {
|
|
824
902
|
writeDebug(" \u270D\uFE0F Writing package.json file", context.workspaceConfig);
|
|
825
903
|
const stopwatch = getStopwatch("Write package.json file");
|
|
826
|
-
const packageJsonPath = joinPaths(
|
|
904
|
+
const packageJsonPath = joinPaths(
|
|
905
|
+
context.options.projectRoot,
|
|
906
|
+
"project.json"
|
|
907
|
+
);
|
|
827
908
|
if (!existsSync4(packageJsonPath)) {
|
|
828
909
|
throw new Error("Cannot find package.json configuration");
|
|
829
910
|
}
|
|
830
|
-
const packageJsonFile = await hf2.readFile(
|
|
911
|
+
const packageJsonFile = await hf2.readFile(
|
|
912
|
+
joinPaths(
|
|
913
|
+
context.workspaceConfig.workspaceRoot,
|
|
914
|
+
context.options.projectRoot,
|
|
915
|
+
"package.json"
|
|
916
|
+
),
|
|
917
|
+
"utf8"
|
|
918
|
+
);
|
|
831
919
|
let packageJson = JSON.parse(packageJsonFile);
|
|
832
920
|
if (!packageJson) {
|
|
833
921
|
throw new Error("Cannot find package.json configuration file");
|
|
834
922
|
}
|
|
835
|
-
packageJson = await addPackageDependencies(
|
|
836
|
-
|
|
923
|
+
packageJson = await addPackageDependencies(
|
|
924
|
+
context.workspaceConfig.workspaceRoot,
|
|
925
|
+
context.options.projectRoot,
|
|
926
|
+
context.projectName,
|
|
927
|
+
packageJson
|
|
928
|
+
);
|
|
929
|
+
packageJson = await addWorkspacePackageJsonFields(
|
|
930
|
+
context.workspaceConfig,
|
|
931
|
+
context.options.projectRoot,
|
|
932
|
+
context.sourceRoot,
|
|
933
|
+
context.projectName,
|
|
934
|
+
false,
|
|
935
|
+
packageJson
|
|
936
|
+
);
|
|
837
937
|
if (context.options.entry) {
|
|
838
938
|
packageJson.exports ??= {};
|
|
839
939
|
packageJson.exports["./package.json"] ??= "./package.json";
|
|
@@ -903,24 +1003,29 @@ async function generatePackageJson(context) {
|
|
|
903
1003
|
if (isDts) {
|
|
904
1004
|
packageJson.types = `${defaultEntry}.d.${isEsm ? "mts" : isCjs ? "cts" : "ts"}`;
|
|
905
1005
|
}
|
|
906
|
-
packageJson.exports = Object.keys(packageJson.exports).reduce(
|
|
907
|
-
|
|
908
|
-
ret[key.replace("/index", "")]
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
1006
|
+
packageJson.exports = Object.keys(packageJson.exports).reduce(
|
|
1007
|
+
(ret, key) => {
|
|
1008
|
+
if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
|
|
1009
|
+
ret[key.replace("/index", "")] = packageJson.exports[key];
|
|
1010
|
+
}
|
|
1011
|
+
return ret;
|
|
1012
|
+
},
|
|
1013
|
+
packageJson.exports
|
|
1014
|
+
);
|
|
912
1015
|
}
|
|
913
1016
|
}
|
|
914
|
-
await writeJsonFile(
|
|
1017
|
+
await writeJsonFile(
|
|
1018
|
+
joinPaths(context.outputPath, "package.json"),
|
|
1019
|
+
packageJson
|
|
1020
|
+
);
|
|
915
1021
|
stopwatch();
|
|
916
1022
|
}
|
|
917
1023
|
return context;
|
|
918
1024
|
}
|
|
919
|
-
__name(generatePackageJson, "generatePackageJson");
|
|
920
1025
|
|
|
921
1026
|
// ../esbuild/src/plugins/deps-check.ts
|
|
922
1027
|
import { builtinModules as builtinModules2 } from "node:module";
|
|
923
|
-
import
|
|
1028
|
+
import path2 from "node:path";
|
|
924
1029
|
var unusedIgnore = [
|
|
925
1030
|
// these are our dev dependencies
|
|
926
1031
|
/@types\/.*?/,
|
|
@@ -945,15 +1050,11 @@ var unusedIgnore = [
|
|
|
945
1050
|
// these are indirectly used by build
|
|
946
1051
|
"buffer"
|
|
947
1052
|
];
|
|
948
|
-
var missingIgnore = [
|
|
949
|
-
|
|
950
|
-
"@prisma/client",
|
|
951
|
-
"ts-toolbelt"
|
|
952
|
-
];
|
|
953
|
-
var depsCheckPlugin = /* @__PURE__ */ __name((bundle) => ({
|
|
1053
|
+
var missingIgnore = [".prisma", "@prisma/client", "ts-toolbelt"];
|
|
1054
|
+
var depsCheckPlugin = (bundle) => ({
|
|
954
1055
|
name: "storm:deps-check",
|
|
955
1056
|
setup(build3) {
|
|
956
|
-
const pkgJsonPath =
|
|
1057
|
+
const pkgJsonPath = path2.join(process.cwd(), "package.json");
|
|
957
1058
|
const pkgContents = __require(pkgJsonPath);
|
|
958
1059
|
const regDependencies = Object.keys(pkgContents["dependencies"] ?? {});
|
|
959
1060
|
const devDependencies = Object.keys(pkgContents["devDependencies"] ?? {});
|
|
@@ -964,9 +1065,7 @@ var depsCheckPlugin = /* @__PURE__ */ __name((bundle) => ({
|
|
|
964
1065
|
];
|
|
965
1066
|
const collectedDependencies = /* @__PURE__ */ new Set();
|
|
966
1067
|
const onlyPackages = /^[^./](?!:)|^\.[^./]|^\.\.[^/]/;
|
|
967
|
-
build3.onResolve({
|
|
968
|
-
filter: onlyPackages
|
|
969
|
-
}, (args) => {
|
|
1068
|
+
build3.onResolve({ filter: onlyPackages }, (args) => {
|
|
970
1069
|
if (args.importer.includes(process.cwd())) {
|
|
971
1070
|
if (args.path[0] === "@") {
|
|
972
1071
|
const [org, pkg] = args.path.split("/");
|
|
@@ -976,19 +1075,13 @@ var depsCheckPlugin = /* @__PURE__ */ __name((bundle) => ({
|
|
|
976
1075
|
collectedDependencies.add(pkg);
|
|
977
1076
|
}
|
|
978
1077
|
}
|
|
979
|
-
return {
|
|
980
|
-
external: true
|
|
981
|
-
};
|
|
1078
|
+
return { external: true };
|
|
982
1079
|
});
|
|
983
1080
|
build3.onEnd(() => {
|
|
984
|
-
const unusedDependencies = [
|
|
985
|
-
...dependencies
|
|
986
|
-
].filter((dep) => {
|
|
1081
|
+
const unusedDependencies = [...dependencies].filter((dep) => {
|
|
987
1082
|
return !collectedDependencies.has(dep) || builtinModules2.includes(dep);
|
|
988
1083
|
});
|
|
989
|
-
const missingDependencies = [
|
|
990
|
-
...collectedDependencies
|
|
991
|
-
].filter((dep) => {
|
|
1084
|
+
const missingDependencies = [...collectedDependencies].filter((dep) => {
|
|
992
1085
|
return !dependencies.includes(dep) && !builtinModules2.includes(dep);
|
|
993
1086
|
});
|
|
994
1087
|
const filteredUnusedDeps = unusedDependencies.filter((dep) => {
|
|
@@ -997,8 +1090,12 @@ var depsCheckPlugin = /* @__PURE__ */ __name((bundle) => ({
|
|
|
997
1090
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
998
1091
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
999
1092
|
});
|
|
1000
|
-
writeWarning(
|
|
1001
|
-
|
|
1093
|
+
writeWarning(
|
|
1094
|
+
`Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`
|
|
1095
|
+
);
|
|
1096
|
+
writeError(
|
|
1097
|
+
`Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`
|
|
1098
|
+
);
|
|
1002
1099
|
if (filteredMissingDeps.length > 0) {
|
|
1003
1100
|
throw new Error(`Missing dependencies detected - please install them:
|
|
1004
1101
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -1006,12 +1103,15 @@ ${JSON.stringify(filteredMissingDeps)}
|
|
|
1006
1103
|
}
|
|
1007
1104
|
});
|
|
1008
1105
|
}
|
|
1009
|
-
})
|
|
1106
|
+
});
|
|
1010
1107
|
|
|
1011
1108
|
// ../esbuild/src/tsup.ts
|
|
1012
1109
|
import { build as tsup } from "tsup";
|
|
1013
1110
|
async function executeTsup(context) {
|
|
1014
|
-
writeDebug(
|
|
1111
|
+
writeDebug(
|
|
1112
|
+
` \u{1F680} Running ${context.options.name} build`,
|
|
1113
|
+
context.workspaceConfig
|
|
1114
|
+
);
|
|
1015
1115
|
const stopwatch = getStopwatch(`${context.options.name} build`);
|
|
1016
1116
|
await tsup({
|
|
1017
1117
|
...context.options,
|
|
@@ -1021,21 +1121,30 @@ async function executeTsup(context) {
|
|
|
1021
1121
|
stopwatch();
|
|
1022
1122
|
return context;
|
|
1023
1123
|
}
|
|
1024
|
-
__name(executeTsup, "executeTsup");
|
|
1025
1124
|
|
|
1026
1125
|
// ../esbuild/src/build.ts
|
|
1027
1126
|
async function reportResults(context) {
|
|
1028
1127
|
if (context.result?.errors.length === 0) {
|
|
1029
1128
|
if (context.result.warnings.length > 0) {
|
|
1030
|
-
writeWarning(
|
|
1031
|
-
|
|
1032
|
-
|
|
1129
|
+
writeWarning(
|
|
1130
|
+
` \u{1F6A7} The following warnings occurred during the build: ${context.result.warnings.map((warning) => warning.text).join("\n")}`,
|
|
1131
|
+
context.workspaceConfig
|
|
1132
|
+
);
|
|
1133
|
+
}
|
|
1134
|
+
writeSuccess(
|
|
1135
|
+
` \u{1F4E6} The ${context.options.name} build completed successfully`,
|
|
1136
|
+
context.workspaceConfig
|
|
1137
|
+
);
|
|
1033
1138
|
} else if (context.result?.errors && context.result?.errors.length > 0) {
|
|
1034
|
-
writeError(
|
|
1035
|
-
|
|
1139
|
+
writeError(
|
|
1140
|
+
` \u274C The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`,
|
|
1141
|
+
context.workspaceConfig
|
|
1142
|
+
);
|
|
1143
|
+
throw new Error(
|
|
1144
|
+
`The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`
|
|
1145
|
+
);
|
|
1036
1146
|
}
|
|
1037
1147
|
}
|
|
1038
|
-
__name(reportResults, "reportResults");
|
|
1039
1148
|
async function dependencyCheck(options) {
|
|
1040
1149
|
if (process.env.DEV === "true") {
|
|
1041
1150
|
return void 0;
|
|
@@ -1046,43 +1155,39 @@ async function dependencyCheck(options) {
|
|
|
1046
1155
|
const buildPromise = esbuild.build({
|
|
1047
1156
|
entryPoints: globbySync("**/*.{j,t}s", {
|
|
1048
1157
|
// We don't check dependencies in ecosystem tests because tests are isolated from the build.
|
|
1049
|
-
ignore: [
|
|
1050
|
-
"./src/__tests__/**/*",
|
|
1051
|
-
"./tests/e2e/**/*",
|
|
1052
|
-
"./dist/**/*"
|
|
1053
|
-
],
|
|
1158
|
+
ignore: ["./src/__tests__/**/*", "./tests/e2e/**/*", "./dist/**/*"],
|
|
1054
1159
|
gitignore: true
|
|
1055
1160
|
}),
|
|
1056
1161
|
logLevel: "silent",
|
|
1162
|
+
// there will be errors
|
|
1057
1163
|
bundle: true,
|
|
1164
|
+
// we bundle to get everything
|
|
1058
1165
|
write: false,
|
|
1166
|
+
// no need to write for analysis
|
|
1059
1167
|
outdir: "out",
|
|
1060
|
-
plugins: [
|
|
1061
|
-
depsCheckPlugin(options.bundle)
|
|
1062
|
-
]
|
|
1168
|
+
plugins: [depsCheckPlugin(options.bundle)]
|
|
1063
1169
|
});
|
|
1064
1170
|
await buildPromise.catch(() => {
|
|
1065
1171
|
});
|
|
1066
1172
|
return void 0;
|
|
1067
1173
|
}
|
|
1068
|
-
__name(dependencyCheck, "dependencyCheck");
|
|
1069
1174
|
async function cleanOutputPath(context) {
|
|
1070
1175
|
if (context.clean !== false && context.outputPath) {
|
|
1071
|
-
writeDebug(
|
|
1176
|
+
writeDebug(
|
|
1177
|
+
` \u{1F9F9} Cleaning ${context.options.name} output path: ${context.outputPath}`,
|
|
1178
|
+
context.workspaceConfig
|
|
1179
|
+
);
|
|
1072
1180
|
const stopwatch = getStopwatch(`${context.options.name} output clean`);
|
|
1073
1181
|
await cleanDirectories(context.outputPath);
|
|
1074
1182
|
stopwatch();
|
|
1075
1183
|
}
|
|
1076
1184
|
return context;
|
|
1077
1185
|
}
|
|
1078
|
-
__name(cleanOutputPath, "cleanOutputPath");
|
|
1079
1186
|
async function build2(options) {
|
|
1080
1187
|
writeDebug(` \u26A1 Executing Storm ESBuild pipeline`);
|
|
1081
1188
|
const stopwatch = getStopwatch("ESBuild pipeline");
|
|
1082
1189
|
try {
|
|
1083
|
-
const opts = Array.isArray(options) ? options : [
|
|
1084
|
-
options
|
|
1085
|
-
];
|
|
1190
|
+
const opts = Array.isArray(options) ? options : [options];
|
|
1086
1191
|
if (opts.length === 0) {
|
|
1087
1192
|
throw new Error("No build options were provided");
|
|
1088
1193
|
}
|
|
@@ -1097,19 +1202,22 @@ async function build2(options) {
|
|
|
1097
1202
|
await reportResults(context);
|
|
1098
1203
|
writeSuccess(" \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
1099
1204
|
} catch (error) {
|
|
1100
|
-
writeFatal(
|
|
1205
|
+
writeFatal(
|
|
1206
|
+
"Fatal errors that the build process could not recover from have occured. The build process has been terminated."
|
|
1207
|
+
);
|
|
1101
1208
|
throw error;
|
|
1102
1209
|
} finally {
|
|
1103
1210
|
stopwatch();
|
|
1104
1211
|
}
|
|
1105
1212
|
}
|
|
1106
|
-
__name(build2, "build");
|
|
1107
1213
|
|
|
1108
1214
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
1109
1215
|
async function esbuildExecutorFn(options, context, config) {
|
|
1110
1216
|
writeInfo("\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
1111
1217
|
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !context.projectsConfigurations.projects[context.projectName]?.root) {
|
|
1112
|
-
throw new Error(
|
|
1218
|
+
throw new Error(
|
|
1219
|
+
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
1220
|
+
);
|
|
1113
1221
|
}
|
|
1114
1222
|
await build2({
|
|
1115
1223
|
...options,
|
|
@@ -1123,20 +1231,21 @@ async function esbuildExecutorFn(options, context, config) {
|
|
|
1123
1231
|
success: true
|
|
1124
1232
|
};
|
|
1125
1233
|
}
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1234
|
+
var executor_default6 = withRunExecutor(
|
|
1235
|
+
"Storm ESBuild build",
|
|
1236
|
+
esbuildExecutorFn,
|
|
1237
|
+
{
|
|
1238
|
+
skipReadingConfig: false,
|
|
1239
|
+
hooks: {
|
|
1240
|
+
applyDefaultOptions: async (options, config) => {
|
|
1241
|
+
options.entry ??= ["src/index.ts"];
|
|
1242
|
+
options.outputPath ??= "dist/{projectRoot}";
|
|
1243
|
+
options.tsconfig ??= "{projectRoot}/tsconfig.json";
|
|
1244
|
+
return options;
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1138
1247
|
}
|
|
1139
|
-
|
|
1248
|
+
);
|
|
1140
1249
|
|
|
1141
1250
|
// ../workspace-tools/src/executors/npm-publish/executor.ts
|
|
1142
1251
|
import { execSync as execSync3 } from "node:child_process";
|
|
@@ -1159,31 +1268,38 @@ import filePlugin from "@size-limit/file";
|
|
|
1159
1268
|
import sizeLimit from "size-limit";
|
|
1160
1269
|
async function sizeLimitExecutorFn(options, context, config) {
|
|
1161
1270
|
if (!context?.projectName || !context.projectsConfigurations?.projects || !context.projectsConfigurations.projects[context.projectName]) {
|
|
1162
|
-
throw new Error(
|
|
1271
|
+
throw new Error(
|
|
1272
|
+
"The Size-Limit process failed because the context is not valid. Please run this command from a workspace."
|
|
1273
|
+
);
|
|
1163
1274
|
}
|
|
1164
1275
|
writeInfo(`\u{1F4CF} Running Size-Limit on ${context.projectName}`, config);
|
|
1165
|
-
sizeLimit([
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
checks: options.entry ?? context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? joinPathFragments3(context.projectsConfigurations.projects[context.projectName]?.root ?? "./", "src")
|
|
1276
|
+
sizeLimit([filePlugin, esBuildPlugin, esBuildWhyPlugin], {
|
|
1277
|
+
checks: options.entry ?? context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? joinPathFragments3(
|
|
1278
|
+
context.projectsConfigurations.projects[context.projectName]?.root ?? "./",
|
|
1279
|
+
"src"
|
|
1280
|
+
)
|
|
1171
1281
|
}).then((result) => {
|
|
1172
|
-
writeInfo(
|
|
1282
|
+
writeInfo(
|
|
1283
|
+
`\u{1F4CF} ${context.projectName} Size-Limit result: ${JSON.stringify(result)}`,
|
|
1284
|
+
config
|
|
1285
|
+
);
|
|
1173
1286
|
});
|
|
1174
1287
|
return {
|
|
1175
1288
|
success: true
|
|
1176
1289
|
};
|
|
1177
1290
|
}
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1291
|
+
var executor_default7 = withRunExecutor(
|
|
1292
|
+
"Size-Limit Performance Test Executor",
|
|
1293
|
+
sizeLimitExecutorFn,
|
|
1294
|
+
{
|
|
1295
|
+
skipReadingConfig: false,
|
|
1296
|
+
hooks: {
|
|
1297
|
+
applyDefaultOptions: (options) => {
|
|
1298
|
+
return options;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1185
1301
|
}
|
|
1186
|
-
|
|
1302
|
+
);
|
|
1187
1303
|
|
|
1188
1304
|
// ../workspace-tools/src/executors/typia/executor.ts
|
|
1189
1305
|
import { removeSync } from "fs-extra";
|
|
@@ -1193,33 +1309,36 @@ async function typiaExecutorFn(options, _, config) {
|
|
|
1193
1309
|
writeInfo(`\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
|
|
1194
1310
|
removeSync(options.outputPath);
|
|
1195
1311
|
}
|
|
1196
|
-
await Promise.all(
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1312
|
+
await Promise.all(
|
|
1313
|
+
options.entry.map((entry) => {
|
|
1314
|
+
writeInfo(`\u{1F680} Running Typia on entry: ${entry}`, config);
|
|
1315
|
+
return TypiaProgrammer.build({
|
|
1316
|
+
input: entry,
|
|
1317
|
+
output: options.outputPath,
|
|
1318
|
+
project: options.tsconfig
|
|
1319
|
+
});
|
|
1320
|
+
})
|
|
1321
|
+
);
|
|
1204
1322
|
return {
|
|
1205
1323
|
success: true
|
|
1206
1324
|
};
|
|
1207
1325
|
}
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1326
|
+
var executor_default8 = withRunExecutor(
|
|
1327
|
+
"Typia runtime validation generator",
|
|
1328
|
+
typiaExecutorFn,
|
|
1329
|
+
{
|
|
1330
|
+
skipReadingConfig: false,
|
|
1331
|
+
hooks: {
|
|
1332
|
+
applyDefaultOptions: (options) => {
|
|
1333
|
+
options.entry ??= ["{sourceRoot}/index.ts"];
|
|
1334
|
+
options.outputPath ??= "{sourceRoot}/__generated__/typia";
|
|
1335
|
+
options.tsconfig ??= "{projectRoot}/tsconfig.json";
|
|
1336
|
+
options.clean ??= true;
|
|
1337
|
+
return options;
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1221
1340
|
}
|
|
1222
|
-
|
|
1341
|
+
);
|
|
1223
1342
|
|
|
1224
1343
|
// ../workspace-tools/src/executors/unbuild/executor.ts
|
|
1225
1344
|
import { defu as defu3 } from "defu";
|
|
@@ -1227,74 +1346,101 @@ import { createJiti } from "jiti";
|
|
|
1227
1346
|
async function unbuildExecutorFn(options, context, config) {
|
|
1228
1347
|
writeInfo("\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
1229
1348
|
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
1230
|
-
throw new Error(
|
|
1349
|
+
throw new Error(
|
|
1350
|
+
"The Build process failed because the context is not valid. Please run this command from a workspace root directory."
|
|
1351
|
+
);
|
|
1231
1352
|
}
|
|
1232
1353
|
if (!context.projectsConfigurations.projects[context.projectName].root) {
|
|
1233
|
-
throw new Error(
|
|
1354
|
+
throw new Error(
|
|
1355
|
+
"The Build process failed because the project root is not valid. Please run this command from a workspace root directory."
|
|
1356
|
+
);
|
|
1234
1357
|
}
|
|
1235
1358
|
if (!context.projectsConfigurations.projects[context.projectName].sourceRoot) {
|
|
1236
|
-
throw new Error(
|
|
1359
|
+
throw new Error(
|
|
1360
|
+
"The Build process failed because the project's source root is not valid. Please run this command from a workspace root directory."
|
|
1361
|
+
);
|
|
1237
1362
|
}
|
|
1238
1363
|
const jiti = createJiti(config.workspaceRoot, {
|
|
1239
|
-
fsCache: config.skipCache ? false : joinPaths(
|
|
1364
|
+
fsCache: config.skipCache ? false : joinPaths(
|
|
1365
|
+
config.workspaceRoot,
|
|
1366
|
+
config.directories.cache || "node_modules/.cache/storm",
|
|
1367
|
+
"jiti"
|
|
1368
|
+
),
|
|
1240
1369
|
interopDefault: true
|
|
1241
1370
|
});
|
|
1242
|
-
const stormUnbuild = await jiti.import(
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
}
|
|
1254
|
-
},
|
|
1255
|
-
rollup: {
|
|
1256
|
-
emitCJS: true,
|
|
1257
|
-
watch: false,
|
|
1258
|
-
dts: {
|
|
1259
|
-
respectExternal: true
|
|
1371
|
+
const stormUnbuild = await jiti.import(
|
|
1372
|
+
jiti.esmResolve("@storm-software/unbuild/build")
|
|
1373
|
+
);
|
|
1374
|
+
await stormUnbuild.build(
|
|
1375
|
+
defu3(
|
|
1376
|
+
{
|
|
1377
|
+
...options,
|
|
1378
|
+
projectRoot: context.projectsConfigurations.projects[context.projectName].root,
|
|
1379
|
+
projectName: context.projectName,
|
|
1380
|
+
sourceRoot: context.projectsConfigurations.projects[context.projectName].sourceRoot,
|
|
1381
|
+
platform: options.platform
|
|
1260
1382
|
},
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1383
|
+
{
|
|
1384
|
+
stubOptions: {
|
|
1385
|
+
jiti: {
|
|
1386
|
+
fsCache: config.skipCache ? false : joinPaths(
|
|
1387
|
+
config.workspaceRoot,
|
|
1388
|
+
config.directories.cache || "node_modules/.cache/storm",
|
|
1389
|
+
"jiti"
|
|
1390
|
+
)
|
|
1391
|
+
}
|
|
1392
|
+
},
|
|
1393
|
+
rollup: {
|
|
1394
|
+
emitCJS: true,
|
|
1395
|
+
watch: false,
|
|
1396
|
+
dts: {
|
|
1397
|
+
respectExternal: true
|
|
1398
|
+
},
|
|
1399
|
+
esbuild: {
|
|
1400
|
+
target: options.target,
|
|
1401
|
+
format: "esm",
|
|
1402
|
+
platform: options.platform,
|
|
1403
|
+
minify: options.minify ?? !options.debug,
|
|
1404
|
+
sourcemap: options.sourcemap ?? options.debug,
|
|
1405
|
+
treeShaking: options.treeShaking
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1268
1408
|
}
|
|
1269
|
-
|
|
1270
|
-
|
|
1409
|
+
)
|
|
1410
|
+
);
|
|
1271
1411
|
return {
|
|
1272
1412
|
success: true
|
|
1273
1413
|
};
|
|
1274
1414
|
}
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
options
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
"
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1415
|
+
var executor_default9 = withRunExecutor(
|
|
1416
|
+
"TypeScript Unbuild build",
|
|
1417
|
+
unbuildExecutorFn,
|
|
1418
|
+
{
|
|
1419
|
+
skipReadingConfig: false,
|
|
1420
|
+
hooks: {
|
|
1421
|
+
applyDefaultOptions: async (options, config) => {
|
|
1422
|
+
options.debug ??= false;
|
|
1423
|
+
options.treeShaking ??= true;
|
|
1424
|
+
options.buildOnly ??= false;
|
|
1425
|
+
options.platform ??= "neutral";
|
|
1426
|
+
options.entry ??= ["{sourceRoot}"];
|
|
1427
|
+
options.tsconfig ??= "{projectRoot}/tsconfig.json";
|
|
1428
|
+
return options;
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1290
1431
|
}
|
|
1291
|
-
|
|
1432
|
+
);
|
|
1292
1433
|
|
|
1293
1434
|
// ../workspace-tools/src/generators/browser-library/generator.ts
|
|
1294
|
-
import {
|
|
1435
|
+
import {
|
|
1436
|
+
formatFiles as formatFiles2,
|
|
1437
|
+
generateFiles,
|
|
1438
|
+
names as names2,
|
|
1439
|
+
offsetFromRoot as offsetFromRoot2
|
|
1440
|
+
} from "@nx/devkit";
|
|
1295
1441
|
|
|
1296
1442
|
// ../workspace-tools/src/base/base-generator.ts
|
|
1297
|
-
var withRunGenerator =
|
|
1443
|
+
var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
1298
1444
|
skipReadingConfig: false
|
|
1299
1445
|
}) => async (tree, _options) => {
|
|
1300
1446
|
const stopwatch = getStopwatch(name);
|
|
@@ -1306,27 +1452,40 @@ var withRunGenerator = /* @__PURE__ */ __name((name, generatorFn, generatorOptio
|
|
|
1306
1452
|
`, config);
|
|
1307
1453
|
const workspaceRoot3 = findWorkspaceRoot();
|
|
1308
1454
|
if (!generatorOptions.skipReadingConfig) {
|
|
1309
|
-
writeDebug(
|
|
1310
|
-
|
|
1455
|
+
writeDebug(
|
|
1456
|
+
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
1457
|
+
- workspaceRoot: ${workspaceRoot3}`,
|
|
1458
|
+
config
|
|
1459
|
+
);
|
|
1311
1460
|
config = await getConfig(workspaceRoot3);
|
|
1312
1461
|
}
|
|
1313
1462
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
1314
1463
|
writeDebug("Running the applyDefaultOptions hook...", config);
|
|
1315
|
-
options = await Promise.resolve(
|
|
1464
|
+
options = await Promise.resolve(
|
|
1465
|
+
generatorOptions.hooks.applyDefaultOptions(options, config)
|
|
1466
|
+
);
|
|
1316
1467
|
writeDebug("Completed the applyDefaultOptions hook", config);
|
|
1317
1468
|
}
|
|
1318
|
-
writeTrace(
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
workspaceRoot: tree.root,
|
|
1469
|
+
writeTrace(
|
|
1470
|
+
`Generator schema options \u2699\uFE0F
|
|
1471
|
+
${Object.keys(options ?? {}).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`,
|
|
1322
1472
|
config
|
|
1323
|
-
|
|
1473
|
+
);
|
|
1474
|
+
const tokenized = await applyWorkspaceTokens(
|
|
1475
|
+
options,
|
|
1476
|
+
{ workspaceRoot: tree.root, config },
|
|
1477
|
+
applyWorkspaceBaseTokens
|
|
1478
|
+
);
|
|
1324
1479
|
if (generatorOptions?.hooks?.preProcess) {
|
|
1325
1480
|
writeDebug("Running the preProcess hook...", config);
|
|
1326
|
-
await Promise.resolve(
|
|
1481
|
+
await Promise.resolve(
|
|
1482
|
+
generatorOptions.hooks.preProcess(tokenized, config)
|
|
1483
|
+
);
|
|
1327
1484
|
writeDebug("Completed the preProcess hook", config);
|
|
1328
1485
|
}
|
|
1329
|
-
const result = await Promise.resolve(
|
|
1486
|
+
const result = await Promise.resolve(
|
|
1487
|
+
generatorFn(tree, tokenized, config)
|
|
1488
|
+
);
|
|
1330
1489
|
if (result) {
|
|
1331
1490
|
if (result.success === false || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string") {
|
|
1332
1491
|
throw new Error(`The ${name} generator failed to run`, {
|
|
@@ -1347,20 +1506,40 @@ ${Object.keys(options ?? {}).map((key) => ` - ${key}=${JSON.stringify(options[ke
|
|
|
1347
1506
|
};
|
|
1348
1507
|
} catch (error) {
|
|
1349
1508
|
return () => {
|
|
1350
|
-
writeFatal(
|
|
1351
|
-
|
|
1509
|
+
writeFatal(
|
|
1510
|
+
"A fatal error occurred while running the generator - the process was forced to terminate",
|
|
1511
|
+
config
|
|
1512
|
+
);
|
|
1513
|
+
writeError(
|
|
1514
|
+
`An exception was thrown in the generator's process
|
|
1352
1515
|
- Details: ${error.message}
|
|
1353
|
-
- Stacktrace: ${error.stack}`,
|
|
1516
|
+
- Stacktrace: ${error.stack}`,
|
|
1517
|
+
config
|
|
1518
|
+
);
|
|
1354
1519
|
};
|
|
1355
1520
|
} finally {
|
|
1356
1521
|
stopwatch();
|
|
1357
1522
|
}
|
|
1358
|
-
}
|
|
1523
|
+
};
|
|
1359
1524
|
|
|
1360
1525
|
// ../workspace-tools/src/base/typescript-library-generator.ts
|
|
1361
|
-
import {
|
|
1526
|
+
import {
|
|
1527
|
+
addDependenciesToPackageJson,
|
|
1528
|
+
addProjectConfiguration,
|
|
1529
|
+
ensurePackage,
|
|
1530
|
+
formatFiles,
|
|
1531
|
+
names,
|
|
1532
|
+
offsetFromRoot,
|
|
1533
|
+
readJson,
|
|
1534
|
+
updateJson,
|
|
1535
|
+
writeJson
|
|
1536
|
+
} from "@nx/devkit";
|
|
1362
1537
|
import { determineProjectNameAndRootOptions } from "@nx/devkit/src/generators/project-name-and-root-utils";
|
|
1363
|
-
import {
|
|
1538
|
+
import {
|
|
1539
|
+
addTsConfigPath,
|
|
1540
|
+
getRelativePathToRootTsConfig,
|
|
1541
|
+
tsConfigBaseOptions
|
|
1542
|
+
} from "@nx/js";
|
|
1364
1543
|
import jsInitGenerator from "@nx/js/src/generators/init/init";
|
|
1365
1544
|
import setupVerdaccio from "@nx/js/src/generators/setup-verdaccio/generator";
|
|
1366
1545
|
|
|
@@ -1372,24 +1551,27 @@ var pnpmVersion = "8.10.2";
|
|
|
1372
1551
|
|
|
1373
1552
|
// ../workspace-tools/src/base/typescript-library-generator.ts
|
|
1374
1553
|
async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
1375
|
-
const normalized = await normalizeOptions(tree, {
|
|
1376
|
-
...options
|
|
1377
|
-
});
|
|
1554
|
+
const normalized = await normalizeOptions(tree, { ...options });
|
|
1378
1555
|
const tasks = [];
|
|
1379
|
-
tasks.push(
|
|
1380
|
-
|
|
1381
|
-
tsConfigName: normalized.rootProject ? "tsconfig.json" : "tsconfig.base.json"
|
|
1382
|
-
}));
|
|
1383
|
-
tasks.push(addDependenciesToPackageJson(tree, {}, {
|
|
1384
|
-
"@storm-software/workspace-tools": "latest",
|
|
1385
|
-
"@storm-software/testing-tools": "latest",
|
|
1386
|
-
...options.devDependencies ?? {}
|
|
1387
|
-
}));
|
|
1388
|
-
if (normalized.publishable) {
|
|
1389
|
-
tasks.push(await setupVerdaccio(tree, {
|
|
1556
|
+
tasks.push(
|
|
1557
|
+
await jsInitGenerator(tree, {
|
|
1390
1558
|
...normalized,
|
|
1391
|
-
|
|
1392
|
-
})
|
|
1559
|
+
tsConfigName: normalized.rootProject ? "tsconfig.json" : "tsconfig.base.json"
|
|
1560
|
+
})
|
|
1561
|
+
);
|
|
1562
|
+
tasks.push(
|
|
1563
|
+
addDependenciesToPackageJson(
|
|
1564
|
+
tree,
|
|
1565
|
+
{},
|
|
1566
|
+
{
|
|
1567
|
+
"@storm-software/workspace-tools": "latest",
|
|
1568
|
+
"@storm-software/testing-tools": "latest",
|
|
1569
|
+
...options.devDependencies ?? {}
|
|
1570
|
+
}
|
|
1571
|
+
)
|
|
1572
|
+
);
|
|
1573
|
+
if (normalized.publishable) {
|
|
1574
|
+
tasks.push(await setupVerdaccio(tree, { ...normalized, skipFormat: true }));
|
|
1393
1575
|
}
|
|
1394
1576
|
const projectConfig = {
|
|
1395
1577
|
root: normalized.directory,
|
|
@@ -1398,13 +1580,9 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1398
1580
|
targets: {
|
|
1399
1581
|
build: {
|
|
1400
1582
|
executor: options.buildExecutor,
|
|
1401
|
-
outputs: [
|
|
1402
|
-
"{options.outputPath}"
|
|
1403
|
-
],
|
|
1583
|
+
outputs: ["{options.outputPath}"],
|
|
1404
1584
|
options: {
|
|
1405
|
-
entry: [
|
|
1406
|
-
joinPaths(normalized.projectRoot, "src", "index.ts")
|
|
1407
|
-
],
|
|
1585
|
+
entry: [joinPaths(normalized.projectRoot, "src", "index.ts")],
|
|
1408
1586
|
outputPath: getOutputPath(normalized),
|
|
1409
1587
|
tsconfig: joinPaths(normalized.projectRoot, "tsconfig.json"),
|
|
1410
1588
|
project: joinPaths(normalized.projectRoot, "package.json"),
|
|
@@ -1439,9 +1617,12 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1439
1617
|
if (options.platform) {
|
|
1440
1618
|
projectConfig.targets.build.options.platform = options.platform === "worker" ? "node" : options.platform;
|
|
1441
1619
|
}
|
|
1442
|
-
addProjectTag(
|
|
1443
|
-
|
|
1444
|
-
|
|
1620
|
+
addProjectTag(
|
|
1621
|
+
projectConfig,
|
|
1622
|
+
ProjectTagConstants.Platform.TAG_ID,
|
|
1623
|
+
options.platform === "node" ? ProjectTagConstants.Platform.NODE : options.platform === "worker" ? ProjectTagConstants.Platform.WORKER : options.platform === "browser" ? ProjectTagConstants.Platform.BROWSER : ProjectTagConstants.Platform.NEUTRAL,
|
|
1624
|
+
{ overwrite: false }
|
|
1625
|
+
);
|
|
1445
1626
|
createProjectTsConfigJson(tree, normalized);
|
|
1446
1627
|
addProjectConfiguration(tree, normalized.name, projectConfig);
|
|
1447
1628
|
let repository = {
|
|
@@ -1518,7 +1699,11 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1518
1699
|
}));
|
|
1519
1700
|
}
|
|
1520
1701
|
addTsConfigPath(tree, normalized.importPath, [
|
|
1521
|
-
joinPaths(
|
|
1702
|
+
joinPaths(
|
|
1703
|
+
normalized.projectRoot,
|
|
1704
|
+
"./src",
|
|
1705
|
+
`index.${normalized.js ? "js" : "ts"}`
|
|
1706
|
+
)
|
|
1522
1707
|
]);
|
|
1523
1708
|
addTsConfigPath(tree, joinPaths(normalized.importPath, "/*"), [
|
|
1524
1709
|
joinPaths(normalized.projectRoot, "./src", "/*")
|
|
@@ -1546,25 +1731,15 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1546
1731
|
outDir: `${offsetFromRoot(normalized.projectRoot)}dist/out-tsc`
|
|
1547
1732
|
},
|
|
1548
1733
|
files: [],
|
|
1549
|
-
include: [
|
|
1550
|
-
|
|
1551
|
-
"src/**/*.js"
|
|
1552
|
-
],
|
|
1553
|
-
exclude: [
|
|
1554
|
-
"jest.config.ts",
|
|
1555
|
-
"src/**/*.spec.ts",
|
|
1556
|
-
"src/**/*.test.ts"
|
|
1557
|
-
]
|
|
1734
|
+
include: ["src/**/*.ts", "src/**/*.js"],
|
|
1735
|
+
exclude: ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
|
|
1558
1736
|
});
|
|
1559
1737
|
}
|
|
1560
1738
|
await formatFiles(tree);
|
|
1561
1739
|
return null;
|
|
1562
1740
|
}
|
|
1563
|
-
__name(typeScriptLibraryGeneratorFn, "typeScriptLibraryGeneratorFn");
|
|
1564
1741
|
function getOutputPath(options) {
|
|
1565
|
-
const parts = [
|
|
1566
|
-
"dist"
|
|
1567
|
-
];
|
|
1742
|
+
const parts = ["dist"];
|
|
1568
1743
|
if (options.projectRoot === ".") {
|
|
1569
1744
|
parts.push(options.name);
|
|
1570
1745
|
} else {
|
|
@@ -1572,7 +1747,6 @@ function getOutputPath(options) {
|
|
|
1572
1747
|
}
|
|
1573
1748
|
return joinPaths(...parts);
|
|
1574
1749
|
}
|
|
1575
|
-
__name(getOutputPath, "getOutputPath");
|
|
1576
1750
|
function createProjectTsConfigJson(tree, options) {
|
|
1577
1751
|
const tsconfig = {
|
|
1578
1752
|
extends: options.rootProject ? void 0 : getRelativePathToRootTsConfig(tree, options.projectRoot),
|
|
@@ -1583,9 +1757,7 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
1583
1757
|
noEmit: true,
|
|
1584
1758
|
...options?.tsconfigOptions?.compilerOptions ?? {}
|
|
1585
1759
|
},
|
|
1586
|
-
files: [
|
|
1587
|
-
...options?.tsconfigOptions?.files ?? []
|
|
1588
|
-
],
|
|
1760
|
+
files: [...options?.tsconfigOptions?.files ?? []],
|
|
1589
1761
|
include: [
|
|
1590
1762
|
...options?.tsconfigOptions?.include ?? [],
|
|
1591
1763
|
"src/**/*.ts",
|
|
@@ -1601,7 +1773,6 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
1601
1773
|
};
|
|
1602
1774
|
writeJson(tree, joinPaths(options.projectRoot, "tsconfig.json"), tsconfig);
|
|
1603
1775
|
}
|
|
1604
|
-
__name(createProjectTsConfigJson, "createProjectTsConfigJson");
|
|
1605
1776
|
async function normalizeOptions(tree, options, config) {
|
|
1606
1777
|
let importPath = options.importPath;
|
|
1607
1778
|
if (!importPath && config?.namespace) {
|
|
@@ -1609,7 +1780,9 @@ async function normalizeOptions(tree, options, config) {
|
|
|
1609
1780
|
}
|
|
1610
1781
|
if (options.publishable) {
|
|
1611
1782
|
if (!importPath) {
|
|
1612
|
-
throw new Error(
|
|
1783
|
+
throw new Error(
|
|
1784
|
+
`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`
|
|
1785
|
+
);
|
|
1613
1786
|
}
|
|
1614
1787
|
}
|
|
1615
1788
|
let bundler = "tsc";
|
|
@@ -1618,7 +1791,12 @@ async function normalizeOptions(tree, options, config) {
|
|
|
1618
1791
|
}
|
|
1619
1792
|
const { Linter } = ensurePackage("@nx/eslint", nxVersion);
|
|
1620
1793
|
const rootProject = false;
|
|
1621
|
-
const {
|
|
1794
|
+
const {
|
|
1795
|
+
projectName,
|
|
1796
|
+
names: projectNames,
|
|
1797
|
+
projectRoot,
|
|
1798
|
+
importPath: normalizedImportPath
|
|
1799
|
+
} = await determineProjectNameAndRootOptions(tree, {
|
|
1622
1800
|
name: options.name,
|
|
1623
1801
|
projectType: "library",
|
|
1624
1802
|
directory: options.directory,
|
|
@@ -1655,11 +1833,16 @@ async function normalizeOptions(tree, options, config) {
|
|
|
1655
1833
|
shouldUseSwcJest: false
|
|
1656
1834
|
};
|
|
1657
1835
|
}
|
|
1658
|
-
__name(normalizeOptions, "normalizeOptions");
|
|
1659
1836
|
|
|
1660
1837
|
// ../workspace-tools/src/generators/browser-library/generator.ts
|
|
1661
1838
|
async function browserLibraryGeneratorFn(tree, schema, config) {
|
|
1662
|
-
const filesDir = joinPaths(
|
|
1839
|
+
const filesDir = joinPaths(
|
|
1840
|
+
__dirname,
|
|
1841
|
+
"src",
|
|
1842
|
+
"generators",
|
|
1843
|
+
"browser-library",
|
|
1844
|
+
"files"
|
|
1845
|
+
);
|
|
1663
1846
|
const tsLibraryGeneratorOptions = {
|
|
1664
1847
|
buildExecutor: "@storm-software/workspace-tools:unbuild",
|
|
1665
1848
|
platform: "browser",
|
|
@@ -1685,7 +1868,9 @@ async function browserLibraryGeneratorFn(tree, schema, config) {
|
|
|
1685
1868
|
directory: schema.directory
|
|
1686
1869
|
};
|
|
1687
1870
|
const options = await normalizeOptions(tree, tsLibraryGeneratorOptions);
|
|
1688
|
-
const { className, name, propertyName } = names2(
|
|
1871
|
+
const { className, name, propertyName } = names2(
|
|
1872
|
+
options.projectNames.projectFileName
|
|
1873
|
+
);
|
|
1689
1874
|
generateFiles(tree, filesDir, options.projectRoot, {
|
|
1690
1875
|
...schema,
|
|
1691
1876
|
dot: ".",
|
|
@@ -1716,55 +1901,88 @@ async function browserLibraryGeneratorFn(tree, schema, config) {
|
|
|
1716
1901
|
await formatFiles2(tree);
|
|
1717
1902
|
return null;
|
|
1718
1903
|
}
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
options
|
|
1725
|
-
|
|
1726
|
-
|
|
1904
|
+
var generator_default = withRunGenerator(
|
|
1905
|
+
"TypeScript Library Creator (Browser Platform)",
|
|
1906
|
+
browserLibraryGeneratorFn,
|
|
1907
|
+
{
|
|
1908
|
+
hooks: {
|
|
1909
|
+
applyDefaultOptions: (options) => {
|
|
1910
|
+
options.description ??= "A library used by Storm Software to support browser applications";
|
|
1911
|
+
options.platform ??= "browser";
|
|
1912
|
+
return options;
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1727
1915
|
}
|
|
1728
|
-
|
|
1916
|
+
);
|
|
1729
1917
|
|
|
1730
1918
|
// ../workspace-tools/src/generators/config-schema/generator.ts
|
|
1731
1919
|
import { formatFiles as formatFiles3, writeJson as writeJson2 } from "@nx/devkit";
|
|
1732
1920
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
1733
1921
|
async function configSchemaGeneratorFn(tree, options, config) {
|
|
1734
|
-
writeInfo(
|
|
1735
|
-
|
|
1922
|
+
writeInfo(
|
|
1923
|
+
"\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator",
|
|
1924
|
+
config
|
|
1925
|
+
);
|
|
1926
|
+
writeTrace(
|
|
1927
|
+
`Determining the Storm Workspace Configuration JSON Schema...`,
|
|
1928
|
+
config
|
|
1929
|
+
);
|
|
1736
1930
|
const jsonSchema = zodToJsonSchema(stormWorkspaceConfigSchema, {
|
|
1737
1931
|
name: "StormWorkspaceConfiguration"
|
|
1738
1932
|
});
|
|
1739
1933
|
writeTrace(jsonSchema, config);
|
|
1740
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1934
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(
|
|
1935
|
+
config?.workspaceRoot ?? findWorkspaceRoot(),
|
|
1936
|
+
options.outputFile?.startsWith("./") ? "" : "./"
|
|
1937
|
+
);
|
|
1938
|
+
writeTrace(
|
|
1939
|
+
`\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`,
|
|
1940
|
+
config
|
|
1941
|
+
);
|
|
1942
|
+
writeJson2(tree, outputPath, jsonSchema, { spaces: 2 });
|
|
1745
1943
|
await formatFiles3(tree);
|
|
1746
|
-
writeSuccess(
|
|
1944
|
+
writeSuccess(
|
|
1945
|
+
"\u{1F680} Storm Configuration JSON Schema creation has completed successfully!",
|
|
1946
|
+
config
|
|
1947
|
+
);
|
|
1747
1948
|
return {
|
|
1748
1949
|
success: true
|
|
1749
1950
|
};
|
|
1750
1951
|
}
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1952
|
+
var generator_default2 = withRunGenerator(
|
|
1953
|
+
"Configuration Schema Creator",
|
|
1954
|
+
configSchemaGeneratorFn,
|
|
1955
|
+
{
|
|
1956
|
+
hooks: {
|
|
1957
|
+
applyDefaultOptions: (options) => {
|
|
1958
|
+
options.outputFile ??= "{workspaceRoot}/storm-workspace.schema.json";
|
|
1959
|
+
return options;
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1758
1962
|
}
|
|
1759
|
-
|
|
1963
|
+
);
|
|
1760
1964
|
|
|
1761
1965
|
// ../workspace-tools/src/generators/init/init.ts
|
|
1762
|
-
import {
|
|
1966
|
+
import {
|
|
1967
|
+
addDependenciesToPackageJson as addDependenciesToPackageJson2,
|
|
1968
|
+
formatFiles as formatFiles4
|
|
1969
|
+
} from "@nx/devkit";
|
|
1763
1970
|
|
|
1764
1971
|
// ../workspace-tools/src/generators/neutral-library/generator.ts
|
|
1765
|
-
import {
|
|
1972
|
+
import {
|
|
1973
|
+
formatFiles as formatFiles5,
|
|
1974
|
+
generateFiles as generateFiles2,
|
|
1975
|
+
names as names3,
|
|
1976
|
+
offsetFromRoot as offsetFromRoot3
|
|
1977
|
+
} from "@nx/devkit";
|
|
1766
1978
|
async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
1767
|
-
const filesDir = joinPaths(
|
|
1979
|
+
const filesDir = joinPaths(
|
|
1980
|
+
__dirname,
|
|
1981
|
+
"src",
|
|
1982
|
+
"generators",
|
|
1983
|
+
"neutral-library",
|
|
1984
|
+
"files"
|
|
1985
|
+
);
|
|
1768
1986
|
const tsLibraryGeneratorOptions = {
|
|
1769
1987
|
...schema,
|
|
1770
1988
|
platform: "neutral",
|
|
@@ -1772,7 +1990,9 @@ async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
|
1772
1990
|
buildExecutor: "@storm-software/workspace-tools:unbuild"
|
|
1773
1991
|
};
|
|
1774
1992
|
const options = await normalizeOptions(tree, tsLibraryGeneratorOptions);
|
|
1775
|
-
const { className, name, propertyName } = names3(
|
|
1993
|
+
const { className, name, propertyName } = names3(
|
|
1994
|
+
options.projectNames.projectFileName
|
|
1995
|
+
);
|
|
1776
1996
|
generateFiles2(tree, filesDir, options.projectRoot, {
|
|
1777
1997
|
...schema,
|
|
1778
1998
|
dot: ".",
|
|
@@ -1793,21 +2013,35 @@ async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
|
1793
2013
|
await formatFiles5(tree);
|
|
1794
2014
|
return null;
|
|
1795
2015
|
}
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
options
|
|
1802
|
-
|
|
1803
|
-
|
|
2016
|
+
var generator_default3 = withRunGenerator(
|
|
2017
|
+
"TypeScript Library Creator (Neutral Platform)",
|
|
2018
|
+
neutralLibraryGeneratorFn,
|
|
2019
|
+
{
|
|
2020
|
+
hooks: {
|
|
2021
|
+
applyDefaultOptions: (options) => {
|
|
2022
|
+
options.description ??= "A library used by Storm Software to support either browser or NodeJs applications";
|
|
2023
|
+
options.platform = "neutral";
|
|
2024
|
+
return options;
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
1804
2027
|
}
|
|
1805
|
-
|
|
2028
|
+
);
|
|
1806
2029
|
|
|
1807
2030
|
// ../workspace-tools/src/generators/node-library/generator.ts
|
|
1808
|
-
import {
|
|
2031
|
+
import {
|
|
2032
|
+
formatFiles as formatFiles6,
|
|
2033
|
+
generateFiles as generateFiles3,
|
|
2034
|
+
names as names4,
|
|
2035
|
+
offsetFromRoot as offsetFromRoot4
|
|
2036
|
+
} from "@nx/devkit";
|
|
1809
2037
|
async function nodeLibraryGeneratorFn(tree, schema, config) {
|
|
1810
|
-
const filesDir = joinPaths(
|
|
2038
|
+
const filesDir = joinPaths(
|
|
2039
|
+
__dirname,
|
|
2040
|
+
"src",
|
|
2041
|
+
"generators",
|
|
2042
|
+
"node-library",
|
|
2043
|
+
"files"
|
|
2044
|
+
);
|
|
1811
2045
|
const tsLibraryGeneratorOptions = {
|
|
1812
2046
|
platform: "node",
|
|
1813
2047
|
devDependencies: {
|
|
@@ -1840,20 +2074,30 @@ async function nodeLibraryGeneratorFn(tree, schema, config) {
|
|
|
1840
2074
|
await formatFiles6(tree);
|
|
1841
2075
|
return null;
|
|
1842
2076
|
}
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
options
|
|
1849
|
-
|
|
1850
|
-
|
|
2077
|
+
var generator_default4 = withRunGenerator(
|
|
2078
|
+
"TypeScript Library Creator (NodeJs Platform)",
|
|
2079
|
+
nodeLibraryGeneratorFn,
|
|
2080
|
+
{
|
|
2081
|
+
hooks: {
|
|
2082
|
+
applyDefaultOptions: (options) => {
|
|
2083
|
+
options.description ??= "A library used by Storm Software to support NodeJs applications";
|
|
2084
|
+
options.platform ??= "node";
|
|
2085
|
+
return options;
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
1851
2088
|
}
|
|
1852
|
-
|
|
2089
|
+
);
|
|
1853
2090
|
|
|
1854
2091
|
// ../workspace-tools/src/generators/preset/generator.ts
|
|
1855
|
-
import {
|
|
1856
|
-
|
|
2092
|
+
import {
|
|
2093
|
+
addDependenciesToPackageJson as addDependenciesToPackageJson3,
|
|
2094
|
+
addProjectConfiguration as addProjectConfiguration2,
|
|
2095
|
+
formatFiles as formatFiles7,
|
|
2096
|
+
generateFiles as generateFiles4,
|
|
2097
|
+
joinPathFragments as joinPathFragments4,
|
|
2098
|
+
updateJson as updateJson2
|
|
2099
|
+
} from "@nx/devkit";
|
|
2100
|
+
import * as path3 from "node:path";
|
|
1857
2101
|
async function presetGeneratorFn(tree, options) {
|
|
1858
2102
|
const projectRoot = ".";
|
|
1859
2103
|
options.description ??= `\u26A1The ${options.namespace ? options.namespace : options.name} monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.`;
|
|
@@ -2001,7 +2245,7 @@ async function presetGeneratorFn(tree, options) {
|
|
|
2001
2245
|
};
|
|
2002
2246
|
return json;
|
|
2003
2247
|
});
|
|
2004
|
-
generateFiles4(tree,
|
|
2248
|
+
generateFiles4(tree, path3.join(__dirname, "files"), projectRoot, {
|
|
2005
2249
|
...options,
|
|
2006
2250
|
pnpmVersion,
|
|
2007
2251
|
nodeVersion
|
|
@@ -2067,14 +2311,30 @@ async function presetGeneratorFn(tree, options) {
|
|
|
2067
2311
|
"nx-cloud": "latest"
|
|
2068
2312
|
};
|
|
2069
2313
|
}
|
|
2070
|
-
await Promise.resolve(
|
|
2314
|
+
await Promise.resolve(
|
|
2315
|
+
addDependenciesToPackageJson3(
|
|
2316
|
+
tree,
|
|
2317
|
+
dependencies,
|
|
2318
|
+
{},
|
|
2319
|
+
joinPathFragments4(projectRoot, "package.json")
|
|
2320
|
+
)
|
|
2321
|
+
);
|
|
2071
2322
|
return null;
|
|
2072
2323
|
}
|
|
2073
|
-
|
|
2074
|
-
|
|
2324
|
+
var generator_default5 = withRunGenerator(
|
|
2325
|
+
"Storm Workspace Preset Generator",
|
|
2326
|
+
presetGeneratorFn
|
|
2327
|
+
);
|
|
2075
2328
|
|
|
2076
2329
|
// ../workspace-tools/src/generators/release-version/generator.ts
|
|
2077
|
-
import {
|
|
2330
|
+
import {
|
|
2331
|
+
formatFiles as formatFiles8,
|
|
2332
|
+
joinPathFragments as joinPathFragments5,
|
|
2333
|
+
output,
|
|
2334
|
+
readJson as readJson2,
|
|
2335
|
+
updateJson as updateJson3,
|
|
2336
|
+
writeJson as writeJson3
|
|
2337
|
+
} from "@nx/devkit";
|
|
2078
2338
|
import { resolveLocalPackageDependencies as resolveLocalPackageJsonDependencies } from "@nx/js/src/generators/release-version/utils/resolve-local-package-dependencies";
|
|
2079
2339
|
import { updateLockFile } from "@nx/js/src/release/utils/update-lock-file";
|
|
2080
2340
|
|
|
@@ -2213,7 +2473,9 @@ var DEFAULT_COMMIT_QUESTIONS = {
|
|
|
2213
2473
|
type: "select",
|
|
2214
2474
|
title: "Commit Type",
|
|
2215
2475
|
description: "Select the commit type that best describes your changes",
|
|
2216
|
-
enum: Object.keys(DEFAULT_COMMIT_TYPES).filter(
|
|
2476
|
+
enum: Object.keys(DEFAULT_COMMIT_TYPES).filter(
|
|
2477
|
+
(type) => DEFAULT_COMMIT_TYPES[type].hidden !== true
|
|
2478
|
+
).reduce((ret, type) => {
|
|
2217
2479
|
ret[type] = DEFAULT_COMMIT_TYPES[type];
|
|
2218
2480
|
return ret;
|
|
2219
2481
|
}, {}),
|
|
@@ -2253,7 +2515,7 @@ var DEFAULT_COMMIT_QUESTIONS = {
|
|
|
2253
2515
|
type: "input",
|
|
2254
2516
|
title: "Breaking Changes (Details)",
|
|
2255
2517
|
description: "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself",
|
|
2256
|
-
when:
|
|
2518
|
+
when: (answers) => answers.isBreaking === true,
|
|
2257
2519
|
maxLength: 600,
|
|
2258
2520
|
minLength: 3
|
|
2259
2521
|
},
|
|
@@ -2267,26 +2529,29 @@ var DEFAULT_COMMIT_QUESTIONS = {
|
|
|
2267
2529
|
type: "input",
|
|
2268
2530
|
title: "Open Issue Affected (Details)",
|
|
2269
2531
|
description: "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself",
|
|
2270
|
-
when:
|
|
2532
|
+
when: (answers) => answers.isIssueAffected === true,
|
|
2271
2533
|
maxLength: 600,
|
|
2272
2534
|
minLength: 3
|
|
2273
2535
|
}
|
|
2274
2536
|
};
|
|
2275
|
-
var RuleConfigSeverity;
|
|
2276
|
-
(function(RuleConfigSeverity2) {
|
|
2277
|
-
RuleConfigSeverity2[RuleConfigSeverity2["Disabled"] = 0] = "Disabled";
|
|
2278
|
-
RuleConfigSeverity2[RuleConfigSeverity2["Warning"] = 1] = "Warning";
|
|
2279
|
-
RuleConfigSeverity2[RuleConfigSeverity2["Error"] = 2] = "Error";
|
|
2280
|
-
})(RuleConfigSeverity || (RuleConfigSeverity = {}));
|
|
2281
2537
|
|
|
2282
2538
|
// ../workspace-tools/src/generators/release-version/generator.ts
|
|
2283
2539
|
import { exec, execSync as execSync4 } from "node:child_process";
|
|
2284
2540
|
import { relative as relative3 } from "node:path";
|
|
2285
2541
|
import { IMPLICIT_DEFAULT_RELEASE_GROUP } from "nx/src/command-line/release/config/config";
|
|
2286
|
-
import {
|
|
2287
|
-
|
|
2542
|
+
import {
|
|
2543
|
+
getFirstGitCommit,
|
|
2544
|
+
getLatestGitTagForPattern
|
|
2545
|
+
} from "nx/src/command-line/release/utils/git";
|
|
2546
|
+
import {
|
|
2547
|
+
resolveSemverSpecifierFromConventionalCommits,
|
|
2548
|
+
resolveSemverSpecifierFromPrompt
|
|
2549
|
+
} from "nx/src/command-line/release/utils/resolve-semver-specifier";
|
|
2288
2550
|
import { isValidSemverSpecifier } from "nx/src/command-line/release/utils/semver";
|
|
2289
|
-
import {
|
|
2551
|
+
import {
|
|
2552
|
+
deriveNewSemverVersion,
|
|
2553
|
+
validReleaseVersionPrefixes
|
|
2554
|
+
} from "nx/src/command-line/release/version-legacy";
|
|
2290
2555
|
import { interpolate } from "nx/src/tasks-runner/utils";
|
|
2291
2556
|
import { prerelease } from "semver";
|
|
2292
2557
|
|
|
@@ -2348,11 +2613,7 @@ var cargo_base_executor_untyped_default = defineUntypedSchema3({
|
|
|
2348
2613
|
$schema: {
|
|
2349
2614
|
title: "Toolchain",
|
|
2350
2615
|
description: "The type of toolchain to use for the build",
|
|
2351
|
-
enum: [
|
|
2352
|
-
"stable",
|
|
2353
|
-
"beta",
|
|
2354
|
-
"nightly"
|
|
2355
|
-
],
|
|
2616
|
+
enum: ["stable", "beta", "nightly"],
|
|
2356
2617
|
default: "stable"
|
|
2357
2618
|
},
|
|
2358
2619
|
$default: "stable"
|
|
@@ -2390,17 +2651,7 @@ var cargo_base_executor_untyped_default = defineUntypedSchema3({
|
|
|
2390
2651
|
title: "Features",
|
|
2391
2652
|
type: "string",
|
|
2392
2653
|
description: "The features to build",
|
|
2393
|
-
oneOf: [
|
|
2394
|
-
{
|
|
2395
|
-
type: "string"
|
|
2396
|
-
},
|
|
2397
|
-
{
|
|
2398
|
-
type: "array",
|
|
2399
|
-
items: {
|
|
2400
|
-
type: "string"
|
|
2401
|
-
}
|
|
2402
|
-
}
|
|
2403
|
-
]
|
|
2654
|
+
oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }]
|
|
2404
2655
|
}
|
|
2405
2656
|
},
|
|
2406
2657
|
allFeatures: {
|
|
@@ -2420,10 +2671,7 @@ var typescript_build_executor_untyped_default = defineUntypedSchema4({
|
|
|
2420
2671
|
id: "TypeScriptBuildExecutorSchema",
|
|
2421
2672
|
title: "TypeScript Build Executor",
|
|
2422
2673
|
description: "A type definition for the base TypeScript build executor schema",
|
|
2423
|
-
required: [
|
|
2424
|
-
"entry",
|
|
2425
|
-
"tsconfig"
|
|
2426
|
-
]
|
|
2674
|
+
required: ["entry", "tsconfig"]
|
|
2427
2675
|
},
|
|
2428
2676
|
entry: {
|
|
2429
2677
|
$schema: {
|
|
@@ -2431,13 +2679,9 @@ var typescript_build_executor_untyped_default = defineUntypedSchema4({
|
|
|
2431
2679
|
format: "path",
|
|
2432
2680
|
type: "array",
|
|
2433
2681
|
description: "The entry file or files to build",
|
|
2434
|
-
items: {
|
|
2435
|
-
type: "string"
|
|
2436
|
-
}
|
|
2682
|
+
items: { type: "string" }
|
|
2437
2683
|
},
|
|
2438
|
-
$default: [
|
|
2439
|
-
"{sourceRoot}/index.ts"
|
|
2440
|
-
]
|
|
2684
|
+
$default: ["{sourceRoot}/index.ts"]
|
|
2441
2685
|
},
|
|
2442
2686
|
tsconfig: {
|
|
2443
2687
|
$schema: {
|
|
@@ -2517,7 +2761,7 @@ var typescript_build_executor_untyped_default = defineUntypedSchema4({
|
|
|
2517
2761
|
]
|
|
2518
2762
|
},
|
|
2519
2763
|
$default: "esnext",
|
|
2520
|
-
$resolve:
|
|
2764
|
+
$resolve: (val = "esnext") => val.toLowerCase()
|
|
2521
2765
|
},
|
|
2522
2766
|
format: {
|
|
2523
2767
|
$schema: {
|
|
@@ -2526,28 +2770,17 @@ var typescript_build_executor_untyped_default = defineUntypedSchema4({
|
|
|
2526
2770
|
description: "The format to build",
|
|
2527
2771
|
items: {
|
|
2528
2772
|
type: "string",
|
|
2529
|
-
enum: [
|
|
2530
|
-
"cjs",
|
|
2531
|
-
"esm",
|
|
2532
|
-
"iife"
|
|
2533
|
-
]
|
|
2773
|
+
enum: ["cjs", "esm", "iife"]
|
|
2534
2774
|
}
|
|
2535
2775
|
},
|
|
2536
|
-
$resolve:
|
|
2537
|
-
"cjs",
|
|
2538
|
-
"esm"
|
|
2539
|
-
]) => [].concat(val), "$resolve")
|
|
2776
|
+
$resolve: (val = ["cjs", "esm"]) => [].concat(val)
|
|
2540
2777
|
},
|
|
2541
2778
|
platform: {
|
|
2542
2779
|
$schema: {
|
|
2543
2780
|
title: "Platform",
|
|
2544
2781
|
type: "string",
|
|
2545
2782
|
description: "The platform to build",
|
|
2546
|
-
enum: [
|
|
2547
|
-
"neutral",
|
|
2548
|
-
"node",
|
|
2549
|
-
"browser"
|
|
2550
|
-
]
|
|
2783
|
+
enum: ["neutral", "node", "browser"]
|
|
2551
2784
|
},
|
|
2552
2785
|
$default: "neutral"
|
|
2553
2786
|
},
|
|
@@ -2557,7 +2790,7 @@ var typescript_build_executor_untyped_default = defineUntypedSchema4({
|
|
|
2557
2790
|
type: "array",
|
|
2558
2791
|
description: "The external dependencies"
|
|
2559
2792
|
},
|
|
2560
|
-
$resolve:
|
|
2793
|
+
$resolve: (val = []) => [].concat(val)
|
|
2561
2794
|
},
|
|
2562
2795
|
define: {
|
|
2563
2796
|
$schema: {
|
|
@@ -2566,7 +2799,7 @@ var typescript_build_executor_untyped_default = defineUntypedSchema4({
|
|
|
2566
2799
|
tsType: "Record<string, string>",
|
|
2567
2800
|
description: "The define values"
|
|
2568
2801
|
},
|
|
2569
|
-
$resolve:
|
|
2802
|
+
$resolve: (val = {}) => val,
|
|
2570
2803
|
$default: {}
|
|
2571
2804
|
},
|
|
2572
2805
|
env: {
|
|
@@ -2576,7 +2809,7 @@ var typescript_build_executor_untyped_default = defineUntypedSchema4({
|
|
|
2576
2809
|
tsType: "Record<string, string>",
|
|
2577
2810
|
description: "The environment variable values"
|
|
2578
2811
|
},
|
|
2579
|
-
$resolve:
|
|
2812
|
+
$resolve: (val = {}) => val,
|
|
2580
2813
|
$default: {}
|
|
2581
2814
|
}
|
|
2582
2815
|
});
|
|
@@ -2589,10 +2822,7 @@ var typescript_library_generator_untyped_default = defineUntypedSchema5({
|
|
|
2589
2822
|
id: "TypeScriptLibraryGeneratorSchema",
|
|
2590
2823
|
title: "TypeScript Library Generator",
|
|
2591
2824
|
description: "A type definition for the base TypeScript Library Generator schema",
|
|
2592
|
-
required: [
|
|
2593
|
-
"directory",
|
|
2594
|
-
"name"
|
|
2595
|
-
]
|
|
2825
|
+
required: ["directory", "name"]
|
|
2596
2826
|
},
|
|
2597
2827
|
name: {
|
|
2598
2828
|
$schema: {
|
|
@@ -2621,12 +2851,7 @@ var typescript_library_generator_untyped_default = defineUntypedSchema5({
|
|
|
2621
2851
|
title: "Platform",
|
|
2622
2852
|
type: "string",
|
|
2623
2853
|
description: "The platform to target with the library",
|
|
2624
|
-
enum: [
|
|
2625
|
-
"neutral",
|
|
2626
|
-
"node",
|
|
2627
|
-
"worker",
|
|
2628
|
-
"browser"
|
|
2629
|
-
]
|
|
2854
|
+
enum: ["neutral", "node", "worker", "browser"]
|
|
2630
2855
|
},
|
|
2631
2856
|
$default: "neutral"
|
|
2632
2857
|
},
|
|
@@ -2648,11 +2873,7 @@ var typescript_library_generator_untyped_default = defineUntypedSchema5({
|
|
|
2648
2873
|
$schema: {
|
|
2649
2874
|
title: "Unit Test Runner",
|
|
2650
2875
|
type: "string",
|
|
2651
|
-
enum: [
|
|
2652
|
-
"jest",
|
|
2653
|
-
"vitest",
|
|
2654
|
-
"none"
|
|
2655
|
-
],
|
|
2876
|
+
enum: ["jest", "vitest", "none"],
|
|
2656
2877
|
description: "The unit test runner to use"
|
|
2657
2878
|
}
|
|
2658
2879
|
},
|
|
@@ -2660,10 +2881,7 @@ var typescript_library_generator_untyped_default = defineUntypedSchema5({
|
|
|
2660
2881
|
$schema: {
|
|
2661
2882
|
title: "Test Environment",
|
|
2662
2883
|
type: "string",
|
|
2663
|
-
enum: [
|
|
2664
|
-
"jsdom",
|
|
2665
|
-
"node"
|
|
2666
|
-
],
|
|
2884
|
+
enum: ["jsdom", "node"],
|
|
2667
2885
|
description: "The test environment to use"
|
|
2668
2886
|
}
|
|
2669
2887
|
},
|
|
@@ -2705,12 +2923,25 @@ var typescript_library_generator_untyped_default = defineUntypedSchema5({
|
|
|
2705
2923
|
import { retrieveProjectConfigurationsWithoutPluginInference } from "nx/src/project-graph/utils/retrieve-workspace-files";
|
|
2706
2924
|
|
|
2707
2925
|
// ../workspace-tools/src/utils/lock-file.ts
|
|
2708
|
-
import {
|
|
2926
|
+
import {
|
|
2927
|
+
output as output2,
|
|
2928
|
+
readJsonFile,
|
|
2929
|
+
workspaceRoot as workspaceRoot2
|
|
2930
|
+
} from "@nx/devkit";
|
|
2709
2931
|
import { existsSync as existsSync6 } from "node:fs";
|
|
2710
2932
|
import { join as join2 } from "node:path";
|
|
2711
|
-
import {
|
|
2712
|
-
|
|
2713
|
-
|
|
2933
|
+
import {
|
|
2934
|
+
getNpmLockfileDependencies,
|
|
2935
|
+
getNpmLockfileNodes
|
|
2936
|
+
} from "nx/src/plugins/js/lock-file/npm-parser";
|
|
2937
|
+
import {
|
|
2938
|
+
getPnpmLockfileDependencies,
|
|
2939
|
+
getPnpmLockfileNodes
|
|
2940
|
+
} from "nx/src/plugins/js/lock-file/pnpm-parser";
|
|
2941
|
+
import {
|
|
2942
|
+
getYarnLockfileDependencies,
|
|
2943
|
+
getYarnLockfileNodes
|
|
2944
|
+
} from "nx/src/plugins/js/lock-file/yarn-parser";
|
|
2714
2945
|
var YARN_LOCK_FILE = "yarn.lock";
|
|
2715
2946
|
var NPM_LOCK_FILE = "package-lock.json";
|
|
2716
2947
|
var PNPM_LOCK_FILE = "pnpm-lock.yaml";
|