@storm-software/pnpm-tools 0.7.88 → 0.7.89
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 +18 -0
- package/README.md +1 -1
- package/bin/pnpm.cjs +54 -19
- package/bin/pnpm.js +53 -18
- package/dist/chunk-EHOSPPPM.cjs +2 -0
- package/dist/chunk-ETTRGCQ4.js +2 -0
- package/dist/{chunk-5DGGSWUE.cjs → chunk-RFGN2A3E.cjs} +1 -1
- package/dist/{chunk-D5OWPJ4N.js → chunk-Z25SRWHS.js} +1 -1
- package/dist/helpers/catalog.cjs +1 -1
- package/dist/helpers/catalog.js +1 -1
- package/dist/helpers/index.cjs +1 -1
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/replace-deps-aliases.cjs +1 -1
- package/dist/helpers/replace-deps-aliases.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -6
- package/dist/chunk-HDFKZ7VD.cjs +0 -2
- package/dist/chunk-YS5TOJST.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Storm Ops - Pnpm Tools
|
|
4
4
|
|
|
5
|
+
## [0.7.89](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.7.89) (06/26/2026)
|
|
6
|
+
|
|
7
|
+
### Miscellaneous
|
|
8
|
+
|
|
9
|
+
- **monorepo:** Update workspace packages' dependencies ([5b4faf445](https://github.com/storm-software/storm-ops/commit/5b4faf445))
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- **npm-tools:** Updated `getVersion` function to allow `retries` and `timeout` options ([c1ebc0184](https://github.com/storm-software/storm-ops/commit/c1ebc0184))
|
|
14
|
+
|
|
15
|
+
### Updated Dependencies
|
|
16
|
+
|
|
17
|
+
- Updated **config** to **v1.138.15**
|
|
18
|
+
- Updated **config-tools** to **v1.190.78**
|
|
19
|
+
- Updated **npm-tools** to **v0.6.196**
|
|
20
|
+
- Updated **package-constants** to **v0.1.91**
|
|
21
|
+
- Updated **testing-tools** to **v1.119.231**
|
|
22
|
+
|
|
5
23
|
## [0.7.88](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.7.88) (06/24/2026)
|
|
6
24
|
|
|
7
25
|
### Bug Fixes
|
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
|
@@ -2186,7 +2186,7 @@ var import_commander = require("commander");
|
|
|
2186
2186
|
// package.json
|
|
2187
2187
|
var package_default = {
|
|
2188
2188
|
name: "@storm-software/pnpm-tools",
|
|
2189
|
-
version: "0.7.
|
|
2189
|
+
version: "0.7.89",
|
|
2190
2190
|
private: false,
|
|
2191
2191
|
description: "A set of [pnpm](https://pnpm.io/) plugins and utilities for managing workspace packages/dependencies.",
|
|
2192
2192
|
repository: {
|
|
@@ -2305,6 +2305,8 @@ var DEFAULT_NPM_TAG = LATEST_NPM_TAG;
|
|
|
2305
2305
|
|
|
2306
2306
|
// ../npm-tools/src/helpers/get-version.ts
|
|
2307
2307
|
var import_node_child_process3 = require("child_process");
|
|
2308
|
+
var import_semver = require("semver");
|
|
2309
|
+
var import_strip_ansi = __toESM(require("strip-ansi"), 1);
|
|
2308
2310
|
|
|
2309
2311
|
// ../npm-tools/src/helpers/get-registry.ts
|
|
2310
2312
|
var import_node_child_process2 = require("child_process");
|
|
@@ -2325,25 +2327,58 @@ async function getRegistry(executable = "npm") {
|
|
|
2325
2327
|
// ../npm-tools/src/helpers/get-version.ts
|
|
2326
2328
|
async function getVersion(packageName, tag = DEFAULT_NPM_TAG, options = {}) {
|
|
2327
2329
|
const executable = options.executable || "npm";
|
|
2330
|
+
const retries = options.retries ?? 3;
|
|
2331
|
+
const timeout = options.timeout ?? 1e4;
|
|
2328
2332
|
const registry2 = options.registry || await getRegistry(executable);
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2333
|
+
let lastError;
|
|
2334
|
+
for (let attempt = 0; attempt <= retries; attempt++) {
|
|
2335
|
+
try {
|
|
2336
|
+
const abortController = new AbortController();
|
|
2337
|
+
const timeoutId = setTimeout(() => {
|
|
2338
|
+
abortController.abort();
|
|
2339
|
+
}, timeout);
|
|
2340
|
+
const version = await Promise.resolve(
|
|
2341
|
+
new Promise((resolve, reject) => {
|
|
2342
|
+
(0, import_node_child_process3.exec)(
|
|
2343
|
+
`${executable} view ${packageName} version --registry=${registry2}`,
|
|
2344
|
+
{
|
|
2345
|
+
signal: abortController.signal,
|
|
2346
|
+
maxBuffer: 1024 * 1024 * 10
|
|
2347
|
+
// 10 MB
|
|
2348
|
+
},
|
|
2349
|
+
(error, stdout, stderr) => {
|
|
2350
|
+
if (error && !error.message.toLowerCase().trim().startsWith("npm warn")) {
|
|
2351
|
+
return reject(error);
|
|
2352
|
+
}
|
|
2353
|
+
if (stderr && !stderr.toLowerCase().trim().startsWith("npm warn")) {
|
|
2354
|
+
return reject(stderr);
|
|
2355
|
+
}
|
|
2356
|
+
return resolve(stdout.trim());
|
|
2357
|
+
}
|
|
2358
|
+
);
|
|
2359
|
+
})
|
|
2360
|
+
);
|
|
2361
|
+
if (!(0, import_semver.valid)(version, true)) {
|
|
2362
|
+
clearTimeout(timeoutId);
|
|
2363
|
+
throw new Error(
|
|
2364
|
+
(0, import_strip_ansi.default)(version).startsWith("[WARN] Request took") ? `A timeout occurred while fetching the version for package "${packageName}" with tag "${tag}".` : `Invalid version "${version}" fetched for package "${packageName}" with tag "${tag}"`
|
|
2365
|
+
);
|
|
2340
2366
|
}
|
|
2341
|
-
|
|
2342
|
-
|
|
2367
|
+
clearTimeout(timeoutId);
|
|
2368
|
+
return version;
|
|
2369
|
+
} catch (error) {
|
|
2370
|
+
lastError = error;
|
|
2371
|
+
if (attempt < retries) {
|
|
2372
|
+
const delayMs = Math.pow(2, attempt) * 100;
|
|
2373
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
throw lastError;
|
|
2343
2378
|
}
|
|
2344
2379
|
|
|
2345
2380
|
// src/helpers/catalog.ts
|
|
2346
|
-
var
|
|
2381
|
+
var import_semver2 = require("semver");
|
|
2347
2382
|
|
|
2348
2383
|
// src/helpers/format.ts
|
|
2349
2384
|
function replacePrefix(value) {
|
|
@@ -2420,7 +2455,7 @@ async function setCatalog(catalog, workspaceRoot = findWorkspaceRoot(process.cwd
|
|
|
2420
2455
|
throw new Error("No pnpm-workspace.yaml file found");
|
|
2421
2456
|
}
|
|
2422
2457
|
pnpmWorkspaceFile.catalog = Object.fromEntries(
|
|
2423
|
-
Object.entries(catalog).filter(([, value]) => value && (0,
|
|
2458
|
+
Object.entries(catalog).filter(([, value]) => value && (0, import_semver2.valid)(replacePrefix(value), true)).map(([key, value]) => {
|
|
2424
2459
|
return [key, value.replaceAll('"', "").replaceAll("'", "")];
|
|
2425
2460
|
})
|
|
2426
2461
|
);
|
|
@@ -2448,15 +2483,15 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
2448
2483
|
`Failed to fetch version for package "${packageName}" with tag "${tag}"`
|
|
2449
2484
|
);
|
|
2450
2485
|
}
|
|
2451
|
-
if (!(0,
|
|
2486
|
+
if (!(0, import_semver2.valid)(replacePrefix(origVersion), true)) {
|
|
2452
2487
|
throw new Error(
|
|
2453
2488
|
`Invalid version "${origVersion}" fetched for package "${packageName}" with tag "${tag}"`
|
|
2454
2489
|
);
|
|
2455
2490
|
}
|
|
2456
2491
|
const version = `${prefix || ""}${replacePrefix(origVersion)}`;
|
|
2457
2492
|
let updated = false;
|
|
2458
|
-
if (!(0,
|
|
2459
|
-
(0,
|
|
2493
|
+
if (!(0, import_semver2.valid)((0, import_semver2.coerce)(catalog[packageName])) || (0, import_semver2.coerce)(catalog[packageName]) && (0, import_semver2.coerce)(version) && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2494
|
+
(0, import_semver2.gt)((0, import_semver2.coerce)(version), (0, import_semver2.coerce)(catalog[packageName]))) {
|
|
2460
2495
|
catalog[packageName] = `${prefix || ""}${replacePrefix(version)}`;
|
|
2461
2496
|
writeDebug(
|
|
2462
2497
|
`Writing version ${catalog[packageName]} to catalog for "${packageName}" package`,
|
package/bin/pnpm.js
CHANGED
|
@@ -2164,7 +2164,7 @@ import { Command } from "commander";
|
|
|
2164
2164
|
// package.json
|
|
2165
2165
|
var package_default = {
|
|
2166
2166
|
name: "@storm-software/pnpm-tools",
|
|
2167
|
-
version: "0.7.
|
|
2167
|
+
version: "0.7.89",
|
|
2168
2168
|
private: false,
|
|
2169
2169
|
description: "A set of [pnpm](https://pnpm.io/) plugins and utilities for managing workspace packages/dependencies.",
|
|
2170
2170
|
repository: {
|
|
@@ -2283,6 +2283,8 @@ var DEFAULT_NPM_TAG = LATEST_NPM_TAG;
|
|
|
2283
2283
|
|
|
2284
2284
|
// ../npm-tools/src/helpers/get-version.ts
|
|
2285
2285
|
import { exec as exec3 } from "node:child_process";
|
|
2286
|
+
import { valid } from "semver";
|
|
2287
|
+
import stripAnsi from "strip-ansi";
|
|
2286
2288
|
|
|
2287
2289
|
// ../npm-tools/src/helpers/get-registry.ts
|
|
2288
2290
|
import { exec as exec2 } from "node:child_process";
|
|
@@ -2303,25 +2305,58 @@ async function getRegistry(executable = "npm") {
|
|
|
2303
2305
|
// ../npm-tools/src/helpers/get-version.ts
|
|
2304
2306
|
async function getVersion(packageName, tag = DEFAULT_NPM_TAG, options = {}) {
|
|
2305
2307
|
const executable = options.executable || "npm";
|
|
2308
|
+
const retries = options.retries ?? 3;
|
|
2309
|
+
const timeout = options.timeout ?? 1e4;
|
|
2306
2310
|
const registry2 = options.registry || await getRegistry(executable);
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2311
|
+
let lastError;
|
|
2312
|
+
for (let attempt = 0; attempt <= retries; attempt++) {
|
|
2313
|
+
try {
|
|
2314
|
+
const abortController = new AbortController();
|
|
2315
|
+
const timeoutId = setTimeout(() => {
|
|
2316
|
+
abortController.abort();
|
|
2317
|
+
}, timeout);
|
|
2318
|
+
const version = await Promise.resolve(
|
|
2319
|
+
new Promise((resolve, reject) => {
|
|
2320
|
+
exec3(
|
|
2321
|
+
`${executable} view ${packageName} version --registry=${registry2}`,
|
|
2322
|
+
{
|
|
2323
|
+
signal: abortController.signal,
|
|
2324
|
+
maxBuffer: 1024 * 1024 * 10
|
|
2325
|
+
// 10 MB
|
|
2326
|
+
},
|
|
2327
|
+
(error, stdout, stderr) => {
|
|
2328
|
+
if (error && !error.message.toLowerCase().trim().startsWith("npm warn")) {
|
|
2329
|
+
return reject(error);
|
|
2330
|
+
}
|
|
2331
|
+
if (stderr && !stderr.toLowerCase().trim().startsWith("npm warn")) {
|
|
2332
|
+
return reject(stderr);
|
|
2333
|
+
}
|
|
2334
|
+
return resolve(stdout.trim());
|
|
2335
|
+
}
|
|
2336
|
+
);
|
|
2337
|
+
})
|
|
2338
|
+
);
|
|
2339
|
+
if (!valid(version, true)) {
|
|
2340
|
+
clearTimeout(timeoutId);
|
|
2341
|
+
throw new Error(
|
|
2342
|
+
stripAnsi(version).startsWith("[WARN] Request took") ? `A timeout occurred while fetching the version for package "${packageName}" with tag "${tag}".` : `Invalid version "${version}" fetched for package "${packageName}" with tag "${tag}"`
|
|
2343
|
+
);
|
|
2318
2344
|
}
|
|
2319
|
-
|
|
2320
|
-
|
|
2345
|
+
clearTimeout(timeoutId);
|
|
2346
|
+
return version;
|
|
2347
|
+
} catch (error) {
|
|
2348
|
+
lastError = error;
|
|
2349
|
+
if (attempt < retries) {
|
|
2350
|
+
const delayMs = Math.pow(2, attempt) * 100;
|
|
2351
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
throw lastError;
|
|
2321
2356
|
}
|
|
2322
2357
|
|
|
2323
2358
|
// src/helpers/catalog.ts
|
|
2324
|
-
import { coerce, gt, valid } from "semver";
|
|
2359
|
+
import { coerce, gt, valid as valid2 } from "semver";
|
|
2325
2360
|
|
|
2326
2361
|
// src/helpers/format.ts
|
|
2327
2362
|
function replacePrefix(value) {
|
|
@@ -2398,7 +2433,7 @@ async function setCatalog(catalog, workspaceRoot = findWorkspaceRoot(process.cwd
|
|
|
2398
2433
|
throw new Error("No pnpm-workspace.yaml file found");
|
|
2399
2434
|
}
|
|
2400
2435
|
pnpmWorkspaceFile.catalog = Object.fromEntries(
|
|
2401
|
-
Object.entries(catalog).filter(([, value]) => value &&
|
|
2436
|
+
Object.entries(catalog).filter(([, value]) => value && valid2(replacePrefix(value), true)).map(([key, value]) => {
|
|
2402
2437
|
return [key, value.replaceAll('"', "").replaceAll("'", "")];
|
|
2403
2438
|
})
|
|
2404
2439
|
);
|
|
@@ -2426,14 +2461,14 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
2426
2461
|
`Failed to fetch version for package "${packageName}" with tag "${tag}"`
|
|
2427
2462
|
);
|
|
2428
2463
|
}
|
|
2429
|
-
if (!
|
|
2464
|
+
if (!valid2(replacePrefix(origVersion), true)) {
|
|
2430
2465
|
throw new Error(
|
|
2431
2466
|
`Invalid version "${origVersion}" fetched for package "${packageName}" with tag "${tag}"`
|
|
2432
2467
|
);
|
|
2433
2468
|
}
|
|
2434
2469
|
const version = `${prefix || ""}${replacePrefix(origVersion)}`;
|
|
2435
2470
|
let updated = false;
|
|
2436
|
-
if (!
|
|
2471
|
+
if (!valid2(coerce(catalog[packageName])) || coerce(catalog[packageName]) && coerce(version) && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2437
2472
|
gt(coerce(version), coerce(catalog[packageName]))) {
|
|
2438
2473
|
catalog[packageName] = `${prefix || ""}${replacePrefix(version)}`;
|
|
2439
2474
|
writeDebug(
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkWAL5SD4G_cjs=require('./chunk-WAL5SD4G.cjs'),chunk5XC5YOKM_cjs=require('./chunk-5XC5YOKM.cjs'),child_process=require('child_process'),semver=require('semver'),L=require('strip-ansi');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var L__default=/*#__PURE__*/_interopDefault(L);var C="latest";var m=C;async function G(t="npm"){return new Promise((r,o)=>{child_process.exec(`${t} config get registry`,(e,a,f)=>e&&!e.message.toLowerCase().trim().startsWith("npm warn")?o(e):f&&!f.toLowerCase().trim().startsWith("npm warn")?o(f):r(a.trim()));})}async function P(t,r=m,o={}){let e=o.executable||"npm",a=o.retries??3,f=o.timeout??1e4,l=o.registry||await G(e),c;for(let i=0;i<=a;i++)try{let n=new AbortController,s=setTimeout(()=>{n.abort();},f),u=await Promise.resolve(new Promise((M,_)=>{child_process.exec(`${e} view ${t} version --registry=${l}`,{signal:n.signal,maxBuffer:1024*1024*10},(T,I,y)=>T&&!T.message.toLowerCase().trim().startsWith("npm warn")?_(T):y&&!y.toLowerCase().trim().startsWith("npm warn")?_(y):M(I.trim()));}));if(!semver.valid(u,!0))throw clearTimeout(s),new Error(L__default.default(u).startsWith("[WARN] Request took")?`A timeout occurred while fetching the version for package "${t}" with tag "${r}".`:`Invalid version "${u}" fetched for package "${t}" with tag "${r}"`);return clearTimeout(s),u}catch(n){if(c=n,i<a){let s=Math.pow(2,i)*100;await new Promise(u=>setTimeout(u,s));}}throw c}async function W(t=chunk5XC5YOKM_cjs.e(process.cwd())){let r=await chunk5XC5YOKM_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(([o,e])=>[o,e.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 F(t=chunk5XC5YOKM_cjs.e(process.cwd())){let r=await W(t);if(!r)throw new Error("No catalog entries found in pnpm-workspace.yaml file");return r}async function V(t,r=chunk5XC5YOKM_cjs.e(process.cwd())){let o=await chunk5XC5YOKM_cjs.h(r);if(!o)throw new Error("No pnpm-workspace.yaml file found");o.catalog=Object.fromEntries(Object.entries(t).filter(([,e])=>e&&semver.valid(chunkWAL5SD4G_cjs.a(e),true)).map(([e,a])=>[e,a.replaceAll('"',"").replaceAll("'","")])),await chunk5XC5YOKM_cjs.i(o,r);}async function pt(t,r,o={}){let{tag:e=m,prefix:a="^",workspaceRoot:f=chunk5XC5YOKM_cjs.e(),verbose:l=false}=o,c=await chunk5XC5YOKM_cjs.f(true,{workspaceRoot:f});l&&chunk5XC5YOKM_cjs.c(`Upgrading catalog entry for package "${r}" with tag "${e}"`,c);let i=await P(r,e,{executable:"pnpm"});if(!i)throw new Error(`Failed to fetch version for package "${r}" with tag "${e}"`);if(!semver.valid(chunkWAL5SD4G_cjs.a(i),true))throw new Error(`Invalid version "${i}" fetched for package "${r}" with tag "${e}"`);let n=`${a||""}${chunkWAL5SD4G_cjs.a(i)}`,s=false;return !semver.valid(semver.coerce(t[r]))||semver.coerce(t[r])&&semver.coerce(n)&&semver.gt(semver.coerce(n),semver.coerce(t[r]))?(t[r]=`${a||""}${chunkWAL5SD4G_cjs.a(n)}`,chunk5XC5YOKM_cjs.b(`Writing version ${t[r]} to catalog for "${r}" package`,c),s=true):l&&chunk5XC5YOKM_cjs.b(`The current version ${t[r]} for package "${r}" is greater than or equal to the version ${chunkWAL5SD4G_cjs.a(n)} fetched from the npm registry with tag "${e}". No update performed.`,c),{catalog:t,updated:s}}async function lt(t,r={}){let{tag:o=m,prefix:e="^",throwIfMissingInCatalog:a=false,workspaceRoot:f=chunk5XC5YOKM_cjs.e(),verbose:l=false}=r,c=await chunk5XC5YOKM_cjs.f(true,{workspaceRoot:f}),i=await F(f);if(!i)throw new Error("No catalog found");if(a===true&&!i[t])throw new Error(`Package "${t}" not found in catalog: ${JSON.stringify(i,null,2)}`);l&&chunk5XC5YOKM_cjs.c(`Upgrading catalog entry for package "${t}" with tag "${o}"`,c);let n=await P(t,o,{executable:"pnpm"});if(!n)throw new Error(`Failed to fetch version for package "${t}" with tag "${o}"`);if(!semver.valid(chunkWAL5SD4G_cjs.a(n),true))throw new Error(`Invalid version "${n}" fetched for package "${t}" with tag "${o}"`);let s=`${e||""}${chunkWAL5SD4G_cjs.a(n)}`;s===i[t]?l&&chunk5XC5YOKM_cjs.c(`The version for package "${t}" is already up to date in the catalog: ${s}`,c):!semver.valid(chunkWAL5SD4G_cjs.a(i[t]),true)||semver.coerce(i[t])&&semver.coerce(s)&&semver.gt(semver.coerce(s),semver.coerce(i[t]))?(i[t]=`${e||""}${chunkWAL5SD4G_cjs.a(s)}`,chunk5XC5YOKM_cjs.b(`Writing version ${i[t]} to catalog for "${t}" package`,c),await V(i,f)):l&&chunk5XC5YOKM_cjs.a(`The current version "${i[t]}" for package "${t}" is greater than or equal to the version "${s}" fetched from the npm registry with tag "${o}". No update performed.`,c);}exports.a=W;exports.b=F;exports.c=V;exports.d=pt;exports.e=lt;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-7QKHH2VM.js';import {h,e,i,f,c,b as b$1,a as a$1}from'./chunk-BKKIARGK.js';import {exec}from'node:child_process';import {valid,coerce,gt}from'semver';import W from'strip-ansi';var G="latest";var m=G;async function b(t="npm"){return new Promise((r,o)=>{exec(`${t} config get registry`,(e,a,f)=>e&&!e.message.toLowerCase().trim().startsWith("npm warn")?o(e):f&&!f.toLowerCase().trim().startsWith("npm warn")?o(f):r(a.trim()));})}async function _(t,r=m,o={}){let e=o.executable||"npm",a=o.retries??3,f=o.timeout??1e4,l=o.registry||await b(e),c;for(let i=0;i<=a;i++)try{let n=new AbortController,s=setTimeout(()=>{n.abort();},f),u=await Promise.resolve(new Promise((I,A)=>{exec(`${e} view ${t} version --registry=${l}`,{signal:n.signal,maxBuffer:1024*1024*10},(T,O,y)=>T&&!T.message.toLowerCase().trim().startsWith("npm warn")?A(T):y&&!y.toLowerCase().trim().startsWith("npm warn")?A(y):I(O.trim()));}));if(!valid(u,!0))throw clearTimeout(s),new Error(W(u).startsWith("[WARN] Request took")?`A timeout occurred while fetching the version for package "${t}" with tag "${r}".`:`Invalid version "${u}" fetched for package "${t}" with tag "${r}"`);return clearTimeout(s),u}catch(n){if(c=n,i<a){let s=Math.pow(2,i)*100;await new Promise(u=>setTimeout(u,s));}}throw c}async function F(t=e(process.cwd())){let r=await h(t);if(!r)throw new Error("No pnpm-workspace.yaml file found");if(r?.catalog)return Object.fromEntries(Object.entries(r.catalog).map(([o,e])=>[o,e.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 V(t=e(process.cwd())){let r=await F(t);if(!r)throw new Error("No catalog entries found in pnpm-workspace.yaml file");return r}async function Y(t,r=e(process.cwd())){let o=await h(r);if(!o)throw new Error("No pnpm-workspace.yaml file found");o.catalog=Object.fromEntries(Object.entries(t).filter(([,e])=>e&&valid(a(e),true)).map(([e,a])=>[e,a.replaceAll('"',"").replaceAll("'","")])),await i(o,r);}async function lt(t,r,o={}){let{tag:e$1=m,prefix:a$1="^",workspaceRoot:f$1=e(),verbose:l=false}=o,c$1=await f(true,{workspaceRoot:f$1});l&&c(`Upgrading catalog entry for package "${r}" with tag "${e$1}"`,c$1);let i=await _(r,e$1,{executable:"pnpm"});if(!i)throw new Error(`Failed to fetch version for package "${r}" with tag "${e$1}"`);if(!valid(a(i),true))throw new Error(`Invalid version "${i}" fetched for package "${r}" with tag "${e$1}"`);let n=`${a$1||""}${a(i)}`,s=false;return !valid(coerce(t[r]))||coerce(t[r])&&coerce(n)&>(coerce(n),coerce(t[r]))?(t[r]=`${a$1||""}${a(n)}`,b$1(`Writing version ${t[r]} to catalog for "${r}" package`,c$1),s=true):l&&b$1(`The current version ${t[r]} for package "${r}" is greater than or equal to the version ${a(n)} fetched from the npm registry with tag "${e$1}". No update performed.`,c$1),{catalog:t,updated:s}}async function ut(t,r={}){let{tag:o=m,prefix:e$1="^",throwIfMissingInCatalog:a$2=false,workspaceRoot:f$1=e(),verbose:l=false}=r,c$1=await f(true,{workspaceRoot:f$1}),i=await V(f$1);if(!i)throw new Error("No catalog found");if(a$2===true&&!i[t])throw new Error(`Package "${t}" not found in catalog: ${JSON.stringify(i,null,2)}`);l&&c(`Upgrading catalog entry for package "${t}" with tag "${o}"`,c$1);let n=await _(t,o,{executable:"pnpm"});if(!n)throw new Error(`Failed to fetch version for package "${t}" with tag "${o}"`);if(!valid(a(n),true))throw new Error(`Invalid version "${n}" fetched for package "${t}" with tag "${o}"`);let s=`${e$1||""}${a(n)}`;s===i[t]?l&&c(`The version for package "${t}" is already up to date in the catalog: ${s}`,c$1):!valid(a(i[t]),true)||coerce(i[t])&&coerce(s)&>(coerce(s),coerce(i[t]))?(i[t]=`${e$1||""}${a(s)}`,b$1(`Writing version ${i[t]} to catalog for "${t}" package`,c$1),await Y(i,f$1)):l&&a$1(`The current version "${i[t]}" for package "${t}" is greater than or equal to the version "${s}" fetched from the npm registry with tag "${o}". No update performed.`,c$1);}export{F as a,V as b,Y as c,lt as d,ut as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkEHOSPPPM_cjs=require('./chunk-EHOSPPPM.cjs'),chunk5XC5YOKM_cjs=require('./chunk-5XC5YOKM.cjs'),devkit=require('@nx/devkit'),fs=require('fs'),promises=require('fs/promises'),prettier=require('prettier');async function C(c=process.cwd(),i=chunk5XC5YOKM_cjs.e(c)){let l=chunk5XC5YOKM_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 chunkEHOSPPPM_cjs.b(i),a=JSON.parse(m),g=chunk5XC5YOKM_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=chunk5XC5YOKM_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
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-ETTRGCQ4.js';import {d,e}from'./chunk-BKKIARGK.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};
|
package/dist/helpers/catalog.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkEHOSPPPM_cjs=require('../chunk-EHOSPPPM.cjs');require('../chunk-WAL5SD4G.cjs'),require('../chunk-5XC5YOKM.cjs');Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.d}});
|
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-ETTRGCQ4.js';import'../chunk-7QKHH2VM.js';import'../chunk-BKKIARGK.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 chunkRFGN2A3E_cjs=require('../chunk-RFGN2A3E.cjs'),chunkEHOSPPPM_cjs=require('../chunk-EHOSPPPM.cjs');require('../chunk-WAL5SD4G.cjs');var chunk5XC5YOKM_cjs=require('../chunk-5XC5YOKM.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkRFGN2A3E_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.d}});Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunk5XC5YOKM_cjs.g}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunk5XC5YOKM_cjs.h}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunk5XC5YOKM_cjs.i}});
|
package/dist/helpers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import'../chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'../chunk-
|
|
1
|
+
import'../chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'../chunk-Z25SRWHS.js';export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'../chunk-ETTRGCQ4.js';import'../chunk-7QKHH2VM.js';export{g as getPnpmWorkspaceFilePath,h as readPnpmWorkspaceFile,i as writePnpmWorkspaceFile}from'../chunk-BKKIARGK.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkRFGN2A3E_cjs=require('../chunk-RFGN2A3E.cjs');require('../chunk-EHOSPPPM.cjs'),require('../chunk-WAL5SD4G.cjs'),require('../chunk-5XC5YOKM.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkRFGN2A3E_cjs.a}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as replaceDepsAliases}from'../chunk-
|
|
1
|
+
export{a as replaceDepsAliases}from'../chunk-Z25SRWHS.js';import'../chunk-ETTRGCQ4.js';import'../chunk-7QKHH2VM.js';import'../chunk-BKKIARGK.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 chunkRFGN2A3E_cjs=require('./chunk-RFGN2A3E.cjs'),chunkEHOSPPPM_cjs=require('./chunk-EHOSPPPM.cjs');require('./chunk-WAL5SD4G.cjs');var chunk5XC5YOKM_cjs=require('./chunk-5XC5YOKM.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkRFGN2A3E_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkEHOSPPPM_cjs.d}});Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunk5XC5YOKM_cjs.g}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunk5XC5YOKM_cjs.h}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunk5XC5YOKM_cjs.i}});
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import'./chunk-GGNOJ77I.js';import'./chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'./chunk-
|
|
1
|
+
import'./chunk-GGNOJ77I.js';import'./chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'./chunk-Z25SRWHS.js';export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'./chunk-ETTRGCQ4.js';import'./chunk-7QKHH2VM.js';export{g as getPnpmWorkspaceFilePath,h as readPnpmWorkspaceFile,i as writePnpmWorkspaceFile}from'./chunk-BKKIARGK.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/pnpm-tools",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.89",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A set of [pnpm](https://pnpm.io/) plugins and utilities for managing workspace packages/dependencies.",
|
|
6
6
|
"repository": {
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
"storm-pnpm-esm": "./bin/pnpm.js"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@storm-software/config": "
|
|
77
|
-
"@storm-software/config-tools": "
|
|
78
|
-
"@storm-software/npm-tools": "
|
|
79
|
-
"@storm-software/package-constants": "
|
|
76
|
+
"@storm-software/config": "1.138.15",
|
|
77
|
+
"@storm-software/config-tools": "1.190.78",
|
|
78
|
+
"@storm-software/npm-tools": "0.6.196",
|
|
79
|
+
"@storm-software/package-constants": "0.1.91",
|
|
80
80
|
"chalk": "^4.1.2",
|
|
81
81
|
"commander": "^12.1.0",
|
|
82
82
|
"defu": "^6.1.7",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"tsup": "8.4.0"
|
|
92
92
|
},
|
|
93
93
|
"publishConfig": { "access": "public" },
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "c969fce9f24f583cbbe49cc655c74b9a82eab765"
|
|
95
95
|
}
|
package/dist/chunk-HDFKZ7VD.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkWAL5SD4G_cjs=require('./chunk-WAL5SD4G.cjs'),chunk5XC5YOKM_cjs=require('./chunk-5XC5YOKM.cjs'),child_process=require('child_process'),semver=require('semver');var _="latest";var w=_;async function P(r="npm"){return new Promise((t,o)=>{child_process.exec(`${r} config get registry`,(e,g,a)=>e&&!e.message.toLowerCase().trim().startsWith("npm warn")?o(e):a&&!a.toLowerCase().trim().startsWith("npm warn")?o(a):t(g.trim()));})}async function R(r,t=w,o={}){let e=o.executable||"npm",g=o.registry||await P(e);return new Promise((a,p)=>{child_process.exec(`${e} view ${r} version --registry=${g}`,(s,n,i)=>s&&!s.message.toLowerCase().trim().startsWith("npm warn")?p(s):i&&!i.toLowerCase().trim().startsWith("npm warn")?p(i):a(n.trim()));})}async function C(r=chunk5XC5YOKM_cjs.e(process.cwd())){let t=await chunk5XC5YOKM_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(([o,e])=>[o,e.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=chunk5XC5YOKM_cjs.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 b(r,t=chunk5XC5YOKM_cjs.e(process.cwd())){let o=await chunk5XC5YOKM_cjs.h(t);if(!o)throw new Error("No pnpm-workspace.yaml file found");o.catalog=Object.fromEntries(Object.entries(r).filter(([,e])=>e&&semver.valid(chunkWAL5SD4G_cjs.a(e),true)).map(([e,g])=>[e,g.replaceAll('"',"").replaceAll("'","")])),await chunk5XC5YOKM_cjs.i(o,t);}async function tr(r,t,o={}){let{tag:e=w,prefix:g="^",workspaceRoot:a=chunk5XC5YOKM_cjs.e(),verbose:p=false}=o,s=await chunk5XC5YOKM_cjs.f(true,{workspaceRoot:a});p&&chunk5XC5YOKM_cjs.c(`Upgrading catalog entry for package "${t}" with tag "${e}"`,s);let n=await R(t,e,{executable:"pnpm"});if(!n)throw new Error(`Failed to fetch version for package "${t}" with tag "${e}"`);if(!semver.valid(chunkWAL5SD4G_cjs.a(n),true))throw new Error(`Invalid version "${n}" fetched for package "${t}" with tag "${e}"`);let i=`${g||""}${chunkWAL5SD4G_cjs.a(n)}`,c=false;return !semver.valid(semver.coerce(r[t]))||semver.coerce(r[t])&&semver.coerce(i)&&semver.gt(semver.coerce(i),semver.coerce(r[t]))?(r[t]=`${g||""}${chunkWAL5SD4G_cjs.a(i)}`,chunk5XC5YOKM_cjs.b(`Writing version ${r[t]} to catalog for "${t}" package`,s),c=true):p&&chunk5XC5YOKM_cjs.b(`The current version ${r[t]} for package "${t}" is greater than or equal to the version ${chunkWAL5SD4G_cjs.a(i)} fetched from the npm registry with tag "${e}". No update performed.`,s),{catalog:r,updated:c}}async function er(r,t={}){let{tag:o=w,prefix:e="^",throwIfMissingInCatalog:g=false,workspaceRoot:a=chunk5XC5YOKM_cjs.e(),verbose:p=false}=t,s=await chunk5XC5YOKM_cjs.f(true,{workspaceRoot:a}),n=await M(a);if(!n)throw new Error("No catalog found");if(g===true&&!n[r])throw new Error(`Package "${r}" not found in catalog: ${JSON.stringify(n,null,2)}`);p&&chunk5XC5YOKM_cjs.c(`Upgrading catalog entry for package "${r}" with tag "${o}"`,s);let i=await R(r,o,{executable:"pnpm"});if(!i)throw new Error(`Failed to fetch version for package "${r}" with tag "${o}"`);if(!semver.valid(chunkWAL5SD4G_cjs.a(i),true))throw new Error(`Invalid version "${i}" fetched for package "${r}" with tag "${o}"`);let c=`${e||""}${chunkWAL5SD4G_cjs.a(i)}`;c===n[r]?p&&chunk5XC5YOKM_cjs.c(`The version for package "${r}" is already up to date in the catalog: ${c}`,s):!semver.valid(chunkWAL5SD4G_cjs.a(n[r]),true)||semver.coerce(n[r])&&semver.coerce(c)&&semver.gt(semver.coerce(c),semver.coerce(n[r]))?(n[r]=`${e||""}${chunkWAL5SD4G_cjs.a(c)}`,chunk5XC5YOKM_cjs.b(`Writing version ${n[r]} to catalog for "${r}" package`,s),await b(n,a)):p&&chunk5XC5YOKM_cjs.a(`The current version "${n[r]}" for package "${r}" is greater than or equal to the version "${c}" fetched from the npm registry with tag "${o}". No update performed.`,s);}exports.a=C;exports.b=M;exports.c=b;exports.d=tr;exports.e=er;
|
package/dist/chunk-YS5TOJST.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-7QKHH2VM.js';import {h,e,i,f,c,b as b$1,a as a$1}from'./chunk-BKKIARGK.js';import {exec}from'node:child_process';import {valid,coerce,gt}from'semver';var P="latest";var w=P;async function A(r="npm"){return new Promise((t,o)=>{exec(`${r} config get registry`,(e,g,a)=>e&&!e.message.toLowerCase().trim().startsWith("npm warn")?o(e):a&&!a.toLowerCase().trim().startsWith("npm warn")?o(a):t(g.trim()));})}async function x(r,t=w,o={}){let e=o.executable||"npm",g=o.registry||await A(e);return new Promise((a,p)=>{exec(`${e} view ${r} version --registry=${g}`,(s,n,i)=>s&&!s.message.toLowerCase().trim().startsWith("npm warn")?p(s):i&&!i.toLowerCase().trim().startsWith("npm warn")?p(i):a(n.trim()));})}async function M(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(([o,e])=>[o,e.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 b(r=e(process.cwd())){let t=await M(r);if(!t)throw new Error("No catalog entries found in pnpm-workspace.yaml file");return t}async function I(r,t=e(process.cwd())){let o=await h(t);if(!o)throw new Error("No pnpm-workspace.yaml file found");o.catalog=Object.fromEntries(Object.entries(r).filter(([,e])=>e&&valid(a(e),true)).map(([e,g])=>[e,g.replaceAll('"',"").replaceAll("'","")])),await i(o,t);}async function er(r,t,o={}){let{tag:e$1=w,prefix:g="^",workspaceRoot:a$1=e(),verbose:p=false}=o,s=await f(true,{workspaceRoot:a$1});p&&c(`Upgrading catalog entry for package "${t}" with tag "${e$1}"`,s);let n=await x(t,e$1,{executable:"pnpm"});if(!n)throw new Error(`Failed to fetch version for package "${t}" with tag "${e$1}"`);if(!valid(a(n),true))throw new Error(`Invalid version "${n}" fetched for package "${t}" with tag "${e$1}"`);let i=`${g||""}${a(n)}`,c$1=false;return !valid(coerce(r[t]))||coerce(r[t])&&coerce(i)&>(coerce(i),coerce(r[t]))?(r[t]=`${g||""}${a(i)}`,b$1(`Writing version ${r[t]} to catalog for "${t}" package`,s),c$1=true):p&&b$1(`The current version ${r[t]} for package "${t}" is greater than or equal to the version ${a(i)} fetched from the npm registry with tag "${e$1}". No update performed.`,s),{catalog:r,updated:c$1}}async function or(r,t={}){let{tag:o=w,prefix:e$1="^",throwIfMissingInCatalog:g=false,workspaceRoot:a$2=e(),verbose:p=false}=t,s=await f(true,{workspaceRoot:a$2}),n=await b(a$2);if(!n)throw new Error("No catalog found");if(g===true&&!n[r])throw new Error(`Package "${r}" not found in catalog: ${JSON.stringify(n,null,2)}`);p&&c(`Upgrading catalog entry for package "${r}" with tag "${o}"`,s);let i=await x(r,o,{executable:"pnpm"});if(!i)throw new Error(`Failed to fetch version for package "${r}" with tag "${o}"`);if(!valid(a(i),true))throw new Error(`Invalid version "${i}" fetched for package "${r}" with tag "${o}"`);let c$1=`${e$1||""}${a(i)}`;c$1===n[r]?p&&c(`The version for package "${r}" is already up to date in the catalog: ${c$1}`,s):!valid(a(n[r]),true)||coerce(n[r])&&coerce(c$1)&>(coerce(c$1),coerce(n[r]))?(n[r]=`${e$1||""}${a(c$1)}`,b$1(`Writing version ${n[r]} to catalog for "${r}" package`,s),await I(n,a$2)):p&&a$1(`The current version "${n[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.`,s);}export{M as a,b,I as c,er as d,or as e};
|