Skip to content

Commit

Permalink
Merge branch 'Expensify:main' into fix-26941
Browse files Browse the repository at this point in the history
  • Loading branch information
byte1012 authored Jan 8, 2024
2 parents c396220 + 463b7bc commit 4b39bf3
Show file tree
Hide file tree
Showing 978 changed files with 8,380 additions and 5,047 deletions.
47 changes: 47 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,45 @@ const restrictedImportPaths = [
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 @@ -171,6 +203,21 @@ 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',
Expand Down
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
3 changes: 0 additions & 3 deletions .github/actions/javascript/validateReassureOutput/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ inputs:
COUNT_DEVIATION:
description: Allowable deviation for the mean count in regression test results.
required: true
REGRESSION_OUTPUT:
description: Refers to the results obtained from regression tests `.reassure/output.json`.
required: true
runs:
using: 'node20'
main: './index.js'
3 changes: 2 additions & 1 deletion .github/actions/javascript/validateReassureOutput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

const core = __nccwpck_require__(186);
const fs = __nccwpck_require__(147);

const run = () => {
const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', {required: true}));
const regressionOutput = JSON.parse(fs.readFileSync('.reassure/output.json', 'utf8'));
const countDeviation = core.getInput('COUNT_DEVIATION', {required: true});
const durationDeviation = core.getInput('DURATION_DEVIATION_PERCENTAGE', {required: true});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const core = require('@actions/core');
const fs = require('fs');

const run = () => {
const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', {required: true}));
const regressionOutput = JSON.parse(fs.readFileSync('.reassure/output.json', 'utf8'));
const countDeviation = core.getInput('COUNT_DEVIATION', {required: true});
const durationDeviation = core.getInput('DURATION_DEVIATION_PERCENTAGE', {required: true});

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:

env:
SHOULD_DEPLOY_PRODUCTION: ${{ github.event_name == 'release' }}
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}
Expand Down Expand Up @@ -174,6 +173,8 @@ jobs:
name: Build and deploy iOS
needs: validateActor
if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) }}
env:
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer
runs-on: macos-13-xlarge
steps:
- name: Checkout
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/reassurePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,10 @@ jobs:
npm install --force
npx reassure --branch
- name: Read output.json
id: reassure
uses: juliangruber/read-file-action@v1
with:
path: .reassure/output.json

- name: Validate output.json
id: validateReassureOutput
uses: ./.github/actions/javascript/validateReassureOutput
with:
DURATION_DEVIATION_PERCENTAGE: 20
COUNT_DEVIATION: 0
REGRESSION_OUTPUT: ${{ steps.reassure.outputs.content }}

4 changes: 1 addition & 3 deletions .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ on:
types: [opened, synchronize, labeled]
branches: ['*ci-test/**']

env:
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer

jobs:
validateActor:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -139,6 +136,7 @@ jobs:
if: ${{ fromJSON(needs.validateActor.outputs.READY_TO_BUILD) }}
env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer
runs-on: macos-13-xlarge
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testGithubActionsWorkflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
workflow_call:
pull_request:
types: [opened, reopened, edited, synchronize]
types: [opened, reopened, synchronize]
branches-ignore: [staging, production]
paths: ['.github/**']

Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001042002
versionName "1.4.20-2"
versionCode 1001042203
versionName "1.4.22-3"
}

flavorDimensions "default"
Expand Down
2 changes: 1 addition & 1 deletion assets/emojis/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import TravelAndPlaces from '@assets/images/emojiCategoryIcons/plane.svg';
import AnimalsAndNature from '@assets/images/emojiCategoryIcons/plant.svg';
import Activities from '@assets/images/emojiCategoryIcons/soccer-ball.svg';
import FrequentlyUsed from '@assets/images/history.svg';
import {HeaderEmoji, PickerEmojis} from './types';
import type {HeaderEmoji, PickerEmojis} from './types';

const skinTones = [
{
Expand Down
2 changes: 1 addition & 1 deletion assets/emojis/en.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {EmojisList} from './types';
import type {EmojisList} from './types';

/* eslint-disable @typescript-eslint/naming-convention */
const enEmojis: EmojisList = {
Expand Down
2 changes: 1 addition & 1 deletion assets/emojis/es.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {EmojisList} from './types';
import type {EmojisList} from './types';

/* eslint-disable @typescript-eslint/naming-convention */
const esEmojis: EmojisList = {
Expand Down
9 changes: 6 additions & 3 deletions assets/emojis/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import type {Locale} from '@src/types/onyx';
import emojis from './common';
import enEmojis from './en';
import esEmojis from './es';
import {Emoji} from './types';
import type {Emoji, EmojisList} from './types';

type EmojiTable = Record<string, Emoji>;

type LocaleEmojis = Partial<Record<Locale, EmojisList>>;

const emojiNameTable = emojis.reduce<EmojiTable>((prev, cur) => {
const newValue = prev;
if (!('header' in cur) && cur.name) {
Expand All @@ -26,10 +29,10 @@ const emojiCodeTableWithSkinTones = emojis.reduce<EmojiTable>((prev, cur) => {
return newValue;
}, {});

const localeEmojis = {
const localeEmojis: LocaleEmojis = {
en: enEmojis,
es: esEmojis,
} as const;
};

export default emojis;
export {emojiNameTable, emojiCodeTableWithSkinTones, localeEmojis};
Expand Down
10 changes: 6 additions & 4 deletions assets/emojis/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import IconAsset from '@src/types/utils/IconAsset';
import type IconAsset from '@src/types/utils/IconAsset';

type Emoji = {
code: string;
name: string;
types?: string[];
types?: readonly string[];
};

type HeaderEmoji = {
Expand All @@ -12,8 +12,10 @@ type HeaderEmoji = {
code: string;
};

type PickerEmojis = Array<Emoji | HeaderEmoji>;
type PickerEmoji = Emoji | HeaderEmoji;

type PickerEmojis = PickerEmoji[];

type EmojisList = Record<string, {keywords: string[]; name?: string}>;

export type {Emoji, HeaderEmoji, EmojisList, PickerEmojis};
export type {Emoji, HeaderEmoji, EmojisList, PickerEmojis, PickerEmoji};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4b39bf3

Please sign in to comment.