@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 CHANGED
@@ -1,3 +1,27 @@
1
+ ## 1.62.10 (2024-02-27)
2
+
3
+
4
+ ### 🩹 Fixes
5
+
6
+ - **workspace-tools:** Update all imports to `config-tools` in the package ([85202800](https://github.com/storm-software/storm-ops/commit/85202800))
7
+
8
+
9
+ ### ❤️ Thank You
10
+
11
+ - Patrick Sullivan
12
+
13
+ ## 1.62.9 (2024-02-27)
14
+
15
+
16
+ ### 🩹 Fixes
17
+
18
+ - **config-tools:** Update config packages to only use cjs ([75e4a16b](https://github.com/storm-software/storm-ops/commit/75e4a16b))
19
+
20
+
21
+ ### ❤️ Thank You
22
+
23
+ - Patrick Sullivan
24
+
1
25
  ## 1.62.8 (2024-02-27)
2
26
 
3
27
 
package/declarations.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { StormConfig } from "@storm-software/config-tools";
1
+ import type { StormConfig } from "@storm-software/config";
2
2
  import type { TsupExecutorSchema } from "./src/executors/tsup/schema";
3
3
  import type { ExecutorContext } from "@nx/devkit";
4
4
  import type { Tree } from "@nx/devkit";
package/index.js CHANGED
@@ -476154,8 +476154,7 @@ __export(workspace_tools_exports, {
476154
476154
  module.exports = __toCommonJS(workspace_tools_exports);
476155
476155
 
476156
476156
  // packages/workspace-tools/src/utils/apply-workspace-tokens.ts
476157
- var import_config_tools = require("@storm-software/config-tools");
476158
- var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
476157
+ var applyWorkspaceExecutorTokens = async (option, tokenizerOptions) => {
476159
476158
  let result = option;
476160
476159
  if (!result) {
476161
476160
  return result;
@@ -476198,14 +476197,15 @@ var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
476198
476197
  result = result.replaceAll("{sourceRoot}", sourceRoot);
476199
476198
  }
476200
476199
  if (result.includes("{workspaceRoot}")) {
476200
+ const { findWorkspaceRoot } = await import("@storm-software/config-tools");
476201
476201
  result = result.replaceAll(
476202
476202
  "{workspaceRoot}",
476203
- tokenizerOptions.workspaceRoot ?? (0, import_config_tools.findWorkspaceRoot)()
476203
+ tokenizerOptions.workspaceRoot ?? findWorkspaceRoot()
476204
476204
  );
476205
476205
  }
476206
476206
  return result;
476207
476207
  };
476208
- var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
476208
+ var applyWorkspaceGeneratorTokens = async (option, tokenizerOptions) => {
476209
476209
  let result = option;
476210
476210
  if (!result) {
476211
476211
  return result;
@@ -476221,30 +476221,33 @@ var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
476221
476221
  }
476222
476222
  }
476223
476223
  if (result.includes("{workspaceRoot}")) {
476224
+ const { findWorkspaceRoot } = await import("@storm-software/config-tools");
476224
476225
  result = result.replaceAll(
476225
476226
  "{workspaceRoot}",
476226
- tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ?? (0, import_config_tools.findWorkspaceRoot)()
476227
+ tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ?? findWorkspaceRoot()
476227
476228
  );
476228
476229
  }
476229
476230
  return result;
476230
476231
  };
476231
- var applyWorkspaceTokens = (options8, config, tokenizerFn) => {
476232
- const result = options8;
476233
- if (!result) {
476232
+ var applyWorkspaceTokens = async (options8, config, tokenizerFn) => {
476233
+ if (!options8) {
476234
476234
  return {};
476235
476235
  }
476236
- return Object.keys(options8).reduce((ret, option) => {
476236
+ const result = {};
476237
+ for (const option of Object.keys(options8)) {
476237
476238
  if (typeof options8[option] === "string") {
476238
- ret[option] = tokenizerFn(options8[option], config);
476239
+ result[option] = await Promise.resolve(tokenizerFn(options8[option], config));
476239
476240
  } else if (Array.isArray(options8[option])) {
476240
- ret[option] = options8[option].map(
476241
- (item) => typeof item === "string" ? tokenizerFn(item, config) : item
476241
+ result[option] = await Promise.all(
476242
+ options8[option].map(
476243
+ async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, config)) : item
476244
+ )
476242
476245
  );
476243
476246
  } else if (typeof options8[option] === "object") {
476244
- ret[option] = applyWorkspaceTokens(options8[option], config, tokenizerFn);
476247
+ result[option] = await applyWorkspaceTokens(options8[option], config, tokenizerFn);
476245
476248
  }
476246
- return ret;
476247
- }, {});
476249
+ }
476250
+ return result;
476248
476251
  };
476249
476252
 
476250
476253
  // packages/workspace-tools/src/base/base-executor.ts
@@ -476254,24 +476257,24 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
476254
476257
  writeDebug,
476255
476258
  writeError,
476256
476259
  writeFatal,
476257
- writeInfo: writeInfo3,
476260
+ writeInfo,
476258
476261
  writeSuccess,
476259
476262
  writeTrace,
476260
- findWorkspaceRoot: findWorkspaceRoot5,
476263
+ findWorkspaceRoot,
476261
476264
  loadStormConfig
476262
476265
  } = await import("@storm-software/config-tools");
476263
476266
  const stopwatch = getStopwatch(name);
476264
476267
  let options8 = _options;
476265
476268
  let config;
476266
476269
  try {
476267
- writeInfo3(config, `\u26A1 Running the ${name} executor...
476270
+ writeInfo(config, `\u26A1 Running the ${name} executor...
476268
476271
  `);
476269
476272
  if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
476270
476273
  throw new Error(
476271
476274
  "The Build process failed because the context is not valid. Please run this command from a workspace."
476272
476275
  );
476273
476276
  }
476274
- const workspaceRoot = findWorkspaceRoot5();
476277
+ const workspaceRoot = findWorkspaceRoot();
476275
476278
  const projectRoot = context.projectsConfigurations.projects[context.projectName]?.root ?? workspaceRoot;
476276
476279
  const sourceRoot = context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? workspaceRoot;
476277
476280
  const projectName = context.projectsConfigurations.projects[context.projectName]?.name ?? context.projectName;
@@ -476306,7 +476309,7 @@ ${Object.keys(options8).map(
476306
476309
  (key2) => ` - ${key2}=${_isFunction(options8[key2]) ? "<function>" : JSON.stringify(options8[key2])}`
476307
476310
  ).join("\n")}`
476308
476311
  );
476309
- const tokenized = applyWorkspaceTokens(
476312
+ const tokenized = await applyWorkspaceTokens(
476310
476313
  options8,
476311
476314
  {
476312
476315
  config,
@@ -476375,7 +476378,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
476375
476378
  writeDebug,
476376
476379
  writeError,
476377
476380
  writeFatal,
476378
- writeInfo: writeInfo3,
476381
+ writeInfo,
476379
476382
  writeSuccess,
476380
476383
  writeTrace,
476381
476384
  findWorkspaceRootSafe,
@@ -476385,7 +476388,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
476385
476388
  let options8 = _options;
476386
476389
  let config;
476387
476390
  try {
476388
- writeInfo3(config, `\u26A1 Running the ${name} generator...
476391
+ writeInfo(config, `\u26A1 Running the ${name} generator...
476389
476392
 
476390
476393
  `);
476391
476394
  const workspaceRoot = findWorkspaceRootSafe();
@@ -476414,7 +476417,7 @@ ${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.en
476414
476417
  `Generator schema options \u2699\uFE0F
476415
476418
  ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
476416
476419
  );
476417
- const tokenized = applyWorkspaceTokens(
476420
+ const tokenized = await applyWorkspaceTokens(
476418
476421
  options8,
476419
476422
  { workspaceRoot: tree.root, config },
476420
476423
  applyWorkspaceGeneratorTokens
@@ -476940,23 +476943,30 @@ var getFileBanner = (name, commentStart = "//") => {
476940
476943
  while (name.length + padding.length < 12) {
476941
476944
  padding += " ";
476942
476945
  }
476946
+ let titleName = process.env.STORM_NAMESPACE ?? "";
476947
+ if (titleName) {
476948
+ if (titleName?.startsWith("@")) {
476949
+ titleName = titleName.slice(1);
476950
+ }
476951
+ 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(" ");
476952
+ }
476943
476953
  return `
476944
476954
 
476945
476955
  ${commentStart} -------------------------------------------------------------------
476946
476956
  ${commentStart}
476947
476957
  ${commentStart} ${padding}Storm Software
476948
- ${commentStart} \u26A1 ${process.env.STORM_NAMESPACE} - ${name}
476958
+ ${commentStart} \u26A1 ${titleName ? `${titleName} - ` : ""}${name}
476949
476959
  ${commentStart}
476950
- ${commentStart} This code was released as part of the ${process.env.STORM_NAMESPACE} project. ${process.env.STORM_NAMESPACE}
476960
+ ${commentStart} This code was released as part of the ${titleName ? `${titleName} ` : ""}project. ${titleName ? titleName : "This project"}
476951
476961
  ${commentStart} is maintained by Storm Software under the ${process.env.STORM_LICENSE ?? "Apache License 2.0"}, and is
476952
476962
  ${commentStart} free for commercial and private use. For more information, please visit
476953
476963
  ${commentStart} our licensing page.
476954
476964
  ${commentStart}
476955
476965
  ${commentStart} Website: ${process.env.STORM_HOMEPAGE ?? "https://stormsoftware.org"}
476956
476966
  ${commentStart} Repository: ${process.env.STORM_REPOSITORY ?? "https://github.com/storm-software/storm-stack"}
476957
- ${commentStart} Documentation: https://stormsoftware.org/docs/storm-stack
476958
- ${commentStart} Contact: https://stormsoftware.org/contact
476959
- ${commentStart} Licensing: https://stormsoftware.org/licensing
476967
+ ${commentStart} Documentation: https://stormsoftware.org/docs${titleName?.startsWith("@") ? `/${titleName.slice(1)}` : ""}
476968
+ ${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
476969
+ ${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
476960
476970
  ${commentStart}
476961
476971
  ${commentStart} -------------------------------------------------------------------
476962
476972
 
@@ -477067,8 +477077,8 @@ var applyDefaultOptions = (options8) => {
477067
477077
  return options8;
477068
477078
  };
477069
477079
  var runTsupBuild = async (context, config, options8) => {
477070
- const { LogLevel, getLogLevel, writeInfo: writeInfo3, writeWarning, findWorkspaceRoot: findWorkspaceRoot5 } = await import("@storm-software/config-tools");
477071
- const workspaceRoot = config?.workspaceRoot ?? findWorkspaceRoot5();
477080
+ const { LogLevel, getLogLevel, writeInfo, writeWarning, findWorkspaceRoot } = await import("@storm-software/config-tools");
477081
+ const workspaceRoot = config?.workspaceRoot ?? findWorkspaceRoot();
477072
477082
  const stormEnv = Object.keys(options8.env ?? {}).filter((key2) => key2.startsWith("STORM_")).reduce((ret, key2) => {
477073
477083
  ret[key2] = options8.env?.[key2];
477074
477084
  return ret;
@@ -477127,7 +477137,7 @@ ${options8.banner}
477127
477137
  outputPath: options8.outputPath
477128
477138
  };
477129
477139
  if (options8.getConfig) {
477130
- writeInfo3(config, "\u26A1 Running the Build process");
477140
+ writeInfo(config, "\u26A1 Running the Build process");
477131
477141
  const getConfigFns = [options8.getConfig];
477132
477142
  const tsupConfig = (0, import_tsup.defineConfig)(
477133
477143
  getConfigFns.map(
@@ -483407,8 +483417,10 @@ var import_fileutils = require("nx/src/utils/fileutils.js");
483407
483417
 
483408
483418
  // packages/workspace-tools/src/utils/get-project-configurations.ts
483409
483419
  var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
483410
- var import_config_tools2 = require("@storm-software/config-tools");
483411
- var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)((0, import_config_tools2.findWorkspaceRoot)());
483420
+ var getProjectConfigurations = async () => {
483421
+ const { findWorkspaceRoot } = await import("@storm-software/config-tools");
483422
+ return (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(findWorkspaceRoot());
483423
+ };
483412
483424
  var getProjectConfiguration = (projectName) => getProjectConfigurations()?.[projectName];
483413
483425
 
483414
483426
  // packages/workspace-tools/src/utils/get-project-deps.ts
@@ -483472,13 +483484,13 @@ async function tsupExecutorFn(options8, context, config) {
483472
483484
  LogLevel,
483473
483485
  getLogLevel,
483474
483486
  writeDebug,
483475
- writeInfo: writeInfo3,
483487
+ writeInfo,
483476
483488
  writeSuccess,
483477
483489
  writeTrace,
483478
483490
  writeWarning,
483479
- findWorkspaceRoot: findWorkspaceRoot5
483491
+ findWorkspaceRoot
483480
483492
  } = await import("@storm-software/config-tools");
483481
- writeInfo3(config, "\u{1F4E6} Running Storm build executor on the workspace");
483493
+ writeInfo(config, "\u{1F4E6} Running Storm build executor on the workspace");
483482
483494
  writeDebug(
483483
483495
  config,
483484
483496
  `\u2699\uFE0F Executor options:
@@ -483492,11 +483504,11 @@ ${Object.keys(options8).map(
483492
483504
  "The Build process failed because the context is not valid. Please run this command from a workspace."
483493
483505
  );
483494
483506
  }
483495
- const workspaceRoot = findWorkspaceRoot5();
483507
+ const workspaceRoot = findWorkspaceRoot();
483496
483508
  const projectRoot = context.projectsConfigurations.projects[context.projectName]?.root ?? workspaceRoot;
483497
483509
  const sourceRoot = context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? workspaceRoot;
483498
483510
  if (options8.clean !== false) {
483499
- writeInfo3(config, `\u{1F9F9} Cleaning output path: ${options8.outputPath}`);
483511
+ writeInfo(config, `\u{1F9F9} Cleaning output path: ${options8.outputPath}`);
483500
483512
  (0, import_fs_extra.removeSync)(options8.outputPath);
483501
483513
  }
483502
483514
  const assets = Array.from(options8.assets);
@@ -484194,12 +484206,12 @@ var executor_default4 = withRunExecutor(
484194
484206
  );
484195
484207
 
484196
484208
  // packages/workspace-tools/src/executors/typia/executor.ts
484197
- var import_config_tools3 = require("@storm-software/config-tools");
484198
484209
  var import_fs_extra2 = __toESM(require_lib4());
484199
484210
  var import_TypiaProgrammer = __toESM(require_TypiaProgrammer());
484200
484211
  async function typiaExecutorFn(options8, _4, config) {
484212
+ const { writeInfo } = await import("@storm-software/config-tools");
484201
484213
  if (options8.clean !== false) {
484202
- (0, import_config_tools3.writeInfo)(config, `\u{1F9F9} Cleaning output path: ${options8.outputPath}`);
484214
+ writeInfo(config, `\u{1F9F9} Cleaning output path: ${options8.outputPath}`);
484203
484215
  (0, import_fs_extra2.removeSync)(options8.outputPath);
484204
484216
  }
484205
484217
  await import_TypiaProgrammer.TypiaProgrammer.build({
@@ -488823,10 +488835,10 @@ var zodToJsonSchema = (schema2, options8) => {
488823
488835
  };
488824
488836
 
488825
488837
  // packages/workspace-tools/src/generators/config-schema/generator.ts
488826
- var import_config_tools4 = require("@storm-software/config-tools");
488827
488838
  async function configSchemaGeneratorFn(tree, options8, config) {
488839
+ const { findWorkspaceRoot } = await import("@storm-software/config-tools");
488828
488840
  const projectConfigurations = getProjectConfigurations();
488829
- const workspaceRoot = config?.workspaceRoot ?? (0, import_config_tools4.findWorkspaceRoot)();
488841
+ const workspaceRoot = config?.workspaceRoot ?? findWorkspaceRoot();
488830
488842
  const modules = await Promise.all(
488831
488843
  Object.keys(projectConfigurations).map(async (key2) => {
488832
488844
  if (projectConfigurations[key2]?.config) {
@@ -489160,7 +489172,6 @@ var import_version = require("nx/src/command-line/release/version");
489160
489172
  var import_utils2 = require("nx/src/tasks-runner/utils");
489161
489173
  var import_semver = require("nx/src/command-line/release/utils/semver");
489162
489174
  var import_node_path4 = require("node:path");
489163
- var import_config_tools5 = require("@storm-software/config-tools");
489164
489175
  var import_update_lock_file = __toESM(require_update_lock_file());
489165
489176
  var import_node_child_process = require("node:child_process");
489166
489177
  var import_git = require("nx/src/command-line/release/utils/git");
@@ -489169,6 +489180,7 @@ var import_config2 = require("nx/src/command-line/release/config/config");
489169
489180
  var import_semver2 = __toESM(require_semver3());
489170
489181
  var import_resolve_local_package_dependencies = __toESM(require_resolve_local_package_dependencies());
489171
489182
  async function releaseVersionGeneratorFn(tree, options8, config) {
489183
+ const { writeInfo, findWorkspaceRoot } = await import("@storm-software/config-tools");
489172
489184
  const versionData = {};
489173
489185
  if (options8.specifier) {
489174
489186
  if (!(0, import_semver.isValidSemverSpecifier)(options8.specifier)) {
@@ -489191,7 +489203,7 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
489191
489203
  const projects = options8.projects;
489192
489204
  const createResolvePackageRoot = (customPackageRoot) => (projectNode) => {
489193
489205
  if (projectNode?.data?.root === config?.workspaceRoot || projectNode?.data?.root === ".") {
489194
- return config?.workspaceRoot ?? (0, import_config_tools5.findWorkspaceRoot)();
489206
+ return config?.workspaceRoot ?? findWorkspaceRoot();
489195
489207
  }
489196
489208
  if (!customPackageRoot) {
489197
489209
  return projectNode.data.root;
@@ -489216,11 +489228,11 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
489216
489228
  const packageRoot = projectNameToPackageRootMap.get(projectName);
489217
489229
  const packageJsonPath = (0, import_devkit13.joinPathFragments)(packageRoot ?? "./", "package.json");
489218
489230
  const workspaceRelativePackageJsonPath = (0, import_node_path4.relative)(
489219
- config?.workspaceRoot ?? (0, import_config_tools5.findWorkspaceRoot)(),
489231
+ config?.workspaceRoot ?? findWorkspaceRoot(),
489220
489232
  packageJsonPath
489221
489233
  );
489222
489234
  const log = (msg) => {
489223
- (0, import_config_tools5.writeInfo)(config, `${projectName}: ${msg}`);
489235
+ writeInfo(config, `${projectName}: ${msg}`);
489224
489236
  };
489225
489237
  if (!tree.exists(packageJsonPath)) {
489226
489238
  throw new Error(
@@ -489229,7 +489241,7 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
489229
489241
  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.`
489230
489242
  );
489231
489243
  }
489232
- (0, import_config_tools5.writeInfo)(config, `Running release version for project: ${project.name}`);
489244
+ writeInfo(config, `Running release version for project: ${project.name}`);
489233
489245
  const projectPackageJson = (0, import_devkit13.readJson)(tree, packageJsonPath);
489234
489246
  log(
489235
489247
  `\u{1F50D} Reading data for package "${projectPackageJson.name}" from ${workspaceRelativePackageJsonPath}`