@marktiderman/genesis-cli 1.5.0 → 1.7.0
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/README.md +224 -3
- package/dist/cli.js +4602 -1549
- package/dist/cli.js.map +1 -1
- package/dist/{config-Ci-_Ue-1.d.ts → config-CrZbM3jD.d.ts} +73 -4
- package/dist/doctor.d.ts +31 -4
- package/dist/doctor.js +976 -30
- package/dist/doctor.js.map +1 -1
- package/dist/expo.d.ts +91 -8
- package/dist/expo.js +207 -14
- package/dist/expo.js.map +1 -1
- package/dist/genesis-catalog.json +502 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +987 -38
- package/dist/index.js.map +1 -1
- package/dist/scaffolder.d.ts +1 -1
- package/dist/scaffolder.js +9 -6
- package/dist/scaffolder.js.map +1 -1
- package/dist/starter/.eas/scripts/rollout-health.mjs +85 -0
- package/dist/starter/.eas/workflows/deploy-production.yml +149 -0
- package/dist/starter/.eas/workflows/e2e.yml +77 -0
- package/dist/starter/.eas/workflows/pr-preview.yml +117 -0
- package/dist/starter/.eas/workflows/rollout.yml +120 -0
- package/dist/starter/.env.example +11 -0
- package/dist/starter/.fingerprintignore +7 -0
- package/dist/starter/.maestro/README.md +38 -0
- package/dist/starter/.maestro/config.yaml +5 -0
- package/dist/starter/.maestro/flows/deep-link.yaml +22 -0
- package/dist/starter/.maestro/flows/launch.yaml +17 -0
- package/dist/starter/.maestro/flows/settings-version.yaml +28 -0
- package/dist/starter/.maestro/flows/sign-in-screen.yaml +17 -0
- package/dist/starter/.maestro/subflows/sign-in.yaml +20 -0
- package/dist/starter/README.md +314 -0
- package/dist/starter/__tests__/app-config.test.ts +51 -0
- package/dist/starter/__tests__/check-in-photos.test.ts +57 -0
- package/dist/starter/__tests__/components/css-stub.js +2 -0
- package/dist/starter/__tests__/components/fake-supabase.ts +136 -0
- package/dist/starter/__tests__/components/links.test.ts +25 -0
- package/dist/starter/__tests__/components/render-app.ts +22 -0
- package/dist/starter/__tests__/components/reports.ts +10 -0
- package/dist/starter/__tests__/components/resolver.js +12 -0
- package/dist/starter/__tests__/components/root-layout.test.tsx +55 -0
- package/dist/starter/__tests__/components/session-storage.test.tsx +81 -0
- package/dist/starter/__tests__/components/settings.test.tsx +134 -0
- package/dist/starter/__tests__/components/setup.ts +69 -0
- package/dist/starter/__tests__/components/sign-in.test.tsx +90 -0
- package/dist/starter/__tests__/components/tabs-feature-off.test.tsx +19 -0
- package/dist/starter/__tests__/components/tabs.test.tsx +43 -0
- package/dist/starter/__tests__/components/tabs.ts +12 -0
- package/dist/starter/__tests__/entry.test.ts +28 -0
- package/dist/starter/__tests__/inline-copy.ts +59 -0
- package/dist/starter/__tests__/starter.test.ts +319 -0
- package/dist/starter/_gitignore +13 -0
- package/dist/starter/app.config.ts +44 -0
- package/dist/starter/babel.config.js +9 -0
- package/dist/starter/eas.json +47 -0
- package/dist/starter/eslint.config.js +5 -0
- package/dist/starter/genesis.config.json +12 -0
- package/dist/starter/global.css +3 -0
- package/dist/starter/index.ts +14 -0
- package/dist/starter/jest.config.js +36 -0
- package/dist/starter/metro.config.js +38 -0
- package/dist/starter/package.json +93 -0
- package/dist/starter/pnpm-workspace.yaml +73 -0
- package/dist/starter/src/app/(app)/(home)/_layout.tsx +6 -0
- package/dist/starter/src/app/(app)/(home)/check-in.tsx +41 -0
- package/dist/starter/src/app/(app)/(home)/index.tsx +34 -0
- package/dist/starter/src/app/(app)/_layout.tsx +27 -0
- package/dist/starter/src/app/(app)/notifications/_layout.tsx +6 -0
- package/dist/starter/src/app/(app)/notifications/index.tsx +36 -0
- package/dist/starter/src/app/(app)/settings/_layout.tsx +6 -0
- package/dist/starter/src/app/(app)/settings/index.tsx +96 -0
- package/dist/starter/src/app/(app)/settings/notifications.tsx +16 -0
- package/dist/starter/src/app/(app)/settings/support/[id].tsx +23 -0
- package/dist/starter/src/app/(app)/settings/support/ideas.tsx +20 -0
- package/dist/starter/src/app/(app)/settings/support/index.tsx +20 -0
- package/dist/starter/src/app/(app)/settings/support/new.tsx +35 -0
- package/dist/starter/src/app/(app)/settings/support/shipped.tsx +20 -0
- package/dist/starter/src/app/+native-intent.ts +11 -0
- package/dist/starter/src/app/_layout.tsx +20 -0
- package/dist/starter/src/app/sign-in.tsx +69 -0
- package/dist/starter/src/copy.ts +118 -0
- package/dist/starter/src/forms/check-in.json +121 -0
- package/dist/starter/src/lib/account.ts +42 -0
- package/dist/starter/src/lib/app.ts +52 -0
- package/dist/starter/src/lib/auth.ts +80 -0
- package/dist/starter/src/lib/check-in-photos.ts +66 -0
- package/dist/starter/src/lib/check-in.ts +85 -0
- package/dist/starter/src/lib/define-starter.ts +148 -0
- package/dist/starter/src/lib/devtools-overlay.ts +34 -0
- package/dist/starter/src/lib/devtools.ts +23 -0
- package/dist/starter/src/lib/env.ts +33 -0
- package/dist/starter/src/lib/google-signin.ts +23 -0
- package/dist/starter/src/lib/links.ts +40 -0
- package/dist/starter/src/lib/native-modules.ts +27 -0
- package/dist/starter/src/lib/notifications.ts +15 -0
- package/dist/starter/src/lib/observability.ts +45 -0
- package/dist/starter/src/lib/push.ts +49 -0
- package/dist/starter/src/lib/supabase.ts +65 -0
- package/dist/starter/src/lib/support.ts +44 -0
- package/dist/starter/src/lib/updates.ts +61 -0
- package/dist/starter/starter.config.ts +37 -0
- package/dist/starter/supabase/config.toml +26 -0
- package/dist/starter/supabase/functions/genesis-apple-revoke/apple.ts +237 -0
- package/dist/starter/supabase/functions/genesis-apple-revoke/handler.ts +227 -0
- package/dist/starter/supabase/functions/genesis-apple-revoke/index.ts +55 -0
- package/dist/starter/supabase/functions/genesis-push-send/expo.ts +117 -0
- package/dist/starter/supabase/functions/genesis-push-send/handler.ts +462 -0
- package/dist/starter/supabase/functions/genesis-push-send/index.ts +54 -0
- package/dist/starter/supabase/migrations/20261024000000_genesis_account_deletion.sql +133 -0
- package/dist/starter/supabase/migrations/20261024000100_genesis_app_release_policy.sql +82 -0
- package/dist/starter/supabase/migrations/20261024000200_genesis_apple_token_revocation.sql +205 -0
- package/dist/starter/supabase/migrations/20261024000400_genesis_push.sql +524 -0
- package/dist/starter/supabase/migrations/20261024000600_genesis_support.sql +846 -0
- package/dist/starter/supabase/tests/database/genesis_account_deletion.test.sql +138 -0
- package/dist/starter/supabase/tests/database/genesis_app_release_policy.test.sql +148 -0
- package/dist/starter/supabase/tests/database/genesis_apple_token_revocation.test.sql +230 -0
- package/dist/starter/supabase/tests/database/genesis_push.test.sql +407 -0
- package/dist/starter/supabase/tests/database/genesis_support.test.sql +552 -0
- package/dist/starter/tailwind.config.mjs +15 -0
- package/dist/starter/tsconfig.json +14 -0
- package/dist/starter/vitest.config.mts +7 -0
- package/dist/templates/ci/app-ci.yml +17 -0
- package/dist/templates/ci/genesis-upgrade.yml +21 -0
- package/dist/templates/ci/supabase-ci.yml +20 -0
- package/dist/templates/eas/eas.json +47 -0
- package/dist/templates/eas/scripts/rollout-health.mjs +85 -0
- package/dist/templates/eas/workflows/deploy-production.yml +149 -0
- package/dist/templates/eas/workflows/e2e.yml +77 -0
- package/dist/templates/eas/workflows/pr-preview.yml +117 -0
- package/dist/templates/eas/workflows/rollout.yml +120 -0
- package/dist/templates/maestro/config.yaml +5 -0
- package/dist/templates/maestro/flows/deep-link.yaml +22 -0
- package/dist/templates/maestro/flows/launch.yaml +17 -0
- package/dist/templates/maestro/flows/settings-version.yaml +28 -0
- package/dist/templates/maestro/flows/sign-in-screen.yaml +17 -0
- package/dist/templates/maestro/subflows/sign-in.yaml +20 -0
- package/dist/vite.js +975 -29
- package/dist/vite.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Promote or roll back a staged production update (one deploy-production.yml started).
|
|
2
|
+
#
|
|
3
|
+
# Run it by hand, from git:
|
|
4
|
+
#
|
|
5
|
+
# eas workflow:run rollout.yml --ref main \
|
|
6
|
+
# --input update_group_id=<group id> --input action=promote --input percentage=50
|
|
7
|
+
# eas workflow:run rollout.yml --ref main --input update_group_id=<group id> --input action=rollback
|
|
8
|
+
#
|
|
9
|
+
# Always pass --ref: without it, eas workflow:run uploads your working directory as it is (the
|
|
10
|
+
# health check included) and runs it with the production token.
|
|
11
|
+
#
|
|
12
|
+
# deploy-production.yml publishes one update group per platform: run this once per group.
|
|
13
|
+
#
|
|
14
|
+
# promote: first a health check reads EAS's insights for the update group
|
|
15
|
+
# (`eas update:insights --json`) and stops the promotion when fewer than 200 launches were
|
|
16
|
+
# counted or more than 1% of launches failed. The limits are in this file, not inputs, so a run
|
|
17
|
+
# can't turn the check off. Then the rollout goes up to `percentage`. It never goes down; use
|
|
18
|
+
# rollback for that.
|
|
19
|
+
#
|
|
20
|
+
# What the check sees, and what it doesn't: EAS's "crash rate" is failed launches of the update
|
|
21
|
+
# (expo-updates couldn't start it and fell back to the previous code), not crash-free sessions. A
|
|
22
|
+
# crash after the app started isn't in it. Before promoting, read crash-free sessions for the
|
|
23
|
+
# update in your crash reporter (the update id is in the version signature, Settings > About).
|
|
24
|
+
# The workflow can't do that part for you.
|
|
25
|
+
#
|
|
26
|
+
# rollback: while the update is still staged (below 100%), everyone on the channel goes back to
|
|
27
|
+
# what they ran before it (`eas update:revert-update-rollout`). At 100% the rollout is over and
|
|
28
|
+
# this fails; republish the previous group instead (`eas update:republish --group <id>`).
|
|
29
|
+
#
|
|
30
|
+
# The custom jobs run EAS CLI, which needs `EXPO_TOKEN`: a robot token with access to this
|
|
31
|
+
# project, as a secret variable of the production EAS environment.
|
|
32
|
+
#
|
|
33
|
+
# Genesis template (templates/eas/workflows/rollout.yml). Edit the copy in your app; see
|
|
34
|
+
# docs/NATIVE-RELEASE.md in the Genesis repository.
|
|
35
|
+
name: Rollout
|
|
36
|
+
|
|
37
|
+
on:
|
|
38
|
+
workflow_dispatch:
|
|
39
|
+
inputs:
|
|
40
|
+
update_group_id:
|
|
41
|
+
type: string
|
|
42
|
+
required: true
|
|
43
|
+
description: One platform's update group from deploy-production.yml (its update job's log, or `eas update:list --branch production`).
|
|
44
|
+
action:
|
|
45
|
+
type: choice
|
|
46
|
+
required: true
|
|
47
|
+
options: [promote, rollback]
|
|
48
|
+
description: promote raises the rollout to `percentage`; rollback reverts it.
|
|
49
|
+
percentage:
|
|
50
|
+
type: choice
|
|
51
|
+
options: ["25", "50", "100"]
|
|
52
|
+
default: "50"
|
|
53
|
+
description: The share of production installs to promote to.
|
|
54
|
+
|
|
55
|
+
jobs:
|
|
56
|
+
health_check:
|
|
57
|
+
name: Check failed launches before promoting
|
|
58
|
+
if: ${{ inputs.action == 'promote' }}
|
|
59
|
+
environment: production
|
|
60
|
+
env:
|
|
61
|
+
APP_VARIANT: production
|
|
62
|
+
EXPO_PUBLIC_APP_VARIANT: production
|
|
63
|
+
UPDATE_GROUP_ID: ${{ inputs.update_group_id }}
|
|
64
|
+
MAX_FAILED_LAUNCH_PERCENT: "1"
|
|
65
|
+
MIN_LAUNCHES: "200"
|
|
66
|
+
steps:
|
|
67
|
+
- uses: eas/checkout
|
|
68
|
+
# EAS CLI evaluates app.config.ts (tsx, the Genesis config plugin), so it needs the packages.
|
|
69
|
+
- uses: eas/install_node_modules
|
|
70
|
+
- name: Read the update group's insights and check them
|
|
71
|
+
run: |
|
|
72
|
+
set -euo pipefail
|
|
73
|
+
npx --yes eas-cli@25.3.0 update:insights "$UPDATE_GROUP_ID" --json --non-interactive > insights.json
|
|
74
|
+
node .eas/scripts/rollout-health.mjs insights.json
|
|
75
|
+
|
|
76
|
+
promote_25:
|
|
77
|
+
name: Promote to 25%
|
|
78
|
+
needs: [health_check]
|
|
79
|
+
if: ${{ inputs.percentage == '25' }}
|
|
80
|
+
type: update-rollout
|
|
81
|
+
environment: production
|
|
82
|
+
params:
|
|
83
|
+
update_group_id: ${{ inputs.update_group_id }}
|
|
84
|
+
rollout_percentage: 25
|
|
85
|
+
|
|
86
|
+
promote_50:
|
|
87
|
+
name: Promote to 50%
|
|
88
|
+
needs: [health_check]
|
|
89
|
+
if: ${{ inputs.percentage == '50' }}
|
|
90
|
+
type: update-rollout
|
|
91
|
+
environment: production
|
|
92
|
+
params:
|
|
93
|
+
update_group_id: ${{ inputs.update_group_id }}
|
|
94
|
+
rollout_percentage: 50
|
|
95
|
+
|
|
96
|
+
promote_100:
|
|
97
|
+
name: Promote to 100%
|
|
98
|
+
needs: [health_check]
|
|
99
|
+
if: ${{ inputs.percentage == '100' }}
|
|
100
|
+
type: update-rollout
|
|
101
|
+
environment: production
|
|
102
|
+
params:
|
|
103
|
+
update_group_id: ${{ inputs.update_group_id }}
|
|
104
|
+
rollout_percentage: 100
|
|
105
|
+
|
|
106
|
+
rollback:
|
|
107
|
+
name: Roll back the staged update
|
|
108
|
+
if: ${{ inputs.action == 'rollback' }}
|
|
109
|
+
environment: production
|
|
110
|
+
env:
|
|
111
|
+
APP_VARIANT: production
|
|
112
|
+
EXPO_PUBLIC_APP_VARIANT: production
|
|
113
|
+
UPDATE_GROUP_ID: ${{ inputs.update_group_id }}
|
|
114
|
+
steps:
|
|
115
|
+
- uses: eas/checkout
|
|
116
|
+
- uses: eas/install_node_modules
|
|
117
|
+
- name: Revert the rollout
|
|
118
|
+
run: |
|
|
119
|
+
set -euo pipefail
|
|
120
|
+
npx --yes eas-cli@25.3.0 update:revert-update-rollout --group "$UPDATE_GROUP_ID" --message "Rolled back by rollout.yml" --non-interactive
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Copy to .env (git-ignored) and fill in. Both values are public: they ship in the app bundle.
|
|
2
|
+
# Supabase dashboard -> Project Settings -> API (or `supabase status` for a local stack).
|
|
3
|
+
EXPO_PUBLIC_SUPABASE_URL=https://your-project-ref.supabase.co
|
|
4
|
+
EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY=sb_publishable_your_key
|
|
5
|
+
# Optional: Sentry crash and error reporting (features.observability). Sentry project -> Settings ->
|
|
6
|
+
# Client Keys (DSN). Public too: it only lets the app send events. Empty means no Sentry.
|
|
7
|
+
EXPO_PUBLIC_SENTRY_DSN=
|
|
8
|
+
# Optional: native Google sign-in (features.googleSignIn, off by default). Google Cloud -> APIs &
|
|
9
|
+
# Services -> Credentials: the Web client id and the iOS client id. Public: they ship in the app.
|
|
10
|
+
EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID=
|
|
11
|
+
EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID=
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# app.config.ts imports these, so the fingerprint would hash them as files: then turning off a
|
|
2
|
+
# JavaScript-only feature (queryPersistence, deepLinks…) would give a new runtime version and
|
|
3
|
+
# `eas update` could no longer reach installed builds. What they mean for the native build
|
|
4
|
+
# (name, ids, scheme, usesAppleSignIn, platforms) is already in the evaluated Expo config, which
|
|
5
|
+
# the fingerprint hashes.
|
|
6
|
+
starter.config.ts
|
|
7
|
+
src/lib/define-starter.ts
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Maestro flows
|
|
2
|
+
|
|
3
|
+
Smoke flows for the starter, run against the development variant on a simulator or emulator.
|
|
4
|
+
`.eas/workflows/e2e.yml` runs them on EAS for each pull request.
|
|
5
|
+
|
|
6
|
+
| Flow | Tags | What it checks |
|
|
7
|
+
| --- | --- | --- |
|
|
8
|
+
| `flows/launch.yaml` | smoke | A fresh install runs every boot step and leaves the splash, with no fatal screen. |
|
|
9
|
+
| `flows/sign-in-screen.yaml` | smoke | It lands on the sign-in screen: the email form and the sign-in / create-account switch. |
|
|
10
|
+
| `flows/settings-version.yaml` | smoke, account | Signs in with email, opens the Settings tab, and finds the About row (`settings-row-version`) showing a version signature (`1.0.0 (1) · …`), and sign-out. `e2e.yml` leaves it out until its secrets exist. |
|
|
11
|
+
| `flows/deep-link.yaml` | smoke, account | Signs in, opens `genesis-starter-dev://settings` and lands on Settings: the development variant answers to its own scheme (each variant registers its own). |
|
|
12
|
+
|
|
13
|
+
`subflows/sign-in.yaml` is the sign-in steps `settings-version.yaml` runs; it isn't a flow of its
|
|
14
|
+
own, so it lives outside `flows/`.
|
|
15
|
+
|
|
16
|
+
## Running
|
|
17
|
+
|
|
18
|
+
You need [Maestro](https://maestro.mobile.dev), `.env` filled in (see the starter's README), and the
|
|
19
|
+
development variant installed:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
APP_VARIANT=development pnpm --filter genesis-rn-starter ios --configuration Release
|
|
23
|
+
pnpm --filter genesis-rn-starter e2e # every flow in flows/
|
|
24
|
+
maestro test --exclude-tags account .maestro/flows # the ones that don't sign in
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The `account` flow signs in with `MAESTRO_TEST_EMAIL` and `MAESTRO_TEST_PASSWORD` from the
|
|
28
|
+
environment (Maestro reads `MAESTRO_*` variables): an account that can sign in with email and
|
|
29
|
+
password on the Supabase project the build points at. On EAS they are secret variables of the
|
|
30
|
+
development environment.
|
|
31
|
+
|
|
32
|
+
`config.yaml` and each flow name the development variant's bundle id
|
|
33
|
+
(`com.example.genesisstarter.dev`); change them with `app.bundleId` in `starter.config.ts` (a test
|
|
34
|
+
checks they agree). The flows find screens by the testIDs the Genesis layouts set (`auth-screen`,
|
|
35
|
+
`home`, `settings`, `settings-row-<id>`, `genesis-boot`, `genesis-fatal`).
|
|
36
|
+
|
|
37
|
+
These files are copies of [`templates/maestro/`](../../../templates/maestro); a test fails if they
|
|
38
|
+
drift.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Smoke: a `scheme://` link opens its screen in this build. Each APP_VARIANT registers its own scheme
|
|
2
|
+
# (withGenesis appends `-dev` / `-preview`), so the development variant answers to
|
|
3
|
+
# `genesis-starter-dev://`, and a production build installed beside it never takes the link.
|
|
4
|
+
#
|
|
5
|
+
# MAESTRO_TEST_EMAIL=… MAESTRO_TEST_PASSWORD=… maestro test .maestro/flows/deep-link.yaml
|
|
6
|
+
#
|
|
7
|
+
# Change the scheme with `app.scheme` in starter.config.ts (and keep the `-dev`).
|
|
8
|
+
appId: com.example.genesisstarter.dev
|
|
9
|
+
tags:
|
|
10
|
+
- smoke
|
|
11
|
+
- account
|
|
12
|
+
---
|
|
13
|
+
- launchApp:
|
|
14
|
+
clearState: true
|
|
15
|
+
- runFlow: ../subflows/sign-in.yaml
|
|
16
|
+
- openLink: "genesis-starter-dev://settings"
|
|
17
|
+
- extendedWaitUntil:
|
|
18
|
+
visible:
|
|
19
|
+
id: "settings"
|
|
20
|
+
timeout: 10000
|
|
21
|
+
- assertVisible:
|
|
22
|
+
id: "settings-row-version"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Smoke: a fresh install launches, runs every boot step and leaves the splash, with no fatal screen.
|
|
2
|
+
#
|
|
3
|
+
# maestro test .maestro/flows/launch.yaml
|
|
4
|
+
appId: com.example.genesisstarter.dev
|
|
5
|
+
tags:
|
|
6
|
+
- smoke
|
|
7
|
+
---
|
|
8
|
+
- launchApp:
|
|
9
|
+
clearState: true
|
|
10
|
+
- extendedWaitUntil:
|
|
11
|
+
notVisible:
|
|
12
|
+
id: "genesis-boot"
|
|
13
|
+
timeout: 20000
|
|
14
|
+
- assertNotVisible:
|
|
15
|
+
id: "genesis-fatal"
|
|
16
|
+
- assertNotVisible:
|
|
17
|
+
id: "genesis-fatal-plain"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Smoke: sign in with email, open the Settings tab and see the About row's version signature.
|
|
2
|
+
#
|
|
3
|
+
# Needs an account that can sign in with email and password on the app's Supabase project:
|
|
4
|
+
#
|
|
5
|
+
# MAESTRO_TEST_EMAIL=… MAESTRO_TEST_PASSWORD=… maestro test .maestro/flows/settings-version.yaml
|
|
6
|
+
#
|
|
7
|
+
# Maestro reads MAESTRO_* variables from the environment. In EAS Workflows (e2e.yml) they are
|
|
8
|
+
# secret variables of the EAS environment the build uses.
|
|
9
|
+
appId: com.example.genesisstarter.dev
|
|
10
|
+
tags:
|
|
11
|
+
- smoke
|
|
12
|
+
- account
|
|
13
|
+
---
|
|
14
|
+
- launchApp:
|
|
15
|
+
clearState: true
|
|
16
|
+
- runFlow: ../subflows/sign-in.yaml
|
|
17
|
+
- tapOn: "Settings"
|
|
18
|
+
- extendedWaitUntil:
|
|
19
|
+
visible:
|
|
20
|
+
id: "settings"
|
|
21
|
+
timeout: 10000
|
|
22
|
+
- assertVisible:
|
|
23
|
+
id: "settings-row-version"
|
|
24
|
+
# The version signature, `1.0.0 (1) · …`, not an empty row.
|
|
25
|
+
- assertVisible:
|
|
26
|
+
text: "\\d+\\.\\d+\\.\\d+ \\(.+\\).*"
|
|
27
|
+
- assertVisible:
|
|
28
|
+
id: "sign-out"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Smoke: a fresh install boots past the splash to the sign-in screen.
|
|
2
|
+
#
|
|
3
|
+
# maestro test .maestro/flows/sign-in-screen.yaml
|
|
4
|
+
appId: com.example.genesisstarter.dev
|
|
5
|
+
tags:
|
|
6
|
+
- smoke
|
|
7
|
+
---
|
|
8
|
+
- launchApp:
|
|
9
|
+
clearState: true
|
|
10
|
+
- extendedWaitUntil:
|
|
11
|
+
visible:
|
|
12
|
+
id: "auth-screen"
|
|
13
|
+
timeout: 20000
|
|
14
|
+
- assertVisible:
|
|
15
|
+
id: "auth-screen-form-email"
|
|
16
|
+
- assertVisible:
|
|
17
|
+
id: "sign-in-switch"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Signs in with MAESTRO_TEST_EMAIL and MAESTRO_TEST_PASSWORD from the sign-in screen and waits for
|
|
2
|
+
# the Home tab. Not a flow of its own: flows/ runs it with `runFlow`.
|
|
3
|
+
appId: com.example.genesisstarter.dev
|
|
4
|
+
---
|
|
5
|
+
- extendedWaitUntil:
|
|
6
|
+
visible:
|
|
7
|
+
id: "auth-screen"
|
|
8
|
+
timeout: 20000
|
|
9
|
+
- tapOn:
|
|
10
|
+
id: "auth-screen-form-email"
|
|
11
|
+
- inputText: ${MAESTRO_TEST_EMAIL}
|
|
12
|
+
- tapOn:
|
|
13
|
+
id: "auth-screen-form-password"
|
|
14
|
+
- inputText: ${MAESTRO_TEST_PASSWORD}
|
|
15
|
+
- tapOn:
|
|
16
|
+
id: "auth-screen-form-submit"
|
|
17
|
+
- extendedWaitUntil:
|
|
18
|
+
visible:
|
|
19
|
+
id: "home"
|
|
20
|
+
timeout: 20000
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
# Genesis RN starter
|
|
2
|
+
|
|
3
|
+
A new Expo app that runs on day one: sign-in with email and Apple, a Settings tab with sign-out and
|
|
4
|
+
in-app account deletion, a Notifications tab, a persisted query cache, deep links and a Keychain
|
|
5
|
+
session that survives offline starts and is wiped after a reinstall. Every universal feature the
|
|
6
|
+
Genesis packages ship is on, and each one is turned off in one line of
|
|
7
|
+
[`starter.config.ts`](./starter.config.ts).
|
|
8
|
+
|
|
9
|
+
- Expo SDK 58: React Native 0.88, React 19.3, expo-router 58, the New Architecture (the only one
|
|
10
|
+
since SDK 55), the React Compiler, typed routes and the platform's own tab bar (`NativeTabs`).
|
|
11
|
+
TypeScript strict.
|
|
12
|
+
- The root layout is a few lines: [`<GenesisNativeApp>`](../../packages/native/README.md) owns the
|
|
13
|
+
splash and boot steps, errors and the fatal screen, theme, data, the session and held deep links.
|
|
14
|
+
A test fails if [`src/app/_layout.tsx`](./src/app/_layout.tsx) grows past 30 lines.
|
|
15
|
+
- Every screen renders a Genesis layout (`AuthScreen`, `SettingsPage`, `NotificationsPage`,
|
|
16
|
+
`ScreenContainer`) under the navigator's own header. `genesis doctor` enforces it.
|
|
17
|
+
- Every string a person sees is in [`src/copy.ts`](./src/copy.ts), one typed catalog. A test fails
|
|
18
|
+
on JSX text or a literal label in `src/app`.
|
|
19
|
+
|
|
20
|
+
## Create an app from it
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx @marktiderman/genesis-cli init my-app --template native --bundle-id com.acme.myapp
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
makes `./my-app` from this folder, outside the monorepo: the files an app owns (not this
|
|
27
|
+
starter's monorepo-only test), renamed (name, slug, scheme, bundle id), with each `workspace:^`
|
|
28
|
+
set to the published version released with the CLI, the plain Metro config, the pnpm settings
|
|
29
|
+
Metro needs, and the eas, maestro and ci templates. It records its blocks and the files Genesis
|
|
30
|
+
owns in `genesis.lock.json`, so later `genesis add <block>`, `genesis migrate` and `genesis
|
|
31
|
+
upgrade` work in it (see the [CLI's README](../../packages/genesis-cli/README.md#a-new-native-app)).
|
|
32
|
+
Then follow steps 3 to 5 below, and `pnpm install`.
|
|
33
|
+
|
|
34
|
+
It needs a CLI release that has `--template` and every package the starter uses on npm at the
|
|
35
|
+
versions that CLI was released with; check with `npm view @marktiderman/genesis-native versions`.
|
|
36
|
+
Until then, or to work on Genesis itself, make new apps inside the monorepo:
|
|
37
|
+
|
|
38
|
+
1. Copy the folder: `cp -R apps/genesis-rn-starter apps/my-app`, and set `"name"` in its
|
|
39
|
+
`package.json`.
|
|
40
|
+
2. In `starter.config.ts`, set `app`: the name, slug, URL scheme and bundle id. Turn off what you
|
|
41
|
+
don't want (below).
|
|
42
|
+
3. In `genesis.config.json`, set `links.hosts` to your web domain (or delete the `links` block for
|
|
43
|
+
no universal links).
|
|
44
|
+
4. `cp .env.example .env` and fill in your Supabase project's URL and publishable key.
|
|
45
|
+
For EAS (builds, previews, updates), run `eas init` and put the project id in
|
|
46
|
+
`starter.config.ts` `app.easProjectId`; see [Releasing](#releasing).
|
|
47
|
+
5. Apply `supabase/migrations` to your project (`supabase db push`, or `supabase start` for a
|
|
48
|
+
local stack) and enable the providers you use in Supabase Auth (below).
|
|
49
|
+
6. `pnpm install`, `pnpm build:packages` at the root, then `pnpm --filter my-app ios`.
|
|
50
|
+
|
|
51
|
+
Once `genesis-native` is on npm, an app outside the monorepo is the same folder with each
|
|
52
|
+
`workspace:^` replaced by a version range and `metro.config.js` reduced to
|
|
53
|
+
`withNativeWind(getDefaultConfig(__dirname), { input: "./global.css" })` (the rest of it watches
|
|
54
|
+
the workspace packages and keeps one copy of React, React Native and NativeWind's runtime).
|
|
55
|
+
|
|
56
|
+
In this monorepo the root `pnpm-workspace.yaml` pins `react`, `react-dom`, `@types/react` and
|
|
57
|
+
`react-native` to the versions Expo SDK 58 needs, for every package: move them with the SDK.
|
|
58
|
+
|
|
59
|
+
## Turning features off
|
|
60
|
+
|
|
61
|
+
Each line of `features` in `starter.config.ts` is one feature, `true` by default except
|
|
62
|
+
`googleSignIn`:
|
|
63
|
+
|
|
64
|
+
| Line | What it is | Off means |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| `emailSignIn` | Email and password sign-in and sign-up on `AuthScreen`. | No form; Apple only, so the app builds for iOS only (`platforms`). |
|
|
67
|
+
| `appleSignIn` | Sign in with Apple (`signInWithApple`, `appleProvider`), iOS only. | No Apple button; `ios.usesAppleSignIn` off. |
|
|
68
|
+
| `googleSignIn` | Native Google sign-in (`signInWithGoogle`, `googleProvider`). **Off by default**: it needs client ids and setup, see [Google sign-in](#google-sign-in). Needs `appleSignIn` on. | No Google button. |
|
|
69
|
+
| `accountDeletion` | "Delete account" in Settings (`deleteMyAccount`). | No delete row. App Review requires it for apps with accounts. |
|
|
70
|
+
| `notifications` | The Notifications tab (`NotificationsPage`). | The tab is hidden, its route redirects home and links to it open `/`. Drop `/notifications` from `links.paths` in `genesis.config.json` too. |
|
|
71
|
+
| `queryPersistence` | The `persistedQueryKeys` queries (`src/lib/app.ts`) saved to the phone for 24 hours, per user. | Cache in memory only. |
|
|
72
|
+
| `queryLifecycle` | Refetch when the app comes to the front; follow the network (AppState + NetInfo). | Queries refetch only on mount. |
|
|
73
|
+
| `keyboardScroll` | The focused field stays above the keyboard on form screens, with the previous / next / done bar (`KeyboardToolbar`) above it. | `KeyboardAvoidingView` fallback, no bar. |
|
|
74
|
+
| `deepLinks` | `scheme://` and universal links open their screen, after sign-in if needed (`normalizeLink`). | Every link opens `/`. Universal links still open the app until you also delete the `links` block in `genesis.config.json`. |
|
|
75
|
+
| `wipeSessionOnReinstall` | A reinstalled iOS app starts signed out (the Keychain outlives an uninstall). | The last session comes back after a reinstall. |
|
|
76
|
+
| `refreshWhileActive` | The session refreshes only while the app is in front. | supabase-js's own timer runs in the background too. |
|
|
77
|
+
| `push` | The push block (`createPush`, `src/lib/push.ts`): this phone's push token on sign-in once permission is granted, off on sign-out; Settings > Notifications (`NotificationSettings`: categories, quiet hours, previews); the soft prompt, offered when the Notifications tab opens, never at launch; taps open their screen through the link map. Needs an EAS project id for a token. | No token, no prompt, no Notifications row in Settings; expo-notifications stays in the build. |
|
|
78
|
+
| `support` | The support block (`createSupport`, `src/lib/support.ts`): Settings > Support > Send feedback and Help; shake the phone to capture the screen you're on and open the feedback screen with it (mark it up, hide private parts, or drop it); Help lists your reports with staff replies; the idea board with one vote each and "you asked, we shipped". Screens: `src/app/(app)/settings/support/`. | No Support rows, no shake; react-native-view-shot and expo-sensors stay in the build. |
|
|
79
|
+
| `updates` | The updates block (`createUpdates`, `src/lib/updates.ts`): force upgrade and maintenance from the `app_release_policy` row, the update banner (never reloads mid sign-in or mid deletion: `useBlockReload`), what's new, and the version signature in Settings > About. | No blocking screens, banner or notes; About shows the version and build from `expo-application`. |
|
|
80
|
+
| `observability` | The observability block (`src/lib/observability.ts`): every error the shell catches, route breadcrumbs and timings, the user's id and the typed events in `events`, to Sentry when `EXPO_PUBLIC_SENTRY_DSN` is set and to the console in development, scrubbed of emails, tokens and query strings on the phone. | Errors only reach `console` (LogBox in development). |
|
|
81
|
+
| `devtools` | The devtools overlay (`src/lib/devtools.ts`) in development and preview builds: a three-finger hold, "Open devtools" in the dev menu or Settings > About > Developer tools open a sheet with the version signature, channel switch, user id, blocks, flags and recent errors. Never in a production bundle. | No overlay and no Settings row. |
|
|
82
|
+
|
|
83
|
+
A config with every sign-in method off, or Google without Apple, fails at start-up. Apple's button
|
|
84
|
+
only shows on iOS, so with `emailSignIn` and `googleSignIn` off `app.config.ts` builds for iOS only.
|
|
85
|
+
|
|
86
|
+
Switches that only change JavaScript (`updates`, `push`, `observability`, `devtools` and `support` included) don't change the build's fingerprint (`.fingerprintignore`
|
|
87
|
+
leaves `starter.config.ts` out; what it means for the native build is in the evaluated config), so
|
|
88
|
+
`eas update` still reaches installed builds after you turn one off. `appleSignIn` and
|
|
89
|
+
`emailSignIn` change the native build and its runtime version.
|
|
90
|
+
|
|
91
|
+
## Native modules
|
|
92
|
+
|
|
93
|
+
`src/lib/native-modules.ts` hands Genesis components the native modules the starter installs
|
|
94
|
+
(`GenesisNativeApp`'s `modules`): FlashList v2 for long lists, expo-image for avatars and pictures,
|
|
95
|
+
Reanimated 4 for toasts, drawers and skeletons, Liquid Glass (expo-glass-effect) for toasts,
|
|
96
|
+
the update banner, popovers and menus on iOS 26, SF Symbols (expo-symbols) for `NativeIcon` on
|
|
97
|
+
iOS with lucide on Android, and the @expo/ui SwiftUI / Jetpack Compose date picker. To fall back to plain React Native for one, delete its line, its
|
|
98
|
+
import at the top of that file, and its package from `package.json`. FlashList v2
|
|
99
|
+
needs the New Architecture (the starter's default). Liquid Glass needs a build made with Xcode 26
|
|
100
|
+
and iOS 26 on the device; otherwise the surfaces stay solid.
|
|
101
|
+
|
|
102
|
+
## Entry file
|
|
103
|
+
|
|
104
|
+
`package.json`'s `main` is `index.ts`, not `expo-router/entry`. In development it first keeps the
|
|
105
|
+
warnings the app can't act on out of LogBox (`ignoreKnownDependencyWarnings` from
|
|
106
|
+
`@marktiderman/genesis-native/dev-warnings`), then requires expo-router's entry. Why: in React
|
|
107
|
+
Native 0.88 (Expo SDK 58) the first warning pins LogBox's "Open debugger to view warnings." pill to
|
|
108
|
+
the bottom of the screen, over the native tab bar, so the first tab tap after a launch (or after a
|
|
109
|
+
link brought the app forward) lands on the pill and seems ignored; the second works. The warning
|
|
110
|
+
was NativeWind's runtime reading React Native's deprecated `ImageBackground` as expo-router loads
|
|
111
|
+
the first screen, too early for anything in `_layout.tsx`. A warning your own code causes still
|
|
112
|
+
shows the pill: open the debugger (`j` in Metro) to read it, then fix it. Release builds have no
|
|
113
|
+
LogBox.
|
|
114
|
+
|
|
115
|
+
## App variants
|
|
116
|
+
|
|
117
|
+
`app.config.ts` lists the Genesis config plugin (`withGenesis()`, from `@marktiderman/genesis-cli`).
|
|
118
|
+
`APP_VARIANT` picks the build:
|
|
119
|
+
|
|
120
|
+
| `APP_VARIANT` | Name | Bundle id / package | URL scheme |
|
|
121
|
+
| --- | --- | --- | --- |
|
|
122
|
+
| `development` | Genesis Starter (Dev) | `com.example.genesisstarter.dev` | `genesis-starter-dev://` |
|
|
123
|
+
| `preview` | Genesis Starter (Preview) | `com.example.genesisstarter.preview` | `genesis-starter-preview://` |
|
|
124
|
+
| unset or `production` | Genesis Starter | `com.example.genesisstarter` | `genesis-starter://` |
|
|
125
|
+
|
|
126
|
+
All three install side by side, and each registers its own scheme, so a link opens the build it
|
|
127
|
+
names (`genesis-starter-dev://check-in?gym=hilltop` in a development build). `src/lib/links.ts`
|
|
128
|
+
accepts every variant's scheme (the OS only delivers the one the build registered). Redirect URLs
|
|
129
|
+
that use the scheme (Supabase Auth, OAuth clients) need each variant's. Any other value fails the
|
|
130
|
+
build. Set it per EAS environment so
|
|
131
|
+
builds, updates and fingerprints all see it; see the
|
|
132
|
+
[plugin's README](../../packages/genesis-cli/README.md#setting-app_variant). The plugin also adds
|
|
133
|
+
the associated domains and Android app links from `genesis.config.json`'s `links`, the privacy
|
|
134
|
+
manifest for the packages installed, export compliance and the fingerprint runtime version.
|
|
135
|
+
|
|
136
|
+
## Supabase
|
|
137
|
+
|
|
138
|
+
- **Keys:** `.env` holds `EXPO_PUBLIC_SUPABASE_URL` and `EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY`, the
|
|
139
|
+
publishable key only (everything in the bundle can be read off the phone). A missing value shows
|
|
140
|
+
the fatal screen at start-up, naming the variable (the first boot step checks it).
|
|
141
|
+
- **Account deletion:** a refusal is shown in the catalog's words by its code: sign in again for
|
|
142
|
+
`GA002` (recent sign-in required) and `42501` (MFA step-up), contact support for `GA001` (your
|
|
143
|
+
hook refused) and `23503` (data or Storage files still point at the login).
|
|
144
|
+
- **Client:** `src/lib/supabase.ts` makes the one client with `createGenesisSupabase`, the session
|
|
145
|
+
in the Keychain (`keychainStorage`), `wipeSessionOnReinstall` before the first read and
|
|
146
|
+
`refreshWhileActive`.
|
|
147
|
+
- **Migrations:** `supabase/migrations/20261024000000_genesis_account_deletion.sql` and
|
|
148
|
+
`20261024000100_genesis_app_release_policy.sql` are `@marktiderman/genesis-supabase`'s
|
|
149
|
+
`migrations/0001_genesis_account_deletion.sql` and `0002_genesis_app_release_policy.sql`, copied
|
|
150
|
+
under timestamped names as its README says, with their pgTAP tests in `supabase/tests/database/`
|
|
151
|
+
(`supabase test db`). A test fails if any of them drifts from the package's copy. The updates
|
|
152
|
+
block reads the release policy row (`app_id` `default`) with the publishable key; write it with
|
|
153
|
+
the SQL editor or the service role. Give every table of
|
|
154
|
+
yours that holds a person's data a foreign key to `auth.users(id)` with `on delete cascade`, or
|
|
155
|
+
deleting their account is refused.
|
|
156
|
+
- **Apple token revocation:** `supabase/migrations/20261024000200_genesis_apple_token_revocation.sql`
|
|
157
|
+
and `supabase/functions/genesis-apple-revoke/` are the package's migration 0003 and its Edge
|
|
158
|
+
Function, copied the same way (and drift-tested the same way). After an Apple sign-in,
|
|
159
|
+
`src/lib/auth.ts` sends Apple's code to the function (`storeAppleToken`); deleting the account
|
|
160
|
+
queues the token and `src/lib/account.ts` asks the function to revoke it
|
|
161
|
+
(`deleteMyAccount(supabase, { revokeAppleTokens: true })`). `APPLE_CLIENT_IDS` must list all three
|
|
162
|
+
bundle ids (`…`, `….dev`, `….preview`), or that variant's sign-ins keep no token (a console
|
|
163
|
+
warning, `unknown_client`). Before a release, set the function's
|
|
164
|
+
secrets, deploy it and schedule its retries: see "Revoking Apple's tokens" in
|
|
165
|
+
[`@marktiderman/genesis-supabase`](../../packages/supabase/README.md#revoking-apples-tokens).
|
|
166
|
+
- **Push:** `supabase/migrations/20261024000400_genesis_push.sql` and
|
|
167
|
+
`supabase/functions/genesis-push-send/` are the package's migration 0005 and its sender, copied and
|
|
168
|
+
drift-tested the same way. The app only registers its token and edits preferences; your server
|
|
169
|
+
(or a trigger) calls the function with `GENESIS_PUSH_SECRET`, and a schedule polls the receipts
|
|
170
|
+
(which also keeps `push_receipts` to 30 days). Turn on enhanced push security in the Expo project
|
|
171
|
+
and give the function `EXPO_ACCESS_TOKEN`, so a leaked token alone can't push to a phone:
|
|
172
|
+
see "Push" in [`@marktiderman/genesis-supabase`](../../packages/supabase/README.md#push-the-push-block).
|
|
173
|
+
- **Support:** `supabase/migrations/20261024000600_genesis_support.sql` is the package's migration
|
|
174
|
+
0006 (reports, screenshots in the private `genesis-support` bucket, replies, ideas and votes),
|
|
175
|
+
copied and drift-tested the same way. Nobody is staff until you add
|
|
176
|
+
`private.genesis_support_staff(person uuid)` in a migration of your own (the migration's header
|
|
177
|
+
has an example). To get an issue or a webhook per report, or to remove deleted screenshots from
|
|
178
|
+
storage, copy the `genesis-support-notify` and `genesis-support-cleanup` templates: see "Support"
|
|
179
|
+
in [`@marktiderman/genesis-supabase`](../../packages/supabase/README.md#support-the-support-block).
|
|
180
|
+
- **Auth providers:** email works with Supabase's defaults (confirmation on: sign-up asks the
|
|
181
|
+
person to confirm, then sign in; the confirmation link opens `site_url`, not the app). For Apple, enable the Apple provider with the bundle ids of all
|
|
182
|
+
three variants as client ids; `supabase/config.toml` does this for a local stack.
|
|
183
|
+
|
|
184
|
+
## Checks
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
pnpm --filter genesis-rn-starter test # both suites below
|
|
188
|
+
pnpm --filter genesis-rn-starter exec vitest run # files: layout length, toggles, copy catalog, migration copies, EAS and Maestro files
|
|
189
|
+
pnpm --filter genesis-rn-starter test:components # screens: jest-expo + React Native Testing Library
|
|
190
|
+
pnpm --filter genesis-rn-starter typecheck
|
|
191
|
+
pnpm --filter genesis-rn-starter lint
|
|
192
|
+
pnpm --filter genesis-rn-starter doctor # genesis doctor: native and supabase packs
|
|
193
|
+
pnpm --filter genesis-rn-starter export:ios # bundles the app, no device needed
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
The component tests (`__tests__/components`, `jest.config.js`) render the real `src/app` tree
|
|
197
|
+
with expo-router's `renderRouter`: the root layout and its boot through `GenesisNativeApp`,
|
|
198
|
+
sign-in, the tabs, Settings and account deletion. Supabase is the fake in
|
|
199
|
+
`__tests__/components/fake-supabase.ts` (`setup.ts` swaps it in for `src/lib/supabase.ts`), and
|
|
200
|
+
native modules use jest-expo's mocks or their library's own. A test fails when the app reports an
|
|
201
|
+
error (`[push]`, `[updates]`, `[observability]`) or React warns about act(); see `reports.ts`.
|
|
202
|
+
Add a screen's test there; tests that only read files stay in vitest, outside that folder.
|
|
203
|
+
|
|
204
|
+
## Releasing
|
|
205
|
+
|
|
206
|
+
`eas.json` and `.eas/workflows/` are the release path on EAS Workflows, and `.maestro/` the smoke
|
|
207
|
+
flows; [docs/NATIVE-RELEASE.md](../../docs/NATIVE-RELEASE.md) has the setup and the safety rules.
|
|
208
|
+
|
|
209
|
+
| Workflow | When | What |
|
|
210
|
+
| --- | --- | --- |
|
|
211
|
+
| `pr-preview.yml` | each pull request | Repack a preview build with the same fingerprint (or build one), publish an update to `pr-<number>`, comment the install link and QR code. |
|
|
212
|
+
| `e2e.yml` | each pull request | The Maestro flows on an iOS simulator build. |
|
|
213
|
+
| `deploy-production.yml` | a pushed `v*.*.*` tag | A store build where native code changed, else an update to `production` at 10%; both after a person approves. |
|
|
214
|
+
| `rollout.yml` | by hand | Promote the staged update after a failed-launch check, or roll it back. |
|
|
215
|
+
|
|
216
|
+
Profiles: `development`, `preview` and `production` build the `APP_VARIANT` of the same name on
|
|
217
|
+
the channel of the same name; `e2e` is a development build for the simulator. Store ids in
|
|
218
|
+
`eas.json` are `REPLACE_WITH_…` placeholders. These files are copies of
|
|
219
|
+
[`templates/eas/`](../../templates/eas) and [`templates/maestro/`](../../templates/maestro); a test
|
|
220
|
+
fails if they drift.
|
|
221
|
+
|
|
222
|
+
## Not covered yet
|
|
223
|
+
|
|
224
|
+
- **Google sign-in hasn't signed anyone in yet.** `signInWithGoogle` is unit-tested against a
|
|
225
|
+
stand-in for the Universal sign-in module; it hasn't run against the paid module and real Google
|
|
226
|
+
client ids.
|
|
227
|
+
- **Apple token revocation needs your Apple key before the App Store.** The code is in place (see
|
|
228
|
+
Supabase above), but nothing is revoked until the `genesis-apple-revoke` function is deployed
|
|
229
|
+
with your Sign in with Apple key, and it hasn't been tried against Apple with a real key yet.
|
|
230
|
+
- **`links.hosts` is `example.com`.** Replace it (step 3 above) before a release build, or the
|
|
231
|
+
build ships associated domains that never verify.
|
|
232
|
+
- **Notifications have no source.** `src/lib/notifications.ts` returns an empty list; point its
|
|
233
|
+
`queryFn` at yours.
|
|
234
|
+
- **Push hasn't reached a real phone.** With no EAS project there is no push token (Settings says
|
|
235
|
+
so). After `eas init`, upload APNs and FCM credentials (`eas credentials`), deploy
|
|
236
|
+
`genesis-push-send` with its secrets and schedule its receipts poll; delivery through Apple and
|
|
237
|
+
Google hasn't been tried yet. Tap routing can be tried on a simulator with `xcrun simctl push`.
|
|
238
|
+
- **No EAS project.** `app.easProjectId` is empty, so builds ship with `updates.enabled: false` and
|
|
239
|
+
no workflow can run until `eas init` (step 4 above). None of the workflows has been run against a
|
|
240
|
+
real EAS account yet.
|
|
241
|
+
- **No channel picker.** Preview builds may switch to a pull request's channel
|
|
242
|
+
(`useUpdates().channels.switchTo("pr-42")`), but no screen offers it yet.
|
|
243
|
+
- **Typing doesn't hold off a reload.** The sign-in form holds reloads only while a sign-in runs:
|
|
244
|
+
`AuthScreen` doesn't report half-typed fields, so tapping "Restart" on the update banner mid-typing
|
|
245
|
+
clears them.
|
|
246
|
+
- **Genesis's own default strings are English.** The starter's copy is all in `src/copy.ts`, but a
|
|
247
|
+
few labels inside the Genesis layouts ("Email", "Password", "or", the boot and fatal screens)
|
|
248
|
+
have no override yet; that is the `i18n` feature in the repo's `features.ts`.
|
|
249
|
+
|
|
250
|
+
## Google sign-in
|
|
251
|
+
|
|
252
|
+
`googleSignIn` is off because it can't work until you set it up. It signs in with Google's native
|
|
253
|
+
sheet and hands the ID token to Supabase (`signInWithGoogle`), with a nonce Supabase checks, so a
|
|
254
|
+
token taken from another sign-in can't be replayed.
|
|
255
|
+
|
|
256
|
+
1. **Google Cloud.** In one project, create OAuth client ids: a **Web** one (Supabase verifies
|
|
257
|
+
tokens against it), an **iOS** one for each bundle id (`com.example.genesisstarter`, `.dev`,
|
|
258
|
+
`.preview`), and an **Android** one for each package with your signing certificate's SHA-1
|
|
259
|
+
(`eas credentials` prints it).
|
|
260
|
+
2. **Supabase.** Authentication > Providers > Google: enable it, enter the Web client id and
|
|
261
|
+
secret, and add the iOS and Android client ids under "Authorized Client IDs". Leave "Skip nonce
|
|
262
|
+
check" off.
|
|
263
|
+
3. **The module.** `signInWithGoogle` needs the Universal sign-in module (`GoogleOneTapSignIn`) of
|
|
264
|
+
`@react-native-google-signin/google-signin`, which is in the library's paid build: the free npm
|
|
265
|
+
build can't put a nonce in the token, and its sign-ins fail with `google_nonce_missing`. Install
|
|
266
|
+
it as its docs say, add its config plugin to `plugins` in `app.config.ts` with your iOS URL
|
|
267
|
+
scheme (`["@react-native-google-signin/google-signin", { iosUrlScheme: "com.googleusercontent.apps.…" }]`),
|
|
268
|
+
and replace the `null` in `src/lib/google-signin.ts` with the module (the file shows how).
|
|
269
|
+
4. **Client ids.** Set `EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID` and `EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID` in
|
|
270
|
+
`.env` and in each EAS environment. They are public.
|
|
271
|
+
5. **Turn it on.** `googleSignIn: true` in `starter.config.ts`, then rebuild (`npx expo prebuild`
|
|
272
|
+
or an EAS build): the module is native code. With the switch on and no module in
|
|
273
|
+
`src/lib/google-signin.ts`, the sign-in screen fails to load, naming the file.
|
|
274
|
+
|
|
275
|
+
The button is `googleProvider` from genesis-ui-native, drawn as an outline button; pass Google's
|
|
276
|
+
"G" mark as its `icon`, as Google's branding guidelines ask. Sign in with Apple must stay on beside
|
|
277
|
+
it (App Store Review Guideline 4.8): `defineStarter` refuses Google without Apple.
|
|
278
|
+
|
|
279
|
+
## Observability and devtools
|
|
280
|
+
|
|
281
|
+
- **Sentry.** Set `EXPO_PUBLIC_SENTRY_DSN` in `.env` (and in each EAS environment). Without it,
|
|
282
|
+
nothing is sent. `src/lib/observability.ts` starts Sentry at module scope; `src/lib/app.ts`
|
|
283
|
+
imports it first, and the root layout is exported wrapped (`wrapRoot`). Release and dist come
|
|
284
|
+
from the version signature, with the update id and channel as tags. Source map upload is
|
|
285
|
+
optional: the commented plugin line in `app.config.ts` says what to turn on.
|
|
286
|
+
- **Source maps.** Builds upload theirs to EAS for EAS Observe (`uploadSourceMaps: true` in the
|
|
287
|
+
preview and production profiles of `eas.json`), so its stack traces are symbolicated. The
|
|
288
|
+
workflows' update jobs set `upload_sentry_sourcemaps: false`: left unset, EAS tries a Sentry
|
|
289
|
+
upload whenever `@sentry/react-native` is installed and only prints the error when it fails. When
|
|
290
|
+
you turn the Sentry plugin on (`app.config.ts`) and add `SENTRY_AUTH_TOKEN`, set it to `true` in
|
|
291
|
+
`.eas/workflows/pr-preview.yml` and `deploy-production.yml`, so a failed upload fails the job.
|
|
292
|
+
- **Privacy manifest.** The Genesis plugin declares, in the iOS privacy manifest, what the blocks
|
|
293
|
+
that are on send off the phone (`privacyBlocks` in `src/lib/define-starter.ts`): `account` (email
|
|
294
|
+
address, user id, name), `observability` (crash, performance and other diagnostic data, user id, and the typed
|
|
295
|
+
events as product interaction for analytics), `push` (the push token as a device id) and `support`
|
|
296
|
+
(what the person sends: their request and text, an optional screenshot, the account id and device
|
|
297
|
+
facts); all
|
|
298
|
+
linked to the person, none for tracking, and `NSPrivacyTracking` false. The check-in example sends
|
|
299
|
+
nothing yet (its `send` and its photo `upload`, `src/lib/check-in-photos.ts`, are stubs; the
|
|
300
|
+
photo question picks from the library through expo-image-picker, a native module, so adding or
|
|
301
|
+
removing it changes the fingerprint); once it posts answers to your server, add them (`other user
|
|
302
|
+
content`, `photos or videos`, or the types your questions ask for) to `privacy.collects`. Turn `observability` off
|
|
303
|
+
if you never set a DSN. If the app collects anything else, list everything it collects in
|
|
304
|
+
`genesis.config.json` `privacy.collects` (it replaces the blocks' list). Check the result with
|
|
305
|
+
`npx expo config --type introspect`. The App Store privacy label in App Store Connect is still
|
|
306
|
+
yours to fill in; the manifest doesn't fill it.
|
|
307
|
+
- **Events.** Add an event to `events` in `src/lib/observability.ts` before calling
|
|
308
|
+
`observability?.track(…)`; props are closed lists, numbers or booleans, so no free text can be
|
|
309
|
+
sent.
|
|
310
|
+
- **Devtools.** In a development build, open the overlay from the dev menu, Settings > About >
|
|
311
|
+
Developer tools, or a three-finger hold. Preview builds (`.preview` bundle id, built or updated
|
|
312
|
+
with `EXPO_PUBLIC_APP_VARIANT=preview`) get it too. A production bundle doesn't contain it:
|
|
313
|
+
`npx expo export --platform ios` with `EXPO_PUBLIC_APP_VARIANT` unset or `production`, then
|
|
314
|
+
search the bundle for `genesis-devtools`, finds nothing.
|