Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate-to-expo #254

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

exec < /dev/tty; yarn node-talisman --githook pre-commit -i
# exec < /dev/tty; yarn node-talisman --githook pre-commit -i
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/monsuivipsy.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

14 changes: 6 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@
"titleBar.activeBackground": "#1FC6D5",
"titleBar.inactiveBackground": "#1FC6D599",
"titleBar.activeForeground": "#14484d",
"titleBar.inactiveForeground": "#afd0d399",
"titleBar.inactiveForeground": "#afd0d399"
},
// NEW
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": false,
"source.fixAll": true,
"source.fixAll.stylelint": true
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never",
"source.fixAll": "explicit",
"source.fixAll.stylelint": "explicit"
},
"eslint.validate": [
"javascript"
],
"eslint.validate": ["javascript"],
// END NEW
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
Expand Down
2 changes: 0 additions & 2 deletions app/.bundle/config

This file was deleted.

6 changes: 6 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Expo
.expo/
# Ios
ios/
# Android
android/
# OSX
#
.DS_Store
Expand Down
1 change: 1 addition & 0 deletions app/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ module.exports = {
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
printWidth: 180,
};
1 change: 0 additions & 1 deletion app/.ruby-version

This file was deleted.

1 change: 0 additions & 1 deletion app/.watchmanconfig

This file was deleted.

41 changes: 21 additions & 20 deletions app/App.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
import "react-native-gesture-handler";
import "react-native-get-random-values";
import React from "react";
import dayjs from "dayjs";
import "dayjs/locale/fr";
import isSameOrAfter from "dayjs/plugin/isSameOrAfter";
import 'expo-dev-client';
import 'react-native-gesture-handler';
import 'react-native-get-random-values';
import React from 'react';
import dayjs from 'dayjs';
import 'dayjs/locale/fr';
import isSameOrAfter from 'dayjs/plugin/isSameOrAfter';

dayjs.extend(isSameOrAfter);
dayjs.locale("fr");
dayjs.locale('fr');

import Router from "./src/navigation/router";
import { DiaryDataProvider } from "./src/context/diaryData";
import { DiaryNotesProvider } from "./src/context/diaryNotes";
import NPS from "./src/services/NPS/NPS";
import { Sentry } from "react-native-sentry";
import { NeedUpdateContextProvider } from "./src/context/needUpdate";
import { InfoModalProvider } from "./src/components/InfoModal";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { OnboardingProgressHeaderProvider } from "./src/scenes/onboarding/ProgressHeader";
import { LatestChangesModalProvider } from "./src/scenes/news/latestChangesModal";
import Router from './src/navigation/router';
import {DiaryDataProvider} from './src/context/diaryData';
import {DiaryNotesProvider} from './src/context/diaryNotes';
import NPS from './src/services/NPS/NPS';
// import { Sentry } from "react-native-sentry";
import {NeedUpdateContextProvider} from './src/context/needUpdate';
import {InfoModalProvider} from './src/components/InfoModal';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import {OnboardingProgressHeaderProvider} from './src/scenes/onboarding/ProgressHeader';
import {LatestChangesModalProvider} from './src/scenes/news/latestChangesModal';

if (!__DEV__) {
Sentry.config("https://9f0bd8f8af8444eea9f470d00a1bb411@sentry.fabrique.social.gouv.fr/54").install();
}
// if (!__DEV__) {
// Sentry.config("https://9f0bd8f8af8444eea9f470d00a1bb411@sentry.fabrique.social.gouv.fr/54").install();
// }

const App = () => (
<SafeAreaProvider>
Expand Down
4 changes: 0 additions & 4 deletions app/Gemfile

This file was deleted.

47 changes: 47 additions & 0 deletions app/UPDATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# What's new

- adding expo@51
- - running expo-doctor to see package needed to be updated
- updating react-natigation to v6
- - review some of the code to match the new version
- made the project Continuous Native Generation (CNG) https://docs.expo.dev/workflow/continuous-native-generation/
- - means that /ios and /android are generated automatically from the code - so no need to have them in the repo

# What's changed

- react-native-cli
- change react-native-permissions to package that works with expo https://docs.expo.dev/guides/permissions/
- - mostly the notification permission had to be changed, so I changed for expo-notifications --> TO CHECK
- sentry was not working, so it need to be re-install use @sentry/react-native and follow the instructions https://docs.expo.dev/guides/using-sentry/
- chabge react-native-dotenv to built in expo https://docs.expo.dev/guides/using-environment-variables/
- In the code the Button2.js, Card.js Collapsable.js and InputText.js (searh for // FIX-EVAL: ) were not working, so I make a quick win fix but a refactoring is needed
- the pdf viewer was not working, so I use the WebView component from expo-web-browser (presentation/index.js)
- the pie chart was not working, so I use the react-native-pie-chart package (scenes/suivi/chartPie.js)
- - scenes/suivi/chartPie.js
- - scenes/goals/suivi/GoalsChartPie.js

- asset moved
- - fonts to assets/fonts
- - - all the `fontFamily: "Karla"` style were changed to `fontFamily: "Karla-Regular"` (follow the best practices of expo naming file https://docs.expo.dev/develop/user-interface/fonts/#how-to-determine-which-font-family-name-to-use)
- - images to assets/imgs
- status/DiaryList.js was not working having a warning, so I use forwardRef to fix it
- scenes/indicateurs/settings/IndicatorsSettingsMore.js and goals/settings/GoalsSettingsMore.js were crashing the app cause of incompatible version of react-native-draggable-flatlist (v3) and react-native-reanimated, so I use the react-native-draggable-flatlist@4

# What's removed

- removed the /ios and /android folders, as they are now generated automatically from the code
- all @babel packages except for @babel/core
- unused packages: react-test-renderer, react-native-masked-view/masked-view

# To do

- P0
- - fix the pdf viewer for android not working
- - check the notification system
- - add sentry
- - check if assets are how they were before (icons, fonts and splash screen)
- P1
- - Safe Area View badly handled (android the top is cut and ios with not rectangle screen the bottom is hidden)
- - Use nativewind
- P2
- - change the pie chart react-native-pie (5y not maintained) package for react-native-pie-chart or else
14 changes: 0 additions & 14 deletions app/__tests__/App-test.js

This file was deleted.

3 changes: 0 additions & 3 deletions app/android/Gemfile

This file was deleted.

55 changes: 0 additions & 55 deletions app/android/app/_BUCK

This file was deleted.

Loading
Loading