skuba 3.15.2 → 3.16.2
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/lib/api/github/checkRun.d.ts +22 -0
- package/lib/api/github/checkRun.js +111 -0
- package/lib/api/github/checkRun.js.map +1 -0
- package/lib/api/github/environment.d.ts +3 -0
- package/lib/api/github/environment.js +21 -0
- package/lib/api/github/environment.js.map +1 -0
- package/lib/api/github/index.d.ts +2 -0
- package/lib/api/github/index.js +6 -0
- package/lib/api/github/index.js.map +1 -0
- package/lib/cli/adapter/eslint.d.ts +7 -0
- package/lib/cli/adapter/eslint.js +21 -9
- package/lib/cli/adapter/eslint.js.map +1 -1
- package/lib/cli/adapter/prettier.d.ts +21 -0
- package/lib/cli/adapter/prettier.js +49 -17
- package/lib/cli/adapter/prettier.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/format.js +2 -0
- package/lib/cli/format.js.map +1 -1
- package/lib/cli/init/getConfig.d.ts +1 -1
- package/lib/cli/lint/annotate/buildkite/eslint.d.ts +2 -0
- package/lib/cli/lint/annotate/buildkite/eslint.js +26 -0
- package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -0
- package/lib/cli/lint/annotate/buildkite/index.d.ts +4 -0
- package/lib/cli/lint/annotate/buildkite/index.js +53 -0
- package/lib/cli/lint/annotate/buildkite/index.js.map +1 -0
- package/lib/cli/lint/annotate/buildkite/prettier.d.ts +2 -0
- package/lib/cli/lint/annotate/buildkite/prettier.js +33 -0
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -0
- package/lib/cli/lint/annotate/buildkite/tsc.d.ts +2 -0
- package/lib/cli/lint/annotate/buildkite/tsc.js +37 -0
- package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -0
- package/lib/cli/lint/annotate/github/eslint.d.ts +3 -0
- package/lib/cli/lint/annotate/github/eslint.js +13 -0
- package/lib/cli/lint/annotate/github/eslint.js.map +1 -0
- package/lib/cli/lint/annotate/github/index.d.ts +4 -0
- package/lib/cli/lint/annotate/github/index.js +61 -0
- package/lib/cli/lint/annotate/github/index.js.map +1 -0
- package/lib/cli/lint/annotate/github/prettier.d.ts +3 -0
- package/lib/cli/lint/annotate/github/prettier.js +16 -0
- package/lib/cli/lint/annotate/github/prettier.js.map +1 -0
- package/lib/cli/lint/annotate/github/tsc.d.ts +3 -0
- package/lib/cli/lint/annotate/github/tsc.js +59 -0
- package/lib/cli/lint/annotate/github/tsc.js.map +1 -0
- package/lib/cli/lint/annotate/index.d.ts +4 -0
- package/lib/cli/lint/annotate/index.js +22 -0
- package/lib/cli/lint/annotate/index.js.map +1 -0
- package/lib/cli/lint/external.d.ts +7 -0
- package/lib/cli/lint/external.js +13 -36
- 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/types.d.ts +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/args.d.ts +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/worker.d.ts +0 -1
- package/lib/wrapper/functionHandler.js +4 -1
- package/lib/wrapper/functionHandler.js.map +1 -1
- package/package.json +15 -8
- package/template/base/_.gitignore +1 -0
- package/template/base/_.prettierignore +2 -0
- package/template/express-rest-api/.buildkite/pipeline.yml +4 -4
- package/template/express-rest-api/.nvmrc +1 -1
- package/template/express-rest-api/Dockerfile +1 -1
- package/template/express-rest-api/Dockerfile.dev-deps +1 -1
- package/template/express-rest-api/docker-compose.yml +4 -2
- package/template/express-rest-api/package.json +5 -5
- package/template/express-rest-api/src/framework/logging.ts +2 -1
- package/template/greeter/.buildkite/pipeline.yml +1 -1
- package/template/greeter/.nvmrc +1 -1
- package/template/greeter/Dockerfile +1 -1
- package/template/greeter/docker-compose.yml +4 -2
- package/template/greeter/package.json +2 -2
- package/template/koa-rest-api/.buildkite/pipeline.yml +4 -4
- package/template/koa-rest-api/.nvmrc +1 -1
- package/template/koa-rest-api/Dockerfile +1 -1
- package/template/koa-rest-api/Dockerfile.dev-deps +1 -1
- package/template/koa-rest-api/docker-compose.yml +4 -2
- package/template/koa-rest-api/package.json +11 -11
- package/template/koa-rest-api/src/framework/logging.ts +2 -1
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +2 -2
- package/template/lambda-sqs-worker/docker-compose.yml +3 -1
- package/template/lambda-sqs-worker/package.json +9 -9
- package/template/lambda-sqs-worker/serverless.yml +1 -0
- package/template/lambda-sqs-worker/src/framework/handler.ts +2 -2
- package/template/lambda-sqs-worker/src/framework/logging.ts +2 -1
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
- package/template/lambda-sqs-worker-cdk/docker-compose.yml +3 -1
- package/template/lambda-sqs-worker-cdk/package.json +2 -2
- package/template/oss-npm-package/.github/workflows/release.yml +2 -2
- package/template/oss-npm-package/.github/workflows/validate.yml +2 -2
- package/template/oss-npm-package/.nvmrc +1 -1
- package/template/oss-npm-package/_package.json +1 -1
- package/template/private-npm-package/.nvmrc +1 -1
- package/template/private-npm-package/_package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.createPrettierAnnotations = void 0;
|
|
23
|
+
const Buildkite = __importStar(require("../../../../api/buildkite"));
|
|
24
|
+
const createPrettierAnnotations = (prettier) => !prettier.ok
|
|
25
|
+
? [
|
|
26
|
+
'**Prettier**',
|
|
27
|
+
Buildkite.md.terminal(prettier.result.errored
|
|
28
|
+
.map(({ err, filepath }) => [filepath, ...(err ? [String(err)] : [])].join(' '))
|
|
29
|
+
.join('\n')),
|
|
30
|
+
]
|
|
31
|
+
: [];
|
|
32
|
+
exports.createPrettierAnnotations = createPrettierAnnotations;
|
|
33
|
+
//# sourceMappingURL=prettier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettier.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/buildkite/prettier.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qEAAuD;AAGhD,MAAM,yBAAyB,GAAG,CAAC,QAAwB,EAAY,EAAE,CAC9E,CAAC,QAAQ,CAAC,EAAE;IACV,CAAC,CAAC;QACE,cAAc;QACd,SAAS,CAAC,EAAE,CAAC,QAAQ,CACnB,QAAQ,CAAC,MAAM,CAAC,OAAO;aACpB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CACzB,CAAC,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CACpD;aACA,IAAI,CAAC,IAAI,CAAC,CACd;KACF;IACH,CAAC,CAAC,EAAE,CAAC;AAZI,QAAA,yBAAyB,6BAY7B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.createTscAnnotations = void 0;
|
|
23
|
+
const Buildkite = __importStar(require("../../../../api/buildkite"));
|
|
24
|
+
const createTscAnnotations = (tscOk, tscOutputStream) => !tscOk
|
|
25
|
+
? [
|
|
26
|
+
'**tsc**',
|
|
27
|
+
Buildkite.md.terminal(tscOutputStream
|
|
28
|
+
.output()
|
|
29
|
+
.split('\n')
|
|
30
|
+
.filter(Boolean)
|
|
31
|
+
.filter((line) => !line.startsWith('TSFILE: '))
|
|
32
|
+
.join('\n')
|
|
33
|
+
.trim()),
|
|
34
|
+
]
|
|
35
|
+
: [];
|
|
36
|
+
exports.createTscAnnotations = createTscAnnotations;
|
|
37
|
+
//# sourceMappingURL=tsc.js.map
|
|
@@ -0,0 +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,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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createEslintAnnotations = void 0;
|
|
4
|
+
const createEslintAnnotations = (eslint) => [...eslint.errors, ...eslint.warnings].flatMap((result) => result.messages.map((message) => {
|
|
5
|
+
var _a, _b, _c;
|
|
6
|
+
// Annotations only support start_column and end_column on the same line.
|
|
7
|
+
const isSameLine = message.line === message.endLine;
|
|
8
|
+
const startColumn = isSameLine && message.column;
|
|
9
|
+
const endColumn = (isSameLine && message.endColumn) || startColumn;
|
|
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
|
+
}));
|
|
12
|
+
exports.createEslintAnnotations = createEslintAnnotations;
|
|
13
|
+
//# sourceMappingURL=eslint.js.map
|
|
@@ -0,0 +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,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"}
|
|
@@ -0,0 +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) => Promise<void>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.createGitHubAnnotations = void 0;
|
|
32
|
+
const GitHub = __importStar(require("../../../../api/github"));
|
|
33
|
+
const environment_1 = require("../../../../api/github/environment");
|
|
34
|
+
const eslint_1 = require("./eslint");
|
|
35
|
+
const prettier_1 = require("./prettier");
|
|
36
|
+
const tsc_1 = require("./tsc");
|
|
37
|
+
const createGitHubAnnotations = (eslint, prettier, tscOk, tscOutputStream) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
if (!(0, environment_1.enabledFromEnvironment)()) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const annotations = [
|
|
42
|
+
...(0, eslint_1.createEslintAnnotations)(eslint),
|
|
43
|
+
...(0, prettier_1.createPrettierAnnotations)(prettier),
|
|
44
|
+
...(0, tsc_1.createTscAnnotations)(tscOk, tscOutputStream),
|
|
45
|
+
];
|
|
46
|
+
const isOk = eslint.ok && prettier.ok && tscOk;
|
|
47
|
+
const conclusion = isOk ? 'success' : 'failure';
|
|
48
|
+
const summary = isOk
|
|
49
|
+
? '`skuba lint` passed.'
|
|
50
|
+
: '`skuba lint` found issues that require triage.';
|
|
51
|
+
const build = (0, environment_1.buildNameFromEnvironment)();
|
|
52
|
+
yield GitHub.createCheckRun({
|
|
53
|
+
name: 'skuba/lint',
|
|
54
|
+
summary,
|
|
55
|
+
annotations,
|
|
56
|
+
conclusion,
|
|
57
|
+
title: `${build} ${isOk ? 'passed' : 'failed'}`,
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
exports.createGitHubAnnotations = createGitHubAnnotations;
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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;IAC/C,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IAEhD,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;QACV,KAAK,EAAE,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;KAChD,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAhCW,QAAA,uBAAuB,2BAgClC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPrettierAnnotations = void 0;
|
|
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
|
+
});
|
|
15
|
+
exports.createPrettierAnnotations = createPrettierAnnotations;
|
|
16
|
+
//# sourceMappingURL=prettier.js.map
|
|
@@ -0,0 +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;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"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.createTscAnnotations = void 0;
|
|
7
|
+
const strip_ansi_1 = __importDefault(require("strip-ansi"));
|
|
8
|
+
/**
|
|
9
|
+
* Matches the `tsc │` prefix on each `tsc` log.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Matches regular and pretty `tsc` output.
|
|
13
|
+
*
|
|
14
|
+
* For example, given the following input string:
|
|
15
|
+
*
|
|
16
|
+
* ```console
|
|
17
|
+
* src/skuba.ts:43:7 - error TS2769: No overload matches this call.
|
|
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'.
|
|
33
|
+
*/
|
|
34
|
+
const tscOutputRegex = /([^\s].*)[\(:](\d+)[,:](\d+)(?:\):\s+|\s+-\s+)(error|warning|info)\s+TS(\d+)\s*:\s*([\s\S]*?)(?=\n\S)(?=\n\D)/g;
|
|
35
|
+
const annotationLevelMap = {
|
|
36
|
+
error: 'failure',
|
|
37
|
+
warning: 'warning',
|
|
38
|
+
info: 'notice',
|
|
39
|
+
};
|
|
40
|
+
const createTscAnnotations = (tscOk, tscOutputStream) => {
|
|
41
|
+
if (tscOk) {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
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
|
+
: []);
|
|
57
|
+
};
|
|
58
|
+
exports.createTscAnnotations = createTscAnnotations;
|
|
59
|
+
//# sourceMappingURL=tsc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsc.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/github/tsc.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAmC;AAOnC;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,cAAc,GAClB,gHAAgH,CAAC;AAEnH,MAAM,kBAAkB,GAGpB;IACF,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,QAAQ;CACf,CAAC;AAEK,MAAM,oBAAoB,GAAG,CAClC,KAAc,EACd,eAAkC,EACb,EAAE;IACvB,IAAI,KAAK,EAAE;QACT,OAAO,EAAE,CAAC;KACX;IAED,MAAM,OAAO,GAAG,IAAA,oBAAS,EAAC,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC7E,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAoB,CAAC,KAAK,EAAE,EAAE,CAC9D,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,MAAK,CAAC;QACjB,CAAC,CAAC;YACE,gBAAgB,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAa,CAAC;YAC1D,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;YACd,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC5B,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC1B,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9B,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC5B,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;YACxB,KAAK,EAAE,UAAU,KAAK,CAAC,CAAC,CAAC,GAAG;SAC7B;QACH,CAAC,CAAC,EAAE,CACP,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,oBAAoB,wBAuB/B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
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) => Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.createAnnotations = void 0;
|
|
13
|
+
const buildkite_1 = require("./buildkite");
|
|
14
|
+
const github_1 = require("./github");
|
|
15
|
+
const createAnnotations = (eslint, prettier, tscOk, tscOutputStream) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
yield Promise.all([
|
|
17
|
+
(0, github_1.createGitHubAnnotations)(eslint, prettier, tscOk, tscOutputStream),
|
|
18
|
+
(0, buildkite_1.createBuildkiteAnnotations)(eslint, prettier, tscOk, tscOutputStream),
|
|
19
|
+
]);
|
|
20
|
+
});
|
|
21
|
+
exports.createAnnotations = createAnnotations;
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,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"}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import stream from 'stream';
|
|
1
3
|
import type { Input } from './types';
|
|
4
|
+
export declare class StreamInterceptor extends stream.Transform {
|
|
5
|
+
private chunks;
|
|
6
|
+
output(): string;
|
|
7
|
+
_transform(chunk: any, _encoding: BufferEncoding, callback: stream.TransformCallback): void;
|
|
8
|
+
}
|
|
2
9
|
export declare const externalLint: (input: Input) => Promise<void>;
|
package/lib/cli/lint/external.js
CHANGED
|
@@ -23,26 +23,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.externalLint = void 0;
|
|
26
|
+
exports.externalLint = exports.StreamInterceptor = void 0;
|
|
27
27
|
const stream_1 = __importDefault(require("stream"));
|
|
28
|
-
const __1 = require("../..");
|
|
29
28
|
const logging_1 = require("../../utils/logging");
|
|
29
|
+
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);
|
|
43
44
|
callback(null, chunk);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
47
|
+
exports.StreamInterceptor = StreamInterceptor;
|
|
46
48
|
const lintConcurrently = (_a) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
49
|
var { tscOutputStream } = _a, input = __rest(_a, ["tscOutputStream"]);
|
|
48
50
|
const [eslint, prettier, tscOk] = yield Promise.all([
|
|
@@ -86,6 +88,13 @@ const externalLint = (input) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
86
88
|
const tscOutputStream = new StreamInterceptor();
|
|
87
89
|
tscOutputStream.pipe((_c = input.tscOutputStream) !== null && _c !== void 0 ? _c : process.stdout);
|
|
88
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
|
+
}
|
|
89
98
|
if (eslint.ok && prettier.ok && tscOk) {
|
|
90
99
|
return;
|
|
91
100
|
}
|
|
@@ -95,39 +104,7 @@ const externalLint = (input) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
95
104
|
...(tscOk ? [] : ['tsc']),
|
|
96
105
|
];
|
|
97
106
|
logging_1.log.newline();
|
|
98
|
-
logging_1.log.err(tools.join(', ')
|
|
99
|
-
const buildkiteOutput = [
|
|
100
|
-
'`skuba lint` found issues that require triage:',
|
|
101
|
-
...(eslint.ok
|
|
102
|
-
? []
|
|
103
|
-
: ['**ESLint**', __1.Buildkite.md.terminal(eslint.output.trim())]),
|
|
104
|
-
...(prettier.ok
|
|
105
|
-
? []
|
|
106
|
-
: [
|
|
107
|
-
'**Prettier**',
|
|
108
|
-
__1.Buildkite.md.terminal(prettier.result.errored
|
|
109
|
-
.map(({ err, filepath }) => [filepath, ...(err ? [String(err)] : [])].join(' '))
|
|
110
|
-
.join('\n')),
|
|
111
|
-
]),
|
|
112
|
-
...(tscOk
|
|
113
|
-
? []
|
|
114
|
-
: [
|
|
115
|
-
'**tsc**',
|
|
116
|
-
__1.Buildkite.md.terminal(tscOutputStream
|
|
117
|
-
.output()
|
|
118
|
-
.split('\n')
|
|
119
|
-
.filter(Boolean)
|
|
120
|
-
.map((line) => line.replace(/^tsc\s+│ /, ''))
|
|
121
|
-
.filter((line) => !line.startsWith('TSFILE: '))
|
|
122
|
-
.join('\n')
|
|
123
|
-
.trim()),
|
|
124
|
-
]),
|
|
125
|
-
].join('\n\n');
|
|
126
|
-
yield __1.Buildkite.annotate(buildkiteOutput, {
|
|
127
|
-
context: 'skuba-lint-external',
|
|
128
|
-
scopeContextToStep: true,
|
|
129
|
-
style: 'error',
|
|
130
|
-
});
|
|
107
|
+
logging_1.log.err(`${tools.join(', ')} found issues that require triage.`);
|
|
131
108
|
process.exitCode = 1;
|
|
132
109
|
});
|
|
133
110
|
exports.externalLint = externalLint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external.js","sourceRoot":"","sources":["../../../src/cli/lint/external.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,
|
|
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,MAAM,cAAc,GAAG,sBAAsB,CAAC;AAE9C,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,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,UAAU,CACR,KAAU,EACV,SAAyB,EACzB,QAAkC;Q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C,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"}
|
package/lib/cli/lint/types.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface Input {
|
|
|
9
9
|
/**
|
|
10
10
|
* Whether to disable parallelism to run linting operations serially.
|
|
11
11
|
*
|
|
12
|
-
* This can be useful for executing in
|
|
12
|
+
* This can be useful for executing in resource-constrained environments and
|
|
13
13
|
* snapshotting deterministic output in tests.
|
|
14
14
|
*
|
|
15
15
|
* Defaults to `false`.
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -30,7 +30,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.Net = exports.Jest = exports.Buildkite = void 0;
|
|
33
|
+
exports.Net = exports.Jest = exports.Buildkite = exports.GitHub = void 0;
|
|
34
|
+
exports.GitHub = __importStar(require("./api/github"));
|
|
34
35
|
exports.Buildkite = __importStar(require("./api/buildkite"));
|
|
35
36
|
exports.Jest = __importStar(require("./api/jest"));
|
|
36
37
|
exports.Net = __importStar(require("./api/net"));
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;AAEH,6DAA6C;AAC7C,mDAAmC;AACnC,iDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;AAEH,uDAAuC;AACvC,6DAA6C;AAC7C,mDAAmC;AACnC,iDAAiC"}
|
package/lib/utils/args.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const hasSerialFlag: (args?: string[], env?: NodeJS.ProcessEnv) =
|
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
export declare const parseProcessArgs: (args?: string[]) => {
|
|
18
|
-
commandName: "
|
|
18
|
+
commandName: "test" | "release" | "format" | "node" | "version" | "build" | "build-package" | "configure" | "help" | "init" | "lint" | "start";
|
|
19
19
|
args: string[];
|
|
20
20
|
};
|
|
21
21
|
interface RunArgs {
|
package/lib/utils/logging.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export declare type Logger = typeof log;
|
|
|
3
3
|
export declare const createLogger: (debug: boolean, ...prefixes: unknown[]) => {
|
|
4
4
|
bold: chalk.Chalk;
|
|
5
5
|
formatSubtle: chalk.Chalk;
|
|
6
|
-
pluralise: (count: number, subject: string) => string;
|
|
7
6
|
timing: (start: bigint, end: bigint) => string;
|
|
8
7
|
debug: (...message: unknown[]) => void;
|
|
9
8
|
subtle: (...message: unknown[]) => void;
|
|
@@ -16,7 +15,6 @@ export declare const createLogger: (debug: boolean, ...prefixes: unknown[]) => {
|
|
|
16
15
|
export declare const log: {
|
|
17
16
|
bold: chalk.Chalk;
|
|
18
17
|
formatSubtle: chalk.Chalk;
|
|
19
|
-
pluralise: (count: number, subject: string) => string;
|
|
20
18
|
timing: (start: bigint, end: bigint) => string;
|
|
21
19
|
debug: (...message: unknown[]) => void;
|
|
22
20
|
subtle: (...message: unknown[]) => void;
|
|
@@ -26,3 +24,4 @@ export declare const log: {
|
|
|
26
24
|
plain: (...message: unknown[]) => void;
|
|
27
25
|
warn: (...message: unknown[]) => void;
|
|
28
26
|
};
|
|
27
|
+
export declare const pluralise: (count: number, subject: string) => string;
|
package/lib/utils/logging.js
CHANGED
|
@@ -4,14 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.log = exports.createLogger = void 0;
|
|
7
|
+
exports.pluralise = exports.log = exports.createLogger = void 0;
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const createLogger = (debug, ...prefixes) => {
|
|
10
10
|
const log = (...message) => console.log(...prefixes, ...message);
|
|
11
11
|
return {
|
|
12
12
|
bold: chalk_1.default.bold,
|
|
13
13
|
formatSubtle: chalk_1.default.grey,
|
|
14
|
-
pluralise: (count, subject) => `${count} ${subject}${count === 1 ? '' : 's'}`,
|
|
15
14
|
timing: (start, end) => `${Number((end - start) / BigInt(10000000)) / 100}s`,
|
|
16
15
|
debug: (...message) => debug ? log(chalk_1.default.grey(...message)) : undefined,
|
|
17
16
|
subtle: (...message) => log(chalk_1.default.grey(...message)),
|
|
@@ -24,4 +23,6 @@ const createLogger = (debug, ...prefixes) => {
|
|
|
24
23
|
};
|
|
25
24
|
exports.createLogger = createLogger;
|
|
26
25
|
exports.log = (0, exports.createLogger)(false);
|
|
26
|
+
const pluralise = (count, subject) => `${count} ${subject}${count === 1 ? '' : 's'}`;
|
|
27
|
+
exports.pluralise = pluralise;
|
|
27
28
|
//# sourceMappingURL=logging.js.map
|
package/lib/utils/logging.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/utils/logging.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;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C,GAAG,OAAO,CAAC,CAAC;QAC1D,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE;QACpB,EAAE,EAAE,CAAC,GAAG,OAAkB,EAAE,EAAE,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC;QAC3D,KAAK,EAAE,CAAC,GAAG,OAAkB,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;QACjD,IAAI,EAAE,CAAC,GAAG,OAAkB,EAAE,EAAE,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC;KAC/D,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,YAAY,gBAmBvB;AAEW,QAAA,GAAG,GAAG,IAAA,oBAAY,EAAC,KAAK,CAAC,CAAC;AAEhC,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,OAAe,EAAE,EAAE,CAC1D,GAAG,KAAK,IAAI,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AADpC,QAAA,SAAS,aAC2B"}
|
package/lib/utils/worker.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ export declare const execWorkerThread: <Input, Output>(filepath: string, input:
|
|
|
9
9
|
export declare const postWorkerOutput: <Input, Output>(fn: (input: Input) => Promise<Output>, logger?: {
|
|
10
10
|
bold: import("chalk").Chalk;
|
|
11
11
|
formatSubtle: import("chalk").Chalk;
|
|
12
|
-
pluralise: (count: number, subject: string) => string;
|
|
13
12
|
timing: (start: bigint, end: bigint) => string;
|
|
14
13
|
debug: (...message: unknown[]) => void;
|
|
15
14
|
subtle: (...message: unknown[]) => void;
|
|
@@ -30,7 +30,10 @@ const runFunctionHandler = ({ availablePort, entryPoint, functionName, }) => __a
|
|
|
30
30
|
logging_1.log.subtle(logging_1.log.bold(functionName), 'is not a function');
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
logging_1.log.warn(logging_1.log.bold(functionName), `(${(0, function_arguments_1.default)(fn)
|
|
33
|
+
logging_1.log.warn(logging_1.log.bold(functionName), `(${(0, function_arguments_1.default)(fn)
|
|
34
|
+
// Add a `?` placeholder for unnamed arguments.
|
|
35
|
+
.map((arg) => arg || '?')
|
|
36
|
+
.join(', ')})`);
|
|
34
37
|
const requestListener = (0, http_1.createRequestListenerFromFunction)(fn);
|
|
35
38
|
return (0, http_1.serveRequestListener)(requestListener, availablePort);
|
|
36
39
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functionHandler.js","sourceRoot":"","sources":["../../src/wrapper/functionHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4EAAwC;AAExC,8CAAuC;AACvC,oDAA2D;AAE3D,iCAGgB;AAQhB;;GAEG;AACI,MAAM,kBAAkB,GAAG,CAAO,EACvC,aAAa,EACb,UAAU,EACV,YAAY,GACP,EAAiB,EAAE;IACxB,IAAI,CAAC,IAAA,qBAAQ,EAAC,UAAU,CAAC,EAAE;QACzB,aAAG,CAAC,MAAM,CAAC,aAAG,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC,CAAC;QACtD,OAAO;KACR;IAED,MAAM,EAAE,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IAEpC,IAAI,CAAC,IAAA,uBAAU,EAAC,EAAE,CAAC,EAAE;QACnB,aAAG,CAAC,MAAM,CAAC,aAAG,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC,CAAC;QACxD,OAAO;KACR;IAED,aAAG,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"functionHandler.js","sourceRoot":"","sources":["../../src/wrapper/functionHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4EAAwC;AAExC,8CAAuC;AACvC,oDAA2D;AAE3D,iCAGgB;AAQhB;;GAEG;AACI,MAAM,kBAAkB,GAAG,CAAO,EACvC,aAAa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