@stacksjs/desktop-build 0.75.597 → 0.75.598
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/agent-launcher.d.ts +1 -0
- package/dist/agent-launcher.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/macos-app.d.ts +50 -6
- package/dist/macos-app.js +2 -2
- package/dist/macos-bundle.d.ts +35 -2
- package/dist/macos-bundle.js +4 -3
- package/dist/macos-release.d.ts +37 -0
- package/dist/macos-release.js +1 -0
- package/dist/update-feed.d.ts +22 -3
- package/dist/update-feed.js +1 -1
- package/dist/update-signing.d.ts +11 -0
- package/dist/update-signing.js +1 -1
- package/dist/webview-app.js +1 -1
- package/package.json +11 -11
package/dist/agent-launcher.d.ts
CHANGED
package/dist/agent-launcher.js
CHANGED
|
@@ -19,6 +19,6 @@ process.exit(await runDesktopAgentApp({
|
|
|
19
19
|
manifest,
|
|
20
20
|
handler: () => stacksAgentHandler({ entry: ${entry}, appRoutes: manifest.appRoutes, routes: ${routes}, actions: ${actions} }),
|
|
21
21
|
}))
|
|
22
|
-
`}export async function runDesktopAgentApp(options){const{manifest}=options;const paths=options.paths??desktopAgentPaths(manifest.appName);const tag=`[${manifest.appName}]`;if(options.logWhenDetached!==false)logToFileWhenDetached(paths.logFile);if(!acquireInstanceLock(paths.lockFile)){console.log(`${tag} already running`);return 0}if(!existsSync(manifest.host)){console.error(`${tag} the AppKit host is missing: ${manifest.host}`);releaseInstanceLock(paths.lockFile);return 1}if(!existsSync(manifest.nativeBundle)){console.error(`${tag} the native screens are missing: ${manifest.nativeBundle}`);releaseInstanceLock(paths.lockFile);return 1}let agent;let handlerReady;try{if(manifest.projectRoot&&manifest.appRoutes)process.chdir(manifest.projectRoot);process.env[AGENT_DATA_DIR_ENV]=paths.dataDir;process.env[AGENT_RESOURCES_ENV]=JSON.stringify(manifest.resources??{});const ready=options.handler();handlerReady=ready;ready.catch(()=>{});agent=await startDesktopAgent({handler:async(request)=>(await ready)(request),name:manifest.appName,version:manifest.version,port:manifest.port,portFile:paths.portFile,staticDir:manifest.staticDir})}catch(error){console.error(`${tag} could not start: ${error instanceof Error?error.stack??error.message:String(error)}`);releaseInstanceLock(paths.lockFile);return 1}console.log(`${tag} ${manifest.version} serving on ${agent.url}`);const command=agentHostCommand(manifest,agent.url);const host=options.spawn?options.spawn(command):(()=>{const child=Bun.spawn(command,{stdio:["ignore","inherit","pipe"]});new Response(child.stderr).text().then((stderr)=>{const lines=stderr.split(`
|
|
22
|
+
`}export async function runDesktopAgentApp(options){const{manifest}=options;if((options.argv??process.argv.slice(2)).includes("--version")){if(!existsSync(manifest.host)){console.error(`[${manifest.appName}] the AppKit host is missing: ${manifest.host}`);return 1}return Bun.spawnSync([manifest.host,"--version"],{stdout:"inherit",stderr:"inherit"}).exitCode??1}const paths=options.paths??desktopAgentPaths(manifest.appName);const tag=`[${manifest.appName}]`;if(options.logWhenDetached!==false)logToFileWhenDetached(paths.logFile);if(!acquireInstanceLock(paths.lockFile)){console.log(`${tag} already running`);return 0}if(!existsSync(manifest.host)){console.error(`${tag} the AppKit host is missing: ${manifest.host}`);releaseInstanceLock(paths.lockFile);return 1}if(!existsSync(manifest.nativeBundle)){console.error(`${tag} the native screens are missing: ${manifest.nativeBundle}`);releaseInstanceLock(paths.lockFile);return 1}let agent;let handlerReady;try{if(manifest.projectRoot&&manifest.appRoutes)process.chdir(manifest.projectRoot);process.env[AGENT_DATA_DIR_ENV]=paths.dataDir;process.env[AGENT_RESOURCES_ENV]=JSON.stringify(manifest.resources??{});const ready=options.handler();handlerReady=ready;ready.catch(()=>{});agent=await startDesktopAgent({handler:async(request)=>(await ready)(request),name:manifest.appName,version:manifest.version,port:manifest.port,portFile:paths.portFile,staticDir:manifest.staticDir})}catch(error){console.error(`${tag} could not start: ${error instanceof Error?error.stack??error.message:String(error)}`);releaseInstanceLock(paths.lockFile);return 1}console.log(`${tag} ${manifest.version} serving on ${agent.url}`);const command=agentHostCommand(manifest,agent.url);const host=options.spawn?options.spawn(command):(()=>{const child=Bun.spawn(command,{stdio:["ignore","inherit","pipe"]});new Response(child.stderr).text().then((stderr)=>{const lines=stderr.split(`
|
|
23
23
|
`).filter((line)=>line.trim());if(lines.length)console.error(`[craft] ${lines.join(`
|
|
24
24
|
`)}`)});return{exited:child.exited,kill:()=>child.kill()}})();let stopped=false;const stop=()=>{if(stopped)return;stopped=true;host.kill();agent.stop();releaseInstanceLock(paths.lockFile)};const onSignal=()=>{stop();process.exit(0)};for(const signal of["SIGTERM","SIGINT","SIGHUP"])process.on(signal,onSignal);try{await handlerReady}catch(error){console.error(`${tag} could not start: ${error instanceof Error?error.stack??error.message:String(error)}`);for(const signal of["SIGTERM","SIGINT","SIGHUP"])process.off(signal,onSignal);stop();return 1}const code=await host.exited;console.log(`${tag} window closed (${code})`);for(const signal of["SIGTERM","SIGINT","SIGHUP"])process.off(signal,onSignal);stop();return 0}
|
package/dist/index.d.ts
CHANGED
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 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);if(resolved!=="craft")return resolved;const executable=findOnPath(resolved);if(!executable)throw new Error(craftBinaryNotFoundMessage(resolved));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"],...options.bytecode===false?[]:["--bytecode","--format=esm"],"--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(`
|
|
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);if(resolved!=="craft")return resolved;const executable=findOnPath(resolved);if(!executable)throw new Error(craftBinaryNotFoundMessage(resolved));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"],...options.bytecode===false?[]:["--bytecode","--format=esm"],"--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/dist/macos-app.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DesktopConfig, MacosAgentConfig, MacosDesktopConfig } from '@stacksjs/types';
|
|
1
|
+
import type { DesktopConfig, DesktopUpdatesConfig, MacosAgentConfig, MacosDesktopConfig } from '@stacksjs/types';
|
|
2
2
|
/** `config/desktop.ts` of a project, or null when it has none or no `macos` section. */
|
|
3
3
|
export declare function loadDesktopConfig(root: string): Promise<DesktopConfig | null>;
|
|
4
4
|
/** Whether the project declares a native macOS app. */
|
|
@@ -7,10 +7,24 @@ export declare function loadMacosDesktop(root: string, packageVersion?: string):
|
|
|
7
7
|
export declare function resolveMacosDesktop(config: MacosDesktopConfig, packageVersion?: string): ResolvedMacosDesktop;
|
|
8
8
|
/** Why a config cannot build, as a list; empty when it can. */
|
|
9
9
|
export declare function validateMacosDesktop(config: ResolvedMacosDesktop): string[];
|
|
10
|
+
export declare function macosHostUpdates(updates: DesktopUpdatesConfig): MacosHostUpdates;
|
|
11
|
+
/**
|
|
12
|
+
* Whether a build of this distribution updates itself: it has `macos.updates`
|
|
13
|
+
* and it is not for the Mac App Store. The Store replaces its own apps, and
|
|
14
|
+
* App Review rejects one that downloads and installs code, so a Store build
|
|
15
|
+
* carries neither the `updates` settings nor the updater in its host.
|
|
16
|
+
*/
|
|
17
|
+
export declare function macosSelfUpdates(config: Pick<MacosDesktopConfig, 'updates'>, distribution: MacosDistribution | undefined): boolean;
|
|
10
18
|
/** Screen name to its `.stx` source, relative to the project root. */
|
|
11
19
|
export declare function macosScreens(config: Pick<MacosDesktopConfig, 'nativeScreens' | 'nativeScreensDir'>): Record<string, string>;
|
|
12
|
-
/**
|
|
13
|
-
|
|
20
|
+
/**
|
|
21
|
+
* What the host reads from `Contents/Resources/craft-app.json` when Finder
|
|
22
|
+
* launches it with no arguments. `updates` is written for a development or
|
|
23
|
+
* Developer ID build and for no other: with no distribution named there is
|
|
24
|
+
* none, so a caller cannot put the updater's settings in a Store app by
|
|
25
|
+
* leaving an argument out.
|
|
26
|
+
*/
|
|
27
|
+
export declare function renderHostConfig(config: ResolvedMacosDesktop, distribution?: MacosDistribution): string;
|
|
14
28
|
/** The host's command line, for a bare executable run during development. */
|
|
15
29
|
export declare function hostArguments(config: ResolvedMacosDesktop, nativeBundle: string): string[];
|
|
16
30
|
/**
|
|
@@ -29,7 +43,12 @@ export declare function renderMacosInfoPlist(config: ResolvedMacosDesktop, optio
|
|
|
29
43
|
* the Mac App Store requires of an app that only talks to a server; the
|
|
30
44
|
* application identifier and keychain access group are what let the app keep
|
|
31
45
|
* its sign-in in the data-protection Keychain, and need a team. A development
|
|
32
|
-
* build carries neither (it is signed ad hoc, which cannot hold them)
|
|
46
|
+
* build carries neither (it is signed ad hoc, which cannot hold them), and
|
|
47
|
+
* nor does a Developer ID build: those entitlements are restricted, and
|
|
48
|
+
* outside the Store they need a provisioning profile a downloaded app has none of.
|
|
49
|
+
*
|
|
50
|
+
* A Developer ID build is not sandboxed, whatever `macos.sandbox` says: see
|
|
51
|
+
* `MacosDistribution`.
|
|
33
52
|
*
|
|
34
53
|
* `permissions` adds a device entitlement for each device the app asks for,
|
|
35
54
|
* sandboxed or not: the hardened runtime refuses the camera, microphone and
|
|
@@ -48,7 +67,7 @@ export declare function renderMacosEntitlements(config: ResolvedMacosDesktop, di
|
|
|
48
67
|
* permissions); unsandboxed, it needs its own device entitlements, because
|
|
49
68
|
* the host is the process whose web views use the camera and microphone.
|
|
50
69
|
*/
|
|
51
|
-
export declare function renderMacosHostEntitlements(config: ResolvedMacosDesktop): string;
|
|
70
|
+
export declare function renderMacosHostEntitlements(config: ResolvedMacosDesktop, distribution?: MacosDistribution): string;
|
|
52
71
|
/** `PrivacyInfo.xcprivacy`: what the app collects and which required-reason APIs it uses. */
|
|
53
72
|
export declare function renderPrivacyManifest(config: Pick<ResolvedMacosDesktop, 'privacy'>): string;
|
|
54
73
|
/** Where the build writes a project's app, relative to the project root unless absolute. */
|
|
@@ -90,7 +109,32 @@ export declare interface ResolvedMacosDesktop extends Omit<MacosDesktopConfig, '
|
|
|
90
109
|
sandbox: boolean
|
|
91
110
|
executable: string
|
|
92
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* What the AppKit host reads as `updates` in `craft-app.json`: only what an
|
|
114
|
+
* installed app needs to ask and to verify. Where a release is stored (`disk`,
|
|
115
|
+
* `prefix`, `artifactBaseUrl`) stays on the releaser's side. The channel and
|
|
116
|
+
* the interval are written out in full, so the host needs no defaults of its own.
|
|
117
|
+
*/
|
|
118
|
+
export declare interface MacosHostUpdates {
|
|
119
|
+
feedUrl: string
|
|
120
|
+
publicKeys: Record<string, string>
|
|
121
|
+
channel: string
|
|
122
|
+
checkEveryHours: number
|
|
123
|
+
}
|
|
93
124
|
export declare interface MacosInfoPlistOptions {
|
|
94
125
|
iconFile?: string
|
|
95
126
|
}
|
|
96
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Who a build is for.
|
|
129
|
+
*
|
|
130
|
+
* - `development`: this Mac. Signed with an Apple Development identity when
|
|
131
|
+
* there is one, else ad hoc.
|
|
132
|
+
* - `developer-id`: people who download it from you (`buddy release:desktop`,
|
|
133
|
+
* `buddy build:dmg` with an identity). Signed with a Developer ID
|
|
134
|
+
* Application certificate under the hardened runtime, notarized, and never
|
|
135
|
+
* sandboxed: an app that updates itself replaces its own bundle, which the
|
|
136
|
+
* App Sandbox does not allow. It carries none of the Store's entitlements.
|
|
137
|
+
* - `app-store`: the Mac App Store (`buddy desktop:apple:package`). Sandboxed,
|
|
138
|
+
* with the application identifier and Keychain group, and no updater.
|
|
139
|
+
*/
|
|
140
|
+
export type MacosDistribution = 'development' | 'developer-id' | 'app-store';
|
package/dist/macos-app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{existsSync}from"node:fs";import{join,resolve}from"node:path";import{pathToFileURL}from"node:url";import{plistValue,renderUserlandPlistEntries,xmlEscape}from"./index";export const MACOS_DEFAULTS={minimumSystemVersion:"13.0",category:"public.app-category.productivity",nativeScreensDir:"resources/native",initialScreen:"Main",window:{width:1180,height:760,minWidth:820,minHeight:520}};export const RESERVED_RESOURCES=new Set(["web","native-screen.js","craft-app.json","desktop-agent.json","PrivacyInfo.xcprivacy","AppIcon.icns"]);export async function loadDesktopConfig(root){const file=join(root,"config/desktop.ts");if(!existsSync(file))return null;const module=await import(`${pathToFileURL(file).href}?t=${Date.now()}`);return module.default??null}export async function hasMacosDesktop(root){return Boolean((await loadDesktopConfig(root))?.macos)}export async function loadMacosDesktop(root,packageVersion="0.0.0"){const config=await loadDesktopConfig(root);return config?.macos?resolveMacosDesktop(config.macos,packageVersion):null}export function resolveMacosDesktop(config,packageVersion="0.0.0"){const version=config.version??packageVersion;const agent=config.agent?config.agent===true?{}:{...config.agent}:null;return{...config,agent,url:agent?"http://127.0.0.1":config.url??"",version,buildNumber:config.buildNumber??version.split(/[-+]/)[0],minimumSystemVersion:config.minimumSystemVersion??MACOS_DEFAULTS.minimumSystemVersion,category:config.category??MACOS_DEFAULTS.category,nativeScreensDir:config.nativeScreensDir??MACOS_DEFAULTS.nativeScreensDir,initialScreen:config.initialScreen??(Array.isArray(config.nativeScreens)?config.nativeScreens.includes("Main")?"Main":config.nativeScreens[0]:Object.keys(config.nativeScreens).includes("Main")?"Main":Object.keys(config.nativeScreens)[0])??MACOS_DEFAULTS.initialScreen,sandbox:config.sandbox!==false,executable:config.appName}}export function validateMacosDesktop(config){const errors=[];if(!config.appName?.trim())errors.push("macos.appName is required");if(!/^[A-Za-z0-9][A-Za-z0-9.-]*\.[A-Za-z0-9.-]+$/.test(config.bundleId??""))errors.push("macos.bundleId must be a reverse-DNS identifier such as com.example.app");if(config.teamId!==undefined&&!/^[A-Z0-9]{10}$/.test(config.teamId))errors.push("macos.teamId must be the 10-character Apple Developer team ID");if(!/^\d+(?:\.\d+){0,2}$/.test(config.version))errors.push(`macos.version must be one to three numeric components, not "${config.version}"`);if(!/^[A-Za-z0-9.-]+$/.test(config.buildNumber))errors.push("macos.buildNumber must contain only letters, numbers, periods and hyphens");if(!/^\d+(?:\.\d+){0,2}$/.test(config.minimumSystemVersion))errors.push("macos.minimumSystemVersion must be a macOS version such as 13.0");if(!/^public\.app-category\.[a-z][a-z0-9-]*$/.test(config.category))errors.push("macos.category must be an LSApplicationCategoryType such as public.app-category.productivity");if(!config.agent){try{const url=new URL(config.url);if(!["http:","https:"].includes(url.protocol))errors.push("macos.url must be an http(s) origin")}catch{errors.push("macos.url must be the server origin the app talks to, e.g. https://example.com, or turn on macos.agent to run the API inside the app")}}else{if(config.agent.port!==undefined&&!(Number.isInteger(config.agent.port)&&config.agent.port>1024&&config.agent.port<65536))errors.push("macos.agent.port must be a port above 1024");for(const[name,path]of Object.entries(config.agent.resources??{})){if(!/^[\w-][\w.-]*$/.test(name)||RESERVED_RESOURCES.has(name))errors.push(`macos.agent.resources: "${name}" must be a plain file name (letters, digits, . _ -) other than ${[...RESERVED_RESOURCES].join(", ")}`);if(typeof path!=="string"||!path.trim())errors.push(`macos.agent.resources.${name} must be a path in the project`)}}const lights=config.window?.trafficLights;if(lights!==undefined&&!(Array.isArray(lights)&&lights.length===2&&lights.every((value)=>Number.isFinite(value)&&value>=0)))errors.push("macos.window.trafficLights must be [x, y], two points from the window's top-left");for(const[index,item]of(config.dockMenu??[]).entries()){if(!item?.title?.trim())errors.push(`macos.dockMenu[${index}] needs a title`);if(!item?.action?.trim())errors.push(`macos.dockMenu[${index}] needs an action`)}const names=Object.keys(macosScreens(config));if(!names.length)errors.push("macos.nativeScreens must name at least one screen");if(names.length&&!names.includes(config.initialScreen))errors.push(`macos.initialScreen "${config.initialScreen}" is not one of the native screens (${names.join(", ")})`);for(const scheme of config.urlSchemes??[])if(!/^[a-z][a-z0-9+.-]*$/.test(scheme))errors.push(`macos.urlSchemes: "${scheme}" is not a valid URL scheme`);return errors}export function macosScreens(config){const dir=config.nativeScreensDir??MACOS_DEFAULTS.nativeScreensDir;if(Array.isArray(config.nativeScreens))return Object.fromEntries(config.nativeScreens.map((name)=>[name,`${dir}/${name}.stx`]));return{...config.nativeScreens}}export function renderHostConfig(config){const window={...MACOS_DEFAULTS.window,...config.window};return`${JSON.stringify({...config.agent?{}:{apiUrl:config.url.replace(/\/+$/,"")},title:config.appName,route:config.initialScreen,session:Boolean(config.agent),titlebarStyle:window.titlebarStyle??"standard",width:window.width,height:window.height,minWidth:window.minWidth,minHeight:window.minHeight,...window.trafficLights?{trafficLights:window.trafficLights}:{},...config.webkit?{webkit:true}:{},...config.dockMenu?.length?{dockMenu:config.dockMenu.map((item)=>({title:item.title,action:item.action}))}:{}},null,2)}
|
|
1
|
+
import{existsSync}from"node:fs";import{join,resolve}from"node:path";import{pathToFileURL}from"node:url";import{plistValue,renderUserlandPlistEntries,xmlEscape}from"./index";import{desktopUpdatesProblems}from"./update-signing";export const MACOS_DEFAULTS={minimumSystemVersion:"13.0",category:"public.app-category.productivity",nativeScreensDir:"resources/native",initialScreen:"Main",window:{width:1180,height:760,minWidth:820,minHeight:520}};export const RESERVED_RESOURCES=new Set(["web","native-screen.js","craft-app.json","desktop-agent.json","PrivacyInfo.xcprivacy","AppIcon.icns"]);export async function loadDesktopConfig(root){const file=join(root,"config/desktop.ts");if(!existsSync(file))return null;const module=await import(`${pathToFileURL(file).href}?t=${Date.now()}`);return module.default??null}export async function hasMacosDesktop(root){return Boolean((await loadDesktopConfig(root))?.macos)}export async function loadMacosDesktop(root,packageVersion="0.0.0"){const config=await loadDesktopConfig(root);return config?.macos?resolveMacosDesktop(config.macos,packageVersion):null}export function resolveMacosDesktop(config,packageVersion="0.0.0"){const version=config.version??packageVersion;const agent=config.agent?config.agent===true?{}:{...config.agent}:null;return{...config,agent,url:agent?"http://127.0.0.1":config.url??"",version,buildNumber:config.buildNumber??version.split(/[-+]/)[0],minimumSystemVersion:config.minimumSystemVersion??MACOS_DEFAULTS.minimumSystemVersion,category:config.category??MACOS_DEFAULTS.category,nativeScreensDir:config.nativeScreensDir??MACOS_DEFAULTS.nativeScreensDir,initialScreen:config.initialScreen??(Array.isArray(config.nativeScreens)?config.nativeScreens.includes("Main")?"Main":config.nativeScreens[0]:Object.keys(config.nativeScreens).includes("Main")?"Main":Object.keys(config.nativeScreens)[0])??MACOS_DEFAULTS.initialScreen,sandbox:config.sandbox!==false,executable:config.appName}}export function validateMacosDesktop(config){const errors=[];if(!config.appName?.trim())errors.push("macos.appName is required");if(!/^[A-Za-z0-9][A-Za-z0-9.-]*\.[A-Za-z0-9.-]+$/.test(config.bundleId??""))errors.push("macos.bundleId must be a reverse-DNS identifier such as com.example.app");if(config.teamId!==undefined&&!/^[A-Z0-9]{10}$/.test(config.teamId))errors.push("macos.teamId must be the 10-character Apple Developer team ID");if(!/^\d+(?:\.\d+){0,2}$/.test(config.version))errors.push(`macos.version must be one to three numeric components, not "${config.version}"`);if(!/^[A-Za-z0-9.-]+$/.test(config.buildNumber))errors.push("macos.buildNumber must contain only letters, numbers, periods and hyphens");if(!/^\d+(?:\.\d+){0,2}$/.test(config.minimumSystemVersion))errors.push("macos.minimumSystemVersion must be a macOS version such as 13.0");if(!/^public\.app-category\.[a-z][a-z0-9-]*$/.test(config.category))errors.push("macos.category must be an LSApplicationCategoryType such as public.app-category.productivity");if(!config.agent){try{const url=new URL(config.url);if(!["http:","https:"].includes(url.protocol))errors.push("macos.url must be an http(s) origin")}catch{errors.push("macos.url must be the server origin the app talks to, e.g. https://example.com, or turn on macos.agent to run the API inside the app")}}else{if(config.agent.port!==undefined&&!(Number.isInteger(config.agent.port)&&config.agent.port>1024&&config.agent.port<65536))errors.push("macos.agent.port must be a port above 1024");for(const[name,path]of Object.entries(config.agent.resources??{})){if(!/^[\w-][\w.-]*$/.test(name)||RESERVED_RESOURCES.has(name))errors.push(`macos.agent.resources: "${name}" must be a plain file name (letters, digits, . _ -) other than ${[...RESERVED_RESOURCES].join(", ")}`);if(typeof path!=="string"||!path.trim())errors.push(`macos.agent.resources.${name} must be a path in the project`)}}const lights=config.window?.trafficLights;if(lights!==undefined&&!(Array.isArray(lights)&&lights.length===2&&lights.every((value)=>Number.isFinite(value)&&value>=0)))errors.push("macos.window.trafficLights must be [x, y], two points from the window's top-left");for(const[index,item]of(config.dockMenu??[]).entries()){if(!item?.title?.trim())errors.push(`macos.dockMenu[${index}] needs a title`);if(!item?.action?.trim())errors.push(`macos.dockMenu[${index}] needs an action`)}const names=Object.keys(macosScreens(config));if(!names.length)errors.push("macos.nativeScreens must name at least one screen");if(names.length&&!names.includes(config.initialScreen))errors.push(`macos.initialScreen "${config.initialScreen}" is not one of the native screens (${names.join(", ")})`);for(const scheme of config.urlSchemes??[])if(!/^[a-z][a-z0-9+.-]*$/.test(scheme))errors.push(`macos.urlSchemes: "${scheme}" is not a valid URL scheme`);if(config.updates){errors.push(...desktopUpdatesProblems(config.updates,"macos.updates",{decodeKeys:true}));if(!/^\d+\.\d+\.\d+$/.test(config.version))errors.push(`macos.version must be major.minor.patch (1.4.0) when macos.updates is set, not "${config.version}": the app compares versions to know an update is newer`)}return errors}export function macosHostUpdates(updates){return{feedUrl:updates.feedUrl.replace(/\/+$/,""),publicKeys:{...updates.publicKeys},channel:updates.channel||"stable",checkEveryHours:updates.checkEveryHours??24}}export function macosSelfUpdates(config,distribution){return Boolean(config.updates)&&(distribution==="development"||distribution==="developer-id")}export function macosScreens(config){const dir=config.nativeScreensDir??MACOS_DEFAULTS.nativeScreensDir;if(Array.isArray(config.nativeScreens))return Object.fromEntries(config.nativeScreens.map((name)=>[name,`${dir}/${name}.stx`]));return{...config.nativeScreens}}export function renderHostConfig(config,distribution){const window={...MACOS_DEFAULTS.window,...config.window};return`${JSON.stringify({...config.agent?{}:{apiUrl:config.url.replace(/\/+$/,"")},title:config.appName,route:config.initialScreen,session:Boolean(config.agent),titlebarStyle:window.titlebarStyle??"standard",width:window.width,height:window.height,minWidth:window.minWidth,minHeight:window.minHeight,...window.trafficLights?{trafficLights:window.trafficLights}:{},...config.webkit?{webkit:true}:{},...config.dockMenu?.length?{dockMenu:config.dockMenu.map((item)=>({title:item.title,action:item.action}))}:{},...config.updates&&macosSelfUpdates(config,distribution)?{updates:macosHostUpdates(config.updates)}:{}},null,2)}
|
|
2
2
|
`}export function hostArguments(config,nativeBundle){return["--api-url",config.url.replace(/\/+$/,""),"--native-bundle",nativeBundle,...windowArguments(config),"--no-session"]}export function agentHostArguments(config){return windowArguments(config)}function windowArguments(config){const window={...MACOS_DEFAULTS.window,...config.window};return["--title",config.appName,"--route",config.initialScreen,"--titlebar-style",window.titlebarStyle??"standard","--width",String(window.width),"--height",String(window.height),"--min-width",String(window.minWidth),"--min-height",String(window.minHeight),...window.trafficLights?["--traffic-lights",window.trafficLights.join(",")]:[]]}const OWNED_KEYS=["CFBundleIdentifier","CFBundleExecutable","CFBundleName","CFBundleDisplayName","CFBundleShortVersionString","CFBundleVersion","CFBundlePackageType","LSApplicationCategoryType","LSMinimumSystemVersion","CFBundleIconFile","CFBundleURLTypes"];export const BROWSER_DOCUMENT_TYPES=[{name:"HTML document",types:["public.html"]},{name:"XHTML document",types:["public.xhtml"]},{name:"Web archive",types:["com.apple.webarchive"]},{name:"PDF document",types:["com.adobe.pdf"]}];export function defaultUsageDescriptions(appName){return{camera:`${appName} uses the camera when you allow a page or feature to.`,microphone:`${appName} uses the microphone when you allow a page or feature to.`,location:`${appName} uses your location when you allow a page or feature to.`}}export function permissionUsageDescriptions(config){const permissions=config.permissions??{};const defaults=defaultUsageDescriptions(config.appName);const sentence=(value,fallback)=>typeof value==="string"&&value.trim()?value:value?fallback:undefined;const usage={};const camera=sentence(permissions.camera,defaults.camera);if(camera)usage.NSCameraUsageDescription=camera;const microphone=sentence(permissions.microphone,defaults.microphone);if(microphone)usage.NSMicrophoneUsageDescription=microphone;const location=sentence(permissions.location,defaults.location);if(location){usage.NSLocationUsageDescription=location;usage.NSLocationWhenInUseUsageDescription=location}return usage}export function renderMacosInfoPlist(config,options={}){const owns=config.defaultBrowser?[...OWNED_KEYS,"CFBundleDocumentTypes"]:OWNED_KEYS;const declared={...permissionUsageDescriptions(config),...config.usageDescriptions,...config.infoPlist};if(config.defaultBrowser&&declared.NSAppTransportSecurity===undefined)declared.NSAppTransportSecurity={NSAllowsArbitraryLoadsInWebContent:true};const{xml:extra,ignored}=renderUserlandPlistEntries(Object.fromEntries(Object.entries(declared).filter(([key])=>!owns.includes(key))));const owned=Object.keys(declared).filter((key)=>owns.includes(key));const urlTypes=[];if(config.urlSchemes?.length)urlTypes.push({CFBundleURLName:config.bundleId,CFBundleURLSchemes:config.urlSchemes});if(config.defaultBrowser)urlTypes.push({CFBundleURLName:"Web site URL",CFBundleTypeRole:"Viewer",CFBundleURLSchemes:["http","https"]});const schemes=urlTypes.length?` <key>CFBundleURLTypes</key>${plistValue(urlTypes," ")}
|
|
3
3
|
`:"";const documents=config.defaultBrowser?` <key>CFBundleDocumentTypes</key>${plistValue(BROWSER_DOCUMENT_TYPES.map((type)=>({CFBundleTypeName:type.name,CFBundleTypeRole:"Viewer",LSHandlerRank:"Default",LSItemContentTypes:type.types}))," ")}
|
|
4
4
|
`:"";const icon=options.iconFile?` <key>CFBundleIconFile</key><string>${xmlEscape(options.iconFile)}</string>
|
|
@@ -22,7 +22,7 @@ import{existsSync}from"node:fs";import{join,resolve}from"node:path";import{pathT
|
|
|
22
22
|
<key>ITSAppUsesNonExemptEncryption</key><false/>
|
|
23
23
|
${icon}${schemes}${documents}${extra}</dict>
|
|
24
24
|
</plist>
|
|
25
|
-
`;return{xml,ignored:[...ignored,...owned]}}export function renderMacosEntitlements(config,distribution){const entitlements={};const permissions=config.permissions??{};if(config.sandbox){entitlements["com.apple.security.app-sandbox"]=true;if(permissions.network!==false)entitlements["com.apple.security.network.client"]=true;if(config.agent)entitlements["com.apple.security.network.server"]=true;if(permissions.downloads)entitlements[permissions.downloads==="read-only"?"com.apple.security.files.downloads.read-only":"com.apple.security.files.downloads.read-write"]=true;if(permissions.printing)entitlements["com.apple.security.print"]=true}if(permissions.camera)entitlements["com.apple.security.device.camera"]=true;if(permissions.microphone)entitlements["com.apple.security.device.audio-input"]=true;if(permissions.location)entitlements["com.apple.security.personal-information.location"]=true;if(config.agent){entitlements["com.apple.security.cs.allow-jit"]=true;entitlements["com.apple.security.cs.allow-unsigned-executable-memory"]=true;entitlements["com.apple.security.cs.disable-library-validation"]=true}if(distribution==="app-store"){if(!config.teamId)throw new Error("macos.teamId is required to sign for the Mac App Store");entitlements["com.apple.application-identifier"]=`${config.teamId}.${config.bundleId}`;entitlements["com.apple.developer.team-identifier"]=config.teamId;entitlements["keychain-access-groups"]=[`${config.teamId}.${config.bundleId}`]}Object.assign(entitlements,config.entitlements);return renderEntitlementsPlist(entitlements)}export function renderMacosHostEntitlements(config){if(config.sandbox)return renderEntitlementsPlist({"com.apple.security.app-sandbox":true,"com.apple.security.inherit":true});const permissions=config.permissions??{};const entitlements={};if(permissions.camera)entitlements["com.apple.security.device.camera"]=true;if(permissions.microphone)entitlements["com.apple.security.device.audio-input"]=true;if(permissions.location)entitlements["com.apple.security.personal-information.location"]=true;return renderEntitlementsPlist(entitlements)}function renderEntitlementsPlist(entitlements){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
25
|
+
`;return{xml,ignored:[...ignored,...owned]}}export function renderMacosEntitlements(config,distribution){const entitlements={};const permissions=config.permissions??{};if(config.sandbox&&distribution!=="developer-id"){entitlements["com.apple.security.app-sandbox"]=true;if(permissions.network!==false)entitlements["com.apple.security.network.client"]=true;if(config.agent)entitlements["com.apple.security.network.server"]=true;if(permissions.downloads)entitlements[permissions.downloads==="read-only"?"com.apple.security.files.downloads.read-only":"com.apple.security.files.downloads.read-write"]=true;if(permissions.printing)entitlements["com.apple.security.print"]=true}if(permissions.camera)entitlements["com.apple.security.device.camera"]=true;if(permissions.microphone)entitlements["com.apple.security.device.audio-input"]=true;if(permissions.location)entitlements["com.apple.security.personal-information.location"]=true;if(config.agent){entitlements["com.apple.security.cs.allow-jit"]=true;entitlements["com.apple.security.cs.allow-unsigned-executable-memory"]=true;entitlements["com.apple.security.cs.disable-library-validation"]=true}if(distribution==="app-store"){if(!config.teamId)throw new Error("macos.teamId is required to sign for the Mac App Store");entitlements["com.apple.application-identifier"]=`${config.teamId}.${config.bundleId}`;entitlements["com.apple.developer.team-identifier"]=config.teamId;entitlements["keychain-access-groups"]=[`${config.teamId}.${config.bundleId}`]}Object.assign(entitlements,config.entitlements);return renderEntitlementsPlist(entitlements)}export function renderMacosHostEntitlements(config,distribution){if(config.sandbox&&distribution!=="developer-id")return renderEntitlementsPlist({"com.apple.security.app-sandbox":true,"com.apple.security.inherit":true});const permissions=config.permissions??{};const entitlements={};if(permissions.camera)entitlements["com.apple.security.device.camera"]=true;if(permissions.microphone)entitlements["com.apple.security.device.audio-input"]=true;if(permissions.location)entitlements["com.apple.security.personal-information.location"]=true;return renderEntitlementsPlist(entitlements)}function renderEntitlementsPlist(entitlements){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
26
26
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
27
27
|
<plist version="1.0">
|
|
28
28
|
${plistValue(entitlements)}
|
package/dist/macos-bundle.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export declare function makeIcns(png: string, output: string, scratch: string, r
|
|
|
5
5
|
/**
|
|
6
6
|
* Lay out and sign the `.app`: the host as the executable, the compiled
|
|
7
7
|
* screens and host settings in Resources, then `codesign` with the entitlements
|
|
8
|
-
* for the chosen distribution. The same function builds the development app
|
|
9
|
-
* the Mac App Store app, so what runs locally is what ships.
|
|
8
|
+
* for the chosen distribution. The same function builds the development app,
|
|
9
|
+
* the Developer ID app and the Mac App Store app, so what runs locally is what ships.
|
|
10
10
|
*/
|
|
11
11
|
export declare function assembleMacosApp(options: AssembleMacosAppOptions): AssembledMacosApp;
|
|
12
12
|
/**
|
|
@@ -14,6 +14,16 @@ export declare function assembleMacosApp(options: AssembleMacosAppOptions): Asse
|
|
|
14
14
|
* output, by its hash (a name can be shared by two certificates).
|
|
15
15
|
*/
|
|
16
16
|
export declare function parseDevelopmentIdentity(output: string): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* The first "Developer ID Application" identity in `security find-identity -v
|
|
19
|
+
* -p codesigning` output, by its hash: what a `developer-id` build is signed
|
|
20
|
+
* with when it was not told which.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseDeveloperIdIdentity(output: string): string | undefined;
|
|
23
|
+
export declare function findDeveloperIdIdentity(read?: () => string): string | undefined;
|
|
24
|
+
export declare function macosBuildRecordFile(output: string, appName: string): string;
|
|
25
|
+
/** The record of the last build, or null when there is none or it predates the fields a release needs. */
|
|
26
|
+
export declare function readMacosBuildRecord(output: string, appName: string): MacosBuildRecord | null;
|
|
17
27
|
/**
|
|
18
28
|
* The identity a development build is signed with, when the machine has one.
|
|
19
29
|
*
|
|
@@ -43,6 +53,7 @@ export declare interface AssembleMacosAppOptions {
|
|
|
43
53
|
keychain?: string
|
|
44
54
|
unsandboxed?: boolean
|
|
45
55
|
agent?: MacosAgentBundle
|
|
56
|
+
rehearsal?: boolean
|
|
46
57
|
run?: BundleCommand
|
|
47
58
|
}
|
|
48
59
|
export declare interface AssembledMacosApp {
|
|
@@ -51,4 +62,26 @@ export declare interface AssembledMacosApp {
|
|
|
51
62
|
ignoredPlistKeys: string[]
|
|
52
63
|
notes: string[]
|
|
53
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* What `buddy build:desktop` writes beside a `macos` app
|
|
67
|
+
* (`<App>.build.json`): what was built, from which commit, for whom. A release
|
|
68
|
+
* reads it to refuse a bundle built for development, from another commit, or
|
|
69
|
+
* at another version than the config now says.
|
|
70
|
+
*/
|
|
71
|
+
export declare interface MacosBuildRecord {
|
|
72
|
+
appName: string
|
|
73
|
+
bundleId: string
|
|
74
|
+
version: string
|
|
75
|
+
buildNumber: string
|
|
76
|
+
url: string | null
|
|
77
|
+
agent: boolean
|
|
78
|
+
webkit: boolean
|
|
79
|
+
host: { key: string, sha256: string }
|
|
80
|
+
signedWith: string
|
|
81
|
+
sandboxed: boolean
|
|
82
|
+
distribution: MacosDistribution
|
|
83
|
+
updater: boolean
|
|
84
|
+
architecture: string
|
|
85
|
+
sourceRevision: string | null
|
|
86
|
+
}
|
|
54
87
|
export type BundleCommand = (args: string[]) => void;
|
package/dist/macos-bundle.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import{chmodSync,copyFileSync,cpSync,existsSync,mkdirSync,rmSync,writeFileSync}from"node:fs";import{join,resolve}from"node:path";import{AGENT_MANIFEST}from"./agent-launcher";import{ICONSET_SIZES,renderHostConfig,renderMacosEntitlements,renderMacosHostEntitlements,renderMacosInfoPlist,renderPrivacyManifest}from"./macos-app";export const AGENT_HOST_EXECUTABLE="craft-runtime";export const runBundleCommand=(args)=>{const result=Bun.spawnSync(args,{stdout:"pipe",stderr:"pipe"});if(result.exitCode!==0)throw new Error(`${args[0]} ${args.slice(1).join(" ")} exited with ${result.exitCode}: ${result.stderr.toString().trim()||result.stdout.toString().trim()}`)};export function makeIcns(png,output,scratch,run=runBundleCommand){const iconset=join(scratch,"AppIcon.iconset");rmSync(iconset,{recursive:true,force:true});mkdirSync(iconset,{recursive:true});for(const{file,pixels}of ICONSET_SIZES)run(["sips","-z",String(pixels),String(pixels),png,"--out",join(iconset,file)]);run(["iconutil","-c","icns",iconset,"-o",output]);rmSync(iconset,{recursive:true,force:true})}export function assembleMacosApp(options){const run=options.run??runBundleCommand;const{config}=options;const notes=[];const appPath=join(options.output,`${config.appName}.app`);const contents=join(appPath,"Contents");const macos=join(contents,"MacOS");const resources=join(contents,"Resources");rmSync(appPath,{recursive:true,force:true});mkdirSync(macos,{recursive:true});mkdirSync(resources,{recursive:true});if(options.agent){if(!config.agent)throw new Error("An agent launcher was given for an app whose config has no macos.agent");copyFileSync(options.agent.launcher,join(macos,config.executable));copyFileSync(options.host,join(macos,AGENT_HOST_EXECUTABLE));chmodSync(join(macos,AGENT_HOST_EXECUTABLE),493);const manifest={...options.agent.manifest,host:`../MacOS/${AGENT_HOST_EXECUTABLE}`,nativeBundle:"native-screen.js"};if(options.agent.manifest.staticDir){cpSync(options.agent.manifest.staticDir,join(resources,"web"),{recursive:true});manifest.staticDir="web"}if(options.agent.manifest.resources){for(const[name,source]of Object.entries(options.agent.manifest.resources)){if(!existsSync(source))throw new Error(`macos.agent.resources.${name} does not exist: ${source}`);cpSync(source,join(resources,name),{recursive:true,dereference:true})}manifest.resources=Object.fromEntries(Object.keys(options.agent.manifest.resources).map((name)=>[name,name]))}writeFileSync(join(resources,AGENT_MANIFEST),`${JSON.stringify(manifest,null,2)}
|
|
2
|
-
`)}else{copyFileSync(options.host,join(macos,config.executable))}chmodSync(join(macos,config.executable),493);copyFileSync(options.nativeBundle,join(resources,"native-screen.js"));writeFileSync(join(resources,"craft-app.json"),renderHostConfig(config));writeFileSync(join(resources,"PrivacyInfo.xcprivacy"),renderPrivacyManifest(config));let iconFile;if(config.icon){const icon=resolve(options.root,config.icon);if(!existsSync(icon))throw new Error(`macos.icon does not exist: ${icon}`);if(icon.endsWith(".icns"))copyFileSync(icon,join(resources,"AppIcon.icns"));else makeIcns(icon,join(resources,"AppIcon.icns"),options.output,run);iconFile="AppIcon"}else notes.push("No macos.icon: the app has the generic icon, which the Mac App Store rejects.");const plist=renderMacosInfoPlist(config,{iconFile});writeFileSync(join(contents,"Info.plist"),plist.xml);if(options.distribution==="app-store"){if(!options.provisioningProfile)throw new Error("A Mac App Store build needs a provisioning profile");const embedded=join(contents,"embedded.provisionprofile");copyFileSync(options.provisioningProfile,embedded);chmodSync(embedded,420)}const signed=options.unsandboxed?{...config,sandbox:false}:config;const entitlementsPath=join(options.output,`${config.appName}.entitlements`);writeFileSync(entitlementsPath,renderMacosEntitlements(signed,options.distribution));const hostEntitlements=join(options.output,`${config.appName}.host.entitlements`);if(options.agent)writeFileSync(hostEntitlements,renderMacosHostEntitlements(signed));run(["plutil","-lint",join(contents,"Info.plist"),join(resources,"PrivacyInfo.xcprivacy"),entitlementsPath,...options.agent?[hostEntitlements]:[]]);
|
|
3
|
-
`)){const match=/^\s*\d+\)\s+([0-9A-F]{40})\s+"Apple Development:/.exec(line);if(match)return match[1]}return}export function
|
|
1
|
+
import{chmodSync,copyFileSync,cpSync,existsSync,mkdirSync,readFileSync,rmSync,writeFileSync}from"node:fs";import{join,resolve}from"node:path";import{AGENT_MANIFEST}from"./agent-launcher";import{ICONSET_SIZES,renderHostConfig,renderMacosEntitlements,renderMacosHostEntitlements,renderMacosInfoPlist,renderPrivacyManifest}from"./macos-app";export const AGENT_HOST_EXECUTABLE="craft-runtime";export const runBundleCommand=(args)=>{const result=Bun.spawnSync(args,{stdout:"pipe",stderr:"pipe"});if(result.exitCode!==0)throw new Error(`${args[0]} ${args.slice(1).join(" ")} exited with ${result.exitCode}: ${result.stderr.toString().trim()||result.stdout.toString().trim()}`)};export function makeIcns(png,output,scratch,run=runBundleCommand){const iconset=join(scratch,"AppIcon.iconset");rmSync(iconset,{recursive:true,force:true});mkdirSync(iconset,{recursive:true});for(const{file,pixels}of ICONSET_SIZES)run(["sips","-z",String(pixels),String(pixels),png,"--out",join(iconset,file)]);run(["iconutil","-c","icns",iconset,"-o",output]);rmSync(iconset,{recursive:true,force:true})}export function assembleMacosApp(options){const run=options.run??runBundleCommand;const{config}=options;const notes=[];const appPath=join(options.output,`${config.appName}.app`);const contents=join(appPath,"Contents");const macos=join(contents,"MacOS");const resources=join(contents,"Resources");rmSync(appPath,{recursive:true,force:true});mkdirSync(macos,{recursive:true});mkdirSync(resources,{recursive:true});if(options.agent){if(!config.agent)throw new Error("An agent launcher was given for an app whose config has no macos.agent");copyFileSync(options.agent.launcher,join(macos,config.executable));copyFileSync(options.host,join(macos,AGENT_HOST_EXECUTABLE));chmodSync(join(macos,AGENT_HOST_EXECUTABLE),493);const manifest={...options.agent.manifest,host:`../MacOS/${AGENT_HOST_EXECUTABLE}`,nativeBundle:"native-screen.js"};if(options.agent.manifest.staticDir){cpSync(options.agent.manifest.staticDir,join(resources,"web"),{recursive:true});manifest.staticDir="web"}if(options.agent.manifest.resources){for(const[name,source]of Object.entries(options.agent.manifest.resources)){if(!existsSync(source))throw new Error(`macos.agent.resources.${name} does not exist: ${source}`);cpSync(source,join(resources,name),{recursive:true,dereference:true})}manifest.resources=Object.fromEntries(Object.keys(options.agent.manifest.resources).map((name)=>[name,name]))}writeFileSync(join(resources,AGENT_MANIFEST),`${JSON.stringify(manifest,null,2)}
|
|
2
|
+
`)}else{copyFileSync(options.host,join(macos,config.executable))}chmodSync(join(macos,config.executable),493);copyFileSync(options.nativeBundle,join(resources,"native-screen.js"));writeFileSync(join(resources,"craft-app.json"),renderHostConfig(config,options.distribution));writeFileSync(join(resources,"PrivacyInfo.xcprivacy"),renderPrivacyManifest(config));let iconFile;if(config.icon){const icon=resolve(options.root,config.icon);if(!existsSync(icon))throw new Error(`macos.icon does not exist: ${icon}`);if(icon.endsWith(".icns"))copyFileSync(icon,join(resources,"AppIcon.icns"));else makeIcns(icon,join(resources,"AppIcon.icns"),options.output,run);iconFile="AppIcon"}else notes.push("No macos.icon: the app has the generic icon, which the Mac App Store rejects.");const plist=renderMacosInfoPlist(config,{iconFile});writeFileSync(join(contents,"Info.plist"),plist.xml);if(options.distribution==="app-store"){if(!options.provisioningProfile)throw new Error("A Mac App Store build needs a provisioning profile");const embedded=join(contents,"embedded.provisionprofile");copyFileSync(options.provisioningProfile,embedded);chmodSync(embedded,420)}const identity=options.signingIdentity||"-";if(options.distribution==="developer-id"&&identity==="-"&&!options.rehearsal)throw new Error("A Developer ID build needs a Developer ID Application identity: Gatekeeper refuses an ad hoc signature on every other Mac.");const signed=options.unsandboxed||options.distribution==="developer-id"?{...config,sandbox:false}:config;const entitlementsPath=join(options.output,`${config.appName}.entitlements`);writeFileSync(entitlementsPath,renderMacosEntitlements(signed,options.distribution));const hostEntitlements=join(options.output,`${config.appName}.host.entitlements`);if(options.agent)writeFileSync(hostEntitlements,renderMacosHostEntitlements(signed,options.distribution));run(["plutil","-lint",join(contents,"Info.plist"),join(resources,"PrivacyInfo.xcprivacy"),entitlementsPath,...options.agent?[hostEntitlements]:[]]);if(options.agent){run(["codesign","--force","--options","runtime",...identity==="-"?[]:["--timestamp"],"--entitlements",hostEntitlements,...options.keychain?["--keychain",options.keychain]:[],"--sign",identity,join(macos,AGENT_HOST_EXECUTABLE)])}run(["codesign","--force","--options","runtime",...identity==="-"?[]:["--timestamp"],"--entitlements",entitlementsPath,...options.keychain?["--keychain",options.keychain]:[],"--sign",identity,appPath]);run(["codesign","--verify","--deep","--strict",appPath]);return{appPath,entitlementsPath,ignoredPlistKeys:plist.ignored,notes}}export function parseDevelopmentIdentity(output){for(const line of output.split(`
|
|
3
|
+
`)){const match=/^\s*\d+\)\s+([0-9A-F]{40})\s+"Apple Development:/.exec(line);if(match)return match[1]}return}export function parseDeveloperIdIdentity(output){for(const line of output.split(`
|
|
4
|
+
`)){const match=/^\s*\d+\)\s+([0-9A-F]{40})\s+"Developer ID Application:/.exec(line);if(match)return match[1]}return}export function findDeveloperIdIdentity(read=()=>Bun.spawnSync(["security","find-identity","-v","-p","codesigning"],{stdout:"pipe",stderr:"ignore"}).stdout.toString()){try{return parseDeveloperIdIdentity(read())}catch{return}}export function macosBuildRecordFile(output,appName){return join(output,`${appName}.build.json`)}export function readMacosBuildRecord(output,appName){const file=macosBuildRecordFile(output,appName);if(!existsSync(file))return null;try{const record=JSON.parse(readFileSync(file,"utf8"));return typeof record.version==="string"&&typeof record.distribution==="string"&&typeof record.architecture==="string"?record:null}catch{return null}}export function findDevelopmentIdentity(read=()=>Bun.spawnSync(["security","find-identity","-v","-p","codesigning"],{stdout:"pipe",stderr:"ignore"}).stdout.toString()){try{return parseDevelopmentIdentity(read())}catch{return}}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { DesktopTargetName } from '@stacksjs/types';
|
|
2
|
+
import type { ResolvedMacosDesktop } from './macos-app';
|
|
3
|
+
/**
|
|
4
|
+
* The files a release of a `macos` app is made of, named and placed as a web
|
|
5
|
+
* view app's Mac release is (`<App>-<version>-<arch>.zip` and `.dmg`), so the
|
|
6
|
+
* feed, the artifact route and a download page treat both kinds alike.
|
|
7
|
+
* `architecture` is a Node id (`arm64`, `x64`): the machine the host was built on.
|
|
8
|
+
*/
|
|
9
|
+
export declare function macosReleasePlan(options: { output: string, appName: string, version: string, architecture: string }): MacosReleasePlan;
|
|
10
|
+
export declare function macosPantryArtifact(config: Pick<ResolvedMacosDesktop, 'appName' | 'executable' | 'bundleId' | 'version' | 'buildNumber' | 'minimumSystemVersion'>, options: { output: string, architecture: string }): MacosPantryArtifact;
|
|
11
|
+
/**
|
|
12
|
+
* Where `buddy release:desktop` puts a native macOS app's release, and what
|
|
13
|
+
* it tells Pantry about it. Pure functions of the config and the build, so
|
|
14
|
+
* the layout can be asserted without signing or notarizing anything.
|
|
15
|
+
*/
|
|
16
|
+
export declare interface MacosReleasePlan {
|
|
17
|
+
target: DesktopTargetName
|
|
18
|
+
staged: string
|
|
19
|
+
update: string
|
|
20
|
+
dmg: string
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* What Pantry's native app pipeline reads from `.pantry/native/artifact.json`
|
|
24
|
+
* (`NativeArtifact` in `ts-pantry/native`): the file it notarizes and
|
|
25
|
+
* releases, the app inside it, and the identity it checks the built
|
|
26
|
+
* `Info.plist` against.
|
|
27
|
+
*/
|
|
28
|
+
export declare interface MacosPantryArtifact {
|
|
29
|
+
path: string
|
|
30
|
+
appPath: string
|
|
31
|
+
name: string
|
|
32
|
+
bundleId: string
|
|
33
|
+
version: string
|
|
34
|
+
buildNumber: string
|
|
35
|
+
target: 'macos'
|
|
36
|
+
minimumSystemVersion: string
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{join}from"node:path";import{releaseArtifactNames}from"./webview-app";export function macosReleasePlan(options){if(!["arm64","x64"].includes(options.architecture))throw new Error(`A macOS app is built for arm64 or x64, not "${options.architecture}"`);const target=`darwin-${options.architecture}`;const names=releaseArtifactNames({appName:options.appName,version:options.version},target);const staged=join(options.output,"release",target);return{target,staged,update:join(staged,names.update),dmg:join(staged,names.downloads[0])}}export function macosPantryArtifact(config,options){const plan=macosReleasePlan({output:options.output,appName:config.appName,version:config.version,architecture:options.architecture});return{path:plan.dmg,appPath:join(options.output,`${config.appName}.app`),name:config.executable,bundleId:config.bundleId,version:config.version,buildNumber:config.buildNumber,target:"macos",minimumSystemVersion:config.minimumSystemVersion}}
|
package/dist/update-feed.d.ts
CHANGED
|
@@ -51,6 +51,20 @@ export declare function parseByteRange(header: string | null | undefined, size:
|
|
|
51
51
|
* byte ranges, so a download can be resumed and nothing is held in memory.
|
|
52
52
|
*/
|
|
53
53
|
export declare function serveUpdateArtifact(options: ServeUpdateArtifactOptions): Promise<Response>;
|
|
54
|
+
/**
|
|
55
|
+
* The `updates` a project's feed serves. An app that declares one desktop app
|
|
56
|
+
* with updates serves that one. With both, `webview.updates` is the answer
|
|
57
|
+
* unless `app` says otherwise, as `buddy build:desktop` and `buddy
|
|
58
|
+
* release:desktop` take the web view app unless given `--native`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function selectDesktopUpdates<T extends UpdatesConfig>(config: { webview?: { updates?: T }, macos?: { updates?: T } } | null | undefined, app?: DesktopUpdatesApp): T | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Why a project's two desktop apps cannot both publish updates as configured,
|
|
63
|
+
* or nothing. Both kinds store a Mac release under `<prefix>/<channel>/darwin-<arch>/`,
|
|
64
|
+
* so on one disk and folder each release would replace the other's manifest
|
|
65
|
+
* and an installed app would be offered the other app.
|
|
66
|
+
*/
|
|
67
|
+
export declare function desktopUpdatesCollision(config: UpdatesSections): string | undefined;
|
|
54
68
|
/**
|
|
55
69
|
* A published artifact of the app this project builds, as a route handler's
|
|
56
70
|
* answer: `GET /api/updates/files/{channel}/{target}/{version}/{file}`.
|
|
@@ -59,9 +73,9 @@ export declare function answerUpdateArtifact(options: AnswerUpdateArtifactOption
|
|
|
59
73
|
/**
|
|
60
74
|
* The update feed for the app this project builds, as a route handler's
|
|
61
75
|
* answer: `GET /api/updates/{platform}/{arch}`. Reads the manifest
|
|
62
|
-
* `buddy release:desktop` published, from the disk and folder
|
|
63
|
-
* `
|
|
64
|
-
* answers 404.
|
|
76
|
+
* `buddy release:desktop` published, from the disk and folder the app's
|
|
77
|
+
* `updates` names (`webview.updates`, or `macos.updates` for a native macOS
|
|
78
|
+
* app). A project that publishes no desktop updates answers 404.
|
|
65
79
|
*/
|
|
66
80
|
export declare function answerUpdateFeed(options: AnswerUpdateFeedOptions): Promise<Response>;
|
|
67
81
|
/** The storage key of a channel's release.json. */
|
|
@@ -124,6 +138,7 @@ export declare interface ServeUpdateArtifactOptions {
|
|
|
124
138
|
}
|
|
125
139
|
export declare interface AnswerUpdateArtifactOptions extends Omit<ServeUpdateArtifactOptions, 'store' | 'prefix'> {
|
|
126
140
|
root?: string
|
|
141
|
+
app?: DesktopUpdatesApp
|
|
127
142
|
updates?: UpdatesConfig
|
|
128
143
|
store?: UpdateStore
|
|
129
144
|
}
|
|
@@ -133,6 +148,7 @@ export declare interface AnswerUpdateFeedOptions {
|
|
|
133
148
|
channel?: string | null
|
|
134
149
|
currentVersion?: string | null
|
|
135
150
|
root?: string
|
|
151
|
+
app?: DesktopUpdatesApp
|
|
136
152
|
updates?: { disk?: string, prefix?: string, channel?: string }
|
|
137
153
|
store?: UpdateStore
|
|
138
154
|
}
|
|
@@ -159,4 +175,7 @@ export declare interface ReleaseRecord {
|
|
|
159
175
|
targets: ReleaseRecordTarget[]
|
|
160
176
|
}
|
|
161
177
|
declare type UpdatesConfig = { disk?: string, prefix?: string, channel?: string }
|
|
178
|
+
/** Which of a project's desktop apps a feed serves: the web view one (`webview.updates`) or the native macOS one (`macos.updates`). */
|
|
179
|
+
export type DesktopUpdatesApp = 'webview' | 'macos';
|
|
180
|
+
declare type UpdatesSections = { webview?: { updates?: UpdatesConfig }, macos?: { updates?: UpdatesConfig } }
|
|
162
181
|
export {};
|
package/dist/update-feed.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{existsSync,readFileSync}from"node:fs";import{basename,join}from"node:path";import process from"node:process";import{pathToFileURL}from"node:url";import{describeArtifact,signUpdateManifest}from"./update-signing";import{compareVersions,validateUpdateManifest}from"./updater";export const UPDATE_PLATFORMS=["darwin","linux","win32"];export const DEFAULT_UPDATE_PREFIX="desktop-updates";function checkedLocation(location){const channel=location.channel||"stable";const prefix=(location.prefix??DEFAULT_UPDATE_PREFIX).replace(/^\/+|\/+$/g,"");if(!UPDATE_PLATFORMS.includes(location.platform))throw new Error(`Unknown desktop platform: ${location.platform}`);if(!/^[a-z0-9_]+$/.test(location.architecture))throw new Error(`Unknown desktop architecture: ${location.architecture}`);if(!/^[a-z0-9][a-z0-9._-]*$/i.test(channel))throw new Error(`Invalid release channel: ${channel}`);return{platform:location.platform,architecture:location.architecture,channel,prefix}}export function updateManifestKey(location){const at=checkedLocation(location);return`${at.prefix}/${at.channel}/${at.platform}-${at.architecture}/latest.json`}export function updateArtifactKey(location,version,fileName){const at=checkedLocation(location);if(!/^\w[\w.+-]*$/.test(version)||!/^\w[\w.+ -]*$/.test(fileName))throw new Error(`Invalid artifact name: ${version}/${fileName}`);return`${at.prefix}/${at.channel}/${at.platform}-${at.architecture}/${version}/${fileName}`}export function updateFeedUrl(feedUrl,target,query={}){const url=new URL(`${feedUrl.replace(/\/+$/,"")}/${target.platform}/${target.architecture}`);if(query.channel&&query.channel!=="stable")url.searchParams.set("channel",query.channel);if(query.currentVersion)url.searchParams.set("current",query.currentVersion);return url.toString()}export function updateArtifactUrl(feedUrl,location,version,fileName){const key=updateArtifactKey({...location,prefix:""},version,fileName);return`${feedUrl.replace(/\/+$/,"")}/files/${key.replace(/^\/+/,"").split("/").map(encodeURIComponent).join("/")}`}export function artifactUrlProblem(url){let parsed;try{parsed=new URL(url)}catch{return`${url} is not a URL`}if(parsed.protocol!=="https:"&&parsed.protocol!=="http:")return`${url} is not an http(s) URL`;const host=parsed.hostname.toLowerCase().replace(/^\[|\]$/g,"");const local=host==="localhost"||host.endsWith(".localhost")||host.endsWith(".test")||host.endsWith(".local")||host==="::1"||host==="0.0.0.0"||/^127\./.test(host);return local?`${url} is on this machine (${host}): no installed app could download it`:null}export async function storageUpdateStore(disk){const{Storage}=await import("@stacksjs/storage");const adapter=Storage.disk(disk);return{read:async(key)=>await adapter.fileExists(key)?adapter.readToString(key):null,write:async(key,contents)=>{await adapter.write(key,typeof contents==="string"?contents:Buffer.from(contents))},publicUrl:(key)=>adapter.publicUrl(key),open:async(key)=>{if(!await adapter.fileExists(key))return null;const size=await adapter.fileSize(key);return{size,stream:async(range)=>{const whole=typeof adapter.getStream==="function"?await adapter.getStream(key):new Blob([await adapter.readToUint8Array(key)]).stream();return range?sliceStream(whole,range.start,range.end):whole}}}}}export function sliceStream(source,start,end){const reader=source.getReader();let offset=0;return new ReadableStream({async pull(controller){while(true){if(offset>end){await reader.cancel();controller.close();return}const{done,value}=await reader.read();if(done){controller.close();return}const from=Math.max(start-offset,0);const to=Math.min(end+1-offset,value.byteLength);offset+=value.byteLength;if(to>from){controller.enqueue(value.subarray(from,to));return}}},cancel:(reason)=>reader.cancel(reason)})}export async function publishedArtifactUrl(options,version,fileName){const key=updateArtifactKey(options,version,fileName);if(options.artifactBaseUrl)return`${options.artifactBaseUrl.replace(/\/+$/,"")}/${key.split("/").map(encodeURIComponent).join("/")}`;if(options.feedUrl)return updateArtifactUrl(options.feedUrl,options,version,fileName);return options.store.publicUrl(key)}export async function publishDesktopUpdate(options){const{size,sha256}=await describeArtifact(options.artifact);const artifactKey=updateArtifactKey(options,options.version,basename(options.artifact));const url=await publishedArtifactUrl(options,options.version,basename(options.artifact));await options.store.write(artifactKey,readFileSync(options.artifact));const unsigned={version:options.version,url,sha256,size,sourceRevision:options.sourceRevision,platform:options.platform,architecture:options.architecture,publishedAt:options.publishedAt??new Date().toISOString(),...options.notes?{notes:options.notes}:{}};const manifest=signUpdateManifest(unsigned,options.privateKey,options.keyId);await options.store.write(updateManifestKey(options),`${JSON.stringify(manifest,null,2)}
|
|
2
|
-
`);return manifest}const feedHeaders={"content-type":"application/json; charset=utf-8","cache-control":"no-store"};export async function serveUpdateFeed(options){let key;try{key=updateManifestKey(options)}catch(error){return new Response(JSON.stringify({error:error instanceof Error?error.message:String(error)}),{status:404,headers:feedHeaders})}const stored=await options.store.read(key);if(!stored)return new Response(JSON.stringify({error:"No update has been published for this platform."}),{status:404,headers:feedHeaders});let manifest;try{manifest=validateUpdateManifest(JSON.parse(stored))}catch{return new Response(JSON.stringify({error:"The published update manifest is not valid."}),{status:500,headers:feedHeaders})}if(options.currentVersion){try{if(compareVersions(manifest.version,options.currentVersion)<=0)return new Response(null,{status:204,headers:{"cache-control":"no-store"}})}catch{}}return new Response(stored,{headers:feedHeaders})}const artifactTypes={zip:"application/zip",dmg:"application/x-apple-diskimage",msi:"application/x-msi",exe:"application/vnd.microsoft.portable-executable",appimage:"application/vnd.appimage",deb:"application/vnd.debian.binary-package",rpm:"application/x-rpm"};function refused(status,error,headers={}){return new Response(JSON.stringify({error}),{status,headers:{...feedHeaders,...headers}})}export function parseByteRange(header,size){if(!header)return null;const match=/^bytes=(\d*)-(\d*)$/.exec(header.trim());if(!match||!match[1]&&!match[2])return null;if(!match[1]){const last=Number(match[2]);if(!last||!size)return false;return{start:Math.max(size-last,0),end:size-1}}const start=Number(match[1]);const end=match[2]?Math.min(Number(match[2]),size-1):size-1;if(start>=size||start>end)return false;return{start,end}}export async function serveUpdateArtifact(options){const missing=()=>refused(404,"No such release artifact.");const split=/^([a-z0-9]+)-([a-z0-9_]+)$/.exec(options.target);if(!split)return missing();let key;try{key=updateArtifactKey({platform:split[1],architecture:split[2],channel:options.channel,prefix:options.prefix},options.version,options.file)}catch{return missing()}if(!options.store.open)return missing();const stored=await options.store.open(key);if(!stored)return missing();const range=parseByteRange(options.range,stored.size);if(range===false)return refused(416,"The requested range is outside the file.",{"content-range":`bytes */${stored.size}`});const length=range?range.end-range.start+1:stored.size;const headers={"content-type":artifactTypes[options.file.slice(options.file.lastIndexOf(".")+1).toLowerCase()]??"application/octet-stream","content-length":String(length),"content-disposition":`attachment; filename="${options.file}"`,"accept-ranges":"bytes","cache-control":"public, max-age=31536000, immutable","x-content-type-options":"nosniff"};if(range)headers["content-range"]=`bytes ${range.start}-${range.end}/${stored.size}`;const body=options.method?.toUpperCase()==="HEAD"?null:await stored.stream(range??undefined);return new Response(body,{status:range?206:200,headers})}async function projectUpdates(root){const file=join(root??process.cwd(),"config/desktop.ts");return existsSync(file)?(await import(pathToFileURL(file).href)).default
|
|
2
|
+
`);return manifest}const feedHeaders={"content-type":"application/json; charset=utf-8","cache-control":"no-store"};export async function serveUpdateFeed(options){let key;try{key=updateManifestKey(options)}catch(error){return new Response(JSON.stringify({error:error instanceof Error?error.message:String(error)}),{status:404,headers:feedHeaders})}const stored=await options.store.read(key);if(!stored)return new Response(JSON.stringify({error:"No update has been published for this platform."}),{status:404,headers:feedHeaders});let manifest;try{manifest=validateUpdateManifest(JSON.parse(stored))}catch{return new Response(JSON.stringify({error:"The published update manifest is not valid."}),{status:500,headers:feedHeaders})}if(options.currentVersion){try{if(compareVersions(manifest.version,options.currentVersion)<=0)return new Response(null,{status:204,headers:{"cache-control":"no-store"}})}catch{}}return new Response(stored,{headers:feedHeaders})}const artifactTypes={zip:"application/zip",dmg:"application/x-apple-diskimage",msi:"application/x-msi",exe:"application/vnd.microsoft.portable-executable",appimage:"application/vnd.appimage",deb:"application/vnd.debian.binary-package",rpm:"application/x-rpm"};function refused(status,error,headers={}){return new Response(JSON.stringify({error}),{status,headers:{...feedHeaders,...headers}})}export function parseByteRange(header,size){if(!header)return null;const match=/^bytes=(\d*)-(\d*)$/.exec(header.trim());if(!match||!match[1]&&!match[2])return null;if(!match[1]){const last=Number(match[2]);if(!last||!size)return false;return{start:Math.max(size-last,0),end:size-1}}const start=Number(match[1]);const end=match[2]?Math.min(Number(match[2]),size-1):size-1;if(start>=size||start>end)return false;return{start,end}}export async function serveUpdateArtifact(options){const missing=()=>refused(404,"No such release artifact.");const split=/^([a-z0-9]+)-([a-z0-9_]+)$/.exec(options.target);if(!split)return missing();let key;try{key=updateArtifactKey({platform:split[1],architecture:split[2],channel:options.channel,prefix:options.prefix},options.version,options.file)}catch{return missing()}if(!options.store.open)return missing();const stored=await options.store.open(key);if(!stored)return missing();const range=parseByteRange(options.range,stored.size);if(range===false)return refused(416,"The requested range is outside the file.",{"content-range":`bytes */${stored.size}`});const length=range?range.end-range.start+1:stored.size;const headers={"content-type":artifactTypes[options.file.slice(options.file.lastIndexOf(".")+1).toLowerCase()]??"application/octet-stream","content-length":String(length),"content-disposition":`attachment; filename="${options.file}"`,"accept-ranges":"bytes","cache-control":"public, max-age=31536000, immutable","x-content-type-options":"nosniff"};if(range)headers["content-range"]=`bytes ${range.start}-${range.end}/${stored.size}`;const body=options.method?.toUpperCase()==="HEAD"?null:await stored.stream(range??undefined);return new Response(body,{status:range?206:200,headers})}export function selectDesktopUpdates(config,app){if(app)return config?.[app]?.updates;return config?.webview?.updates??config?.macos?.updates}export function desktopUpdatesCollision(config){const webview=config.webview?.updates;const macos=config.macos?.updates;if(!webview||!macos)return;const folder=(updates)=>(updates.prefix??DEFAULT_UPDATE_PREFIX).replace(/^\/+|\/+$/g,"");if((webview.disk??"")!==(macos.disk??"")||folder(webview)!==folder(macos))return;return`config/desktop.ts: webview.updates and macos.updates publish to the same folder (${folder(macos)}) on the same disk, where each app's release would replace the other's. Give one of them its own \`prefix\`.`}async function projectUpdates(root,app){const file=join(root??process.cwd(),"config/desktop.ts");return existsSync(file)?selectDesktopUpdates((await import(pathToFileURL(file).href)).default,app):undefined}export async function answerUpdateArtifact(options){const updates=options.updates??(options.store?undefined:await projectUpdates(options.root,options.app));if(!updates&&!options.store)return refused(404,"This app publishes no desktop updates.");return serveUpdateArtifact({...options,store:options.store??await storageUpdateStore(updates?.disk),prefix:updates?.prefix})}export async function answerUpdateFeed(options){let updates=options.updates;if(!updates&&!options.store){updates=await projectUpdates(options.root,options.app);if(!updates)return new Response(JSON.stringify({error:"This app publishes no desktop updates."}),{status:404,headers:feedHeaders})}return serveUpdateFeed({store:options.store??await storageUpdateStore(updates?.disk),platform:options.platform,architecture:options.architecture,channel:options.channel||updates?.channel,prefix:updates?.prefix,currentVersion:options.currentVersion})}export function releaseRecordKey(location){const channel=location.channel||"stable";if(!/^[a-z0-9][a-z0-9._-]*$/i.test(channel))throw new Error(`Invalid release channel: ${channel}`);return`${(location.prefix??DEFAULT_UPDATE_PREFIX).replace(/^\/+|\/+$/g,"")}/${channel}/release.json`}export function mergeReleaseRecord(stored,next){let previous=null;try{previous=stored?JSON.parse(stored):null}catch{previous=null}if(!previous||previous.version!==next.version||previous.channel!==next.channel||!Array.isArray(previous.targets))return next;const published=new Set(next.targets.map((item)=>item.target));const kept=previous.targets.filter((item)=>typeof item?.target==="string"&&item.update&&Array.isArray(item.downloads)&&!published.has(item.target));return{...next,targets:[...kept,...next.targets].sort((a,b)=>a.target.localeCompare(b.target))}}
|
package/dist/update-signing.d.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import type { DesktopUpdateManifest } from './updater';
|
|
2
|
+
import type { DesktopUpdatesConfig } from '@stacksjs/types';
|
|
2
3
|
export declare function generateUpdateKeypair(keyId?: string): UpdateKeypair;
|
|
3
4
|
/** The public key that verifies what a private key signs, in the encoding the app trusts. */
|
|
4
5
|
export declare function updatePublicKey(privateKey: string): string;
|
|
6
|
+
/** Whether a value is a public key an app can verify with: the prefix, then an Ed25519 key as base64url SPKI DER. */
|
|
7
|
+
export declare function isUpdatePublicKey(encoded: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Why an `updates` section cannot ship, as a list; empty when it can. `key`
|
|
10
|
+
* names it in the messages (`webview.updates`, `macos.updates`). The feed is
|
|
11
|
+
* https, or loopback while developing; every trusted key is a public key.
|
|
12
|
+
* `decodeKeys` also reads each key: the AppKit host parses them natively, and
|
|
13
|
+
* one it cannot read is an app that never updates and never says why.
|
|
14
|
+
*/
|
|
15
|
+
export declare function desktopUpdatesProblems(updates: DesktopUpdatesConfig, key: string, options?: { decodeKeys?: boolean }): string[];
|
|
5
16
|
/** Sign a manifest. The result is verified against the key's own public half before it is returned. */
|
|
6
17
|
export declare function signUpdateManifest(unsigned: UnsignedUpdateManifest, privateKey: string, keyId?: string): DesktopUpdateManifest;
|
|
7
18
|
/** A file's size and SHA-256, read as a stream: an installer is too large to hold twice. */
|
package/dist/update-signing.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHash,createPrivateKey,createPublicKey,generateKeyPairSync,sign}from"node:crypto";import{createReadStream,statSync}from"node:fs";import{updateManifestPayload,validateUpdateManifest,verifyUpdateManifestSignature}from"./updater";export const UPDATE_PUBLIC_PREFIX="ed25519-public:";export const UPDATE_PRIVATE_PREFIX="ed25519-private:";export function generateUpdateKeypair(keyId="main"){if(!/^[\w.-]+$/.test(keyId))throw new Error(`A key id is letters, digits, dots, dashes and underscores: ${keyId}`);const{publicKey,privateKey}=generateKeyPairSync("ed25519");return{keyId,publicKey:`${UPDATE_PUBLIC_PREFIX}${publicKey.export({format:"der",type:"spki"}).toString("base64url")}`,privateKey:`${UPDATE_PRIVATE_PREFIX}${privateKey.export({format:"der",type:"pkcs8"}).toString("base64url")}`}}function privateKeyObject(encoded){if(!encoded.startsWith(UPDATE_PRIVATE_PREFIX))throw new Error(`A desktop update private key starts with ${UPDATE_PRIVATE_PREFIX}`);let key;try{key=createPrivateKey({key:Buffer.from(encoded.slice(UPDATE_PRIVATE_PREFIX.length),"base64url"),format:"der",type:"pkcs8"})}catch{throw new Error("The desktop update private key could not be read")}if(key.asymmetricKeyType!=="ed25519")throw new Error("The desktop update private key is not an Ed25519 key");return key}export function updatePublicKey(privateKey){return`${UPDATE_PUBLIC_PREFIX}${createPublicKey(privateKeyObject(privateKey)).export({format:"der",type:"spki"}).toString("base64url")}`}export function signUpdateManifest(unsigned,privateKey,keyId="main"){const key=privateKeyObject(privateKey);const manifest={...unsigned,sha256:unsigned.sha256.toLowerCase(),signingKeyId:keyId,signature:""};manifest.signature=sign(null,updateManifestPayload(manifest),key).toString("base64url");validateUpdateManifest(manifest);verifyUpdateManifestSignature(manifest,{[keyId]:updatePublicKey(privateKey)});return manifest}export async function describeArtifact(file){const hash=createHash("sha256");await new Promise((resolve,reject)=>{createReadStream(file).on("data",(chunk)=>hash.update(chunk)).on("end",resolve).on("error",reject)});return{size:statSync(file).size,sha256:hash.digest("hex")}}
|
|
1
|
+
import{createHash,createPrivateKey,createPublicKey,generateKeyPairSync,sign}from"node:crypto";import{createReadStream,statSync}from"node:fs";import{updateManifestPayload,validateUpdateManifest,verifyUpdateManifestSignature}from"./updater";export const UPDATE_PUBLIC_PREFIX="ed25519-public:";export const UPDATE_PRIVATE_PREFIX="ed25519-private:";export function generateUpdateKeypair(keyId="main"){if(!/^[\w.-]+$/.test(keyId))throw new Error(`A key id is letters, digits, dots, dashes and underscores: ${keyId}`);const{publicKey,privateKey}=generateKeyPairSync("ed25519");return{keyId,publicKey:`${UPDATE_PUBLIC_PREFIX}${publicKey.export({format:"der",type:"spki"}).toString("base64url")}`,privateKey:`${UPDATE_PRIVATE_PREFIX}${privateKey.export({format:"der",type:"pkcs8"}).toString("base64url")}`}}function privateKeyObject(encoded){if(!encoded.startsWith(UPDATE_PRIVATE_PREFIX))throw new Error(`A desktop update private key starts with ${UPDATE_PRIVATE_PREFIX}`);let key;try{key=createPrivateKey({key:Buffer.from(encoded.slice(UPDATE_PRIVATE_PREFIX.length),"base64url"),format:"der",type:"pkcs8"})}catch{throw new Error("The desktop update private key could not be read")}if(key.asymmetricKeyType!=="ed25519")throw new Error("The desktop update private key is not an Ed25519 key");return key}export function updatePublicKey(privateKey){return`${UPDATE_PUBLIC_PREFIX}${createPublicKey(privateKeyObject(privateKey)).export({format:"der",type:"spki"}).toString("base64url")}`}export function isUpdatePublicKey(encoded){if(typeof encoded!=="string"||!encoded.startsWith(UPDATE_PUBLIC_PREFIX))return false;try{return createPublicKey({key:Buffer.from(encoded.slice(UPDATE_PUBLIC_PREFIX.length),"base64url"),format:"der",type:"spki"}).asymmetricKeyType==="ed25519"}catch{return false}}export function desktopUpdatesProblems(updates,key,options={}){const errors=[];try{const url=new URL(updates.feedUrl);if(url.protocol!=="https:"&&!["localhost","127.0.0.1"].includes(url.hostname))errors.push(`${key}.feedUrl must be https`)}catch{errors.push(`${key}.feedUrl is not a URL (got ${JSON.stringify(updates.feedUrl)})`)}const keys=Object.entries(updates.publicKeys??{});if(!keys.length)errors.push(`${key}.publicKeys needs at least one key (run \`buddy desktop:update:keypair\`)`);for(const[id,value]of keys){if(typeof value!=="string"||!value.startsWith(UPDATE_PUBLIC_PREFIX))errors.push(`${key}.publicKeys.${id} is not a public key (it starts with ${UPDATE_PUBLIC_PREFIX})`);else if(options.decodeKeys&&!isUpdatePublicKey(value))errors.push(`${key}.publicKeys.${id} is not a readable Ed25519 public key: paste the one \`buddy desktop:update:keypair\` printed, whole`)}if(updates.checkEveryHours!==undefined&&!(Number.isFinite(updates.checkEveryHours)&&updates.checkEveryHours>=0))errors.push(`${key}.checkEveryHours must be a number of hours, or 0 to turn the automatic check off`);return errors}export function signUpdateManifest(unsigned,privateKey,keyId="main"){const key=privateKeyObject(privateKey);const manifest={...unsigned,sha256:unsigned.sha256.toLowerCase(),signingKeyId:keyId,signature:""};manifest.signature=sign(null,updateManifestPayload(manifest),key).toString("base64url");validateUpdateManifest(manifest);verifyUpdateManifestSignature(manifest,{[keyId]:updatePublicKey(privateKey)});return manifest}export async function describeArtifact(file){const hash=createHash("sha256");await new Promise((resolve,reject)=>{createReadStream(file).on("data",(chunk)=>hash.update(chunk)).on("end",resolve).on("error",reject)});return{size:statSync(file).size,sha256:hash.digest("hex")}}
|
package/dist/webview-app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{chmodSync,copyFileSync,existsSync,mkdirSync,readdirSync,readFileSync,rmSync,statSync,writeFileSync}from"node:fs";import{basename,dirname,isAbsolute,join,relative,resolve,sep}from"node:path";import process from"node:process";import{codesignArgs,plistValue,renderInfoPlist}from"./index";import{loadDesktopConfig}from"./macos-app";import{makeIcns,runBundleCommand}from"./macos-bundle";import{webviewComponentDirs}from"./webview-agent";import{OPTIONAL_CRAFT_FLAGS,WEBVIEW_RUNTIME_NAME}from"./webview-launcher";export const DESKTOP_TARGETS=["darwin-arm64","darwin-x64","linux-x64","linux-arm64","win32-x64","win32-arm64"];export const WEBVIEW_DEFAULTS={views:"resources/desktop",output:"storage/framework/desktop/webview",width:1280,height:800,minimumSystemVersion:"13.0",category:"public.app-category.developer-tools"};export async function hasWebviewDesktop(root){return Boolean((await loadDesktopConfig(root))?.webview)}export async function loadWebviewDesktop(root,packageVersion="0.0.0"){const config=await loadDesktopConfig(root);return config?.webview?resolveWebviewDesktop(config.webview,packageVersion):null}export function resolveWebviewDesktop(config,packageVersion="0.0.0"){return{...config,version:config.version??packageVersion,window:{...config.window,title:config.window?.title??config.appName,width:config.window?.width??WEBVIEW_DEFAULTS.width,height:config.window?.height??WEBVIEW_DEFAULTS.height},agent:{...config.agent,views:config.agent?.views??WEBVIEW_DEFAULTS.views},output:config.output??WEBVIEW_DEFAULTS.output,executable:config.appName.replace(/[^\w .-]+/g,"").trim()||"App",slug:config.appName.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"app"}}export function validateWebviewDesktop(config){const errors=[];if(!config.appName?.trim())errors.push("webview.appName is required");if(!/^[a-z0-9-]+(\.[a-z0-9-]+)+$/i.test(config.appId??""))errors.push(`webview.appId must be reverse-DNS, like org.example.app (got ${JSON.stringify(config.appId)})`);if(!/^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/.test(config.version))errors.push(`webview.version must be a semantic version (got ${JSON.stringify(config.version)})`);for(const scheme of config.urlSchemes??[]){if(!/^[a-z][a-z0-9+.-]*$/i.test(scheme))errors.push(`webview.urlSchemes: ${JSON.stringify(scheme)} is not a URL scheme`)}if(config.updates)
|
|
1
|
+
import{chmodSync,copyFileSync,existsSync,mkdirSync,readdirSync,readFileSync,rmSync,statSync,writeFileSync}from"node:fs";import{basename,dirname,isAbsolute,join,relative,resolve,sep}from"node:path";import process from"node:process";import{codesignArgs,plistValue,renderInfoPlist}from"./index";import{loadDesktopConfig}from"./macos-app";import{makeIcns,runBundleCommand}from"./macos-bundle";import{desktopUpdatesProblems}from"./update-signing";import{webviewComponentDirs}from"./webview-agent";import{OPTIONAL_CRAFT_FLAGS,WEBVIEW_RUNTIME_NAME}from"./webview-launcher";export const DESKTOP_TARGETS=["darwin-arm64","darwin-x64","linux-x64","linux-arm64","win32-x64","win32-arm64"];export const WEBVIEW_DEFAULTS={views:"resources/desktop",output:"storage/framework/desktop/webview",width:1280,height:800,minimumSystemVersion:"13.0",category:"public.app-category.developer-tools"};export async function hasWebviewDesktop(root){return Boolean((await loadDesktopConfig(root))?.webview)}export async function loadWebviewDesktop(root,packageVersion="0.0.0"){const config=await loadDesktopConfig(root);return config?.webview?resolveWebviewDesktop(config.webview,packageVersion):null}export function resolveWebviewDesktop(config,packageVersion="0.0.0"){return{...config,version:config.version??packageVersion,window:{...config.window,title:config.window?.title??config.appName,width:config.window?.width??WEBVIEW_DEFAULTS.width,height:config.window?.height??WEBVIEW_DEFAULTS.height},agent:{...config.agent,views:config.agent?.views??WEBVIEW_DEFAULTS.views},output:config.output??WEBVIEW_DEFAULTS.output,executable:config.appName.replace(/[^\w .-]+/g,"").trim()||"App",slug:config.appName.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"app"}}export function validateWebviewDesktop(config){const errors=[];if(!config.appName?.trim())errors.push("webview.appName is required");if(!/^[a-z0-9-]+(\.[a-z0-9-]+)+$/i.test(config.appId??""))errors.push(`webview.appId must be reverse-DNS, like org.example.app (got ${JSON.stringify(config.appId)})`);if(!/^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/.test(config.version))errors.push(`webview.version must be a semantic version (got ${JSON.stringify(config.version)})`);for(const scheme of config.urlSchemes??[]){if(!/^[a-z][a-z0-9+.-]*$/i.test(scheme))errors.push(`webview.urlSchemes: ${JSON.stringify(scheme)} is not a URL scheme`)}if(config.updates)errors.push(...desktopUpdatesProblems(config.updates,"webview.updates"));return errors}export function hostDesktopTarget(){return`${process.platform}-${process.arch}`}export function parseDesktopTargets(input,host=hostDesktopTarget()){if(!input?.trim())return[host];if(input.trim()==="all")return[...DESKTOP_TARGETS];const targets=input.split(",").map((part)=>part.trim()).filter(Boolean).map((part)=>{const name=part.replace(/^macos-/,"darwin-").replace(/^windows-/,"win32-");if(!DESKTOP_TARGETS.includes(name))throw new Error(`Unknown desktop target ${JSON.stringify(part)}. Targets: ${DESKTOP_TARGETS.join(", ")}, or all.`);return name});return[...new Set(targets)]}export function splitDesktopTarget(target){const[platform,architecture]=target.split("-");return{platform,architecture}}export function bunCompileTarget(target){const{platform,architecture}=splitDesktopTarget(target);return`bun-${platform==="win32"?"windows":platform}-${architecture}`}export function webviewCompileArgs(options){const cross=options.target!==(options.host??hostDesktopTarget());return["build","--compile",...options.minify===false?[]:["--minify"],...cross?[`--target=${bunCompileTarget(options.target)}`]:["--bytecode","--format=esm"],"--no-compile-autoload-bunfig","--no-compile-autoload-dotenv",...options.target.startsWith("win32-")?["--windows-hide-console"]:[],options.entry,"--outfile",options.outfile]}export function webviewRuntimeFor(config,target,options){const configured=configuredWebviewRuntime(config,target,options);if(configured)return configured;throw new Error(`No Craft runtime for ${target}. Unpack that platform's Craft release and name its binary in desktop.webview.runtime['${target}'] or CRAFT_BIN_${target.replace("-","_").toUpperCase()}.`)}export function configuredWebviewRuntime(config,target,options){const env=options.env??process.env;const variable=`CRAFT_BIN_${target.replace("-","_").toUpperCase()}`;const named=config.runtime?.[target]??env[variable];if(named){const file=isAbsolute(named)?named:resolve(options.root,named);if(!existsSync(file))throw new Error(`The Craft runtime for ${target} does not exist: ${file}`);return file}if(target===(options.host??hostDesktopTarget())&&options.hostRuntime)return options.hostRuntime();return null}export function probeCraftFlags(runtime,flags=OPTIONAL_CRAFT_FLAGS){const binary=readFileSync(runtime);return flags.filter((flag)=>binary.includes(flag))}export function webviewManifest(config,options){return{appName:config.appName,appId:config.appId,version:config.version,runtime:options.runtime,window:{title:config.window.title,width:config.window.width,height:config.window.height,...config.window.darkMode!==undefined?{darkMode:config.window.darkMode}:{},...options.development||config.window.devtools?{devtools:true}:{},...config.window.titlebarHidden?{titlebarHidden:true}:{},...config.window.arguments?.length?{arguments:config.window.arguments}:{}},...config.agent.port?{port:config.agent.port}:{},...config.agent.startPath?{startPath:config.agent.startPath}:{},...config.agent.publicPaths?.length?{publicPaths:config.agent.publicPaths}:{},...config.urlSchemes?.length?{urlSchemes:config.urlSchemes}:{},...config.updates&&!options.development?{updates:{feedUrl:config.updates.feedUrl,publicKeys:config.updates.publicKeys,...config.updates.channel?{channel:config.updates.channel}:{},...config.updates.checkEveryHours!==undefined?{checkEveryHours:config.updates.checkEveryHours}:{}}}:{},...options.runtimeFlags?.length?{runtimeFlags:options.runtimeFlags}:{},...options.sourceRevision?{sourceRevision:options.sourceRevision}:{}}}export function collectViewFiles(directory){const files={};const walk=(current)=>{for(const entry of readdirSync(current).sort()){if(entry===".DS_Store")continue;const file=join(current,entry);if(statSync(file).isDirectory())walk(file);else files[`/${relative(directory,file).split(sep).join("/")}`]=file}};if(existsSync(directory))walk(directory);return files}export const BUN_HARDENED_ENTITLEMENTS={"com.apple.security.cs.allow-jit":true,"com.apple.security.cs.allow-unsigned-executable-memory":true,"com.apple.security.cs.disable-library-validation":true};export function renderWebviewEntitlements(config){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
3
|
<plist version="1.0">
|
|
4
4
|
${plistValue({...BUN_HARDENED_ENTITLEMENTS,...config.macos?.entitlements})}
|
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.598",
|
|
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.
|
|
80
|
-
"craft-native": ">=0.0.
|
|
76
|
+
"@stacksjs/config": "0.75.598",
|
|
77
|
+
"@stacksjs/router": "0.75.598",
|
|
78
|
+
"@stacksjs/server": "0.75.598",
|
|
79
|
+
"@stacksjs/storage": "0.75.598",
|
|
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.598",
|
|
84
|
+
"@stacksjs/router": "0.75.598",
|
|
85
|
+
"@stacksjs/server": "0.75.598",
|
|
86
|
+
"@stacksjs/storage": "0.75.598"
|
|
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.598",
|
|
104
104
|
"better-dx": "^0.2.39"
|
|
105
105
|
}
|
|
106
106
|
}
|