@stacksjs/actions 0.70.71 → 0.70.72
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/dist/bump.js +2 -1
- package/dist/upgrade/packages.js +8 -7
- package/package.json +16 -16
package/dist/bump.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{execSync as
|
|
2
|
+
import{execSync as y,log as W,parseOptions as C,runCommand as h}from"@stacksjs/cli";import{path as I}from"@stacksjs/path";import{existsSync as x,readFileSync as O,writeFileSync as k}from"fs";import{join as v,relative as f}from"path";var $=C(),B=new Set(["patch","minor","major","prepatch","preminor","premajor","prerelease"]),N=$?.bump?.toString(),D=N?B.has(N)||/^\d+\.\d+\.\d+(?:-[\w.]+)?$/.test(N)?N:null:null;if(N&&!D)W.warn(`Ignoring invalid --bump "${N}"; expected one of patch|minor|major or x.y.z`);async function F(q){if(!q||/^\d+\.\d+\.\d+(?:-[\w.]+)?$/.test(q))return q;if(!["patch","minor","major"].includes(q))return q;let z=(await Bun.file(I.frameworkPath("core/package.json")).json()).version?.match(/^(\d+)\.(\d+)\.(\d+)$/);if(!z)return q;let[,G,H,K]=z.map(Number);if(q==="major")return`${G+1}.0.0`;if(q==="minor")return`${G}.${H+1}.0`;return`${G}.${H}.${K+1}`}var Q=await F(D),X=$?.dryRun===!0;async function S(q,E){let z=await h(q,E);if(z.isErr)throw z.error}async function L(q,E=I.projectPath()){return await y(["git",...q],{cwd:E,stdin:"inherit"})}async function w(){let q=await Bun.file(I.frameworkPath("core/package.json")).json();if(!q.version||!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(q.version))throw Error(`Invalid framework version in package.json: ${q.version??"<missing>"}`);return q.version}var R=I.projectPath("buddy"),J=I.frameworkPath("core");async function Z(q,E){let z=new Bun.Glob(q),G=[];for await(let H of z.scan({cwd:E,absolute:!0,onlyFiles:!0})){if(H.includes("/node_modules/")||H.includes("/dist/")||H.includes("/pantry/"))continue;G.push(`./${f(J,H)}`)}return G}async function c(q){let E=[];for(let z of q){let G=v(J,z);if(await Bun.file(G).exists())E.push(z)}return E}var b=new Set([...await Z("package.json",J),...await Z("*/package.json",J),...await Z("*/*/package.json",J),...await c(["../package.json","../defaults/ide/vscode/package.json","../api/package.json","../cloud/package.json","../docs/package.json","../orm/package.json","../server/package.json"]),...await Z("../libs/**/package.json",J)]),V=Array.from(b).join(","),_=["--no-commit","--no-tag","--no-push","--no-recursive","--no-changelog"];if(X)_.push("--dry-run");if(Q)_.push("--yes");if($?.verbose)_.push("--verbose");var P=`bunx --bun bumpx ${Q?`${Q} `:""}--files ${V} ${_.join(" ")}`;W.debug(`Running: ${P}`);W.debug(`Bumping ${V.split(",").filter(Boolean).length} package manifest(s)`);W.debug(`In frameworkPath: ${I.frameworkPath()}`);await S(P,{cwd:J,stdin:"inherit"});var j=(await L(["describe","--abbrev=0","--tags"])).trim(),U=X&&Q&&/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(Q)?Q:await w(),g=X?`${R} changelog --quiet --dry-run --from ${j} --to HEAD --version ${U}`:`${R} changelog --quiet --from ${j} --to HEAD --version ${U}`;await S(g,{cwd:I.projectPath(),stdin:"inherit"});if(!X)d(U);function d(q){let E=I.frameworkPath("core/package.json"),z=JSON.parse(O(E,"utf-8")),G=0;for(let H of["dependencies","devDependencies"]){let K=z[H];if(!K)continue;for(let Y of Object.keys(K)){if(!Y.startsWith("@stacksjs/"))continue;let A=Y.slice(10),M=I.frameworkPath(`core/${A}/package.json`);if(!x(M))continue;if(JSON.parse(O(M,"utf-8")).version!==q)continue;let T=`^${q}`;if(K[Y]!==T)K[Y]=T,G++}}if(G>0)k(E,`${JSON.stringify(z,null,2)}
|
|
3
|
+
`),W.debug(`Pinned ${G} lockstep core dep(s) in the stacks meta to ^${q}`)}if(!X)await L(["add","--all"]),await L(["commit","-m",`chore: release v${U}`]),await L(["tag",`v${U}`]),await L(["push"]),await L(["push","origin",`v${U}`]);
|
package/dist/upgrade/packages.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"../chunk-4qzb8g3z.js";import{existsSync as U,readFileSync as V,writeFileSync as W}from"fs";import{join as X}from"path";import
|
|
2
|
+
import"../chunk-4qzb8g3z.js";import{existsSync as U,readFileSync as V,writeFileSync as W}from"fs";import{join as X}from"path";import N from"process";import{runCommand as Y}from"@stacksjs/cli";async function Z(A){let z=await fetch("https://registry.npmjs.org/stacks").catch(()=>null);if(!z||!z.ok)throw Error("Could not reach the npm registry to resolve the target `stacks` version.");let J=await z.json(),K=J["dist-tags"]??{},H=J.versions??{},q;if(A.version){if(!H[A.version])throw Error(`stacks@${A.version} was not found on the npm registry.`);q=A.version}else{let I=A.canary?"canary":"latest",b=K[I];if(!b)throw Error(`The \`${I}\` dist-tag is not published for \`stacks\`.`);q=b}let E=new Set(Object.keys(H[q]?.dependencies??{}));return{version:q,coreDeps:E}}function _(A,z,J){let K=[],H=(q)=>q==="stacks"||q.startsWith("@stacksjs/")&&J.has(q);for(let q of["dependencies","devDependencies"]){let E=A[q];if(!E)continue;for(let[I,b]of Object.entries(E)){if(!H(I))continue;let G=`${/^[\^~]/.test(b)?b[0]:/^\d/.test(b)?"":"^"}${z}`;if(b!==G)K.push({name:I,from:b,to:G}),E[I]=G}}return K}async function T(A,z){let J=X(A,"package.json");if(!U(J))console.error("No package.json found \u2014 nothing to upgrade."),N.exit(1);let K=V(J,"utf-8"),H=JSON.parse(K),q=H.dependencies?.stacks??H.devDependencies?.stacks,{version:E,coreDeps:I}=await Z(z).catch((M)=>{console.error(`\u2717 ${M.message}`),N.exit(1)});if(console.log(`
|
|
3
3
|
Upgrading the Stacks framework${z.canary?" (canary)":""} \u2192 ${E}`),q)console.log(` current \`stacks\` constraint: ${q}
|
|
4
|
-
`);let b=_(
|
|
5
|
-
`),
|
|
6
|
-
`),
|
|
4
|
+
`);let b=_(H,E,I);if(b.length===0&&!z.force)console.log(`\u2714 Already up to date \u2014 every framework dependency matches the target.
|
|
5
|
+
`),N.exit(0);if(b.length>0){console.log(" The following dependencies will be updated:");let M=Math.max(...b.map((O)=>O.name.length));for(let O of b)console.log(` ${O.name.padEnd(M)} ${O.from} \u2192 ${O.to}`);console.log("")}if(z.dryRun)console.log(` --dry-run: no files were written and nothing was installed.
|
|
6
|
+
`),N.exit(0);if(b.length>0){let M=K.endsWith(`
|
|
7
7
|
`)?`
|
|
8
|
-
`:"";W(
|
|
9
|
-
`)
|
|
8
|
+
`:"";W(J,`${JSON.stringify(H,null,2)}${M}`),console.log("\u2714 Updated package.json")}let Q=["stacks",...[...I].filter((M)=>M.startsWith("@stacksjs/"))];if(z.noPostinstall)console.log(" --no-postinstall: skipping install. Run this to pull the new versions:"),console.log(` bun update ${Q.slice(0,3).join(" ")} \u2026
|
|
9
|
+
`),N.exit(0);console.log(` Installing\u2026
|
|
10
|
+
`);let G=await Y(`bun update ${Q.join(" ")}`,{cwd:A});if(G&&typeof G==="object"&&"isErr"in G?typeof G.isErr==="function"?G.isErr():G.isErr===!0:!1)console.error("\n\u2717 The install step failed. Your package.json was updated \u2014 resolve the error and re-run `bun update`.\n"),N.exit(1);console.log(`
|
|
10
11
|
\u2714 Upgraded to stacks@${E}. Review the changelog: https://github.com/stacksjs/stacks/releases/tag/v${E}
|
|
11
|
-
`),
|
|
12
|
+
`),N.exit(0)}export{T as upgradeStacksPackages};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.70.
|
|
4
|
+
"version": "0.70.72",
|
|
5
5
|
"description": "The Stacks actions.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": [
|
|
@@ -65,22 +65,22 @@
|
|
|
65
65
|
"@stacksjs/ts-md": "^0.1.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@stacksjs/api": "0.70.
|
|
69
|
-
"@stacksjs/cli": "0.70.
|
|
70
|
-
"@stacksjs/config": "0.70.
|
|
71
|
-
"@stacksjs/database": "0.70.
|
|
68
|
+
"@stacksjs/api": "0.70.72",
|
|
69
|
+
"@stacksjs/cli": "0.70.72",
|
|
70
|
+
"@stacksjs/config": "0.70.72",
|
|
71
|
+
"@stacksjs/database": "0.70.72",
|
|
72
72
|
"@stacksjs/tlsx": "^0.13.2",
|
|
73
73
|
"better-dx": "^0.2.12",
|
|
74
|
-
"@stacksjs/dns": "0.70.
|
|
75
|
-
"@stacksjs/enums": "0.70.
|
|
76
|
-
"@stacksjs/env": "0.70.
|
|
77
|
-
"@stacksjs/error-handling": "0.70.
|
|
78
|
-
"@stacksjs/logging": "0.70.
|
|
79
|
-
"@stacksjs/path": "0.70.
|
|
80
|
-
"@stacksjs/security": "0.70.
|
|
81
|
-
"@stacksjs/storage": "0.70.
|
|
82
|
-
"@stacksjs/strings": "0.70.
|
|
83
|
-
"@stacksjs/utils": "0.70.
|
|
84
|
-
"@stacksjs/validation": "0.70.
|
|
74
|
+
"@stacksjs/dns": "0.70.72",
|
|
75
|
+
"@stacksjs/enums": "0.70.72",
|
|
76
|
+
"@stacksjs/env": "0.70.72",
|
|
77
|
+
"@stacksjs/error-handling": "0.70.72",
|
|
78
|
+
"@stacksjs/logging": "0.70.72",
|
|
79
|
+
"@stacksjs/path": "0.70.72",
|
|
80
|
+
"@stacksjs/security": "0.70.72",
|
|
81
|
+
"@stacksjs/storage": "0.70.72",
|
|
82
|
+
"@stacksjs/strings": "0.70.72",
|
|
83
|
+
"@stacksjs/utils": "0.70.72",
|
|
84
|
+
"@stacksjs/validation": "0.70.72"
|
|
85
85
|
}
|
|
86
86
|
}
|