@marktiderman/genesis-native 0.1.0 → 0.3.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 (87) hide show
  1. package/README.md +354 -10
  2. package/dist/block-C5-noMhB.d.ts +223 -0
  3. package/dist/blocks-a1YQ1Elf.d.ts +1540 -0
  4. package/dist/chunk-65P7RU4V.js +49 -0
  5. package/dist/chunk-65P7RU4V.js.map +1 -0
  6. package/dist/chunk-6BT4PTGH.js +37 -0
  7. package/dist/chunk-6BT4PTGH.js.map +1 -0
  8. package/dist/chunk-75YP72G6.js +374 -0
  9. package/dist/chunk-75YP72G6.js.map +1 -0
  10. package/dist/chunk-NGYNYJPL.js +90 -0
  11. package/dist/chunk-NGYNYJPL.js.map +1 -0
  12. package/dist/chunk-VKTIHNAV.js +95 -0
  13. package/dist/chunk-VKTIHNAV.js.map +1 -0
  14. package/dist/{chunk-MMTPWUWI.js → chunk-VTJDIKFC.js} +9 -6
  15. package/dist/chunk-VTJDIKFC.js.map +1 -0
  16. package/dist/chunk-XE7LC7K6.js +29 -0
  17. package/dist/chunk-XE7LC7K6.js.map +1 -0
  18. package/dist/dev-warnings.d.ts +34 -0
  19. package/dist/dev-warnings.js +15 -0
  20. package/dist/dev-warnings.js.map +1 -0
  21. package/dist/devtools.d.ts +144 -0
  22. package/dist/devtools.js +390 -0
  23. package/dist/devtools.js.map +1 -0
  24. package/dist/index.d.ts +12 -368
  25. package/dist/index.js +88 -191
  26. package/dist/index.js.map +1 -1
  27. package/dist/observability.d.ts +170 -0
  28. package/dist/observability.js +123 -0
  29. package/dist/observability.js.map +1 -0
  30. package/dist/persist.d.ts +1 -1
  31. package/dist/persist.js +1 -1
  32. package/dist/push.d.ts +169 -0
  33. package/dist/push.js +996 -0
  34. package/dist/push.js.map +1 -0
  35. package/dist/{query-DhH3lLFa.d.ts → query-DUmVAfsF.d.ts} +11 -6
  36. package/dist/updates.d.ts +8 -1
  37. package/dist/updates.js +44 -69
  38. package/dist/updates.js.map +1 -1
  39. package/package.json +222 -5
  40. package/src/app.tsx +491 -0
  41. package/src/auth.tsx +176 -0
  42. package/src/blocks.tsx +144 -0
  43. package/src/boot.tsx +188 -0
  44. package/src/dev-warnings.ts +43 -0
  45. package/src/devtools/block.tsx +488 -0
  46. package/src/devtools/gestures.ts +107 -0
  47. package/src/devtools/index.ts +22 -0
  48. package/src/devtools/info.ts +45 -0
  49. package/src/devtools/slots.ts +21 -0
  50. package/src/errors.tsx +195 -0
  51. package/src/held-link.ts +90 -0
  52. package/src/hydration-gate.ts +88 -0
  53. package/src/index.ts +83 -0
  54. package/src/links.ts +140 -0
  55. package/src/nativewind.d.ts +41 -0
  56. package/src/observability/block.tsx +300 -0
  57. package/src/observability/events.ts +89 -0
  58. package/src/observability/index.ts +44 -0
  59. package/src/observability/scrub.ts +166 -0
  60. package/src/observability/sentry.ts +222 -0
  61. package/src/observability/sink.ts +147 -0
  62. package/src/persist.ts +83 -0
  63. package/src/push/backend.ts +129 -0
  64. package/src/push/block.tsx +545 -0
  65. package/src/push/index.ts +102 -0
  66. package/src/push/modules.ts +111 -0
  67. package/src/push/permission.ts +191 -0
  68. package/src/push/preferences.ts +136 -0
  69. package/src/push/quiet-hours.ts +71 -0
  70. package/src/push/registration.ts +189 -0
  71. package/src/push/routing.ts +27 -0
  72. package/src/push/screens.tsx +46 -0
  73. package/src/push/settings.tsx +378 -0
  74. package/src/query.ts +100 -0
  75. package/src/updates/block.tsx +442 -0
  76. package/src/updates/channels.ts +131 -0
  77. package/src/updates/checker.ts +190 -0
  78. package/src/updates/index.ts +87 -0
  79. package/src/updates/modules.ts +64 -0
  80. package/src/updates/policy.ts +314 -0
  81. package/src/updates/screens.tsx +159 -0
  82. package/src/updates/signature.ts +80 -0
  83. package/src/updates/store.ts +33 -0
  84. package/src/updates/version.ts +39 -0
  85. package/src/updates/whats-new.ts +122 -0
  86. package/dist/block-Dh5ny06W.d.ts +0 -535
  87. package/dist/chunk-MMTPWUWI.js.map +0 -1
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@marktiderman/genesis-native",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
- "description": "The native app shell for Genesis Expo apps: one GenesisNativeApp root that runs boot steps behind the splash, catches errors into a fatal screen with retry, persists the query cache, gates on the Supabase session and normalizes deep links. An optional updates block (/updates) adds force upgrade, maintenance, an update banner and what's new. Every part is a slot and is also exported on its own. Part of the Genesis framework.",
7
+ "description": "The native app shell for Genesis Expo apps: one GenesisNativeApp root that runs boot steps behind the splash, catches errors into a fatal screen with retry, persists the query cache, gates on the Supabase session and normalizes deep links. An optional updates block (/updates) adds force upgrade, maintenance, an update banner and what's new; an optional push block (/push) adds push registration, tap routing, the badge and a notification settings screen with quiet hours and private previews; the observability block (/observability) reports errors, breadcrumbs, typed analytics events and timings through vendor-neutral sinks (Sentry, EAS Observe, console) with PII scrubbed on the device; the devtools overlay (/devtools) is a debug sheet for development and preview builds. Blocks (defineBlock declarations, through `blocks`) add boot steps, roots, slot fills and Settings rows. Every part is a slot and is also exported on its own. Part of the Genesis framework.",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/marktiderman/genesis.git",
@@ -18,29 +18,57 @@
18
18
  "main": "./dist/index.js",
19
19
  "module": "./dist/index.js",
20
20
  "types": "./dist/index.d.ts",
21
+ "source": "./src/index.ts",
22
+ "react-native": "./src/index.ts",
21
23
  "exports": {
22
24
  "./package.json": "./package.json",
23
25
  ".": {
24
26
  "types": "./dist/index.d.ts",
27
+ "react-native": "./src/index.ts",
25
28
  "import": "./dist/index.js"
26
29
  },
27
30
  "./persist": {
28
31
  "types": "./dist/persist.d.ts",
32
+ "react-native": "./src/persist.ts",
29
33
  "import": "./dist/persist.js"
30
34
  },
31
35
  "./updates": {
32
36
  "types": "./dist/updates.d.ts",
37
+ "react-native": "./src/updates/index.ts",
33
38
  "import": "./dist/updates.js"
39
+ },
40
+ "./push": {
41
+ "types": "./dist/push.d.ts",
42
+ "react-native": "./src/push/index.ts",
43
+ "import": "./dist/push.js"
44
+ },
45
+ "./observability": {
46
+ "types": "./dist/observability.d.ts",
47
+ "react-native": "./src/observability/index.ts",
48
+ "import": "./dist/observability.js"
49
+ },
50
+ "./devtools": {
51
+ "types": "./dist/devtools.d.ts",
52
+ "react-native": "./src/devtools/index.ts",
53
+ "import": "./dist/devtools.js"
54
+ },
55
+ "./dev-warnings": {
56
+ "types": "./dist/dev-warnings.d.ts",
57
+ "react-native": "./src/dev-warnings.ts",
58
+ "import": "./dist/dev-warnings.js"
34
59
  }
35
60
  },
36
61
  "files": [
37
62
  "dist",
63
+ "src",
64
+ "!src/**/__tests__",
38
65
  "README.md"
39
66
  ],
40
67
  "dependencies": {
41
68
  "@marktiderman/genesis-core": "^1.7.0",
42
- "@marktiderman/genesis-design-system": "^1.4.0",
43
- "@marktiderman/genesis-ui-native": "^2.1.0"
69
+ "@marktiderman/genesis-design-system": "^1.5.0",
70
+ "@marktiderman/genesis-features": "^0.3.0",
71
+ "@marktiderman/genesis-ui-native": "^2.3.0"
44
72
  },
45
73
  "peerDependencies": {
46
74
  "@tanstack/query-async-storage-persister": "^5.0.0",
@@ -51,6 +79,9 @@
51
79
  "react-native-safe-area-context": ">=4.0.0"
52
80
  },
53
81
  "peerDependenciesMeta": {
82
+ "@sentry/react-native": {
83
+ "optional": true
84
+ },
54
85
  "@tanstack/query-async-storage-persister": {
55
86
  "optional": true
56
87
  },
@@ -60,8 +91,17 @@
60
91
  "expo-application": {
61
92
  "optional": true
62
93
  },
94
+ "expo-observe": {
95
+ "optional": true
96
+ },
97
+ "expo-sensors": {
98
+ "optional": true
99
+ },
63
100
  "expo-updates": {
64
101
  "optional": true
102
+ },
103
+ "expo-notifications": {
104
+ "optional": true
65
105
  }
66
106
  },
67
107
  "devDependencies": {
@@ -75,9 +115,186 @@
75
115
  "react": "^19.2.5",
76
116
  "react-dom": "^19.2.5",
77
117
  "tsup": "^8.3.0",
78
- "typescript": "^5.9.3",
118
+ "typescript": "~6.0.3",
79
119
  "vitest": "^4.1.12"
80
120
  },
121
+ "genesis": {
122
+ "blocks": {
123
+ "push": {
124
+ "feature": {
125
+ "name": "Push and notification preferences",
126
+ "summary": "Registers this device's push token for whoever signs in, routes taps, and edits per-category preferences, quiet hours and previews.",
127
+ "keywords": [
128
+ "notifications",
129
+ "push token",
130
+ "quiet hours"
131
+ ],
132
+ "audience": [
133
+ "person"
134
+ ]
135
+ },
136
+ "platforms": [
137
+ "native"
138
+ ],
139
+ "packages": [
140
+ "@marktiderman/genesis-native",
141
+ "@marktiderman/genesis-supabase"
142
+ ],
143
+ "migrations": [
144
+ {
145
+ "package": "@marktiderman/genesis-supabase",
146
+ "file": "migrations/0005_genesis_push.sql",
147
+ "test": "migrations/tests/0005_genesis_push.test.sql"
148
+ }
149
+ ],
150
+ "functions": [
151
+ {
152
+ "package": "@marktiderman/genesis-supabase",
153
+ "dir": "functions/genesis-push-send",
154
+ "verifyJwt": false,
155
+ "secrets": [
156
+ "GENESIS_PUSH_SECRET",
157
+ "EXPO_ACCESS_TOKEN"
158
+ ]
159
+ }
160
+ ],
161
+ "routes": [
162
+ {
163
+ "path": "/settings/notifications",
164
+ "description": "Notification settings: categories, quiet hours, previews",
165
+ "signedIn": true
166
+ }
167
+ ],
168
+ "steps": [
169
+ "npx expo install expo-notifications, and add \"expo-notifications\" to the plugins in app.config.",
170
+ "Create the block with createPush (@marktiderman/genesis-native/push) and pass it to <GenesisNativeApp blocks>; render NotificationSettings on the /settings/notifications screen (genesis-native README, Push).",
171
+ "A push token needs an EAS project id (eas init)."
172
+ ],
173
+ "privacy": {
174
+ "collects": [
175
+ {
176
+ "type": "device ID",
177
+ "purposes": [
178
+ "app functionality"
179
+ ],
180
+ "linked": true,
181
+ "tracking": false
182
+ }
183
+ ]
184
+ }
185
+ },
186
+ "app-updates": {
187
+ "feature": {
188
+ "name": "App updates",
189
+ "summary": "Force upgrade, a maintenance screen, an update banner and a what's new sheet, from the app_release_policy row.",
190
+ "keywords": [
191
+ "force upgrade",
192
+ "maintenance",
193
+ "ota"
194
+ ],
195
+ "audience": [
196
+ "person"
197
+ ]
198
+ },
199
+ "platforms": [
200
+ "native"
201
+ ],
202
+ "packages": [
203
+ "@marktiderman/genesis-native",
204
+ "@marktiderman/genesis-supabase"
205
+ ],
206
+ "migrations": [
207
+ {
208
+ "package": "@marktiderman/genesis-supabase",
209
+ "file": "migrations/0002_genesis_app_release_policy.sql",
210
+ "test": "migrations/tests/0002_genesis_app_release_policy.test.sql"
211
+ }
212
+ ],
213
+ "steps": [
214
+ "npx expo install expo-updates expo-application.",
215
+ "Create the block with createUpdates (@marktiderman/genesis-native/updates) and pass it to <GenesisNativeApp updates> (genesis-native README, Updates)."
216
+ ]
217
+ },
218
+ "observability": {
219
+ "feature": {
220
+ "name": "Observability",
221
+ "summary": "Crash reports, breadcrumbs, timings and typed analytics events, scrubbed on the device, through vendor-neutral sinks (Sentry included).",
222
+ "keywords": [
223
+ "crash reporting",
224
+ "sentry",
225
+ "analytics",
226
+ "breadcrumbs"
227
+ ],
228
+ "audience": [
229
+ "developer"
230
+ ]
231
+ },
232
+ "platforms": [
233
+ "native"
234
+ ],
235
+ "steps": [
236
+ "npx expo install @sentry/react-native if you report to Sentry, and set the DSN in your environment (genesis-native README, Observability).",
237
+ "Create the block with createObservability (@marktiderman/genesis-native/observability) at module scope, pass it to <GenesisNativeApp blocks>, and export observability.wrap(RootLayout)."
238
+ ],
239
+ "privacy": {
240
+ "collects": [
241
+ {
242
+ "type": "crash data",
243
+ "purposes": [
244
+ "app functionality"
245
+ ],
246
+ "linked": true,
247
+ "tracking": false
248
+ },
249
+ {
250
+ "type": "performance data",
251
+ "purposes": [
252
+ "app functionality"
253
+ ],
254
+ "linked": true,
255
+ "tracking": false
256
+ },
257
+ {
258
+ "type": "other diagnostic data",
259
+ "purposes": [
260
+ "app functionality"
261
+ ],
262
+ "linked": true,
263
+ "tracking": false
264
+ },
265
+ {
266
+ "type": "user id",
267
+ "purposes": [
268
+ "app functionality"
269
+ ],
270
+ "linked": true,
271
+ "tracking": false
272
+ }
273
+ ]
274
+ }
275
+ },
276
+ "devtools-overlay": {
277
+ "feature": {
278
+ "name": "Devtools overlay",
279
+ "summary": "An on-device overlay for development, preview and internal builds: what the app knows about itself, recent activity, a crash test.",
280
+ "keywords": [
281
+ "debug menu",
282
+ "devtools",
283
+ "shake to debug"
284
+ ],
285
+ "audience": [
286
+ "developer"
287
+ ]
288
+ },
289
+ "platforms": [
290
+ "native"
291
+ ],
292
+ "steps": [
293
+ "Create the block with createDevtools (@marktiderman/genesis-native/devtools), enabled only outside production builds, and pass it to <GenesisNativeApp blocks> (genesis-native README)."
294
+ ]
295
+ }
296
+ }
297
+ },
81
298
  "scripts": {
82
299
  "build": "tsup && node ../../scripts/check-exports-resolve.mjs",
83
300
  "clean": "rm -rf dist",