Release/2.0.22#2263
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Bun reads bunfig.toml at startup, so env vars set inside the preinstall hook never reach the parent install process. The previous docs and configure-deps script implied the hook handled auth automatically, which caused silent 401s on `@packrat-ai/nativewindui`. - CLAUDE.md: rewrite Private Package Auth with accurate export patterns and troubleshooting for the "token set?" check. - configure-deps.ts: stop pretending to inject the var into the parent process; detect a missing token and print the exact fix command.
Bun auto-loads .env.local before `bun install`, so the token can live alongside other secrets. Demoted the shell-export approach to an alternative path.
Main -> Development
fix(expo): consistent fixed search bar in tab screens
…yout fix(expo): #2256 broken search UI layout
Coverage Report for Expo Unit Tests Coverage (./apps/expo)
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Coverage Report for API Unit Tests Coverage (./packages/api)
File CoverageNo changed files found. |
📝 WalkthroughWalkthroughThis PR refactors GitHub package token verification to validate token availability before bun reads bunfig.toml, introduces a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
apps/expo/features/trips/components/TripForm.tsx (1)
36-138:⚠️ Potential issue | 🔴 CriticalCritical: schema change breaks the TypeScript build — normalize
packIdbefore submit.Broadening the schema to
z.string().nullable().optional()makesTripFormValues['packId']widen tostring | null | undefined, but bothupdateTrip({ ...trip, ...submitData })(line 118) andcreateTrip(submitData)(line 124) expectTrip/TripInputwherepackIdisstring | undefined. This is exactly what the pipeline is failing on (TS2345), and at runtimenullwill also be persisted to the store/DB even though consumers only expectundefined.Normalize
packIdat submit time sonullis coerced toundefined:🐛 Proposed fix
onSubmit: async ({ value }) => { - const submitData = { ...value, location: location ?? value.location }; + const submitData = { + ...value, + location: location ?? value.location, + packId: value.packId ?? undefined, + }; try {Alternatively, if nullable
packIdis intentional downstream (e.g. to distinguish "explicitly cleared" from "never set"), updateTrip/TripInputinapps/expo/features/trips/types.tstopackId?: Pack['id'] | nulland adjust the store/mutation paths — but that's a broader change than this PR's scope.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/expo/features/trips/components/TripForm.tsx` around lines 36 - 138, The tripFormSchema change allows packId to be string | null | undefined which breaks typing for createTrip/updateTrip and can persist null; in TripForm's onSubmit (where submitData is built) normalize packId by converting any null value to undefined (e.g. set submitData.packId = submitData.packId ?? undefined) before calling updateTrip/createTrip so the payload matches expected Trip/TripInput types; update the normalization near the submitData construction in the onSubmit handler of TripForm (references: tripFormSchema, TripFormValues.packId, submitData, onSubmit, createTrip, updateTrip).apps/expo/features/catalog/screens/CatalogItemsScreen.tsx (1)
97-131:⚠️ Potential issue | 🟠 MajorRemove
TabScreenfromListHeaderComponent— it applies incorrect screen-level layout.The
listHeadermemo uses<TabScreen useLegacySafeAreaView>(line 101), butTabScreenis designed as a screen-level wrapper that appliesflex: 1, safe-area padding, and tab-bar offset. Using it inside aFlatList'sListHeaderComponentis architecturally incorrect:
flex: 1will make the header expand to fill available space, breaking the header layout- Safe-area insets (
paddingTopon iOS) apply only to the header, not to list rows- Tab-bar offset is misplaced in a header context
Unwrap the header content from
TabScreenand apply only necessary styling (e.g.,classNameprops for padding/spacing). TheFlatListbody should remain unstyled or use a fragment to extend edge-to-edge as intended.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/expo/features/catalog/screens/CatalogItemsScreen.tsx` around lines 97 - 131, The listHeader memo currently wraps header content in the screen-level component TabScreen (used in the listHeader constant inside CatalogItemsScreen), which causes inappropriate layout (flex:1, safe-area and tab offsets); remove the TabScreen wrapper and return the header content directly (keep CategoriesFilter, the surrounding Views, Texts and their className props), ensuring listHeader remains a fragment or plain View-based structure and leaving FlatList/parent screen to handle screen-level safe area and flex styling; update the dependency array and return value of the useMemo-defined listHeader accordingly.
🧹 Nitpick comments (3)
apps/expo/lib/utils/dateUtils.ts (1)
30-33: Fallback relies on implementation-definedDateparsing.
parseLocalDatealready handles ISO 8601 andYYYY-MM-DD. The remaining inputs that reach the fallback are, by definition, strings that aren't ISO — for whichnew Date(dateString)behavior is implementation-defined (per ECMA-262) and can silently accept locale-quirky formats or produce timezone-shifted results. If the goal is to tolerate a specific additional format (e.g.MM/dd/yyyy), consider parsing it explicitly withdate-fnsparserather than delegating to the engine'sDateconstructor.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/expo/lib/utils/dateUtils.ts` around lines 30 - 33, The current fallback uses new Date(dateString) which is implementation-defined; update the logic in the function that calls parseLocalDate (references: parseLocalDate and dateString) to avoid relying on the engine Date parser—either (A) remove the fallback and return '\u2014' when parseLocalDate returns null/undefined, or (B) explicitly parse the additional expected format(s) with date-fns parse (e.g. parse(dateString, 'MM/dd/yyyy', new Date())) before falling back to '\u2014'; implement one of these options and ensure the final branch uses isNaN(date.getTime()) only on a reliably parsed Date..github/scripts/configure-deps.ts (1)
43-67: LGTM — validation-only flow is correct.The refactor correctly reflects that Bun parses
bunfig.tomlbefore the preinstall hook runs, so injecting the env var into the current process would be too late. Detecting + printing the exact fix command is the right call, and CI fast-fail vs. localgh-based guidance is cleanly separated.One small nit: when
gh auth statussucceeds but the token still isn't exported (Lines 55-66),printLocalFix()already covers guidance — consider adding a one-line hint like "gh is authenticated but the token isn't exported to this shell" beforeprintLocalFix()to make the distinction obvious to users who just rangh auth loginand expected it to propagate.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/scripts/configure-deps.ts around lines 43 - 67, Add a one-line hint before calling printLocalFix() in configureDeps() to clarify the situation when gh auth status succeeds but the env token isn't exported: insert a console.error or console.log message like "gh is authenticated but the token isn't exported to this shell" (or similar) immediately after the ghStatus success check and before printLocalFix(), referencing TOKEN_VAR to show users which variable to export; keep the existing early exits (process.exit(1)) and preserve printLocalFix() behavior.CLAUDE.md (1)
108-113: Recommend least-privilege scope.Line 112 notes
write:packages also works— for installing a read-only dependency,read:packagesis sufficient and safer. Consider dropping the "write:packages also works" aside (or rephrasing as "only needed if you also publish") to avoid nudging contributors toward a broader-than-necessary scope.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@CLAUDE.md` around lines 108 - 113, Update the "One-time GitHub CLI setup" block to recommend the least-privilege scope by removing or rephrasing the "write:packages also works" aside; specifically, change the comment after `gh auth refresh -h github.com -s read:packages` to either drop the mention of `write:packages` or replace it with a note like "use write:packages only if you need to publish" so the instructions clearly recommend `read:packages` for installing read-only dependencies.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/expo/components/LargeTitleHeaderSearchContentContainer.tsx`:
- Around line 1-14: Replace the Platform-based SafeAreaView import with the
context-aware SafeAreaView from react-native-safe-area-context and switch
styling to NativeWind classes: update imports used by
LargeTitleHeaderSearchContentContainer (remove SafeAreaView from 'react-native',
import SafeAreaView from 'react-native-safe-area-context'), keep the Platform/
View fallback logic but render SafeAreaView on iOS so it uses the
SafeAreaProvider context (optionally add edges={['bottom']} if top insets are
managed by the header), and replace the inline style that uses useColorScheme()
with className="flex-1 bg-background" on the Container to match project
NativeWind conventions.
In `@apps/expo/features/guides/screens/GuidesListScreen.tsx`:
- Around line 115-128: The listHeader function currently wraps the header in
TabScreen which adds unwanted flex and bottom padding on Android; change it so
listHeader returns only the CategoriesFilter (remove the TabScreen wrapper) and
instead wrap the entire screen's top-level return with TabScreen (using
useLegacySafeAreaView) — i.e., move the TabScreen that currently wraps
CategoriesFilter to enclose the full component return (replacing the outer
Fragment), matching the pattern used in TripListScreen and PackListScreen; keep
props and handlers (data={categories}, onFilter={handleCategoryChange},
activeFilter={selectedCategory}, error={categoriesError},
retry={refetchCategories}, className="px-4 pb-2") on CategoriesFilter and ensure
refetchCategories and handleCategoryChange remain referenced.
---
Outside diff comments:
In `@apps/expo/features/catalog/screens/CatalogItemsScreen.tsx`:
- Around line 97-131: The listHeader memo currently wraps header content in the
screen-level component TabScreen (used in the listHeader constant inside
CatalogItemsScreen), which causes inappropriate layout (flex:1, safe-area and
tab offsets); remove the TabScreen wrapper and return the header content
directly (keep CategoriesFilter, the surrounding Views, Texts and their
className props), ensuring listHeader remains a fragment or plain View-based
structure and leaving FlatList/parent screen to handle screen-level safe area
and flex styling; update the dependency array and return value of the
useMemo-defined listHeader accordingly.
In `@apps/expo/features/trips/components/TripForm.tsx`:
- Around line 36-138: The tripFormSchema change allows packId to be string |
null | undefined which breaks typing for createTrip/updateTrip and can persist
null; in TripForm's onSubmit (where submitData is built) normalize packId by
converting any null value to undefined (e.g. set submitData.packId =
submitData.packId ?? undefined) before calling updateTrip/createTrip so the
payload matches expected Trip/TripInput types; update the normalization near the
submitData construction in the onSubmit handler of TripForm (references:
tripFormSchema, TripFormValues.packId, submitData, onSubmit, createTrip,
updateTrip).
---
Nitpick comments:
In @.github/scripts/configure-deps.ts:
- Around line 43-67: Add a one-line hint before calling printLocalFix() in
configureDeps() to clarify the situation when gh auth status succeeds but the
env token isn't exported: insert a console.error or console.log message like "gh
is authenticated but the token isn't exported to this shell" (or similar)
immediately after the ghStatus success check and before printLocalFix(),
referencing TOKEN_VAR to show users which variable to export; keep the existing
early exits (process.exit(1)) and preserve printLocalFix() behavior.
In `@apps/expo/lib/utils/dateUtils.ts`:
- Around line 30-33: The current fallback uses new Date(dateString) which is
implementation-defined; update the logic in the function that calls
parseLocalDate (references: parseLocalDate and dateString) to avoid relying on
the engine Date parser—either (A) remove the fallback and return '\u2014' when
parseLocalDate returns null/undefined, or (B) explicitly parse the additional
expected format(s) with date-fns parse (e.g. parse(dateString, 'MM/dd/yyyy', new
Date())) before falling back to '\u2014'; implement one of these options and
ensure the final branch uses isNaN(date.getTime()) only on a reliably parsed
Date.
In `@CLAUDE.md`:
- Around line 108-113: Update the "One-time GitHub CLI setup" block to recommend
the least-privilege scope by removing or rephrasing the "write:packages also
works" aside; specifically, change the comment after `gh auth refresh -h
github.com -s read:packages` to either drop the mention of `write:packages` or
replace it with a note like "use write:packages only if you need to publish" so
the instructions clearly recommend `read:packages` for installing read-only
dependencies.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7ad21582-c928-43e7-b51a-53636d16837a
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (29)
.github/scripts/configure-deps.tsCLAUDE.mdapps/admin/package.jsonapps/expo/app.config.tsapps/expo/app/(app)/(tabs)/(home)/index.tsxapps/expo/components/LargeTitleHeaderSearchContentContainer.tsxapps/expo/features/catalog/screens/CatalogItemsScreen.tsxapps/expo/features/guides/screens/GuidesListScreen.tsxapps/expo/features/packs/components/SearchResults.tsxapps/expo/features/packs/screens/PackListScreen.tsxapps/expo/features/trips/components/TripForm.tsxapps/expo/features/trips/screens/TripListScreen.tsxapps/expo/lib/utils/dateUtils.tsapps/expo/package.jsonapps/guides/package.jsonapps/landing/package.jsonpackage.jsonpackages/analytics/package.jsonpackages/api-client/package.jsonpackages/api/container_src/package.jsonpackages/api/package.jsonpackages/checks/package.jsonpackages/cli/package.jsonpackages/config/package.jsonpackages/env/package.jsonpackages/guards/package.jsonpackages/mcp/package.jsonpackages/ui/package.jsonpackages/web-ui/package.json
There was a problem hiding this comment.
Pull request overview
This PR prepares the 2.0.22 release by improving private GitHub Packages authentication guidance/validation, standardizing Expo search overlay containers for LargeTitleHeader screens, and bumping versions across the monorepo.
Changes:
- Bump app/package versions to
2.0.22(plus corresponding lockfile updates). - Refactor Expo search UI to use a shared
LargeTitleHeaderSearchContentContaineracross multiple screens. - Simplify GitHub Packages auth setup: preinstall script now validates token presence and docs clarify recommended
.env.localsetup.
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/web-ui/package.json | Bump package version to 2.0.22. |
| packages/ui/package.json | Bump package version to 2.0.22. |
| packages/mcp/package.json | Bump package version to 2.0.22. |
| packages/guards/package.json | Bump package version to 2.0.22. |
| packages/env/package.json | Bump package version to 2.0.22. |
| packages/config/package.json | Bump package version to 2.0.22. |
| packages/cli/package.json | Bump package version to 2.0.22. |
| packages/checks/package.json | Bump package version to 2.0.22. |
| packages/api/package.json | Bump package version to 2.0.22. |
| packages/api/container_src/package.json | Bump container package version to 2.0.22. |
| packages/api-client/package.json | Bump package version to 2.0.22. |
| packages/analytics/package.json | Bump package version to 2.0.22. |
| package.json | Bump monorepo version to 2.0.22. |
| bun.lock | Update lockfile for bumped versions/dependency resolution. |
| apps/landing/package.json | Bump app version to 2.0.22. |
| apps/guides/package.json | Bump app version to 2.0.22. |
| apps/expo/package.json | Bump app version to 2.0.22. |
| apps/expo/lib/utils/dateUtils.ts | Adjust date formatting behavior with a parsing fallback. |
| apps/expo/features/trips/screens/TripListScreen.tsx | Use shared search content container for LargeTitleHeader search overlay. |
| apps/expo/features/trips/components/TripForm.tsx | Update packId schema typing to allow nullable values. |
| apps/expo/features/packs/screens/PackListScreen.tsx | Use shared search content container for LargeTitleHeader search overlay. |
| apps/expo/features/packs/components/SearchResults.tsx | Simplify search results rendering and add list padding. |
| apps/expo/features/guides/screens/GuidesListScreen.tsx | Refactor header/filter layout to use TabScreen via list header composition. |
| apps/expo/features/catalog/screens/CatalogItemsScreen.tsx | Refactor header/filter/search overlay container usage and search bar ref wiring. |
| apps/expo/components/LargeTitleHeaderSearchContentContainer.tsx | Add reusable container for consistent search overlay background/safe-area handling. |
| apps/expo/app/(app)/(tabs)/(home)/index.tsx | Use shared search content container for dashboard search overlay. |
| apps/expo/app.config.ts | Bump Expo app config version to 2.0.22. |
| apps/admin/package.json | Bump app version to 2.0.22. |
| CLAUDE.md | Update private package auth instructions and troubleshooting guidance. |
| .github/scripts/configure-deps.ts | Refactor preinstall auth script to validate token presence and print remediation steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces several improvements across the codebase, focusing on enhancing the developer experience for private package authentication, standardizing search result containers in the UI, and updating app versions. The main highlights include a more robust and user-friendly authentication flow for GitHub Packages, the introduction of a reusable container for search content, and UI refactors to improve consistency and maintainability.
Private Package Authentication Improvements:
.github/scripts/configure-deps.tsto only verify the presence of thePACKRAT_NATIVEWIND_UI_GITHUB_TOKENenvironment variable, printing clear instructions if missing, and removed logic that attempted to inject the token at runtime.features/{name}/CLAUDE.mddocumentation to recommend storing the token in.env.localfor Bun, clarified troubleshooting steps, and explained why the preinstall hook cannot inject env vars into Bun's process.UI Consistency and Refactors (Search Content Container):
LargeTitleHeaderSearchContentContainercomponent to encapsulate search result content with consistent background and safe area handling, and refactoredDashboardScreen,CatalogItemsScreen, andPackListScreento use it for their search bar content [1] [2] [3] [4] [5] [6] [7] [8] [9] [10].UI Refactors and Bug Fixes:
GuidesListScreenandCatalogItemsScreento useTabScreenfor header and filter layout, improving safe area handling and code clarity [1] [2] [3] [4] [5] [6] [7].SearchResultsin packs to only render when there are results, and added padding to the results list [1] [2].Version Updates:
apps/admin/package.jsonandapps/expo/app.config.tsto2.0.22[1] [2].Miscellaneous:
Let me know if you want to walk through any of these changes in detail!
Summary by CodeRabbit
Release 2.0.22
New Features
Bug Fixes
Improvements