@storm-software/workspace-tools 1.62.8 → 1.62.10
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/declarations.d.ts +1 -1
- package/index.js +59 -47
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +22 -19
- package/src/executors/tsup/executor.js +26 -22
- package/src/executors/tsup-browser/executor.js +38 -27
- package/src/executors/tsup-neutral/executor.js +38 -27
- package/src/executors/tsup-node/executor.js +38 -27
- package/src/executors/typia/executor.js +22 -20
- package/src/generators/browser-library/generator.js +16 -14
- package/src/generators/config-schema/generator.js +22 -18
- package/src/generators/neutral-library/generator.js +16 -14
- package/src/generators/node-library/generator.js +16 -14
- package/src/generators/preset/generator.js +16 -14
- package/src/generators/release-version/generator.js +23 -21
- package/src/utils/index.js +36 -24
|
@@ -174425,12 +174425,10 @@ 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_tools2 = require("@storm-software/config-tools");
|
|
174429
174428
|
var import_update_lock_file = __toESM(require_update_lock_file());
|
|
174430
174429
|
|
|
174431
174430
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
174432
|
-
var
|
|
174433
|
-
var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
174431
|
+
var applyWorkspaceGeneratorTokens = async (option, tokenizerOptions) => {
|
|
174434
174432
|
let result = option;
|
|
174435
174433
|
if (!result) {
|
|
174436
174434
|
return result;
|
|
@@ -174446,30 +174444,33 @@ var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
|
174446
174444
|
}
|
|
174447
174445
|
}
|
|
174448
174446
|
if (result.includes("{workspaceRoot}")) {
|
|
174447
|
+
const { findWorkspaceRoot } = await import("@storm-software/config-tools");
|
|
174449
174448
|
result = result.replaceAll(
|
|
174450
174449
|
"{workspaceRoot}",
|
|
174451
|
-
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ??
|
|
174450
|
+
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ?? findWorkspaceRoot()
|
|
174452
174451
|
);
|
|
174453
174452
|
}
|
|
174454
174453
|
return result;
|
|
174455
174454
|
};
|
|
174456
|
-
var applyWorkspaceTokens = (options8, config, tokenizerFn) => {
|
|
174457
|
-
|
|
174458
|
-
if (!result) {
|
|
174455
|
+
var applyWorkspaceTokens = async (options8, config, tokenizerFn) => {
|
|
174456
|
+
if (!options8) {
|
|
174459
174457
|
return {};
|
|
174460
174458
|
}
|
|
174461
|
-
|
|
174459
|
+
const result = {};
|
|
174460
|
+
for (const option of Object.keys(options8)) {
|
|
174462
174461
|
if (typeof options8[option] === "string") {
|
|
174463
|
-
|
|
174462
|
+
result[option] = await Promise.resolve(tokenizerFn(options8[option], config));
|
|
174464
174463
|
} else if (Array.isArray(options8[option])) {
|
|
174465
|
-
|
|
174466
|
-
(
|
|
174464
|
+
result[option] = await Promise.all(
|
|
174465
|
+
options8[option].map(
|
|
174466
|
+
async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, config)) : item
|
|
174467
|
+
)
|
|
174467
174468
|
);
|
|
174468
174469
|
} else if (typeof options8[option] === "object") {
|
|
174469
|
-
|
|
174470
|
+
result[option] = await applyWorkspaceTokens(options8[option], config, tokenizerFn);
|
|
174470
174471
|
}
|
|
174471
|
-
|
|
174472
|
-
|
|
174472
|
+
}
|
|
174473
|
+
return result;
|
|
174473
174474
|
};
|
|
174474
174475
|
|
|
174475
174476
|
// packages/workspace-tools/src/base/base-generator.ts
|
|
@@ -174481,7 +174482,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
174481
174482
|
writeDebug,
|
|
174482
174483
|
writeError,
|
|
174483
174484
|
writeFatal,
|
|
174484
|
-
writeInfo
|
|
174485
|
+
writeInfo,
|
|
174485
174486
|
writeSuccess,
|
|
174486
174487
|
writeTrace,
|
|
174487
174488
|
findWorkspaceRootSafe,
|
|
@@ -174491,7 +174492,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
174491
174492
|
let options8 = _options;
|
|
174492
174493
|
let config;
|
|
174493
174494
|
try {
|
|
174494
|
-
|
|
174495
|
+
writeInfo(config, `\u26A1 Running the ${name} generator...
|
|
174495
174496
|
|
|
174496
174497
|
`);
|
|
174497
174498
|
const workspaceRoot = findWorkspaceRootSafe();
|
|
@@ -174520,7 +174521,7 @@ ${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.en
|
|
|
174520
174521
|
`Generator schema options \u2699\uFE0F
|
|
174521
174522
|
${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
174522
174523
|
);
|
|
174523
|
-
const tokenized = applyWorkspaceTokens(
|
|
174524
|
+
const tokenized = await applyWorkspaceTokens(
|
|
174524
174525
|
options8,
|
|
174525
174526
|
{ workspaceRoot: tree.root, config },
|
|
174526
174527
|
applyWorkspaceGeneratorTokens
|
|
@@ -174574,6 +174575,7 @@ var import_config = require("nx/src/command-line/release/config/config");
|
|
|
174574
174575
|
var import_semver2 = __toESM(require_semver3());
|
|
174575
174576
|
var import_resolve_local_package_dependencies = __toESM(require_resolve_local_package_dependencies());
|
|
174576
174577
|
async function releaseVersionGeneratorFn(tree, options8, config) {
|
|
174578
|
+
const { writeInfo, findWorkspaceRoot } = await import("@storm-software/config-tools");
|
|
174577
174579
|
const versionData = {};
|
|
174578
174580
|
if (options8.specifier) {
|
|
174579
174581
|
if (!(0, import_semver.isValidSemverSpecifier)(options8.specifier)) {
|
|
@@ -174596,7 +174598,7 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
|
|
|
174596
174598
|
const projects = options8.projects;
|
|
174597
174599
|
const createResolvePackageRoot = (customPackageRoot) => (projectNode) => {
|
|
174598
174600
|
if (projectNode?.data?.root === config?.workspaceRoot || projectNode?.data?.root === ".") {
|
|
174599
|
-
return config?.workspaceRoot ??
|
|
174601
|
+
return config?.workspaceRoot ?? findWorkspaceRoot();
|
|
174600
174602
|
}
|
|
174601
174603
|
if (!customPackageRoot) {
|
|
174602
174604
|
return projectNode.data.root;
|
|
@@ -174621,11 +174623,11 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
|
|
|
174621
174623
|
const packageRoot = projectNameToPackageRootMap.get(projectName);
|
|
174622
174624
|
const packageJsonPath = (0, import_devkit.joinPathFragments)(packageRoot ?? "./", "package.json");
|
|
174623
174625
|
const workspaceRelativePackageJsonPath = (0, import_node_path.relative)(
|
|
174624
|
-
config?.workspaceRoot ??
|
|
174626
|
+
config?.workspaceRoot ?? findWorkspaceRoot(),
|
|
174625
174627
|
packageJsonPath
|
|
174626
174628
|
);
|
|
174627
174629
|
const log = (msg) => {
|
|
174628
|
-
|
|
174630
|
+
writeInfo(config, `${projectName}: ${msg}`);
|
|
174629
174631
|
};
|
|
174630
174632
|
if (!tree.exists(packageJsonPath)) {
|
|
174631
174633
|
throw new Error(
|
|
@@ -174634,7 +174636,7 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
|
|
|
174634
174636
|
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.`
|
|
174635
174637
|
);
|
|
174636
174638
|
}
|
|
174637
|
-
|
|
174639
|
+
writeInfo(config, `Running release version for project: ${project.name}`);
|
|
174638
174640
|
const projectPackageJson = (0, import_devkit.readJson)(tree, packageJsonPath);
|
|
174639
174641
|
log(
|
|
174640
174642
|
`\u{1F50D} Reading data for package "${projectPackageJson.name}" from ${workspaceRelativePackageJsonPath}`
|
package/src/utils/index.js
CHANGED
|
@@ -459217,8 +459217,7 @@ __export(utils_exports, {
|
|
|
459217
459217
|
module.exports = __toCommonJS(utils_exports);
|
|
459218
459218
|
|
|
459219
459219
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
459220
|
-
var
|
|
459221
|
-
var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
|
|
459220
|
+
var applyWorkspaceExecutorTokens = async (option, tokenizerOptions) => {
|
|
459222
459221
|
let result = option;
|
|
459223
459222
|
if (!result) {
|
|
459224
459223
|
return result;
|
|
@@ -459261,14 +459260,15 @@ var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
|
|
|
459261
459260
|
result = result.replaceAll("{sourceRoot}", sourceRoot);
|
|
459262
459261
|
}
|
|
459263
459262
|
if (result.includes("{workspaceRoot}")) {
|
|
459263
|
+
const { findWorkspaceRoot } = await import("@storm-software/config-tools");
|
|
459264
459264
|
result = result.replaceAll(
|
|
459265
459265
|
"{workspaceRoot}",
|
|
459266
|
-
tokenizerOptions.workspaceRoot ??
|
|
459266
|
+
tokenizerOptions.workspaceRoot ?? findWorkspaceRoot()
|
|
459267
459267
|
);
|
|
459268
459268
|
}
|
|
459269
459269
|
return result;
|
|
459270
459270
|
};
|
|
459271
|
-
var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
459271
|
+
var applyWorkspaceGeneratorTokens = async (option, tokenizerOptions) => {
|
|
459272
459272
|
let result = option;
|
|
459273
459273
|
if (!result) {
|
|
459274
459274
|
return result;
|
|
@@ -459284,30 +459284,33 @@ var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
|
459284
459284
|
}
|
|
459285
459285
|
}
|
|
459286
459286
|
if (result.includes("{workspaceRoot}")) {
|
|
459287
|
+
const { findWorkspaceRoot } = await import("@storm-software/config-tools");
|
|
459287
459288
|
result = result.replaceAll(
|
|
459288
459289
|
"{workspaceRoot}",
|
|
459289
|
-
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ??
|
|
459290
|
+
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ?? findWorkspaceRoot()
|
|
459290
459291
|
);
|
|
459291
459292
|
}
|
|
459292
459293
|
return result;
|
|
459293
459294
|
};
|
|
459294
|
-
var applyWorkspaceTokens = (options8, config, tokenizerFn) => {
|
|
459295
|
-
|
|
459296
|
-
if (!result) {
|
|
459295
|
+
var applyWorkspaceTokens = async (options8, config, tokenizerFn) => {
|
|
459296
|
+
if (!options8) {
|
|
459297
459297
|
return {};
|
|
459298
459298
|
}
|
|
459299
|
-
|
|
459299
|
+
const result = {};
|
|
459300
|
+
for (const option of Object.keys(options8)) {
|
|
459300
459301
|
if (typeof options8[option] === "string") {
|
|
459301
|
-
|
|
459302
|
+
result[option] = await Promise.resolve(tokenizerFn(options8[option], config));
|
|
459302
459303
|
} else if (Array.isArray(options8[option])) {
|
|
459303
|
-
|
|
459304
|
-
(
|
|
459304
|
+
result[option] = await Promise.all(
|
|
459305
|
+
options8[option].map(
|
|
459306
|
+
async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, config)) : item
|
|
459307
|
+
)
|
|
459305
459308
|
);
|
|
459306
459309
|
} else if (typeof options8[option] === "object") {
|
|
459307
|
-
|
|
459310
|
+
result[option] = await applyWorkspaceTokens(options8[option], config, tokenizerFn);
|
|
459308
459311
|
}
|
|
459309
|
-
|
|
459310
|
-
|
|
459312
|
+
}
|
|
459313
|
+
return result;
|
|
459311
459314
|
};
|
|
459312
459315
|
|
|
459313
459316
|
// packages/workspace-tools/src/utils/file-path-utils.ts
|
|
@@ -459332,23 +459335,30 @@ var getFileBanner = (name, commentStart = "//") => {
|
|
|
459332
459335
|
while (name.length + padding.length < 12) {
|
|
459333
459336
|
padding += " ";
|
|
459334
459337
|
}
|
|
459338
|
+
let titleName = process.env.STORM_NAMESPACE ?? "";
|
|
459339
|
+
if (titleName) {
|
|
459340
|
+
if (titleName?.startsWith("@")) {
|
|
459341
|
+
titleName = titleName.slice(1);
|
|
459342
|
+
}
|
|
459343
|
+
titleName = (titleName.charAt(0).toUpperCase() + titleName.slice(1)).split("-").filter((word) => word && word.length > 0).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
459344
|
+
}
|
|
459335
459345
|
return `
|
|
459336
459346
|
|
|
459337
459347
|
${commentStart} -------------------------------------------------------------------
|
|
459338
459348
|
${commentStart}
|
|
459339
459349
|
${commentStart} ${padding}Storm Software
|
|
459340
|
-
${commentStart} \u26A1 ${
|
|
459350
|
+
${commentStart} \u26A1 ${titleName ? `${titleName} - ` : ""}${name}
|
|
459341
459351
|
${commentStart}
|
|
459342
|
-
${commentStart} This code was released as part of the ${
|
|
459352
|
+
${commentStart} This code was released as part of the ${titleName ? `${titleName} ` : ""}project. ${titleName ? titleName : "This project"}
|
|
459343
459353
|
${commentStart} is maintained by Storm Software under the ${process.env.STORM_LICENSE ?? "Apache License 2.0"}, and is
|
|
459344
459354
|
${commentStart} free for commercial and private use. For more information, please visit
|
|
459345
459355
|
${commentStart} our licensing page.
|
|
459346
459356
|
${commentStart}
|
|
459347
459357
|
${commentStart} Website: ${process.env.STORM_HOMEPAGE ?? "https://stormsoftware.org"}
|
|
459348
459358
|
${commentStart} Repository: ${process.env.STORM_REPOSITORY ?? "https://github.com/storm-software/storm-stack"}
|
|
459349
|
-
${commentStart} Documentation: https://stormsoftware.org/docs
|
|
459350
|
-
${commentStart} Contact: https://stormsoftware.org/contact
|
|
459351
|
-
${commentStart} Licensing: https://stormsoftware.org/licensing
|
|
459359
|
+
${commentStart} Documentation: https://stormsoftware.org/docs${titleName?.startsWith("@") ? `/${titleName.slice(1)}` : ""}
|
|
459360
|
+
${commentStart} Contact: ${process.env.STORM_HOMEPAGE ? process.env.STORM_HOMEPAGE.endsWith("/") ? process.env.STORM_HOMEPAGE.slice(-1) : process.env.STORM_HOMEPAGE : "https://stormsoftware.org"}/contact
|
|
459361
|
+
${commentStart} Licensing: ${process.env.STORM_HOMEPAGE ? process.env.STORM_HOMEPAGE.endsWith("/") ? process.env.STORM_HOMEPAGE.slice(-1) : process.env.STORM_HOMEPAGE : "https://stormsoftware.org"}/licensing
|
|
459352
459362
|
${commentStart}
|
|
459353
459363
|
${commentStart} -------------------------------------------------------------------
|
|
459354
459364
|
|
|
@@ -459358,8 +459368,10 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
459358
459368
|
|
|
459359
459369
|
// packages/workspace-tools/src/utils/get-project-configurations.ts
|
|
459360
459370
|
var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
|
|
459361
|
-
var
|
|
459362
|
-
|
|
459371
|
+
var getProjectConfigurations = async () => {
|
|
459372
|
+
const { findWorkspaceRoot } = await import("@storm-software/config-tools");
|
|
459373
|
+
return (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(findWorkspaceRoot());
|
|
459374
|
+
};
|
|
459363
459375
|
var getProjectConfiguration = (projectName) => getProjectConfigurations()?.[projectName];
|
|
459364
459376
|
|
|
459365
459377
|
// packages/workspace-tools/src/utils/get-project-deps.ts
|
|
@@ -459635,8 +459647,8 @@ var applyDefaultOptions = (options8) => {
|
|
|
459635
459647
|
return options8;
|
|
459636
459648
|
};
|
|
459637
459649
|
var runTsupBuild = async (context, config, options8) => {
|
|
459638
|
-
const { LogLevel, getLogLevel, writeInfo, writeWarning, findWorkspaceRoot
|
|
459639
|
-
const workspaceRoot = config?.workspaceRoot ??
|
|
459650
|
+
const { LogLevel, getLogLevel, writeInfo, writeWarning, findWorkspaceRoot } = await import("@storm-software/config-tools");
|
|
459651
|
+
const workspaceRoot = config?.workspaceRoot ?? findWorkspaceRoot();
|
|
459640
459652
|
const stormEnv = Object.keys(options8.env ?? {}).filter((key2) => key2.startsWith("STORM_")).reduce((ret, key2) => {
|
|
459641
459653
|
ret[key2] = options8.env?.[key2];
|
|
459642
459654
|
return ret;
|