Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ jobs:
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
cache: true

- name: Install dependencies
env:
PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }}
run: bun install
run: bun install --frozen-lockfile

- name: Run API tests
run: bun run --cwd packages/api test 2>&1 | tee /tmp/api-tests-output.log
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ jobs:
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
cache: true
- name: Install dependencies
env:
PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }}
run: bun install
run: bun install --frozen-lockfile
- name: Run Biome (check mode)
if: ${{ !(github.event_name == 'workflow_dispatch' && inputs.fix == true) }}
run: bun biome check
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ jobs:
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ steps.bun-version.outputs.version }}
cache: true

# Sanity-check that the runner satisfies the repo's engine constraints.
- name: Verify runtime versions
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Install dependencies
env:
PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }}
run: bun install
run: bun install --frozen-lockfile

- name: Setup Expo
uses: expo/expo-github-action@v8
Expand Down Expand Up @@ -343,7 +343,7 @@ jobs:
- name: Install dependencies
env:
PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }}
run: bun install
run: bun install --frozen-lockfile

- name: Setup Expo
uses: expo/expo-github-action@v8
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
cache: true

- name: Install dependencies
env:
Expand Down Expand Up @@ -60,7 +59,6 @@ jobs:
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
cache: true

- name: Install dependencies
env:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@ jobs:
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
cache: true

- name: Install dependencies
env:
PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }}
run: bun install
run: bun install --frozen-lockfile

- name: Determine target environment
id: env
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.10
cache: true

- name: Validate release tag and app versions
run: bun .github/scripts/validate-release-version.ts "${{ steps.release_tag.outputs.tag }}"
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/sync-guides-r2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ jobs:
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
cache: true

- name: Authenticate with GitHub for private packages
run: |
echo "PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV

- name: Install dependencies
run: bun install
run: bun install --frozen-lockfile
timeout-minutes: 5

- name: Sync guides to R2 bucket
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ jobs:
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
cache: true

- name: Install dependencies
env:
PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }}
run: bun install
run: bun install --frozen-lockfile

- name: Run API unit tests
run: bun run --cwd packages/api test:unit:coverage
Expand All @@ -80,12 +79,11 @@ jobs:
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
cache: true

- name: Install dependencies
env:
PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }}
run: bun install
run: bun install --frozen-lockfile

- name: Run Expo unit tests
run: bun run --cwd apps/expo test:coverage
Expand Down
22 changes: 12 additions & 10 deletions apps/admin/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export interface AdminPack {
description: string | null;
category: string;
isPublic: boolean | null;
isAIGenerated: boolean;
isAIGenerated: boolean | null;
tags: string[] | null;
image: string | null;
createdAt: string | null;
Expand Down Expand Up @@ -176,23 +176,15 @@ export interface AdminCatalogItem {
categories: string[] | null;
brand: string | null;
model: string | null;
sku: string | null;
price: number | null;
currency: string | null;
weight: number | null;
weight: number;
weightUnit: string;
availability: string | null;
ratingValue: number | null;
reviewCount: number | null;
color: string | null;
size: string | null;
material: string | null;
seller: string | null;
productUrl: string | null;
images: string[] | null;
variants: Array<{ attribute: string; values: string[] }> | null;
techs: Record<string, string> | null;
links: Array<{ title: string; url: string }> | null;
createdAt: string | null;
}

Expand Down Expand Up @@ -377,6 +369,16 @@ export async function deleteTrailCondition(reportId: string): Promise<{ success:
return unwrap(data, 'deleteTrailCondition');
}

async function adminFetch<T>(path: string, init?: RequestInit): Promise<T> {
const res = await adminFetcher(`${API_BASE}/api/admin${path}`, init);
if (!res.ok) {
const body = (await res.json().catch(() => ({}))) as { error?: string };
throw new Error(body.error ?? `Admin API error: ${res.status}`);
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return res.json();
}

export function resetStuckEtlJobs(): Promise<{ reset: number; ids: string[] }> {
return adminFetch('/analytics/catalog/etl/reset-stuck', { method: 'POST' });
}
Expand Down
7 changes: 7 additions & 0 deletions apps/admin/lib/queryKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ export const queryKeys = {
breakdown: () => [...queryKeys.platform.all(), 'breakdown'] as const,
},

osm: {
all: () => ['osm'] as const,
search: (q: string, sport?: string) => [...queryKeys.osm.all(), 'search', q, sport] as const,
trail: (osmId: string) => [...queryKeys.osm.all(), 'trail', osmId] as const,
conditions: (search?: string) => [...queryKeys.osm.all(), 'conditions', search] as const,
},

catalogAnalytics: {
all: () => ['catalogAnalytics'] as const,
overview: () => [...queryKeys.catalogAnalytics.all(), 'overview'] as const,
Expand Down
3 changes: 3 additions & 0 deletions apps/expo/features/auth/hooks/useAuthActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ function mapToUser(raw: Record<string, unknown>): User {
firstName: spaceIdx >= 0 ? name.slice(0, spaceIdx) : name,
lastName: spaceIdx >= 0 ? name.slice(spaceIdx + 1) : '',
role: (raw.role as 'USER' | 'ADMIN') ?? 'USER',
emailVerified: (raw.emailVerified as boolean | null) ?? null,
avatarUrl: (raw.image as string | null) ?? null,
createdAt: (raw.createdAt as string | null) ?? null,
updatedAt: (raw.updatedAt as string | null) ?? null,
preferredWeightUnit: (raw.preferredWeightUnit as User['preferredWeightUnit']) ?? 'g',
};
}
Expand Down
3 changes: 3 additions & 0 deletions apps/expo/features/auth/hooks/useAuthInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ function applySessionUser(sessionUser: Record<string, unknown>) {
.slice(1)
.join(' ') ?? '',
role: (sessionUser.role as 'USER' | 'ADMIN') ?? 'USER', // safe-cast: Better Auth client type omits additionalFields; role is present at runtime
emailVerified: (sessionUser.emailVerified as boolean | null) ?? null,
avatarUrl: (sessionUser.image as string | null) ?? null,
createdAt: (sessionUser.createdAt as string | null) ?? null,
updatedAt: (sessionUser.updatedAt as string | null) ?? null,
preferredWeightUnit: 'g',
});
}
Expand Down
18 changes: 9 additions & 9 deletions apps/expo/features/catalog/components/ItemReviews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ export function ItemReviews({ reviews }: ItemReviewsProps) {
</Text>
</View>

{reviews.map((review) => {
const isExpanded = expandedReviews[review.title] || false;
const shouldTruncate = review.text.length > 150;
{reviews.map((review, i) => {
const reviewKey = review.title ?? String(i);
const isExpanded = expandedReviews[reviewKey] || false;
const shouldTruncate = (review.text ?? '').length > 150;

return (
<View key={review.title} className="mb-3 rounded-lg bg-card p-3 shadow-sm">
<View key={reviewKey} className="mb-3 rounded-lg bg-card p-3 shadow-sm">
<View className="flex-row items-center justify-between">
<View className="flex-row items-center">
{review.user_avatar ? (
Expand All @@ -63,7 +64,9 @@ export function ItemReviews({ reviews }: ItemReviewsProps) {
<Text className="font-medium text-foreground">
{review.user_name || t('catalog.anonymous')}
</Text>
<Text className="text-xs text-muted-foreground">{formatDate(review.date)}</Text>
<Text className="text-xs text-muted-foreground">
{review.date ? formatDate(review.date) : ''}
</Text>
</View>
</View>
<View className="flex-row items-center">
Expand Down Expand Up @@ -97,10 +100,7 @@ export function ItemReviews({ reviews }: ItemReviewsProps) {
</Text>

{shouldTruncate && (
<TouchableOpacity
className="mt-1"
onPress={() => toggleReviewExpansion(review.title)}
>
<TouchableOpacity className="mt-1" onPress={() => toggleReviewExpansion(reviewKey)}>
<Text className="text-sm text-primary">
{isExpanded ? t('catalog.showLess') : t('catalog.readMore')}
</Text>
Expand Down
Loading
Loading