@marktiderman/genesis-cli 1.6.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 +156 -1
  2. package/dist/cli.js +2769 -567
  3. package/dist/cli.js.map +1 -1
  4. package/dist/{config-CUdwT-nY.d.ts → config-CrZbM3jD.d.ts} +45 -2
  5. package/dist/doctor.d.ts +2 -2
  6. package/dist/doctor.js +133 -5
  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 +140 -9
  14. package/dist/index.js.map +1 -1
  15. package/dist/scaffolder.d.ts +1 -1
  16. package/dist/scaffolder.js +7 -4
  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 +133 -5
  138. package/dist/vite.js.map +1 -1
  139. package/package.json +4 -4
@@ -0,0 +1,13 @@
1
+ # Expo
2
+ .expo/
3
+ dist/
4
+ android/
5
+ ios/
6
+ expo-env.d.ts
7
+
8
+ # Dependencies
9
+ node_modules/
10
+
11
+ # Environment (copy .env.example)
12
+ .env
13
+ .env.local
@@ -0,0 +1,44 @@
1
+ // Expo compiles this file on its own; tsx lets it import starter.config.ts (Expo's recommended hook).
2
+ import "tsx/cjs";
3
+ import type { ConfigContext, ExpoConfig } from "expo/config";
4
+ import starter from "./starter.config";
5
+ import { easConfig, nativePlatforms, privacyBlocks } from "./src/lib/define-starter";
6
+
7
+ // Name, ids and plugins only. The Genesis plugin (`@marktiderman/genesis-cli`) adds the rest:
8
+ // APP_VARIANT variants (development / preview / production), associated domains and app links from
9
+ // genesis.config.json, the privacy manifest, export compliance and the fingerprint runtime version.
10
+ // `easConfig` adds the EAS update URL and project id from starter.config.ts `app.easProjectId`. It
11
+ // sets `updates` and `extra` whole: there is no app.json, so nothing else writes them.
12
+ export default ({ config }: ConfigContext): ExpoConfig => ({
13
+ ...config,
14
+ ...easConfig(starter.app),
15
+ name: starter.app.name,
16
+ slug: starter.app.slug,
17
+ scheme: starter.app.scheme,
18
+ version: "1.0.0",
19
+ platforms: nativePlatforms(starter.features),
20
+ orientation: "portrait",
21
+ userInterfaceStyle: "automatic",
22
+ ios: {
23
+ bundleIdentifier: starter.app.bundleId,
24
+ supportsTablet: true,
25
+ usesAppleSignIn: starter.features.appleSignIn,
26
+ },
27
+ android: { package: starter.app.bundleId },
28
+ experiments: { typedRoutes: true, reactCompiler: true },
29
+ plugins: [
30
+ "expo-router",
31
+ "expo-secure-store",
32
+ "expo-updates",
33
+ "expo-notifications",
34
+ // The check-in's photo question picks from the library only: no camera, so no camera or microphone prompt.
35
+ ["expo-image-picker", { photosPermission: "Choose a photo to add to your check-in.", cameraPermission: false, microphonePermission: false }],
36
+ // The privacy manifest declares the data of the blocks that are on (account, observability, push).
37
+ ["@marktiderman/genesis-cli", { privacy: { blocks: privacyBlocks(starter.features) } }],
38
+ // Optional: upload source maps to Sentry from EAS builds (the observability block). Set your
39
+ // organization and project slugs, add SENTRY_AUTH_TOKEN as an EAS secret, set "@sentry/cli" to
40
+ // true under allowBuilds in pnpm-workspace.yaml, and switch metro.config.js to
41
+ // getSentryExpoConfig. See the README's Observability section.
42
+ // ["@sentry/react-native/expo", { organization: "your-org", project: "your-project", url: "https://sentry.io/" }],
43
+ ],
44
+ });
@@ -0,0 +1,9 @@
1
+ module.exports = function (api) {
2
+ api.cache(true);
3
+ return {
4
+ presets: [
5
+ ["babel-preset-expo", { jsxImportSource: "nativewind" }],
6
+ "nativewind/babel",
7
+ ],
8
+ };
9
+ };
@@ -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,5 @@
1
+ // https://docs.expo.dev/guides/using-eslint/
2
+ const { defineConfig } = require("eslint/config");
3
+ const expoConfig = require("eslint-config-expo/flat");
4
+
5
+ module.exports = defineConfig([expoConfig, { ignores: ["dist/*", ".expo/*", "supabase/functions/**"] }]);
@@ -0,0 +1,12 @@
1
+ {
2
+ "doctor": {
3
+ "packs": ["native", "supabase"],
4
+ "native": { "routerRoot": "src/app" },
5
+ "supabase": { "migrations": "supabase/migrations", "base": "origin/main", "exposedSchemas": ["public"] },
6
+ "src": ["src", "starter.config.ts", "app.config.ts"]
7
+ },
8
+ "links": {
9
+ "hosts": ["example.com"],
10
+ "paths": ["/notifications", "/settings"]
11
+ }
12
+ }
@@ -0,0 +1,3 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The app's entry. In development, first keep the dependency warnings the app can't act on out of
3
+ * LogBox: React Native 0.88 pins "Open debugger to view warnings." over the tab bar on the first
4
+ * warning, where it takes the first tab tap. NativeWind's runtime warns while expo-router loads the
5
+ * first screen, so this runs before expo-router's entry (a `require`, so it isn't hoisted above
6
+ * the call). See `@marktiderman/genesis-native/dev-warnings`.
7
+ */
8
+ import { LogBox } from "react-native";
9
+ import { ignoreKnownDependencyWarnings } from "@marktiderman/genesis-native/dev-warnings";
10
+
11
+ ignoreKnownDependencyWarnings(LogBox, __DEV__);
12
+
13
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
14
+ require("expo-router/entry");
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Component tests: the starter's screens rendered by React Native Testing Library on
3
+ * jest-expo (`pnpm test:components`). The vitest suite (`vitest.config.mts`) keeps the
4
+ * file and config tests; neither runner picks up the other's files.
5
+ */
6
+ const expoPreset = require("jest-expo/jest-preset");
7
+
8
+ // Packages that ship untranspiled (ESM or JSX) code, on top of the ones jest-expo already
9
+ // transforms. The Genesis packages are workspace links, so they resolve outside node_modules
10
+ // here; an app made from the starter installs them from npm, and needs them in this list.
11
+ const alsoTransform = [
12
+ "@marktiderman", "@sentry", "nativewind", "react-native-css-interop", "lucide-react-native",
13
+ // The optional native modules the starter opts into (FlashList, @expo/ui).
14
+ "@shopify/flash-list", "@expo/ui",
15
+ ];
16
+
17
+ const [modulesPattern, ...rest] = expoPreset.transformIgnorePatterns;
18
+ const extended = modulesPattern.replace("(?!(", `(?!(${alsoTransform.join("|")}|`);
19
+ if (extended === modulesPattern) throw new Error("jest.config.js: jest-expo's transformIgnorePatterns changed shape; update the extension.");
20
+
21
+ module.exports = {
22
+ preset: "jest-expo",
23
+ // Every test file here is jest's, `.ts` or `.tsx`; vitest.config.mts leaves this folder out.
24
+ testMatch: ["<rootDir>/__tests__/components/**/*.test.{ts,tsx}"],
25
+ setupFilesAfterEnv: ["<rootDir>/__tests__/components/setup.ts"],
26
+ resolver: "<rootDir>/__tests__/components/resolver.js",
27
+ moduleNameMapper: {
28
+ "^@/(.*)$": "<rootDir>/src/$1",
29
+ "\\.css$": "<rootDir>/__tests__/components/css-stub.js",
30
+ // lucide's React Native entry is an .mjs file jest-expo doesn't transform; use its CommonJS build.
31
+ "^lucide-react-native$": require.resolve("lucide-react-native"),
32
+ },
33
+ transformIgnorePatterns: [extended, ...rest],
34
+ // A file's first render loads the whole app through Babel; on a cold cache (CI) that alone can pass 5 s.
35
+ testTimeout: 30_000,
36
+ };
@@ -0,0 +1,38 @@
1
+ // Metro in the Genesis monorepo. An app made from the starter outside the
2
+ // monorepo can replace this file with `withNativeWind(getDefaultConfig(__dirname), { input: "./global.css" })`.
3
+ const { getDefaultConfig } = require("expo/metro-config");
4
+ const { withNativeWind } = require("nativewind/metro");
5
+ const path = require("path");
6
+
7
+ const projectRoot = __dirname;
8
+ const monorepoRoot = path.resolve(projectRoot, "../..");
9
+
10
+ /** @type {import('expo/metro-config').MetroConfig} */
11
+ const config = getDefaultConfig(projectRoot);
12
+
13
+ // The workspace packages the app imports, so edits to them reload the app.
14
+ config.watchFolders = [
15
+ ...(config.watchFolders || []),
16
+ ...["core", "design-system", "features", "forms", "forms-native", "forms-react", "native", "supabase", "support", "ui-native"].map((name) => path.resolve(monorepoRoot, "packages", name)),
17
+ ];
18
+
19
+ config.resolver.nodeModulesPaths = [
20
+ ...(config.resolver.nodeModulesPaths || []),
21
+ path.resolve(projectRoot, "node_modules"),
22
+ path.resolve(monorepoRoot, "node_modules"),
23
+ ];
24
+
25
+ // One copy of each of these, resolved from the app, wherever they're imported from. A workspace
26
+ // package can have its own copy in its node_modules (ui-native has NativeWind's runtime), and a
27
+ // second React, React Native, query cache or NativeWind style registry in the bundle breaks hooks,
28
+ // native modules, shared caches or the components' classNames.
29
+ const singletons = ["react", "react-native", "@tanstack/react-query", "@tanstack/query-core", "nativewind", "react-native-css-interop"];
30
+ const appOrigin = path.join(projectRoot, "package.json");
31
+ const resolveRequest = config.resolver.resolveRequest;
32
+ config.resolver.resolveRequest = (context, moduleName, platform) => {
33
+ const single = singletons.some((name) => moduleName === name || moduleName.startsWith(`${name}/`));
34
+ const ctx = single ? { ...context, originModulePath: appOrigin } : context;
35
+ return resolveRequest ? resolveRequest(ctx, moduleName, platform) : ctx.resolveRequest(ctx, moduleName, platform);
36
+ };
37
+
38
+ module.exports = withNativeWind(config, { input: "./global.css" });
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "genesis-rn-starter",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "main": "index.ts",
6
+ "scripts": {
7
+ "start": "expo start",
8
+ "ios": "expo run:ios",
9
+ "android": "expo run:android",
10
+ "export:ios": "expo export --platform ios",
11
+ "doctor": "genesis doctor",
12
+ "typecheck": "tsc --noEmit",
13
+ "lint": "expo lint",
14
+ "test": "vitest run && jest",
15
+ "test:components": "jest",
16
+ "e2e": "maestro test .maestro/flows"
17
+ },
18
+ "dependencies": {
19
+ "@expo/metro-runtime": "~58.0.15",
20
+ "@expo/ui": "~58.0.23",
21
+ "@hookform/resolvers": "^5.0.1",
22
+ "@marktiderman/genesis-core": "workspace:^",
23
+ "@marktiderman/genesis-design-system": "workspace:^",
24
+ "@marktiderman/genesis-forms": "workspace:^",
25
+ "@marktiderman/genesis-forms-native": "workspace:^",
26
+ "@marktiderman/genesis-forms-react": "workspace:^",
27
+ "@marktiderman/genesis-native": "workspace:^",
28
+ "@marktiderman/genesis-supabase": "workspace:^",
29
+ "@marktiderman/genesis-support": "workspace:^",
30
+ "@marktiderman/genesis-ui-native": "workspace:^",
31
+ "@react-native-async-storage/async-storage": "2.2.0",
32
+ "@react-native-community/datetimepicker": "9.2.1",
33
+ "@react-native-community/netinfo": "12.0.1",
34
+ "@sentry/react-native": "~8.28.0",
35
+ "@shopify/flash-list": "2.3.2",
36
+ "@supabase/supabase-js": "^2.118.0",
37
+ "@tanstack/query-async-storage-persister": "5.101.4",
38
+ "@tanstack/query-persist-client-core": "5.101.4",
39
+ "@tanstack/react-query": "5.101.4",
40
+ "clsx": "^2.1.1",
41
+ "expo": "~58.0.19",
42
+ "expo-apple-authentication": "~58.0.2",
43
+ "expo-application": "~58.1.2",
44
+ "expo-constants": "~58.0.13",
45
+ "expo-crypto": "~58.0.7",
46
+ "expo-glass-effect": "~58.0.5",
47
+ "expo-haptics": "~58.0.7",
48
+ "expo-image": "~58.0.17",
49
+ "expo-image-picker": "~58.0.10",
50
+ "expo-linking": "~58.0.14",
51
+ "expo-notifications": "~58.1.6",
52
+ "expo-router": "~58.0.26",
53
+ "expo-secure-store": "~58.0.2",
54
+ "expo-sensors": "~58.0.4",
55
+ "expo-splash-screen": "~58.0.11",
56
+ "expo-status-bar": "~58.0.4",
57
+ "expo-symbols": "~58.0.4",
58
+ "expo-updates": "~58.0.18",
59
+ "lucide-react-native": ">=0.475.0",
60
+ "nativewind": "^4.2.7",
61
+ "react": "19.3.0",
62
+ "react-hook-form": "^7.56.4",
63
+ "react-native": "0.88.0",
64
+ "react-native-css-interop": "^0.2.7",
65
+ "react-native-keyboard-controller": "1.22.7",
66
+ "react-native-reanimated": "4.7.1",
67
+ "react-native-safe-area-context": "~5.10.1",
68
+ "react-native-screens": "~4.30.0",
69
+ "react-native-svg": "15.16.0",
70
+ "react-native-url-polyfill": "^4.0.0",
71
+ "react-native-view-shot": "6.1.1",
72
+ "react-native-worklets": "0.13.0",
73
+ "tailwind-merge": "^3.5.0",
74
+ "zod": "^4.3.6"
75
+ },
76
+ "devDependencies": {
77
+ "@marktiderman/genesis-cli": "workspace:^",
78
+ "@react-native/jest-preset": "0.88.0",
79
+ "@testing-library/react-native": "^14.1.0",
80
+ "@types/node": "^22.20.1",
81
+ "@types/react": "~19.3.0",
82
+ "babel-plugin-react-compiler": "^1.0.0",
83
+ "eslint": "^9.0.0",
84
+ "eslint-config-expo": "~58.0.4",
85
+ "jest": "~30.5.2",
86
+ "jest-expo": "~58.0.12",
87
+ "tailwindcss": "^3.4.17",
88
+ "tsx": "^4.21.0",
89
+ "typescript": "~6.0.3",
90
+ "vitest": "^4.1.12",
91
+ "yaml": "^2.6.0"
92
+ }
93
+ }
@@ -0,0 +1,73 @@
1
+ packages:
2
+ - "apps/*"
3
+ - "packages/*"
4
+
5
+ # pnpm 11 refuses to run a dependency's build script unless it is named
6
+ # here, and it makes that refusal an ERROR (`ERR_PNPM_IGNORED_BUILDS`).
7
+ # pnpm 9 ran every one of these silently, so this list RECORDS the behaviour
8
+ # the repository already had. It grants nothing new.
9
+ #
10
+ # The key is `allowBuilds`, a MAP, not the pnpm 10 `onlyBuiltDependencies`
11
+ # LIST. pnpm 11 removed that setting and replaced it with this one
12
+ # (https://pnpm.io/settings/build). A leftover `onlyBuiltDependencies` block
13
+ # is not an error and not a warning: pnpm ignores it in silence, and the
14
+ # install still fails on `ERR_PNPM_IGNORED_BUILDS`. Measured on CI run
15
+ # 34433045280, where the list form was present and every package in it was
16
+ # still reported as ignored.
17
+ #
18
+ # The names are exactly what pnpm 11.26.0 reported on this workspace.
19
+ allowBuilds:
20
+ "@bundled-es-modules/glob": true
21
+ # From @tailwindcss/cli (the studio's prebuilt stylesheet). Its install
22
+ # script only builds a native file watcher for --watch, which the build
23
+ # never uses; prebuilt binaries cover the platforms we run on.
24
+ "@parcel/watcher": false
25
+ # From @sentry/react-native (the starter). Its install script downloads the
26
+ # sentry-cli binary, which only uploads source maps. Source map upload is
27
+ # optional and off in the starter; an app that turns the Sentry Expo plugin
28
+ # on sets this to true so EAS builds can upload.
29
+ "@sentry/cli": false
30
+ esbuild: true
31
+ style-dictionary: true
32
+ unrs-resolver: true
33
+
34
+ # pnpm 11 reads ONLY auth and registry settings from `.npmrc`. Every other
35
+ # setting must live here (https://pnpm.io/settings). The three below were in
36
+ # `.npmrc` and pnpm 11 ignored all three in silence — no error, no warning.
37
+ #
38
+ # MEASURED consequence on CI run 34433391298, the first run to get past the
39
+ # install step: with `nodeLinker` unapplied, pnpm used its default isolated
40
+ # layout, `@types/node` left the workspace root, and `packages/core` failed
41
+ # to build with `TS2580: Cannot find name 'process'`. `packages/core` never
42
+ # declared `@types/node`; it relied on the hoisted layout, and it compiled
43
+ # under pnpm 9 for that reason.
44
+ #
45
+ # `autoInstallPeers` also shapes the lockfile. pnpm 9 resolved this
46
+ # workspace with it ON, so turning it off here would put `--frozen-lockfile`
47
+ # in conflict with the committed `pnpm-lock.yaml`.
48
+ #
49
+ # Hoisted layout is required for the Metro bundler in the Expo apps.
50
+ nodeLinker: hoisted
51
+ autoInstallPeers: true
52
+ # React Native packages declare conflicting peers.
53
+ strictPeerDependencies: false
54
+
55
+ # One React and one React Native for the whole workspace: the versions Expo SDK 58 pins (React
56
+ # Native 0.88, react 19.3.0). With the hoisted layout, a second version puts packages built for
57
+ # one React next to the other: react-dom refuses to load beside a react of another patch
58
+ # ("Incompatible React versions"), and a dependency's nested @types/react breaks the web
59
+ # package's declaration build. Move these with the Expo SDK.
60
+ overrides:
61
+ react: 19.3.0
62
+ react-dom: 19.3.0
63
+ "@types/react": 19.3.0
64
+ react-native: 0.88.0
65
+
66
+ patchedDependencies:
67
+ # tsup 8.5.1's declaration build forces `baseUrl: "."` into the compiler options, and TypeScript 6
68
+ # fails on `baseUrl` (TS5101, deprecated). The patch deletes that one line, as tsup 9.0.0 does
69
+ # upstream; no package sets `paths`, and the emitted .d.ts files are byte-identical with and
70
+ # without it (measured on every package's dist). Drop the patch when the packages move to tsup 9.
71
+ # It names 8.5.1 exactly: if the lockfile moves tsup to another 8.x, re-create it for that version.
72
+ # `genesis init` leaves this block out of an app's pnpm settings (an app has no patches/ folder).
73
+ tsup@8.5.1: patches/tsup@8.5.1.patch
@@ -0,0 +1,6 @@
1
+ import { Stack } from "expo-router";
2
+
3
+ /** Each tab is a stack, so its screen gets the platform's own header. */
4
+ export default function HomeStack() {
5
+ return <Stack />;
6
+ }
@@ -0,0 +1,41 @@
1
+ import { Redirect, Stack, router, useLocalSearchParams } from "expo-router";
2
+ import type { Session } from "@supabase/supabase-js";
3
+ import { useSession } from "@marktiderman/genesis-native";
4
+ import { FormFocus, Button } from "@marktiderman/genesis-forms-native";
5
+ import { useFormDraft } from "@marktiderman/genesis-forms-react";
6
+ import { ScreenContainer } from "@marktiderman/genesis-ui-native";
7
+ import starter from "../../../../starter.config";
8
+ import { copy } from "@/copy";
9
+ import { checkInDrafts, checkInForm, checkInHaptics, checkInHostOptions, checkInKey, checkInOutbox, checkInPhotos } from "@/lib/check-in";
10
+
11
+ /**
12
+ * The check-in example (`features.checkIn`): one question per screen, the title in the native
13
+ * header, a draft per signed-in user and the offline outbox. Open it with a link to fill in the
14
+ * gym: `genesis-starter://check-in?gym=hilltop`.
15
+ */
16
+ export default function CheckInScreen() {
17
+ const params = useLocalSearchParams<{ gym?: string }>();
18
+ const { session } = useSession<Session>();
19
+ const draft = useFormDraft(checkInForm, {
20
+ store: checkInDrafts,
21
+ respondent: session?.user.id ?? "signed-out",
22
+ hostOptions: checkInHostOptions,
23
+ linkParams: params.gym ? { gym: params.gym } : undefined,
24
+ });
25
+ if (!starter.features.checkIn) return <Redirect href="/" />;
26
+ return (
27
+ <ScreenContainer testID="check-in">
28
+ <FormFocus
29
+ draft={draft}
30
+ outbox={checkInOutbox}
31
+ createKey={checkInKey}
32
+ haptics={checkInHaptics}
33
+ photos={checkInPhotos}
34
+ screen={Stack.Screen}
35
+ headerOptions={{ headerBackTitle: copy.home.title }}
36
+ testID="check-in-form"
37
+ slotProps={{ ending: { actions: <Button onPress={() => router.back()} testID="check-in-done">{copy.checkIn.done}</Button> } }}
38
+ />
39
+ </ScreenContainer>
40
+ );
41
+ }
@@ -0,0 +1,34 @@
1
+ import { Stack, router } from "expo-router";
2
+ import { NativeButton, NativeEmptyState, ScreenContainer, composeHeaderOptions } from "@marktiderman/genesis-ui-native";
3
+ import starter from "../../../../starter.config";
4
+ import { copy } from "@/copy";
5
+
6
+ /** The first tab. Replace it with your app's home screen. */
7
+ export default function HomeScreen() {
8
+ const checkIn = starter.features.checkIn ? (
9
+ <NativeButton testID="home-check-in" onPress={() => router.push("/check-in")}>
10
+ {copy.home.checkIn}
11
+ </NativeButton>
12
+ ) : null;
13
+ // The same form opened from a link that fills in the gym, so that question is skipped.
14
+ const fromLink = starter.features.checkIn ? (
15
+ <NativeButton testID="home-check-in-link" variant="outline" onPress={() => router.push("/check-in?gym=hilltop")}>
16
+ {copy.home.checkInFromLink}
17
+ </NativeButton>
18
+ ) : null;
19
+ return (
20
+ <>
21
+ <Stack.Screen options={composeHeaderOptions({ headerTitle: copy.home.title, large: true })} />
22
+ <ScreenContainer scroll testID="home" contentClassName="flex-grow justify-center p-6">
23
+ <NativeEmptyState
24
+ variant="first-run"
25
+ title={copy.home.emptyTitle}
26
+ body={copy.home.emptyBody}
27
+ primaryAction={checkIn}
28
+ secondaryAction={fromLink}
29
+ testID="home-empty"
30
+ />
31
+ </ScreenContainer>
32
+ </>
33
+ );
34
+ }
@@ -0,0 +1,27 @@
1
+ import { Redirect } from "expo-router";
2
+ import { NativeTabs } from "expo-router/native-tabs";
3
+ import { useSession } from "@marktiderman/genesis-native";
4
+ import starter from "../../../starter.config";
5
+ import { copy } from "@/copy";
6
+
7
+ /** Signed-in screens: the platform's own tab bar. A tab whose feature is off is hidden. */
8
+ export default function AppLayout() {
9
+ const { status } = useSession();
10
+ if (status === "signedOut") return <Redirect href="/sign-in" />;
11
+ return (
12
+ <NativeTabs>
13
+ <NativeTabs.Trigger name="(home)">
14
+ <NativeTabs.Trigger.Label>{copy.tabs.home}</NativeTabs.Trigger.Label>
15
+ <NativeTabs.Trigger.Icon sf={{ default: "house", selected: "house.fill" }} md="home" />
16
+ </NativeTabs.Trigger>
17
+ <NativeTabs.Trigger name="notifications" hidden={!starter.features.notifications}>
18
+ <NativeTabs.Trigger.Label>{copy.tabs.notifications}</NativeTabs.Trigger.Label>
19
+ <NativeTabs.Trigger.Icon sf={{ default: "bell", selected: "bell.fill" }} md="notifications" />
20
+ </NativeTabs.Trigger>
21
+ <NativeTabs.Trigger name="settings">
22
+ <NativeTabs.Trigger.Label>{copy.tabs.settings}</NativeTabs.Trigger.Label>
23
+ <NativeTabs.Trigger.Icon sf={{ default: "gearshape", selected: "gearshape.fill" }} md="settings" />
24
+ </NativeTabs.Trigger>
25
+ </NativeTabs>
26
+ );
27
+ }
@@ -0,0 +1,6 @@
1
+ import { Stack } from "expo-router";
2
+
3
+ /** Each tab is a stack, so its screen gets the platform's own header. */
4
+ export default function NotificationsStack() {
5
+ return <Stack />;
6
+ }
@@ -0,0 +1,36 @@
1
+ import { useCallback } from "react";
2
+ import { Redirect, Stack, useFocusEffect } from "expo-router";
3
+ import { useOptionalPush } from "@marktiderman/genesis-native/push";
4
+ import { NotificationsPage, getNotificationsPageStackOptions } from "@marktiderman/genesis-ui-native";
5
+ import starter from "../../../../starter.config";
6
+ import { copy } from "@/copy";
7
+ import { useNotifications } from "@/lib/notifications";
8
+
9
+ /** The Notifications tab (`features.notifications`). */
10
+ export default function NotificationsScreen() {
11
+ const { data = [], isRefetching, refetch } = useNotifications();
12
+ // Coming to this tab is the moment push is worth asking for: the soft prompt (never at launch;
13
+ // the block ignores an offer in its first seconds and after a recent Not now), each time it's shown.
14
+ const push = useOptionalPush();
15
+ useFocusEffect(
16
+ useCallback(() => {
17
+ void push?.prompt.offer(copy.push.promptReason);
18
+ }, [push]),
19
+ );
20
+ if (!starter.features.notifications) return <Redirect href="/" />;
21
+ return (
22
+ <>
23
+ <Stack.Screen options={getNotificationsPageStackOptions({ headerTitle: copy.notifications.title })} />
24
+ <NotificationsPage
25
+ testID="notifications"
26
+ items={data}
27
+ refreshing={isRefetching}
28
+ onRefresh={async () => {
29
+ await refetch();
30
+ }}
31
+ emptyTitle={copy.notifications.emptyTitle}
32
+ emptyBody={copy.notifications.emptyBody}
33
+ />
34
+ </>
35
+ );
36
+ }
@@ -0,0 +1,6 @@
1
+ import { Stack } from "expo-router";
2
+
3
+ /** Each tab is a stack, so its screen gets the platform's own header. */
4
+ export default function SettingsStack() {
5
+ return <Stack />;
6
+ }