@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.
Files changed (139) hide show
  1. package/README.md +224 -3
  2. package/dist/cli.js +4602 -1549
  3. package/dist/cli.js.map +1 -1
  4. package/dist/{config-Ci-_Ue-1.d.ts → config-CrZbM3jD.d.ts} +73 -4
  5. package/dist/doctor.d.ts +31 -4
  6. package/dist/doctor.js +976 -30
  7. package/dist/doctor.js.map +1 -1
  8. package/dist/expo.d.ts +91 -8
  9. package/dist/expo.js +207 -14
  10. package/dist/expo.js.map +1 -1
  11. package/dist/genesis-catalog.json +502 -0
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.js +987 -38
  14. package/dist/index.js.map +1 -1
  15. package/dist/scaffolder.d.ts +1 -1
  16. package/dist/scaffolder.js +9 -6
  17. package/dist/scaffolder.js.map +1 -1
  18. package/dist/starter/.eas/scripts/rollout-health.mjs +85 -0
  19. package/dist/starter/.eas/workflows/deploy-production.yml +149 -0
  20. package/dist/starter/.eas/workflows/e2e.yml +77 -0
  21. package/dist/starter/.eas/workflows/pr-preview.yml +117 -0
  22. package/dist/starter/.eas/workflows/rollout.yml +120 -0
  23. package/dist/starter/.env.example +11 -0
  24. package/dist/starter/.fingerprintignore +7 -0
  25. package/dist/starter/.maestro/README.md +38 -0
  26. package/dist/starter/.maestro/config.yaml +5 -0
  27. package/dist/starter/.maestro/flows/deep-link.yaml +22 -0
  28. package/dist/starter/.maestro/flows/launch.yaml +17 -0
  29. package/dist/starter/.maestro/flows/settings-version.yaml +28 -0
  30. package/dist/starter/.maestro/flows/sign-in-screen.yaml +17 -0
  31. package/dist/starter/.maestro/subflows/sign-in.yaml +20 -0
  32. package/dist/starter/README.md +314 -0
  33. package/dist/starter/__tests__/app-config.test.ts +51 -0
  34. package/dist/starter/__tests__/check-in-photos.test.ts +57 -0
  35. package/dist/starter/__tests__/components/css-stub.js +2 -0
  36. package/dist/starter/__tests__/components/fake-supabase.ts +136 -0
  37. package/dist/starter/__tests__/components/links.test.ts +25 -0
  38. package/dist/starter/__tests__/components/render-app.ts +22 -0
  39. package/dist/starter/__tests__/components/reports.ts +10 -0
  40. package/dist/starter/__tests__/components/resolver.js +12 -0
  41. package/dist/starter/__tests__/components/root-layout.test.tsx +55 -0
  42. package/dist/starter/__tests__/components/session-storage.test.tsx +81 -0
  43. package/dist/starter/__tests__/components/settings.test.tsx +134 -0
  44. package/dist/starter/__tests__/components/setup.ts +69 -0
  45. package/dist/starter/__tests__/components/sign-in.test.tsx +90 -0
  46. package/dist/starter/__tests__/components/tabs-feature-off.test.tsx +19 -0
  47. package/dist/starter/__tests__/components/tabs.test.tsx +43 -0
  48. package/dist/starter/__tests__/components/tabs.ts +12 -0
  49. package/dist/starter/__tests__/entry.test.ts +28 -0
  50. package/dist/starter/__tests__/inline-copy.ts +59 -0
  51. package/dist/starter/__tests__/starter.test.ts +319 -0
  52. package/dist/starter/_gitignore +13 -0
  53. package/dist/starter/app.config.ts +44 -0
  54. package/dist/starter/babel.config.js +9 -0
  55. package/dist/starter/eas.json +47 -0
  56. package/dist/starter/eslint.config.js +5 -0
  57. package/dist/starter/genesis.config.json +12 -0
  58. package/dist/starter/global.css +3 -0
  59. package/dist/starter/index.ts +14 -0
  60. package/dist/starter/jest.config.js +36 -0
  61. package/dist/starter/metro.config.js +38 -0
  62. package/dist/starter/package.json +93 -0
  63. package/dist/starter/pnpm-workspace.yaml +73 -0
  64. package/dist/starter/src/app/(app)/(home)/_layout.tsx +6 -0
  65. package/dist/starter/src/app/(app)/(home)/check-in.tsx +41 -0
  66. package/dist/starter/src/app/(app)/(home)/index.tsx +34 -0
  67. package/dist/starter/src/app/(app)/_layout.tsx +27 -0
  68. package/dist/starter/src/app/(app)/notifications/_layout.tsx +6 -0
  69. package/dist/starter/src/app/(app)/notifications/index.tsx +36 -0
  70. package/dist/starter/src/app/(app)/settings/_layout.tsx +6 -0
  71. package/dist/starter/src/app/(app)/settings/index.tsx +96 -0
  72. package/dist/starter/src/app/(app)/settings/notifications.tsx +16 -0
  73. package/dist/starter/src/app/(app)/settings/support/[id].tsx +23 -0
  74. package/dist/starter/src/app/(app)/settings/support/ideas.tsx +20 -0
  75. package/dist/starter/src/app/(app)/settings/support/index.tsx +20 -0
  76. package/dist/starter/src/app/(app)/settings/support/new.tsx +35 -0
  77. package/dist/starter/src/app/(app)/settings/support/shipped.tsx +20 -0
  78. package/dist/starter/src/app/+native-intent.ts +11 -0
  79. package/dist/starter/src/app/_layout.tsx +20 -0
  80. package/dist/starter/src/app/sign-in.tsx +69 -0
  81. package/dist/starter/src/copy.ts +118 -0
  82. package/dist/starter/src/forms/check-in.json +121 -0
  83. package/dist/starter/src/lib/account.ts +42 -0
  84. package/dist/starter/src/lib/app.ts +52 -0
  85. package/dist/starter/src/lib/auth.ts +80 -0
  86. package/dist/starter/src/lib/check-in-photos.ts +66 -0
  87. package/dist/starter/src/lib/check-in.ts +85 -0
  88. package/dist/starter/src/lib/define-starter.ts +148 -0
  89. package/dist/starter/src/lib/devtools-overlay.ts +34 -0
  90. package/dist/starter/src/lib/devtools.ts +23 -0
  91. package/dist/starter/src/lib/env.ts +33 -0
  92. package/dist/starter/src/lib/google-signin.ts +23 -0
  93. package/dist/starter/src/lib/links.ts +40 -0
  94. package/dist/starter/src/lib/native-modules.ts +27 -0
  95. package/dist/starter/src/lib/notifications.ts +15 -0
  96. package/dist/starter/src/lib/observability.ts +45 -0
  97. package/dist/starter/src/lib/push.ts +49 -0
  98. package/dist/starter/src/lib/supabase.ts +65 -0
  99. package/dist/starter/src/lib/support.ts +44 -0
  100. package/dist/starter/src/lib/updates.ts +61 -0
  101. package/dist/starter/starter.config.ts +37 -0
  102. package/dist/starter/supabase/config.toml +26 -0
  103. package/dist/starter/supabase/functions/genesis-apple-revoke/apple.ts +237 -0
  104. package/dist/starter/supabase/functions/genesis-apple-revoke/handler.ts +227 -0
  105. package/dist/starter/supabase/functions/genesis-apple-revoke/index.ts +55 -0
  106. package/dist/starter/supabase/functions/genesis-push-send/expo.ts +117 -0
  107. package/dist/starter/supabase/functions/genesis-push-send/handler.ts +462 -0
  108. package/dist/starter/supabase/functions/genesis-push-send/index.ts +54 -0
  109. package/dist/starter/supabase/migrations/20261024000000_genesis_account_deletion.sql +133 -0
  110. package/dist/starter/supabase/migrations/20261024000100_genesis_app_release_policy.sql +82 -0
  111. package/dist/starter/supabase/migrations/20261024000200_genesis_apple_token_revocation.sql +205 -0
  112. package/dist/starter/supabase/migrations/20261024000400_genesis_push.sql +524 -0
  113. package/dist/starter/supabase/migrations/20261024000600_genesis_support.sql +846 -0
  114. package/dist/starter/supabase/tests/database/genesis_account_deletion.test.sql +138 -0
  115. package/dist/starter/supabase/tests/database/genesis_app_release_policy.test.sql +148 -0
  116. package/dist/starter/supabase/tests/database/genesis_apple_token_revocation.test.sql +230 -0
  117. package/dist/starter/supabase/tests/database/genesis_push.test.sql +407 -0
  118. package/dist/starter/supabase/tests/database/genesis_support.test.sql +552 -0
  119. package/dist/starter/tailwind.config.mjs +15 -0
  120. package/dist/starter/tsconfig.json +14 -0
  121. package/dist/starter/vitest.config.mts +7 -0
  122. package/dist/templates/ci/app-ci.yml +17 -0
  123. package/dist/templates/ci/genesis-upgrade.yml +21 -0
  124. package/dist/templates/ci/supabase-ci.yml +20 -0
  125. package/dist/templates/eas/eas.json +47 -0
  126. package/dist/templates/eas/scripts/rollout-health.mjs +85 -0
  127. package/dist/templates/eas/workflows/deploy-production.yml +149 -0
  128. package/dist/templates/eas/workflows/e2e.yml +77 -0
  129. package/dist/templates/eas/workflows/pr-preview.yml +117 -0
  130. package/dist/templates/eas/workflows/rollout.yml +120 -0
  131. package/dist/templates/maestro/config.yaml +5 -0
  132. package/dist/templates/maestro/flows/deep-link.yaml +22 -0
  133. package/dist/templates/maestro/flows/launch.yaml +17 -0
  134. package/dist/templates/maestro/flows/settings-version.yaml +28 -0
  135. package/dist/templates/maestro/flows/sign-in-screen.yaml +17 -0
  136. package/dist/templates/maestro/subflows/sign-in.yaml +20 -0
  137. package/dist/vite.js +975 -29
  138. package/dist/vite.js.map +1 -1
  139. package/package.json +4 -4
@@ -0,0 +1,47 @@
1
+ {
2
+ "cli": {
3
+ "version": ">= 18.0.0",
4
+ "appVersionSource": "remote"
5
+ },
6
+ "build": {
7
+ "development": {
8
+ "environment": "development",
9
+ "channel": "development",
10
+ "distribution": "internal",
11
+ "env": { "APP_VARIANT": "development", "EXPO_PUBLIC_APP_VARIANT": "development" }
12
+ },
13
+ "preview": {
14
+ "environment": "preview",
15
+ "channel": "preview",
16
+ "distribution": "internal",
17
+ "uploadSourceMaps": true,
18
+ "env": { "APP_VARIANT": "preview", "EXPO_PUBLIC_APP_VARIANT": "preview" },
19
+ "android": { "buildType": "apk" }
20
+ },
21
+ "e2e": {
22
+ "extends": "development",
23
+ "ios": { "simulator": true }
24
+ },
25
+ "production": {
26
+ "environment": "production",
27
+ "channel": "production",
28
+ "distribution": "store",
29
+ "uploadSourceMaps": true,
30
+ "autoIncrement": true,
31
+ "env": { "APP_VARIANT": "production", "EXPO_PUBLIC_APP_VARIANT": "production" }
32
+ }
33
+ },
34
+ "submit": {
35
+ "production": {
36
+ "ios": {
37
+ "ascAppId": "REPLACE_WITH_APP_STORE_CONNECT_APP_ID",
38
+ "appleTeamId": "REPLACE_WITH_APPLE_TEAM_ID"
39
+ },
40
+ "android": {
41
+ "serviceAccountKeyPath": "REPLACE_WITH_PATH_TO_GOOGLE_SERVICE_ACCOUNT_JSON",
42
+ "track": "internal",
43
+ "releaseStatus": "draft"
44
+ }
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * The health check rollout.yml runs before promoting a staged update.
4
+ *
5
+ * eas update:insights <group> --json > insights.json
6
+ * MAX_FAILED_LAUNCH_PERCENT=1 MIN_LAUNCHES=200 node .eas/scripts/rollout-health.mjs insights.json
7
+ *
8
+ * It exits 1, saying why, when the insights have no platform, when a platform counted fewer than
9
+ * MIN_LAUNCHES launches (too early to tell), or when more than MAX_FAILED_LAUNCH_PERCENT of a
10
+ * platform's launches failed. A threshold that isn't a number is an error, never a pass.
11
+ *
12
+ * "Failed launches" are what EAS counts: expo-updates couldn't start the update and fell back.
13
+ * A platform's launches are `installs + failedInstalls`, the denominator eas-cli's own crash rate
14
+ * uses (update/insights/formatInsights.js in eas-cli 25.3.0).
15
+ * Crash-free sessions are not in EAS's insights; read them in your crash reporter.
16
+ *
17
+ * Genesis template (templates/eas/scripts/rollout-health.mjs).
18
+ */
19
+ import { readFileSync } from "node:fs";
20
+ import { pathToFileURL } from "node:url";
21
+
22
+ /**
23
+ * @param {unknown} insights `eas update:insights --json` output.
24
+ * @param {{ maxFailedLaunchPercent: number; minLaunches: number }} limits
25
+ * @returns {{ ok: boolean; lines: string[] }}
26
+ */
27
+ export function checkRollout(insights, { maxFailedLaunchPercent, minLaunches }) {
28
+ if (!Number.isFinite(maxFailedLaunchPercent) || maxFailedLaunchPercent < 0 || maxFailedLaunchPercent > 100) {
29
+ return { ok: false, lines: [`MAX_FAILED_LAUNCH_PERCENT must be a number from 0 to 100, got ${maxFailedLaunchPercent}.`] };
30
+ }
31
+ if (!Number.isInteger(minLaunches) || minLaunches < 1) {
32
+ return { ok: false, lines: [`MIN_LAUNCHES must be a whole number above 0, got ${minLaunches}.`] };
33
+ }
34
+ const platforms = Array.isArray(insights?.platforms) ? insights.platforms : [];
35
+ if (platforms.length === 0) {
36
+ return { ok: false, lines: ["The insights list no platform: is the update group id right?"] };
37
+ }
38
+ let ok = true;
39
+ const lines = [];
40
+ for (const entry of platforms) {
41
+ const name = typeof entry?.platform === "string" ? entry.platform : "unknown platform";
42
+ const installs = Number(entry?.totals?.installs);
43
+ const failed = Number(entry?.totals?.failedInstalls);
44
+ if (!Number.isFinite(installs) || !Number.isFinite(failed)) {
45
+ ok = false;
46
+ lines.push(`${name}: the insights have no launch counts.`);
47
+ continue;
48
+ }
49
+ const launches = installs + failed;
50
+ const percent = launches === 0 ? 0 : (failed / launches) * 100;
51
+ const summary = `${name}: ${failed} of ${launches} launches failed (${percent.toFixed(2)}%)`;
52
+ if (launches < minLaunches) {
53
+ ok = false;
54
+ lines.push(`${summary}; fewer than ${minLaunches} launches, too early to promote.`);
55
+ } else if (percent > maxFailedLaunchPercent) {
56
+ ok = false;
57
+ lines.push(`${summary}; more than ${maxFailedLaunchPercent}%, don't promote (roll back instead?).`);
58
+ } else {
59
+ lines.push(`${summary}; within ${maxFailedLaunchPercent}%.`);
60
+ }
61
+ }
62
+ return { ok, lines };
63
+ }
64
+
65
+ /** Unset gives the default; an empty or non-numeric value gives NaN, which `checkRollout` refuses. */
66
+ function numberFrom(value, fallback) {
67
+ if (value === undefined) return fallback;
68
+ return value.trim() === "" ? Number.NaN : Number(value);
69
+ }
70
+
71
+ function main() {
72
+ const file = process.argv[2];
73
+ if (!file) {
74
+ console.error("Usage: node rollout-health.mjs <insights.json>");
75
+ process.exit(1);
76
+ }
77
+ const { ok, lines } = checkRollout(JSON.parse(readFileSync(file, "utf8")), {
78
+ maxFailedLaunchPercent: numberFrom(process.env.MAX_FAILED_LAUNCH_PERCENT, 1),
79
+ minLaunches: numberFrom(process.env.MIN_LAUNCHES, 200),
80
+ });
81
+ for (const line of lines) (ok ? console.log : console.error)(line);
82
+ if (!ok) process.exit(1);
83
+ }
84
+
85
+ if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) main();
@@ -0,0 +1,149 @@
1
+ # Deploy to production, started by pushing a release tag (`git tag v1.4.0 && git push origin v1.4.0`).
2
+ # A release that changes native code is a new store version: bump `version` in app.config.ts in
3
+ # the same change. The version isn't part of the fingerprint, so a bump on its own starts no
4
+ # build, and a native change without one uploads the old version string again.
5
+ #
6
+ # 1. Fingerprint the native project as the production variant builds it.
7
+ # 2. Per platform, look for a production build with that fingerprint.
8
+ # - None (native code changed): build one. The store submission waits for a person to approve
9
+ # it in the run's page on expo.dev.
10
+ # - One exists (JavaScript only): publish an over-the-air update to the `production` channel,
11
+ # also after that approval, to 10% of installs. rollout.yml raises it or rolls it back.
12
+ #
13
+ # Safety:
14
+ # - A tag push is the only trigger, so a run always builds a commit in git, never a local folder.
15
+ # Don't add `workflow_dispatch` without `--ref` discipline: `eas workflow:run` without `--ref`
16
+ # uploads the working directory as it is on that machine.
17
+ # - Nothing is submitted or published before the `approve_release` job is approved, and it isn't
18
+ # offered when a build failed, so one approval never ships half a release. Check that the tag's
19
+ # commit is on main before approving.
20
+ # - Builds go to TestFlight and to the Play internal track as a draft (eas.json `submit`);
21
+ # releasing to the stores stays a person's step in App Store Connect and Play Console.
22
+ # - EAS refuses to start a second rollout on the same channel, platform and runtime while one is
23
+ # in progress, so a new update can't silently replace a staged one (finish it with rollout.yml).
24
+ # - Each platform's update is its own update group; promote or roll back each with rollout.yml.
25
+ # - A production build whose approval was rejected (or whose submit failed) still matches its
26
+ # fingerprint: a later JavaScript-only tag sends an update to a binary nobody has. Submit that
27
+ # build by hand first (`eas submit --platform ios --id <build id> --profile production`).
28
+ #
29
+ # Genesis template (templates/eas/workflows/deploy-production.yml). Edit the copy in your app; see
30
+ # docs/NATIVE-RELEASE.md in the Genesis repository.
31
+ name: Deploy production
32
+
33
+ on:
34
+ push:
35
+ tags: ["v*.*.*"]
36
+
37
+ jobs:
38
+ fingerprint:
39
+ name: Fingerprint
40
+ type: fingerprint
41
+ environment: production
42
+ env:
43
+ APP_VARIANT: production
44
+ EXPO_PUBLIC_APP_VARIANT: production
45
+
46
+ get_ios_build:
47
+ name: Find a production iOS build with this fingerprint
48
+ needs: [fingerprint]
49
+ type: get-build
50
+ params:
51
+ platform: ios
52
+ profile: production
53
+ fingerprint_hash: ${{ needs.fingerprint.outputs.ios_fingerprint_hash }}
54
+ wait_for_in_progress: true
55
+
56
+ get_android_build:
57
+ name: Find a production Android build with this fingerprint
58
+ needs: [fingerprint]
59
+ type: get-build
60
+ params:
61
+ platform: android
62
+ profile: production
63
+ fingerprint_hash: ${{ needs.fingerprint.outputs.android_fingerprint_hash }}
64
+ wait_for_in_progress: true
65
+
66
+ build_ios:
67
+ name: Build iOS (native code changed)
68
+ needs: [get_ios_build]
69
+ if: ${{ !needs.get_ios_build.outputs.build_id }}
70
+ type: build
71
+ environment: production
72
+ params:
73
+ platform: ios
74
+ profile: production
75
+
76
+ build_android:
77
+ name: Build Android (native code changed)
78
+ needs: [get_android_build]
79
+ if: ${{ !needs.get_android_build.outputs.build_id }}
80
+ type: build
81
+ environment: production
82
+ params:
83
+ platform: android
84
+ profile: production
85
+
86
+ approve_release:
87
+ name: Approve submitting the builds and publishing the updates
88
+ # Both lookups must have succeeded (needs) and neither build failed (after): a failure on one
89
+ # platform never leaves the other to ship alone.
90
+ needs: [get_ios_build, get_android_build]
91
+ after: [build_ios, build_android]
92
+ if: ${{ after.build_ios.status != 'failure' && after.build_android.status != 'failure' }}
93
+ type: require-approval
94
+
95
+ submit_ios:
96
+ name: Submit iOS to TestFlight
97
+ needs: [build_ios, approve_release]
98
+ if: ${{ needs.build_ios.outputs.build_id }}
99
+ type: submit
100
+ environment: production
101
+ params:
102
+ build_id: ${{ needs.build_ios.outputs.build_id }}
103
+ profile: production
104
+
105
+ submit_android:
106
+ name: Submit Android to the internal track (draft)
107
+ needs: [build_android, approve_release]
108
+ if: ${{ needs.build_android.outputs.build_id }}
109
+ type: submit
110
+ environment: production
111
+ params:
112
+ build_id: ${{ needs.build_android.outputs.build_id }}
113
+ profile: production
114
+
115
+ update_ios:
116
+ name: Update iOS (10% of production installs)
117
+ needs: [get_ios_build, approve_release]
118
+ if: ${{ needs.get_ios_build.outputs.build_id }}
119
+ type: update
120
+ environment: production
121
+ env:
122
+ APP_VARIANT: production
123
+ EXPO_PUBLIC_APP_VARIANT: production
124
+ params:
125
+ channel: production
126
+ platform: ios
127
+ rollout_percentage: 10
128
+ # Explicit: unset, EAS tries a Sentry source map upload whenever @sentry/react-native is
129
+ # installed and only logs a failure. Set true once the Sentry plugin is on in app.config.ts
130
+ # (with SENTRY_AUTH_TOKEN), so a failed upload fails the job.
131
+ upload_sentry_sourcemaps: false
132
+
133
+ update_android:
134
+ name: Update Android (10% of production installs)
135
+ needs: [get_android_build, approve_release]
136
+ if: ${{ needs.get_android_build.outputs.build_id }}
137
+ type: update
138
+ environment: production
139
+ env:
140
+ APP_VARIANT: production
141
+ EXPO_PUBLIC_APP_VARIANT: production
142
+ params:
143
+ channel: production
144
+ platform: android
145
+ rollout_percentage: 10
146
+ # Explicit: unset, EAS tries a Sentry source map upload whenever @sentry/react-native is
147
+ # installed and only logs a failure. Set true once the Sentry plugin is on in app.config.ts
148
+ # (with SENTRY_AUTH_TOKEN), so a failed upload fails the job.
149
+ upload_sentry_sourcemaps: false
@@ -0,0 +1,77 @@
1
+ # E2E: the Maestro smoke flows in .maestro/flows on an iOS simulator build.
2
+ #
3
+ # 1. Fingerprint the native project as the development variant builds it (the flows name the
4
+ # development bundle id).
5
+ # 2. An `e2e` simulator build with that fingerprint exists: repack it with this commit's
6
+ # JavaScript. None exists: build one.
7
+ # 3. Run every flow in .maestro/flows on it.
8
+ #
9
+ # The `account` flows sign in, so they are left out (`exclude_tags: account`) until the
10
+ # development EAS environment has MAESTRO_TEST_EMAIL and MAESTRO_TEST_PASSWORD (a test account on
11
+ # the development Supabase project) as secret variables; then delete that line. Maestro reads
12
+ # MAESTRO_* variables from the environment. This runs the pull request's code with that
13
+ # environment's variables: keep nothing there that production depends on.
14
+ #
15
+ # Genesis template (templates/eas/workflows/e2e.yml). Edit the copy in your app; see
16
+ # docs/NATIVE-RELEASE.md in the Genesis repository.
17
+ name: E2E
18
+
19
+ on:
20
+ pull_request:
21
+ types: [opened, reopened, synchronize]
22
+ workflow_dispatch: {}
23
+
24
+ jobs:
25
+ fingerprint:
26
+ name: Fingerprint
27
+ type: fingerprint
28
+ environment: development
29
+ env:
30
+ APP_VARIANT: development
31
+ EXPO_PUBLIC_APP_VARIANT: development
32
+
33
+ get_ios_build:
34
+ name: Find an iOS simulator build with this fingerprint
35
+ needs: [fingerprint]
36
+ type: get-build
37
+ params:
38
+ platform: ios
39
+ profile: e2e
40
+ simulator: true
41
+ fingerprint_hash: ${{ needs.fingerprint.outputs.ios_fingerprint_hash }}
42
+ wait_for_in_progress: true
43
+
44
+ repack_ios:
45
+ name: Repack the simulator build with this JavaScript
46
+ needs: [get_ios_build]
47
+ if: ${{ needs.get_ios_build.outputs.build_id }}
48
+ type: repack
49
+ environment: development
50
+ env:
51
+ APP_VARIANT: development
52
+ EXPO_PUBLIC_APP_VARIANT: development
53
+ params:
54
+ build_id: ${{ needs.get_ios_build.outputs.build_id }}
55
+ profile: e2e
56
+
57
+ build_ios:
58
+ name: Build for the iOS simulator (native code changed)
59
+ needs: [get_ios_build]
60
+ if: ${{ !needs.get_ios_build.outputs.build_id }}
61
+ type: build
62
+ environment: development
63
+ params:
64
+ platform: ios
65
+ profile: e2e
66
+
67
+ maestro_ios:
68
+ name: Maestro smoke flows
69
+ after: [repack_ios, build_ios]
70
+ if: ${{ after.repack_ios.outputs.build_id || after.build_ios.outputs.build_id }}
71
+ type: maestro
72
+ environment: development
73
+ params:
74
+ build_id: ${{ after.repack_ios.outputs.build_id || after.build_ios.outputs.build_id }}
75
+ flow_path: [".maestro/flows"]
76
+ exclude_tags: account
77
+ retries: 1
@@ -0,0 +1,117 @@
1
+ # PR preview: an installable build of each pull request, and an update on its own channel.
2
+ #
3
+ # 1. Fingerprint the native project as the preview variant builds it.
4
+ # 2. A preview build with that fingerprint exists: repack it with this pull request's JavaScript
5
+ # (no native compile). None exists (the pull request changed native code): build one.
6
+ # 3. Publish the pull request's JavaScript as an update to the channel `pr-<number>`.
7
+ # 4. Comment on the pull request: the build's install link and QR code, and the update.
8
+ #
9
+ # Nothing here can reach production: the preview profile and EAS environment, internal
10
+ # distribution, a pr-<number> channel, and no submit job. It does build the pull request's code
11
+ # with the preview environment's variables, so keep nothing there that production depends on.
12
+ # EAS doesn't run pull_request workflows for pull requests from forks.
13
+ #
14
+ # Genesis template (templates/eas/workflows/pr-preview.yml). Edit the copy in your app; see
15
+ # docs/NATIVE-RELEASE.md in the Genesis repository.
16
+ name: PR preview
17
+
18
+ on:
19
+ pull_request:
20
+ types: [opened, reopened, synchronize]
21
+
22
+ jobs:
23
+ fingerprint:
24
+ name: Fingerprint
25
+ type: fingerprint
26
+ environment: preview
27
+ env:
28
+ APP_VARIANT: preview
29
+ EXPO_PUBLIC_APP_VARIANT: preview
30
+
31
+ get_ios_build:
32
+ name: Find a preview iOS build with this fingerprint
33
+ needs: [fingerprint]
34
+ type: get-build
35
+ params:
36
+ platform: ios
37
+ profile: preview
38
+ fingerprint_hash: ${{ needs.fingerprint.outputs.ios_fingerprint_hash }}
39
+ wait_for_in_progress: true
40
+
41
+ get_android_build:
42
+ name: Find a preview Android build with this fingerprint
43
+ needs: [fingerprint]
44
+ type: get-build
45
+ params:
46
+ platform: android
47
+ profile: preview
48
+ fingerprint_hash: ${{ needs.fingerprint.outputs.android_fingerprint_hash }}
49
+ wait_for_in_progress: true
50
+
51
+ repack_ios:
52
+ name: Repack iOS with this JavaScript
53
+ needs: [get_ios_build]
54
+ if: ${{ needs.get_ios_build.outputs.build_id }}
55
+ type: repack
56
+ environment: preview
57
+ env:
58
+ APP_VARIANT: preview
59
+ EXPO_PUBLIC_APP_VARIANT: preview
60
+ params:
61
+ build_id: ${{ needs.get_ios_build.outputs.build_id }}
62
+ profile: preview
63
+
64
+ repack_android:
65
+ name: Repack Android with this JavaScript
66
+ needs: [get_android_build]
67
+ if: ${{ needs.get_android_build.outputs.build_id }}
68
+ type: repack
69
+ environment: preview
70
+ env:
71
+ APP_VARIANT: preview
72
+ EXPO_PUBLIC_APP_VARIANT: preview
73
+ params:
74
+ build_id: ${{ needs.get_android_build.outputs.build_id }}
75
+ profile: preview
76
+
77
+ build_ios:
78
+ name: Build iOS (native code changed)
79
+ needs: [get_ios_build]
80
+ if: ${{ !needs.get_ios_build.outputs.build_id }}
81
+ type: build
82
+ environment: preview
83
+ params:
84
+ platform: ios
85
+ profile: preview
86
+
87
+ build_android:
88
+ name: Build Android (native code changed)
89
+ needs: [get_android_build]
90
+ if: ${{ !needs.get_android_build.outputs.build_id }}
91
+ type: build
92
+ environment: preview
93
+ params:
94
+ platform: android
95
+ profile: preview
96
+
97
+ publish_update:
98
+ name: Publish to channel pr-<number>
99
+ needs: [fingerprint]
100
+ type: update
101
+ environment: preview
102
+ env:
103
+ APP_VARIANT: preview
104
+ EXPO_PUBLIC_APP_VARIANT: preview
105
+ params:
106
+ channel: pr-${{ github.event.pull_request.number }}
107
+ # Explicit: unset, EAS tries a Sentry source map upload whenever @sentry/react-native is
108
+ # installed and only logs a failure. Set true once the Sentry plugin is on in app.config.ts
109
+ # (with SENTRY_AUTH_TOKEN), so a failed upload fails the job.
110
+ upload_sentry_sourcemaps: false
111
+
112
+ comment:
113
+ name: Comment on the pull request
114
+ after: [repack_ios, repack_android, build_ios, build_android, publish_update]
115
+ type: github-comment
116
+ params:
117
+ message: "Preview of this pull request: install a build from its link or QR code. A preview build already installed can switch to the channel pr-${{ github.event.pull_request.number }} instead."
@@ -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,5 @@
1
+ # Maestro project config for the starter's flows.
2
+ #
3
+ # appId is the development variant's bundle id (APP_VARIANT=development appends `.dev` to
4
+ # starter.config.ts `app.bundleId`). Change both together when you rename the app.
5
+ appId: com.example.genesisstarter.dev
@@ -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"