@storm-software/workspace-tools 1.62.6 → 1.62.8
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/README.md +1 -1
- package/index.js +111 -84
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +54 -37
- package/src/executors/tsup/executor.js +75 -57
- package/src/executors/tsup-browser/executor.js +75 -57
- package/src/executors/tsup-neutral/executor.js +75 -57
- package/src/executors/tsup-node/executor.js +75 -57
- package/src/executors/typia/executor.js +29 -21
- package/src/generators/browser-library/generator.js +27 -20
- package/src/generators/config-schema/generator.js +31 -24
- package/src/generators/neutral-library/generator.js +27 -20
- package/src/generators/node-library/generator.js +27 -20
- package/src/generators/preset/generator.js +27 -20
- package/src/generators/release-version/generator.js +32 -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,39 +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
|
-
|
|
176617
|
+
writeDebug(
|
|
176611
176618
|
config,
|
|
176612
176619
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
176613
176620
|
- workspaceRoot: ${workspaceRoot}`
|
|
176614
176621
|
);
|
|
176615
|
-
config = await
|
|
176616
|
-
|
|
176622
|
+
config = await loadStormConfig(workspaceRoot);
|
|
176623
|
+
writeTrace(
|
|
176617
176624
|
config,
|
|
176618
176625
|
`Loaded Storm config into env:
|
|
176619
176626
|
${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.env[key2])}`).join("\n")}`
|
|
176620
176627
|
);
|
|
176621
176628
|
}
|
|
176622
176629
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
176623
|
-
|
|
176630
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
176624
176631
|
options8 = await Promise.resolve(
|
|
176625
176632
|
generatorOptions.hooks.applyDefaultOptions(options8, config)
|
|
176626
176633
|
);
|
|
176627
|
-
|
|
176634
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
176628
176635
|
}
|
|
176629
|
-
|
|
176636
|
+
writeTrace(
|
|
176630
176637
|
config,
|
|
176631
176638
|
`Generator schema options \u2699\uFE0F
|
|
176632
176639
|
${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
@@ -176637,9 +176644,9 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
176637
176644
|
applyWorkspaceGeneratorTokens
|
|
176638
176645
|
);
|
|
176639
176646
|
if (generatorOptions?.hooks?.preProcess) {
|
|
176640
|
-
|
|
176647
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
176641
176648
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
176642
|
-
|
|
176649
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
176643
176650
|
}
|
|
176644
176651
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
176645
176652
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -176648,22 +176655,22 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
176648
176655
|
});
|
|
176649
176656
|
}
|
|
176650
176657
|
if (generatorOptions?.hooks?.postProcess) {
|
|
176651
|
-
|
|
176658
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
176652
176659
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
176653
|
-
|
|
176660
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
176654
176661
|
}
|
|
176655
|
-
|
|
176662
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
176656
176663
|
`);
|
|
176657
176664
|
return {
|
|
176658
176665
|
...result,
|
|
176659
176666
|
success: true
|
|
176660
176667
|
};
|
|
176661
176668
|
} catch (error) {
|
|
176662
|
-
|
|
176669
|
+
writeFatal(
|
|
176663
176670
|
config,
|
|
176664
176671
|
"A fatal error occurred while running the generator - the process was forced to terminate"
|
|
176665
176672
|
);
|
|
176666
|
-
|
|
176673
|
+
writeError(
|
|
176667
176674
|
config,
|
|
176668
176675
|
`An exception was thrown in the generator's process
|
|
176669
176676
|
- Details: ${error.message}
|
|
@@ -176679,14 +176686,14 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
176679
176686
|
|
|
176680
176687
|
// packages/workspace-tools/src/utils/get-project-configurations.ts
|
|
176681
176688
|
var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
|
|
176682
|
-
var
|
|
176683
|
-
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)());
|
|
176684
176691
|
|
|
176685
176692
|
// packages/workspace-tools/src/generators/config-schema/generator.ts
|
|
176686
|
-
var
|
|
176693
|
+
var import_config_tools3 = require("@storm-software/config-tools");
|
|
176687
176694
|
async function configSchemaGeneratorFn(tree, options8, config) {
|
|
176688
176695
|
const projectConfigurations = getProjectConfigurations();
|
|
176689
|
-
const workspaceRoot = config?.workspaceRoot ?? (0,
|
|
176696
|
+
const workspaceRoot = config?.workspaceRoot ?? (0, import_config_tools3.findWorkspaceRoot)();
|
|
176690
176697
|
const modules = await Promise.all(
|
|
176691
176698
|
Object.keys(projectConfigurations).map(async (key2) => {
|
|
176692
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,39 +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
|
-
|
|
391293
|
+
writeDebug(
|
|
391287
391294
|
config,
|
|
391288
391295
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
391289
391296
|
- workspaceRoot: ${workspaceRoot}`
|
|
391290
391297
|
);
|
|
391291
|
-
config = await
|
|
391292
|
-
|
|
391298
|
+
config = await loadStormConfig(workspaceRoot);
|
|
391299
|
+
writeTrace(
|
|
391293
391300
|
config,
|
|
391294
391301
|
`Loaded Storm config into env:
|
|
391295
391302
|
${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.env[key2])}`).join("\n")}`
|
|
391296
391303
|
);
|
|
391297
391304
|
}
|
|
391298
391305
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
391299
|
-
|
|
391306
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
391300
391307
|
options8 = await Promise.resolve(
|
|
391301
391308
|
generatorOptions.hooks.applyDefaultOptions(options8, config)
|
|
391302
391309
|
);
|
|
391303
|
-
|
|
391310
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
391304
391311
|
}
|
|
391305
|
-
|
|
391312
|
+
writeTrace(
|
|
391306
391313
|
config,
|
|
391307
391314
|
`Generator schema options \u2699\uFE0F
|
|
391308
391315
|
${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
@@ -391313,9 +391320,9 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
391313
391320
|
applyWorkspaceGeneratorTokens
|
|
391314
391321
|
);
|
|
391315
391322
|
if (generatorOptions?.hooks?.preProcess) {
|
|
391316
|
-
|
|
391323
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
391317
391324
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
391318
|
-
|
|
391325
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
391319
391326
|
}
|
|
391320
391327
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
391321
391328
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -391324,22 +391331,22 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
391324
391331
|
});
|
|
391325
391332
|
}
|
|
391326
391333
|
if (generatorOptions?.hooks?.postProcess) {
|
|
391327
|
-
|
|
391334
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
391328
391335
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
391329
|
-
|
|
391336
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
391330
391337
|
}
|
|
391331
|
-
|
|
391338
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
391332
391339
|
`);
|
|
391333
391340
|
return {
|
|
391334
391341
|
...result,
|
|
391335
391342
|
success: true
|
|
391336
391343
|
};
|
|
391337
391344
|
} catch (error) {
|
|
391338
|
-
|
|
391345
|
+
writeFatal(
|
|
391339
391346
|
config,
|
|
391340
391347
|
"A fatal error occurred while running the generator - the process was forced to terminate"
|
|
391341
391348
|
);
|
|
391342
|
-
|
|
391349
|
+
writeError(
|
|
391343
391350
|
config,
|
|
391344
391351
|
`An exception was thrown in the generator's process
|
|
391345
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,39 +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
|
-
|
|
391293
|
+
writeDebug(
|
|
391287
391294
|
config,
|
|
391288
391295
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
391289
391296
|
- workspaceRoot: ${workspaceRoot}`
|
|
391290
391297
|
);
|
|
391291
|
-
config = await
|
|
391292
|
-
|
|
391298
|
+
config = await loadStormConfig(workspaceRoot);
|
|
391299
|
+
writeTrace(
|
|
391293
391300
|
config,
|
|
391294
391301
|
`Loaded Storm config into env:
|
|
391295
391302
|
${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.env[key2])}`).join("\n")}`
|
|
391296
391303
|
);
|
|
391297
391304
|
}
|
|
391298
391305
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
391299
|
-
|
|
391306
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
391300
391307
|
options8 = await Promise.resolve(
|
|
391301
391308
|
generatorOptions.hooks.applyDefaultOptions(options8, config)
|
|
391302
391309
|
);
|
|
391303
|
-
|
|
391310
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
391304
391311
|
}
|
|
391305
|
-
|
|
391312
|
+
writeTrace(
|
|
391306
391313
|
config,
|
|
391307
391314
|
`Generator schema options \u2699\uFE0F
|
|
391308
391315
|
${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
@@ -391313,9 +391320,9 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
391313
391320
|
applyWorkspaceGeneratorTokens
|
|
391314
391321
|
);
|
|
391315
391322
|
if (generatorOptions?.hooks?.preProcess) {
|
|
391316
|
-
|
|
391323
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
391317
391324
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
391318
|
-
|
|
391325
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
391319
391326
|
}
|
|
391320
391327
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
391321
391328
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -391324,22 +391331,22 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
391324
391331
|
});
|
|
391325
391332
|
}
|
|
391326
391333
|
if (generatorOptions?.hooks?.postProcess) {
|
|
391327
|
-
|
|
391334
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
391328
391335
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
391329
|
-
|
|
391336
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
391330
391337
|
}
|
|
391331
|
-
|
|
391338
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
391332
391339
|
`);
|
|
391333
391340
|
return {
|
|
391334
391341
|
...result,
|
|
391335
391342
|
success: true
|
|
391336
391343
|
};
|
|
391337
391344
|
} catch (error) {
|
|
391338
|
-
|
|
391345
|
+
writeFatal(
|
|
391339
391346
|
config,
|
|
391340
391347
|
"A fatal error occurred while running the generator - the process was forced to terminate"
|
|
391341
391348
|
);
|
|
391342
|
-
|
|
391349
|
+
writeError(
|
|
391343
391350
|
config,
|
|
391344
391351
|
`An exception was thrown in the generator's process
|
|
391345
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,39 +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
|
-
|
|
172031
|
+
writeDebug(
|
|
172025
172032
|
config,
|
|
172026
172033
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
172027
172034
|
- workspaceRoot: ${workspaceRoot}`
|
|
172028
172035
|
);
|
|
172029
|
-
config = await
|
|
172030
|
-
|
|
172036
|
+
config = await loadStormConfig(workspaceRoot);
|
|
172037
|
+
writeTrace(
|
|
172031
172038
|
config,
|
|
172032
172039
|
`Loaded Storm config into env:
|
|
172033
172040
|
${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.env[key2])}`).join("\n")}`
|
|
172034
172041
|
);
|
|
172035
172042
|
}
|
|
172036
172043
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
172037
|
-
|
|
172044
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
172038
172045
|
options8 = await Promise.resolve(
|
|
172039
172046
|
generatorOptions.hooks.applyDefaultOptions(options8, config)
|
|
172040
172047
|
);
|
|
172041
|
-
|
|
172048
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
172042
172049
|
}
|
|
172043
|
-
|
|
172050
|
+
writeTrace(
|
|
172044
172051
|
config,
|
|
172045
172052
|
`Generator schema options \u2699\uFE0F
|
|
172046
172053
|
${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
@@ -172051,9 +172058,9 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
172051
172058
|
applyWorkspaceGeneratorTokens
|
|
172052
172059
|
);
|
|
172053
172060
|
if (generatorOptions?.hooks?.preProcess) {
|
|
172054
|
-
|
|
172061
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
172055
172062
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
172056
|
-
|
|
172063
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
172057
172064
|
}
|
|
172058
172065
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
172059
172066
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -172062,22 +172069,22 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
172062
172069
|
});
|
|
172063
172070
|
}
|
|
172064
172071
|
if (generatorOptions?.hooks?.postProcess) {
|
|
172065
|
-
|
|
172072
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
172066
172073
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
172067
|
-
|
|
172074
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
172068
172075
|
}
|
|
172069
|
-
|
|
172076
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
172070
172077
|
`);
|
|
172071
172078
|
return {
|
|
172072
172079
|
...result,
|
|
172073
172080
|
success: true
|
|
172074
172081
|
};
|
|
172075
172082
|
} catch (error) {
|
|
172076
|
-
|
|
172083
|
+
writeFatal(
|
|
172077
172084
|
config,
|
|
172078
172085
|
"A fatal error occurred while running the generator - the process was forced to terminate"
|
|
172079
172086
|
);
|
|
172080
|
-
|
|
172087
|
+
writeError(
|
|
172081
172088
|
config,
|
|
172082
172089
|
`An exception was thrown in the generator's process
|
|
172083
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,39 +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
|
-
|
|
174499
|
+
writeDebug(
|
|
174493
174500
|
config,
|
|
174494
174501
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
174495
174502
|
- workspaceRoot: ${workspaceRoot}`
|
|
174496
174503
|
);
|
|
174497
|
-
config = await
|
|
174498
|
-
|
|
174504
|
+
config = await loadStormConfig(workspaceRoot);
|
|
174505
|
+
writeTrace(
|
|
174499
174506
|
config,
|
|
174500
174507
|
`Loaded Storm config into env:
|
|
174501
174508
|
${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.env[key2])}`).join("\n")}`
|
|
174502
174509
|
);
|
|
174503
174510
|
}
|
|
174504
174511
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
174505
|
-
|
|
174512
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
174506
174513
|
options8 = await Promise.resolve(
|
|
174507
174514
|
generatorOptions.hooks.applyDefaultOptions(options8, config)
|
|
174508
174515
|
);
|
|
174509
|
-
|
|
174516
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
174510
174517
|
}
|
|
174511
|
-
|
|
174518
|
+
writeTrace(
|
|
174512
174519
|
config,
|
|
174513
174520
|
`Generator schema options \u2699\uFE0F
|
|
174514
174521
|
${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
@@ -174519,9 +174526,9 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
174519
174526
|
applyWorkspaceGeneratorTokens
|
|
174520
174527
|
);
|
|
174521
174528
|
if (generatorOptions?.hooks?.preProcess) {
|
|
174522
|
-
|
|
174529
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
174523
174530
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
174524
|
-
|
|
174531
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
174525
174532
|
}
|
|
174526
174533
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
174527
174534
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -174530,22 +174537,22 @@ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options
|
|
|
174530
174537
|
});
|
|
174531
174538
|
}
|
|
174532
174539
|
if (generatorOptions?.hooks?.postProcess) {
|
|
174533
|
-
|
|
174540
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
174534
174541
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
174535
|
-
|
|
174542
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
174536
174543
|
}
|
|
174537
|
-
|
|
174544
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
174538
174545
|
`);
|
|
174539
174546
|
return {
|
|
174540
174547
|
...result,
|
|
174541
174548
|
success: true
|
|
174542
174549
|
};
|
|
174543
174550
|
} catch (error) {
|
|
174544
|
-
|
|
174551
|
+
writeFatal(
|
|
174545
174552
|
config,
|
|
174546
174553
|
"A fatal error occurred while running the generator - the process was forced to terminate"
|
|
174547
174554
|
);
|
|
174548
|
-
|
|
174555
|
+
writeError(
|
|
174549
174556
|
config,
|
|
174550
174557
|
`An exception was thrown in the generator's process
|
|
174551
174558
|
- Details: ${error.message}
|
|
@@ -174589,7 +174596,7 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
|
|
|
174589
174596
|
const projects = options8.projects;
|
|
174590
174597
|
const createResolvePackageRoot = (customPackageRoot) => (projectNode) => {
|
|
174591
174598
|
if (projectNode?.data?.root === config?.workspaceRoot || projectNode?.data?.root === ".") {
|
|
174592
|
-
return config?.workspaceRoot ?? (0,
|
|
174599
|
+
return config?.workspaceRoot ?? (0, import_config_tools2.findWorkspaceRoot)();
|
|
174593
174600
|
}
|
|
174594
174601
|
if (!customPackageRoot) {
|
|
174595
174602
|
return projectNode.data.root;
|
|
@@ -174614,11 +174621,11 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
|
|
|
174614
174621
|
const packageRoot = projectNameToPackageRootMap.get(projectName);
|
|
174615
174622
|
const packageJsonPath = (0, import_devkit.joinPathFragments)(packageRoot ?? "./", "package.json");
|
|
174616
174623
|
const workspaceRelativePackageJsonPath = (0, import_node_path.relative)(
|
|
174617
|
-
config?.workspaceRoot ?? (0,
|
|
174624
|
+
config?.workspaceRoot ?? (0, import_config_tools2.findWorkspaceRoot)(),
|
|
174618
174625
|
packageJsonPath
|
|
174619
174626
|
);
|
|
174620
174627
|
const log = (msg) => {
|
|
174621
|
-
(0,
|
|
174628
|
+
(0, import_config_tools2.writeInfo)(config, `${projectName}: ${msg}`);
|
|
174622
174629
|
};
|
|
174623
174630
|
if (!tree.exists(packageJsonPath)) {
|
|
174624
174631
|
throw new Error(
|
|
@@ -174627,7 +174634,7 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
|
|
|
174627
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.`
|
|
174628
174635
|
);
|
|
174629
174636
|
}
|
|
174630
|
-
(0,
|
|
174637
|
+
(0, import_config_tools2.writeInfo)(config, `Running release version for project: ${project.name}`);
|
|
174631
174638
|
const projectPackageJson = (0, import_devkit.readJson)(tree, packageJsonPath);
|
|
174632
174639
|
log(
|
|
174633
174640
|
`\u{1F50D} Reading data for package "${projectPackageJson.name}" from ${workspaceRelativePackageJsonPath}`
|