Skip to content

Commit 6fc46c5

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/43599
2 parents aca4770 + 2026f62 commit 6fc46c5

File tree

277 files changed

+7361
-4089
lines changed

Some content is hidden

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

277 files changed

+7361
-4089
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ android/**/build/**
99
docs/vendor/**
1010
docs/assets/**
1111
web/gtm.js
12+
**/.expo/**

.eslintrc.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const path = require('path');
2+
13
const restrictedImportPaths = [
24
{
35
name: 'react-native',
@@ -96,7 +98,7 @@ module.exports = {
9698
plugins: ['@typescript-eslint', 'jsdoc', 'you-dont-need-lodash-underscore', 'react-native-a11y', 'react', 'testing-library'],
9799
parser: '@typescript-eslint/parser',
98100
parserOptions: {
99-
project: './tsconfig.json',
101+
project: path.resolve(__dirname, './tsconfig.json'),
100102
},
101103
env: {
102104
jest: true,
@@ -105,10 +107,9 @@ module.exports = {
105107
__DEV__: 'readonly',
106108
},
107109
rules: {
110+
// TypeScript specific rules
108111
'@typescript-eslint/no-unsafe-member-access': 'off',
109112
'@typescript-eslint/no-unsafe-assignment': 'off',
110-
111-
// TypeScript specific rules
112113
'@typescript-eslint/prefer-enum-initializers': 'error',
113114
'@typescript-eslint/no-var-requires': 'off',
114115
'@typescript-eslint/no-non-null-assertion': 'error',
@@ -215,6 +216,8 @@ module.exports = {
215216
// Other rules
216217
curly: 'error',
217218
'you-dont-need-lodash-underscore/throttle': 'off',
219+
// The suggested alternative (structuredClone) is not supported in Hermes:https://github.com/facebook/hermes/issues/684
220+
'you-dont-need-lodash-underscore/clone-deep': 'off',
218221
'prefer-regex-literals': 'off',
219222
'valid-jsdoc': 'off',
220223
'jsdoc/no-types': 'error',
@@ -257,6 +260,7 @@ module.exports = {
257260
// Remove once no JS files are left
258261
{
259262
files: ['*.js', '*.jsx'],
263+
extends: ['plugin:@typescript-eslint/disable-type-checked'],
260264
rules: {
261265
'@typescript-eslint/prefer-nullish-coalescing': 'off',
262266
'@typescript-eslint/no-unsafe-return': 'off',

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

+43-17
Original file line numberDiff line numberDiff line change
@@ -11710,7 +11710,7 @@ FetchError.prototype.name = 'FetchError';
1171011710

1171111711
let convert;
1171211712
try {
11713-
convert = (__nccwpck_require__(2877).convert);
11713+
convert = (__nccwpck_require__(3975).convert);
1171411714
} catch (e) {}
1171511715

1171611716
const INTERNALS = Symbol('Body internals');
@@ -17073,13 +17073,11 @@ const CONST_1 = __importDefault(__nccwpck_require__(9873));
1707317073
class GithubUtils {
1707417074
static internalOctokit;
1707517075
/**
17076-
* Initialize internal octokit
17077-
*
17078-
* @private
17076+
* Initialize internal octokit.
17077+
* NOTE: When using GithubUtils in CI, you don't need to call this manually.
1707917078
*/
17080-
static initOctokit() {
17079+
static initOctokitWithToken(token) {
1708117080
const Octokit = utils_1.GitHub.plugin(plugin_throttling_1.throttling, plugin_paginate_rest_1.paginateRest);
17082-
const token = core.getInput('GITHUB_TOKEN', { required: true });
1708317081
// Save a copy of octokit used in this class
1708417082
this.internalOctokit = new Octokit((0, utils_1.getOctokitOptions)(token, {
1708517083
throttle: {
@@ -17099,6 +17097,15 @@ class GithubUtils {
1709917097
},
1710017098
}));
1710117099
}
17100+
/**
17101+
* Default initialize method assuming running in CI, getting the token from an input.
17102+
*
17103+
* @private
17104+
*/
17105+
static initOctokit() {
17106+
const token = core.getInput('GITHUB_TOKEN', { required: true });
17107+
this.initOctokitWithToken(token);
17108+
}
1710217109
/**
1710317110
* Either give an existing instance of Octokit rest or create a new one
1710417111
*
@@ -17454,12 +17461,31 @@ class GithubUtils {
1745417461
.then((events) => events.filter((event) => event.event === 'closed'))
1745517462
.then((closedEvents) => closedEvents.at(-1)?.actor?.login ?? '');
1745617463
}
17457-
static getArtifactByName(artefactName) {
17458-
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
17464+
/**
17465+
* Returns a single artifact by name. If none is found, it returns undefined.
17466+
*/
17467+
static getArtifactByName(artifactName) {
17468+
return this.octokit.actions
17469+
.listArtifactsForRepo({
1745917470
owner: CONST_1.default.GITHUB_OWNER,
1746017471
repo: CONST_1.default.APP_REPO,
17461-
per_page: 100,
17462-
}).then((artifacts) => artifacts.find((artifact) => artifact.name === artefactName));
17472+
per_page: 1,
17473+
name: artifactName,
17474+
})
17475+
.then((response) => response.data.artifacts[0]);
17476+
}
17477+
/**
17478+
* Given an artifact ID, returns the download URL to a zip file containing the artifact.
17479+
*/
17480+
static getArtifactDownloadURL(artifactId) {
17481+
return this.octokit.actions
17482+
.downloadArtifact({
17483+
owner: CONST_1.default.GITHUB_OWNER,
17484+
repo: CONST_1.default.APP_REPO,
17485+
artifact_id: artifactId,
17486+
archive_format: 'zip',
17487+
})
17488+
.then((response) => response.url);
1746317489
}
1746417490
}
1746517491
exports["default"] = GithubUtils;
@@ -17531,27 +17557,27 @@ exports["default"] = arrayDifference;
1753117557

1753217558
/***/ }),
1753317559

17534-
/***/ 2877:
17560+
/***/ 9491:
1753517561
/***/ ((module) => {
1753617562

17537-
module.exports = eval("require")("encoding");
17538-
17563+
"use strict";
17564+
module.exports = require("assert");
1753917565

1754017566
/***/ }),
1754117567

17542-
/***/ 9491:
17568+
/***/ 6113:
1754317569
/***/ ((module) => {
1754417570

1754517571
"use strict";
17546-
module.exports = require("assert");
17572+
module.exports = require("crypto");
1754717573

1754817574
/***/ }),
1754917575

17550-
/***/ 6113:
17576+
/***/ 3975:
1755117577
/***/ ((module) => {
1755217578

1755317579
"use strict";
17554-
module.exports = require("crypto");
17580+
module.exports = require("encoding");
1755517581

1755617582
/***/ }),
1755717583

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

+43-17
Original file line numberDiff line numberDiff line change
@@ -7373,7 +7373,7 @@ FetchError.prototype.name = 'FetchError';
73737373

73747374
let convert;
73757375
try {
7376-
convert = (__nccwpck_require__(2877).convert);
7376+
convert = (__nccwpck_require__(3975).convert);
73777377
} catch (e) {}
73787378

73797379
const INTERNALS = Symbol('Body internals');
@@ -12314,13 +12314,11 @@ const CONST_1 = __importDefault(__nccwpck_require__(9873));
1231412314
class GithubUtils {
1231512315
static internalOctokit;
1231612316
/**
12317-
* Initialize internal octokit
12318-
*
12319-
* @private
12317+
* Initialize internal octokit.
12318+
* NOTE: When using GithubUtils in CI, you don't need to call this manually.
1232012319
*/
12321-
static initOctokit() {
12320+
static initOctokitWithToken(token) {
1232212321
const Octokit = utils_1.GitHub.plugin(plugin_throttling_1.throttling, plugin_paginate_rest_1.paginateRest);
12323-
const token = core.getInput('GITHUB_TOKEN', { required: true });
1232412322
// Save a copy of octokit used in this class
1232512323
this.internalOctokit = new Octokit((0, utils_1.getOctokitOptions)(token, {
1232612324
throttle: {
@@ -12340,6 +12338,15 @@ class GithubUtils {
1234012338
},
1234112339
}));
1234212340
}
12341+
/**
12342+
* Default initialize method assuming running in CI, getting the token from an input.
12343+
*
12344+
* @private
12345+
*/
12346+
static initOctokit() {
12347+
const token = core.getInput('GITHUB_TOKEN', { required: true });
12348+
this.initOctokitWithToken(token);
12349+
}
1234312350
/**
1234412351
* Either give an existing instance of Octokit rest or create a new one
1234512352
*
@@ -12695,12 +12702,31 @@ class GithubUtils {
1269512702
.then((events) => events.filter((event) => event.event === 'closed'))
1269612703
.then((closedEvents) => closedEvents.at(-1)?.actor?.login ?? '');
1269712704
}
12698-
static getArtifactByName(artefactName) {
12699-
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
12705+
/**
12706+
* Returns a single artifact by name. If none is found, it returns undefined.
12707+
*/
12708+
static getArtifactByName(artifactName) {
12709+
return this.octokit.actions
12710+
.listArtifactsForRepo({
1270012711
owner: CONST_1.default.GITHUB_OWNER,
1270112712
repo: CONST_1.default.APP_REPO,
12702-
per_page: 100,
12703-
}).then((artifacts) => artifacts.find((artifact) => artifact.name === artefactName));
12713+
per_page: 1,
12714+
name: artifactName,
12715+
})
12716+
.then((response) => response.data.artifacts[0]);
12717+
}
12718+
/**
12719+
* Given an artifact ID, returns the download URL to a zip file containing the artifact.
12720+
*/
12721+
static getArtifactDownloadURL(artifactId) {
12722+
return this.octokit.actions
12723+
.downloadArtifact({
12724+
owner: CONST_1.default.GITHUB_OWNER,
12725+
repo: CONST_1.default.APP_REPO,
12726+
artifact_id: artifactId,
12727+
archive_format: 'zip',
12728+
})
12729+
.then((response) => response.url);
1270412730
}
1270512731
}
1270612732
exports["default"] = GithubUtils;
@@ -12796,27 +12822,27 @@ exports["default"] = arrayDifference;
1279612822

1279712823
/***/ }),
1279812824

12799-
/***/ 2877:
12825+
/***/ 9491:
1280012826
/***/ ((module) => {
1280112827

12802-
module.exports = eval("require")("encoding");
12803-
12828+
"use strict";
12829+
module.exports = require("assert");
1280412830

1280512831
/***/ }),
1280612832

12807-
/***/ 9491:
12833+
/***/ 6113:
1280812834
/***/ ((module) => {
1280912835

1281012836
"use strict";
12811-
module.exports = require("assert");
12837+
module.exports = require("crypto");
1281212838

1281312839
/***/ }),
1281412840

12815-
/***/ 6113:
12841+
/***/ 3975:
1281612842
/***/ ((module) => {
1281712843

1281812844
"use strict";
12819-
module.exports = require("crypto");
12845+
module.exports = require("encoding");
1282012846

1282112847
/***/ }),
1282212848

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type {PackageJson} from 'type-fest';
55
import {promisify} from 'util';
66
import {generateAndroidVersionCode, updateAndroidVersion, updateiOSVersion} from '@github/libs/nativeVersionUpdater';
77
import * as versionUpdater from '@github/libs/versionUpdater';
8+
import type {SemverLevel} from '@github/libs/versionUpdater';
89

910
const exec = promisify(originalExec);
1011

@@ -43,7 +44,7 @@ function updateNativeVersions(version: string) {
4344
}
4445

4546
let semanticVersionLevel = core.getInput('SEMVER_LEVEL', {required: true});
46-
if (!semanticVersionLevel || !Object.keys(versionUpdater.SEMANTIC_VERSION_LEVELS).includes(semanticVersionLevel)) {
47+
if (!semanticVersionLevel || !versionUpdater.isValidSemverLevel(semanticVersionLevel)) {
4748
semanticVersionLevel = versionUpdater.SEMANTIC_VERSION_LEVELS.BUILD;
4849
console.log(`Invalid input for 'SEMVER_LEVEL': ${semanticVersionLevel}`, `Defaulting to: ${semanticVersionLevel}`);
4950
}
@@ -53,7 +54,7 @@ if (!previousVersion) {
5354
core.setFailed('Error: Could not read package.json');
5455
}
5556

56-
const newVersion = versionUpdater.incrementVersion(previousVersion ?? '', semanticVersionLevel);
57+
const newVersion = versionUpdater.incrementVersion(previousVersion ?? '', semanticVersionLevel as SemverLevel);
5758
console.log(`Previous version: ${previousVersion}`, `New version: ${newVersion}`);
5859

5960
updateNativeVersions(newVersion);

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

+6-2
Original file line numberDiff line numberDiff line change
@@ -3473,7 +3473,7 @@ function updateNativeVersions(version) {
34733473
}
34743474
}
34753475
let semanticVersionLevel = core.getInput('SEMVER_LEVEL', { required: true });
3476-
if (!semanticVersionLevel || !Object.keys(versionUpdater.SEMANTIC_VERSION_LEVELS).includes(semanticVersionLevel)) {
3476+
if (!semanticVersionLevel || !versionUpdater.isValidSemverLevel(semanticVersionLevel)) {
34773477
semanticVersionLevel = versionUpdater.SEMANTIC_VERSION_LEVELS.BUILD;
34783478
console.log(`Invalid input for 'SEMVER_LEVEL': ${semanticVersionLevel}`, `Defaulting to: ${semanticVersionLevel}`);
34793479
}
@@ -3589,7 +3589,7 @@ exports.updateiOSVersion = updateiOSVersion;
35893589
"use strict";
35903590

35913591
Object.defineProperty(exports, "__esModule", ({ value: true }));
3592-
exports.getPreviousVersion = exports.incrementPatch = exports.incrementMinor = exports.SEMANTIC_VERSION_LEVELS = exports.MAX_INCREMENTS = exports.incrementVersion = exports.getVersionStringFromNumber = exports.getVersionNumberFromString = void 0;
3592+
exports.getPreviousVersion = exports.incrementPatch = exports.incrementMinor = exports.SEMANTIC_VERSION_LEVELS = exports.MAX_INCREMENTS = exports.incrementVersion = exports.getVersionStringFromNumber = exports.getVersionNumberFromString = exports.isValidSemverLevel = void 0;
35933593
const SEMANTIC_VERSION_LEVELS = {
35943594
MAJOR: 'MAJOR',
35953595
MINOR: 'MINOR',
@@ -3599,6 +3599,10 @@ const SEMANTIC_VERSION_LEVELS = {
35993599
exports.SEMANTIC_VERSION_LEVELS = SEMANTIC_VERSION_LEVELS;
36003600
const MAX_INCREMENTS = 99;
36013601
exports.MAX_INCREMENTS = MAX_INCREMENTS;
3602+
function isValidSemverLevel(str) {
3603+
return Object.keys(SEMANTIC_VERSION_LEVELS).includes(str);
3604+
}
3605+
exports.isValidSemverLevel = isValidSemverLevel;
36023606
/**
36033607
* Transforms a versions string into a number
36043608
*/

0 commit comments

Comments
 (0)