@storm-software/unbuild 0.35.2 → 0.36.1

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/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-0.35.1-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-0.36.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
package/bin/unbuild.cjs CHANGED
@@ -129,7 +129,7 @@ var WorkspaceDirectoryConfigSchema = import_zod.default.object({
129
129
  build: import_zod.default.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
130
130
  }).describe("Various directories used by the workspace to store data, cache, and configuration files");
131
131
  var StormConfigSchema = import_zod.default.object({
132
- $schema: import_zod.default.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
132
+ $schema: import_zod.default.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm-workspace.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
133
133
  extends: ExtendsSchema.optional(),
134
134
  name: import_zod.default.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
135
135
  namespace: import_zod.default.string().trim().toLowerCase().optional().describe("The namespace of the package"),
@@ -171,6 +171,7 @@ var StormConfigSchema = import_zod.default.object({
171
171
  "trace",
172
172
  "all"
173
173
  ]).default("info").describe("The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."),
174
+ skipConfigLogging: import_zod.default.boolean().optional().describe("Should the logging of the current Storm Workspace configuration be skipped?"),
174
175
  registry: RegistryConfigSchema,
175
176
  configFile: import_zod.default.string().trim().nullable().default(null).describe("The filepath of the Storm config. When this field is null, no config file was found in the current workspace."),
176
177
  colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
@@ -364,14 +365,17 @@ var import_node_fs = require("fs");
364
365
  var import_node_path = require("path");
365
366
  var MAX_PATH_SEARCH_DEPTH = 30;
366
367
  var depth = 0;
367
- function findFolderUp(startPath, endFileNames) {
368
+ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
368
369
  const _startPath = startPath ?? process.cwd();
370
+ if (endDirectoryNames.some((endDirName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endDirName)))) {
371
+ return _startPath;
372
+ }
369
373
  if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
370
374
  return _startPath;
371
375
  }
372
376
  if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
373
377
  const parent = (0, import_node_path.join)(_startPath, "..");
374
- return findFolderUp(parent, endFileNames);
378
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
375
379
  }
376
380
  return void 0;
377
381
  }
@@ -379,17 +383,17 @@ __name(findFolderUp, "findFolderUp");
379
383
 
380
384
  // ../config-tools/src/utilities/find-workspace-root.ts
381
385
  var rootFiles = [
382
- "storm.json",
383
- "storm.json",
384
- "storm.yaml",
385
- "storm.yml",
386
- "storm.js",
387
- "storm.ts",
388
- ".storm.json",
389
- ".storm.yaml",
390
- ".storm.yml",
391
- ".storm.js",
392
- ".storm.ts",
386
+ "storm-workspace.json",
387
+ "storm-workspace.json",
388
+ "storm-workspace.yaml",
389
+ "storm-workspace.yml",
390
+ "storm-workspace.js",
391
+ "storm-workspace.ts",
392
+ ".storm-workspace.json",
393
+ ".storm-workspace.yaml",
394
+ ".storm-workspace.yml",
395
+ ".storm-workspace.js",
396
+ ".storm-workspace.ts",
393
397
  "lerna.json",
394
398
  "nx.json",
395
399
  "turbo.json",
@@ -413,11 +417,18 @@ var rootFiles = [
413
417
  "pnpm-lock.yml",
414
418
  "bun.lockb"
415
419
  ];
420
+ var rootDirectories = [
421
+ ".storm-workspace",
422
+ ".nx",
423
+ ".github",
424
+ ".vscode",
425
+ ".verdaccio"
426
+ ];
416
427
  function findWorkspaceRootSafe(pathInsideMonorepo) {
417
428
  if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
418
429
  return correctPaths(process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH);
419
430
  }
420
- return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles));
431
+ return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles, rootDirectories));
421
432
  }
422
433
  __name(findWorkspaceRootSafe, "findWorkspaceRootSafe");
423
434
  function findWorkspaceRoot(pathInsideMonorepo) {
@@ -792,10 +803,10 @@ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, opti
792
803
  }, "getConfigFileByName");
793
804
  var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames = []) => {
794
805
  const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
795
- const result = await getConfigFileByName("storm", workspacePath);
806
+ const result = await getConfigFileByName("storm-workspace", workspacePath);
796
807
  let config = result.config;
797
808
  const configFile = result.configFile;
798
- if (config && configFile && Object.keys(config).length > 0) {
809
+ if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
799
810
  writeTrace(`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
800
811
  logLevel: "all"
801
812
  });
@@ -804,9 +815,11 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
804
815
  const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
805
816
  for (const result2 of results) {
806
817
  if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
807
- writeTrace(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
808
- logLevel: "all"
809
- });
818
+ if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
819
+ writeTrace(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
820
+ logLevel: "all"
821
+ });
822
+ }
810
823
  config = (0, import_defu.default)(result2.config ?? {}, config ?? {});
811
824
  }
812
825
  }
@@ -879,7 +892,8 @@ var getConfigEnv = /* @__PURE__ */ __name(() => {
879
892
  cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
880
893
  container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
881
894
  },
882
- logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
895
+ logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0,
896
+ skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
883
897
  };
884
898
  const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
885
899
  config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
@@ -1114,6 +1128,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
1114
1128
  process.env.NX_VERBOSE_LOGGING = String(getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false);
1115
1129
  process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
1116
1130
  }
1131
+ if (config.skipConfigLogging !== void 0) {
1132
+ process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(config.skipConfigLogging);
1133
+ }
1117
1134
  process.env[`${prefix}CONFIG`] = JSON.stringify(config);
1118
1135
  for (const key of Object.keys(config.extensions ?? {})) {
1119
1136
  config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
@@ -1231,7 +1248,7 @@ var createStormConfig = /* @__PURE__ */ __name(async (extensionName, schema, wor
1231
1248
  const defaultConfig = await getDefaultConfig(_workspaceRoot);
1232
1249
  const configFile = await getConfigFile(_workspaceRoot);
1233
1250
  if (!configFile && !skipLogs) {
1234
- writeWarning("No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n", {
1251
+ writeWarning("No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n", {
1235
1252
  logLevel: "all"
1236
1253
  });
1237
1254
  }
@@ -1269,8 +1286,8 @@ var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
1269
1286
  var loadStormConfig = /* @__PURE__ */ __name(async (workspaceRoot, skipLogs = false) => {
1270
1287
  const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
1271
1288
  setConfigEnv(config);
1272
- if (!skipLogs) {
1273
- writeTrace(`\u2699\uFE0F Using Storm configuration:
1289
+ if (!skipLogs && !config.skipConfigLogging) {
1290
+ writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
1274
1291
  ${formatLogMessage(config)}`, config);
1275
1292
  }
1276
1293
  return config;
@@ -1364,7 +1381,8 @@ var import_node_fs4 = require("fs");
1364
1381
  var import_promises3 = require("fs/promises");
1365
1382
  var import_project_graph = require("nx/src/project-graph/project-graph");
1366
1383
  var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
1367
- const projectDependencies = (0, import_buildable_libs_utils.calculateProjectBuildableDependencies)(void 0, (0, import_project_graph.readCachedProjectGraph)(), workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
1384
+ const projectGraph = (0, import_project_graph.readCachedProjectGraph)();
1385
+ const projectDependencies = (0, import_buildable_libs_utils.calculateProjectBuildableDependencies)(void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
1368
1386
  const localPackages = [];
1369
1387
  for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
1370
1388
  const projectNode = project.node;
@@ -1381,26 +1399,38 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
1381
1399
  }
1382
1400
  if (localPackages.length > 0) {
1383
1401
  writeTrace(`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
1384
- packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
1385
- if (!ret[localPackage.name]) {
1386
- ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
1402
+ const projectJsonFile = await (0, import_promises3.readFile)(joinPaths(projectRoot, "project.json"), "utf8");
1403
+ const projectJson = JSON.parse(projectJsonFile);
1404
+ const projectName2 = projectJson.name;
1405
+ const projectConfigurations = (0, import_project_graph.readProjectsConfigurationFromProjectGraph)(projectGraph);
1406
+ if (!projectConfigurations?.projects?.[projectName2]) {
1407
+ throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
1408
+ }
1409
+ const implicitDependencies = projectConfigurations.projects?.[projectName2].implicitDependencies?.reduce((ret, dep) => {
1410
+ if (projectConfigurations.projects?.[dep]) {
1411
+ const depPackageJsonPath = joinPaths(workspaceRoot, projectConfigurations.projects[dep].root, "package.json");
1412
+ if ((0, import_node_fs4.existsSync)(depPackageJsonPath)) {
1413
+ const depPackageJsonContent = (0, import_node_fs4.readFileSync)(depPackageJsonPath, "utf8");
1414
+ const depPackageJson = JSON.parse(depPackageJsonContent);
1415
+ if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
1416
+ ret.push(depPackageJson.name);
1417
+ }
1418
+ }
1387
1419
  }
1388
1420
  return ret;
1389
- }, packageJson.peerDependencies ?? {});
1390
- packageJson.peerDependenciesMeta = localPackages.reduce((ret, localPackage) => {
1391
- if (!ret[localPackage.name]) {
1392
- ret[localPackage.name] = {
1393
- optional: false
1394
- };
1421
+ }, []);
1422
+ packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
1423
+ if (!ret[localPackage.name] && !implicitDependencies?.includes(localPackage.name)) {
1424
+ ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
1395
1425
  }
1396
1426
  return ret;
1397
- }, packageJson.peerDependenciesMeta ?? {});
1427
+ }, packageJson.dependencies ?? {});
1398
1428
  packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
1399
- if (!ret[localPackage.name]) {
1429
+ if (!ret[localPackage.name] && implicitDependencies?.includes(localPackage.name)) {
1400
1430
  ret[localPackage.name] = localPackage.version || "0.0.1";
1401
1431
  }
1402
1432
  return ret;
1403
- }, packageJson.peerDependencies ?? {});
1433
+ }, packageJson.devDependencies ?? {});
1404
1434
  } else {
1405
1435
  writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
1406
1436
  }
package/bin/unbuild.js CHANGED
@@ -108,7 +108,7 @@ var WorkspaceDirectoryConfigSchema = z.object({
108
108
  build: z.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
109
109
  }).describe("Various directories used by the workspace to store data, cache, and configuration files");
110
110
  var StormConfigSchema = z.object({
111
- $schema: z.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
111
+ $schema: z.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm-workspace.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
112
112
  extends: ExtendsSchema.optional(),
113
113
  name: z.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
114
114
  namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
@@ -150,6 +150,7 @@ var StormConfigSchema = z.object({
150
150
  "trace",
151
151
  "all"
152
152
  ]).default("info").describe("The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."),
153
+ skipConfigLogging: z.boolean().optional().describe("Should the logging of the current Storm Workspace configuration be skipped?"),
153
154
  registry: RegistryConfigSchema,
154
155
  configFile: z.string().trim().nullable().default(null).describe("The filepath of the Storm config. When this field is null, no config file was found in the current workspace."),
155
156
  colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
@@ -343,14 +344,17 @@ import { existsSync } from "node:fs";
343
344
  import { join } from "node:path";
344
345
  var MAX_PATH_SEARCH_DEPTH = 30;
345
346
  var depth = 0;
346
- function findFolderUp(startPath, endFileNames) {
347
+ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
347
348
  const _startPath = startPath ?? process.cwd();
349
+ if (endDirectoryNames.some((endDirName) => existsSync(join(_startPath, endDirName)))) {
350
+ return _startPath;
351
+ }
348
352
  if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
349
353
  return _startPath;
350
354
  }
351
355
  if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
352
356
  const parent = join(_startPath, "..");
353
- return findFolderUp(parent, endFileNames);
357
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
354
358
  }
355
359
  return void 0;
356
360
  }
@@ -358,17 +362,17 @@ __name(findFolderUp, "findFolderUp");
358
362
 
359
363
  // ../config-tools/src/utilities/find-workspace-root.ts
360
364
  var rootFiles = [
361
- "storm.json",
362
- "storm.json",
363
- "storm.yaml",
364
- "storm.yml",
365
- "storm.js",
366
- "storm.ts",
367
- ".storm.json",
368
- ".storm.yaml",
369
- ".storm.yml",
370
- ".storm.js",
371
- ".storm.ts",
365
+ "storm-workspace.json",
366
+ "storm-workspace.json",
367
+ "storm-workspace.yaml",
368
+ "storm-workspace.yml",
369
+ "storm-workspace.js",
370
+ "storm-workspace.ts",
371
+ ".storm-workspace.json",
372
+ ".storm-workspace.yaml",
373
+ ".storm-workspace.yml",
374
+ ".storm-workspace.js",
375
+ ".storm-workspace.ts",
372
376
  "lerna.json",
373
377
  "nx.json",
374
378
  "turbo.json",
@@ -392,11 +396,18 @@ var rootFiles = [
392
396
  "pnpm-lock.yml",
393
397
  "bun.lockb"
394
398
  ];
399
+ var rootDirectories = [
400
+ ".storm-workspace",
401
+ ".nx",
402
+ ".github",
403
+ ".vscode",
404
+ ".verdaccio"
405
+ ];
395
406
  function findWorkspaceRootSafe(pathInsideMonorepo) {
396
407
  if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
397
408
  return correctPaths(process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH);
398
409
  }
399
- return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles));
410
+ return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles, rootDirectories));
400
411
  }
401
412
  __name(findWorkspaceRootSafe, "findWorkspaceRootSafe");
402
413
  function findWorkspaceRoot(pathInsideMonorepo) {
@@ -771,10 +782,10 @@ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, opti
771
782
  }, "getConfigFileByName");
772
783
  var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames = []) => {
773
784
  const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
774
- const result = await getConfigFileByName("storm", workspacePath);
785
+ const result = await getConfigFileByName("storm-workspace", workspacePath);
775
786
  let config = result.config;
776
787
  const configFile = result.configFile;
777
- if (config && configFile && Object.keys(config).length > 0) {
788
+ if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
778
789
  writeTrace(`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
779
790
  logLevel: "all"
780
791
  });
@@ -783,9 +794,11 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
783
794
  const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
784
795
  for (const result2 of results) {
785
796
  if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
786
- writeTrace(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
787
- logLevel: "all"
788
- });
797
+ if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
798
+ writeTrace(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
799
+ logLevel: "all"
800
+ });
801
+ }
789
802
  config = defu(result2.config ?? {}, config ?? {});
790
803
  }
791
804
  }
@@ -858,7 +871,8 @@ var getConfigEnv = /* @__PURE__ */ __name(() => {
858
871
  cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
859
872
  container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
860
873
  },
861
- logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
874
+ logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0,
875
+ skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
862
876
  };
863
877
  const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
864
878
  config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
@@ -1093,6 +1107,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
1093
1107
  process.env.NX_VERBOSE_LOGGING = String(getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false);
1094
1108
  process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
1095
1109
  }
1110
+ if (config.skipConfigLogging !== void 0) {
1111
+ process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(config.skipConfigLogging);
1112
+ }
1096
1113
  process.env[`${prefix}CONFIG`] = JSON.stringify(config);
1097
1114
  for (const key of Object.keys(config.extensions ?? {})) {
1098
1115
  config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
@@ -1210,7 +1227,7 @@ var createStormConfig = /* @__PURE__ */ __name(async (extensionName, schema, wor
1210
1227
  const defaultConfig = await getDefaultConfig(_workspaceRoot);
1211
1228
  const configFile = await getConfigFile(_workspaceRoot);
1212
1229
  if (!configFile && !skipLogs) {
1213
- writeWarning("No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n", {
1230
+ writeWarning("No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n", {
1214
1231
  logLevel: "all"
1215
1232
  });
1216
1233
  }
@@ -1248,8 +1265,8 @@ var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
1248
1265
  var loadStormConfig = /* @__PURE__ */ __name(async (workspaceRoot, skipLogs = false) => {
1249
1266
  const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
1250
1267
  setConfigEnv(config);
1251
- if (!skipLogs) {
1252
- writeTrace(`\u2699\uFE0F Using Storm configuration:
1268
+ if (!skipLogs && !config.skipConfigLogging) {
1269
+ writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
1253
1270
  ${formatLogMessage(config)}`, config);
1254
1271
  }
1255
1272
  return config;
@@ -1339,11 +1356,12 @@ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `//
1339
1356
  // ../build-tools/src/utilities/generate-package-json.ts
1340
1357
  import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
1341
1358
  import { Glob } from "glob";
1342
- import { existsSync as existsSync3 } from "node:fs";
1359
+ import { existsSync as existsSync3, readFileSync } from "node:fs";
1343
1360
  import { readFile as readFile3 } from "node:fs/promises";
1344
- import { readCachedProjectGraph } from "nx/src/project-graph/project-graph";
1361
+ import { readCachedProjectGraph, readProjectsConfigurationFromProjectGraph } from "nx/src/project-graph/project-graph";
1345
1362
  var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
1346
- const projectDependencies = calculateProjectBuildableDependencies(void 0, readCachedProjectGraph(), workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
1363
+ const projectGraph = readCachedProjectGraph();
1364
+ const projectDependencies = calculateProjectBuildableDependencies(void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
1347
1365
  const localPackages = [];
1348
1366
  for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
1349
1367
  const projectNode = project.node;
@@ -1360,26 +1378,38 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
1360
1378
  }
1361
1379
  if (localPackages.length > 0) {
1362
1380
  writeTrace(`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
1363
- packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
1364
- if (!ret[localPackage.name]) {
1365
- ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
1381
+ const projectJsonFile = await readFile3(joinPaths(projectRoot, "project.json"), "utf8");
1382
+ const projectJson = JSON.parse(projectJsonFile);
1383
+ const projectName2 = projectJson.name;
1384
+ const projectConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
1385
+ if (!projectConfigurations?.projects?.[projectName2]) {
1386
+ throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
1387
+ }
1388
+ const implicitDependencies = projectConfigurations.projects?.[projectName2].implicitDependencies?.reduce((ret, dep) => {
1389
+ if (projectConfigurations.projects?.[dep]) {
1390
+ const depPackageJsonPath = joinPaths(workspaceRoot, projectConfigurations.projects[dep].root, "package.json");
1391
+ if (existsSync3(depPackageJsonPath)) {
1392
+ const depPackageJsonContent = readFileSync(depPackageJsonPath, "utf8");
1393
+ const depPackageJson = JSON.parse(depPackageJsonContent);
1394
+ if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
1395
+ ret.push(depPackageJson.name);
1396
+ }
1397
+ }
1366
1398
  }
1367
1399
  return ret;
1368
- }, packageJson.peerDependencies ?? {});
1369
- packageJson.peerDependenciesMeta = localPackages.reduce((ret, localPackage) => {
1370
- if (!ret[localPackage.name]) {
1371
- ret[localPackage.name] = {
1372
- optional: false
1373
- };
1400
+ }, []);
1401
+ packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
1402
+ if (!ret[localPackage.name] && !implicitDependencies?.includes(localPackage.name)) {
1403
+ ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
1374
1404
  }
1375
1405
  return ret;
1376
- }, packageJson.peerDependenciesMeta ?? {});
1406
+ }, packageJson.dependencies ?? {});
1377
1407
  packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
1378
- if (!ret[localPackage.name]) {
1408
+ if (!ret[localPackage.name] && implicitDependencies?.includes(localPackage.name)) {
1379
1409
  ret[localPackage.name] = localPackage.version || "0.0.1";
1380
1410
  }
1381
1411
  return ret;
1382
- }, packageJson.peerDependencies ?? {});
1412
+ }, packageJson.devDependencies ?? {});
1383
1413
  } else {
1384
1414
  writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
1385
1415
  }
package/dist/build.cjs CHANGED
@@ -5,13 +5,13 @@
5
5
 
6
6
 
7
7
 
8
- var _chunk44QVHNBQcjs = require('./chunk-44QVHNBQ.cjs');
8
+ var _chunkWIBRZ6QGcjs = require('./chunk-WIBRZ6QG.cjs');
9
9
  require('./chunk-OD3ULBE3.cjs');
10
- require('./chunk-3HGUCQU6.cjs');
11
- require('./chunk-N5KR37LU.cjs');
12
- require('./chunk-Y7PS2HJA.cjs');
13
- require('./chunk-ZPWH22ZM.cjs');
14
- require('./chunk-5FQVMM7I.cjs');
10
+ require('./chunk-5XTLMOFH.cjs');
11
+ require('./chunk-MXG2QBLK.cjs');
12
+ require('./chunk-AI7YECRT.cjs');
13
+ require('./chunk-BZELKGMN.cjs');
14
+ require('./chunk-A45F3XCO.cjs');
15
15
  require('./chunk-BGYQAVKQ.cjs');
16
16
 
17
17
 
@@ -20,4 +20,4 @@ require('./chunk-BGYQAVKQ.cjs');
20
20
 
21
21
 
22
22
 
23
- exports.build = _chunk44QVHNBQcjs.build; exports.cleanOutputPath = _chunk44QVHNBQcjs.cleanOutputPath; exports.copyBuildAssets = _chunk44QVHNBQcjs.copyBuildAssets; exports.executeUnbuild = _chunk44QVHNBQcjs.executeUnbuild; exports.generatePackageJson = _chunk44QVHNBQcjs.generatePackageJson; exports.resolveOptions = _chunk44QVHNBQcjs.resolveOptions;
23
+ exports.build = _chunkWIBRZ6QGcjs.build; exports.cleanOutputPath = _chunkWIBRZ6QGcjs.cleanOutputPath; exports.copyBuildAssets = _chunkWIBRZ6QGcjs.copyBuildAssets; exports.executeUnbuild = _chunkWIBRZ6QGcjs.executeUnbuild; exports.generatePackageJson = _chunkWIBRZ6QGcjs.generatePackageJson; exports.resolveOptions = _chunkWIBRZ6QGcjs.resolveOptions;
package/dist/build.js CHANGED
@@ -5,13 +5,13 @@ import {
5
5
  executeUnbuild,
6
6
  generatePackageJson,
7
7
  resolveOptions
8
- } from "./chunk-KXDOKQLW.js";
8
+ } from "./chunk-4VAP3O4T.js";
9
9
  import "./chunk-RBYYB7X2.js";
10
- import "./chunk-2E6P5U5P.js";
11
- import "./chunk-L3WYWYD4.js";
12
- import "./chunk-RFEZKCMQ.js";
13
- import "./chunk-3M7GEZDL.js";
14
- import "./chunk-PLJQK2VX.js";
10
+ import "./chunk-FLMNRVR2.js";
11
+ import "./chunk-XRMMVXZP.js";
12
+ import "./chunk-R6HJQ5XB.js";
13
+ import "./chunk-FRURXT64.js";
14
+ import "./chunk-A7ULBMR4.js";
15
15
  import "./chunk-3GQAWCBQ.js";
16
16
  export {
17
17
  build,