@storm-software/pnpm-tools 0.7.85 → 0.7.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +1 -1
- package/bin/pnpm.cjs +36 -27
- package/bin/pnpm.js +36 -27
- package/dist/chunk-4OVGAFXM.js +1 -0
- package/dist/chunk-ANKNDB3J.cjs +2 -0
- package/dist/{chunk-RZHHYKOG.cjs → chunk-BYHHPW5J.cjs} +1 -1
- package/dist/chunk-CGTJ2YUM.cjs +1 -0
- package/dist/chunk-J2C3QFEO.js +2 -0
- package/dist/{chunk-BSDK5XRN.js → chunk-OK5D5JRE.js} +1 -1
- package/dist/helpers/catalog.cjs +1 -1
- package/dist/helpers/catalog.d.cts +6 -0
- package/dist/helpers/catalog.d.ts +6 -0
- package/dist/helpers/catalog.js +1 -1
- package/dist/helpers/format.cjs +1 -0
- package/dist/helpers/format.d.cts +9 -0
- package/dist/helpers/format.d.ts +9 -0
- package/dist/helpers/format.js +1 -0
- 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 +8 -8
- package/dist/chunk-IGK2WCA4.js +0 -2
- package/dist/chunk-KTVYXCMC.cjs +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Storm Ops - Pnpm Tools
|
|
4
4
|
|
|
5
|
+
## [0.7.87](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.7.87) (06/24/2026)
|
|
6
|
+
|
|
7
|
+
### Miscellaneous
|
|
8
|
+
|
|
9
|
+
- **monorepo:** Update workspace packages' dependencies ([ab5da025e](https://github.com/storm-software/storm-ops/commit/ab5da025e))
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- **pnpm-tools:** Added `verbose` flag to CLI and improvoed semver validation logic ([b9dbabed0](https://github.com/storm-software/storm-ops/commit/b9dbabed0))
|
|
14
|
+
|
|
15
|
+
### Updated Dependencies
|
|
16
|
+
|
|
17
|
+
- Updated **config** to **v1.138.13**
|
|
18
|
+
- Updated **config-tools** to **v1.190.76**
|
|
19
|
+
- Updated **npm-tools** to **v0.6.194**
|
|
20
|
+
- Updated **package-constants** to **v0.1.89**
|
|
21
|
+
- Updated **testing-tools** to **v1.119.229**
|
|
22
|
+
|
|
23
|
+
## [0.7.86](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.7.86) (06/23/2026)
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
- **pnpm-tools:** Ensure invalid values are never saved to the catalog ([66657e599](https://github.com/storm-software/storm-ops/commit/66657e599))
|
|
28
|
+
|
|
29
|
+
### Updated Dependencies
|
|
30
|
+
|
|
31
|
+
- Updated **config** to **v1.138.12**
|
|
32
|
+
- Updated **config-tools** to **v1.190.75**
|
|
33
|
+
- Updated **npm-tools** to **v0.6.193**
|
|
34
|
+
- Updated **package-constants** to **v0.1.88**
|
|
35
|
+
- Updated **testing-tools** to **v1.119.228**
|
|
36
|
+
|
|
5
37
|
## [0.7.85](https://github.com/storm-software/storm-ops/releases/tag/pnpm-tools%400.7.85) (06/19/2026)
|
|
6
38
|
|
|
7
39
|
### 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
|
@@ -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.87",
|
|
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: {
|
|
@@ -2345,6 +2345,11 @@ async function getVersion(packageName, tag = DEFAULT_NPM_TAG, options = {}) {
|
|
|
2345
2345
|
// src/helpers/catalog.ts
|
|
2346
2346
|
var import_semver = require("semver");
|
|
2347
2347
|
|
|
2348
|
+
// src/helpers/format.ts
|
|
2349
|
+
function replacePrefix(value) {
|
|
2350
|
+
return (value ?? "").replaceAll(/^===/, "").replaceAll(/^!==/, "").replaceAll(/^==/, "").replaceAll(/^!=/, "").replaceAll(/^>/, "").replaceAll(/^>=/, "").replaceAll(/^</, "").replaceAll(/^<=/, "").replaceAll(/^\^/, "").replaceAll(/^~/, "");
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2348
2353
|
// src/helpers/pnpm-workspace.ts
|
|
2349
2354
|
var import_node_fs4 = require("fs");
|
|
2350
2355
|
var import_promises2 = require("fs/promises");
|
|
@@ -2415,7 +2420,7 @@ async function setCatalog(catalog, workspaceRoot = findWorkspaceRoot(process.cwd
|
|
|
2415
2420
|
throw new Error("No pnpm-workspace.yaml file found");
|
|
2416
2421
|
}
|
|
2417
2422
|
pnpmWorkspaceFile.catalog = Object.fromEntries(
|
|
2418
|
-
Object.entries(catalog).map(([key, value]) => {
|
|
2423
|
+
Object.entries(catalog).filter(([, value]) => value && (0, import_semver.valid)(replacePrefix(value), true)).map(([key, value]) => {
|
|
2419
2424
|
return [key, value.replaceAll('"', "").replaceAll("'", "")];
|
|
2420
2425
|
})
|
|
2421
2426
|
);
|
|
@@ -2425,13 +2430,16 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
2425
2430
|
const {
|
|
2426
2431
|
tag = DEFAULT_NPM_TAG,
|
|
2427
2432
|
prefix = "^",
|
|
2428
|
-
workspaceRoot = findWorkspaceRoot()
|
|
2433
|
+
workspaceRoot = findWorkspaceRoot(),
|
|
2434
|
+
verbose = false
|
|
2429
2435
|
} = options;
|
|
2430
2436
|
const workspaceConfig = await getWorkspaceConfig(true, { workspaceRoot });
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2437
|
+
if (verbose) {
|
|
2438
|
+
writeTrace(
|
|
2439
|
+
`Upgrading catalog entry for package "${packageName}" with tag "${tag}"`,
|
|
2440
|
+
workspaceConfig
|
|
2441
|
+
);
|
|
2442
|
+
}
|
|
2435
2443
|
const origVersion = await getVersion(packageName, tag, {
|
|
2436
2444
|
executable: "pnpm"
|
|
2437
2445
|
});
|
|
@@ -2440,24 +2448,26 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
2440
2448
|
`Failed to fetch version for package "${packageName}" with tag "${tag}"`
|
|
2441
2449
|
);
|
|
2442
2450
|
}
|
|
2443
|
-
if (!(0, import_semver.valid)((
|
|
2451
|
+
if (!(0, import_semver.valid)(replacePrefix(origVersion), true)) {
|
|
2444
2452
|
throw new Error(
|
|
2445
2453
|
`Invalid version "${origVersion}" fetched for package "${packageName}" with tag "${tag}"`
|
|
2446
2454
|
);
|
|
2447
2455
|
}
|
|
2448
|
-
const version = `${prefix || ""}${origVersion
|
|
2456
|
+
const version = `${prefix || ""}${replacePrefix(origVersion)}`;
|
|
2449
2457
|
let updated = false;
|
|
2450
2458
|
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
|
|
2451
2459
|
(0, import_semver.gt)((0, import_semver.coerce)(version), (0, import_semver.coerce)(catalog[packageName]))) {
|
|
2452
|
-
catalog[packageName] = `${prefix || ""}${version
|
|
2460
|
+
catalog[packageName] = `${prefix || ""}${replacePrefix(version)}`;
|
|
2453
2461
|
writeDebug(
|
|
2454
2462
|
`Writing version ${catalog[packageName]} to catalog for "${packageName}" package`,
|
|
2455
2463
|
workspaceConfig
|
|
2456
2464
|
);
|
|
2457
2465
|
updated = true;
|
|
2458
|
-
} else {
|
|
2466
|
+
} else if (verbose) {
|
|
2459
2467
|
writeDebug(
|
|
2460
|
-
`The current version ${catalog[packageName]} for package "${packageName}" is greater than or equal to the version ${
|
|
2468
|
+
`The current version ${catalog[packageName]} for package "${packageName}" is greater than or equal to the version ${replacePrefix(
|
|
2469
|
+
version
|
|
2470
|
+
)} fetched from the npm registry with tag "${tag}". No update performed.`,
|
|
2461
2471
|
workspaceConfig
|
|
2462
2472
|
);
|
|
2463
2473
|
}
|
|
@@ -2505,6 +2515,10 @@ function createProgram(config) {
|
|
|
2505
2515
|
- Wildcard (*): Allows the most flexibility by accepting any version. Example: \u201C*2.4.6" allows any version.`,
|
|
2506
2516
|
"^"
|
|
2507
2517
|
).option("--internal", "Whether to update all Storm Software packages.").option("--nx", "Whether to update Nx packages.").option(
|
|
2518
|
+
"--verbose",
|
|
2519
|
+
"An option to enable verbose logging for the update process.",
|
|
2520
|
+
false
|
|
2521
|
+
).option(
|
|
2508
2522
|
"--pnpm-plugin",
|
|
2509
2523
|
"Whether to upgrade the Storm Software pnpm plugin."
|
|
2510
2524
|
).option(
|
|
@@ -2529,9 +2543,10 @@ async function updateAction(packages, options) {
|
|
|
2529
2543
|
install,
|
|
2530
2544
|
all,
|
|
2531
2545
|
internal = all,
|
|
2532
|
-
nx =
|
|
2546
|
+
nx = false,
|
|
2533
2547
|
pnpmPlugin,
|
|
2534
|
-
prefix = "^"
|
|
2548
|
+
prefix = "^",
|
|
2549
|
+
verbose = false
|
|
2535
2550
|
} = options || {};
|
|
2536
2551
|
let packagesFound = false;
|
|
2537
2552
|
let pkgs = packages && Array.isArray(packages) ? packages : [];
|
|
@@ -2578,7 +2593,8 @@ async function updateAction(packages, options) {
|
|
|
2578
2593
|
const result = await upgradeCatalog(catalog, matchedPackage, {
|
|
2579
2594
|
tag,
|
|
2580
2595
|
prefix,
|
|
2581
|
-
workspaceRoot: _config.workspaceRoot
|
|
2596
|
+
workspaceRoot: _config.workspaceRoot,
|
|
2597
|
+
verbose
|
|
2582
2598
|
});
|
|
2583
2599
|
if (result.updated && result.catalog[matchedPackage]) {
|
|
2584
2600
|
catalog[matchedPackage] = result.catalog[matchedPackage];
|
|
@@ -2658,26 +2674,19 @@ async function updateAction(packages, options) {
|
|
|
2658
2674
|
`${brandIcon(_config)} Successfully updated${install ? " and installed" : ""} the following package(s):
|
|
2659
2675
|
${changed.map(
|
|
2660
2676
|
(pkg) => `- ${import_chalk3.default.bold(pkg.packageName)}: ${import_chalk3.default.bold(
|
|
2661
|
-
import_chalk3.default.red(`v${pkg.previous
|
|
2662
|
-
)} -> ${import_chalk3.default.bold(
|
|
2663
|
-
import_chalk3.default.green(`v${pkg.current.replace(/^[\^~><=]*/, "")}`)
|
|
2664
|
-
)}`
|
|
2677
|
+
import_chalk3.default.red(`v${replacePrefix(pkg.previous)}`)
|
|
2678
|
+
)} -> ${import_chalk3.default.bold(import_chalk3.default.green(`v${replacePrefix(pkg.current)}`))}`
|
|
2665
2679
|
).join("\n")}`,
|
|
2666
2680
|
_config
|
|
2667
2681
|
);
|
|
2668
2682
|
}
|
|
2669
2683
|
} catch (error) {
|
|
2670
2684
|
writeFatal(
|
|
2671
|
-
`A fatal error occurred while running
|
|
2672
|
-
|
|
2673
|
-
${JSON.stringify(
|
|
2674
|
-
error,
|
|
2675
|
-
null,
|
|
2676
|
-
2
|
|
2677
|
-
)}`,
|
|
2685
|
+
`A fatal error occurred while running storm-pnpm update: ${typeof error === "object" ? error.message ? error.message : `
|
|
2686
|
+
${JSON.stringify(error, null, 2)}` : error}`,
|
|
2678
2687
|
_config
|
|
2679
2688
|
);
|
|
2680
|
-
throw
|
|
2689
|
+
throw error;
|
|
2681
2690
|
}
|
|
2682
2691
|
}
|
|
2683
2692
|
|
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.87",
|
|
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: {
|
|
@@ -2323,6 +2323,11 @@ async function getVersion(packageName, tag = DEFAULT_NPM_TAG, options = {}) {
|
|
|
2323
2323
|
// src/helpers/catalog.ts
|
|
2324
2324
|
import { coerce, gt, valid } from "semver";
|
|
2325
2325
|
|
|
2326
|
+
// src/helpers/format.ts
|
|
2327
|
+
function replacePrefix(value) {
|
|
2328
|
+
return (value ?? "").replaceAll(/^===/, "").replaceAll(/^!==/, "").replaceAll(/^==/, "").replaceAll(/^!=/, "").replaceAll(/^>/, "").replaceAll(/^>=/, "").replaceAll(/^</, "").replaceAll(/^<=/, "").replaceAll(/^\^/, "").replaceAll(/^~/, "");
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2326
2331
|
// src/helpers/pnpm-workspace.ts
|
|
2327
2332
|
import { existsSync as existsSync4 } from "node:fs";
|
|
2328
2333
|
import { readFile as readFile2, writeFile } from "node:fs/promises";
|
|
@@ -2393,7 +2398,7 @@ async function setCatalog(catalog, workspaceRoot = findWorkspaceRoot(process.cwd
|
|
|
2393
2398
|
throw new Error("No pnpm-workspace.yaml file found");
|
|
2394
2399
|
}
|
|
2395
2400
|
pnpmWorkspaceFile.catalog = Object.fromEntries(
|
|
2396
|
-
Object.entries(catalog).map(([key, value]) => {
|
|
2401
|
+
Object.entries(catalog).filter(([, value]) => value && valid(replacePrefix(value), true)).map(([key, value]) => {
|
|
2397
2402
|
return [key, value.replaceAll('"', "").replaceAll("'", "")];
|
|
2398
2403
|
})
|
|
2399
2404
|
);
|
|
@@ -2403,13 +2408,16 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
2403
2408
|
const {
|
|
2404
2409
|
tag = DEFAULT_NPM_TAG,
|
|
2405
2410
|
prefix = "^",
|
|
2406
|
-
workspaceRoot = findWorkspaceRoot()
|
|
2411
|
+
workspaceRoot = findWorkspaceRoot(),
|
|
2412
|
+
verbose = false
|
|
2407
2413
|
} = options;
|
|
2408
2414
|
const workspaceConfig = await getWorkspaceConfig(true, { workspaceRoot });
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2415
|
+
if (verbose) {
|
|
2416
|
+
writeTrace(
|
|
2417
|
+
`Upgrading catalog entry for package "${packageName}" with tag "${tag}"`,
|
|
2418
|
+
workspaceConfig
|
|
2419
|
+
);
|
|
2420
|
+
}
|
|
2413
2421
|
const origVersion = await getVersion(packageName, tag, {
|
|
2414
2422
|
executable: "pnpm"
|
|
2415
2423
|
});
|
|
@@ -2418,24 +2426,26 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
2418
2426
|
`Failed to fetch version for package "${packageName}" with tag "${tag}"`
|
|
2419
2427
|
);
|
|
2420
2428
|
}
|
|
2421
|
-
if (!valid(
|
|
2429
|
+
if (!valid(replacePrefix(origVersion), true)) {
|
|
2422
2430
|
throw new Error(
|
|
2423
2431
|
`Invalid version "${origVersion}" fetched for package "${packageName}" with tag "${tag}"`
|
|
2424
2432
|
);
|
|
2425
2433
|
}
|
|
2426
|
-
const version = `${prefix || ""}${origVersion
|
|
2434
|
+
const version = `${prefix || ""}${replacePrefix(origVersion)}`;
|
|
2427
2435
|
let updated = false;
|
|
2428
2436
|
if (!valid(coerce(catalog[packageName])) || coerce(catalog[packageName]) && coerce(version) && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2429
2437
|
gt(coerce(version), coerce(catalog[packageName]))) {
|
|
2430
|
-
catalog[packageName] = `${prefix || ""}${version
|
|
2438
|
+
catalog[packageName] = `${prefix || ""}${replacePrefix(version)}`;
|
|
2431
2439
|
writeDebug(
|
|
2432
2440
|
`Writing version ${catalog[packageName]} to catalog for "${packageName}" package`,
|
|
2433
2441
|
workspaceConfig
|
|
2434
2442
|
);
|
|
2435
2443
|
updated = true;
|
|
2436
|
-
} else {
|
|
2444
|
+
} else if (verbose) {
|
|
2437
2445
|
writeDebug(
|
|
2438
|
-
`The current version ${catalog[packageName]} for package "${packageName}" is greater than or equal to the version ${
|
|
2446
|
+
`The current version ${catalog[packageName]} for package "${packageName}" is greater than or equal to the version ${replacePrefix(
|
|
2447
|
+
version
|
|
2448
|
+
)} fetched from the npm registry with tag "${tag}". No update performed.`,
|
|
2439
2449
|
workspaceConfig
|
|
2440
2450
|
);
|
|
2441
2451
|
}
|
|
@@ -2483,6 +2493,10 @@ function createProgram(config) {
|
|
|
2483
2493
|
- Wildcard (*): Allows the most flexibility by accepting any version. Example: \u201C*2.4.6" allows any version.`,
|
|
2484
2494
|
"^"
|
|
2485
2495
|
).option("--internal", "Whether to update all Storm Software packages.").option("--nx", "Whether to update Nx packages.").option(
|
|
2496
|
+
"--verbose",
|
|
2497
|
+
"An option to enable verbose logging for the update process.",
|
|
2498
|
+
false
|
|
2499
|
+
).option(
|
|
2486
2500
|
"--pnpm-plugin",
|
|
2487
2501
|
"Whether to upgrade the Storm Software pnpm plugin."
|
|
2488
2502
|
).option(
|
|
@@ -2507,9 +2521,10 @@ async function updateAction(packages, options) {
|
|
|
2507
2521
|
install,
|
|
2508
2522
|
all,
|
|
2509
2523
|
internal = all,
|
|
2510
|
-
nx =
|
|
2524
|
+
nx = false,
|
|
2511
2525
|
pnpmPlugin,
|
|
2512
|
-
prefix = "^"
|
|
2526
|
+
prefix = "^",
|
|
2527
|
+
verbose = false
|
|
2513
2528
|
} = options || {};
|
|
2514
2529
|
let packagesFound = false;
|
|
2515
2530
|
let pkgs = packages && Array.isArray(packages) ? packages : [];
|
|
@@ -2556,7 +2571,8 @@ async function updateAction(packages, options) {
|
|
|
2556
2571
|
const result = await upgradeCatalog(catalog, matchedPackage, {
|
|
2557
2572
|
tag,
|
|
2558
2573
|
prefix,
|
|
2559
|
-
workspaceRoot: _config.workspaceRoot
|
|
2574
|
+
workspaceRoot: _config.workspaceRoot,
|
|
2575
|
+
verbose
|
|
2560
2576
|
});
|
|
2561
2577
|
if (result.updated && result.catalog[matchedPackage]) {
|
|
2562
2578
|
catalog[matchedPackage] = result.catalog[matchedPackage];
|
|
@@ -2636,26 +2652,19 @@ async function updateAction(packages, options) {
|
|
|
2636
2652
|
`${brandIcon(_config)} Successfully updated${install ? " and installed" : ""} the following package(s):
|
|
2637
2653
|
${changed.map(
|
|
2638
2654
|
(pkg) => `- ${chalk2.bold(pkg.packageName)}: ${chalk2.bold(
|
|
2639
|
-
chalk2.red(`v${pkg.previous
|
|
2640
|
-
)} -> ${chalk2.bold(
|
|
2641
|
-
chalk2.green(`v${pkg.current.replace(/^[\^~><=]*/, "")}`)
|
|
2642
|
-
)}`
|
|
2655
|
+
chalk2.red(`v${replacePrefix(pkg.previous)}`)
|
|
2656
|
+
)} -> ${chalk2.bold(chalk2.green(`v${replacePrefix(pkg.current)}`))}`
|
|
2643
2657
|
).join("\n")}`,
|
|
2644
2658
|
_config
|
|
2645
2659
|
);
|
|
2646
2660
|
}
|
|
2647
2661
|
} catch (error) {
|
|
2648
2662
|
writeFatal(
|
|
2649
|
-
`A fatal error occurred while running
|
|
2650
|
-
|
|
2651
|
-
${JSON.stringify(
|
|
2652
|
-
error,
|
|
2653
|
-
null,
|
|
2654
|
-
2
|
|
2655
|
-
)}`,
|
|
2663
|
+
`A fatal error occurred while running storm-pnpm update: ${typeof error === "object" ? error.message ? error.message : `
|
|
2664
|
+
${JSON.stringify(error, null, 2)}` : error}`,
|
|
2656
2665
|
_config
|
|
2657
2666
|
);
|
|
2658
|
-
throw
|
|
2667
|
+
throw error;
|
|
2659
2668
|
}
|
|
2660
2669
|
}
|
|
2661
2670
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function c(l){return (l??"").replaceAll(/^===/,"").replaceAll(/^!==/,"").replaceAll(/^==/,"").replaceAll(/^!=/,"").replaceAll(/^>/,"").replaceAll(/^>=/,"").replaceAll(/^</,"").replaceAll(/^<=/,"").replaceAll(/^\^/,"").replaceAll(/^~/,"")}export{c as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkCGTJ2YUM_cjs=require('./chunk-CGTJ2YUM.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(chunkCGTJ2YUM_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(chunkCGTJ2YUM_cjs.a(n),true))throw new Error(`Invalid version "${n}" fetched for package "${t}" with tag "${e}"`);let i=`${g||""}${chunkCGTJ2YUM_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||""}${chunkCGTJ2YUM_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 ${chunkCGTJ2YUM_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(chunkCGTJ2YUM_cjs.a(i),true))throw new Error(`Invalid version "${i}" fetched for package "${r}" with tag "${o}"`);let c=`${e||""}${chunkCGTJ2YUM_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(chunkCGTJ2YUM_cjs.a(n[r]),true)||semver.coerce(n[r])&&semver.coerce(c)&&semver.gt(semver.coerce(c),semver.coerce(n[r]))?(n[r]=`${e||""}${chunkCGTJ2YUM_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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkANKNDB3J_cjs=require('./chunk-ANKNDB3J.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 chunkANKNDB3J_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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function r(l){return (l??"").replaceAll(/^===/,"").replaceAll(/^!==/,"").replaceAll(/^==/,"").replaceAll(/^!=/,"").replaceAll(/^>/,"").replaceAll(/^>=/,"").replaceAll(/^</,"").replaceAll(/^<=/,"").replaceAll(/^\^/,"").replaceAll(/^~/,"")}exports.a=r;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-4OVGAFXM.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-J2C3QFEO.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 chunkANKNDB3J_cjs=require('../chunk-ANKNDB3J.cjs');require('../chunk-CGTJ2YUM.cjs'),require('../chunk-5XC5YOKM.cjs');Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkANKNDB3J_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkANKNDB3J_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkANKNDB3J_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkANKNDB3J_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkANKNDB3J_cjs.d}});
|
|
@@ -51,6 +51,12 @@ interface UpgradeCatalogPackageOptions {
|
|
|
51
51
|
* @defaultValue `"^"`
|
|
52
52
|
*/
|
|
53
53
|
prefix?: "^" | "~" | ">" | "<" | ">=" | "<=" | "*";
|
|
54
|
+
/**
|
|
55
|
+
* An indicator of whether to enable debug logging for the upgrade process.
|
|
56
|
+
*
|
|
57
|
+
* @defaultValue `false`
|
|
58
|
+
*/
|
|
59
|
+
verbose?: boolean;
|
|
54
60
|
}
|
|
55
61
|
interface UpgradeCatalogResult {
|
|
56
62
|
catalog: Record<string, string>;
|
|
@@ -51,6 +51,12 @@ interface UpgradeCatalogPackageOptions {
|
|
|
51
51
|
* @defaultValue `"^"`
|
|
52
52
|
*/
|
|
53
53
|
prefix?: "^" | "~" | ">" | "<" | ">=" | "<=" | "*";
|
|
54
|
+
/**
|
|
55
|
+
* An indicator of whether to enable debug logging for the upgrade process.
|
|
56
|
+
*
|
|
57
|
+
* @defaultValue `false`
|
|
58
|
+
*/
|
|
59
|
+
verbose?: boolean;
|
|
54
60
|
}
|
|
55
61
|
interface UpgradeCatalogResult {
|
|
56
62
|
catalog: Record<string, string>;
|
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-J2C3QFEO.js';import'../chunk-4OVGAFXM.js';import'../chunk-BKKIARGK.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkCGTJ2YUM_cjs=require('../chunk-CGTJ2YUM.cjs');Object.defineProperty(exports,"replacePrefix",{enumerable:true,get:function(){return chunkCGTJ2YUM_cjs.a}});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replaces all the prefixes in a string with an empty string.
|
|
3
|
+
*
|
|
4
|
+
* @param value - The string to replace the prefixes in.
|
|
5
|
+
* @returns The string with all the prefixes replaced with an empty string.
|
|
6
|
+
*/
|
|
7
|
+
declare function replacePrefix(value?: string): string;
|
|
8
|
+
|
|
9
|
+
export { replacePrefix };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replaces all the prefixes in a string with an empty string.
|
|
3
|
+
*
|
|
4
|
+
* @param value - The string to replace the prefixes in.
|
|
5
|
+
* @returns The string with all the prefixes replaced with an empty string.
|
|
6
|
+
*/
|
|
7
|
+
declare function replacePrefix(value?: string): string;
|
|
8
|
+
|
|
9
|
+
export { replacePrefix };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as replacePrefix}from'../chunk-4OVGAFXM.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 chunkBYHHPW5J_cjs=require('../chunk-BYHHPW5J.cjs'),chunkANKNDB3J_cjs=require('../chunk-ANKNDB3J.cjs');require('../chunk-CGTJ2YUM.cjs');var chunk5XC5YOKM_cjs=require('../chunk-5XC5YOKM.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkBYHHPW5J_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkANKNDB3J_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkANKNDB3J_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkANKNDB3J_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkANKNDB3J_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkANKNDB3J_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-OK5D5JRE.js';export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'../chunk-J2C3QFEO.js';import'../chunk-4OVGAFXM.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 chunkBYHHPW5J_cjs=require('../chunk-BYHHPW5J.cjs');require('../chunk-ANKNDB3J.cjs'),require('../chunk-CGTJ2YUM.cjs'),require('../chunk-5XC5YOKM.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkBYHHPW5J_cjs.a}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as replaceDepsAliases}from'../chunk-
|
|
1
|
+
export{a as replaceDepsAliases}from'../chunk-OK5D5JRE.js';import'../chunk-J2C3QFEO.js';import'../chunk-4OVGAFXM.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 chunkBYHHPW5J_cjs=require('./chunk-BYHHPW5J.cjs'),chunkANKNDB3J_cjs=require('./chunk-ANKNDB3J.cjs');require('./chunk-CGTJ2YUM.cjs');var chunk5XC5YOKM_cjs=require('./chunk-5XC5YOKM.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkBYHHPW5J_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkANKNDB3J_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkANKNDB3J_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkANKNDB3J_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkANKNDB3J_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkANKNDB3J_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-OK5D5JRE.js';export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'./chunk-J2C3QFEO.js';import'./chunk-4OVGAFXM.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.87",
|
|
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,23 +73,23 @@
|
|
|
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.13",
|
|
77
|
+
"@storm-software/config-tools": "1.190.76",
|
|
78
|
+
"@storm-software/npm-tools": "0.6.194",
|
|
79
|
+
"@storm-software/package-constants": "0.1.89",
|
|
80
80
|
"chalk": "^4.1.2",
|
|
81
81
|
"commander": "^12.1.0",
|
|
82
82
|
"defu": "^6.1.7",
|
|
83
83
|
"prettier": "^3.8.4",
|
|
84
84
|
"prettier-plugin-packagejson": "^3.0.2",
|
|
85
|
-
"semver": "^7.8.
|
|
85
|
+
"semver": "^7.8.5",
|
|
86
86
|
"yaml": "^2.9.0"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@pnpm/types": "^1001.3.1",
|
|
90
|
-
"@types/node": "^25.9.
|
|
90
|
+
"@types/node": "^25.9.4",
|
|
91
91
|
"tsup": "8.4.0"
|
|
92
92
|
},
|
|
93
93
|
"publishConfig": { "access": "public" },
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "787f5e3d2fce849d93cfaea129ba6b941f407de1"
|
|
95
95
|
}
|
package/dist/chunk-IGK2WCA4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {h as h$1,e,i,f,c,b,a}from'./chunk-BKKIARGK.js';import {exec}from'node:child_process';import {valid,coerce,gt}from'semver';var _="latest";var l=_;async function E(t="npm"){return new Promise((r,n)=>{exec(`${t} config get registry`,(o,p,s)=>o&&!o.message.toLowerCase().trim().startsWith("npm warn")?n(o):s&&!s.toLowerCase().trim().startsWith("npm warn")?n(s):r(p.trim()));})}async function h(t,r=l,n={}){let o=n.executable||"npm",p=n.registry||await E(o);return new Promise((s,a)=>{exec(`${o} view ${t} version --registry=${p}`,(e,c,i)=>e&&!e.message.toLowerCase().trim().startsWith("npm warn")?a(e):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(([n,o])=>[n,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 n=await h$1(r);if(!n)throw new Error("No pnpm-workspace.yaml file found");n.catalog=Object.fromEntries(Object.entries(t).map(([o,p])=>[o,p.replaceAll('"',"").replaceAll("'","")])),await i(n,r);}async function Z(t,r,n={}){let{tag:o=l,prefix:p="^",workspaceRoot:s=e()}=n,a=await f(true,{workspaceRoot:s});c(`Upgrading catalog entry for package "${r}" with tag "${o}"`,a);let e$1=await h(r,o,{executable:"pnpm"});if(!e$1)throw new Error(`Failed to fetch version for package "${r}" with tag "${o}"`);if(!valid(coerce(e$1)))throw new Error(`Invalid version "${e$1}" fetched for package "${r}" with tag "${o}"`);let c$1=`${p||""}${e$1.replace(/^[\^~><=*]+/g,"")}`,i=false;return !valid(coerce(t[r]))||coerce(t[r])&&coerce(c$1)&>(coerce(c$1),coerce(t[r]))?(t[r]=`${p||""}${c$1.replace(/^[\^~><=*]+/g,"")}`,b(`Writing version ${t[r]} to catalog for "${r}" package`,a),i=true):b(`The current version ${t[r]} for package "${r}" is greater than or equal to the version ${c$1} fetched from the npm registry with tag "${o}". No update performed.`,a),{catalog:t,updated:i}}async function tt(t,r={}){let{tag:n=l,prefix:o="^",throwIfMissingInCatalog:p=false,workspaceRoot:s=e()}=r,a$1=await f(true,{workspaceRoot:s}),e$1=await M(s);if(!e$1)throw new Error("No catalog found");if(p===true&&!e$1[t])throw new Error(`Package "${t}" not found in catalog: ${JSON.stringify(e$1,null,2)}`);c(`Upgrading catalog entry for package "${t}" with tag "${n}"`,a$1);let c$1=await h(t,n,{executable:"pnpm"}),i=`${o||""}${c$1.replace(/^[\^~><=*]+/g,"")}`;i===e$1[t]?c(`The version for package "${t}" is already up to date in the catalog: ${i}`,a$1):!valid(coerce(e$1[t]))||coerce(e$1[t])&&coerce(i)&>(coerce(i),coerce(e$1[t]))?(e$1[t]=`${o||""}${i.replace(/^[\^~><=*]+/g,"")}`,b(`Writing version ${e$1[t]} to catalog for "${t}" package`,a$1),await v(e$1,s)):a(`The current version "${e$1[t]}" for package "${t}" is greater than or equal to the version "${i}" fetched from the npm registry with tag "${n}". No update performed.`,a$1);}export{C as a,M as b,v as c,Z as d,tt as e};
|
package/dist/chunk-KTVYXCMC.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunk5XC5YOKM_cjs=require('./chunk-5XC5YOKM.cjs'),child_process=require('child_process'),semver=require('semver');var x="latest";var l=x;async function _(t="npm"){return new Promise((r,n)=>{child_process.exec(`${t} config get registry`,(o,p,s)=>o&&!o.message.toLowerCase().trim().startsWith("npm warn")?n(o):s&&!s.toLowerCase().trim().startsWith("npm warn")?n(s):r(p.trim()));})}async function $(t,r=l,n={}){let o=n.executable||"npm",p=n.registry||await _(o);return new Promise((s,a)=>{child_process.exec(`${o} view ${t} version --registry=${p}`,(e,c,i)=>e&&!e.message.toLowerCase().trim().startsWith("npm warn")?a(e):i&&!i.toLowerCase().trim().startsWith("npm warn")?a(i):s(c.trim()));})}async function G(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(([n,o])=>[n,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=chunk5XC5YOKM_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=chunk5XC5YOKM_cjs.e(process.cwd())){let n=await chunk5XC5YOKM_cjs.h(r);if(!n)throw new Error("No pnpm-workspace.yaml file found");n.catalog=Object.fromEntries(Object.entries(t).map(([o,p])=>[o,p.replaceAll('"',"").replaceAll("'","")])),await chunk5XC5YOKM_cjs.i(n,r);}async function Q(t,r,n={}){let{tag:o=l,prefix:p="^",workspaceRoot:s=chunk5XC5YOKM_cjs.e()}=n,a=await chunk5XC5YOKM_cjs.f(true,{workspaceRoot:s});chunk5XC5YOKM_cjs.c(`Upgrading catalog entry for package "${r}" with tag "${o}"`,a);let e=await $(r,o,{executable:"pnpm"});if(!e)throw new Error(`Failed to fetch version for package "${r}" with tag "${o}"`);if(!semver.valid(semver.coerce(e)))throw new Error(`Invalid version "${e}" fetched for package "${r}" with tag "${o}"`);let c=`${p||""}${e.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]=`${p||""}${c.replace(/^[\^~><=*]+/g,"")}`,chunk5XC5YOKM_cjs.b(`Writing version ${t[r]} to catalog for "${r}" package`,a),i=true):chunk5XC5YOKM_cjs.b(`The current version ${t[r]} for package "${r}" is greater than or equal to the version ${c} fetched from the npm registry with tag "${o}". No update performed.`,a),{catalog:t,updated:i}}async function Z(t,r={}){let{tag:n=l,prefix:o="^",throwIfMissingInCatalog:p=false,workspaceRoot:s=chunk5XC5YOKM_cjs.e()}=r,a=await chunk5XC5YOKM_cjs.f(true,{workspaceRoot:s}),e=await C(s);if(!e)throw new Error("No catalog found");if(p===true&&!e[t])throw new Error(`Package "${t}" not found in catalog: ${JSON.stringify(e,null,2)}`);chunk5XC5YOKM_cjs.c(`Upgrading catalog entry for package "${t}" with tag "${n}"`,a);let c=await $(t,n,{executable:"pnpm"}),i=`${o||""}${c.replace(/^[\^~><=*]+/g,"")}`;i===e[t]?chunk5XC5YOKM_cjs.c(`The version for package "${t}" is already up to date in the catalog: ${i}`,a):!semver.valid(semver.coerce(e[t]))||semver.coerce(e[t])&&semver.coerce(i)&&semver.gt(semver.coerce(i),semver.coerce(e[t]))?(e[t]=`${o||""}${i.replace(/^[\^~><=*]+/g,"")}`,chunk5XC5YOKM_cjs.b(`Writing version ${e[t]} to catalog for "${t}" package`,a),await M(e,s)):chunk5XC5YOKM_cjs.a(`The current version "${e[t]}" for package "${t}" is greater than or equal to the version "${i}" fetched from the npm registry with tag "${n}". No update performed.`,a);}exports.a=G;exports.b=C;exports.c=M;exports.d=Q;exports.e=Z;
|