Skip to content

Commit

Permalink
Merge pull request #10 from Expensify/main
Browse files Browse the repository at this point in the history
Even with main
  • Loading branch information
graylewis authored Jan 30, 2024
2 parents c509d44 + 82ae62f commit 19e86ea
Show file tree
Hide file tree
Showing 2,327 changed files with 100,312 additions and 132,539 deletions.
62 changes: 61 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,74 @@
const restrictedImportPaths = [
{
name: 'react-native',
importNames: ['useWindowDimensions', 'StatusBar', 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable'],
importNames: ['useWindowDimensions', 'StatusBar', 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable', 'Text'],
message: [
'',
"For 'useWindowDimensions', please use 'src/hooks/useWindowDimensions' instead.",
"For 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable', please use 'PressableWithFeedback' and/or 'PressableWithoutFeedback' from 'src/components/Pressable' instead.",
"For 'StatusBar', please use 'src/libs/StatusBar' instead.",
"For 'Text', please use '@components/Text' instead.",
].join('\n'),
},
{
name: 'react-native-gesture-handler',
importNames: ['TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight'],
message: "Please use 'PressableWithFeedback' and/or 'PressableWithoutFeedback' from 'src/components/Pressable' instead.",
},
{
name: 'awesome-phonenumber',
importNames: ['parsePhoneNumber'],
message: "Please use '@libs/PhoneNumber' instead.",
},
{
name: 'react-native-safe-area-context',
importNames: ['useSafeAreaInsets', 'SafeAreaConsumer', 'SafeAreaInsetsContext'],
message: "Please use 'useSafeAreaInsets' from 'src/hooks/useSafeAreaInset' and/or 'SafeAreaConsumer' from 'src/components/SafeAreaConsumer' instead.",
},
{
name: 'react',
importNames: ['CSSProperties'],
message: "Please use 'ViewStyle', 'TextStyle', 'ImageStyle' from 'react-native' instead.",
},
{
name: '@styles/index',
importNames: ['default', 'defaultStyles'],
message: 'Do not import styles directly. Please use the `useThemeStyles` hook or `withThemeStyles` HOC instead.',
},
{
name: '@styles/utils',
importNames: ['default', 'DefaultStyleUtils'],
message: 'Do not import StyleUtils directly. Please use the `useStyleUtils` hook or `withStyleUtils` HOC instead.',
},
{
name: '@styles/theme',
importNames: ['default', 'defaultTheme'],

message: 'Do not import themes directly. Please use the `useTheme` hook or `withTheme` HOC instead.',
},
{
name: '@styles/theme/illustrations',
message: 'Do not import theme illustrations directly. Please use the `useThemeIllustrations` hook instead.',
},
];

const restrictedImportPatterns = [
{
group: ['**/assets/animations/**/*.json'],
message: "Do not import animations directly. Please use the 'src/components/LottieAnimations' import instead.",
},
{
group: ['@styles/theme/themes/**'],
message: 'Do not import themes directly. Please use the `useTheme` hook or `withTheme` HOC instead.',
},
{
group: ['@styles/utils/**', '!@styles/utils/FontUtils', '!@styles/utils/types'],
message: 'Do not import style util functions directly. Please use the `useStyleUtils` hook or `withStyleUtils` HOC instead.',
},
{
group: ['@styles/theme/illustrations/themes/**'],
message: 'Do not import theme illustrations directly. Please use the `useThemeIllustrations` hook instead.',
},
];

module.exports = {
Expand Down Expand Up @@ -166,14 +209,31 @@ module.exports = {
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
fixStyle: 'separate-type-imports',
},
],
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/consistent-type-exports': [
'error',
{
fixMixedExportsWithInlineTypeSpecifier: false,
},
],
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'es/no-nullish-coalescing-operators': 'off',
'es/no-optional-chaining': 'off',
'valid-jsdoc': 'off',
'jsdoc/no-types': 'error',
'rulesdir/no-default-props': 'error',
'import/no-extraneous-dependencies': 'off',
'rulesdir/prefer-underscore-method': 'off',
'rulesdir/prefer-import-module-contents': 'off',
'react/require-default-props': 'off',
'react/prop-types': 'off',
'no-restricted-syntax': [
'error',
{
Expand Down
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ This is a checklist for PR authors. Please make sure to complete all tasks and c
- [ ] 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)
- [ ] 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.
- [ ] 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.
- [ ] If the PR modifies the form input styles:
- [ ] I verified that all the inputs inside a form are aligned with each other.
- [ ] I added `Design` label so the design team can review the changes.
- [ ] 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.
- [ ] 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.

Expand Down
29 changes: 0 additions & 29 deletions .github/actions/composite/buildAndroidAPK/action.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/actions/composite/buildAndroidAPKDelta/action.yml

This file was deleted.

81 changes: 81 additions & 0 deletions .github/actions/composite/buildAndroidE2EAPK/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Build an Android apk for e2e tests
description: Build an Android apk for an E2E test build and upload it as an artifact

inputs:
ARTIFACT_NAME:
description: The name of the workflow artifact where the APK should be uploaded
required: true
PACKAGE_SCRIPT_NAME:
description: The name of the npm script to run to build the APK
required: true
APP_OUTPUT_PATH:
description: The path to the built APK
required: true
MAPBOX_SDK_DOWNLOAD_TOKEN:
description: The token to use to download the MapBox SDK
required: true
PATH_ENV_FILE:
description: The path to the .env file to use for the build
required: true
EXPENSIFY_PARTNER_NAME:
description: The name of the Expensify partner to use for the build
required: true
EXPENSIFY_PARTNER_PASSWORD:
description: The password of the Expensify partner to use for the build
required: true
EXPENSIFY_PARTNER_USER_ID:
description: The user ID of the Expensify partner to use for the build
required: true
EXPENSIFY_PARTNER_USER_SECRET:
description: The user secret of the Expensify partner to use for the build
required: true
EXPENSIFY_PARTNER_PASSWORD_EMAIL:
description: The email address of the Expensify partner to use for the build
required: true

runs:
using: composite
steps:
- name: Configure MapBox SDK
run: ./scripts/setup-mapbox-sdk.sh ${{ inputs.MAPBOX_SDK_DOWNLOAD_TOKEN }}
shell: bash

- uses: Expensify/App/.github/actions/composite/setupNode@main

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: "oracle"
java-version: "17"

- uses: ruby/setup-ruby@a05e47355e80e57b9a67566a813648fa67d92011
with:
ruby-version: "2.7"
bundler-cache: true

- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef

- name: Append environment variables to env file
shell: bash
run: |
echo "EXPENSIFY_PARTNER_NAME=${EXPENSIFY_PARTNER_NAME}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_PASSWORD=${EXPENSIFY_PARTNER_PASSWORD}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_USER_ID=${EXPENSIFY_PARTNER_USER_ID}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_USER_SECRET=${EXPENSIFY_PARTNER_USER_SECRET}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_PASSWORD_EMAIL=${EXPENSIFY_PARTNER_PASSWORD_EMAIL}" >> ${{ inputs.PATH_ENV_FILE }}
- name: Build APK
run: npm run ${{ inputs.PACKAGE_SCRIPT_NAME }}
shell: bash
env:
EXPENSIFY_PARTNER_NAME: ${{ inputs.EXPENSIFY_PARTNER_NAME }}
EXPENSIFY_PARTNER_PASSWORD: ${{ inputs.EXPENSIFY_PARTNER_PASSWORD }}
EXPENSIFY_PARTNER_USER_ID: ${{ inputs.EXPENSIFY_PARTNER_USER_ID }}
EXPENSIFY_PARTNER_USER_SECRET: ${{ inputs.EXPENSIFY_PARTNER_USER_SECRET }}
EXPENSIFY_PARTNER_PASSWORD_EMAIL: ${{ inputs.EXPENSIFY_PARTNER_PASSWORD_EMAIL }}

- name: Upload APK
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
with:
name: ${{ inputs.ARTIFACT_NAME }}
path: ${{ inputs.APP_OUTPUT_PATH }}
25 changes: 0 additions & 25 deletions .github/actions/composite/configureAwsCredentials/action.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Category from './Category';
import type Category from './Category';
import newComponent from './newComponentCategory';

const categories: Category[] = [newComponent];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import traverse from '@babel/traverse';
import CONST from '../../../../libs/CONST';
import GithubUtils from '../../../../libs/GithubUtils';
import promiseSome from '../../../../libs/promiseSome';
import Category from './Category';
import type Category from './Category';

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

Expand Down
Loading

0 comments on commit 19e86ea

Please sign in to comment.