also looking at this
feat: finish native customization and platform seams
#401
21 files
+707
-17
| @@ -391,6 +391,29 @@ Appearance and navigation: | ||
| 391 | 391 | - `swipeNavigation`: an edge swipe goes back and forward through the page's |
| 392 | 392 | history, pushState entries included. |
| 393 | 393 | |
| 394 | Native tab-bar selection styling is opt-in and lives in the generated config, | |
| 395 | so the generated Swift never needs to be patched: | |
| 396 | ||
| 397 | ```json | |
| 398 | { | |
| 399 | "tabBar": { | |
| 400 | "selection": { "cornerRadius": 8, "color": "#123456" } | |
| 401 | }, | |
| 402 | "postGenerate": { | |
| 403 | "command": "bun", | |
| 404 | "args": ["run", "scripts/customize-native.ts"] | |
| 405 | } | |
| 406 | } | |
| 407 | ``` | |
| 408 | ||
| 409 | `cornerRadius` is measured in points and `color` is `#RRGGBB`; omit either to | |
| 410 | keep its host default. `postGenerate` runs after `craft ios build` has written | |
| 411 | the Xcode project, with the generated project as its working directory. Craft | |
| 412 | does not invoke a shell: `command` and `args` are passed directly. The hook | |
| 413 | receives `CRAFT_PROJECT_ROOT`, `CRAFT_PLATFORM=ios`, and | |
| 414 | `CRAFT_GENERATE_PHASE=build`. A missing executable, non-zero exit, or invalid | |
| 415 | configuration fails the build with the hook's stderr in the diagnostic. | |
| 416 | ||
| 394 | 417 | Debug builds let Safari's Develop menu inspect the webview, and relay the |
| 395 | 418 | page's console, uncaught errors, rejected promises and failed script loads to |
| 396 | 419 | the device log as `[craft page] …`, so a page that only breaks inside the app |