Skip to content

chore(guards): migrate remaining expo files to @packrat/guards#2050

Merged
andrew-bierman merged 1 commit into
developmentfrom
chore/guards-migration-followup
Apr 11, 2026
Merged

chore(guards): migrate remaining expo files to @packrat/guards#2050
andrew-bierman merged 1 commit into
developmentfrom
chore/guards-migration-followup

Conversation

@andrew-bierman
Copy link
Copy Markdown
Collaborator

Summary

Finishes the @packrat/guards migration started in #2039 by touching the expo files that were intentionally left out of scope:

  • apps/expo/lib/utils/itemCalculations.tsisWeightUnit now uses makeEnumGuard from @packrat/guards, and is exported so other call sites can reuse it
  • apps/expo/features/packs/components/PackCard.tsxisArray now comes from @packrat/guards
  • apps/expo/features/pack-templates/components/PackTemplateCard.tsx — same
  • apps/expo/features/pack-templates/hooks/useGenerateTemplateFromOnlineContent.ts — drops its duplicate inline isWeightUnit and imports the canonical one from itemCalculations

No behavior change. Pure canonicalization.

Test plan

  • bun run check-types clean (no new errors in touched files)
  • bun lint clean (no new diagnostics in touched files)
  • CI passes

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
Copilot AI review requested due to automatic review settings April 11, 2026 05:48
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 11, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f61f9fcd-8608-48fc-9eb4-409c47c386e3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/guards-migration-followup

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report for API Unit Tests Coverage (./packages/api)

Status Category Percentage Covered / Total
🔵 Lines 96.57% 902 / 934
🔵 Statements 96.57% (🎯 80%) 902 / 934
🔵 Functions 100% 48 / 48
🔵 Branches 90.03% 280 / 311
File CoverageNo changed files found.
Generated in workflow #65 for commit 74f6220 by the Vitest Coverage Report Action

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 isWeightUnit from apps/expo/lib/utils/itemCalculations.ts using makeEnumGuard.
  • Replaced radash’s isArray usage with @packrat/guards in affected components.
  • Removed a duplicate inline isWeightUnit in 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.

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report for Expo Unit Tests Coverage (./apps/expo)

Status Category Percentage Covered / Total
🔵 Lines 75.92% 495 / 652
🔵 Statements 75.92% (🎯 75%) 495 / 652
🔵 Functions 92.59% 50 / 54
🔵 Branches 91.78% 190 / 207
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/expo/lib/utils/itemCalculations.ts 100% 100% 100% 100%
Generated in workflow #65 for commit 74f6220 by the Vitest Coverage Report Action

@andrew-bierman andrew-bierman merged commit 6b89909 into development Apr 11, 2026
10 of 12 checks passed
@andrew-bierman andrew-bierman deleted the chore/guards-migration-followup branch April 11, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants