skuba 3.15.3-beta.0 → 3.17.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jest-preset.js +1 -0
- package/lib/api/git/commit.d.ts +15 -0
- package/lib/api/git/commit.js +31 -0
- package/lib/api/git/commit.js.map +1 -0
- package/lib/api/git/commitAllChanges.d.ts +12 -0
- package/lib/api/git/commitAllChanges.js +36 -0
- package/lib/api/git/commitAllChanges.js.map +1 -0
- package/lib/api/git/getChangedFiles.d.ts +14 -0
- package/lib/api/git/getChangedFiles.js +41 -0
- package/lib/api/git/getChangedFiles.js.map +1 -0
- package/lib/api/git/index.d.ts +7 -0
- package/lib/api/git/index.js +18 -0
- package/lib/api/git/index.js.map +1 -0
- package/lib/api/git/log.d.ts +12 -0
- package/lib/api/git/log.js +37 -0
- package/lib/api/git/log.js.map +1 -0
- package/lib/api/git/push.d.ts +43 -0
- package/lib/api/git/push.js +46 -0
- package/lib/api/git/push.js.map +1 -0
- package/lib/api/git/remote.d.ts +18 -0
- package/lib/api/git/remote.js +57 -0
- package/lib/api/git/remote.js.map +1 -0
- package/lib/api/git/reset.d.ts +12 -0
- package/lib/api/git/reset.js +39 -0
- package/lib/api/git/reset.js.map +1 -0
- package/lib/api/git/statusMatrix.d.ts +7 -0
- package/lib/api/git/statusMatrix.js +14 -0
- package/lib/api/git/statusMatrix.js.map +1 -0
- package/lib/api/github/checkRun.d.ts +37 -4
- package/lib/api/github/checkRun.js +60 -59
- package/lib/api/github/checkRun.js.map +1 -1
- package/lib/api/github/environment.d.ts +22 -0
- package/lib/api/github/environment.js +42 -0
- package/lib/api/github/environment.js.map +1 -0
- package/lib/api/github/index.d.ts +2 -1
- package/lib/api/github/index.js +5 -2
- package/lib/api/github/index.js.map +1 -1
- package/lib/api/github/issueComment.d.ts +59 -0
- package/lib/api/github/issueComment.js +96 -0
- package/lib/api/github/issueComment.js.map +1 -0
- package/lib/api/github/pullRequest.d.ts +21 -0
- package/lib/api/github/pullRequest.js +70 -0
- package/lib/api/github/pullRequest.js.map +1 -0
- package/lib/api/jest/index.d.ts +2 -2
- package/lib/api/jest/index.js.map +1 -1
- package/lib/api/net/waitFor.d.ts +1 -1
- package/lib/api/net/waitFor.js.map +1 -1
- package/lib/cli/adapter/eslint.d.ts +2 -2
- package/lib/cli/adapter/eslint.js +3 -4
- package/lib/cli/adapter/eslint.js.map +1 -1
- package/lib/cli/adapter/prettier.d.ts +22 -1
- package/lib/cli/adapter/prettier.js +49 -17
- package/lib/cli/adapter/prettier.js.map +1 -1
- package/lib/cli/configure/analyseConfiguration.d.ts +1 -1
- package/lib/cli/configure/analyseDependencies.d.ts +2 -2
- package/lib/cli/configure/analyseDependencies.js.map +1 -1
- package/lib/cli/configure/analysis/package.d.ts +1 -1
- package/lib/cli/configure/analysis/project.d.ts +1 -1
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.d.ts +1 -1
- package/lib/cli/configure/dependencies/seekKoala.d.ts +1 -1
- package/lib/cli/configure/dependencies/skuba.d.ts +1 -1
- package/lib/cli/configure/dependencies/skubaDeps.d.ts +1 -1
- package/lib/cli/configure/dependencies/skubaDive.d.ts +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.d.ts +2 -2
- package/lib/cli/configure/ensureTemplateCompletion.js.map +1 -1
- package/lib/cli/configure/getEntryPoint.d.ts +3 -3
- package/lib/cli/configure/getProjectType.d.ts +2 -2
- package/lib/cli/configure/modules/eslint.d.ts +1 -1
- package/lib/cli/configure/modules/ignore.d.ts +1 -1
- package/lib/cli/configure/modules/index.d.ts +1 -1
- package/lib/cli/configure/modules/jest.d.ts +1 -1
- package/lib/cli/configure/modules/nodemon.d.ts +1 -1
- package/lib/cli/configure/modules/package.d.ts +1 -1
- package/lib/cli/configure/modules/prettier.d.ts +1 -1
- package/lib/cli/configure/modules/renovate.d.ts +1 -1
- package/lib/cli/configure/modules/serverless.d.ts +1 -1
- package/lib/cli/configure/modules/skubaDive.d.ts +1 -1
- package/lib/cli/configure/modules/tsconfig.d.ts +1 -1
- package/lib/cli/configure/modules/tslint.d.ts +1 -1
- package/lib/cli/configure/processing/deleteFiles.d.ts +1 -1
- package/lib/cli/configure/processing/loadFiles.d.ts +1 -1
- package/lib/cli/configure/processing/package.d.ts +1 -1
- package/lib/cli/configure/processing/typescript.js +1 -1
- package/lib/cli/configure/processing/typescript.js.map +1 -1
- package/lib/cli/configure/refreshIgnoreFiles.d.ts +2 -0
- package/lib/cli/configure/refreshIgnoreFiles.js +55 -0
- package/lib/cli/configure/refreshIgnoreFiles.js.map +1 -0
- package/lib/cli/configure/types.d.ts +1 -1
- package/lib/cli/format.js +2 -0
- package/lib/cli/format.js.map +1 -1
- package/lib/cli/init/getConfig.d.ts +2 -2
- package/lib/cli/init/getConfig.js.map +1 -1
- package/lib/cli/init/git.js +22 -8
- package/lib/cli/init/git.js.map +1 -1
- package/lib/cli/init/writePackageJson.d.ts +1 -1
- package/lib/cli/lint/annotate/buildkite/eslint.d.ts +1 -1
- package/lib/cli/lint/annotate/buildkite/index.d.ts +3 -3
- package/lib/cli/lint/annotate/buildkite/prettier.d.ts +1 -1
- package/lib/cli/lint/annotate/buildkite/tsc.d.ts +1 -1
- package/lib/cli/lint/annotate/buildkite/tsc.js +0 -1
- package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
- package/lib/cli/lint/annotate/github/eslint.d.ts +2 -2
- package/lib/cli/lint/annotate/github/eslint.js +1 -1
- package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/github/index.d.ts +4 -4
- package/lib/cli/lint/annotate/github/index.js +14 -7
- package/lib/cli/lint/annotate/github/index.js.map +1 -1
- package/lib/cli/lint/annotate/github/prettier.d.ts +2 -2
- package/lib/cli/lint/annotate/github/prettier.js +11 -8
- package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/github/tsc.d.ts +2 -2
- package/lib/cli/lint/annotate/github/tsc.js +37 -34
- package/lib/cli/lint/annotate/github/tsc.js.map +1 -1
- package/lib/cli/lint/annotate/index.d.ts +4 -4
- package/lib/cli/lint/annotate/index.js +2 -2
- package/lib/cli/lint/annotate/index.js.map +1 -1
- package/lib/cli/lint/eslint.d.ts +1 -1
- package/lib/cli/lint/eslint.js.map +1 -1
- package/lib/cli/lint/external.js +13 -7
- package/lib/cli/lint/external.js.map +1 -1
- package/lib/cli/lint/index.js +2 -0
- package/lib/cli/lint/index.js.map +1 -1
- package/lib/cli/lint/prettier.d.ts +1 -1
- package/lib/cli/lint/prettier.js.map +1 -1
- package/lib/cli/node.js +1 -1
- package/lib/cli/node.js.map +1 -1
- package/lib/cli/start.js +1 -1
- package/lib/cli/start.js.map +1 -1
- package/lib/cli/{test.d.ts → test/index.d.ts} +0 -0
- package/lib/cli/{test.js → test/index.js} +4 -4
- package/lib/cli/test/index.js.map +1 -0
- package/lib/cli/test/reporters/github/annotations.d.ts +9 -0
- package/lib/cli/test/reporters/github/annotations.js +86 -0
- package/lib/cli/test/reporters/github/annotations.js.map +1 -0
- package/lib/cli/test/reporters/github/index.d.ts +5 -0
- package/lib/cli/test/reporters/github/index.js +69 -0
- package/lib/cli/test/reporters/github/index.js.map +1 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -1
- package/lib/utils/args.d.ts +1 -1
- package/lib/utils/exec.d.ts +2 -1
- package/lib/utils/exec.js.map +1 -1
- package/lib/utils/logging.d.ts +1 -2
- package/lib/utils/logging.js +3 -2
- package/lib/utils/logging.js.map +1 -1
- package/lib/utils/manifest.d.ts +2 -1
- package/lib/utils/manifest.js.map +1 -1
- package/lib/utils/worker.d.ts +0 -1
- package/lib/wrapper/functionHandler.js +4 -1
- package/lib/wrapper/functionHandler.js.map +1 -1
- package/package.json +12 -9
- package/template/base/_.gitignore +1 -0
- package/template/express-rest-api/.buildkite/pipeline.yml +2 -0
- package/template/express-rest-api/docker-compose.yml +4 -2
- package/template/greeter/.buildkite/pipeline.yml +2 -0
- package/template/greeter/docker-compose.yml +4 -2
- package/template/koa-rest-api/.buildkite/pipeline.yml +2 -0
- package/template/koa-rest-api/docker-compose.yml +4 -2
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +3 -1
- package/template/lambda-sqs-worker/docker-compose.yml +3 -1
- package/template/lambda-sqs-worker/serverless.yml +1 -0
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +3 -1
- package/template/lambda-sqs-worker-cdk/docker-compose.yml +3 -1
- package/lib/cli/test.js.map +0 -1
- package/lib/register.d.ts +0 -20
- package/lib/register.js +0 -44
- package/lib/register.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ESLintOutput } from '../../../../cli/adapter/eslint';
|
|
1
|
+
import type { ESLintOutput } from '../../../../cli/adapter/eslint';
|
|
2
2
|
export declare const createEslintAnnotations: (eslint: ESLintOutput) => string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ESLintOutput } from '../../../../cli/adapter/eslint';
|
|
2
|
-
import { PrettierOutput } from '../../../../cli/adapter/prettier';
|
|
3
|
-
import { StreamInterceptor } from '../../../../cli/lint/external';
|
|
1
|
+
import type { ESLintOutput } from '../../../../cli/adapter/eslint';
|
|
2
|
+
import type { PrettierOutput } from '../../../../cli/adapter/prettier';
|
|
3
|
+
import type { StreamInterceptor } from '../../../../cli/lint/external';
|
|
4
4
|
export declare const createBuildkiteAnnotations: (eslint: ESLintOutput, prettier: PrettierOutput, tscOk: boolean, tscOutputStream: StreamInterceptor) => Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PrettierOutput } from '../../../../cli/adapter/prettier';
|
|
1
|
+
import type { PrettierOutput } from '../../../../cli/adapter/prettier';
|
|
2
2
|
export declare const createPrettierAnnotations: (prettier: PrettierOutput) => string[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { StreamInterceptor } from '../../../../cli/lint/external';
|
|
1
|
+
import type { StreamInterceptor } from '../../../../cli/lint/external';
|
|
2
2
|
export declare const createTscAnnotations: (tscOk: boolean, tscOutputStream: StreamInterceptor) => string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsc.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/buildkite/tsc.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qEAAuD;AAGhD,MAAM,oBAAoB,GAAG,CAClC,KAAc,EACd,eAAkC,EACxB,EAAE,CACZ,CAAC,KAAK;IACJ,CAAC,CAAC;QACE,SAAS;QACT,SAAS,CAAC,EAAE,CAAC,QAAQ,CACnB,eAAe;aACZ,MAAM,EAAE;aACR,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CAAC,OAAO,CAAC;aACf,
|
|
1
|
+
{"version":3,"file":"tsc.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/buildkite/tsc.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qEAAuD;AAGhD,MAAM,oBAAoB,GAAG,CAClC,KAAc,EACd,eAAkC,EACxB,EAAE,CACZ,CAAC,KAAK;IACJ,CAAC,CAAC;QACE,SAAS;QACT,SAAS,CAAC,EAAE,CAAC,QAAQ,CACnB,eAAe;aACZ,MAAM,EAAE;aACR,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CAAC,OAAO,CAAC;aACf,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;aAC9C,IAAI,CAAC,IAAI,CAAC;aACV,IAAI,EAAE,CACV;KACF;IACH,CAAC,CAAC,EAAE,CAAC;AAjBI,QAAA,oBAAoB,wBAiBxB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import * as GitHub from '../../../../api/github';
|
|
2
|
-
import { ESLintOutput } from '../../../../cli/adapter/eslint';
|
|
1
|
+
import type * as GitHub from '../../../../api/github';
|
|
2
|
+
import type { ESLintOutput } from '../../../../cli/adapter/eslint';
|
|
3
3
|
export declare const createEslintAnnotations: (eslint: ESLintOutput) => GitHub.Annotation[];
|
|
@@ -6,7 +6,7 @@ const createEslintAnnotations = (eslint) => [...eslint.errors, ...eslint.warning
|
|
|
6
6
|
// Annotations only support start_column and end_column on the same line.
|
|
7
7
|
const isSameLine = message.line === message.endLine;
|
|
8
8
|
const startColumn = isSameLine && message.column;
|
|
9
|
-
const endColumn = isSameLine &&
|
|
9
|
+
const endColumn = (isSameLine && message.endColumn) || startColumn;
|
|
10
10
|
return Object.assign(Object.assign(Object.assign({ annotation_level: message.severity === 2 ? 'failure' : 'warning', start_line: (_a = message.line) !== null && _a !== void 0 ? _a : 1, end_line: (_c = (_b = message.endLine) !== null && _b !== void 0 ? _b : message.line) !== null && _c !== void 0 ? _c : 1 }, (startColumn && { start_column: startColumn })), (endColumn && { end_column: endColumn })), { message: message.message, path: result.filePath, title: `ESLint${message.ruleId ? ` (${message.ruleId})` : ''}` });
|
|
11
11
|
}));
|
|
12
12
|
exports.createEslintAnnotations = createEslintAnnotations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/github/eslint.ts"],"names":[],"mappings":";;;AAGO,MAAM,uBAAuB,GAAG,CACrC,MAAoB,EACC,EAAE,CACvB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"eslint.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/github/eslint.ts"],"names":[],"mappings":";;;AAGO,MAAM,uBAAuB,GAAG,CACrC,MAAoB,EACC,EAAE,CACvB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAoB,CAAC,MAAM,EAAE,EAAE,CAC3E,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAqB,EAAE;;IACjD,yEAAyE;IACzE,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC;IACpD,MAAM,WAAW,GAAG,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IACjD,MAAM,SAAS,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC;IAEnE,mDACE,gBAAgB,EAAE,OAAO,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAChE,UAAU,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,CAAC,EAC7B,QAAQ,EAAE,MAAA,MAAA,OAAO,CAAC,OAAO,mCAAI,OAAO,CAAC,IAAI,mCAAI,CAAC,IAC3C,CAAC,WAAW,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC,GAC9C,CAAC,SAAS,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,KAC3C,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,IAAI,EAAE,MAAM,CAAC,QAAQ,EACrB,KAAK,EAAE,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,IAC9D;AACJ,CAAC,CAAC,CACH,CAAC;AArBS,QAAA,uBAAuB,2BAqBhC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ESLintOutput } from '../../../../cli/adapter/eslint';
|
|
2
|
-
import { PrettierOutput } from '../../../../cli/adapter/prettier';
|
|
3
|
-
import { StreamInterceptor } from '../../../../cli/lint/external';
|
|
4
|
-
export declare const createGitHubAnnotations: (eslint: ESLintOutput, prettier: PrettierOutput, tscOk: boolean, tscOutputStream: StreamInterceptor
|
|
1
|
+
import type { ESLintOutput } from '../../../../cli/adapter/eslint';
|
|
2
|
+
import type { PrettierOutput } from '../../../../cli/adapter/prettier';
|
|
3
|
+
import type { StreamInterceptor } from '../../../../cli/lint/external';
|
|
4
|
+
export declare const createGitHubAnnotations: (eslint: ESLintOutput, prettier: PrettierOutput, tscOk: boolean, tscOutputStream: StreamInterceptor) => Promise<void>;
|
|
@@ -30,23 +30,30 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
31
|
exports.createGitHubAnnotations = void 0;
|
|
32
32
|
const GitHub = __importStar(require("../../../../api/github"));
|
|
33
|
+
const environment_1 = require("../../../../api/github/environment");
|
|
33
34
|
const eslint_1 = require("./eslint");
|
|
34
35
|
const prettier_1 = require("./prettier");
|
|
35
36
|
const tsc_1 = require("./tsc");
|
|
36
|
-
const createGitHubAnnotations = (eslint, prettier, tscOk, tscOutputStream
|
|
37
|
+
const createGitHubAnnotations = (eslint, prettier, tscOk, tscOutputStream) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
if (!(0, environment_1.enabledFromEnvironment)()) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
37
41
|
const annotations = [
|
|
38
42
|
...(0, eslint_1.createEslintAnnotations)(eslint),
|
|
39
43
|
...(0, prettier_1.createPrettierAnnotations)(prettier),
|
|
40
44
|
...(0, tsc_1.createTscAnnotations)(tscOk, tscOutputStream),
|
|
41
45
|
];
|
|
42
46
|
const isOk = eslint.ok && prettier.ok && tscOk;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
const summary = isOk
|
|
48
|
+
? '`skuba lint` passed.'
|
|
49
|
+
: '`skuba lint` found issues that require triage.';
|
|
50
|
+
const build = (0, environment_1.buildNameFromEnvironment)();
|
|
51
|
+
yield GitHub.createCheckRun({
|
|
52
|
+
name: 'skuba/lint',
|
|
53
|
+
summary,
|
|
48
54
|
annotations,
|
|
49
|
-
conclusion,
|
|
55
|
+
conclusion: isOk ? 'success' : 'failure',
|
|
56
|
+
title: `${build} ${isOk ? 'passed' : 'failed'}`,
|
|
50
57
|
});
|
|
51
58
|
});
|
|
52
59
|
exports.createGitHubAnnotations = createGitHubAnnotations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/github/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAiD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/github/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAiD;AACjD,oEAG4C;AAK5C,qCAAmD;AACnD,yCAAuD;AACvD,+BAA6C;AAEtC,MAAM,uBAAuB,GAAG,CACrC,MAAoB,EACpB,QAAwB,EACxB,KAAc,EACd,eAAkC,EAClC,EAAE;IACF,IAAI,CAAC,IAAA,oCAAsB,GAAE,EAAE;QAC7B,OAAO;KACR;IAED,MAAM,WAAW,GAAwB;QACvC,GAAG,IAAA,gCAAuB,EAAC,MAAM,CAAC;QAClC,GAAG,IAAA,oCAAyB,EAAC,QAAQ,CAAC;QACtC,GAAG,IAAA,0BAAoB,EAAC,KAAK,EAAE,eAAe,CAAC;KAChD,CAAC;IAEF,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,IAAI,QAAQ,CAAC,EAAE,IAAI,KAAK,CAAC;IAE/C,MAAM,OAAO,GAAG,IAAI;QAClB,CAAC,CAAC,sBAAsB;QACxB,CAAC,CAAC,gDAAgD,CAAC;IAErD,MAAM,KAAK,GAAG,IAAA,sCAAwB,GAAE,CAAC;IAEzC,MAAM,MAAM,CAAC,cAAc,CAAC;QAC1B,IAAI,EAAE,YAAY;QAClB,OAAO;QACP,WAAW;QACX,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QACxC,KAAK,EAAE,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;KAChD,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AA/BW,QAAA,uBAAuB,2BA+BlC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import * as GitHub from '../../../../api/github';
|
|
2
|
-
import { PrettierOutput } from '../../../../cli/adapter/prettier';
|
|
1
|
+
import type * as GitHub from '../../../../api/github';
|
|
2
|
+
import type { PrettierOutput } from '../../../../cli/adapter/prettier';
|
|
3
3
|
export declare const createPrettierAnnotations: (prettier: PrettierOutput) => GitHub.Annotation[];
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createPrettierAnnotations = void 0;
|
|
4
|
-
const createPrettierAnnotations = (prettier) => prettier.result.errored.map((result) =>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
const createPrettierAnnotations = (prettier) => prettier.result.errored.map((result) => {
|
|
5
|
+
const message = result.err instanceof Error ? result.err.message : result.err;
|
|
6
|
+
return {
|
|
7
|
+
annotation_level: 'failure',
|
|
8
|
+
start_line: 1,
|
|
9
|
+
end_line: 1,
|
|
10
|
+
path: result.filepath,
|
|
11
|
+
message: message ? String(message) : 'This file has not been formatted.',
|
|
12
|
+
title: 'Prettier',
|
|
13
|
+
};
|
|
14
|
+
});
|
|
12
15
|
exports.createPrettierAnnotations = createPrettierAnnotations;
|
|
13
16
|
//# sourceMappingURL=prettier.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/github/prettier.ts"],"names":[],"mappings":";;;AAGO,MAAM,yBAAyB,GAAG,CACvC,QAAwB,EACH,EAAE,CACvB,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"prettier.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/github/prettier.ts"],"names":[],"mappings":";;;AAGO,MAAM,yBAAyB,GAAG,CACvC,QAAwB,EACH,EAAE,CACvB,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;IACrC,MAAM,OAAO,GACX,MAAM,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IAEhE,OAAO;QACL,gBAAgB,EAAE,SAAS;QAC3B,UAAU,EAAE,CAAC;QACb,QAAQ,EAAE,CAAC;QACX,IAAI,EAAE,MAAM,CAAC,QAAQ;QACrB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,mCAAmC;QACxE,KAAK,EAAE,UAAU;KAClB,CAAC;AACJ,CAAC,CAAC,CAAC;AAfQ,QAAA,yBAAyB,6BAejC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import * as GitHub from '../../../../api/github';
|
|
2
|
-
import { StreamInterceptor } from '../../../../cli/lint/external';
|
|
1
|
+
import type * as GitHub from '../../../../api/github';
|
|
2
|
+
import type { StreamInterceptor } from '../../../../cli/lint/external';
|
|
3
3
|
export declare const createTscAnnotations: (tscOk: boolean, tscOutputStream: StreamInterceptor) => GitHub.Annotation[];
|
|
@@ -6,51 +6,54 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.createTscAnnotations = void 0;
|
|
7
7
|
const strip_ansi_1 = __importDefault(require("strip-ansi"));
|
|
8
8
|
/**
|
|
9
|
-
* Matches the tsc
|
|
9
|
+
* Matches the `tsc │` prefix on each `tsc` log.
|
|
10
10
|
*/
|
|
11
|
-
const tscPrefixRegex = new RegExp(/(tsc\s+│ )/, 'g');
|
|
12
11
|
/**
|
|
13
|
-
* Matches regular and pretty tsc output
|
|
12
|
+
* Matches regular and pretty `tsc` output.
|
|
13
|
+
*
|
|
14
|
+
* For example, given the following input string:
|
|
15
|
+
*
|
|
16
|
+
* ```console
|
|
14
17
|
* src/skuba.ts:43:7 - error TS2769: No overload matches this call.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
* Overload 1 of 2, '(obj: LogContext, msg?: string | undefined, ...args: any[]): void', gave the following error.
|
|
19
|
+
* Argument of type 'unknown' is not assignable to parameter of type 'LogContext'.
|
|
20
|
+
* Overload 2 of 2, '(msg?: string | undefined, ...args: any[]): void', gave the following error.
|
|
21
|
+
* Argument of type 'unknown' is not assignable to parameter of type 'string | undefined'.
|
|
22
|
+
* Type 'unknown' is not assignable to type 'string'.
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* This pattern will produce the following matches:
|
|
26
|
+
*
|
|
27
|
+
* 1. src/skuba.ts
|
|
28
|
+
* 2. 43
|
|
29
|
+
* 3. 7
|
|
30
|
+
* 4. error
|
|
31
|
+
* 5. 2769
|
|
32
|
+
* 6. No overload matches this call [...] not assignable to type 'string'.
|
|
26
33
|
*/
|
|
27
|
-
const tscOutputRegex =
|
|
34
|
+
const tscOutputRegex = /([^\s].*)[\(:](\d+)[,:](\d+)(?:\):\s+|\s+-\s+)(error|warning|info)\s+TS(\d+)\s*:\s*([\s\S]*?)(?=\n\S)(?=\n\D)/g;
|
|
28
35
|
const annotationLevelMap = {
|
|
29
36
|
error: 'failure',
|
|
30
37
|
warning: 'warning',
|
|
31
38
|
info: 'notice',
|
|
32
39
|
};
|
|
33
40
|
const createTscAnnotations = (tscOk, tscOutputStream) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const rawOutput = (0, strip_ansi_1.default)(tscOutputStream.output()).replace(tscPrefixRegex, '');
|
|
37
|
-
const matches = rawOutput.matchAll(tscOutputRegex);
|
|
38
|
-
for (const match of matches) {
|
|
39
|
-
if ((match === null || match === void 0 ? void 0 : match.length) === 7) {
|
|
40
|
-
annotations.push({
|
|
41
|
-
annotation_level: annotationLevelMap[match[4]],
|
|
42
|
-
path: match[1],
|
|
43
|
-
start_line: Number(match[2]),
|
|
44
|
-
end_line: Number(match[2]),
|
|
45
|
-
start_column: Number(match[3]),
|
|
46
|
-
end_column: Number(match[3]),
|
|
47
|
-
message: match[6].trim(),
|
|
48
|
-
title: `tsc`,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}
|
|
41
|
+
if (tscOk) {
|
|
42
|
+
return [];
|
|
52
43
|
}
|
|
53
|
-
|
|
44
|
+
const matches = (0, strip_ansi_1.default)(tscOutputStream.output()).matchAll(tscOutputRegex);
|
|
45
|
+
return Array.from(matches).flatMap((match) => (match === null || match === void 0 ? void 0 : match.length) === 7
|
|
46
|
+
? {
|
|
47
|
+
annotation_level: annotationLevelMap[match[4]],
|
|
48
|
+
path: match[1],
|
|
49
|
+
start_line: Number(match[2]),
|
|
50
|
+
end_line: Number(match[2]),
|
|
51
|
+
start_column: Number(match[3]),
|
|
52
|
+
end_column: Number(match[3]),
|
|
53
|
+
message: match[6].trim(),
|
|
54
|
+
title: `tsc (TS${match[5]})`,
|
|
55
|
+
}
|
|
56
|
+
: []);
|
|
54
57
|
};
|
|
55
58
|
exports.createTscAnnotations = createTscAnnotations;
|
|
56
59
|
//# sourceMappingURL=tsc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsc.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/github/tsc.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAmC;AAOnC;;GAEG;
|
|
1
|
+
{"version":3,"file":"tsc.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate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@
|
|
|
1
|
-
import { ESLintOutput } from 'cli/adapter/eslint';
|
|
2
|
-
import { PrettierOutput } from 'cli/adapter/prettier';
|
|
3
|
-
import { StreamInterceptor } from '../external';
|
|
4
|
-
export declare const createAnnotations: (eslint: ESLintOutput, prettier: PrettierOutput, tscOk: boolean, tscOutputStream: StreamInterceptor
|
|
1
|
+
import type { ESLintOutput } from 'cli/adapter/eslint';
|
|
2
|
+
import type { PrettierOutput } from 'cli/adapter/prettier';
|
|
3
|
+
import type { StreamInterceptor } from '../external';
|
|
4
|
+
export declare const createAnnotations: (eslint: ESLintOutput, prettier: PrettierOutput, tscOk: boolean, tscOutputStream: StreamInterceptor) => Promise<void>;
|
|
@@ -12,9 +12,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.createAnnotations = void 0;
|
|
13
13
|
const buildkite_1 = require("./buildkite");
|
|
14
14
|
const github_1 = require("./github");
|
|
15
|
-
const createAnnotations = (eslint, prettier, tscOk, tscOutputStream
|
|
15
|
+
const createAnnotations = (eslint, prettier, tscOk, tscOutputStream) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
16
|
yield Promise.all([
|
|
17
|
-
(0, github_1.createGitHubAnnotations)(eslint, prettier, tscOk, tscOutputStream
|
|
17
|
+
(0, github_1.createGitHubAnnotations)(eslint, prettier, tscOk, tscOutputStream),
|
|
18
18
|
(0, buildkite_1.createBuildkiteAnnotations)(eslint, prettier, tscOk, tscOutputStream),
|
|
19
19
|
]);
|
|
20
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/lint/annotate/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,2CAAyD;AACzD,qCAAmD;AAE5C,MAAM,iBAAiB,GAAG,CAC/B,MAAoB,EACpB,QAAwB,EACxB,KAAc,EACd,eAAkC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/lint/annotate/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,2CAAyD;AACzD,qCAAmD;AAE5C,MAAM,iBAAiB,GAAG,CAC/B,MAAoB,EACpB,QAAwB,EACxB,KAAc,EACd,eAAkC,EACnB,EAAE;IACjB,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,IAAA,gCAAuB,EAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,CAAC;QACjE,IAAA,sCAA0B,EAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,CAAC;KACrE,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAVW,QAAA,iBAAiB,qBAU5B"}
|
package/lib/cli/lint/eslint.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ESLintOutput } from '../adapter/eslint';
|
|
1
|
+
import type { ESLintOutput } from '../adapter/eslint';
|
|
2
2
|
import type { Input } from './types';
|
|
3
3
|
export declare const runESLintInCurrentThread: ({ debug }: Input) => Promise<ESLintOutput>;
|
|
4
4
|
export declare const runESLintInWorkerThread: (input: Input) => Promise<ESLintOutput>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.js","sourceRoot":"","sources":["../../../src/cli/lint/eslint.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,mDAA8C;AAE9C,kDAA0B;AAE1B,iDAAmD;AACnD,+CAAwE;
|
|
1
|
+
{"version":3,"file":"eslint.js","sourceRoot":"","sources":["../../../src/cli/lint/eslint.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,mDAA8C;AAE9C,kDAA0B;AAE1B,iDAAmD;AACnD,+CAAwE;AAExE,8CAA8C;AAI9C,MAAM,UAAU,GAAG,eAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAExC,MAAM,wBAAwB,GAAG,CAAC,EAAE,KAAK,EAAS,EAAE,EAAE,CAC3D,IAAA,kBAAS,EAAC,MAAM,EAAE,IAAA,sBAAY,EAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;AADxC,QAAA,wBAAwB,4BACgB;AAE9C,MAAM,uBAAuB,GAAG,CAAC,KAAY,EAAE,EAAE,CACtD,IAAA,yBAAgB,EACd,cAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,EACvC,KAAK,CACN,CAAC;AAJS,QAAA,uBAAuB,2BAIhC;AAEJ,IAAI,CAAC,6BAAY,EAAE;IACjB,IAAA,yBAAgB,EAAC,gCAAwB,EAAE,IAAA,sBAAY,EAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;CAC7E"}
|
package/lib/cli/lint/external.js
CHANGED
|
@@ -30,13 +30,14 @@ const annotate_1 = require("./annotate");
|
|
|
30
30
|
const eslint_1 = require("./eslint");
|
|
31
31
|
const prettier_1 = require("./prettier");
|
|
32
32
|
const tsc_1 = require("./tsc");
|
|
33
|
+
const tscPrefixRegex = /^(.*?tsc\s+│.*?\s)/gm;
|
|
33
34
|
class StreamInterceptor extends stream_1.default.Transform {
|
|
34
35
|
constructor() {
|
|
35
36
|
super(...arguments);
|
|
36
37
|
this.chunks = [];
|
|
37
38
|
}
|
|
38
39
|
output() {
|
|
39
|
-
return Buffer.concat(this.chunks).toString();
|
|
40
|
+
return Buffer.concat(this.chunks).toString().replace(tscPrefixRegex, '');
|
|
40
41
|
}
|
|
41
42
|
_transform(chunk, _encoding, callback) {
|
|
42
43
|
this.chunks.push(chunk);
|
|
@@ -87,18 +88,23 @@ const externalLint = (input) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
87
88
|
const tscOutputStream = new StreamInterceptor();
|
|
88
89
|
tscOutputStream.pipe((_c = input.tscOutputStream) !== null && _c !== void 0 ? _c : process.stdout);
|
|
89
90
|
const { eslint, prettier, tscOk } = yield lint(Object.assign(Object.assign({}, input), { tscOutputStream }));
|
|
91
|
+
try {
|
|
92
|
+
yield (0, annotate_1.createAnnotations)(eslint, prettier, tscOk, tscOutputStream);
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
logging_1.log.warn('Failed to annotate results.');
|
|
96
|
+
logging_1.log.warn(err);
|
|
97
|
+
}
|
|
98
|
+
if (eslint.ok && prettier.ok && tscOk) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
90
101
|
const tools = [
|
|
91
102
|
...(eslint.ok ? [] : ['ESLint']),
|
|
92
103
|
...(prettier.ok ? [] : ['Prettier']),
|
|
93
104
|
...(tscOk ? [] : ['tsc']),
|
|
94
105
|
];
|
|
95
|
-
const summary = `${tools.join(', ')} found issues that require triage.`;
|
|
96
|
-
yield (0, annotate_1.createAnnotations)(eslint, prettier, tscOk, tscOutputStream, summary);
|
|
97
|
-
if (eslint.ok && prettier.ok && tscOk) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
106
|
logging_1.log.newline();
|
|
101
|
-
logging_1.log.err(
|
|
107
|
+
logging_1.log.err(`${tools.join(', ')} found issues that require triage.`);
|
|
102
108
|
process.exitCode = 1;
|
|
103
109
|
});
|
|
104
110
|
exports.externalLint = externalLint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external.js","sourceRoot":"","sources":["../../../src/cli/lint/external.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,iDAA0C;AAE1C,yCAA+C;AAC/C,qCAA6E;AAC7E,yCAGoB;AACpB,+BAA2C;AAG3C,MAAa,iBAAkB,SAAQ,gBAAM,CAAC,SAAS;IAAvD;;QACU,WAAM,GAAiB,EAAE,CAAC;IAepC,CAAC;IAbQ,MAAM;QACX,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"external.js","sourceRoot":"","sources":["../../../src/cli/lint/external.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,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BAAiB,EAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;KACnE;IAAC,OAAO,GAAG,EAAE;QACZ,aAAG,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;QACxC,aAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACf;IAED,IAAI,MAAM,CAAC,EAAE,IAAI,QAAQ,CAAC,EAAE,IAAI,KAAK,EAAE;QACrC,OAAO;KACR;IAED,MAAM,KAAK,GAAG;QACZ,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAChC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QACpC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;KAC1B,CAAC;IAEF,aAAG,CAAC,OAAO,EAAE,CAAC;IACd,aAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;IAEjE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAA,CAAC;AA7BW,QAAA,YAAY,gBA6BvB"}
|
package/lib/cli/lint/index.js
CHANGED
|
@@ -11,9 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.lint = void 0;
|
|
13
13
|
const args_1 = require("../../utils/args");
|
|
14
|
+
const refreshIgnoreFiles_1 = require("../configure/refreshIgnoreFiles");
|
|
14
15
|
const external_1 = require("./external");
|
|
15
16
|
const internal_1 = require("./internal");
|
|
16
17
|
const lint = (args = process.argv, tscOutputStream = undefined, workerThreads = true) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
yield (0, refreshIgnoreFiles_1.tryRefreshIgnoreFiles)();
|
|
17
19
|
const opts = {
|
|
18
20
|
debug: (0, args_1.hasDebugFlag)(args),
|
|
19
21
|
serial: (0, args_1.hasSerialFlag)(args),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/lint/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA+D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/lint/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA+D;AAC/D,wEAAwE;AAExE,yCAA0C;AAC1C,yCAA0C;AAGnC,MAAM,IAAI,GAAG,CAClB,IAAI,GAAG,OAAO,CAAC,IAAI,EACnB,kBAAqD,SAAS,EAC9D,aAAa,GAAG,IAAI,EACpB,EAAE;IACF,MAAM,IAAA,0CAAqB,GAAE,CAAC;IAE9B,MAAM,IAAI,GAAU;QAClB,KAAK,EAAE,IAAA,mBAAY,EAAC,IAAI,CAAC;QACzB,MAAM,EAAE,IAAA,oBAAa,EAAC,IAAI,CAAC;QAC3B,eAAe;QACf,aAAa;KACd,CAAC;IAEF,MAAM,IAAA,uBAAY,EAAC,IAAI,CAAC,CAAC;IAEzB,MAAM,IAAA,uBAAY,GAAE,CAAC;AACvB,CAAC,CAAA,CAAC;AAjBW,QAAA,IAAI,QAiBf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PrettierOutput } from '../adapter/prettier';
|
|
1
|
+
import type { PrettierOutput } from '../adapter/prettier';
|
|
2
2
|
import type { Input } from './types';
|
|
3
3
|
export declare const runPrettierInCurrentThread: ({ debug }: Input) => Promise<PrettierOutput>;
|
|
4
4
|
export declare const runPrettierInWorkerThread: (input: Input) => Promise<PrettierOutput>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.js","sourceRoot":"","sources":["../../../src/cli/lint/prettier.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,mDAA8C;AAE9C,kDAA0B;AAE1B,iDAAmD;AACnD,+CAAwE;
|
|
1
|
+
{"version":3,"file":"prettier.js","sourceRoot":"","sources":["../../../src/cli/lint/prettier.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,mDAA8C;AAE9C,kDAA0B;AAE1B,iDAAmD;AACnD,+CAAwE;AAExE,kDAAkD;AAIlD,MAAM,UAAU,GAAG,eAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAErC,MAAM,0BAA0B,GAAG,CAAC,EAAE,KAAK,EAAS,EAAE,EAAE,CAC7D,IAAA,sBAAW,EAAC,MAAM,EAAE,IAAA,sBAAY,EAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;AAD1C,QAAA,0BAA0B,8BACgB;AAEhD,MAAM,yBAAyB,GAAG,CAAC,KAAY,EAAE,EAAE,CACxD,IAAA,yBAAgB,EACd,cAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,EACzC,KAAK,CACN,CAAC;AAJS,QAAA,yBAAyB,6BAIlC;AAEJ,IAAI,CAAC,6BAAY,EAAE;IACjB,IAAA,yBAAgB,EAAC,kCAA0B,EAAE,IAAA,sBAAY,EAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;CAC/E"}
|
package/lib/cli/node.js
CHANGED
|
@@ -50,7 +50,7 @@ const node = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
50
50
|
});
|
|
51
51
|
// Run a script with plain `node` to support inspector options.
|
|
52
52
|
// https://github.com/TypeStrong/ts-node#programmatic
|
|
53
|
-
return exec('node', ...args.node, '--require',
|
|
53
|
+
return exec('node', ...args.node, '--require', 'tsconfig-paths/register', '--require', 'ts-node/register/transpile-only', path_1.default.join(__dirname, '..', 'wrapper'), ...args.script);
|
|
54
54
|
}
|
|
55
55
|
// REPL with `ts-node` to support import statements.
|
|
56
56
|
return tsNode
|
package/lib/cli/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/cli/node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AAExB,wDAA+B;AAC/B,gDAAkC;AAElC,wCAA6C;AAC7C,wCAA2C;AAC3C,oDAA+C;AAExC,MAAM,IAAI,GAAG,GAAS,EAAE;IAC7B,MAAM,IAAI,GAAG,IAAA,mBAAY,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjD,MAAM,aAAa,GAAG,MAAM,IAAA,kBAAO,GAAE,CAAC;IAEtC,IAAI,IAAI,CAAC,UAAU,EAAE;QACnB,MAAM,IAAI,GAAG,IAAA,iBAAU,EAAC;YACtB,GAAG,EAAE;gBACH,mBAAmB,EAAE,IAAI,CAAC,UAAU;gBACpC,YAAY,EAAE,MAAM,CAAC,IAAA,qBAAQ,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC;aACtE;SACF,CAAC,CAAC;QAEH,+DAA+D;QAC/D,qDAAqD;QACrD,OAAO,IAAI,CACT,MAAM,EACN,GAAG,IAAI,CAAC,IAAI,EACZ,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/cli/node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AAExB,wDAA+B;AAC/B,gDAAkC;AAElC,wCAA6C;AAC7C,wCAA2C;AAC3C,oDAA+C;AAExC,MAAM,IAAI,GAAG,GAAS,EAAE;IAC7B,MAAM,IAAI,GAAG,IAAA,mBAAY,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjD,MAAM,aAAa,GAAG,MAAM,IAAA,kBAAO,GAAE,CAAC;IAEtC,IAAI,IAAI,CAAC,UAAU,EAAE;QACnB,MAAM,IAAI,GAAG,IAAA,iBAAU,EAAC;YACtB,GAAG,EAAE;gBACH,mBAAmB,EAAE,IAAI,CAAC,UAAU;gBACpC,YAAY,EAAE,MAAM,CAAC,IAAA,qBAAQ,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC;aACtE;SACF,CAAC,CAAC;QAEH,+DAA+D;QAC/D,qDAAqD;QACrD,OAAO,IAAI,CACT,MAAM,EACN,GAAG,IAAI,CAAC,IAAI,EACZ,WAAW,EACX,yBAAyB,EACzB,WAAW,EACX,iCAAiC,EACjC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,EACrC,GAAG,IAAI,CAAC,MAAM,CACf,CAAC;KACH;IAED,oDAAoD;IACpD,OAAO,MAAM;SACV,UAAU,CAAC;QACV,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC;YACvB,OAAO,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;YACjD,aAAa,EAAE,IAAI;SACpB,CAAC;KACH,CAAC;SACD,KAAK,EAAE,CAAC;AACb,CAAC,CAAA,CAAC;AApCW,QAAA,IAAI,QAoCf"}
|
package/lib/cli/start.js
CHANGED
|
@@ -33,7 +33,7 @@ const start = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
33
33
|
__SKUBA_PORT: String((0, validation_1.isIpPort)(args.port) ? args.port : availablePort),
|
|
34
34
|
},
|
|
35
35
|
});
|
|
36
|
-
return execProcess('ts-node-dev', ...args.node, '--require',
|
|
36
|
+
return execProcess('ts-node-dev', ...args.node, '--require', 'tsconfig-paths/register', '--respawn', '--transpile-only', path_1.default.join(__dirname, '..', 'wrapper'), ...args.script);
|
|
37
37
|
});
|
|
38
38
|
exports.start = start;
|
|
39
39
|
//# sourceMappingURL=start.js.map
|
package/lib/cli/start.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/cli/start.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAwB;AAExB,wDAA+B;AAE/B,wCAA6C;AAC7C,wCAA2C;AAC3C,gDAA8D;AAC9D,oDAA+C;AAExC,MAAM,KAAK,GAAG,GAAS,EAAE;IAC9B,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC9C,IAAA,mBAAY,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnC,IAAA,kBAAO,GAAE;KACV,CAAC,CAAC;IAEH,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QACpB,IAAI,CAAC,UAAU,GAAG,MAAM,IAAA,oCAAyB,GAAE,CAAC;KACrD;IAED,MAAM,WAAW,GAAG,IAAA,iBAAU,EAAC;QAC7B,GAAG,EAAE;YACH,mBAAmB,EAAE,IAAI,CAAC,UAAU;YACpC,YAAY,EAAE,MAAM,CAAC,IAAA,qBAAQ,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC;SACtE;KACF,CAAC,CAAC;IAEH,OAAO,WAAW,CAChB,aAAa,EACb,GAAG,IAAI,CAAC,IAAI,EACZ,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/cli/start.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAwB;AAExB,wDAA+B;AAE/B,wCAA6C;AAC7C,wCAA2C;AAC3C,gDAA8D;AAC9D,oDAA+C;AAExC,MAAM,KAAK,GAAG,GAAS,EAAE;IAC9B,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC9C,IAAA,mBAAY,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnC,IAAA,kBAAO,GAAE;KACV,CAAC,CAAC;IAEH,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QACpB,IAAI,CAAC,UAAU,GAAG,MAAM,IAAA,oCAAyB,GAAE,CAAC;KACrD;IAED,MAAM,WAAW,GAAG,IAAA,iBAAU,EAAC;QAC7B,GAAG,EAAE;YACH,mBAAmB,EAAE,IAAI,CAAC,UAAU;YACpC,YAAY,EAAE,MAAM,CAAC,IAAA,qBAAQ,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC;SACtE;KACF,CAAC,CAAC;IAEH,OAAO,WAAW,CAChB,aAAa,EACb,GAAG,IAAI,CAAC,IAAI,EACZ,WAAW,EACX,yBAAyB,EACzB,WAAW,EACX,kBAAkB,EAClB,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,EACrC,GAAG,IAAI,CAAC,MAAM,CACf,CAAC;AACJ,CAAC,CAAA,CAAC;AA3BW,QAAA,KAAK,SA2BhB"}
|
|
File without changes
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.test = void 0;
|
|
4
4
|
const jest_1 = require("jest");
|
|
5
5
|
const test = () => {
|
|
6
|
+
var _a;
|
|
7
|
+
var _b;
|
|
6
8
|
// This is usually set in `jest-cli`'s binary wrapper
|
|
7
|
-
|
|
8
|
-
process.env.NODE_ENV = 'test';
|
|
9
|
-
}
|
|
9
|
+
(_a = (_b = process.env).NODE_ENV) !== null && _a !== void 0 ? _a : (_b.NODE_ENV = 'test');
|
|
10
10
|
const argv = process.argv.slice(2);
|
|
11
11
|
return (0, jest_1.run)(argv);
|
|
12
12
|
};
|
|
13
13
|
exports.test = test;
|
|
14
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/test/index.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAEpB,MAAM,IAAI,GAAG,GAAG,EAAE;;;IACvB,qDAAqD;IACrD,YAAA,OAAO,CAAC,GAAG,EAAC,QAAQ,uCAAR,QAAQ,GAAK,MAAM,EAAC;IAEhC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEnC,OAAO,IAAA,UAAG,EAAC,IAAI,CAAC,CAAC;AACnB,CAAC,CAAC;AAPW,QAAA,IAAI,QAOf"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TestResult } from '@jest/test-result';
|
|
2
|
+
import type * as GitHub from '../../../../api/github';
|
|
3
|
+
export declare const createAnnotations: (testResults: TestResult[]) => GitHub.Annotation[];
|
|
4
|
+
interface AnnotationEntry {
|
|
5
|
+
annotations: GitHub.Annotation[];
|
|
6
|
+
displayName: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare const generateAnnotationEntries: (testResults: TestResult[]) => AnnotationEntry[];
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generateAnnotationEntries = exports.createAnnotations = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
/**
|
|
9
|
+
* Matches the first stack trace location in a Jest failure message.
|
|
10
|
+
*
|
|
11
|
+
* For example, given the following input message:
|
|
12
|
+
*
|
|
13
|
+
* ```console
|
|
14
|
+
* Error: expect(received).toBe(expected) // Object.is equality
|
|
15
|
+
*
|
|
16
|
+
* Expected: "a"
|
|
17
|
+
* Received: "b"
|
|
18
|
+
* at Object.<anonymous> (/workdir/skuba/src/test.test.ts:2:15)
|
|
19
|
+
* at Promise.then.completed (/workdir/skuba/node_modules/jest-circus/build/utils.js:390:28)
|
|
20
|
+
* ...
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* This pattern will produce the following matches:
|
|
24
|
+
*
|
|
25
|
+
* 1. /workdir/skuba/src/test.test.ts
|
|
26
|
+
* 2. 2
|
|
27
|
+
* 2. 15
|
|
28
|
+
*/
|
|
29
|
+
const JEST_LOCATION_REGEX = /\((.+?):(\d+):(\d+)\)/;
|
|
30
|
+
const createAnnotations = (testResults) => {
|
|
31
|
+
const cwd = process.cwd();
|
|
32
|
+
return testResults.flatMap((testResult) => {
|
|
33
|
+
if (testResult.testExecError) {
|
|
34
|
+
return {
|
|
35
|
+
annotation_level: 'failure',
|
|
36
|
+
path: path_1.default.relative(cwd, testResult.testFilePath),
|
|
37
|
+
start_line: 1,
|
|
38
|
+
end_line: 1,
|
|
39
|
+
message: testResult.testExecError.message,
|
|
40
|
+
title: 'Jest',
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (testResult.numFailingTests > 0) {
|
|
44
|
+
return testResult.testResults.flatMap((assertionResult) => assertionResult.failureMessages.flatMap((failureMessage) => {
|
|
45
|
+
const match = JEST_LOCATION_REGEX.exec(failureMessage);
|
|
46
|
+
if ((match === null || match === void 0 ? void 0 : match.length) === 4) {
|
|
47
|
+
return {
|
|
48
|
+
annotation_level: 'failure',
|
|
49
|
+
path: path_1.default.relative(cwd, match[1]),
|
|
50
|
+
start_line: Number(match[2]),
|
|
51
|
+
end_line: Number(match[2]),
|
|
52
|
+
start_column: Number(match[3]),
|
|
53
|
+
end_column: Number(match[3]),
|
|
54
|
+
message: failureMessage,
|
|
55
|
+
title: 'Jest',
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return [];
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
return [];
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
exports.createAnnotations = createAnnotations;
|
|
65
|
+
const DEFAULT_DISPLAY_NAME = Symbol('DEFAULT_DISPLAY_NAME');
|
|
66
|
+
const generateAnnotationEntries = (testResults) => {
|
|
67
|
+
// Group test results by display name.
|
|
68
|
+
const resultsByDisplayName = testResults.reduce((acc, result) => {
|
|
69
|
+
var _a, _b, _c;
|
|
70
|
+
const displayName = (_b = (_a = result.displayName) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : DEFAULT_DISPLAY_NAME;
|
|
71
|
+
((_c = acc[displayName]) !== null && _c !== void 0 ? _c : (acc[displayName] = [])).push(result);
|
|
72
|
+
return acc;
|
|
73
|
+
}, {});
|
|
74
|
+
const defaultResults = resultsByDisplayName[DEFAULT_DISPLAY_NAME];
|
|
75
|
+
const entries = [
|
|
76
|
+
...((defaultResults === null || defaultResults === void 0 ? void 0 : defaultResults.length) ? [[undefined, defaultResults]] : []),
|
|
77
|
+
...Object.entries(resultsByDisplayName),
|
|
78
|
+
];
|
|
79
|
+
// Create annotations for each display name.
|
|
80
|
+
return entries.map(([displayName, results]) => ({
|
|
81
|
+
annotations: (0, exports.createAnnotations)(results),
|
|
82
|
+
displayName,
|
|
83
|
+
}));
|
|
84
|
+
};
|
|
85
|
+
exports.generateAnnotationEntries = generateAnnotationEntries;
|
|
86
|
+
//# sourceMappingURL=annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.js","sourceRoot":"","sources":["../../../../../src/cli/test/reporters/github/annotations.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAMxB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAE7C,MAAM,iBAAiB,GAAG,CAC/B,WAAyB,EACJ,EAAE;IACvB,MAAM,GAAG,GAAG,O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export default class GitHubReporter implements Pick<Reporter, 'onRunComplete'> {
|
|
4
|
+
onRunComplete(_contexts: Set<Context>, { testResults }: AggregatedResult): Promise<void>;
|
|
5
|
+
}
|