Skip to content

Commit 19e86ea

Browse files
authored
Merge pull request #10 from Expensify/main
Even with main
2 parents c509d44 + 82ae62f commit 19e86ea

File tree

2,327 files changed

+100312
-132539
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,327 files changed

+100312
-132539
lines changed

.eslintrc.js

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,74 @@
11
const restrictedImportPaths = [
22
{
33
name: 'react-native',
4-
importNames: ['useWindowDimensions', 'StatusBar', 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable'],
4+
importNames: ['useWindowDimensions', 'StatusBar', 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable', 'Text'],
55
message: [
66
'',
77
"For 'useWindowDimensions', please use 'src/hooks/useWindowDimensions' instead.",
88
"For 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable', please use 'PressableWithFeedback' and/or 'PressableWithoutFeedback' from 'src/components/Pressable' instead.",
99
"For 'StatusBar', please use 'src/libs/StatusBar' instead.",
10+
"For 'Text', please use '@components/Text' instead.",
1011
].join('\n'),
1112
},
1213
{
1314
name: 'react-native-gesture-handler',
1415
importNames: ['TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight'],
1516
message: "Please use 'PressableWithFeedback' and/or 'PressableWithoutFeedback' from 'src/components/Pressable' instead.",
1617
},
18+
{
19+
name: 'awesome-phonenumber',
20+
importNames: ['parsePhoneNumber'],
21+
message: "Please use '@libs/PhoneNumber' instead.",
22+
},
1723
{
1824
name: 'react-native-safe-area-context',
1925
importNames: ['useSafeAreaInsets', 'SafeAreaConsumer', 'SafeAreaInsetsContext'],
2026
message: "Please use 'useSafeAreaInsets' from 'src/hooks/useSafeAreaInset' and/or 'SafeAreaConsumer' from 'src/components/SafeAreaConsumer' instead.",
2127
},
28+
{
29+
name: 'react',
30+
importNames: ['CSSProperties'],
31+
message: "Please use 'ViewStyle', 'TextStyle', 'ImageStyle' from 'react-native' instead.",
32+
},
33+
{
34+
name: '@styles/index',
35+
importNames: ['default', 'defaultStyles'],
36+
message: 'Do not import styles directly. Please use the `useThemeStyles` hook or `withThemeStyles` HOC instead.',
37+
},
38+
{
39+
name: '@styles/utils',
40+
importNames: ['default', 'DefaultStyleUtils'],
41+
message: 'Do not import StyleUtils directly. Please use the `useStyleUtils` hook or `withStyleUtils` HOC instead.',
42+
},
43+
{
44+
name: '@styles/theme',
45+
importNames: ['default', 'defaultTheme'],
46+
47+
message: 'Do not import themes directly. Please use the `useTheme` hook or `withTheme` HOC instead.',
48+
},
49+
{
50+
name: '@styles/theme/illustrations',
51+
message: 'Do not import theme illustrations directly. Please use the `useThemeIllustrations` hook instead.',
52+
},
2253
];
2354

2455
const restrictedImportPatterns = [
2556
{
2657
group: ['**/assets/animations/**/*.json'],
2758
message: "Do not import animations directly. Please use the 'src/components/LottieAnimations' import instead.",
2859
},
60+
{
61+
group: ['@styles/theme/themes/**'],
62+
message: 'Do not import themes directly. Please use the `useTheme` hook or `withTheme` HOC instead.',
63+
},
64+
{
65+
group: ['@styles/utils/**', '!@styles/utils/FontUtils', '!@styles/utils/types'],
66+
message: 'Do not import style util functions directly. Please use the `useStyleUtils` hook or `withStyleUtils` HOC instead.',
67+
},
68+
{
69+
group: ['@styles/theme/illustrations/themes/**'],
70+
message: 'Do not import theme illustrations directly. Please use the `useThemeIllustrations` hook instead.',
71+
},
2972
];
3073

3174
module.exports = {
@@ -166,14 +209,31 @@ module.exports = {
166209
'@typescript-eslint/switch-exhaustiveness-check': 'error',
167210
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
168211
'@typescript-eslint/no-floating-promises': 'off',
212+
'@typescript-eslint/consistent-type-imports': [
213+
'error',
214+
{
215+
prefer: 'type-imports',
216+
fixStyle: 'separate-type-imports',
217+
},
218+
],
219+
'@typescript-eslint/no-import-type-side-effects': 'error',
220+
'@typescript-eslint/consistent-type-exports': [
221+
'error',
222+
{
223+
fixMixedExportsWithInlineTypeSpecifier: false,
224+
},
225+
],
226+
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
169227
'es/no-nullish-coalescing-operators': 'off',
170228
'es/no-optional-chaining': 'off',
171229
'valid-jsdoc': 'off',
172230
'jsdoc/no-types': 'error',
231+
'rulesdir/no-default-props': 'error',
173232
'import/no-extraneous-dependencies': 'off',
174233
'rulesdir/prefer-underscore-method': 'off',
175234
'rulesdir/prefer-import-module-contents': 'off',
176235
'react/require-default-props': 'off',
236+
'react/prop-types': 'off',
177237
'no-restricted-syntax': [
178238
'error',
179239
{

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ This is a checklist for PR authors. Please make sure to complete all tasks and c
103103
- [ ] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like `Avatar` is modified, I verified that `Avatar` is working as expected in all cases)
104104
- [ ] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
105105
- [ ] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
106+
- [ ] If the PR modifies the form input styles:
107+
- [ ] I verified that all the inputs inside a form are aligned with each other.
108+
- [ ] I added `Design` label so the design team can review the changes.
106109
- [ ] If a new page is added, I verified it's using the `ScrollView` component to make it scrollable when more elements are added to the page.
107110
- [ ] If the `main` branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the `Test` steps.
108111

.github/actions/composite/buildAndroidAPK/action.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/actions/composite/buildAndroidAPKDelta/action.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Build an Android apk for e2e tests
2+
description: Build an Android apk for an E2E test build and upload it as an artifact
3+
4+
inputs:
5+
ARTIFACT_NAME:
6+
description: The name of the workflow artifact where the APK should be uploaded
7+
required: true
8+
PACKAGE_SCRIPT_NAME:
9+
description: The name of the npm script to run to build the APK
10+
required: true
11+
APP_OUTPUT_PATH:
12+
description: The path to the built APK
13+
required: true
14+
MAPBOX_SDK_DOWNLOAD_TOKEN:
15+
description: The token to use to download the MapBox SDK
16+
required: true
17+
PATH_ENV_FILE:
18+
description: The path to the .env file to use for the build
19+
required: true
20+
EXPENSIFY_PARTNER_NAME:
21+
description: The name of the Expensify partner to use for the build
22+
required: true
23+
EXPENSIFY_PARTNER_PASSWORD:
24+
description: The password of the Expensify partner to use for the build
25+
required: true
26+
EXPENSIFY_PARTNER_USER_ID:
27+
description: The user ID of the Expensify partner to use for the build
28+
required: true
29+
EXPENSIFY_PARTNER_USER_SECRET:
30+
description: The user secret of the Expensify partner to use for the build
31+
required: true
32+
EXPENSIFY_PARTNER_PASSWORD_EMAIL:
33+
description: The email address of the Expensify partner to use for the build
34+
required: true
35+
36+
runs:
37+
using: composite
38+
steps:
39+
- name: Configure MapBox SDK
40+
run: ./scripts/setup-mapbox-sdk.sh ${{ inputs.MAPBOX_SDK_DOWNLOAD_TOKEN }}
41+
shell: bash
42+
43+
- uses: Expensify/App/.github/actions/composite/setupNode@main
44+
45+
- name: Setup Java
46+
uses: actions/setup-java@v3
47+
with:
48+
distribution: "oracle"
49+
java-version: "17"
50+
51+
- uses: ruby/setup-ruby@a05e47355e80e57b9a67566a813648fa67d92011
52+
with:
53+
ruby-version: "2.7"
54+
bundler-cache: true
55+
56+
- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
57+
58+
- name: Append environment variables to env file
59+
shell: bash
60+
run: |
61+
echo "EXPENSIFY_PARTNER_NAME=${EXPENSIFY_PARTNER_NAME}" >> ${{ inputs.PATH_ENV_FILE }}
62+
echo "EXPENSIFY_PARTNER_PASSWORD=${EXPENSIFY_PARTNER_PASSWORD}" >> ${{ inputs.PATH_ENV_FILE }}
63+
echo "EXPENSIFY_PARTNER_USER_ID=${EXPENSIFY_PARTNER_USER_ID}" >> ${{ inputs.PATH_ENV_FILE }}
64+
echo "EXPENSIFY_PARTNER_USER_SECRET=${EXPENSIFY_PARTNER_USER_SECRET}" >> ${{ inputs.PATH_ENV_FILE }}
65+
echo "EXPENSIFY_PARTNER_PASSWORD_EMAIL=${EXPENSIFY_PARTNER_PASSWORD_EMAIL}" >> ${{ inputs.PATH_ENV_FILE }}
66+
67+
- name: Build APK
68+
run: npm run ${{ inputs.PACKAGE_SCRIPT_NAME }}
69+
shell: bash
70+
env:
71+
EXPENSIFY_PARTNER_NAME: ${{ inputs.EXPENSIFY_PARTNER_NAME }}
72+
EXPENSIFY_PARTNER_PASSWORD: ${{ inputs.EXPENSIFY_PARTNER_PASSWORD }}
73+
EXPENSIFY_PARTNER_USER_ID: ${{ inputs.EXPENSIFY_PARTNER_USER_ID }}
74+
EXPENSIFY_PARTNER_USER_SECRET: ${{ inputs.EXPENSIFY_PARTNER_USER_SECRET }}
75+
EXPENSIFY_PARTNER_PASSWORD_EMAIL: ${{ inputs.EXPENSIFY_PARTNER_PASSWORD_EMAIL }}
76+
77+
- name: Upload APK
78+
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
79+
with:
80+
name: ${{ inputs.ARTIFACT_NAME }}
81+
path: ${{ inputs.APP_OUTPUT_PATH }}

.github/actions/composite/configureAwsCredentials/action.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/actions/javascript/authorChecklist/categories/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Category from './Category';
1+
import type Category from './Category';
22
import newComponent from './newComponentCategory';
33

44
const categories: Category[] = [newComponent];

.github/actions/javascript/authorChecklist/categories/newComponentCategory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import traverse from '@babel/traverse';
44
import CONST from '../../../../libs/CONST';
55
import GithubUtils from '../../../../libs/GithubUtils';
66
import promiseSome from '../../../../libs/promiseSome';
7-
import Category from './Category';
7+
import type Category from './Category';
88

99
type SuperClassType = {superClass: {name?: string; object: {name: string}; property: {name: string}} | null; name: string};
1010

0 commit comments

Comments
 (0)