@stacksjs/actions 0.75.175 → 0.75.176
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.
|
@@ -21,6 +21,8 @@ export declare function pantryExecutable(projectRoot: string, env?: Env, exists?
|
|
|
21
21
|
export declare function missingToolMessage(pkg: string, constraint: string, program: string): string;
|
|
22
22
|
/** xcodegen from Pantry, or an {@link IosToolchainError} that says how to install it. */
|
|
23
23
|
export declare function resolveXcodegen(projectRoot: string, options?: { env?: Env, fs?: Filesystem }): Promise<PantryTool>;
|
|
24
|
+
/** The preset file xcodegen needs beside its binary, at `<prefix>/share/xcodegen`. */
|
|
25
|
+
export declare function xcodegenPresets(tool: PantryTool): string;
|
|
24
26
|
/*.xcodeproj` from its project.yml with the given xcodegen. */
|
|
25
27
|
export declare function generateXcodeProject(xcodegen: PantryTool, output: string): void;
|
|
26
28
|
/** The selected Xcode's developer directory, or null when there is none. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{existsSync,readdirSync}from"node:fs";import{homedir}from"node:os";import{join}from"node:path";import process from"node:process";import{pathToFileURL}from"node:url";export const XCODEGEN_PACKAGE="github.com/yonaskolb/XcodeGen",DEFAULT_IOS_DEPENDENCIES={[XCODEGEN_PACKAGE]:"^2.46.0"},XCODE_NOTE="Xcode itself does not come from Pantry: install it from the Mac App Store or developer.apple.com, then select it with `sudo xcode-select --switch /Applications/Xcode.app`.";export class IosToolchainError extends Error{name="IosToolchainError"}const realFilesystem={exists:existsSync,list:(path)=>{try{return readdirSync(path)}catch{return[]}}};export function pantryPackageRoots(projectRoot,env=process.env){const home=env.HOME||homedir(),data=env.XDG_DATA_HOME||join(home,".local","share");return[join(projectRoot,"pantry"),join(data,"pantry","global","packages"),"/usr/local/packages"]}export function findPantryProgram(pkg,constraint,program,roots,fs=realFilesystem){for(const root of roots){const versions=fs.list(join(root,pkg)).filter((entry)=>/^v\d+\.\d+\.\d+$/.test(entry)).map((entry)=>entry.slice(1)).filter((version)=>Bun.semver.satisfies(version,constraint)).sort((a,b)=>Bun.semver.order(b,a));for(const version of versions){const path=join(root,pkg,`v${version}`,"bin",program);if(fs.exists(path))return{pkg,constraint,version,path}}}return null}export async function loadIosDependencies(projectRoot){const depsPath=join(projectRoot,"config","deps.ts");if(!existsSync(depsPath))return{...DEFAULT_IOS_DEPENDENCIES};const deps=await import(pathToFileURL(depsPath).href);return{...DEFAULT_IOS_DEPENDENCIES,...deps.iosDependencies??{}}}export function pantryInstallArgs(dependencies){return["install","--user","--no-save",...Object.entries(dependencies).map(([pkg,constraint])=>`${pkg}@${constraint}`)]}export function pantryExecutable(projectRoot,env=process.env,exists=existsSync){const home=env.HOME||homedir(),data=env.XDG_DATA_HOME||join(home,".local","share");return[env.PANTRY_BIN,join(projectRoot,"pantry",".bin","pantry"),join(home,".local","bin","pantry"),join(data,"pantry","global","bin","pantry")].find((candidate)=>candidate&&exists(candidate))??"pantry"}export function missingToolMessage(pkg,constraint,program){return`${program} ${constraint} is not installed through Pantry, and the iOS build only runs the version config/deps.ts pins (\`iosDependencies\`, else the framework default). Run \`buddy setup:ios\`, or \`pantry install --user ${pkg}@${constraint}\`, then build again. `+XCODE_NOTE}export async function resolveXcodegen(projectRoot,options={}){const constraint=(await loadIosDependencies(projectRoot))[XCODEGEN_PACKAGE],tool=findPantryProgram(XCODEGEN_PACKAGE,constraint,"xcodegen",pantryPackageRoots(projectRoot,options.env),options.fs);if(!tool)throw new IosToolchainError(missingToolMessage(XCODEGEN_PACKAGE,constraint,"xcodegen"));return tool}export function generateXcodeProject(xcodegen,output){const result=Bun.spawnSync([xcodegen.path,"generate","--quiet"],{cwd:output,stdout:"pipe",stderr:"pipe"});if(result.exitCode!==0){const detail=`${result.stderr.toString()}${result.stdout.toString()}`.trim();throw new IosToolchainError(`xcodegen ${xcodegen.version} (${xcodegen.path}) could not generate the Xcode project in ${output}${detail?`:
|
|
1
|
+
import{existsSync,readdirSync}from"node:fs";import{homedir}from"node:os";import{dirname,join}from"node:path";import process from"node:process";import{pathToFileURL}from"node:url";export const XCODEGEN_PACKAGE="github.com/yonaskolb/XcodeGen",DEFAULT_IOS_DEPENDENCIES={[XCODEGEN_PACKAGE]:"^2.46.0"},XCODE_NOTE="Xcode itself does not come from Pantry: install it from the Mac App Store or developer.apple.com, then select it with `sudo xcode-select --switch /Applications/Xcode.app`.";export class IosToolchainError extends Error{name="IosToolchainError"}const realFilesystem={exists:existsSync,list:(path)=>{try{return readdirSync(path)}catch{return[]}}};export function pantryPackageRoots(projectRoot,env=process.env){const home=env.HOME||homedir(),data=env.XDG_DATA_HOME||join(home,".local","share");return[join(projectRoot,"pantry"),join(data,"pantry","global","packages"),"/usr/local/packages"]}export function findPantryProgram(pkg,constraint,program,roots,fs=realFilesystem){for(const root of roots){const versions=fs.list(join(root,pkg)).filter((entry)=>/^v\d+\.\d+\.\d+$/.test(entry)).map((entry)=>entry.slice(1)).filter((version)=>Bun.semver.satisfies(version,constraint)).sort((a,b)=>Bun.semver.order(b,a));for(const version of versions){const path=join(root,pkg,`v${version}`,"bin",program);if(fs.exists(path))return{pkg,constraint,version,path}}}return null}export async function loadIosDependencies(projectRoot){const depsPath=join(projectRoot,"config","deps.ts");if(!existsSync(depsPath))return{...DEFAULT_IOS_DEPENDENCIES};const deps=await import(pathToFileURL(depsPath).href);return{...DEFAULT_IOS_DEPENDENCIES,...deps.iosDependencies??{}}}export function pantryInstallArgs(dependencies){return["install","--user","--no-save",...Object.entries(dependencies).map(([pkg,constraint])=>`${pkg}@${constraint}`)]}export function pantryExecutable(projectRoot,env=process.env,exists=existsSync){const home=env.HOME||homedir(),data=env.XDG_DATA_HOME||join(home,".local","share");return[env.PANTRY_BIN,join(projectRoot,"pantry",".bin","pantry"),join(home,".local","bin","pantry"),join(data,"pantry","global","bin","pantry")].find((candidate)=>candidate&&exists(candidate))??"pantry"}export function missingToolMessage(pkg,constraint,program){return`${program} ${constraint} is not installed through Pantry, and the iOS build only runs the version config/deps.ts pins (\`iosDependencies\`, else the framework default). Run \`buddy setup:ios\`, or \`pantry install --user ${pkg}@${constraint}\`, then build again. `+XCODE_NOTE}export async function resolveXcodegen(projectRoot,options={}){const constraint=(await loadIosDependencies(projectRoot))[XCODEGEN_PACKAGE],tool=findPantryProgram(XCODEGEN_PACKAGE,constraint,"xcodegen",pantryPackageRoots(projectRoot,options.env),options.fs);if(!tool)throw new IosToolchainError(missingToolMessage(XCODEGEN_PACKAGE,constraint,"xcodegen"));const presets=xcodegenPresets(tool);if(!(options.fs??realFilesystem).exists(presets))throw new IosToolchainError(`xcodegen ${tool.version} at ${tool.path} has no setting presets (${presets}), so the project it generates would lose its base build settings. Reinstall it: \`pantry install --user --force ${XCODEGEN_PACKAGE}@${tool.version}\` (or \`buddy setup:ios\` after removing ${dirname(dirname(tool.path))}).`);return tool}export function xcodegenPresets(tool){return join(dirname(dirname(tool.path)),"share","xcodegen","SettingPresets","base.yml")}export function generateXcodeProject(xcodegen,output){const result=Bun.spawnSync([xcodegen.path,"generate","--quiet"],{cwd:output,stdout:"pipe",stderr:"pipe"});if(result.exitCode!==0){const detail=`${result.stderr.toString()}${result.stdout.toString()}`.trim();throw new IosToolchainError(`xcodegen ${xcodegen.version} (${xcodegen.path}) could not generate the Xcode project in ${output}${detail?`:
|
|
2
2
|
${detail}`:""}`)}}export function xcodeDeveloperDir(){try{const result=Bun.spawnSync(["xcode-select","--print-path"],{stdout:"pipe",stderr:"ignore"}),path=result.stdout.toString().trim();return result.exitCode===0&&path&&!path.includes("CommandLineTools")?path:null}catch{return null}}
|
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.
|
|
5
|
+
"version": "0.75.176",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -66,53 +66,53 @@
|
|
|
66
66
|
"prepublishOnly": "bun run build"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@stacksjs/action-runner": "0.75.
|
|
70
|
-
"@stacksjs/ai": "0.75.
|
|
71
|
-
"@stacksjs/analytics": "0.75.
|
|
72
|
-
"@stacksjs/api": "0.75.
|
|
73
|
-
"@stacksjs/auth": "0.75.
|
|
74
|
-
"@stacksjs/build": "0.75.
|
|
69
|
+
"@stacksjs/action-runner": "0.75.176",
|
|
70
|
+
"@stacksjs/ai": "0.75.176",
|
|
71
|
+
"@stacksjs/analytics": "0.75.176",
|
|
72
|
+
"@stacksjs/api": "0.75.176",
|
|
73
|
+
"@stacksjs/auth": "0.75.176",
|
|
74
|
+
"@stacksjs/build": "0.75.176",
|
|
75
75
|
"@stacksjs/bumpx": "^0.2.21",
|
|
76
76
|
"@stacksjs/bunpress": "^0.2.15",
|
|
77
|
-
"@stacksjs/cli": "0.75.
|
|
78
|
-
"@stacksjs/cloud": "0.75.
|
|
79
|
-
"@stacksjs/cms": "0.75.
|
|
77
|
+
"@stacksjs/cli": "0.75.176",
|
|
78
|
+
"@stacksjs/cloud": "0.75.176",
|
|
79
|
+
"@stacksjs/cms": "0.75.176",
|
|
80
80
|
"@stacksjs/components": "^0.2.483",
|
|
81
|
-
"@stacksjs/config": "0.75.
|
|
82
|
-
"@stacksjs/database": "0.75.
|
|
83
|
-
"@stacksjs/desktop-build": "0.75.
|
|
84
|
-
"@stacksjs/dns": "0.75.
|
|
85
|
-
"@stacksjs/enums": "0.75.
|
|
86
|
-
"@stacksjs/env": "0.75.
|
|
87
|
-
"@stacksjs/error-handling": "0.75.
|
|
81
|
+
"@stacksjs/config": "0.75.176",
|
|
82
|
+
"@stacksjs/database": "0.75.176",
|
|
83
|
+
"@stacksjs/desktop-build": "0.75.176",
|
|
84
|
+
"@stacksjs/dns": "0.75.176",
|
|
85
|
+
"@stacksjs/enums": "0.75.176",
|
|
86
|
+
"@stacksjs/env": "0.75.176",
|
|
87
|
+
"@stacksjs/error-handling": "0.75.176",
|
|
88
88
|
"@stacksjs/gitit": "^0.2.5",
|
|
89
|
-
"@stacksjs/i18n": "0.75.
|
|
90
|
-
"@stacksjs/image": "0.75.
|
|
91
|
-
"@stacksjs/logging": "0.75.
|
|
89
|
+
"@stacksjs/i18n": "0.75.176",
|
|
90
|
+
"@stacksjs/image": "0.75.176",
|
|
91
|
+
"@stacksjs/logging": "0.75.176",
|
|
92
92
|
"@stacksjs/logsmith": "^0.2.11",
|
|
93
|
-
"@stacksjs/mobile": "0.75.
|
|
94
|
-
"@stacksjs/orm": "0.75.
|
|
95
|
-
"@stacksjs/path": "0.75.
|
|
96
|
-
"@stacksjs/payments": "0.75.
|
|
97
|
-
"@stacksjs/queue": "0.75.
|
|
98
|
-
"@stacksjs/registry": "0.75.
|
|
99
|
-
"@stacksjs/router": "0.75.
|
|
93
|
+
"@stacksjs/mobile": "0.75.176",
|
|
94
|
+
"@stacksjs/orm": "0.75.176",
|
|
95
|
+
"@stacksjs/path": "0.75.176",
|
|
96
|
+
"@stacksjs/payments": "0.75.176",
|
|
97
|
+
"@stacksjs/queue": "0.75.176",
|
|
98
|
+
"@stacksjs/registry": "0.75.176",
|
|
99
|
+
"@stacksjs/router": "0.75.176",
|
|
100
100
|
"@stacksjs/rpx": "^0.11.54",
|
|
101
|
-
"@stacksjs/scheduler": "0.75.
|
|
102
|
-
"@stacksjs/search-engine": "0.75.
|
|
103
|
-
"@stacksjs/security": "0.75.
|
|
104
|
-
"@stacksjs/server": "0.75.
|
|
105
|
-
"@stacksjs/sites": "0.75.
|
|
106
|
-
"@stacksjs/storage": "0.75.
|
|
107
|
-
"@stacksjs/strings": "0.75.
|
|
101
|
+
"@stacksjs/scheduler": "0.75.176",
|
|
102
|
+
"@stacksjs/search-engine": "0.75.176",
|
|
103
|
+
"@stacksjs/security": "0.75.176",
|
|
104
|
+
"@stacksjs/server": "0.75.176",
|
|
105
|
+
"@stacksjs/sites": "0.75.176",
|
|
106
|
+
"@stacksjs/storage": "0.75.176",
|
|
107
|
+
"@stacksjs/strings": "0.75.176",
|
|
108
108
|
"@stacksjs/stx": "^0.2.483",
|
|
109
109
|
"@stacksjs/tlsx": "^0.13.19",
|
|
110
110
|
"@stacksjs/ts-cloud": "^0.16.52",
|
|
111
111
|
"@stacksjs/ts-md": "^0.1.1",
|
|
112
|
-
"@stacksjs/tunnel": "0.75.
|
|
113
|
-
"@stacksjs/types": "0.75.
|
|
114
|
-
"@stacksjs/utils": "0.75.
|
|
115
|
-
"@stacksjs/whois": "0.75.
|
|
112
|
+
"@stacksjs/tunnel": "0.75.176",
|
|
113
|
+
"@stacksjs/types": "0.75.176",
|
|
114
|
+
"@stacksjs/utils": "0.75.176",
|
|
115
|
+
"@stacksjs/whois": "0.75.176",
|
|
116
116
|
"bun-plugin-stx": "^0.2.483"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
|
-
"@stacksjs/validation": "0.75.
|
|
131
|
+
"@stacksjs/validation": "0.75.176",
|
|
132
132
|
"better-dx": "^0.2.24"
|
|
133
133
|
}
|
|
134
134
|
}
|