Skip to content

Commit

Permalink
Merge branch 'main' into traveldot
Browse files Browse the repository at this point in the history
  • Loading branch information
rushatgabhane authored Jun 23, 2024
2 parents c1c69f7 + 0176052 commit beb9744
Show file tree
Hide file tree
Showing 199 changed files with 4,627 additions and 3,395 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ android/**/build/**
docs/vendor/**
docs/assets/**
web/gtm.js
**/.expo/**
10 changes: 7 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const path = require('path');

const restrictedImportPaths = [
{
name: 'react-native',
Expand Down Expand Up @@ -96,7 +98,7 @@ module.exports = {
plugins: ['@typescript-eslint', 'jsdoc', 'you-dont-need-lodash-underscore', 'react-native-a11y', 'react', 'testing-library'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
project: path.resolve(__dirname, './tsconfig.json'),
},
env: {
jest: true,
Expand All @@ -105,10 +107,9 @@ module.exports = {
__DEV__: 'readonly',
},
rules: {
// TypeScript specific rules
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',

// TypeScript specific rules
'@typescript-eslint/prefer-enum-initializers': 'error',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-non-null-assertion': 'error',
Expand Down Expand Up @@ -215,6 +216,8 @@ module.exports = {
// Other rules
curly: 'error',
'you-dont-need-lodash-underscore/throttle': 'off',
// The suggested alternative (structuredClone) is not supported in Hermes:https://github.com/facebook/hermes/issues/684
'you-dont-need-lodash-underscore/clone-deep': 'off',
'prefer-regex-literals': 'off',
'valid-jsdoc': 'off',
'jsdoc/no-types': 'error',
Expand Down Expand Up @@ -257,6 +260,7 @@ module.exports = {
// Remove once no JS files are left
{
files: ['*.js', '*.jsx'],
extends: ['plugin:@typescript-eslint/disable-type-checked'],
rules: {
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
Expand Down
16 changes: 8 additions & 8 deletions .github/actions/javascript/authorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11710,7 +11710,7 @@ FetchError.prototype.name = 'FetchError';

let convert;
try {
convert = (__nccwpck_require__(2877).convert);
convert = (__nccwpck_require__(3975).convert);
} catch (e) {}

const INTERNALS = Symbol('Body internals');
Expand Down Expand Up @@ -17557,27 +17557,27 @@ exports["default"] = arrayDifference;

/***/ }),

/***/ 2877:
/***/ 9491:
/***/ ((module) => {

module.exports = eval("require")("encoding");

"use strict";
module.exports = require("assert");

/***/ }),

/***/ 9491:
/***/ 6113:
/***/ ((module) => {

"use strict";
module.exports = require("assert");
module.exports = require("crypto");

/***/ }),

/***/ 6113:
/***/ 3975:
/***/ ((module) => {

"use strict";
module.exports = require("crypto");
module.exports = require("encoding");

/***/ }),

Expand Down
16 changes: 8 additions & 8 deletions .github/actions/javascript/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7373,7 +7373,7 @@ FetchError.prototype.name = 'FetchError';

let convert;
try {
convert = (__nccwpck_require__(2877).convert);
convert = (__nccwpck_require__(3975).convert);
} catch (e) {}

const INTERNALS = Symbol('Body internals');
Expand Down Expand Up @@ -12822,27 +12822,27 @@ exports["default"] = arrayDifference;

/***/ }),

/***/ 2877:
/***/ 9491:
/***/ ((module) => {

module.exports = eval("require")("encoding");

"use strict";
module.exports = require("assert");

/***/ }),

/***/ 9491:
/***/ 6113:
/***/ ((module) => {

"use strict";
module.exports = require("assert");
module.exports = require("crypto");

/***/ }),

/***/ 6113:
/***/ 3975:
/***/ ((module) => {

"use strict";
module.exports = require("crypto");
module.exports = require("encoding");

/***/ }),

Expand Down
5 changes: 3 additions & 2 deletions .github/actions/javascript/bumpVersion/bumpVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type {PackageJson} from 'type-fest';
import {promisify} from 'util';
import {generateAndroidVersionCode, updateAndroidVersion, updateiOSVersion} from '@github/libs/nativeVersionUpdater';
import * as versionUpdater from '@github/libs/versionUpdater';
import type {SemverLevel} from '@github/libs/versionUpdater';

const exec = promisify(originalExec);

Expand Down Expand Up @@ -43,7 +44,7 @@ function updateNativeVersions(version: string) {
}

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

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

updateNativeVersions(newVersion);
Expand Down
8 changes: 6 additions & 2 deletions .github/actions/javascript/bumpVersion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3473,7 +3473,7 @@ function updateNativeVersions(version) {
}
}
let semanticVersionLevel = core.getInput('SEMVER_LEVEL', { required: true });
if (!semanticVersionLevel || !Object.keys(versionUpdater.SEMANTIC_VERSION_LEVELS).includes(semanticVersionLevel)) {
if (!semanticVersionLevel || !versionUpdater.isValidSemverLevel(semanticVersionLevel)) {
semanticVersionLevel = versionUpdater.SEMANTIC_VERSION_LEVELS.BUILD;
console.log(`Invalid input for 'SEMVER_LEVEL': ${semanticVersionLevel}`, `Defaulting to: ${semanticVersionLevel}`);
}
Expand Down Expand Up @@ -3589,7 +3589,7 @@ exports.updateiOSVersion = updateiOSVersion;
"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getPreviousVersion = exports.incrementPatch = exports.incrementMinor = exports.SEMANTIC_VERSION_LEVELS = exports.MAX_INCREMENTS = exports.incrementVersion = exports.getVersionStringFromNumber = exports.getVersionNumberFromString = void 0;
exports.getPreviousVersion = exports.incrementPatch = exports.incrementMinor = exports.SEMANTIC_VERSION_LEVELS = exports.MAX_INCREMENTS = exports.incrementVersion = exports.getVersionStringFromNumber = exports.getVersionNumberFromString = exports.isValidSemverLevel = void 0;
const SEMANTIC_VERSION_LEVELS = {
MAJOR: 'MAJOR',
MINOR: 'MINOR',
Expand All @@ -3599,6 +3599,10 @@ const SEMANTIC_VERSION_LEVELS = {
exports.SEMANTIC_VERSION_LEVELS = SEMANTIC_VERSION_LEVELS;
const MAX_INCREMENTS = 99;
exports.MAX_INCREMENTS = MAX_INCREMENTS;
function isValidSemverLevel(str) {
return Object.keys(SEMANTIC_VERSION_LEVELS).includes(str);
}
exports.isValidSemverLevel = isValidSemverLevel;
/**
* Transforms a versions string into a number
*/
Expand Down
16 changes: 8 additions & 8 deletions .github/actions/javascript/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6679,7 +6679,7 @@ FetchError.prototype.name = 'FetchError';

let convert;
try {
convert = (__nccwpck_require__(2877).convert);
convert = (__nccwpck_require__(3975).convert);
} catch (e) {}

const INTERNALS = Symbol('Body internals');
Expand Down Expand Up @@ -12050,27 +12050,27 @@ exports["default"] = arrayDifference;

/***/ }),

/***/ 2877:
/***/ 9491:
/***/ ((module) => {

module.exports = eval("require")("encoding");

"use strict";
module.exports = require("assert");

/***/ }),

/***/ 9491:
/***/ 6113:
/***/ ((module) => {

"use strict";
module.exports = require("assert");
module.exports = require("crypto");

/***/ }),

/***/ 6113:
/***/ 3975:
/***/ ((module) => {

"use strict";
module.exports = require("crypto");
module.exports = require("encoding");

/***/ }),

Expand Down
90 changes: 77 additions & 13 deletions .github/actions/javascript/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9434,7 +9434,7 @@ FetchError.prototype.name = 'FetchError';

let convert;
try {
convert = (__nccwpck_require__(2877).convert);
convert = (__nccwpck_require__(3975).convert);
} catch (e) {}

const INTERNALS = Symbol('Body internals');
Expand Down Expand Up @@ -14401,7 +14401,66 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
const child_process_1 = __nccwpck_require__(2081);
const CONST_1 = __importDefault(__nccwpck_require__(9873));
const sanitizeStringForJSONParse_1 = __importDefault(__nccwpck_require__(3902));
const VERSION_UPDATER = __importStar(__nccwpck_require__(8982));
const VersionUpdater = __importStar(__nccwpck_require__(8982));
/**
* Check if a tag exists locally or in the remote.
*/
function tagExists(tag) {
try {
// Check if the tag exists locally
(0, child_process_1.execSync)(`git show-ref --tags ${tag}`, { stdio: 'ignore' });
return true; // Tag exists locally
}
catch (error) {
// Tag does not exist locally, check in remote
let shouldRetry = true;
let needsRepack = false;
let doesTagExist = false;
while (shouldRetry) {
try {
if (needsRepack) {
// We have seen some scenarios where this fixes the git fetch.
// Why? Who knows... https://github.com/Expensify/App/pull/31459
(0, child_process_1.execSync)('git repack -d', { stdio: 'inherit' });
}
(0, child_process_1.execSync)(`git ls-remote --exit-code --tags origin ${tag}`, { stdio: 'ignore' });
doesTagExist = true;
shouldRetry = false;
}
catch (e) {
if (!needsRepack) {
console.log('Attempting to repack and retry...');
needsRepack = true;
}
else {
console.error("Repack didn't help, giving up...");
shouldRetry = false;
}
}
}
return doesTagExist;
}
}
/**
* This essentially just calls getPreviousVersion in a loop, until it finds a version for which a tag exists.
* It's useful if we manually perform a version bump, because in that case a tag may not exist for the previous version.
*
* @param tag the current tag
* @param level the Semver level to step backward by
*/
function getPreviousExistingTag(tag, level) {
let previousVersion = VersionUpdater.getPreviousVersion(tag, level);
let tagExistsForPreviousVersion = false;
while (!tagExistsForPreviousVersion) {
if (tagExists(previousVersion)) {
tagExistsForPreviousVersion = true;
break;
}
console.log(`Tag for previous version ${previousVersion} does not exist. Checking for an older version...`);
previousVersion = VersionUpdater.getPreviousVersion(previousVersion, level);
}
return previousVersion;
}
/**
* @param [shallowExcludeTag] When fetching the given tag, exclude all history reachable by the shallowExcludeTag (used to make fetch much faster)
*/
Expand Down Expand Up @@ -14444,8 +14503,8 @@ function fetchTag(tag, shallowExcludeTag = '') {
* Get merge logs between two tags (inclusive) as a JavaScript object.
*/
function getCommitHistoryAsJSON(fromTag, toTag) {
// Fetch tags, exclude commits reachable from the previous patch version (i.e: previous checklist), so that we don't have to fetch the full history
const previousPatchVersion = VERSION_UPDATER.getPreviousVersion(fromTag, VERSION_UPDATER.SEMANTIC_VERSION_LEVELS.PATCH);
// Fetch tags, excluding commits reachable from the previous patch version (i.e: previous checklist), so that we don't have to fetch the full history
const previousPatchVersion = getPreviousExistingTag(fromTag, VersionUpdater.SEMANTIC_VERSION_LEVELS.PATCH);
fetchTag(fromTag, previousPatchVersion);
fetchTag(toTag, previousPatchVersion);
console.log('Getting pull requests merged between the following tags:', fromTag, toTag);
Expand Down Expand Up @@ -14517,6 +14576,7 @@ async function getPullRequestsMergedBetween(fromTag, toTag) {
return pullRequestNumbers;
}
exports["default"] = {
getPreviousExistingTag,
getValidMergedPRs,
getPullRequestsMergedBetween,
};
Expand Down Expand Up @@ -15026,7 +15086,7 @@ exports["default"] = sanitizeStringForJSONParse;
"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getPreviousVersion = exports.incrementPatch = exports.incrementMinor = exports.SEMANTIC_VERSION_LEVELS = exports.MAX_INCREMENTS = exports.incrementVersion = exports.getVersionStringFromNumber = exports.getVersionNumberFromString = void 0;
exports.getPreviousVersion = exports.incrementPatch = exports.incrementMinor = exports.SEMANTIC_VERSION_LEVELS = exports.MAX_INCREMENTS = exports.incrementVersion = exports.getVersionStringFromNumber = exports.getVersionNumberFromString = exports.isValidSemverLevel = void 0;
const SEMANTIC_VERSION_LEVELS = {
MAJOR: 'MAJOR',
MINOR: 'MINOR',
Expand All @@ -15036,6 +15096,10 @@ const SEMANTIC_VERSION_LEVELS = {
exports.SEMANTIC_VERSION_LEVELS = SEMANTIC_VERSION_LEVELS;
const MAX_INCREMENTS = 99;
exports.MAX_INCREMENTS = MAX_INCREMENTS;
function isValidSemverLevel(str) {
return Object.keys(SEMANTIC_VERSION_LEVELS).includes(str);
}
exports.isValidSemverLevel = isValidSemverLevel;
/**
* Transforms a versions string into a number
*/
Expand Down Expand Up @@ -15152,14 +15216,6 @@ function arrayDifference(array1, array2) {
exports["default"] = arrayDifference;


/***/ }),

/***/ 2877:
/***/ ((module) => {

module.exports = eval("require")("encoding");


/***/ }),

/***/ 9491:
Expand All @@ -15186,6 +15242,14 @@ module.exports = require("crypto");

/***/ }),

/***/ 3975:
/***/ ((module) => {

"use strict";
module.exports = require("encoding");

/***/ }),

/***/ 2361:
/***/ ((module) => {

Expand Down
Loading

0 comments on commit beb9744

Please sign in to comment.