@storm-software/pnpm-tools 0.6.111 → 0.6.113
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 +26 -0
- package/README.md +1 -1
- package/bin/pnpm.cjs +23 -14
- package/bin/pnpm.js +23 -14
- package/dist/chunk-7QQ55GIN.js +2 -0
- package/dist/{chunk-OKUC5BI2.js → chunk-ARKATJGX.js} +1 -1
- package/dist/chunk-DZ7HXKJD.cjs +2 -0
- package/dist/{chunk-ORSJZ7TS.cjs → chunk-W6ZWMOJ6.cjs} +1 -1
- package/dist/helpers/catalog.cjs +1 -1
- package/dist/helpers/catalog.d.cts +6 -2
- package/dist/helpers/catalog.d.ts +6 -2
- package/dist/helpers/catalog.js +1 -1
- package/dist/helpers/index.cjs +1 -1
- package/dist/helpers/index.d.cts +1 -1
- package/dist/helpers/index.d.ts +1 -1
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/replace-deps-aliases.cjs +1 -1
- package/dist/helpers/replace-deps-aliases.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -6
- package/dist/chunk-67WUYNAK.cjs +0 -2
- package/dist/chunk-7ZZFNO2T.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Storm Ops - Pnpm Tools
|
|
4
4
|
|
|
5
|
+
## [0.6.112](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.6.112) (03/11/2026)
|
|
6
|
+
|
|
7
|
+
### Miscellaneous
|
|
8
|
+
|
|
9
|
+
- **monorepo:** Regenerate `README.md` files ([be5201d27](https://github.com/storm-software/storm-ops/commit/be5201d27))
|
|
10
|
+
|
|
11
|
+
### Updated Dependencies
|
|
12
|
+
|
|
13
|
+
- Updated **testing-tools** to **v1.119.103**
|
|
14
|
+
- Updated **config-tools** to **v1.189.28**
|
|
15
|
+
- Updated **npm-tools** to **v0.6.66**
|
|
16
|
+
- Updated **config** to **v1.135.29**
|
|
17
|
+
|
|
18
|
+
## [0.6.111](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.6.111) (03/11/2026)
|
|
19
|
+
|
|
20
|
+
### Miscellaneous
|
|
21
|
+
|
|
22
|
+
- **monorepo:** Update workspace's `README.md` files ([b38023362](https://github.com/storm-software/storm-ops/commit/b38023362))
|
|
23
|
+
|
|
24
|
+
### Updated Dependencies
|
|
25
|
+
|
|
26
|
+
- Updated **testing-tools** to **v1.119.102**
|
|
27
|
+
- Updated **config-tools** to **v1.189.27**
|
|
28
|
+
- Updated **npm-tools** to **v0.6.65**
|
|
29
|
+
- Updated **config** to **v1.135.28**
|
|
30
|
+
|
|
5
31
|
## [0.6.110](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.6.110) (03/11/2026)
|
|
6
32
|
|
|
7
33
|
### 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
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
package/bin/pnpm.cjs
CHANGED
|
@@ -111,25 +111,22 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
111
111
|
executable: "pnpm"
|
|
112
112
|
});
|
|
113
113
|
const version = `${prefix || ""}${origVersion.replace(/^[\^~><=*]+/g, "")}`;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
`The version for package "${packageName}" is already up to date in the catalog: ${version}`,
|
|
117
|
-
workspaceConfig
|
|
118
|
-
);
|
|
119
|
-
} else if (!(0, import_semver.valid)((0, import_semver.coerce)(catalog[packageName])) || (0, import_semver.coerce)(catalog[packageName]) && (0, import_semver.coerce)(version) && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
114
|
+
let updated = false;
|
|
115
|
+
if (!(0, import_semver.valid)((0, import_semver.coerce)(catalog[packageName])) || (0, import_semver.coerce)(catalog[packageName]) && (0, import_semver.coerce)(version) && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
120
116
|
(0, import_semver.gt)((0, import_semver.coerce)(version), (0, import_semver.coerce)(catalog[packageName]))) {
|
|
121
117
|
catalog[packageName] = `${prefix || ""}${version.replace(/^[\^~><=*]+/g, "")}`;
|
|
122
118
|
(0, import_console.writeDebug)(
|
|
123
|
-
`Writing version ${catalog[packageName]} to catalog for "${packageName}" package`,
|
|
119
|
+
`Writing version v${catalog[packageName]} to catalog for "${packageName}" package`,
|
|
124
120
|
workspaceConfig
|
|
125
121
|
);
|
|
122
|
+
updated = true;
|
|
126
123
|
} else {
|
|
127
|
-
(0, import_console.
|
|
128
|
-
`The current version
|
|
124
|
+
(0, import_console.writeDebug)(
|
|
125
|
+
`The current version v${catalog[packageName]} for package "${packageName}" is greater than or equal to the version v${version} fetched from the npm registry with tag "${tag}". No update performed.`,
|
|
129
126
|
workspaceConfig
|
|
130
127
|
);
|
|
131
128
|
}
|
|
132
|
-
return catalog;
|
|
129
|
+
return { catalog, updated };
|
|
133
130
|
}
|
|
134
131
|
|
|
135
132
|
// src/cli/index.ts
|
|
@@ -188,6 +185,7 @@ async function updateAction(packageNames, {
|
|
|
188
185
|
);
|
|
189
186
|
}
|
|
190
187
|
let packagesFound = false;
|
|
188
|
+
let packagesUpdated = false;
|
|
191
189
|
for (const pkg of packages) {
|
|
192
190
|
const matchedPackages = Object.keys(catalog).filter(
|
|
193
191
|
(p) => pkg.endsWith("/") ? p.startsWith(pkg) : p === pkg
|
|
@@ -198,8 +196,8 @@ async function updateAction(packageNames, {
|
|
|
198
196
|
_config
|
|
199
197
|
);
|
|
200
198
|
} else {
|
|
201
|
-
(0, import_config_tools2.
|
|
202
|
-
`${(0, import_config_tools2.brandIcon)(_config)} Found ${matchedPackages.length} matching
|
|
199
|
+
(0, import_config_tools2.writeDebug)(
|
|
200
|
+
`${(0, import_config_tools2.brandIcon)(_config)} Found ${matchedPackages.length} packages matching "${pkg}" in the pnpm catalog file:
|
|
203
201
|
|
|
204
202
|
- ${matchedPackages.map((p) => `${p} (${catalog[p] || "unknown"})`).join("\n- ")}`,
|
|
205
203
|
_config
|
|
@@ -207,11 +205,15 @@ async function updateAction(packageNames, {
|
|
|
207
205
|
packagesFound = true;
|
|
208
206
|
for (const matchedPackage of matchedPackages) {
|
|
209
207
|
(0, import_config_tools2.writeTrace)(`- Upgrading ${matchedPackage}...`, _config);
|
|
210
|
-
|
|
208
|
+
const result = await upgradeCatalog(catalog, matchedPackage, {
|
|
211
209
|
tag,
|
|
212
210
|
prefix,
|
|
213
211
|
workspaceRoot: _config.workspaceRoot
|
|
214
212
|
});
|
|
213
|
+
if (result.updated) {
|
|
214
|
+
catalog = result.catalog;
|
|
215
|
+
packagesUpdated = true;
|
|
216
|
+
}
|
|
215
217
|
}
|
|
216
218
|
}
|
|
217
219
|
}
|
|
@@ -226,9 +228,16 @@ async function updateAction(packageNames, {
|
|
|
226
228
|
"Finalizing changes to the pnpm workspace's catalog dependencies",
|
|
227
229
|
_config
|
|
228
230
|
);
|
|
231
|
+
if (!packagesUpdated) {
|
|
232
|
+
(0, import_config_tools2.writeDebug)(
|
|
233
|
+
"No packages were updated since all matching packages are already up to date in the catalog.",
|
|
234
|
+
_config
|
|
235
|
+
);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
229
238
|
await setCatalog(catalog, _config.workspaceRoot);
|
|
230
239
|
if (install) {
|
|
231
|
-
(0, import_config_tools2.
|
|
240
|
+
(0, import_config_tools2.writeDebug)(
|
|
232
241
|
"Running `pnpm install --no-frozen-lockfile` to update local dependency versions",
|
|
233
242
|
_config
|
|
234
243
|
);
|
package/bin/pnpm.js
CHANGED
|
@@ -128,25 +128,22 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
128
128
|
executable: "pnpm"
|
|
129
129
|
});
|
|
130
130
|
const version = `${prefix || ""}${origVersion.replace(/^[\^~><=*]+/g, "")}`;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
`The version for package "${packageName}" is already up to date in the catalog: ${version}`,
|
|
134
|
-
workspaceConfig
|
|
135
|
-
);
|
|
136
|
-
} else if (!valid(coerce(catalog[packageName])) || coerce(catalog[packageName]) && coerce(version) && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
131
|
+
let updated = false;
|
|
132
|
+
if (!valid(coerce(catalog[packageName])) || coerce(catalog[packageName]) && coerce(version) && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
137
133
|
gt(coerce(version), coerce(catalog[packageName]))) {
|
|
138
134
|
catalog[packageName] = `${prefix || ""}${version.replace(/^[\^~><=*]+/g, "")}`;
|
|
139
135
|
writeDebug(
|
|
140
|
-
`Writing version ${catalog[packageName]} to catalog for "${packageName}" package`,
|
|
136
|
+
`Writing version v${catalog[packageName]} to catalog for "${packageName}" package`,
|
|
141
137
|
workspaceConfig
|
|
142
138
|
);
|
|
139
|
+
updated = true;
|
|
143
140
|
} else {
|
|
144
|
-
|
|
145
|
-
`The current version
|
|
141
|
+
writeDebug(
|
|
142
|
+
`The current version v${catalog[packageName]} for package "${packageName}" is greater than or equal to the version v${version} fetched from the npm registry with tag "${tag}". No update performed.`,
|
|
146
143
|
workspaceConfig
|
|
147
144
|
);
|
|
148
145
|
}
|
|
149
|
-
return catalog;
|
|
146
|
+
return { catalog, updated };
|
|
150
147
|
}
|
|
151
148
|
|
|
152
149
|
// src/cli/index.ts
|
|
@@ -205,6 +202,7 @@ async function updateAction(packageNames, {
|
|
|
205
202
|
);
|
|
206
203
|
}
|
|
207
204
|
let packagesFound = false;
|
|
205
|
+
let packagesUpdated = false;
|
|
208
206
|
for (const pkg of packages) {
|
|
209
207
|
const matchedPackages = Object.keys(catalog).filter(
|
|
210
208
|
(p) => pkg.endsWith("/") ? p.startsWith(pkg) : p === pkg
|
|
@@ -215,8 +213,8 @@ async function updateAction(packageNames, {
|
|
|
215
213
|
_config
|
|
216
214
|
);
|
|
217
215
|
} else {
|
|
218
|
-
|
|
219
|
-
`${brandIcon(_config)} Found ${matchedPackages.length} matching
|
|
216
|
+
writeDebug2(
|
|
217
|
+
`${brandIcon(_config)} Found ${matchedPackages.length} packages matching "${pkg}" in the pnpm catalog file:
|
|
220
218
|
|
|
221
219
|
- ${matchedPackages.map((p) => `${p} (${catalog[p] || "unknown"})`).join("\n- ")}`,
|
|
222
220
|
_config
|
|
@@ -224,11 +222,15 @@ async function updateAction(packageNames, {
|
|
|
224
222
|
packagesFound = true;
|
|
225
223
|
for (const matchedPackage of matchedPackages) {
|
|
226
224
|
writeTrace3(`- Upgrading ${matchedPackage}...`, _config);
|
|
227
|
-
|
|
225
|
+
const result = await upgradeCatalog(catalog, matchedPackage, {
|
|
228
226
|
tag,
|
|
229
227
|
prefix,
|
|
230
228
|
workspaceRoot: _config.workspaceRoot
|
|
231
229
|
});
|
|
230
|
+
if (result.updated) {
|
|
231
|
+
catalog = result.catalog;
|
|
232
|
+
packagesUpdated = true;
|
|
233
|
+
}
|
|
232
234
|
}
|
|
233
235
|
}
|
|
234
236
|
}
|
|
@@ -243,9 +245,16 @@ async function updateAction(packageNames, {
|
|
|
243
245
|
"Finalizing changes to the pnpm workspace's catalog dependencies",
|
|
244
246
|
_config
|
|
245
247
|
);
|
|
248
|
+
if (!packagesUpdated) {
|
|
249
|
+
writeDebug2(
|
|
250
|
+
"No packages were updated since all matching packages are already up to date in the catalog.",
|
|
251
|
+
_config
|
|
252
|
+
);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
246
255
|
await setCatalog(catalog, _config.workspaceRoot);
|
|
247
256
|
if (install) {
|
|
248
|
-
|
|
257
|
+
writeDebug2(
|
|
249
258
|
"Running `pnpm install --no-frozen-lockfile` to update local dependency versions",
|
|
250
259
|
_config
|
|
251
260
|
);
|
|
@@ -0,0 +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}
|
|
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 v(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)&>(coerce(c$1),coerce(t[r]))?(t[r]=`${g||""}${c$1.replace(/^[\^~><=*]+/g,"")}`,b(`Writing version v${t[r]} to catalog for "${r}" package`,a),i=true):b(`The current version v${t[r]} for package "${r}" is greater than or equal to the version v${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)&>(coerce(i),coerce(n[t]))?(n[t]=`${o||""}${i.replace(/^[\^~><=*]+/g,"")}`,b(`Writing version ${n[t]} to catalog for "${t}" package`,a$1),await v(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,v as c,Z as d,tt as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-7QQ55GIN.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};
|
|
@@ -0,0 +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 v${t[r]} to catalog for "${r}" package`,a),i=true):chunkE3XYGDUJ_cjs.b(`The current version v${t[r]} for package "${r}" is greater than or equal to the version v${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 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkDZ7HXKJD_cjs=require('./chunk-DZ7HXKJD.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 chunkDZ7HXKJD_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;
|
package/dist/helpers/catalog.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkDZ7HXKJD_cjs=require('../chunk-DZ7HXKJD.cjs');require('../chunk-E3XYGDUJ.cjs');Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkDZ7HXKJD_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkDZ7HXKJD_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkDZ7HXKJD_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkDZ7HXKJD_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkDZ7HXKJD_cjs.d}});
|
|
@@ -52,6 +52,10 @@ interface UpgradeCatalogPackageOptions {
|
|
|
52
52
|
*/
|
|
53
53
|
prefix?: "^" | "~" | ">" | "<" | ">=" | "<=" | "*";
|
|
54
54
|
}
|
|
55
|
+
interface UpgradeCatalogResult {
|
|
56
|
+
catalog: Record<string, string>;
|
|
57
|
+
updated: boolean;
|
|
58
|
+
}
|
|
55
59
|
/**
|
|
56
60
|
* Upgrade a package in the pnpm catalog.
|
|
57
61
|
*
|
|
@@ -60,7 +64,7 @@ interface UpgradeCatalogPackageOptions {
|
|
|
60
64
|
* @param options - Options for upgrading the package.
|
|
61
65
|
* @returns The updated catalog.
|
|
62
66
|
*/
|
|
63
|
-
declare function upgradeCatalog(catalog: Record<string, string>, packageName: string, options?: UpgradeCatalogPackageOptions): Promise<
|
|
67
|
+
declare function upgradeCatalog(catalog: Record<string, string>, packageName: string, options?: UpgradeCatalogPackageOptions): Promise<UpgradeCatalogResult>;
|
|
64
68
|
/**
|
|
65
69
|
* Update package.json dependencies currently using `catalog:` or `workspace:*` to use the pnpm catalog dependencies actual versions and the local workspace versions respectively.
|
|
66
70
|
*
|
|
@@ -71,4 +75,4 @@ declare function upgradeCatalog(catalog: Record<string, string>, packageName: st
|
|
|
71
75
|
*/
|
|
72
76
|
declare function saveCatalog(packageName: string, options?: UpgradeCatalogPackageOptions): Promise<void>;
|
|
73
77
|
|
|
74
|
-
export { type UpgradeCatalogPackageOptions, getCatalog, getCatalogSafe, saveCatalog, setCatalog, upgradeCatalog };
|
|
78
|
+
export { type UpgradeCatalogPackageOptions, type UpgradeCatalogResult, getCatalog, getCatalogSafe, saveCatalog, setCatalog, upgradeCatalog };
|
|
@@ -52,6 +52,10 @@ interface UpgradeCatalogPackageOptions {
|
|
|
52
52
|
*/
|
|
53
53
|
prefix?: "^" | "~" | ">" | "<" | ">=" | "<=" | "*";
|
|
54
54
|
}
|
|
55
|
+
interface UpgradeCatalogResult {
|
|
56
|
+
catalog: Record<string, string>;
|
|
57
|
+
updated: boolean;
|
|
58
|
+
}
|
|
55
59
|
/**
|
|
56
60
|
* Upgrade a package in the pnpm catalog.
|
|
57
61
|
*
|
|
@@ -60,7 +64,7 @@ interface UpgradeCatalogPackageOptions {
|
|
|
60
64
|
* @param options - Options for upgrading the package.
|
|
61
65
|
* @returns The updated catalog.
|
|
62
66
|
*/
|
|
63
|
-
declare function upgradeCatalog(catalog: Record<string, string>, packageName: string, options?: UpgradeCatalogPackageOptions): Promise<
|
|
67
|
+
declare function upgradeCatalog(catalog: Record<string, string>, packageName: string, options?: UpgradeCatalogPackageOptions): Promise<UpgradeCatalogResult>;
|
|
64
68
|
/**
|
|
65
69
|
* Update package.json dependencies currently using `catalog:` or `workspace:*` to use the pnpm catalog dependencies actual versions and the local workspace versions respectively.
|
|
66
70
|
*
|
|
@@ -71,4 +75,4 @@ declare function upgradeCatalog(catalog: Record<string, string>, packageName: st
|
|
|
71
75
|
*/
|
|
72
76
|
declare function saveCatalog(packageName: string, options?: UpgradeCatalogPackageOptions): Promise<void>;
|
|
73
77
|
|
|
74
|
-
export { type UpgradeCatalogPackageOptions, getCatalog, getCatalogSafe, saveCatalog, setCatalog, upgradeCatalog };
|
|
78
|
+
export { type UpgradeCatalogPackageOptions, type UpgradeCatalogResult, getCatalog, getCatalogSafe, saveCatalog, setCatalog, upgradeCatalog };
|
package/dist/helpers/catalog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'../chunk-
|
|
1
|
+
export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'../chunk-7QQ55GIN.js';import'../chunk-I4FQEZQN.js';
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';require('../chunk-QNTSKZUU.cjs');var
|
|
1
|
+
'use strict';require('../chunk-QNTSKZUU.cjs');var chunkW6ZWMOJ6_cjs=require('../chunk-W6ZWMOJ6.cjs'),chunkDZ7HXKJD_cjs=require('../chunk-DZ7HXKJD.cjs'),chunkE3XYGDUJ_cjs=require('../chunk-E3XYGDUJ.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkW6ZWMOJ6_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkDZ7HXKJD_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkDZ7HXKJD_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkDZ7HXKJD_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkDZ7HXKJD_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkDZ7HXKJD_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}});
|
package/dist/helpers/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { UpgradeCatalogPackageOptions, getCatalog, getCatalogSafe, saveCatalog, setCatalog, upgradeCatalog } from './catalog.cjs';
|
|
1
|
+
export { UpgradeCatalogPackageOptions, UpgradeCatalogResult, getCatalog, getCatalogSafe, saveCatalog, setCatalog, upgradeCatalog } from './catalog.cjs';
|
|
2
2
|
export { getPnpmWorkspaceFilePath, readPnpmWorkspaceFile, writePnpmWorkspaceFile } from './pnpm-workspace.cjs';
|
|
3
3
|
export { replaceDepsAliases } from './replace-deps-aliases.cjs';
|
|
4
4
|
import '../types.cjs';
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { UpgradeCatalogPackageOptions, getCatalog, getCatalogSafe, saveCatalog, setCatalog, upgradeCatalog } from './catalog.js';
|
|
1
|
+
export { UpgradeCatalogPackageOptions, UpgradeCatalogResult, getCatalog, getCatalogSafe, saveCatalog, setCatalog, upgradeCatalog } from './catalog.js';
|
|
2
2
|
export { getPnpmWorkspaceFilePath, readPnpmWorkspaceFile, writePnpmWorkspaceFile } from './pnpm-workspace.js';
|
|
3
3
|
export { replaceDepsAliases } from './replace-deps-aliases.js';
|
|
4
4
|
import '../types.js';
|
package/dist/helpers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import'../chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'../chunk-
|
|
1
|
+
import'../chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'../chunk-ARKATJGX.js';export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'../chunk-7QQ55GIN.js';export{g as getPnpmWorkspaceFilePath,h as readPnpmWorkspaceFile,i as writePnpmWorkspaceFile}from'../chunk-I4FQEZQN.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkW6ZWMOJ6_cjs=require('../chunk-W6ZWMOJ6.cjs');require('../chunk-DZ7HXKJD.cjs'),require('../chunk-E3XYGDUJ.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkW6ZWMOJ6_cjs.a}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as replaceDepsAliases}from'../chunk-
|
|
1
|
+
export{a as replaceDepsAliases}from'../chunk-ARKATJGX.js';import'../chunk-7QQ55GIN.js';import'../chunk-I4FQEZQN.js';
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';require('./chunk-SFZRYJZ2.cjs'),require('./chunk-QNTSKZUU.cjs');var
|
|
1
|
+
'use strict';require('./chunk-SFZRYJZ2.cjs'),require('./chunk-QNTSKZUU.cjs');var chunkW6ZWMOJ6_cjs=require('./chunk-W6ZWMOJ6.cjs'),chunkDZ7HXKJD_cjs=require('./chunk-DZ7HXKJD.cjs'),chunkE3XYGDUJ_cjs=require('./chunk-E3XYGDUJ.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkW6ZWMOJ6_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkDZ7HXKJD_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkDZ7HXKJD_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkDZ7HXKJD_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkDZ7HXKJD_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkDZ7HXKJD_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}});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { UpgradeCatalogPackageOptions, getCatalog, getCatalogSafe, saveCatalog, setCatalog, upgradeCatalog } from './helpers/catalog.cjs';
|
|
1
|
+
export { UpgradeCatalogPackageOptions, UpgradeCatalogResult, getCatalog, getCatalogSafe, saveCatalog, setCatalog, upgradeCatalog } from './helpers/catalog.cjs';
|
|
2
2
|
export { getPnpmWorkspaceFilePath, readPnpmWorkspaceFile, writePnpmWorkspaceFile } from './helpers/pnpm-workspace.cjs';
|
|
3
3
|
export { replaceDepsAliases } from './helpers/replace-deps-aliases.cjs';
|
|
4
4
|
export { PnpmWorkspaceFile } from './types.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { UpgradeCatalogPackageOptions, getCatalog, getCatalogSafe, saveCatalog, setCatalog, upgradeCatalog } from './helpers/catalog.js';
|
|
1
|
+
export { UpgradeCatalogPackageOptions, UpgradeCatalogResult, getCatalog, getCatalogSafe, saveCatalog, setCatalog, upgradeCatalog } from './helpers/catalog.js';
|
|
2
2
|
export { getPnpmWorkspaceFilePath, readPnpmWorkspaceFile, writePnpmWorkspaceFile } from './helpers/pnpm-workspace.js';
|
|
3
3
|
export { replaceDepsAliases } from './helpers/replace-deps-aliases.js';
|
|
4
4
|
export { PnpmWorkspaceFile } from './types.js';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import'./chunk-GGNOJ77I.js';import'./chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'./chunk-
|
|
1
|
+
import'./chunk-GGNOJ77I.js';import'./chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'./chunk-ARKATJGX.js';export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'./chunk-7QQ55GIN.js';export{g as getPnpmWorkspaceFilePath,h as readPnpmWorkspaceFile,i as writePnpmWorkspaceFile}from'./chunk-I4FQEZQN.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/pnpm-tools",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.113",
|
|
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.
|
|
77
|
-
"@storm-software/config-tools": "^1.189.
|
|
78
|
-
"@storm-software/npm-tools": "^0.6.
|
|
76
|
+
"@storm-software/config": "^1.135.29",
|
|
77
|
+
"@storm-software/config-tools": "^1.189.28",
|
|
78
|
+
"@storm-software/npm-tools": "^0.6.66",
|
|
79
79
|
"commander": "^12.1.0",
|
|
80
80
|
"defu": "6.1.4",
|
|
81
81
|
"prettier": "^3.8.1",
|
|
@@ -85,9 +85,9 @@
|
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@pnpm/types": "^1001.3.0",
|
|
88
|
-
"@types/node": "^25.
|
|
88
|
+
"@types/node": "^25.5.0",
|
|
89
89
|
"tsup": "8.4.0"
|
|
90
90
|
},
|
|
91
91
|
"publishConfig": { "access": "public" },
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "f2ee5e8d460874eebf2e5083cd7c27b0f3f0cf92"
|
|
93
93
|
}
|
package/dist/chunk-67WUYNAK.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkE3XYGDUJ_cjs=require('./chunk-E3XYGDUJ.cjs'),child_process=require('child_process'),semver=require('semver');var h="latest";var u=h;async function _(r="npm"){return new Promise((t,e)=>{child_process.exec(`${r} config get registry`,(o,a,s)=>o&&!o.message.toLowerCase().trim().startsWith("npm warn")?e(o):s&&!s.toLowerCase().trim().startsWith("npm warn")?e(s):t(a.trim()));})}async function d(r,t=u,e={}){let o=e.executable||"npm",a=e.registry||await _(o);return new Promise((s,i)=>{child_process.exec(`${o} view ${r} version --registry=${a} --tag=${t}`,(n,g,p)=>n&&!n.message.toLowerCase().trim().startsWith("npm warn")?i(n):p&&!p.toLowerCase().trim().startsWith("npm warn")?i(p):s(g.trim()));})}async function G(r=chunkE3XYGDUJ_cjs.e(process.cwd())){let t=await chunkE3XYGDUJ_cjs.h(r);if(!t)throw new Error("No pnpm-workspace.yaml file found");if(t?.catalog)return Object.fromEntries(Object.entries(t.catalog).map(([e,o])=>[e,o.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in pnpm-workspace.yaml file located in workspace root: ${r}
|
|
2
|
-
File content: ${JSON.stringify(t,null,2)}`);}async function C(r=chunkE3XYGDUJ_cjs.e(process.cwd())){let t=await G(r);if(!t)throw new Error("No catalog entries found in pnpm-workspace.yaml file");return t}async function M(r,t=chunkE3XYGDUJ_cjs.e(process.cwd())){let e=await chunkE3XYGDUJ_cjs.h(t);if(!e)throw new Error("No pnpm-workspace.yaml file found");e.catalog=Object.fromEntries(Object.entries(r).map(([o,a])=>[o,a.replaceAll('"',"").replaceAll("'","")])),await chunkE3XYGDUJ_cjs.i(e,t);}async function Q(r,t,e={}){let{tag:o=u,prefix:a="^",workspaceRoot:s=chunkE3XYGDUJ_cjs.e()}=e,i=await chunkE3XYGDUJ_cjs.f(true,{workspaceRoot:s});chunkE3XYGDUJ_cjs.c(`Upgrading catalog entry for package "${t}" with tag "${o}"`,i);let n=await d(t,o,{executable:"pnpm"}),g=`${a||""}${n.replace(/^[\^~><=*]+/g,"")}`;return g===r[t]?chunkE3XYGDUJ_cjs.c(`The version for package "${t}" is already up to date in the catalog: ${g}`,i):!semver.valid(semver.coerce(r[t]))||semver.coerce(r[t])&&semver.coerce(g)&&semver.gt(semver.coerce(g),semver.coerce(r[t]))?(r[t]=`${a||""}${g.replace(/^[\^~><=*]+/g,"")}`,chunkE3XYGDUJ_cjs.b(`Writing version ${r[t]} to catalog for "${t}" package`,i)):chunkE3XYGDUJ_cjs.a(`The current version "${r[t]}" for package "${t}" is greater than or equal to the version "${g}" fetched from the npm registry with tag "${o}". No update performed.`,i),r}async function Z(r,t={}){let{tag:e=u,prefix:o="^",throwIfMissingInCatalog:a=false,workspaceRoot:s=chunkE3XYGDUJ_cjs.e()}=t,i=await chunkE3XYGDUJ_cjs.f(true,{workspaceRoot:s}),n=await C(s);if(!n)throw new Error("No catalog found");if(a===true&&!n[r])throw new Error(`Package "${r}" not found in catalog: ${JSON.stringify(n,null,2)}`);chunkE3XYGDUJ_cjs.c(`Upgrading catalog entry for package "${r}" with tag "${e}"`,i);let g=await d(r,e,{executable:"pnpm"}),p=`${o||""}${g.replace(/^[\^~><=*]+/g,"")}`;p===n[r]?chunkE3XYGDUJ_cjs.c(`The version for package "${r}" is already up to date in the catalog: ${p}`,i):!semver.valid(semver.coerce(n[r]))||semver.coerce(n[r])&&semver.coerce(p)&&semver.gt(semver.coerce(p),semver.coerce(n[r]))?(n[r]=`${o||""}${p.replace(/^[\^~><=*]+/g,"")}`,chunkE3XYGDUJ_cjs.b(`Writing version ${n[r]} to catalog for "${r}" package`,i),await M(n,s)):chunkE3XYGDUJ_cjs.a(`The current version "${n[r]}" for package "${r}" is greater than or equal to the version "${p}" fetched from the npm registry with tag "${e}". No update performed.`,i);}exports.a=G;exports.b=C;exports.c=M;exports.d=Q;exports.e=Z;
|
package/dist/chunk-7ZZFNO2T.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {h,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 u=_;async function x(r="npm"){return new Promise((t,e)=>{exec(`${r} config get registry`,(o,a,s)=>o&&!o.message.toLowerCase().trim().startsWith("npm warn")?e(o):s&&!s.toLowerCase().trim().startsWith("npm warn")?e(s):t(a.trim()));})}async function R(r,t=u,e={}){let o=e.executable||"npm",a=e.registry||await x(o);return new Promise((s,i)=>{exec(`${o} view ${r} version --registry=${a} --tag=${t}`,(n,g,p)=>n&&!n.message.toLowerCase().trim().startsWith("npm warn")?i(n):p&&!p.toLowerCase().trim().startsWith("npm warn")?i(p):s(g.trim()));})}async function C(r=e(process.cwd())){let t=await h(r);if(!t)throw new Error("No pnpm-workspace.yaml file found");if(t?.catalog)return Object.fromEntries(Object.entries(t.catalog).map(([e,o])=>[e,o.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in pnpm-workspace.yaml file located in workspace root: ${r}
|
|
2
|
-
File content: ${JSON.stringify(t,null,2)}`);}async function M(r=e(process.cwd())){let t=await C(r);if(!t)throw new Error("No catalog entries found in pnpm-workspace.yaml file");return t}async function v(r,t=e(process.cwd())){let e=await h(t);if(!e)throw new Error("No pnpm-workspace.yaml file found");e.catalog=Object.fromEntries(Object.entries(r).map(([o,a])=>[o,a.replaceAll('"',"").replaceAll("'","")])),await i(e,t);}async function Z(r,t,e$1={}){let{tag:o=u,prefix:a$1="^",workspaceRoot:s=e()}=e$1,i=await f(true,{workspaceRoot:s});c(`Upgrading catalog entry for package "${t}" with tag "${o}"`,i);let n=await R(t,o,{executable:"pnpm"}),g=`${a$1||""}${n.replace(/^[\^~><=*]+/g,"")}`;return g===r[t]?c(`The version for package "${t}" is already up to date in the catalog: ${g}`,i):!valid(coerce(r[t]))||coerce(r[t])&&coerce(g)&>(coerce(g),coerce(r[t]))?(r[t]=`${a$1||""}${g.replace(/^[\^~><=*]+/g,"")}`,b(`Writing version ${r[t]} to catalog for "${t}" package`,i)):a(`The current version "${r[t]}" for package "${t}" is greater than or equal to the version "${g}" fetched from the npm registry with tag "${o}". No update performed.`,i),r}async function rr(r,t={}){let{tag:e$1=u,prefix:o="^",throwIfMissingInCatalog:a$1=false,workspaceRoot:s=e()}=t,i=await f(true,{workspaceRoot:s}),n=await M(s);if(!n)throw new Error("No catalog found");if(a$1===true&&!n[r])throw new Error(`Package "${r}" not found in catalog: ${JSON.stringify(n,null,2)}`);c(`Upgrading catalog entry for package "${r}" with tag "${e$1}"`,i);let g=await R(r,e$1,{executable:"pnpm"}),p=`${o||""}${g.replace(/^[\^~><=*]+/g,"")}`;p===n[r]?c(`The version for package "${r}" is already up to date in the catalog: ${p}`,i):!valid(coerce(n[r]))||coerce(n[r])&&coerce(p)&>(coerce(p),coerce(n[r]))?(n[r]=`${o||""}${p.replace(/^[\^~><=*]+/g,"")}`,b(`Writing version ${n[r]} to catalog for "${r}" package`,i),await v(n,s)):a(`The current version "${n[r]}" for package "${r}" is greater than or equal to the version "${p}" fetched from the npm registry with tag "${e$1}". No update performed.`,i);}export{C as a,M as b,v as c,Z as d,rr as e};
|