@storm-software/workspace-tools 1.62.8 → 1.62.9

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,15 @@
1
+ ## 1.62.9 (2024-02-27)
2
+
3
+
4
+ ### 🩹 Fixes
5
+
6
+ - **config-tools:** Update config packages to only use cjs ([75e4a16b](https://github.com/storm-software/storm-ops/commit/75e4a16b))
7
+
8
+
9
+ ### ❤️ Thank You
10
+
11
+ - Patrick Sullivan
12
+
1
13
  ## 1.62.8 (2024-02-27)
2
14
 
3
15
 
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
@@ -477067,8 +477070,8 @@ var applyDefaultOptions = (options8) => {
477067
477070
  return options8;
477068
477071
  };
477069
477072
  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();
477073
+ const { LogLevel, getLogLevel, writeInfo, writeWarning, findWorkspaceRoot } = await import("@storm-software/config-tools");
477074
+ const workspaceRoot = config?.workspaceRoot ?? findWorkspaceRoot();
477072
477075
  const stormEnv = Object.keys(options8.env ?? {}).filter((key2) => key2.startsWith("STORM_")).reduce((ret, key2) => {
477073
477076
  ret[key2] = options8.env?.[key2];
477074
477077
  return ret;
@@ -477127,7 +477130,7 @@ ${options8.banner}
477127
477130
  outputPath: options8.outputPath
477128
477131
  };
477129
477132
  if (options8.getConfig) {
477130
- writeInfo3(config, "\u26A1 Running the Build process");
477133
+ writeInfo(config, "\u26A1 Running the Build process");
477131
477134
  const getConfigFns = [options8.getConfig];
477132
477135
  const tsupConfig = (0, import_tsup.defineConfig)(
477133
477136
  getConfigFns.map(
@@ -483407,8 +483410,10 @@ var import_fileutils = require("nx/src/utils/fileutils.js");
483407
483410
 
483408
483411
  // packages/workspace-tools/src/utils/get-project-configurations.ts
483409
483412
  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)());
483413
+ var getProjectConfigurations = async () => {
483414
+ const { findWorkspaceRoot } = await import("@storm-software/config-tools");
483415
+ return (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(findWorkspaceRoot());
483416
+ };
483412
483417
  var getProjectConfiguration = (projectName) => getProjectConfigurations()?.[projectName];
483413
483418
 
483414
483419
  // packages/workspace-tools/src/utils/get-project-deps.ts
@@ -483472,13 +483477,13 @@ async function tsupExecutorFn(options8, context, config) {
483472
483477
  LogLevel,
483473
483478
  getLogLevel,
483474
483479
  writeDebug,
483475
- writeInfo: writeInfo3,
483480
+ writeInfo,
483476
483481
  writeSuccess,
483477
483482
  writeTrace,
483478
483483
  writeWarning,
483479
- findWorkspaceRoot: findWorkspaceRoot5
483484
+ findWorkspaceRoot
483480
483485
  } = await import("@storm-software/config-tools");
483481
- writeInfo3(config, "\u{1F4E6} Running Storm build executor on the workspace");
483486
+ writeInfo(config, "\u{1F4E6} Running Storm build executor on the workspace");
483482
483487
  writeDebug(
483483
483488
  config,
483484
483489
  `\u2699\uFE0F Executor options:
@@ -483492,11 +483497,11 @@ ${Object.keys(options8).map(
483492
483497
  "The Build process failed because the context is not valid. Please run this command from a workspace."
483493
483498
  );
483494
483499
  }
483495
- const workspaceRoot = findWorkspaceRoot5();
483500
+ const workspaceRoot = findWorkspaceRoot();
483496
483501
  const projectRoot = context.projectsConfigurations.projects[context.projectName]?.root ?? workspaceRoot;
483497
483502
  const sourceRoot = context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? workspaceRoot;
483498
483503
  if (options8.clean !== false) {
483499
- writeInfo3(config, `\u{1F9F9} Cleaning output path: ${options8.outputPath}`);
483504
+ writeInfo(config, `\u{1F9F9} Cleaning output path: ${options8.outputPath}`);
483500
483505
  (0, import_fs_extra.removeSync)(options8.outputPath);
483501
483506
  }
483502
483507
  const assets = Array.from(options8.assets);
@@ -484194,12 +484199,12 @@ var executor_default4 = withRunExecutor(
484194
484199
  );
484195
484200
 
484196
484201
  // packages/workspace-tools/src/executors/typia/executor.ts
484197
- var import_config_tools3 = require("@storm-software/config-tools");
484198
484202
  var import_fs_extra2 = __toESM(require_lib4());
484199
484203
  var import_TypiaProgrammer = __toESM(require_TypiaProgrammer());
484200
484204
  async function typiaExecutorFn(options8, _4, config) {
484205
+ const { writeInfo } = await import("@storm-software/config-tools");
484201
484206
  if (options8.clean !== false) {
484202
- (0, import_config_tools3.writeInfo)(config, `\u{1F9F9} Cleaning output path: ${options8.outputPath}`);
484207
+ writeInfo(config, `\u{1F9F9} Cleaning output path: ${options8.outputPath}`);
484203
484208
  (0, import_fs_extra2.removeSync)(options8.outputPath);
484204
484209
  }
484205
484210
  await import_TypiaProgrammer.TypiaProgrammer.build({
@@ -488823,10 +488828,10 @@ var zodToJsonSchema = (schema2, options8) => {
488823
488828
  };
488824
488829
 
488825
488830
  // packages/workspace-tools/src/generators/config-schema/generator.ts
488826
- var import_config_tools4 = require("@storm-software/config-tools");
488827
488831
  async function configSchemaGeneratorFn(tree, options8, config) {
488832
+ const { findWorkspaceRoot } = await import("@storm-software/config-tools");
488828
488833
  const projectConfigurations = getProjectConfigurations();
488829
- const workspaceRoot = config?.workspaceRoot ?? (0, import_config_tools4.findWorkspaceRoot)();
488834
+ const workspaceRoot = config?.workspaceRoot ?? findWorkspaceRoot();
488830
488835
  const modules = await Promise.all(
488831
488836
  Object.keys(projectConfigurations).map(async (key2) => {
488832
488837
  if (projectConfigurations[key2]?.config) {
@@ -489160,7 +489165,6 @@ var import_version = require("nx/src/command-line/release/version");
489160
489165
  var import_utils2 = require("nx/src/tasks-runner/utils");
489161
489166
  var import_semver = require("nx/src/command-line/release/utils/semver");
489162
489167
  var import_node_path4 = require("node:path");
489163
- var import_config_tools5 = require("@storm-software/config-tools");
489164
489168
  var import_update_lock_file = __toESM(require_update_lock_file());
489165
489169
  var import_node_child_process = require("node:child_process");
489166
489170
  var import_git = require("nx/src/command-line/release/utils/git");
@@ -489169,6 +489173,7 @@ var import_config2 = require("nx/src/command-line/release/config/config");
489169
489173
  var import_semver2 = __toESM(require_semver3());
489170
489174
  var import_resolve_local_package_dependencies = __toESM(require_resolve_local_package_dependencies());
489171
489175
  async function releaseVersionGeneratorFn(tree, options8, config) {
489176
+ const { writeInfo, findWorkspaceRoot } = await import("@storm-software/config-tools");
489172
489177
  const versionData = {};
489173
489178
  if (options8.specifier) {
489174
489179
  if (!(0, import_semver.isValidSemverSpecifier)(options8.specifier)) {
@@ -489191,7 +489196,7 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
489191
489196
  const projects = options8.projects;
489192
489197
  const createResolvePackageRoot = (customPackageRoot) => (projectNode) => {
489193
489198
  if (projectNode?.data?.root === config?.workspaceRoot || projectNode?.data?.root === ".") {
489194
- return config?.workspaceRoot ?? (0, import_config_tools5.findWorkspaceRoot)();
489199
+ return config?.workspaceRoot ?? findWorkspaceRoot();
489195
489200
  }
489196
489201
  if (!customPackageRoot) {
489197
489202
  return projectNode.data.root;
@@ -489216,11 +489221,11 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
489216
489221
  const packageRoot = projectNameToPackageRootMap.get(projectName);
489217
489222
  const packageJsonPath = (0, import_devkit13.joinPathFragments)(packageRoot ?? "./", "package.json");
489218
489223
  const workspaceRelativePackageJsonPath = (0, import_node_path4.relative)(
489219
- config?.workspaceRoot ?? (0, import_config_tools5.findWorkspaceRoot)(),
489224
+ config?.workspaceRoot ?? findWorkspaceRoot(),
489220
489225
  packageJsonPath
489221
489226
  );
489222
489227
  const log = (msg) => {
489223
- (0, import_config_tools5.writeInfo)(config, `${projectName}: ${msg}`);
489228
+ writeInfo(config, `${projectName}: ${msg}`);
489224
489229
  };
489225
489230
  if (!tree.exists(packageJsonPath)) {
489226
489231
  throw new Error(
@@ -489229,7 +489234,7 @@ Valid values are: ${import_version.validReleaseVersionPrefixes.map((s) => `"${s}
489229
489234
  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
489235
  );
489231
489236
  }
489232
- (0, import_config_tools5.writeInfo)(config, `Running release version for project: ${project.name}`);
489237
+ writeInfo(config, `Running release version for project: ${project.name}`);
489233
489238
  const projectPackageJson = (0, import_devkit13.readJson)(tree, packageJsonPath);
489234
489239
  log(
489235
489240
  `\u{1F50D} Reading data for package "${projectPackageJson.name}" from ${workspaceRelativePackageJsonPath}`