chore(guards): migrate remaining expo files to @packrat/guards#2050
Conversation
Finishes the migration started in #2039: - apps/expo/lib/utils/itemCalculations.ts: replace the inline isWeightUnit guard with makeEnumGuard from @packrat/guards and export it so other call sites can reuse it - apps/expo/features/packs/components/PackCard.tsx: import isArray from @packrat/guards instead of radash directly - apps/expo/features/pack-templates/components/PackTemplateCard.tsx: same - apps/expo/features/pack-templates/hooks/useGenerateTemplateFromOnlineContent.ts: use the canonical isWeightUnit from itemCalculations instead of re-declaring an inline copy
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL 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 API Unit Tests Coverage (./packages/api)
File CoverageNo changed files found. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Completes the Expo-side migration to @packrat/guards by replacing remaining local/third-party guard helpers with canonical guards, and centralizing isWeightUnit for reuse.
Changes:
- Exported a canonical
isWeightUnitfromapps/expo/lib/utils/itemCalculations.tsusingmakeEnumGuard. - Replaced
radash’sisArrayusage with@packrat/guardsin affected components. - Removed a duplicate inline
isWeightUnitin the template generation hook and imported the canonical one instead.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/expo/lib/utils/itemCalculations.ts | Introduces exported isWeightUnit via makeEnumGuard and removes the inline implementation. |
| apps/expo/features/packs/components/PackCard.tsx | Switches isArray import from radash to @packrat/guards. |
| apps/expo/features/pack-templates/components/PackTemplateCard.tsx | Switches isArray import from radash to @packrat/guards. |
| apps/expo/features/pack-templates/hooks/useGenerateTemplateFromOnlineContent.ts | Removes duplicated isWeightUnit logic and imports the canonical guard from itemCalculations. |
Coverage Report for Expo Unit Tests Coverage (./apps/expo)
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Summary
Finishes the
@packrat/guardsmigration started in #2039 by touching the expo files that were intentionally left out of scope:apps/expo/lib/utils/itemCalculations.ts—isWeightUnitnow usesmakeEnumGuardfrom@packrat/guards, and is exported so other call sites can reuse itapps/expo/features/packs/components/PackCard.tsx—isArraynow comes from@packrat/guardsapps/expo/features/pack-templates/components/PackTemplateCard.tsx— sameapps/expo/features/pack-templates/hooks/useGenerateTemplateFromOnlineContent.ts— drops its duplicate inlineisWeightUnitand imports the canonical one fromitemCalculationsNo behavior change. Pure canonicalization.
Test plan
bun run check-typesclean (no new errors in touched files)bun lintclean (no new diagnostics in touched files)