@storm-software/workspace-tools 1.62.5 → 1.62.7
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 +24 -0
- package/index.js +109 -84
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +52 -37
- package/src/executors/tsup/executor.js +74 -57
- package/src/executors/tsup-browser/executor.js +74 -57
- package/src/executors/tsup-neutral/executor.js +74 -57
- package/src/executors/tsup-node/executor.js +74 -57
- package/src/executors/typia/executor.js +28 -21
- package/src/generators/browser-library/generator.js +26 -20
- package/src/generators/config-schema/generator.js +30 -24
- package/src/generators/neutral-library/generator.js +26 -20
- package/src/generators/node-library/generator.js +26 -20
- package/src/generators/preset/generator.js +26 -20
- package/src/generators/release-version/generator.js +31 -25
- package/src/utils/index.js +24 -23
|
@@ -176546,9 +176546,6 @@ var zodToJsonSchema = (schema2, options8) => {
|
|
|
176546
176546
|
return combined;
|
|
176547
176547
|
};
|
|
176548
176548
|
|
|
176549
|
-
// packages/workspace-tools/src/base/base-generator.ts
|
|
176550
|
-
var import_config_tools2 = require("@storm-software/config-tools");
|
|
176551
|
-
|
|
176552
176549
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
176553
176550
|
var import_config_tools = require("@storm-software/config-tools");
|
|
176554
176551
|
var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
@@ -176594,40 +176591,49 @@ var applyWorkspaceTokens = (options8, config, tokenizerFn) => {
|
|
|
176594
176591
|
};
|
|
176595
176592
|
|
|
176596
176593
|
// packages/workspace-tools/src/base/base-generator.ts
|
|
176597
|
-
var import_config_tools3 = require("@storm-software/config-tools");
|
|
176598
176594
|
var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
176599
176595
|
skipReadingConfig: false
|
|
176600
176596
|
}) => async (tree, _options) => {
|
|
176601
|
-
const
|
|
176597
|
+
const {
|
|
176598
|
+
getStopwatch,
|
|
176599
|
+
writeDebug,
|
|
176600
|
+
writeError,
|
|
176601
|
+
writeFatal,
|
|
176602
|
+
writeInfo,
|
|
176603
|
+
writeSuccess,
|
|
176604
|
+
writeTrace,
|
|
176605
|
+
findWorkspaceRootSafe,
|
|
176606
|
+
loadStormConfig
|
|
176607
|
+
} = await import("@storm-software/config-tools");
|
|
176608
|
+
const stopwatch = getStopwatch(name);
|
|
176602
176609
|
let options8 = _options;
|
|
176603
176610
|
let config;
|
|
176604
176611
|
try {
|
|
176605
|
-
|
|
176612
|
+
writeInfo(config, `\u26A1 Running the ${name} generator...
|
|
176606
176613
|
|
|
176607
176614
|
`);
|
|
176608
|
-
const workspaceRoot =
|
|
176615
|
+
const workspaceRoot = findWorkspaceRootSafe();
|
|
176609
176616
|
if (!generatorOptions.skipReadingConfig) {
|
|
176610
|
-
|
|
176611
|
-
(0, import_config_tools2.writeDebug)(
|
|
176617
|
+
writeDebug(
|
|
176612
176618
|
config,
|
|
176613
176619
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
176614
176620
|
- workspaceRoot: ${workspaceRoot}`
|
|
176615
176621
|
);
|
|
176616
176622
|
config = await loadStormConfig(workspaceRoot);
|
|
176617
|
-
|
|
176623
|
+
writeTrace(
|
|
176618
176624
|
config,
|
|
176619
176625
|
`Loaded Storm config into env:
|
|
176620
176626
|
${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.env[key2])}`).join("\n")}`
|
|
176621
176627
|
);
|
|
176622
176628
|
}
|
|
176623
176629
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
176624
|
-
|
|
176630
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
176625
176631
|
options8 = await Promise.resolve(
|
|
176626
176632
|
generatorOptions.hooks.applyDefaultOptions(options8, config)
|
|
176627
176633
|
);
|
|
176628
|
-
|
|
176634
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
176629
176635
|
}
|
|
176630
|
-
|
|
176636
|
+
writeTrace(
|
|
176631
176637
|
config,
|
|
176632
176638
|
`Generator schema options \u2699\uFE0F
|
|
176633
176639
|
${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
@@ -176638,9 +176644,9 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
176638
176644
|
applyWorkspaceGeneratorTokens
|
|
176639
176645
|
);
|
|
176640
176646
|
if (generatorOptions?.hooks?.preProcess) {
|
|
176641
|
-
|
|
176647
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
176642
176648
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
176643
|
-
|
|
176649
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
176644
176650
|
}
|
|
176645
176651
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
176646
176652
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -176649,22 +176655,22 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
176649
176655
|
});
|
|
176650
176656
|
}
|
|
176651
176657
|
if (generatorOptions?.hooks?.postProcess) {
|
|
176652
|
-
|
|
176658
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
176653
176659
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
176654
|
-
|
|
176660
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
176655
176661
|
}
|
|
176656
|
-
|
|
176662
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
176657
176663
|
`);
|
|
176658
176664
|
return {
|
|
176659
176665
|
...result,
|
|
176660
176666
|
success: true
|
|
176661
176667
|
};
|
|
176662
176668
|
} catch (error) {
|
|
176663
|
-
|
|
176669
|
+
writeFatal(
|
|
176664
176670
|
config,
|
|
176665
176671
|
"A fatal error occurred while running the generator - the process was forced to terminate"
|
|
176666
176672
|
);
|
|
176667
|
-
|
|
176673
|
+
writeError(
|
|
176668
176674
|
config,
|
|
176669
176675
|
`An exception was thrown in the generator's process
|
|
176670
176676
|
- Details: ${error.message}
|
|
@@ -176680,14 +176686,14 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
176680
176686
|
|
|
176681
176687
|
// packages/workspace-tools/src/utils/get-project-configurations.ts
|
|
176682
176688
|
var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
|
|
176683
|
-
var
|
|
176684
|
-
var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)((0,
|
|
176689
|
+
var import_config_tools2 = require("@storm-software/config-tools");
|
|
176690
|
+
var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)((0, import_config_tools2.findWorkspaceRoot)());
|
|
176685
176691
|
|
|
176686
176692
|
// packages/workspace-tools/src/generators/config-schema/generator.ts
|
|
176687
|
-
var
|
|
176693
|
+
var import_config_tools3 = require("@storm-software/config-tools");
|
|
176688
176694
|
async function configSchemaGeneratorFn(tree, options8, config) {
|
|
176689
176695
|
const projectConfigurations = getProjectConfigurations();
|
|
176690
|
-
const workspaceRoot = config?.workspaceRoot ?? (0,
|
|
176696
|
+
const workspaceRoot = config?.workspaceRoot ?? (0, import_config_tools3.findWorkspaceRoot)();
|
|
176691
176697
|
const modules = await Promise.all(
|
|
176692
176698
|
Object.keys(projectConfigurations).map(async (key2) => {
|
|
176693
176699
|
if (projectConfigurations[key2]?.config) {
|
|
@@ -391222,9 +391222,6 @@ __export(generator_exports, {
|
|
|
391222
391222
|
module.exports = __toCommonJS(generator_exports);
|
|
391223
391223
|
var import_devkit2 = __toESM(require_devkit());
|
|
391224
391224
|
|
|
391225
|
-
// packages/workspace-tools/src/base/base-generator.ts
|
|
391226
|
-
var import_config_tools2 = require("@storm-software/config-tools");
|
|
391227
|
-
|
|
391228
391225
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
391229
391226
|
var import_config_tools = require("@storm-software/config-tools");
|
|
391230
391227
|
var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
@@ -391270,40 +391267,49 @@ var applyWorkspaceTokens = (options8, config, tokenizerFn) => {
|
|
|
391270
391267
|
};
|
|
391271
391268
|
|
|
391272
391269
|
// packages/workspace-tools/src/base/base-generator.ts
|
|
391273
|
-
var import_config_tools3 = require("@storm-software/config-tools");
|
|
391274
391270
|
var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
391275
391271
|
skipReadingConfig: false
|
|
391276
391272
|
}) => async (tree, _options) => {
|
|
391277
|
-
const
|
|
391273
|
+
const {
|
|
391274
|
+
getStopwatch,
|
|
391275
|
+
writeDebug,
|
|
391276
|
+
writeError,
|
|
391277
|
+
writeFatal,
|
|
391278
|
+
writeInfo,
|
|
391279
|
+
writeSuccess,
|
|
391280
|
+
writeTrace,
|
|
391281
|
+
findWorkspaceRootSafe,
|
|
391282
|
+
loadStormConfig
|
|
391283
|
+
} = await import("@storm-software/config-tools");
|
|
391284
|
+
const stopwatch = getStopwatch(name);
|
|
391278
391285
|
let options8 = _options;
|
|
391279
391286
|
let config;
|
|
391280
391287
|
try {
|
|
391281
|
-
|
|
391288
|
+
writeInfo(config, `\u26A1 Running the ${name} generator...
|
|
391282
391289
|
|
|
391283
391290
|
`);
|
|
391284
|
-
const workspaceRoot =
|
|
391291
|
+
const workspaceRoot = findWorkspaceRootSafe();
|
|
391285
391292
|
if (!generatorOptions.skipReadingConfig) {
|
|
391286
|
-
|
|
391287
|
-
(0, import_config_tools2.writeDebug)(
|
|
391293
|
+
writeDebug(
|
|
391288
391294
|
config,
|
|
391289
391295
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
391290
391296
|
- workspaceRoot: ${workspaceRoot}`
|
|
391291
391297
|
);
|
|
391292
391298
|
config = await loadStormConfig(workspaceRoot);
|
|
391293
|
-
|
|
391299
|
+
writeTrace(
|
|
391294
391300
|
config,
|
|
391295
391301
|
`Loaded Storm config into env:
|
|
391296
391302
|
${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.env[key2])}`).join("\n")}`
|
|
391297
391303
|
);
|
|
391298
391304
|
}
|
|
391299
391305
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
391300
|
-
|
|
391306
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
391301
391307
|
options8 = await Promise.resolve(
|
|
391302
391308
|
generatorOptions.hooks.applyDefaultOptions(options8, config)
|
|
391303
391309
|
);
|
|
391304
|
-
|
|
391310
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
391305
391311
|
}
|
|
391306
|
-
|
|
391312
|
+
writeTrace(
|
|
391307
391313
|
config,
|
|
391308
391314
|
`Generator schema options \u2699\uFE0F
|
|
391309
391315
|
${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
@@ -391314,9 +391320,9 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
391314
391320
|
applyWorkspaceGeneratorTokens
|
|
391315
391321
|
);
|
|
391316
391322
|
if (generatorOptions?.hooks?.preProcess) {
|
|
391317
|
-
|
|
391323
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
391318
391324
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
391319
|
-
|
|
391325
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
391320
391326
|
}
|
|
391321
391327
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
391322
391328
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -391325,22 +391331,22 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
391325
391331
|
});
|
|
391326
391332
|
}
|
|
391327
391333
|
if (generatorOptions?.hooks?.postProcess) {
|
|
391328
|
-
|
|
391334
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
391329
391335
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
391330
|
-
|
|
391336
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
391331
391337
|
}
|
|
391332
|
-
|
|
391338
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
391333
391339
|
`);
|
|
391334
391340
|
return {
|
|
391335
391341
|
...result,
|
|
391336
391342
|
success: true
|
|
391337
391343
|
};
|
|
391338
391344
|
} catch (error) {
|
|
391339
|
-
|
|
391345
|
+
writeFatal(
|
|
391340
391346
|
config,
|
|
391341
391347
|
"A fatal error occurred while running the generator - the process was forced to terminate"
|
|
391342
391348
|
);
|
|
391343
|
-
|
|
391349
|
+
writeError(
|
|
391344
391350
|
config,
|
|
391345
391351
|
`An exception was thrown in the generator's process
|
|
391346
391352
|
- Details: ${error.message}
|
|
@@ -391222,9 +391222,6 @@ __export(generator_exports, {
|
|
|
391222
391222
|
module.exports = __toCommonJS(generator_exports);
|
|
391223
391223
|
var import_devkit2 = __toESM(require_devkit());
|
|
391224
391224
|
|
|
391225
|
-
// packages/workspace-tools/src/base/base-generator.ts
|
|
391226
|
-
var import_config_tools2 = require("@storm-software/config-tools");
|
|
391227
|
-
|
|
391228
391225
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
391229
391226
|
var import_config_tools = require("@storm-software/config-tools");
|
|
391230
391227
|
var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
@@ -391270,40 +391267,49 @@ var applyWorkspaceTokens = (options8, config, tokenizerFn) => {
|
|
|
391270
391267
|
};
|
|
391271
391268
|
|
|
391272
391269
|
// packages/workspace-tools/src/base/base-generator.ts
|
|
391273
|
-
var import_config_tools3 = require("@storm-software/config-tools");
|
|
391274
391270
|
var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
391275
391271
|
skipReadingConfig: false
|
|
391276
391272
|
}) => async (tree, _options) => {
|
|
391277
|
-
const
|
|
391273
|
+
const {
|
|
391274
|
+
getStopwatch,
|
|
391275
|
+
writeDebug,
|
|
391276
|
+
writeError,
|
|
391277
|
+
writeFatal,
|
|
391278
|
+
writeInfo,
|
|
391279
|
+
writeSuccess,
|
|
391280
|
+
writeTrace,
|
|
391281
|
+
findWorkspaceRootSafe,
|
|
391282
|
+
loadStormConfig
|
|
391283
|
+
} = await import("@storm-software/config-tools");
|
|
391284
|
+
const stopwatch = getStopwatch(name);
|
|
391278
391285
|
let options8 = _options;
|
|
391279
391286
|
let config;
|
|
391280
391287
|
try {
|
|
391281
|
-
|
|
391288
|
+
writeInfo(config, `\u26A1 Running the ${name} generator...
|
|
391282
391289
|
|
|
391283
391290
|
`);
|
|
391284
|
-
const workspaceRoot =
|
|
391291
|
+
const workspaceRoot = findWorkspaceRootSafe();
|
|
391285
391292
|
if (!generatorOptions.skipReadingConfig) {
|
|
391286
|
-
|
|
391287
|
-
(0, import_config_tools2.writeDebug)(
|
|
391293
|
+
writeDebug(
|
|
391288
391294
|
config,
|
|
391289
391295
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
391290
391296
|
- workspaceRoot: ${workspaceRoot}`
|
|
391291
391297
|
);
|
|
391292
391298
|
config = await loadStormConfig(workspaceRoot);
|
|
391293
|
-
|
|
391299
|
+
writeTrace(
|
|
391294
391300
|
config,
|
|
391295
391301
|
`Loaded Storm config into env:
|
|
391296
391302
|
${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.env[key2])}`).join("\n")}`
|
|
391297
391303
|
);
|
|
391298
391304
|
}
|
|
391299
391305
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
391300
|
-
|
|
391306
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
391301
391307
|
options8 = await Promise.resolve(
|
|
391302
391308
|
generatorOptions.hooks.applyDefaultOptions(options8, config)
|
|
391303
391309
|
);
|
|
391304
|
-
|
|
391310
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
391305
391311
|
}
|
|
391306
|
-
|
|
391312
|
+
writeTrace(
|
|
391307
391313
|
config,
|
|
391308
391314
|
`Generator schema options \u2699\uFE0F
|
|
391309
391315
|
${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
@@ -391314,9 +391320,9 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
391314
391320
|
applyWorkspaceGeneratorTokens
|
|
391315
391321
|
);
|
|
391316
391322
|
if (generatorOptions?.hooks?.preProcess) {
|
|
391317
|
-
|
|
391323
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
391318
391324
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
391319
|
-
|
|
391325
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
391320
391326
|
}
|
|
391321
391327
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
391322
391328
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -391325,22 +391331,22 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
391325
391331
|
});
|
|
391326
391332
|
}
|
|
391327
391333
|
if (generatorOptions?.hooks?.postProcess) {
|
|
391328
|
-
|
|
391334
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
391329
391335
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
391330
|
-
|
|
391336
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
391331
391337
|
}
|
|
391332
|
-
|
|
391338
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
391333
391339
|
`);
|
|
391334
391340
|
return {
|
|
391335
391341
|
...result,
|
|
391336
391342
|
success: true
|
|
391337
391343
|
};
|
|
391338
391344
|
} catch (error) {
|
|
391339
|
-
|
|
391345
|
+
writeFatal(
|
|
391340
391346
|
config,
|
|
391341
391347
|
"A fatal error occurred while running the generator - the process was forced to terminate"
|
|
391342
391348
|
);
|
|
391343
|
-
|
|
391349
|
+
writeError(
|
|
391344
391350
|
config,
|
|
391345
391351
|
`An exception was thrown in the generator's process
|
|
391346
391352
|
- Details: ${error.message}
|
|
@@ -171960,9 +171960,6 @@ module.exports = __toCommonJS(generator_exports);
|
|
|
171960
171960
|
var path13 = __toESM(require("node:path"));
|
|
171961
171961
|
var import_devkit = __toESM(require_devkit());
|
|
171962
171962
|
|
|
171963
|
-
// packages/workspace-tools/src/base/base-generator.ts
|
|
171964
|
-
var import_config_tools2 = require("@storm-software/config-tools");
|
|
171965
|
-
|
|
171966
171963
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
171967
171964
|
var import_config_tools = require("@storm-software/config-tools");
|
|
171968
171965
|
var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
@@ -172008,40 +172005,49 @@ var applyWorkspaceTokens = (options8, config, tokenizerFn) => {
|
|
|
172008
172005
|
};
|
|
172009
172006
|
|
|
172010
172007
|
// packages/workspace-tools/src/base/base-generator.ts
|
|
172011
|
-
var import_config_tools3 = require("@storm-software/config-tools");
|
|
172012
172008
|
var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
172013
172009
|
skipReadingConfig: false
|
|
172014
172010
|
}) => async (tree, _options) => {
|
|
172015
|
-
const
|
|
172011
|
+
const {
|
|
172012
|
+
getStopwatch,
|
|
172013
|
+
writeDebug,
|
|
172014
|
+
writeError,
|
|
172015
|
+
writeFatal,
|
|
172016
|
+
writeInfo,
|
|
172017
|
+
writeSuccess,
|
|
172018
|
+
writeTrace,
|
|
172019
|
+
findWorkspaceRootSafe,
|
|
172020
|
+
loadStormConfig
|
|
172021
|
+
} = await import("@storm-software/config-tools");
|
|
172022
|
+
const stopwatch = getStopwatch(name);
|
|
172016
172023
|
let options8 = _options;
|
|
172017
172024
|
let config;
|
|
172018
172025
|
try {
|
|
172019
|
-
|
|
172026
|
+
writeInfo(config, `\u26A1 Running the ${name} generator...
|
|
172020
172027
|
|
|
172021
172028
|
`);
|
|
172022
|
-
const workspaceRoot =
|
|
172029
|
+
const workspaceRoot = findWorkspaceRootSafe();
|
|
172023
172030
|
if (!generatorOptions.skipReadingConfig) {
|
|
172024
|
-
|
|
172025
|
-
(0, import_config_tools2.writeDebug)(
|
|
172031
|
+
writeDebug(
|
|
172026
172032
|
config,
|
|
172027
172033
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
172028
172034
|
- workspaceRoot: ${workspaceRoot}`
|
|
172029
172035
|
);
|
|
172030
172036
|
config = await loadStormConfig(workspaceRoot);
|
|
172031
|
-
|
|
172037
|
+
writeTrace(
|
|
172032
172038
|
config,
|
|
172033
172039
|
`Loaded Storm config into env:
|
|
172034
172040
|
${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.env[key2])}`).join("\n")}`
|
|
172035
172041
|
);
|
|
172036
172042
|
}
|
|
172037
172043
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
172038
|
-
|
|
172044
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
172039
172045
|
options8 = await Promise.resolve(
|
|
172040
172046
|
generatorOptions.hooks.applyDefaultOptions(options8, config)
|
|
172041
172047
|
);
|
|
172042
|
-
|
|
172048
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
172043
172049
|
}
|
|
172044
|
-
|
|
172050
|
+
writeTrace(
|
|
172045
172051
|
config,
|
|
172046
172052
|
`Generator schema options \u2699\uFE0F
|
|
172047
172053
|
${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
@@ -172052,9 +172058,9 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
172052
172058
|
applyWorkspaceGeneratorTokens
|
|
172053
172059
|
);
|
|
172054
172060
|
if (generatorOptions?.hooks?.preProcess) {
|
|
172055
|
-
|
|
172061
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
172056
172062
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
172057
|
-
|
|
172063
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
172058
172064
|
}
|
|
172059
172065
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
172060
172066
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -172063,22 +172069,22 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
172063
172069
|
});
|
|
172064
172070
|
}
|
|
172065
172071
|
if (generatorOptions?.hooks?.postProcess) {
|
|
172066
|
-
|
|
172072
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
172067
172073
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
172068
|
-
|
|
172074
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
172069
172075
|
}
|
|
172070
|
-
|
|
172076
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
172071
172077
|
`);
|
|
172072
172078
|
return {
|
|
172073
172079
|
...result,
|
|
172074
172080
|
success: true
|
|
172075
172081
|
};
|
|
172076
172082
|
} catch (error) {
|
|
172077
|
-
|
|
172083
|
+
writeFatal(
|
|
172078
172084
|
config,
|
|
172079
172085
|
"A fatal error occurred while running the generator - the process was forced to terminate"
|
|
172080
172086
|
);
|
|
172081
|
-
|
|
172087
|
+
writeError(
|
|
172082
172088
|
config,
|
|
172083
172089
|
`An exception was thrown in the generator's process
|
|
172084
172090
|
- Details: ${error.message}
|
|
@@ -174425,11 +174425,8 @@ var import_version = require("nx/src/command-line/release/version");
|
|
|
174425
174425
|
var import_utils = require("nx/src/tasks-runner/utils");
|
|
174426
174426
|
var import_semver = require("nx/src/command-line/release/utils/semver");
|
|
174427
174427
|
var import_node_path = require("node:path");
|
|
174428
|
-
var import_config_tools4 = require("@storm-software/config-tools");
|
|
174429
|
-
var import_update_lock_file = __toESM(require_update_lock_file());
|
|
174430
|
-
|
|
174431
|
-
// packages/workspace-tools/src/base/base-generator.ts
|
|
174432
174428
|
var import_config_tools2 = require("@storm-software/config-tools");
|
|
174429
|
+
var import_update_lock_file = __toESM(require_update_lock_file());
|
|
174433
174430
|
|
|
174434
174431
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
174435
174432
|
var import_config_tools = require("@storm-software/config-tools");
|
|
@@ -174476,40 +174473,49 @@ var applyWorkspaceTokens = (options8, config, tokenizerFn) => {
|
|
|
174476
174473
|
};
|
|
174477
174474
|
|
|
174478
174475
|
// packages/workspace-tools/src/base/base-generator.ts
|
|
174479
|
-
var import_config_tools3 = require("@storm-software/config-tools");
|
|
174480
174476
|
var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
174481
174477
|
skipReadingConfig: false
|
|
174482
174478
|
}) => async (tree, _options) => {
|
|
174483
|
-
const
|
|
174479
|
+
const {
|
|
174480
|
+
getStopwatch,
|
|
174481
|
+
writeDebug,
|
|
174482
|
+
writeError,
|
|
174483
|
+
writeFatal,
|
|
174484
|
+
writeInfo: writeInfo2,
|
|
174485
|
+
writeSuccess,
|
|
174486
|
+
writeTrace,
|
|
174487
|
+
findWorkspaceRootSafe,
|
|
174488
|
+
loadStormConfig
|
|
174489
|
+
} = await import("@storm-software/config-tools");
|
|
174490
|
+
const stopwatch = getStopwatch(name);
|
|
174484
174491
|
let options8 = _options;
|
|
174485
174492
|
let config;
|
|
174486
174493
|
try {
|
|
174487
|
-
(
|
|
174494
|
+
writeInfo2(config, `\u26A1 Running the ${name} generator...
|
|
174488
174495
|
|
|
174489
174496
|
`);
|
|
174490
|
-
const workspaceRoot =
|
|
174497
|
+
const workspaceRoot = findWorkspaceRootSafe();
|
|
174491
174498
|
if (!generatorOptions.skipReadingConfig) {
|
|
174492
|
-
|
|
174493
|
-
(0, import_config_tools2.writeDebug)(
|
|
174499
|
+
writeDebug(
|
|
174494
174500
|
config,
|
|
174495
174501
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
174496
174502
|
- workspaceRoot: ${workspaceRoot}`
|
|
174497
174503
|
);
|
|
174498
174504
|
config = await loadStormConfig(workspaceRoot);
|
|
174499
|
-
|
|
174505
|
+
writeTrace(
|
|
174500
174506
|
config,
|
|
174501
174507
|
`Loaded Storm config into env:
|
|
174502
174508
|
${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.env[key2])}`).join("\n")}`
|
|
174503
174509
|
);
|
|
174504
174510
|
}
|
|
174505
174511
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
174506
|
-
|
|
174512
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
174507
174513
|
options8 = await Promise.resolve(
|
|
174508
174514
|
generatorOptions.hooks.applyDefaultOptions(options8, config)
|
|
174509
174515
|
);
|
|
174510
|
-
|
|
174516
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
174511
174517
|
}
|
|
174512
|
-
|
|
174518
|
+
writeTrace(
|
|
174513
174519
|
config,
|
|
174514
174520
|
`Generator schema options \u2699\uFE0F
|
|
174515
174521
|
${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
@@ -174520,9 +174526,9 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
174520
174526
|
applyWorkspaceGeneratorTokens
|
|
174521
174527
|
);
|
|
174522
174528
|
if (generatorOptions?.hooks?.preProcess) {
|
|
174523
|
-
|
|
174529
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
174524
174530
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
174525
|
-
|
|
174531
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
174526
174532
|
}
|
|
174527
174533
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
174528
174534
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -174531,22 +174537,22 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
174531
174537
|
});
|
|
174532
174538
|
}
|
|
174533
174539
|
if (generatorOptions?.hooks?.postProcess) {
|
|
174534
|
-
|
|
174540
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
174535
174541
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
174536
|
-
|
|
174542
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
174537
174543
|
}
|
|
174538
|
-
|
|
174544
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
174539
174545
|
`);
|
|
174540
174546
|
return {
|
|
174541
174547
|
...result,
|
|
174542
174548
|
success: true
|
|
174543
174549
|
};
|
|
174544
174550
|
} catch (error) {
|
|
174545
|
-
|
|
174551
|
+
writeFatal(
|
|
174546
174552
|
config,
|
|
174547
174553
|
"A fatal error occurred while running the generator - the process was forced to terminate"
|
|
174548
174554
|
);
|
|
174549
|
-
|
|
174555
|
+
writeError(
|
|
174550
174556
|
config,
|
|
174551
174557
|
`An exception was thrown in the generator's process
|
|
174552
174558
|
- Details: ${error.message}
|
|
@@ -174590,7 +174596,7 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
|
|
|
174590
174596
|
const projects = options8.projects;
|
|
174591
174597
|
const createResolvePackageRoot = (customPackageRoot) => (projectNode) => {
|
|
174592
174598
|
if (projectNode?.data?.root === config?.workspaceRoot || projectNode?.data?.root === ".") {
|
|
174593
|
-
return config?.workspaceRoot ?? (0,
|
|
174599
|
+
return config?.workspaceRoot ?? (0, import_config_tools2.findWorkspaceRoot)();
|
|
174594
174600
|
}
|
|
174595
174601
|
if (!customPackageRoot) {
|
|
174596
174602
|
return projectNode.data.root;
|
|
@@ -174615,11 +174621,11 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
|
|
|
174615
174621
|
const packageRoot = projectNameToPackageRootMap.get(projectName);
|
|
174616
174622
|
const packageJsonPath = (0, import_devkit.joinPathFragments)(packageRoot ?? "./", "package.json");
|
|
174617
174623
|
const workspaceRelativePackageJsonPath = (0, import_node_path.relative)(
|
|
174618
|
-
config?.workspaceRoot ?? (0,
|
|
174624
|
+
config?.workspaceRoot ?? (0, import_config_tools2.findWorkspaceRoot)(),
|
|
174619
174625
|
packageJsonPath
|
|
174620
174626
|
);
|
|
174621
174627
|
const log = (msg) => {
|
|
174622
|
-
(0,
|
|
174628
|
+
(0, import_config_tools2.writeInfo)(config, `${projectName}: ${msg}`);
|
|
174623
174629
|
};
|
|
174624
174630
|
if (!tree.exists(packageJsonPath)) {
|
|
174625
174631
|
throw new Error(
|
|
@@ -174628,7 +174634,7 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
|
|
|
174628
174634
|
To fix this you will either need to add a package.json file at that location, or configure "release" within your nx.json to exclude "${projectName}" from the current release group, or amend the packageRoot configuration to point to where the package.json should be.`
|
|
174629
174635
|
);
|
|
174630
174636
|
}
|
|
174631
|
-
(0,
|
|
174637
|
+
(0, import_config_tools2.writeInfo)(config, `Running release version for project: ${project.name}`);
|
|
174632
174638
|
const projectPackageJson = (0, import_devkit.readJson)(tree, packageJsonPath);
|
|
174633
174639
|
log(
|
|
174634
174640
|
`\u{1F50D} Reading data for package "${projectPackageJson.name}" from ${workspaceRelativePackageJsonPath}`
|