also looking at this
feat: finish native customization and platform seams
#401
21 files
+707
-17
| @@ -1052,6 +1052,36 @@ all: no `WKWebView` is ever created. | ||
| 1052 | 1052 | capabilities whenever `enableGeolocation` / `enableAppleMusic` are set. The |
| 1053 | 1053 | single-screen native app (no `nativeScreens`) gets them as well. |
| 1054 | 1054 | |
| 1055 | ### Generated project customization | |
| 1056 | ||
| 1057 | Generated native sources are owned by Craft and may be replaced on the next | |
| 1058 | build. Use typed configuration for common chrome changes, and declare a hook | |
| 1059 | only 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 | ||
| 1073 | The `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`. | |
| 1075 | Omitted values preserve each host's default selection appearance. | |
| 1076 | ||
| 1077 | `postGenerate` runs after `craft ios build` or `craft android build` generates | |
| 1078 | the native project. The command runs with the generated project as its working | |
| 1079 | directory and is launched directly from `command` plus `args` (no shell | |
| 1080 | interpolation). Craft provides `CRAFT_PROJECT_ROOT`, `CRAFT_PLATFORM`, and | |
| 1081 | `CRAFT_GENERATE_PHASE=build`. Missing executables, malformed options, and | |
| 1082 | non-zero exits fail the build and include the hook's stderr, so a source patch | |
| 1083 | cannot silently stop applying after a template change. | |
| 1084 | ||
| 1055 | 1085 | ### The app script (`nativeApp`) |
| 1056 | 1086 | |
| 1057 | 1087 | `nativeApp` names a bundle route that has no screen (Stacks names it `__app`). |