Skip to content

Commit 62ed312

Browse files
committed
merge main
2 parents acf2074 + 2514f29 commit 62ed312

File tree

429 files changed

+8381
-5474
lines changed

Some content is hidden

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

429 files changed

+8381
-5474
lines changed

.eslintignore

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
**/node_modules/*
2-
**/dist/*
3-
android/**/build/*
4-
.github/actions/**/index.js"
1+
!.storybook
2+
!.github
3+
.github/actions/**/index.js
4+
*.config.js
5+
**/.eslintrc.js
6+
**/node_modules/**
7+
**/dist/**
8+
android/**/build/**
59
docs/vendor/**
10+
docs/assets/**
11+
web/gtm.js

.eslintrc.js

+164-207
Large diffs are not rendered by default.

.github/.eslintrc.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
// For all these Node.js scripts, we do not want to disable `console` statements
21
module.exports = {
32
rules: {
3+
// For all these Node.js scripts, we do not want to disable `console` statements
44
'no-console': 'off',
5+
6+
'@lwc/lwc/no-async-await': 'off',
7+
'no-await-in-loop': 'off',
8+
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
59
},
610
};

.github/actions/javascript/awaitStagingDeploys/awaitStagingDeploys.ts

-13
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,10 @@ import {promiseDoWhile} from '@github/libs/promiseWhile';
88
type CurrentStagingDeploys = Awaited<ReturnType<typeof GitHubUtils.octokit.actions.listWorkflowRuns>>['data']['workflow_runs'];
99

1010
function run() {
11-
console.info('[awaitStagingDeploys] POLL RATE', CONST.POLL_RATE);
12-
console.info('[awaitStagingDeploys] run()');
13-
console.info('[awaitStagingDeploys] getStringInput', getStringInput);
14-
console.info('[awaitStagingDeploys] GitHubUtils', GitHubUtils);
15-
console.info('[awaitStagingDeploys] promiseDoWhile', promiseDoWhile);
16-
1711
const tag = getStringInput('TAG', {required: false});
18-
console.info('[awaitStagingDeploys] run() tag', tag);
1912

2013
let currentStagingDeploys: CurrentStagingDeploys = [];
2114

22-
console.info('[awaitStagingDeploys] run() _.throttle', lodashThrottle);
23-
2415
const throttleFunc = () =>
2516
Promise.all([
2617
// These are active deploys
@@ -42,24 +33,20 @@ function run() {
4233
}),
4334
])
4435
.then((responses) => {
45-
console.info('[awaitStagingDeploys] listWorkflowRuns responses', responses);
4636
const workflowRuns = responses[0].data.workflow_runs;
4737
if (!tag && typeof responses[1] === 'object') {
4838
workflowRuns.push(...responses[1].data.workflow_runs);
4939
}
50-
console.info('[awaitStagingDeploys] workflowRuns', workflowRuns);
5140
return workflowRuns;
5241
})
5342
.then((workflowRuns) => (currentStagingDeploys = workflowRuns.filter((workflowRun) => workflowRun.status !== 'completed')))
5443
.then(() => {
55-
console.info('[awaitStagingDeploys] currentStagingDeploys', currentStagingDeploys);
5644
console.log(
5745
!currentStagingDeploys.length
5846
? 'No current staging deploys found'
5947
: `Found ${currentStagingDeploys.length} staging deploy${currentStagingDeploys.length > 1 ? 's' : ''} still running...`,
6048
);
6149
});
62-
console.info('[awaitStagingDeploys] run() throttleFunc', throttleFunc);
6350

6451
return promiseDoWhile(
6552
() => !!currentStagingDeploys.length,

.github/actions/javascript/awaitStagingDeploys/index.js

-16
Original file line numberDiff line numberDiff line change
@@ -12131,15 +12131,8 @@ const CONST_1 = __importDefault(__nccwpck_require__(9873));
1213112131
const GithubUtils_1 = __importDefault(__nccwpck_require__(9296));
1213212132
const promiseWhile_1 = __nccwpck_require__(9438);
1213312133
function run() {
12134-
console.info('[awaitStagingDeploys] POLL RATE', CONST_1.default.POLL_RATE);
12135-
console.info('[awaitStagingDeploys] run()');
12136-
console.info('[awaitStagingDeploys] getStringInput', ActionUtils_1.getStringInput);
12137-
console.info('[awaitStagingDeploys] GitHubUtils', GithubUtils_1.default);
12138-
console.info('[awaitStagingDeploys] promiseDoWhile', promiseWhile_1.promiseDoWhile);
1213912134
const tag = (0, ActionUtils_1.getStringInput)('TAG', { required: false });
12140-
console.info('[awaitStagingDeploys] run() tag', tag);
1214112135
let currentStagingDeploys = [];
12142-
console.info('[awaitStagingDeploys] run() _.throttle', throttle_1.default);
1214312136
const throttleFunc = () => Promise.all([
1214412137
// These are active deploys
1214512138
GithubUtils_1.default.octokit.actions.listWorkflowRuns({
@@ -12159,22 +12152,18 @@ function run() {
1215912152
}),
1216012153
])
1216112154
.then((responses) => {
12162-
console.info('[awaitStagingDeploys] listWorkflowRuns responses', responses);
1216312155
const workflowRuns = responses[0].data.workflow_runs;
1216412156
if (!tag && typeof responses[1] === 'object') {
1216512157
workflowRuns.push(...responses[1].data.workflow_runs);
1216612158
}
12167-
console.info('[awaitStagingDeploys] workflowRuns', workflowRuns);
1216812159
return workflowRuns;
1216912160
})
1217012161
.then((workflowRuns) => (currentStagingDeploys = workflowRuns.filter((workflowRun) => workflowRun.status !== 'completed')))
1217112162
.then(() => {
12172-
console.info('[awaitStagingDeploys] currentStagingDeploys', currentStagingDeploys);
1217312163
console.log(!currentStagingDeploys.length
1217412164
? 'No current staging deploys found'
1217512165
: `Found ${currentStagingDeploys.length} staging deploy${currentStagingDeploys.length > 1 ? 's' : ''} still running...`);
1217612166
});
12177-
console.info('[awaitStagingDeploys] run() throttleFunc', throttleFunc);
1217812167
return (0, promiseWhile_1.promiseDoWhile)(() => !!currentStagingDeploys.length, (0, throttle_1.default)(throttleFunc,
1217912168
// Poll every 60 seconds instead of every 10 seconds
1218012169
CONST_1.default.POLL_RATE * 6));
@@ -12730,15 +12719,13 @@ exports.promiseDoWhile = exports.promiseWhile = void 0;
1273012719
* Simulates a while loop where the condition is determined by the result of a Promise.
1273112720
*/
1273212721
function promiseWhile(condition, action) {
12733-
console.info('[promiseWhile] promiseWhile()');
1273412722
return new Promise((resolve, reject) => {
1273512723
const loop = function () {
1273612724
if (!condition()) {
1273712725
resolve();
1273812726
}
1273912727
else {
1274012728
const actionResult = action?.();
12741-
console.info('[promiseWhile] promiseWhile() actionResult', actionResult);
1274212729
if (!actionResult) {
1274312730
resolve();
1274412731
return;
@@ -12759,11 +12746,8 @@ exports.promiseWhile = promiseWhile;
1275912746
* Simulates a do-while loop where the condition is determined by the result of a Promise.
1276012747
*/
1276112748
function promiseDoWhile(condition, action) {
12762-
console.info('[promiseWhile] promiseDoWhile()');
1276312749
return new Promise((resolve, reject) => {
12764-
console.info('[promiseWhile] promiseDoWhile() condition', condition);
1276512750
const actionResult = action?.();
12766-
console.info('[promiseWhile] promiseDoWhile() actionResult', actionResult);
1276712751
if (!actionResult) {
1276812752
resolve();
1276912753
return;

.github/actions/javascript/bumpVersion/bumpVersion.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as core from '@actions/core';
22
import {exec as originalExec} from 'child_process';
33
import fs from 'fs';
4+
import type {PackageJson} from 'type-fest';
45
import {promisify} from 'util';
56
import {generateAndroidVersionCode, updateAndroidVersion, updateiOSVersion} from '@github/libs/nativeVersionUpdater';
67
import * as versionUpdater from '@github/libs/versionUpdater';
@@ -19,7 +20,7 @@ function updateNativeVersions(version: string) {
1920
.then(() => {
2021
console.log('Successfully updated Android!');
2122
})
22-
.catch((err) => {
23+
.catch((err: string | Error) => {
2324
console.error('Error updating Android');
2425
core.setFailed(err);
2526
});
@@ -47,8 +48,12 @@ if (!semanticVersionLevel || !Object.keys(versionUpdater.SEMANTIC_VERSION_LEVELS
4748
console.log(`Invalid input for 'SEMVER_LEVEL': ${semanticVersionLevel}`, `Defaulting to: ${semanticVersionLevel}`);
4849
}
4950

50-
const {version: previousVersion} = JSON.parse(fs.readFileSync('./package.json').toString());
51-
const newVersion = versionUpdater.incrementVersion(previousVersion, semanticVersionLevel);
51+
const {version: previousVersion}: PackageJson = JSON.parse(fs.readFileSync('./package.json').toString());
52+
if (!previousVersion) {
53+
core.setFailed('Error: Could not read package.json');
54+
}
55+
56+
const newVersion = versionUpdater.incrementVersion(previousVersion ?? '', semanticVersionLevel);
5257
console.log(`Previous version: ${previousVersion}`, `New version: ${newVersion}`);
5358

5459
updateNativeVersions(newVersion);

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -3478,7 +3478,10 @@ if (!semanticVersionLevel || !Object.keys(versionUpdater.SEMANTIC_VERSION_LEVELS
34783478
console.log(`Invalid input for 'SEMVER_LEVEL': ${semanticVersionLevel}`, `Defaulting to: ${semanticVersionLevel}`);
34793479
}
34803480
const { version: previousVersion } = JSON.parse(fs_1.default.readFileSync('./package.json').toString());
3481-
const newVersion = versionUpdater.incrementVersion(previousVersion, semanticVersionLevel);
3481+
if (!previousVersion) {
3482+
core.setFailed('Error: Could not read package.json');
3483+
}
3484+
const newVersion = versionUpdater.incrementVersion(previousVersion ?? '', semanticVersionLevel);
34823485
console.log(`Previous version: ${previousVersion}`, `New version: ${newVersion}`);
34833486
updateNativeVersions(newVersion);
34843487
console.log(`Setting npm version to ${newVersion}`);

.github/actions/javascript/checkDeployBlockers/checkDeployBlockers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const run = function (): Promise<void> {
6060
core.setOutput('HAS_DEPLOY_BLOCKERS', false);
6161
}
6262
})
63-
.catch((error) => {
63+
.catch((error: string | Error) => {
6464
console.error('A problem occurred while trying to communicate with the GitHub API', error);
6565
core.setFailed(error);
6666
});

.github/actions/javascript/getGraphiteString/getGraphiteString.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const run = () => {
2828

2929
// Extract timestamp, Graphite accepts timestamp in seconds
3030
if (current.metadata?.creationDate) {
31-
timestamp = Math.floor(new Date(current.metadata.creationDate).getTime() / 1000);
31+
timestamp = Math.floor(new Date(current.metadata.creationDate as string).getTime() / 1000);
3232
}
3333

3434
if (current.name && current.meanDuration && current.meanCount && timestamp) {
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import * as core from '@actions/core';
22
import {readFileSync} from 'fs';
3+
import type {PackageJson} from 'type-fest';
34
import * as versionUpdater from '@github/libs/versionUpdater';
45

56
const semverLevel = core.getInput('SEMVER_LEVEL', {required: true});
67
if (!semverLevel || !Object.values<string>(versionUpdater.SEMANTIC_VERSION_LEVELS).includes(semverLevel)) {
78
core.setFailed(`'Error: Invalid input for 'SEMVER_LEVEL': ${semverLevel}`);
89
}
910

10-
const {version: currentVersion} = JSON.parse(readFileSync('./package.json', 'utf8'));
11-
const previousVersion = versionUpdater.getPreviousVersion(currentVersion, semverLevel);
11+
const {version: currentVersion}: PackageJson = JSON.parse(readFileSync('./package.json', 'utf8'));
12+
if (!currentVersion) {
13+
core.setFailed('Error: Could not read package.json');
14+
}
15+
16+
const previousVersion = versionUpdater.getPreviousVersion(currentVersion ?? '', semverLevel);
1217
core.setOutput('PREVIOUS_VERSION', previousVersion);

.github/actions/javascript/getPreviousVersion/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -2728,7 +2728,10 @@ if (!semverLevel || !Object.values(versionUpdater.SEMANTIC_VERSION_LEVELS).inclu
27282728
core.setFailed(`'Error: Invalid input for 'SEMVER_LEVEL': ${semverLevel}`);
27292729
}
27302730
const { version: currentVersion } = JSON.parse((0, fs_1.readFileSync)('./package.json', 'utf8'));
2731-
const previousVersion = versionUpdater.getPreviousVersion(currentVersion, semverLevel);
2731+
if (!currentVersion) {
2732+
core.setFailed('Error: Could not read package.json');
2733+
}
2734+
const previousVersion = versionUpdater.getPreviousVersion(currentVersion ?? '', semverLevel);
27322735
core.setOutput('PREVIOUS_VERSION', previousVersion);
27332736

27342737

.github/actions/javascript/reviewerChecklist/reviewerChecklist.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function checkIssueForCompletedChecklist(numberOfChecklistItems: number) {
9090

9191
getNumberOfItemsFromReviewerChecklist()
9292
.then(checkIssueForCompletedChecklist)
93-
.catch((err) => {
93+
.catch((err: string | Error) => {
9494
console.error(err);
9595
core.setFailed(err);
9696
});

.github/libs/promiseWhile.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ import type {DebouncedFunc} from 'lodash';
44
* Simulates a while loop where the condition is determined by the result of a Promise.
55
*/
66
function promiseWhile(condition: () => boolean, action: (() => Promise<void>) | DebouncedFunc<() => Promise<void>> | undefined): Promise<void> {
7-
console.info('[promiseWhile] promiseWhile()');
8-
97
return new Promise((resolve, reject) => {
108
const loop = function () {
119
if (!condition()) {
1210
resolve();
1311
} else {
1412
const actionResult = action?.();
15-
console.info('[promiseWhile] promiseWhile() actionResult', actionResult);
1613

1714
if (!actionResult) {
1815
resolve();
@@ -35,12 +32,9 @@ function promiseWhile(condition: () => boolean, action: (() => Promise<void>) |
3532
* Simulates a do-while loop where the condition is determined by the result of a Promise.
3633
*/
3734
function promiseDoWhile(condition: () => boolean, action: (() => Promise<void>) | DebouncedFunc<() => Promise<void>> | undefined): Promise<void> {
38-
console.info('[promiseWhile] promiseDoWhile()');
39-
4035
return new Promise((resolve, reject) => {
41-
console.info('[promiseWhile] promiseDoWhile() condition', condition);
4236
const actionResult = action?.();
43-
console.info('[promiseWhile] promiseDoWhile() actionResult', actionResult);
37+
4438
if (!actionResult) {
4539
resolve();
4640
return;

.github/libs/sanitizeStringForJSONParse.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const replacer = (str: string): string =>
1616
* Solution partly taken from SO user Gabriel Rodríguez Flores 🙇
1717
* https://stackoverflow.com/questions/52789718/how-to-remove-special-characters-before-json-parse-while-file-reading
1818
*/
19-
const sanitizeStringForJSONParse = (inputString: string): string => {
19+
const sanitizeStringForJSONParse = (inputString: string | number | boolean | null | undefined): string => {
2020
if (typeof inputString !== 'string') {
2121
throw new TypeError('Input must me of type String');
2222
}

.github/scripts/detectRedirectCycle.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function detectCycle(): boolean {
5252

5353
fs.createReadStream(`${process.cwd()}/docs/redirects.csv`)
5454
.pipe(parser)
55-
.on('data', (row) => {
55+
.on('data', (row: [string, string]) => {
5656
// Create a directed graph of sourceURL -> targetURL
5757
addEdge(row[0], row[1]);
5858
})

.github/workflows/e2ePerformanceTests.yml

+4
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 == 'refs/heads/main' && format('{0}-{1}', github.ref, github.sha) || github.ref }}-e2e
20+
cancel-in-progress: true
21+
1822
jobs:
1923
buildBaseline:
2024
runs-on: ubuntu-latest-xl

.github/workflows/lint.yml

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

1010
concurrency:
11-
group: "${{ github.ref }}-lint"
11+
group: ${{ github.ref == 'refs/heads/main' && format('{0}-{1}', github.ref, github.sha) || github.ref }}-lint
1212
cancel-in-progress: true
1313

1414
jobs:

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
paths: ['**.js', '**.ts', '**.tsx', '**.sh', 'package.json', 'package-lock.json']
99

1010
concurrency:
11-
group: "${{ github.ref }}-jest"
11+
group: ${{ github.ref == 'refs/heads/main' && format('{0}-{1}', github.ref, github.sha) || github.ref }}-jest
1212
cancel-in-progress: true
1313

1414
jobs:

.github/workflows/typecheck.yml

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

10+
concurrency:
11+
group: ${{ github.ref == 'refs/heads/main' && format('{0}-{1}', github.ref, github.sha) || github.ref }}-typecheck
12+
cancel-in-progress: true
13+
1014
jobs:
1115
typecheck:
1216
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}

.storybook/preview.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import './fonts.css';
1616
Onyx.init({
1717
keys: ONYXKEYS,
1818
initialKeyStates: {
19-
[ONYXKEYS.NETWORK]: {isOffline: false},
19+
[ONYXKEYS.NETWORK]: {isOffline: false, isBackendReachable: true},
2020
},
2121
});
2222

__mocks__/@react-navigation/native/index.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import {useIsFocused as realUseIsFocused, useTheme as realUseTheme} from '@react
33
// We only want these mocked for storybook, not jest
44
const useIsFocused: typeof realUseIsFocused = process.env.NODE_ENV === 'test' ? realUseIsFocused : () => true;
55

6-
// @ts-expect-error as we're mocking this function
7-
const useTheme: typeof realUseTheme = process.env.NODE_ENV === 'test' ? realUseTheme : () => ({});
6+
const useTheme = process.env.NODE_ENV === 'test' ? realUseTheme : () => ({});
87

98
export * from '@react-navigation/core';
10-
export * from '@react-navigation/native';
119
export {useIsFocused, useTheme};

android/app/build.gradle

+12-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@ apply plugin: "com.android.application"
22
apply plugin: "org.jetbrains.kotlin.android"
33
apply plugin: "com.facebook.react"
44
apply plugin: "com.google.firebase.firebase-perf"
5+
apply plugin: "fullstory"
56
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
67

78
/**
89
* This is the configuration block to customize your React Native Android app.
910
* By default you don't need to apply any configuration, just uncomment the lines you need.
1011
*/
12+
13+
/* Fullstory settings */
14+
fullstory {
15+
org 'o-1WN56P-na1'
16+
enabledVariants 'all'
17+
logcatLevel 'debug'
18+
}
19+
1120
react {
1221
/* Folders */
1322
// The root of your project, i.e. where "package.json" lives. Default is '..'
@@ -98,8 +107,8 @@ android {
98107
minSdkVersion rootProject.ext.minSdkVersion
99108
targetSdkVersion rootProject.ext.targetSdkVersion
100109
multiDexEnabled rootProject.ext.multiDexEnabled
101-
versionCode 1001047301
102-
versionName "1.4.73-1"
110+
versionCode 1001047603
111+
versionName "1.4.76-3"
103112
// Supported language variants must be declared here to avoid from being removed during the compilation.
104113
// This also helps us to not include unnecessary language variants in the APK.
105114
resConfigs "en", "es"
@@ -162,7 +171,7 @@ android {
162171
signingConfig null
163172
// buildTypes take precedence over productFlavors when it comes to the signing configuration,
164173
// thus we need to manually set the signing config, so that the e2e uses the debug config again.
165-
// In other words, the signingConfig setting above will be ignored when we build the flavor in release mode.
174+
// In other words, the signingConfig setting above will be ignored when we build the flavor in release mode.
166175
productFlavors.all { flavor ->
167176
// All release builds should be signed with the release config ...
168177
flavor.signingConfig signingConfigs.release

0 commit comments

Comments
 (0)