@stacksjs/actions 0.75.310 → 0.75.315

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.
@@ -6,6 +6,8 @@ export declare function parsePantryVersion(output: string): string | undefined;
6
6
  * declares it in its own manifest, if at all.
7
7
  */
8
8
  export declare function declaredPantryRange(cwd: string): { range: string, file: string } | undefined;
9
+ /** The source and publication jobs must use the SDK's declared toolchain too. */
10
+ export declare function declaredPantryWorkflowVersions(cwd: string): Array<{ file: string, job: string, version: string }>;
9
11
  /** Resolve the Pantry this release will run, and check it against the declared toolchain. */
10
12
  export declare function resolvePantryToolchain(options: PantryToolchainOptions): PantryToolchain;
11
13
  export declare interface PantryToolchainOptions {
@@ -1 +1 @@
1
- import{existsSync,readFileSync}from"node:fs";import{join}from"node:path";export function parsePantryVersion(output){return/\bpantry\s+v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/i.exec(output)?.[1]}export function declaredPantryRange(cwd){for(const file of["storage/framework/core/buddy/package.json","package.json"]){const path=join(cwd,file);if(!existsSync(path))continue;try{const manifest=JSON.parse(readFileSync(path,"utf8")),range=manifest.dependencies?.["ts-pantry"]??manifest.devDependencies?.["ts-pantry"];if(range)return{range,file}}catch{}}return}function probeVersion(bin){try{const result=Bun.spawnSync([bin,"--version"],{stdout:"pipe",stderr:"pipe"});return{exitCode:result.exitCode??1,stdout:`${result.stdout.toString()}${result.stderr.toString()}`}}catch{return{exitCode:127,stdout:""}}}export function resolvePantryToolchain(options){const env=options.env??process.env,allowOverride=options.allowOverride!==!1,bin=allowOverride&&env.PANTRY_BIN?.trim()||"pantry",result=(options.probe??probeVersion)(bin),version=result.exitCode===0?parsePantryVersion(result.stdout):void 0;if(!version)return{ok:!1,bin,message:`Release aborted: could not run \`${bin} --version\`, so the Pantry that would regenerate pantry.lock is unknown. `+(allowOverride?"Install the declared Pantry, or set PANTRY_BIN to it, then re-run.":"Install the declared Pantry and put it first on PATH, then re-run.")};const declared=declaredPantryRange(options.cwd);if(declared&&!Bun.semver.satisfies(version,declared.range))return{ok:!1,bin,message:`Release aborted before any file changed: \`${bin}\` is Pantry ${version}, but ${declared.file} declares ts-pantry ${declared.range}. A different Pantry writes a different pantry.lock than the one CI validates. `+(allowOverride?"Set PANTRY_BIN to a Pantry that satisfies the declared range (or put one first on PATH), then re-run.":"Install a Pantry that satisfies the declared range and put it first on PATH, then re-run.")};return{ok:!0,bin,version,declared:declared?.range,declaredIn:declared?.file}}
1
+ import{existsSync,readFileSync}from"node:fs";import{join}from"node:path";export function parsePantryVersion(output){return/\bpantry\s+v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/i.exec(output)?.[1]}export function declaredPantryRange(cwd){for(const file of["storage/framework/core/buddy/package.json","package.json"]){const path=join(cwd,file);if(!existsSync(path))continue;try{const manifest=JSON.parse(readFileSync(path,"utf8")),range=manifest.dependencies?.["ts-pantry"]??manifest.devDependencies?.["ts-pantry"];if(range)return{range,file}}catch{}}return}export function declaredPantryWorkflowVersions(cwd){const versions=[];for(const file of[".github/workflows/ci.yml",".github/workflows/release.yml"]){const path=join(cwd,file);if(!existsSync(path))continue;const workflow=Bun.YAML.parse(readFileSync(path,"utf8"));for(const[job,config]of Object.entries(workflow.jobs??{}))for(const step of config.steps??[])if(step.uses?.startsWith("pantry-pm/pantry/packages/action@"))versions.push({file,job,version:String(step.with?.version??"")})}return versions}function probeVersion(bin){try{const result=Bun.spawnSync([bin,"--version"],{stdout:"pipe",stderr:"pipe"});return{exitCode:result.exitCode??1,stdout:`${result.stdout.toString()}${result.stderr.toString()}`}}catch{return{exitCode:127,stdout:""}}}export function resolvePantryToolchain(options){const env=options.env??process.env,allowOverride=options.allowOverride!==!1,bin=allowOverride&&env.PANTRY_BIN?.trim()||"pantry",result=(options.probe??probeVersion)(bin),version=result.exitCode===0?parsePantryVersion(result.stdout):void 0;if(!version)return{ok:!1,bin,message:`Release aborted: could not run \`${bin} --version\`, so the Pantry that would regenerate pantry.lock is unknown. `+(allowOverride?"Install the declared Pantry, or set PANTRY_BIN to it, then re-run.":"Install the declared Pantry and put it first on PATH, then re-run.")};const declared=declaredPantryRange(options.cwd);if(declared&&!Bun.semver.satisfies(version,declared.range))return{ok:!1,bin,message:`Release aborted before any file changed: \`${bin}\` is Pantry ${version}, but ${declared.file} declares ts-pantry ${declared.range}. A different Pantry writes a different pantry.lock than the one CI validates. `+(allowOverride?"Set PANTRY_BIN to a Pantry that satisfies the declared range (or put one first on PATH), then re-run.":"Install a Pantry that satisfies the declared range and put it first on PATH, then re-run.")};if(declared?.file==="storage/framework/core/buddy/package.json")try{const pins=declaredPantryWorkflowVersions(options.cwd),bootstrap="storage/framework/scripts/pantry-install",bootstrapPath=join(options.cwd,bootstrap);if(existsSync(bootstrapPath))pins.push({file:bootstrap,job:"bootstrap",version:readFileSync(bootstrapPath,"utf8").match(/PANTRY_VERSION:-([0-9.]+)/)?.[1]??""});const mismatches=pins.filter((pin)=>!/^\d+\.\d+\.\d+$/.test(pin.version)||!Bun.semver.satisfies(pin.version,declared.range));if(mismatches.length)return{ok:!1,bin,message:`Release aborted before any file changed: Pantry toolchain pins do not satisfy ts-pantry ${declared.range}: `+mismatches.map((pin)=>`${pin.file} (${pin.job}): ${pin.version||"missing version"}`).join("; ")+". Update the pinned Pantry action and CLI together before releasing."}}catch(error){return{ok:!1,bin,message:`Could not validate CI Pantry versions before release: ${error instanceof Error?error.message:String(error)}`}}return{ok:!0,bin,version,declared:declared?.range,declaredIn:declared?.file}}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.310",
5
+ "version": "0.75.315",
6
6
  "description": "The Stacks actions.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -66,54 +66,54 @@
66
66
  "prepublishOnly": "bun run build"
67
67
  },
68
68
  "dependencies": {
69
- "@stacksjs/action-runner": "0.75.310",
70
- "@stacksjs/ai": "0.75.310",
71
- "@stacksjs/analytics": "0.75.310",
72
- "@stacksjs/api": "0.75.310",
73
- "@stacksjs/auth": "0.75.310",
74
- "@stacksjs/build": "0.75.310",
69
+ "@stacksjs/action-runner": "0.75.315",
70
+ "@stacksjs/ai": "0.75.315",
71
+ "@stacksjs/analytics": "0.75.315",
72
+ "@stacksjs/api": "0.75.315",
73
+ "@stacksjs/auth": "0.75.315",
74
+ "@stacksjs/build": "0.75.315",
75
75
  "@stacksjs/bumpx": "^0.2.26",
76
76
  "@stacksjs/bunpress": "^0.2.15",
77
- "@stacksjs/cli": "0.75.310",
78
- "@stacksjs/cloud": "0.75.310",
79
- "@stacksjs/cms": "0.75.310",
77
+ "@stacksjs/cli": "0.75.315",
78
+ "@stacksjs/cloud": "0.75.315",
79
+ "@stacksjs/cms": "0.75.315",
80
80
  "@stacksjs/components": "0.2.691",
81
- "@stacksjs/config": "0.75.310",
82
- "@stacksjs/database": "0.75.310",
83
- "@stacksjs/desktop-build": "0.75.310",
84
- "@stacksjs/dns": "0.75.310",
85
- "@stacksjs/enums": "0.75.310",
86
- "@stacksjs/env": "0.75.310",
87
- "@stacksjs/error-handling": "0.75.310",
88
- "@stacksjs/github": "0.75.310",
81
+ "@stacksjs/config": "0.75.315",
82
+ "@stacksjs/database": "0.75.315",
83
+ "@stacksjs/desktop-build": "0.75.315",
84
+ "@stacksjs/dns": "0.75.315",
85
+ "@stacksjs/enums": "0.75.315",
86
+ "@stacksjs/env": "0.75.315",
87
+ "@stacksjs/error-handling": "0.75.315",
88
+ "@stacksjs/github": "0.75.315",
89
89
  "@stacksjs/gitit": "^0.2.5",
90
- "@stacksjs/i18n": "0.75.310",
91
- "@stacksjs/image": "0.75.310",
92
- "@stacksjs/logging": "0.75.310",
90
+ "@stacksjs/i18n": "0.75.315",
91
+ "@stacksjs/image": "0.75.315",
92
+ "@stacksjs/logging": "0.75.315",
93
93
  "@stacksjs/logsmith": "^0.2.11",
94
- "@stacksjs/mobile": "0.75.310",
95
- "@stacksjs/orm": "0.75.310",
96
- "@stacksjs/path": "0.75.310",
97
- "@stacksjs/payments": "0.75.310",
98
- "@stacksjs/queue": "0.75.310",
99
- "@stacksjs/registry": "0.75.310",
100
- "@stacksjs/router": "0.75.310",
94
+ "@stacksjs/mobile": "0.75.315",
95
+ "@stacksjs/orm": "0.75.315",
96
+ "@stacksjs/path": "0.75.315",
97
+ "@stacksjs/payments": "0.75.315",
98
+ "@stacksjs/queue": "0.75.315",
99
+ "@stacksjs/registry": "0.75.315",
100
+ "@stacksjs/router": "0.75.315",
101
101
  "@stacksjs/rpx": "^0.11.54",
102
- "@stacksjs/scheduler": "0.75.310",
103
- "@stacksjs/search-engine": "0.75.310",
104
- "@stacksjs/security": "0.75.310",
105
- "@stacksjs/server": "0.75.310",
106
- "@stacksjs/sites": "0.75.310",
107
- "@stacksjs/storage": "0.75.310",
108
- "@stacksjs/strings": "0.75.310",
102
+ "@stacksjs/scheduler": "0.75.315",
103
+ "@stacksjs/search-engine": "0.75.315",
104
+ "@stacksjs/security": "0.75.315",
105
+ "@stacksjs/server": "0.75.315",
106
+ "@stacksjs/sites": "0.75.315",
107
+ "@stacksjs/storage": "0.75.315",
108
+ "@stacksjs/strings": "0.75.315",
109
109
  "@stacksjs/stx": "0.2.691",
110
110
  "@stacksjs/tlsx": "^0.13.19",
111
111
  "@stacksjs/ts-cloud": "^0.16.69",
112
112
  "@stacksjs/ts-md": "^0.1.1",
113
- "@stacksjs/tunnel": "0.75.310",
114
- "@stacksjs/types": "0.75.310",
115
- "@stacksjs/utils": "0.75.310",
116
- "@stacksjs/whois": "0.75.310",
113
+ "@stacksjs/tunnel": "0.75.315",
114
+ "@stacksjs/types": "0.75.315",
115
+ "@stacksjs/utils": "0.75.315",
116
+ "@stacksjs/whois": "0.75.315",
117
117
  "bun-plugin-stx": "0.2.691"
118
118
  },
119
119
  "peerDependencies": {
@@ -129,7 +129,7 @@
129
129
  }
130
130
  },
131
131
  "devDependencies": {
132
- "@stacksjs/validation": "0.75.310",
132
+ "@stacksjs/validation": "0.75.315",
133
133
  "better-dx": "^0.2.24"
134
134
  }
135
135
  }