@storm-software/unbuild 0.36.0 → 0.36.2

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.2-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.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)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
package/bin/unbuild.cjs CHANGED
@@ -1381,7 +1381,8 @@ var import_node_fs4 = require("fs");
1381
1381
  var import_promises3 = require("fs/promises");
1382
1382
  var import_project_graph = require("nx/src/project-graph/project-graph");
1383
1383
  var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
1384
- 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);
1385
1386
  const localPackages = [];
1386
1387
  for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
1387
1388
  const projectNode = project.node;
@@ -1398,26 +1399,38 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
1398
1399
  }
1399
1400
  if (localPackages.length > 0) {
1400
1401
  writeTrace(`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
1401
- packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
1402
- if (!ret[localPackage.name]) {
1403
- 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
+ }
1404
1419
  }
1405
1420
  return ret;
1406
- }, packageJson.peerDependencies ?? {});
1407
- packageJson.peerDependenciesMeta = localPackages.reduce((ret, localPackage) => {
1408
- if (!ret[localPackage.name]) {
1409
- ret[localPackage.name] = {
1410
- optional: false
1411
- };
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"}`;
1412
1425
  }
1413
1426
  return ret;
1414
- }, packageJson.peerDependenciesMeta ?? {});
1427
+ }, packageJson.dependencies ?? {});
1415
1428
  packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
1416
- if (!ret[localPackage.name]) {
1429
+ if (!ret[localPackage.name] && implicitDependencies?.includes(localPackage.name)) {
1417
1430
  ret[localPackage.name] = localPackage.version || "0.0.1";
1418
1431
  }
1419
1432
  return ret;
1420
- }, packageJson.peerDependencies ?? {});
1433
+ }, packageJson.devDependencies ?? {});
1421
1434
  } else {
1422
1435
  writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
1423
1436
  }
package/bin/unbuild.js CHANGED
@@ -1356,11 +1356,12 @@ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `//
1356
1356
  // ../build-tools/src/utilities/generate-package-json.ts
1357
1357
  import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
1358
1358
  import { Glob } from "glob";
1359
- import { existsSync as existsSync3 } from "node:fs";
1359
+ import { existsSync as existsSync3, readFileSync } from "node:fs";
1360
1360
  import { readFile as readFile3 } from "node:fs/promises";
1361
- import { readCachedProjectGraph } from "nx/src/project-graph/project-graph";
1361
+ import { readCachedProjectGraph, readProjectsConfigurationFromProjectGraph } from "nx/src/project-graph/project-graph";
1362
1362
  var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
1363
- 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);
1364
1365
  const localPackages = [];
1365
1366
  for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
1366
1367
  const projectNode = project.node;
@@ -1377,26 +1378,38 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
1377
1378
  }
1378
1379
  if (localPackages.length > 0) {
1379
1380
  writeTrace(`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
1380
- packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
1381
- if (!ret[localPackage.name]) {
1382
- 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
+ }
1383
1398
  }
1384
1399
  return ret;
1385
- }, packageJson.peerDependencies ?? {});
1386
- packageJson.peerDependenciesMeta = localPackages.reduce((ret, localPackage) => {
1387
- if (!ret[localPackage.name]) {
1388
- ret[localPackage.name] = {
1389
- optional: false
1390
- };
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"}`;
1391
1404
  }
1392
1405
  return ret;
1393
- }, packageJson.peerDependenciesMeta ?? {});
1406
+ }, packageJson.dependencies ?? {});
1394
1407
  packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
1395
- if (!ret[localPackage.name]) {
1408
+ if (!ret[localPackage.name] && implicitDependencies?.includes(localPackage.name)) {
1396
1409
  ret[localPackage.name] = localPackage.version || "0.0.1";
1397
1410
  }
1398
1411
  return ret;
1399
- }, packageJson.peerDependencies ?? {});
1412
+ }, packageJson.devDependencies ?? {});
1400
1413
  } else {
1401
1414
  writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
1402
1415
  }
package/dist/build.cjs CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkPX6F2F5Pcjs = require('./chunk-PX6F2F5P.cjs');
8
+ var _chunkWIBRZ6QGcjs = require('./chunk-WIBRZ6QG.cjs');
9
9
  require('./chunk-OD3ULBE3.cjs');
10
10
  require('./chunk-5XTLMOFH.cjs');
11
11
  require('./chunk-MXG2QBLK.cjs');
@@ -20,4 +20,4 @@ require('./chunk-BGYQAVKQ.cjs');
20
20
 
21
21
 
22
22
 
23
- exports.build = _chunkPX6F2F5Pcjs.build; exports.cleanOutputPath = _chunkPX6F2F5Pcjs.cleanOutputPath; exports.copyBuildAssets = _chunkPX6F2F5Pcjs.copyBuildAssets; exports.executeUnbuild = _chunkPX6F2F5Pcjs.executeUnbuild; exports.generatePackageJson = _chunkPX6F2F5Pcjs.generatePackageJson; exports.resolveOptions = _chunkPX6F2F5Pcjs.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,7 +5,7 @@ import {
5
5
  executeUnbuild,
6
6
  generatePackageJson,
7
7
  resolveOptions
8
- } from "./chunk-JONED24L.js";
8
+ } from "./chunk-4VAP3O4T.js";
9
9
  import "./chunk-RBYYB7X2.js";
10
10
  import "./chunk-FLMNRVR2.js";
11
11
  import "./chunk-XRMMVXZP.js";
@@ -117,11 +117,12 @@ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `//
117
117
  // ../build-tools/src/utilities/generate-package-json.ts
118
118
  import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
119
119
  import { Glob } from "glob";
120
- import { existsSync } from "node:fs";
120
+ import { existsSync, readFileSync } from "node:fs";
121
121
  import { readFile as readFile2 } from "node:fs/promises";
122
- import { readCachedProjectGraph } from "nx/src/project-graph/project-graph";
122
+ import { readCachedProjectGraph, readProjectsConfigurationFromProjectGraph } from "nx/src/project-graph/project-graph";
123
123
  var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
124
- const projectDependencies = calculateProjectBuildableDependencies(void 0, readCachedProjectGraph(), workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
124
+ const projectGraph = readCachedProjectGraph();
125
+ const projectDependencies = calculateProjectBuildableDependencies(void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
125
126
  const localPackages = [];
126
127
  for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
127
128
  const projectNode = project.node;
@@ -138,26 +139,38 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
138
139
  }
139
140
  if (localPackages.length > 0) {
140
141
  writeTrace(`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
141
- packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
142
- if (!ret[localPackage.name]) {
143
- ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
142
+ const projectJsonFile = await readFile2(joinPaths(projectRoot, "project.json"), "utf8");
143
+ const projectJson = JSON.parse(projectJsonFile);
144
+ const projectName2 = projectJson.name;
145
+ const projectConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
146
+ if (!projectConfigurations?.projects?.[projectName2]) {
147
+ 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.");
148
+ }
149
+ const implicitDependencies = projectConfigurations.projects?.[projectName2].implicitDependencies?.reduce((ret, dep) => {
150
+ if (projectConfigurations.projects?.[dep]) {
151
+ const depPackageJsonPath = joinPaths(workspaceRoot, projectConfigurations.projects[dep].root, "package.json");
152
+ if (existsSync(depPackageJsonPath)) {
153
+ const depPackageJsonContent = readFileSync(depPackageJsonPath, "utf8");
154
+ const depPackageJson = JSON.parse(depPackageJsonContent);
155
+ if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
156
+ ret.push(depPackageJson.name);
157
+ }
158
+ }
144
159
  }
145
160
  return ret;
146
- }, packageJson.peerDependencies ?? {});
147
- packageJson.peerDependenciesMeta = localPackages.reduce((ret, localPackage) => {
148
- if (!ret[localPackage.name]) {
149
- ret[localPackage.name] = {
150
- optional: false
151
- };
161
+ }, []);
162
+ packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
163
+ if (!ret[localPackage.name] && !implicitDependencies?.includes(localPackage.name)) {
164
+ ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
152
165
  }
153
166
  return ret;
154
- }, packageJson.peerDependenciesMeta ?? {});
167
+ }, packageJson.dependencies ?? {});
155
168
  packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
156
- if (!ret[localPackage.name]) {
169
+ if (!ret[localPackage.name] && implicitDependencies?.includes(localPackage.name)) {
157
170
  ret[localPackage.name] = localPackage.version || "0.0.1";
158
171
  }
159
172
  return ret;
160
- }, packageJson.peerDependencies ?? {});
173
+ }, packageJson.devDependencies ?? {});
161
174
  } else {
162
175
  writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
163
176
  }
@@ -121,7 +121,8 @@ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `//
121
121
 
122
122
  var _projectgraph = require('nx/src/project-graph/project-graph');
123
123
  var addPackageDependencies = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (workspaceRoot, projectRoot, projectName, packageJson) => {
124
- const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, _projectgraph.readCachedProjectGraph.call(void 0, ), workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
124
+ const projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
125
+ const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
125
126
  const localPackages = [];
126
127
  for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
127
128
  const projectNode = project.node;
@@ -138,26 +139,38 @@ var addPackageDependencies = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void
138
139
  }
139
140
  if (localPackages.length > 0) {
140
141
  _chunkA45F3XCOcjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
141
- packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
142
- if (!ret[localPackage.name]) {
143
- ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
142
+ const projectJsonFile = await _promises.readFile.call(void 0, _chunkA45F3XCOcjs.joinPaths.call(void 0, projectRoot, "project.json"), "utf8");
143
+ const projectJson = JSON.parse(projectJsonFile);
144
+ const projectName2 = projectJson.name;
145
+ const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
146
+ if (!_optionalChain([projectConfigurations, 'optionalAccess', _ => _.projects, 'optionalAccess', _2 => _2[projectName2]])) {
147
+ 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.");
148
+ }
149
+ const implicitDependencies = _optionalChain([projectConfigurations, 'access', _3 => _3.projects, 'optionalAccess', _4 => _4[projectName2], 'access', _5 => _5.implicitDependencies, 'optionalAccess', _6 => _6.reduce, 'call', _7 => _7((ret, dep) => {
150
+ if (_optionalChain([projectConfigurations, 'access', _8 => _8.projects, 'optionalAccess', _9 => _9[dep]])) {
151
+ const depPackageJsonPath = _chunkA45F3XCOcjs.joinPaths.call(void 0, workspaceRoot, projectConfigurations.projects[dep].root, "package.json");
152
+ if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
153
+ const depPackageJsonContent = _fs.readFileSync.call(void 0, depPackageJsonPath, "utf8");
154
+ const depPackageJson = JSON.parse(depPackageJsonContent);
155
+ if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
156
+ ret.push(depPackageJson.name);
157
+ }
158
+ }
144
159
  }
145
160
  return ret;
146
- }, _nullishCoalesce(packageJson.peerDependencies, () => ( {})));
147
- packageJson.peerDependenciesMeta = localPackages.reduce((ret, localPackage) => {
148
- if (!ret[localPackage.name]) {
149
- ret[localPackage.name] = {
150
- optional: false
151
- };
161
+ }, [])]);
162
+ packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
163
+ if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess', _10 => _10.includes, 'call', _11 => _11(localPackage.name)])) {
164
+ ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
152
165
  }
153
166
  return ret;
154
- }, _nullishCoalesce(packageJson.peerDependenciesMeta, () => ( {})));
167
+ }, _nullishCoalesce(packageJson.dependencies, () => ( {})));
155
168
  packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
156
- if (!ret[localPackage.name]) {
169
+ if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess', _12 => _12.includes, 'call', _13 => _13(localPackage.name)])) {
157
170
  ret[localPackage.name] = localPackage.version || "0.0.1";
158
171
  }
159
172
  return ret;
160
- }, _nullishCoalesce(packageJson.peerDependencies, () => ( {})));
173
+ }, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
161
174
  } else {
162
175
  _chunkA45F3XCOcjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
163
176
  }
@@ -219,7 +232,7 @@ var getConfigFileByName = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0,
219
232
  cwd: workspacePath,
220
233
  packageJson: true,
221
234
  name: fileName,
222
- envName: _optionalChain([fileName, 'optionalAccess', _ => _.toUpperCase, 'call', _2 => _2()]),
235
+ envName: _optionalChain([fileName, 'optionalAccess', _14 => _14.toUpperCase, 'call', _15 => _15()]),
223
236
  jitiOptions: {
224
237
  debug: false,
225
238
  fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkA45F3XCOcjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
@@ -230,7 +243,7 @@ var getConfigFileByName = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0,
230
243
  cwd: workspacePath,
231
244
  packageJson: true,
232
245
  name: fileName,
233
- envName: _optionalChain([fileName, 'optionalAccess', _3 => _3.toUpperCase, 'call', _4 => _4()]),
246
+ envName: _optionalChain([fileName, 'optionalAccess', _16 => _16.toUpperCase, 'call', _17 => _17()]),
234
247
  jitiOptions: {
235
248
  debug: false,
236
249
  fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkA45F3XCOcjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
@@ -254,7 +267,7 @@ var getConfigFile = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
254
267
  if (additionalFileNames && additionalFileNames.length > 0) {
255
268
  const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
256
269
  for (const result2 of results) {
257
- if (_optionalChain([result2, 'optionalAccess', _5 => _5.config]) && _optionalChain([result2, 'optionalAccess', _6 => _6.configFile]) && Object.keys(result2.config).length > 0) {
270
+ if (_optionalChain([result2, 'optionalAccess', _18 => _18.config]) && _optionalChain([result2, 'optionalAccess', _19 => _19.configFile]) && Object.keys(result2.config).length > 0) {
258
271
  if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
259
272
  _chunkA45F3XCOcjs.writeTrace.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
260
273
  logLevel: "all"
@@ -426,13 +439,13 @@ var getBaseThemeColorConfigEnv = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(v
426
439
  var setExtensionEnv = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (extensionName, extension) => {
427
440
  for (const key of Object.keys(_nullishCoalesce(extension, () => ( {})))) {
428
441
  if (extension[key]) {
429
- const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess', _7 => _7.replace, 'call', _8 => _8(/([A-Z])+/g, (input) => input ? _optionalChain([input, 'access', _9 => _9[0], 'optionalAccess', _10 => _10.toUpperCase, 'call', _11 => _11()]) + input.slice(1) : ""), 'access', _12 => _12.split, 'call', _13 => _13(/(?=[A-Z])|[.\-\s_]/), 'access', _14 => _14.map, 'call', _15 => _15((x) => x.toLowerCase())]), () => ( []));
442
+ const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess', _20 => _20.replace, 'call', _21 => _21(/([A-Z])+/g, (input) => input ? _optionalChain([input, 'access', _22 => _22[0], 'optionalAccess', _23 => _23.toUpperCase, 'call', _24 => _24()]) + input.slice(1) : ""), 'access', _25 => _25.split, 'call', _26 => _26(/(?=[A-Z])|[.\-\s_]/), 'access', _27 => _27.map, 'call', _28 => _28((x) => x.toLowerCase())]), () => ( []));
430
443
  let extensionKey;
431
444
  if (result.length === 0) {
432
445
  return;
433
446
  }
434
447
  if (result.length === 1) {
435
- extensionKey = _nullishCoalesce(_optionalChain([result, 'access', _16 => _16[0], 'optionalAccess', _17 => _17.toUpperCase, 'call', _18 => _18()]), () => ( ""));
448
+ extensionKey = _nullishCoalesce(_optionalChain([result, 'access', _29 => _29[0], 'optionalAccess', _30 => _30.toUpperCase, 'call', _31 => _31()]), () => ( ""));
436
449
  } else {
437
450
  extensionKey = result.reduce((ret, part) => {
438
451
  return `${ret}_${part.toLowerCase()}`;
@@ -529,7 +542,7 @@ var setConfigEnv = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (config
529
542
  process.env.NODE_ENV = config.env;
530
543
  process.env.ENVIRONMENT = config.env;
531
544
  }
532
- if (_optionalChain([config, 'access', _19 => _19.colors, 'optionalAccess', _20 => _20.base, 'optionalAccess', _21 => _21.light]) || _optionalChain([config, 'access', _22 => _22.colors, 'optionalAccess', _23 => _23.base, 'optionalAccess', _24 => _24.dark])) {
545
+ if (_optionalChain([config, 'access', _32 => _32.colors, 'optionalAccess', _33 => _33.base, 'optionalAccess', _34 => _34.light]) || _optionalChain([config, 'access', _35 => _35.colors, 'optionalAccess', _36 => _36.base, 'optionalAccess', _37 => _37.dark])) {
533
546
  for (const key of Object.keys(config.colors)) {
534
547
  setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
535
548
  }
@@ -580,7 +593,7 @@ var setConfigEnv = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (config
580
593
  }
581
594
  }, "setConfigEnv");
582
595
  var setThemeColorConfigEnv = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (prefix, config) => {
583
- return _optionalChain([config, 'optionalAccess', _25 => _25.light, 'optionalAccess', _26 => _26.brand]) || _optionalChain([config, 'optionalAccess', _27 => _27.dark, 'optionalAccess', _28 => _28.brand]) ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
596
+ return _optionalChain([config, 'optionalAccess', _38 => _38.light, 'optionalAccess', _39 => _39.brand]) || _optionalChain([config, 'optionalAccess', _40 => _40.dark, 'optionalAccess', _41 => _41.brand]) ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
584
597
  }, "setThemeColorConfigEnv");
585
598
  var setSingleThemeColorConfigEnv = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (prefix, config) => {
586
599
  if (config.dark) {
@@ -682,7 +695,7 @@ var _extension_cache = /* @__PURE__ */ new WeakMap();
682
695
  var _static_cache = void 0;
683
696
  var createStormConfig = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (extensionName, schema, workspaceRoot, skipLogs = false) => {
684
697
  let result;
685
- if (!_optionalChain([_static_cache, 'optionalAccess', _29 => _29.data]) || !_optionalChain([_static_cache, 'optionalAccess', _30 => _30.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
698
+ if (!_optionalChain([_static_cache, 'optionalAccess', _42 => _42.data]) || !_optionalChain([_static_cache, 'optionalAccess', _43 => _43.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
686
699
  let _workspaceRoot = workspaceRoot;
687
700
  if (!_workspaceRoot) {
688
701
  _workspaceRoot = _chunkA45F3XCOcjs.findWorkspaceRoot.call(void 0, );
package/dist/index.cjs CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkPX6F2F5Pcjs = require('./chunk-PX6F2F5P.cjs');
8
+ var _chunkWIBRZ6QGcjs = require('./chunk-WIBRZ6QG.cjs');
9
9
  require('./chunk-OD3ULBE3.cjs');
10
10
 
11
11
 
@@ -31,4 +31,4 @@ require('./chunk-BGYQAVKQ.cjs');
31
31
 
32
32
 
33
33
 
34
- exports.build = _chunkPX6F2F5Pcjs.build; exports.clean = _chunk5XTLMOFHcjs.clean; exports.cleanDirectories = _chunk5XTLMOFHcjs.cleanDirectories; exports.cleanOutputPath = _chunkPX6F2F5Pcjs.cleanOutputPath; exports.copyBuildAssets = _chunkPX6F2F5Pcjs.copyBuildAssets; exports.createTsCompilerOptions = _chunkBZELKGMNcjs.createTsCompilerOptions; exports.executeUnbuild = _chunkPX6F2F5Pcjs.executeUnbuild; exports.generatePackageJson = _chunkPX6F2F5Pcjs.generatePackageJson; exports.loadConfig = _chunkBZELKGMNcjs.loadConfig; exports.resolveOptions = _chunkPX6F2F5Pcjs.resolveOptions;
34
+ exports.build = _chunkWIBRZ6QGcjs.build; exports.clean = _chunk5XTLMOFHcjs.clean; exports.cleanDirectories = _chunk5XTLMOFHcjs.cleanDirectories; exports.cleanOutputPath = _chunkWIBRZ6QGcjs.cleanOutputPath; exports.copyBuildAssets = _chunkWIBRZ6QGcjs.copyBuildAssets; exports.createTsCompilerOptions = _chunkBZELKGMNcjs.createTsCompilerOptions; exports.executeUnbuild = _chunkWIBRZ6QGcjs.executeUnbuild; exports.generatePackageJson = _chunkWIBRZ6QGcjs.generatePackageJson; exports.loadConfig = _chunkBZELKGMNcjs.loadConfig; exports.resolveOptions = _chunkWIBRZ6QGcjs.resolveOptions;
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  executeUnbuild,
6
6
  generatePackageJson,
7
7
  resolveOptions
8
- } from "./chunk-JONED24L.js";
8
+ } from "./chunk-4VAP3O4T.js";
9
9
  import "./chunk-RBYYB7X2.js";
10
10
  import {
11
11
  clean,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/unbuild",
3
- "version": "0.36.0",
3
+ "version": "0.36.2",
4
4
  "type": "module",
5
5
  "description": "A package containing `unbuild` utilities for building Storm Software libraries and applications",
6
6
  "repository": {