skuba 4.2.1-beta.0 → 4.3.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/README.md +1 -1
- package/jest-preset.js +5 -1
- package/lib/api/git/index.d.ts +1 -0
- package/lib/api/git/index.js +3 -1
- package/lib/api/git/index.js.map +1 -1
- package/lib/api/git/pull.d.ts +35 -0
- package/lib/api/git/pull.js +34 -0
- package/lib/api/git/pull.js.map +1 -0
- package/lib/api/github/index.d.ts +1 -0
- package/lib/api/github/index.js +5 -1
- package/lib/api/github/index.js.map +1 -1
- package/lib/api/github/push.d.ts +62 -0
- package/lib/api/github/push.js +133 -0
- package/lib/api/github/push.js.map +1 -0
- package/lib/api/jest/index.d.ts +26 -11
- package/lib/cli/adapter/eslint.d.ts +2 -1
- package/lib/cli/adapter/eslint.js +5 -1
- package/lib/cli/adapter/eslint.js.map +1 -1
- package/lib/cli/configure/analysis/diff.d.ts +1 -1
- package/lib/cli/configure/analysis/package.d.ts +1 -1
- package/lib/cli/configure/processing/ignoreFile.d.ts +1 -1
- package/lib/cli/configure/processing/javascript.d.ts +1 -1
- package/lib/cli/configure/processing/json.d.ts +1 -1
- package/lib/cli/configure/processing/package.d.ts +11 -11
- package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
- package/lib/cli/lint/autofix.d.ts +7 -1
- package/lib/cli/lint/autofix.js +35 -18
- package/lib/cli/lint/autofix.js.map +1 -1
- package/lib/cli/lint/external.d.ts +1 -0
- package/lib/cli/lint/external.js +16 -16
- package/lib/cli/lint/external.js.map +1 -1
- package/lib/cli/test/reporters/github/annotations.js +19 -7
- package/lib/cli/test/reporters/github/annotations.js.map +1 -1
- package/lib/cli/test/reporters/github/index.d.ts +2 -2
- package/lib/cli/test/reporters/github/index.js +11 -1
- package/lib/cli/test/reporters/github/index.js.map +1 -1
- package/lib/utils/args.js +1 -1
- package/lib/utils/args.js.map +1 -1
- package/lib/utils/error.d.ts +14 -0
- package/lib/utils/error.js +14 -1
- package/lib/utils/error.js.map +1 -1
- package/lib/utils/version.js +3 -4
- package/lib/utils/version.js.map +1 -1
- package/lib/utils/wait.d.ts +17 -0
- package/lib/utils/wait.js +32 -0
- package/lib/utils/wait.js.map +1 -0
- package/lib/wrapper/http.d.ts +1 -1
- package/package.json +23 -20
- package/template/express-rest-api/.buildkite/pipeline.yml +5 -4
- package/template/express-rest-api/package.json +1 -1
- package/template/greeter/.buildkite/pipeline.yml +2 -1
- package/template/koa-rest-api/.buildkite/pipeline.yml +5 -4
- package/template/koa-rest-api/package.json +6 -6
- package/template/koa-rest-api/src/api/jobs/getJobs.ts +2 -2
- package/template/koa-rest-api/src/api/jobs/postJob.ts +2 -2
- package/template/koa-rest-api/src/framework/logging.ts +8 -5
- package/template/koa-rest-api/src/framework/metrics.ts +2 -2
- package/template/koa-rest-api/src/framework/server.test.ts +21 -21
- package/template/koa-rest-api/src/framework/server.ts +4 -3
- package/template/koa-rest-api/src/listen.ts +2 -2
- package/template/koa-rest-api/src/testing/logging.ts +5 -20
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +2 -1
- package/template/lambda-sqs-worker/.nvmrc +1 -1
- package/template/lambda-sqs-worker/Dockerfile +1 -1
- package/template/lambda-sqs-worker/package.json +5 -5
- package/template/lambda-sqs-worker/serverless.yml +2 -2
- package/template/lambda-sqs-worker/src/app.test.ts +9 -9
- package/template/lambda-sqs-worker/src/app.ts +2 -1
- package/template/lambda-sqs-worker/src/framework/handler.test.ts +10 -10
- package/template/lambda-sqs-worker/src/framework/handler.ts +14 -17
- package/template/lambda-sqs-worker/src/framework/logging.ts +11 -6
- package/template/lambda-sqs-worker/src/testing/logging.ts +7 -5
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -1
- package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
- package/template/lambda-sqs-worker-cdk/Dockerfile +1 -1
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +2 -2
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +1 -1
- package/template/lambda-sqs-worker-cdk/package.json +9 -11
- package/template/private-npm-package/.buildkite/pipeline.yml +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://github.com/seek-oss/skuba/actions?query=workflow%3ARelease)
|
|
6
6
|
[](https://github.com/seek-oss/skuba/actions?query=workflow%3AValidate)
|
|
7
|
-
[](https://nodejs.org/en/)
|
|
8
8
|
[](https://www.npmjs.com/package/skuba)
|
|
9
9
|
|
|
10
10
|
---
|
package/jest-preset.js
CHANGED
|
@@ -21,10 +21,14 @@ module.exports = {
|
|
|
21
21
|
'!<rootDir>/jest.*.ts',
|
|
22
22
|
],
|
|
23
23
|
coverageDirectory: 'coverage',
|
|
24
|
+
reporters: ['default', require.resolve('./lib/cli/test/reporters/github')],
|
|
24
25
|
testEnvironment: 'node',
|
|
25
26
|
testPathIgnorePatterns: [
|
|
26
27
|
'/node_modules.*/',
|
|
27
28
|
'<rootDir>/(coverage|dist|lib|tmp).*/',
|
|
28
29
|
],
|
|
29
|
-
|
|
30
|
+
watchPlugins: [
|
|
31
|
+
require.resolve('jest-watch-typeahead/filename'),
|
|
32
|
+
require.resolve('jest-watch-typeahead/testname'),
|
|
33
|
+
],
|
|
30
34
|
};
|
package/lib/api/git/index.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export { getChangedFiles } from './getChangedFiles';
|
|
|
5
5
|
export { getHeadCommitId, getHeadCommitMessage } from './log';
|
|
6
6
|
export { getOwnerAndRepo } from './remote';
|
|
7
7
|
export { push } from './push';
|
|
8
|
+
export { fastForwardBranch } from './pull';
|
|
8
9
|
export { reset } from './reset';
|
package/lib/api/git/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reset = exports.push = exports.getOwnerAndRepo = exports.getHeadCommitMessage = exports.getHeadCommitId = exports.getChangedFiles = exports.currentBranch = exports.commitAllChanges = exports.commit = void 0;
|
|
3
|
+
exports.reset = exports.fastForwardBranch = exports.push = exports.getOwnerAndRepo = exports.getHeadCommitMessage = exports.getHeadCommitId = exports.getChangedFiles = exports.currentBranch = exports.commitAllChanges = exports.commit = void 0;
|
|
4
4
|
var commit_1 = require("./commit");
|
|
5
5
|
Object.defineProperty(exports, "commit", { enumerable: true, get: function () { return commit_1.commit; } });
|
|
6
6
|
var commitAllChanges_1 = require("./commitAllChanges");
|
|
@@ -16,6 +16,8 @@ var remote_1 = require("./remote");
|
|
|
16
16
|
Object.defineProperty(exports, "getOwnerAndRepo", { enumerable: true, get: function () { return remote_1.getOwnerAndRepo; } });
|
|
17
17
|
var push_1 = require("./push");
|
|
18
18
|
Object.defineProperty(exports, "push", { enumerable: true, get: function () { return push_1.push; } });
|
|
19
|
+
var pull_1 = require("./pull");
|
|
20
|
+
Object.defineProperty(exports, "fastForwardBranch", { enumerable: true, get: function () { return pull_1.fastForwardBranch; } });
|
|
19
21
|
var reset_1 = require("./reset");
|
|
20
22
|
Object.defineProperty(exports, "reset", { enumerable: true, get: function () { return reset_1.reset; } });
|
|
21
23
|
//# sourceMappingURL=index.js.map
|
package/lib/api/git/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/git/index.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,6BAA8D;AAArD,sGAAA,eAAe,OAAA;AAAE,2GAAA,oBAAoB,OAAA;AAC9C,mCAA2C;AAAlC,yGAAA,eAAe,OAAA;AACxB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,iCAAgC;AAAvB,8FAAA,KAAK,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/git/index.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,6BAA8D;AAArD,sGAAA,eAAe,OAAA;AAAE,2GAAA,oBAAoB,OAAA;AAC9C,mCAA2C;AAAlC,yGAAA,eAAe,OAAA;AACxB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,+BAA2C;AAAlC,yGAAA,iBAAiB,OAAA;AAC1B,iCAAgC;AAAvB,8FAAA,KAAK,OAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use a GitHub app token to auth the Git push.
|
|
3
|
+
*
|
|
4
|
+
* This defaults to the `GITHUB_API_TOKEN` and `GITHUB_TOKEN` environment
|
|
5
|
+
* variables if `token` is not provided.
|
|
6
|
+
*/
|
|
7
|
+
interface GitHubAppAuth {
|
|
8
|
+
type: 'gitHubApp';
|
|
9
|
+
token?: string;
|
|
10
|
+
}
|
|
11
|
+
interface PullParameters {
|
|
12
|
+
/**
|
|
13
|
+
* The auth mechanism for the push.
|
|
14
|
+
*
|
|
15
|
+
* Currently, only GitHub app tokens are supported.
|
|
16
|
+
*/
|
|
17
|
+
auth: GitHubAppAuth;
|
|
18
|
+
dir: string;
|
|
19
|
+
/**
|
|
20
|
+
* The branch to merge into
|
|
21
|
+
*/
|
|
22
|
+
ref: string;
|
|
23
|
+
remote?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The destination branch or tag on the remote.
|
|
26
|
+
*
|
|
27
|
+
* This defaults to `ref`.
|
|
28
|
+
*/
|
|
29
|
+
remoteRef?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Fast forwards the local branch to the remote state
|
|
33
|
+
*/
|
|
34
|
+
export declare const fastForwardBranch: ({ auth, dir, ref, remote, remoteRef, }: PullParameters) => Promise<void>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
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.fastForwardBranch = void 0;
|
|
7
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const isomorphic_git_1 = __importDefault(require("isomorphic-git"));
|
|
9
|
+
const node_1 = __importDefault(require("isomorphic-git/http/node"));
|
|
10
|
+
const environment_1 = require("../github/environment");
|
|
11
|
+
const remote_1 = require("./remote");
|
|
12
|
+
/**
|
|
13
|
+
* Fast forwards the local branch to the remote state
|
|
14
|
+
*/
|
|
15
|
+
const fastForwardBranch = async ({ auth, dir, ref, remote, remoteRef, }) => {
|
|
16
|
+
const { owner, repo } = await (0, remote_1.getOwnerAndRepo)({ dir });
|
|
17
|
+
const url = `https://github.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`;
|
|
18
|
+
return isomorphic_git_1.default.fastForward({
|
|
19
|
+
onAuth: () => ({
|
|
20
|
+
username: 'x-access-token',
|
|
21
|
+
password: auth.token ?? (0, environment_1.apiTokenFromEnvironment)(),
|
|
22
|
+
}),
|
|
23
|
+
dir,
|
|
24
|
+
fs: fs_extra_1.default,
|
|
25
|
+
http: node_1.default,
|
|
26
|
+
ref,
|
|
27
|
+
remote,
|
|
28
|
+
remoteRef,
|
|
29
|
+
url,
|
|
30
|
+
singleBranch: true,
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
exports.fastForwardBranch = fastForwardBranch;
|
|
34
|
+
//# sourceMappingURL=pull.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pull.js","sourceRoot":"","sources":["../../../src/api/git/pull.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA0B;AAC1B,oEAAiC;AACjC,oEAA4C;AAE5C,uDAAgE;AAEhE,qCAA2C;AAsC3C;;GAEG;AACI,MAAM,iBAAiB,GAAG,KAAK,EAAE,EACtC,IAAI,EACJ,GAAG,EACH,GAAG,EACH,MAAM,EACN,SAAS,GACM,EAAE,EAAE;IACnB,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,wBAAe,EAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAEvD,MAAM,GAAG,GAAG,sBAAsB,kBAAkB,CAClD,KAAK,CACN,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;IAEhC,OAAO,wBAAG,CAAC,WAAW,CAAC;QACrB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;YACb,QAAQ,EAAE,gBAAgB;YAC1B,QAAQ,EAAE,IAAI,CAAC,KAAK,IAAI,IAAA,qCAAuB,GAAE;SAClD,CAAC;QACF,GAAG;QACH,EAAE,EAAF,kBAAE;QACF,IAAI,EAAJ,cAAI;QACJ,GAAG;QACH,MAAM;QACN,SAAS;QACT,GAAG;QACH,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC,CAAC;AA3BW,QAAA,iBAAiB,qBA2B5B"}
|
|
@@ -4,3 +4,4 @@ export { createCheckRun } from './checkRun';
|
|
|
4
4
|
export { enabledFromEnvironment } from './environment';
|
|
5
5
|
export { getPullRequestNumber } from './pullRequest';
|
|
6
6
|
export { putIssueComment } from './issueComment';
|
|
7
|
+
export { commitAndPush, commitAndPushAllChanges, mapChangedFilesToFileChanges, } from './push';
|
package/lib/api/github/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.putIssueComment = exports.getPullRequestNumber = exports.enabledFromEnvironment = exports.createCheckRun = exports.buildNameFromEnvironment = void 0;
|
|
3
|
+
exports.mapChangedFilesToFileChanges = exports.commitAndPushAllChanges = exports.commitAndPush = exports.putIssueComment = exports.getPullRequestNumber = exports.enabledFromEnvironment = exports.createCheckRun = exports.buildNameFromEnvironment = void 0;
|
|
4
4
|
var environment_1 = require("./environment");
|
|
5
5
|
Object.defineProperty(exports, "buildNameFromEnvironment", { enumerable: true, get: function () { return environment_1.buildNameFromEnvironment; } });
|
|
6
6
|
var checkRun_1 = require("./checkRun");
|
|
@@ -11,4 +11,8 @@ var pullRequest_1 = require("./pullRequest");
|
|
|
11
11
|
Object.defineProperty(exports, "getPullRequestNumber", { enumerable: true, get: function () { return pullRequest_1.getPullRequestNumber; } });
|
|
12
12
|
var issueComment_1 = require("./issueComment");
|
|
13
13
|
Object.defineProperty(exports, "putIssueComment", { enumerable: true, get: function () { return issueComment_1.putIssueComment; } });
|
|
14
|
+
var push_1 = require("./push");
|
|
15
|
+
Object.defineProperty(exports, "commitAndPush", { enumerable: true, get: function () { return push_1.commitAndPush; } });
|
|
16
|
+
Object.defineProperty(exports, "commitAndPushAllChanges", { enumerable: true, get: function () { return push_1.commitAndPushAllChanges; } });
|
|
17
|
+
Object.defineProperty(exports, "mapChangedFilesToFileChanges", { enumerable: true, get: function () { return push_1.mapChangedFilesToFileChanges; } });
|
|
14
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/github/index.ts"],"names":[],"mappings":";;;AACA,6CAAyD;AAAhD,uHAAA,wBAAwB,OAAA;AACjC,uCAA4C;AAAnC,0GAAA,cAAc,OAAA;AACvB,6CAAuD;AAA9C,qHAAA,sBAAsB,OAAA;AAC/B,6CAAqD;AAA5C,mHAAA,oBAAoB,OAAA;AAC7B,+CAAiD;AAAxC,+GAAA,eAAe,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/github/index.ts"],"names":[],"mappings":";;;AACA,6CAAyD;AAAhD,uHAAA,wBAAwB,OAAA;AACjC,uCAA4C;AAAnC,0GAAA,cAAc,OAAA;AACvB,6CAAuD;AAA9C,qHAAA,sBAAsB,OAAA;AAC/B,6CAAqD;AAA5C,mHAAA,oBAAoB,OAAA;AAC7B,+CAAiD;AAAxC,+GAAA,eAAe,OAAA;AACxB,+BAIgB;AAHd,qGAAA,aAAa,OAAA;AACb,+GAAA,uBAAuB,OAAA;AACvB,oHAAA,4BAA4B,OAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { FileAddition, FileDeletion } from '@octokit/graphql-schema';
|
|
2
|
+
import type { ChangedFile } from '../git/getChangedFiles';
|
|
3
|
+
interface CommitAndPushAllChangesParams {
|
|
4
|
+
dir: string;
|
|
5
|
+
/**
|
|
6
|
+
* The branch name
|
|
7
|
+
*/
|
|
8
|
+
branch: string;
|
|
9
|
+
/**
|
|
10
|
+
* The headline of the commit message
|
|
11
|
+
*/
|
|
12
|
+
messageHeadline: string;
|
|
13
|
+
/**
|
|
14
|
+
* The body of the commit message
|
|
15
|
+
*/
|
|
16
|
+
messageBody?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Updates the local git working directory to reflect the new remote state
|
|
19
|
+
*/
|
|
20
|
+
updateLocal?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Commits and pushes all changes from the local git repository up to a GitHub branch.
|
|
24
|
+
* Returns the commit id or `undefined` if there are no changes to commit.
|
|
25
|
+
*/
|
|
26
|
+
export declare const commitAndPushAllChanges: ({ dir, branch, messageHeadline, messageBody, updateLocal, }: CommitAndPushAllChangesParams) => Promise<string | undefined>;
|
|
27
|
+
export interface FileChanges {
|
|
28
|
+
additions: FileAddition[];
|
|
29
|
+
deletions: FileDeletion[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Maps ChangedFiles to {@link https://docs.github.com/en/graphql/reference/input-objects#filechanges| FileChanges}
|
|
33
|
+
*/
|
|
34
|
+
export declare const mapChangedFilesToFileChanges: (changedFiles: ChangedFile[]) => Promise<FileChanges>;
|
|
35
|
+
interface CommitAndPushParams {
|
|
36
|
+
dir: string;
|
|
37
|
+
/**
|
|
38
|
+
* The branch name
|
|
39
|
+
*/
|
|
40
|
+
branch: string;
|
|
41
|
+
/**
|
|
42
|
+
* The headline of the commit message
|
|
43
|
+
*/
|
|
44
|
+
messageHeadline: string;
|
|
45
|
+
/**
|
|
46
|
+
* The body of the commit message
|
|
47
|
+
*/
|
|
48
|
+
messageBody?: string;
|
|
49
|
+
/**
|
|
50
|
+
* File additions and deletions
|
|
51
|
+
*/
|
|
52
|
+
fileChanges: FileChanges;
|
|
53
|
+
/**
|
|
54
|
+
* Updates the local git working directory to reflect the new remote state
|
|
55
|
+
*/
|
|
56
|
+
updateLocal?: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Commits and pushes file changes up to a GitHub branch
|
|
60
|
+
*/
|
|
61
|
+
export declare const commitAndPush: ({ dir, branch, messageHeadline, messageBody, fileChanges, updateLocal, }: CommitAndPushParams) => Promise<string>;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.commitAndPush = exports.mapChangedFilesToFileChanges = exports.commitAndPushAllChanges = void 0;
|
|
30
|
+
const graphql_1 = require("@octokit/graphql");
|
|
31
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
32
|
+
const Git = __importStar(require("../git"));
|
|
33
|
+
const environment_1 = require("./environment");
|
|
34
|
+
/**
|
|
35
|
+
* Commits and pushes all changes from the local git repository up to a GitHub branch.
|
|
36
|
+
* Returns the commit id or `undefined` if there are no changes to commit.
|
|
37
|
+
*/
|
|
38
|
+
const commitAndPushAllChanges = async ({ dir, branch, messageHeadline, messageBody, updateLocal, }) => {
|
|
39
|
+
const changedFiles = await Git.getChangedFiles({ dir });
|
|
40
|
+
if (!changedFiles.length) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
const fileChanges = await (0, exports.mapChangedFilesToFileChanges)(changedFiles);
|
|
44
|
+
return await (0, exports.commitAndPush)({
|
|
45
|
+
dir,
|
|
46
|
+
branch,
|
|
47
|
+
messageHeadline,
|
|
48
|
+
messageBody,
|
|
49
|
+
fileChanges,
|
|
50
|
+
updateLocal,
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
exports.commitAndPushAllChanges = commitAndPushAllChanges;
|
|
54
|
+
/**
|
|
55
|
+
* Maps ChangedFiles to {@link https://docs.github.com/en/graphql/reference/input-objects#filechanges| FileChanges}
|
|
56
|
+
*/
|
|
57
|
+
const mapChangedFilesToFileChanges = async (changedFiles) => {
|
|
58
|
+
const { added, deleted } = changedFiles.reduce((files, changedFile) => {
|
|
59
|
+
const filePath = changedFile.path;
|
|
60
|
+
if (changedFile.state === 'deleted') {
|
|
61
|
+
files.deleted.push(filePath);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
files.added.push(filePath);
|
|
65
|
+
}
|
|
66
|
+
return files;
|
|
67
|
+
}, { added: [], deleted: [] });
|
|
68
|
+
const additions = await Promise.all(added.map(async (filePath) => ({
|
|
69
|
+
path: filePath,
|
|
70
|
+
contents: await fs_extra_1.default.promises.readFile(filePath, {
|
|
71
|
+
encoding: 'base64',
|
|
72
|
+
}),
|
|
73
|
+
})));
|
|
74
|
+
const deletions = deleted.map((filePath) => ({
|
|
75
|
+
path: filePath,
|
|
76
|
+
}));
|
|
77
|
+
return {
|
|
78
|
+
additions,
|
|
79
|
+
deletions,
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
exports.mapChangedFilesToFileChanges = mapChangedFilesToFileChanges;
|
|
83
|
+
/**
|
|
84
|
+
* Commits and pushes file changes up to a GitHub branch
|
|
85
|
+
*/
|
|
86
|
+
const commitAndPush = async ({ dir, branch, messageHeadline, messageBody, fileChanges, updateLocal = false, }) => {
|
|
87
|
+
const authToken = (0, environment_1.apiTokenFromEnvironment)();
|
|
88
|
+
if (!authToken) {
|
|
89
|
+
throw new Error('Could not determine API token from the environment');
|
|
90
|
+
}
|
|
91
|
+
const [{ owner, repo }, headCommitId] = await Promise.all([
|
|
92
|
+
Git.getOwnerAndRepo({ dir }),
|
|
93
|
+
Git.getHeadCommitId({ dir }),
|
|
94
|
+
]);
|
|
95
|
+
const input = {
|
|
96
|
+
branch: {
|
|
97
|
+
repositoryNameWithOwner: `${owner}/${repo}`,
|
|
98
|
+
branchName: branch,
|
|
99
|
+
},
|
|
100
|
+
message: {
|
|
101
|
+
headline: messageHeadline,
|
|
102
|
+
body: messageBody,
|
|
103
|
+
},
|
|
104
|
+
expectedHeadOid: headCommitId,
|
|
105
|
+
clientMutationId: 'skuba',
|
|
106
|
+
fileChanges,
|
|
107
|
+
};
|
|
108
|
+
const result = await (0, graphql_1.graphql)(`
|
|
109
|
+
mutation Mutation($input: CreateCommitOnBranchInput!) {
|
|
110
|
+
createCommitOnBranch(input: $input) {
|
|
111
|
+
commit {
|
|
112
|
+
id
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
`, {
|
|
117
|
+
input,
|
|
118
|
+
headers: {
|
|
119
|
+
authorization: `bearer ${authToken}`,
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
if (updateLocal) {
|
|
123
|
+
await Promise.all([...fileChanges.additions, ...fileChanges.deletions].map((file) => fs_extra_1.default.rm(file.path)));
|
|
124
|
+
await Git.fastForwardBranch({
|
|
125
|
+
ref: branch,
|
|
126
|
+
auth: { type: 'gitHubApp' },
|
|
127
|
+
dir,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return result.createCommitOnBranch.commit.id;
|
|
131
|
+
};
|
|
132
|
+
exports.commitAndPush = commitAndPush;
|
|
133
|
+
//# sourceMappingURL=push.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../../src/api/github/push.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAA2C;AAM3C,wDAA0B;AAE1B,4CAA8B;AAG9B,+CAAwD;AA8BxD;;;GAGG;AACI,MAAM,uBAAuB,GAAG,KAAK,EAAE,EAC5C,GAAG,EACH,MAAM,EACN,eAAe,EACf,WAAW,EACX,WAAW,GACmB,EAA+B,EAAE;IAC/D,MAAM,YAAY,GAAG,M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SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAChE,kBAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CACjB,CACF,CAAC;QAEF,MAAM,GAAG,CAAC,iBAAiB,CAAC;YAC1B,GAAG,EAAE,MAAM;YACX,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;YAC3B,GAAG;SACJ,CAAC,CAAC;KACJ;IAED,OAAO,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC;AAC/C,CAAC,CAAC;AAjEW,QAAA,aAAa,iBAiExB"}
|
package/lib/api/jest/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare type DefaultOptions = 'collectCoverage' | 'collectCoverageFrom' | 'colle
|
|
|
11
11
|
*
|
|
12
12
|
* This concatenates array options like `testPathIgnorePatterns`.
|
|
13
13
|
*/
|
|
14
|
-
export declare const mergePreset: <AdditionalOptions extends "filter" | "json" | "silent" | "
|
|
14
|
+
export declare const mergePreset: <AdditionalOptions extends "filter" | "json" | "silent" | "cache" | "runner" | "projects" | "id" | "automock" | "cacheDirectory" | "clearMocks" | "coveragePathIgnorePatterns" | "dependencyExtractor" | "detectLeaks" | "detectOpenHandles" | "displayName" | "errorOnDeprecated" | "extensionsToTreatAsEsm" | "fakeTimers" | "forceCoverageMatch" | "globalSetup" | "globalTeardown" | "globals" | "haste" | "injectGlobals" | "moduleDirectories" | "moduleFileExtensions" | "moduleNameMapper" | "modulePathIgnorePatterns" | "modulePaths" | "prettierPath" | "resetMocks" | "resetModules" | "resolver" | "restoreMocks" | "rootDir" | "roots" | "runtime" | "sandboxInjectedGlobals" | "setupFiles" | "setupFilesAfterEnv" | "skipFilter" | "skipNodeResolution" | "slowTestThreshold" | "snapshotResolver" | "snapshotSerializers" | "snapshotFormat" | "testEnvironment" | "testEnvironmentOptions" | "testMatch" | "testLocationInResults" | "testPathIgnorePatterns" | "testRegex" | "testRunner" | "transform" | "transformIgnorePatterns" | "watchPathIgnorePatterns" | "unmockedModulePathPatterns" | "bail" | "ci" | "changedFilesWithAncestor" | "changedSince" | "collectCoverage" | "collectCoverageFrom" | "collectCoverageOnlyFrom" | "coverageDirectory" | "coverageProvider" | "coverageReporters" | "coverageThreshold" | "expand" | "findRelatedTests" | "forceExit" | "reporters" | "logHeapUsage" | "lastCommit" | "listTests" | "maxConcurrency" | "maxWorkers" | "noStackTrace" | "notify" | "notifyMode" | "onlyChanged" | "onlyFailures" | "outputFile" | "passWithNoTests" | "preset" | "replname" | "runTestsByPath" | "testFailureExitCode" | "testNamePattern" | "testResultsProcessor" | "testSequencer" | "testTimeout" | "updateSnapshot" | "useStderr" | "verbose" | "watch" | "watchAll" | "watchman" | "watchPlugins">(options: Pick<Partial<{
|
|
15
15
|
automock: boolean;
|
|
16
16
|
bail: number | boolean;
|
|
17
17
|
cache: boolean;
|
|
@@ -39,7 +39,9 @@ export declare const mergePreset: <AdditionalOptions extends "filter" | "json" |
|
|
|
39
39
|
displayName: string | Config.DisplayName;
|
|
40
40
|
expand: boolean;
|
|
41
41
|
extensionsToTreatAsEsm: string[];
|
|
42
|
-
|
|
42
|
+
fakeTimers: Config.GlobalFakeTimersConfig & ((Config.FakeTimersConfig & {
|
|
43
|
+
now?: number | undefined;
|
|
44
|
+
}) | Config.LegacyFakeTimersConfig);
|
|
43
45
|
filter: string;
|
|
44
46
|
findRelatedTests: boolean;
|
|
45
47
|
forceCoverageMatch: string[];
|
|
@@ -49,6 +51,7 @@ export declare const mergePreset: <AdditionalOptions extends "filter" | "json" |
|
|
|
49
51
|
globalSetup: string | null | undefined;
|
|
50
52
|
globalTeardown: string | null | undefined;
|
|
51
53
|
haste: Config.HasteConfig;
|
|
54
|
+
id: string;
|
|
52
55
|
injectGlobals: boolean;
|
|
53
56
|
reporters: (string | Config.ReporterConfig)[];
|
|
54
57
|
logHeapUsage: boolean;
|
|
@@ -58,13 +61,11 @@ export declare const mergePreset: <AdditionalOptions extends "filter" | "json" |
|
|
|
58
61
|
maxWorkers: string | number;
|
|
59
62
|
moduleDirectories: string[];
|
|
60
63
|
moduleFileExtensions: string[];
|
|
61
|
-
moduleLoader: string;
|
|
62
64
|
moduleNameMapper: {
|
|
63
65
|
[key: string]: string | string[];
|
|
64
66
|
};
|
|
65
67
|
modulePathIgnorePatterns: string[];
|
|
66
68
|
modulePaths: string[];
|
|
67
|
-
name: string;
|
|
68
69
|
noStackTrace: boolean;
|
|
69
70
|
notify: boolean;
|
|
70
71
|
notifyMode: string;
|
|
@@ -72,7 +73,6 @@ export declare const mergePreset: <AdditionalOptions extends "filter" | "json" |
|
|
|
72
73
|
onlyFailures: boolean;
|
|
73
74
|
outputFile: string;
|
|
74
75
|
passWithNoTests: boolean;
|
|
75
|
-
preprocessorIgnorePatterns: string[];
|
|
76
76
|
preset: string | null | undefined;
|
|
77
77
|
prettierPath: string | null | undefined;
|
|
78
78
|
projects: (string | Config.InitialProjectOptions)[];
|
|
@@ -85,9 +85,9 @@ export declare const mergePreset: <AdditionalOptions extends "filter" | "json" |
|
|
|
85
85
|
roots: string[];
|
|
86
86
|
runner: string;
|
|
87
87
|
runTestsByPath: boolean;
|
|
88
|
-
|
|
88
|
+
runtime: string;
|
|
89
|
+
sandboxInjectedGlobals: string[];
|
|
89
90
|
setupFiles: string[];
|
|
90
|
-
setupTestFrameworkScriptFile: string;
|
|
91
91
|
setupFilesAfterEnv: string[];
|
|
92
92
|
silent: boolean;
|
|
93
93
|
skipFilter: boolean;
|
|
@@ -95,7 +95,25 @@ export declare const mergePreset: <AdditionalOptions extends "filter" | "json" |
|
|
|
95
95
|
slowTestThreshold: number;
|
|
96
96
|
snapshotResolver: string;
|
|
97
97
|
snapshotSerializers: string[];
|
|
98
|
-
snapshotFormat:
|
|
98
|
+
snapshotFormat: {
|
|
99
|
+
readonly callToJSON?: boolean | undefined;
|
|
100
|
+
readonly escapeRegex?: boolean | undefined;
|
|
101
|
+
readonly escapeString?: boolean | undefined;
|
|
102
|
+
readonly highlight?: boolean | undefined;
|
|
103
|
+
readonly indent?: number | undefined;
|
|
104
|
+
readonly maxDepth?: number | undefined;
|
|
105
|
+
readonly maxWidth?: number | undefined;
|
|
106
|
+
readonly min?: boolean | undefined;
|
|
107
|
+
readonly printBasicPrototype?: boolean | undefined;
|
|
108
|
+
readonly printFunctionName?: boolean | undefined;
|
|
109
|
+
readonly theme?: {
|
|
110
|
+
readonly value?: string | undefined;
|
|
111
|
+
readonly tag?: string | undefined;
|
|
112
|
+
readonly content?: string | undefined;
|
|
113
|
+
readonly comment?: string | undefined;
|
|
114
|
+
readonly prop?: string | undefined;
|
|
115
|
+
} | undefined;
|
|
116
|
+
};
|
|
99
117
|
errorOnDeprecated: boolean;
|
|
100
118
|
testEnvironment: string;
|
|
101
119
|
testEnvironmentOptions: Record<string, unknown>;
|
|
@@ -103,15 +121,12 @@ export declare const mergePreset: <AdditionalOptions extends "filter" | "json" |
|
|
|
103
121
|
testLocationInResults: boolean;
|
|
104
122
|
testMatch: string[];
|
|
105
123
|
testNamePattern: string;
|
|
106
|
-
testPathDirs: string[];
|
|
107
124
|
testPathIgnorePatterns: string[];
|
|
108
125
|
testRegex: string | string[];
|
|
109
126
|
testResultsProcessor: string;
|
|
110
127
|
testRunner: string;
|
|
111
128
|
testSequencer: string;
|
|
112
|
-
testURL: string;
|
|
113
129
|
testTimeout: number;
|
|
114
|
-
timers: "real" | "fake" | "modern" | "legacy";
|
|
115
130
|
transform: {
|
|
116
131
|
[regex: string]: string | Config.TransformerConfig;
|
|
117
132
|
};
|
|
@@ -6,8 +6,9 @@ export interface ESLintResult {
|
|
|
6
6
|
}
|
|
7
7
|
export interface ESLintOutput {
|
|
8
8
|
errors: ESLintResult[];
|
|
9
|
-
|
|
9
|
+
fixable: boolean;
|
|
10
10
|
ok: boolean;
|
|
11
11
|
output: string;
|
|
12
|
+
warnings: ESLintResult[];
|
|
12
13
|
}
|
|
13
14
|
export declare const runESLint: (mode: 'format' | 'lint', logger: Logger) => Promise<ESLintOutput>;
|
|
@@ -48,8 +48,12 @@ const runESLint = async (mode, logger) => {
|
|
|
48
48
|
logger.plain(`Processed ${(0, logging_1.pluralise)(results.length, 'file')} in ${logger.timing(start, end)}.`);
|
|
49
49
|
const errors = [];
|
|
50
50
|
const warnings = [];
|
|
51
|
+
let fixable = false;
|
|
51
52
|
for (const result of results) {
|
|
52
53
|
const relativePath = path_1.default.relative(cwd, result.filePath);
|
|
54
|
+
if (result.fixableErrorCount + result.fixableWarningCount) {
|
|
55
|
+
fixable = true;
|
|
56
|
+
}
|
|
53
57
|
if (result.errorCount) {
|
|
54
58
|
errors.push({
|
|
55
59
|
filePath: relativePath,
|
|
@@ -70,7 +74,7 @@ const runESLint = async (mode, logger) => {
|
|
|
70
74
|
if (output) {
|
|
71
75
|
logger.plain(output);
|
|
72
76
|
}
|
|
73
|
-
return { ok, output,
|
|
77
|
+
return { errors, fixable, ok, output, warnings };
|
|
74
78
|
};
|
|
75
79
|
exports.runESLint = runESLint;
|
|
76
80
|
//# sourceMappingURL=eslint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.js","sourceRoot":"","sources":["../../../src/cli/adapter/eslint.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,kDAA0B;AAE1B,mCAAgC;AAGhC,iDAAgD;AAEhD,MAAM,eAAe,GAAG,CAAC,MAAyB,EAAE,EAAE;IACpD,IAAI,MAAM,CAAC,UAAU,EAAE;QACrB,OAAO,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KACvB;IAED,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,eAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,eAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACpE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"eslint.js","sourceRoot":"","sources":["../../../src/cli/adapter/eslint.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB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C,OAAO,CAAC,CAAC;IAElC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAE/C,IAAI,MAAM,EAAE;QACV,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KACtB;IAED,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AACnD,CAAC,CAAC;AA1FW,QAAA,SAAS,aA0FpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const determineOperation: (oldData?: string
|
|
1
|
+
export declare const determineOperation: (oldData?: string, newData?: string) => string;
|
|
@@ -3,7 +3,7 @@ import type { DependencyDiff, DependencySet } from '../types';
|
|
|
3
3
|
interface GetDestinationManifestProps {
|
|
4
4
|
cwd?: string;
|
|
5
5
|
}
|
|
6
|
-
export declare const getDestinationManifest: (props?: GetDestinationManifestProps
|
|
6
|
+
export declare const getDestinationManifest: (props?: GetDestinationManifestProps) => Promise<readPkgUp.NormalizedReadResult>;
|
|
7
7
|
interface DiffDependenciesProps {
|
|
8
8
|
old: Record<string, string | undefined>;
|
|
9
9
|
new: Record<string, string | undefined>;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* than `lib/`) but they generally represent the same _intent_.
|
|
6
6
|
*/
|
|
7
7
|
export declare const generateSimpleVariants: (patterns: string[]) => Set<string>;
|
|
8
|
-
export declare const mergeWithIgnoreFile: (rawTemplateFile: string) => (rawInputFile?: string
|
|
8
|
+
export declare const mergeWithIgnoreFile: (rawTemplateFile: string) => (rawInputFile?: string) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const prependImport: (name: string, file?: string
|
|
1
|
+
export declare const prependImport: (name: string, file?: string) => string;
|
|
2
2
|
export declare const stripImports: (names: readonly string[], inputFile: string) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const formatObject: (data: Record<Exclude<PropertyKey, symbol>, unknown>, filepath?: string
|
|
1
|
+
export declare const formatObject: (data: Record<Exclude<PropertyKey, symbol>, unknown>, filepath?: string) => string;
|
|
2
2
|
export declare const parseObject: (input: string | undefined) => Record<Exclude<PropertyKey, symbol>, unknown> | undefined;
|
|
@@ -22,7 +22,7 @@ export declare const createDependencyFilter: (names: readonly string[], type: 'd
|
|
|
22
22
|
main?: string | undefined;
|
|
23
23
|
exports?: import("type-fest").PackageJson.Exports | undefined;
|
|
24
24
|
imports?: import("type-fest").PackageJson.Imports | undefined;
|
|
25
|
-
bin?: string | Record<string, string
|
|
25
|
+
bin?: string | Partial<Record<string, string>> | undefined;
|
|
26
26
|
man?: string | string[] | undefined;
|
|
27
27
|
directories?: import("type-fest").PackageJson.DirectoryLocations | undefined;
|
|
28
28
|
repository?: string | {
|
|
@@ -32,17 +32,17 @@ export declare const createDependencyFilter: (names: readonly string[], type: 'd
|
|
|
32
32
|
} | undefined;
|
|
33
33
|
scripts?: import("type-fest").PackageJson.Scripts | undefined;
|
|
34
34
|
config?: Record<string, unknown> | undefined;
|
|
35
|
-
dependencies?:
|
|
36
|
-
devDependencies?:
|
|
37
|
-
optionalDependencies?:
|
|
38
|
-
peerDependencies?:
|
|
39
|
-
peerDependenciesMeta?: Record<string, {
|
|
35
|
+
dependencies?: Partial<Record<string, string>> | undefined;
|
|
36
|
+
devDependencies?: Partial<Record<string, string>> | undefined;
|
|
37
|
+
optionalDependencies?: Partial<Record<string, string>> | undefined;
|
|
38
|
+
peerDependencies?: Partial<Record<string, string>> | undefined;
|
|
39
|
+
peerDependenciesMeta?: Partial<Record<string, {
|
|
40
40
|
optional: true;
|
|
41
|
-
}
|
|
41
|
+
}>> | undefined;
|
|
42
42
|
bundledDependencies?: string[] | undefined;
|
|
43
43
|
bundleDependencies?: string[] | undefined;
|
|
44
44
|
engines?: {
|
|
45
|
-
[x: string]: string;
|
|
45
|
+
[x: string]: string | undefined;
|
|
46
46
|
} | undefined;
|
|
47
47
|
engineStrict?: boolean | undefined;
|
|
48
48
|
os?: import("type-fest").LiteralUnion<"aix" | "darwin" | "freebsd" | "linux" | "openbsd" | "sunos" | "win32" | "!aix" | "!darwin" | "!freebsd" | "!linux" | "!openbsd" | "!sunos" | "!win32", string>[] | undefined;
|
|
@@ -60,14 +60,14 @@ export declare const createDependencyFilter: (names: readonly string[], type: 'd
|
|
|
60
60
|
main?: string | undefined;
|
|
61
61
|
browser?: string | undefined;
|
|
62
62
|
} | undefined;
|
|
63
|
-
browser?: string | Record<string, string | false
|
|
63
|
+
browser?: string | Partial<Record<string, string | false>> | undefined;
|
|
64
64
|
sideEffects?: boolean | string[] | undefined;
|
|
65
65
|
types?: string | undefined;
|
|
66
|
-
typesVersions?: Record<string, Record<string, string[]
|
|
66
|
+
typesVersions?: Partial<Record<string, Partial<Record<string, string[]>>>> | undefined;
|
|
67
67
|
typings?: string | undefined;
|
|
68
68
|
workspaces?: string[] | import("type-fest").PackageJson.WorkspaceConfig | undefined;
|
|
69
69
|
flat?: boolean | undefined;
|
|
70
|
-
resolutions?:
|
|
70
|
+
resolutions?: Partial<Record<string, string>> | undefined;
|
|
71
71
|
jspm?: import("type-fest").PackageJson | undefined;
|
|
72
72
|
};
|
|
73
73
|
export declare const withPackage: (fn: (data: PackageJson) => PackageJson) => (input: string | undefined) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/buildkite/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAAuD;AAKvD,qCAAmD;AACnD,yCAAuD;AACvD,+BAA6C;AAEtC,MAAM,0BAA0B,GAAG,KAAK,EAC7C,MAAoB,EACpB,QAAwB,EACxB,KAAc,EACd,eAAkC,EACnB,EAAE;IACjB,IAAI,MAAM,CAAC,EAAE,IAAI,QAAQ,CAAC,EAAE,IAAI,KAAK,EAAE;QACrC,OAAO;KACR;IAED,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/buildkite/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAAuD;AAKvD,qCAAmD;AACnD,yCAAuD;AACvD,+BAA6C;AAEtC,MAAM,0BAA0B,GAAG,KAAK,EAC7C,MAAoB,EACpB,QAAwB,EACxB,KAAc,EACd,eAAkC,EACnB,EAAE;IACjB,IAAI,MAAM,CAAC,EAAE,IAAI,QAAQ,CAAC,EAAE,IAAI,KAAK,EAAE;QACrC,OAAO;KACR;IAED,MAAM,eAAe,GAAG;QACtB,gDAAgD;QAChD,GAAG,IAAA,gCAAuB,EAAC,MAAM,CAAC;QAClC,GAAG,IAAA,oCAAyB,EAAC,QAAQ,CAAC;QACtC,GAAG,IAAA,0BAAoB,EAAC,KAAK,EAAE,eAAe,CAAC;KAChD,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEf,MAAM,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE;QACxC,OAAO,EAAE,qBAAqB;QAC9B,kBAAkB,EAAE,IAAI;QACxB,KAAK,EAAE,OAAO;KACf,CAAC,CAAC;AACL,CAAC,CAAC;AAtBW,QAAA,0BAA0B,8BAsBrC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import type { Input } from './types';
|
|
2
|
-
|
|
2
|
+
interface AutofixParameters {
|
|
3
|
+
debug: Input['debug'];
|
|
4
|
+
eslint: boolean;
|
|
5
|
+
prettier: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const autofix: (params: AutofixParameters) => Promise<void>;
|
|
8
|
+
export {};
|