Skip to content

Template enhancements: CI, stricter checks, typed i18n/routes, settings tab - #12

Merged
nhonn merged 18 commits into
masterfrom
claude/elegant-albattani-p0jzbl
Nov 30, 2026
Merged

nhonn merged 18 commits into
masterfrom
claude/elegant-albattani-p0jzbl

Conversation

@nhonn

@nhonn nhonn commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Template improvements from a review: CI, stricter checks, typed i18n and routes, a settings tab, and fixes to startup, Sentry, storage and state tracking.

Tooling

  • CI: GitHub Actions runs the locale check, lint and typecheck on PRs and on pushes to master.
  • Lint: oxlint rejects any and runs the suspicious and perf categories. Rules that only flag the new JSX transform, StatusBar's string style or WatermelonDB's _getRaw are off.
  • tsconfig: drops flags strict already sets and enables noUncheckedIndexedAccess, noFallthroughCasesInSwitch and noImplicitOverride.
  • Typed routes: enabled. bun run typegen (expo customize tsconfig.json) writes the route types without starting Metro. typecheck runs it first, so CI and the pre-commit hook check hrefs too.
  • Typed i18n: CustomTypeOptions comes from the English resources, so a misspelled t() key is a compile error.

Runtime

  • Startup: the splash screen waits only for i18n. RevenueCat starts in the background and its listener sets premium.
  • Sentry: events are tagged with the build variant as environment. Traces are sampled per variant (all of preview, 20% of production). expoRouterIntegration names navigation spans after routes, and logger warnings and errors become breadcrumbs. release stays at the native default so uploaded source maps keep matching.
  • Env: src/utils/env.ts holds the runtime config. .env.example lists SENTRY_AUTH_TOKEN.
  • Settings store: selectors track only the fields they read; before, every selector re-ran on any change.
  • Storage: exports the MMKV instance instead of a wrapper that duplicated its API and swallowed errors.
  • Data: a useQuery hook waits for databaseReady, subscribes and cleans up. Clauses are compared by value. useNotes uses it.
  • RevenueCat: the limit paywall has its own feature_limit placement. Paywall results say whether the user cancelled.

UI

  • A settings tab (new gear glyph in the ui icon font) built from @expo/ui FieldGroup rows. It covers theme (match system, dark mode), language, text size, date format, upgrade and restore purchases, and the app version.
  • The error boundary uses the shared gesture-handler Pressable.

Fixes found along the way

  • log/debug/info/warn/error exported from @/utils/logger lost this and threw when called.
  • The layouts' contentContainerStyle stopped type-checking once expo-env.d.ts loads expo/types.

Testing

  • From a clean install: bun install --frozen-lockfile, bun run verify:locales, bun run lint and bun run typecheck all pass.
  • Checked that a bad route and a bad translation key each fail typecheck.
  • Script checks of the Legend State field tracking and the logger sink.
  • Rendered the regenerated icon font to confirm the gear glyph.
  • Not run on a device. Please check the settings tab and startup in a development build.

Follow-ups

  • Create a feature_limit placement in the RevenueCat dashboard. Until then the limit paywall falls back to the current offering.
  • Text size only affects useResponsiveTypography, which no screen uses yet.

Generated by Claude Code

The props used React Native's ViewProps style, which stops type-checking
against @tamagui/tailwind's View once expo/types (web CSS) is loaded by
expo-env.d.ts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRYTsbYhbXbbVqgg3dnYn
typegen runs expo customize tsconfig.json, which writes .expo/types
without starting Metro, so CI and the pre-commit hook check hrefs too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRYTsbYhbXbbVqgg3dnYn
Turns on oxlint's suspicious and perf categories and makes
no-explicit-any an error, matching AGENTS.md. Rules that only flag the
new JSX transform, StatusBar's string style or WatermelonDB's _getRaw
are off; tabBarIcon render props are allowed.

Fixes what the new rules found: styledNative no longer takes any,
layouts share a stable default safe-area edge list, the locale script
uses toSorted, and system theme tracking is one effect driven by
useColorScheme instead of a duplicate Appearance listener.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRYTsbYhbXbbVqgg3dnYn
strict already sets the flags that were listed one by one. Adds
noUncheckedIndexedAccess, noFallthroughCasesInSwitch and
noImplicitOverride, and fixes the index reads and overrides they flag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRYTsbYhbXbbVqgg3dnYn
Augments i18next's CustomTypeOptions with the en resources, so t() keys
and namespaces are checked at compile time. Date utilities take keys of
the date namespace instead of any string.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRYTsbYhbXbbVqgg3dnYn
RevenueCat and Sentry read their keys from src/utils/env.ts, which also
exposes the build variant and app version. .env.example documents
SENTRY_AUTH_TOKEN for source map uploads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRYTsbYhbXbbVqgg3dnYn
initializeRevenueCat waits for a customer-info request, which kept the
splash up on slow networks. It now runs in the background and the
customer-info listener sets premium when the answer arrives; only i18n
gates the first render.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRYTsbYhbXbbVqgg3dnYn
Both placements pointed at "settings", so the limit paywall could never
show a different offering. Also reads error messages without a cast.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRYTsbYhbXbbVqgg3dnYn
The wrapper duplicated MMKV's API under two names each (getItem and
getString, remove and removeItem) and swallowed every error. Callers
now use MMKV directly; the JSON helpers take a StorageKey and log
unparsable values.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRYTsbYhbXbbVqgg3dnYn
The hook spread settings$.get() before running the selector, so every
selector subscribed to the whole store and re-ran on any change.
Selectors now read through per-field getters; calling the hook without
a selector still tracks everything.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRYTsbYhbXbbVqgg3dnYn
Waits for databaseReady, subscribes to the query and cleans up on
unmount, so screens don't repeat that wiring. Clauses are compared by
value, so inline Q calls don't resubscribe every render. useNotes now
uses it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRYTsbYhbXbbVqgg3dnYn
Destructuring the methods off the instance lost `this`, so calling the
exported warn() or error() threw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRYTsbYhbXbbVqgg3dnYn
…rumbs

- environment comes from the build variant
- performance traces are sampled per variant (all of preview, 20% of
  production, none in development)
- expoRouterIntegration names navigation spans after routes
- logger warnings and errors become breadcrumbs through the log sink
  added to @/utils/logger in the previous commit, so reports carry
  context even though release builds keep the console quiet

release is left to the native default so source maps uploaded by the
Expo plugin keep matching.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRYTsbYhbXbbVqgg3dnYn
Uses @expo/ui FieldGroup rows for theme (match system, dark mode),
language, text size and date format, the RevenueCat upgrade and
restore actions, and the app version. Paywall results now report
whether the user cancelled, so the screen only shows a toast for real
failures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRYTsbYhbXbbVqgg3dnYn
@nhonn
nhonn merged commit f365a98 into master Nov 30, 2026
1 check passed
@nhonn
nhonn deleted the claude/elegant-albattani-p0jzbl branch November 30, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants