Skip to content

Commit

Permalink
chore: switched to pnpm + cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
ezeikel committed Dec 8, 2024
1 parent 48afa13 commit 5fe83ab
Show file tree
Hide file tree
Showing 42 changed files with 26,359 additions and 285 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bun test
pnpm test
7 changes: 7 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN}

# Workspace configuration
shared-workspace-lockfile=false
strict-peer-dependencies=false
auto-install-peers=true
1 change: 1 addition & 0 deletions apps/mobile/app/+not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import { Link, Stack } from 'expo-router';
import { StyleSheet, View, Text } from 'react-native';

Expand Down
3 changes: 2 additions & 1 deletion apps/mobile/components/HapticTab.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { BottomTabBarButtonProps } from '@react-navigation/bottom-tabs';
import { PlatformPressable } from '@react-navigation/elements';
import * as Haptics from 'expo-haptics';
import { GestureResponderEvent } from 'react-native';

export function HapticTab(props: BottomTabBarButtonProps) {
return (
<PlatformPressable
{...props}
onPressIn={(ev) => {
onPressIn={(ev: GestureResponderEvent) => {
if (process.env.EXPO_OS === 'ios') {
// Add a soft haptic feedback when pressing down on the tabs.
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
Expand Down
3 changes: 3 additions & 0 deletions apps/mobile/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import expoConfig from "@cuurly/eslint-config/expo";

export default [...expoConfig];
25 changes: 25 additions & 0 deletions apps/mobile/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { Config } from "jest";

const config: Config = {
preset: "jest-expo",
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
transformIgnorePatterns: [
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)",
],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/$1",
},
collectCoverageFrom: [
"**/*.{js,jsx,ts,tsx}",
"!**/coverage/**",
"!**/node_modules/**",
"!**/babel.config.js",
"!**/jest.setup.ts",
],
testMatch: [
"**/__tests__/**/*.+(ts|tsx|js)",
"**/?(*.)+(spec|test).+(ts|tsx|js)",
],
};

export default config;
16 changes: 16 additions & 0 deletions apps/mobile/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import "@testing-library/react-native/extend-expect";

// Mock expo-router
jest.mock("expo-router", () => ({
useRouter: () => ({
push: jest.fn(),
replace: jest.fn(),
back: jest.fn(),
}),
useLocalSearchParams: () => ({}),
}));

// Reset mocks between tests
beforeEach(() => {
jest.clearAllMocks();
});
26 changes: 20 additions & 6 deletions apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"main": "expo-router/entry",
"version": "0.1.0",
"scripts": {
"clean": "git clean -xdf .expo .turbo node_modules",
"start": "expo start",
"reset-project": "node ./scripts/reset-project.js",
"dev": "expo start --ios",
Expand All @@ -12,13 +13,17 @@
"prebuild:android": "expo prebuild --platform android --clean",
"ios": "expo run:ios",
"android": "expo run:android",
"build:ios": "bunx expo prebuild --platform ios --clean && bun ios",
"build:android": "bunx expo prebuild --platform android --clean && bun android",
"build:ios": "pnpm dlx expo prebuild --platform ios --clean && pnpm ios",
"build:android": "pnpm dlx expo prebuild --platform android --clean && pnpm android",
"eas:build:preview": "eas build --profile preview",
"eas:build:development": "eas build --profile development",
"eas:build:production": "eas build --profile production",
"test": "jest --watchAll",
"lint": "expo lint"
"lint": "eslint",
"lint:fix": "eslint --fix",
"typecheck": "tsc --noEmit",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage"
},
"jest": {
"preset": "jest-expo"
Expand All @@ -32,6 +37,7 @@
"@fortawesome/pro-solid-svg-icons": "^6.7.1",
"@fortawesome/react-native-fontawesome": "^0.3.2",
"@react-navigation/bottom-tabs": "^7.0.0",
"@react-navigation/elements": "^2.2.4",
"@react-navigation/native": "^7.0.0",
"expo": "~52.0.11",
"expo-blur": "~14.0.1",
Expand All @@ -58,12 +64,20 @@
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/runtime": "^7.26.0",
"@cuurly/eslint-config": "workspace:*",
"@cuurly/prettier-config": "workspace:*",
"@cuurly/tsconfig": "workspace:*",
"@testing-library/react-native": "^12.9.0",
"@types/jest": "^29.5.12",
"@types/react": "~18.3.12",
"@types/react-test-renderer": "^18.3.0",
"eslint": "^9.16.0",
"eslint-plugin-react-native": "^4.1.0",
"eslint-plugin-testing-library": "^7.0.0",
"jest": "^29.2.1",
"jest-expo": "~52.0.2",
"react-test-renderer": "18.3.1",
"typescript": "^5.3.3"
"react-test-renderer": "^18.3.1",
"typescript": "^5.7.2"
}
}
Loading

0 comments on commit 5fe83ab

Please sign in to comment.