Skip to content

Commit

Permalink
chore: big dependencies updates (#347)
Browse files Browse the repository at this point in the history
* chore: bump most of the dependencies

* chore: update i18n api and tests

* chore: finish updating packages

* chore: final touches to have everything working together
  • Loading branch information
tsyirvo authored Oct 19, 2022
1 parent 449554e commit 5e16273
Show file tree
Hide file tree
Showing 7 changed files with 995 additions and 999 deletions.
1 change: 1 addition & 0 deletions __mocks__/i18n-js.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = jest.requireActual('i18n-js/dist/require/index');
4 changes: 2 additions & 2 deletions __mocks__/react-native-toast-message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jest.mock('react-native-toast-message', () => ({
module.exports = {
show: jest.fn(),
hide: jest.fn(),
}));
};
1 change: 1 addition & 0 deletions e2e/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"maxWorkers": 1,
"preset": "ts-jest",
"testEnvironment": "./environment",
"testRunner": "jest-circus/runner",
"testTimeout": 120000,
Expand Down
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@
"@react-native-masked-view/masked-view": "0.2.7",
"@react-navigation/devtools": "6.0.10",
"@react-navigation/native": "6.0.13",
"@react-navigation/native-stack": "6.9.0",
"@react-navigation/native-stack": "6.9.1",
"@sentry/react-native": "4.2.2",
"@shopify/restyle": "2.1.0",
"dayjs": "1.11.5",
"expo": "46.0.10",
"expo": "46.0.16",
"expo-application": "~4.2.2",
"expo-asset": "~8.6.1",
"expo-constants": "~13.2.4",
Expand All @@ -78,8 +78,8 @@
"expo-splash-screen": "~0.16.2",
"expo-status-bar": "~1.4.0",
"expo-updates": "~0.14.6",
"firebase": "9.10.0",
"i18n-js": "3.9.2",
"firebase": "9.12.1",
"i18n-js": "4.1.1",
"jest-expo": "46.0.1",
"lodash": "4.17.21",
"mixpanel-react-native": "2.1.0",
Expand All @@ -89,14 +89,14 @@
"react-native-fast-image": "8.6.1",
"react-native-gesture-handler": "~2.5.0",
"react-native-keyboard-aware-scroll-view": "0.9.5",
"react-native-localize": "2.2.3",
"react-native-localize": "2.2.4",
"react-native-mmkv": "2.4.3",
"react-native-reanimated": "~2.9.1",
"react-native-safe-area-context": "4.3.1",
"react-native-screens": "~3.15.0",
"react-native-svg": "12.3.0",
"react-native-toast-message": "2.1.5",
"semver": "7.3.7",
"semver": "7.3.8",
"sentry-expo": "~5.0.0"
},
"devDependencies": {
Expand All @@ -105,14 +105,14 @@
"@commitlint/config-conventional": "17.1.0",
"@config-plugins/detox": "3.0.0",
"@svgr/cli": "6.5.0",
"@testing-library/jest-native": "4.0.5",
"@testing-library/react-native": "10.1.1",
"@testing-library/jest-native": "5.0.0",
"@testing-library/react-native": "11.3.0",
"@types/fs-extra": "9.0.13",
"@types/i18n-js": "3.8.2",
"@types/i18n-js": "3.8.3",
"@types/imagemin": "8.0.0",
"@types/imagemin-mozjpeg": "8.0.1",
"@types/jest": "27.0.3",
"@types/lodash": "4.14.185",
"@types/jest": "28.1.1",
"@types/lodash": "4.14.186",
"@types/react": "18.0.0",
"@types/react-native": "0.69.1",
"@types/react-navigation": "3.4.0",
Expand All @@ -124,20 +124,21 @@
"detox": "19.12.6",
"eslint": "8.19.0",
"eslint-config-tsyirvo-react-native": "1.3.0",
"expo-community-flipper": "46.0.1",
"expo-community-flipper": "46.0.2",
"fs-extra": "10.1.0",
"husky": "8.0.1",
"imagemin": "7.0.1",
"imagemin-mozjpeg": "9.0.0",
"imagemin-pngquant": "9.0.2",
"is-image": "3.1.0",
"jest": "27.4.5",
"jest": "28.1.3",
"lint-staged": "13.0.3",
"patch-package": "6.4.7",
"prettier": "2.7.1",
"react-native-flipper": "0.164.0",
"sharp": "0.31.1",
"standard-version": "9.5.0",
"ts-jest": "29.0.3",
"ts-node": "10.9.1",
"typescript": "4.8.3"
},
Expand Down
4 changes: 2 additions & 2 deletions scripts/detox/move-android-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -e

tar -xf e2e/builds/android-release.tar.gz -C e2e/builds

mv "$PWD/release/app-release.apk" "$PWD/e2e/builds/"
mv "$PWD/androidTest/release/app-release-androidTest.apk" "$PWD/e2e/builds/"
mv "$PWD/e2e/builds/release/app-release.apk" "$PWD/e2e/builds/"
mv "$PWD/e2e/builds/androidTest/release/app-release-androidTest.apk" "$PWD/e2e/builds/"

rm -rf "$PWD/e2e/builds/release"
rm -rf "$PWD/e2e/builds/androidTest"
Expand Down
6 changes: 4 additions & 2 deletions src/i18n/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import i18n from 'i18n-js';
import { I18n } from 'i18n-js';
import * as RNLocalize from 'react-native-localize';

import { config, storageKeys } from '$core/constants';
Expand All @@ -14,6 +14,8 @@ const translationGetters: TranslationGetters = {
fr: () => require('$i18n/locales/fr.json'),
};

const i18n = new I18n();

/* ***** ***** Utils ***** ***** */

const getPhoneLocale = () => {
Expand Down Expand Up @@ -56,7 +58,7 @@ const setAppLocale = (locale: string, saveToStorage?: boolean) => {

/* ***** ***** I18n ***** ***** */

i18n.fallbacks = true;
i18n.enableFallback = true;
i18n.translations = { en: translationGetters.en() };

export const initI18n = () => {
Expand Down
Loading

0 comments on commit 5e16273

Please sign in to comment.