@stacksjs/actions 0.75.89 → 0.75.90

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.
@@ -32,6 +32,7 @@ export declare interface CraftIosConfig {
32
32
  urlSchemes?: string[]
33
33
  trustedOrigins?: string[]
34
34
  appBoundDomains?: string[]
35
+ limitNavigationsToAppBoundDomains?: boolean
35
36
  associatedDomains?: string[]
36
37
  appGroups?: string[]
37
38
  appIconPath?: string
@@ -1,4 +1,4 @@
1
- import{existsSync,readFileSync,writeFileSync}from"node:fs";import{isAbsolute,join,resolve}from"node:path";import{spotlightActivityTypes}from"@stacksjs/mobile";const CAPABILITY_KEYS={speechRecognition:"enableSpeechRecognition",haptics:"enableHaptics",share:"enableShare",camera:"enableCamera",biometric:"enableBiometric",pushNotifications:"enablePushNotifications",secureStorage:"enableSecureStorage",geolocation:"enableGeolocation",backgroundLocation:"enableBackgroundLocation",clipboard:"enableClipboard",contacts:"enableContacts",calendar:"enableCalendar",localNotifications:"enableLocalNotifications",inAppPurchase:"enableInAppPurchase",keepAwake:"enableKeepAwake",orientationLock:"enableOrientationLock",deepLinks:"enableDeepLinks",qrScanner:"enableQRScanner",localNetwork:"enableLocalNetwork",filePicker:"enableFilePicker",fileDownload:"enableFileDownload",socialAuth:"enableSocialAuth",audioRecording:"enableAudioRecording",videoRecording:"enableVideoRecording",motionSensors:"enableMotionSensors",localDatabase:"enableLocalDatabase",bluetooth:"enableBluetooth",nfc:"enableNFC",healthKit:"enableHealthKit",liveActivities:"enableLiveActivities",watchApp:"enableWatchApp",backgroundTasks:"enableBackgroundTasks",screenCapture:"enableScreenCapture",pdfViewer:"enablePDFViewer",augmentedReality:"enableAR",machineLearning:"enableMLKit"};export function normalizeMobileUrl(value){const input=value?.trim();if(!input)return;return new URL(/^https?:\/\//i.test(input)?input:`https://${input}`).toString().replace(/\/$/,"")}export function resolveMobilePath(root,value){if(!value)return;return isAbsolute(value)?value:resolve(root,value)}export function toCraftIosConfig(config){const devServerURL=normalizeMobileUrl(config.url),trustedOrigins=new Set(config.trustedOrigins??[]);if(devServerURL)trustedOrigins.add(new URL(devServerURL).origin);const craft={appName:config.appName,bundleId:config.bundleId,version:config.version,buildNumber:config.buildNumber,darkMode:config.darkMode,appearance:config.appearance,backgroundColor:config.backgroundColor,backgroundColorDark:config.backgroundColorDark,swipeNavigation:config.swipeNavigation,iosVersion:config.deploymentTarget,watchosVersion:config.watchDeploymentTarget,teamId:config.teamId,devServerURL,urlSchemes:config.urlSchemes,trustedOrigins:[...trustedOrigins],appBoundDomains:config.appBoundDomains,associatedDomains:config.associatedDomains,appGroups:config.appGroups,appIconPath:config.appIcon,privacy:config.privacy,orientations:config.orientations,deviceFamilies:config.deviceFamilies};for(const[key,nativeKey]of Object.entries(CAPABILITY_KEYS)){const enabled=config.capabilities?.[key];if(enabled!==void 0)craft[nativeKey]=enabled}if(config.capabilities?.backgroundLocation)craft.enableGeolocation=!0;for(const key of Object.keys(craft))if(craft[key]===void 0)delete craft[key];return craft}export function validateIosMobileConfig(config){if(!config.appName?.trim())throw Error("config/mobile.ts must define ios.appName");if(!/^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/.test(config.bundleId))throw Error(`Invalid iOS bundle identifier: ${config.bundleId}`);if(config.url&&config.webAssets)throw Error("Choose either ios.url or ios.webAssets in config/mobile.ts, not both");if(!config.url&&!config.webAssets)throw Error("config/mobile.ts must define ios.url or ios.webAssets");if(config.fallbackWebAssets&&!config.url)throw Error("ios.fallbackWebAssets requires ios.url");if(config.deviceFamilies&&(config.deviceFamilies.length===0||config.deviceFamilies.some((family)=>family!=="iphone"&&family!=="ipad")))throw Error("ios.deviceFamilies must contain iphone and/or ipad");if(config.url){const url=new URL(normalizeMobileUrl(config.url)),isLocal=["localhost","127.0.0.1","::1"].includes(url.hostname);if(url.protocol!=="https:"&&!isLocal)throw Error("ios.url must use HTTPS outside local development")}for(const domain of config.associatedDomains??[])if(!/^(applinks|webcredentials|activitycontinuation):[^/\s]+$/.test(domain))throw Error(`Invalid iOS associated domain: ${domain}`);if(config.capabilities?.watchApp){const target=Number.parseFloat(config.watchDeploymentTarget??"9.0");if(!Number.isFinite(target)||target<9)throw Error("ios.watchDeploymentTarget must be watchOS 9.0 or newer")}}const ACTIVITY_TYPES_BLOCK=/[ \t]*<key>NSUserActivityTypes<\/key>\s*<array>[\s\S]*?<\/array>\n?/;export function withActivityTypes(plist,types){const entries=types.map((type)=>` <string>${escapeXml(type)}</string>`).join(`
1
+ import{existsSync,readFileSync,writeFileSync}from"node:fs";import{isAbsolute,join,resolve}from"node:path";import{spotlightActivityTypes}from"@stacksjs/mobile";const CAPABILITY_KEYS={speechRecognition:"enableSpeechRecognition",haptics:"enableHaptics",share:"enableShare",camera:"enableCamera",biometric:"enableBiometric",pushNotifications:"enablePushNotifications",secureStorage:"enableSecureStorage",geolocation:"enableGeolocation",backgroundLocation:"enableBackgroundLocation",clipboard:"enableClipboard",contacts:"enableContacts",calendar:"enableCalendar",localNotifications:"enableLocalNotifications",inAppPurchase:"enableInAppPurchase",keepAwake:"enableKeepAwake",orientationLock:"enableOrientationLock",deepLinks:"enableDeepLinks",qrScanner:"enableQRScanner",localNetwork:"enableLocalNetwork",filePicker:"enableFilePicker",fileDownload:"enableFileDownload",socialAuth:"enableSocialAuth",audioRecording:"enableAudioRecording",videoRecording:"enableVideoRecording",motionSensors:"enableMotionSensors",localDatabase:"enableLocalDatabase",bluetooth:"enableBluetooth",nfc:"enableNFC",healthKit:"enableHealthKit",liveActivities:"enableLiveActivities",watchApp:"enableWatchApp",backgroundTasks:"enableBackgroundTasks",screenCapture:"enableScreenCapture",pdfViewer:"enablePDFViewer",augmentedReality:"enableAR",machineLearning:"enableMLKit"};export function normalizeMobileUrl(value){const input=value?.trim();if(!input)return;return new URL(/^https?:\/\//i.test(input)?input:`https://${input}`).toString().replace(/\/$/,"")}export function resolveMobilePath(root,value){if(!value)return;return isAbsolute(value)?value:resolve(root,value)}export function toCraftIosConfig(config){const devServerURL=normalizeMobileUrl(config.url),trustedOrigins=new Set(config.trustedOrigins??[]);if(devServerURL)trustedOrigins.add(new URL(devServerURL).origin);const declaresAppBoundDomains=(config.appBoundDomains?.length??0)>0,craft={appName:config.appName,bundleId:config.bundleId,version:config.version,buildNumber:config.buildNumber,darkMode:config.darkMode,appearance:config.appearance,backgroundColor:config.backgroundColor,backgroundColorDark:config.backgroundColorDark,swipeNavigation:config.swipeNavigation,iosVersion:config.deploymentTarget,watchosVersion:config.watchDeploymentTarget,teamId:config.teamId,devServerURL,urlSchemes:config.urlSchemes,trustedOrigins:[...trustedOrigins],appBoundDomains:config.appBoundDomains,limitNavigationsToAppBoundDomains:config.limitNavigationsToAppBoundDomains??(declaresAppBoundDomains||void 0),associatedDomains:config.associatedDomains,appGroups:config.appGroups,appIconPath:config.appIcon,privacy:config.privacy,orientations:config.orientations,deviceFamilies:config.deviceFamilies};for(const[key,nativeKey]of Object.entries(CAPABILITY_KEYS)){const enabled=config.capabilities?.[key];if(enabled!==void 0)craft[nativeKey]=enabled}if(config.capabilities?.backgroundLocation)craft.enableGeolocation=!0;for(const key of Object.keys(craft))if(craft[key]===void 0)delete craft[key];return craft}export function validateIosMobileConfig(config){if(!config.appName?.trim())throw Error("config/mobile.ts must define ios.appName");if(!/^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/.test(config.bundleId))throw Error(`Invalid iOS bundle identifier: ${config.bundleId}`);if(config.url&&config.webAssets)throw Error("Choose either ios.url or ios.webAssets in config/mobile.ts, not both");if(!config.url&&!config.webAssets)throw Error("config/mobile.ts must define ios.url or ios.webAssets");if(config.fallbackWebAssets&&!config.url)throw Error("ios.fallbackWebAssets requires ios.url");if(config.deviceFamilies&&(config.deviceFamilies.length===0||config.deviceFamilies.some((family)=>family!=="iphone"&&family!=="ipad")))throw Error("ios.deviceFamilies must contain iphone and/or ipad");if(config.url){const url=new URL(normalizeMobileUrl(config.url)),isLocal=["localhost","127.0.0.1","::1"].includes(url.hostname);if(url.protocol!=="https:"&&!isLocal)throw Error("ios.url must use HTTPS outside local development")}for(const domain of config.associatedDomains??[])if(!/^(applinks|webcredentials|activitycontinuation):[^/\s]+$/.test(domain))throw Error(`Invalid iOS associated domain: ${domain}`);if(config.capabilities?.watchApp){const target=Number.parseFloat(config.watchDeploymentTarget??"9.0");if(!Number.isFinite(target)||target<9)throw Error("ios.watchDeploymentTarget must be watchOS 9.0 or newer")}}const ACTIVITY_TYPES_BLOCK=/[ \t]*<key>NSUserActivityTypes<\/key>\s*<array>[\s\S]*?<\/array>\n?/;export function withActivityTypes(plist,types){const entries=types.map((type)=>` <string>${escapeXml(type)}</string>`).join(`
2
2
  `),block=types.length===0?"":` <key>NSUserActivityTypes</key>
3
3
  <array>
4
4
  ${entries}
package/dist/commit.js CHANGED
@@ -1 +1 @@
1
- import{NpmScript}from"@stacksjs/enums";import{log}from"@stacksjs/logging";import{projectPath}from"@stacksjs/path";import{runNpmScript}from"@stacksjs/utils";export async function invoke(options){log.info("Committing...");await runNpmScript(NpmScript.Commit,{cwd:projectPath(),...options});log.success("Committed")}export async function commit(options){return await invoke(options)}
1
+ import process from"node:process";import{NpmScript}from"@stacksjs/enums";import{log}from"@stacksjs/logging";import{projectPath}from"@stacksjs/path";import{ExitCode}from"@stacksjs/types";import{runNpmScript}from"@stacksjs/utils";export async function invoke(options){log.info("Committing...");if((await runNpmScript(NpmScript.Commit,{cwd:projectPath(),...options})).isErr){await log.error("Nothing was committed.");await log.flush();process.exit(ExitCode.FatalError)}log.success("Committed")}export async function commit(options){return await invoke(options)}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.89",
5
+ "version": "0.75.90",
6
6
  "description": "The Stacks actions.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -66,53 +66,53 @@
66
66
  "prepublishOnly": "bun run build"
67
67
  },
68
68
  "dependencies": {
69
- "@stacksjs/action-runner": "0.75.89",
70
- "@stacksjs/ai": "0.75.89",
71
- "@stacksjs/analytics": "0.75.89",
72
- "@stacksjs/api": "0.75.89",
73
- "@stacksjs/auth": "0.75.89",
74
- "@stacksjs/build": "0.75.89",
69
+ "@stacksjs/action-runner": "0.75.90",
70
+ "@stacksjs/ai": "0.75.90",
71
+ "@stacksjs/analytics": "0.75.90",
72
+ "@stacksjs/api": "0.75.90",
73
+ "@stacksjs/auth": "0.75.90",
74
+ "@stacksjs/build": "0.75.90",
75
75
  "@stacksjs/bumpx": "^0.2.18",
76
76
  "@stacksjs/bunpress": "^0.2.15",
77
- "@stacksjs/cli": "0.75.89",
78
- "@stacksjs/cloud": "0.75.89",
79
- "@stacksjs/cms": "0.75.89",
77
+ "@stacksjs/cli": "0.75.90",
78
+ "@stacksjs/cloud": "0.75.90",
79
+ "@stacksjs/cms": "0.75.90",
80
80
  "@stacksjs/components": "^0.2.395",
81
- "@stacksjs/config": "0.75.89",
82
- "@stacksjs/database": "0.75.89",
83
- "@stacksjs/desktop-build": "0.75.89",
84
- "@stacksjs/dns": "0.75.89",
85
- "@stacksjs/enums": "0.75.89",
86
- "@stacksjs/env": "0.75.89",
87
- "@stacksjs/error-handling": "0.75.89",
81
+ "@stacksjs/config": "0.75.90",
82
+ "@stacksjs/database": "0.75.90",
83
+ "@stacksjs/desktop-build": "0.75.90",
84
+ "@stacksjs/dns": "0.75.90",
85
+ "@stacksjs/enums": "0.75.90",
86
+ "@stacksjs/env": "0.75.90",
87
+ "@stacksjs/error-handling": "0.75.90",
88
88
  "@stacksjs/gitit": "^0.2.5",
89
- "@stacksjs/i18n": "0.75.89",
90
- "@stacksjs/image": "0.75.89",
91
- "@stacksjs/logging": "0.75.89",
89
+ "@stacksjs/i18n": "0.75.90",
90
+ "@stacksjs/image": "0.75.90",
91
+ "@stacksjs/logging": "0.75.90",
92
92
  "@stacksjs/logsmith": "^0.2.11",
93
- "@stacksjs/mobile": "0.75.89",
94
- "@stacksjs/orm": "0.75.89",
95
- "@stacksjs/path": "0.75.89",
96
- "@stacksjs/payments": "0.75.89",
97
- "@stacksjs/queue": "0.75.89",
98
- "@stacksjs/registry": "0.75.89",
99
- "@stacksjs/router": "0.75.89",
93
+ "@stacksjs/mobile": "0.75.90",
94
+ "@stacksjs/orm": "0.75.90",
95
+ "@stacksjs/path": "0.75.90",
96
+ "@stacksjs/payments": "0.75.90",
97
+ "@stacksjs/queue": "0.75.90",
98
+ "@stacksjs/registry": "0.75.90",
99
+ "@stacksjs/router": "0.75.90",
100
100
  "@stacksjs/rpx": "^0.11.54",
101
- "@stacksjs/scheduler": "0.75.89",
102
- "@stacksjs/search-engine": "0.75.89",
103
- "@stacksjs/security": "0.75.89",
104
- "@stacksjs/server": "0.75.89",
105
- "@stacksjs/sites": "0.75.89",
106
- "@stacksjs/storage": "0.75.89",
107
- "@stacksjs/strings": "0.75.89",
101
+ "@stacksjs/scheduler": "0.75.90",
102
+ "@stacksjs/search-engine": "0.75.90",
103
+ "@stacksjs/security": "0.75.90",
104
+ "@stacksjs/server": "0.75.90",
105
+ "@stacksjs/sites": "0.75.90",
106
+ "@stacksjs/storage": "0.75.90",
107
+ "@stacksjs/strings": "0.75.90",
108
108
  "@stacksjs/stx": "^0.2.395",
109
109
  "@stacksjs/tlsx": "^0.13.19",
110
110
  "@stacksjs/ts-cloud": "^0.16.47",
111
111
  "@stacksjs/ts-md": "^0.1.1",
112
- "@stacksjs/tunnel": "0.75.89",
113
- "@stacksjs/types": "0.75.89",
114
- "@stacksjs/utils": "0.75.89",
115
- "@stacksjs/whois": "0.75.89",
112
+ "@stacksjs/tunnel": "0.75.90",
113
+ "@stacksjs/types": "0.75.90",
114
+ "@stacksjs/utils": "0.75.90",
115
+ "@stacksjs/whois": "0.75.90",
116
116
  "bun-plugin-stx": "^0.2.395"
117
117
  },
118
118
  "peerDependencies": {
@@ -128,7 +128,7 @@
128
128
  }
129
129
  },
130
130
  "devDependencies": {
131
- "@stacksjs/validation": "0.75.89",
131
+ "@stacksjs/validation": "0.75.90",
132
132
  "better-dx": "^0.2.24"
133
133
  }
134
134
  }