@storm-software/bun-tools 0.0.48 → 0.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/bin/bun.cjs +47 -6
- package/bin/bun.js +47 -6
- package/dist/chunk-2GHXV3OE.js +1 -0
- package/dist/{chunk-X45K5DKT.cjs → chunk-37GUJUMR.cjs} +1 -1
- package/dist/chunk-3IUP2V2O.cjs +1 -0
- package/dist/chunk-ACIBJPTX.js +1 -0
- package/dist/chunk-DK4D3PFF.cjs +1 -0
- package/dist/{chunk-66TU3CP3.cjs → chunk-DW2HTWAU.cjs} +17 -17
- package/dist/chunk-HPYBH7QT.cjs +2 -0
- package/dist/chunk-ILE6NSRA.js +2 -0
- package/dist/{chunk-5ZLN4X3W.js → chunk-IMROPYHM.js} +1 -1
- package/dist/{chunk-6RUWDFGG.js → chunk-IVWMWBEI.js} +17 -17
- package/dist/chunk-IW73C7OV.cjs +2 -0
- package/dist/chunk-LUXOLZKJ.js +1 -0
- package/dist/chunk-UKAKS6IQ.cjs +1 -0
- package/dist/chunk-Y2HO4X3Y.js +2 -0
- package/dist/helpers/catalog.cjs +1 -1
- package/dist/helpers/catalog.d.cts +6 -0
- package/dist/helpers/catalog.d.ts +6 -0
- package/dist/helpers/catalog.js +1 -1
- package/dist/helpers/index.cjs +1 -1
- package/dist/helpers/index.d.cts +1 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/package-json.cjs +1 -1
- package/dist/helpers/package-json.js +1 -1
- package/dist/helpers/replace-deps-aliases.cjs +1 -1
- package/dist/helpers/replace-deps-aliases.js +1 -1
- package/dist/helpers/version-cache.cjs +1 -0
- package/dist/helpers/version-cache.d.cts +10 -0
- package/dist/helpers/version-cache.d.ts +10 -0
- package/dist/helpers/version-cache.js +1 -0
- package/dist/helpers/workspace.cjs +1 -1
- package/dist/helpers/workspace.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +10 -8
- package/dist/chunk-75RDZ52U.cjs +0 -3
- package/dist/chunk-FJDNIIEX.js +0 -3
- package/dist/chunk-GC3KXELW.cjs +0 -1
- package/dist/chunk-KWVKMOA5.js +0 -1
- /package/dist/{chunk-3CHW2FOO.cjs → chunk-AEB6NXCJ.cjs} +0 -0
- /package/dist/{chunk-PJBAL7AE.js → chunk-RJQ4TKJL.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Storm Ops - Bun Tools
|
|
4
4
|
|
|
5
|
+
## [0.0.50](https://github.com/storm-software/storm-ops/releases/tag/bun-tools%400.0.50) (09/17/2026)
|
|
6
|
+
|
|
7
|
+
### Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated **config** to **v1.138.73**
|
|
10
|
+
- Updated **config-tools** to **v1.190.137**
|
|
11
|
+
- Updated **npm-tools** to **v0.6.257**
|
|
12
|
+
- Updated **package-constants** to **v0.1.149**
|
|
13
|
+
- Updated **testing-tools** to **v1.119.289**
|
|
14
|
+
|
|
15
|
+
## [0.0.49](https://github.com/storm-software/storm-ops/releases/tag/bun-tools%400.0.49) (09/08/2026)
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- **pnpm-tools:** Updaters now use local cache to reduce network calls ([f468bf4b4](https://github.com/storm-software/storm-ops/commit/f468bf4b4))
|
|
20
|
+
|
|
21
|
+
### Updated Dependencies
|
|
22
|
+
|
|
23
|
+
- Updated **config** to **v1.138.72**
|
|
24
|
+
- Updated **config-tools** to **v1.190.136**
|
|
25
|
+
- Updated **npm-tools** to **v0.6.256**
|
|
26
|
+
- Updated **package-constants** to **v0.1.148**
|
|
27
|
+
- Updated **testing-tools** to **v1.119.288**
|
|
28
|
+
|
|
5
29
|
## [0.0.48](https://github.com/storm-software/storm-ops/releases/tag/bun-tools%400.0.48) (09/06/2026)
|
|
6
30
|
|
|
7
31
|
### Updated Dependencies
|
package/bin/bun.cjs
CHANGED
|
@@ -2210,6 +2210,10 @@ var INTERNAL_PACKAGES = [
|
|
|
2210
2210
|
"aftershock",
|
|
2211
2211
|
"@telepathic/*",
|
|
2212
2212
|
"telepathic",
|
|
2213
|
+
"@questgiver/*",
|
|
2214
|
+
"questgiver",
|
|
2215
|
+
"@mindctl/*",
|
|
2216
|
+
"mindctl",
|
|
2213
2217
|
"@power-plant/*",
|
|
2214
2218
|
"power-plant",
|
|
2215
2219
|
"@razorwind/*",
|
|
@@ -2233,7 +2237,7 @@ var import_commander = require("commander");
|
|
|
2233
2237
|
// package.json
|
|
2234
2238
|
var package_default = {
|
|
2235
2239
|
name: "@storm-software/bun-tools",
|
|
2236
|
-
version: "0.0.
|
|
2240
|
+
version: "0.0.50",
|
|
2237
2241
|
private: false,
|
|
2238
2242
|
description: "A set of [Bun](https://bun.sh/) plugins and utilities for managing workspace packages/dependencies.",
|
|
2239
2243
|
repository: {
|
|
@@ -2333,7 +2337,9 @@ var package_default = {
|
|
|
2333
2337
|
defu: "catalog:",
|
|
2334
2338
|
prettier: "catalog:",
|
|
2335
2339
|
"prettier-plugin-packagejson": "catalog:",
|
|
2340
|
+
"env-paths": "^4.0.0",
|
|
2336
2341
|
semver: "catalog:",
|
|
2342
|
+
unstorage: "^1.17.5",
|
|
2337
2343
|
yaml: "catalog:"
|
|
2338
2344
|
},
|
|
2339
2345
|
devDependencies: {
|
|
@@ -2629,11 +2635,10 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
2629
2635
|
workspaceConfig
|
|
2630
2636
|
);
|
|
2631
2637
|
}
|
|
2632
|
-
const
|
|
2633
|
-
const origVersion = await getVersion(packageName, tag, {
|
|
2638
|
+
const origVersion = await (options.versionResolver ?? (async (name, versionTag) => getVersion(name, versionTag, {
|
|
2634
2639
|
executable: "bun pm",
|
|
2635
|
-
registry:
|
|
2636
|
-
});
|
|
2640
|
+
registry: await getNpmRegistry()
|
|
2641
|
+
})))(packageName, tag);
|
|
2637
2642
|
if (!origVersion) {
|
|
2638
2643
|
throw new Error(
|
|
2639
2644
|
`Failed to fetch version for package "${packageName}" with tag "${tag}"`
|
|
@@ -2671,6 +2676,37 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
2671
2676
|
return { catalog, updated };
|
|
2672
2677
|
}
|
|
2673
2678
|
|
|
2679
|
+
// src/helpers/version-cache.ts
|
|
2680
|
+
var import_env_paths = __toESM(require("env-paths"), 1);
|
|
2681
|
+
var import_unstorage = require("unstorage");
|
|
2682
|
+
var import_fs = __toESM(require("unstorage/drivers/fs"), 1);
|
|
2683
|
+
var VERSION_CACHE_TTL = 1e3 * 60 * 60 * 24;
|
|
2684
|
+
var storage = (0, import_unstorage.createStorage)({
|
|
2685
|
+
driver: (0, import_fs.default)({ base: (0, import_env_paths.default)("storm-bun").cache })
|
|
2686
|
+
});
|
|
2687
|
+
function getCacheKey(packageName, tag) {
|
|
2688
|
+
return `versions/${encodeURIComponent(tag)}/${encodeURIComponent(packageName)}`;
|
|
2689
|
+
}
|
|
2690
|
+
async function getCachedVersion(packageName, tag) {
|
|
2691
|
+
const cacheKey = getCacheKey(packageName, tag);
|
|
2692
|
+
try {
|
|
2693
|
+
const cached = await storage.getItem(cacheKey);
|
|
2694
|
+
if (cached && typeof cached.checkedAt === "number" && typeof cached.version === "string" && Date.now() - cached.checkedAt < VERSION_CACHE_TTL) {
|
|
2695
|
+
return cached.version;
|
|
2696
|
+
}
|
|
2697
|
+
} catch {
|
|
2698
|
+
}
|
|
2699
|
+
const version = await getVersion(packageName, tag, {
|
|
2700
|
+
executable: "bun pm",
|
|
2701
|
+
registry: await getNpmRegistry()
|
|
2702
|
+
});
|
|
2703
|
+
try {
|
|
2704
|
+
await storage.setItem(cacheKey, { checkedAt: Date.now(), version });
|
|
2705
|
+
} catch {
|
|
2706
|
+
}
|
|
2707
|
+
return version;
|
|
2708
|
+
}
|
|
2709
|
+
|
|
2674
2710
|
// src/cli/index.ts
|
|
2675
2711
|
var _config = {};
|
|
2676
2712
|
function createProgram(config) {
|
|
@@ -2739,11 +2775,15 @@ async function updateAction(packages, options) {
|
|
|
2739
2775
|
verbose = false
|
|
2740
2776
|
} = options || {};
|
|
2741
2777
|
let packagesFound = false;
|
|
2742
|
-
|
|
2778
|
+
const requestedPackages = Array.isArray(packages) ? packages.filter(Boolean).map((pkg) => pkg.trim().replaceAll("*", "")) : [];
|
|
2779
|
+
let pkgs = [...requestedPackages];
|
|
2743
2780
|
if (internal || pkgs.length === 0 || all) {
|
|
2744
2781
|
pkgs.push(...INTERNAL_PACKAGES);
|
|
2745
2782
|
}
|
|
2746
2783
|
pkgs = pkgs.filter(Boolean).map((pkg) => pkg.trim().replaceAll("*", ""));
|
|
2784
|
+
const isExplicitlyRequested = (packageName) => requestedPackages.some(
|
|
2785
|
+
(pkg) => pkg.endsWith("/") ? packageName.startsWith(pkg) : packageName === pkg
|
|
2786
|
+
);
|
|
2747
2787
|
let changed = [];
|
|
2748
2788
|
if (pkgs.length > 0) {
|
|
2749
2789
|
writeDebug(
|
|
@@ -2787,6 +2827,7 @@ async function updateAction(packages, options) {
|
|
|
2787
2827
|
tag,
|
|
2788
2828
|
prefix,
|
|
2789
2829
|
workspaceRoot: _config.workspaceRoot,
|
|
2830
|
+
versionResolver: isExplicitlyRequested(matchedPackage) ? getCachedVersion : void 0,
|
|
2790
2831
|
verbose
|
|
2791
2832
|
});
|
|
2792
2833
|
if (result.updated && result.catalog[matchedPackage]) {
|
package/bin/bun.js
CHANGED
|
@@ -2188,6 +2188,10 @@ var INTERNAL_PACKAGES = [
|
|
|
2188
2188
|
"aftershock",
|
|
2189
2189
|
"@telepathic/*",
|
|
2190
2190
|
"telepathic",
|
|
2191
|
+
"@questgiver/*",
|
|
2192
|
+
"questgiver",
|
|
2193
|
+
"@mindctl/*",
|
|
2194
|
+
"mindctl",
|
|
2191
2195
|
"@power-plant/*",
|
|
2192
2196
|
"power-plant",
|
|
2193
2197
|
"@razorwind/*",
|
|
@@ -2211,7 +2215,7 @@ import { Command } from "commander";
|
|
|
2211
2215
|
// package.json
|
|
2212
2216
|
var package_default = {
|
|
2213
2217
|
name: "@storm-software/bun-tools",
|
|
2214
|
-
version: "0.0.
|
|
2218
|
+
version: "0.0.50",
|
|
2215
2219
|
private: false,
|
|
2216
2220
|
description: "A set of [Bun](https://bun.sh/) plugins and utilities for managing workspace packages/dependencies.",
|
|
2217
2221
|
repository: {
|
|
@@ -2311,7 +2315,9 @@ var package_default = {
|
|
|
2311
2315
|
defu: "catalog:",
|
|
2312
2316
|
prettier: "catalog:",
|
|
2313
2317
|
"prettier-plugin-packagejson": "catalog:",
|
|
2318
|
+
"env-paths": "^4.0.0",
|
|
2314
2319
|
semver: "catalog:",
|
|
2320
|
+
unstorage: "^1.17.5",
|
|
2315
2321
|
yaml: "catalog:"
|
|
2316
2322
|
},
|
|
2317
2323
|
devDependencies: {
|
|
@@ -2607,11 +2613,10 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
2607
2613
|
workspaceConfig
|
|
2608
2614
|
);
|
|
2609
2615
|
}
|
|
2610
|
-
const
|
|
2611
|
-
const origVersion = await getVersion(packageName, tag, {
|
|
2616
|
+
const origVersion = await (options.versionResolver ?? (async (name, versionTag) => getVersion(name, versionTag, {
|
|
2612
2617
|
executable: "bun pm",
|
|
2613
|
-
registry:
|
|
2614
|
-
});
|
|
2618
|
+
registry: await getNpmRegistry()
|
|
2619
|
+
})))(packageName, tag);
|
|
2615
2620
|
if (!origVersion) {
|
|
2616
2621
|
throw new Error(
|
|
2617
2622
|
`Failed to fetch version for package "${packageName}" with tag "${tag}"`
|
|
@@ -2649,6 +2654,37 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
2649
2654
|
return { catalog, updated };
|
|
2650
2655
|
}
|
|
2651
2656
|
|
|
2657
|
+
// src/helpers/version-cache.ts
|
|
2658
|
+
import envPaths from "env-paths";
|
|
2659
|
+
import { createStorage } from "unstorage";
|
|
2660
|
+
import fsDriver from "unstorage/drivers/fs";
|
|
2661
|
+
var VERSION_CACHE_TTL = 1e3 * 60 * 60 * 24;
|
|
2662
|
+
var storage = createStorage({
|
|
2663
|
+
driver: fsDriver({ base: envPaths("storm-bun").cache })
|
|
2664
|
+
});
|
|
2665
|
+
function getCacheKey(packageName, tag) {
|
|
2666
|
+
return `versions/${encodeURIComponent(tag)}/${encodeURIComponent(packageName)}`;
|
|
2667
|
+
}
|
|
2668
|
+
async function getCachedVersion(packageName, tag) {
|
|
2669
|
+
const cacheKey = getCacheKey(packageName, tag);
|
|
2670
|
+
try {
|
|
2671
|
+
const cached = await storage.getItem(cacheKey);
|
|
2672
|
+
if (cached && typeof cached.checkedAt === "number" && typeof cached.version === "string" && Date.now() - cached.checkedAt < VERSION_CACHE_TTL) {
|
|
2673
|
+
return cached.version;
|
|
2674
|
+
}
|
|
2675
|
+
} catch {
|
|
2676
|
+
}
|
|
2677
|
+
const version = await getVersion(packageName, tag, {
|
|
2678
|
+
executable: "bun pm",
|
|
2679
|
+
registry: await getNpmRegistry()
|
|
2680
|
+
});
|
|
2681
|
+
try {
|
|
2682
|
+
await storage.setItem(cacheKey, { checkedAt: Date.now(), version });
|
|
2683
|
+
} catch {
|
|
2684
|
+
}
|
|
2685
|
+
return version;
|
|
2686
|
+
}
|
|
2687
|
+
|
|
2652
2688
|
// src/cli/index.ts
|
|
2653
2689
|
var _config = {};
|
|
2654
2690
|
function createProgram(config) {
|
|
@@ -2717,11 +2753,15 @@ async function updateAction(packages, options) {
|
|
|
2717
2753
|
verbose = false
|
|
2718
2754
|
} = options || {};
|
|
2719
2755
|
let packagesFound = false;
|
|
2720
|
-
|
|
2756
|
+
const requestedPackages = Array.isArray(packages) ? packages.filter(Boolean).map((pkg) => pkg.trim().replaceAll("*", "")) : [];
|
|
2757
|
+
let pkgs = [...requestedPackages];
|
|
2721
2758
|
if (internal || pkgs.length === 0 || all) {
|
|
2722
2759
|
pkgs.push(...INTERNAL_PACKAGES);
|
|
2723
2760
|
}
|
|
2724
2761
|
pkgs = pkgs.filter(Boolean).map((pkg) => pkg.trim().replaceAll("*", ""));
|
|
2762
|
+
const isExplicitlyRequested = (packageName) => requestedPackages.some(
|
|
2763
|
+
(pkg) => pkg.endsWith("/") ? packageName.startsWith(pkg) : packageName === pkg
|
|
2764
|
+
);
|
|
2725
2765
|
let changed = [];
|
|
2726
2766
|
if (pkgs.length > 0) {
|
|
2727
2767
|
writeDebug(
|
|
@@ -2765,6 +2805,7 @@ async function updateAction(packages, options) {
|
|
|
2765
2805
|
tag,
|
|
2766
2806
|
prefix,
|
|
2767
2807
|
workspaceRoot: _config.workspaceRoot,
|
|
2808
|
+
versionResolver: isExplicitlyRequested(matchedPackage) ? getCachedVersion : void 0,
|
|
2768
2809
|
verbose
|
|
2769
2810
|
});
|
|
2770
2811
|
if (result.updated && result.catalog[matchedPackage]) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c,b}from'./chunk-Y2HO4X3Y.js';import a from'env-paths';import {createStorage}from'unstorage';import h from'unstorage/drivers/fs';var g=1e3*60*60*24,s=createStorage({driver:h({base:a("storm-bun").cache})});function f(t,r){return `versions/${encodeURIComponent(r)}/${encodeURIComponent(t)}`}async function w(t,r){let n=f(t,r);try{let e=await s.getItem(n);if(e&&typeof e.checkedAt=="number"&&typeof e.version=="string"&&Date.now()-e.checkedAt<g)return e.version}catch{}let o=await c(t,r,{executable:"bun pm",registry:await b()});try{await s.setItem(n,{checkedAt:Date.now(),version:o});}catch{}return o}export{w as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkIW73C7OV_cjs=require('./chunk-IW73C7OV.cjs'),chunkDW2HTWAU_cjs=require('./chunk-DW2HTWAU.cjs'),devkit=require('@nx/devkit'),fs=require('fs'),promises=require('fs/promises'),prettier=require('prettier'),J=require('prettier-plugin-packagejson');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var J__default=/*#__PURE__*/_interopDefault(J);async function x(t=process.cwd(),f=chunkDW2HTWAU_cjs.e(t)){let g=chunkDW2HTWAU_cjs.d(t,"package.json"),l=await promises.readFile(g,"utf8");if(!l)throw new Error("No package.json file found in package root: "+t);let s=await chunkIW73C7OV_cjs.b(f),c=JSON.parse(l);if(!s){console.warn("No workspace catalog found. Skipping dependencies replacement for now.");return}for(let n of ["dependencies","devDependencies","peerDependencies"]){let o=c[n];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!s)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`package.json\` file.`);let a=s[e];if(!a)throw new Error("Missing workspace catalog version for "+e);o[e]=a;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let r;try{r=devkit.readCachedProjectGraph();}catch{await devkit.createProjectGraphAsync(),r=devkit.readCachedProjectGraph();}let i={};r&&await Promise.all(Object.keys(r.nodes).map(async n=>{let o=r.nodes[n];if(o?.data.root){let e=chunkDW2HTWAU_cjs.d(f,o.data.root,"package.json");if(fs.existsSync(e)){let a=await promises.readFile(e,"utf8"),p=JSON.parse(a);p.private!==true&&(i[p.name]=p.version);}}}));for(let n of ["dependencies","devDependencies","peerDependencies"]){let o=c[n];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(i[e])o[e]=`^${i[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return promises.writeFile(g,await prettier.format(JSON.stringify(c),{parser:"json",proseWrap:"preserve",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:[J__default.default]}))}exports.a=x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkDK4D3PFF_cjs=require('./chunk-DK4D3PFF.cjs'),chunkDW2HTWAU_cjs=require('./chunk-DW2HTWAU.cjs'),g=require('defu');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var g__default=/*#__PURE__*/_interopDefault(g);function d(a=chunkDW2HTWAU_cjs.e(process.cwd())){return chunkDK4D3PFF_cjs.a(a)}async function w(a=chunkDW2HTWAU_cjs.e(process.cwd())){let s=await chunkDK4D3PFF_cjs.b(a);if(s)return s}async function u(a,s=chunkDW2HTWAU_cjs.e(process.cwd())){let o=await chunkDK4D3PFF_cjs.b(s);if(!o)throw new Error("No package.json file found in workspace root");if(a.catalog&&chunkDK4D3PFF_cjs.d(o,a.catalog),!a.packages)throw new Error("No packages found in workspace file");Array.isArray(o.workspaces)||!o.workspaces?o.workspaces={packages:a.packages,catalog:a.catalog}:(o.workspaces.packages=g__default.default(a.packages,o.workspaces.packages),a.catalog&&(o.workspaces.catalog=g__default.default(a.catalog,o.workspaces.catalog))),await chunkDK4D3PFF_cjs.e(o,s);}exports.a=d;exports.b=w;exports.c=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a,b,d,e as e$1}from'./chunk-LUXOLZKJ.js';import {e}from'./chunk-IVWMWBEI.js';import g from'defu';function w(a$1=e(process.cwd())){return a(a$1)}async function u(a=e(process.cwd())){let s=await b(a);if(s)return s}async function P(a,s=e(process.cwd())){let o=await b(s);if(!o)throw new Error("No package.json file found in workspace root");if(a.catalog&&d(o,a.catalog),!a.packages)throw new Error("No packages found in workspace file");Array.isArray(o.workspaces)||!o.workspaces?o.workspaces={packages:a.packages,catalog:a.catalog}:(o.workspaces.packages=g(a.packages,o.workspaces.packages),a.catalog&&(o.workspaces.catalog=g(a.catalog,o.workspaces.catalog))),await e$1(o,s);}export{w as a,u as b,P as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkDW2HTWAU_cjs=require('./chunk-DW2HTWAU.cjs'),fs=require('fs'),promises=require('fs/promises'),prettier=require('prettier'),d=require('prettier-plugin-packagejson');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var d__default=/*#__PURE__*/_interopDefault(d);var k={parser:"json",proseWrap:"preserve",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:[d__default.default]};function c(r=chunkDW2HTWAU_cjs.e(process.cwd())){let o=chunkDW2HTWAU_cjs.d(r,"package.json");if(!fs.existsSync(o))throw new Error(`No \`package.json\` file found in workspace root (searched in: ${o}).`);return o}async function h(r=chunkDW2HTWAU_cjs.e(process.cwd())){let o=await promises.readFile(c(r),"utf8");if(o)return JSON.parse(o)}function j(r){if(r.catalog)return r.catalog;let o=r.workspaces;if(o&&typeof o=="object"&&!Array.isArray(o))return o.catalog}function S(r,o){if(r.catalog){r.catalog=o;return}let e=r.workspaces;if(e&&typeof e=="object"&&!Array.isArray(e)&&e.catalog){e.catalog=o;return}r.catalog=o;}async function x(r,o=chunkDW2HTWAU_cjs.e(process.cwd())){let e=await chunkDW2HTWAU_cjs.g(),a=await prettier.format(JSON.stringify(r),k);chunkDW2HTWAU_cjs.c(`Writing updated package.json file to workspace root: ${a}`,e),await promises.writeFile(c(o),a);}exports.a=c;exports.b=h;exports.c=j;exports.d=S;exports.e=x;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
${i?"":`${
|
|
1
|
+
'use strict';require('date-fns/formatDistanceToNow');var xo=require('chalk'),fs=require('fs'),path=require('path'),r=require('zod/v4/mini'),$o=require('defu'),c12=require('c12'),promises=require('fs/promises');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var xo__default=/*#__PURE__*/_interopDefault(xo);var r__namespace=/*#__PURE__*/_interopNamespace(r);var $o__default=/*#__PURE__*/_interopDefault($o);var d={SILENT:0,FATAL:10,ERROR:20,WARN:30,SUCCESS:35,INFO:40,PERFORMANCE:50,DEBUG:60,TRACE:70,ALL:100},l={SILENT:"silent",FATAL:"fatal",ERROR:"error",WARN:"warn",SUCCESS:"success",INFO:"info",PERFORMANCE:"performance",DEBUG:"debug",TRACE:"trace",ALL:"all"};var R={dark:{brand:"#2dd4bf",success:"#10b981",info:"#58a6ff",debug:"#8afafc",warning:"#f3d371",danger:"#D8314A",fatal:"#a40e26",performance:"#80fd74"}};var Go={hex:e=>o=>o,bgHex:e=>({whiteBright:o=>o,white:o=>o}),white:e=>e,whiteBright:e=>e,gray:e=>e,bold:{hex:e=>o=>o,bgHex:e=>({whiteBright:o=>o,white:o=>o}),whiteBright:e=>e,white:e=>e},dim:{hex:e=>o=>o,gray:e=>e}},re=()=>{let e=xo__default.default;return (!e?.hex||!e?.bold?.hex||!e?.bgHex||!e?.whiteBright||!e?.white)&&(e=Go),e};function se(){return process.platform!=="win32"?process.env.TERM!=="linux":!!process.env.WT_SESSION||!!process.env.TERMINUS_SUBLIME||process.env.ConEmuTask==="{cmd::Cmder}"||process.env.TERM_PROGRAM==="Terminus-Sublime"||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color"||process.env.TERM==="alacritty"||process.env.TERM==="rxvt-unicode"||process.env.TERM==="rxvt-unicode-256color"||process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var S=(e,o)=>se()?e:o,T={[l.ERROR]:S("\u2718","\xD7"),[l.FATAL]:S("\u{1F571}","\xD7"),[l.WARN]:S("\u26A0","\u203C"),[l.INFO]:S("\u2139","i"),[l.PERFORMANCE]:S("\u23F1","\u23F1"),[l.SUCCESS]:S("\u2714","\u221A"),[l.DEBUG]:S("\u{1F6E0}","D"),[l.TRACE]:S("\u2699","T"),[l.ALL]:S("\u2709","\u2192")};var C=(e=false,o=new Date)=>e?`${o.toLocaleDateString()} ${o.toLocaleTimeString()}`:`${o.toLocaleTimeString()}`;var O=e=>{switch(e){case "all":return d.ALL;case "trace":return d.TRACE;case "debug":return d.DEBUG;case "performance":return d.PERFORMANCE;case "info":return d.INFO;case "warn":return d.WARN;case "error":return d.ERROR;case "fatal":return d.FATAL;case "silent":return d.SILENT;default:return d.INFO}},te=(e=d.INFO)=>e>=d.ALL?l.ALL:e>=d.TRACE?l.TRACE:e>=d.DEBUG?l.DEBUG:e>=d.PERFORMANCE?l.PERFORMANCE:e>=d.INFO?l.INFO:e>=d.WARN?l.WARN:e>=d.ERROR?l.ERROR:e>=d.FATAL?l.FATAL:e<=d.SILENT?l.SILENT:l.INFO;var J=(e=d.INFO,o={},s={})=>{let{chalk:n=re(),fullDateTime:a=false,hideDateTime:i=false}=s,c=!o.colors?.dark&&!o.colors?.base&&!o.colors?.base?.dark?R:o.colors?.dark&&typeof o.colors.dark=="string"?o.colors:o.colors?.base?.dark&&typeof o.colors.base.dark=="string"?o.colors.base.dark:o.colors?.base?o.colors?.base:R,p=o.logLevel||process.env.STORM_LOG_LEVEL||l.INFO;return e>O(p)||e<=d.SILENT||O(p)<=d.SILENT?u=>{}:typeof e=="number"&&d.FATAL>=e?u=>{console.error(`
|
|
2
|
+
${i?"":`${n.gray(C(a))} `}${n.hex(c.fatal??R.dark.fatal)(`[${T[l.FATAL]} Fatal] `)}${n.bold.whiteBright(E(u))}
|
|
3
3
|
`);}:typeof e=="number"&&d.ERROR>=e?u=>{console.error(`
|
|
4
|
-
${i?"":`${
|
|
4
|
+
${i?"":`${n.gray(C(a))} `}${n.hex(c.danger??R.dark.danger)(`[${T[l.ERROR]} Error] `)}${n.bold.whiteBright(E(u))}
|
|
5
5
|
`);}:typeof e=="number"&&d.WARN>=e?u=>{console.warn(`
|
|
6
|
-
${i?"":`${
|
|
6
|
+
${i?"":`${n.gray(C(a))} `}${n.hex(c.warning??R.dark.warning)(`[${T[l.WARN]} Warn] `)}${n.bold.whiteBright(E(u))}
|
|
7
7
|
`);}:typeof e=="number"&&d.SUCCESS>=e?u=>{console.info(`
|
|
8
|
-
${i?"":`${
|
|
8
|
+
${i?"":`${n.gray(C(a))} `}${n.hex(c.success??R.dark.success)(`[${T[l.SUCCESS]} Success] `)}${n.bold.whiteBright(E(u))}
|
|
9
9
|
`);}:typeof e=="number"&&d.INFO>=e?u=>{console.info(`
|
|
10
|
-
${i?"":`${
|
|
10
|
+
${i?"":`${n.gray(C(a))} `}${n.hex(c.info??R.dark.info)(`[${T[l.INFO]} Info] `)}${n.bold.whiteBright(E(u))}
|
|
11
11
|
`);}:typeof e=="number"&&d.PERFORMANCE>=e?u=>{console.debug(`
|
|
12
|
-
${i?"":`${
|
|
12
|
+
${i?"":`${n.gray(C(a))} `}${n.hex(c.performance??R.dark.performance)(`[${T[l.PERFORMANCE]} Performance] `)}${n.bold.whiteBright(E(u))}
|
|
13
13
|
`);}:typeof e=="number"&&d.DEBUG>=e?u=>{console.debug(`
|
|
14
|
-
${i?"":`${
|
|
14
|
+
${i?"":`${n.gray(C(a))} `}${n.hex(c.debug??R.dark.debug)(`[${T[l.DEBUG]} Debug] `)}${n.bold.whiteBright(E(u))}
|
|
15
15
|
`);}:typeof e=="number"&&d.TRACE>=e?u=>{console.debug(`
|
|
16
|
-
${i?"":`${
|
|
16
|
+
${i?"":`${n.gray(C(a))} `}${n.hex("#bbbbbb")(`[${T[l.TRACE]} Trace] `)}${n.bold.whiteBright(E(u))}
|
|
17
17
|
`);}:u=>{console.log(`
|
|
18
|
-
${i?"":`${
|
|
19
|
-
`);}};var ne=(e,o)=>J(d.WARN,o)(e);var
|
|
20
|
-
${e.sort(i?(c,p)=>!c&&!p?0:c?p?String(c).localeCompare(String(p)):-1:1:void 0).map((c,p)=>` ${
|
|
18
|
+
${i?"":`${n.gray(C(a))} `}${n.hex(c.brand??R.dark.brand)(`[${T[l.ALL]} System] `)}${n.bold.whiteBright(E(u))}
|
|
19
|
+
`);}};var ne=(e,o)=>J(d.WARN,o)(e);var Wr=(e,o)=>J(d.DEBUG,o)(e),_=(e,o)=>J(d.TRACE,o)(e);var Po=10,E=(e,o={},s=0)=>{if(s>Po)return "<max depth>";let n=o.prefix??"",a=o.skip??[],i=o.sort??true;return typeof e>"u"||e===null?"<empty>":typeof e=="string"?e||"<empty string>":Array.isArray(e)?`
|
|
20
|
+
${e.sort(i?(c,p)=>!c&&!p?0:c?p?String(c).localeCompare(String(p)):-1:1:void 0).map((c,p)=>` ${n}> #${p} = ${E(c,{prefix:`${n}--`,skip:a,sort:i},s+1)}`).join(`
|
|
21
21
|
`)}`:typeof e=="object"&&e?`
|
|
22
|
-
${Object.keys(e).filter(c=>typeof c!="string"||!a.map(p=>p.toLowerCase().trim()).includes(c.toLowerCase().trim())).sort(i?(c,p)=>!c&&!p?0:c?p?String(c).localeCompare(String(p)):-1:1:void 0).map(c=>` ${
|
|
23
|
-
`)}`:String(e)},
|
|
22
|
+
${Object.keys(e).filter(c=>typeof c!="string"||!a.map(p=>p.toLowerCase().trim()).includes(c.toLowerCase().trim())).sort(i?(c,p)=>!c&&!p?0:c?p?String(c).localeCompare(String(p)):-1:1:void 0).map(c=>` ${n}> ${c} = ${Mo(e[c])?"<function>":typeof e[c]=="object"&&e[c]?Object.keys(e[c]).filter(p=>typeof p!="string"||!a.map(u=>u.toLowerCase().trim()).includes(p.toLowerCase().trim())).length===0?"{}":E(e[c],{prefix:`${n}--`,skip:a,sort:i},s+1):e[c]}`).join(`
|
|
23
|
+
`)}`:String(e)},Mo=e=>{try{return e instanceof Function||typeof e=="function"||!!(e?.constructor&&e?.call&&e?.apply)}catch{return false}};var Fo=/^[A-Za-z]:\//;function Uo(e=""){return e&&e.replace(/\\/g,"/").replace(Fo,o=>o.toUpperCase())}var Wo=/^[/\\]{2}/,Bo=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,jo=/^[A-Za-z]:$/;var m=function(e){if(!e||e.length===0)return ".";e=Uo(e);let o=e?.match(Wo),s=ae(e),n=e[e.length-1]==="/";return e=Ho(e,!s),e.length===0?s?"/":n?"./":".":(n&&(e+="/"),jo.test(e)&&(e+="/"),o?s?`//${e}`:`//./${e}`:s&&!ae(e)?`/${e}`:e)},v=function(...e){let o="";for(let s of e)if(s)if(o.length>0){let n=o[o.length-1]==="/",a=s[0]==="/";n&&a?o+=s.slice(1):o+=n||a?s:`/${s}`;}else o+=s;return m(o)};function Ho(e,o){let s="",n=0,a=-1,i=0,c=null;for(let p=0;p<=e.length;++p){if(p<e.length)c=e[p];else {if(c==="/")break;c="/";}if(c==="/"){if(!(a===p-1||i===1))if(i===2){if(s.length<2||n!==2||s[s.length-1]!=="."||s[s.length-2]!=="."){if(s.length>2){let u=s.lastIndexOf("/");u===-1?(s="",n=0):(s=s.slice(0,u),n=s.length-1-s.lastIndexOf("/")),a=p,i=0;continue}else if(s.length>0){s="",n=0,a=p,i=0;continue}}o&&(s+=s.length>0?"/..":"..",n=2);}else s.length>0?s+=`/${e.slice(a+1,p)}`:s=e.slice(a+1,p),n=p-a-1;a=p,i=0;}else c==="."&&i!==-1?++i:i=-1;}return s}var ae=function(e){return Bo.test(e)};var Ko=30,Yo=0;function q(e,o=[],s=[]){let n=e??process.cwd();if(s.some(a=>fs.existsSync(path.join(n,a)))||o.some(a=>fs.existsSync(path.join(n,a))))return n;if(n!=="/"&&Yo++<Ko){let a=path.join(n,"..");return q(a,o,s)}}var ce=["storm-workspace.json","storm-workspace.yaml","storm-workspace.yml","storm-workspace.js","storm-workspace.ts",".storm-workspace.json",".storm-workspace.yaml",".storm-workspace.yml",".storm-workspace.js",".storm-workspace.ts","lerna.json","nx.json","turbo.json","npm-workspace.json","yarn-workspace.json","pnpm-workspace.json","npm-workspace.yaml","yarn-workspace.yaml","pnpm-workspace.yaml","npm-workspace.yml","yarn-workspace.yml","pnpm-workspace.yml","npm-lock.json","yarn-lock.json","pnpm-lock.json","npm-lock.yaml","yarn-lock.yaml","pnpm-lock.yaml","npm-lock.yml","yarn-lock.yml","pnpm-lock.yml","bun.lockb","bun.lock","bunfig.toml"],Zo=[".storm-workspace",".nx",".git",".github",".vscode",".verdaccio"];function Vo(e){return process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH?m(process.env.STORM_WORKSPACE_ROOT??process.env.NX_WORKSPACE_ROOT_PATH):m(q(e??process.cwd(),ce,Zo))}function k(e){let o=Vo(e);if(!o)throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
|
|
24
24
|
${ce.join(`
|
|
25
25
|
`)}
|
|
26
|
-
Path: ${e||process.cwd()}`);return o}var pe="https://docs.stormsoftware.com",L="https://stormsoftware.com";var de="https://stormsoftware.com/license",le="Apache-2.0";var w="tools/errors/codes.json",me="The workspace's banner image",ue=["dark","light","base","brand","alternate","accent","link","success","discovery","info","warning","danger","fatal","performance","positive","negative"];var n=r__namespace.registry(),h=r__namespace.string().check(r__namespace.length(7),r__namespace.toLowerCase(),r__namespace.regex(/^#([0-9a-f]{3}){1,2}$/i),r__namespace.trim());n.add(h,{description:"A base schema for describing the format of colors"});var b=r__namespace._default(h,"#1e2124");n.add(b,{description:"The dark background color of the workspace"});var y=r__namespace._default(h,"#cbd5e1");n.add(y,{description:"The light background color of the workspace"});var z=r__namespace._default(h,"#1fb2a6");n.add(z,{description:"The primary brand specific color of the workspace"});var x=r__namespace.optional(h);n.add(x,{description:"The alternate brand specific color of the workspace"});var D=r__namespace.optional(h);n.add(D,{description:"The secondary brand specific color of the workspace"});var G=r__namespace._default(h,"#3fa6ff");n.add(G,{description:"The color used to display hyperlink text"});var P=r__namespace._default(h,"#818cf8");n.add(P,{description:"The second brand specific color of the workspace"});var M=r__namespace._default(h,"#45b27e");n.add(M,{description:"The success color of the workspace"});var F=r__namespace._default(h,"#38bdf8");n.add(F,{description:"The informational color of the workspace"});var W=r__namespace._default(h,"#8afafc");n.add(W,{description:"The debug color of the workspace"});var U=r__namespace._default(h,"#f3d371");n.add(U,{description:"The warning color of the workspace"});var j=r__namespace._default(h,"#d8314a");n.add(j,{description:"The danger color of the workspace"});var B=r__namespace.optional(h);n.add(B,{description:"The fatal color of the workspace"});var H=r__namespace._default(h,"#80fd74");n.add(H,{description:"The performance color of the workspace"});var K=r__namespace._default(h,"#4ade80");n.add(K,{description:"The positive number color of the workspace"});var Y=r__namespace._default(h,"#ef4444");n.add(Y,{description:"The negative number color of the workspace"});var Z=r__namespace.optional(r__namespace.array(h));n.add(Z,{description:"The color stops for the base gradient color pattern used in the workspace"});var or=r__namespace.object({foreground:y,background:b,brand:z,alternate:x,accent:D,link:G,discovery:P,success:M,info:F,debug:W,warning:U,danger:j,fatal:B,performance:H,positive:K,negative:Y,gradient:Z}),rr=r__namespace.object({foreground:b,background:y,brand:z,alternate:x,accent:D,link:G,discovery:P,success:M,info:F,debug:W,warning:U,danger:j,fatal:B,performance:H,positive:K,negative:Y,gradient:Z}),tr=r__namespace.object({dark:or,light:rr}),sr=r__namespace.object({dark:b,light:y,brand:z,alternate:x,accent:D,link:G,discovery:P,success:M,info:F,debug:W,warning:U,danger:j,fatal:B,performance:H,positive:K,negative:Y,gradient:Z}),$=r__namespace.optional(r__namespace.url());n.add($,{description:"A remote registry URL used to publish distributable packages"});var ge=r__namespace._default(r__namespace.object({github:$,npm:$,cargo:$,cyclone:$,container:$}),{});n.add(ge,{description:"A list of remote registry URLs used by Storm Software"});var Q=r__namespace.union([sr,tr]);n.add(Q,{description:"Colors used for various workspace elements"});var fe=r__namespace.record(r__namespace.union([r__namespace.union([r__namespace.literal("base"),r__namespace.string()]),r__namespace.string()]),Q);n.add(fe,{description:"Storm theme config values used for styling various package elements"});var he=r__namespace.optional(r__namespace.union([r__namespace.string().check(r__namespace.trim()),r__namespace.array(r__namespace.string().check(r__namespace.trim()))]));n.add(he,{description:"The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration."});var Ee=r__namespace.string().check(r__namespace.trim());n.add(Ee,{description:"The workspace bot user's name (this is the bot that will be used to perform various tasks)"});var Re=r__namespace.string().check(r__namespace.trim());n.add(Re,{description:"The email of the workspace bot"});var Te=r__namespace.object({name:Ee,email:Re});n.add(Te,{description:"The workspace's bot user's config used to automated various operations tasks"});var Ce=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.url()));n.add(Ce,{description:"A URL to a banner image used to display the workspace's release"});var ve=r__namespace._default(r__namespace.string().check(r__namespace.trim()),me);n.add(ve,{description:"The alt text for the workspace's release banner image"});var Se=r__namespace.object({url:Ce,alt:ve});n.add(Se,{description:"The workspace's banner image used during the release process"});var ke=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));n.add(ke,{description:"A header message appended to the start of the workspace's release notes"});var Oe=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));n.add(Oe,{description:"A footer message appended to the end of the workspace's release notes"});var Ae=r__namespace.object({banner:r__namespace.union([Se,r__namespace.string().check(r__namespace.trim(),r__namespace.url())]),header:ke,footer:Oe});n.add(Ae,{description:"The workspace's release config used during the release process"});var $e=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));n.add($e,{description:"A Twitter/X account associated with the organization/project"});var _e=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));n.add(_e,{description:"A Discord account associated with the organization/project"});var Le=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));n.add(Le,{description:"A Telegram account associated with the organization/project"});var Ie=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));n.add(Ie,{description:"A Slack account associated with the organization/project"});var Ne=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));n.add(Ne,{description:"A Medium account associated with the organization/project"});var we=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));n.add(we,{description:"A GitHub account associated with the organization/project"});var be=r__namespace.object({twitter:$e,discord:_e,telegram:Le,slack:Ie,medium:Ne,github:we});n.add(be,{description:"The workspace's account config used to store various social media links"});var ye=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));n.add(ye,{description:"The directory used to store the environment's cached file data"});var ze=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));n.add(ze,{description:"The directory used to store the environment's data files"});var xe=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));n.add(xe,{description:"The directory used to store the environment's configuration files"});var De=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));n.add(De,{description:"The directory used to store the environment's temp files"});var Ge=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));n.add(Ge,{description:"The directory used to store the environment's log files"});var Pe=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"dist");n.add(Pe,{description:"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"});var Me=r__namespace.object({cache:ye,data:ze,config:xe,temp:De,log:Ge,build:Pe});n.add(Me,{description:"Various directories used by the workspace to store data, cache, and configuration files"});var Fe=r__namespace._default(r__namespace.enum(["minimal","monorepo"]),"monorepo");n.add(Fe,{description:"The variant of the workspace. This can be used to enable or disable certain features or configurations."});var We=r__namespace._default(r__namespace.string().check(r__namespace.trim()),w);n.add(We,{description:"The path to the workspace's error codes JSON file"});var Ue=r__namespace.optional(r__namespace.url());n.add(Ue,{description:"A URL to a page that looks up the workspace's error messages given a specific error code"});var je=r__namespace.object({codesFile:We,url:Ue});n.add(je,{description:"The workspace's error config used when creating error details during a system error"});var Be=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));n.add(Be,{description:"The name of the organization"});var He=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));n.add(He,{description:"A description of the organization"});var Ke=r__namespace.optional(r__namespace.url());n.add(Ke,{description:"A URL to the organization's logo image"});var Ye=r__namespace.optional(r__namespace.url());n.add(Ye,{description:"A URL to the organization's icon image"});var Ze=r__namespace.optional(r__namespace.url());n.add(Ze,{description:"A URL to a page that provides more information about the organization"});var Ve=r__namespace.object({name:Be,description:He,logo:Ke,icon:Ye,url:Ze});n.add(Ve,{description:"The workspace's organization details"});var Je=r__namespace._default(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()),"https://public.storm-cdn.com/schemas/storm-workspace.schema.json");n.add(Je,{description:"The URL or file path to the JSON schema file that describes the Storm configuration file"});var Xe=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());n.add(Xe,{description:"The name of the workspace/project/service/package/scope using this configuration"});var qe=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());n.add(qe,{description:"The namespace of the workspace/project/service/package/scope using this configuration"});var Qe=r__namespace.union([Ve,r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase())]);n.add(Qe,{description:"The organization of the workspace. This can be a string or an object containing the organization's details"});var eo=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());n.add(eo,{description:"The repo URL of the workspace (i.e. the GitHub repository URL)"});var oo=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"Apache-2.0");n.add(oo,{description:"The license type of the package"});var ro=r__namespace.optional(r__namespace.url());n.add(ro,{description:"The homepage of the workspace"});var to=r__namespace.optional(r__namespace.url());n.add(to,{description:"The documentation site for the workspace"});var so=r__namespace.optional(r__namespace.url());n.add(so,{description:"The development portal site for the workspace"});var no=r__namespace.optional(r__namespace.url());n.add(no,{description:"The licensing site for the workspace"});var ao=r__namespace.optional(r__namespace.url());n.add(ao,{description:"The contact site for the workspace"});var io=r__namespace.optional(r__namespace.url());n.add(io,{description:"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"});var co=r__namespace._default(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()),"main");n.add(co,{description:"The branch of the workspace"});var po=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));n.add(po,{description:"A tag specifying the version pre-release identifier"});var lo=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));n.add(lo,{description:"The owner of the package"});var mo=r__namespace._default(r__namespace.enum(["development","test","production"]).check(r__namespace.trim(),r__namespace.toLowerCase()),"production");n.add(mo,{description:"The current runtime environment mode for the package"});var uo=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());n.add(uo,{description:"The root directory of the workspace"});var go=r__namespace._default(r__namespace.boolean(),false);n.add(go,{description:"Should all known types of workspace caching be skipped?"});var fo=r__namespace._default(r__namespace.enum(["npm","yarn","pnpm","bun"]),"npm");n.add(fo,{description:"The JavaScript/TypeScript package manager used by the repository"});var ho=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"America/New_York");n.add(ho,{description:"The default timezone of the workspace"});var Eo=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"en-US");n.add(Eo,{description:"The default locale of the workspace"});var Ro=r__namespace._default(r__namespace.enum(["silent","fatal","error","warn","success","info","performance","debug","trace","all"]),"info");n.add(Ro,{description:"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`)."});var To=r__namespace._default(r__namespace.boolean(),true);n.add(To,{description:"Should the logging of the current Storm Workspace configuration be skipped?"});var Co=r__namespace._default(r__namespace.nullable(r__namespace.string().check(r__namespace.trim())),null);n.add(Co,{description:"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."});var ee=r__namespace._default(r__namespace.record(r__namespace.string(),r__namespace.any()),{});n.add(ee,{description:"Configuration of each used extension"});var vo=r__namespace.object({$schema:Je,extends:he,name:Xe,variant:Fe,namespace:qe,organization:Qe,repository:eo,license:oo,homepage:ro,docs:to,portal:so,licensing:no,contact:ao,support:io,branch:co,preid:po,owner:lo,bot:Te,release:Ae,socials:be,error:je,mode:mo,workspaceRoot:uo,skipCache:go,directories:Me,packageManager:fo,timezone:ho,locale:Eo,logLevel:Ro,skipConfigLogging:To,registry:ge,configFile:Co,colors:r__namespace.union([Q,fe]),extensions:ee});n.add(ee,{description:"Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo."});async function So(e){let o=le,t,s,a,i,c,p=R(e);if(fs.existsSync(path.join(p,"package.json"))){let u=await promises.readFile(T(p,"package.json"),"utf8");if(u){let f=JSON.parse(u);f.name&&(a=f.name),f.namespace&&(i=f.namespace),f.repository&&(typeof f.repository=="string"?c=f.repository:f.repository.url&&(c=f.repository.url)),f.license&&(o=f.license),f.homepage&&(t=f.homepage),f.bugs&&(typeof f.bugs=="string"?s=f.bugs:f.bugs.url&&(s=f.bugs.url));}}return {workspaceRoot:p,name:a,namespace:i,repository:c,license:o,homepage:t,support:s}}function ko(e){return !e.support&&e.contact&&(e.support=e.contact),!e.contact&&e.support&&(e.contact=e.support),e.homepage&&(e.docs||(e.docs=`${e.homepage}/docs`),e.license||(e.license=`${e.homepage}/license`),e.support||(e.support=`${e.homepage}/support`),e.contact||(e.contact=`${e.homepage}/contact`),(!e.error?.codesFile||!e?.error?.url)&&(e.error??={codesFile:w},e.homepage&&(e.error.url??=`${e.homepage}/errors`))),e}var Ao=async(e,o,t={})=>{let s=o||R(o),a=await Promise.all([c12.loadConfig({cwd:s,packageJson:true,name:e,envName:e?.toUpperCase(),jitiOptions:{debug:false,fsCache:process.env.STORM_SKIP_CACHE==="true"?false:T(process.env.STORM_CACHE_DIR||"node_modules/.cache/storm","jiti")},...t}),c12.loadConfig({cwd:s,packageJson:true,name:e,envName:e?.toUpperCase(),jitiOptions:{debug:false,fsCache:process.env.STORM_SKIP_CACHE==="true"?false:T(process.env.STORM_CACHE_DIR||"node_modules/.cache/storm","jiti")},configFile:e,...t})]);return $o__default.default(a[0]??{},a[1]??{})},_o=async(e,o=[])=>{let t=e||R(e),s=await Ao("storm-workspace",t),a=s.config,i=s.configFile;if(a&&i&&Object.keys(a).length>0&&!a.skipConfigLogging&&O(`Found Storm configuration file "${i.includes(`${t}/`)?i.replace(`${t}/`,""):i}" at "${t}"`,{logLevel:"all"}),o&&o.length>0){let c=await Promise.all(o.map(p=>Ao(p,t)));for(let p of c)p?.config&&p?.configFile&&Object.keys(p.config).length>0&&(!a.skipConfigLogging&&!p.config.skipConfigLogging&&O(`Found alternative configuration file "${p.configFile.includes(`${t}/`)?p.configFile.replace(`${t}/`,""):p.configFile}" at "${t}"`,{logLevel:"all"}),a=$o__default.default(p.config??{},a??{}));}if(!(!a||Object.keys(a).length===0))return a.configFile=i,a};var wo=()=>{let e="STORM_",o={extends:process.env[`${e}EXTENDS`]||void 0,name:process.env[`${e}NAME`]||void 0,variant:process.env[`${e}VARIANT`]||void 0,namespace:process.env[`${e}NAMESPACE`]||void 0,owner:process.env[`${e}OWNER`]||void 0,bot:{name:process.env[`${e}BOT_NAME`]||void 0,email:process.env[`${e}BOT_EMAIL`]||void 0},release:{banner:{url:process.env[`${e}RELEASE_BANNER_URL`]||void 0,alt:process.env[`${e}RELEASE_BANNER_ALT`]||void 0},header:process.env[`${e}RELEASE_HEADER`]||void 0,footer:process.env[`${e}RELEASE_FOOTER`]||void 0},error:{codesFile:process.env[`${e}ERROR_CODES_FILE`]||void 0,url:process.env[`${e}ERROR_URL`]||void 0},socials:{twitter:process.env[`${e}SOCIAL_TWITTER`]||void 0,discord:process.env[`${e}SOCIAL_DISCORD`]||void 0,telegram:process.env[`${e}SOCIAL_TELEGRAM`]||void 0,slack:process.env[`${e}SOCIAL_SLACK`]||void 0,medium:process.env[`${e}SOCIAL_MEDIUM`]||void 0,github:process.env[`${e}SOCIAL_GITHUB`]||void 0},organization:process.env[`${e}ORG`]||process.env[`${e}ORGANIZATION`]||process.env[`${e}ORG_NAME`]||process.env[`${e}ORGANIZATION_NAME`]?process.env[`${e}ORG_DESCRIPTION`]||process.env[`${e}ORGANIZATION_DESCRIPTION`]||process.env[`${e}ORG_URL`]||process.env[`${e}ORGANIZATION_URL`]||process.env[`${e}ORG_LOGO`]||process.env[`${e}ORGANIZATION_LOGO`]?{name:process.env[`${e}ORG`]||process.env[`${e}ORGANIZATION`]||process.env[`${e}ORG_NAME`]||process.env[`${e}ORGANIZATION_NAME`],description:process.env[`${e}ORG_DESCRIPTION`]||process.env[`${e}ORGANIZATION_DESCRIPTION`]||void 0,url:process.env[`${e}ORG_URL`]||process.env[`${e}ORGANIZATION_URL`]||void 0,logo:process.env[`${e}ORG_LOGO`]||process.env[`${e}ORGANIZATION_LOGO`]||void 0,icon:process.env[`${e}ORG_ICON`]||process.env[`${e}ORGANIZATION_ICON`]||void 0}:process.env[`${e}ORG`]||process.env[`${e}ORGANIZATION`]||process.env[`${e}ORG_NAME`]||process.env[`${e}ORGANIZATION_NAME`]:void 0,packageManager:process.env[`${e}PACKAGE_MANAGER`]||void 0,license:process.env[`${e}LICENSE`]||void 0,homepage:process.env[`${e}HOMEPAGE`]||void 0,docs:process.env[`${e}DOCS`]||void 0,portal:process.env[`${e}PORTAL`]||void 0,licensing:process.env[`${e}LICENSING`]||void 0,contact:process.env[`${e}CONTACT`]||void 0,support:process.env[`${e}SUPPORT`]||void 0,timezone:process.env[`${e}TIMEZONE`]||process.env.TZ||void 0,locale:process.env[`${e}LOCALE`]||process.env.LOCALE||void 0,configFile:process.env[`${e}WORKSPACE_CONFIG_FILE`]?m(process.env[`${e}WORKSPACE_CONFIG_FILE`]):void 0,workspaceRoot:process.env[`${e}WORKSPACE_ROOT`]?m(process.env[`${e}WORKSPACE_ROOT`]):void 0,directories:{cache:process.env[`${e}CACHE_DIR`]?m(process.env[`${e}CACHE_DIR`]):process.env[`${e}CACHE_DIRECTORY`]?m(process.env[`${e}CACHE_DIRECTORY`]):void 0,data:process.env[`${e}DATA_DIR`]?m(process.env[`${e}DATA_DIR`]):process.env[`${e}DATA_DIRECTORY`]?m(process.env[`${e}DATA_DIRECTORY`]):void 0,config:process.env[`${e}CONFIG_DIR`]?m(process.env[`${e}CONFIG_DIR`]):process.env[`${e}CONFIG_DIRECTORY`]?m(process.env[`${e}CONFIG_DIRECTORY`]):void 0,temp:process.env[`${e}TEMP_DIR`]?m(process.env[`${e}TEMP_DIR`]):process.env[`${e}TEMP_DIRECTORY`]?m(process.env[`${e}TEMP_DIRECTORY`]):void 0,log:process.env[`${e}LOG_DIR`]?m(process.env[`${e}LOG_DIR`]):process.env[`${e}LOG_DIRECTORY`]?m(process.env[`${e}LOG_DIRECTORY`]):void 0,build:process.env[`${e}BUILD_DIR`]?m(process.env[`${e}BUILD_DIR`]):process.env[`${e}BUILD_DIRECTORY`]?m(process.env[`${e}BUILD_DIRECTORY`]):void 0},skipCache:process.env[`${e}SKIP_CACHE`]!==void 0?!!process.env[`${e}SKIP_CACHE`]:void 0,mode:(process.env[`${e}MODE`]??process.env.NODE_ENV??process.env.ENVIRONMENT)||void 0,repository:process.env[`${e}REPOSITORY`]||void 0,branch:process.env[`${e}BRANCH`]||void 0,preid:process.env[`${e}PRE_ID`]||void 0,registry:{github:process.env[`${e}REGISTRY_GITHUB`]||void 0,npm:process.env[`${e}REGISTRY_NPM`]||void 0,cargo:process.env[`${e}REGISTRY_CARGO`]||void 0,cyclone:process.env[`${e}REGISTRY_CYCLONE`]||void 0,container:process.env[`${e}REGISTRY_CONTAINER`]||void 0},logLevel:process.env[`${e}LOG_LEVEL`]!==null&&process.env[`${e}LOG_LEVEL`]!==void 0?process.env[`${e}LOG_LEVEL`]&&Number.isSafeInteger(Number.parseInt(process.env[`${e}LOG_LEVEL`]))?se(Number.parseInt(process.env[`${e}LOG_LEVEL`])):process.env[`${e}LOG_LEVEL`]:void 0,skipConfigLogging:process.env[`${e}SKIP_CONFIG_LOGGING`]!==void 0?!!process.env[`${e}SKIP_CONFIG_LOGGING`]:void 0},t=Object.keys(process.env).filter(a=>a.startsWith(`${e}COLOR_`)&&ue.every(i=>!a.startsWith(`${e}COLOR_LIGHT_${i}`)&&!a.startsWith(`${e}COLOR_DARK_${i}`)));o.colors=t.length>0?t.reduce((a,i)=>(a[i]=Lo(e,i),a),{}):Lo(e),o.docs===pe&&(o.homepage===L?o.docs=`${L}/projects/${o.name}/docs`:o.docs=`${o.homepage}/docs`),o.licensing===de&&(o.homepage===L?o.licensing=`${L}/projects/${o.name}/licensing`:o.licensing=`${o.homepage}/docs`);let s=process.env[`${e}WORKSPACE_CONFIG`];if(s){let a=JSON.parse(s);o={...o,...a,colors:{...o.colors,...a.colors},extensions:{...o.extensions,...a.extensions}};}return o},Lo=(e,o)=>{let t=`COLOR_${o&&o!=="base"?`${o}_`:""}`.toUpperCase();return process.env[`${e}${t}LIGHT_BRAND`]||process.env[`${e}${t}DARK_BRAND`]?pr(e+t):cr(e+t)},cr=e=>{let o=[];if(process.env[`${e}GRADIENT_START`]&&process.env[`${e}GRADIENT_END`])o.push(process.env[`${e}GRADIENT_START`],process.env[`${e}GRADIENT_END`]);else if(process.env[`${e}GRADIENT_0`]||process.env[`${e}GRADIENT_1`]){let t=process.env[`${e}GRADIENT_0`]?0:1;for(;process.env[`${e}GRADIENT_${t}`];)o.push(process.env[`${e}GRADIENT_${t}`]),t++;}return {dark:process.env[`${e}DARK`],light:process.env[`${e}LIGHT`],brand:process.env[`${e}BRAND`],alternate:process.env[`${e}ALTERNATE`],accent:process.env[`${e}ACCENT`],link:process.env[`${e}LINK`],discovery:process.env[`${e}DISCOVERY`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],debug:process.env[`${e}DEBUG`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],performance:process.env[`${e}PERFORMANCE`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}},pr=e=>({light:Io(`${e}_LIGHT_`),dark:Io(`${e}_DARK_`)}),Io=e=>{let o=[];if(process.env[`${e}GRADIENT_START`]&&process.env[`${e}GRADIENT_END`])o.push(process.env[`${e}GRADIENT_START`],process.env[`${e}GRADIENT_END`]);else if(process.env[`${e}GRADIENT_0`]||process.env[`${e}GRADIENT_1`]){let t=process.env[`${e}GRADIENT_0`]?0:1;for(;process.env[`${e}GRADIENT_${t}`];)o.push(process.env[`${e}GRADIENT_${t}`]),t++;}return {foreground:process.env[`${e}FOREGROUND`],background:process.env[`${e}BACKGROUND`],brand:process.env[`${e}BRAND`],alternate:process.env[`${e}ALTERNATE`],accent:process.env[`${e}ACCENT`],link:process.env[`${e}LINK`],discovery:process.env[`${e}DISCOVERY`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],debug:process.env[`${e}DEBUG`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],performance:process.env[`${e}PERFORMANCE`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}};var dr=(e,o)=>{for(let t of Object.keys(o??{}))if(o[t]){let s=t?.replace(/([A-Z])+/g,i=>i?i[0]?.toUpperCase()+i.slice(1):"").split(/(?=[A-Z])|[.\-\s_]/).map(i=>i.toLowerCase())??[],a;if(s.length===0)return;s.length===1?a=s[0]?.toUpperCase()??"":a=s.reduce((i,c)=>`${i}_${c.toLowerCase()}`),process.env[`STORM_EXTENSION_${e.toUpperCase()}_${a.toUpperCase()}`]=o[t];}},zo=e=>{let o="STORM_";if(e.extends&&(process.env[`${o}EXTENDS`]=Array.isArray(e.extends)?JSON.stringify(e.extends):e.extends),e.name&&(process.env[`${o}NAME`]=e.name),e.variant&&(process.env[`${o}VARIANT`]=e.variant),e.namespace&&(process.env[`${o}NAMESPACE`]=e.namespace),e.owner&&(process.env[`${o}OWNER`]=e.owner),e.bot&&(process.env[`${o}BOT_NAME`]=e.bot.name,process.env[`${o}BOT_EMAIL`]=e.bot.email),e.error&&(process.env[`${o}ERROR_CODES_FILE`]=e.error.codesFile,process.env[`${o}ERROR_URL`]=e.error.url),e.release&&(e.release.banner&&(typeof e.release.banner=="string"?(process.env[`${o}RELEASE_BANNER`]=e.release.banner,process.env[`${o}RELEASE_BANNER_URL`]=e.release.banner):(process.env[`${o}RELEASE_BANNER`]=e.release.banner.url,process.env[`${o}RELEASE_BANNER_URL`]=e.release.banner.url,process.env[`${o}RELEASE_BANNER_ALT`]=e.release.banner.alt)),process.env[`${o}RELEASE_HEADER`]=e.release.header,process.env[`${o}RELEASE_FOOTER`]=e.release.footer),e.socials&&(e.socials.twitter&&(process.env[`${o}SOCIAL_TWITTER`]=e.socials.twitter),e.socials.discord&&(process.env[`${o}SOCIAL_DISCORD`]=e.socials.discord),e.socials.telegram&&(process.env[`${o}SOCIAL_TELEGRAM`]=e.socials.telegram),e.socials.slack&&(process.env[`${o}SOCIAL_SLACK`]=e.socials.slack),e.socials.medium&&(process.env[`${o}SOCIAL_MEDIUM`]=e.socials.medium),e.socials.github&&(process.env[`${o}SOCIAL_GITHUB`]=e.socials.github)),e.organization&&(typeof e.organization=="string"?(process.env[`${o}ORG`]=e.organization,process.env[`${o}ORG_NAME`]=e.organization,process.env[`${o}ORGANIZATION`]=e.organization,process.env[`${o}ORGANIZATION_NAME`]=e.organization):(process.env[`${o}ORG`]=e.organization.name,process.env[`${o}ORG_NAME`]=e.organization.name,process.env[`${o}ORGANIZATION`]=e.organization.name,process.env[`${o}ORGANIZATION_NAME`]=e.organization.name,e.organization.url&&(process.env[`${o}ORG_URL`]=e.organization.url,process.env[`${o}ORGANIZATION_URL`]=e.organization.url),e.organization.description&&(process.env[`${o}ORG_DESCRIPTION`]=e.organization.description,process.env[`${o}ORGANIZATION_DESCRIPTION`]=e.organization.description),e.organization.logo&&(process.env[`${o}ORG_LOGO`]=e.organization.logo,process.env[`${o}ORGANIZATION_LOGO`]=e.organization.logo),e.organization.icon&&(process.env[`${o}ORG_ICON`]=e.organization.icon,process.env[`${o}ORGANIZATION_ICON`]=e.organization.icon))),e.packageManager&&(process.env[`${o}PACKAGE_MANAGER`]=e.packageManager),e.license&&(process.env[`${o}LICENSE`]=e.license),e.homepage&&(process.env[`${o}HOMEPAGE`]=e.homepage),e.docs&&(process.env[`${o}DOCS`]=e.docs),e.portal&&(process.env[`${o}PORTAL`]=e.portal),e.licensing&&(process.env[`${o}LICENSING`]=e.licensing),e.contact&&(process.env[`${o}CONTACT`]=e.contact),e.support&&(process.env[`${o}SUPPORT`]=e.support),e.timezone&&(process.env[`${o}TIMEZONE`]=e.timezone,process.env.TZ=e.timezone,process.env.DEFAULT_TIMEZONE=e.timezone,process.env.TIMEZONE=e.timezone),e.locale&&(process.env[`${o}LOCALE`]=e.locale,process.env.DEFAULT_LOCALE=e.locale,process.env.LOCALE=e.locale,process.env.LANG=e.locale?`${e.locale.replaceAll("-","_")}.UTF-8`:"en_US.UTF-8"),e.configFile&&(process.env[`${o}WORKSPACE_CONFIG_FILE`]=m(e.configFile)),e.workspaceRoot&&(process.env[`${o}WORKSPACE_ROOT`]=m(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT=m(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT_PATH=m(e.workspaceRoot)),e.directories&&(!e.skipCache&&e.directories.cache&&(process.env[`${o}CACHE_DIR`]=m(e.directories.cache),process.env[`${o}CACHE_DIRECTORY`]=process.env[`${o}CACHE_DIR`]),e.directories.data&&(process.env[`${o}DATA_DIR`]=m(e.directories.data),process.env[`${o}DATA_DIRECTORY`]=process.env[`${o}DATA_DIR`]),e.directories.config&&(process.env[`${o}CONFIG_DIR`]=m(e.directories.config),process.env[`${o}CONFIG_DIRECTORY`]=process.env[`${o}CONFIG_DIR`]),e.directories.temp&&(process.env[`${o}TEMP_DIR`]=m(e.directories.temp),process.env[`${o}TEMP_DIRECTORY`]=process.env[`${o}TEMP_DIR`]),e.directories.log&&(process.env[`${o}LOG_DIR`]=m(e.directories.log),process.env[`${o}LOG_DIRECTORY`]=process.env[`${o}LOG_DIR`]),e.directories.build&&(process.env[`${o}BUILD_DIR`]=m(e.directories.build),process.env[`${o}BUILD_DIRECTORY`]=process.env[`${o}BUILD_DIR`])),e.skipCache!==void 0&&(process.env[`${o}SKIP_CACHE`]=String(e.skipCache),e.skipCache&&(process.env.NX_SKIP_NX_CACHE??=String(e.skipCache),process.env.NX_CACHE_PROJECT_GRAPH??=String(e.skipCache))),e.mode&&(process.env[`${o}MODE`]=e.mode,process.env.NODE_ENV=e.mode,process.env.ENVIRONMENT=e.mode),e.colors?.base?.light||e.colors?.base?.dark)for(let t of Object.keys(e.colors))bo(`${o}COLOR_${t}_`,e.colors[t]);else bo(`${o}COLOR_`,e.colors);e.repository&&(process.env[`${o}REPOSITORY`]=e.repository),e.branch&&(process.env[`${o}BRANCH`]=e.branch),e.preid&&(process.env[`${o}PRE_ID`]=String(e.preid)),e.registry&&(e.registry.github&&(process.env[`${o}REGISTRY_GITHUB`]=String(e.registry.github)),e.registry.npm&&(process.env[`${o}REGISTRY_NPM`]=String(e.registry.npm)),e.registry.cargo&&(process.env[`${o}REGISTRY_CARGO`]=String(e.registry.cargo)),e.registry.cyclone&&(process.env[`${o}REGISTRY_CYCLONE`]=String(e.registry.cyclone)),e.registry.container&&(process.env[`${o}REGISTRY_CONTAINER`]=String(e.registry.container))),e.logLevel&&(process.env[`${o}LOG_LEVEL`]=String(e.logLevel),process.env.LOG_LEVEL=String(e.logLevel),process.env.NX_VERBOSE_LOGGING=String(A(e.logLevel)>=d.DEBUG),process.env.RUST_BACKTRACE=A(e.logLevel)>=d.DEBUG?"full":"none"),e.skipConfigLogging!==void 0&&(process.env[`${o}SKIP_CONFIG_LOGGING`]=String(e.skipConfigLogging)),process.env[`${o}WORKSPACE_CONFIG`]=JSON.stringify(e);for(let t of Object.keys(e.extensions??{}))e.extensions[t]&&Object.keys(e.extensions[t])&&dr(t,e.extensions[t]);},bo=(e,o)=>o?.light?.brand||o?.dark?.brand?mr(e,o):lr(e,o),lr=(e,o)=>{if(o.dark&&(process.env[`${e}DARK`]=o.dark),o.light&&(process.env[`${e}LIGHT`]=o.light),o.brand&&(process.env[`${e}BRAND`]=o.brand),o.alternate&&(process.env[`${e}ALTERNATE`]=o.alternate),o.accent&&(process.env[`${e}ACCENT`]=o.accent),o.link&&(process.env[`${e}LINK`]=o.link),o.discovery&&(process.env[`${e}DISCOVERY`]=o.discovery),o.success&&(process.env[`${e}SUCCESS`]=o.success),o.info&&(process.env[`${e}INFO`]=o.info),o.debug&&(process.env[`${e}DEBUG`]=o.debug),o.warning&&(process.env[`${e}WARNING`]=o.warning),o.danger&&(process.env[`${e}DANGER`]=o.danger),o.fatal&&(process.env[`${e}FATAL`]=o.fatal),o.performance&&(process.env[`${e}PERFORMANCE`]=o.performance),o.positive&&(process.env[`${e}POSITIVE`]=o.positive),o.negative&&(process.env[`${e}NEGATIVE`]=o.negative),o.gradient)for(let t=0;t<o.gradient.length;t++)process.env[`${e}GRADIENT_${t}`]=o.gradient[t];},mr=(e,o)=>({light:yo(`${e}LIGHT_`,o.light),dark:yo(`${e}DARK_`,o.dark)}),yo=(e,o)=>{if(o.foreground&&(process.env[`${e}FOREGROUND`]=o.foreground),o.background&&(process.env[`${e}BACKGROUND`]=o.background),o.brand&&(process.env[`${e}BRAND`]=o.brand),o.alternate&&(process.env[`${e}ALTERNATE`]=o.alternate),o.accent&&(process.env[`${e}ACCENT`]=o.accent),o.link&&(process.env[`${e}LINK`]=o.link),o.discovery&&(process.env[`${e}DISCOVERY`]=o.discovery),o.success&&(process.env[`${e}SUCCESS`]=o.success),o.info&&(process.env[`${e}INFO`]=o.info),o.debug&&(process.env[`${e}DEBUG`]=o.debug),o.warning&&(process.env[`${e}WARNING`]=o.warning),o.danger&&(process.env[`${e}DANGER`]=o.danger),o.fatal&&(process.env[`${e}FATAL`]=o.fatal),o.performance&&(process.env[`${e}PERFORMANCE`]=o.performance),o.positive&&(process.env[`${e}POSITIVE`]=o.positive),o.negative&&(process.env[`${e}NEGATIVE`]=o.negative),o.gradient)for(let t=0;t<o.gradient.length;t++)process.env[`${e}GRADIENT_${t}`]=o.gradient[t];};var I,gr=async(e,o,t,s=false,a=true)=>{let i;if(!I?.data||!I?.timestamp||I.timestamp<Date.now()-8e3){let c=t;c||(c=R());let p=wo(),u=await _o(c);if(!u&&(s||ne("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",{logLevel:"all"}),a===false))return;let f=await So(c),N=$o__default.default(p,u,f);N.variant||(N.variant=fs.existsSync(T(c,"nx.json"))||fs.existsSync(T(c,".nx"))||fs.existsSync(T(c,"lerna.json"))||fs.existsSync(T(c,"turbo.json"))?"monorepo":"minimal");try{let _=await Promise.resolve(vo._zod.parse({value:N,issues:[]},{async:!0}));i=ko(_.value),i.workspaceRoot??=c;}catch(_){throw new Error(`Failed to parse Storm Workspace configuration${_?.message?`: ${_.message}`:""}
|
|
26
|
+
Path: ${e||process.cwd()}`);return o}var pe="https://docs.stormsoftware.com",L="https://stormsoftware.com";var de="https://stormsoftware.com/license",le="Apache-2.0";var b="tools/errors/codes.json",me="The workspace's banner image",ue=["dark","light","base","brand","alternate","accent","link","success","discovery","info","warning","danger","fatal","performance","positive","negative"];var t=r__namespace.registry(),h=r__namespace.string().check(r__namespace.length(7),r__namespace.toLowerCase(),r__namespace.regex(/^#([0-9a-f]{3}){1,2}$/i),r__namespace.trim());t.add(h,{description:"A base schema for describing the format of colors"});var y=r__namespace._default(h,"#1e2124");t.add(y,{description:"The dark background color of the workspace"});var w=r__namespace._default(h,"#cbd5e1");t.add(w,{description:"The light background color of the workspace"});var z=r__namespace._default(h,"#1fb2a6");t.add(z,{description:"The primary brand specific color of the workspace"});var D=r__namespace.optional(h);t.add(D,{description:"The alternate brand specific color of the workspace"});var x=r__namespace.optional(h);t.add(x,{description:"The secondary brand specific color of the workspace"});var G=r__namespace._default(h,"#3fa6ff");t.add(G,{description:"The color used to display hyperlink text"});var P=r__namespace._default(h,"#818cf8");t.add(P,{description:"The second brand specific color of the workspace"});var M=r__namespace._default(h,"#45b27e");t.add(M,{description:"The success color of the workspace"});var F=r__namespace._default(h,"#38bdf8");t.add(F,{description:"The informational color of the workspace"});var U=r__namespace._default(h,"#8afafc");t.add(U,{description:"The debug color of the workspace"});var W=r__namespace._default(h,"#f3d371");t.add(W,{description:"The warning color of the workspace"});var B=r__namespace._default(h,"#d8314a");t.add(B,{description:"The danger color of the workspace"});var j=r__namespace.optional(h);t.add(j,{description:"The fatal color of the workspace"});var H=r__namespace._default(h,"#80fd74");t.add(H,{description:"The performance color of the workspace"});var K=r__namespace._default(h,"#4ade80");t.add(K,{description:"The positive number color of the workspace"});var Y=r__namespace._default(h,"#ef4444");t.add(Y,{description:"The negative number color of the workspace"});var Z=r__namespace.optional(r__namespace.array(h));t.add(Z,{description:"The color stops for the base gradient color pattern used in the workspace"});var Qo=r__namespace.object({foreground:w,background:y,brand:z,alternate:D,accent:x,link:G,discovery:P,success:M,info:F,debug:U,warning:W,danger:B,fatal:j,performance:H,positive:K,negative:Y,gradient:Z}),er=r__namespace.object({foreground:y,background:w,brand:z,alternate:D,accent:x,link:G,discovery:P,success:M,info:F,debug:U,warning:W,danger:B,fatal:j,performance:H,positive:K,negative:Y,gradient:Z}),or=r__namespace.object({dark:Qo,light:er}),rr=r__namespace.object({dark:y,light:w,brand:z,alternate:D,accent:x,link:G,discovery:P,success:M,info:F,debug:U,warning:W,danger:B,fatal:j,performance:H,positive:K,negative:Y,gradient:Z}),A=r__namespace.optional(r__namespace.url());t.add(A,{description:"A remote registry URL used to publish distributable packages"});var ge=r__namespace._default(r__namespace.object({github:A,npm:A,cargo:A,cyclone:A,container:A}),{});t.add(ge,{description:"A list of remote registry URLs used by Storm Software"});var Q=r__namespace.union([rr,or]);t.add(Q,{description:"Colors used for various workspace elements"});var fe=r__namespace.record(r__namespace.union([r__namespace.union([r__namespace.literal("base"),r__namespace.string()]),r__namespace.string()]),Q);t.add(fe,{description:"Storm theme config values used for styling various package elements"});var he=r__namespace.optional(r__namespace.union([r__namespace.string().check(r__namespace.trim()),r__namespace.array(r__namespace.string().check(r__namespace.trim()))]));t.add(he,{description:"The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration."});var Ee=r__namespace.string().check(r__namespace.trim());t.add(Ee,{description:"The workspace bot user's name (this is the bot that will be used to perform various tasks)"});var Re=r__namespace.string().check(r__namespace.trim());t.add(Re,{description:"The email of the workspace bot"});var Te=r__namespace.object({name:Ee,email:Re});t.add(Te,{description:"The workspace's bot user's config used to automated various operations tasks"});var Ce=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.url()));t.add(Ce,{description:"A URL to a banner image used to display the workspace's release"});var ve=r__namespace._default(r__namespace.string().check(r__namespace.trim()),me);t.add(ve,{description:"The alt text for the workspace's release banner image"});var Se=r__namespace.object({url:Ce,alt:ve});t.add(Se,{description:"The workspace's banner image used during the release process"});var ke=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));t.add(ke,{description:"A header message appended to the start of the workspace's release notes"});var Oe=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));t.add(Oe,{description:"A footer message appended to the end of the workspace's release notes"});var Ae=r__namespace.object({banner:r__namespace.union([Se,r__namespace.string().check(r__namespace.trim(),r__namespace.url())]),header:ke,footer:Oe});t.add(Ae,{description:"The workspace's release config used during the release process"});var $e=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));t.add($e,{description:"A Twitter/X account associated with the organization/project"});var _e=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));t.add(_e,{description:"A Discord account associated with the organization/project"});var Le=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));t.add(Le,{description:"A Telegram account associated with the organization/project"});var Ie=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));t.add(Ie,{description:"A Slack account associated with the organization/project"});var Ne=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));t.add(Ne,{description:"A Medium account associated with the organization/project"});var be=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));t.add(be,{description:"A GitHub account associated with the organization/project"});var ye=r__namespace.object({twitter:$e,discord:_e,telegram:Le,slack:Ie,medium:Ne,github:be});t.add(ye,{description:"The workspace's account config used to store various social media links"});var we=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));t.add(we,{description:"The directory used to store the environment's cached file data"});var ze=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));t.add(ze,{description:"The directory used to store the environment's data files"});var De=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));t.add(De,{description:"The directory used to store the environment's configuration files"});var xe=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));t.add(xe,{description:"The directory used to store the environment's temp files"});var Ge=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));t.add(Ge,{description:"The directory used to store the environment's log files"});var Pe=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"dist");t.add(Pe,{description:"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"});var Me=r__namespace.object({cache:we,data:ze,config:De,temp:xe,log:Ge,build:Pe});t.add(Me,{description:"Various directories used by the workspace to store data, cache, and configuration files"});var Fe=r__namespace._default(r__namespace.enum(["minimal","monorepo"]),"monorepo");t.add(Fe,{description:"The variant of the workspace. This can be used to enable or disable certain features or configurations."});var Ue=r__namespace._default(r__namespace.string().check(r__namespace.trim()),b);t.add(Ue,{description:"The path to the workspace's error codes JSON file"});var We=r__namespace.optional(r__namespace.url());t.add(We,{description:"A URL to a page that looks up the workspace's error messages given a specific error code"});var Be=r__namespace.object({codesFile:Ue,url:We});t.add(Be,{description:"The workspace's error config used when creating error details during a system error"});var je=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));t.add(je,{description:"The name of the organization"});var He=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));t.add(He,{description:"A description of the organization"});var Ke=r__namespace.optional(r__namespace.url());t.add(Ke,{description:"A URL to the organization's logo image"});var Ye=r__namespace.optional(r__namespace.url());t.add(Ye,{description:"A URL to the organization's icon image"});var Ze=r__namespace.optional(r__namespace.url());t.add(Ze,{description:"A URL to a page that provides more information about the organization"});var Ve=r__namespace.object({name:je,description:He,logo:Ke,icon:Ye,url:Ze});t.add(Ve,{description:"The workspace's organization details"});var Je=r__namespace._default(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()),"https://public.storm-cdn.com/schemas/storm-workspace.schema.json");t.add(Je,{description:"The URL or file path to the JSON schema file that describes the Storm configuration file"});var Xe=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());t.add(Xe,{description:"The name of the workspace/project/service/package/scope using this configuration"});var qe=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());t.add(qe,{description:"The namespace of the workspace/project/service/package/scope using this configuration"});var Qe=r__namespace.union([Ve,r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase())]);t.add(Qe,{description:"The organization of the workspace. This can be a string or an object containing the organization's details"});var eo=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());t.add(eo,{description:"The repo URL of the workspace (i.e. the GitHub repository URL)"});var oo=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"Apache-2.0");t.add(oo,{description:"The license type of the package"});var ro=r__namespace.optional(r__namespace.url());t.add(ro,{description:"The homepage of the workspace"});var so=r__namespace.optional(r__namespace.url());t.add(so,{description:"The documentation site for the workspace"});var to=r__namespace.optional(r__namespace.url());t.add(to,{description:"The development portal site for the workspace"});var no=r__namespace.optional(r__namespace.url());t.add(no,{description:"The licensing site for the workspace"});var ao=r__namespace.optional(r__namespace.url());t.add(ao,{description:"The contact site for the workspace"});var io=r__namespace.optional(r__namespace.url());t.add(io,{description:"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"});var co=r__namespace._default(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()),"main");t.add(co,{description:"The branch of the workspace"});var po=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));t.add(po,{description:"A tag specifying the version pre-release identifier"});var lo=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));t.add(lo,{description:"The owner of the package"});var mo=r__namespace._default(r__namespace.enum(["development","test","production"]).check(r__namespace.trim(),r__namespace.toLowerCase()),"production");t.add(mo,{description:"The current runtime environment mode for the package"});var uo=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());t.add(uo,{description:"The root directory of the workspace"});var go=r__namespace._default(r__namespace.boolean(),false);t.add(go,{description:"Should all known types of workspace caching be skipped?"});var fo=r__namespace._default(r__namespace.enum(["npm","yarn","pnpm","bun"]),"npm");t.add(fo,{description:"The JavaScript/TypeScript package manager used by the repository"});var ho=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"America/New_York");t.add(ho,{description:"The default timezone of the workspace"});var Eo=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"en-US");t.add(Eo,{description:"The default locale of the workspace"});var Ro=r__namespace._default(r__namespace.enum(["silent","fatal","error","warn","success","info","performance","debug","trace","all"]),"info");t.add(Ro,{description:"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`)."});var To=r__namespace._default(r__namespace.boolean(),true);t.add(To,{description:"Should the logging of the current Storm Workspace configuration be skipped?"});var Co=r__namespace._default(r__namespace.nullable(r__namespace.string().check(r__namespace.trim())),null);t.add(Co,{description:"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."});var ee=r__namespace._default(r__namespace.record(r__namespace.string(),r__namespace.any()),{});t.add(ee,{description:"Configuration of each used extension"});var vo=r__namespace.object({$schema:Je,extends:he,name:Xe,variant:Fe,namespace:qe,organization:Qe,repository:eo,license:oo,homepage:ro,docs:so,portal:to,licensing:no,contact:ao,support:io,branch:co,preid:po,owner:lo,bot:Te,release:Ae,socials:ye,error:Be,mode:mo,workspaceRoot:uo,skipCache:go,directories:Me,packageManager:fo,timezone:ho,locale:Eo,logLevel:Ro,skipConfigLogging:To,registry:ge,configFile:Co,colors:r__namespace.union([Q,fe]),extensions:ee});t.add(ee,{description:"Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo."});async function So(e){let o=le,s,n,a,i,c,p=k(e);if(fs.existsSync(path.join(p,"package.json"))){let u=await promises.readFile(v(p,"package.json"),"utf8");if(u){let g=JSON.parse(u);g.name&&(a=g.name),g.namespace&&(i=g.namespace),g.repository&&(typeof g.repository=="string"?c=g.repository:g.repository.url&&(c=g.repository.url)),g.license&&(o=g.license),g.homepage&&(s=g.homepage),g.bugs&&(typeof g.bugs=="string"?n=g.bugs:g.bugs.url&&(n=g.bugs.url));}}return {workspaceRoot:p,name:a,namespace:i,repository:c,license:o,homepage:s,support:n}}function ko(e){return !e.support&&e.contact&&(e.support=e.contact),!e.contact&&e.support&&(e.contact=e.support),e.homepage&&(e.docs||(e.docs=`${e.homepage}/docs`),e.license||(e.license=`${e.homepage}/license`),e.support||(e.support=`${e.homepage}/support`),e.contact||(e.contact=`${e.homepage}/contact`),(!e.error?.codesFile||!e?.error?.url)&&(e.error??={codesFile:b},e.homepage&&(e.error.url??=`${e.homepage}/errors`))),e}var Ao=async(e,o,s={})=>{let n=o||k(o),a=await Promise.all([c12.loadConfig({cwd:n,packageJson:true,name:e,envName:e?.toUpperCase(),jitiOptions:{debug:false,fsCache:process.env.STORM_SKIP_CACHE==="true"?false:v(process.env.STORM_CACHE_DIR||"node_modules/.cache/storm","jiti")},...s}),c12.loadConfig({cwd:n,packageJson:true,name:e,envName:e?.toUpperCase(),jitiOptions:{debug:false,fsCache:process.env.STORM_SKIP_CACHE==="true"?false:v(process.env.STORM_CACHE_DIR||"node_modules/.cache/storm","jiti")},configFile:e,...s})]);return $o__default.default(a[0]??{},a[1]??{})},_o=async(e,o=[])=>{let s=e||k(e),n=await Ao("storm-workspace",s),a=n.config,i=n.configFile;if(a&&i&&Object.keys(a).length>0&&!a.skipConfigLogging&&_(`Found Storm configuration file "${i.includes(`${s}/`)?i.replace(`${s}/`,""):i}" at "${s}"`,{logLevel:"all"}),o&&o.length>0){let c=await Promise.all(o.map(p=>Ao(p,s)));for(let p of c)p?.config&&p?.configFile&&Object.keys(p.config).length>0&&(!a.skipConfigLogging&&!p.config.skipConfigLogging&&_(`Found alternative configuration file "${p.configFile.includes(`${s}/`)?p.configFile.replace(`${s}/`,""):p.configFile}" at "${s}"`,{logLevel:"all"}),a=$o__default.default(p.config??{},a??{}));}if(!(!a||Object.keys(a).length===0))return a.configFile=i,a};var bo=()=>{let e="STORM_",o={extends:process.env[`${e}EXTENDS`]||void 0,name:process.env[`${e}NAME`]||void 0,variant:process.env[`${e}VARIANT`]||void 0,namespace:process.env[`${e}NAMESPACE`]||void 0,owner:process.env[`${e}OWNER`]||void 0,bot:{name:process.env[`${e}BOT_NAME`]||void 0,email:process.env[`${e}BOT_EMAIL`]||void 0},release:{banner:{url:process.env[`${e}RELEASE_BANNER_URL`]||void 0,alt:process.env[`${e}RELEASE_BANNER_ALT`]||void 0},header:process.env[`${e}RELEASE_HEADER`]||void 0,footer:process.env[`${e}RELEASE_FOOTER`]||void 0},error:{codesFile:process.env[`${e}ERROR_CODES_FILE`]||void 0,url:process.env[`${e}ERROR_URL`]||void 0},socials:{twitter:process.env[`${e}SOCIAL_TWITTER`]||void 0,discord:process.env[`${e}SOCIAL_DISCORD`]||void 0,telegram:process.env[`${e}SOCIAL_TELEGRAM`]||void 0,slack:process.env[`${e}SOCIAL_SLACK`]||void 0,medium:process.env[`${e}SOCIAL_MEDIUM`]||void 0,github:process.env[`${e}SOCIAL_GITHUB`]||void 0},organization:process.env[`${e}ORG`]||process.env[`${e}ORGANIZATION`]||process.env[`${e}ORG_NAME`]||process.env[`${e}ORGANIZATION_NAME`]?process.env[`${e}ORG_DESCRIPTION`]||process.env[`${e}ORGANIZATION_DESCRIPTION`]||process.env[`${e}ORG_URL`]||process.env[`${e}ORGANIZATION_URL`]||process.env[`${e}ORG_LOGO`]||process.env[`${e}ORGANIZATION_LOGO`]?{name:process.env[`${e}ORG`]||process.env[`${e}ORGANIZATION`]||process.env[`${e}ORG_NAME`]||process.env[`${e}ORGANIZATION_NAME`],description:process.env[`${e}ORG_DESCRIPTION`]||process.env[`${e}ORGANIZATION_DESCRIPTION`]||void 0,url:process.env[`${e}ORG_URL`]||process.env[`${e}ORGANIZATION_URL`]||void 0,logo:process.env[`${e}ORG_LOGO`]||process.env[`${e}ORGANIZATION_LOGO`]||void 0,icon:process.env[`${e}ORG_ICON`]||process.env[`${e}ORGANIZATION_ICON`]||void 0}:process.env[`${e}ORG`]||process.env[`${e}ORGANIZATION`]||process.env[`${e}ORG_NAME`]||process.env[`${e}ORGANIZATION_NAME`]:void 0,packageManager:process.env[`${e}PACKAGE_MANAGER`]||void 0,license:process.env[`${e}LICENSE`]||void 0,homepage:process.env[`${e}HOMEPAGE`]||void 0,docs:process.env[`${e}DOCS`]||void 0,portal:process.env[`${e}PORTAL`]||void 0,licensing:process.env[`${e}LICENSING`]||void 0,contact:process.env[`${e}CONTACT`]||void 0,support:process.env[`${e}SUPPORT`]||void 0,timezone:process.env[`${e}TIMEZONE`]||process.env.TZ||void 0,locale:process.env[`${e}LOCALE`]||process.env.LOCALE||void 0,configFile:process.env[`${e}WORKSPACE_CONFIG_FILE`]?m(process.env[`${e}WORKSPACE_CONFIG_FILE`]):void 0,workspaceRoot:process.env[`${e}WORKSPACE_ROOT`]?m(process.env[`${e}WORKSPACE_ROOT`]):void 0,directories:{cache:process.env[`${e}CACHE_DIR`]?m(process.env[`${e}CACHE_DIR`]):process.env[`${e}CACHE_DIRECTORY`]?m(process.env[`${e}CACHE_DIRECTORY`]):void 0,data:process.env[`${e}DATA_DIR`]?m(process.env[`${e}DATA_DIR`]):process.env[`${e}DATA_DIRECTORY`]?m(process.env[`${e}DATA_DIRECTORY`]):void 0,config:process.env[`${e}CONFIG_DIR`]?m(process.env[`${e}CONFIG_DIR`]):process.env[`${e}CONFIG_DIRECTORY`]?m(process.env[`${e}CONFIG_DIRECTORY`]):void 0,temp:process.env[`${e}TEMP_DIR`]?m(process.env[`${e}TEMP_DIR`]):process.env[`${e}TEMP_DIRECTORY`]?m(process.env[`${e}TEMP_DIRECTORY`]):void 0,log:process.env[`${e}LOG_DIR`]?m(process.env[`${e}LOG_DIR`]):process.env[`${e}LOG_DIRECTORY`]?m(process.env[`${e}LOG_DIRECTORY`]):void 0,build:process.env[`${e}BUILD_DIR`]?m(process.env[`${e}BUILD_DIR`]):process.env[`${e}BUILD_DIRECTORY`]?m(process.env[`${e}BUILD_DIRECTORY`]):void 0},skipCache:process.env[`${e}SKIP_CACHE`]!==void 0?!!process.env[`${e}SKIP_CACHE`]:void 0,mode:(process.env[`${e}MODE`]??process.env.NODE_ENV??process.env.ENVIRONMENT)||void 0,repository:process.env[`${e}REPOSITORY`]||void 0,branch:process.env[`${e}BRANCH`]||void 0,preid:process.env[`${e}PRE_ID`]||void 0,registry:{github:process.env[`${e}REGISTRY_GITHUB`]||void 0,npm:process.env[`${e}REGISTRY_NPM`]||void 0,cargo:process.env[`${e}REGISTRY_CARGO`]||void 0,cyclone:process.env[`${e}REGISTRY_CYCLONE`]||void 0,container:process.env[`${e}REGISTRY_CONTAINER`]||void 0},logLevel:process.env[`${e}LOG_LEVEL`]!==null&&process.env[`${e}LOG_LEVEL`]!==void 0?process.env[`${e}LOG_LEVEL`]&&Number.isSafeInteger(Number.parseInt(process.env[`${e}LOG_LEVEL`]))?te(Number.parseInt(process.env[`${e}LOG_LEVEL`])):process.env[`${e}LOG_LEVEL`]:void 0,skipConfigLogging:process.env[`${e}SKIP_CONFIG_LOGGING`]!==void 0?!!process.env[`${e}SKIP_CONFIG_LOGGING`]:void 0},s=Object.keys(process.env).filter(a=>a.startsWith(`${e}COLOR_`)&&ue.every(i=>!a.startsWith(`${e}COLOR_LIGHT_${i}`)&&!a.startsWith(`${e}COLOR_DARK_${i}`)));o.colors=s.length>0?s.reduce((a,i)=>(a[i]=Lo(e,i),a),{}):Lo(e),o.docs===pe&&(o.homepage===L?o.docs=`${L}/projects/${o.name}/docs`:o.docs=`${o.homepage}/docs`),o.licensing===de&&(o.homepage===L?o.licensing=`${L}/projects/${o.name}/licensing`:o.licensing=`${o.homepage}/docs`);let n=process.env[`${e}WORKSPACE_CONFIG`];if(n){let a=JSON.parse(n);o={...o,...a,colors:{...o.colors,...a.colors},extensions:{...o.extensions,...a.extensions}};}return o},Lo=(e,o)=>{let s=`COLOR_${o&&o!=="base"?`${o}_`:""}`.toUpperCase();return process.env[`${e}${s}LIGHT_BRAND`]||process.env[`${e}${s}DARK_BRAND`]?ir(e+s):ar(e+s)},ar=e=>{let o=[];if(process.env[`${e}GRADIENT_START`]&&process.env[`${e}GRADIENT_END`])o.push(process.env[`${e}GRADIENT_START`],process.env[`${e}GRADIENT_END`]);else if(process.env[`${e}GRADIENT_0`]||process.env[`${e}GRADIENT_1`]){let s=process.env[`${e}GRADIENT_0`]?0:1;for(;process.env[`${e}GRADIENT_${s}`];)o.push(process.env[`${e}GRADIENT_${s}`]),s++;}return {dark:process.env[`${e}DARK`],light:process.env[`${e}LIGHT`],brand:process.env[`${e}BRAND`],alternate:process.env[`${e}ALTERNATE`],accent:process.env[`${e}ACCENT`],link:process.env[`${e}LINK`],discovery:process.env[`${e}DISCOVERY`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],debug:process.env[`${e}DEBUG`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],performance:process.env[`${e}PERFORMANCE`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}},ir=e=>({light:Io(`${e}_LIGHT_`),dark:Io(`${e}_DARK_`)}),Io=e=>{let o=[];if(process.env[`${e}GRADIENT_START`]&&process.env[`${e}GRADIENT_END`])o.push(process.env[`${e}GRADIENT_START`],process.env[`${e}GRADIENT_END`]);else if(process.env[`${e}GRADIENT_0`]||process.env[`${e}GRADIENT_1`]){let s=process.env[`${e}GRADIENT_0`]?0:1;for(;process.env[`${e}GRADIENT_${s}`];)o.push(process.env[`${e}GRADIENT_${s}`]),s++;}return {foreground:process.env[`${e}FOREGROUND`],background:process.env[`${e}BACKGROUND`],brand:process.env[`${e}BRAND`],alternate:process.env[`${e}ALTERNATE`],accent:process.env[`${e}ACCENT`],link:process.env[`${e}LINK`],discovery:process.env[`${e}DISCOVERY`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],debug:process.env[`${e}DEBUG`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],performance:process.env[`${e}PERFORMANCE`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}};var cr=(e,o)=>{for(let s of Object.keys(o??{}))if(o[s]){let n=s?.replace(/([A-Z])+/g,i=>i?i[0]?.toUpperCase()+i.slice(1):"").split(/(?=[A-Z])|[.\-\s_]/).map(i=>i.toLowerCase())??[],a;if(n.length===0)return;n.length===1?a=n[0]?.toUpperCase()??"":a=n.reduce((i,c)=>`${i}_${c.toLowerCase()}`),process.env[`STORM_EXTENSION_${e.toUpperCase()}_${a.toUpperCase()}`]=o[s];}},zo=e=>{let o="STORM_";if(e.extends&&(process.env[`${o}EXTENDS`]=Array.isArray(e.extends)?JSON.stringify(e.extends):e.extends),e.name&&(process.env[`${o}NAME`]=e.name),e.variant&&(process.env[`${o}VARIANT`]=e.variant),e.namespace&&(process.env[`${o}NAMESPACE`]=e.namespace),e.owner&&(process.env[`${o}OWNER`]=e.owner),e.bot&&(process.env[`${o}BOT_NAME`]=e.bot.name,process.env[`${o}BOT_EMAIL`]=e.bot.email),e.error&&(process.env[`${o}ERROR_CODES_FILE`]=e.error.codesFile,process.env[`${o}ERROR_URL`]=e.error.url),e.release&&(e.release.banner&&(typeof e.release.banner=="string"?(process.env[`${o}RELEASE_BANNER`]=e.release.banner,process.env[`${o}RELEASE_BANNER_URL`]=e.release.banner):(process.env[`${o}RELEASE_BANNER`]=e.release.banner.url,process.env[`${o}RELEASE_BANNER_URL`]=e.release.banner.url,process.env[`${o}RELEASE_BANNER_ALT`]=e.release.banner.alt)),process.env[`${o}RELEASE_HEADER`]=e.release.header,process.env[`${o}RELEASE_FOOTER`]=e.release.footer),e.socials&&(e.socials.twitter&&(process.env[`${o}SOCIAL_TWITTER`]=e.socials.twitter),e.socials.discord&&(process.env[`${o}SOCIAL_DISCORD`]=e.socials.discord),e.socials.telegram&&(process.env[`${o}SOCIAL_TELEGRAM`]=e.socials.telegram),e.socials.slack&&(process.env[`${o}SOCIAL_SLACK`]=e.socials.slack),e.socials.medium&&(process.env[`${o}SOCIAL_MEDIUM`]=e.socials.medium),e.socials.github&&(process.env[`${o}SOCIAL_GITHUB`]=e.socials.github)),e.organization&&(typeof e.organization=="string"?(process.env[`${o}ORG`]=e.organization,process.env[`${o}ORG_NAME`]=e.organization,process.env[`${o}ORGANIZATION`]=e.organization,process.env[`${o}ORGANIZATION_NAME`]=e.organization):(process.env[`${o}ORG`]=e.organization.name,process.env[`${o}ORG_NAME`]=e.organization.name,process.env[`${o}ORGANIZATION`]=e.organization.name,process.env[`${o}ORGANIZATION_NAME`]=e.organization.name,e.organization.url&&(process.env[`${o}ORG_URL`]=e.organization.url,process.env[`${o}ORGANIZATION_URL`]=e.organization.url),e.organization.description&&(process.env[`${o}ORG_DESCRIPTION`]=e.organization.description,process.env[`${o}ORGANIZATION_DESCRIPTION`]=e.organization.description),e.organization.logo&&(process.env[`${o}ORG_LOGO`]=e.organization.logo,process.env[`${o}ORGANIZATION_LOGO`]=e.organization.logo),e.organization.icon&&(process.env[`${o}ORG_ICON`]=e.organization.icon,process.env[`${o}ORGANIZATION_ICON`]=e.organization.icon))),e.packageManager&&(process.env[`${o}PACKAGE_MANAGER`]=e.packageManager),e.license&&(process.env[`${o}LICENSE`]=e.license),e.homepage&&(process.env[`${o}HOMEPAGE`]=e.homepage),e.docs&&(process.env[`${o}DOCS`]=e.docs),e.portal&&(process.env[`${o}PORTAL`]=e.portal),e.licensing&&(process.env[`${o}LICENSING`]=e.licensing),e.contact&&(process.env[`${o}CONTACT`]=e.contact),e.support&&(process.env[`${o}SUPPORT`]=e.support),e.timezone&&(process.env[`${o}TIMEZONE`]=e.timezone,process.env.TZ=e.timezone,process.env.DEFAULT_TIMEZONE=e.timezone,process.env.TIMEZONE=e.timezone),e.locale&&(process.env[`${o}LOCALE`]=e.locale,process.env.DEFAULT_LOCALE=e.locale,process.env.LOCALE=e.locale,process.env.LANG=e.locale?`${e.locale.replaceAll("-","_")}.UTF-8`:"en_US.UTF-8"),e.configFile&&(process.env[`${o}WORKSPACE_CONFIG_FILE`]=m(e.configFile)),e.workspaceRoot&&(process.env[`${o}WORKSPACE_ROOT`]=m(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT=m(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT_PATH=m(e.workspaceRoot)),e.directories&&(!e.skipCache&&e.directories.cache&&(process.env[`${o}CACHE_DIR`]=m(e.directories.cache),process.env[`${o}CACHE_DIRECTORY`]=process.env[`${o}CACHE_DIR`]),e.directories.data&&(process.env[`${o}DATA_DIR`]=m(e.directories.data),process.env[`${o}DATA_DIRECTORY`]=process.env[`${o}DATA_DIR`]),e.directories.config&&(process.env[`${o}CONFIG_DIR`]=m(e.directories.config),process.env[`${o}CONFIG_DIRECTORY`]=process.env[`${o}CONFIG_DIR`]),e.directories.temp&&(process.env[`${o}TEMP_DIR`]=m(e.directories.temp),process.env[`${o}TEMP_DIRECTORY`]=process.env[`${o}TEMP_DIR`]),e.directories.log&&(process.env[`${o}LOG_DIR`]=m(e.directories.log),process.env[`${o}LOG_DIRECTORY`]=process.env[`${o}LOG_DIR`]),e.directories.build&&(process.env[`${o}BUILD_DIR`]=m(e.directories.build),process.env[`${o}BUILD_DIRECTORY`]=process.env[`${o}BUILD_DIR`])),e.skipCache!==void 0&&(process.env[`${o}SKIP_CACHE`]=String(e.skipCache),e.skipCache&&(process.env.NX_SKIP_NX_CACHE??=String(e.skipCache),process.env.NX_CACHE_PROJECT_GRAPH??=String(e.skipCache))),e.mode&&(process.env[`${o}MODE`]=e.mode,process.env.NODE_ENV=e.mode,process.env.ENVIRONMENT=e.mode),e.colors?.base?.light||e.colors?.base?.dark)for(let s of Object.keys(e.colors))yo(`${o}COLOR_${s}_`,e.colors[s]);else yo(`${o}COLOR_`,e.colors);e.repository&&(process.env[`${o}REPOSITORY`]=e.repository),e.branch&&(process.env[`${o}BRANCH`]=e.branch),e.preid&&(process.env[`${o}PRE_ID`]=String(e.preid)),e.registry&&(e.registry.github&&(process.env[`${o}REGISTRY_GITHUB`]=String(e.registry.github)),e.registry.npm&&(process.env[`${o}REGISTRY_NPM`]=String(e.registry.npm)),e.registry.cargo&&(process.env[`${o}REGISTRY_CARGO`]=String(e.registry.cargo)),e.registry.cyclone&&(process.env[`${o}REGISTRY_CYCLONE`]=String(e.registry.cyclone)),e.registry.container&&(process.env[`${o}REGISTRY_CONTAINER`]=String(e.registry.container))),e.logLevel&&(process.env[`${o}LOG_LEVEL`]=String(e.logLevel),process.env.LOG_LEVEL=String(e.logLevel),process.env.NX_VERBOSE_LOGGING=String(O(e.logLevel)>=d.DEBUG),process.env.RUST_BACKTRACE=O(e.logLevel)>=d.DEBUG?"full":"none"),e.skipConfigLogging!==void 0&&(process.env[`${o}SKIP_CONFIG_LOGGING`]=String(e.skipConfigLogging)),process.env[`${o}WORKSPACE_CONFIG`]=JSON.stringify(e);for(let s of Object.keys(e.extensions??{}))e.extensions[s]&&Object.keys(e.extensions[s])&&cr(s,e.extensions[s]);},yo=(e,o)=>o?.light?.brand||o?.dark?.brand?dr(e,o):pr(e,o),pr=(e,o)=>{if(o.dark&&(process.env[`${e}DARK`]=o.dark),o.light&&(process.env[`${e}LIGHT`]=o.light),o.brand&&(process.env[`${e}BRAND`]=o.brand),o.alternate&&(process.env[`${e}ALTERNATE`]=o.alternate),o.accent&&(process.env[`${e}ACCENT`]=o.accent),o.link&&(process.env[`${e}LINK`]=o.link),o.discovery&&(process.env[`${e}DISCOVERY`]=o.discovery),o.success&&(process.env[`${e}SUCCESS`]=o.success),o.info&&(process.env[`${e}INFO`]=o.info),o.debug&&(process.env[`${e}DEBUG`]=o.debug),o.warning&&(process.env[`${e}WARNING`]=o.warning),o.danger&&(process.env[`${e}DANGER`]=o.danger),o.fatal&&(process.env[`${e}FATAL`]=o.fatal),o.performance&&(process.env[`${e}PERFORMANCE`]=o.performance),o.positive&&(process.env[`${e}POSITIVE`]=o.positive),o.negative&&(process.env[`${e}NEGATIVE`]=o.negative),o.gradient)for(let s=0;s<o.gradient.length;s++)process.env[`${e}GRADIENT_${s}`]=o.gradient[s];},dr=(e,o)=>({light:wo(`${e}LIGHT_`,o.light),dark:wo(`${e}DARK_`,o.dark)}),wo=(e,o)=>{if(o.foreground&&(process.env[`${e}FOREGROUND`]=o.foreground),o.background&&(process.env[`${e}BACKGROUND`]=o.background),o.brand&&(process.env[`${e}BRAND`]=o.brand),o.alternate&&(process.env[`${e}ALTERNATE`]=o.alternate),o.accent&&(process.env[`${e}ACCENT`]=o.accent),o.link&&(process.env[`${e}LINK`]=o.link),o.discovery&&(process.env[`${e}DISCOVERY`]=o.discovery),o.success&&(process.env[`${e}SUCCESS`]=o.success),o.info&&(process.env[`${e}INFO`]=o.info),o.debug&&(process.env[`${e}DEBUG`]=o.debug),o.warning&&(process.env[`${e}WARNING`]=o.warning),o.danger&&(process.env[`${e}DANGER`]=o.danger),o.fatal&&(process.env[`${e}FATAL`]=o.fatal),o.performance&&(process.env[`${e}PERFORMANCE`]=o.performance),o.positive&&(process.env[`${e}POSITIVE`]=o.positive),o.negative&&(process.env[`${e}NEGATIVE`]=o.negative),o.gradient)for(let s=0;s<o.gradient.length;s++)process.env[`${e}GRADIENT_${s}`]=o.gradient[s];};var I,mr=async(e,o,s,n=false,a=true)=>{let i;if(!I?.data||!I?.timestamp||I.timestamp<Date.now()-8e3){let c=s;c||(c=k());let p=bo(),u=await _o(c);if(!u&&(n||ne("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",{logLevel:"all"}),a===false))return;let g=await So(c),N=$o__default.default(p,u,g);N.variant||(N.variant=fs.existsSync(v(c,"nx.json"))||fs.existsSync(v(c,".nx"))||fs.existsSync(v(c,"lerna.json"))||fs.existsSync(v(c,"turbo.json"))?"monorepo":"minimal");try{let $=await Promise.resolve(vo._zod.parse({value:N,issues:[]},{async:!0}));i=ko($.value),i.workspaceRoot??=c;}catch($){throw new Error(`Failed to parse Storm Workspace configuration${$?.message?`: ${$.message}`:""}
|
|
27
27
|
|
|
28
|
-
Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${E(N)}`,{cause
|
|
29
|
-
${E(
|
|
28
|
+
Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${E(N)}`,{cause:$})}}else i=I.data;return I={timestamp:Date.now(),data:i},i},Do=async(e,o=false)=>{let s=await mr(void 0,void 0,e,o,true);return zo(s),!o&&!s.skipConfigLogging&&_(`\u2699\uFE0F Using Storm Workspace configuration:
|
|
29
|
+
${E(s)}`,s),s};function gr(e,o=false){return Do(e,o)}function rt(e=true,o={}){let s=o.workspaceRoot;return s||(s=k(o.cwd)),gr(s,e)}exports.a=ne;exports.b=Wr;exports.c=_;exports.d=v;exports.e=k;exports.f=gr;exports.g=rt;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkDW2HTWAU_cjs=require('./chunk-DW2HTWAU.cjs'),child_process=require('child_process'),semver=require('semver'),o=require('strip-ansi');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var o__default=/*#__PURE__*/_interopDefault(o);var x="https://registry.npmjs.org";var P="latest";var y=P;async function M(r="npm"){return new Promise((t,n)=>{child_process.exec(`${r} config get registry`,(e,u,a)=>e&&!e.message.toLowerCase().trim().startsWith("npm warn")?n(e):a&&!a.toLowerCase().trim().startsWith("npm warn")?n(a):t(u.trim()));})}async function D(){if(process.env.STORM_REGISTRY_NPM)return process.env.STORM_REGISTRY_NPM;let r=await chunkDW2HTWAU_cjs.f();return r?.registry?.npm?r?.registry?.npm:x}var L=/^(npm warn|\[[\d.]+ms\]|\[sys\]|\[warn\] request took)/i,d=/^\[[\d.]+ms\].*(?:\.env(?:\.local)?|"\.env)/i;function N(r){let t=r.trim();return t?[t,o__default.default(t)].some(e=>!e||L.test(e)||d.test(e)||/ms\].*\.env/i.test(e)?true:/\[[\d.]+ms\].*\.env/i.test(t)):true}function V(r){return r.split(/\r?\n/).map(t=>o__default.default(t).trim()).filter(t=>t.length>0).filter(t=>!N(t)).join(`
|
|
2
|
+
`).trim()}function b(r){let t=o__default.default(r).split(/\r?\n/).map(n=>n.trim()).filter(Boolean);for(let n=t.length-1;n>=0;n-=1){let e=t[n];if(e&&semver.valid(e,true))return e}return o__default.default(r).trim()}async function j(r,t=y,n={}){let e=n.executable||"npm",u=n.retries??3,a=n.timeout??12e4,h=n.registry||await M(e),l;for(let c=0;c<=u;c++)try{let g=new AbortController,m=setTimeout(()=>{g.abort();},a),s=await Promise.resolve(new Promise((A,f)=>{child_process.exec(`${e} view ${r} version --registry=${h}`,{signal:g.signal,maxBuffer:1024*1024*10},(i,I,R)=>{let p=R?V(R):"",T=b(I);if(semver.valid(T,!0))return A(T);let _=i?.message?o__default.default(i.message).trim():"";return i&&_&&!_.toLowerCase().startsWith("npm warn")&&!N(_)?f(p?new Error(p,{cause:i}):i):p?f(new Error(p)):i?f(i):A(T)});}));if(!semver.valid(s,!0))throw clearTimeout(m),new Error(o__default.default(s).startsWith("[WARN] Request took")?`A timeout occurred while fetching the version for package "${r}" with tag "${t}".`:`Invalid version "${s}" fetched for package "${r}" with tag "${t}"`);return clearTimeout(m),s}catch(g){if(l=g,c<u){let m=Math.pow(2,c)*100;await new Promise(s=>setTimeout(s,m));}}throw l}exports.a=y;exports.b=D;exports.c=j;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-7QKHH2VM.js';import {b,c,d,e as e$1}from'./chunk-LUXOLZKJ.js';import {a as a$2,c as c$2,b as b$1}from'./chunk-Y2HO4X3Y.js';import {a,e,g,c as c$1,b as b$2}from'./chunk-IVWMWBEI.js';import {valid,coerce,gt}from'semver';async function J(r=e(process.cwd())){let t=await b(r);if(!t){a(`No package.json file found in workspace root: ${r}`,{logLevel:"all"});return}let i=c(t);if(i)return Object.fromEntries(Object.entries(i).map(([o,f])=>[o,f.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in package.json file located in workspace root: ${r}
|
|
2
|
+
File content: ${JSON.stringify(t,null,2)}`);}async function U(r=e(process.cwd())){let t=await J(r);if(!t)throw new Error("No catalog entries found in workspace root package.json file");return t}async function W(r,t=e(process.cwd())){let i=await b(t);if(!i)throw new Error("No package.json file found in workspace root");d(i,Object.fromEntries(Object.entries(r).filter(([,o])=>o&&(o.startsWith("npm:")||valid(a$1(o),true))).map(([o,f])=>[o,f.replaceAll('"',"").replaceAll("'","")]))),await e$1(i,t);}async function _(r,t,i={}){let{tag:o=a$2,prefix:f="^",workspaceRoot:p=e(),verbose:d=false}=i,s=await g(true,{workspaceRoot:p});d&&c$1(`Upgrading catalog entry for package "${t}" with tag "${o}"`,s);let e$1=await(i.versionResolver??(async(g,j)=>c$2(g,j,{executable:"bun pm",registry:await b$1()})))(t,o);if(!e$1)throw new Error(`Failed to fetch version for package "${t}" with tag "${o}"`);if(!valid(a$1(e$1),true))throw new Error(`Invalid version "${e$1}" fetched for package "${t}" with tag "${o}"`);let c=`${f||""}${a$1(e$1)}`,l=false;return r[t]?.startsWith("npm:")?(r[t]=c,b$2(`Writing version ${r[t]} to catalog for "${t}" package`,s)):!valid(coerce(r[t]))||coerce(r[t])&&coerce(c)&>(coerce(c),coerce(r[t]))?(r[t]=`${f||""}${a$1(c)}`,b$2(`Writing version ${r[t]} to catalog for "${t}" package`,s),l=true):d&&b$2(`The current version ${r[t]} for package "${t}" is greater than or equal to the version ${a$1(c)} fetched from the npm registry with tag "${o}". No update performed.`,s),{catalog:r,updated:l}}async function G(r,t={}){let{tag:i=a$2,prefix:o="^",throwIfMissingInCatalog:f=false,workspaceRoot:p=e(),verbose:d=false}=t,s=await g(true,{workspaceRoot:p}),e$1=await U(p);if(!e$1)throw new Error("No catalog found");if(f===true&&!e$1[r])throw new Error(`Package "${r}" not found in catalog: ${JSON.stringify(e$1,null,2)}`);d&&c$1(`Upgrading catalog entry for package "${r}" with tag "${i}"`,s);let c=await b$1(),l=await c$2(r,i,{executable:"bun pm",registry:c});if(!l)throw new Error(`Failed to fetch version for package "${r}" with tag "${i}"`);if(!valid(a$1(l),true))throw new Error(`Invalid version "${l}" fetched for package "${r}" with tag "${i}"`);let g$1=`${o||""}${a$1(l)}`;g$1===e$1[r]?d&&c$1(`The version for package "${r}" is already up to date in the catalog: ${g$1}`,s):!valid(a$1(e$1[r]),true)||coerce(e$1[r])&&coerce(g$1)&>(coerce(g$1),coerce(e$1[r]))?(e$1[r]=`${o||""}${a$1(g$1)}`,b$2(`Writing version ${e$1[r]} to catalog for "${r}" package`,s),await W(e$1,p)):d&&a(`The current version "${e$1[r]}" for package "${r}" is greater than or equal to the version "${g$1}" fetched from the npm registry with tag "${i}". No update performed.`,s);}export{J as a,U as b,W as c,_ as d,G as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-ILE6NSRA.js';import {d,e}from'./chunk-IVWMWBEI.js';import {readCachedProjectGraph,createProjectGraphAsync}from'@nx/devkit';import {existsSync}from'node:fs';import {readFile,writeFile}from'node:fs/promises';import {format}from'prettier';import J from'prettier-plugin-packagejson';async function F(t=process.cwd(),f=e(t)){let g=d(t,"package.json"),l=await readFile(g,"utf8");if(!l)throw new Error("No package.json file found in package root: "+t);let s=await b(f),c=JSON.parse(l);if(!s){console.warn("No workspace catalog found. Skipping dependencies replacement for now.");return}for(let n of ["dependencies","devDependencies","peerDependencies"]){let o=c[n];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!s)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`package.json\` file.`);let a=s[e];if(!a)throw new Error("Missing workspace catalog version for "+e);o[e]=a;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let r;try{r=readCachedProjectGraph();}catch{await createProjectGraphAsync(),r=readCachedProjectGraph();}let i={};r&&await Promise.all(Object.keys(r.nodes).map(async n=>{let o=r.nodes[n];if(o?.data.root){let e=d(f,o.data.root,"package.json");if(existsSync(e)){let a=await readFile(e,"utf8"),p=JSON.parse(a);p.private!==true&&(i[p.name]=p.version);}}}));for(let n of ["dependencies","devDependencies","peerDependencies"]){let o=c[n];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(i[e])o[e]=`^${i[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return writeFile(g,await format(JSON.stringify(c),{parser:"json",proseWrap:"preserve",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:[J]}))}export{F as a};
|