@marktiderman/genesis-cli 1.13.0 → 1.13.1

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "packages": {
3
3
  "@marktiderman/genesis-chat": {
4
- "version": "0.3.2",
4
+ "version": "0.3.3",
5
5
  "blocks": {
6
6
  "chat": {
7
7
  "feature": {
@@ -52,8 +52,11 @@
52
52
  }
53
53
  }
54
54
  },
55
+ "@marktiderman/genesis-collab": {
56
+ "version": "0.1.0"
57
+ },
55
58
  "@marktiderman/genesis-core": {
56
- "version": "1.13.0"
59
+ "version": "1.14.0"
57
60
  },
58
61
  "@marktiderman/genesis-switchboard": {
59
62
  "version": "2.1.0"
@@ -68,7 +71,7 @@
68
71
  "version": "0.6.0"
69
72
  },
70
73
  "@marktiderman/genesis-forms": {
71
- "version": "0.9.2"
74
+ "version": "0.9.3"
72
75
  },
73
76
  "@marktiderman/genesis-forms-builder": {
74
77
  "version": "0.6.4"
@@ -77,7 +80,7 @@
77
80
  "version": "0.1.2"
78
81
  },
79
82
  "@marktiderman/genesis-forms-native": {
80
- "version": "0.1.1"
83
+ "version": "0.2.0"
81
84
  },
82
85
  "@marktiderman/genesis-forms-react": {
83
86
  "version": "0.3.1"
@@ -89,13 +92,13 @@
89
92
  "version": "0.6.3"
90
93
  },
91
94
  "@marktiderman/genesis": {
92
- "version": "0.9.13"
95
+ "version": "0.9.14"
93
96
  },
94
97
  "@marktiderman/genesis-cli": {
95
- "version": "1.13.0"
98
+ "version": "1.13.1"
96
99
  },
97
100
  "@marktiderman/genesis-native": {
98
- "version": "0.4.4",
101
+ "version": "0.5.0",
99
102
  "blocks": {
100
103
  "push": {
101
104
  "feature": {
@@ -273,7 +276,7 @@
273
276
  }
274
277
  },
275
278
  "@marktiderman/genesis-notifications": {
276
- "version": "0.2.2",
279
+ "version": "0.3.0",
277
280
  "blocks": {
278
281
  "notifications": {
279
282
  "feature": {
@@ -328,6 +331,9 @@
328
331
  }
329
332
  }
330
333
  },
334
+ "@marktiderman/genesis-product": {
335
+ "version": "0.0.5"
336
+ },
331
337
  "@marktiderman/genesis-sites": {
332
338
  "version": "0.3.3",
333
339
  "blocks": {
@@ -376,10 +382,10 @@
376
382
  "version": "0.2.1"
377
383
  },
378
384
  "@marktiderman/genesis-studio-server": {
379
- "version": "0.3.1"
385
+ "version": "0.4.0"
380
386
  },
381
387
  "@marktiderman/genesis-supabase": {
382
- "version": "0.7.0",
388
+ "version": "0.8.0",
383
389
  "blocks": {
384
390
  "account": {
385
391
  "feature": {
@@ -546,6 +552,40 @@
546
552
  "steps": [
547
553
  "Define private.genesis_owner_can(tenant, viewer, person_id, team_id, organization_id, action) and private.genesis_readable_owners(viewer) in your own migration, as the header of 0009 shows. Without them the wrappers answer no."
548
554
  ]
555
+ },
556
+ "web-handoff": {
557
+ "feature": {
558
+ "name": "Continue on the web",
559
+ "summary": "A native app opens a web page signed in as the same person: a single-use, 60-second link minted by the server for the person's own account, confirmed on the page unless that browser is already signed in as them.",
560
+ "keywords": [
561
+ "handoff",
562
+ "open on web",
563
+ "magic link",
564
+ "single sign-on",
565
+ "continue on web"
566
+ ],
567
+ "audience": [
568
+ "person"
569
+ ]
570
+ },
571
+ "platforms": [
572
+ "web",
573
+ "native"
574
+ ],
575
+ "migrations": [
576
+ {
577
+ "file": "migrations/0015_genesis_web_handoff.sql",
578
+ "test": "migrations/tests/0015_genesis_web_handoff.test.sql"
579
+ }
580
+ ],
581
+ "install": [
582
+ "@supabase/supabase-js@^2.118.0"
583
+ ],
584
+ "steps": [
585
+ "Add two POST routes with createWebHandoff from @marktiderman/genesis-supabase/web-handoff/server (mint at /api/auth/handoff, redeem at /api/auth/redeem-handoff), using the service-role client on the server.",
586
+ "Add the /auth/handoff page: call takeWebHandoffFragment before analytics or error reporting load, then completeWebHandoff; send Referrer-Policy: no-referrer and frame-ancestors 'none' for it.",
587
+ "In the native app, call openOnWeb from @marktiderman/genesis-native/web-handoff with the mint route, the session's access token and expo-web-browser."
588
+ ]
549
589
  }
550
590
  }
551
591
  },
@@ -740,10 +780,243 @@
740
780
  }
741
781
  },
742
782
  "@marktiderman/genesis-ui": {
743
- "version": "2.18.0"
783
+ "version": "2.19.0"
744
784
  },
745
785
  "@marktiderman/genesis-ui-native": {
746
- "version": "2.6.0"
786
+ "version": "2.7.0"
787
+ },
788
+ "@marktiderman/genesis-work": {
789
+ "version": "0.2.0",
790
+ "blocks": {
791
+ "pursuits": {
792
+ "feature": {
793
+ "name": "Pursuits",
794
+ "summary": "Goals and projects (one table, either or both) with tasks, issues and milestones, owned by a person, a team or the tenant; who reads and writes is the app's hook.",
795
+ "keywords": [
796
+ "goals",
797
+ "projects",
798
+ "tasks",
799
+ "issues",
800
+ "milestones",
801
+ "quarterly priorities"
802
+ ],
803
+ "audience": [
804
+ "person",
805
+ "developer"
806
+ ]
807
+ },
808
+ "platforms": [
809
+ "web",
810
+ "native"
811
+ ],
812
+ "requires": [
813
+ "owner-access"
814
+ ],
815
+ "migrations": [
816
+ {
817
+ "file": "migrations/0001_genesis_work_pursuits.sql",
818
+ "test": "migrations/tests/0001_genesis_work_pursuits.test.sql"
819
+ }
820
+ ],
821
+ "install": [
822
+ "@supabase/supabase-js@^2.118.0"
823
+ ],
824
+ "steps": [
825
+ "Define private.genesis_readable_owners(viewer) and private.genesis_owner_can(tenant, viewer, person_id, team_id, organization_id, action) in a migration, as the header of 0009 shows. Without them nobody signed in reads or writes.",
826
+ "Add genesis_work to your API's exposed schemas (supabase/config.toml [api] schemas)."
827
+ ]
828
+ },
829
+ "metrics": {
830
+ "feature": {
831
+ "name": "Metrics",
832
+ "summary": "Numbers tracked over time (a scorecard, a habit, a profit margin), one value per period, goals that change over time, owned by a person, a team or the tenant.",
833
+ "keywords": [
834
+ "metrics",
835
+ "kpi",
836
+ "scorecard",
837
+ "habits",
838
+ "trend"
839
+ ],
840
+ "audience": [
841
+ "person",
842
+ "developer"
843
+ ]
844
+ },
845
+ "platforms": [
846
+ "web",
847
+ "native"
848
+ ],
849
+ "requires": [
850
+ "pursuits"
851
+ ],
852
+ "migrations": [
853
+ {
854
+ "file": "migrations/0002_genesis_work_metrics.sql",
855
+ "test": "migrations/tests/0002_genesis_work_metrics.test.sql"
856
+ }
857
+ ],
858
+ "install": [
859
+ "@supabase/supabase-js@^2.118.0"
860
+ ],
861
+ "steps": [
862
+ "Uses the owner-access block's hooks: private.genesis_readable_owners(viewer) and private.genesis_owner_can(...). Without them nobody signed in reads or writes.",
863
+ "Add genesis_work to your API's exposed schemas (supabase/config.toml [api] schemas)."
864
+ ]
865
+ },
866
+ "status-updates": {
867
+ "feature": {
868
+ "name": "Status updates",
869
+ "summary": "Dated updates (health and a note) on goals, projects, tasks, issues and metrics, and requests to a person for an update by a due time, answered by posting one.",
870
+ "keywords": [
871
+ "status update",
872
+ "check-in",
873
+ "update request",
874
+ "health",
875
+ "overdue"
876
+ ],
877
+ "audience": [
878
+ "person",
879
+ "developer"
880
+ ]
881
+ },
882
+ "platforms": [
883
+ "web",
884
+ "native"
885
+ ],
886
+ "requires": [
887
+ "pursuits",
888
+ "metrics"
889
+ ],
890
+ "migrations": [
891
+ {
892
+ "file": "migrations/0003_genesis_work_updates.sql",
893
+ "test": "migrations/tests/0003_genesis_work_updates.test.sql"
894
+ }
895
+ ],
896
+ "install": [
897
+ "@supabase/supabase-js@^2.118.0"
898
+ ],
899
+ "steps": [
900
+ "Needs the pursuits and metrics blocks and their hooks. For reminders, schedule a job (the jobs block) that reads update_requests_due and sends one notification per request.",
901
+ "Add genesis_work to your API's exposed schemas (supabase/config.toml [api] schemas)."
902
+ ]
903
+ },
904
+ "sessions": {
905
+ "feature": {
906
+ "name": "Sessions",
907
+ "summary": "Sessions of any kind (a meeting, workshop, presentation, coaching call, one-on-one, class or planning day): types with agendas, a schedule and calendar event, the agenda copied at start, the live step, notes and recordings; attendees with presence and a 1-to-10 rating; links to pre-work and collaboration spaces.",
908
+ "keywords": [
909
+ "sessions",
910
+ "meetings",
911
+ "workshops",
912
+ "coaching calls",
913
+ "agenda",
914
+ "rating",
915
+ "attendance"
916
+ ],
917
+ "audience": [
918
+ "person",
919
+ "developer"
920
+ ]
921
+ },
922
+ "platforms": [
923
+ "web",
924
+ "native"
925
+ ],
926
+ "requires": [
927
+ "pursuits"
928
+ ],
929
+ "migrations": [
930
+ {
931
+ "file": "migrations/0004_genesis_work_sessions.sql",
932
+ "test": "migrations/tests/0004_genesis_work_sessions.test.sql"
933
+ }
934
+ ],
935
+ "install": [
936
+ "@supabase/supabase-js@^2.118.0"
937
+ ],
938
+ "steps": [
939
+ "Uses the owner-access block (genesis-supabase) and its app hooks. To share pre-work or a live worksheet with attendees, register private.genesis_session_members(session) as a collaboration audience.",
940
+ "Add genesis_work to your API's exposed schemas (supabase/config.toml [api] schemas)."
941
+ ]
942
+ },
943
+ "custom-fields": {
944
+ "feature": {
945
+ "name": "Custom fields",
946
+ "summary": "A tenant's own fields on goals, projects, tasks, issues, metrics and sessions, with no code or migration: genesis-forms field types, values in a custom jsonb checked by shape, app and content-pack fields that only server code writes.",
947
+ "keywords": [
948
+ "custom fields",
949
+ "extend",
950
+ "metafields",
951
+ "properties"
952
+ ],
953
+ "audience": [
954
+ "admin",
955
+ "developer"
956
+ ]
957
+ },
958
+ "platforms": [
959
+ "web",
960
+ "native"
961
+ ],
962
+ "requires": [
963
+ "pursuits",
964
+ "metrics",
965
+ "sessions"
966
+ ],
967
+ "migrations": [
968
+ {
969
+ "file": "migrations/0005_genesis_work_fields.sql",
970
+ "test": "migrations/tests/0005_genesis_work_fields.test.sql"
971
+ }
972
+ ],
973
+ "install": [
974
+ "@supabase/supabase-js@^2.118.0"
975
+ ],
976
+ "steps": [
977
+ "Validate custom values on the server with the genesis-forms engine before writing; the database checks only their shape and that a field exists."
978
+ ]
979
+ },
980
+ "content-pack-install": {
981
+ "feature": {
982
+ "name": "Content pack install",
983
+ "summary": "Install a content pack (session types, metric templates, custom fields, labels) into a tenant's own editable rows; updates are additive and keep what the tenant changed; uninstalling removes only untouched, unused items.",
984
+ "keywords": [
985
+ "content packs",
986
+ "templates",
987
+ "starter content",
988
+ "install",
989
+ "taxonomy"
990
+ ],
991
+ "audience": [
992
+ "admin",
993
+ "developer"
994
+ ]
995
+ },
996
+ "platforms": [
997
+ "web",
998
+ "native",
999
+ "server"
1000
+ ],
1001
+ "requires": [
1002
+ "sessions",
1003
+ "metrics",
1004
+ "custom-fields"
1005
+ ],
1006
+ "migrations": [
1007
+ {
1008
+ "file": "migrations/0006_genesis_work_packs.sql",
1009
+ "test": "migrations/tests/0006_genesis_work_packs.test.sql"
1010
+ }
1011
+ ],
1012
+ "install": [
1013
+ "@supabase/supabase-js@^2.118.0"
1014
+ ],
1015
+ "steps": [
1016
+ "Install packs from server code: check that a tenant admin asked, then call genesis_work.install_content_pack(tenant, manifest, person) with the service role. Forms and roadmap templates in a manifest are the app's to install."
1017
+ ]
1018
+ }
1019
+ }
747
1020
  }
748
1021
  }
749
1022
  }
@@ -59,7 +59,7 @@ In this monorepo the root `pnpm-workspace.yaml` pins `react`, `react-dom`, `@typ
59
59
  ## Turning features off
60
60
 
61
61
  Each line of `features` in `starter.config.ts` is one feature, `true` by default except
62
- `googleSignIn`:
62
+ `googleSignIn` and `productDemo`:
63
63
 
64
64
  | Line | What it is | Off means |
65
65
  | --- | --- | --- |
@@ -79,6 +79,7 @@ Each line of `features` in `starter.config.ts` is one feature, `true` by default
79
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
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
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
+ | `productDemo` | **Off by default.** A demo of `@marktiderman/genesis-product/native` (`src/lib/product-demo.ts`): Settings > Product demo opens the idea board (a vote shows at once, with a haptic, and is queued while offline) and the Now / Next / Later roadmap, over sample data in memory. Nothing is sent anywhere. Screen: `src/app/(app)/settings/product.tsx`. | No Settings row; the route sends you back to Settings. |
82
83
 
83
84
  A config with every sign-in method off, or Google without Apple, fails at start-up. Apple's button
84
85
  only shows on iOS, so with `emailSignIn` and `googleSignIn` off `app.config.ts` builds for iOS only.
@@ -290,6 +291,13 @@ it (App Store Review Guideline 4.8): `defineStarter` refuses Google without Appl
290
291
  imports it first, and the root layout is exported wrapped (`wrapRoot`). Release and dist come
291
292
  from the version signature, with the update id and channel as tags. Source map upload is
292
293
  optional: the commented plugin line in `app.config.ts` says what to turn on.
294
+ - **Errors per tab.** Each tab's `_layout.tsx` exports `ScreenErrorBoundary` (from
295
+ `src/lib/observability.ts`) as its Expo Router `ErrorBoundary`: a screen that throws shows "This
296
+ screen hit a problem" with Try again, the tab bar keeps working, and the error is reported
297
+ non-fatal (through Sentry's `wrapExpoRouterErrorBoundary`). Queries and mutations that fail
298
+ unexpectedly are reported too; offline, signed-out and refused requests are not.
299
+ - **Trace headers.** `tracePropagationTargets` lists the hosts that get Sentry's trace headers:
300
+ this app's Supabase project only. Add your own API's origin there; every other host gets none.
293
301
  - **Source maps.** Builds upload theirs to EAS for EAS Observe (`uploadSourceMaps: true` in the
294
302
  preview and production profiles of `eas.json`), so its stack traces are symbolicated. The
295
303
  workflows' update jobs set `upload_sentry_sourcemaps: false`: left unset, EAS tries a Sentry
@@ -0,0 +1,32 @@
1
+ import { describe, expect, it, jest } from "@jest/globals";
2
+ import { screen, userEvent, within } from "@testing-library/react-native";
3
+ import { copy } from "@/copy";
4
+ import { expectPathname, renderApp } from "./render-app";
5
+
6
+ // This file's app has `features.productDemo` on (it is off by default); every other switch is the starter's own.
7
+ jest.mock("../../starter.config", () => {
8
+ const actual = jest.requireActual<{ default: { features: object } }>("../../starter.config").default;
9
+ return { __esModule: true, default: { ...actual, features: { ...actual.features, productDemo: true } } };
10
+ });
11
+
12
+ const t = copy.productDemo;
13
+
14
+ describe("product demo", () => {
15
+ it("opens from Settings: the idea board votes at once, and the roadmap switches to Next", async () => {
16
+ const app = await renderApp("/settings", "person@example.com");
17
+ const user = userEvent.setup();
18
+ await user.press(await screen.findByTestId("open-product-demo"));
19
+ await expectPathname(app, "/settings/product");
20
+ expect(await screen.findByText(t.ideas.darkMode.title)).toBeOnTheScreen();
21
+ const row = screen.getByTestId("product-ideas-idea-dark-mode");
22
+ expect(within(row).getByText("12 votes · Planned")).toBeOnTheScreen();
23
+ await user.press(screen.getByTestId("product-ideas-vote-dark-mode"));
24
+ expect(await within(row).findByText("13 votes · Planned · You voted")).toBeOnTheScreen();
25
+
26
+ await user.press(screen.getByTestId("product-demo-tab-option-roadmap"));
27
+ expect(await screen.findByText(t.roadmap.search.title)).toBeOnTheScreen();
28
+ await user.press(screen.getByTestId("product-roadmap-horizon-option-next"));
29
+ expect(await screen.findByText(t.roadmap.offline.title)).toBeOnTheScreen();
30
+ expect(screen.queryByText(t.roadmap.search.title)).toBeNull();
31
+ });
32
+ });
@@ -1,4 +1,4 @@
1
- // @feat:native-starter @feat:app-updates @feat:push @feat:observability @feat:devtools-overlay @feat:support-feedback @feat:chat
1
+ // @feat:native-starter @feat:app-updates @feat:push @feat:observability @feat:devtools-overlay @feat:support-feedback @feat:chat @feat:product-roadmap
2
2
  import { readFileSync, readdirSync, statSync } from "node:fs";
3
3
  import { createRequire } from "node:module";
4
4
  import { dirname, join } from "node:path";
@@ -389,6 +389,15 @@ describe("chat", () => {
389
389
  }
390
390
  });
391
391
 
392
+ it("gives every tab a reported screen boundary, and sends trace headers to its own Supabase only", () => {
393
+ for (const tab of ["(home)", "notifications", "messages", "settings"]) {
394
+ expect(read(join("src/app/(app)", tab, "_layout.tsx")), tab).toContain('export { ScreenErrorBoundary as ErrorBoundary } from "@/lib/observability";');
395
+ }
396
+ const observability = read("src/lib/observability.ts");
397
+ expect(observability).toContain("observability.screenBoundary()");
398
+ expect(observability).toMatch(/tracePropagationTargets: \[env\.supabaseUrl/);
399
+ });
400
+
392
401
  it("starts each conversation's thread fresh: the screen is keyed by the conversation id", () => {
393
402
  expect(read("src/app/(app)/messages/[id].tsx")).toMatch(/<ChatThreadScreen key=\{id\} conversationId=\{id\}/);
394
403
  });
@@ -431,3 +440,26 @@ describe("chat", () => {
431
440
  expect(Object.keys(pkg.dependencies)).toEqual(expect.arrayContaining(["expo-audio", "expo-image-picker", "expo-clipboard", "@marktiderman/genesis-chat"]));
432
441
  });
433
442
  });
443
+
444
+ describe("product demo", () => {
445
+ it("is off by default, behind the one `productDemo` switch: no Settings row, and the route goes back to Settings", () => {
446
+ expect(starter.features.productDemo).toBe(false);
447
+ expect(read("src/app/(app)/settings/index.tsx")).toContain("...(starter.features.productDemo");
448
+ expect(read("src/app/(app)/settings/product.tsx")).toContain('if (!starter.features.productDemo) return <Redirect href="/settings" />');
449
+ expect(read("app.config.ts")).not.toContain("features.productDemo");
450
+ const pkg = JSON.parse(read("package.json")) as { dependencies: Record<string, string> };
451
+ expect(Object.keys(pkg.dependencies)).toContain("@marktiderman/genesis-product");
452
+ });
453
+ });
454
+
455
+ describe("metro", () => {
456
+ it("watches every Genesis workspace package the app depends on, so an edit to one reloads the app", () => {
457
+ const pkg = JSON.parse(read("package.json")) as { dependencies: Record<string, string> };
458
+ const watched = /\.\.\.\[([^\]]+)\]\.map\(\(name\) => path\.resolve\(monorepoRoot, "packages", name\)\)/.exec(read("metro.config.js"))?.[1] ?? "";
459
+ const names = [...watched.matchAll(/"([^"]+)"/g)].map((m) => m[1]);
460
+ const genesis = Object.keys(pkg.dependencies)
461
+ .filter((d) => d.startsWith("@marktiderman/genesis-"))
462
+ .map((d) => d.slice("@marktiderman/genesis-".length));
463
+ for (const name of genesis) expect(names, name).toContain(name);
464
+ });
465
+ });
@@ -13,7 +13,7 @@ const config = getDefaultConfig(projectRoot);
13
13
  // The workspace packages the app imports, so edits to them reload the app.
14
14
  config.watchFolders = [
15
15
  ...(config.watchFolders || []),
16
- ...["chat", "core", "design-system", "features", "forms", "forms-native", "forms-react", "native", "supabase", "support", "ui-native"].map((name) => path.resolve(monorepoRoot, "packages", name)),
16
+ ...["chat", "core", "design-system", "features", "forms", "forms-native", "forms-react", "native", "notifications", "product", "supabase", "support", "ui-native"].map((name) => path.resolve(monorepoRoot, "packages", name)),
17
17
  ];
18
18
 
19
19
  config.resolver.nodeModulesPaths = [
@@ -27,6 +27,7 @@
27
27
  "@marktiderman/genesis-forms-react": "workspace:^",
28
28
  "@marktiderman/genesis-native": "workspace:^",
29
29
  "@marktiderman/genesis-notifications": "workspace:^",
30
+ "@marktiderman/genesis-product": "workspace:^",
30
31
  "@marktiderman/genesis-supabase": "workspace:^",
31
32
  "@marktiderman/genesis-support": "workspace:^",
32
33
  "@marktiderman/genesis-ui-native": "workspace:^",
@@ -4,3 +4,6 @@ import { Stack } from "expo-router";
4
4
  export default function HomeStack() {
5
5
  return <Stack />;
6
6
  }
7
+
8
+ /** A screen in this tab that throws shows Try again here; the tab bar and the other tabs keep working. */
9
+ export { ScreenErrorBoundary as ErrorBoundary } from "@/lib/observability";
@@ -9,3 +9,6 @@ export default function MessagesStack() {
9
9
  if (!userId) return null;
10
10
  return <Stack />;
11
11
  }
12
+
13
+ /** A screen in this tab that throws shows Try again here; the tab bar and the other tabs keep working. */
14
+ export { ScreenErrorBoundary as ErrorBoundary } from "@/lib/observability";
@@ -4,3 +4,6 @@ import { Stack } from "expo-router";
4
4
  export default function NotificationsStack() {
5
5
  return <Stack />;
6
6
  }
7
+
8
+ /** A screen in this tab that throws shows Try again here; the tab bar and the other tabs keep working. */
9
+ export { ScreenErrorBoundary as ErrorBoundary } from "@/lib/observability";
@@ -4,3 +4,6 @@ import { Stack } from "expo-router";
4
4
  export default function SettingsStack() {
5
5
  return <Stack />;
6
6
  }
7
+
8
+ /** A screen in this tab that throws shows Try again here; the tab bar and the other tabs keep working. */
9
+ export { ScreenErrorBoundary as ErrorBoundary } from "@/lib/observability";
@@ -28,9 +28,15 @@ export default function SettingsScreen() {
28
28
  { id: "account", title: t.accountSection, rows: [{ id: "email", title: t.signedInAs, subtitle: session?.user.email ?? "" }] },
29
29
  {
30
30
  id: "general",
31
- rows: starter.features.chat
32
- ? [{ id: "availability", title: t.availability, subtitle: t.availabilitySubtitle, showChevron: true, onPress: () => router.push("/settings/availability" as Href), testID: "open-availability" }]
33
- : [],
31
+ rows: [
32
+ ...(starter.features.chat
33
+ ? [{ id: "availability", title: t.availability, subtitle: t.availabilitySubtitle, showChevron: true, onPress: () => router.push("/settings/availability" as Href), testID: "open-availability" }]
34
+ : []),
35
+ // Off by default (`features.productDemo`).
36
+ ...(starter.features.productDemo
37
+ ? [{ id: "product-demo", title: copy.productDemo.settingsRow, subtitle: copy.productDemo.settingsRowSubtitle, showChevron: true, onPress: () => router.push("/settings/product" as Href), testID: "open-product-demo" }]
38
+ : []),
39
+ ],
34
40
  },
35
41
  // The support block's Send feedback and Help rows (`features.support`).
36
42
  { id: "support", title: copy.support.settings.section, rows: [] },
@@ -0,0 +1,44 @@
1
+ import { useState } from "react";
2
+ import { Redirect, Stack } from "expo-router";
3
+ import { View } from "react-native";
4
+ import * as Haptics from "expo-haptics";
5
+ import { IdeaBoardScreen, RoadmapScreen } from "@marktiderman/genesis-product/native";
6
+ import { NativeSegmentedControl, getInboxPageStackOptions } from "@marktiderman/genesis-ui-native";
7
+ import starter from "../../../../starter.config";
8
+ import { copy } from "@/copy";
9
+ import { productDemoSource, productDemoVotes } from "@/lib/product-demo";
10
+
11
+ const t = copy.productDemo;
12
+
13
+ /** The product demo (`features.productDemo`): the idea board and the roadmap over sample data. */
14
+ export default function ProductDemoScreen() {
15
+ if (!starter.features.productDemo) return <Redirect href="/settings" />;
16
+ return <Demo />;
17
+ }
18
+
19
+ function Demo() {
20
+ const [tab, setTab] = useState<"ideas" | "roadmap">("ideas");
21
+ return (
22
+ <>
23
+ <Stack.Screen options={getInboxPageStackOptions({ headerTitle: t.title, large: false })} />
24
+ <View style={{ paddingHorizontal: 16, paddingVertical: 8 }}>
25
+ <NativeSegmentedControl
26
+ testID="product-demo-tab"
27
+ value={tab}
28
+ onChange={setTab}
29
+ options={[
30
+ { value: "ideas", label: t.ideasTab },
31
+ { value: "roadmap", label: t.roadmapTab },
32
+ ]}
33
+ />
34
+ </View>
35
+ <View style={{ flex: 1 }}>
36
+ {tab === "ideas" ? (
37
+ <IdeaBoardScreen source={productDemoSource} queue={productDemoVotes} haptics={Haptics} />
38
+ ) : (
39
+ <RoadmapScreen source={productDemoSource} haptics={Haptics} />
40
+ )}
41
+ </View>
42
+ </>
43
+ );
44
+ }
@@ -108,6 +108,24 @@ const en = {
108
108
  ideas: { title: "Idea board" },
109
109
  shipped: { title: "You asked, we shipped" },
110
110
  },
111
+ // The product demo (`features.productDemo`): sample data for @marktiderman/genesis-product's screens.
112
+ productDemo: {
113
+ settingsRow: "Product demo",
114
+ settingsRowSubtitle: "Ideas and the roadmap, over sample data",
115
+ title: "Product",
116
+ ideasTab: "Ideas",
117
+ roadmapTab: "Roadmap",
118
+ ideas: {
119
+ darkMode: { title: "Dark mode", body: "Follow the phone's light or dark setting." },
120
+ calendar: { title: "Add sessions to my calendar", body: "One tap to put a booking in my phone's calendar." },
121
+ widgets: { title: "Home screen widget", body: "See today's plan without opening the app." },
122
+ },
123
+ roadmap: {
124
+ search: { title: "Search", summary: "Find any message, note or file." },
125
+ offline: { title: "Works offline", summary: "Read and write without a connection; it syncs when you're back." },
126
+ sharing: { title: "Share a plan", summary: "Send a plan to someone outside the app." },
127
+ },
128
+ },
111
129
  // Chat's own strings (genesis-chat's `chatNativeCopy`); the ones here override its English.
112
130
  chat: {
113
131
  inboxTitle: "Messages",
@@ -101,6 +101,13 @@ export interface StarterFeatures {
101
101
  * and expo-clipboard stay in the build either way.
102
102
  */
103
103
  chat: boolean;
104
+ /**
105
+ * A demo of `@marktiderman/genesis-product/native`, off by default: Settings > Product demo opens
106
+ * the idea board (votes with haptics, queued while offline) and the Now / Next / Later roadmap, over
107
+ * sample data in memory (`memoryProductSource`, `src/lib/product-demo.ts`). Nothing leaves the
108
+ * phone. JavaScript only.
109
+ */
110
+ productDemo: boolean;
104
111
  }
105
112
 
106
113
  export interface StarterConfig {
@@ -14,9 +14,10 @@ import { useSegments } from "expo-router";
14
14
  import * as Updates from "expo-updates";
15
15
  import type { ComponentType } from "react";
16
16
  import { Platform } from "react-native";
17
- import { consoleSink, createObservability, defineEvents, sentrySink } from "@marktiderman/genesis-native/observability";
17
+ import { consoleSink, createObservability, createScreenErrorBoundary, defineEvents, sentrySink } from "@marktiderman/genesis-native/observability";
18
18
  import { versionSignature } from "@marktiderman/genesis-native/updates";
19
19
  import starter from "../../starter.config";
20
+ import { env } from "./env";
20
21
 
21
22
  /** Every analytics event the app sends, and the props each may carry (closed lists, numbers, booleans: never free text). */
22
23
  export const events = defineEvents({
@@ -34,6 +35,8 @@ export const observability = starter.features.observability
34
35
  dsn: process.env.EXPO_PUBLIC_SENTRY_DSN,
35
36
  signature: versionSignature({ application: Application, updates: Updates, platform: Platform.OS }),
36
37
  applicationId: Application.applicationId,
38
+ // Trace headers go to this app's own Supabase project only, never to other hosts.
39
+ tracePropagationTargets: [env.supabaseUrl.replace(/\/+$/, "")],
37
40
  }),
38
41
  ],
39
42
  })
@@ -43,3 +46,11 @@ export const observability = starter.features.observability
43
46
  export function wrapRoot<P extends Record<string, unknown>>(root: ComponentType<P>): ComponentType<P> {
44
47
  return observability ? observability.wrap(root) : root;
45
48
  }
49
+
50
+ /**
51
+ * Each tab's `ErrorBoundary` (`export { ScreenErrorBoundary as ErrorBoundary }` in its
52
+ * `_layout.tsx`): a screen that throws shows "This screen hit a problem" with Try again, the tab
53
+ * bar and the other tabs keep working, and the error is reported non-fatal (through Sentry's
54
+ * Expo Router wrapper when the block is on).
55
+ */
56
+ export const ScreenErrorBoundary = observability ? observability.screenBoundary() : createScreenErrorBoundary();
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The product demo (`features.productDemo`, off by default): @marktiderman/genesis-product's
3
+ * native screens over sample data in memory. Nothing leaves the phone. A real app passes a
4
+ * `ProductSource` over its own backend instead, and a vote queue kept in AsyncStorage
5
+ * (`createVoteQueue({ source, store: storageVoteQueueStore(AsyncStorage) })`).
6
+ */
7
+ import { createVoteQueue, memoryProductSource } from "@marktiderman/genesis-product/native";
8
+ import { copy } from "@/copy";
9
+
10
+ const t = copy.productDemo;
11
+
12
+ /** One source and one vote queue for the app's life, so votes survive leaving the screen. */
13
+ export const productDemoSource = memoryProductSource({
14
+ ideas: [
15
+ { id: "dark-mode", ...t.ideas.darkMode, votes: 12, voted: false, status: "planned" },
16
+ { id: "calendar", ...t.ideas.calendar, votes: 7, voted: true, status: "open" },
17
+ { id: "widgets", ...t.ideas.widgets, votes: 3, voted: false, status: "open" },
18
+ ],
19
+ roadmap: [
20
+ { id: "search", ...t.roadmap.search, horizon: "now", votes: 9 },
21
+ { id: "offline", ...t.roadmap.offline, horizon: "next", votes: 5 },
22
+ { id: "sharing", ...t.roadmap.sharing, horizon: "later" },
23
+ ],
24
+ });
25
+
26
+ export const productDemoVotes = createVoteQueue({ source: productDemoSource });
@@ -34,5 +34,7 @@ export default defineStarter({
34
34
  checkIn: true,
35
35
  support: true,
36
36
  chat: true,
37
+ // Off: a demo of @marktiderman/genesis-product's native screens over sample data. README, "Product demo".
38
+ productDemo: false,
37
39
  },
38
40
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marktiderman/genesis-cli",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Genesis CLI — `genesis init` scaffolds a Genesis app (`--template native`: a new Expo app from the RN starter); `genesis add <block>` adds a block from what its package declares; `genesis migrate` copies new package migrations in and never rewrites an applied one; `genesis upgrade` moves every Genesis package to one release and refreshes the files Genesis owns; `genesis doctor` checks an app against the installed Genesis; `genesis studio init` turns the Data Studio on; `genesis introspect` writes a checked-in contract; `genesis features build|check` keeps generated feature docs in step with features.ts; `withGenesis()` (`app.plugin.js`, `/expo`) is the Expo config plugin.",
@@ -51,7 +51,7 @@
51
51
  ],
52
52
  "dependencies": {
53
53
  "@marktiderman/genesis-features": "^0.6.0",
54
- "@marktiderman/genesis-studio-server": "^0.3.1",
54
+ "@marktiderman/genesis-studio-server": "^0.4.0",
55
55
  "commander": "^12.1.0",
56
56
  "jiti": "^2.4.0",
57
57
  "postgres": "^3.4.9"
@@ -60,7 +60,7 @@
60
60
  "@expo/config": "^55.0.19",
61
61
  "@expo/config-plugins": "^55.0.11",
62
62
  "@expo/config-types": "^55.0.6",
63
- "@marktiderman/genesis-core": "^1.13.0",
63
+ "@marktiderman/genesis-core": "^1.14.0",
64
64
  "@types/node": "^22.9.0",
65
65
  "tsup": "^8.3.0",
66
66
  "typescript": "~6.0.3",