Skip to content

Commit 87fc66f

Browse files
committed
Merge branch 'main' into migrateGroup6FilesToTypeScript
2 parents 4e3f77f + 4231ac9 commit 87fc66f

File tree

201 files changed

+4670
-3069
lines changed

Some content is hidden

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

201 files changed

+4670
-3069
lines changed

.github/actions/composite/setupNode/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ runs:
1818
desktop/package-lock.json
1919
2020
- id: cache-node-modules
21-
uses: actions/cache@v3
21+
uses: actions/cache@v4
2222
with:
2323
path: node_modules
2424
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json', 'patches/**') }}
2525

2626
- id: cache-desktop-node-modules
27-
uses: actions/cache@v3
27+
uses: actions/cache@v4
2828
with:
2929
path: desktop/node_modules
3030
key: ${{ runner.os }}-desktop-node-modules-${{ hashFiles('desktop/package-lock.json', 'desktop/patches/**') }}

.github/actions/javascript/bumpVersion/index.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -2657,12 +2657,17 @@ createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
26572657

26582658
// Coercion.
26592659
// Extract anything that could conceivably be a part of a valid semver
2660-
createToken('COERCE', `${'(^|[^\\d])' +
2660+
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
26612661
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
26622662
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
2663-
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
2663+
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
2664+
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
2665+
createToken('COERCEFULL', src[t.COERCEPLAIN] +
2666+
`(?:${src[t.PRERELEASE]})?` +
2667+
`(?:${src[t.BUILD]})?` +
26642668
`(?:$|[^\\d])`)
26652669
createToken('COERCERTL', src[t.COERCE], true)
2670+
createToken('COERCERTLFULL', src[t.COERCEFULL], true)
26662671

26672672
// Tilde ranges.
26682673
// Meaning is "reasonably at or greater than"
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check e2e test code builds correctly
2+
3+
on:
4+
workflow_call:
5+
pull_request:
6+
types: [opened, synchronize]
7+
paths:
8+
- 'tests/e2e/**'
9+
- 'src/libs/E2E/**'
10+
11+
jobs:
12+
lint:
13+
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node
20+
uses: ./.github/actions/composite/setupNode
21+
22+
- name: Verify e2e tests compile correctly
23+
run: npm run e2e-test-runner-build

.github/workflows/e2ePerformanceTests.yml

+8-16
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
type: string
1616
required: true
1717

18+
concurrency:
19+
group: "${{ github.ref }}-e2e"
20+
cancel-in-progress: true
21+
1822
jobs:
1923
buildBaseline:
2024
runs-on: ubuntu-latest-xl
@@ -175,23 +179,11 @@ jobs:
175179
- name: Rename delta APK
176180
run: mv "${{steps.downloadDeltaAPK.outputs.download-path}}/app-e2edelta-release.apk" "${{steps.downloadDeltaAPK.outputs.download-path}}/app-e2edeltaRelease.apk"
177181

178-
- name: Copy e2e code into zip folder
179-
run: cp -r tests/e2e zip
182+
- name: Compile test runner to be executable in a nodeJS environment
183+
run: npm run e2e-test-runner-build
180184

181-
# Note: we can't reuse the apps tsconfig, as it depends on modules that aren't available in the AWS Device Farm environment
182-
- name: Write tsconfig.json to zip folder
183-
run: |
184-
echo '{
185-
"compilerOptions": {
186-
"target": "ESNext",
187-
"module": "commonjs",
188-
"strict": true,
189-
"esModuleInterop": true,
190-
"skipLibCheck": true,
191-
"forceConsistentCasingInFileNames": true,
192-
"allowJs": true,
193-
}
194-
}' > zip/tsconfig.json
185+
- name: Copy e2e code into zip folder
186+
run: cp tests/e2e/dist/index.js zip/testRunner.js
195187

196188
- name: Zip everything in the zip directory up
197189
run: zip -qr App.zip ./zip

.github/workflows/lint.yml

+5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ on:
77
branches-ignore: [staging, production]
88
paths: ['**.js', '**.ts', '**.tsx', '**.json', '**.mjs', '**.cjs', 'config/.editorconfig', '.watchmanconfig', '.imgbotconfig']
99

10+
concurrency:
11+
group: "${{ github.ref }}-lint"
12+
cancel-in-progress: true
13+
1014
jobs:
1115
lint:
16+
name: Run ESLint
1217
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}
1318
runs-on: ubuntu-latest
1419
steps:

.github/workflows/platformDeploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ jobs:
194194
bundler-cache: true
195195

196196
- name: Cache Pod dependencies
197-
uses: actions/cache@v3
197+
uses: actions/cache@v4
198198
id: pods-cache
199199
with:
200200
path: ios/Pods

.github/workflows/test.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
branches-ignore: [staging, production]
88
paths: ['**.js', '**.ts', '**.tsx', '**.sh', 'package.json', 'package-lock.json']
99

10+
concurrency:
11+
group: "${{ github.ref }}-jest"
12+
cancel-in-progress: true
13+
1014
jobs:
1115
jest:
1216
if: ${{ github.actor != 'OSBotify' && github.actor != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
@@ -31,7 +35,7 @@ jobs:
3135

3236
- name: Cache Jest cache
3337
id: cache-jest-cache
34-
uses: actions/cache@ac25611caef967612169ab7e95533cf932c32270
38+
uses: actions/cache@v4
3539
with:
3640
path: .jest-cache
3741
key: ${{ runner.os }}-jest

.github/workflows/testBuild.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ jobs:
167167
bundler-cache: true
168168

169169
- name: Cache Pod dependencies
170-
uses: actions/cache@v3
170+
uses: actions/cache@v4
171171
id: pods-cache
172172
with:
173173
path: ios/Pods

__mocks__/react-native.js __mocks__/react-native.ts

+33-11
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,47 @@
11
// eslint-disable-next-line no-restricted-imports
22
import * as ReactNative from 'react-native';
3-
import _ from 'underscore';
3+
import type StartupTimer from '@libs/StartupTimer/types';
4+
5+
const {BootSplash} = ReactNative.NativeModules;
46

57
jest.doMock('react-native', () => {
68
let url = 'https://new.expensify.com/';
79
const getInitialURL = () => Promise.resolve(url);
810

9-
let appState = 'active';
11+
let appState: ReactNative.AppStateStatus = 'active';
1012
let count = 0;
11-
const changeListeners = {};
13+
const changeListeners: Record<number, (state: ReactNative.AppStateStatus) => void> = {};
1214

1315
// Tests will run with the app in a typical small screen size by default. We do this since the react-native test renderer
1416
// runs against index.native.js source and so anything that is testing a component reliant on withWindowDimensions()
1517
// would be most commonly assumed to be on a mobile phone vs. a tablet or desktop style view. This behavior can be
1618
// overridden by explicitly setting the dimensions inside a test via Dimensions.set()
17-
let dimensions = {
19+
let dimensions: Record<string, number> = {
1820
width: 300,
1921
height: 700,
2022
scale: 1,
2123
fontScale: 1,
2224
};
2325

24-
return Object.setPrototypeOf(
26+
type ReactNativeMock = typeof ReactNative & {
27+
NativeModules: typeof ReactNative.NativeModules & {
28+
BootSplash: {
29+
getVisibilityStatus: typeof BootSplash.getVisibilityStatus;
30+
hide: typeof BootSplash.hide;
31+
logoSizeRatio: number;
32+
navigationBarHeight: number;
33+
};
34+
StartupTimer: StartupTimer;
35+
};
36+
Linking: typeof ReactNative.Linking & {
37+
setInitialURL: (newUrl: string) => void;
38+
};
39+
AppState: typeof ReactNative.AppState & {
40+
emitCurrentTestState: (state: ReactNative.AppStateStatus) => void;
41+
};
42+
};
43+
44+
const reactNativeMock: ReactNativeMock = Object.setPrototypeOf(
2545
{
2646
NativeModules: {
2747
...ReactNative.NativeModules,
@@ -36,7 +56,7 @@ jest.doMock('react-native', () => {
3656
Linking: {
3757
...ReactNative.Linking,
3858
getInitialURL,
39-
setInitialURL(newUrl) {
59+
setInitialURL(newUrl: string) {
4060
url = newUrl;
4161
},
4262
},
@@ -45,11 +65,11 @@ jest.doMock('react-native', () => {
4565
get currentState() {
4666
return appState;
4767
},
48-
emitCurrentTestState(state) {
68+
emitCurrentTestState(state: ReactNative.AppStateStatus) {
4969
appState = state;
50-
_.each(changeListeners, (listener) => listener(appState));
70+
Object.entries(changeListeners).forEach(([, listener]) => listener(appState));
5171
},
52-
addEventListener(type, listener) {
72+
addEventListener(type: ReactNative.AppStateEvent, listener: (state: ReactNative.AppStateStatus) => void) {
5373
if (type === 'change') {
5474
const originalCount = count;
5575
changeListeners[originalCount] = listener;
@@ -68,7 +88,7 @@ jest.doMock('react-native', () => {
6888
...ReactNative.Dimensions,
6989
addEventListener: jest.fn(),
7090
get: () => dimensions,
71-
set: (newDimensions) => {
91+
set: (newDimensions: Record<string, number>) => {
7292
dimensions = newDimensions;
7393
},
7494
},
@@ -78,9 +98,11 @@ jest.doMock('react-native', () => {
7898
// so it seems easier to just run the callback immediately in tests.
7999
InteractionManager: {
80100
...ReactNative.InteractionManager,
81-
runAfterInteractions: (callback) => callback(),
101+
runAfterInteractions: (callback: () => void) => callback(),
82102
},
83103
},
84104
ReactNative,
85105
);
106+
107+
return reactNativeMock;
86108
});

android/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ android {
9898
minSdkVersion rootProject.ext.minSdkVersion
9999
targetSdkVersion rootProject.ext.targetSdkVersion
100100
multiDexEnabled rootProject.ext.multiDexEnabled
101-
versionCode 1001044500
102-
versionName "1.4.45-0"
101+
versionCode 1001044601
102+
versionName "1.4.46-1"
103103
}
104104

105105
flavorDimensions "default"

assets/images/chatbubble-add.svg

+10-1
Loading

assets/images/chatbubble-reply.svg

+10
Loading

assets/images/chatbubble-unread.svg

+9-1
Loading

assets/images/make-admin.svg

+12
Loading

0 commit comments

Comments
 (0)