@stacksjs/desktop-build 0.75.765 → 0.75.770
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/macos-app.d.ts +2 -0
- package/dist/macos-app.js +2 -2
- package/package.json +10 -10
package/dist/macos-app.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export declare function macosHostUpdates(updates: DesktopUpdatesConfig): MacosHo
|
|
|
17
17
|
export declare function macosSelfUpdates(config: Pick<MacosDesktopConfig, 'updates'>, distribution: MacosDistribution | undefined): boolean;
|
|
18
18
|
/** Screen name to its `.stx` source, relative to the project root. */
|
|
19
19
|
export declare function macosScreens(config: Pick<MacosDesktopConfig, 'nativeScreens' | 'nativeScreensDir'>): Record<string, string>;
|
|
20
|
+
/** Why a global shortcut's accelerator would be refused by the host, or null when it would not. */
|
|
21
|
+
export declare function acceleratorProblem(accelerator: string): string | null;
|
|
20
22
|
/**
|
|
21
23
|
* What the host reads from `Contents/Resources/craft-app.json` when Finder
|
|
22
24
|
* launches it with no arguments. `updates` is written for a development or
|
package/dist/macos-app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
-
`}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," ")}
|
|
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));errors.push(...menuBarProblems(config,names));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}}const ACCELERATOR_MODIFIERS=new Set(["cmd","command","meta","super","cmdorctrl","commandorcontrol","commandorctrl","cmdorcontrol","ctrl","control","alt","option","opt","shift"]);const ACCELERATOR_KEYS=new Set(["-","minus","=","equal","plus","[","]",";","'",",",".","/","\\","`","space","return","enter","tab","escape","esc","backspace","delete","forwarddelete","up","down","left","right","home","end","pageup","pagedown"]);export function acceleratorProblem(accelerator){const parts=accelerator.toLowerCase().split("+").map((part)=>part.trim());const key=parts.at(-1)??"";if(!key||parts.slice(0,-1).includes(""))return"is not a shortcut: write modifiers and a key, like cmd+shift+k";const unknown=parts.slice(0,-1).find((part)=>!ACCELERATOR_MODIFIERS.has(part));if(unknown)return`names "${unknown}", which is not a modifier: use cmd, ctrl, alt or shift`;const functionKey=/^f(?:[1-9]|1\d|20)$/.test(key);if(!/^[a-z0-9]$/.test(key)&&!functionKey&&!ACCELERATOR_KEYS.has(key))return`ends with "${key}", which is not a key a shortcut can use`;const modifiers=parts.slice(0,-1);if(!functionKey&&!modifiers.some((part)=>part!=="shift"))return"needs cmd, ctrl or alt: without one it would take the key from every app's typing";return null}function menuBarProblems(config,screens){const errors=[];const items=config.statusItems??[];if(config.menuBarOnly&&!items.length)errors.push("macos.menuBarOnly needs at least one macos.statusItems entry: without one the app has no way to be reached");const seen=new Set;for(const[index,item]of items.entries()){const where=`macos.statusItems[${index}]`;if(!item?.id?.trim())errors.push(`${where} needs an id`);else if(seen.has(item.id))errors.push(`${where}: the id "${item.id}" is used twice`);else seen.add(item.id);if(!item?.icon?.trim()&&!item?.title?.trim())errors.push(`${where} needs an icon or a title`);if(item?.popover){if(!screens.includes(item.popover.screen))errors.push(`${where}.popover.screen "${item.popover.screen}" is not one of the native screens (${screens.join(", ")})`);for(const side of["width","height"]){const value=item.popover[side];if(value!==undefined&&!(Number.isFinite(value)&&value>0))errors.push(`${where}.popover.${side} must be a positive number of points`)}}for(const[position,entry]of(item?.menu??[]).entries()){if(!entry?.separator&&(!entry?.id?.trim()||!entry?.label?.trim()))errors.push(`${where}.menu[${position}] needs an id and a label, or separator: true`)}}const shortcuts=new Set;for(const[index,shortcut]of(config.globalShortcuts??[]).entries()){const where=`macos.globalShortcuts[${index}]`;if(!shortcut?.id?.trim())errors.push(`${where} needs an id`);else if(shortcuts.has(shortcut.id))errors.push(`${where}: the id "${shortcut.id}" is used twice`);else shortcuts.add(shortcut.id);const problem=typeof shortcut?.accelerator==="string"?acceleratorProblem(shortcut.accelerator):"is missing";if(problem)errors.push(`${where}.accelerator ${problem}`)}return errors}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.menuBarOnly?{menuBarOnly:true}:{},...config.statusItems?.length?{statusItems:config.statusItems.map(hostStatusItem)}:{},...config.globalShortcuts?.length?{globalShortcuts:config.globalShortcuts.map(({id,accelerator})=>({id,accelerator}))}:{},...config.updates&&macosSelfUpdates(config,distribution)?{updates:macosHostUpdates(config.updates)}:{}},null,2)}
|
|
2
|
+
`}function hostStatusItem(item){const{popover,...rest}=item;if(!popover)return rest;const{screen,...size}=popover;return{...rest,popover:{route:screen,...size}}}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(",")]:[],...config.menuBarOnly?["--menu-bar-only"]:[]]}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};if(config.menuBarOnly&&declared.LSUIElement===undefined)declared.LSUIElement=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>
|
|
5
5
|
`:"";const xml=`<?xml version="1.0" encoding="UTF-8"?>
|
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.770",
|
|
6
6
|
"description": "Build and launch Craft desktop applications for Stacks",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -73,17 +73,17 @@
|
|
|
73
73
|
"prepublishOnly": "bun run build"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@stacksjs/config": "0.75.
|
|
77
|
-
"@stacksjs/router": "0.75.
|
|
78
|
-
"@stacksjs/server": "0.75.
|
|
79
|
-
"@stacksjs/storage": "0.75.
|
|
76
|
+
"@stacksjs/config": "0.75.770",
|
|
77
|
+
"@stacksjs/router": "0.75.770",
|
|
78
|
+
"@stacksjs/server": "0.75.770",
|
|
79
|
+
"@stacksjs/storage": "0.75.770",
|
|
80
80
|
"craft-native": ">=0.0.505"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"@stacksjs/config": "0.75.
|
|
84
|
-
"@stacksjs/router": "0.75.
|
|
85
|
-
"@stacksjs/server": "0.75.
|
|
86
|
-
"@stacksjs/storage": "0.75.
|
|
83
|
+
"@stacksjs/config": "0.75.770",
|
|
84
|
+
"@stacksjs/router": "0.75.770",
|
|
85
|
+
"@stacksjs/server": "0.75.770",
|
|
86
|
+
"@stacksjs/storage": "0.75.770"
|
|
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.770",
|
|
104
104
|
"better-dx": "^0.2.42"
|
|
105
105
|
}
|
|
106
106
|
}
|