Skip to content

Commit 25f7928

Browse files
authored
Merge branch 'main' into krishna2323/issue/41800
2 parents ba952e1 + a6cb60c commit 25f7928

File tree

239 files changed

+5226
-3577
lines changed

Some content is hidden

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

239 files changed

+5226
-3577
lines changed

.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/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/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
key: ${{ runner.os }}-jest
4242

4343
- name: Jest tests
44-
run: npx jest --silent --shard=${{ fromJSON(matrix.chunk) }}/${{ strategy.job-total }} --max-workers ${{ steps.cpu-cores.outputs.count }}
44+
run: NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" npx jest --silent --shard=${{ fromJSON(matrix.chunk) }}/${{ strategy.job-total }} --max-workers ${{ steps.cpu-cores.outputs.count }}
4545

4646
storybookTests:
4747
if: ${{ github.actor != 'OSBotify' && github.actor != 'imgbot[bot]' || github.event_name == 'workflow_call' }}

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.10.0
1+
20.13.0

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 1001047201
102-
versionName "1.4.72-1"
101+
versionCode 1001047304
102+
versionName "1.4.73-4"
103103
// Supported language variants must be declared here to avoid from being removed during the compilation.
104104
// This also helps us to not include unnecessary language variants in the APK.
105105
resConfigs "en", "es"

assets/emojis/index.ts

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import type {Locale} from '@src/types/onyx';
22
import emojis from './common';
3-
import enEmojis from './en';
4-
import esEmojis from './es';
53
import type {Emoji, EmojisList} from './types';
64

75
type EmojiTable = Record<string, Emoji>;
@@ -30,10 +28,22 @@ const emojiCodeTableWithSkinTones = emojis.reduce<EmojiTable>((prev, cur) => {
3028
}, {});
3129

3230
const localeEmojis: LocaleEmojis = {
33-
en: enEmojis,
34-
es: esEmojis,
31+
en: undefined,
32+
es: undefined,
33+
};
34+
35+
const importEmojiLocale = (locale: Locale) => {
36+
const normalizedLocale = locale.toLowerCase().split('-')[0] as Locale;
37+
if (!localeEmojis[normalizedLocale]) {
38+
const emojiImportPromise = normalizedLocale === 'en' ? import('./en') : import('./es');
39+
return emojiImportPromise.then((esEmojiModule) => {
40+
// it is needed because in jest test the modules are imported in double nested default object
41+
localeEmojis[normalizedLocale] = esEmojiModule.default.default ? (esEmojiModule.default.default as unknown as EmojisList) : esEmojiModule.default;
42+
});
43+
}
44+
return Promise.resolve();
3545
};
3646

3747
export default emojis;
38-
export {emojiNameTable, emojiCodeTableWithSkinTones, localeEmojis};
48+
export {emojiNameTable, emojiCodeTableWithSkinTones, localeEmojis, importEmojiLocale};
3949
export {skinTones, categoryFrequentlyUsed} from './common';
+19
Loading

assets/images/receipt-scan.svg

+1-1
Loading

0 commit comments

Comments
 (0)