feat(app): scaffold @packrat/app shared package with FSD organization#2375
feat(app): scaffold @packrat/app shared package with FSD organization#2375andrew-bierman wants to merge 9 commits into
Conversation
Adds packages/domain with package.json, tsconfig, and barrel index files for packs, catalog, trips, and pack-templates sub-packages. Registers @packrat/domain/* paths in the root tsconfig.
- Fix imports in moved domain files to use @packrat/api/types instead of expo-app/* aliases - Add thin re-export stubs in expo features so all existing imports are unaffected (zero churn to callers) - Add @packrat/domain workspace dependency to expo package.json
Renames packages/domain → packages/app and updates all references. The shared package will hold full FSD feature slices (types, hooks, utils, and .web.tsx UI variants) — not just domain logic — so 'app' is the more accurate name. Expo and web apps become thin routing shells on top of packages/app.
Moves 7 feature type files (ai-packs, ai, feed, guides, profile, trail-conditions, wildlife) to packages/app/src with index barrels and sub-path exports. Adds re-export stubs in expo so existing imports are unaffected. Adds `ai` catalog dep to packages/app. Skipped: weather/types.ts (refs MaterialIconName from expo-app), auth atoms/store (kvStorage — needs injection pattern PR).
Move all cleanly extractable code from apps/expo/features to packages/app
following FSD organization. Callers import directly via @packrat/app/{feature}
sub-path exports — no re-export stubs.
Moved:
- packs, catalog, trips, pack-templates, ai, ai-packs, feed, guides,
profile, trail-conditions, wildlife — types, utils, lib, data files
packages/app gets self-referential tsconfig paths so internal files
can import siblings via @packrat/app/packs instead of deep ../.. traversal.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report for Expo Unit Tests Coverage (./apps/expo)
File CoverageNo changed files found. |
Coverage Report for API Unit Tests Coverage (./packages/api)
File CoverageNo changed files found. |
…ms, components, screens)
Completes the mass migration of apps/expo/features/ to packages/app/src/.
Every feature slice now lives in the shared package — expo becomes a thin
routing shell.
Moved:
- hooks, stores, atoms (all features)
- components, screens (all features)
- lib dirs (ai, catalog, weather)
- offline-ai feature (new slice)
- weather feature (new slice with types, atoms, hooks, components, screens)
Import strategy:
- Deep paths for cross-feature hook/component imports (@packrat/app/{feature}/hooks/X)
- Type barrel (@packrat/app/{feature}) for type-only imports
- expo-app/* internal refs are transitional (lib/, components/ not yet moved)
packages/app tsconfig updated to allow deep path resolution.
Relocates all remaining non-routing directories from apps/expo/ to packages/app/src/ via git mv (atoms, components, lib, screens, types, utils, providers, theme, data) and rewrites all expo-app/* imports in both packages/app/src/ and apps/expo/app/ routing files to use the @packrat/app/* path alias. The expo routing shell retains only expo-app/app/_layout and expo-app/config cross-references which legitimately remain in apps/expo. Also updates biome.json overrides to point to new file paths and nativewindui tsconfig alias.
…mport paths - Fix all expo routing files: expo-app/config → @packrat/app/config - Fix settings screen: expo-app/app/_layout appAlert → @packrat/app/lib/appAlert - Fix auth screens: expo-app/assets → @packrat/app/assets requires - Add packages/app/src/lib/appAlert.ts with registerAppAlert() pattern - Move apps/expo/config.ts → packages/app/src/config.ts (git rename) - Move assets/packrat-app-icon-gradient.png and adaptive-icon.png to packages/app/src/assets/ - Fix biome formatting on all changed files Zero type errors, zero remaining expo-app/ imports outside comments. apps/expo is now a thin routing shell with only routing files and base config.
|
Unblocked by #2423 ( Three review focuses when this comes out of draft:
Ready to do a deeper structural review once you flip from draft. |
Summary
packages/appworkspace package (@packrat/app) intended to be the shared layer for both the Expo app and future web appapps/expo/features/intopackages/app/src/following Feature-Sliced Design organization@packrat/appWhat moved
All feature types, pure utils, and lib files were
git mv'd (tracked as renames) fromapps/expo/features/{feature}/intopackages/app/src/{feature}/:packstypes.ts,input.ts,utils/convertToGrams,utils/convertFromGrams,utils/computePackWeightscatalogtypes.ts,lib/normalizeDescriptiontripstypes.tspack-templatestypes.ts,utils/computePacktemplateWeightaitypes.ts,lib/constantsai-packstypes.tsfeedtypes.tsguidestypes.tsprofiletypes.tstrail-conditionstypes.tswildlifetypes.ts,data/speciesDatabase,lib/offlineIdentifierPackage design
@packrat/app/packs,@packrat/app/catalog, etc. — no single barrel, FSD-style import pathspackages/appcan import siblings via@packrat/app/packsinstead of deep../../traversal@packrat/app/{feature}— clean break, no compatibility shimsbun check-typesclean)Left for follow-up PRs
kvStorage— needs persistence injection pattern).web.tsxUI components (next major phase — expo/web thin shells)Post-Deploy Monitoring & Validation
No additional operational monitoring required: purely a refactor moving code between packages with no runtime behavior changes.