@stacksjs/desktop-build 0.75.650 → 0.75.653
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/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/package.json +10 -10
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* Stacks drifting back into checkout and node_modules probing.
|
|
7
7
|
*/
|
|
8
8
|
export declare function resolveCraftBinary(explicit?: string | undefined): string;
|
|
9
|
+
/** Pantry puts a short activation script on PATH ahead of the actual binary. */
|
|
10
|
+
export declare function isCraftActivationScript(executable: string): boolean;
|
|
9
11
|
export declare function resolveCraftExecutable(explicit?: string | undefined, findOnPath?: CraftBinaryLocator): string;
|
|
10
12
|
/**
|
|
11
13
|
* Whether this application supplies its own desktop launcher.
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{closeSync,existsSync,openSync,readSync,statSync}from"node:fs";import{dirname,join}from"node:path";import process from"node:process";import{fileURLToPath}from"node:url";import{craftBinaryNotFoundMessage,resolveCraftBinary as resolveCraftNativeBinary}from"craft-native";export*from"./agent";export*from"./agent-launcher";export*from"./invites";export*from"./updater";export*from"./update-signing";export*from"./update-feed";export*from"./update-install";export*from"./webview-agent";export*from"./webview-launcher";export*from"./webview-app";export*from"./craft-runtime";export*from"./webview-build-record";export*from"./support";export*from"./macos-app";export*from"./macos-bundle";export*from"./macos-release";export function resolveCraftBinary(explicit=process.env.CRAFT_BIN){return resolveCraftNativeBinary(explicit)}export function resolveCraftExecutable(explicit=process.env.CRAFT_BIN,findOnPath=(binary)=>Bun.which(binary)){const resolved=resolveCraftBinary(explicit);
|
|
1
|
+
import{closeSync,existsSync,openSync,readSync,statSync}from"node:fs";import{dirname,join}from"node:path";import process from"node:process";import{fileURLToPath}from"node:url";import{craftBinaryNotFoundMessage,resolveCraftBinary as resolveCraftNativeBinary}from"craft-native";export*from"./agent";export*from"./agent-launcher";export*from"./invites";export*from"./updater";export*from"./update-signing";export*from"./update-feed";export*from"./update-install";export*from"./webview-agent";export*from"./webview-launcher";export*from"./webview-app";export*from"./craft-runtime";export*from"./webview-build-record";export*from"./support";export*from"./macos-app";export*from"./macos-bundle";export*from"./macos-release";export function resolveCraftBinary(explicit=process.env.CRAFT_BIN){return resolveCraftNativeBinary(explicit)}export function isCraftActivationScript(executable){const fd=openSync(executable,"r");try{const prefix=Buffer.alloc(2);return readSync(fd,prefix,0,prefix.length,0)===2&&prefix.toString()==="#!"}finally{closeSync(fd)}}export function resolveCraftExecutable(explicit=process.env.CRAFT_BIN,findOnPath=(binary)=>Bun.which(binary)){const resolved=resolveCraftBinary(explicit);const executable=resolved==="craft"?findOnPath(resolved):resolved;if(!executable)throw new Error(craftBinaryNotFoundMessage(resolved));if(existsSync(executable)&&isCraftActivationScript(executable)){const pantry=Bun.which("pantry");if(pantry){const result=Bun.spawnSync([pantry,"which","--resolve",executable],{stdout:"pipe",stderr:"pipe"});const provider=result.stdout.toString().trim();if(result.exitCode===0&&existsSync(provider)&&!isCraftActivationScript(provider))return provider}}return executable}export const USERLAND_LAUNCHER="app/Desktop/launcher.ts";export function hasUserlandDesktopLauncher(projectRoot=process.cwd()){return existsSync(join(projectRoot,USERLAND_LAUNCHER))}export function desktopLauncherCompileArgs(options){return["build","--compile",...options.minify===false?[]:["--minify"],"--format=esm",...options.bytecode?["--bytecode"]:[],...options.runtimeExecutable?["--compile-executable-path",options.runtimeExecutable]:[],"--no-compile-autoload-bunfig","--no-compile-autoload-dotenv",options.entry,"--outfile",options.outfile]}export function resolveDesktopLauncher(projectRoot=process.cwd()){const userland=join(projectRoot,USERLAND_LAUNCHER);if(existsSync(userland))return userland;const here=dirname(fileURLToPath(import.meta.url));const candidates=[join(here,"launcher.ts"),join(here,"launcher.js")];const launcher=candidates.find((candidate)=>existsSync(candidate));if(!launcher){throw new Error("Desktop launcher entrypoint not found. Reinstall @stacksjs/desktop - the package must ship dist/launcher.js.")}return launcher}export const RESERVED_PLIST_KEYS=new Set(["CFBundleName","CFBundleDisplayName","CFBundleIdentifier","CFBundleVersion","CFBundleShortVersionString","CFBundleExecutable","CFBundlePackageType","CFBundleInfoDictionaryVersion","CFBundleIconFile"]);export function xmlEscape(value){return value.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}export function plistValue(value,indent=""){if(typeof value==="string")return`<string>${xmlEscape(value)}</string>`;if(typeof value==="boolean")return value?"<true/>":"<false/>";if(typeof value==="number"){if(!Number.isFinite(value))throw new Error(`Unsupported Info.plist number: ${value}`);return Number.isInteger(value)?`<integer>${value}</integer>`:`<real>${value}</real>`}if(Array.isArray(value)){if(value.length===0)return"<array/>";const items=value.map((item)=>`${indent} ${plistValue(item,`${indent} `)}`).join(`
|
|
2
2
|
`);return`<array>
|
|
3
3
|
${items}
|
|
4
4
|
${indent}</array>`}if(value&&typeof value==="object"){const entries=Object.entries(value);if(entries.length===0)return"<dict/>";const body=entries.map(([key,val])=>`${indent} <key>${xmlEscape(key)}</key>${plistValue(val,`${indent} `)}`).join(`
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/desktop-build",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.653",
|
|
6
6
|
"description": "Build and launch Craft desktop applications for Stacks",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -73,17 +73,17 @@
|
|
|
73
73
|
"prepublishOnly": "bun run build"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@stacksjs/config": "0.75.
|
|
77
|
-
"@stacksjs/router": "0.75.
|
|
78
|
-
"@stacksjs/server": "0.75.
|
|
79
|
-
"@stacksjs/storage": "0.75.
|
|
76
|
+
"@stacksjs/config": "0.75.653",
|
|
77
|
+
"@stacksjs/router": "0.75.653",
|
|
78
|
+
"@stacksjs/server": "0.75.653",
|
|
79
|
+
"@stacksjs/storage": "0.75.653",
|
|
80
80
|
"craft-native": ">=0.0.505"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"@stacksjs/config": "0.75.
|
|
84
|
-
"@stacksjs/router": "0.75.
|
|
85
|
-
"@stacksjs/server": "0.75.
|
|
86
|
-
"@stacksjs/storage": "0.75.
|
|
83
|
+
"@stacksjs/config": "0.75.653",
|
|
84
|
+
"@stacksjs/router": "0.75.653",
|
|
85
|
+
"@stacksjs/server": "0.75.653",
|
|
86
|
+
"@stacksjs/storage": "0.75.653"
|
|
87
87
|
},
|
|
88
88
|
"peerDependenciesMeta": {
|
|
89
89
|
"@stacksjs/config": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
|
-
"@stacksjs/build": "0.75.
|
|
103
|
+
"@stacksjs/build": "0.75.653",
|
|
104
104
|
"better-dx": "^0.2.39"
|
|
105
105
|
}
|
|
106
106
|
}
|