@storm-software/pnpm-tools 0.6.125 → 0.6.126

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  # Changelog for Storm Ops - Pnpm Tools
4
4
 
5
+ ## [0.6.125](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.6.125) (03/18/2026)
6
+
7
+ ### Miscellaneous
8
+
9
+ - **devenv-modules:** Update tasks for devenv modules ([7e9677f2e](https://github.com/storm-software/storm-ops/commit/7e9677f2e))
10
+
11
+ ### Updated Dependencies
12
+
13
+ - Updated **testing-tools** to **v1.119.115**
14
+ - Updated **config-tools** to **v1.189.40**
15
+ - Updated **npm-tools** to **v0.6.78**
16
+ - Updated **config** to **v1.135.41**
17
+
5
18
  ## [0.6.124](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.6.124) (03/16/2026)
6
19
 
7
20
  ### Miscellaneous
package/README.md CHANGED
@@ -27,7 +27,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
27
27
 
28
28
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
29
29
 
30
- [![Version](https://img.shields.io/badge/version-0.6.123-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
30
+ [![Version](https://img.shields.io/badge/version-0.6.124-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
31
 
32
32
  <!-- prettier-ignore-start -->
33
33
  <!-- markdownlint-disable -->
@@ -0,0 +1,29 @@
1
+ import {loadConfig}from'c12';import Lo from'defu';import'date-fns/formatDistanceToNow';import Mo 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,PERFORMANCE:50,DEBUG:60,TRACE:70,ALL:100},p={SILENT:"silent",FATAL:"fatal",ERROR:"error",WARN:"warn",SUCCESS:"success",INFO:"info",PERFORMANCE:"performance",DEBUG:"debug",TRACE:"trace",ALL:"all"};var R={dark:{brand:"#2dd4bf",success:"#10b981",info:"#58a6ff",debug:"#8afafc",warning:"#f3d371",danger:"#D8314A",fatal:"#a40e26",performance:"#00ff00"}};var Fo={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}},te=()=>{let e=Mo;return (!e?.hex||!e?.bold?.hex||!e?.bgHex||!e?.whiteBright||!e?.white)&&(e=Fo),e};function se(){return process.platform!=="win32"?process.env.TERM!=="linux":!!process.env.WT_SESSION||!!process.env.TERMINUS_SUBLIME||process.env.ConEmuTask==="{cmd::Cmder}"||process.env.TERM_PROGRAM==="Terminus-Sublime"||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color"||process.env.TERM==="alacritty"||process.env.TERM==="rxvt-unicode"||process.env.TERM==="rxvt-unicode-256color"||process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var k=(e,o)=>se()?e:o,S={[p.ERROR]:k("\u2718","\xD7"),[p.FATAL]:k("\u{1F571}","\xD7"),[p.WARN]:k("\u26A0","\u203C"),[p.INFO]:k("\u2139","i"),[p.PERFORMANCE]:k("\u23F1","\u23F1"),[p.SUCCESS]:k("\u2714","\u221A"),[p.DEBUG]:k("\u{1F6E0}","D"),[p.TRACE]:k("\u2699","T"),[p.ALL]:k("\u2709","\u2192")};var v=(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 "performance":return c.PERFORMANCE;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}},ne=(e=c.INFO)=>e>=c.ALL?p.ALL:e>=c.TRACE?p.TRACE:e>=c.DEBUG?p.DEBUG:e>=c.PERFORMANCE?p.PERFORMANCE: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 X=(e=c.INFO,o={},t=te())=>{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||p.INFO;return e>$(i)||e<=c.SILENT||$(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[p.FATAL]} Fatal] `)}${t.bold.whiteBright(C(n))}
3
+ `);}:typeof e=="number"&&c.ERROR>=e?n=>{console.error(`
4
+ ${t.gray(v())} ${t.hex(a.danger??R.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(a.warning??R.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(a.success??R.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(a.info??R.dark.info)(`[${S[p.INFO]} Info] `)}${t.bold.whiteBright(C(n))}
11
+ `);}:typeof e=="number"&&c.PERFORMANCE>=e?n=>{console.debug(`
12
+ ${t.gray(v())} ${t.hex(a.performance??R.dark.performance)(`[${S[p.PERFORMANCE]} Performance] `)}${t.bold.whiteBright(C(n))}
13
+ `);}:typeof e=="number"&&c.DEBUG>=e?n=>{console.debug(`
14
+ ${t.gray(v())} ${t.hex(a.debug??R.dark.debug)(`[${S[p.DEBUG]} Debug] `)}${t.bold.whiteBright(C(n))}
15
+ `);}:typeof e=="number"&&c.TRACE>=e?n=>{console.debug(`
16
+ ${t.gray(v())} ${t.hex("#bbbbbb")(`[${S[p.TRACE]} Trace] `)}${t.bold.whiteBright(C(n))}
17
+ `);}:n=>{console.log(`
18
+ ${t.gray(v())} ${t.hex(a.brand??R.dark.brand)(`[${S[p.ALL]} System] `)}${t.bold.whiteBright(C(n))}
19
+ `);}};var ae=(e,o)=>X(c.WARN,o)(e);var Jr=(e,o)=>X(c.DEBUG,o)(e),A=(e,o)=>X(c.TRACE,o)(e);var Wo=6,C=(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)?`
20
+ ${e.map((n,m)=>` ${a}> #${m} = ${C(n,{prefix:`${a}-`,skip:i},t+1)}`).join(`
21
+ `)}`:typeof e=="object"?`
22
+ ${Object.keys(e).filter(n=>!i.includes(n)).map(n=>` ${a}> ${n} = ${Uo(e[n])?"<function>":typeof e[n]=="object"?C(e[n],{prefix:`${a}-`,skip:i},t+1):e[n]}`).join(`
23
+ `)}`:e},Uo=e=>{try{return e instanceof Function||typeof e=="function"||!!(e?.constructor&&e?.call&&e?.apply)}catch{return false}};var Bo=/^[A-Za-z]:\//;function jo(e=""){return e&&e.replace(/\\/g,"/").replace(Bo,o=>o.toUpperCase())}var Ho=/^[/\\]{2}/,Ko=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Zo=/^[A-Za-z]:$/;var l=function(e){if(!e||e.length===0)return ".";e=jo(e);let o=e?.match(Ho),t=ie(e),a=e[e.length-1]==="/";return e=Yo(e,!t),e.length===0?t?"/":a?"./":".":(a&&(e+="/"),Zo.test(e)&&(e+="/"),o?t?`//${e}`:`//./${e}`:t&&!ie(e)?`/${e}`:e)},T=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 l(o)};function Yo(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 O=t.lastIndexOf("/");O===-1?(t="",a=0):(t=t.slice(0,O),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 ie=function(e){return Ko.test(e)};var Vo=30,Jo=0;function Q(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!=="/"&&Jo++<Vo){let i=join(a,"..");return Q(i,o,t)}}var pe=["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"],Xo=[".storm-workspace",".nx",".git",".github",".vscode",".verdaccio"];function qo(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(Q(e??process.cwd(),pe,Xo))}function E(e){let o=qo(e);if(!o)throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
24
+ ${pe.join(`
25
+ `)}
26
+ Path: ${e||process.cwd()}`);return o}var le="https://docs.stormsoftware.com",_="https://stormsoftware.com";var de="https://stormsoftware.com/license",me="Apache-2.0";var N="tools/errors/codes.json",ue="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 b=r._default(h,"#cbd5e1");s.add(b,{description:"The light background color of the workspace"});var z=r._default(h,"#1fb2a6");s.add(z,{description:"The primary brand specific color of the workspace"});var x=r.optional(h);s.add(x,{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 M=r._default(h,"#45b27e");s.add(M,{description:"The success color of the workspace"});var F=r._default(h,"#38bdf8");s.add(F,{description:"The informational color of the workspace"});var W=r._default(h,"#8afafc");s.add(W,{description:"The debug color of the workspace"});var U=r._default(h,"#f3d371");s.add(U,{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,"#00ff00");s.add(H,{description:"The performance color of the workspace"});var K=r._default(h,"#4ade80");s.add(K,{description:"The positive number color of the workspace"});var Z=r._default(h,"#ef4444");s.add(Z,{description:"The negative number color of the workspace"});var Y=r.optional(r.array(h));s.add(Y,{description:"The color stops for the base gradient color pattern used in the workspace"});var rr=r.object({foreground:b,background:w,brand:z,alternate:x,accent:D,link:G,help:P,success:M,info:F,debug:W,warning:U,danger:B,fatal:j,performance:H,positive:K,negative:Z,gradient:Y}),tr=r.object({foreground:w,background:b,brand:z,alternate:x,accent:D,link:G,help:P,success:M,info:F,debug:W,warning:U,danger:B,fatal:j,performance:H,positive:K,negative:Z,gradient:Y}),sr=r.object({dark:rr,light:tr}),nr=r.object({dark:w,light:b,brand:z,alternate:x,accent:D,link:G,help:P,success:M,info:F,debug:W,warning:U,danger:B,fatal:j,performance:H,positive:K,negative:Z,gradient:Y}),L=r.optional(r.url());s.add(L,{description:"A remote registry URL used to publish distributable packages"});var ge=r._default(r.object({github:L,npm:L,cargo:L,cyclone:L,container:L}),{});s.add(ge,{description:"A list of remote registry URLs used by Storm Software"});var ee=r.union([nr,sr]);s.add(ee,{description:"Colors used for various workspace elements"});var fe=r.record(r.union([r.union([r.literal("base"),r.string()]),r.string()]),ee);s.add(fe,{description:"Storm theme config values used for styling various package elements"});var he=r.optional(r.union([r.string().check(r.trim()),r.array(r.string().check(r.trim()))]));s.add(he,{description:"The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration."});var Ce=r.string().check(r.trim());s.add(Ce,{description:"The workspace bot user's name (this is the bot that will be used to perform various tasks)"});var Ee=r.string().check(r.trim());s.add(Ee,{description:"The email of the workspace bot"});var Te=r.object({name:Ce,email:Ee});s.add(Te,{description:"The workspace's bot user's config used to automated various operations tasks"});var Re=r.optional(r.string().check(r.trim(),r.url()));s.add(Re,{description:"A URL to a banner image used to display the workspace's release"});var Se=r._default(r.string().check(r.trim()),ue);s.add(Se,{description:"The alt text for the workspace's release banner image"});var ve=r.object({url:Re,alt:Se});s.add(ve,{description:"The workspace's banner image used during the release process"});var ke=r.optional(r.string().check(r.trim()));s.add(ke,{description:"A header message appended to the start of the workspace's release notes"});var Oe=r.optional(r.string().check(r.trim()));s.add(Oe,{description:"A footer message appended to the end of the workspace's release notes"});var Ae=r.object({banner:r.union([ve,r.string().check(r.trim(),r.url())]),header:ke,footer:Oe});s.add(Ae,{description:"The workspace's release config used during the release process"});var $e=r.optional(r.string().check(r.trim()));s.add($e,{description:"A Twitter/X account associated with the organization/project"});var Le=r.optional(r.string().check(r.trim()));s.add(Le,{description:"A Discord account associated with the organization/project"});var _e=r.optional(r.string().check(r.trim()));s.add(_e,{description:"A Telegram account associated with the organization/project"});var Ie=r.optional(r.string().check(r.trim()));s.add(Ie,{description:"A Slack account associated with the organization/project"});var ye=r.optional(r.string().check(r.trim()));s.add(ye,{description:"A Medium account associated with the organization/project"});var Ne=r.optional(r.string().check(r.trim()));s.add(Ne,{description:"A GitHub account associated with the organization/project"});var we=r.object({twitter:$e,discord:Le,telegram:_e,slack:Ie,medium:ye,github:Ne});s.add(we,{description:"The workspace's account config used to store various social media links"});var be=r.optional(r.string().check(r.trim()));s.add(be,{description:"The directory used to store the environment's cached file data"});var ze=r.optional(r.string().check(r.trim()));s.add(ze,{description:"The directory used to store the environment's data files"});var xe=r.optional(r.string().check(r.trim()));s.add(xe,{description:"The directory used to store the environment's configuration files"});var De=r.optional(r.string().check(r.trim()));s.add(De,{description:"The directory used to store the environment's temp files"});var Ge=r.optional(r.string().check(r.trim()));s.add(Ge,{description:"The directory used to store the environment's log files"});var Pe=r._default(r.string().check(r.trim()),"dist");s.add(Pe,{description:"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"});var Me=r.object({cache:be,data:ze,config:xe,temp:De,log:Ge,build:Pe});s.add(Me,{description:"Various directories used by the workspace to store data, cache, and configuration files"});var Fe=r._default(r.enum(["minimal","monorepo"]),"monorepo");s.add(Fe,{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 Ue=r.optional(r.url());s.add(Ue,{description:"A URL to a page that looks up the workspace's error messages given a specific error code"});var Be=r.object({codesFile:We,url:Ue});s.add(Be,{description:"The workspace's error config used when creating error details during a system error"});var je=r.optional(r.string().check(r.trim(),r.toLowerCase()));s.add(je,{description:"The name of the organization"});var He=r.optional(r.string().check(r.trim()));s.add(He,{description:"A description of the organization"});var Ke=r.optional(r.url());s.add(Ke,{description:"A URL to the organization's logo image"});var Ze=r.optional(r.url());s.add(Ze,{description:"A URL to the organization's icon image"});var Ye=r.optional(r.url());s.add(Ye,{description:"A URL to a page that provides more information about the organization"});var Ve=r.object({name:je,description:He,logo:Ke,icon:Ze,url:Ye});s.add(Ve,{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 Xe=r.string().check(r.trim(),r.toLowerCase());s.add(Xe,{description:"The name of the workspace/project/service/package/scope using this configuration"});var qe=r.string().check(r.trim(),r.toLowerCase());s.add(qe,{description:"The namespace of the workspace/project/service/package/scope using this configuration"});var Qe=r.union([Ve,r.string().check(r.trim(),r.toLowerCase())]);s.add(Qe,{description:"The organization of the workspace. This can be a string or an object containing the organization's details"});var eo=r.string().check(r.trim(),r.toLowerCase());s.add(eo,{description:"The repo URL of the workspace (i.e. the GitHub repository URL)"});var oo=r._default(r.string().check(r.trim()),"Apache-2.0");s.add(oo,{description:"The license type of the package"});var ro=r.optional(r.url());s.add(ro,{description:"The homepage of the workspace"});var to=r.optional(r.url());s.add(to,{description:"The documentation site for the workspace"});var so=r.optional(r.url());s.add(so,{description:"The development portal site for the workspace"});var no=r.optional(r.url());s.add(no,{description:"The licensing site for the workspace"});var ao=r.optional(r.url());s.add(ao,{description:"The contact site for the workspace"});var io=r.optional(r.url());s.add(io,{description:"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"});var co=r._default(r.string().check(r.trim(),r.toLowerCase()),"main");s.add(co,{description:"The branch of the workspace"});var po=r.optional(r.string().check(r.trim(),r.toLowerCase()));s.add(po,{description:"A tag specifying the version pre-release identifier"});var lo=r.optional(r.string().check(r.trim(),r.toLowerCase()));s.add(lo,{description:"The owner of the package"});var mo=r._default(r.enum(["development","test","production"]).check(r.trim(),r.toLowerCase()),"production");s.add(mo,{description:"The current runtime environment mode for the package"});var uo=r.string().check(r.trim(),r.toLowerCase());s.add(uo,{description:"The root directory of the workspace"});var go=r._default(r.boolean(),false);s.add(go,{description:"Should all known types of workspace caching be skipped?"});var fo=r._default(r.enum(["npm","yarn","pnpm","bun"]),"npm");s.add(fo,{description:"The JavaScript/TypeScript package manager used by the repository"});var ho=r._default(r.string().check(r.trim()),"America/New_York");s.add(ho,{description:"The default timezone of the workspace"});var Co=r._default(r.string().check(r.trim()),"en-US");s.add(Co,{description:"The default locale of the workspace"});var Eo=r._default(r.enum(["silent","fatal","error","warn","success","info","performance","debug","trace","all"]),"info");s.add(Eo,{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 Ro=r._default(r.nullable(r.string().check(r.trim())),null);s.add(Ro,{description:"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."});var oe=r._default(r.record(r.string(),r.any()),{});s.add(oe,{description:"Configuration of each used extension"});var So=r.object({$schema:Je,extends:he,name:Xe,variant:Fe,namespace:qe,organization:Qe,repository:eo,license:oo,homepage:ro,docs:to,portal:so,licensing:no,contact:ao,support:io,branch:co,preid:po,owner:lo,bot:Te,release:Ae,socials:we,error:Be,mode:mo,workspaceRoot:uo,skipCache:go,directories:Me,packageManager:fo,timezone:ho,locale:Co,logLevel:Eo,skipConfigLogging:To,registry:ge,configFile:Ro,colors:r.union([ee,fe]),extensions:oe});s.add(oe,{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 vo=["dark","light","base","brand","alternate","accent","link","success","help","info","warning","danger","fatal","performance","positive","negative"];async function ko(e){let o=me,t,a,i,n,m,d=E(e);if(existsSync(join(d,"package.json"))){let O=await readFile(T(d,"package.json"),"utf8");if(O){let f=JSON.parse(O);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 Oo(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 $o=async(e,o,t={})=>{let a=o||E(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:T(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:T(process.env.STORM_CACHE_DIR||"node_modules/.cache/storm","jiti")},configFile:e,...t})]);return Lo(i[0]??{},i[1]??{})},_o=async(e,o=[])=>{let t=e||E(e),a=await $o("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=>$o(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=Lo(d.config??{},i??{}));}if(!(!i||Object.keys(i).length===0))return i.configFile=n,i};var wo=()=>{let e="STORM_",o={extends:process.env[`${e}EXTENDS`]||void 0,name:process.env[`${e}NAME`]||void 0,variant:process.env[`${e}VARIANT`]||void 0,namespace:process.env[`${e}NAMESPACE`]||void 0,owner:process.env[`${e}OWNER`]||void 0,bot:{name:process.env[`${e}BOT_NAME`]||void 0,email:process.env[`${e}BOT_EMAIL`]||void 0},release:{banner:{url:process.env[`${e}RELEASE_BANNER_URL`]||void 0,alt:process.env[`${e}RELEASE_BANNER_ALT`]||void 0},header:process.env[`${e}RELEASE_HEADER`]||void 0,footer:process.env[`${e}RELEASE_FOOTER`]||void 0},error:{codesFile:process.env[`${e}ERROR_CODES_FILE`]||void 0,url:process.env[`${e}ERROR_URL`]||void 0},socials:{twitter:process.env[`${e}SOCIAL_TWITTER`]||void 0,discord:process.env[`${e}SOCIAL_DISCORD`]||void 0,telegram:process.env[`${e}SOCIAL_TELEGRAM`]||void 0,slack:process.env[`${e}SOCIAL_SLACK`]||void 0,medium:process.env[`${e}SOCIAL_MEDIUM`]||void 0,github:process.env[`${e}SOCIAL_GITHUB`]||void 0},organization:process.env[`${e}ORG`]||process.env[`${e}ORGANIZATION`]||process.env[`${e}ORG_NAME`]||process.env[`${e}ORGANIZATION_NAME`]?process.env[`${e}ORG_DESCRIPTION`]||process.env[`${e}ORGANIZATION_DESCRIPTION`]||process.env[`${e}ORG_URL`]||process.env[`${e}ORGANIZATION_URL`]||process.env[`${e}ORG_LOGO`]||process.env[`${e}ORGANIZATION_LOGO`]?{name:process.env[`${e}ORG`]||process.env[`${e}ORGANIZATION`]||process.env[`${e}ORG_NAME`]||process.env[`${e}ORGANIZATION_NAME`],description:process.env[`${e}ORG_DESCRIPTION`]||process.env[`${e}ORGANIZATION_DESCRIPTION`]||void 0,url:process.env[`${e}ORG_URL`]||process.env[`${e}ORGANIZATION_URL`]||void 0,logo:process.env[`${e}ORG_LOGO`]||process.env[`${e}ORGANIZATION_LOGO`]||void 0,icon:process.env[`${e}ORG_ICON`]||process.env[`${e}ORGANIZATION_ICON`]||void 0}:process.env[`${e}ORG`]||process.env[`${e}ORGANIZATION`]||process.env[`${e}ORG_NAME`]||process.env[`${e}ORGANIZATION_NAME`]:void 0,packageManager:process.env[`${e}PACKAGE_MANAGER`]||void 0,license:process.env[`${e}LICENSE`]||void 0,homepage:process.env[`${e}HOMEPAGE`]||void 0,docs:process.env[`${e}DOCS`]||void 0,portal:process.env[`${e}PORTAL`]||void 0,licensing:process.env[`${e}LICENSING`]||void 0,contact:process.env[`${e}CONTACT`]||void 0,support:process.env[`${e}SUPPORT`]||void 0,timezone:process.env[`${e}TIMEZONE`]||process.env.TZ||void 0,locale:process.env[`${e}LOCALE`]||process.env.LOCALE||void 0,configFile:process.env[`${e}WORKSPACE_CONFIG_FILE`]?l(process.env[`${e}WORKSPACE_CONFIG_FILE`]):void 0,workspaceRoot:process.env[`${e}WORKSPACE_ROOT`]?l(process.env[`${e}WORKSPACE_ROOT`]):void 0,directories:{cache:process.env[`${e}CACHE_DIR`]?l(process.env[`${e}CACHE_DIR`]):process.env[`${e}CACHE_DIRECTORY`]?l(process.env[`${e}CACHE_DIRECTORY`]):void 0,data:process.env[`${e}DATA_DIR`]?l(process.env[`${e}DATA_DIR`]):process.env[`${e}DATA_DIRECTORY`]?l(process.env[`${e}DATA_DIRECTORY`]):void 0,config:process.env[`${e}CONFIG_DIR`]?l(process.env[`${e}CONFIG_DIR`]):process.env[`${e}CONFIG_DIRECTORY`]?l(process.env[`${e}CONFIG_DIRECTORY`]):void 0,temp:process.env[`${e}TEMP_DIR`]?l(process.env[`${e}TEMP_DIR`]):process.env[`${e}TEMP_DIRECTORY`]?l(process.env[`${e}TEMP_DIRECTORY`]):void 0,log:process.env[`${e}LOG_DIR`]?l(process.env[`${e}LOG_DIR`]):process.env[`${e}LOG_DIRECTORY`]?l(process.env[`${e}LOG_DIRECTORY`]):void 0,build:process.env[`${e}BUILD_DIR`]?l(process.env[`${e}BUILD_DIR`]):process.env[`${e}BUILD_DIRECTORY`]?l(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`]))?ne(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_`)&&vo.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]=Io(e,n),i),{}):Io(e),o.docs===le&&(o.homepage===_?o.docs=`${_}/projects/${o.name}/docs`:o.docs=`${o.homepage}/docs`),o.licensing===de&&(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},Io=(e,o)=>{let t=`COLOR_${o&&o!=="base"?`${o}_`:""}`.toUpperCase();return process.env[`${e}${t}LIGHT_BRAND`]||process.env[`${e}${t}DARK_BRAND`]?lr(e+t):pr(e+t)},pr=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`],debug:process.env[`${e}DEBUG`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],performance:process.env[`${e}PERFORMANCE`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}},lr=e=>({light:yo(`${e}_LIGHT_`),dark:yo(`${e}_DARK_`)}),yo=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`],debug:process.env[`${e}DEBUG`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],performance:process.env[`${e}PERFORMANCE`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}};var dr=(e,o)=>{for(let t of Object.keys(o??{}))if(o[t]){let 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];}},xo=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`]=l(e.configFile)),e.workspaceRoot&&(process.env[`${o}WORKSPACE_ROOT`]=l(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT=l(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT_PATH=l(e.workspaceRoot)),e.directories&&(!e.skipCache&&e.directories.cache&&(process.env[`${o}CACHE_DIR`]=l(e.directories.cache),process.env[`${o}CACHE_DIRECTORY`]=process.env[`${o}CACHE_DIR`]),e.directories.data&&(process.env[`${o}DATA_DIR`]=l(e.directories.data),process.env[`${o}DATA_DIRECTORY`]=process.env[`${o}DATA_DIR`]),e.directories.config&&(process.env[`${o}CONFIG_DIR`]=l(e.directories.config),process.env[`${o}CONFIG_DIRECTORY`]=process.env[`${o}CONFIG_DIR`]),e.directories.temp&&(process.env[`${o}TEMP_DIR`]=l(e.directories.temp),process.env[`${o}TEMP_DIRECTORY`]=process.env[`${o}TEMP_DIR`]),e.directories.log&&(process.env[`${o}LOG_DIR`]=l(e.directories.log),process.env[`${o}LOG_DIRECTORY`]=process.env[`${o}LOG_DIR`]),e.directories.build&&(process.env[`${o}BUILD_DIR`]=l(e.directories.build),process.env[`${o}BUILD_DIRECTORY`]=process.env[`${o}BUILD_DIR`])),e.skipCache!==void 0&&(process.env[`${o}SKIP_CACHE`]=String(e.skipCache),e.skipCache&&(process.env.NX_SKIP_NX_CACHE??=String(e.skipCache),process.env.NX_CACHE_PROJECT_GRAPH??=String(e.skipCache))),e.mode&&(process.env[`${o}MODE`]=e.mode,process.env.NODE_ENV=e.mode,process.env.ENVIRONMENT=e.mode),e.colors?.base?.light||e.colors?.base?.dark)for(let t of Object.keys(e.colors))bo(`${o}COLOR_${t}_`,e.colors[t]);else bo(`${o}COLOR_`,e.colors);e.repository&&(process.env[`${o}REPOSITORY`]=e.repository),e.branch&&(process.env[`${o}BRANCH`]=e.branch),e.preid&&(process.env[`${o}PRE_ID`]=String(e.preid)),e.registry&&(e.registry.github&&(process.env[`${o}REGISTRY_GITHUB`]=String(e.registry.github)),e.registry.npm&&(process.env[`${o}REGISTRY_NPM`]=String(e.registry.npm)),e.registry.cargo&&(process.env[`${o}REGISTRY_CARGO`]=String(e.registry.cargo)),e.registry.cyclone&&(process.env[`${o}REGISTRY_CYCLONE`]=String(e.registry.cyclone)),e.registry.container&&(process.env[`${o}REGISTRY_CONTAINER`]=String(e.registry.container))),e.logLevel&&(process.env[`${o}LOG_LEVEL`]=String(e.logLevel),process.env.LOG_LEVEL=String(e.logLevel),process.env.NX_VERBOSE_LOGGING=String($(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])&&dr(t,e.extensions[t]);},bo=(e,o)=>o?.light?.brand||o?.dark?.brand?ur(e,o):mr(e,o),mr=(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.debug&&(process.env[`${e}DEBUG`]=o.debug),o.warning&&(process.env[`${e}WARNING`]=o.warning),o.danger&&(process.env[`${e}DANGER`]=o.danger),o.fatal&&(process.env[`${e}FATAL`]=o.fatal),o.performance&&(process.env[`${e}PERFORMANCE`]=o.performance),o.positive&&(process.env[`${e}POSITIVE`]=o.positive),o.negative&&(process.env[`${e}NEGATIVE`]=o.negative),o.gradient)for(let t=0;t<o.gradient.length;t++)process.env[`${e}GRADIENT_${t}`]=o.gradient[t];},ur=(e,o)=>({light:zo(`${e}LIGHT_`,o.light),dark:zo(`${e}DARK_`,o.dark)}),zo=(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.debug&&(process.env[`${e}DEBUG`]=o.debug),o.warning&&(process.env[`${e}WARNING`]=o.warning),o.danger&&(process.env[`${e}DANGER`]=o.danger),o.fatal&&(process.env[`${e}FATAL`]=o.fatal),o.performance&&(process.env[`${e}PERFORMANCE`]=o.performance),o.positive&&(process.env[`${e}POSITIVE`]=o.positive),o.negative&&(process.env[`${e}NEGATIVE`]=o.negative),o.gradient)for(let t=0;t<o.gradient.length;t++)process.env[`${e}GRADIENT_${t}`]=o.gradient[t];};var I,fr=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=E());let d=wo(),O=await _o(m);if(!O&&(a||ae("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 ko(m),y=Lo(d,O,f);y.variant||(y.variant=existsSync(T(m,"nx.json"))||existsSync(T(m,".nx"))||existsSync(T(m,"lerna.json"))||existsSync(T(m,"turbo.json"))?"monorepo":"minimal");try{n=Oo(await So.parseAsync(y)),n.workspaceRoot??=m;}catch(J){throw new Error(`Failed to parse Storm Workspace configuration${J?.message?`: ${J.message}`:""}
27
+
28
+ Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${C(y)}`,{cause:J})}}else n=I.data;return I={timestamp:Date.now(),data:n},n},Do=async(e,o=false)=>{let t=await fr(void 0,void 0,e,o,true);return xo(t),!o&&!t.skipConfigLogging&&A(`\u2699\uFE0F Using Storm Workspace configuration:
29
+ ${C(t)}`,t),t};function Cr(e,o=false){return Do(e,o)}function Go(e=true,o={}){let t=o.workspaceRoot;return t||(t=E(o.cwd)),Cr(t,e)}function Po(e=E(process.cwd())){let o=T(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 Ss(e=E(process.cwd())){let o=await readFile(Po(e),"utf8");if(o)return parse(o)}async function vs(e,o=E(process.cwd())){let t=await Go(),a=stringify(e);A(`Writing updated pnpm-workspace.yaml file to workspace root: ${a}`,t),await writeFile(Po(o),a);}export{ae as a,Jr as b,A as c,T as d,E as e,Go as f,Po as g,Ss as h,vs as i};
@@ -1,2 +1,2 @@
1
- import {h as h$1,e,i,f,c,b,a}from'./chunk-I4FQEZQN.js';import {exec}from'node:child_process';import {valid,coerce,gt}from'semver';var _="latest";var l=_;async function h(t="npm"){return new Promise((r,e)=>{exec(`${t} config get registry`,(o,g,s)=>o&&!o.message.toLowerCase().trim().startsWith("npm warn")?e(o):s&&!s.toLowerCase().trim().startsWith("npm warn")?e(s):r(g.trim()));})}async function R(t,r=l,e={}){let o=e.executable||"npm",g=e.registry||await h(o);return new Promise((s,a)=>{exec(`${o} view ${t} version --registry=${g} --tag=${r}`,(n,c,i)=>n&&!n.message.toLowerCase().trim().startsWith("npm warn")?a(n):i&&!i.toLowerCase().trim().startsWith("npm warn")?a(i):s(c.trim()));})}async function C(t=e(process.cwd())){let r=await h$1(t);if(!r)throw new Error("No pnpm-workspace.yaml file found");if(r?.catalog)return Object.fromEntries(Object.entries(r.catalog).map(([e,o])=>[e,o.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in pnpm-workspace.yaml file located in workspace root: ${t}
1
+ import {h as h$1,e,i,f,c,b,a}from'./chunk-35AD6SOZ.js';import {exec}from'node:child_process';import {valid,coerce,gt}from'semver';var _="latest";var l=_;async function h(t="npm"){return new Promise((r,e)=>{exec(`${t} config get registry`,(o,g,s)=>o&&!o.message.toLowerCase().trim().startsWith("npm warn")?e(o):s&&!s.toLowerCase().trim().startsWith("npm warn")?e(s):r(g.trim()));})}async function R(t,r=l,e={}){let o=e.executable||"npm",g=e.registry||await h(o);return new Promise((s,a)=>{exec(`${o} view ${t} version --registry=${g} --tag=${r}`,(n,c,i)=>n&&!n.message.toLowerCase().trim().startsWith("npm warn")?a(n):i&&!i.toLowerCase().trim().startsWith("npm warn")?a(i):s(c.trim()));})}async function C(t=e(process.cwd())){let r=await h$1(t);if(!r)throw new Error("No pnpm-workspace.yaml file found");if(r?.catalog)return Object.fromEntries(Object.entries(r.catalog).map(([e,o])=>[e,o.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in pnpm-workspace.yaml file located in workspace root: ${t}
2
2
  File content: ${JSON.stringify(r,null,2)}`);}async function M(t=e(process.cwd())){let r=await C(t);if(!r)throw new Error("No catalog entries found in pnpm-workspace.yaml file");return r}async function I(t,r=e(process.cwd())){let e=await h$1(r);if(!e)throw new Error("No pnpm-workspace.yaml file found");e.catalog=Object.fromEntries(Object.entries(t).map(([o,g])=>[o,g.replaceAll('"',"").replaceAll("'","")])),await i(e,r);}async function Z(t,r,e$1={}){let{tag:o=l,prefix:g="^",workspaceRoot:s=e()}=e$1,a=await f(true,{workspaceRoot:s});c(`Upgrading catalog entry for package "${r}" with tag "${o}"`,a);let n=await R(r,o,{executable:"pnpm"}),c$1=`${g||""}${n.replace(/^[\^~><=*]+/g,"")}`,i=false;return !valid(coerce(t[r]))||coerce(t[r])&&coerce(c$1)&&gt(coerce(c$1),coerce(t[r]))?(t[r]=`${g||""}${c$1.replace(/^[\^~><=*]+/g,"")}`,b(`Writing version ${t[r]} to catalog for "${r}" package`,a),i=true):b(`The current version ${t[r]} for package "${r}" is greater than or equal to the version ${c$1} fetched from the npm registry with tag "${o}". No update performed.`,a),{catalog:t,updated:i}}async function tt(t,r={}){let{tag:e$1=l,prefix:o="^",throwIfMissingInCatalog:g=false,workspaceRoot:s=e()}=r,a$1=await f(true,{workspaceRoot:s}),n=await M(s);if(!n)throw new Error("No catalog found");if(g===true&&!n[t])throw new Error(`Package "${t}" not found in catalog: ${JSON.stringify(n,null,2)}`);c(`Upgrading catalog entry for package "${t}" with tag "${e$1}"`,a$1);let c$1=await R(t,e$1,{executable:"pnpm"}),i=`${o||""}${c$1.replace(/^[\^~><=*]+/g,"")}`;i===n[t]?c(`The version for package "${t}" is already up to date in the catalog: ${i}`,a$1):!valid(coerce(n[t]))||coerce(n[t])&&coerce(i)&&gt(coerce(i),coerce(n[t]))?(n[t]=`${o||""}${i.replace(/^[\^~><=*]+/g,"")}`,b(`Writing version ${n[t]} to catalog for "${t}" package`,a$1),await I(n,s)):a(`The current version "${n[t]}" for package "${t}" is greater than or equal to the version "${i}" fetched from the npm registry with tag "${e$1}". No update performed.`,a$1);}export{C as a,M as b,I as c,Z as d,tt as e};
@@ -1 +1 @@
1
- import {b}from'./chunk-2D7XRLNQ.js';import {d,e}from'./chunk-I4FQEZQN.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),a=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.`),a;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];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 r=>{let o=n.nodes[r];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 r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];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(a),{parser:"json",proseWrap:"preserve",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-packagejson"]}))}export{$ as a};
1
+ import {b}from'./chunk-3NEBMUX3.js';import {d,e}from'./chunk-35AD6SOZ.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),a=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.`),a;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];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 r=>{let o=n.nodes[r];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 r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];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(a),{parser:"json",proseWrap:"preserve",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-packagejson"]}))}export{$ as a};
@@ -0,0 +1,29 @@
1
+ 'use strict';var c12=require('c12'),$o=require('defu');require('date-fns/formatDistanceToNow');var Po=require('chalk'),fs=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 $o__default=/*#__PURE__*/_interopDefault($o);var Po__default=/*#__PURE__*/_interopDefault(Po);var r__namespace=/*#__PURE__*/_interopNamespace(r);var c={SILENT:0,FATAL:10,ERROR:20,WARN:30,SUCCESS:35,INFO:40,PERFORMANCE:50,DEBUG:60,TRACE:70,ALL:100},p={SILENT:"silent",FATAL:"fatal",ERROR:"error",WARN:"warn",SUCCESS:"success",INFO:"info",PERFORMANCE:"performance",DEBUG:"debug",TRACE:"trace",ALL:"all"};var T={dark:{brand:"#2dd4bf",success:"#10b981",info:"#58a6ff",debug:"#8afafc",warning:"#f3d371",danger:"#D8314A",fatal:"#a40e26",performance:"#00ff00"}};var Mo={hex:e=>o=>o,bgHex:e=>({whiteBright:o=>o,white:o=>o}),white:e=>e,whiteBright:e=>e,gray:e=>e,bold:{hex:e=>o=>o,bgHex:e=>({whiteBright:o=>o,white:o=>o}),whiteBright:e=>e,white:e=>e},dim:{hex:e=>o=>o,gray:e=>e}},re=()=>{let e=Po__default.default;return (!e?.hex||!e?.bold?.hex||!e?.bgHex||!e?.whiteBright||!e?.white)&&(e=Mo),e};function te(){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 v=(e,o)=>te()?e:o,R={[p.ERROR]:v("\u2718","\xD7"),[p.FATAL]:v("\u{1F571}","\xD7"),[p.WARN]:v("\u26A0","\u203C"),[p.INFO]:v("\u2139","i"),[p.PERFORMANCE]:v("\u23F1","\u23F1"),[p.SUCCESS]:v("\u2714","\u221A"),[p.DEBUG]:v("\u{1F6E0}","D"),[p.TRACE]:v("\u2699","T"),[p.ALL]:v("\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 "performance":return c.PERFORMANCE;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}},se=(e=c.INFO)=>e>=c.ALL?p.ALL:e>=c.TRACE?p.TRACE:e>=c.DEBUG?p.DEBUG:e>=c.PERFORMANCE?p.PERFORMANCE: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 J=(e=c.INFO,o={},t=re())=>{let a=!o.colors?.dark&&!o.colors?.base&&!o.colors?.base?.dark?T: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:T,i=o.logLevel||process.env.STORM_LOG_LEVEL||p.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??T.dark.fatal)(`[${R[p.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??T.dark.danger)(`[${R[p.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??T.dark.warning)(`[${R[p.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??T.dark.success)(`[${R[p.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??T.dark.info)(`[${R[p.INFO]} Info] `)}${t.bold.whiteBright(h(n))}
11
+ `);}:typeof e=="number"&&c.PERFORMANCE>=e?n=>{console.debug(`
12
+ ${t.gray(S())} ${t.hex(a.performance??T.dark.performance)(`[${R[p.PERFORMANCE]} Performance] `)}${t.bold.whiteBright(h(n))}
13
+ `);}:typeof e=="number"&&c.DEBUG>=e?n=>{console.debug(`
14
+ ${t.gray(S())} ${t.hex(a.debug??T.dark.debug)(`[${R[p.DEBUG]} Debug] `)}${t.bold.whiteBright(h(n))}
15
+ `);}:typeof e=="number"&&c.TRACE>=e?n=>{console.debug(`
16
+ ${t.gray(S())} ${t.hex("#bbbbbb")(`[${R[p.TRACE]} Trace] `)}${t.bold.whiteBright(h(n))}
17
+ `);}:n=>{console.log(`
18
+ ${t.gray(S())} ${t.hex(a.brand??T.dark.brand)(`[${R[p.ALL]} System] `)}${t.bold.whiteBright(h(n))}
19
+ `);}};var ne=(e,o)=>J(c.WARN,o)(e);var Vr=(e,o)=>J(c.DEBUG,o)(e),O=(e,o)=>J(c.TRACE,o)(e);var Fo=6,h=(e,o={},t=0)=>{if(t>Fo)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)?`
20
+ ${e.map((n,m)=>` ${a}> #${m} = ${h(n,{prefix:`${a}-`,skip:i},t+1)}`).join(`
21
+ `)}`:typeof e=="object"?`
22
+ ${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(`
23
+ `)}`:e},Wo=e=>{try{return e instanceof Function||typeof e=="function"||!!(e?.constructor&&e?.call&&e?.apply)}catch{return false}};var Uo=/^[A-Za-z]:\//;function Bo(e=""){return e&&e.replace(/\\/g,"/").replace(Uo,o=>o.toUpperCase())}var jo=/^[/\\]{2}/,Ho=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Ko=/^[A-Za-z]:$/;var l=function(e){if(!e||e.length===0)return ".";e=Bo(e);let o=e?.match(jo),t=ae(e),a=e[e.length-1]==="/";return e=Zo(e,!t),e.length===0?t?"/":a?"./":".":(a&&(e+="/"),Ko.test(e)&&(e+="/"),o?t?`//${e}`:`//./${e}`:t&&!ae(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 l(o)};function Zo(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 ae=function(e){return Ho.test(e)};var Yo=30,Vo=0;function q(e,o=[],t=[]){let a=e??process.cwd();if(t.some(i=>fs.existsSync(path.join(a,i)))||o.some(i=>fs.existsSync(path.join(a,i))))return a;if(a!=="/"&&Vo++<Yo){let i=path.join(a,"..");return q(i,o,t)}}var ce=["storm-workspace.json","storm-workspace.yaml","storm-workspace.yml","storm-workspace.js","storm-workspace.ts",".storm-workspace.json",".storm-workspace.yaml",".storm-workspace.yml",".storm-workspace.js",".storm-workspace.ts","lerna.json","nx.json","turbo.json","npm-workspace.json","yarn-workspace.json","pnpm-workspace.json","npm-workspace.yaml","yarn-workspace.yaml","pnpm-workspace.yaml","npm-workspace.yml","yarn-workspace.yml","pnpm-workspace.yml","npm-lock.json","yarn-lock.json","pnpm-lock.json","npm-lock.yaml","yarn-lock.yaml","pnpm-lock.yaml","npm-lock.yml","yarn-lock.yml","pnpm-lock.yml","bun.lockb"],Jo=[".storm-workspace",".nx",".git",".github",".vscode",".verdaccio"];function Xo(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(q(e??process.cwd(),ce,Jo))}function C(e){let o=Xo(e);if(!o)throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
24
+ ${ce.join(`
25
+ `)}
26
+ Path: ${e||process.cwd()}`);return o}var pe="https://docs.stormsoftware.com",L="https://stormsoftware.com";var le="https://stormsoftware.com/license",de="Apache-2.0";var y="tools/errors/codes.json",me="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 b=r__namespace._default(f,"#1fb2a6");s.add(b,{description:"The primary brand specific color of the workspace"});var z=r__namespace.optional(f);s.add(z,{description:"The alternate brand specific color of the workspace"});var x=r__namespace.optional(f);s.add(x,{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 M=r__namespace._default(f,"#38bdf8");s.add(M,{description:"The informational color of the workspace"});var F=r__namespace._default(f,"#8afafc");s.add(F,{description:"The debug color of the workspace"});var W=r__namespace._default(f,"#f3d371");s.add(W,{description:"The warning color of the workspace"});var U=r__namespace._default(f,"#d8314a");s.add(U,{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,"#00ff00");s.add(j,{description:"The performance color of the workspace"});var H=r__namespace._default(f,"#4ade80");s.add(H,{description:"The positive number color of the workspace"});var K=r__namespace._default(f,"#ef4444");s.add(K,{description:"The negative number color of the workspace"});var Z=r__namespace.optional(r__namespace.array(f));s.add(Z,{description:"The color stops for the base gradient color pattern used in the workspace"});var or=r__namespace.object({foreground:w,background:N,brand:b,alternate:z,accent:x,link:D,help:G,success:P,info:M,debug:F,warning:W,danger:U,fatal:B,performance:j,positive:H,negative:K,gradient:Z}),rr=r__namespace.object({foreground:N,background:w,brand:b,alternate:z,accent:x,link:D,help:G,success:P,info:M,debug:F,warning:W,danger:U,fatal:B,performance:j,positive:H,negative:K,gradient:Z}),tr=r__namespace.object({dark:or,light:rr}),sr=r__namespace.object({dark:N,light:w,brand:b,alternate:z,accent:x,link:D,help:G,success:P,info:M,debug:F,warning:W,danger:U,fatal:B,performance:j,positive:H,negative:K,gradient:Z}),$=r__namespace.optional(r__namespace.url());s.add($,{description:"A remote registry URL used to publish distributable packages"});var ue=r__namespace._default(r__namespace.object({github:$,npm:$,cargo:$,cyclone:$,container:$}),{});s.add(ue,{description:"A list of remote registry URLs used by Storm Software"});var Q=r__namespace.union([sr,tr]);s.add(Q,{description:"Colors used for various workspace elements"});var ge=r__namespace.record(r__namespace.union([r__namespace.union([r__namespace.literal("base"),r__namespace.string()]),r__namespace.string()]),Q);s.add(ge,{description:"Storm theme config values used for styling various package elements"});var fe=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(fe,{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 he=r__namespace.string().check(r__namespace.trim());s.add(he,{description:"The workspace bot user's name (this is the bot that will be used to perform various tasks)"});var Ce=r__namespace.string().check(r__namespace.trim());s.add(Ce,{description:"The email of the workspace bot"});var Ee=r__namespace.object({name:he,email:Ce});s.add(Ee,{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 Re=r__namespace._default(r__namespace.string().check(r__namespace.trim()),me);s.add(Re,{description:"The alt text for the workspace's release banner image"});var Se=r__namespace.object({url:Te,alt:Re});s.add(Se,{description:"The workspace's banner image used during the release process"});var ve=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(ve,{description:"A header message appended to the start of the workspace's release notes"});var ke=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(ke,{description:"A footer message appended to the end of the workspace's release notes"});var Oe=r__namespace.object({banner:r__namespace.union([Se,r__namespace.string().check(r__namespace.trim(),r__namespace.url())]),header:ve,footer:ke});s.add(Oe,{description:"The workspace's release config used during the release process"});var Ae=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Ae,{description:"A Twitter/X account associated with the organization/project"});var $e=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add($e,{description:"A Discord account associated with the organization/project"});var Le=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Le,{description:"A Telegram account associated with the organization/project"});var _e=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(_e,{description:"A Slack account associated with the organization/project"});var Ie=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Ie,{description:"A Medium account associated with the organization/project"});var ye=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(ye,{description:"A GitHub account associated with the organization/project"});var Ne=r__namespace.object({twitter:Ae,discord:$e,telegram:Le,slack:_e,medium:Ie,github:ye});s.add(Ne,{description:"The workspace's account config used to store various social media links"});var we=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(we,{description:"The directory used to store the environment's cached file data"});var be=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(be,{description:"The directory used to store the environment's data 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 configuration 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 temp files"});var De=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(De,{description:"The directory used to store the environment's log files"});var Ge=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"dist");s.add(Ge,{description:"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"});var Pe=r__namespace.object({cache:we,data:be,config:ze,temp:xe,log:De,build:Ge});s.add(Pe,{description:"Various directories used by the workspace to store data, cache, and configuration files"});var Me=r__namespace._default(r__namespace.enum(["minimal","monorepo"]),"monorepo");s.add(Me,{description:"The variant of the workspace. This can be used to enable or disable certain features or configurations."});var Fe=r__namespace._default(r__namespace.string().check(r__namespace.trim()),y);s.add(Fe,{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 Ue=r__namespace.object({codesFile:Fe,url:We});s.add(Ue,{description:"The workspace's error config used when creating error details during a system error"});var Be=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));s.add(Be,{description:"The name of the organization"});var je=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(je,{description:"A description of the organization"});var He=r__namespace.optional(r__namespace.url());s.add(He,{description:"A URL to the organization's logo image"});var Ke=r__namespace.optional(r__namespace.url());s.add(Ke,{description:"A URL to the organization's icon image"});var Ze=r__namespace.optional(r__namespace.url());s.add(Ze,{description:"A URL to a page that provides more information about the organization"});var Ye=r__namespace.object({name:Be,description:je,logo:He,icon:Ke,url:Ze});s.add(Ye,{description:"The workspace's organization details"});var Ve=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(Ve,{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 Xe=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(Xe,{description:"The namespace of the workspace/project/service/package/scope using this configuration"});var qe=r__namespace.union([Ye,r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase())]);s.add(qe,{description:"The organization of the workspace. This can be a string or an object containing the organization's details"});var Qe=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(Qe,{description:"The repo URL of the workspace (i.e. the GitHub repository URL)"});var eo=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"Apache-2.0");s.add(eo,{description:"The license type of the package"});var oo=r__namespace.optional(r__namespace.url());s.add(oo,{description:"The homepage of the workspace"});var ro=r__namespace.optional(r__namespace.url());s.add(ro,{description:"The documentation site for the workspace"});var to=r__namespace.optional(r__namespace.url());s.add(to,{description:"The development portal site for the workspace"});var so=r__namespace.optional(r__namespace.url());s.add(so,{description:"The licensing site for the workspace"});var no=r__namespace.optional(r__namespace.url());s.add(no,{description:"The contact site for the workspace"});var ao=r__namespace.optional(r__namespace.url());s.add(ao,{description:"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"});var io=r__namespace._default(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()),"main");s.add(io,{description:"The branch of the workspace"});var co=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));s.add(co,{description:"A tag specifying the version pre-release identifier"});var po=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));s.add(po,{description:"The owner of the package"});var lo=r__namespace._default(r__namespace.enum(["development","test","production"]).check(r__namespace.trim(),r__namespace.toLowerCase()),"production");s.add(lo,{description:"The current runtime environment mode for the package"});var mo=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(mo,{description:"The root directory of the workspace"});var uo=r__namespace._default(r__namespace.boolean(),false);s.add(uo,{description:"Should all known types of workspace caching be skipped?"});var go=r__namespace._default(r__namespace.enum(["npm","yarn","pnpm","bun"]),"npm");s.add(go,{description:"The JavaScript/TypeScript package manager used by the repository"});var fo=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"America/New_York");s.add(fo,{description:"The default timezone of the workspace"});var ho=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"en-US");s.add(ho,{description:"The default locale of the workspace"});var Co=r__namespace._default(r__namespace.enum(["silent","fatal","error","warn","success","info","performance","debug","trace","all"]),"info");s.add(Co,{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 Eo=r__namespace._default(r__namespace.boolean(),true);s.add(Eo,{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 ee=r__namespace._default(r__namespace.record(r__namespace.string(),r__namespace.any()),{});s.add(ee,{description:"Configuration of each used extension"});var Ro=r__namespace.object({$schema:Ve,extends:fe,name:Je,variant:Me,namespace:Xe,organization:qe,repository:Qe,license:eo,homepage:oo,docs:ro,portal:to,licensing:so,contact:no,support:ao,branch:io,preid:co,owner:po,bot:Ee,release:Oe,socials:Ne,error:Ue,mode:lo,workspaceRoot:mo,skipCache:uo,directories:Pe,packageManager:go,timezone:fo,locale:ho,logLevel:Co,skipConfigLogging:Eo,registry:ue,configFile:To,colors:r__namespace.union([Q,ge]),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 So=["dark","light","base","brand","alternate","accent","link","success","help","info","warning","danger","fatal","performance","positive","negative"];async function vo(e){let o=de,t,a,i,n,m,d=C(e);if(fs.existsSync(path.join(d,"package.json"))){let k=await promises.readFile(E(d,"package.json"),"utf8");if(k){let g=JSON.parse(k);g.name&&(i=g.name),g.namespace&&(n=g.namespace),g.repository&&(typeof g.repository=="string"?m=g.repository:g.repository.url&&(m=g.repository.url)),g.license&&(o=g.license),g.homepage&&(t=g.homepage),g.bugs&&(typeof g.bugs=="string"?a=g.bugs:g.bugs.url&&(a=g.bugs.url));}}return {workspaceRoot:d,name:i,namespace:n,repository:m,license:o,homepage:t,support:a}}function ko(e){return !e.support&&e.contact&&(e.support=e.contact),!e.contact&&e.support&&(e.contact=e.support),e.homepage&&(e.docs||(e.docs=`${e.homepage}/docs`),e.license||(e.license=`${e.homepage}/license`),e.support||(e.support=`${e.homepage}/support`),e.contact||(e.contact=`${e.homepage}/contact`),(!e.error?.codesFile||!e?.error?.url)&&(e.error??={codesFile:y},e.homepage&&(e.error.url??=`${e.homepage}/errors`))),e}var Ao=async(e,o,t={})=>{let a=o||C(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:E(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:E(process.env.STORM_CACHE_DIR||"node_modules/.cache/storm","jiti")},configFile:e,...t})]);return $o__default.default(i[0]??{},i[1]??{})},Lo=async(e,o=[])=>{let t=e||C(e),a=await Ao("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=>Ao(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=$o__default.default(d.config??{},i??{}));}if(!(!i||Object.keys(i).length===0))return i.configFile=n,i};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`]?l(process.env[`${e}WORKSPACE_CONFIG_FILE`]):void 0,workspaceRoot:process.env[`${e}WORKSPACE_ROOT`]?l(process.env[`${e}WORKSPACE_ROOT`]):void 0,directories:{cache:process.env[`${e}CACHE_DIR`]?l(process.env[`${e}CACHE_DIR`]):process.env[`${e}CACHE_DIRECTORY`]?l(process.env[`${e}CACHE_DIRECTORY`]):void 0,data:process.env[`${e}DATA_DIR`]?l(process.env[`${e}DATA_DIR`]):process.env[`${e}DATA_DIRECTORY`]?l(process.env[`${e}DATA_DIRECTORY`]):void 0,config:process.env[`${e}CONFIG_DIR`]?l(process.env[`${e}CONFIG_DIR`]):process.env[`${e}CONFIG_DIRECTORY`]?l(process.env[`${e}CONFIG_DIRECTORY`]):void 0,temp:process.env[`${e}TEMP_DIR`]?l(process.env[`${e}TEMP_DIR`]):process.env[`${e}TEMP_DIRECTORY`]?l(process.env[`${e}TEMP_DIRECTORY`]):void 0,log:process.env[`${e}LOG_DIR`]?l(process.env[`${e}LOG_DIR`]):process.env[`${e}LOG_DIRECTORY`]?l(process.env[`${e}LOG_DIRECTORY`]):void 0,build:process.env[`${e}BUILD_DIR`]?l(process.env[`${e}BUILD_DIR`]):process.env[`${e}BUILD_DIRECTORY`]?l(process.env[`${e}BUILD_DIRECTORY`]):void 0},skipCache:process.env[`${e}SKIP_CACHE`]!==void 0?!!process.env[`${e}SKIP_CACHE`]:void 0,mode:(process.env[`${e}MODE`]??process.env.NODE_ENV??process.env.ENVIRONMENT)||void 0,repository:process.env[`${e}REPOSITORY`]||void 0,branch:process.env[`${e}BRANCH`]||void 0,preid:process.env[`${e}PRE_ID`]||void 0,registry:{github:process.env[`${e}REGISTRY_GITHUB`]||void 0,npm:process.env[`${e}REGISTRY_NPM`]||void 0,cargo:process.env[`${e}REGISTRY_CARGO`]||void 0,cyclone:process.env[`${e}REGISTRY_CYCLONE`]||void 0,container:process.env[`${e}REGISTRY_CONTAINER`]||void 0},logLevel:process.env[`${e}LOG_LEVEL`]!==null&&process.env[`${e}LOG_LEVEL`]!==void 0?process.env[`${e}LOG_LEVEL`]&&Number.isSafeInteger(Number.parseInt(process.env[`${e}LOG_LEVEL`]))?se(Number.parseInt(process.env[`${e}LOG_LEVEL`])):process.env[`${e}LOG_LEVEL`]:void 0,skipConfigLogging:process.env[`${e}SKIP_CONFIG_LOGGING`]!==void 0?!!process.env[`${e}SKIP_CONFIG_LOGGING`]:void 0},t=Object.keys(process.env).filter(i=>i.startsWith(`${e}COLOR_`)&&So.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===pe&&(o.homepage===L?o.docs=`${L}/projects/${o.name}/docs`:o.docs=`${o.homepage}/docs`),o.licensing===le&&(o.homepage===L?o.licensing=`${L}/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`]?pr(e+t):cr(e+t)},cr=e=>{let o=[];if(process.env[`${e}GRADIENT_START`]&&process.env[`${e}GRADIENT_END`])o.push(process.env[`${e}GRADIENT_START`],process.env[`${e}GRADIENT_END`]);else if(process.env[`${e}GRADIENT_0`]||process.env[`${e}GRADIENT_1`]){let t=process.env[`${e}GRADIENT_0`]?0:1;for(;process.env[`${e}GRADIENT_${t}`];)o.push(process.env[`${e}GRADIENT_${t}`]),t++;}return {dark:process.env[`${e}DARK`],light:process.env[`${e}LIGHT`],brand:process.env[`${e}BRAND`],alternate:process.env[`${e}ALTERNATE`],accent:process.env[`${e}ACCENT`],link:process.env[`${e}LINK`],help:process.env[`${e}HELP`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],debug:process.env[`${e}DEBUG`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],performance:process.env[`${e}PERFORMANCE`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}},pr=e=>({light:Io(`${e}_LIGHT_`),dark:Io(`${e}_DARK_`)}),Io=e=>{let o=[];if(process.env[`${e}GRADIENT_START`]&&process.env[`${e}GRADIENT_END`])o.push(process.env[`${e}GRADIENT_START`],process.env[`${e}GRADIENT_END`]);else if(process.env[`${e}GRADIENT_0`]||process.env[`${e}GRADIENT_1`]){let t=process.env[`${e}GRADIENT_0`]?0:1;for(;process.env[`${e}GRADIENT_${t}`];)o.push(process.env[`${e}GRADIENT_${t}`]),t++;}return {foreground:process.env[`${e}FOREGROUND`],background:process.env[`${e}BACKGROUND`],brand:process.env[`${e}BRAND`],alternate:process.env[`${e}ALTERNATE`],accent:process.env[`${e}ACCENT`],link:process.env[`${e}LINK`],help:process.env[`${e}HELP`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],debug:process.env[`${e}DEBUG`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],performance:process.env[`${e}PERFORMANCE`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}};var lr=(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`]=l(e.configFile)),e.workspaceRoot&&(process.env[`${o}WORKSPACE_ROOT`]=l(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT=l(e.workspaceRoot),process.env.NX_WORKSPACE_ROOT_PATH=l(e.workspaceRoot)),e.directories&&(!e.skipCache&&e.directories.cache&&(process.env[`${o}CACHE_DIR`]=l(e.directories.cache),process.env[`${o}CACHE_DIRECTORY`]=process.env[`${o}CACHE_DIR`]),e.directories.data&&(process.env[`${o}DATA_DIR`]=l(e.directories.data),process.env[`${o}DATA_DIRECTORY`]=process.env[`${o}DATA_DIR`]),e.directories.config&&(process.env[`${o}CONFIG_DIR`]=l(e.directories.config),process.env[`${o}CONFIG_DIRECTORY`]=process.env[`${o}CONFIG_DIR`]),e.directories.temp&&(process.env[`${o}TEMP_DIR`]=l(e.directories.temp),process.env[`${o}TEMP_DIRECTORY`]=process.env[`${o}TEMP_DIR`]),e.directories.log&&(process.env[`${o}LOG_DIR`]=l(e.directories.log),process.env[`${o}LOG_DIRECTORY`]=process.env[`${o}LOG_DIR`]),e.directories.build&&(process.env[`${o}BUILD_DIR`]=l(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))wo(`${o}COLOR_${t}_`,e.colors[t]);else wo(`${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])&&lr(t,e.extensions[t]);},wo=(e,o)=>o?.light?.brand||o?.dark?.brand?mr(e,o):dr(e,o),dr=(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.debug&&(process.env[`${e}DEBUG`]=o.debug),o.warning&&(process.env[`${e}WARNING`]=o.warning),o.danger&&(process.env[`${e}DANGER`]=o.danger),o.fatal&&(process.env[`${e}FATAL`]=o.fatal),o.performance&&(process.env[`${e}PERFORMANCE`]=o.performance),o.positive&&(process.env[`${e}POSITIVE`]=o.positive),o.negative&&(process.env[`${e}NEGATIVE`]=o.negative),o.gradient)for(let t=0;t<o.gradient.length;t++)process.env[`${e}GRADIENT_${t}`]=o.gradient[t];},mr=(e,o)=>({light:bo(`${e}LIGHT_`,o.light),dark:bo(`${e}DARK_`,o.dark)}),bo=(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.debug&&(process.env[`${e}DEBUG`]=o.debug),o.warning&&(process.env[`${e}WARNING`]=o.warning),o.danger&&(process.env[`${e}DANGER`]=o.danger),o.fatal&&(process.env[`${e}FATAL`]=o.fatal),o.performance&&(process.env[`${e}PERFORMANCE`]=o.performance),o.positive&&(process.env[`${e}POSITIVE`]=o.positive),o.negative&&(process.env[`${e}NEGATIVE`]=o.negative),o.gradient)for(let t=0;t<o.gradient.length;t++)process.env[`${e}GRADIENT_${t}`]=o.gradient[t];};var _,gr=async(e,o,t,a=false,i=true)=>{let n;if(!_?.data||!_?.timestamp||_.timestamp<Date.now()-8e3){let m=t;m||(m=C());let d=No(),k=await Lo(m);if(!k&&(a||ne("No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n",{logLevel:"all"}),i===false))return;let g=await vo(m),I=$o__default.default(d,k,g);I.variant||(I.variant=fs.existsSync(E(m,"nx.json"))||fs.existsSync(E(m,".nx"))||fs.existsSync(E(m,"lerna.json"))||fs.existsSync(E(m,"turbo.json"))?"monorepo":"minimal");try{n=ko(await Ro.parseAsync(I)),n.workspaceRoot??=m;}catch(V){throw new Error(`Failed to parse Storm Workspace configuration${V?.message?`: ${V.message}`:""}
27
+
28
+ Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${h(I)}`,{cause:V})}}else n=_.data;return _={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&&O(`\u2699\uFE0F Using Storm Workspace configuration:
29
+ ${h(t)}`,t),t};function hr(e,o=false){return xo(e,o)}function Do(e=true,o={}){let t=o.workspaceRoot;return t||(t=C(o.cwd)),hr(t,e)}function Go(e=C(process.cwd())){let o=E(e,"pnpm-workspace.yaml");if(!fs.existsSync(o))throw new Error(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${o}).`);return o}async function Rs(e=C(process.cwd())){let o=await promises.readFile(Go(e),"utf8");if(o)return yaml.parse(o)}async function Ss(e,o=C(process.cwd())){let t=await Do(),a=yaml.stringify(e);O(`Writing updated pnpm-workspace.yaml file to workspace root: ${a}`,t),await promises.writeFile(Go(o),a);}exports.a=ne;exports.b=Vr;exports.c=O;exports.d=E;exports.e=C;exports.f=Do;exports.g=Go;exports.h=Rs;exports.i=Ss;
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkE3XYGDUJ_cjs=require('./chunk-E3XYGDUJ.cjs'),child_process=require('child_process'),semver=require('semver');var x="latest";var l=x;async function _(t="npm"){return new Promise((r,e)=>{child_process.exec(`${t} config get registry`,(o,g,s)=>o&&!o.message.toLowerCase().trim().startsWith("npm warn")?e(o):s&&!s.toLowerCase().trim().startsWith("npm warn")?e(s):r(g.trim()));})}async function y(t,r=l,e={}){let o=e.executable||"npm",g=e.registry||await _(o);return new Promise((s,a)=>{child_process.exec(`${o} view ${t} version --registry=${g} --tag=${r}`,(n,c,i)=>n&&!n.message.toLowerCase().trim().startsWith("npm warn")?a(n):i&&!i.toLowerCase().trim().startsWith("npm warn")?a(i):s(c.trim()));})}async function G(t=chunkE3XYGDUJ_cjs.e(process.cwd())){let r=await chunkE3XYGDUJ_cjs.h(t);if(!r)throw new Error("No pnpm-workspace.yaml file found");if(r?.catalog)return Object.fromEntries(Object.entries(r.catalog).map(([e,o])=>[e,o.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in pnpm-workspace.yaml file located in workspace root: ${t}
2
- File content: ${JSON.stringify(r,null,2)}`);}async function C(t=chunkE3XYGDUJ_cjs.e(process.cwd())){let r=await G(t);if(!r)throw new Error("No catalog entries found in pnpm-workspace.yaml file");return r}async function M(t,r=chunkE3XYGDUJ_cjs.e(process.cwd())){let e=await chunkE3XYGDUJ_cjs.h(r);if(!e)throw new Error("No pnpm-workspace.yaml file found");e.catalog=Object.fromEntries(Object.entries(t).map(([o,g])=>[o,g.replaceAll('"',"").replaceAll("'","")])),await chunkE3XYGDUJ_cjs.i(e,r);}async function Q(t,r,e={}){let{tag:o=l,prefix:g="^",workspaceRoot:s=chunkE3XYGDUJ_cjs.e()}=e,a=await chunkE3XYGDUJ_cjs.f(true,{workspaceRoot:s});chunkE3XYGDUJ_cjs.c(`Upgrading catalog entry for package "${r}" with tag "${o}"`,a);let n=await y(r,o,{executable:"pnpm"}),c=`${g||""}${n.replace(/^[\^~><=*]+/g,"")}`,i=false;return !semver.valid(semver.coerce(t[r]))||semver.coerce(t[r])&&semver.coerce(c)&&semver.gt(semver.coerce(c),semver.coerce(t[r]))?(t[r]=`${g||""}${c.replace(/^[\^~><=*]+/g,"")}`,chunkE3XYGDUJ_cjs.b(`Writing version ${t[r]} to catalog for "${r}" package`,a),i=true):chunkE3XYGDUJ_cjs.b(`The current version ${t[r]} for package "${r}" is greater than or equal to the version ${c} fetched from the npm registry with tag "${o}". No update performed.`,a),{catalog:t,updated:i}}async function Z(t,r={}){let{tag:e=l,prefix:o="^",throwIfMissingInCatalog:g=false,workspaceRoot:s=chunkE3XYGDUJ_cjs.e()}=r,a=await chunkE3XYGDUJ_cjs.f(true,{workspaceRoot:s}),n=await C(s);if(!n)throw new Error("No catalog found");if(g===true&&!n[t])throw new Error(`Package "${t}" not found in catalog: ${JSON.stringify(n,null,2)}`);chunkE3XYGDUJ_cjs.c(`Upgrading catalog entry for package "${t}" with tag "${e}"`,a);let c=await y(t,e,{executable:"pnpm"}),i=`${o||""}${c.replace(/^[\^~><=*]+/g,"")}`;i===n[t]?chunkE3XYGDUJ_cjs.c(`The version for package "${t}" is already up to date in the catalog: ${i}`,a):!semver.valid(semver.coerce(n[t]))||semver.coerce(n[t])&&semver.coerce(i)&&semver.gt(semver.coerce(i),semver.coerce(n[t]))?(n[t]=`${o||""}${i.replace(/^[\^~><=*]+/g,"")}`,chunkE3XYGDUJ_cjs.b(`Writing version ${n[t]} to catalog for "${t}" package`,a),await M(n,s)):chunkE3XYGDUJ_cjs.a(`The current version "${n[t]}" for package "${t}" is greater than or equal to the version "${i}" fetched from the npm registry with tag "${e}". No update performed.`,a);}exports.a=G;exports.b=C;exports.c=M;exports.d=Q;exports.e=Z;
1
+ 'use strict';var chunkLIMK2LR3_cjs=require('./chunk-LIMK2LR3.cjs'),child_process=require('child_process'),semver=require('semver');var x="latest";var l=x;async function _(t="npm"){return new Promise((r,e)=>{child_process.exec(`${t} config get registry`,(o,g,s)=>o&&!o.message.toLowerCase().trim().startsWith("npm warn")?e(o):s&&!s.toLowerCase().trim().startsWith("npm warn")?e(s):r(g.trim()));})}async function y(t,r=l,e={}){let o=e.executable||"npm",g=e.registry||await _(o);return new Promise((s,a)=>{child_process.exec(`${o} view ${t} version --registry=${g} --tag=${r}`,(n,c,i)=>n&&!n.message.toLowerCase().trim().startsWith("npm warn")?a(n):i&&!i.toLowerCase().trim().startsWith("npm warn")?a(i):s(c.trim()));})}async function G(t=chunkLIMK2LR3_cjs.e(process.cwd())){let r=await chunkLIMK2LR3_cjs.h(t);if(!r)throw new Error("No pnpm-workspace.yaml file found");if(r?.catalog)return Object.fromEntries(Object.entries(r.catalog).map(([e,o])=>[e,o.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in pnpm-workspace.yaml file located in workspace root: ${t}
2
+ File content: ${JSON.stringify(r,null,2)}`);}async function C(t=chunkLIMK2LR3_cjs.e(process.cwd())){let r=await G(t);if(!r)throw new Error("No catalog entries found in pnpm-workspace.yaml file");return r}async function M(t,r=chunkLIMK2LR3_cjs.e(process.cwd())){let e=await chunkLIMK2LR3_cjs.h(r);if(!e)throw new Error("No pnpm-workspace.yaml file found");e.catalog=Object.fromEntries(Object.entries(t).map(([o,g])=>[o,g.replaceAll('"',"").replaceAll("'","")])),await chunkLIMK2LR3_cjs.i(e,r);}async function Q(t,r,e={}){let{tag:o=l,prefix:g="^",workspaceRoot:s=chunkLIMK2LR3_cjs.e()}=e,a=await chunkLIMK2LR3_cjs.f(true,{workspaceRoot:s});chunkLIMK2LR3_cjs.c(`Upgrading catalog entry for package "${r}" with tag "${o}"`,a);let n=await y(r,o,{executable:"pnpm"}),c=`${g||""}${n.replace(/^[\^~><=*]+/g,"")}`,i=false;return !semver.valid(semver.coerce(t[r]))||semver.coerce(t[r])&&semver.coerce(c)&&semver.gt(semver.coerce(c),semver.coerce(t[r]))?(t[r]=`${g||""}${c.replace(/^[\^~><=*]+/g,"")}`,chunkLIMK2LR3_cjs.b(`Writing version ${t[r]} to catalog for "${r}" package`,a),i=true):chunkLIMK2LR3_cjs.b(`The current version ${t[r]} for package "${r}" is greater than or equal to the version ${c} fetched from the npm registry with tag "${o}". No update performed.`,a),{catalog:t,updated:i}}async function Z(t,r={}){let{tag:e=l,prefix:o="^",throwIfMissingInCatalog:g=false,workspaceRoot:s=chunkLIMK2LR3_cjs.e()}=r,a=await chunkLIMK2LR3_cjs.f(true,{workspaceRoot:s}),n=await C(s);if(!n)throw new Error("No catalog found");if(g===true&&!n[t])throw new Error(`Package "${t}" not found in catalog: ${JSON.stringify(n,null,2)}`);chunkLIMK2LR3_cjs.c(`Upgrading catalog entry for package "${t}" with tag "${e}"`,a);let c=await y(t,e,{executable:"pnpm"}),i=`${o||""}${c.replace(/^[\^~><=*]+/g,"")}`;i===n[t]?chunkLIMK2LR3_cjs.c(`The version for package "${t}" is already up to date in the catalog: ${i}`,a):!semver.valid(semver.coerce(n[t]))||semver.coerce(n[t])&&semver.coerce(i)&&semver.gt(semver.coerce(i),semver.coerce(n[t]))?(n[t]=`${o||""}${i.replace(/^[\^~><=*]+/g,"")}`,chunkLIMK2LR3_cjs.b(`Writing version ${n[t]} to catalog for "${t}" package`,a),await M(n,s)):chunkLIMK2LR3_cjs.a(`The current version "${n[t]}" for package "${t}" is greater than or equal to the version "${i}" fetched from the npm registry with tag "${e}". No update performed.`,a);}exports.a=G;exports.b=C;exports.c=M;exports.d=Q;exports.e=Z;
@@ -1 +1 @@
1
- 'use strict';var chunkK2UYW6EI_cjs=require('./chunk-K2UYW6EI.cjs'),chunkE3XYGDUJ_cjs=require('./chunk-E3XYGDUJ.cjs'),devkit=require('@nx/devkit'),fs=require('fs'),promises=require('fs/promises'),prettier=require('prettier');async function C(c=process.cwd(),i=chunkE3XYGDUJ_cjs.e(c)){let l=chunkE3XYGDUJ_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 chunkK2UYW6EI_cjs.b(i),a=JSON.parse(m),g=chunkE3XYGDUJ_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.`),a;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];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 r=>{let o=n.nodes[r];if(o?.data.root){let e=chunkE3XYGDUJ_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 r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];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(a),{parser:"json",proseWrap:"preserve",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-packagejson"]}))}exports.a=C;
1
+ 'use strict';var chunkWJHGAU2P_cjs=require('./chunk-WJHGAU2P.cjs'),chunkLIMK2LR3_cjs=require('./chunk-LIMK2LR3.cjs'),devkit=require('@nx/devkit'),fs=require('fs'),promises=require('fs/promises'),prettier=require('prettier');async function C(c=process.cwd(),i=chunkLIMK2LR3_cjs.e(c)){let l=chunkLIMK2LR3_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 chunkWJHGAU2P_cjs.b(i),a=JSON.parse(m),g=chunkLIMK2LR3_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.`),a;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];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 r=>{let o=n.nodes[r];if(o?.data.root){let e=chunkLIMK2LR3_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 r of ["dependencies","devDependencies","peerDependencies"]){let o=a[r];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(a),{parser:"json",proseWrap:"preserve",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-packagejson"]}))}exports.a=C;
@@ -1 +1 @@
1
- 'use strict';var chunkK2UYW6EI_cjs=require('../chunk-K2UYW6EI.cjs');require('../chunk-E3XYGDUJ.cjs');Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.d}});
1
+ 'use strict';var chunkWJHGAU2P_cjs=require('../chunk-WJHGAU2P.cjs');require('../chunk-LIMK2LR3.cjs');Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.d}});
@@ -1 +1 @@
1
- export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'../chunk-2D7XRLNQ.js';import'../chunk-I4FQEZQN.js';
1
+ export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'../chunk-3NEBMUX3.js';import'../chunk-35AD6SOZ.js';
@@ -1 +1 @@
1
- 'use strict';require('../chunk-QNTSKZUU.cjs');var chunkBU4K3RZN_cjs=require('../chunk-BU4K3RZN.cjs'),chunkK2UYW6EI_cjs=require('../chunk-K2UYW6EI.cjs'),chunkE3XYGDUJ_cjs=require('../chunk-E3XYGDUJ.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkBU4K3RZN_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.d}});Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkE3XYGDUJ_cjs.g}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkE3XYGDUJ_cjs.h}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkE3XYGDUJ_cjs.i}});
1
+ 'use strict';require('../chunk-QNTSKZUU.cjs');var chunkYFN5Z6PU_cjs=require('../chunk-YFN5Z6PU.cjs'),chunkWJHGAU2P_cjs=require('../chunk-WJHGAU2P.cjs'),chunkLIMK2LR3_cjs=require('../chunk-LIMK2LR3.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkYFN5Z6PU_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.d}});Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkLIMK2LR3_cjs.g}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkLIMK2LR3_cjs.h}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkLIMK2LR3_cjs.i}});
@@ -1 +1 @@
1
- import'../chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'../chunk-FF57MF77.js';export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'../chunk-2D7XRLNQ.js';export{g as getPnpmWorkspaceFilePath,h as readPnpmWorkspaceFile,i as writePnpmWorkspaceFile}from'../chunk-I4FQEZQN.js';
1
+ import'../chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'../chunk-KYFOH3WX.js';export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'../chunk-3NEBMUX3.js';export{g as getPnpmWorkspaceFilePath,h as readPnpmWorkspaceFile,i as writePnpmWorkspaceFile}from'../chunk-35AD6SOZ.js';
@@ -1 +1 @@
1
- 'use strict';var chunkE3XYGDUJ_cjs=require('../chunk-E3XYGDUJ.cjs');Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkE3XYGDUJ_cjs.g}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkE3XYGDUJ_cjs.h}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkE3XYGDUJ_cjs.i}});
1
+ 'use strict';var chunkLIMK2LR3_cjs=require('../chunk-LIMK2LR3.cjs');Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkLIMK2LR3_cjs.g}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkLIMK2LR3_cjs.h}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkLIMK2LR3_cjs.i}});
@@ -1 +1 @@
1
- export{g as getPnpmWorkspaceFilePath,h as readPnpmWorkspaceFile,i as writePnpmWorkspaceFile}from'../chunk-I4FQEZQN.js';
1
+ export{g as getPnpmWorkspaceFilePath,h as readPnpmWorkspaceFile,i as writePnpmWorkspaceFile}from'../chunk-35AD6SOZ.js';
@@ -1 +1 @@
1
- 'use strict';var chunkBU4K3RZN_cjs=require('../chunk-BU4K3RZN.cjs');require('../chunk-K2UYW6EI.cjs'),require('../chunk-E3XYGDUJ.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkBU4K3RZN_cjs.a}});
1
+ 'use strict';var chunkYFN5Z6PU_cjs=require('../chunk-YFN5Z6PU.cjs');require('../chunk-WJHGAU2P.cjs'),require('../chunk-LIMK2LR3.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkYFN5Z6PU_cjs.a}});
@@ -1 +1 @@
1
- export{a as replaceDepsAliases}from'../chunk-FF57MF77.js';import'../chunk-2D7XRLNQ.js';import'../chunk-I4FQEZQN.js';
1
+ export{a as replaceDepsAliases}from'../chunk-KYFOH3WX.js';import'../chunk-3NEBMUX3.js';import'../chunk-35AD6SOZ.js';
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';require('./chunk-SFZRYJZ2.cjs'),require('./chunk-QNTSKZUU.cjs');var chunkBU4K3RZN_cjs=require('./chunk-BU4K3RZN.cjs'),chunkK2UYW6EI_cjs=require('./chunk-K2UYW6EI.cjs'),chunkE3XYGDUJ_cjs=require('./chunk-E3XYGDUJ.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkBU4K3RZN_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkK2UYW6EI_cjs.d}});Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkE3XYGDUJ_cjs.g}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkE3XYGDUJ_cjs.h}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkE3XYGDUJ_cjs.i}});
1
+ 'use strict';require('./chunk-SFZRYJZ2.cjs'),require('./chunk-QNTSKZUU.cjs');var chunkYFN5Z6PU_cjs=require('./chunk-YFN5Z6PU.cjs'),chunkWJHGAU2P_cjs=require('./chunk-WJHGAU2P.cjs'),chunkLIMK2LR3_cjs=require('./chunk-LIMK2LR3.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkYFN5Z6PU_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkWJHGAU2P_cjs.d}});Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkLIMK2LR3_cjs.g}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkLIMK2LR3_cjs.h}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkLIMK2LR3_cjs.i}});
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import'./chunk-GGNOJ77I.js';import'./chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'./chunk-FF57MF77.js';export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'./chunk-2D7XRLNQ.js';export{g as getPnpmWorkspaceFilePath,h as readPnpmWorkspaceFile,i as writePnpmWorkspaceFile}from'./chunk-I4FQEZQN.js';
1
+ import'./chunk-GGNOJ77I.js';import'./chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'./chunk-KYFOH3WX.js';export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'./chunk-3NEBMUX3.js';export{g as getPnpmWorkspaceFilePath,h as readPnpmWorkspaceFile,i as writePnpmWorkspaceFile}from'./chunk-35AD6SOZ.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/pnpm-tools",
3
- "version": "0.6.125",
3
+ "version": "0.6.126",
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": {
@@ -73,9 +73,9 @@
73
73
  },
74
74
  "types": "./dist/index.d.ts",
75
75
  "dependencies": {
76
- "@storm-software/config": "^1.135.41",
77
- "@storm-software/config-tools": "^1.189.40",
78
- "@storm-software/npm-tools": "^0.6.78",
76
+ "@storm-software/config": "^1.136.0",
77
+ "@storm-software/config-tools": "^1.189.41",
78
+ "@storm-software/npm-tools": "^0.6.79",
79
79
  "commander": "^12.1.0",
80
80
  "defu": "6.1.4",
81
81
  "prettier": "^3.8.1",
@@ -89,5 +89,5 @@
89
89
  "tsup": "8.4.0"
90
90
  },
91
91
  "publishConfig": { "access": "public" },
92
- "gitHead": "f5dd2e96c8a8f7afd74015f40e6fbfb7fb0b57c9"
92
+ "gitHead": "86357db0291c9364860c12fda996cd88e8a5e0bd"
93
93
  }
@@ -1,27 +0,0 @@
1
- 'use strict';var c12=require('c12'),Ao=require('defu');require('date-fns/formatDistanceToNow');var Go=require('chalk'),fs=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 Ao__default=/*#__PURE__*/_interopDefault(Ao);var Go__default=/*#__PURE__*/_interopDefault(Go);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",debug:"#8afafc",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__default.default;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 k=(e,o)=>re()?e:o,S={[l.ERROR]:k("\u2718","\xD7"),[l.FATAL]:k("\u{1F571}","\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("\u2699","T"),[l.ALL]:k("\u2709","\u2192")};var R=(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}},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?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(R())} ${t.hex(a.fatal??E.dark.fatal)(`[${S[l.FATAL]} Fatal] `)}${t.bold.whiteBright(h(n))}
3
- `);}:typeof e=="number"&&c.ERROR>=e?n=>{console.error(`
4
- ${t.gray(R())} ${t.hex(a.danger??E.dark.danger)(`[${S[l.ERROR]} Error] `)}${t.bold.whiteBright(h(n))}
5
- `);}:typeof e=="number"&&c.WARN>=e?n=>{console.warn(`
6
- ${t.gray(R())} ${t.hex(a.warning??E.dark.warning)(`[${S[l.WARN]} Warn] `)}${t.bold.whiteBright(h(n))}
7
- `);}:typeof e=="number"&&c.SUCCESS>=e?n=>{console.info(`
8
- ${t.gray(R())} ${t.hex(a.success??E.dark.success)(`[${S[l.SUCCESS]} Success] `)}${t.bold.whiteBright(h(n))}
9
- `);}:typeof e=="number"&&c.INFO>=e?n=>{console.info(`
10
- ${t.gray(R())} ${t.hex(a.info??E.dark.info)(`[${S[l.INFO]} Info] `)}${t.bold.whiteBright(h(n))}
11
- `);}:typeof e=="number"&&c.DEBUG>=e?n=>{console.debug(`
12
- ${t.gray(R())} ${t.hex(a.debug??E.dark.debug)(`[${S[l.DEBUG]} Debug] `)}${t.bold.whiteBright(h(n))}
13
- `);}:typeof e=="number"&&c.TRACE>=e?n=>{console.debug(`
14
- ${t.gray(R())} ${t.hex("#bbbbbb")(`[${S[l.TRACE]} Trace] `)}${t.bold.whiteBright(h(n))}
15
- `);}:n=>{console.log(`
16
- ${t.gray(R())} ${t.hex(a.brand??E.dark.brand)(`[${S[l.ALL]} System] `)}${t.bold.whiteBright(h(n))}
17
- `);}};var se=(e,o)=>V(c.WARN,o)(e);var Yr=(e,o)=>V(c.DEBUG,o)(e),O=(e,o)=>V(c.TRACE,o)(e);var Wo=6,h=(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} = ${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} = ${Mo(e[n])?"<function>":typeof e[n]=="object"?h(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)},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 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 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 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=>fs.existsSync(path.join(a,i)))||o.some(i=>fs.existsSync(path.join(a,i))))return a;if(a!=="/"&&Yo++<Zo){let i=path.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 T(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",L="https://stormsoftware.com";var pe="https://stormsoftware.com/license",le="Apache-2.0";var y="tools/errors/codes.json",de="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 b=r__namespace._default(f,"#1fb2a6");s.add(b,{description:"The primary brand specific color of the workspace"});var z=r__namespace.optional(f);s.add(z,{description:"The alternate brand specific color of the workspace"});var x=r__namespace.optional(f);s.add(x,{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,"#8afafc");s.add(M,{description:"The debug color of the workspace"});var F=r__namespace._default(f,"#f3d371");s.add(F,{description:"The warning color of the workspace"});var U=r__namespace._default(f,"#d8314a");s.add(U,{description:"The danger color of the workspace"});var j=r__namespace.optional(f);s.add(j,{description:"The fatal color of the workspace"});var B=r__namespace._default(f,"#4ade80");s.add(B,{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 K=r__namespace.optional(r__namespace.array(f));s.add(K,{description:"The color stops for the base gradient color pattern used in the workspace"});var er=r__namespace.object({foreground:w,background:N,brand:b,alternate:z,accent:x,link:D,help:G,success:P,info:W,debug:M,warning:F,danger:U,fatal:j,positive:B,negative:H,gradient:K}),or=r__namespace.object({foreground:N,background:w,brand:b,alternate:z,accent:x,link:D,help:G,success:P,info:W,debug:M,warning:F,danger:U,fatal:j,positive:B,negative:H,gradient:K}),rr=r__namespace.object({dark:er,light:or}),tr=r__namespace.object({dark:N,light:w,brand:b,alternate:z,accent:x,link:D,help:G,success:P,info:W,debug:M,warning:F,danger:U,fatal:j,positive:B,negative:H,gradient:K}),$=r__namespace.optional(r__namespace.url());s.add($,{description:"A remote registry URL used to publish distributable packages"});var me=r__namespace._default(r__namespace.object({github:$,npm:$,cargo:$,cyclone:$,container:$}),{});s.add(me,{description:"A list of remote registry URLs used by Storm Software"});var q=r__namespace.union([tr,rr]);s.add(q,{description:"Colors used for various workspace elements"});var ue=r__namespace.record(r__namespace.union([r__namespace.union([r__namespace.literal("base"),r__namespace.string()]),r__namespace.string()]),q);s.add(ue,{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 fe=r__namespace.string().check(r__namespace.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__namespace.string().check(r__namespace.trim());s.add(he,{description:"The email of the workspace bot"});var Te=r__namespace.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__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.url()));s.add(Ce,{description:"A URL to a banner image used to display the workspace's release"});var Ee=r__namespace._default(r__namespace.string().check(r__namespace.trim()),de);s.add(Ee,{description:"The alt text for the workspace's release banner image"});var Se=r__namespace.object({url:Ce,alt:Ee});s.add(Se,{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 ve=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(ve,{description:"A footer message appended to the end of the workspace's release notes"});var ke=r__namespace.object({banner:r__namespace.union([Se,r__namespace.string().check(r__namespace.trim(),r__namespace.url())]),header:Re,footer:ve});s.add(ke,{description:"The workspace's release config used during the release process"});var Oe=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Oe,{description:"A Twitter/X account associated with the organization/project"});var Ae=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Ae,{description:"A Discord account associated with the organization/project"});var $e=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add($e,{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 Ie=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Ie,{description:"A GitHub account associated with the organization/project"});var ye=r__namespace.object({twitter:Oe,discord:Ae,telegram:$e,slack:Le,medium:_e,github:Ie});s.add(ye,{description:"The workspace's account config used to store various social media links"});var Ne=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(Ne,{description:"The directory used to store the environment's cached file data"});var we=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(we,{description:"The directory used to store the environment's data files"});var be=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(be,{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 De=r__namespace._default(r__namespace.string().check(r__namespace.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__namespace.object({cache:Ne,data:we,config:be,temp:ze,log:xe,build:De});s.add(Ge,{description:"Various directories used by the workspace to store data, cache, and configuration files"});var Pe=r__namespace._default(r__namespace.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__namespace._default(r__namespace.string().check(r__namespace.trim()),y);s.add(We,{description:"The path to the workspace's error codes JSON file"});var Me=r__namespace.optional(r__namespace.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__namespace.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__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));s.add(Ue,{description:"The name of the organization"});var je=r__namespace.optional(r__namespace.string().check(r__namespace.trim()));s.add(je,{description:"A description of the organization"});var Be=r__namespace.optional(r__namespace.url());s.add(Be,{description:"A URL to the organization's logo image"});var He=r__namespace.optional(r__namespace.url());s.add(He,{description:"A URL to the organization's icon image"});var Ke=r__namespace.optional(r__namespace.url());s.add(Ke,{description:"A URL to a page that provides more information about the organization"});var Ze=r__namespace.object({name:Ue,description:je,logo:Be,icon:He,url:Ke});s.add(Ze,{description:"The workspace's organization details"});var Ye=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(Ye,{description:"The URL or file path to the JSON schema file that describes the Storm configuration file"});var Ve=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(Ve,{description:"The name of the workspace/project/service/package/scope using this configuration"});var Je=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(Je,{description:"The namespace of the workspace/project/service/package/scope using this configuration"});var Xe=r__namespace.union([Ze,r__namespace.string().check(r__namespace.trim(),r__namespace.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__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(qe,{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 eo=r__namespace.optional(r__namespace.url());s.add(eo,{description:"The homepage of the workspace"});var oo=r__namespace.optional(r__namespace.url());s.add(oo,{description:"The documentation site for the workspace"});var ro=r__namespace.optional(r__namespace.url());s.add(ro,{description:"The development portal site for the workspace"});var to=r__namespace.optional(r__namespace.url());s.add(to,{description:"The licensing site for the workspace"});var so=r__namespace.optional(r__namespace.url());s.add(so,{description:"The contact site for the workspace"});var no=r__namespace.optional(r__namespace.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__namespace._default(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()),"main");s.add(ao,{description:"The branch of the workspace"});var io=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));s.add(io,{description:"A tag specifying the version pre-release identifier"});var co=r__namespace.optional(r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase()));s.add(co,{description:"The owner of the package"});var po=r__namespace._default(r__namespace.enum(["development","test","production"]).check(r__namespace.trim(),r__namespace.toLowerCase()),"production");s.add(po,{description:"The current runtime environment mode for the package"});var lo=r__namespace.string().check(r__namespace.trim(),r__namespace.toLowerCase());s.add(lo,{description:"The root directory of the workspace"});var mo=r__namespace._default(r__namespace.boolean(),false);s.add(mo,{description:"Should all known types of workspace caching be skipped?"});var uo=r__namespace._default(r__namespace.enum(["npm","yarn","pnpm","bun"]),"npm");s.add(uo,{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 fo=r__namespace._default(r__namespace.string().check(r__namespace.trim()),"en-US");s.add(fo,{description:"The default locale of the workspace"});var ho=r__namespace._default(r__namespace.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__namespace._default(r__namespace.boolean(),true);s.add(To,{description:"Should the logging of the current Storm Workspace configuration be skipped?"});var Co=r__namespace._default(r__namespace.nullable(r__namespace.string().check(r__namespace.trim())),null);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__namespace._default(r__namespace.record(r__namespace.string(),r__namespace.any()),{});s.add(Q,{description:"Configuration of each used extension"});var Eo=r__namespace.object({$schema:Ye,extends:ge,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:uo,timezone:go,locale:fo,logLevel:ho,skipConfigLogging:To,registry:me,configFile:Co,colors:r__namespace.union([q,ue]),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 So=["dark","light","base","brand","alternate","accent","link","success","help","info","warning","danger","fatal","positive","negative"];async function Ro(e){let o=le,t,a,i,n,m,d=T(e);if(fs.existsSync(path.join(d,"package.json"))){let v=await promises.readFile(C(d,"package.json"),"utf8");if(v){let g=JSON.parse(v);g.name&&(i=g.name),g.namespace&&(n=g.namespace),g.repository&&(typeof g.repository=="string"?m=g.repository:g.repository.url&&(m=g.repository.url)),g.license&&(o=g.license),g.homepage&&(t=g.homepage),g.bugs&&(typeof g.bugs=="string"?a=g.bugs:g.bugs.url&&(a=g.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:y},e.homepage&&(e.error.url??=`${e.homepage}/errors`))),e}var Oo=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 Ao__default.default(i[0]??{},i[1]??{})},$o=async(e,o=[])=>{let t=e||T(e),a=await Oo("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=>Oo(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=Ao__default.default(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_`)&&So.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===ce&&(o.homepage===L?o.docs=`${L}/projects/${o.name}/docs`:o.docs=`${o.homepage}/docs`),o.licensing===pe&&(o.homepage===L?o.licensing=`${L}/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`]?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`],debug:process.env[`${e}DEBUG`],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`],debug:process.env[`${e}DEBUG`],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];}},bo=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(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])&&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.debug&&(process.env[`${e}DEBUG`]=o.debug),o.warning&&(process.env[`${e}WARNING`]=o.warning),o.danger&&(process.env[`${e}DANGER`]=o.danger),o.fatal&&(process.env[`${e}FATAL`]=o.fatal),o.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.debug&&(process.env[`${e}DEBUG`]=o.debug),o.warning&&(process.env[`${e}WARNING`]=o.warning),o.danger&&(process.env[`${e}DANGER`]=o.danger),o.fatal&&(process.env[`${e}FATAL`]=o.fatal),o.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 _,ur=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=yo(),v=await $o(m);if(!v&&(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 g=await Ro(m),I=Ao__default.default(d,v,g);I.variant||(I.variant=fs.existsSync(C(m,"nx.json"))||fs.existsSync(C(m,".nx"))||fs.existsSync(C(m,"lerna.json"))||fs.existsSync(C(m,"turbo.json"))?"monorepo":"minimal");try{n=vo(await Eo.parseAsync(I)),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: ${h(I)}`,{cause:Y})}}else n=_.data;return _={timestamp:Date.now(),data:n},n},zo=async(e,o=false)=>{let t=await ur(void 0,void 0,e,o,true);return bo(t),!o&&!t.skipConfigLogging&&O(`\u2699\uFE0F Using Storm Workspace configuration:
27
- ${h(t)}`,t),t};function fr(e,o=false){return zo(e,o)}function xo(e=true,o={}){let t=o.workspaceRoot;return t||(t=T(o.cwd)),fr(t,e)}function Do(e=T(process.cwd())){let o=C(e,"pnpm-workspace.yaml");if(!fs.existsSync(o))throw new Error(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${o}).`);return o}async function Es(e=T(process.cwd())){let o=await promises.readFile(Do(e),"utf8");if(o)return yaml.parse(o)}async function Ss(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(Do(o),a);}exports.a=se;exports.b=Yr;exports.c=O;exports.d=C;exports.e=T;exports.f=xo;exports.g=Do;exports.h=Es;exports.i=Ss;
@@ -1,27 +0,0 @@
1
- import {loadConfig}from'c12';import $o from'defu';import'date-fns/formatDistanceToNow';import Po 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 S={dark:{brand:"#2dd4bf",success:"#10b981",info:"#58a6ff",debug:"#8afafc",warning:"#f3d371",danger:"#D8314A",fatal:"#a40e26"}};var Wo={hex:e=>o=>o,bgHex:e=>({whiteBright:o=>o,white:o=>o}),white:e=>e,whiteBright:e=>e,gray:e=>e,bold:{hex:e=>o=>o,bgHex:e=>({whiteBright:o=>o,white:o=>o}),whiteBright:e=>e,white:e=>e},dim:{hex:e=>o=>o,gray:e=>e}},re=()=>{let e=Po;return (!e?.hex||!e?.bold?.hex||!e?.bgHex||!e?.whiteBright||!e?.white)&&(e=Wo),e};function te(){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)=>te()?e:o,R={[l.ERROR]:O("\u2718","\xD7"),[l.FATAL]:O("\u{1F571}","\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("\u2699","T"),[l.ALL]:O("\u2709","\u2192")};var v=(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}},se=(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 J=(e=c.INFO,o={},t=re())=>{let a=!o.colors?.dark&&!o.colors?.base&&!o.colors?.base?.dark?S: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:S,i=o.logLevel||process.env.STORM_LOG_LEVEL||l.INFO;return e>$(i)||e<=c.SILENT||$(i)<=c.SILENT?n=>{}:typeof e=="number"&&c.FATAL>=e?n=>{console.error(`
2
- ${t.gray(v())} ${t.hex(a.fatal??S.dark.fatal)(`[${R[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??S.dark.danger)(`[${R[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??S.dark.warning)(`[${R[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??S.dark.success)(`[${R[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??S.dark.info)(`[${R[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.debug??S.dark.debug)(`[${R[l.DEBUG]} Debug] `)}${t.bold.whiteBright(T(n))}
13
- `);}:typeof e=="number"&&c.TRACE>=e?n=>{console.debug(`
14
- ${t.gray(v())} ${t.hex("#bbbbbb")(`[${R[l.TRACE]} Trace] `)}${t.bold.whiteBright(T(n))}
15
- `);}:n=>{console.log(`
16
- ${t.gray(v())} ${t.hex(a.brand??S.dark.brand)(`[${R[l.ALL]} System] `)}${t.bold.whiteBright(T(n))}
17
- `);}};var ne=(e,o)=>J(c.WARN,o)(e);var Vr=(e,o)=>J(c.DEBUG,o)(e),A=(e,o)=>J(c.TRACE,o)(e);var Mo=6,T=(e,o={},t=0)=>{if(t>Mo)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} = ${Fo(e[n])?"<function>":typeof e[n]=="object"?T(e[n],{prefix:`${a}-`,skip:i},t+1):e[n]}`).join(`
21
- `)}`:e},Fo=e=>{try{return e instanceof Function||typeof e=="function"||!!(e?.constructor&&e?.call&&e?.apply)}catch{return false}};var Uo=/^[A-Za-z]:\//;function jo(e=""){return e&&e.replace(/\\/g,"/").replace(Uo,o=>o.toUpperCase())}var Bo=/^[/\\]{2}/,Ho=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Ko=/^[A-Za-z]:$/;var p=function(e){if(!e||e.length===0)return ".";e=jo(e);let o=e?.match(Bo),t=ae(e),a=e[e.length-1]==="/";return e=Zo(e,!t),e.length===0?t?"/":a?"./":".":(a&&(e+="/"),Ko.test(e)&&(e+="/"),o?t?`//${e}`:`//./${e}`:t&&!ae(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 Zo(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 ae=function(e){return Ho.test(e)};var Yo=30,Vo=0;function q(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!=="/"&&Vo++<Yo){let i=join(a,"..");return q(i,o,t)}}var ce=["storm-workspace.json","storm-workspace.yaml","storm-workspace.yml","storm-workspace.js","storm-workspace.ts",".storm-workspace.json",".storm-workspace.yaml",".storm-workspace.yml",".storm-workspace.js",".storm-workspace.ts","lerna.json","nx.json","turbo.json","npm-workspace.json","yarn-workspace.json","pnpm-workspace.json","npm-workspace.yaml","yarn-workspace.yaml","pnpm-workspace.yaml","npm-workspace.yml","yarn-workspace.yml","pnpm-workspace.yml","npm-lock.json","yarn-lock.json","pnpm-lock.json","npm-lock.yaml","yarn-lock.yaml","pnpm-lock.yaml","npm-lock.yml","yarn-lock.yml","pnpm-lock.yml","bun.lockb"],Jo=[".storm-workspace",".nx",".git",".github",".vscode",".verdaccio"];function Xo(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(q(e??process.cwd(),ce,Jo))}function C(e){let o=Xo(e);if(!o)throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
22
- ${ce.join(`
23
- `)}
24
- Path: ${e||process.cwd()}`);return o}var pe="https://docs.stormsoftware.com",_="https://stormsoftware.com";var le="https://stormsoftware.com/license",de="Apache-2.0";var N="tools/errors/codes.json",me="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 b=r._default(h,"#cbd5e1");s.add(b,{description:"The light background color of the workspace"});var z=r._default(h,"#1fb2a6");s.add(z,{description:"The primary brand specific color of the workspace"});var x=r.optional(h);s.add(x,{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,"#8afafc");s.add(F,{description:"The debug color of the workspace"});var U=r._default(h,"#f3d371");s.add(U,{description:"The warning color of the workspace"});var j=r._default(h,"#d8314a");s.add(j,{description:"The danger color of the workspace"});var B=r.optional(h);s.add(B,{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 K=r._default(h,"#ef4444");s.add(K,{description:"The negative number color of the workspace"});var Z=r.optional(r.array(h));s.add(Z,{description:"The color stops for the base gradient color pattern used in the workspace"});var or=r.object({foreground:b,background:w,brand:z,alternate:x,accent:D,link:G,help:P,success:W,info:M,debug:F,warning:U,danger:j,fatal:B,positive:H,negative:K,gradient:Z}),rr=r.object({foreground:w,background:b,brand:z,alternate:x,accent:D,link:G,help:P,success:W,info:M,debug:F,warning:U,danger:j,fatal:B,positive:H,negative:K,gradient:Z}),tr=r.object({dark:or,light:rr}),sr=r.object({dark:w,light:b,brand:z,alternate:x,accent:D,link:G,help:P,success:W,info:M,debug:F,warning:U,danger:j,fatal:B,positive:H,negative:K,gradient:Z}),L=r.optional(r.url());s.add(L,{description:"A remote registry URL used to publish distributable packages"});var ue=r._default(r.object({github:L,npm:L,cargo:L,cyclone:L,container:L}),{});s.add(ue,{description:"A list of remote registry URLs used by Storm Software"});var Q=r.union([sr,tr]);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 fe=r.optional(r.union([r.string().check(r.trim()),r.array(r.string().check(r.trim()))]));s.add(fe,{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 he=r.string().check(r.trim());s.add(he,{description:"The workspace bot user's name (this is the bot that will be used to perform various tasks)"});var Te=r.string().check(r.trim());s.add(Te,{description:"The email of the workspace bot"});var Ce=r.object({name:he,email:Te});s.add(Ce,{description:"The workspace's bot user's config used to automated various operations tasks"});var Ee=r.optional(r.string().check(r.trim(),r.url()));s.add(Ee,{description:"A URL to a banner image used to display the workspace's release"});var Se=r._default(r.string().check(r.trim()),me);s.add(Se,{description:"The alt text for the workspace's release banner image"});var Re=r.object({url:Ee,alt:Se});s.add(Re,{description:"The workspace's banner image used during the release process"});var ve=r.optional(r.string().check(r.trim()));s.add(ve,{description:"A header message appended to the start of the workspace's release notes"});var ke=r.optional(r.string().check(r.trim()));s.add(ke,{description:"A footer message appended to the end of the workspace's release notes"});var Oe=r.object({banner:r.union([Re,r.string().check(r.trim(),r.url())]),header:ve,footer:ke});s.add(Oe,{description:"The workspace's release config used during the release process"});var Ae=r.optional(r.string().check(r.trim()));s.add(Ae,{description:"A Twitter/X account associated with the organization/project"});var $e=r.optional(r.string().check(r.trim()));s.add($e,{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 Ie=r.optional(r.string().check(r.trim()));s.add(Ie,{description:"A Medium account associated with the organization/project"});var ye=r.optional(r.string().check(r.trim()));s.add(ye,{description:"A GitHub account associated with the organization/project"});var Ne=r.object({twitter:Ae,discord:$e,telegram:Le,slack:_e,medium:Ie,github:ye});s.add(Ne,{description:"The workspace's account config used to store various social media links"});var we=r.optional(r.string().check(r.trim()));s.add(we,{description:"The directory used to store the environment's cached file data"});var be=r.optional(r.string().check(r.trim()));s.add(be,{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 De=r.optional(r.string().check(r.trim()));s.add(De,{description:"The directory used to store the environment's log files"});var Ge=r._default(r.string().check(r.trim()),"dist");s.add(Ge,{description:"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"});var Pe=r.object({cache:we,data:be,config:ze,temp:xe,log:De,build:Ge});s.add(Pe,{description:"Various directories used by the workspace to store data, cache, and configuration files"});var We=r._default(r.enum(["minimal","monorepo"]),"monorepo");s.add(We,{description:"The variant of the workspace. This can be used to enable or disable certain features or configurations."});var Me=r._default(r.string().check(r.trim()),N);s.add(Me,{description:"The path to the workspace's error codes JSON file"});var Fe=r.optional(r.url());s.add(Fe,{description:"A URL to a page that looks up the workspace's error messages given a specific error code"});var Ue=r.object({codesFile:Me,url:Fe});s.add(Ue,{description:"The workspace's error config used when creating error details during a system error"});var je=r.optional(r.string().check(r.trim(),r.toLowerCase()));s.add(je,{description:"The name of the organization"});var Be=r.optional(r.string().check(r.trim()));s.add(Be,{description:"A description of the organization"});var He=r.optional(r.url());s.add(He,{description:"A URL to the organization's logo image"});var Ke=r.optional(r.url());s.add(Ke,{description:"A URL to the organization's icon image"});var Ze=r.optional(r.url());s.add(Ze,{description:"A URL to a page that provides more information about the organization"});var Ye=r.object({name:je,description:Be,logo:He,icon:Ke,url:Ze});s.add(Ye,{description:"The workspace's organization details"});var Ve=r._default(r.string().check(r.trim(),r.toLowerCase()),"https://public.storm-cdn.com/schemas/storm-workspace.schema.json");s.add(Ve,{description:"The URL or file path to the JSON schema file that describes the Storm configuration file"});var Je=r.string().check(r.trim(),r.toLowerCase());s.add(Je,{description:"The name of the workspace/project/service/package/scope using this configuration"});var Xe=r.string().check(r.trim(),r.toLowerCase());s.add(Xe,{description:"The namespace of the workspace/project/service/package/scope using this configuration"});var qe=r.union([Ye,r.string().check(r.trim(),r.toLowerCase())]);s.add(qe,{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 eo=r._default(r.string().check(r.trim()),"Apache-2.0");s.add(eo,{description:"The license type of the package"});var oo=r.optional(r.url());s.add(oo,{description:"The homepage of the workspace"});var ro=r.optional(r.url());s.add(ro,{description:"The documentation site for the workspace"});var to=r.optional(r.url());s.add(to,{description:"The development portal site for the workspace"});var so=r.optional(r.url());s.add(so,{description:"The licensing site for the workspace"});var no=r.optional(r.url());s.add(no,{description:"The contact site for the workspace"});var ao=r.optional(r.url());s.add(ao,{description:"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"});var io=r._default(r.string().check(r.trim(),r.toLowerCase()),"main");s.add(io,{description:"The branch of the workspace"});var co=r.optional(r.string().check(r.trim(),r.toLowerCase()));s.add(co,{description:"A tag specifying the version pre-release identifier"});var po=r.optional(r.string().check(r.trim(),r.toLowerCase()));s.add(po,{description:"The owner of the package"});var lo=r._default(r.enum(["development","test","production"]).check(r.trim(),r.toLowerCase()),"production");s.add(lo,{description:"The current runtime environment mode for the package"});var mo=r.string().check(r.trim(),r.toLowerCase());s.add(mo,{description:"The root directory of the workspace"});var uo=r._default(r.boolean(),false);s.add(uo,{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 fo=r._default(r.string().check(r.trim()),"America/New_York");s.add(fo,{description:"The default timezone of the workspace"});var ho=r._default(r.string().check(r.trim()),"en-US");s.add(ho,{description:"The default locale of the workspace"});var To=r._default(r.enum(["silent","fatal","error","warn","success","info","debug","trace","all"]),"info");s.add(To,{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 Co=r._default(r.boolean(),true);s.add(Co,{description:"Should the logging of the current Storm Workspace configuration be skipped?"});var Eo=r._default(r.nullable(r.string().check(r.trim())),null);s.add(Eo,{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 So=r.object({$schema:Ve,extends:fe,name:Je,variant:We,namespace:Xe,organization:qe,repository:Qe,license:eo,homepage:oo,docs:ro,portal:to,licensing:so,contact:no,support:ao,branch:io,preid:co,owner:po,bot:Ce,release:Oe,socials:Ne,error:Ue,mode:lo,workspaceRoot:mo,skipCache:uo,directories:Pe,packageManager:go,timezone:fo,locale:ho,logLevel:To,skipConfigLogging:Co,registry:ue,configFile:Eo,colors:r.union([Q,ge]),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 Ro=["dark","light","base","brand","alternate","accent","link","success","help","info","warning","danger","fatal","positive","negative"];async function vo(e){let o=de,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 ko(e){return !e.support&&e.contact&&(e.support=e.contact),!e.contact&&e.support&&(e.contact=e.support),e.homepage&&(e.docs||(e.docs=`${e.homepage}/docs`),e.license||(e.license=`${e.homepage}/license`),e.support||(e.support=`${e.homepage}/support`),e.contact||(e.contact=`${e.homepage}/contact`),(!e.error?.codesFile||!e?.error?.url)&&(e.error??={codesFile:N},e.homepage&&(e.error.url??=`${e.homepage}/errors`))),e}var Ao=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 $o(i[0]??{},i[1]??{})},Lo=async(e,o=[])=>{let t=e||C(e),a=await Ao("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=>Ao(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=$o(d.config??{},i??{}));}if(!(!i||Object.keys(i).length===0))return i.configFile=n,i};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`]?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`]))?se(Number.parseInt(process.env[`${e}LOG_LEVEL`])):process.env[`${e}LOG_LEVEL`]:void 0,skipConfigLogging:process.env[`${e}SKIP_CONFIG_LOGGING`]!==void 0?!!process.env[`${e}SKIP_CONFIG_LOGGING`]:void 0},t=Object.keys(process.env).filter(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===pe&&(o.homepage===_?o.docs=`${_}/projects/${o.name}/docs`:o.docs=`${o.homepage}/docs`),o.licensing===le&&(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`]?pr(e+t):cr(e+t)},cr=e=>{let o=[];if(process.env[`${e}GRADIENT_START`]&&process.env[`${e}GRADIENT_END`])o.push(process.env[`${e}GRADIENT_START`],process.env[`${e}GRADIENT_END`]);else if(process.env[`${e}GRADIENT_0`]||process.env[`${e}GRADIENT_1`]){let t=process.env[`${e}GRADIENT_0`]?0:1;for(;process.env[`${e}GRADIENT_${t}`];)o.push(process.env[`${e}GRADIENT_${t}`]),t++;}return {dark:process.env[`${e}DARK`],light:process.env[`${e}LIGHT`],brand:process.env[`${e}BRAND`],alternate:process.env[`${e}ALTERNATE`],accent:process.env[`${e}ACCENT`],link:process.env[`${e}LINK`],help:process.env[`${e}HELP`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],debug:process.env[`${e}DEBUG`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}},pr=e=>({light:Io(`${e}_LIGHT_`),dark:Io(`${e}_DARK_`)}),Io=e=>{let o=[];if(process.env[`${e}GRADIENT_START`]&&process.env[`${e}GRADIENT_END`])o.push(process.env[`${e}GRADIENT_START`],process.env[`${e}GRADIENT_END`]);else if(process.env[`${e}GRADIENT_0`]||process.env[`${e}GRADIENT_1`]){let t=process.env[`${e}GRADIENT_0`]?0:1;for(;process.env[`${e}GRADIENT_${t}`];)o.push(process.env[`${e}GRADIENT_${t}`]),t++;}return {foreground:process.env[`${e}FOREGROUND`],background:process.env[`${e}BACKGROUND`],brand:process.env[`${e}BRAND`],alternate:process.env[`${e}ALTERNATE`],accent:process.env[`${e}ACCENT`],link:process.env[`${e}LINK`],help:process.env[`${e}HELP`],success:process.env[`${e}SUCCESS`],info:process.env[`${e}INFO`],debug:process.env[`${e}DEBUG`],warning:process.env[`${e}WARNING`],danger:process.env[`${e}DANGER`],fatal:process.env[`${e}FATAL`],positive:process.env[`${e}POSITIVE`],negative:process.env[`${e}NEGATIVE`],gradient:o}};var lr=(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))wo(`${o}COLOR_${t}_`,e.colors[t]);else wo(`${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])&&lr(t,e.extensions[t]);},wo=(e,o)=>o?.light?.brand||o?.dark?.brand?mr(e,o):dr(e,o),dr=(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.debug&&(process.env[`${e}DEBUG`]=o.debug),o.warning&&(process.env[`${e}WARNING`]=o.warning),o.danger&&(process.env[`${e}DANGER`]=o.danger),o.fatal&&(process.env[`${e}FATAL`]=o.fatal),o.positive&&(process.env[`${e}POSITIVE`]=o.positive),o.negative&&(process.env[`${e}NEGATIVE`]=o.negative),o.gradient)for(let t=0;t<o.gradient.length;t++)process.env[`${e}GRADIENT_${t}`]=o.gradient[t];},mr=(e,o)=>({light:bo(`${e}LIGHT_`,o.light),dark:bo(`${e}DARK_`,o.dark)}),bo=(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.debug&&(process.env[`${e}DEBUG`]=o.debug),o.warning&&(process.env[`${e}WARNING`]=o.warning),o.danger&&(process.env[`${e}DANGER`]=o.danger),o.fatal&&(process.env[`${e}FATAL`]=o.fatal),o.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=No(),k=await Lo(m);if(!k&&(a||ne("No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n",{logLevel:"all"}),i===false))return;let f=await vo(m),y=$o(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=ko(await So.parseAsync(y)),n.workspaceRoot??=m;}catch(V){throw new Error(`Failed to parse Storm Workspace configuration${V?.message?`: ${V.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:V})}}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};function hr(e,o=false){return xo(e,o)}function Do(e=true,o={}){let t=o.workspaceRoot;return t||(t=C(o.cwd)),hr(t,e)}function Go(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 Ss(e=C(process.cwd())){let o=await readFile(Go(e),"utf8");if(o)return parse(o)}async function Rs(e,o=C(process.cwd())){let t=await Do(),a=stringify(e);A(`Writing updated pnpm-workspace.yaml file to workspace root: ${a}`,t),await writeFile(Go(o),a);}export{ne as a,Vr as b,A as c,E as d,C as e,Do as f,Go as g,Ss as h,Rs as i};