@storm-software/pnpm-tools 0.3.2 → 0.3.4

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,32 @@
2
2
 
3
3
  # Changelog for Storm Ops - Pnpm Tools
4
4
 
5
+ ## [0.3.3](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.3.3) (2025-09-18)
6
+
7
+ ### Miscellaneous
8
+
9
+ - **monorepo:** Update workspace package links
10
+ ([5fc0b1cec](https://github.com/storm-software/storm-ops/commit/5fc0b1cec))
11
+
12
+ ### Updated Dependencies
13
+
14
+ - Updated config-tools to 1.185.3
15
+ - Updated npm-tools to 0.3.3
16
+ - Updated config to 1.131.3
17
+
18
+ ## [0.3.2](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.3.2) (2025-09-18)
19
+
20
+ ### Miscellaneous
21
+
22
+ - **monorepo:** Update workspace package links
23
+ ([89e2511ad](https://github.com/storm-software/storm-ops/commit/89e2511ad))
24
+
25
+ ### Updated Dependencies
26
+
27
+ - Updated config-tools to 1.185.2
28
+ - Updated npm-tools to 0.3.2
29
+ - Updated config to 1.131.2
30
+
5
31
  ## [0.3.1](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.3.1) (2025-09-18)
6
32
 
7
33
  ### Miscellaneous
package/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-0.3.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-0.3.2-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
@@ -1 +1 @@
1
- 'use strict';var chunkW4TJXJ3L_cjs=require('./chunk-W4TJXJ3L.cjs'),chunkMJEKZAJO_cjs=require('./chunk-MJEKZAJO.cjs'),devkit=require('@nx/devkit'),fs=require('fs'),promises=require('fs/promises'),prettier=require('prettier');async function C(c=process.cwd(),i=chunkMJEKZAJO_cjs.b(c)){let l=chunkMJEKZAJO_cjs.a(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 chunkW4TJXJ3L_cjs.b(i),r=JSON.parse(m),g=chunkMJEKZAJO_cjs.a(i,"pnpm-workspace.yaml");if(!fs.existsSync(g))return console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${g}). Skipping pnpm catalog read for now.`),r;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!p)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`);let t=p[e];if(!t)throw new Error("Missing pnpm catalog version for "+e);o[e]=t;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let n;try{n=devkit.readCachedProjectGraph();}catch{await devkit.createProjectGraphAsync(),n=devkit.readCachedProjectGraph();}let d={};n&&await Promise.all(Object.keys(n.nodes).map(async a=>{let o=n.nodes[a];if(o?.data.root){let e=chunkMJEKZAJO_cjs.a(i,o.data.root,"package.json");if(fs.existsSync(e)){let t=await promises.readFile(e,"utf8"),f=JSON.parse(t);f.private!==true&&(d[f.name]=f.version);}}}));for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(d[e])o[e]=`^${d[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return promises.writeFile(l,await prettier.format(JSON.stringify(r),{parser:"json",proseWrap:"always",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-pkg"]}))}exports.a=C;
1
+ 'use strict';var chunkZCHODZ5U_cjs=require('./chunk-ZCHODZ5U.cjs'),chunkVCKQ3P42_cjs=require('./chunk-VCKQ3P42.cjs'),devkit=require('@nx/devkit'),fs=require('fs'),promises=require('fs/promises'),prettier=require('prettier');async function C(c=process.cwd(),i=chunkVCKQ3P42_cjs.b(c)){let l=chunkVCKQ3P42_cjs.a(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 chunkZCHODZ5U_cjs.b(i),r=JSON.parse(m),g=chunkVCKQ3P42_cjs.a(i,"pnpm-workspace.yaml");if(!fs.existsSync(g))return console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${g}). Skipping pnpm catalog read for now.`),r;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!p)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`);let t=p[e];if(!t)throw new Error("Missing pnpm catalog version for "+e);o[e]=t;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let n;try{n=devkit.readCachedProjectGraph();}catch{await devkit.createProjectGraphAsync(),n=devkit.readCachedProjectGraph();}let d={};n&&await Promise.all(Object.keys(n.nodes).map(async a=>{let o=n.nodes[a];if(o?.data.root){let e=chunkVCKQ3P42_cjs.a(i,o.data.root,"package.json");if(fs.existsSync(e)){let t=await promises.readFile(e,"utf8"),f=JSON.parse(t);f.private!==true&&(d[f.name]=f.version);}}}));for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(d[e])o[e]=`^${d[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return promises.writeFile(l,await prettier.format(JSON.stringify(r),{parser:"json",proseWrap:"always",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-pkg"]}))}exports.a=C;
@@ -0,0 +1,4 @@
1
+ 'use strict';var fs=require('fs'),path=require('path'),promises=require('fs/promises'),yaml=require('yaml');var y=/^[A-Za-z]:\//;function x(e=""){return e&&e.replace(/\\/g,"/").replace(y,n=>n.toUpperCase())}var _=/^[/\\]{2}/,P=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,R=/^[A-Za-z]:$/;var l=function(e){if(!e||e.length===0)return ".";e=x(e);let n=e?.match(_),t=g(e),o=e[e.length-1]==="/";return e=E(e,!t),e.length===0?t?"/":o?"./":".":(o&&(e+="/"),R.test(e)&&(e+="/"),n?t?`//${e}`:`//./${e}`:t&&!g(e)?`/${e}`:e)},d=function(...e){let n="";for(let t of e)if(t)if(n.length>0){let o=n[n.length-1]==="/",r=t[0]==="/";o&&r?n+=t.slice(1):n+=o||r?t:`/${t}`;}else n+=t;return l(n)};function E(e,n){let t="",o=0,r=-1,c=0,i=null;for(let s=0;s<=e.length;++s){if(s<e.length)i=e[s];else {if(i==="/")break;i="/";}if(i==="/"){if(!(r===s-1||c===1))if(c===2){if(t.length<2||o!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let u=t.lastIndexOf("/");u===-1?(t="",o=0):(t=t.slice(0,u),o=t.length-1-t.lastIndexOf("/")),r=s,c=0;continue}else if(t.length>0){t="",o=0,r=s,c=0;continue}}n&&(t+=t.length>0?"/..":"..",o=2);}else t.length>0?t+=`/${e.slice(r+1,s)}`:t=e.slice(r+1,s),o=s-r-1;r=s,c=0;}else i==="."&&c!==-1?++c:c=-1;}return t}var g=function(e){return P.test(e)};var j=30,A=0;function m(e,n=[],t=[]){let o=e??process.cwd();if(t.some(r=>fs.existsSync(path.join(o,r)))||n.some(r=>fs.existsSync(path.join(o,r))))return o;if(o!=="/"&&A++<j){let r=path.join(o,"..");return m(r,n,t)}}var h=["storm-workspace.json","storm-workspace.yaml","storm-workspace.yml","storm-workspace.js","storm-workspace.ts",".storm-workspace.json",".storm-workspace.yaml",".storm-workspace.yml",".storm-workspace.js",".storm-workspace.ts","lerna.json","nx.json","turbo.json","npm-workspace.json","yarn-workspace.json","pnpm-workspace.json","npm-workspace.yaml","yarn-workspace.yaml","pnpm-workspace.yaml","npm-workspace.yml","yarn-workspace.yml","pnpm-workspace.yml","npm-lock.json","yarn-lock.json","pnpm-lock.json","npm-lock.yaml","yarn-lock.yaml","pnpm-lock.yaml","npm-lock.yml","yarn-lock.yml","pnpm-lock.yml","bun.lockb"],O=[".storm-workspace",".nx",".github",".vscode",".verdaccio"];function T(e){return process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH?l(process.env.STORM_WORKSPACE_ROOT??process.env.NX_WORKSPACE_ROOT_PATH):l(m(e??process.cwd(),h,O))}function a(e){let n=T(e);if(!n)throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
2
+ ${h.join(`
3
+ `)}
4
+ Path: ${e||process.cwd()}`);return n}function w(e=a(process.cwd())){let n=d(e,"pnpm-workspace.yaml");if(!fs.existsSync(n))throw new Error(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${n}).`);return n}async function G(e=a(process.cwd())){let n=await promises.readFile(w(e),"utf8");if(n)return yaml.parse(n)}async function q(e,n=a(process.cwd())){await promises.writeFile(w(n),yaml.stringify(e));}exports.a=d;exports.b=a;exports.c=w;exports.d=G;exports.e=q;
@@ -1 +1 @@
1
- import {b as b$1}from'./chunk-ETQM4AGR.js';import {b,a}from'./chunk-7MJHUWVF.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=b(c)){let l=a(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$1(i),r=JSON.parse(m),g=a(i,"pnpm-workspace.yaml");if(!existsSync(g))return console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${g}). Skipping pnpm catalog read for now.`),r;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!p)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`);let t=p[e];if(!t)throw new Error("Missing pnpm catalog version for "+e);o[e]=t;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let n;try{n=readCachedProjectGraph();}catch{await createProjectGraphAsync(),n=readCachedProjectGraph();}let d={};n&&await Promise.all(Object.keys(n.nodes).map(async a$1=>{let o=n.nodes[a$1];if(o?.data.root){let e=a(i,o.data.root,"package.json");if(existsSync(e)){let t=await readFile(e,"utf8"),f=JSON.parse(t);f.private!==true&&(d[f.name]=f.version);}}}));for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(d[e])o[e]=`^${d[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return writeFile(l,await format(JSON.stringify(r),{parser:"json",proseWrap:"always",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-pkg"]}))}export{$ as a};
1
+ import {b as b$1}from'./chunk-Z4T6FZTE.js';import {b,a}from'./chunk-XTBC4NUB.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=b(c)){let l=a(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$1(i),r=JSON.parse(m),g=a(i,"pnpm-workspace.yaml");if(!existsSync(g))return console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${g}). Skipping pnpm catalog read for now.`),r;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!p)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`);let t=p[e];if(!t)throw new Error("Missing pnpm catalog version for "+e);o[e]=t;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let n;try{n=readCachedProjectGraph();}catch{await createProjectGraphAsync(),n=readCachedProjectGraph();}let d={};n&&await Promise.all(Object.keys(n.nodes).map(async a$1=>{let o=n.nodes[a$1];if(o?.data.root){let e=a(i,o.data.root,"package.json");if(existsSync(e)){let t=await readFile(e,"utf8"),f=JSON.parse(t);f.private!==true&&(d[f.name]=f.version);}}}));for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(d[e])o[e]=`^${d[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return writeFile(l,await format(JSON.stringify(r),{parser:"json",proseWrap:"always",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-pkg"]}))}export{$ as a};
@@ -0,0 +1,4 @@
1
+ import {existsSync}from'node:fs';import {join}from'node:path';import {readFile,writeFile}from'node:fs/promises';import {parse,stringify}from'yaml';var x=/^[A-Za-z]:\//;function _(e=""){return e&&e.replace(/\\/g,"/").replace(x,n=>n.toUpperCase())}var P=/^[/\\]{2}/,R=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,E=/^[A-Za-z]:$/;var l=function(e){if(!e||e.length===0)return ".";e=_(e);let n=e?.match(P),t=d(e),o=e[e.length-1]==="/";return e=j(e,!t),e.length===0?t?"/":o?"./":".":(o&&(e+="/"),E.test(e)&&(e+="/"),n?t?`//${e}`:`//./${e}`:t&&!d(e)?`/${e}`:e)},k=function(...e){let n="";for(let t of e)if(t)if(n.length>0){let o=n[n.length-1]==="/",r=t[0]==="/";o&&r?n+=t.slice(1):n+=o||r?t:`/${t}`;}else n+=t;return l(n)};function j(e,n){let t="",o=0,r=-1,c=0,i=null;for(let s=0;s<=e.length;++s){if(s<e.length)i=e[s];else {if(i==="/")break;i="/";}if(i==="/"){if(!(r===s-1||c===1))if(c===2){if(t.length<2||o!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let g=t.lastIndexOf("/");g===-1?(t="",o=0):(t=t.slice(0,g),o=t.length-1-t.lastIndexOf("/")),r=s,c=0;continue}else if(t.length>0){t="",o=0,r=s,c=0;continue}}n&&(t+=t.length>0?"/..":"..",o=2);}else t.length>0?t+=`/${e.slice(r+1,s)}`:t=e.slice(r+1,s),o=s-r-1;r=s,c=0;}else i==="."&&c!==-1?++c:c=-1;}return t}var d=function(e){return R.test(e)};var A=30,O=0;function u(e,n=[],t=[]){let o=e??process.cwd();if(t.some(r=>existsSync(join(o,r)))||n.some(r=>existsSync(join(o,r))))return o;if(o!=="/"&&O++<A){let r=join(o,"..");return u(r,n,t)}}var w=["storm-workspace.json","storm-workspace.yaml","storm-workspace.yml","storm-workspace.js","storm-workspace.ts",".storm-workspace.json",".storm-workspace.yaml",".storm-workspace.yml",".storm-workspace.js",".storm-workspace.ts","lerna.json","nx.json","turbo.json","npm-workspace.json","yarn-workspace.json","pnpm-workspace.json","npm-workspace.yaml","yarn-workspace.yaml","pnpm-workspace.yaml","npm-workspace.yml","yarn-workspace.yml","pnpm-workspace.yml","npm-lock.json","yarn-lock.json","pnpm-lock.json","npm-lock.yaml","yarn-lock.yaml","pnpm-lock.yaml","npm-lock.yml","yarn-lock.yml","pnpm-lock.yml","bun.lockb"],T=[".storm-workspace",".nx",".github",".vscode",".verdaccio"];function S(e){return process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH?l(process.env.STORM_WORKSPACE_ROOT??process.env.NX_WORKSPACE_ROOT_PATH):l(u(e??process.cwd(),w,T))}function a(e){let n=S(e);if(!n)throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
2
+ ${w.join(`
3
+ `)}
4
+ Path: ${e||process.cwd()}`);return n}function y(e=a(process.cwd())){let n=k(e,"pnpm-workspace.yaml");if(!existsSync(n))throw new Error(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${n}).`);return n}async function q(e=a(process.cwd())){let n=await readFile(y(e),"utf8");if(n)return parse(n)}async function J(e,n=a(process.cwd())){await writeFile(y(n),stringify(e));}export{k as a,a as b,y as c,q as d,J as e};
@@ -1,2 +1,2 @@
1
- import {b,d as d$1,e}from'./chunk-7MJHUWVF.js';import {exec}from'node:child_process';import {valid,coerce,gt}from'semver';var T="latest";var g=T;async function w(){return new Promise((t,r)=>{exec("npm config get registry",(n,o,i)=>n?r(n):i?r(i):t(o.trim()));})}async function _(t,r=g,n={}){let{registry:o=w()}=n;return new Promise((i,e)=>{exec(`npm view ${t} version --registry=${o} --tag=${r}`,(s,R,u)=>s?e(s):u?e(u):i(R.trim()));})}async function A(t=b(process.cwd())){let r=await d$1(t);if(!r)throw new Error("No pnpm-workspace.yaml file found");if(r?.catalog)return Object.fromEntries(Object.entries(r.catalog).map(([n,o])=>[n,o.replaceAll(/^"/g,"").replaceAll(/"$/g,"")]));console.warn(`No catalog found in pnpm-workspace.yaml file located in workspace root: ${t}
1
+ import {b,d as d$1,e}from'./chunk-XTBC4NUB.js';import {exec}from'node:child_process';import {valid,coerce,gt}from'semver';var T="latest";var g=T;async function w(){return new Promise((t,r)=>{exec("npm config get registry",(n,o,i)=>n?r(n):i?r(i):t(o.trim()));})}async function _(t,r=g,n={}){let{registry:o=w()}=n;return new Promise((i,e)=>{exec(`npm view ${t} version --registry=${o} --tag=${r}`,(s,R,u)=>s?e(s):u?e(u):i(R.trim()));})}async function A(t=b(process.cwd())){let r=await d$1(t);if(!r)throw new Error("No pnpm-workspace.yaml file found");if(r?.catalog)return Object.fromEntries(Object.entries(r.catalog).map(([n,o])=>[n,o.replaceAll(/^"/g,"").replaceAll(/"$/g,"")]));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 x(t=b(process.cwd())){let r=await A(t);if(!r)throw new Error("No catalog entries found in pnpm-workspace.yaml file");return r}async function d(t,r=b(process.cwd())){let n=await d$1(r);if(!n)throw new Error("No pnpm-workspace.yaml file found");n.catalog=Object.fromEntries(Object.entries(t).map(([o,i])=>[o,`"${i}"`])),await e(n,r);}async function j(t,r={}){let{tag:n=g,throwIfMissingInCatalog:o=false,workspaceRoot:i=b()}=r,e=await x(i);if(!e)throw new Error("No catalog found");if(o===true&&!e[t])throw new Error(`Package "${t}" not found in catalog: ${JSON.stringify(e,null,2)}`);let s=await _(t,n);(!valid(coerce(e[t]))||coerce(e[t])&&coerce(s)&&gt(coerce(s),coerce(e[t])))&&(e[t]=s),await d(e,i);}export{A as a,x as b,d as c,j as d};
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkMJEKZAJO_cjs=require('./chunk-MJEKZAJO.cjs'),child_process=require('child_process'),semver=require('semver');var l="latest";var g=l;async function T(){return new Promise((t,r)=>{child_process.exec("npm config get registry",(n,o,i)=>n?r(n):i?r(i):t(o.trim()));})}async function w(t,r=g,n={}){let{registry:o=T()}=n;return new Promise((i,e)=>{child_process.exec(`npm view ${t} version --registry=${o} --tag=${r}`,(s,_,m)=>s?e(s):m?e(m):i(_.trim()));})}async function G(t=chunkMJEKZAJO_cjs.b(process.cwd())){let r=await chunkMJEKZAJO_cjs.d(t);if(!r)throw new Error("No pnpm-workspace.yaml file found");if(r?.catalog)return Object.fromEntries(Object.entries(r.catalog).map(([n,o])=>[n,o.replaceAll(/^"/g,"").replaceAll(/"$/g,"")]));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 A(t=chunkMJEKZAJO_cjs.b(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 x(t,r=chunkMJEKZAJO_cjs.b(process.cwd())){let n=await chunkMJEKZAJO_cjs.d(r);if(!n)throw new Error("No pnpm-workspace.yaml file found");n.catalog=Object.fromEntries(Object.entries(t).map(([o,i])=>[o,`"${i}"`])),await chunkMJEKZAJO_cjs.e(n,r);}async function B(t,r={}){let{tag:n=g,throwIfMissingInCatalog:o=false,workspaceRoot:i=chunkMJEKZAJO_cjs.b()}=r,e=await A(i);if(!e)throw new Error("No catalog found");if(o===true&&!e[t])throw new Error(`Package "${t}" not found in catalog: ${JSON.stringify(e,null,2)}`);let s=await w(t,n);(!semver.valid(semver.coerce(e[t]))||semver.coerce(e[t])&&semver.coerce(s)&&semver.gt(semver.coerce(s),semver.coerce(e[t])))&&(e[t]=s),await x(e,i);}exports.a=G;exports.b=A;exports.c=x;exports.d=B;
1
+ 'use strict';var chunkVCKQ3P42_cjs=require('./chunk-VCKQ3P42.cjs'),child_process=require('child_process'),semver=require('semver');var l="latest";var g=l;async function T(){return new Promise((t,r)=>{child_process.exec("npm config get registry",(n,o,i)=>n?r(n):i?r(i):t(o.trim()));})}async function w(t,r=g,n={}){let{registry:o=T()}=n;return new Promise((i,e)=>{child_process.exec(`npm view ${t} version --registry=${o} --tag=${r}`,(s,_,m)=>s?e(s):m?e(m):i(_.trim()));})}async function G(t=chunkVCKQ3P42_cjs.b(process.cwd())){let r=await chunkVCKQ3P42_cjs.d(t);if(!r)throw new Error("No pnpm-workspace.yaml file found");if(r?.catalog)return Object.fromEntries(Object.entries(r.catalog).map(([n,o])=>[n,o.replaceAll(/^"/g,"").replaceAll(/"$/g,"")]));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 A(t=chunkVCKQ3P42_cjs.b(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 x(t,r=chunkVCKQ3P42_cjs.b(process.cwd())){let n=await chunkVCKQ3P42_cjs.d(r);if(!n)throw new Error("No pnpm-workspace.yaml file found");n.catalog=Object.fromEntries(Object.entries(t).map(([o,i])=>[o,`"${i}"`])),await chunkVCKQ3P42_cjs.e(n,r);}async function B(t,r={}){let{tag:n=g,throwIfMissingInCatalog:o=false,workspaceRoot:i=chunkVCKQ3P42_cjs.b()}=r,e=await A(i);if(!e)throw new Error("No catalog found");if(o===true&&!e[t])throw new Error(`Package "${t}" not found in catalog: ${JSON.stringify(e,null,2)}`);let s=await w(t,n);(!semver.valid(semver.coerce(e[t]))||semver.coerce(e[t])&&semver.coerce(s)&&semver.gt(semver.coerce(s),semver.coerce(e[t])))&&(e[t]=s),await x(e,i);}exports.a=G;exports.b=A;exports.c=x;exports.d=B;
@@ -1 +1 @@
1
- 'use strict';var chunkW4TJXJ3L_cjs=require('../chunk-W4TJXJ3L.cjs');require('../chunk-MJEKZAJO.cjs');Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkW4TJXJ3L_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkW4TJXJ3L_cjs.a}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkW4TJXJ3L_cjs.c}});Object.defineProperty(exports,"upgradeCatalogPackage",{enumerable:true,get:function(){return chunkW4TJXJ3L_cjs.d}});
1
+ 'use strict';var chunkZCHODZ5U_cjs=require('../chunk-ZCHODZ5U.cjs');require('../chunk-VCKQ3P42.cjs');Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkZCHODZ5U_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkZCHODZ5U_cjs.a}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkZCHODZ5U_cjs.c}});Object.defineProperty(exports,"upgradeCatalogPackage",{enumerable:true,get:function(){return chunkZCHODZ5U_cjs.d}});
@@ -1 +1 @@
1
- export{b as getCatalog,a as getCatalogSafe,c as setCatalog,d as upgradeCatalogPackage}from'../chunk-ETQM4AGR.js';import'../chunk-7MJHUWVF.js';
1
+ export{b as getCatalog,a as getCatalogSafe,c as setCatalog,d as upgradeCatalogPackage}from'../chunk-Z4T6FZTE.js';import'../chunk-XTBC4NUB.js';
@@ -1 +1 @@
1
- 'use strict';require('../chunk-QNTSKZUU.cjs');var chunkPCTJLZIA_cjs=require('../chunk-PCTJLZIA.cjs'),chunkW4TJXJ3L_cjs=require('../chunk-W4TJXJ3L.cjs'),chunkMJEKZAJO_cjs=require('../chunk-MJEKZAJO.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkPCTJLZIA_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkW4TJXJ3L_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkW4TJXJ3L_cjs.a}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkW4TJXJ3L_cjs.c}});Object.defineProperty(exports,"upgradeCatalogPackage",{enumerable:true,get:function(){return chunkW4TJXJ3L_cjs.d}});Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkMJEKZAJO_cjs.c}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkMJEKZAJO_cjs.d}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkMJEKZAJO_cjs.e}});
1
+ 'use strict';require('../chunk-QNTSKZUU.cjs');var chunk5SAFTNVG_cjs=require('../chunk-5SAFTNVG.cjs'),chunkZCHODZ5U_cjs=require('../chunk-ZCHODZ5U.cjs'),chunkVCKQ3P42_cjs=require('../chunk-VCKQ3P42.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunk5SAFTNVG_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkZCHODZ5U_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkZCHODZ5U_cjs.a}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkZCHODZ5U_cjs.c}});Object.defineProperty(exports,"upgradeCatalogPackage",{enumerable:true,get:function(){return chunkZCHODZ5U_cjs.d}});Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkVCKQ3P42_cjs.c}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkVCKQ3P42_cjs.d}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkVCKQ3P42_cjs.e}});
@@ -1 +1 @@
1
- import'../chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'../chunk-ZCIPFY7B.js';export{b as getCatalog,a as getCatalogSafe,c as setCatalog,d as upgradeCatalogPackage}from'../chunk-ETQM4AGR.js';export{c as getPnpmWorkspaceFilePath,d as readPnpmWorkspaceFile,e as writePnpmWorkspaceFile}from'../chunk-7MJHUWVF.js';
1
+ import'../chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'../chunk-XDDTK3CL.js';export{b as getCatalog,a as getCatalogSafe,c as setCatalog,d as upgradeCatalogPackage}from'../chunk-Z4T6FZTE.js';export{c as getPnpmWorkspaceFilePath,d as readPnpmWorkspaceFile,e as writePnpmWorkspaceFile}from'../chunk-XTBC4NUB.js';
@@ -1 +1 @@
1
- 'use strict';var chunkMJEKZAJO_cjs=require('../chunk-MJEKZAJO.cjs');Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkMJEKZAJO_cjs.c}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkMJEKZAJO_cjs.d}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkMJEKZAJO_cjs.e}});
1
+ 'use strict';var chunkVCKQ3P42_cjs=require('../chunk-VCKQ3P42.cjs');Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkVCKQ3P42_cjs.c}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkVCKQ3P42_cjs.d}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkVCKQ3P42_cjs.e}});
@@ -1 +1 @@
1
- export{c as getPnpmWorkspaceFilePath,d as readPnpmWorkspaceFile,e as writePnpmWorkspaceFile}from'../chunk-7MJHUWVF.js';
1
+ export{c as getPnpmWorkspaceFilePath,d as readPnpmWorkspaceFile,e as writePnpmWorkspaceFile}from'../chunk-XTBC4NUB.js';
@@ -1 +1 @@
1
- 'use strict';var chunkPCTJLZIA_cjs=require('../chunk-PCTJLZIA.cjs');require('../chunk-W4TJXJ3L.cjs'),require('../chunk-MJEKZAJO.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkPCTJLZIA_cjs.a}});
1
+ 'use strict';var chunk5SAFTNVG_cjs=require('../chunk-5SAFTNVG.cjs');require('../chunk-ZCHODZ5U.cjs'),require('../chunk-VCKQ3P42.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunk5SAFTNVG_cjs.a}});
@@ -1 +1 @@
1
- export{a as replaceDepsAliases}from'../chunk-ZCIPFY7B.js';import'../chunk-ETQM4AGR.js';import'../chunk-7MJHUWVF.js';
1
+ export{a as replaceDepsAliases}from'../chunk-XDDTK3CL.js';import'../chunk-Z4T6FZTE.js';import'../chunk-XTBC4NUB.js';
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';require('./chunk-SFZRYJZ2.cjs'),require('./chunk-QNTSKZUU.cjs');var chunkPCTJLZIA_cjs=require('./chunk-PCTJLZIA.cjs'),chunkW4TJXJ3L_cjs=require('./chunk-W4TJXJ3L.cjs'),chunkMJEKZAJO_cjs=require('./chunk-MJEKZAJO.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkPCTJLZIA_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkW4TJXJ3L_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkW4TJXJ3L_cjs.a}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkW4TJXJ3L_cjs.c}});Object.defineProperty(exports,"upgradeCatalogPackage",{enumerable:true,get:function(){return chunkW4TJXJ3L_cjs.d}});Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkMJEKZAJO_cjs.c}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkMJEKZAJO_cjs.d}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkMJEKZAJO_cjs.e}});
1
+ 'use strict';require('./chunk-SFZRYJZ2.cjs'),require('./chunk-QNTSKZUU.cjs');var chunk5SAFTNVG_cjs=require('./chunk-5SAFTNVG.cjs'),chunkZCHODZ5U_cjs=require('./chunk-ZCHODZ5U.cjs'),chunkVCKQ3P42_cjs=require('./chunk-VCKQ3P42.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunk5SAFTNVG_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkZCHODZ5U_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkZCHODZ5U_cjs.a}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkZCHODZ5U_cjs.c}});Object.defineProperty(exports,"upgradeCatalogPackage",{enumerable:true,get:function(){return chunkZCHODZ5U_cjs.d}});Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkVCKQ3P42_cjs.c}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkVCKQ3P42_cjs.d}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkVCKQ3P42_cjs.e}});
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import'./chunk-GGNOJ77I.js';import'./chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'./chunk-ZCIPFY7B.js';export{b as getCatalog,a as getCatalogSafe,c as setCatalog,d as upgradeCatalogPackage}from'./chunk-ETQM4AGR.js';export{c as getPnpmWorkspaceFilePath,d as readPnpmWorkspaceFile,e as writePnpmWorkspaceFile}from'./chunk-7MJHUWVF.js';
1
+ import'./chunk-GGNOJ77I.js';import'./chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'./chunk-XDDTK3CL.js';export{b as getCatalog,a as getCatalogSafe,c as setCatalog,d as upgradeCatalogPackage}from'./chunk-Z4T6FZTE.js';export{c as getPnpmWorkspaceFilePath,d as readPnpmWorkspaceFile,e as writePnpmWorkspaceFile}from'./chunk-XTBC4NUB.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/pnpm-tools",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "description": "A set of [pnpm](https://pnpm.io/) plugins and utilities for managing workspace packages/dependencies.",
6
6
  "repository": {
@@ -89,9 +89,9 @@
89
89
  "dependencies": {
90
90
  "@pnpm/plugin-better-defaults": "^0.2.1",
91
91
  "@pnpm/plugin-esm-node-path": "^0.1.2",
92
- "@storm-software/config": "^1.131.2",
93
- "@storm-software/config-tools": "^1.185.2",
94
- "@storm-software/npm-tools": "^0.3.2",
92
+ "@storm-software/config": "^1.131.4",
93
+ "@storm-software/config-tools": "^1.185.4",
94
+ "@storm-software/npm-tools": "^0.3.4",
95
95
  "commander": "^12.1.0",
96
96
  "defu": "6.1.4",
97
97
  "prettier": "^3.5.1",
@@ -105,5 +105,5 @@
105
105
  "tsup": "8.4.0"
106
106
  },
107
107
  "publishConfig": { "access": "public" },
108
- "gitHead": "a65b87ef2f82c159996a3c45db514650df5d86ee"
108
+ "gitHead": "bf0e3ad2902fa0cd4613fe4896deea054a78a4be"
109
109
  }
@@ -1,4 +0,0 @@
1
- import {existsSync}from'node:fs';import {join}from'node:path';import {readFile,writeFile}from'node:fs/promises';import {parse,stringify}from'yaml';var x=/^[A-Za-z]:\//;function _(e=""){return e&&e.replace(/\\/g,"/").replace(x,n=>n.toUpperCase())}var P=/^[/\\]{2}/,R=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,E=/^[A-Za-z]:$/;var l=function(e){if(!e||e.length===0)return ".";e=_(e);let n=e.match(P),t=d(e),o=e[e.length-1]==="/";return e=j(e,!t),e.length===0?t?"/":o?"./":".":(o&&(e+="/"),E.test(e)&&(e+="/"),n?t?`//${e}`:`//./${e}`:t&&!d(e)?`/${e}`:e)},k=function(...e){let n="";for(let t of e)if(t)if(n.length>0){let o=n[n.length-1]==="/",r=t[0]==="/";o&&r?n+=t.slice(1):n+=o||r?t:`/${t}`;}else n+=t;return l(n)};function j(e,n){let t="",o=0,r=-1,c=0,i=null;for(let s=0;s<=e.length;++s){if(s<e.length)i=e[s];else {if(i==="/")break;i="/";}if(i==="/"){if(!(r===s-1||c===1))if(c===2){if(t.length<2||o!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let g=t.lastIndexOf("/");g===-1?(t="",o=0):(t=t.slice(0,g),o=t.length-1-t.lastIndexOf("/")),r=s,c=0;continue}else if(t.length>0){t="",o=0,r=s,c=0;continue}}n&&(t+=t.length>0?"/..":"..",o=2);}else t.length>0?t+=`/${e.slice(r+1,s)}`:t=e.slice(r+1,s),o=s-r-1;r=s,c=0;}else i==="."&&c!==-1?++c:c=-1;}return t}var d=function(e){return R.test(e)};var A=30,O=0;function u(e,n=[],t=[]){let o=e??process.cwd();if(t.some(r=>existsSync(join(o,r)))||n.some(r=>existsSync(join(o,r))))return o;if(o!=="/"&&O++<A){let r=join(o,"..");return u(r,n,t)}}var w=["storm-workspace.json","storm-workspace.yaml","storm-workspace.yml","storm-workspace.js","storm-workspace.ts",".storm-workspace.json",".storm-workspace.yaml",".storm-workspace.yml",".storm-workspace.js",".storm-workspace.ts","lerna.json","nx.json","turbo.json","npm-workspace.json","yarn-workspace.json","pnpm-workspace.json","npm-workspace.yaml","yarn-workspace.yaml","pnpm-workspace.yaml","npm-workspace.yml","yarn-workspace.yml","pnpm-workspace.yml","npm-lock.json","yarn-lock.json","pnpm-lock.json","npm-lock.yaml","yarn-lock.yaml","pnpm-lock.yaml","npm-lock.yml","yarn-lock.yml","pnpm-lock.yml","bun.lockb"],T=[".storm-workspace",".nx",".github",".vscode",".verdaccio"];function S(e){return process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH?l(process.env.STORM_WORKSPACE_ROOT??process.env.NX_WORKSPACE_ROOT_PATH):l(u(e??process.cwd(),w,T))}function a(e){let n=S(e);if(!n)throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
2
- ${w.join(`
3
- `)}
4
- Path: ${e||process.cwd()}`);return n}function y(e=a(process.cwd())){let n=k(e,"pnpm-workspace.yaml");if(!existsSync(n))throw new Error(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${n}).`);return n}async function q(e=a(process.cwd())){let n=await readFile(y(e),"utf8");if(n)return parse(n)}async function J(e,n=a(process.cwd())){await writeFile(y(n),stringify(e));}export{k as a,a as b,y as c,q as d,J as e};
@@ -1,4 +0,0 @@
1
- 'use strict';var fs=require('fs'),path=require('path'),promises=require('fs/promises'),yaml=require('yaml');var y=/^[A-Za-z]:\//;function x(e=""){return e&&e.replace(/\\/g,"/").replace(y,n=>n.toUpperCase())}var _=/^[/\\]{2}/,P=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,R=/^[A-Za-z]:$/;var l=function(e){if(!e||e.length===0)return ".";e=x(e);let n=e.match(_),t=g(e),o=e[e.length-1]==="/";return e=E(e,!t),e.length===0?t?"/":o?"./":".":(o&&(e+="/"),R.test(e)&&(e+="/"),n?t?`//${e}`:`//./${e}`:t&&!g(e)?`/${e}`:e)},d=function(...e){let n="";for(let t of e)if(t)if(n.length>0){let o=n[n.length-1]==="/",r=t[0]==="/";o&&r?n+=t.slice(1):n+=o||r?t:`/${t}`;}else n+=t;return l(n)};function E(e,n){let t="",o=0,r=-1,c=0,i=null;for(let s=0;s<=e.length;++s){if(s<e.length)i=e[s];else {if(i==="/")break;i="/";}if(i==="/"){if(!(r===s-1||c===1))if(c===2){if(t.length<2||o!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let u=t.lastIndexOf("/");u===-1?(t="",o=0):(t=t.slice(0,u),o=t.length-1-t.lastIndexOf("/")),r=s,c=0;continue}else if(t.length>0){t="",o=0,r=s,c=0;continue}}n&&(t+=t.length>0?"/..":"..",o=2);}else t.length>0?t+=`/${e.slice(r+1,s)}`:t=e.slice(r+1,s),o=s-r-1;r=s,c=0;}else i==="."&&c!==-1?++c:c=-1;}return t}var g=function(e){return P.test(e)};var j=30,A=0;function m(e,n=[],t=[]){let o=e??process.cwd();if(t.some(r=>fs.existsSync(path.join(o,r)))||n.some(r=>fs.existsSync(path.join(o,r))))return o;if(o!=="/"&&A++<j){let r=path.join(o,"..");return m(r,n,t)}}var h=["storm-workspace.json","storm-workspace.yaml","storm-workspace.yml","storm-workspace.js","storm-workspace.ts",".storm-workspace.json",".storm-workspace.yaml",".storm-workspace.yml",".storm-workspace.js",".storm-workspace.ts","lerna.json","nx.json","turbo.json","npm-workspace.json","yarn-workspace.json","pnpm-workspace.json","npm-workspace.yaml","yarn-workspace.yaml","pnpm-workspace.yaml","npm-workspace.yml","yarn-workspace.yml","pnpm-workspace.yml","npm-lock.json","yarn-lock.json","pnpm-lock.json","npm-lock.yaml","yarn-lock.yaml","pnpm-lock.yaml","npm-lock.yml","yarn-lock.yml","pnpm-lock.yml","bun.lockb"],O=[".storm-workspace",".nx",".github",".vscode",".verdaccio"];function T(e){return process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH?l(process.env.STORM_WORKSPACE_ROOT??process.env.NX_WORKSPACE_ROOT_PATH):l(m(e??process.cwd(),h,O))}function a(e){let n=T(e);if(!n)throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
2
- ${h.join(`
3
- `)}
4
- Path: ${e||process.cwd()}`);return n}function w(e=a(process.cwd())){let n=d(e,"pnpm-workspace.yaml");if(!fs.existsSync(n))throw new Error(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${n}).`);return n}async function G(e=a(process.cwd())){let n=await promises.readFile(w(e),"utf8");if(n)return yaml.parse(n)}async function q(e,n=a(process.cwd())){await promises.writeFile(w(n),yaml.stringify(e));}exports.a=d;exports.b=a;exports.c=w;exports.d=G;exports.e=q;