@stacksjs/buddy 0.75.233 → 0.75.237
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.
|
@@ -17,9 +17,9 @@ export declare function automatedDeploymentRevision(environment: string, variabl
|
|
|
17
17
|
* production already runs one of those.
|
|
18
18
|
*
|
|
19
19
|
* The branch is fetched without updating any ref (FETCH_HEAD only). A shallow
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* checkout must complete its history before enumerating the difference: a
|
|
21
|
+
* newer merge can expose shared ancestors hidden behind the CI boundary,
|
|
22
|
+
* making an older live release look newer even when CI is a proven ancestor.
|
|
23
23
|
*/
|
|
24
24
|
export declare function assertCurrentDeploymentRevision(revision: AutomatedDeploymentRevision | undefined, cwd?: unknown): Promise<DeploymentRevisionCheck | undefined>;
|
|
25
25
|
/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{execFile}from"node:child_process";import process from"node:process";import{promisify}from"node:util";const execute=promisify(execFile);export function automatedDeploymentRevision(environment,variables=process.env){if(environment!=="production")return;const prefix=variables.REVIEWOS==="true"?"REVIEWOS":variables.GITHUB_ACTIONS==="true"?"GITHUB":void 0;if(!prefix)return;const ref=variables[`${prefix}_REF`],sha=variables[`${prefix}_SHA`];if(!ref?.startsWith("refs/heads/")||!sha||!/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/i.test(sha))throw Error("Automated production deployment requires a branch ref and full commit SHA from the CI provider.");return Object.freeze({ref,sha:sha.toLowerCase()})}export async function assertCurrentDeploymentRevision(revision,cwd=process.cwd()){if(!revision)return;const git=async(args,options={})=>{try{return(await execute("git",args,{cwd,timeout:60000,maxBuffer:16777216,env:{...process.env,GIT_TERMINAL_PROMPT:"0",GCM_INTERACTIVE:"never"}})).stdout.trim()}catch{if(options.allowFailure)return null;throw Error("Cannot verify the automated deployment revision against origin; production deployment stopped.")}};await git(["check-ref-format",revision.ref]);if((await git(["rev-parse","--verify","HEAD"]))?.toLowerCase()!==revision.sha)throw Error("The deployment checkout does not match the CI commit; production deployment stopped.");const remote=await git(["ls-remote","--exit-code","--refs","origin",revision.ref]),lines=String(remote).split(`
|
|
2
|
-
`).map((line)=>line.split(/\s+/));if(lines.length!==1||lines[0]?.[1]!==revision.ref||!/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/i.test(lines[0]?.[0]??""))throw Error("Origin did not return one authoritative branch head; production deployment stopped.");if(lines[0][0].toLowerCase()===revision.sha)return Object.freeze({revision,newer:[]});await git(["
|
|
2
|
+
`).map((line)=>line.split(/\s+/));if(lines.length!==1||lines[0]?.[1]!==revision.ref||!/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/i.test(lines[0]?.[0]??""))throw Error("Origin did not return one authoritative branch head; production deployment stopped.");if(lines[0][0].toLowerCase()===revision.sha)return Object.freeze({revision,newer:[]});const shallow=await git(["rev-parse","--is-shallow-repository"])==="true";await git(["fetch","--quiet","--no-tags",...shallow?["--unshallow"]:[],"origin",revision.ref]);if(await git(["rev-parse","--is-shallow-repository"])==="true")throw Error("Cannot verify complete origin history; production deployment stopped.");const tip=String(await git(["rev-parse","--verify","FETCH_HEAD^{commit}"])).toLowerCase();if(await git(["merge-base","--is-ancestor",revision.sha,tip],{allowFailure:!0})===null)throw Error("This CI commit is no longer on the origin branch; production deployment stopped. Deploy the current branch head.");const newer=String(await git(["rev-list",`${revision.sha}..${tip}`])).split(`
|
|
3
3
|
`).map((line)=>line.trim().toLowerCase()).filter(Boolean);return Object.freeze({revision,newer})}export function assertNotBehindLiveRelease(check,liveReleases){if(!check||check.newer.length===0)return;for(const raw of liveReleases){const id=String(raw??"").trim().toLowerCase();if(!/^[a-f0-9]{7,64}$/.test(id))continue;if(check.newer.some((sha)=>sha.startsWith(id)))throw Error(`Production already runs ${id}, which is newer than this CI commit; production deployment stopped. Deploy the current branch head.`)}}export function liveReleasesCommand(slug){if(!/^[a-z0-9][a-z0-9-]*$/i.test(slug))throw Error("A project slug is letters, digits and dashes.");return`for d in /var/www/${slug}-*/current; do [ -L "$d" ] && basename "$(readlink -f "$d")"; done; true`}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/buddy",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.237",
|
|
6
6
|
"description": "Meet Buddy. The Stacks runtime.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -95,73 +95,73 @@
|
|
|
95
95
|
"prepublishOnly": "bun run build"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@stacksjs/bumpx": "^0.2.
|
|
99
|
-
"@stacksjs/actions": "0.75.
|
|
100
|
-
"@stacksjs/ai": "0.75.
|
|
101
|
-
"@stacksjs/alias": "0.75.
|
|
102
|
-
"@stacksjs/analytics": "0.75.
|
|
103
|
-
"@stacksjs/api": "0.75.
|
|
104
|
-
"@stacksjs/arrays": "0.75.
|
|
105
|
-
"@stacksjs/auth": "0.75.
|
|
106
|
-
"@stacksjs/browser-extension": "0.75.
|
|
107
|
-
"@stacksjs/build": "0.75.
|
|
108
|
-
"@stacksjs/cache": "0.75.
|
|
109
|
-
"@stacksjs/chat": "0.75.
|
|
98
|
+
"@stacksjs/bumpx": "^0.2.24",
|
|
99
|
+
"@stacksjs/actions": "0.75.237",
|
|
100
|
+
"@stacksjs/ai": "0.75.237",
|
|
101
|
+
"@stacksjs/alias": "0.75.237",
|
|
102
|
+
"@stacksjs/analytics": "0.75.237",
|
|
103
|
+
"@stacksjs/api": "0.75.237",
|
|
104
|
+
"@stacksjs/arrays": "0.75.237",
|
|
105
|
+
"@stacksjs/auth": "0.75.237",
|
|
106
|
+
"@stacksjs/browser-extension": "0.75.237",
|
|
107
|
+
"@stacksjs/build": "0.75.237",
|
|
108
|
+
"@stacksjs/cache": "0.75.237",
|
|
109
|
+
"@stacksjs/chat": "0.75.237",
|
|
110
110
|
"@stacksjs/clapp": "^0.2.16",
|
|
111
|
-
"@stacksjs/cli": "0.75.
|
|
112
|
-
"@stacksjs/cloud": "0.75.
|
|
113
|
-
"@stacksjs/cms": "0.75.
|
|
114
|
-
"@stacksjs/collections": "0.75.
|
|
115
|
-
"@stacksjs/commerce": "0.75.
|
|
116
|
-
"@stacksjs/config": "0.75.
|
|
117
|
-
"@stacksjs/database": "0.75.
|
|
118
|
-
"@stacksjs/desktop-build": "0.75.
|
|
119
|
-
"@stacksjs/dns": "0.75.
|
|
111
|
+
"@stacksjs/cli": "0.75.237",
|
|
112
|
+
"@stacksjs/cloud": "0.75.237",
|
|
113
|
+
"@stacksjs/cms": "0.75.237",
|
|
114
|
+
"@stacksjs/collections": "0.75.237",
|
|
115
|
+
"@stacksjs/commerce": "0.75.237",
|
|
116
|
+
"@stacksjs/config": "0.75.237",
|
|
117
|
+
"@stacksjs/database": "0.75.237",
|
|
118
|
+
"@stacksjs/desktop-build": "0.75.237",
|
|
119
|
+
"@stacksjs/dns": "0.75.237",
|
|
120
120
|
"@stacksjs/dnsx": "^0.2.3",
|
|
121
|
-
"@stacksjs/email": "0.75.
|
|
122
|
-
"@stacksjs/enums": "0.75.
|
|
123
|
-
"@stacksjs/env": "0.75.
|
|
124
|
-
"@stacksjs/error-handling": "0.75.
|
|
125
|
-
"@stacksjs/events": "0.75.
|
|
126
|
-
"@stacksjs/features": "0.75.
|
|
127
|
-
"@stacksjs/git": "0.75.
|
|
121
|
+
"@stacksjs/email": "0.75.237",
|
|
122
|
+
"@stacksjs/enums": "0.75.237",
|
|
123
|
+
"@stacksjs/env": "0.75.237",
|
|
124
|
+
"@stacksjs/error-handling": "0.75.237",
|
|
125
|
+
"@stacksjs/events": "0.75.237",
|
|
126
|
+
"@stacksjs/features": "0.75.237",
|
|
127
|
+
"@stacksjs/git": "0.75.237",
|
|
128
128
|
"@stacksjs/gitit": "^0.2.5",
|
|
129
|
-
"@stacksjs/health": "0.75.
|
|
129
|
+
"@stacksjs/health": "0.75.237",
|
|
130
130
|
"@stacksjs/httx": "^0.1.10",
|
|
131
|
-
"@stacksjs/image": "0.75.
|
|
132
|
-
"@stacksjs/lint": "0.75.
|
|
133
|
-
"@stacksjs/logging": "0.75.
|
|
134
|
-
"@stacksjs/notifications": "0.75.
|
|
135
|
-
"@stacksjs/objects": "0.75.
|
|
136
|
-
"@stacksjs/orm": "0.75.
|
|
137
|
-
"@stacksjs/path": "0.75.
|
|
138
|
-
"@stacksjs/payments": "0.75.
|
|
139
|
-
"@stacksjs/realtime": "0.75.
|
|
140
|
-
"@stacksjs/router": "0.75.
|
|
131
|
+
"@stacksjs/image": "0.75.237",
|
|
132
|
+
"@stacksjs/lint": "0.75.237",
|
|
133
|
+
"@stacksjs/logging": "0.75.237",
|
|
134
|
+
"@stacksjs/notifications": "0.75.237",
|
|
135
|
+
"@stacksjs/objects": "0.75.237",
|
|
136
|
+
"@stacksjs/orm": "0.75.237",
|
|
137
|
+
"@stacksjs/path": "0.75.237",
|
|
138
|
+
"@stacksjs/payments": "0.75.237",
|
|
139
|
+
"@stacksjs/realtime": "0.75.237",
|
|
140
|
+
"@stacksjs/router": "0.75.237",
|
|
141
141
|
"@stacksjs/rpx": "^0.11.54",
|
|
142
|
-
"@stacksjs/scheduler": "0.75.
|
|
143
|
-
"@stacksjs/search-engine": "0.75.
|
|
144
|
-
"@stacksjs/security": "0.75.
|
|
145
|
-
"@stacksjs/server": "0.75.
|
|
146
|
-
"@stacksjs/sites": "0.75.
|
|
147
|
-
"@stacksjs/skills": "0.75.
|
|
148
|
-
"@stacksjs/socials": "0.75.
|
|
149
|
-
"@stacksjs/storage": "0.75.
|
|
150
|
-
"@stacksjs/strings": "0.75.
|
|
142
|
+
"@stacksjs/scheduler": "0.75.237",
|
|
143
|
+
"@stacksjs/search-engine": "0.75.237",
|
|
144
|
+
"@stacksjs/security": "0.75.237",
|
|
145
|
+
"@stacksjs/server": "0.75.237",
|
|
146
|
+
"@stacksjs/sites": "0.75.237",
|
|
147
|
+
"@stacksjs/skills": "0.75.237",
|
|
148
|
+
"@stacksjs/socials": "0.75.237",
|
|
149
|
+
"@stacksjs/storage": "0.75.237",
|
|
150
|
+
"@stacksjs/strings": "0.75.237",
|
|
151
151
|
"@stacksjs/stx": "^0.2.574",
|
|
152
|
-
"@stacksjs/testing": "0.75.
|
|
153
|
-
"@stacksjs/tinker": "0.75.
|
|
152
|
+
"@stacksjs/testing": "0.75.237",
|
|
153
|
+
"@stacksjs/tinker": "0.75.237",
|
|
154
154
|
"@stacksjs/tlsx": "^0.13.19",
|
|
155
155
|
"@stacksjs/ts-cloud": "^0.16.58",
|
|
156
|
-
"@stacksjs/tunnel": "0.75.
|
|
157
|
-
"@stacksjs/types": "0.75.
|
|
158
|
-
"@stacksjs/ui": "0.75.
|
|
159
|
-
"@stacksjs/utils": "0.75.
|
|
160
|
-
"@stacksjs/validation": "0.75.
|
|
156
|
+
"@stacksjs/tunnel": "0.75.237",
|
|
157
|
+
"@stacksjs/types": "0.75.237",
|
|
158
|
+
"@stacksjs/ui": "0.75.237",
|
|
159
|
+
"@stacksjs/utils": "0.75.237",
|
|
160
|
+
"@stacksjs/validation": "0.75.237",
|
|
161
161
|
"ajv": "^8.20.0",
|
|
162
162
|
"ajv-formats": "^3.0.1",
|
|
163
163
|
"bun-plugin-stx": "^0.2.574",
|
|
164
|
-
"ts-pantry": "^0.11.
|
|
164
|
+
"ts-pantry": "^0.11.98"
|
|
165
165
|
},
|
|
166
166
|
"devDependencies": {
|
|
167
167
|
"better-dx": "^0.2.24"
|