ReviewOS

also looking at this

craft-native/craft

feat: finish native customization and platform seams

#401
Merged glennmichael123 wants to merge codex/issues-388-400-344 into main
21 files +707 -17
docs/guides/native-stx.mdmodified+30-0
Changes to docs/guides/native-stx.md
@@ -1052,6 +1052,36 @@ all: no `WKWebView` is ever created.
10521052 capabilities whenever `enableGeolocation` / `enableAppleMusic` are set. The
10531053 single-screen native app (no `nativeScreens`) gets them as well.
10541054
1055### Generated project customization
1056
1057Generated native sources are owned by Craft and may be replaced on the next
1058build. Use typed configuration for common chrome changes, and declare a hook
1059only for app-owned source changes that Craft does not model yet:
1060
1061```json
1062{
1063 "tabBar": {
1064 "selection": { "cornerRadius": 8, "color": "#123456" }
1065 },
1066 "postGenerate": {
1067 "command": "bun",
1068 "args": ["run", "scripts/customize-native.ts"]
1069 }
1070}
1071```
1072
1073The `tabBar.selection` option is shared by the iOS and Android builders. Its
1074`cornerRadius` is in points on iOS and dp on Android; `color` is `#RRGGBB`.
1075Omitted values preserve each host's default selection appearance.
1076
1077`postGenerate` runs after `craft ios build` or `craft android build` generates
1078the native project. The command runs with the generated project as its working
1079directory and is launched directly from `command` plus `args` (no shell
1080interpolation). Craft provides `CRAFT_PROJECT_ROOT`, `CRAFT_PLATFORM`, and
1081`CRAFT_GENERATE_PHASE=build`. Missing executables, malformed options, and
1082non-zero exits fail the build and include the hook's stderr, so a source patch
1083cannot silently stop applying after a template change.
1084
10551085### The app script (`nativeApp`)
10561086
10571087`nativeApp` names a bundle route that has no screen (Stacks names it `__app`).