@stacksjs/actions 0.75.155 → 0.75.157
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/build/ios-shell.d.ts +3 -0
- package/dist/build/ios-shell.js +16 -0
- package/dist/build/ios.js +1 -1
- package/package.json +39 -39
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{chmodSync,mkdirSync,writeFileSync}from"node:fs";import{join}from"node:path";export function writeIosShellSupport(output,config,bunVersion=Bun.version){const version=config.shell?.bunVersion??bunVersion;if(!/^\d+\.\d+\.\d+(?:-[A-Za-z0-9.-]+)?$/.test(version))throw Error("ios.shell.bunVersion must be a Bun version such as 1.3.14");writeFileSync(join(output,".gitignore"),`# Native sources are restored from the locked Craft package.
|
|
2
|
+
*.swift
|
|
3
|
+
`);const scripts=join(output,"ci_scripts");mkdirSync(scripts,{recursive:!0});writeFileSync(join(scripts,"bunfig.toml"),`preload = []
|
|
4
|
+
`);const path=join(scripts,"ci_post_clone.sh");writeFileSync(path,`#!/bin/sh
|
|
5
|
+
set -eu
|
|
6
|
+
PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
7
|
+
ROOT="\${CI_PRIMARY_REPOSITORY_PATH:-$(git -C "$PROJECT_DIR" rev-parse --show-toplevel)}"
|
|
8
|
+
if ! command -v bun >/dev/null 2>&1; then
|
|
9
|
+
curl -fsSL https://bun.com/install -o /tmp/stacks-install-bun.sh
|
|
10
|
+
bash /tmp/stacks-install-bun.sh "bun-v${version}"
|
|
11
|
+
export PATH="$HOME/.bun/bin:$PATH"
|
|
12
|
+
fi
|
|
13
|
+
cd "$ROOT"
|
|
14
|
+
bun install --frozen-lockfile
|
|
15
|
+
bun --config="$PROJECT_DIR/ci_scripts/bunfig.toml" -e 'import { restoreIosShell } from "@stacksjs/mobile/testing"; restoreIosShell(process.argv[1])' "$PROJECT_DIR"
|
|
16
|
+
`);chmodSync(path,493)}
|
package/dist/build/ios.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{existsSync,readFileSync,writeFileSync}from"node:fs";import{pathToFileURL}from"node:url";import process from"node:process";import{log}from"@stacksjs/cli";import{projectPath,storagePath}from"@stacksjs/path";import{craftBuilderSpecifier}from"./craft-entry";import{resolveCraftBuilderProvenance}from"./craft-provenance";import{portablePaths,resolveMobilePath,toCraftIosConfig,validateIosMobileConfig,writeIosActivityTypes}from"./ios-config";import{compileNativeScreens}from"./native-screens";process.exitCode=1;async function loadCraftIosBuilder(){const explicit=process.env.CRAFT_IOS_SRC;try{if(explicit)return await import(pathToFileURL(explicit).href);return await import(craftBuilderSpecifier("ios",projectPath()))}catch(error){throw Error("Craft iOS builder is unavailable. Install the current craft-native package or set CRAFT_IOS_SRC to packages/ios/src/index.ts in a Craft checkout.",{cause:error})}}const configPath=projectPath("config/mobile.ts");if(!existsSync(configPath))throw Error("Missing config/mobile.ts. Add an ios section before running `buddy build:ios`.");const configModule=await import(`${pathToFileURL(configPath).href}?t=${Date.now()}`),mobile=configModule.default,config=mobile.ios;validateIosMobileConfig(config);if(config.swipeNavigation===!0&&config.swipeBack!=="webview")log.warn("ios.swipeNavigation turns on WebKit's edge swipe alongside the stx router's own. Remove it, or set ios.swipeBack: 'webview' for an app not on the router.");const output=resolveMobilePath(projectPath(),config.output)??storagePath("framework/mobile/ios"),webAssets=resolveMobilePath(projectPath(),config.webAssets),fallbackWebAssets=resolveMobilePath(projectPath(),config.fallbackWebAssets),craftConfig=toCraftIosConfig(config);craftConfig.appIconPath=resolveMobilePath(projectPath(),config.appIcon);craftConfig.splashImagePath=resolveMobilePath(projectPath(),config.splash?.image);craftConfig.splashImagePathDark=resolveMobilePath(projectPath(),config.splash?.imageDark);const nativeBundle=await compileNativeScreens(config,projectPath(),output);if(nativeBundle){craftConfig.nativeBundle=nativeBundle.outFile;for(const diagnostic of nativeBundle.diagnostics??[])log.warn(`${diagnostic.file?`${diagnostic.file}: `:""}${diagnostic.message}`);log.info(`Compiled ${Object.keys(config.nativeScreens??{}).length} native screen path(s) into ${nativeBundle.outFile}`)}const builder=await loadCraftIosBuilder();await builder.init({name:config.appName,bundleId:config.bundleId,teamId:config.teamId,output,config:craftConfig});await builder.build({output,htmlPath:webAssets??fallbackWebAssets,devServer:craftConfig.devServerURL,generateProject:process.env.STACKS_IOS_SKIP_XCODEGEN!=="1"});const activityTypes=writeIosActivityTypes(output,mobile);if(activityTypes)log.info(`Declared ${activityTypes.length} activity types, so a tapped Spotlight or Siri entry reaches the app`);const sourceRevision=Bun.spawnSync(["git","rev-parse","HEAD"],{cwd:projectPath()}).stdout.toString().trim(),craftConfigPath=`${output}/craft.config.json`,generatedConfig=portablePaths(JSON.parse(readFileSync(craftConfigPath,"utf8")),output,projectPath());writeFileSync(craftConfigPath,`${JSON.stringify(generatedConfig,null,2)}
|
|
1
|
+
import{existsSync,readFileSync,writeFileSync}from"node:fs";import{pathToFileURL}from"node:url";import process from"node:process";import{log}from"@stacksjs/cli";import{projectPath,storagePath}from"@stacksjs/path";import{craftBuilderSpecifier}from"./craft-entry";import{resolveCraftBuilderProvenance}from"./craft-provenance";import{portablePaths,resolveMobilePath,toCraftIosConfig,validateIosMobileConfig,writeIosActivityTypes}from"./ios-config";import{compileNativeScreens}from"./native-screens";import{writeIosShellSupport}from"./ios-shell";process.exitCode=1;async function loadCraftIosBuilder(){const explicit=process.env.CRAFT_IOS_SRC;try{if(explicit)return await import(pathToFileURL(explicit).href);return await import(craftBuilderSpecifier("ios",projectPath()))}catch(error){throw Error("Craft iOS builder is unavailable. Install the current craft-native package or set CRAFT_IOS_SRC to packages/ios/src/index.ts in a Craft checkout.",{cause:error})}}const configPath=projectPath("config/mobile.ts");if(!existsSync(configPath))throw Error("Missing config/mobile.ts. Add an ios section before running `buddy build:ios`.");const configModule=await import(`${pathToFileURL(configPath).href}?t=${Date.now()}`),mobile=configModule.default,config=mobile.ios;validateIosMobileConfig(config);if(config.swipeNavigation===!0&&config.swipeBack!=="webview")log.warn("ios.swipeNavigation turns on WebKit's edge swipe alongside the stx router's own. Remove it, or set ios.swipeBack: 'webview' for an app not on the router.");const output=resolveMobilePath(projectPath(),config.output)??storagePath("framework/mobile/ios"),webAssets=resolveMobilePath(projectPath(),config.webAssets),fallbackWebAssets=resolveMobilePath(projectPath(),config.fallbackWebAssets),craftConfig=toCraftIosConfig(config);craftConfig.appIconPath=resolveMobilePath(projectPath(),config.appIcon);craftConfig.splashImagePath=resolveMobilePath(projectPath(),config.splash?.image);craftConfig.splashImagePathDark=resolveMobilePath(projectPath(),config.splash?.imageDark);const nativeBundle=await compileNativeScreens(config,projectPath(),output);if(nativeBundle){craftConfig.nativeBundle=nativeBundle.outFile;for(const diagnostic of nativeBundle.diagnostics??[])log.warn(`${diagnostic.file?`${diagnostic.file}: `:""}${diagnostic.message}`);log.info(`Compiled ${Object.keys(config.nativeScreens??{}).length} native screen path(s) into ${nativeBundle.outFile}`)}const builder=await loadCraftIosBuilder();await builder.init({name:config.appName,bundleId:config.bundleId,teamId:config.teamId,output,config:craftConfig});await builder.build({output,htmlPath:webAssets??fallbackWebAssets,devServer:craftConfig.devServerURL,generateProject:process.env.STACKS_IOS_SKIP_XCODEGEN!=="1"});writeIosShellSupport(output,config);const activityTypes=writeIosActivityTypes(output,mobile);if(activityTypes)log.info(`Declared ${activityTypes.length} activity types, so a tapped Spotlight or Siri entry reaches the app`);const sourceRevision=Bun.spawnSync(["git","rev-parse","HEAD"],{cwd:projectPath()}).stdout.toString().trim(),craftConfigPath=`${output}/craft.config.json`,generatedConfig=portablePaths(JSON.parse(readFileSync(craftConfigPath,"utf8")),output,projectPath());writeFileSync(craftConfigPath,`${JSON.stringify(generatedConfig,null,2)}
|
|
2
2
|
`);writeFileSync(`${output}/stacks-mobile.json`,`${JSON.stringify(portablePaths({schemaVersion:"1.0.0",platform:"ios",sourceRevision,source:webAssets?{kind:"bundled",path:webAssets}:{kind:"remote",url:craftConfig.devServerURL,fallback:fallbackWebAssets?{kind:"bundled",path:fallbackWebAssets}:void 0},capabilities:config.capabilities??{},builder:resolveCraftBuilderProvenance(process.env.CRAFT_IOS_SRC),craft:generatedConfig},output,projectPath()),null,2)}
|
|
3
3
|
`);log.success(`Built the Craft iOS project in ${output}`);await log.flush();process.exitCode=0;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.157",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -66,53 +66,53 @@
|
|
|
66
66
|
"prepublishOnly": "bun run build"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@stacksjs/action-runner": "0.75.
|
|
70
|
-
"@stacksjs/ai": "0.75.
|
|
71
|
-
"@stacksjs/analytics": "0.75.
|
|
72
|
-
"@stacksjs/api": "0.75.
|
|
73
|
-
"@stacksjs/auth": "0.75.
|
|
74
|
-
"@stacksjs/build": "0.75.
|
|
69
|
+
"@stacksjs/action-runner": "0.75.157",
|
|
70
|
+
"@stacksjs/ai": "0.75.157",
|
|
71
|
+
"@stacksjs/analytics": "0.75.157",
|
|
72
|
+
"@stacksjs/api": "0.75.157",
|
|
73
|
+
"@stacksjs/auth": "0.75.157",
|
|
74
|
+
"@stacksjs/build": "0.75.157",
|
|
75
75
|
"@stacksjs/bumpx": "^0.2.21",
|
|
76
76
|
"@stacksjs/bunpress": "^0.2.15",
|
|
77
|
-
"@stacksjs/cli": "0.75.
|
|
78
|
-
"@stacksjs/cloud": "0.75.
|
|
79
|
-
"@stacksjs/cms": "0.75.
|
|
77
|
+
"@stacksjs/cli": "0.75.157",
|
|
78
|
+
"@stacksjs/cloud": "0.75.157",
|
|
79
|
+
"@stacksjs/cms": "0.75.157",
|
|
80
80
|
"@stacksjs/components": "^0.2.483",
|
|
81
|
-
"@stacksjs/config": "0.75.
|
|
82
|
-
"@stacksjs/database": "0.75.
|
|
83
|
-
"@stacksjs/desktop-build": "0.75.
|
|
84
|
-
"@stacksjs/dns": "0.75.
|
|
85
|
-
"@stacksjs/enums": "0.75.
|
|
86
|
-
"@stacksjs/env": "0.75.
|
|
87
|
-
"@stacksjs/error-handling": "0.75.
|
|
81
|
+
"@stacksjs/config": "0.75.157",
|
|
82
|
+
"@stacksjs/database": "0.75.157",
|
|
83
|
+
"@stacksjs/desktop-build": "0.75.157",
|
|
84
|
+
"@stacksjs/dns": "0.75.157",
|
|
85
|
+
"@stacksjs/enums": "0.75.157",
|
|
86
|
+
"@stacksjs/env": "0.75.157",
|
|
87
|
+
"@stacksjs/error-handling": "0.75.157",
|
|
88
88
|
"@stacksjs/gitit": "^0.2.5",
|
|
89
|
-
"@stacksjs/i18n": "0.75.
|
|
90
|
-
"@stacksjs/image": "0.75.
|
|
91
|
-
"@stacksjs/logging": "0.75.
|
|
89
|
+
"@stacksjs/i18n": "0.75.157",
|
|
90
|
+
"@stacksjs/image": "0.75.157",
|
|
91
|
+
"@stacksjs/logging": "0.75.157",
|
|
92
92
|
"@stacksjs/logsmith": "^0.2.11",
|
|
93
|
-
"@stacksjs/mobile": "0.75.
|
|
94
|
-
"@stacksjs/orm": "0.75.
|
|
95
|
-
"@stacksjs/path": "0.75.
|
|
96
|
-
"@stacksjs/payments": "0.75.
|
|
97
|
-
"@stacksjs/queue": "0.75.
|
|
98
|
-
"@stacksjs/registry": "0.75.
|
|
99
|
-
"@stacksjs/router": "0.75.
|
|
93
|
+
"@stacksjs/mobile": "0.75.157",
|
|
94
|
+
"@stacksjs/orm": "0.75.157",
|
|
95
|
+
"@stacksjs/path": "0.75.157",
|
|
96
|
+
"@stacksjs/payments": "0.75.157",
|
|
97
|
+
"@stacksjs/queue": "0.75.157",
|
|
98
|
+
"@stacksjs/registry": "0.75.157",
|
|
99
|
+
"@stacksjs/router": "0.75.157",
|
|
100
100
|
"@stacksjs/rpx": "^0.11.54",
|
|
101
|
-
"@stacksjs/scheduler": "0.75.
|
|
102
|
-
"@stacksjs/search-engine": "0.75.
|
|
103
|
-
"@stacksjs/security": "0.75.
|
|
104
|
-
"@stacksjs/server": "0.75.
|
|
105
|
-
"@stacksjs/sites": "0.75.
|
|
106
|
-
"@stacksjs/storage": "0.75.
|
|
107
|
-
"@stacksjs/strings": "0.75.
|
|
101
|
+
"@stacksjs/scheduler": "0.75.157",
|
|
102
|
+
"@stacksjs/search-engine": "0.75.157",
|
|
103
|
+
"@stacksjs/security": "0.75.157",
|
|
104
|
+
"@stacksjs/server": "0.75.157",
|
|
105
|
+
"@stacksjs/sites": "0.75.157",
|
|
106
|
+
"@stacksjs/storage": "0.75.157",
|
|
107
|
+
"@stacksjs/strings": "0.75.157",
|
|
108
108
|
"@stacksjs/stx": "^0.2.483",
|
|
109
109
|
"@stacksjs/tlsx": "^0.13.19",
|
|
110
110
|
"@stacksjs/ts-cloud": "^0.16.52",
|
|
111
111
|
"@stacksjs/ts-md": "^0.1.1",
|
|
112
|
-
"@stacksjs/tunnel": "0.75.
|
|
113
|
-
"@stacksjs/types": "0.75.
|
|
114
|
-
"@stacksjs/utils": "0.75.
|
|
115
|
-
"@stacksjs/whois": "0.75.
|
|
112
|
+
"@stacksjs/tunnel": "0.75.157",
|
|
113
|
+
"@stacksjs/types": "0.75.157",
|
|
114
|
+
"@stacksjs/utils": "0.75.157",
|
|
115
|
+
"@stacksjs/whois": "0.75.157",
|
|
116
116
|
"bun-plugin-stx": "^0.2.483"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
|
-
"@stacksjs/validation": "0.75.
|
|
131
|
+
"@stacksjs/validation": "0.75.157",
|
|
132
132
|
"better-dx": "^0.2.24"
|
|
133
133
|
}
|
|
134
134
|
}
|