Skip to content

Commit

Permalink
Merge branch 'main' of github.com:wyne/scorepad-react-native into nav…
Browse files Browse the repository at this point in the history
…igation-tests
  • Loading branch information
wyne committed Aug 3, 2024
2 parents f016f22 + 4bbc44e commit c13b9da
Show file tree
Hide file tree
Showing 89 changed files with 3,987 additions and 3,475 deletions.
47 changes: 47 additions & 0 deletions .easignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.env
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
*.ipa
*.apk

.expo/
web-build/

assets-src/
assets-stores/
node_modules/
ios/
android/
dist/

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

# @end expo-cli
11 changes: 6 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ module.exports = {
'prettier',
],
rules: {
'quotes': ['error', 'single'],
'@typescript-eslint/no-var-requires': 0,
'jest/no-disabled-tests': 0,
'semi': ['error', 'always'],
'eol-last': ['error', 'always'],
'import/order': ['error', {
"pathGroups": [
'pathGroups': [
{
"pattern": "react",
"group": "builtin",
"position": "before"
'pattern': 'react',
'group': 'builtin',
'position': 'before'
}
],
"pathGroupsExcludedImportTypes": ["react"],
'pathGroupsExcludedImportTypes': ['react'],
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'alphabetize': {
'order': 'asc',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npx eslint .
- run: npm run lint
- run: npm test
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*.key
*.mobileprovision
*.orig.*

*.ipa
*.apk


# Ignore iOS and Android builds
Expand Down Expand Up @@ -50,4 +51,4 @@ yarn-error.*
# typescript
*.tsbuildinfo

# @end expo-cli
# @end expo-cli
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.18.0
18.18
2 changes: 1 addition & 1 deletion App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { AddendModalContextProvider } from './src/components/Sheets/AddendModalC
import { GameSheetContextProvider } from './src/components/Sheets/GameSheetContext';
import { Navigation } from './src/Navigation';

if (process.env.EXPO_PUBLIC_FIREBASE_ANALYTICS == "false") {
if (process.env.EXPO_PUBLIC_FIREBASE_ANALYTICS == 'false') {
analytics().setAnalyticsCollectionEnabled(false);
}

Expand Down
24 changes: 16 additions & 8 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ Run any build command remotely by removing `--local` flag.
For android, use JDK 17.

```zsh
nvm use

npx react-native-clean-project
npx expo prebuild
eas build --profile development-simulator --platform ios --local
eas build --profile development-simulator --platform android --local
eas build:run -p ios # select expo build from above
eas build:run -p android # select expo build from above
npx eas build --profile development-simulator --platform ios --local
npx eas build --profile development-simulator --platform android --local
npx eas build:run -p ios # select expo build from above
npx eas build:run -p android # select expo build from above
npx expo start --dev-client
```

Expand All @@ -25,16 +27,20 @@ Debug Firebase Crashlytics by running simulator with `FIRDebugEnabled` flag:
### Development - Physical Device

```zsh
nvm use

npx expo prebuild -p ios
eas build --platform ios --profile development --local
npx eas build --platform ios --profile development --local

npx expo prebuild -p android
eas build --platform android --profile development --local
npx eas build --platform android --profile development --local
```

### Preview Build (Standalone)

```zsh
nvm use

npx expo prebuild -p ios
npx eas-cli build --platform ios --profile preview --local

Expand All @@ -47,10 +53,12 @@ npx eas-cli build --platform android --profile preview --local
Remember to bump `versionCode` and `buildNumber` in `app.config.js`.

```zsh
nvm use

npx expo-doctor
npx expo prebuild
eas build --platform ios
eas build --platform android
npx eas build --platform ios
npx eas build --platform android
```

## Run
Expand Down
1 change: 1 addition & 0 deletions __mocks__/Analytics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const logEvent = jest.fn();
96 changes: 57 additions & 39 deletions app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,99 +2,117 @@ const variant = process.env.APP_VARIANT;

let packageName;
switch (variant) {
case "development":
packageName = "com.wyne.scorepad.dev";
case 'development':
packageName = 'com.wyne.scorepad.dev';
break;
case "preview":
packageName = "com.wyne.scorepad.preview";
case 'preview':
packageName = 'com.wyne.scorepad.preview';
break;
default:
packageName = "com.wyne.scorepad";
packageName = 'com.wyne.scorepad';
break;
}

let name;
switch (variant) {
case "development":
name = "ScorePad with Rounds (dev)";
case 'development':
name = 'ScorePad with Rounds (dev)';
break;
case "preview":
name = "ScorePad with Rounds (preview)";
case 'preview':
name = 'ScorePad with Rounds (preview)';
break;
default:
name = "ScorePad with Rounds";
name = 'ScorePad with Rounds';
break;
}

let icon;
switch (variant) {
case "development":
icon = "./assets/icon-dev.png";
case 'development':
icon = './assets/icon-dev.png';
break;
case "preview":
icon = "./assets/icon-preview.png";
case 'preview':
icon = './assets/icon-preview.png';
break;
default:
icon = "./assets/icon.png";
icon = './assets/icon.png';
break;
}

let androidIcon;
let androidIconBg;
switch (variant) {
case 'development':
androidIcon = './assets/adaptive-icon-dev.png';
androidIconBg = './assets/adaptive-icon-bg-dev.png';
break;
case 'preview':
androidIcon = './assets/adaptive-icon-preview.png';
androidIconBg = './assets/adaptive-icon-bg-preview.png';
break;
default:
androidIcon = './assets/adaptive-icon.png';
androidIconBg = './assets/adaptive-icon-bg.png';
break;
}

export default {
name: name,
slug: "scorepad",
version: "2.5.0",
orientation: "default",
slug: 'scorepad',
version: '2.5.7',
orientation: 'default',
icon: icon,
assetBundlePatterns: ["assets/*"],
backgroundColor: "#000000",
assetBundlePatterns: ['assets/*'],
backgroundColor: '#000000',
ios: {
bundleIdentifier: packageName,
supportsTablet: true,
requireFullScreen: false,
buildNumber: "73",
buildNumber: '83',
infoPlist: {
RCTAsyncStorageExcludeFromBackup: false,
},
googleServicesFile: "./GoogleService-Info.plist",
googleServicesFile: './GoogleService-Info.plist',
},
android: {
icon: "./assets/adaptive-icon.png",
icon: androidIcon,
adaptiveIcon: {
foregroundImage: "./assets/adaptive-icon-fg.png",
backgroundImage: "./assets/adaptive-icon-bg.png",
foregroundImage: './assets/adaptive-icon-fg.png',
backgroundImage: androidIconBg,
},
package: packageName,
permissions: [],
versionCode: 73,
googleServicesFile: "./google-services.json",
blockedPermissions: ['android.permission.ACTIVITY_RECOGNITION'],
versionCode: 83,
googleServicesFile: './google-services.json',
},
userInterfaceStyle: "dark",
userInterfaceStyle: 'dark',
web: {
favicon: "./assets/favicon.png",
favicon: './assets/favicon.png',
},
extra: {
eas: {
projectId: "fc8859ea-b320-41cd-a091-36b3ec7f9b1f",
projectId: 'fc8859ea-b320-41cd-a091-36b3ec7f9b1f',
},
},
updates: {
fallbackToCacheTimeout: 0,
url: "https://u.expo.dev/fc8859ea-b320-41cd-a091-36b3ec7f9b1f",
url: 'https://u.expo.dev/fc8859ea-b320-41cd-a091-36b3ec7f9b1f',
},
runtimeVersion: {
policy: "sdkVersion",
policy: 'sdkVersion',
},
description: "",
githubUrl: "https://github.com/wyne/scorepad-react-native",
owner: "wyne",
description: '',
githubUrl: 'https://github.com/wyne/scorepad-react-native',
owner: 'wyne',
plugins: [
"@react-native-firebase/app",
"@react-native-firebase/crashlytics",
'@react-native-firebase/app',
'@react-native-firebase/crashlytics',
[
"expo-build-properties",
'expo-build-properties',
{
ios: {
useFrameworks: "static",
useFrameworks: 'static',
},
},
],
Expand Down
Binary file added assets/adaptive-icon-bg-dev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/adaptive-icon-bg-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/adaptive-icon-dev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/adaptive-icon-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"build": {
"development-simulator": {
"node": "18.18.2",
"developmentClient": true,
"distribution": "internal",
"ios": {
Expand All @@ -16,28 +17,37 @@
}
},
"development": {
"node": "18.18.2",
"developmentClient": true,
"distribution": "internal",
"ios": {
"resourceClass": "m-medium"
},
"android": {
"buildType": "apk"
},
"env": {
"APP_VARIANT": "development",
"EXPO_PUBLIC_FIREBASE_ANALYTICS": "false"
}
},
"preview": {
"node": "18.18.2",
"distribution": "internal",
"ios": {
"resourceClass": "m-medium"
},
"android": {
"buildType": "apk"
},
"channel": "preview",
"env": {
"APP_VARIANT": "preview",
"EXPO_PUBLIC_FIREBASE_ANALYTICS": "false"
}
},
"production": {
"node": "18.18.2",
"ios": {
"resourceClass": "m-medium"
},
Expand Down
4 changes: 2 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ const config: Config = {
'^.+\\.tsx?$': 'babel-jest',
},
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)"
'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)'
],
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFilesAfterEnv: [
"@testing-library/jest-native/extend-expect",
'@testing-library/jest-native/extend-expect',
]
};

Expand Down
Loading

0 comments on commit c13b9da

Please sign in to comment.