@storm-software/pnpm-tools 0.5.1 → 0.5.3
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 +32 -0
- package/README.md +1 -1
- package/bin/pnpm.cjs +23 -13
- package/bin/pnpm.js +23 -13
- package/dist/chunk-E7QLQFQS.js +1 -0
- package/dist/{chunk-YXTQCEU6.cjs → chunk-EOY4SFRO.cjs} +1 -1
- package/dist/chunk-JGJEVC4U.js +27 -0
- package/dist/chunk-NM3PKH5T.cjs +2 -0
- package/dist/chunk-U7UAWKHA.js +2 -0
- package/dist/chunk-XDFF7DBD.cjs +27 -0
- package/dist/helpers/catalog.cjs +1 -1
- package/dist/helpers/catalog.js +1 -1
- package/dist/helpers/index.cjs +1 -1
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/pnpm-workspace.cjs +1 -1
- package/dist/helpers/pnpm-workspace.js +1 -1
- package/dist/helpers/replace-deps-aliases.cjs +1 -1
- package/dist/helpers/replace-deps-aliases.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-CZ7PAWK2.cjs +0 -4
- package/dist/chunk-IHDHOPTD.js +0 -1
- package/dist/chunk-IMQTDNZI.js +0 -25
- package/dist/chunk-LGDN3UHN.js +0 -4
- package/dist/chunk-ZZOQH7Z4.cjs +0 -25
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Storm Ops - Pnpm Tools
|
|
4
4
|
|
|
5
|
+
## [0.5.2](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.5.2) (2025-09-21)
|
|
6
|
+
|
|
7
|
+
### Miscellaneous
|
|
8
|
+
|
|
9
|
+
- **monorepo:** Update workspace package links
|
|
10
|
+
([33ab95f46](https://github.com/storm-software/storm-ops/commit/33ab95f46))
|
|
11
|
+
- **pnpm-tools:** Update `storm-pnpm` trace logging
|
|
12
|
+
([ab3f1d696](https://github.com/storm-software/storm-ops/commit/ab3f1d696))
|
|
13
|
+
|
|
14
|
+
### Updated Dependencies
|
|
15
|
+
|
|
16
|
+
- Updated config-tools to 1.187.4
|
|
17
|
+
- Updated npm-tools to 0.4.9
|
|
18
|
+
- Updated config to 1.133.2
|
|
19
|
+
|
|
20
|
+
## [0.5.1](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.5.1) (2025-09-20)
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
- **pnpm-tools:** Resolve issue with logger import path
|
|
25
|
+
([6e99599b2](https://github.com/storm-software/storm-ops/commit/6e99599b2))
|
|
26
|
+
|
|
27
|
+
### Miscellaneous
|
|
28
|
+
|
|
29
|
+
- **monorepo:** Update workspace package links
|
|
30
|
+
([a927dea1d](https://github.com/storm-software/storm-ops/commit/a927dea1d))
|
|
31
|
+
|
|
32
|
+
### Updated Dependencies
|
|
33
|
+
|
|
34
|
+
- Updated config-tools to 1.187.3
|
|
35
|
+
- Updated npm-tools to 0.4.8
|
|
36
|
+
|
|
5
37
|
## [0.5.0](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.5.0) (2025-09-20)
|
|
6
38
|
|
|
7
39
|
### Features
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
package/bin/pnpm.cjs
CHANGED
|
@@ -6,7 +6,7 @@ var import_console2 = require("@storm-software/config-tools/logger/console");
|
|
|
6
6
|
var import_process_handler = require("@storm-software/config-tools/utilities/process-handler");
|
|
7
7
|
|
|
8
8
|
// src/cli/index.ts
|
|
9
|
-
var
|
|
9
|
+
var import_config_tools2 = require("@storm-software/config-tools");
|
|
10
10
|
var import_commander = require("commander");
|
|
11
11
|
|
|
12
12
|
// src/helpers/catalog.ts
|
|
@@ -18,6 +18,7 @@ var import_get_version = require("@storm-software/npm-tools/helpers/get-version"
|
|
|
18
18
|
var import_semver = require("semver");
|
|
19
19
|
|
|
20
20
|
// src/helpers/pnpm-workspace.ts
|
|
21
|
+
var import_config_tools = require("@storm-software/config-tools");
|
|
21
22
|
var import_correct_paths = require("@storm-software/config-tools/utilities/correct-paths");
|
|
22
23
|
var import_find_workspace_root = require("@storm-software/config-tools/utilities/find-workspace-root");
|
|
23
24
|
var import_node_fs = require("fs");
|
|
@@ -43,10 +44,13 @@ async function readPnpmWorkspaceFile(workspaceRoot = (0, import_find_workspace_r
|
|
|
43
44
|
return (0, import_yaml.parse)(result);
|
|
44
45
|
}
|
|
45
46
|
async function writePnpmWorkspaceFile(pnpmWorkspaceFile, workspaceRoot = (0, import_find_workspace_root.findWorkspaceRoot)(process.cwd())) {
|
|
46
|
-
await (0,
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
const config = await (0, import_config_tools.getWorkspaceConfig)();
|
|
48
|
+
const stringified = (0, import_yaml.stringify)(pnpmWorkspaceFile);
|
|
49
|
+
(0, import_config_tools.writeTrace)(
|
|
50
|
+
`Writing updated pnpm-workspace.yaml file to workspace root: ${stringified}`,
|
|
51
|
+
config
|
|
49
52
|
);
|
|
53
|
+
await (0, import_promises.writeFile)(getPnpmWorkspaceFilePath(workspaceRoot), stringified);
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
// src/helpers/catalog.ts
|
|
@@ -117,8 +121,14 @@ async function upgradeCatalogPackage(packageName, options = {}) {
|
|
|
117
121
|
`Upgrading catalog entry for package "${packageName}" with tag "${tag}"`,
|
|
118
122
|
workspaceConfig
|
|
119
123
|
);
|
|
120
|
-
const
|
|
121
|
-
|
|
124
|
+
const origVersion = await (0, import_get_version.getVersion)(packageName, tag);
|
|
125
|
+
const version = `${prefix || ""}${origVersion.replace(/^[\^~><=*]+/, "")}`;
|
|
126
|
+
if (version === catalog[packageName]) {
|
|
127
|
+
(0, import_console.writeTrace)(
|
|
128
|
+
`The version for package "${packageName}" is already up to date in the catalog: ${version}`,
|
|
129
|
+
workspaceConfig
|
|
130
|
+
);
|
|
131
|
+
} else if (!(0, import_semver.valid)((0, import_semver.coerce)(catalog[packageName])) || (0, import_semver.coerce)(catalog[packageName]) && (0, import_semver.coerce)(version) && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
122
132
|
(0, import_semver.gt)((0, import_semver.coerce)(version), (0, import_semver.coerce)(catalog[packageName]))) {
|
|
123
133
|
catalog[packageName] = `${prefix || ""}${version}`;
|
|
124
134
|
(0, import_console.writeDebug)(
|
|
@@ -138,8 +148,8 @@ async function upgradeCatalogPackage(packageName, options = {}) {
|
|
|
138
148
|
var _config = {};
|
|
139
149
|
function createProgram(config) {
|
|
140
150
|
_config = config;
|
|
141
|
-
(0,
|
|
142
|
-
const root = (0,
|
|
151
|
+
(0, import_config_tools2.writeInfo)("\u26A1 Running the `storm-pnpm` command-line application", config);
|
|
152
|
+
const root = (0, import_config_tools2.findWorkspaceRootSafe)(_config.workspaceRoot || process.cwd());
|
|
143
153
|
process.env.STORM_WORKSPACE_ROOT ??= root;
|
|
144
154
|
process.env.NX_WORKSPACE_ROOT_PATH ??= root;
|
|
145
155
|
if (root) {
|
|
@@ -178,7 +188,7 @@ async function updateAction(packageNames, {
|
|
|
178
188
|
}) {
|
|
179
189
|
try {
|
|
180
190
|
const packages = (Array.isArray(packageNames) ? packageNames : [packageNames.split(",")].flat()).map((p) => p.trim().replaceAll("*", ""));
|
|
181
|
-
(0,
|
|
191
|
+
(0, import_config_tools2.writeInfo)(
|
|
182
192
|
`\u26A1 Preparing to update the package version for ${packages.join(", ")}.`,
|
|
183
193
|
_config
|
|
184
194
|
);
|
|
@@ -197,7 +207,7 @@ async function updateAction(packageNames, {
|
|
|
197
207
|
`No packages found in the catalog matching the name/pattern "${pkg}".`
|
|
198
208
|
);
|
|
199
209
|
}
|
|
200
|
-
(0,
|
|
210
|
+
(0, import_config_tools2.writeDebug)(
|
|
201
211
|
`Found ${matchedPackages.length} matching packages in the catalog file:
|
|
202
212
|
|
|
203
213
|
- ${matchedPackages.map((p) => `${p} (${catalog[p] || "unknown"})`).join("\n- ")}`,
|
|
@@ -214,17 +224,17 @@ async function updateAction(packageNames, {
|
|
|
214
224
|
);
|
|
215
225
|
}
|
|
216
226
|
if (install) {
|
|
217
|
-
(0,
|
|
227
|
+
(0, import_config_tools2.writeTrace)(
|
|
218
228
|
"Running `pnpm install --no-frozen-lockfile` to update local dependency versions",
|
|
219
229
|
_config
|
|
220
230
|
);
|
|
221
|
-
const proc = await (0,
|
|
231
|
+
const proc = await (0, import_config_tools2.runAsync)(_config, "pnpm install --no-frozen-lockfile");
|
|
222
232
|
proc.stdout?.on("data", (data) => {
|
|
223
233
|
console.log(data.toString());
|
|
224
234
|
});
|
|
225
235
|
}
|
|
226
236
|
} catch (error) {
|
|
227
|
-
(0,
|
|
237
|
+
(0, import_config_tools2.writeFatal)(
|
|
228
238
|
`A fatal error occurred while running Storm pnpm update:
|
|
229
239
|
|
|
230
240
|
${JSON.stringify(
|
package/bin/pnpm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// bin/pnpm.ts
|
|
4
|
-
import { getWorkspaceConfig as
|
|
4
|
+
import { getWorkspaceConfig as getWorkspaceConfig3 } from "@storm-software/config-tools/get-config";
|
|
5
5
|
import { writeSuccess } from "@storm-software/config-tools/logger/console";
|
|
6
6
|
import {
|
|
7
7
|
exitWithError,
|
|
@@ -16,15 +16,15 @@ import {
|
|
|
16
16
|
writeDebug as writeDebug2,
|
|
17
17
|
writeFatal,
|
|
18
18
|
writeInfo,
|
|
19
|
-
writeTrace as
|
|
19
|
+
writeTrace as writeTrace3
|
|
20
20
|
} from "@storm-software/config-tools";
|
|
21
21
|
import { Argument, Command, Option } from "commander";
|
|
22
22
|
|
|
23
23
|
// src/helpers/catalog.ts
|
|
24
|
-
import { getWorkspaceConfig } from "@storm-software/config-tools/get-config";
|
|
24
|
+
import { getWorkspaceConfig as getWorkspaceConfig2 } from "@storm-software/config-tools/get-config";
|
|
25
25
|
import {
|
|
26
26
|
writeDebug,
|
|
27
|
-
writeTrace,
|
|
27
|
+
writeTrace as writeTrace2,
|
|
28
28
|
writeWarning
|
|
29
29
|
} from "@storm-software/config-tools/logger/console";
|
|
30
30
|
import { findWorkspaceRoot as findWorkspaceRoot2 } from "@storm-software/config-tools/utilities/find-workspace-root";
|
|
@@ -33,6 +33,7 @@ import { getVersion } from "@storm-software/npm-tools/helpers/get-version";
|
|
|
33
33
|
import { coerce, gt, valid } from "semver";
|
|
34
34
|
|
|
35
35
|
// src/helpers/pnpm-workspace.ts
|
|
36
|
+
import { getWorkspaceConfig, writeTrace } from "@storm-software/config-tools";
|
|
36
37
|
import { joinPaths } from "@storm-software/config-tools/utilities/correct-paths";
|
|
37
38
|
import { findWorkspaceRoot } from "@storm-software/config-tools/utilities/find-workspace-root";
|
|
38
39
|
import { existsSync } from "node:fs";
|
|
@@ -58,10 +59,13 @@ async function readPnpmWorkspaceFile(workspaceRoot = findWorkspaceRoot(process.c
|
|
|
58
59
|
return parse(result);
|
|
59
60
|
}
|
|
60
61
|
async function writePnpmWorkspaceFile(pnpmWorkspaceFile, workspaceRoot = findWorkspaceRoot(process.cwd())) {
|
|
61
|
-
await
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
const config = await getWorkspaceConfig();
|
|
63
|
+
const stringified = stringify(pnpmWorkspaceFile);
|
|
64
|
+
writeTrace(
|
|
65
|
+
`Writing updated pnpm-workspace.yaml file to workspace root: ${stringified}`,
|
|
66
|
+
config
|
|
64
67
|
);
|
|
68
|
+
await writeFile(getPnpmWorkspaceFilePath(workspaceRoot), stringified);
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
// src/helpers/catalog.ts
|
|
@@ -114,7 +118,7 @@ async function upgradeCatalogPackage(packageName, options = {}) {
|
|
|
114
118
|
throwIfMissingInCatalog = false,
|
|
115
119
|
workspaceRoot = findWorkspaceRoot2()
|
|
116
120
|
} = options;
|
|
117
|
-
const workspaceConfig = await
|
|
121
|
+
const workspaceConfig = await getWorkspaceConfig2(true, { workspaceRoot });
|
|
118
122
|
const catalog = await getCatalog(workspaceRoot);
|
|
119
123
|
if (!catalog) {
|
|
120
124
|
throw new Error("No catalog found");
|
|
@@ -128,12 +132,18 @@ async function upgradeCatalogPackage(packageName, options = {}) {
|
|
|
128
132
|
)}`
|
|
129
133
|
);
|
|
130
134
|
}
|
|
131
|
-
|
|
135
|
+
writeTrace2(
|
|
132
136
|
`Upgrading catalog entry for package "${packageName}" with tag "${tag}"`,
|
|
133
137
|
workspaceConfig
|
|
134
138
|
);
|
|
135
|
-
const
|
|
136
|
-
|
|
139
|
+
const origVersion = await getVersion(packageName, tag);
|
|
140
|
+
const version = `${prefix || ""}${origVersion.replace(/^[\^~><=*]+/, "")}`;
|
|
141
|
+
if (version === catalog[packageName]) {
|
|
142
|
+
writeTrace2(
|
|
143
|
+
`The version for package "${packageName}" is already up to date in the catalog: ${version}`,
|
|
144
|
+
workspaceConfig
|
|
145
|
+
);
|
|
146
|
+
} else if (!valid(coerce(catalog[packageName])) || coerce(catalog[packageName]) && coerce(version) && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
137
147
|
gt(coerce(version), coerce(catalog[packageName]))) {
|
|
138
148
|
catalog[packageName] = `${prefix || ""}${version}`;
|
|
139
149
|
writeDebug(
|
|
@@ -229,7 +239,7 @@ async function updateAction(packageNames, {
|
|
|
229
239
|
);
|
|
230
240
|
}
|
|
231
241
|
if (install) {
|
|
232
|
-
|
|
242
|
+
writeTrace3(
|
|
233
243
|
"Running `pnpm install --no-frozen-lockfile` to update local dependency versions",
|
|
234
244
|
_config
|
|
235
245
|
);
|
|
@@ -255,7 +265,7 @@ ${JSON.stringify(
|
|
|
255
265
|
|
|
256
266
|
// bin/pnpm.ts
|
|
257
267
|
void (async () => {
|
|
258
|
-
const config = await
|
|
268
|
+
const config = await getWorkspaceConfig3();
|
|
259
269
|
try {
|
|
260
270
|
handleProcess(config);
|
|
261
271
|
const program = createProgram(config);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-U7UAWKHA.js';import {e,d}from'./chunk-JGJEVC4U.js';import {readCachedProjectGraph,createProjectGraphAsync}from'@nx/devkit';import {existsSync}from'node:fs';import {readFile,writeFile}from'node:fs/promises';import {format}from'prettier';async function $(c=process.cwd(),i=e(c)){let l=d(c,"package.json"),m=await readFile(l,"utf8");if(!m)throw new Error("No package.json file found in package root: "+c);let p=await b(i),r=JSON.parse(m),g=d(i,"pnpm-workspace.yaml");if(!existsSync(g))return console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${g}). Skipping pnpm catalog read for now.`),r;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!p)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`);let t=p[e];if(!t)throw new Error("Missing pnpm catalog version for "+e);o[e]=t;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let n;try{n=readCachedProjectGraph();}catch{await createProjectGraphAsync(),n=readCachedProjectGraph();}let d$1={};n&&await Promise.all(Object.keys(n.nodes).map(async a=>{let o=n.nodes[a];if(o?.data.root){let e=d(i,o.data.root,"package.json");if(existsSync(e)){let t=await readFile(e,"utf8"),f=JSON.parse(t);f.private!==true&&(d$1[f.name]=f.version);}}}));for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(d$1[e])o[e]=`^${d$1[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return writeFile(l,await format(JSON.stringify(r),{parser:"json",proseWrap:"always",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-pkg"]}))}export{$ as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkNM3PKH5T_cjs=require('./chunk-NM3PKH5T.cjs'),chunkXDFF7DBD_cjs=require('./chunk-XDFF7DBD.cjs'),devkit=require('@nx/devkit'),fs=require('fs'),promises=require('fs/promises'),prettier=require('prettier');async function C(c=process.cwd(),i=chunkXDFF7DBD_cjs.e(c)){let l=chunkXDFF7DBD_cjs.d(c,"package.json"),m=await promises.readFile(l,"utf8");if(!m)throw new Error("No package.json file found in package root: "+c);let p=await chunkNM3PKH5T_cjs.b(i),r=JSON.parse(m),g=chunkXDFF7DBD_cjs.d(i,"pnpm-workspace.yaml");if(!fs.existsSync(g))return console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${g}). Skipping pnpm catalog read for now.`),r;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!p)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`);let t=p[e];if(!t)throw new Error("Missing pnpm catalog version for "+e);o[e]=t;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let n;try{n=devkit.readCachedProjectGraph();}catch{await devkit.createProjectGraphAsync(),n=devkit.readCachedProjectGraph();}let d={};n&&await Promise.all(Object.keys(n.nodes).map(async a=>{let o=n.nodes[a];if(o?.data.root){let e=chunkXDFF7DBD_cjs.d(i,o.data.root,"package.json");if(fs.existsSync(e)){let t=await promises.readFile(e,"utf8"),f=JSON.parse(t);f.private!==true&&(d[f.name]=f.version);}}}));for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(d[e])o[e]=`^${d[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return promises.writeFile(l,await prettier.format(JSON.stringify(r),{parser:"json",proseWrap:"always",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-pkg"]}))}exports.a=C;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {loadConfig}from'c12';import Ao from'defu';import Go from'chalk';import {existsSync}from'node:fs';import {join}from'node:path';import*as r from'zod/mini';import {readFile,writeFile}from'node:fs/promises';import {parse,stringify}from'yaml';var c={SILENT:0,FATAL:10,ERROR:20,WARN:30,SUCCESS:35,INFO:40,DEBUG:60,TRACE:70,ALL:100},l={SILENT:"silent",FATAL:"fatal",ERROR:"error",WARN:"warn",SUCCESS:"success",INFO:"info",DEBUG:"debug",TRACE:"trace",ALL:"all"};var R={dark:{brand:"#2dd4bf",success:"#10b981",info:"#58a6ff",warning:"#f3d371",danger:"#D8314A",fatal:"#a40e26"}};var Po={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}},oe=()=>{let e=Go;return (!e?.hex||!e?.bold?.hex||!e?.bgHex||!e?.whiteBright||!e?.white)&&(e=Po),e};function re(){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 O=(e,o)=>re()?e:o,S={[l.ERROR]:O("\u2718","\xD7"),[l.FATAL]:O("\u{1F480}","\xD7"),[l.WARN]:O("\u26A0","\u203C"),[l.INFO]:O("\u2139","i"),[l.SUCCESS]:O("\u2714","\u221A"),[l.DEBUG]:O("\u{1F6E0}","D"),[l.TRACE]:O("\u{1F6E0}","T"),[l.ALL]:O("\u2709","\u2192")};var v=(e=new Date)=>`${e.toLocaleDateString()} ${e.toLocaleTimeString()}`;var L=e=>{switch(e){case "all":return c.ALL;case "trace":return c.TRACE;case "debug":return c.DEBUG;case "info":return c.INFO;case "warn":return c.WARN;case "error":return c.ERROR;case "fatal":return c.FATAL;case "silent":return c.SILENT;default:return c.INFO}},te=(e=c.INFO)=>e>=c.ALL?l.ALL:e>=c.TRACE?l.TRACE:e>=c.DEBUG?l.DEBUG:e>=c.INFO?l.INFO:e>=c.WARN?l.WARN:e>=c.ERROR?l.ERROR:e>=c.FATAL?l.FATAL:e<=c.SILENT?l.SILENT:l.INFO;var V=(e=c.INFO,o={},t=oe())=>{let a=!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,i=o.logLevel||process.env.STORM_LOG_LEVEL||l.INFO;return e>L(i)||e<=c.SILENT||L(i)<=c.SILENT?n=>{}:typeof e=="number"&&c.FATAL>=e?n=>{console.error(`
|
|
2
|
+
${t.gray(v())} ${t.hex(a.fatal??R.dark.fatal)(`[${S[l.FATAL]} Fatal] `)}${t.bold.whiteBright(T(n))}
|
|
3
|
+
`);}:typeof e=="number"&&c.ERROR>=e?n=>{console.error(`
|
|
4
|
+
${t.gray(v())} ${t.hex(a.danger??R.dark.danger)(`[${S[l.ERROR]} Error] `)}${t.bold.whiteBright(T(n))}
|
|
5
|
+
`);}:typeof e=="number"&&c.WARN>=e?n=>{console.warn(`
|
|
6
|
+
${t.gray(v())} ${t.hex(a.warning??R.dark.warning)(`[${S[l.WARN]} Warn] `)}${t.bold.whiteBright(T(n))}
|
|
7
|
+
`);}:typeof e=="number"&&c.SUCCESS>=e?n=>{console.info(`
|
|
8
|
+
${t.gray(v())} ${t.hex(a.success??R.dark.success)(`[${S[l.SUCCESS]} Success] `)}${t.bold.whiteBright(T(n))}
|
|
9
|
+
`);}:typeof e=="number"&&c.INFO>=e?n=>{console.info(`
|
|
10
|
+
${t.gray(v())} ${t.hex(a.info??R.dark.info)(`[${S[l.INFO]} Info] `)}${t.bold.whiteBright(T(n))}
|
|
11
|
+
`);}:typeof e=="number"&&c.DEBUG>=e?n=>{console.debug(`
|
|
12
|
+
${t.gray(v())} ${t.hex(a.info??R.dark.info)(`[${S[l.DEBUG]} Debug] `)}${t.bold.whiteBright(T(n))}
|
|
13
|
+
`);}:typeof e=="number"&&c.TRACE>=e?n=>{console.debug(`
|
|
14
|
+
${t.gray(v())} ${t.hex(a.info??R.dark.info)(`[${S[l.TRACE]} Trace] `)}${t.bold.whiteBright(T(n))}
|
|
15
|
+
`);}:n=>{console.log(`
|
|
16
|
+
${t.gray(v())} ${t.hex(a.brand??R.dark.brand)(`[${S[l.ALL]} System] `)}${t.bold.whiteBright(T(n))}
|
|
17
|
+
`);}};var se=(e,o)=>V(c.WARN,o)(e);var Hr=(e,o)=>V(c.DEBUG,o)(e),A=(e,o)=>V(c.TRACE,o)(e);var Wo=4,T=(e,o={},t=0)=>{if(t>Wo)return "<max depth>";let a=o.prefix??"-",i=o.skip??[];return typeof e>"u"||e===null||!e&&typeof e!="boolean"?"<none>":typeof e=="string"?e:Array.isArray(e)?`
|
|
18
|
+
${e.map((n,m)=>` ${a}> #${m} = ${T(n,{prefix:`${a}-`,skip:i},t+1)}`).join(`
|
|
19
|
+
`)}`:typeof e=="object"?`
|
|
20
|
+
${Object.keys(e).filter(n=>!i.includes(n)).map(n=>` ${a}> ${n} = ${Mo(e[n])?"<function>":typeof e[n]=="object"?T(e[n],{prefix:`${a}-`,skip:i},t+1):e[n]}`).join(`
|
|
21
|
+
`)}`: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 jo=/^[/\\]{2}/,Bo=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Ho=/^[A-Za-z]:$/;var p=function(e){if(!e||e.length===0)return ".";e=Uo(e);let o=e?.match(jo),t=ne(e),a=e[e.length-1]==="/";return e=Ko(e,!t),e.length===0?t?"/":a?"./":".":(a&&(e+="/"),Ho.test(e)&&(e+="/"),o?t?`//${e}`:`//./${e}`:t&&!ne(e)?`/${e}`:e)},E=function(...e){let o="";for(let t of e)if(t)if(o.length>0){let a=o[o.length-1]==="/",i=t[0]==="/";a&&i?o+=t.slice(1):o+=a||i?t:`/${t}`;}else o+=t;return p(o)};function Ko(e,o){let t="",a=0,i=-1,n=0,m=null;for(let d=0;d<=e.length;++d){if(d<e.length)m=e[d];else {if(m==="/")break;m="/";}if(m==="/"){if(!(i===d-1||n===1))if(n===2){if(t.length<2||a!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let k=t.lastIndexOf("/");k===-1?(t="",a=0):(t=t.slice(0,k),a=t.length-1-t.lastIndexOf("/")),i=d,n=0;continue}else if(t.length>0){t="",a=0,i=d,n=0;continue}}o&&(t+=t.length>0?"/..":"..",a=2);}else t.length>0?t+=`/${e.slice(i+1,d)}`:t=e.slice(i+1,d),a=d-i-1;i=d,n=0;}else m==="."&&n!==-1?++n:n=-1;}return t}var ne=function(e){return Bo.test(e)};var Zo=30,Yo=0;function X(e,o=[],t=[]){let a=e??process.cwd();if(t.some(i=>existsSync(join(a,i)))||o.some(i=>existsSync(join(a,i))))return a;if(a!=="/"&&Yo++<Zo){let i=join(a,"..");return X(i,o,t)}}var ie=["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"],Vo=[".storm-workspace",".nx",".git",".github",".vscode",".verdaccio"];function Jo(e){return process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH?p(process.env.STORM_WORKSPACE_ROOT??process.env.NX_WORKSPACE_ROOT_PATH):p(X(e??process.cwd(),ie,Vo))}function C(e){let o=Jo(e);if(!o)throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
|
|
22
|
+
${ie.join(`
|
|
23
|
+
`)}
|
|
24
|
+
Path: ${e||process.cwd()}`);return o}var ce="https://docs.stormsoftware.com",_="https://stormsoftware.com";var pe="https://stormsoftware.com/license",le="Apache-2.0";var N="tools/errors/codes.json",de="The workspace's banner image";var s=r.registry(),h=r.string().check(r.length(7),r.toLowerCase(),r.regex(/^#([0-9a-f]{3}){1,2}$/i),r.trim());s.add(h,{description:"A base schema for describing the format of colors"});var w=r._default(h,"#151718");s.add(w,{description:"The dark background color of the workspace"});var z=r._default(h,"#cbd5e1");s.add(z,{description:"The light background color of the workspace"});var x=r._default(h,"#1fb2a6");s.add(x,{description:"The primary brand specific color of the workspace"});var b=r.optional(h);s.add(b,{description:"The alternate brand specific color of the workspace"});var D=r.optional(h);s.add(D,{description:"The secondary brand specific color of the workspace"});var G=r._default(h,"#3fa6ff");s.add(G,{description:"The color used to display hyperlink text"});var P=r._default(h,"#818cf8");s.add(P,{description:"The second brand specific color of the workspace"});var W=r._default(h,"#45b27e");s.add(W,{description:"The success color of the workspace"});var M=r._default(h,"#38bdf8");s.add(M,{description:"The informational color of the workspace"});var F=r._default(h,"#f3d371");s.add(F,{description:"The warning color of the workspace"});var U=r._default(h,"#d8314a");s.add(U,{description:"The danger color of the workspace"});var j=r.optional(h);s.add(j,{description:"The fatal color of the workspace"});var B=r._default(h,"#4ade80");s.add(B,{description:"The positive number color of the workspace"});var H=r._default(h,"#ef4444");s.add(H,{description:"The negative number color of the workspace"});var K=r.optional(r.array(h));s.add(K,{description:"The color stops for the base gradient color pattern used in the workspace"});var er=r.object({foreground:z,background:w,brand:x,alternate:b,accent:D,link:G,help:P,success:W,info:M,warning:F,danger:U,fatal:j,positive:B,negative:H,gradient:K}),or=r.object({foreground:w,background:z,brand:x,alternate:b,accent:D,link:G,help:P,success:W,info:M,warning:F,danger:U,fatal:j,positive:B,negative:H,gradient:K}),rr=r.object({dark:er,light:or}),tr=r.object({dark:w,light:z,brand:x,alternate:b,accent:D,link:G,help:P,success:W,info:M,warning:F,danger:U,fatal:j,positive:B,negative:H,gradient:K}),$=r.optional(r.url());s.add($,{description:"A remote registry URL used to publish distributable packages"});var me=r._default(r.object({github:$,npm:$,cargo:$,cyclone:$,container:$}),{});s.add(me,{description:"A list of remote registry URLs used by Storm Software"});var q=r.union([tr,rr]);s.add(q,{description:"Colors used for various workspace elements"});var ge=r.record(r.union([r.union([r.literal("base"),r.string()]),r.string()]),q);s.add(ge,{description:"Storm theme config values used for styling various package elements"});var ue=r.optional(r.union([r.string().check(r.trim()),r.array(r.string().check(r.trim()))]));s.add(ue,{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 fe=r.string().check(r.trim());s.add(fe,{description:"The workspace bot user's name (this is the bot that will be used to perform various tasks)"});var he=r.string().check(r.trim());s.add(he,{description:"The email of the workspace bot"});var Te=r.object({name:fe,email:he});s.add(Te,{description:"The workspace's bot user's config used to automated various operations tasks"});var Ce=r.optional(r.string().check(r.trim(),r.url()));s.add(Ce,{description:"A URL to a banner image used to display the workspace's release"});var Ee=r._default(r.string().check(r.trim()),de);s.add(Ee,{description:"The alt text for the workspace's release banner image"});var Re=r.object({url:Ce,alt:Ee});s.add(Re,{description:"The workspace's banner image used during the release process"});var Se=r.optional(r.string().check(r.trim()));s.add(Se,{description:"A header message appended to the start of the workspace's release notes"});var ve=r.optional(r.string().check(r.trim()));s.add(ve,{description:"A footer message appended to the end of the workspace's release notes"});var ke=r.object({banner:r.union([Re,r.string().check(r.trim(),r.url())]),header:Se,footer:ve});s.add(ke,{description:"The workspace's release config used during the release process"});var Oe=r.optional(r.string().check(r.trim()));s.add(Oe,{description:"A Twitter/X account associated with the organization/project"});var Ae=r.optional(r.string().check(r.trim()));s.add(Ae,{description:"A Discord account associated with the organization/project"});var Le=r.optional(r.string().check(r.trim()));s.add(Le,{description:"A Telegram account associated with the organization/project"});var $e=r.optional(r.string().check(r.trim()));s.add($e,{description:"A Slack account associated with the organization/project"});var _e=r.optional(r.string().check(r.trim()));s.add(_e,{description:"A Medium account associated with the organization/project"});var Ie=r.optional(r.string().check(r.trim()));s.add(Ie,{description:"A GitHub account associated with the organization/project"});var ye=r.object({twitter:Oe,discord:Ae,telegram:Le,slack:$e,medium:_e,github:Ie});s.add(ye,{description:"The workspace's account config used to store various social media links"});var Ne=r.optional(r.string().check(r.trim()));s.add(Ne,{description:"The directory used to store the environment's cached file data"});var we=r.optional(r.string().check(r.trim()));s.add(we,{description:"The directory used to store the environment's data files"});var ze=r.optional(r.string().check(r.trim()));s.add(ze,{description:"The directory used to store the environment's configuration files"});var xe=r.optional(r.string().check(r.trim()));s.add(xe,{description:"The directory used to store the environment's temp files"});var be=r.optional(r.string().check(r.trim()));s.add(be,{description:"The directory used to store the environment's log files"});var De=r._default(r.string().check(r.trim()),"dist");s.add(De,{description:"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"});var Ge=r.object({cache:Ne,data:we,config:ze,temp:xe,log:be,build:De});s.add(Ge,{description:"Various directories used by the workspace to store data, cache, and configuration files"});var Pe=r._default(r.enum(["minimal","monorepo"]),"monorepo");s.add(Pe,{description:"The variant of the workspace. This can be used to enable or disable certain features or configurations."});var We=r._default(r.string().check(r.trim()),N);s.add(We,{description:"The path to the workspace's error codes JSON file"});var Me=r.optional(r.url());s.add(Me,{description:"A URL to a page that looks up the workspace's error messages given a specific error code"});var Fe=r.object({codesFile:We,url:Me});s.add(Fe,{description:"The workspace's error config used when creating error details during a system error"});var Ue=r.optional(r.string().check(r.trim(),r.toLowerCase()));s.add(Ue,{description:"The name of the organization"});var je=r.optional(r.string().check(r.trim()));s.add(je,{description:"A description of the organization"});var Be=r.optional(r.url());s.add(Be,{description:"A URL to the organization's logo image"});var He=r.optional(r.url());s.add(He,{description:"A URL to the organization's icon image"});var Ke=r.optional(r.url());s.add(Ke,{description:"A URL to a page that provides more information about the organization"});var Ze=r.object({name:Ue,description:je,logo:Be,icon:He,url:Ke});s.add(Ze,{description:"The workspace's organization details"});var Ye=r._default(r.string().check(r.trim(),r.toLowerCase()),"https://public.storm-cdn.com/schemas/storm-workspace.schema.json");s.add(Ye,{description:"The URL or file path to the JSON schema file that describes the Storm configuration file"});var Ve=r.string().check(r.trim(),r.toLowerCase());s.add(Ve,{description:"The name of the workspace/project/service/package/scope using this configuration"});var Je=r.string().check(r.trim(),r.toLowerCase());s.add(Je,{description:"The namespace of the workspace/project/service/package/scope using this configuration"});var Xe=r.union([Ze,r.string().check(r.trim(),r.toLowerCase())]);s.add(Xe,{description:"The organization of the workspace. This can be a string or an object containing the organization's details"});var qe=r.string().check(r.trim(),r.toLowerCase());s.add(qe,{description:"The repo URL of the workspace (i.e. the GitHub repository URL)"});var Qe=r._default(r.string().check(r.trim()),"Apache-2.0");s.add(Qe,{description:"The license type of the package"});var eo=r.optional(r.url());s.add(eo,{description:"The homepage of the workspace"});var oo=r.optional(r.url());s.add(oo,{description:"The documentation site for the workspace"});var ro=r.optional(r.url());s.add(ro,{description:"The development portal site for the workspace"});var to=r.optional(r.url());s.add(to,{description:"The licensing site for the workspace"});var so=r.optional(r.url());s.add(so,{description:"The contact site for the workspace"});var no=r.optional(r.url());s.add(no,{description:"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"});var ao=r._default(r.string().check(r.trim(),r.toLowerCase()),"main");s.add(ao,{description:"The branch of the workspace"});var io=r.optional(r.string().check(r.trim(),r.toLowerCase()));s.add(io,{description:"A tag specifying the version pre-release identifier"});var co=r.optional(r.string().check(r.trim(),r.toLowerCase()));s.add(co,{description:"The owner of the package"});var po=r._default(r.enum(["development","staging","production"]).check(r.trim(),r.toLowerCase()),"production");s.add(po,{description:"The current runtime environment mode for the package"});var lo=r.string().check(r.trim(),r.toLowerCase());s.add(lo,{description:"The root directory of the workspace"});var mo=r._default(r.boolean(),false);s.add(mo,{description:"Should all known types of workspace caching be skipped?"});var go=r._default(r.enum(["npm","yarn","pnpm","bun"]),"npm");s.add(go,{description:"The JavaScript/TypeScript package manager used by the repository"});var uo=r._default(r.string().check(r.trim()),"America/New_York");s.add(uo,{description:"The default timezone of the workspace"});var fo=r._default(r.string().check(r.trim()),"en-US");s.add(fo,{description:"The default locale of the workspace"});var ho=r._default(r.enum(["silent","fatal","error","warn","success","info","debug","trace","all"]),"info");s.add(ho,{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._default(r.boolean(),true);s.add(To,{description:"Should the logging of the current Storm Workspace configuration be skipped?"});var Co=r._default(r.nullable(r.string().check(r.trim())),null);s.add(Co,{description:"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."});var Q=r._default(r.record(r.string(),r.any()),{});s.add(Q,{description:"Configuration of each used extension"});var Eo=r.object({$schema:Ye,extends:ue,name:Ve,variant:Pe,namespace:Je,organization:Xe,repository:qe,license:Qe,homepage:eo,docs:oo,portal:ro,licensing:to,contact:so,support:no,branch:ao,preid:io,owner:co,bot:Te,release:ke,socials:ye,error:Fe,mode:po,workspaceRoot:lo,skipCache:mo,directories:Ge,packageManager:go,timezone:uo,locale:fo,logLevel:ho,skipConfigLogging:To,registry:me,configFile:Co,colors:r.union([q,ge]),extensions:Q});s.add(Q,{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."});var Ro=["dark","light","base","brand","alternate","accent","link","success","help","info","warning","danger","fatal","positive","negative"];async function So(e){let o=le,t,a,i,n,m,d=C(e);if(existsSync(join(d,"package.json"))){let k=await readFile(E(d,"package.json"),"utf8");if(k){let f=JSON.parse(k);f.name&&(i=f.name),f.namespace&&(n=f.namespace),f.repository&&(typeof f.repository=="string"?m=f.repository:f.repository.url&&(m=f.repository.url)),f.license&&(o=f.license),f.homepage&&(t=f.homepage),f.bugs&&(typeof f.bugs=="string"?a=f.bugs:f.bugs.url&&(a=f.bugs.url));}}return {workspaceRoot:d,name:i,namespace:n,repository:m,license:o,homepage:t,support:a}}function vo(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:N},e.homepage&&(e.error.url??=`${e.homepage}/errors`))),e}var Oo=async(e,o,t={})=>{let a=o||C(o),i=await Promise.all([loadConfig({cwd:a,packageJson:true,name:e,envName:e?.toUpperCase(),jitiOptions:{debug:false,fsCache:process.env.STORM_SKIP_CACHE==="true"?false:E(process.env.STORM_CACHE_DIR||"node_modules/.cache/storm","jiti")},...t}),loadConfig({cwd:a,packageJson:true,name:e,envName:e?.toUpperCase(),jitiOptions:{debug:false,fsCache:process.env.STORM_SKIP_CACHE==="true"?false:E(process.env.STORM_CACHE_DIR||"node_modules/.cache/storm","jiti")},configFile:e,...t})]);return Ao(i[0]??{},i[1]??{})},Lo=async(e,o=[])=>{let t=e||C(e),a=await Oo("storm-workspace",t),i=a.config,n=a.configFile;if(i&&n&&Object.keys(i).length>0&&!i.skipConfigLogging&&A(`Found Storm configuration file "${n.includes(`${t}/`)?n.replace(`${t}/`,""):n}" at "${t}"`,{logLevel:"all"}),o&&o.length>0){let m=await Promise.all(o.map(d=>Oo(d,t)));for(let d of m)d?.config&&d?.configFile&&Object.keys(d.config).length>0&&(!i.skipConfigLogging&&!d.config.skipConfigLogging&&A(`Found alternative configuration file "${d.configFile.includes(`${t}/`)?d.configFile.replace(`${t}/`,""):d.configFile}" at "${t}"`,{logLevel:"all"}),i=Ao(d.config??{},i??{}));}if(!(!i||Object.keys(i).length===0))return i.configFile=n,i};var yo=()=>{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`]?p(process.env[`${e}WORKSPACE_CONFIG_FILE`]):void 0,workspaceRoot:process.env[`${e}WORKSPACE_ROOT`]?p(process.env[`${e}WORKSPACE_ROOT`]):void 0,directories:{cache:process.env[`${e}CACHE_DIR`]?p(process.env[`${e}CACHE_DIR`]):process.env[`${e}CACHE_DIRECTORY`]?p(process.env[`${e}CACHE_DIRECTORY`]):void 0,data:process.env[`${e}DATA_DIR`]?p(process.env[`${e}DATA_DIR`]):process.env[`${e}DATA_DIRECTORY`]?p(process.env[`${e}DATA_DIRECTORY`]):void 0,config:process.env[`${e}CONFIG_DIR`]?p(process.env[`${e}CONFIG_DIR`]):process.env[`${e}CONFIG_DIRECTORY`]?p(process.env[`${e}CONFIG_DIRECTORY`]):void 0,temp:process.env[`${e}TEMP_DIR`]?p(process.env[`${e}TEMP_DIR`]):process.env[`${e}TEMP_DIRECTORY`]?p(process.env[`${e}TEMP_DIRECTORY`]):void 0,log:process.env[`${e}LOG_DIR`]?p(process.env[`${e}LOG_DIR`]):process.env[`${e}LOG_DIRECTORY`]?p(process.env[`${e}LOG_DIRECTORY`]):void 0,build:process.env[`${e}BUILD_DIR`]?p(process.env[`${e}BUILD_DIR`]):process.env[`${e}BUILD_DIRECTORY`]?p(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},t=Object.keys(process.env).filter(i=>i.startsWith(`${e}COLOR_`)&&Ro.every(n=>!i.startsWith(`${e}COLOR_LIGHT_${n}`)&&!i.startsWith(`${e}COLOR_DARK_${n}`)));o.colors=t.length>0?t.reduce((i,n)=>(i[n]=$o(e,n),i),{}):$o(e),o.docs===ce&&(o.homepage===_?o.docs=`${_}/projects/${o.name}/docs`:o.docs=`${o.homepage}/docs`),o.licensing===pe&&(o.homepage===_?o.licensing=`${_}/projects/${o.name}/licensing`:o.licensing=`${o.homepage}/docs`);let a=process.env[`${e}WORKSPACE_CONFIG`];if(a){let i=JSON.parse(a);o={...o,...i,colors:{...o.colors,...i.colors},extensions:{...o.extensions,...i.extensions}};}return o},$o=(e,o)=>{let t=`COLOR_${o&&o!=="base"?`${o}_`:""}`.toUpperCase();return process.env[`${e}${t}LIGHT_BRAND`]||process.env[`${e}${t}DARK_BRAND`]?cr(e+t):ir(e+t)},ir=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`],help:process.env[`${e}HELP`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}},cr=e=>({light:_o(`${e}_LIGHT_`),dark:_o(`${e}_DARK_`)}),_o=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`],help:process.env[`${e}HELP`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}};var pr=(e,o)=>{for(let t of Object.keys(o??{}))if(o[t]){let a=t?.replace(/([A-Z])+/g,n=>n?n[0]?.toUpperCase()+n.slice(1):"").split(/(?=[A-Z])|[.\-\s_]/).map(n=>n.toLowerCase())??[],i;if(a.length===0)return;a.length===1?i=a[0]?.toUpperCase()??"":i=a.reduce((n,m)=>`${n}_${m.toLowerCase()}`),process.env[`STORM_EXTENSION_${e.toUpperCase()}_${i.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`]=p(e.configFile)),e.workspaceRoot&&(process.env[`${o}WORKSPACE_ROOT`]=p(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT=p(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT_PATH=p(e.workspaceRoot)),e.directories&&(!e.skipCache&&e.directories.cache&&(process.env[`${o}CACHE_DIR`]=p(e.directories.cache),process.env[`${o}CACHE_DIRECTORY`]=process.env[`${o}CACHE_DIR`]),e.directories.data&&(process.env[`${o}DATA_DIR`]=p(e.directories.data),process.env[`${o}DATA_DIRECTORY`]=process.env[`${o}DATA_DIR`]),e.directories.config&&(process.env[`${o}CONFIG_DIR`]=p(e.directories.config),process.env[`${o}CONFIG_DIRECTORY`]=process.env[`${o}CONFIG_DIR`]),e.directories.temp&&(process.env[`${o}TEMP_DIR`]=p(e.directories.temp),process.env[`${o}TEMP_DIRECTORY`]=process.env[`${o}TEMP_DIR`]),e.directories.log&&(process.env[`${o}LOG_DIR`]=p(e.directories.log),process.env[`${o}LOG_DIRECTORY`]=process.env[`${o}LOG_DIR`]),e.directories.build&&(process.env[`${o}BUILD_DIR`]=p(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))No(`${o}COLOR_${t}_`,e.colors[t]);else No(`${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(L(e.logLevel)>=c.DEBUG),process.env.RUST_BACKTRACE=L(e.logLevel)>=c.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])&&pr(t,e.extensions[t]);},No=(e,o)=>o?.light?.brand||o?.dark?.brand?dr(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.help&&(process.env[`${e}HELP`]=o.help),o.success&&(process.env[`${e}SUCCESS`]=o.success),o.info&&(process.env[`${e}INFO`]=o.info),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.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];},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.help&&(process.env[`${e}HELP`]=o.help),o.success&&(process.env[`${e}SUCCESS`]=o.success),o.info&&(process.env[`${e}INFO`]=o.info),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.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,a=false,i=true)=>{let n;if(!I?.data||!I?.timestamp||I.timestamp<Date.now()-8e3){let m=t;m||(m=C());let d=yo(),k=await Lo(m);if(!k&&(a||se("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"}),i===false))return;let f=await So(m),y=Ao(d,k,f);y.variant||(y.variant=existsSync(E(m,"nx.json"))||existsSync(E(m,".nx"))||existsSync(E(m,"lerna.json"))||existsSync(E(m,"turbo.json"))?"monorepo":"minimal");try{n=vo(await Eo.parseAsync(y)),n.workspaceRoot??=m;}catch(Y){throw new Error(`Failed to parse Storm Workspace configuration${Y?.message?`: ${Y.message}`:""}
|
|
25
|
+
|
|
26
|
+
Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${T(y)}`,{cause:Y})}}else n=I.data;return I={timestamp:Date.now(),data:n},n},xo=async(e,o=false)=>{let t=await gr(void 0,void 0,e,o,true);return zo(t),!o&&!t.skipConfigLogging&&A(`\u2699\uFE0F Using Storm Workspace configuration:
|
|
27
|
+
${T(t)}`,t),t};var fr=(e,o=false)=>xo(e,o),bo=(e=true,o={})=>{let t=o.workspaceRoot;return t||(t=C(o.cwd)),fr(t,e)};function Do(e=C(process.cwd())){let o=E(e,"pnpm-workspace.yaml");if(!existsSync(o))throw new Error(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${o}).`);return o}async function hs(e=C(process.cwd())){let o=await readFile(Do(e),"utf8");if(o)return parse(o)}async function Ts(e,o=C(process.cwd())){let t=await bo(),a=stringify(e);A(`Writing updated pnpm-workspace.yaml file to workspace root: ${a}`,t),await writeFile(Do(o),a);}export{se as a,Hr as b,A as c,E as d,C as e,bo as f,Do as g,hs as h,Ts as i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkXDFF7DBD_cjs=require('./chunk-XDFF7DBD.cjs'),child_process=require('child_process'),semver=require('semver');var E="latest";var l=E;async function d(){return new Promise((r,t)=>{child_process.exec("npm config get registry",(e,n,i)=>e?t(e):i?t(i):r(n.trim()));})}async function P(r,t=l,e={}){let{registry:n=await d()}=e;return new Promise((i,g)=>{child_process.exec(`npm view ${r} version --registry=${n} --tag=${t}`,(s,o,f)=>s?g(s):f?g(f):i(o.trim()));})}async function M(r=chunkXDFF7DBD_cjs.e(process.cwd())){let t=await chunkXDFF7DBD_cjs.h(r);if(!t)throw new Error("No pnpm-workspace.yaml file found");if(t?.catalog)return Object.fromEntries(Object.entries(t.catalog).map(([e,n])=>[e,n.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in pnpm-workspace.yaml file located in workspace root: ${r}
|
|
2
|
+
File content: ${JSON.stringify(t,null,2)}`);}async function $(r=chunkXDFF7DBD_cjs.e(process.cwd())){let t=await M(r);if(!t)throw new Error("No catalog entries found in pnpm-workspace.yaml file");return t}async function I(r,t=chunkXDFF7DBD_cjs.e(process.cwd())){let e=await chunkXDFF7DBD_cjs.h(t);if(!e)throw new Error("No pnpm-workspace.yaml file found");e.catalog=Object.fromEntries(Object.entries(r).map(([n,i])=>[n,i.replaceAll('"',"").replaceAll("'","")])),await chunkXDFF7DBD_cjs.i(e,t);}async function Q(r,t={}){let{tag:e=l,prefix:n="^",throwIfMissingInCatalog:i=false,workspaceRoot:g=chunkXDFF7DBD_cjs.e()}=t,s=await chunkXDFF7DBD_cjs.f(true,{workspaceRoot:g}),o=await $(g);if(!o)throw new Error("No catalog found");if(i===true&&!o[r])throw new Error(`Package "${r}" not found in catalog: ${JSON.stringify(o,null,2)}`);chunkXDFF7DBD_cjs.c(`Upgrading catalog entry for package "${r}" with tag "${e}"`,s);let f=await P(r,e),a=`${n||""}${f.replace(/^[\^~><=*]+/,"")}`;a===o[r]?chunkXDFF7DBD_cjs.c(`The version for package "${r}" is already up to date in the catalog: ${a}`,s):!semver.valid(semver.coerce(o[r]))||semver.coerce(o[r])&&semver.coerce(a)&&semver.gt(semver.coerce(a),semver.coerce(o[r]))?(o[r]=`${n||""}${a}`,chunkXDFF7DBD_cjs.b(`Writing version ${a} to catalog for "${r}" package`,s),await I(o,g)):chunkXDFF7DBD_cjs.a(`The current version "${o[r]}" for package "${r}" is greater than or equal to the version "${a}" fetched from the npm registry with tag "${e}". No update performed.`,s);}exports.a=M;exports.b=$;exports.c=I;exports.d=Q;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {e,h,i,f,c,b,a}from'./chunk-JGJEVC4U.js';import {exec}from'node:child_process';import {valid,coerce,gt}from'semver';var d="latest";var l=d;async function P(){return new Promise((r,t)=>{exec("npm config get registry",(e,n,i)=>e?t(e):i?t(i):r(n.trim()));})}async function A(r,t=l,e={}){let{registry:n=await P()}=e;return new Promise((i,g)=>{exec(`npm view ${r} version --registry=${n} --tag=${t}`,(s,o,f)=>s?g(s):f?g(f):i(o.trim()));})}async function $(r=e(process.cwd())){let t=await h(r);if(!t)throw new Error("No pnpm-workspace.yaml file found");if(t?.catalog)return Object.fromEntries(Object.entries(t.catalog).map(([e,n])=>[e,n.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in pnpm-workspace.yaml file located in workspace root: ${r}
|
|
2
|
+
File content: ${JSON.stringify(t,null,2)}`);}async function I(r=e(process.cwd())){let t=await $(r);if(!t)throw new Error("No catalog entries found in pnpm-workspace.yaml file");return t}async function O(r,t=e(process.cwd())){let e=await h(t);if(!e)throw new Error("No pnpm-workspace.yaml file found");e.catalog=Object.fromEntries(Object.entries(r).map(([n,i])=>[n,i.replaceAll('"',"").replaceAll("'","")])),await i(e,t);}async function Z(r,t={}){let{tag:e$1=l,prefix:n="^",throwIfMissingInCatalog:i=false,workspaceRoot:g=e()}=t,s=await f(true,{workspaceRoot:g}),o=await I(g);if(!o)throw new Error("No catalog found");if(i===true&&!o[r])throw new Error(`Package "${r}" not found in catalog: ${JSON.stringify(o,null,2)}`);c(`Upgrading catalog entry for package "${r}" with tag "${e$1}"`,s);let f$1=await A(r,e$1),a$1=`${n||""}${f$1.replace(/^[\^~><=*]+/,"")}`;a$1===o[r]?c(`The version for package "${r}" is already up to date in the catalog: ${a$1}`,s):!valid(coerce(o[r]))||coerce(o[r])&&coerce(a$1)&>(coerce(a$1),coerce(o[r]))?(o[r]=`${n||""}${a$1}`,b(`Writing version ${a$1} to catalog for "${r}" package`,s),await O(o,g)):a(`The current version "${o[r]}" for package "${r}" is greater than or equal to the version "${a$1}" fetched from the npm registry with tag "${e$1}". No update performed.`,s);}export{$ as a,I as b,O as c,Z as d};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';var c12=require('c12'),Oo=require('defu'),Do=require('chalk'),fs$1=require('fs'),path=require('path'),r=require('zod/mini'),promises=require('fs/promises'),yaml=require('yaml');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 Oo__default=/*#__PURE__*/_interopDefault(Oo);var Do__default=/*#__PURE__*/_interopDefault(Do);var r__namespace=/*#__PURE__*/_interopNamespace(r);var c={SILENT:0,FATAL:10,ERROR:20,WARN:30,SUCCESS:35,INFO:40,DEBUG:60,TRACE:70,ALL:100},l={SILENT:"silent",FATAL:"fatal",ERROR:"error",WARN:"warn",SUCCESS:"success",INFO:"info",DEBUG:"debug",TRACE:"trace",ALL:"all"};var E={dark:{brand:"#2dd4bf",success:"#10b981",info:"#58a6ff",warning:"#f3d371",danger:"#D8314A",fatal:"#a40e26"}};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}},ee=()=>{let e=Do__default.default;return (!e?.hex||!e?.bold?.hex||!e?.bgHex||!e?.whiteBright||!e?.white)&&(e=Go),e};function oe(){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 k=(e,o)=>oe()?e:o,R={[l.ERROR]:k("\u2718","\xD7"),[l.FATAL]:k("\u{1F480}","\xD7"),[l.WARN]:k("\u26A0","\u203C"),[l.INFO]:k("\u2139","i"),[l.SUCCESS]:k("\u2714","\u221A"),[l.DEBUG]:k("\u{1F6E0}","D"),[l.TRACE]:k("\u{1F6E0}","T"),[l.ALL]:k("\u2709","\u2192")};var S=(e=new Date)=>`${e.toLocaleDateString()} ${e.toLocaleTimeString()}`;var A=e=>{switch(e){case "all":return c.ALL;case "trace":return c.TRACE;case "debug":return c.DEBUG;case "info":return c.INFO;case "warn":return c.WARN;case "error":return c.ERROR;case "fatal":return c.FATAL;case "silent":return c.SILENT;default:return c.INFO}},re=(e=c.INFO)=>e>=c.ALL?l.ALL:e>=c.TRACE?l.TRACE:e>=c.DEBUG?l.DEBUG:e>=c.INFO?l.INFO:e>=c.WARN?l.WARN:e>=c.ERROR?l.ERROR:e>=c.FATAL?l.FATAL:e<=c.SILENT?l.SILENT:l.INFO;var Y=(e=c.INFO,o={},t=ee())=>{let a=!o.colors?.dark&&!o.colors?.base&&!o.colors?.base?.dark?E: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:E,i=o.logLevel||process.env.STORM_LOG_LEVEL||l.INFO;return e>A(i)||e<=c.SILENT||A(i)<=c.SILENT?n=>{}:typeof e=="number"&&c.FATAL>=e?n=>{console.error(`
|
|
2
|
+
${t.gray(S())} ${t.hex(a.fatal??E.dark.fatal)(`[${R[l.FATAL]} Fatal] `)}${t.bold.whiteBright(h(n))}
|
|
3
|
+
`);}:typeof e=="number"&&c.ERROR>=e?n=>{console.error(`
|
|
4
|
+
${t.gray(S())} ${t.hex(a.danger??E.dark.danger)(`[${R[l.ERROR]} Error] `)}${t.bold.whiteBright(h(n))}
|
|
5
|
+
`);}:typeof e=="number"&&c.WARN>=e?n=>{console.warn(`
|
|
6
|
+
${t.gray(S())} ${t.hex(a.warning??E.dark.warning)(`[${R[l.WARN]} Warn] `)}${t.bold.whiteBright(h(n))}
|
|
7
|
+
`);}:typeof e=="number"&&c.SUCCESS>=e?n=>{console.info(`
|
|
8
|
+
${t.gray(S())} ${t.hex(a.success??E.dark.success)(`[${R[l.SUCCESS]} Success] `)}${t.bold.whiteBright(h(n))}
|
|
9
|
+
`);}:typeof e=="number"&&c.INFO>=e?n=>{console.info(`
|
|
10
|
+
${t.gray(S())} ${t.hex(a.info??E.dark.info)(`[${R[l.INFO]} Info] `)}${t.bold.whiteBright(h(n))}
|
|
11
|
+
`);}:typeof e=="number"&&c.DEBUG>=e?n=>{console.debug(`
|
|
12
|
+
${t.gray(S())} ${t.hex(a.info??E.dark.info)(`[${R[l.DEBUG]} Debug] `)}${t.bold.whiteBright(h(n))}
|
|
13
|
+
`);}:typeof e=="number"&&c.TRACE>=e?n=>{console.debug(`
|
|
14
|
+
${t.gray(S())} ${t.hex(a.info??E.dark.info)(`[${R[l.TRACE]} Trace] `)}${t.bold.whiteBright(h(n))}
|
|
15
|
+
`);}:n=>{console.log(`
|
|
16
|
+
${t.gray(S())} ${t.hex(a.brand??E.dark.brand)(`[${R[l.ALL]} System] `)}${t.bold.whiteBright(h(n))}
|
|
17
|
+
`);}};var te=(e,o)=>Y(c.WARN,o)(e);var Br=(e,o)=>Y(c.DEBUG,o)(e),O=(e,o)=>Y(c.TRACE,o)(e);var Po=4,h=(e,o={},t=0)=>{if(t>Po)return "<max depth>";let a=o.prefix??"-",i=o.skip??[];return typeof e>"u"||e===null||!e&&typeof e!="boolean"?"<none>":typeof e=="string"?e:Array.isArray(e)?`
|
|
18
|
+
${e.map((n,m)=>` ${a}> #${m} = ${h(n,{prefix:`${a}-`,skip:i},t+1)}`).join(`
|
|
19
|
+
`)}`:typeof e=="object"?`
|
|
20
|
+
${Object.keys(e).filter(n=>!i.includes(n)).map(n=>` ${a}> ${n} = ${Wo(e[n])?"<function>":typeof e[n]=="object"?h(e[n],{prefix:`${a}-`,skip:i},t+1):e[n]}`).join(`
|
|
21
|
+
`)}`:e},Wo=e=>{try{return e instanceof Function||typeof e=="function"||!!(e?.constructor&&e?.call&&e?.apply)}catch{return false}};var Mo=/^[A-Za-z]:\//;function Fo(e=""){return e&&e.replace(/\\/g,"/").replace(Mo,o=>o.toUpperCase())}var Uo=/^[/\\]{2}/,jo=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Bo=/^[A-Za-z]:$/;var p=function(e){if(!e||e.length===0)return ".";e=Fo(e);let o=e?.match(Uo),t=se(e),a=e[e.length-1]==="/";return e=Ho(e,!t),e.length===0?t?"/":a?"./":".":(a&&(e+="/"),Bo.test(e)&&(e+="/"),o?t?`//${e}`:`//./${e}`:t&&!se(e)?`/${e}`:e)},C=function(...e){let o="";for(let t of e)if(t)if(o.length>0){let a=o[o.length-1]==="/",i=t[0]==="/";a&&i?o+=t.slice(1):o+=a||i?t:`/${t}`;}else o+=t;return p(o)};function Ho(e,o){let t="",a=0,i=-1,n=0,m=null;for(let d=0;d<=e.length;++d){if(d<e.length)m=e[d];else {if(m==="/")break;m="/";}if(m==="/"){if(!(i===d-1||n===1))if(n===2){if(t.length<2||a!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let v=t.lastIndexOf("/");v===-1?(t="",a=0):(t=t.slice(0,v),a=t.length-1-t.lastIndexOf("/")),i=d,n=0;continue}else if(t.length>0){t="",a=0,i=d,n=0;continue}}o&&(t+=t.length>0?"/..":"..",a=2);}else t.length>0?t+=`/${e.slice(i+1,d)}`:t=e.slice(i+1,d),a=d-i-1;i=d,n=0;}else m==="."&&n!==-1?++n:n=-1;}return t}var se=function(e){return jo.test(e)};var Ko=30,Zo=0;function J(e,o=[],t=[]){let a=e??process.cwd();if(t.some(i=>fs$1.existsSync(path.join(a,i)))||o.some(i=>fs$1.existsSync(path.join(a,i))))return a;if(a!=="/"&&Zo++<Ko){let i=path.join(a,"..");return J(i,o,t)}}var ae=["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"],Yo=[".storm-workspace",".nx",".git",".github",".vscode",".verdaccio"];function Vo(e){return process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH?p(process.env.STORM_WORKSPACE_ROOT??process.env.NX_WORKSPACE_ROOT_PATH):p(J(e??process.cwd(),ae,Yo))}function T(e){let o=Vo(e);if(!o)throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
|
|
22
|
+
${ae.join(`
|
|
23
|
+
`)}
|
|
24
|
+
Path: ${e||process.cwd()}`);return o}var ie="https://docs.stormsoftware.com",$="https://stormsoftware.com";var ce="https://stormsoftware.com/license",pe="Apache-2.0";var y="tools/errors/codes.json",le="The workspace's banner image";var s=r__namespace.registry(),f=r__namespace.string().check(r__namespace.length(7),r__namespace.toLowerCase(),r__namespace.regex(/^#([0-9a-f]{3}){1,2}$/i),r__namespace.trim());s.add(f,{description:"A base schema for describing the format of colors"});var N=r__namespace._default(f,"#151718");s.add(N,{description:"The dark background color of the workspace"});var w=r__namespace._default(f,"#cbd5e1");s.add(w,{description:"The light background color of the workspace"});var z=r__namespace._default(f,"#1fb2a6");s.add(z,{description:"The primary brand specific color of the workspace"});var x=r__namespace.optional(f);s.add(x,{description:"The alternate brand specific color of the workspace"});var b=r__namespace.optional(f);s.add(b,{description:"The secondary brand specific color of the workspace"});var D=r__namespace._default(f,"#3fa6ff");s.add(D,{description:"The color used to display hyperlink text"});var G=r__namespace._default(f,"#818cf8");s.add(G,{description:"The second brand specific color of the workspace"});var P=r__namespace._default(f,"#45b27e");s.add(P,{description:"The success color of the workspace"});var W=r__namespace._default(f,"#38bdf8");s.add(W,{description:"The informational color of the workspace"});var M=r__namespace._default(f,"#f3d371");s.add(M,{description:"The warning color of the workspace"});var F=r__namespace._default(f,"#d8314a");s.add(F,{description:"The danger color of the workspace"});var U=r__namespace.optional(f);s.add(U,{description:"The fatal color of the workspace"});var j=r__namespace._default(f,"#4ade80");s.add(j,{description:"The positive number color of the workspace"});var B=r__namespace._default(f,"#ef4444");s.add(B,{description:"The negative number color of the workspace"});var H=r__namespace.optional(r__namespace.array(f));s.add(H,{description:"The color stops for the base gradient color pattern used in the workspace"});var Qo=r__namespace.object({foreground:w,background:N,brand:z,alternate:x,accent:b,link:D,help:G,success:P,info:W,warning:M,danger:F,fatal:U,positive:j,negative:B,gradient:H}),er=r__namespace.object({foreground:N,background:w,brand:z,alternate:x,accent:b,link:D,help:G,success:P,info:W,warning:M,danger:F,fatal:U,positive:j,negative:B,gradient:H}),or=r__namespace.object({dark:Qo,light:er}),rr=r__namespace.object({dark:N,light:w,brand:z,alternate:x,accent:b,link:D,help:G,success:P,info:W,warning:M,danger:F,fatal:U,positive:j,negative:B,gradient:H}),L=r__namespace.optional(r__namespace.url());s.add(L,{description:"A remote registry URL used to publish distributable packages"});var de=r__namespace._default(r__namespace.object({github:L,npm:L,cargo:L,cyclone:L,container:L}),{});s.add(de,{description:"A list of remote registry URLs used by Storm Software"});var X=r__namespace.union([rr,or]);s.add(X,{description:"Colors used for various workspace elements"});var me=r__namespace.record(r__namespace.union([r__namespace.union([r__namespace.literal("base"),r__namespace.string()]),r__namespace.string()]),X);s.add(me,{description:"Storm theme config values used for styling various package elements"});var ge=r__namespace.optional(r__namespace.union([r__namespace.string().check(r__namespace.trim()),r__namespace.array(r__namespace.string().check(r__namespace.trim()))]));s.add(ge,{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 ue=r__namespace.string().check(r__namespace.trim());s.add(ue,{description:"The workspace bot user's name (this is the bot that will be used to perform various tasks)"});var fe=r__namespace.string().check(r__namespace.trim());s.add(fe,{description:"The email of the workspace bot"});var he=r__namespace.object({name:ue,email:fe});s.add(he,{description:"The workspace's bot user's config used to automated various operations tasks"});var Te=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.url()));s.add(Te,{description:"A URL to a banner image used to display the workspace's release"});var Ce=r__namespace._default(r__namespace.string().check(r__namespace.trim()),le);s.add(Ce,{description:"The alt text for the workspace's release banner image"});var Ee=r__namespace.object({url:Te,alt:Ce});s.add(Ee,{description:"The workspace's banner image used during the release process"});var Re=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Re,{description:"A header message appended to the start of the workspace's release notes"});var Se=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Se,{description:"A footer message appended to the end of the workspace's release notes"});var ve=r__namespace.object({banner:r__namespace.union([Ee,r__namespace.string().check(r__namespace.trim(),r__namespace.url())]),header:Re,footer:Se});s.add(ve,{description:"The workspace's release config used during the release process"});var ke=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(ke,{description:"A Twitter/X account associated with the organization/project"});var Oe=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Oe,{description:"A Discord account associated with the organization/project"});var Ae=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Ae,{description:"A Telegram account associated with the organization/project"});var Le=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Le,{description:"A Slack account associated with the organization/project"});var $e=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add($e,{description:"A Medium account associated with the organization/project"});var _e=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(_e,{description:"A GitHub account associated with the organization/project"});var Ie=r__namespace.object({twitter:ke,discord:Oe,telegram:Ae,slack:Le,medium:$e,github:_e});s.add(Ie,{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()));s.add(ye,{description:"The directory used to store the environment's cached file data"});var Ne=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Ne,{description:"The directory used to store the environment's data files"});var we=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(we,{description:"The directory used to store the environment's configuration files"});var ze=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(ze,{description:"The directory used to store the environment's temp files"});var xe=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(xe,{description:"The directory used to store the environment's log files"});var be=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"dist");s.add(be,{description:"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"});var De=r__namespace.object({cache:ye,data:Ne,config:we,temp:ze,log:xe,build:be});s.add(De,{description:"Various directories used by the workspace to store data, cache, and configuration files"});var Ge=r__namespace._default(r__namespace.enum(["minimal","monorepo"]),"monorepo");s.add(Ge,{description:"The variant of the workspace. This can be used to enable or disable certain features or configurations."});var Pe=r__namespace._default(r__namespace.string().check(r__namespace.trim()),y);s.add(Pe,{description:"The path to the workspace's error codes JSON file"});var We=r__namespace.optional(r__namespace.url());s.add(We,{description:"A URL to a page that looks up the workspace's error messages given a specific error code"});var Me=r__namespace.object({codesFile:Pe,url:We});s.add(Me,{description:"The workspace's error config used when creating error details during a system error"});var Fe=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));s.add(Fe,{description:"The name of the organization"});var Ue=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Ue,{description:"A description of the organization"});var je=r__namespace.optional(r__namespace.url());s.add(je,{description:"A URL to the organization's logo image"});var Be=r__namespace.optional(r__namespace.url());s.add(Be,{description:"A URL to the organization's icon image"});var He=r__namespace.optional(r__namespace.url());s.add(He,{description:"A URL to a page that provides more information about the organization"});var Ke=r__namespace.object({name:Fe,description:Ue,logo:je,icon:Be,url:He});s.add(Ke,{description:"The workspace's organization details"});var Ze=r__namespace._default(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()),"https://public.storm-cdn.com/schemas/storm-workspace.schema.json");s.add(Ze,{description:"The URL or file path to the JSON schema file that describes the Storm configuration file"});var Ye=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(Ye,{description:"The name of the workspace/project/service/package/scope using this configuration"});var Ve=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(Ve,{description:"The namespace of the workspace/project/service/package/scope using this configuration"});var Je=r__namespace.union([Ke,r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase())]);s.add(Je,{description:"The organization of the workspace. This can be a string or an object containing the organization's details"});var Xe=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(Xe,{description:"The repo URL of the workspace (i.e. the GitHub repository URL)"});var qe=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"Apache-2.0");s.add(qe,{description:"The license type of the package"});var Qe=r__namespace.optional(r__namespace.url());s.add(Qe,{description:"The homepage of the workspace"});var eo=r__namespace.optional(r__namespace.url());s.add(eo,{description:"The documentation site for the workspace"});var oo=r__namespace.optional(r__namespace.url());s.add(oo,{description:"The development portal site for the workspace"});var ro=r__namespace.optional(r__namespace.url());s.add(ro,{description:"The licensing site for the workspace"});var to=r__namespace.optional(r__namespace.url());s.add(to,{description:"The contact site for the workspace"});var so=r__namespace.optional(r__namespace.url());s.add(so,{description:"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"});var no=r__namespace._default(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()),"main");s.add(no,{description:"The branch of the workspace"});var ao=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));s.add(ao,{description:"A tag specifying the version pre-release identifier"});var io=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));s.add(io,{description:"The owner of the package"});var co=r__namespace._default(r__namespace.enum(["development","staging","production"]).check(r__namespace.trim(),r__namespace.toLowerCase()),"production");s.add(co,{description:"The current runtime environment mode for the package"});var po=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(po,{description:"The root directory of the workspace"});var lo=r__namespace._default(r__namespace.boolean(),false);s.add(lo,{description:"Should all known types of workspace caching be skipped?"});var mo=r__namespace._default(r__namespace.enum(["npm","yarn","pnpm","bun"]),"npm");s.add(mo,{description:"The JavaScript/TypeScript package manager used by the repository"});var go=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"America/New_York");s.add(go,{description:"The default timezone of the workspace"});var uo=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"en-US");s.add(uo,{description:"The default locale of the workspace"});var fo=r__namespace._default(r__namespace.enum(["silent","fatal","error","warn","success","info","debug","trace","all"]),"info");s.add(fo,{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 ho=r__namespace._default(r__namespace.boolean(),true);s.add(ho,{description:"Should the logging of the current Storm Workspace configuration be skipped?"});var To=r__namespace._default(r__namespace.nullable(r__namespace.string().check(r__namespace.trim())),null);s.add(To,{description:"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."});var q=r__namespace._default(r__namespace.record(r__namespace.string(),r__namespace.any()),{});s.add(q,{description:"Configuration of each used extension"});var Co=r__namespace.object({$schema:Ze,extends:ge,name:Ye,variant:Ge,namespace:Ve,organization:Je,repository:Xe,license:qe,homepage:Qe,docs:eo,portal:oo,licensing:ro,contact:to,support:so,branch:no,preid:ao,owner:io,bot:he,release:ve,socials:Ie,error:Me,mode:co,workspaceRoot:po,skipCache:lo,directories:De,packageManager:mo,timezone:go,locale:uo,logLevel:fo,skipConfigLogging:ho,registry:de,configFile:To,colors:r__namespace.union([X,me]),extensions:q});s.add(q,{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."});var Eo=["dark","light","base","brand","alternate","accent","link","success","help","info","warning","danger","fatal","positive","negative"];async function Ro(e){let o=pe,t,a,i,n,m,d=T(e);if(fs$1.existsSync(path.join(d,"package.json"))){let v=await promises.readFile(C(d,"package.json"),"utf8");if(v){let u=JSON.parse(v);u.name&&(i=u.name),u.namespace&&(n=u.namespace),u.repository&&(typeof u.repository=="string"?m=u.repository:u.repository.url&&(m=u.repository.url)),u.license&&(o=u.license),u.homepage&&(t=u.homepage),u.bugs&&(typeof u.bugs=="string"?a=u.bugs:u.bugs.url&&(a=u.bugs.url));}}return {workspaceRoot:d,name:i,namespace:n,repository:m,license:o,homepage:t,support:a}}function So(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:y},e.homepage&&(e.error.url??=`${e.homepage}/errors`))),e}var ko=async(e,o,t={})=>{let a=o||T(o),i=await Promise.all([c12.loadConfig({cwd:a,packageJson:true,name:e,envName:e?.toUpperCase(),jitiOptions:{debug:false,fsCache:process.env.STORM_SKIP_CACHE==="true"?false:C(process.env.STORM_CACHE_DIR||"node_modules/.cache/storm","jiti")},...t}),c12.loadConfig({cwd:a,packageJson:true,name:e,envName:e?.toUpperCase(),jitiOptions:{debug:false,fsCache:process.env.STORM_SKIP_CACHE==="true"?false:C(process.env.STORM_CACHE_DIR||"node_modules/.cache/storm","jiti")},configFile:e,...t})]);return Oo__default.default(i[0]??{},i[1]??{})},Ao=async(e,o=[])=>{let t=e||T(e),a=await ko("storm-workspace",t),i=a.config,n=a.configFile;if(i&&n&&Object.keys(i).length>0&&!i.skipConfigLogging&&O(`Found Storm configuration file "${n.includes(`${t}/`)?n.replace(`${t}/`,""):n}" at "${t}"`,{logLevel:"all"}),o&&o.length>0){let m=await Promise.all(o.map(d=>ko(d,t)));for(let d of m)d?.config&&d?.configFile&&Object.keys(d.config).length>0&&(!i.skipConfigLogging&&!d.config.skipConfigLogging&&O(`Found alternative configuration file "${d.configFile.includes(`${t}/`)?d.configFile.replace(`${t}/`,""):d.configFile}" at "${t}"`,{logLevel:"all"}),i=Oo__default.default(d.config??{},i??{}));}if(!(!i||Object.keys(i).length===0))return i.configFile=n,i};var Io=()=>{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`]?p(process.env[`${e}WORKSPACE_CONFIG_FILE`]):void 0,workspaceRoot:process.env[`${e}WORKSPACE_ROOT`]?p(process.env[`${e}WORKSPACE_ROOT`]):void 0,directories:{cache:process.env[`${e}CACHE_DIR`]?p(process.env[`${e}CACHE_DIR`]):process.env[`${e}CACHE_DIRECTORY`]?p(process.env[`${e}CACHE_DIRECTORY`]):void 0,data:process.env[`${e}DATA_DIR`]?p(process.env[`${e}DATA_DIR`]):process.env[`${e}DATA_DIRECTORY`]?p(process.env[`${e}DATA_DIRECTORY`]):void 0,config:process.env[`${e}CONFIG_DIR`]?p(process.env[`${e}CONFIG_DIR`]):process.env[`${e}CONFIG_DIRECTORY`]?p(process.env[`${e}CONFIG_DIRECTORY`]):void 0,temp:process.env[`${e}TEMP_DIR`]?p(process.env[`${e}TEMP_DIR`]):process.env[`${e}TEMP_DIRECTORY`]?p(process.env[`${e}TEMP_DIRECTORY`]):void 0,log:process.env[`${e}LOG_DIR`]?p(process.env[`${e}LOG_DIR`]):process.env[`${e}LOG_DIRECTORY`]?p(process.env[`${e}LOG_DIRECTORY`]):void 0,build:process.env[`${e}BUILD_DIR`]?p(process.env[`${e}BUILD_DIR`]):process.env[`${e}BUILD_DIRECTORY`]?p(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`]))?re(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(i=>i.startsWith(`${e}COLOR_`)&&Eo.every(n=>!i.startsWith(`${e}COLOR_LIGHT_${n}`)&&!i.startsWith(`${e}COLOR_DARK_${n}`)));o.colors=t.length>0?t.reduce((i,n)=>(i[n]=Lo(e,n),i),{}):Lo(e),o.docs===ie&&(o.homepage===$?o.docs=`${$}/projects/${o.name}/docs`:o.docs=`${o.homepage}/docs`),o.licensing===ce&&(o.homepage===$?o.licensing=`${$}/projects/${o.name}/licensing`:o.licensing=`${o.homepage}/docs`);let a=process.env[`${e}WORKSPACE_CONFIG`];if(a){let i=JSON.parse(a);o={...o,...i,colors:{...o.colors,...i.colors},extensions:{...o.extensions,...i.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`]?ir(e+t):ar(e+t)},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 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`],help:process.env[`${e}HELP`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}},ir=e=>({light:$o(`${e}_LIGHT_`),dark:$o(`${e}_DARK_`)}),$o=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`],help:process.env[`${e}HELP`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}};var cr=(e,o)=>{for(let t of Object.keys(o??{}))if(o[t]){let a=t?.replace(/([A-Z])+/g,n=>n?n[0]?.toUpperCase()+n.slice(1):"").split(/(?=[A-Z])|[.\-\s_]/).map(n=>n.toLowerCase())??[],i;if(a.length===0)return;a.length===1?i=a[0]?.toUpperCase()??"":i=a.reduce((n,m)=>`${n}_${m.toLowerCase()}`),process.env[`STORM_EXTENSION_${e.toUpperCase()}_${i.toUpperCase()}`]=o[t];}},wo=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`]=p(e.configFile)),e.workspaceRoot&&(process.env[`${o}WORKSPACE_ROOT`]=p(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT=p(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT_PATH=p(e.workspaceRoot)),e.directories&&(!e.skipCache&&e.directories.cache&&(process.env[`${o}CACHE_DIR`]=p(e.directories.cache),process.env[`${o}CACHE_DIRECTORY`]=process.env[`${o}CACHE_DIR`]),e.directories.data&&(process.env[`${o}DATA_DIR`]=p(e.directories.data),process.env[`${o}DATA_DIRECTORY`]=process.env[`${o}DATA_DIR`]),e.directories.config&&(process.env[`${o}CONFIG_DIR`]=p(e.directories.config),process.env[`${o}CONFIG_DIRECTORY`]=process.env[`${o}CONFIG_DIR`]),e.directories.temp&&(process.env[`${o}TEMP_DIR`]=p(e.directories.temp),process.env[`${o}TEMP_DIRECTORY`]=process.env[`${o}TEMP_DIR`]),e.directories.log&&(process.env[`${o}LOG_DIR`]=p(e.directories.log),process.env[`${o}LOG_DIRECTORY`]=process.env[`${o}LOG_DIR`]),e.directories.build&&(process.env[`${o}BUILD_DIR`]=p(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))yo(`${o}COLOR_${t}_`,e.colors[t]);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(A(e.logLevel)>=c.DEBUG),process.env.RUST_BACKTRACE=A(e.logLevel)>=c.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])&&cr(t,e.extensions[t]);},yo=(e,o)=>o?.light?.brand||o?.dark?.brand?lr(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.help&&(process.env[`${e}HELP`]=o.help),o.success&&(process.env[`${e}SUCCESS`]=o.success),o.info&&(process.env[`${e}INFO`]=o.info),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.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];},lr=(e,o)=>({light:No(`${e}LIGHT_`,o.light),dark:No(`${e}DARK_`,o.dark)}),No=(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.help&&(process.env[`${e}HELP`]=o.help),o.success&&(process.env[`${e}SUCCESS`]=o.success),o.info&&(process.env[`${e}INFO`]=o.info),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.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 _,mr=async(e,o,t,a=false,i=true)=>{let n;if(!_?.data||!_?.timestamp||_.timestamp<Date.now()-8e3){let m=t;m||(m=T());let d=Io(),v=await Ao(m);if(!v&&(a||te("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"}),i===false))return;let u=await Ro(m),I=Oo__default.default(d,v,u);I.variant||(I.variant=fs$1.existsSync(C(m,"nx.json"))||fs$1.existsSync(C(m,".nx"))||fs$1.existsSync(C(m,"lerna.json"))||fs$1.existsSync(C(m,"turbo.json"))?"monorepo":"minimal");try{n=So(await Co.parseAsync(I)),n.workspaceRoot??=m;}catch(Z){throw new Error(`Failed to parse Storm Workspace configuration${Z?.message?`: ${Z.message}`:""}
|
|
25
|
+
|
|
26
|
+
Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${h(I)}`,{cause:Z})}}else n=_.data;return _={timestamp:Date.now(),data:n},n},zo=async(e,o=false)=>{let t=await mr(void 0,void 0,e,o,true);return wo(t),!o&&!t.skipConfigLogging&&O(`\u2699\uFE0F Using Storm Workspace configuration:
|
|
27
|
+
${h(t)}`,t),t};var ur=(e,o=false)=>zo(e,o),xo=(e=true,o={})=>{let t=o.workspaceRoot;return t||(t=T(o.cwd)),ur(t,e)};function bo(e=T(process.cwd())){let o=C(e,"pnpm-workspace.yaml");if(!fs$1.existsSync(o))throw new Error(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${o}).`);return o}async function fs(e=T(process.cwd())){let o=await promises.readFile(bo(e),"utf8");if(o)return yaml.parse(o)}async function hs(e,o=T(process.cwd())){let t=await xo(),a=yaml.stringify(e);O(`Writing updated pnpm-workspace.yaml file to workspace root: ${a}`,t),await promises.writeFile(bo(o),a);}exports.a=te;exports.b=Br;exports.c=O;exports.d=C;exports.e=T;exports.f=xo;exports.g=bo;exports.h=fs;exports.i=hs;
|
package/dist/helpers/catalog.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkNM3PKH5T_cjs=require('../chunk-NM3PKH5T.cjs');require('../chunk-XDFF7DBD.cjs');Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkNM3PKH5T_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkNM3PKH5T_cjs.a}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkNM3PKH5T_cjs.c}});Object.defineProperty(exports,"upgradeCatalogPackage",{enumerable:true,get:function(){return chunkNM3PKH5T_cjs.d}});
|
package/dist/helpers/catalog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as getCatalog,a as getCatalogSafe,c as setCatalog,d as upgradeCatalogPackage}from'../chunk-
|
|
1
|
+
export{b as getCatalog,a as getCatalogSafe,c as setCatalog,d as upgradeCatalogPackage}from'../chunk-U7UAWKHA.js';import'../chunk-JGJEVC4U.js';
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';require('../chunk-QNTSKZUU.cjs');var
|
|
1
|
+
'use strict';require('../chunk-QNTSKZUU.cjs');var chunkEOY4SFRO_cjs=require('../chunk-EOY4SFRO.cjs'),chunkNM3PKH5T_cjs=require('../chunk-NM3PKH5T.cjs'),chunkXDFF7DBD_cjs=require('../chunk-XDFF7DBD.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkEOY4SFRO_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkNM3PKH5T_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkNM3PKH5T_cjs.a}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkNM3PKH5T_cjs.c}});Object.defineProperty(exports,"upgradeCatalogPackage",{enumerable:true,get:function(){return chunkNM3PKH5T_cjs.d}});Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkXDFF7DBD_cjs.g}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkXDFF7DBD_cjs.h}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkXDFF7DBD_cjs.i}});
|
package/dist/helpers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import'../chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'../chunk-
|
|
1
|
+
import'../chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'../chunk-E7QLQFQS.js';export{b as getCatalog,a as getCatalogSafe,c as setCatalog,d as upgradeCatalogPackage}from'../chunk-U7UAWKHA.js';export{g as getPnpmWorkspaceFilePath,h as readPnpmWorkspaceFile,i as writePnpmWorkspaceFile}from'../chunk-JGJEVC4U.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkXDFF7DBD_cjs=require('../chunk-XDFF7DBD.cjs');Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkXDFF7DBD_cjs.g}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkXDFF7DBD_cjs.h}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkXDFF7DBD_cjs.i}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{g as getPnpmWorkspaceFilePath,h as readPnpmWorkspaceFile,i as writePnpmWorkspaceFile}from'../chunk-JGJEVC4U.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkEOY4SFRO_cjs=require('../chunk-EOY4SFRO.cjs');require('../chunk-NM3PKH5T.cjs'),require('../chunk-XDFF7DBD.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkEOY4SFRO_cjs.a}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as replaceDepsAliases}from'../chunk-
|
|
1
|
+
export{a as replaceDepsAliases}from'../chunk-E7QLQFQS.js';import'../chunk-U7UAWKHA.js';import'../chunk-JGJEVC4U.js';
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';require('./chunk-SFZRYJZ2.cjs'),require('./chunk-QNTSKZUU.cjs');var
|
|
1
|
+
'use strict';require('./chunk-SFZRYJZ2.cjs'),require('./chunk-QNTSKZUU.cjs');var chunkEOY4SFRO_cjs=require('./chunk-EOY4SFRO.cjs'),chunkNM3PKH5T_cjs=require('./chunk-NM3PKH5T.cjs'),chunkXDFF7DBD_cjs=require('./chunk-XDFF7DBD.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkEOY4SFRO_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkNM3PKH5T_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkNM3PKH5T_cjs.a}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkNM3PKH5T_cjs.c}});Object.defineProperty(exports,"upgradeCatalogPackage",{enumerable:true,get:function(){return chunkNM3PKH5T_cjs.d}});Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkXDFF7DBD_cjs.g}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkXDFF7DBD_cjs.h}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkXDFF7DBD_cjs.i}});
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import'./chunk-GGNOJ77I.js';import'./chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'./chunk-
|
|
1
|
+
import'./chunk-GGNOJ77I.js';import'./chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'./chunk-E7QLQFQS.js';export{b as getCatalog,a as getCatalogSafe,c as setCatalog,d as upgradeCatalogPackage}from'./chunk-U7UAWKHA.js';export{g as getPnpmWorkspaceFilePath,h as readPnpmWorkspaceFile,i as writePnpmWorkspaceFile}from'./chunk-JGJEVC4U.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/pnpm-tools",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A set of [pnpm](https://pnpm.io/) plugins and utilities for managing workspace packages/dependencies.",
|
|
6
6
|
"repository": {
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@pnpm/plugin-better-defaults": "^0.2.1",
|
|
91
91
|
"@pnpm/plugin-esm-node-path": "^0.1.2",
|
|
92
|
-
"@storm-software/config": "^1.133.
|
|
93
|
-
"@storm-software/config-tools": "^1.187.
|
|
94
|
-
"@storm-software/npm-tools": "^0.4.
|
|
92
|
+
"@storm-software/config": "^1.133.2",
|
|
93
|
+
"@storm-software/config-tools": "^1.187.5",
|
|
94
|
+
"@storm-software/npm-tools": "^0.4.10",
|
|
95
95
|
"commander": "^12.1.0",
|
|
96
96
|
"defu": "6.1.4",
|
|
97
97
|
"prettier": "^3.5.1",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"tsup": "8.4.0"
|
|
106
106
|
},
|
|
107
107
|
"publishConfig": { "access": "public" },
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "b753d37ad9234874790ad66d2d94fff0c772a3c5"
|
|
109
109
|
}
|
package/dist/chunk-CZ7PAWK2.cjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
'use strict';var fs=require('fs'),path=require('path'),promises=require('fs/promises'),yaml=require('yaml');var y=/^[A-Za-z]:\//;function x(e=""){return e&&e.replace(/\\/g,"/").replace(y,n=>n.toUpperCase())}var _=/^[/\\]{2}/,P=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,R=/^[A-Za-z]:$/;var l=function(e){if(!e||e.length===0)return ".";e=x(e);let n=e?.match(_),t=g(e),o=e[e.length-1]==="/";return e=E(e,!t),e.length===0?t?"/":o?"./":".":(o&&(e+="/"),R.test(e)&&(e+="/"),n?t?`//${e}`:`//./${e}`:t&&!g(e)?`/${e}`:e)},d=function(...e){let n="";for(let t of e)if(t)if(n.length>0){let o=n[n.length-1]==="/",r=t[0]==="/";o&&r?n+=t.slice(1):n+=o||r?t:`/${t}`;}else n+=t;return l(n)};function E(e,n){let t="",o=0,r=-1,c=0,i=null;for(let s=0;s<=e.length;++s){if(s<e.length)i=e[s];else {if(i==="/")break;i="/";}if(i==="/"){if(!(r===s-1||c===1))if(c===2){if(t.length<2||o!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let u=t.lastIndexOf("/");u===-1?(t="",o=0):(t=t.slice(0,u),o=t.length-1-t.lastIndexOf("/")),r=s,c=0;continue}else if(t.length>0){t="",o=0,r=s,c=0;continue}}n&&(t+=t.length>0?"/..":"..",o=2);}else t.length>0?t+=`/${e.slice(r+1,s)}`:t=e.slice(r+1,s),o=s-r-1;r=s,c=0;}else i==="."&&c!==-1?++c:c=-1;}return t}var g=function(e){return P.test(e)};var j=30,A=0;function m(e,n=[],t=[]){let o=e??process.cwd();if(t.some(r=>fs.existsSync(path.join(o,r)))||n.some(r=>fs.existsSync(path.join(o,r))))return o;if(o!=="/"&&A++<j){let r=path.join(o,"..");return m(r,n,t)}}var h=["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"],O=[".storm-workspace",".nx",".git",".github",".vscode",".verdaccio"];function T(e){return process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH?l(process.env.STORM_WORKSPACE_ROOT??process.env.NX_WORKSPACE_ROOT_PATH):l(m(e??process.cwd(),h,O))}function a(e){let n=T(e);if(!n)throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
|
|
2
|
-
${h.join(`
|
|
3
|
-
`)}
|
|
4
|
-
Path: ${e||process.cwd()}`);return n}function w(e=a(process.cwd())){let n=d(e,"pnpm-workspace.yaml");if(!fs.existsSync(n))throw new Error(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${n}).`);return n}async function G(e=a(process.cwd())){let n=await promises.readFile(w(e),"utf8");if(n)return yaml.parse(n)}async function q(e,n=a(process.cwd())){await promises.writeFile(w(n),yaml.stringify(e));}exports.a=l;exports.b=d;exports.c=a;exports.d=w;exports.e=G;exports.f=q;
|
package/dist/chunk-IHDHOPTD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b as b$1}from'./chunk-IMQTDNZI.js';import {c,b}from'./chunk-LGDN3UHN.js';import {readCachedProjectGraph,createProjectGraphAsync}from'@nx/devkit';import {existsSync}from'node:fs';import {readFile,writeFile}from'node:fs/promises';import {format}from'prettier';async function $(c$1=process.cwd(),i=c(c$1)){let l=b(c$1,"package.json"),m=await readFile(l,"utf8");if(!m)throw new Error("No package.json file found in package root: "+c$1);let p=await b$1(i),r=JSON.parse(m),g=b(i,"pnpm-workspace.yaml");if(!existsSync(g))return console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${g}). Skipping pnpm catalog read for now.`),r;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!p)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`);let t=p[e];if(!t)throw new Error("Missing pnpm catalog version for "+e);o[e]=t;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let n;try{n=readCachedProjectGraph();}catch{await createProjectGraphAsync(),n=readCachedProjectGraph();}let d={};n&&await Promise.all(Object.keys(n.nodes).map(async a=>{let o=n.nodes[a];if(o?.data.root){let e=b(i,o.data.root,"package.json");if(existsSync(e)){let t=await readFile(e,"utf8"),f=JSON.parse(t);f.private!==true&&(d[f.name]=f.version);}}}));for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(d[e])o[e]=`^${d[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return writeFile(l,await format(JSON.stringify(r),{parser:"json",proseWrap:"always",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-pkg"]}))}export{$ as a};
|
package/dist/chunk-IMQTDNZI.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {c as c$1,e,f,b as b$1,a}from'./chunk-LGDN3UHN.js';import*as r from'zod/mini';import Oo from'defu';import {existsSync}from'node:fs';import {loadConfig}from'c12';import Yo from'chalk';import {readFile}from'node:fs/promises';import {join}from'node:path';import {exec}from'node:child_process';import {valid,coerce,gt}from'semver';var se="https://docs.stormsoftware.com",_="https://stormsoftware.com";var ne="https://stormsoftware.com/license",ae="Apache-2.0";var w="tools/errors/codes.json",ie="The workspace's banner image";var s=r.registry(),h=r.string().check(r.length(7),r.toLowerCase(),r.regex(/^#([0-9a-f]{3}){1,2}$/i),r.trim());s.add(h,{description:"A base schema for describing the format of colors"});var z=r._default(h,"#151718");s.add(z,{description:"The dark background color of the workspace"});var b=r._default(h,"#cbd5e1");s.add(b,{description:"The light background color of the workspace"});var x=r._default(h,"#1fb2a6");s.add(x,{description:"The primary brand specific color of the workspace"});var D=r.optional(h);s.add(D,{description:"The alternate brand specific color of the workspace"});var G=r.optional(h);s.add(G,{description:"The secondary brand specific color of the workspace"});var M=r._default(h,"#3fa6ff");s.add(M,{description:"The color used to display hyperlink text"});var P=r._default(h,"#818cf8");s.add(P,{description:"The second brand specific color of the workspace"});var F=r._default(h,"#45b27e");s.add(F,{description:"The success color of the workspace"});var U=r._default(h,"#38bdf8");s.add(U,{description:"The informational color of the workspace"});var W=r._default(h,"#f3d371");s.add(W,{description:"The warning color of the workspace"});var B=r._default(h,"#d8314a");s.add(B,{description:"The danger color of the workspace"});var j=r.optional(h);s.add(j,{description:"The fatal color of the workspace"});var H=r._default(h,"#4ade80");s.add(H,{description:"The positive number color of the workspace"});var Y=r._default(h,"#ef4444");s.add(Y,{description:"The negative number color of the workspace"});var V=r.optional(r.array(h));s.add(V,{description:"The color stops for the base gradient color pattern used in the workspace"});var Wo=r.object({foreground:b,background:z,brand:x,alternate:D,accent:G,link:M,help:P,success:F,info:U,warning:W,danger:B,fatal:j,positive:H,negative:Y,gradient:V}),Bo=r.object({foreground:z,background:b,brand:x,alternate:D,accent:G,link:M,help:P,success:F,info:U,warning:W,danger:B,fatal:j,positive:H,negative:Y,gradient:V}),jo=r.object({dark:Wo,light:Bo}),Ho=r.object({dark:z,light:b,brand:x,alternate:D,accent:G,link:M,help:P,success:F,info:U,warning:W,danger:B,fatal:j,positive:H,negative:Y,gradient:V}),L=r.optional(r.url());s.add(L,{description:"A remote registry URL used to publish distributable packages"});var ce=r._default(r.object({github:L,npm:L,cargo:L,cyclone:L,container:L}),{});s.add(ce,{description:"A list of remote registry URLs used by Storm Software"});var Q=r.union([Ho,jo]);s.add(Q,{description:"Colors used for various workspace elements"});var pe=r.record(r.union([r.union([r.literal("base"),r.string()]),r.string()]),Q);s.add(pe,{description:"Storm theme config values used for styling various package elements"});var de=r.optional(r.union([r.string().check(r.trim()),r.array(r.string().check(r.trim()))]));s.add(de,{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 le=r.string().check(r.trim());s.add(le,{description:"The workspace bot user's name (this is the bot that will be used to perform various tasks)"});var me=r.string().check(r.trim());s.add(me,{description:"The email of the workspace bot"});var ge=r.object({name:le,email:me});s.add(ge,{description:"The workspace's bot user's config used to automated various operations tasks"});var ue=r.optional(r.string().check(r.trim(),r.url()));s.add(ue,{description:"A URL to a banner image used to display the workspace's release"});var fe=r._default(r.string().check(r.trim()),ie);s.add(fe,{description:"The alt text for the workspace's release banner image"});var he=r.object({url:ue,alt:fe});s.add(he,{description:"The workspace's banner image used during the release process"});var Te=r.optional(r.string().check(r.trim()));s.add(Te,{description:"A header message appended to the start of the workspace's release notes"});var Ce=r.optional(r.string().check(r.trim()));s.add(Ce,{description:"A footer message appended to the end of the workspace's release notes"});var Ee=r.object({banner:r.union([he,r.string().check(r.trim(),r.url())]),header:Te,footer:Ce});s.add(Ee,{description:"The workspace's release config used during the release process"});var Re=r.optional(r.string().check(r.trim()));s.add(Re,{description:"A Twitter/X account associated with the organization/project"});var Se=r.optional(r.string().check(r.trim()));s.add(Se,{description:"A Discord account associated with the organization/project"});var ve=r.optional(r.string().check(r.trim()));s.add(ve,{description:"A Telegram account associated with the organization/project"});var Ae=r.optional(r.string().check(r.trim()));s.add(Ae,{description:"A Slack account associated with the organization/project"});var ke=r.optional(r.string().check(r.trim()));s.add(ke,{description:"A Medium account associated with the organization/project"});var Oe=r.optional(r.string().check(r.trim()));s.add(Oe,{description:"A GitHub account associated with the organization/project"});var Le=r.object({twitter:Re,discord:Se,telegram:ve,slack:Ae,medium:ke,github:Oe});s.add(Le,{description:"The workspace's account config used to store various social media links"});var $e=r.optional(r.string().check(r.trim()));s.add($e,{description:"The directory used to store the environment's cached file data"});var _e=r.optional(r.string().check(r.trim()));s.add(_e,{description:"The directory used to store the environment's data files"});var Ie=r.optional(r.string().check(r.trim()));s.add(Ie,{description:"The directory used to store the environment's configuration files"});var Ne=r.optional(r.string().check(r.trim()));s.add(Ne,{description:"The directory used to store the environment's temp files"});var ye=r.optional(r.string().check(r.trim()));s.add(ye,{description:"The directory used to store the environment's log files"});var we=r._default(r.string().check(r.trim()),"dist");s.add(we,{description:"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"});var ze=r.object({cache:$e,data:_e,config:Ie,temp:Ne,log:ye,build:we});s.add(ze,{description:"Various directories used by the workspace to store data, cache, and configuration files"});var be=r._default(r.enum(["minimal","monorepo"]),"monorepo");s.add(be,{description:"The variant of the workspace. This can be used to enable or disable certain features or configurations."});var xe=r._default(r.string().check(r.trim()),w);s.add(xe,{description:"The path to the workspace's error codes JSON file"});var De=r.optional(r.url());s.add(De,{description:"A URL to a page that looks up the workspace's error messages given a specific error code"});var Ge=r.object({codesFile:xe,url:De});s.add(Ge,{description:"The workspace's error config used when creating error details during a system error"});var Me=r.optional(r.string().check(r.trim(),r.toLowerCase()));s.add(Me,{description:"The name of the organization"});var Pe=r.optional(r.string().check(r.trim()));s.add(Pe,{description:"A description of the organization"});var Fe=r.optional(r.url());s.add(Fe,{description:"A URL to the organization's logo image"});var Ue=r.optional(r.url());s.add(Ue,{description:"A URL to the organization's icon image"});var We=r.optional(r.url());s.add(We,{description:"A URL to a page that provides more information about the organization"});var Be=r.object({name:Me,description:Pe,logo:Fe,icon:Ue,url:We});s.add(Be,{description:"The workspace's organization details"});var je=r._default(r.string().check(r.trim(),r.toLowerCase()),"https://public.storm-cdn.com/schemas/storm-workspace.schema.json");s.add(je,{description:"The URL or file path to the JSON schema file that describes the Storm configuration file"});var He=r.string().check(r.trim(),r.toLowerCase());s.add(He,{description:"The name of the workspace/project/service/package/scope using this configuration"});var Ye=r.string().check(r.trim(),r.toLowerCase());s.add(Ye,{description:"The namespace of the workspace/project/service/package/scope using this configuration"});var Ve=r.union([Be,r.string().check(r.trim(),r.toLowerCase())]);s.add(Ve,{description:"The organization of the workspace. This can be a string or an object containing the organization's details"});var Ke=r.string().check(r.trim(),r.toLowerCase());s.add(Ke,{description:"The repo URL of the workspace (i.e. the GitHub repository URL)"});var Ze=r._default(r.string().check(r.trim()),"Apache-2.0");s.add(Ze,{description:"The license type of the package"});var Je=r.optional(r.url());s.add(Je,{description:"The homepage of the workspace"});var Xe=r.optional(r.url());s.add(Xe,{description:"The documentation site for the workspace"});var qe=r.optional(r.url());s.add(qe,{description:"The development portal site for the workspace"});var Qe=r.optional(r.url());s.add(Qe,{description:"The licensing site for the workspace"});var eo=r.optional(r.url());s.add(eo,{description:"The contact site for the workspace"});var oo=r.optional(r.url());s.add(oo,{description:"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"});var ro=r._default(r.string().check(r.trim(),r.toLowerCase()),"main");s.add(ro,{description:"The branch of the workspace"});var to=r.optional(r.string().check(r.trim(),r.toLowerCase()));s.add(to,{description:"A tag specifying the version pre-release identifier"});var so=r.optional(r.string().check(r.trim(),r.toLowerCase()));s.add(so,{description:"The owner of the package"});var no=r._default(r.enum(["development","staging","production"]).check(r.trim(),r.toLowerCase()),"production");s.add(no,{description:"The current runtime environment mode for the package"});var ao=r.string().check(r.trim(),r.toLowerCase());s.add(ao,{description:"The root directory of the workspace"});var io=r._default(r.boolean(),false);s.add(io,{description:"Should all known types of workspace caching be skipped?"});var co=r._default(r.enum(["npm","yarn","pnpm","bun"]),"npm");s.add(co,{description:"The JavaScript/TypeScript package manager used by the repository"});var po=r._default(r.string().check(r.trim()),"America/New_York");s.add(po,{description:"The default timezone of the workspace"});var lo=r._default(r.string().check(r.trim()),"en-US");s.add(lo,{description:"The default locale of the workspace"});var mo=r._default(r.enum(["silent","fatal","error","warn","success","info","debug","trace","all"]),"info");s.add(mo,{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 go=r._default(r.boolean(),true);s.add(go,{description:"Should the logging of the current Storm Workspace configuration be skipped?"});var uo=r._default(r.nullable(r.string().check(r.trim())),null);s.add(uo,{description:"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."});var ee=r._default(r.record(r.string(),r.any()),{});s.add(ee,{description:"Configuration of each used extension"});var fo=r.object({$schema:je,extends:de,name:He,variant:be,namespace:Ye,organization:Ve,repository:Ke,license:Ze,homepage:Je,docs:Xe,portal:qe,licensing:Qe,contact:eo,support:oo,branch:ro,preid:to,owner:so,bot:ge,release:Ee,socials:Le,error:Ge,mode:no,workspaceRoot:ao,skipCache:io,directories:ze,packageManager:co,timezone:po,locale:lo,logLevel:mo,skipConfigLogging:go,registry:ce,configFile:uo,colors:r.union([Q,pe]),extensions:ee});s.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."});var c={SILENT:0,FATAL:10,ERROR:20,WARN:30,SUCCESS:35,INFO:40,DEBUG:60,TRACE:70,ALL:100},p={SILENT:"silent",FATAL:"fatal",ERROR:"error",WARN:"warn",SUCCESS:"success",INFO:"info",DEBUG:"debug",TRACE:"trace",ALL:"all"};var R={dark:{brand:"#2dd4bf",success:"#10b981",info:"#58a6ff",warning:"#f3d371",danger:"#D8314A",fatal:"#a40e26"}};var Vo={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}},ho=()=>{let e=Yo;return (!e?.hex||!e?.bold?.hex||!e?.bgHex||!e?.whiteBright||!e?.white)&&(e=Vo),e};function To(){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 k=(e,o)=>To()?e:o,v={[p.ERROR]:k("\u2718","\xD7"),[p.FATAL]:k("\u{1F480}","\xD7"),[p.WARN]:k("\u26A0","\u203C"),[p.INFO]:k("\u2139","i"),[p.SUCCESS]:k("\u2714","\u221A"),[p.DEBUG]:k("\u{1F6E0}","D"),[p.TRACE]:k("\u{1F6E0}","T"),[p.ALL]:k("\u2709","\u2192")};var A=(e=new Date)=>`${e.toLocaleDateString()} ${e.toLocaleTimeString()}`;var $=e=>{switch(e){case "all":return c.ALL;case "trace":return c.TRACE;case "debug":return c.DEBUG;case "info":return c.INFO;case "warn":return c.WARN;case "error":return c.ERROR;case "fatal":return c.FATAL;case "silent":return c.SILENT;default:return c.INFO}},Co=(e=c.INFO)=>e>=c.ALL?p.ALL:e>=c.TRACE?p.TRACE:e>=c.DEBUG?p.DEBUG:e>=c.INFO?p.INFO:e>=c.WARN?p.WARN:e>=c.ERROR?p.ERROR:e>=c.FATAL?p.FATAL:e<=c.SILENT?p.SILENT:p.INFO;var oe=(e=c.INFO,o={},t=ho())=>{let i=!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,a=o.logLevel||process.env.STORM_LOG_LEVEL||p.INFO;return e>$(a)||e<=c.SILENT||$(a)<=c.SILENT?n=>{}:typeof e=="number"&&c.FATAL>=e?n=>{console.error(`
|
|
2
|
-
${t.gray(A())} ${t.hex(i.fatal??R.dark.fatal)(`[${v[p.FATAL]} Fatal] `)}${t.bold.whiteBright(E(n))}
|
|
3
|
-
`);}:typeof e=="number"&&c.ERROR>=e?n=>{console.error(`
|
|
4
|
-
${t.gray(A())} ${t.hex(i.danger??R.dark.danger)(`[${v[p.ERROR]} Error] `)}${t.bold.whiteBright(E(n))}
|
|
5
|
-
`);}:typeof e=="number"&&c.WARN>=e?n=>{console.warn(`
|
|
6
|
-
${t.gray(A())} ${t.hex(i.warning??R.dark.warning)(`[${v[p.WARN]} Warn] `)}${t.bold.whiteBright(E(n))}
|
|
7
|
-
`);}:typeof e=="number"&&c.SUCCESS>=e?n=>{console.info(`
|
|
8
|
-
${t.gray(A())} ${t.hex(i.success??R.dark.success)(`[${v[p.SUCCESS]} Success] `)}${t.bold.whiteBright(E(n))}
|
|
9
|
-
`);}:typeof e=="number"&&c.INFO>=e?n=>{console.info(`
|
|
10
|
-
${t.gray(A())} ${t.hex(i.info??R.dark.info)(`[${v[p.INFO]} Info] `)}${t.bold.whiteBright(E(n))}
|
|
11
|
-
`);}:typeof e=="number"&&c.DEBUG>=e?n=>{console.debug(`
|
|
12
|
-
${t.gray(A())} ${t.hex(i.info??R.dark.info)(`[${v[p.DEBUG]} Debug] `)}${t.bold.whiteBright(E(n))}
|
|
13
|
-
`);}:typeof e=="number"&&c.TRACE>=e?n=>{console.debug(`
|
|
14
|
-
${t.gray(A())} ${t.hex(i.info??R.dark.info)(`[${v[p.TRACE]} Trace] `)}${t.bold.whiteBright(E(n))}
|
|
15
|
-
`);}:n=>{console.log(`
|
|
16
|
-
${t.gray(A())} ${t.hex(i.brand??R.dark.brand)(`[${v[p.ALL]} System] `)}${t.bold.whiteBright(E(n))}
|
|
17
|
-
`);}};var K=(e,o)=>oe(c.WARN,o)(e);var Eo=(e,o)=>oe(c.DEBUG,o)(e),O=(e,o)=>oe(c.TRACE,o)(e);var Ko=4,E=(e,o={},t=0)=>{if(t>Ko)return "<max depth>";let i=o.prefix??"-",a=o.skip??[];return typeof e>"u"||e===null||!e&&typeof e!="boolean"?"<none>":typeof e=="string"?e:Array.isArray(e)?`
|
|
18
|
-
${e.map((n,l)=>` ${i}> #${l} = ${E(n,{prefix:`${i}-`,skip:a},t+1)}`).join(`
|
|
19
|
-
`)}`:typeof e=="object"?`
|
|
20
|
-
${Object.keys(e).filter(n=>!a.includes(n)).map(n=>` ${i}> ${n} = ${Zo(e[n])?"<function>":typeof e[n]=="object"?E(e[n],{prefix:`${i}-`,skip:a},t+1):e[n]}`).join(`
|
|
21
|
-
`)}`:e},Zo=e=>{try{return e instanceof Function||typeof e=="function"||!!(e?.constructor&&e?.call&&e?.apply)}catch{return false}};var Ro=["dark","light","base","brand","alternate","accent","link","success","help","info","warning","danger","fatal","positive","negative"];async function So(e){let o=ae,t,i,a,n,l,d=c$1(e);if(existsSync(join(d,"package.json"))){let T=await readFile(b$1(d,"package.json"),"utf8");if(T){let f=JSON.parse(T);f.name&&(a=f.name),f.namespace&&(n=f.namespace),f.repository&&(typeof f.repository=="string"?l=f.repository:f.repository.url&&(l=f.repository.url)),f.license&&(o=f.license),f.homepage&&(t=f.homepage),f.bugs&&(typeof f.bugs=="string"?i=f.bugs:f.bugs.url&&(i=f.bugs.url));}}return {workspaceRoot:d,name:a,namespace:n,repository:l,license:o,homepage:t,support:i}}function vo(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 ko=async(e,o,t={})=>{let i=o||c$1(o),a=await Promise.all([loadConfig({cwd:i,packageJson:true,name:e,envName:e?.toUpperCase(),jitiOptions:{debug:false,fsCache:process.env.STORM_SKIP_CACHE==="true"?false:b$1(process.env.STORM_CACHE_DIR||"node_modules/.cache/storm","jiti")},...t}),loadConfig({cwd:i,packageJson:true,name:e,envName:e?.toUpperCase(),jitiOptions:{debug:false,fsCache:process.env.STORM_SKIP_CACHE==="true"?false:b$1(process.env.STORM_CACHE_DIR||"node_modules/.cache/storm","jiti")},configFile:e,...t})]);return Oo(a[0]??{},a[1]??{})},Lo=async(e,o=[])=>{let t=e||c$1(e),i=await ko("storm-workspace",t),a=i.config,n=i.configFile;if(a&&n&&Object.keys(a).length>0&&!a.skipConfigLogging&&O(`Found Storm configuration file "${n.includes(`${t}/`)?n.replace(`${t}/`,""):n}" at "${t}"`,{logLevel:"all"}),o&&o.length>0){let l=await Promise.all(o.map(d=>ko(d,t)));for(let d of l)d?.config&&d?.configFile&&Object.keys(d.config).length>0&&(!a.skipConfigLogging&&!d.config.skipConfigLogging&&O(`Found alternative configuration file "${d.configFile.includes(`${t}/`)?d.configFile.replace(`${t}/`,""):d.configFile}" at "${t}"`,{logLevel:"all"}),a=Oo(d.config??{},a??{}));}if(!(!a||Object.keys(a).length===0))return a.configFile=n,a};var No=()=>{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`]?a(process.env[`${e}WORKSPACE_CONFIG_FILE`]):void 0,workspaceRoot:process.env[`${e}WORKSPACE_ROOT`]?a(process.env[`${e}WORKSPACE_ROOT`]):void 0,directories:{cache:process.env[`${e}CACHE_DIR`]?a(process.env[`${e}CACHE_DIR`]):process.env[`${e}CACHE_DIRECTORY`]?a(process.env[`${e}CACHE_DIRECTORY`]):void 0,data:process.env[`${e}DATA_DIR`]?a(process.env[`${e}DATA_DIR`]):process.env[`${e}DATA_DIRECTORY`]?a(process.env[`${e}DATA_DIRECTORY`]):void 0,config:process.env[`${e}CONFIG_DIR`]?a(process.env[`${e}CONFIG_DIR`]):process.env[`${e}CONFIG_DIRECTORY`]?a(process.env[`${e}CONFIG_DIRECTORY`]):void 0,temp:process.env[`${e}TEMP_DIR`]?a(process.env[`${e}TEMP_DIR`]):process.env[`${e}TEMP_DIRECTORY`]?a(process.env[`${e}TEMP_DIRECTORY`]):void 0,log:process.env[`${e}LOG_DIR`]?a(process.env[`${e}LOG_DIR`]):process.env[`${e}LOG_DIRECTORY`]?a(process.env[`${e}LOG_DIRECTORY`]):void 0,build:process.env[`${e}BUILD_DIR`]?a(process.env[`${e}BUILD_DIR`]):process.env[`${e}BUILD_DIRECTORY`]?a(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`]))?Co(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_`)&&Ro.every(n=>!a.startsWith(`${e}COLOR_LIGHT_${n}`)&&!a.startsWith(`${e}COLOR_DARK_${n}`)));o.colors=t.length>0?t.reduce((a,n)=>(a[n]=$o(e,n),a),{}):$o(e),o.docs===se&&(o.homepage===_?o.docs=`${_}/projects/${o.name}/docs`:o.docs=`${o.homepage}/docs`),o.licensing===ne&&(o.homepage===_?o.licensing=`${_}/projects/${o.name}/licensing`:o.licensing=`${o.homepage}/docs`);let i=process.env[`${e}WORKSPACE_CONFIG`];if(i){let a=JSON.parse(i);o={...o,...a,colors:{...o.colors,...a.colors},extensions:{...o.extensions,...a.extensions}};}return o},$o=(e,o)=>{let t=`COLOR_${o&&o!=="base"?`${o}_`:""}`.toUpperCase();return process.env[`${e}${t}LIGHT_BRAND`]||process.env[`${e}${t}DARK_BRAND`]?er(e+t):Qo(e+t)},Qo=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`],help:process.env[`${e}HELP`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}},er=e=>({light:_o(`${e}_LIGHT_`),dark:_o(`${e}_DARK_`)}),_o=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`],help:process.env[`${e}HELP`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}};var or=(e,o)=>{for(let t of Object.keys(o??{}))if(o[t]){let i=t?.replace(/([A-Z])+/g,n=>n?n[0]?.toUpperCase()+n.slice(1):"").split(/(?=[A-Z])|[.\-\s_]/).map(n=>n.toLowerCase())??[],a;if(i.length===0)return;i.length===1?a=i[0]?.toUpperCase()??"":a=i.reduce((n,l)=>`${n}_${l.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`]=a(e.configFile)),e.workspaceRoot&&(process.env[`${o}WORKSPACE_ROOT`]=a(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT=a(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT_PATH=a(e.workspaceRoot)),e.directories&&(!e.skipCache&&e.directories.cache&&(process.env[`${o}CACHE_DIR`]=a(e.directories.cache),process.env[`${o}CACHE_DIRECTORY`]=process.env[`${o}CACHE_DIR`]),e.directories.data&&(process.env[`${o}DATA_DIR`]=a(e.directories.data),process.env[`${o}DATA_DIRECTORY`]=process.env[`${o}DATA_DIR`]),e.directories.config&&(process.env[`${o}CONFIG_DIR`]=a(e.directories.config),process.env[`${o}CONFIG_DIRECTORY`]=process.env[`${o}CONFIG_DIR`]),e.directories.temp&&(process.env[`${o}TEMP_DIR`]=a(e.directories.temp),process.env[`${o}TEMP_DIRECTORY`]=process.env[`${o}TEMP_DIR`]),e.directories.log&&(process.env[`${o}LOG_DIR`]=a(e.directories.log),process.env[`${o}LOG_DIRECTORY`]=process.env[`${o}LOG_DIR`]),e.directories.build&&(process.env[`${o}BUILD_DIR`]=a(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))yo(`${o}COLOR_${t}_`,e.colors[t]);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($(e.logLevel)>=c.DEBUG),process.env.RUST_BACKTRACE=$(e.logLevel)>=c.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])&&or(t,e.extensions[t]);},yo=(e,o)=>o?.light?.brand||o?.dark?.brand?tr(e,o):rr(e,o),rr=(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.help&&(process.env[`${e}HELP`]=o.help),o.success&&(process.env[`${e}SUCCESS`]=o.success),o.info&&(process.env[`${e}INFO`]=o.info),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.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];},tr=(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.help&&(process.env[`${e}HELP`]=o.help),o.success&&(process.env[`${e}SUCCESS`]=o.success),o.info&&(process.env[`${e}INFO`]=o.info),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.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,nr=async(e,o,t,i=false,a=true)=>{let n;if(!I?.data||!I?.timestamp||I.timestamp<Date.now()-8e3){let l=t;l||(l=c$1());let d=No(),T=await Lo(l);if(!T&&(i||K("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(l),y=Oo(d,T,f);y.variant||(y.variant=existsSync(b$1(l,"nx.json"))||existsSync(b$1(l,".nx"))||existsSync(b$1(l,"lerna.json"))||existsSync(b$1(l,"turbo.json"))?"monorepo":"minimal");try{n=vo(await fo.parseAsync(y)),n.workspaceRoot??=l;}catch(X){throw new Error(`Failed to parse Storm Workspace configuration${X?.message?`: ${X.message}`:""}
|
|
22
|
-
|
|
23
|
-
Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${E(y)}`,{cause:X})}}else n=I.data;return I={timestamp:Date.now(),data:n},n},bo=async(e,o=false)=>{let t=await nr(void 0,void 0,e,o,true);return zo(t),!o&&!t.skipConfigLogging&&O(`\u2699\uFE0F Using Storm Workspace configuration:
|
|
24
|
-
${E(t)}`,t),t};var ir=(e,o=false)=>bo(e,o),xo=(e=true,o={})=>{let t=o.workspaceRoot;return t||(t=c$1(o.cwd)),ir(t,e)};var Do="latest";var J=Do;async function Go(){return new Promise((e,o)=>{exec("npm config get registry",(t,i,a)=>t?o(t):a?o(a):e(i.trim()));})}async function Mo(e,o=J,t={}){let{registry:i=await Go()}=t;return new Promise((a,n)=>{exec(`npm view ${e} version --registry=${i} --tag=${o}`,(l,d,T)=>l?n(l):T?n(T):a(d.trim()));})}async function mr(e$1=c$1(process.cwd())){let o=await e(e$1);if(!o)throw new Error("No pnpm-workspace.yaml file found");if(o?.catalog)return Object.fromEntries(Object.entries(o.catalog).map(([t,i])=>[t,i.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in pnpm-workspace.yaml file located in workspace root: ${e$1}
|
|
25
|
-
File content: ${JSON.stringify(o,null,2)}`);}async function gr(e=c$1(process.cwd())){let o=await mr(e);if(!o)throw new Error("No catalog entries found in pnpm-workspace.yaml file");return o}async function ur(e$1,o=c$1(process.cwd())){let t=await e(o);if(!t)throw new Error("No pnpm-workspace.yaml file found");t.catalog=Object.fromEntries(Object.entries(e$1).map(([i,a])=>[i,a.replaceAll('"',"").replaceAll("'","")])),await f(t,o);}async function fs(e,o={}){let{tag:t=J,prefix:i="^",throwIfMissingInCatalog:a=false,workspaceRoot:n=c$1()}=o,l=await xo(true,{workspaceRoot:n}),d=await gr(n);if(!d)throw new Error("No catalog found");if(a===true&&!d[e])throw new Error(`Package "${e}" not found in catalog: ${JSON.stringify(d,null,2)}`);O(`Upgrading catalog entry for package "${e}" with tag "${t}"`,l);let T=await Mo(e,t);!valid(coerce(d[e]))||coerce(d[e])&&coerce(T)&>(coerce(T),coerce(d[e]))?(d[e]=`${i||""}${T}`,Eo(`Writing version ${T} to catalog for "${e}" package`,l),await ur(d,n)):K(`The current version "${d[e]}" for package "${e}" is greater than or equal to the version "${T}" fetched from the npm registry with tag "${t}". No update performed.`,l);}export{mr as a,gr as b,ur as c,fs as d};
|
package/dist/chunk-LGDN3UHN.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import {existsSync}from'node:fs';import {join}from'node:path';import {readFile,writeFile}from'node:fs/promises';import {parse,stringify}from'yaml';var x=/^[A-Za-z]:\//;function _(e=""){return e&&e.replace(/\\/g,"/").replace(x,n=>n.toUpperCase())}var P=/^[/\\]{2}/,R=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,E=/^[A-Za-z]:$/;var l=function(e){if(!e||e.length===0)return ".";e=_(e);let n=e?.match(P),t=d(e),o=e[e.length-1]==="/";return e=j(e,!t),e.length===0?t?"/":o?"./":".":(o&&(e+="/"),E.test(e)&&(e+="/"),n?t?`//${e}`:`//./${e}`:t&&!d(e)?`/${e}`:e)},k=function(...e){let n="";for(let t of e)if(t)if(n.length>0){let o=n[n.length-1]==="/",r=t[0]==="/";o&&r?n+=t.slice(1):n+=o||r?t:`/${t}`;}else n+=t;return l(n)};function j(e,n){let t="",o=0,r=-1,c=0,i=null;for(let s=0;s<=e.length;++s){if(s<e.length)i=e[s];else {if(i==="/")break;i="/";}if(i==="/"){if(!(r===s-1||c===1))if(c===2){if(t.length<2||o!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let g=t.lastIndexOf("/");g===-1?(t="",o=0):(t=t.slice(0,g),o=t.length-1-t.lastIndexOf("/")),r=s,c=0;continue}else if(t.length>0){t="",o=0,r=s,c=0;continue}}n&&(t+=t.length>0?"/..":"..",o=2);}else t.length>0?t+=`/${e.slice(r+1,s)}`:t=e.slice(r+1,s),o=s-r-1;r=s,c=0;}else i==="."&&c!==-1?++c:c=-1;}return t}var d=function(e){return R.test(e)};var A=30,O=0;function u(e,n=[],t=[]){let o=e??process.cwd();if(t.some(r=>existsSync(join(o,r)))||n.some(r=>existsSync(join(o,r))))return o;if(o!=="/"&&O++<A){let r=join(o,"..");return u(r,n,t)}}var w=["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"],T=[".storm-workspace",".nx",".git",".github",".vscode",".verdaccio"];function S(e){return process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH?l(process.env.STORM_WORKSPACE_ROOT??process.env.NX_WORKSPACE_ROOT_PATH):l(u(e??process.cwd(),w,T))}function a(e){let n=S(e);if(!n)throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
|
|
2
|
-
${w.join(`
|
|
3
|
-
`)}
|
|
4
|
-
Path: ${e||process.cwd()}`);return n}function y(e=a(process.cwd())){let n=k(e,"pnpm-workspace.yaml");if(!existsSync(n))throw new Error(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${n}).`);return n}async function q(e=a(process.cwd())){let n=await readFile(y(e),"utf8");if(n)return parse(n)}async function J(e,n=a(process.cwd())){await writeFile(y(n),stringify(e));}export{l as a,k as b,a as c,y as d,q as e,J as f};
|
package/dist/chunk-ZZOQH7Z4.cjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkCZ7PAWK2_cjs=require('./chunk-CZ7PAWK2.cjs'),r=require('zod/mini'),ko=require('defu'),fs=require('fs'),c12=require('c12'),Ho=require('chalk'),promises=require('fs/promises'),path=require('path'),child_process=require('child_process'),semver=require('semver');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 r__namespace=/*#__PURE__*/_interopNamespace(r);var ko__default=/*#__PURE__*/_interopDefault(ko);var Ho__default=/*#__PURE__*/_interopDefault(Ho);var te="https://docs.stormsoftware.com",$="https://stormsoftware.com";var se="https://stormsoftware.com/license",ne="Apache-2.0";var y="tools/errors/codes.json",ae="The workspace's banner image";var s=r__namespace.registry(),f=r__namespace.string().check(r__namespace.length(7),r__namespace.toLowerCase(),r__namespace.regex(/^#([0-9a-f]{3}){1,2}$/i),r__namespace.trim());s.add(f,{description:"A base schema for describing the format of colors"});var w=r__namespace._default(f,"#151718");s.add(w,{description:"The dark background color of the workspace"});var z=r__namespace._default(f,"#cbd5e1");s.add(z,{description:"The light background color of the workspace"});var b=r__namespace._default(f,"#1fb2a6");s.add(b,{description:"The primary brand specific color of the workspace"});var x=r__namespace.optional(f);s.add(x,{description:"The alternate brand specific color of the workspace"});var D=r__namespace.optional(f);s.add(D,{description:"The secondary brand specific color of the workspace"});var G=r__namespace._default(f,"#3fa6ff");s.add(G,{description:"The color used to display hyperlink text"});var M=r__namespace._default(f,"#818cf8");s.add(M,{description:"The second brand specific color of the workspace"});var P=r__namespace._default(f,"#45b27e");s.add(P,{description:"The success color of the workspace"});var F=r__namespace._default(f,"#38bdf8");s.add(F,{description:"The informational color of the workspace"});var U=r__namespace._default(f,"#f3d371");s.add(U,{description:"The warning color of the workspace"});var W=r__namespace._default(f,"#d8314a");s.add(W,{description:"The danger color of the workspace"});var B=r__namespace.optional(f);s.add(B,{description:"The fatal color of the workspace"});var j=r__namespace._default(f,"#4ade80");s.add(j,{description:"The positive number color of the workspace"});var H=r__namespace._default(f,"#ef4444");s.add(H,{description:"The negative number color of the workspace"});var Y=r__namespace.optional(r__namespace.array(f));s.add(Y,{description:"The color stops for the base gradient color pattern used in the workspace"});var Uo=r__namespace.object({foreground:z,background:w,brand:b,alternate:x,accent:D,link:G,help:M,success:P,info:F,warning:U,danger:W,fatal:B,positive:j,negative:H,gradient:Y}),Wo=r__namespace.object({foreground:w,background:z,brand:b,alternate:x,accent:D,link:G,help:M,success:P,info:F,warning:U,danger:W,fatal:B,positive:j,negative:H,gradient:Y}),Bo=r__namespace.object({dark:Uo,light:Wo}),jo=r__namespace.object({dark:w,light:z,brand:b,alternate:x,accent:D,link:G,help:M,success:P,info:F,warning:U,danger:W,fatal:B,positive:j,negative:H,gradient:Y}),O=r__namespace.optional(r__namespace.url());s.add(O,{description:"A remote registry URL used to publish distributable packages"});var ie=r__namespace._default(r__namespace.object({github:O,npm:O,cargo:O,cyclone:O,container:O}),{});s.add(ie,{description:"A list of remote registry URLs used by Storm Software"});var q=r__namespace.union([jo,Bo]);s.add(q,{description:"Colors used for various workspace elements"});var ce=r__namespace.record(r__namespace.union([r__namespace.union([r__namespace.literal("base"),r__namespace.string()]),r__namespace.string()]),q);s.add(ce,{description:"Storm theme config values used for styling various package elements"});var pe=r__namespace.optional(r__namespace.union([r__namespace.string().check(r__namespace.trim()),r__namespace.array(r__namespace.string().check(r__namespace.trim()))]));s.add(pe,{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 de=r__namespace.string().check(r__namespace.trim());s.add(de,{description:"The workspace bot user's name (this is the bot that will be used to perform various tasks)"});var le=r__namespace.string().check(r__namespace.trim());s.add(le,{description:"The email of the workspace bot"});var me=r__namespace.object({name:de,email:le});s.add(me,{description:"The workspace's bot user's config used to automated various operations tasks"});var ge=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.url()));s.add(ge,{description:"A URL to a banner image used to display the workspace's release"});var ue=r__namespace._default(r__namespace.string().check(r__namespace.trim()),ae);s.add(ue,{description:"The alt text for the workspace's release banner image"});var fe=r__namespace.object({url:ge,alt:ue});s.add(fe,{description:"The workspace's banner image used during the release process"});var he=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(he,{description:"A header message appended to the start of the workspace's release notes"});var Te=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Te,{description:"A footer message appended to the end of the workspace's release notes"});var Ce=r__namespace.object({banner:r__namespace.union([fe,r__namespace.string().check(r__namespace.trim(),r__namespace.url())]),header:he,footer:Te});s.add(Ce,{description:"The workspace's release config used during the release process"});var Ee=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Ee,{description:"A Twitter/X account associated with the organization/project"});var Re=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Re,{description:"A Discord account associated with the organization/project"});var Se=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Se,{description:"A Telegram account associated with the organization/project"});var ve=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(ve,{description:"A Slack account associated with the organization/project"});var Ae=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Ae,{description:"A Medium account associated with the organization/project"});var ke=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(ke,{description:"A GitHub account associated with the organization/project"});var Oe=r__namespace.object({twitter:Ee,discord:Re,telegram:Se,slack:ve,medium:Ae,github:ke});s.add(Oe,{description:"The workspace's account config used to store various social media links"});var Le=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Le,{description:"The directory used to store the environment's cached file data"});var $e=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add($e,{description:"The directory used to store the environment's data files"});var _e=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(_e,{description:"The directory used to store the environment's configuration files"});var Ie=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Ie,{description:"The directory used to store the environment's temp files"});var Ne=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Ne,{description:"The directory used to store the environment's log files"});var ye=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"dist");s.add(ye,{description:"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"});var we=r__namespace.object({cache:Le,data:$e,config:_e,temp:Ie,log:Ne,build:ye});s.add(we,{description:"Various directories used by the workspace to store data, cache, and configuration files"});var ze=r__namespace._default(r__namespace.enum(["minimal","monorepo"]),"monorepo");s.add(ze,{description:"The variant of the workspace. This can be used to enable or disable certain features or configurations."});var be=r__namespace._default(r__namespace.string().check(r__namespace.trim()),y);s.add(be,{description:"The path to the workspace's error codes JSON file"});var xe=r__namespace.optional(r__namespace.url());s.add(xe,{description:"A URL to a page that looks up the workspace's error messages given a specific error code"});var De=r__namespace.object({codesFile:be,url:xe});s.add(De,{description:"The workspace's error config used when creating error details during a system error"});var Ge=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));s.add(Ge,{description:"The name of the organization"});var Me=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Me,{description:"A description of the organization"});var Pe=r__namespace.optional(r__namespace.url());s.add(Pe,{description:"A URL to the organization's logo image"});var Fe=r__namespace.optional(r__namespace.url());s.add(Fe,{description:"A URL to the organization's icon image"});var Ue=r__namespace.optional(r__namespace.url());s.add(Ue,{description:"A URL to a page that provides more information about the organization"});var We=r__namespace.object({name:Ge,description:Me,logo:Pe,icon:Fe,url:Ue});s.add(We,{description:"The workspace's organization details"});var Be=r__namespace._default(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()),"https://public.storm-cdn.com/schemas/storm-workspace.schema.json");s.add(Be,{description:"The URL or file path to the JSON schema file that describes the Storm configuration file"});var je=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(je,{description:"The name of the workspace/project/service/package/scope using this configuration"});var He=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(He,{description:"The namespace of the workspace/project/service/package/scope using this configuration"});var Ye=r__namespace.union([We,r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase())]);s.add(Ye,{description:"The organization of the workspace. This can be a string or an object containing the organization's details"});var Ve=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(Ve,{description:"The repo URL of the workspace (i.e. the GitHub repository URL)"});var Ke=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"Apache-2.0");s.add(Ke,{description:"The license type of the package"});var Ze=r__namespace.optional(r__namespace.url());s.add(Ze,{description:"The homepage of the workspace"});var Je=r__namespace.optional(r__namespace.url());s.add(Je,{description:"The documentation site for the workspace"});var Xe=r__namespace.optional(r__namespace.url());s.add(Xe,{description:"The development portal site for the workspace"});var qe=r__namespace.optional(r__namespace.url());s.add(qe,{description:"The licensing site for the workspace"});var Qe=r__namespace.optional(r__namespace.url());s.add(Qe,{description:"The contact site for the workspace"});var eo=r__namespace.optional(r__namespace.url());s.add(eo,{description:"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"});var oo=r__namespace._default(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()),"main");s.add(oo,{description:"The branch of the workspace"});var ro=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));s.add(ro,{description:"A tag specifying the version pre-release identifier"});var to=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));s.add(to,{description:"The owner of the package"});var so=r__namespace._default(r__namespace.enum(["development","staging","production"]).check(r__namespace.trim(),r__namespace.toLowerCase()),"production");s.add(so,{description:"The current runtime environment mode for the package"});var no=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(no,{description:"The root directory of the workspace"});var ao=r__namespace._default(r__namespace.boolean(),false);s.add(ao,{description:"Should all known types of workspace caching be skipped?"});var io=r__namespace._default(r__namespace.enum(["npm","yarn","pnpm","bun"]),"npm");s.add(io,{description:"The JavaScript/TypeScript package manager used by the repository"});var co=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"America/New_York");s.add(co,{description:"The default timezone of the workspace"});var po=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"en-US");s.add(po,{description:"The default locale of the workspace"});var lo=r__namespace._default(r__namespace.enum(["silent","fatal","error","warn","success","info","debug","trace","all"]),"info");s.add(lo,{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 mo=r__namespace._default(r__namespace.boolean(),true);s.add(mo,{description:"Should the logging of the current Storm Workspace configuration be skipped?"});var go=r__namespace._default(r__namespace.nullable(r__namespace.string().check(r__namespace.trim())),null);s.add(go,{description:"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."});var Q=r__namespace._default(r__namespace.record(r__namespace.string(),r__namespace.any()),{});s.add(Q,{description:"Configuration of each used extension"});var uo=r__namespace.object({$schema:Be,extends:pe,name:je,variant:ze,namespace:He,organization:Ye,repository:Ve,license:Ke,homepage:Ze,docs:Je,portal:Xe,licensing:qe,contact:Qe,support:eo,branch:oo,preid:ro,owner:to,bot:me,release:Ce,socials:Oe,error:De,mode:so,workspaceRoot:no,skipCache:ao,directories:we,packageManager:io,timezone:co,locale:po,logLevel:lo,skipConfigLogging:mo,registry:ie,configFile:go,colors:r__namespace.union([q,ce]),extensions:Q});s.add(Q,{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."});var c={SILENT:0,FATAL:10,ERROR:20,WARN:30,SUCCESS:35,INFO:40,DEBUG:60,TRACE:70,ALL:100},p={SILENT:"silent",FATAL:"fatal",ERROR:"error",WARN:"warn",SUCCESS:"success",INFO:"info",DEBUG:"debug",TRACE:"trace",ALL:"all"};var E={dark:{brand:"#2dd4bf",success:"#10b981",info:"#58a6ff",warning:"#f3d371",danger:"#D8314A",fatal:"#a40e26"}};var Yo={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}},fo=()=>{let e=Ho__default.default;return (!e?.hex||!e?.bold?.hex||!e?.bgHex||!e?.whiteBright||!e?.white)&&(e=Yo),e};function ho(){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 A=(e,o)=>ho()?e:o,S={[p.ERROR]:A("\u2718","\xD7"),[p.FATAL]:A("\u{1F480}","\xD7"),[p.WARN]:A("\u26A0","\u203C"),[p.INFO]:A("\u2139","i"),[p.SUCCESS]:A("\u2714","\u221A"),[p.DEBUG]:A("\u{1F6E0}","D"),[p.TRACE]:A("\u{1F6E0}","T"),[p.ALL]:A("\u2709","\u2192")};var v=(e=new Date)=>`${e.toLocaleDateString()} ${e.toLocaleTimeString()}`;var L=e=>{switch(e){case "all":return c.ALL;case "trace":return c.TRACE;case "debug":return c.DEBUG;case "info":return c.INFO;case "warn":return c.WARN;case "error":return c.ERROR;case "fatal":return c.FATAL;case "silent":return c.SILENT;default:return c.INFO}},To=(e=c.INFO)=>e>=c.ALL?p.ALL:e>=c.TRACE?p.TRACE:e>=c.DEBUG?p.DEBUG:e>=c.INFO?p.INFO:e>=c.WARN?p.WARN:e>=c.ERROR?p.ERROR:e>=c.FATAL?p.FATAL:e<=c.SILENT?p.SILENT:p.INFO;var ee=(e=c.INFO,o={},t=fo())=>{let i=!o.colors?.dark&&!o.colors?.base&&!o.colors?.base?.dark?E: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:E,a=o.logLevel||process.env.STORM_LOG_LEVEL||p.INFO;return e>L(a)||e<=c.SILENT||L(a)<=c.SILENT?n=>{}:typeof e=="number"&&c.FATAL>=e?n=>{console.error(`
|
|
2
|
-
${t.gray(v())} ${t.hex(i.fatal??E.dark.fatal)(`[${S[p.FATAL]} Fatal] `)}${t.bold.whiteBright(C(n))}
|
|
3
|
-
`);}:typeof e=="number"&&c.ERROR>=e?n=>{console.error(`
|
|
4
|
-
${t.gray(v())} ${t.hex(i.danger??E.dark.danger)(`[${S[p.ERROR]} Error] `)}${t.bold.whiteBright(C(n))}
|
|
5
|
-
`);}:typeof e=="number"&&c.WARN>=e?n=>{console.warn(`
|
|
6
|
-
${t.gray(v())} ${t.hex(i.warning??E.dark.warning)(`[${S[p.WARN]} Warn] `)}${t.bold.whiteBright(C(n))}
|
|
7
|
-
`);}:typeof e=="number"&&c.SUCCESS>=e?n=>{console.info(`
|
|
8
|
-
${t.gray(v())} ${t.hex(i.success??E.dark.success)(`[${S[p.SUCCESS]} Success] `)}${t.bold.whiteBright(C(n))}
|
|
9
|
-
`);}:typeof e=="number"&&c.INFO>=e?n=>{console.info(`
|
|
10
|
-
${t.gray(v())} ${t.hex(i.info??E.dark.info)(`[${S[p.INFO]} Info] `)}${t.bold.whiteBright(C(n))}
|
|
11
|
-
`);}:typeof e=="number"&&c.DEBUG>=e?n=>{console.debug(`
|
|
12
|
-
${t.gray(v())} ${t.hex(i.info??E.dark.info)(`[${S[p.DEBUG]} Debug] `)}${t.bold.whiteBright(C(n))}
|
|
13
|
-
`);}:typeof e=="number"&&c.TRACE>=e?n=>{console.debug(`
|
|
14
|
-
${t.gray(v())} ${t.hex(i.info??E.dark.info)(`[${S[p.TRACE]} Trace] `)}${t.bold.whiteBright(C(n))}
|
|
15
|
-
`);}:n=>{console.log(`
|
|
16
|
-
${t.gray(v())} ${t.hex(i.brand??E.dark.brand)(`[${S[p.ALL]} System] `)}${t.bold.whiteBright(C(n))}
|
|
17
|
-
`);}};var V=(e,o)=>ee(c.WARN,o)(e);var Co=(e,o)=>ee(c.DEBUG,o)(e),k=(e,o)=>ee(c.TRACE,o)(e);var Vo=4,C=(e,o={},t=0)=>{if(t>Vo)return "<max depth>";let i=o.prefix??"-",a=o.skip??[];return typeof e>"u"||e===null||!e&&typeof e!="boolean"?"<none>":typeof e=="string"?e:Array.isArray(e)?`
|
|
18
|
-
${e.map((n,l)=>` ${i}> #${l} = ${C(n,{prefix:`${i}-`,skip:a},t+1)}`).join(`
|
|
19
|
-
`)}`:typeof e=="object"?`
|
|
20
|
-
${Object.keys(e).filter(n=>!a.includes(n)).map(n=>` ${i}> ${n} = ${Ko(e[n])?"<function>":typeof e[n]=="object"?C(e[n],{prefix:`${i}-`,skip:a},t+1):e[n]}`).join(`
|
|
21
|
-
`)}`:e},Ko=e=>{try{return e instanceof Function||typeof e=="function"||!!(e?.constructor&&e?.call&&e?.apply)}catch{return false}};var Eo=["dark","light","base","brand","alternate","accent","link","success","help","info","warning","danger","fatal","positive","negative"];async function Ro(e){let o=ne,t,i,a,n,l,d=chunkCZ7PAWK2_cjs.c(e);if(fs.existsSync(path.join(d,"package.json"))){let h=await promises.readFile(chunkCZ7PAWK2_cjs.b(d,"package.json"),"utf8");if(h){let u=JSON.parse(h);u.name&&(a=u.name),u.namespace&&(n=u.namespace),u.repository&&(typeof u.repository=="string"?l=u.repository:u.repository.url&&(l=u.repository.url)),u.license&&(o=u.license),u.homepage&&(t=u.homepage),u.bugs&&(typeof u.bugs=="string"?i=u.bugs:u.bugs.url&&(i=u.bugs.url));}}return {workspaceRoot:d,name:a,namespace:n,repository:l,license:o,homepage:t,support:i}}function So(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:y},e.homepage&&(e.error.url??=`${e.homepage}/errors`))),e}var Ao=async(e,o,t={})=>{let i=o||chunkCZ7PAWK2_cjs.c(o),a=await Promise.all([c12.loadConfig({cwd:i,packageJson:true,name:e,envName:e?.toUpperCase(),jitiOptions:{debug:false,fsCache:process.env.STORM_SKIP_CACHE==="true"?false:chunkCZ7PAWK2_cjs.b(process.env.STORM_CACHE_DIR||"node_modules/.cache/storm","jiti")},...t}),c12.loadConfig({cwd:i,packageJson:true,name:e,envName:e?.toUpperCase(),jitiOptions:{debug:false,fsCache:process.env.STORM_SKIP_CACHE==="true"?false:chunkCZ7PAWK2_cjs.b(process.env.STORM_CACHE_DIR||"node_modules/.cache/storm","jiti")},configFile:e,...t})]);return ko__default.default(a[0]??{},a[1]??{})},Oo=async(e,o=[])=>{let t=e||chunkCZ7PAWK2_cjs.c(e),i=await Ao("storm-workspace",t),a=i.config,n=i.configFile;if(a&&n&&Object.keys(a).length>0&&!a.skipConfigLogging&&k(`Found Storm configuration file "${n.includes(`${t}/`)?n.replace(`${t}/`,""):n}" at "${t}"`,{logLevel:"all"}),o&&o.length>0){let l=await Promise.all(o.map(d=>Ao(d,t)));for(let d of l)d?.config&&d?.configFile&&Object.keys(d.config).length>0&&(!a.skipConfigLogging&&!d.config.skipConfigLogging&&k(`Found alternative configuration file "${d.configFile.includes(`${t}/`)?d.configFile.replace(`${t}/`,""):d.configFile}" at "${t}"`,{logLevel:"all"}),a=ko__default.default(d.config??{},a??{}));}if(!(!a||Object.keys(a).length===0))return a.configFile=n,a};var Io=()=>{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`]?chunkCZ7PAWK2_cjs.a(process.env[`${e}WORKSPACE_CONFIG_FILE`]):void 0,workspaceRoot:process.env[`${e}WORKSPACE_ROOT`]?chunkCZ7PAWK2_cjs.a(process.env[`${e}WORKSPACE_ROOT`]):void 0,directories:{cache:process.env[`${e}CACHE_DIR`]?chunkCZ7PAWK2_cjs.a(process.env[`${e}CACHE_DIR`]):process.env[`${e}CACHE_DIRECTORY`]?chunkCZ7PAWK2_cjs.a(process.env[`${e}CACHE_DIRECTORY`]):void 0,data:process.env[`${e}DATA_DIR`]?chunkCZ7PAWK2_cjs.a(process.env[`${e}DATA_DIR`]):process.env[`${e}DATA_DIRECTORY`]?chunkCZ7PAWK2_cjs.a(process.env[`${e}DATA_DIRECTORY`]):void 0,config:process.env[`${e}CONFIG_DIR`]?chunkCZ7PAWK2_cjs.a(process.env[`${e}CONFIG_DIR`]):process.env[`${e}CONFIG_DIRECTORY`]?chunkCZ7PAWK2_cjs.a(process.env[`${e}CONFIG_DIRECTORY`]):void 0,temp:process.env[`${e}TEMP_DIR`]?chunkCZ7PAWK2_cjs.a(process.env[`${e}TEMP_DIR`]):process.env[`${e}TEMP_DIRECTORY`]?chunkCZ7PAWK2_cjs.a(process.env[`${e}TEMP_DIRECTORY`]):void 0,log:process.env[`${e}LOG_DIR`]?chunkCZ7PAWK2_cjs.a(process.env[`${e}LOG_DIR`]):process.env[`${e}LOG_DIRECTORY`]?chunkCZ7PAWK2_cjs.a(process.env[`${e}LOG_DIRECTORY`]):void 0,build:process.env[`${e}BUILD_DIR`]?chunkCZ7PAWK2_cjs.a(process.env[`${e}BUILD_DIR`]):process.env[`${e}BUILD_DIRECTORY`]?chunkCZ7PAWK2_cjs.a(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`]))?To(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_`)&&Eo.every(n=>!a.startsWith(`${e}COLOR_LIGHT_${n}`)&&!a.startsWith(`${e}COLOR_DARK_${n}`)));o.colors=t.length>0?t.reduce((a,n)=>(a[n]=Lo(e,n),a),{}):Lo(e),o.docs===te&&(o.homepage===$?o.docs=`${$}/projects/${o.name}/docs`:o.docs=`${o.homepage}/docs`),o.licensing===se&&(o.homepage===$?o.licensing=`${$}/projects/${o.name}/licensing`:o.licensing=`${o.homepage}/docs`);let i=process.env[`${e}WORKSPACE_CONFIG`];if(i){let a=JSON.parse(i);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`]?Qo(e+t):qo(e+t)},qo=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`],help:process.env[`${e}HELP`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}},Qo=e=>({light:$o(`${e}_LIGHT_`),dark:$o(`${e}_DARK_`)}),$o=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`],help:process.env[`${e}HELP`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}};var er=(e,o)=>{for(let t of Object.keys(o??{}))if(o[t]){let i=t?.replace(/([A-Z])+/g,n=>n?n[0]?.toUpperCase()+n.slice(1):"").split(/(?=[A-Z])|[.\-\s_]/).map(n=>n.toLowerCase())??[],a;if(i.length===0)return;i.length===1?a=i[0]?.toUpperCase()??"":a=i.reduce((n,l)=>`${n}_${l.toLowerCase()}`),process.env[`STORM_EXTENSION_${e.toUpperCase()}_${a.toUpperCase()}`]=o[t];}},wo=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`]=chunkCZ7PAWK2_cjs.a(e.configFile)),e.workspaceRoot&&(process.env[`${o}WORKSPACE_ROOT`]=chunkCZ7PAWK2_cjs.a(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT=chunkCZ7PAWK2_cjs.a(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT_PATH=chunkCZ7PAWK2_cjs.a(e.workspaceRoot)),e.directories&&(!e.skipCache&&e.directories.cache&&(process.env[`${o}CACHE_DIR`]=chunkCZ7PAWK2_cjs.a(e.directories.cache),process.env[`${o}CACHE_DIRECTORY`]=process.env[`${o}CACHE_DIR`]),e.directories.data&&(process.env[`${o}DATA_DIR`]=chunkCZ7PAWK2_cjs.a(e.directories.data),process.env[`${o}DATA_DIRECTORY`]=process.env[`${o}DATA_DIR`]),e.directories.config&&(process.env[`${o}CONFIG_DIR`]=chunkCZ7PAWK2_cjs.a(e.directories.config),process.env[`${o}CONFIG_DIRECTORY`]=process.env[`${o}CONFIG_DIR`]),e.directories.temp&&(process.env[`${o}TEMP_DIR`]=chunkCZ7PAWK2_cjs.a(e.directories.temp),process.env[`${o}TEMP_DIRECTORY`]=process.env[`${o}TEMP_DIR`]),e.directories.log&&(process.env[`${o}LOG_DIR`]=chunkCZ7PAWK2_cjs.a(e.directories.log),process.env[`${o}LOG_DIRECTORY`]=process.env[`${o}LOG_DIR`]),e.directories.build&&(process.env[`${o}BUILD_DIR`]=chunkCZ7PAWK2_cjs.a(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))No(`${o}COLOR_${t}_`,e.colors[t]);else No(`${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(L(e.logLevel)>=c.DEBUG),process.env.RUST_BACKTRACE=L(e.logLevel)>=c.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])&&er(t,e.extensions[t]);},No=(e,o)=>o?.light?.brand||o?.dark?.brand?rr(e,o):or(e,o),or=(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.help&&(process.env[`${e}HELP`]=o.help),o.success&&(process.env[`${e}SUCCESS`]=o.success),o.info&&(process.env[`${e}INFO`]=o.info),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.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];},rr=(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.help&&(process.env[`${e}HELP`]=o.help),o.success&&(process.env[`${e}SUCCESS`]=o.success),o.info&&(process.env[`${e}INFO`]=o.info),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.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 _,sr=async(e,o,t,i=false,a=true)=>{let n;if(!_?.data||!_?.timestamp||_.timestamp<Date.now()-8e3){let l=t;l||(l=chunkCZ7PAWK2_cjs.c());let d=Io(),h=await Oo(l);if(!h&&(i||V("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 u=await Ro(l),N=ko__default.default(d,h,u);N.variant||(N.variant=fs.existsSync(chunkCZ7PAWK2_cjs.b(l,"nx.json"))||fs.existsSync(chunkCZ7PAWK2_cjs.b(l,".nx"))||fs.existsSync(chunkCZ7PAWK2_cjs.b(l,"lerna.json"))||fs.existsSync(chunkCZ7PAWK2_cjs.b(l,"turbo.json"))?"monorepo":"minimal");try{n=So(await uo.parseAsync(N)),n.workspaceRoot??=l;}catch(J){throw new Error(`Failed to parse Storm Workspace configuration${J?.message?`: ${J.message}`:""}
|
|
22
|
-
|
|
23
|
-
Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${C(N)}`,{cause:J})}}else n=_.data;return _={timestamp:Date.now(),data:n},n},zo=async(e,o=false)=>{let t=await sr(void 0,void 0,e,o,true);return wo(t),!o&&!t.skipConfigLogging&&k(`\u2699\uFE0F Using Storm Workspace configuration:
|
|
24
|
-
${C(t)}`,t),t};var ar=(e,o=false)=>zo(e,o),bo=(e=true,o={})=>{let t=o.workspaceRoot;return t||(t=chunkCZ7PAWK2_cjs.c(o.cwd)),ar(t,e)};var xo="latest";var Z=xo;async function Do(){return new Promise((e,o)=>{child_process.exec("npm config get registry",(t,i,a)=>t?o(t):a?o(a):e(i.trim()));})}async function Go(e,o=Z,t={}){let{registry:i=await Do()}=t;return new Promise((a,n)=>{child_process.exec(`npm view ${e} version --registry=${i} --tag=${o}`,(l,d,h)=>l?n(l):h?n(h):a(d.trim()));})}async function lr(e=chunkCZ7PAWK2_cjs.c(process.cwd())){let o=await chunkCZ7PAWK2_cjs.e(e);if(!o)throw new Error("No pnpm-workspace.yaml file found");if(o?.catalog)return Object.fromEntries(Object.entries(o.catalog).map(([t,i])=>[t,i.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in pnpm-workspace.yaml file located in workspace root: ${e}
|
|
25
|
-
File content: ${JSON.stringify(o,null,2)}`);}async function mr(e=chunkCZ7PAWK2_cjs.c(process.cwd())){let o=await lr(e);if(!o)throw new Error("No catalog entries found in pnpm-workspace.yaml file");return o}async function gr(e,o=chunkCZ7PAWK2_cjs.c(process.cwd())){let t=await chunkCZ7PAWK2_cjs.e(o);if(!t)throw new Error("No pnpm-workspace.yaml file found");t.catalog=Object.fromEntries(Object.entries(e).map(([i,a])=>[i,a.replaceAll('"',"").replaceAll("'","")])),await chunkCZ7PAWK2_cjs.f(t,o);}async function us(e,o={}){let{tag:t=Z,prefix:i="^",throwIfMissingInCatalog:a=false,workspaceRoot:n=chunkCZ7PAWK2_cjs.c()}=o,l=await bo(true,{workspaceRoot:n}),d=await mr(n);if(!d)throw new Error("No catalog found");if(a===true&&!d[e])throw new Error(`Package "${e}" not found in catalog: ${JSON.stringify(d,null,2)}`);k(`Upgrading catalog entry for package "${e}" with tag "${t}"`,l);let h=await Go(e,t);!semver.valid(semver.coerce(d[e]))||semver.coerce(d[e])&&semver.coerce(h)&&semver.gt(semver.coerce(h),semver.coerce(d[e]))?(d[e]=`${i||""}${h}`,Co(`Writing version ${h} to catalog for "${e}" package`,l),await gr(d,n)):V(`The current version "${d[e]}" for package "${e}" is greater than or equal to the version "${h}" fetched from the npm registry with tag "${t}". No update performed.`,l);}exports.a=lr;exports.b=mr;exports.c=gr;exports.d=us;
|