Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TS migration] Migrate 'sanitizeStringForJSONParse.js', 'promiseWhile.js', 'CONST.js', 'versionUpdater.js', 'ActionUtils.js' .github file to TypeScript #37975

Merged
merged 41 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8bffd0d
ref: move sanitizeStringForJSONParse to TS
kubabutkiewicz Mar 8, 2024
d59a55f
ref: move const and promiseWhile to TS
kubabutkiewicz Mar 8, 2024
1804cdb
ref: move ActionUtils to TS
kubabutkiewicz Mar 8, 2024
9cf90e2
fix: tests
kubabutkiewicz Mar 8, 2024
b89a97c
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 11, 2024
2e8f2c6
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 12, 2024
17942ce
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 13, 2024
6957113
fix: typecheck
kubabutkiewicz Mar 13, 2024
153561b
fix: validate actions
kubabutkiewicz Mar 13, 2024
9df8f4e
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 14, 2024
d3033e7
fix: resolve comments
kubabutkiewicz Mar 14, 2024
fd12300
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 15, 2024
79e65c7
fix: tests
kubabutkiewicz Mar 15, 2024
82f2162
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 25, 2024
28f2219
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 26, 2024
78bdb4c
fix: adjusted imports
kubabutkiewicz Mar 26, 2024
ad5eb49
feat: run gh-actions-build
kubabutkiewicz Mar 26, 2024
63cf03a
fix: lint
kubabutkiewicz Mar 27, 2024
67c4e73
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 27, 2024
910b9f6
fix: run gh-actions-build
kubabutkiewicz Mar 27, 2024
a0358f5
fix: resolve comments
kubabutkiewicz Mar 27, 2024
e8167d9
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 27, 2024
df99b41
fix: run gh-actions-build
kubabutkiewicz Mar 27, 2024
1500bbc
fix: typecheck
kubabutkiewicz Mar 27, 2024
1e1fd16
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 27, 2024
fddb07b
fix: run gh-actions-build
kubabutkiewicz Mar 27, 2024
5fbffbe
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 28, 2024
be27995
fix: resolve comments
kubabutkiewicz Mar 28, 2024
437a9b4
fix: run gh-actions-build
kubabutkiewicz Mar 28, 2024
9113492
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 29, 2024
9656c8b
fix: run gh-actions-build
kubabutkiewicz Mar 29, 2024
6451e1d
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Mar 29, 2024
76b6f28
fix: run gh-actions-build
kubabutkiewicz Mar 29, 2024
6723071
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Apr 2, 2024
2bad90b
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Apr 3, 2024
e585214
fix: resolve comment
kubabutkiewicz Apr 3, 2024
3338c04
fix: run gh-actions-build
kubabutkiewicz Apr 3, 2024
2d2512d
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
kubabutkiewicz Apr 3, 2024
41f0d72
fix: run gh-actions-build
kubabutkiewicz Apr 3, 2024
ef5f493
fix: typecheck
kubabutkiewicz Apr 3, 2024
25318df
fix: run gh-actions-build
kubabutkiewicz Apr 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import escapeRegExp from 'lodash/escapeRegExp';
import CONST from '../../../libs/CONST';
import GithubUtils from '../../../libs/GithubUtils';
import newComponentCategory from './categories/newComponentCategory';

const CONST = require('../../../libs/CONST');
kubabutkiewicz marked this conversation as resolved.
Show resolved Hide resolved

const pathToAuthorChecklist = `https://raw.githubusercontent.com/${CONST.GITHUB_OWNER}/${CONST.APP_REPO}/main/.github/PULL_REQUEST_TEMPLATE.md`;
const checklistStartsWith = '### PR Author Checklist';
const checklistEndsWith = '\r\n### Screenshots/Videos';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import github from '@actions/github';
import {parse} from '@babel/parser';
import traverse from '@babel/traverse';
import CONST from '../../../../libs/CONST';
import GithubUtils from '../../../../libs/GithubUtils';
import promiseSome from '../../../../libs/promiseSome';
import type Category from './Category';

const CONST = require('../../../../libs/CONST');

type SuperClassType = {superClass: {name?: string; object: {name: string}; property: {name: string}} | null; name: string};

const items = [
Expand Down
68 changes: 34 additions & 34 deletions .github/actions/javascript/authorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,6 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

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

const CONST = {
GITHUB_OWNER: 'Expensify',
APP_REPO: 'App',
APPLAUSE_BOT: 'applausebot',
OS_BOTIFY: 'OSBotify',
LABELS: {
STAGING_DEPLOY: 'StagingDeployCash',
DEPLOY_BLOCKER: 'DeployBlockerCash',
INTERNAL_QA: 'InternalQA',
},
DATE_FORMAT_STRING: 'yyyy-MM-dd',
};

CONST.APP_REPO_URL = `https://github.com/${CONST.GITHUB_OWNER}/${CONST.APP_REPO}`;
CONST.APP_REPO_GIT_URL = `git@github.com:${CONST.GITHUB_OWNER}/${CONST.APP_REPO}.git`;

module.exports = CONST;


/***/ }),

/***/ 7999:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

Expand All @@ -37,7 +13,7 @@ const core = __nccwpck_require__(2186);
const {GitHub, getOctokitOptions} = __nccwpck_require__(3030);
const {throttling} = __nccwpck_require__(9968);
const {paginateRest} = __nccwpck_require__(4193);
const CONST = __nccwpck_require__(4097);
const CONST = __nccwpck_require__(9873);

const GITHUB_BASE_URL_REGEX = new RegExp('https?://(?:github\\.com|api\\.github\\.com)');
const PULL_REQUEST_REGEX = new RegExp(`${GITHUB_BASE_URL_REGEX.source}/.*/.*/pull/([0-9]+).*`);
Expand Down Expand Up @@ -18403,10 +18379,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(2186));
const github = __importStar(__nccwpck_require__(5438));
const escapeRegExp_1 = __importDefault(__nccwpck_require__(8415));
const CONST_1 = __importDefault(__nccwpck_require__(4097));
const GithubUtils_1 = __importDefault(__nccwpck_require__(7999));
const newComponentCategory_1 = __importDefault(__nccwpck_require__(9032));
const pathToAuthorChecklist = `https://raw.githubusercontent.com/${CONST_1.default.GITHUB_OWNER}/${CONST_1.default.APP_REPO}/main/.github/PULL_REQUEST_TEMPLATE.md`;
const CONST = __nccwpck_require__(9873);
const pathToAuthorChecklist = `https://raw.githubusercontent.com/${CONST.GITHUB_OWNER}/${CONST.APP_REPO}/main/.github/PULL_REQUEST_TEMPLATE.md`;
const checklistStartsWith = '### PR Author Checklist';
const checklistEndsWith = '\r\n### Screenshots/Videos';
const prNumber = github.context.payload.pull_request?.number;
Expand All @@ -18419,8 +18395,8 @@ const CHECKLIST_CATEGORIES = {
async function getChecklistCategoriesForPullRequest() {
const checks = new Set();
const changedFiles = await GithubUtils_1.default.paginate(GithubUtils_1.default.octokit.pulls.listFiles, {
owner: CONST_1.default.GITHUB_OWNER,
repo: CONST_1.default.APP_REPO,
owner: CONST.GITHUB_OWNER,
repo: CONST.APP_REPO,
// eslint-disable-next-line @typescript-eslint/naming-convention
pull_number: prNumber,
// eslint-disable-next-line @typescript-eslint/naming-convention
Expand Down Expand Up @@ -18511,8 +18487,8 @@ async function generateDynamicChecksAndCheckForCompletion() {
if (didChecklistChange) {
console.log('Checklist changed, updating PR...');
await GithubUtils_1.default.octokit.pulls.update({
owner: CONST_1.default.GITHUB_OWNER,
repo: CONST_1.default.APP_REPO,
owner: CONST.GITHUB_OWNER,
repo: CONST.APP_REPO,
// eslint-disable-next-line @typescript-eslint/naming-convention
pull_number: prNumber,
body: newBody,
Expand Down Expand Up @@ -18557,9 +18533,9 @@ exports.detectReactComponent = void 0;
const github_1 = __importDefault(__nccwpck_require__(5438));
const parser_1 = __nccwpck_require__(5026);
const traverse_1 = __importDefault(__nccwpck_require__(1380));
const CONST_1 = __importDefault(__nccwpck_require__(4097));
const GithubUtils_1 = __importDefault(__nccwpck_require__(7999));
const promiseSome_1 = __importDefault(__nccwpck_require__(8534));
const CONST = __nccwpck_require__(9873);
const items = [
"I verified that similar component doesn't exist in the codebase",
'I verified that all props are defined accurately and each prop has a `/** comment above it */`',
Expand Down Expand Up @@ -18618,8 +18594,8 @@ function nodeBase64ToUtf8(data) {
}
async function detectReactComponentInFile(filename) {
const params = {
owner: CONST_1.default.GITHUB_OWNER,
repo: CONST_1.default.APP_REPO,
owner: CONST.GITHUB_OWNER,
repo: CONST.APP_REPO,
path: filename,
ref: github_1.default.context.payload.pull_request?.head.ref,
};
Expand Down Expand Up @@ -18649,6 +18625,30 @@ const newComponentCategory = {
exports["default"] = newComponentCategory;


/***/ }),

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

"use strict";

const CONST = {
GITHUB_OWNER: 'Expensify',
APP_REPO: 'App',
APPLAUSE_BOT: 'applausebot',
OS_BOTIFY: 'OSBotify',
LABELS: {
STAGING_DEPLOY: 'StagingDeployCash',
DEPLOY_BLOCKER: 'DeployBlockerCash',
INTERNAL_QA: 'InternalQA',
},
DATE_FORMAT_STRING: 'yyyy-MM-dd',
};
CONST.APP_REPO_URL = `https://github.com/${CONST.GITHUB_OWNER}/${CONST.APP_REPO}`;
CONST.APP_REPO_GIT_URL = `git@github.com:${CONST.GITHUB_OWNER}/${CONST.APP_REPO}.git`;
module.exports = CONST;


/***/ }),

/***/ 8534:
Expand Down
Loading
Loading