Skip to content

Commit 92c5860

Browse files
committed
Merge branch 'main' into issue-61052
2 parents 14a38a4 + a003c86 commit 92c5860

646 files changed

Lines changed: 17723 additions & 8248 deletions

File tree

Some content is hidden

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

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ module.exports = {
230230
'rulesdir/no-multiple-onyx-in-file': 'off',
231231
'rulesdir/prefer-underscore-method': 'off',
232232
'rulesdir/prefer-import-module-contents': 'off',
233+
'rulesdir/no-beta-handler': 'error',
233234

234235
// React and React Native specific rules
235236
'react-native-a11y/has-accessibility-hint': ['off'],
@@ -276,6 +277,14 @@ module.exports = {
276277
property: 'isHybridApp',
277278
message: 'Use CONFIG.IS_HYBRID_APP instead.',
278279
},
280+
// Prevent direct use of HybridAppModule.closeReactNativeApp().
281+
// Instead, use the `closeReactNativeApp` action from `@userActions/HybridApp`,
282+
// which correctly updates `hybridApp.closingReactNativeApp` when closing NewDot
283+
{
284+
object: 'HybridAppModule',
285+
property: 'closeReactNativeApp',
286+
message: 'Use `closeReactNativeApp` from `@userActions/HybridApp` instead.',
287+
},
279288
],
280289
'no-restricted-imports': [
281290
'error',

.github/.eslintrc.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ module.exports = {
77
'no-await-in-loop': 'off',
88
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
99
'no-continue': 'off',
10-
'no-restricted-imports': 'off',
10+
'no-restricted-imports': [
11+
'error',
12+
{
13+
patterns: [
14+
{
15+
group: ['@src/**'],
16+
message: 'Do not import files from src/ directory as they can break the GH Actions build script.',
17+
},
18+
],
19+
},
20+
],
1121
},
1222
};

.github/actions/javascript/authorChecklist/index.js

Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15545,8 +15545,8 @@ exports["default"] = newComponentCategory;
1554515545
Object.defineProperty(exports, "__esModule", ({ value: true }));
1554615546
const GITHUB_BASE_URL_REGEX = new RegExp('https?://(?:github\\.com|api\\.github\\.com)');
1554715547
const GIT_CONST = {
15548-
GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER,
15549-
APP_REPO: process.env.GITHUB_REPOSITORY.split('/').at(1) ?? '',
15548+
GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER ?? 'Expensify',
15549+
APP_REPO: (process.env.GITHUB_REPOSITORY ?? 'Expensify/App').split('/').at(1) ?? '',
1555015550
MOBILE_EXPENSIFY_REPO: 'Mobile-Expensify',
1555115551
};
1555215552
const CONST = {
@@ -15622,9 +15622,9 @@ const utils_1 = __nccwpck_require__(3030);
1562215622
const plugin_paginate_rest_1 = __nccwpck_require__(4193);
1562315623
const plugin_throttling_1 = __nccwpck_require__(9968);
1562415624
const request_error_1 = __nccwpck_require__(537);
15625-
const EmptyObject_1 = __nccwpck_require__(8227);
15626-
const arrayDifference_1 = __importDefault(__nccwpck_require__(7034));
15625+
const arrayDifference_1 = __importDefault(__nccwpck_require__(7532));
1562715626
const CONST_1 = __importDefault(__nccwpck_require__(9873));
15627+
const isEmptyObject_1 = __nccwpck_require__(6497);
1562815628
class GithubUtils {
1562915629
static internalOctokit;
1563015630
/**
@@ -15815,7 +15815,7 @@ class GithubUtils {
1581515815
static generateStagingDeployCashBodyAndAssignees(tag, PRList, verifiedPRList = [], deployBlockers = [], resolvedDeployBlockers = [], resolvedInternalQAPRs = [], isFirebaseChecked = false, isGHStatusChecked = false) {
1581615816
return this.fetchAllPullRequests(PRList.map((pr) => this.getPullRequestNumberFromURL(pr)))
1581715817
.then((data) => {
15818-
const internalQAPRs = Array.isArray(data) ? data.filter((pr) => !(0, EmptyObject_1.isEmptyObject)(pr.labels.find((item) => item.name === CONST_1.default.LABELS.INTERNAL_QA))) : [];
15818+
const internalQAPRs = Array.isArray(data) ? data.filter((pr) => !(0, isEmptyObject_1.isEmptyObject)(pr.labels.find((item) => item.name === CONST_1.default.LABELS.INTERNAL_QA))) : [];
1581915819
return Promise.all(internalQAPRs.map((pr) => this.getPullRequestMergerLogin(pr.number).then((mergerLogin) => ({ url: pr.html_url, mergerLogin })))).then((results) => {
1582015820
// The format of this map is following:
1582115821
// {
@@ -15845,7 +15845,7 @@ class GithubUtils {
1584515845
issueBody += '\r\n\r\n';
1584615846
}
1584715847
// Internal QA PR list
15848-
if (!(0, EmptyObject_1.isEmptyObject)(internalQAPRMap)) {
15848+
if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) {
1584915849
console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
1585015850
issueBody += '**Internal QA:**\r\n';
1585115851
Object.keys(internalQAPRMap).forEach((URL) => {
@@ -16045,6 +16045,24 @@ class GithubUtils {
1604516045
})
1604616046
.then((response) => response.url);
1604716047
}
16048+
/**
16049+
* Get the contents of a file from the API at a given ref as a string.
16050+
*/
16051+
static async getFileContents(path, ref = 'main') {
16052+
const { data } = await this.octokit.repos.getContent({
16053+
owner: CONST_1.default.GITHUB_OWNER,
16054+
repo: CONST_1.default.APP_REPO,
16055+
path,
16056+
ref,
16057+
});
16058+
if (Array.isArray(data)) {
16059+
throw new Error(`Provided path ${path} refers to a directory, not a file`);
16060+
}
16061+
if (!('content' in data)) {
16062+
throw new Error(`Provided path ${path} is invalid`);
16063+
}
16064+
return Buffer.from(data.content, 'base64').toString('utf8');
16065+
}
1604816066
/**
1604916067
* Get commits between two tags via the GitHub API
1605016068
*/
@@ -16109,38 +16127,25 @@ exports["default"] = GithubUtils;
1610916127

1611016128
/***/ }),
1611116129

16112-
/***/ 8534:
16130+
/***/ 7532:
1611316131
/***/ ((__unused_webpack_module, exports) => {
1611416132

1611516133
"use strict";
1611616134

1611716135
Object.defineProperty(exports, "__esModule", ({ value: true }));
1611816136
/**
16119-
* Like _.some but for promises. It short-circuts after a promise fulfills with a value that passes the test implemented by provided function.
16120-
* It does not wait for the other promises to complete once it finds one.
16121-
* If no promise passes the provided test, it rejects.
16137+
* This function is an equivalent of _.difference, it takes two arrays and returns the difference between them.
16138+
* It returns an array of items that are in the first array but not in the second array.
1612216139
*/
16123-
function promiseSome(promises, callbackFn) {
16124-
return new Promise((resolve, reject) => {
16125-
for (const p of promises) {
16126-
Promise.resolve(p)
16127-
.then((res) => {
16128-
if (!callbackFn(res)) {
16129-
return;
16130-
}
16131-
resolve(true);
16132-
})
16133-
.catch(() => { });
16134-
}
16135-
Promise.allSettled(promises).then(() => reject());
16136-
});
16140+
function arrayDifference(array1, array2) {
16141+
return [array1, array2].reduce((a, b) => a.filter((c) => !b.includes(c)));
1613716142
}
16138-
exports["default"] = promiseSome;
16143+
exports["default"] = arrayDifference;
1613916144

1614016145

1614116146
/***/ }),
1614216147

16143-
/***/ 8227:
16148+
/***/ 6497:
1614416149
/***/ ((__unused_webpack_module, exports) => {
1614516150

1614616151
"use strict";
@@ -16155,20 +16160,33 @@ exports.isEmptyObject = isEmptyObject;
1615516160

1615616161
/***/ }),
1615716162

16158-
/***/ 7034:
16163+
/***/ 8534:
1615916164
/***/ ((__unused_webpack_module, exports) => {
1616016165

1616116166
"use strict";
1616216167

1616316168
Object.defineProperty(exports, "__esModule", ({ value: true }));
1616416169
/**
16165-
* This function is an equivalent of _.difference, it takes two arrays and returns the difference between them.
16166-
* It returns an array of items that are in the first array but not in the second array.
16170+
* Like _.some but for promises. It short-circuts after a promise fulfills with a value that passes the test implemented by provided function.
16171+
* It does not wait for the other promises to complete once it finds one.
16172+
* If no promise passes the provided test, it rejects.
1616716173
*/
16168-
function arrayDifference(array1, array2) {
16169-
return [array1, array2].reduce((a, b) => a.filter((c) => !b.includes(c)));
16174+
function promiseSome(promises, callbackFn) {
16175+
return new Promise((resolve, reject) => {
16176+
for (const p of promises) {
16177+
Promise.resolve(p)
16178+
.then((res) => {
16179+
if (!callbackFn(res)) {
16180+
return;
16181+
}
16182+
resolve(true);
16183+
})
16184+
.catch(() => { });
16185+
}
16186+
Promise.allSettled(promises).then(() => reject());
16187+
});
1617016188
}
16171-
exports["default"] = arrayDifference;
16189+
exports["default"] = promiseSome;
1617216190

1617316191

1617416192
/***/ }),

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

Lines changed: 57 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12319,8 +12319,8 @@ exports.getStringInput = getStringInput;
1231912319
Object.defineProperty(exports, "__esModule", ({ value: true }));
1232012320
const GITHUB_BASE_URL_REGEX = new RegExp('https?://(?:github\\.com|api\\.github\\.com)');
1232112321
const GIT_CONST = {
12322-
GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER,
12323-
APP_REPO: process.env.GITHUB_REPOSITORY.split('/').at(1) ?? '',
12322+
GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER ?? 'Expensify',
12323+
APP_REPO: (process.env.GITHUB_REPOSITORY ?? 'Expensify/App').split('/').at(1) ?? '',
1232412324
MOBILE_EXPENSIFY_REPO: 'Mobile-Expensify',
1232512325
};
1232612326
const CONST = {
@@ -12396,9 +12396,9 @@ const utils_1 = __nccwpck_require__(3030);
1239612396
const plugin_paginate_rest_1 = __nccwpck_require__(4193);
1239712397
const plugin_throttling_1 = __nccwpck_require__(9968);
1239812398
const request_error_1 = __nccwpck_require__(537);
12399-
const EmptyObject_1 = __nccwpck_require__(8227);
12400-
const arrayDifference_1 = __importDefault(__nccwpck_require__(7034));
12399+
const arrayDifference_1 = __importDefault(__nccwpck_require__(7532));
1240112400
const CONST_1 = __importDefault(__nccwpck_require__(9873));
12401+
const isEmptyObject_1 = __nccwpck_require__(6497);
1240212402
class GithubUtils {
1240312403
static internalOctokit;
1240412404
/**
@@ -12589,7 +12589,7 @@ class GithubUtils {
1258912589
static generateStagingDeployCashBodyAndAssignees(tag, PRList, verifiedPRList = [], deployBlockers = [], resolvedDeployBlockers = [], resolvedInternalQAPRs = [], isFirebaseChecked = false, isGHStatusChecked = false) {
1259012590
return this.fetchAllPullRequests(PRList.map((pr) => this.getPullRequestNumberFromURL(pr)))
1259112591
.then((data) => {
12592-
const internalQAPRs = Array.isArray(data) ? data.filter((pr) => !(0, EmptyObject_1.isEmptyObject)(pr.labels.find((item) => item.name === CONST_1.default.LABELS.INTERNAL_QA))) : [];
12592+
const internalQAPRs = Array.isArray(data) ? data.filter((pr) => !(0, isEmptyObject_1.isEmptyObject)(pr.labels.find((item) => item.name === CONST_1.default.LABELS.INTERNAL_QA))) : [];
1259312593
return Promise.all(internalQAPRs.map((pr) => this.getPullRequestMergerLogin(pr.number).then((mergerLogin) => ({ url: pr.html_url, mergerLogin })))).then((results) => {
1259412594
// The format of this map is following:
1259512595
// {
@@ -12619,7 +12619,7 @@ class GithubUtils {
1261912619
issueBody += '\r\n\r\n';
1262012620
}
1262112621
// Internal QA PR list
12622-
if (!(0, EmptyObject_1.isEmptyObject)(internalQAPRMap)) {
12622+
if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) {
1262312623
console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
1262412624
issueBody += '**Internal QA:**\r\n';
1262512625
Object.keys(internalQAPRMap).forEach((URL) => {
@@ -12819,6 +12819,24 @@ class GithubUtils {
1281912819
})
1282012820
.then((response) => response.url);
1282112821
}
12822+
/**
12823+
* Get the contents of a file from the API at a given ref as a string.
12824+
*/
12825+
static async getFileContents(path, ref = 'main') {
12826+
const { data } = await this.octokit.repos.getContent({
12827+
owner: CONST_1.default.GITHUB_OWNER,
12828+
repo: CONST_1.default.APP_REPO,
12829+
path,
12830+
ref,
12831+
});
12832+
if (Array.isArray(data)) {
12833+
throw new Error(`Provided path ${path} refers to a directory, not a file`);
12834+
}
12835+
if (!('content' in data)) {
12836+
throw new Error(`Provided path ${path} is invalid`);
12837+
}
12838+
return Buffer.from(data.content, 'base64').toString('utf8');
12839+
}
1282212840
/**
1282312841
* Get commits between two tags via the GitHub API
1282412842
*/
@@ -12881,6 +12899,39 @@ class GithubUtils {
1288112899
exports["default"] = GithubUtils;
1288212900

1288312901

12902+
/***/ }),
12903+
12904+
/***/ 7532:
12905+
/***/ ((__unused_webpack_module, exports) => {
12906+
12907+
"use strict";
12908+
12909+
Object.defineProperty(exports, "__esModule", ({ value: true }));
12910+
/**
12911+
* This function is an equivalent of _.difference, it takes two arrays and returns the difference between them.
12912+
* It returns an array of items that are in the first array but not in the second array.
12913+
*/
12914+
function arrayDifference(array1, array2) {
12915+
return [array1, array2].reduce((a, b) => a.filter((c) => !b.includes(c)));
12916+
}
12917+
exports["default"] = arrayDifference;
12918+
12919+
12920+
/***/ }),
12921+
12922+
/***/ 6497:
12923+
/***/ ((__unused_webpack_module, exports) => {
12924+
12925+
"use strict";
12926+
12927+
Object.defineProperty(exports, "__esModule", ({ value: true }));
12928+
exports.isEmptyObject = void 0;
12929+
function isEmptyObject(obj) {
12930+
return Object.keys(obj ?? {}).length === 0;
12931+
}
12932+
exports.isEmptyObject = isEmptyObject;
12933+
12934+
1288412935
/***/ }),
1288512936

1288612937
/***/ 9438:
@@ -12936,39 +12987,6 @@ function promiseDoWhile(condition, action) {
1293612987
exports.promiseDoWhile = promiseDoWhile;
1293712988

1293812989

12939-
/***/ }),
12940-
12941-
/***/ 8227:
12942-
/***/ ((__unused_webpack_module, exports) => {
12943-
12944-
"use strict";
12945-
12946-
Object.defineProperty(exports, "__esModule", ({ value: true }));
12947-
exports.isEmptyObject = void 0;
12948-
function isEmptyObject(obj) {
12949-
return Object.keys(obj ?? {}).length === 0;
12950-
}
12951-
exports.isEmptyObject = isEmptyObject;
12952-
12953-
12954-
/***/ }),
12955-
12956-
/***/ 7034:
12957-
/***/ ((__unused_webpack_module, exports) => {
12958-
12959-
"use strict";
12960-
12961-
Object.defineProperty(exports, "__esModule", ({ value: true }));
12962-
/**
12963-
* This function is an equivalent of _.difference, it takes two arrays and returns the difference between them.
12964-
* It returns an array of items that are in the first array but not in the second array.
12965-
*/
12966-
function arrayDifference(array1, array2) {
12967-
return [array1, array2].reduce((a, b) => a.filter((c) => !b.includes(c)));
12968-
}
12969-
exports["default"] = arrayDifference;
12970-
12971-
1297212990
/***/ }),
1297312991

1297412992
/***/ 9491:

0 commit comments

Comments
 (0)