Skip to content

Commit

Permalink
fix: regenerate package lock
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinnot authored Apr 9, 2021
1 parent 1dac4e8 commit 23282bb
Show file tree
Hide file tree
Showing 8 changed files with 14,411 additions and 22,661 deletions.
37,036 changes: 14,391 additions & 22,645 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@types/jest": "^26.0.22",
"@types/micromatch": "^4.0.1",
"@types/node": "^14.14.37",
"@zeit/ncc": "^0.22.3",
"@vercel/ncc": "^0.28.2",
"commitizen": "^4.2.3",
"cspell": "^5.3.7",
"eslint": "^7.21.0",
Expand Down Expand Up @@ -73,7 +73,7 @@
},
"scripts": {
"build": "run-s clean:dist build:dist",
"build:dist": "ncc build src/index.ts --minify --source-map --v8-cache",
"build:dist": "ncc build ./src/index.ts --minify --source-map --v8-cache",
"build:ts": "tsc --project tsconfig.production.json",
"build:ts:watch": "tsc --project tsconfig.production.json --watch",
"clean": "run-p clean:*",
Expand Down
5 changes: 2 additions & 3 deletions src/common/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ export interface PullRequestDetails {
const EXPONENTIAL_BACKOFF = 2;
const MINIMUM_WAIT_TIME = 1000;

const delay = async (duration: number): Promise<void> => {
return new Promise((resolve: () => void): void => {
const delay = async (duration: number): Promise<void> =>
new Promise((resolve: () => void): void => {
setTimeout((): void => {
resolve();
}, duration);
});
};

/**
* Approves and merges a given Pull Request.
Expand Down
6 changes: 5 additions & 1 deletion src/eventHandlers/continuousIntegrationEnd/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable no-await-in-loop */

import { context, getOctokit } from '@actions/github';
import type { GraphQlQueryResponseData } from '@octokit/graphql';
import { isMatch } from 'micromatch';

import { tryMerge } from '../../common/merge';
Expand All @@ -19,7 +20,10 @@ const getPullRequestInformation = async (
repositoryOwner: string;
},
): Promise<PullRequestInformationContinuousIntegrationEnd | undefined> => {
const response = await octokit.graphql(findPullRequestInfoByNumber, query);
const response = await octokit.graphql<GraphQlQueryResponseData | null>(
findPullRequestInfoByNumber,
query,
);

if (response === null || response.repository.pullRequest === null) {
return undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const GITHUB_LOGIN = getInput('GITHUB_LOGIN');
const MAXIMUM_RETRIES =
getInput('MAXIMUM_RETRIES').trim() === ''
? DEFAULT_MAXIMUM_RETRIES
: parseInt(getInput('MAXIMUM_RETRIES'), 10);
: Number.parseInt(getInput('MAXIMUM_RETRIES'), 10);

const octokit = getOctokit(GITHUB_TOKEN);

Expand Down
4 changes: 2 additions & 2 deletions src/utilities/log.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const errorWithStack = new Error('I am an error.');
errorWithStack.stack = 'I am a stack.';

describe.each<
[string, (value: unknown) => void, jest.SpyInstance<void, [string | Error]>]
[string, (value: unknown) => void, jest.SpyInstance<void, [Error | string]>]
>([
['logError', logError, errorSpy],
['logWarning', logWarning, warningSpy],
Expand All @@ -24,7 +24,7 @@ describe.each<
(
_: string,
logFunction: (value: unknown) => void,
coreFunction: jest.SpyInstance<void, [string | Error]>,
coreFunction: jest.SpyInstance<void, [Error | string]>,
): void => {
it.each<[unknown, string]>([
['I am a string.', 'I am a string.'],
Expand Down
14 changes: 7 additions & 7 deletions src/utilities/prTitleParsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ export const checkPullRequestTitleForMergePreset = (title: string): boolean => {
return true;
}

const semVerTitleRegExp = /bump .* from (?<from>.*) to (?<to>.*)/iu;
const match = semVerTitleRegExp.exec(title);
const semanticVersionTitleRegExp = /bump .* from (?<from>.*) to (?<to>.*)/iu;
const match = semanticVersionTitleRegExp.exec(title);

if (match === null) {
return true;
}

const semVerRegExp = /^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)$/u;
const semVersionRegExp = /^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)$/u;

const matchGroups = match.groups;
// Using non-null assertions per: https://github.com/microsoft/TypeScript/issues/32098
const fromMatch = semVerRegExp.exec(matchGroups!.from!);
const toMatch = semVerRegExp.exec(matchGroups!.to!);
const fromMatch = semVersionRegExp.exec(matchGroups!.from!);
const toMatch = semVersionRegExp.exec(matchGroups!.to!);

if (fromMatch === null || toMatch === null) {
return true;
Expand All @@ -34,14 +34,14 @@ export const checkPullRequestTitleForMergePreset = (title: string): boolean => {
const fromMajor = fromMatchGroups!.major!;
const toMajor = toMatchGroups!.major!;

if (parseInt(fromMajor, 10) !== parseInt(toMajor, 10)) {
if (Number.parseInt(fromMajor, 10) !== Number.parseInt(toMajor, 10)) {
return false;
}

const fromMinor = fromMatchGroups!.minor!;
const toMinor = toMatchGroups!.minor!;

if (parseInt(fromMinor, 10) !== parseInt(toMinor, 10)) {
if (Number.parseInt(fromMinor, 10) !== Number.parseInt(toMinor, 10)) {
return category === 'DEPENDABOT_MINOR';
}

Expand Down
1 change: 1 addition & 0 deletions tsconfig.production.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"forceConsistentCasingInFileNames": true,
"lib": ["ES2019"],
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": false,
"noImplicitReturns": true,
"noUnusedLocals": true,
Expand Down

0 comments on commit 23282bb

Please sign in to comment.