@storm-software/bun-tools 0.0.17 → 0.0.19
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 +29 -0
- package/README.md +1 -1
- package/bin/bun.cjs +15 -5
- package/bin/bun.js +15 -5
- package/dist/chunk-CNGWFMRC.cjs +2 -0
- package/dist/{chunk-7OL2EGZP.cjs → chunk-SJCE2DOC.cjs} +1 -1
- package/dist/chunk-U26JJOFM.js +2 -0
- package/dist/{chunk-LCNR6GFC.js → chunk-XDAT6OMA.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-ET2J7MDH.js +0 -2
- package/dist/chunk-IVRV4VUN.cjs +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Storm Ops - Bun Tools
|
|
4
4
|
|
|
5
|
+
## [0.0.19](https://github.com/storm-software/storm-ops/releases/tag/bun-tools%400.0.19) (08/01/2026)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **pnpm-tools:** Update update tool to better handle `npm:` prefixes ([e36d870e8](https://github.com/storm-software/storm-ops/commit/e36d870e8))
|
|
10
|
+
- **prettier:** Resolve issue causing exclude files from being part of release ([137627bfa](https://github.com/storm-software/storm-ops/commit/137627bfa))
|
|
11
|
+
|
|
12
|
+
### Updated Dependencies
|
|
13
|
+
|
|
14
|
+
- Updated **config** to **v1.138.47**
|
|
15
|
+
- Updated **config-tools** to **v1.190.110**
|
|
16
|
+
- Updated **npm-tools** to **v0.6.228**
|
|
17
|
+
- Updated **package-constants** to **v0.1.123**
|
|
18
|
+
- Updated **testing-tools** to **v1.119.263**
|
|
19
|
+
|
|
20
|
+
## [0.0.18](https://github.com/storm-software/storm-ops/releases/tag/bun-tools%400.0.18) (07/23/2026)
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
- **package-constants:** Resolve issue with incorrect package prefix ([24eb88022](https://github.com/storm-software/storm-ops/commit/24eb88022))
|
|
25
|
+
|
|
26
|
+
### Updated Dependencies
|
|
27
|
+
|
|
28
|
+
- Updated **config** to **v1.138.46**
|
|
29
|
+
- Updated **config-tools** to **v1.190.109**
|
|
30
|
+
- Updated **npm-tools** to **v0.6.227**
|
|
31
|
+
- Updated **package-constants** to **v0.1.122**
|
|
32
|
+
- Updated **testing-tools** to **v1.119.262**
|
|
33
|
+
|
|
5
34
|
## [0.0.17](https://github.com/storm-software/storm-ops/releases/tag/bun-tools%400.0.17) (07/23/2026)
|
|
6
35
|
|
|
7
36
|
### 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/bun.cjs
CHANGED
|
@@ -2183,7 +2183,7 @@ var INTERNAL_PACKAGES = [
|
|
|
2183
2183
|
"aftershock",
|
|
2184
2184
|
"@telepathic/*",
|
|
2185
2185
|
"telepathic",
|
|
2186
|
-
"@power-plant",
|
|
2186
|
+
"@power-plant/*",
|
|
2187
2187
|
"power-plant",
|
|
2188
2188
|
"@razorwind/*",
|
|
2189
2189
|
"razorwind",
|
|
@@ -2204,7 +2204,7 @@ var import_chalk3 = __toESM(require("chalk"), 1);
|
|
|
2204
2204
|
var import_commander = require("commander");
|
|
2205
2205
|
|
|
2206
2206
|
// package.json
|
|
2207
|
-
var package_default = { name: "@storm-software/bun-tools", version: "0.0.
|
|
2207
|
+
var package_default = { name: "@storm-software/bun-tools", version: "0.0.19", private: false, description: "A set of [Bun](https://bun.sh/) plugins and utilities for managing workspace packages/dependencies.", repository: { type: "github", url: "https://github.com/storm-software/storm-ops.git", directory: "packages/bun-tools" }, type: "module", exports: { "./package.json": "./package.json", "./index": { import: { types: "./dist/index.d.ts", default: "./dist/index.js" }, require: { types: "./dist/index.d.cts", default: "./dist/index.cjs" }, default: { types: "./dist/index.d.ts", default: "./dist/index.js" } }, ".": { import: { types: "./dist/index.d.ts", default: "./dist/index.js" }, require: { types: "./dist/index.d.cts", default: "./dist/index.cjs" }, default: { types: "./dist/index.d.ts", default: "./dist/index.js" } }, "./types": { import: { types: "./dist/types.d.ts", default: "./dist/types.js" }, require: { types: "./dist/types.d.cts", default: "./dist/types.cjs" }, default: { types: "./dist/types.d.ts", default: "./dist/types.js" } }, "./helpers": { import: { types: "./dist/helpers/index.d.ts", default: "./dist/helpers/index.js" }, require: { types: "./dist/helpers/index.d.cts", default: "./dist/helpers/index.cjs" }, default: { types: "./dist/helpers/index.d.ts", default: "./dist/helpers/index.js" } }, "./helpers/*": { import: { types: "./dist/helpers/*.d.ts", default: "./dist/helpers/*.js" }, require: { types: "./dist/helpers/*.d.cts", default: "./dist/helpers/*.cjs" }, default: { types: "./dist/helpers/*.d.ts", default: "./dist/helpers/*.js" } } }, main: "./dist/index.cjs", module: "./dist/index.js", types: "./dist/index.d.ts", bin: { "storm-bun": "./bin/bun.js", "storm-bun-cjs": "./bin/bun.cjs", "storm-bun-esm": "./bin/bun.js" }, dependencies: { "@storm-software/config": "workspace:*", "@storm-software/config-tools": "workspace:*", "@storm-software/npm-tools": "workspace:*", "@storm-software/package-constants": "workspace:*", chalk: "catalog:", commander: "catalog:", defu: "catalog:", prettier: "catalog:", "prettier-plugin-packagejson": "catalog:", semver: "catalog:", yaml: "catalog:" }, devDependencies: { "@types/node": "catalog:", tsup: "catalog:" }, publishConfig: { access: "public" } };
|
|
2208
2208
|
|
|
2209
2209
|
// ../npm-tools/src/constants.ts
|
|
2210
2210
|
var DEFAULT_NPM_REGISTRY = "https://registry.npmjs.org";
|
|
@@ -2399,7 +2399,9 @@ File content: ${JSON.stringify(
|
|
|
2399
2399
|
async function getCatalog(workspaceRoot = findWorkspaceRoot(process.cwd())) {
|
|
2400
2400
|
const catalog = await getCatalogSafe(workspaceRoot);
|
|
2401
2401
|
if (!catalog) {
|
|
2402
|
-
throw new Error(
|
|
2402
|
+
throw new Error(
|
|
2403
|
+
"No catalog entries found in workspace root package.json file"
|
|
2404
|
+
);
|
|
2403
2405
|
}
|
|
2404
2406
|
return catalog;
|
|
2405
2407
|
}
|
|
@@ -2411,7 +2413,9 @@ async function setCatalog(catalog, workspaceRoot = findWorkspaceRoot(process.cwd
|
|
|
2411
2413
|
setCatalogInPackageJson(
|
|
2412
2414
|
packageJson,
|
|
2413
2415
|
Object.fromEntries(
|
|
2414
|
-
Object.entries(catalog).filter(
|
|
2416
|
+
Object.entries(catalog).filter(
|
|
2417
|
+
([, value]) => value && (value.startsWith("npm:") || (0, import_semver2.valid)(replacePrefix(value), true))
|
|
2418
|
+
).map(([key, value]) => {
|
|
2415
2419
|
return [key, value.replaceAll('"', "").replaceAll("'", "")];
|
|
2416
2420
|
})
|
|
2417
2421
|
)
|
|
@@ -2449,7 +2453,13 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
2449
2453
|
}
|
|
2450
2454
|
const version = `${prefix || ""}${replacePrefix(origVersion)}`;
|
|
2451
2455
|
let updated = false;
|
|
2452
|
-
if (
|
|
2456
|
+
if (catalog[packageName]?.startsWith("npm:")) {
|
|
2457
|
+
catalog[packageName] = version;
|
|
2458
|
+
writeDebug(
|
|
2459
|
+
`Writing version ${catalog[packageName]} to catalog for "${packageName}" package`,
|
|
2460
|
+
workspaceConfig
|
|
2461
|
+
);
|
|
2462
|
+
} else 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
|
|
2453
2463
|
(0, import_semver2.gt)((0, import_semver2.coerce)(version), (0, import_semver2.coerce)(catalog[packageName]))) {
|
|
2454
2464
|
catalog[packageName] = `${prefix || ""}${replacePrefix(version)}`;
|
|
2455
2465
|
writeDebug(
|
package/bin/bun.js
CHANGED
|
@@ -2161,7 +2161,7 @@ var INTERNAL_PACKAGES = [
|
|
|
2161
2161
|
"aftershock",
|
|
2162
2162
|
"@telepathic/*",
|
|
2163
2163
|
"telepathic",
|
|
2164
|
-
"@power-plant",
|
|
2164
|
+
"@power-plant/*",
|
|
2165
2165
|
"power-plant",
|
|
2166
2166
|
"@razorwind/*",
|
|
2167
2167
|
"razorwind",
|
|
@@ -2182,7 +2182,7 @@ import chalk2 from "chalk";
|
|
|
2182
2182
|
import { Command } from "commander";
|
|
2183
2183
|
|
|
2184
2184
|
// package.json
|
|
2185
|
-
var package_default = { name: "@storm-software/bun-tools", version: "0.0.
|
|
2185
|
+
var package_default = { name: "@storm-software/bun-tools", version: "0.0.19", private: false, description: "A set of [Bun](https://bun.sh/) plugins and utilities for managing workspace packages/dependencies.", repository: { type: "github", url: "https://github.com/storm-software/storm-ops.git", directory: "packages/bun-tools" }, type: "module", exports: { "./package.json": "./package.json", "./index": { import: { types: "./dist/index.d.ts", default: "./dist/index.js" }, require: { types: "./dist/index.d.cts", default: "./dist/index.cjs" }, default: { types: "./dist/index.d.ts", default: "./dist/index.js" } }, ".": { import: { types: "./dist/index.d.ts", default: "./dist/index.js" }, require: { types: "./dist/index.d.cts", default: "./dist/index.cjs" }, default: { types: "./dist/index.d.ts", default: "./dist/index.js" } }, "./types": { import: { types: "./dist/types.d.ts", default: "./dist/types.js" }, require: { types: "./dist/types.d.cts", default: "./dist/types.cjs" }, default: { types: "./dist/types.d.ts", default: "./dist/types.js" } }, "./helpers": { import: { types: "./dist/helpers/index.d.ts", default: "./dist/helpers/index.js" }, require: { types: "./dist/helpers/index.d.cts", default: "./dist/helpers/index.cjs" }, default: { types: "./dist/helpers/index.d.ts", default: "./dist/helpers/index.js" } }, "./helpers/*": { import: { types: "./dist/helpers/*.d.ts", default: "./dist/helpers/*.js" }, require: { types: "./dist/helpers/*.d.cts", default: "./dist/helpers/*.cjs" }, default: { types: "./dist/helpers/*.d.ts", default: "./dist/helpers/*.js" } } }, main: "./dist/index.cjs", module: "./dist/index.js", types: "./dist/index.d.ts", bin: { "storm-bun": "./bin/bun.js", "storm-bun-cjs": "./bin/bun.cjs", "storm-bun-esm": "./bin/bun.js" }, dependencies: { "@storm-software/config": "workspace:*", "@storm-software/config-tools": "workspace:*", "@storm-software/npm-tools": "workspace:*", "@storm-software/package-constants": "workspace:*", chalk: "catalog:", commander: "catalog:", defu: "catalog:", prettier: "catalog:", "prettier-plugin-packagejson": "catalog:", semver: "catalog:", yaml: "catalog:" }, devDependencies: { "@types/node": "catalog:", tsup: "catalog:" }, publishConfig: { access: "public" } };
|
|
2186
2186
|
|
|
2187
2187
|
// ../npm-tools/src/constants.ts
|
|
2188
2188
|
var DEFAULT_NPM_REGISTRY = "https://registry.npmjs.org";
|
|
@@ -2377,7 +2377,9 @@ File content: ${JSON.stringify(
|
|
|
2377
2377
|
async function getCatalog(workspaceRoot = findWorkspaceRoot(process.cwd())) {
|
|
2378
2378
|
const catalog = await getCatalogSafe(workspaceRoot);
|
|
2379
2379
|
if (!catalog) {
|
|
2380
|
-
throw new Error(
|
|
2380
|
+
throw new Error(
|
|
2381
|
+
"No catalog entries found in workspace root package.json file"
|
|
2382
|
+
);
|
|
2381
2383
|
}
|
|
2382
2384
|
return catalog;
|
|
2383
2385
|
}
|
|
@@ -2389,7 +2391,9 @@ async function setCatalog(catalog, workspaceRoot = findWorkspaceRoot(process.cwd
|
|
|
2389
2391
|
setCatalogInPackageJson(
|
|
2390
2392
|
packageJson,
|
|
2391
2393
|
Object.fromEntries(
|
|
2392
|
-
Object.entries(catalog).filter(
|
|
2394
|
+
Object.entries(catalog).filter(
|
|
2395
|
+
([, value]) => value && (value.startsWith("npm:") || valid2(replacePrefix(value), true))
|
|
2396
|
+
).map(([key, value]) => {
|
|
2393
2397
|
return [key, value.replaceAll('"', "").replaceAll("'", "")];
|
|
2394
2398
|
})
|
|
2395
2399
|
)
|
|
@@ -2427,7 +2431,13 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
2427
2431
|
}
|
|
2428
2432
|
const version = `${prefix || ""}${replacePrefix(origVersion)}`;
|
|
2429
2433
|
let updated = false;
|
|
2430
|
-
if (
|
|
2434
|
+
if (catalog[packageName]?.startsWith("npm:")) {
|
|
2435
|
+
catalog[packageName] = version;
|
|
2436
|
+
writeDebug(
|
|
2437
|
+
`Writing version ${catalog[packageName]} to catalog for "${packageName}" package`,
|
|
2438
|
+
workspaceConfig
|
|
2439
|
+
);
|
|
2440
|
+
} else if (!valid2(coerce(catalog[packageName])) || coerce(catalog[packageName]) && coerce(version) && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2431
2441
|
gt(coerce(version), coerce(catalog[packageName]))) {
|
|
2432
2442
|
catalog[packageName] = `${prefix || ""}${replacePrefix(version)}`;
|
|
2433
2443
|
writeDebug(
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkWAL5SD4G_cjs=require('./chunk-WAL5SD4G.cjs'),chunkLW7LMN74_cjs=require('./chunk-LW7LMN74.cjs'),child_process=require('child_process'),semver=require('semver'),k=require('strip-ansi');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var k__default=/*#__PURE__*/_interopDefault(k);var M="https://registry.npmjs.org";var O="latest";var h=O;async function U(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(){if(process.env.STORM_REGISTRY_NPM)return process.env.STORM_REGISTRY_NPM;let t=await chunkLW7LMN74_cjs.f();return t?.registry?.npm?t?.registry?.npm:M}async function _(t,r=h,o={}){let e=o.executable||"npm",a=o.retries??3,f=o.timeout??1e4,l=o.registry||await U(e),g;for(let i=0;i<=a;i++)try{let c=new AbortController,s=setTimeout(()=>{c.abort();},f),n=await Promise.resolve(new Promise((L,A)=>{child_process.exec(`${e} view ${t} version --registry=${l}`,{signal:c.signal,maxBuffer:1024*1024*10},(T,W,R)=>T&&!T.message.toLowerCase().trim().startsWith("npm warn")?A(T):R&&!R.toLowerCase().trim().startsWith("npm warn")?A(R):L(W.trim()));}));if(!semver.valid(n,!0))throw clearTimeout(s),new Error(k__default.default(n).startsWith("[WARN] Request took")?`A timeout occurred while fetching the version for package "${t}" with tag "${r}".`:`Invalid version "${n}" fetched for package "${t}" with tag "${r}"`);return clearTimeout(s),n}catch(c){if(g=c,i<a){let s=Math.pow(2,i)*100;await new Promise(n=>setTimeout(n,s));}}throw g}async function D(t=chunkLW7LMN74_cjs.e(process.cwd())){let r=await chunkLW7LMN74_cjs.i(t);if(!r)throw new Error("No package.json file found in workspace root");let o=chunkLW7LMN74_cjs.j(r);if(o)return Object.fromEntries(Object.entries(o).map(([e,a])=>[e,a.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in package.json file located in workspace root: ${t}
|
|
2
|
+
File content: ${JSON.stringify(r,null,2)}`);}async function J(t=chunkLW7LMN74_cjs.e(process.cwd())){let r=await D(t);if(!r)throw new Error("No catalog entries found in workspace root package.json file");return r}async function j(t,r=chunkLW7LMN74_cjs.e(process.cwd())){let o=await chunkLW7LMN74_cjs.i(r);if(!o)throw new Error("No package.json file found in workspace root");chunkLW7LMN74_cjs.k(o,Object.fromEntries(Object.entries(t).filter(([,e])=>e&&(e.startsWith("npm:")||semver.valid(chunkWAL5SD4G_cjs.a(e),true))).map(([e,a])=>[e,a.replaceAll('"',"").replaceAll("'","")]))),await chunkLW7LMN74_cjs.l(o,r);}async function dt(t,r,o={}){let{tag:e=h,prefix:a="^",workspaceRoot:f=chunkLW7LMN74_cjs.e(),verbose:l=false}=o,g=await chunkLW7LMN74_cjs.g(true,{workspaceRoot:f});l&&chunkLW7LMN74_cjs.c(`Upgrading catalog entry for package "${r}" with tag "${e}"`,g);let i=await P(),c=await _(r,e,{executable:"bun pm",registry:i});if(!c)throw new Error(`Failed to fetch version for package "${r}" with tag "${e}"`);if(!semver.valid(chunkWAL5SD4G_cjs.a(c),true))throw new Error(`Invalid version "${c}" fetched for package "${r}" with tag "${e}"`);let s=`${a||""}${chunkWAL5SD4G_cjs.a(c)}`,n=false;return t[r]?.startsWith("npm:")?(t[r]=s,chunkLW7LMN74_cjs.b(`Writing version ${t[r]} to catalog for "${r}" package`,g)):!semver.valid(semver.coerce(t[r]))||semver.coerce(t[r])&&semver.coerce(s)&&semver.gt(semver.coerce(s),semver.coerce(t[r]))?(t[r]=`${a||""}${chunkWAL5SD4G_cjs.a(s)}`,chunkLW7LMN74_cjs.b(`Writing version ${t[r]} to catalog for "${r}" package`,g),n=true):l&&chunkLW7LMN74_cjs.b(`The current version ${t[r]} for package "${r}" is greater than or equal to the version ${chunkWAL5SD4G_cjs.a(s)} fetched from the npm registry with tag "${e}". No update performed.`,g),{catalog:t,updated:n}}async function $t(t,r={}){let{tag:o=h,prefix:e="^",throwIfMissingInCatalog:a=false,workspaceRoot:f=chunkLW7LMN74_cjs.e(),verbose:l=false}=r,g=await chunkLW7LMN74_cjs.g(true,{workspaceRoot:f}),i=await J(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&&chunkLW7LMN74_cjs.c(`Upgrading catalog entry for package "${t}" with tag "${o}"`,g);let c=await P(),s=await _(t,o,{executable:"bun pm",registry:c});if(!s)throw new Error(`Failed to fetch version for package "${t}" with tag "${o}"`);if(!semver.valid(chunkWAL5SD4G_cjs.a(s),true))throw new Error(`Invalid version "${s}" fetched for package "${t}" with tag "${o}"`);let n=`${e||""}${chunkWAL5SD4G_cjs.a(s)}`;n===i[t]?l&&chunkLW7LMN74_cjs.c(`The version for package "${t}" is already up to date in the catalog: ${n}`,g):!semver.valid(chunkWAL5SD4G_cjs.a(i[t]),true)||semver.coerce(i[t])&&semver.coerce(n)&&semver.gt(semver.coerce(n),semver.coerce(i[t]))?(i[t]=`${e||""}${chunkWAL5SD4G_cjs.a(n)}`,chunkLW7LMN74_cjs.b(`Writing version ${i[t]} to catalog for "${t}" package`,g),await j(i,f)):l&&chunkLW7LMN74_cjs.a(`The current version "${i[t]}" for package "${t}" is greater than or equal to the version "${n}" fetched from the npm registry with tag "${o}". No update performed.`,g);}exports.a=D;exports.b=J;exports.c=j;exports.d=dt;exports.e=$t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkCNGWFMRC_cjs=require('./chunk-CNGWFMRC.cjs'),chunkLW7LMN74_cjs=require('./chunk-LW7LMN74.cjs'),devkit=require('@nx/devkit'),fs=require('fs'),promises=require('fs/promises'),prettier=require('prettier');async function G(t=process.cwd(),f=chunkLW7LMN74_cjs.e(t)){let g=chunkLW7LMN74_cjs.d(t,"package.json"),l=await promises.readFile(g,"utf8");if(!l)throw new Error("No package.json file found in package root: "+t);let s=await chunkCNGWFMRC_cjs.b(f),c=JSON.parse(l);if(!s){console.warn("No workspace catalog found. Skipping dependencies replacement for now.");return}for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=c[a];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!s)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`package.json\` file.`);let n=s[e];if(!n)throw new Error("Missing workspace catalog version for "+e);o[e]=n;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let r;try{r=devkit.readCachedProjectGraph();}catch{await devkit.createProjectGraphAsync(),r=devkit.readCachedProjectGraph();}let i={};r&&await Promise.all(Object.keys(r.nodes).map(async a=>{let o=r.nodes[a];if(o?.data.root){let e=chunkLW7LMN74_cjs.d(f,o.data.root,"package.json");if(fs.existsSync(e)){let n=await promises.readFile(e,"utf8"),p=JSON.parse(n);p.private!==true&&(i[p.name]=p.version);}}}));for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=c[a];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(i[e])o[e]=`^${i[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return promises.writeFile(g,await prettier.format(JSON.stringify(c),{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=G;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-7QKHH2VM.js';import {i,j as j$1,e,k,l,g,c,b,a as a$1,f}from'./chunk-SEDA3WBM.js';import {exec}from'node:child_process';import {valid,coerce,gt}from'semver';import D from'strip-ansi';var O="https://registry.npmjs.org";var U="latest";var h=U;async function S(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 _(){if(process.env.STORM_REGISTRY_NPM)return process.env.STORM_REGISTRY_NPM;let t=await f();return t?.registry?.npm?t?.registry?.npm:O}async function A(t,r=h,o={}){let e=o.executable||"npm",a=o.retries??3,f=o.timeout??1e4,l=o.registry||await S(e),g;for(let i=0;i<=a;i++)try{let c=new AbortController,s=setTimeout(()=>{c.abort();},f),n=await Promise.resolve(new Promise((W,v)=>{exec(`${e} view ${t} version --registry=${l}`,{signal:c.signal,maxBuffer:1024*1024*10},(T,V,R)=>T&&!T.message.toLowerCase().trim().startsWith("npm warn")?v(T):R&&!R.toLowerCase().trim().startsWith("npm warn")?v(R):W(V.trim()));}));if(!valid(n,!0))throw clearTimeout(s),new Error(D(n).startsWith("[WARN] Request took")?`A timeout occurred while fetching the version for package "${t}" with tag "${r}".`:`Invalid version "${n}" fetched for package "${t}" with tag "${r}"`);return clearTimeout(s),n}catch(c){if(g=c,i<a){let s=Math.pow(2,i)*100;await new Promise(n=>setTimeout(n,s));}}throw g}async function J(t=e(process.cwd())){let r=await i(t);if(!r)throw new Error("No package.json file found in workspace root");let o=j$1(r);if(o)return Object.fromEntries(Object.entries(o).map(([e,a])=>[e,a.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in package.json file located in workspace root: ${t}
|
|
2
|
+
File content: ${JSON.stringify(r,null,2)}`);}async function j(t=e(process.cwd())){let r=await J(t);if(!r)throw new Error("No catalog entries found in workspace root package.json file");return r}async function B(t,r=e(process.cwd())){let o=await i(r);if(!o)throw new Error("No package.json file found in workspace root");k(o,Object.fromEntries(Object.entries(t).filter(([,e])=>e&&(e.startsWith("npm:")||valid(a(e),true))).map(([e,a])=>[e,a.replaceAll('"',"").replaceAll("'","")]))),await l(o,r);}async function $t(t,r,o={}){let{tag:e$1=h,prefix:a$1="^",workspaceRoot:f=e(),verbose:l=false}=o,g$1=await g(true,{workspaceRoot:f});l&&c(`Upgrading catalog entry for package "${r}" with tag "${e$1}"`,g$1);let i=await _(),c$1=await A(r,e$1,{executable:"bun pm",registry:i});if(!c$1)throw new Error(`Failed to fetch version for package "${r}" with tag "${e$1}"`);if(!valid(a(c$1),true))throw new Error(`Invalid version "${c$1}" fetched for package "${r}" with tag "${e$1}"`);let s=`${a$1||""}${a(c$1)}`,n=false;return t[r]?.startsWith("npm:")?(t[r]=s,b(`Writing version ${t[r]} to catalog for "${r}" package`,g$1)):!valid(coerce(t[r]))||coerce(t[r])&&coerce(s)&>(coerce(s),coerce(t[r]))?(t[r]=`${a$1||""}${a(s)}`,b(`Writing version ${t[r]} to catalog for "${r}" package`,g$1),n=true):l&&b(`The current version ${t[r]} for package "${r}" is greater than or equal to the version ${a(s)} fetched from the npm registry with tag "${e$1}". No update performed.`,g$1),{catalog:t,updated:n}}async function Tt(t,r={}){let{tag:o=h,prefix:e$1="^",throwIfMissingInCatalog:a$2=false,workspaceRoot:f=e(),verbose:l=false}=r,g$1=await g(true,{workspaceRoot:f}),i=await j(f);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}"`,g$1);let c$1=await _(),s=await A(t,o,{executable:"bun pm",registry:c$1});if(!s)throw new Error(`Failed to fetch version for package "${t}" with tag "${o}"`);if(!valid(a(s),true))throw new Error(`Invalid version "${s}" fetched for package "${t}" with tag "${o}"`);let n=`${e$1||""}${a(s)}`;n===i[t]?l&&c(`The version for package "${t}" is already up to date in the catalog: ${n}`,g$1):!valid(a(i[t]),true)||coerce(i[t])&&coerce(n)&>(coerce(n),coerce(i[t]))?(i[t]=`${e$1||""}${a(n)}`,b(`Writing version ${i[t]} to catalog for "${t}" package`,g$1),await B(i,f)):l&&a$1(`The current version "${i[t]}" for package "${t}" is greater than or equal to the version "${n}" fetched from the npm registry with tag "${o}". No update performed.`,g$1);}export{J as a,j as b,B as c,$t as d,Tt as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-U26JJOFM.js';import {d,e}from'./chunk-SEDA3WBM.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(t=process.cwd(),f=e(t)){let g=d(t,"package.json"),l=await readFile(g,"utf8");if(!l)throw new Error("No package.json file found in package root: "+t);let s=await b(f),c=JSON.parse(l);if(!s){console.warn("No workspace catalog found. Skipping dependencies replacement for now.");return}for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=c[a];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!s)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`package.json\` file.`);let n=s[e];if(!n)throw new Error("Missing workspace catalog version for "+e);o[e]=n;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let r;try{r=readCachedProjectGraph();}catch{await createProjectGraphAsync(),r=readCachedProjectGraph();}let i={};r&&await Promise.all(Object.keys(r.nodes).map(async a=>{let o=r.nodes[a];if(o?.data.root){let e=d(f,o.data.root,"package.json");if(existsSync(e)){let n=await readFile(e,"utf8"),p=JSON.parse(n);p.private!==true&&(i[p.name]=p.version);}}}));for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=c[a];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(i[e])o[e]=`^${i[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return writeFile(g,await format(JSON.stringify(c),{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{C as a};
|
package/dist/helpers/catalog.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkCNGWFMRC_cjs=require('../chunk-CNGWFMRC.cjs');require('../chunk-WAL5SD4G.cjs'),require('../chunk-LW7LMN74.cjs');Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkCNGWFMRC_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkCNGWFMRC_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkCNGWFMRC_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkCNGWFMRC_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkCNGWFMRC_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-U26JJOFM.js';import'../chunk-7QKHH2VM.js';import'../chunk-SEDA3WBM.js';
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';require('../chunk-3CHW2FOO.cjs');var
|
|
1
|
+
'use strict';require('../chunk-3CHW2FOO.cjs');var chunkSJCE2DOC_cjs=require('../chunk-SJCE2DOC.cjs'),chunkCNGWFMRC_cjs=require('../chunk-CNGWFMRC.cjs');require('../chunk-WAL5SD4G.cjs');var chunk5NB734BQ_cjs=require('../chunk-5NB734BQ.cjs'),chunkLW7LMN74_cjs=require('../chunk-LW7LMN74.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkSJCE2DOC_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkCNGWFMRC_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkCNGWFMRC_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkCNGWFMRC_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkCNGWFMRC_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkCNGWFMRC_cjs.d}});Object.defineProperty(exports,"getWorkspaceFilePath",{enumerable:true,get:function(){return chunk5NB734BQ_cjs.a}});Object.defineProperty(exports,"readWorkspaceFile",{enumerable:true,get:function(){return chunk5NB734BQ_cjs.b}});Object.defineProperty(exports,"writeWorkspaceFile",{enumerable:true,get:function(){return chunk5NB734BQ_cjs.c}});Object.defineProperty(exports,"getCatalogFromPackageJson",{enumerable:true,get:function(){return chunkLW7LMN74_cjs.j}});Object.defineProperty(exports,"getRootPackageJsonPath",{enumerable:true,get:function(){return chunkLW7LMN74_cjs.h}});Object.defineProperty(exports,"readRootPackageJson",{enumerable:true,get:function(){return chunkLW7LMN74_cjs.i}});Object.defineProperty(exports,"setCatalogInPackageJson",{enumerable:true,get:function(){return chunkLW7LMN74_cjs.k}});Object.defineProperty(exports,"writeRootPackageJson",{enumerable:true,get:function(){return chunkLW7LMN74_cjs.l}});
|
package/dist/helpers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import'../chunk-PJBAL7AE.js';export{a as replaceDepsAliases}from'../chunk-
|
|
1
|
+
import'../chunk-PJBAL7AE.js';export{a as replaceDepsAliases}from'../chunk-XDAT6OMA.js';export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'../chunk-U26JJOFM.js';import'../chunk-7QKHH2VM.js';export{a as getWorkspaceFilePath,b as readWorkspaceFile,c as writeWorkspaceFile}from'../chunk-PJWTWPKR.js';export{j as getCatalogFromPackageJson,h as getRootPackageJsonPath,i as readRootPackageJson,k as setCatalogInPackageJson,l as writeRootPackageJson}from'../chunk-SEDA3WBM.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkSJCE2DOC_cjs=require('../chunk-SJCE2DOC.cjs');require('../chunk-CNGWFMRC.cjs'),require('../chunk-WAL5SD4G.cjs'),require('../chunk-LW7LMN74.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkSJCE2DOC_cjs.a}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as replaceDepsAliases}from'../chunk-
|
|
1
|
+
export{a as replaceDepsAliases}from'../chunk-XDAT6OMA.js';import'../chunk-U26JJOFM.js';import'../chunk-7QKHH2VM.js';import'../chunk-SEDA3WBM.js';
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';require('./chunk-SFZRYJZ2.cjs'),require('./chunk-3CHW2FOO.cjs');var
|
|
1
|
+
'use strict';require('./chunk-SFZRYJZ2.cjs'),require('./chunk-3CHW2FOO.cjs');var chunkSJCE2DOC_cjs=require('./chunk-SJCE2DOC.cjs'),chunkCNGWFMRC_cjs=require('./chunk-CNGWFMRC.cjs');require('./chunk-WAL5SD4G.cjs');var chunk5NB734BQ_cjs=require('./chunk-5NB734BQ.cjs'),chunkLW7LMN74_cjs=require('./chunk-LW7LMN74.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkSJCE2DOC_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkCNGWFMRC_cjs.b}});Object.defineProperty(exports,"getCatalogSafe",{enumerable:true,get:function(){return chunkCNGWFMRC_cjs.a}});Object.defineProperty(exports,"saveCatalog",{enumerable:true,get:function(){return chunkCNGWFMRC_cjs.e}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkCNGWFMRC_cjs.c}});Object.defineProperty(exports,"upgradeCatalog",{enumerable:true,get:function(){return chunkCNGWFMRC_cjs.d}});Object.defineProperty(exports,"getWorkspaceFilePath",{enumerable:true,get:function(){return chunk5NB734BQ_cjs.a}});Object.defineProperty(exports,"readWorkspaceFile",{enumerable:true,get:function(){return chunk5NB734BQ_cjs.b}});Object.defineProperty(exports,"writeWorkspaceFile",{enumerable:true,get:function(){return chunk5NB734BQ_cjs.c}});Object.defineProperty(exports,"getCatalogFromPackageJson",{enumerable:true,get:function(){return chunkLW7LMN74_cjs.j}});Object.defineProperty(exports,"getRootPackageJsonPath",{enumerable:true,get:function(){return chunkLW7LMN74_cjs.h}});Object.defineProperty(exports,"readRootPackageJson",{enumerable:true,get:function(){return chunkLW7LMN74_cjs.i}});Object.defineProperty(exports,"setCatalogInPackageJson",{enumerable:true,get:function(){return chunkLW7LMN74_cjs.k}});Object.defineProperty(exports,"writeRootPackageJson",{enumerable:true,get:function(){return chunkLW7LMN74_cjs.l}});
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import'./chunk-GGNOJ77I.js';import'./chunk-PJBAL7AE.js';export{a as replaceDepsAliases}from'./chunk-
|
|
1
|
+
import'./chunk-GGNOJ77I.js';import'./chunk-PJBAL7AE.js';export{a as replaceDepsAliases}from'./chunk-XDAT6OMA.js';export{b as getCatalog,a as getCatalogSafe,e as saveCatalog,c as setCatalog,d as upgradeCatalog}from'./chunk-U26JJOFM.js';import'./chunk-7QKHH2VM.js';export{a as getWorkspaceFilePath,b as readWorkspaceFile,c as writeWorkspaceFile}from'./chunk-PJWTWPKR.js';export{j as getCatalogFromPackageJson,h as getRootPackageJsonPath,i as readRootPackageJson,k as setCatalogInPackageJson,l as writeRootPackageJson}from'./chunk-SEDA3WBM.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/bun-tools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A set of [Bun](https://bun.sh/) plugins and utilities for managing workspace packages/dependencies.",
|
|
6
6
|
"repository": {
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
"storm-bun-esm": "./bin/bun.js"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@storm-software/config": "^1.138.
|
|
77
|
-
"@storm-software/config-tools": "^1.190.
|
|
78
|
-
"@storm-software/npm-tools": "^0.6.
|
|
79
|
-
"@storm-software/package-constants": "^0.1.
|
|
76
|
+
"@storm-software/config": "^1.138.47",
|
|
77
|
+
"@storm-software/config-tools": "^1.190.110",
|
|
78
|
+
"@storm-software/npm-tools": "^0.6.228",
|
|
79
|
+
"@storm-software/package-constants": "^0.1.123",
|
|
80
80
|
"chalk": "^4.1.2",
|
|
81
81
|
"commander": "^12.1.0",
|
|
82
82
|
"defu": "^6.1.7",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": { "@types/node": "^25.9.5", "tsup": "8.4.0" },
|
|
89
89
|
"publishConfig": { "access": "public" },
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "791a16dc61f034268cb0a0c8c171e70091d553bd"
|
|
91
91
|
}
|
package/dist/chunk-ET2J7MDH.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-7QKHH2VM.js';import {i,j as j$1,e,k,l,g,c,b,a as a$1,f}from'./chunk-SEDA3WBM.js';import {exec}from'node:child_process';import {valid,coerce,gt}from'semver';import D from'strip-ansi';var O="https://registry.npmjs.org";var U="latest";var m=U;async function S(t="npm"){return new Promise((r,e)=>{exec(`${t} config get registry`,(o,a,g)=>o&&!o.message.toLowerCase().trim().startsWith("npm warn")?e(o):g&&!g.toLowerCase().trim().startsWith("npm warn")?e(g):r(a.trim()));})}async function _(){if(process.env.STORM_REGISTRY_NPM)return process.env.STORM_REGISTRY_NPM;let t=await f();return t?.registry?.npm?t?.registry?.npm:O}async function A(t,r=m,e={}){let o=e.executable||"npm",a=e.retries??3,g=e.timeout??1e4,l=e.registry||await S(o),c;for(let i=0;i<=a;i++)try{let f=new AbortController,s=setTimeout(()=>{f.abort();},g),n=await Promise.resolve(new Promise((k,v)=>{exec(`${o} view ${t} version --registry=${l}`,{signal:f.signal,maxBuffer:1024*1024*10},(T,V,R)=>T&&!T.message.toLowerCase().trim().startsWith("npm warn")?v(T):R&&!R.toLowerCase().trim().startsWith("npm warn")?v(R):k(V.trim()));}));if(!valid(n,!0))throw clearTimeout(s),new Error(D(n).startsWith("[WARN] Request took")?`A timeout occurred while fetching the version for package "${t}" with tag "${r}".`:`Invalid version "${n}" fetched for package "${t}" with tag "${r}"`);return clearTimeout(s),n}catch(f){if(c=f,i<a){let s=Math.pow(2,i)*100;await new Promise(n=>setTimeout(n,s));}}throw c}async function J(t=e(process.cwd())){let r=await i(t);if(!r)throw new Error("No package.json file found in workspace root");let e=j$1(r);if(e)return Object.fromEntries(Object.entries(e).map(([o,a])=>[o,a.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in package.json file located in workspace root: ${t}
|
|
2
|
-
File content: ${JSON.stringify(r,null,2)}`);}async function j(t=e(process.cwd())){let r=await J(t);if(!r)throw new Error("No catalog entries found in workspace root package.json file");return r}async function B(t,r=e(process.cwd())){let e=await i(r);if(!e)throw new Error("No package.json file found in workspace root");k(e,Object.fromEntries(Object.entries(t).filter(([,o])=>o&&valid(a(o),true)).map(([o,a])=>[o,a.replaceAll('"',"").replaceAll("'","")]))),await l(e,r);}async function $t(t,r,e$1={}){let{tag:o=m,prefix:a$1="^",workspaceRoot:g$1=e(),verbose:l=false}=e$1,c$1=await g(true,{workspaceRoot:g$1});l&&c(`Upgrading catalog entry for package "${r}" with tag "${o}"`,c$1);let i=await _(),f=await A(r,o,{executable:"bun pm",registry:i});if(!f)throw new Error(`Failed to fetch version for package "${r}" with tag "${o}"`);if(!valid(a(f),true))throw new Error(`Invalid version "${f}" fetched for package "${r}" with tag "${o}"`);let s=`${a$1||""}${a(f)}`,n=false;return !valid(coerce(t[r]))||coerce(t[r])&&coerce(s)&>(coerce(s),coerce(t[r]))?(t[r]=`${a$1||""}${a(s)}`,b(`Writing version ${t[r]} to catalog for "${r}" package`,c$1),n=true):l&&b(`The current version ${t[r]} for package "${r}" is greater than or equal to the version ${a(s)} fetched from the npm registry with tag "${o}". No update performed.`,c$1),{catalog:t,updated:n}}async function Tt(t,r={}){let{tag:e$1=m,prefix:o="^",throwIfMissingInCatalog:a$2=false,workspaceRoot:g$1=e(),verbose:l=false}=r,c$1=await g(true,{workspaceRoot:g$1}),i=await j(g$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 "${e$1}"`,c$1);let f=await _(),s=await A(t,e$1,{executable:"bun pm",registry:f});if(!s)throw new Error(`Failed to fetch version for package "${t}" with tag "${e$1}"`);if(!valid(a(s),true))throw new Error(`Invalid version "${s}" fetched for package "${t}" with tag "${e$1}"`);let n=`${o||""}${a(s)}`;n===i[t]?l&&c(`The version for package "${t}" is already up to date in the catalog: ${n}`,c$1):!valid(a(i[t]),true)||coerce(i[t])&&coerce(n)&>(coerce(n),coerce(i[t]))?(i[t]=`${o||""}${a(n)}`,b(`Writing version ${i[t]} to catalog for "${t}" package`,c$1),await B(i,g$1)):l&&a$1(`The current version "${i[t]}" for package "${t}" is greater than or equal to the version "${n}" fetched from the npm registry with tag "${e$1}". No update performed.`,c$1);}export{J as a,j as b,B as c,$t as d,Tt as e};
|
package/dist/chunk-IVRV4VUN.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkWAL5SD4G_cjs=require('./chunk-WAL5SD4G.cjs'),chunkLW7LMN74_cjs=require('./chunk-LW7LMN74.cjs'),child_process=require('child_process'),semver=require('semver'),Y=require('strip-ansi');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Y__default=/*#__PURE__*/_interopDefault(Y);var M="https://registry.npmjs.org";var O="latest";var m=O;async function U(t="npm"){return new Promise((r,e)=>{child_process.exec(`${t} config get registry`,(o,a,g)=>o&&!o.message.toLowerCase().trim().startsWith("npm warn")?e(o):g&&!g.toLowerCase().trim().startsWith("npm warn")?e(g):r(a.trim()));})}async function P(){if(process.env.STORM_REGISTRY_NPM)return process.env.STORM_REGISTRY_NPM;let t=await chunkLW7LMN74_cjs.f();return t?.registry?.npm?t?.registry?.npm:M}async function _(t,r=m,e={}){let o=e.executable||"npm",a=e.retries??3,g=e.timeout??1e4,l=e.registry||await U(o),c;for(let i=0;i<=a;i++)try{let f=new AbortController,s=setTimeout(()=>{f.abort();},g),n=await Promise.resolve(new Promise((L,A)=>{child_process.exec(`${o} view ${t} version --registry=${l}`,{signal:f.signal,maxBuffer:1024*1024*10},(T,k,R)=>T&&!T.message.toLowerCase().trim().startsWith("npm warn")?A(T):R&&!R.toLowerCase().trim().startsWith("npm warn")?A(R):L(k.trim()));}));if(!semver.valid(n,!0))throw clearTimeout(s),new Error(Y__default.default(n).startsWith("[WARN] Request took")?`A timeout occurred while fetching the version for package "${t}" with tag "${r}".`:`Invalid version "${n}" fetched for package "${t}" with tag "${r}"`);return clearTimeout(s),n}catch(f){if(c=f,i<a){let s=Math.pow(2,i)*100;await new Promise(n=>setTimeout(n,s));}}throw c}async function D(t=chunkLW7LMN74_cjs.e(process.cwd())){let r=await chunkLW7LMN74_cjs.i(t);if(!r)throw new Error("No package.json file found in workspace root");let e=chunkLW7LMN74_cjs.j(r);if(e)return Object.fromEntries(Object.entries(e).map(([o,a])=>[o,a.replaceAll('"',"").replaceAll("'","")]));console.warn(`No catalog found in package.json file located in workspace root: ${t}
|
|
2
|
-
File content: ${JSON.stringify(r,null,2)}`);}async function J(t=chunkLW7LMN74_cjs.e(process.cwd())){let r=await D(t);if(!r)throw new Error("No catalog entries found in workspace root package.json file");return r}async function j(t,r=chunkLW7LMN74_cjs.e(process.cwd())){let e=await chunkLW7LMN74_cjs.i(r);if(!e)throw new Error("No package.json file found in workspace root");chunkLW7LMN74_cjs.k(e,Object.fromEntries(Object.entries(t).filter(([,o])=>o&&semver.valid(chunkWAL5SD4G_cjs.a(o),true)).map(([o,a])=>[o,a.replaceAll('"',"").replaceAll("'","")]))),await chunkLW7LMN74_cjs.l(e,r);}async function dt(t,r,e={}){let{tag:o=m,prefix:a="^",workspaceRoot:g=chunkLW7LMN74_cjs.e(),verbose:l=false}=e,c=await chunkLW7LMN74_cjs.g(true,{workspaceRoot:g});l&&chunkLW7LMN74_cjs.c(`Upgrading catalog entry for package "${r}" with tag "${o}"`,c);let i=await P(),f=await _(r,o,{executable:"bun pm",registry:i});if(!f)throw new Error(`Failed to fetch version for package "${r}" with tag "${o}"`);if(!semver.valid(chunkWAL5SD4G_cjs.a(f),true))throw new Error(`Invalid version "${f}" fetched for package "${r}" with tag "${o}"`);let s=`${a||""}${chunkWAL5SD4G_cjs.a(f)}`,n=false;return !semver.valid(semver.coerce(t[r]))||semver.coerce(t[r])&&semver.coerce(s)&&semver.gt(semver.coerce(s),semver.coerce(t[r]))?(t[r]=`${a||""}${chunkWAL5SD4G_cjs.a(s)}`,chunkLW7LMN74_cjs.b(`Writing version ${t[r]} to catalog for "${r}" package`,c),n=true):l&&chunkLW7LMN74_cjs.b(`The current version ${t[r]} for package "${r}" is greater than or equal to the version ${chunkWAL5SD4G_cjs.a(s)} fetched from the npm registry with tag "${o}". No update performed.`,c),{catalog:t,updated:n}}async function $t(t,r={}){let{tag:e=m,prefix:o="^",throwIfMissingInCatalog:a=false,workspaceRoot:g=chunkLW7LMN74_cjs.e(),verbose:l=false}=r,c=await chunkLW7LMN74_cjs.g(true,{workspaceRoot:g}),i=await J(g);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&&chunkLW7LMN74_cjs.c(`Upgrading catalog entry for package "${t}" with tag "${e}"`,c);let f=await P(),s=await _(t,e,{executable:"bun pm",registry:f});if(!s)throw new Error(`Failed to fetch version for package "${t}" with tag "${e}"`);if(!semver.valid(chunkWAL5SD4G_cjs.a(s),true))throw new Error(`Invalid version "${s}" fetched for package "${t}" with tag "${e}"`);let n=`${o||""}${chunkWAL5SD4G_cjs.a(s)}`;n===i[t]?l&&chunkLW7LMN74_cjs.c(`The version for package "${t}" is already up to date in the catalog: ${n}`,c):!semver.valid(chunkWAL5SD4G_cjs.a(i[t]),true)||semver.coerce(i[t])&&semver.coerce(n)&&semver.gt(semver.coerce(n),semver.coerce(i[t]))?(i[t]=`${o||""}${chunkWAL5SD4G_cjs.a(n)}`,chunkLW7LMN74_cjs.b(`Writing version ${i[t]} to catalog for "${t}" package`,c),await j(i,g)):l&&chunkLW7LMN74_cjs.a(`The current version "${i[t]}" for package "${t}" is greater than or equal to the version "${n}" fetched from the npm registry with tag "${e}". No update performed.`,c);}exports.a=D;exports.b=J;exports.c=j;exports.d=dt;exports.e=$t;
|