skuba 5.1.1 → 5.2.0-beta.1
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/git/commit.js +4 -0
- package/lib/api/git/commit.js.map +1 -1
- package/lib/api/git/commitAllChanges.js +4 -0
- package/lib/api/git/commitAllChanges.js.map +1 -1
- package/lib/api/git/currentBranch.js +4 -0
- package/lib/api/git/currentBranch.js.map +1 -1
- package/lib/api/git/getChangedFiles.js +4 -0
- package/lib/api/git/getChangedFiles.js.map +1 -1
- package/lib/api/git/log.js +4 -0
- package/lib/api/git/log.js.map +1 -1
- package/lib/api/git/pull.js +4 -0
- package/lib/api/git/pull.js.map +1 -1
- package/lib/api/git/push.js +4 -0
- package/lib/api/git/push.js.map +1 -1
- package/lib/api/git/remote.js +4 -0
- package/lib/api/git/remote.js.map +1 -1
- package/lib/api/git/reset.js +4 -0
- package/lib/api/git/reset.js.map +1 -1
- package/lib/api/github/checkRun.js +4 -0
- package/lib/api/github/checkRun.js.map +1 -1
- package/lib/api/github/environment.js +5 -1
- package/lib/api/github/environment.js.map +1 -1
- package/lib/api/github/issueComment.js +4 -0
- package/lib/api/github/issueComment.js.map +1 -1
- package/lib/api/github/pullRequest.js +4 -0
- package/lib/api/github/pullRequest.js.map +1 -1
- package/lib/api/github/push.js +4 -0
- package/lib/api/github/push.js.map +1 -1
- package/lib/api/jest/index.d.ts +1 -1
- package/lib/api/jest/index.js +4 -0
- package/lib/api/jest/index.js.map +1 -1
- package/lib/api/net/socket.js +4 -0
- package/lib/api/net/socket.js.map +1 -1
- package/lib/cli/adapter/eslint.js +11 -2
- package/lib/cli/adapter/eslint.js.map +2 -2
- package/lib/cli/adapter/prettier.js +4 -0
- package/lib/cli/adapter/prettier.js.map +1 -1
- package/lib/cli/build/args.js +4 -0
- package/lib/cli/build/args.js.map +1 -1
- package/lib/cli/build/esbuild.js +5 -0
- package/lib/cli/build/esbuild.js.map +1 -1
- package/lib/cli/build/index.js +4 -0
- package/lib/cli/build/index.js.map +1 -1
- package/lib/cli/configure/addEmptyExports.d.ts +1 -0
- package/lib/cli/configure/addEmptyExports.js +12 -3
- package/lib/cli/configure/addEmptyExports.js.map +2 -2
- package/lib/cli/configure/analyseConfiguration.js +4 -0
- package/lib/cli/configure/analyseConfiguration.js.map +1 -1
- package/lib/cli/configure/analyseDependencies.js +4 -0
- package/lib/cli/configure/analyseDependencies.js.map +1 -1
- package/lib/cli/configure/analysis/diff.js +4 -0
- package/lib/cli/configure/analysis/diff.js.map +1 -1
- package/lib/cli/configure/analysis/files.js +4 -0
- package/lib/cli/configure/analysis/files.js.map +1 -1
- package/lib/cli/configure/analysis/git.js +4 -0
- package/lib/cli/configure/analysis/git.js.map +1 -1
- package/lib/cli/configure/analysis/package.js +4 -0
- package/lib/cli/configure/analysis/package.js.map +1 -1
- package/lib/cli/configure/analysis/project.js +4 -0
- package/lib/cli/configure/analysis/project.js.map +1 -1
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
- package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
- package/lib/cli/configure/dependencies/skuba.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDeps.js +2 -0
- package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
- package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.js +4 -0
- package/lib/cli/configure/ensureTemplateCompletion.js.map +1 -1
- package/lib/cli/configure/getEntryPoint.js +4 -0
- package/lib/cli/configure/getEntryPoint.js.map +1 -1
- package/lib/cli/configure/getProjectType.js.map +1 -1
- package/lib/cli/configure/index.js +4 -0
- package/lib/cli/configure/index.js.map +1 -1
- package/lib/cli/configure/modules/eslint.js +1 -0
- package/lib/cli/configure/modules/eslint.js.map +1 -1
- package/lib/cli/configure/modules/jest.js.map +1 -1
- package/lib/cli/configure/modules/package.js.map +1 -1
- package/lib/cli/configure/modules/prettier.js +1 -0
- package/lib/cli/configure/modules/prettier.js.map +1 -1
- package/lib/cli/configure/modules/renovate.d.ts +1 -0
- package/lib/cli/configure/modules/renovate.js +12 -0
- package/lib/cli/configure/modules/renovate.js.map +2 -2
- package/lib/cli/configure/modules/skubaDive.js +4 -0
- package/lib/cli/configure/modules/skubaDive.js.map +1 -1
- package/lib/cli/configure/modules/tsconfig.js.map +1 -1
- package/lib/cli/configure/patchRenovateConfig.d.ts +1 -0
- package/lib/cli/configure/patchRenovateConfig.js +132 -0
- package/lib/cli/configure/patchRenovateConfig.js.map +7 -0
- package/lib/cli/configure/processing/package.js +4 -0
- package/lib/cli/configure/processing/package.js.map +1 -1
- package/lib/cli/configure/processing/prettier.js +4 -0
- package/lib/cli/configure/processing/prettier.js.map +1 -1
- package/lib/cli/configure/processing/record.js +4 -0
- package/lib/cli/configure/processing/record.js.map +1 -1
- package/lib/cli/configure/processing/typescript.js +4 -3
- package/lib/cli/configure/processing/typescript.js.map +2 -2
- package/lib/cli/configure/refreshIgnoreFiles.d.ts +1 -0
- package/lib/cli/configure/refreshIgnoreFiles.js +12 -5
- package/lib/cli/configure/refreshIgnoreFiles.js.map +2 -2
- package/lib/cli/format.js +10 -1
- package/lib/cli/format.js.map +2 -2
- package/lib/cli/init/getConfig.js +7 -0
- package/lib/cli/init/getConfig.js.map +1 -1
- package/lib/cli/init/git.js +5 -0
- package/lib/cli/init/git.js.map +1 -1
- package/lib/cli/init/index.js +8 -0
- package/lib/cli/init/index.js.map +2 -2
- package/lib/cli/init/prompts.d.ts +1 -1
- package/lib/cli/init/prompts.js.map +2 -2
- package/lib/cli/init/types.js +6 -0
- package/lib/cli/init/types.js.map +1 -1
- package/lib/cli/init/validation.d.ts +1 -1
- package/lib/cli/init/validation.js.map +1 -1
- package/lib/cli/init/writePackageJson.js +4 -0
- package/lib/cli/init/writePackageJson.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/eslint.d.ts +1 -1
- package/lib/cli/lint/annotate/buildkite/eslint.js +4 -0
- package/lib/cli/lint/annotate/buildkite/eslint.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/index.d.ts +3 -3
- package/lib/cli/lint/annotate/buildkite/index.js +4 -0
- package/lib/cli/lint/annotate/buildkite/index.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/prettier.d.ts +1 -1
- package/lib/cli/lint/annotate/buildkite/prettier.js +4 -0
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/tsc.d.ts +1 -1
- package/lib/cli/lint/annotate/buildkite/tsc.js +4 -0
- package/lib/cli/lint/annotate/buildkite/tsc.js.map +2 -2
- package/lib/cli/lint/annotate/github/eslint.d.ts +1 -1
- package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/github/index.d.ts +3 -3
- package/lib/cli/lint/annotate/github/index.js +4 -0
- package/lib/cli/lint/annotate/github/index.js.map +2 -2
- package/lib/cli/lint/annotate/github/prettier.d.ts +1 -1
- package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
- package/lib/cli/lint/annotate/github/tsc.d.ts +1 -1
- package/lib/cli/lint/annotate/github/tsc.js +4 -0
- package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
- package/lib/cli/lint/autofix.js +54 -11
- package/lib/cli/lint/autofix.js.map +3 -3
- package/lib/cli/lint/eslint.js +4 -0
- package/lib/cli/lint/eslint.js.map +1 -1
- package/lib/cli/lint/external.js +4 -0
- package/lib/cli/lint/external.js.map +1 -1
- package/lib/cli/lint/index.js +6 -1
- package/lib/cli/lint/index.js.map +2 -2
- package/lib/cli/lint/internal.js +4 -0
- package/lib/cli/lint/internal.js.map +1 -1
- package/lib/cli/lint/prettier.js +4 -0
- package/lib/cli/lint/prettier.js.map +1 -1
- package/lib/cli/node.js +6 -0
- package/lib/cli/node.js.map +1 -1
- package/lib/cli/start.js +4 -0
- package/lib/cli/start.js.map +1 -1
- package/lib/cli/test/reporters/github/annotations.js +4 -0
- package/lib/cli/test/reporters/github/annotations.js.map +1 -1
- package/lib/cli/test/reporters/github/index.js +4 -0
- package/lib/cli/test/reporters/github/index.js.map +1 -1
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/lib/skuba.js +4 -0
- package/lib/skuba.js.map +1 -1
- package/lib/utils/args.js +6 -0
- package/lib/utils/args.js.map +1 -1
- package/lib/utils/command.d.ts +1 -1
- package/lib/utils/command.js +4 -0
- package/lib/utils/command.js.map +2 -2
- package/lib/utils/copy.js +4 -0
- package/lib/utils/copy.js.map +1 -1
- package/lib/utils/dir.js +4 -0
- package/lib/utils/dir.js.map +1 -1
- package/lib/utils/error.js +4 -0
- package/lib/utils/error.js.map +1 -1
- package/lib/utils/exec.js +7 -1
- package/lib/utils/exec.js.map +1 -1
- package/lib/utils/logging.js +4 -0
- package/lib/utils/logging.js.map +1 -1
- package/lib/utils/logo.js +4 -0
- package/lib/utils/logo.js.map +1 -1
- package/lib/utils/manifest.js +4 -0
- package/lib/utils/manifest.js.map +1 -1
- package/lib/utils/port.js +4 -0
- package/lib/utils/port.js.map +1 -1
- package/lib/utils/template.d.ts +1 -1
- package/lib/utils/template.js +4 -0
- package/lib/utils/template.js.map +2 -2
- package/lib/utils/validation.js.map +1 -1
- package/lib/utils/version.js +4 -0
- package/lib/utils/version.js.map +1 -1
- package/lib/wrapper/functionHandler.js +4 -0
- package/lib/wrapper/functionHandler.js.map +1 -1
- package/lib/wrapper/http.d.ts +6 -0
- package/lib/wrapper/http.js +15 -8
- package/lib/wrapper/http.js.map +2 -2
- package/lib/wrapper/index.js.map +1 -1
- package/lib/wrapper/main.js +4 -0
- package/lib/wrapper/main.js.map +1 -1
- package/lib/wrapper/requestListener.js +19 -5
- package/lib/wrapper/requestListener.js.map +3 -3
- package/package.json +14 -12
- package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/express-rest-api/package.json +1 -1
- package/template/express-rest-api/src/config.ts +1 -1
- package/template/express-rest-api/src/listen.ts +7 -0
- package/template/greeter/.buildkite/pipeline.yml +1 -1
- package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/koa-rest-api/package.json +5 -5
- package/template/koa-rest-api/src/config.ts +1 -1
- package/template/koa-rest-api/src/listen.ts +7 -0
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +3 -3
- package/template/lambda-sqs-worker/package.json +5 -4
- package/template/lambda-sqs-worker/src/config.ts +1 -1
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +3 -3
package/lib/api/git/commit.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/git/commit.ts"],
|
|
4
4
|
"sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nexport interface Identity {\n email?: string;\n name?: string;\n}\n\ninterface CommitParameters {\n author?: Identity;\n committer?: Identity;\n dir: string;\n message: string;\n}\n\n/**\n * Writes a commit to the local Git repository.\n */\nexport const commit = async ({\n author = { name: 'skuba' },\n committer = { name: 'skuba' },\n dir,\n message,\n}: CommitParameters): Promise<string> =>\n git.commit({\n author,\n committer,\n dir,\n fs,\n message,\n });\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAiBT,MAAM,SAAS,OAAO;AAAA,EAC3B,SAAS,EAAE,MAAM,QAAQ;AAAA,EACzB,YAAY,EAAE,MAAM,QAAQ;AAAA,EAC5B;AAAA,EACA;AACF,MACE,sBAAAA,QAAI,OAAO;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAAC;AAAA,EACA;AACF,CAAC;",
|
|
6
6
|
"names": ["git", "fs"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/git/commitAllChanges.ts"],
|
|
4
4
|
"sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nimport { commit } from './commit';\nimport type { Identity } from './commit';\nimport type { ChangedFile } from './getChangedFiles';\nimport { getChangedFiles } from './getChangedFiles';\n\ninterface CommitAllParameters {\n dir: string;\n message: string;\n author?: Identity;\n committer?: Identity;\n\n /**\n * File changes to exclude from the commit.\n *\n * Defaults to `[]` (no exclusions).\n */\n ignore?: ChangedFile[];\n}\n\n/**\n * Stages all changes and writes a commit to the local Git repository.\n */\nexport const commitAllChanges = async ({\n dir,\n message,\n\n author,\n committer,\n ignore,\n}: CommitAllParameters): Promise<string | undefined> => {\n const changedFiles = await getChangedFiles({ dir, ignore });\n\n if (!changedFiles.length) {\n return;\n }\n\n await Promise.all(\n changedFiles.map((file) =>\n file.state === 'deleted'\n ? git.remove({ fs, dir, filepath: file.path })\n : git.add({ fs, dir, filepath: file.path }),\n ),\n );\n\n return commit({\n dir,\n message,\n author,\n committer,\n });\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAEhB,oBAAuB;AAGvB,6BAAgC;AAmBzB,MAAM,mBAAmB,OAAO;AAAA,EACrC;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AACF,MAAwD;AACtD,QAAM,eAAe,UAAM,wCAAgB,EAAE,KAAK,OAAO,CAAC;AAE1D,MAAI,CAAC,aAAa,QAAQ;AACxB;AAAA,EACF;AAEA,QAAM,QAAQ;AAAA,IACZ,aAAa;AAAA,MAAI,CAAC,SAChB,KAAK,UAAU,YACX,sBAAAA,QAAI,OAAO,EAAE,oBAAAC,SAAI,KAAK,UAAU,KAAK,KAAK,CAAC,IAC3C,sBAAAD,QAAI,IAAI,EAAE,oBAAAC,SAAI,KAAK,UAAU,KAAK,KAAK,CAAC;AAAA,IAC9C;AAAA,EACF;AAEA,aAAO,sBAAO;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": ["git", "fs"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/git/currentBranch.ts"],
|
|
4
4
|
"sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\n/**\n * Tries to return a Git branch name from CI environment variables.\n */\nconst currentBranchFromEnvironment = (env = process.env): string | undefined =>\n env.BUILDKITE_BRANCH ?? env.GITHUB_HEAD_REF ?? env.GITHUB_REF_NAME;\n\ninterface CurrentBranchParameters {\n dir?: string;\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Tries to return a Git branch name from CI environment variables, falling back\n * to the local Git repository when the current working `dir` is supplied.\n */\nexport const currentBranch = async ({\n dir,\n env = process.env,\n}: CurrentBranchParameters = {}): Promise<string | undefined> => {\n const fromEnv = currentBranchFromEnvironment(env);\n\n if (fromEnv) {\n return fromEnv;\n }\n\n if (!dir) {\n return;\n }\n\n const fromRepo = await git.currentBranch({\n dir,\n fs,\n });\n\n return fromRepo ?? undefined;\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAKhB,MAAM,+BAA+B,CAAC,MAAM,QAAQ,QAClD,IAAI,oBAAoB,IAAI,mBAAmB,IAAI;AAW9C,MAAM,gBAAgB,OAAO;AAAA,EAClC;AAAA,EACA,MAAM,QAAQ;AAChB,IAA6B,CAAC,MAAmC;AAC/D,QAAM,UAAU,6BAA6B,GAAG;AAEhD,MAAI,SAAS;AACX,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,KAAK;AACR;AAAA,EACF;AAEA,QAAM,WAAW,MAAM,sBAAAA,QAAI,cAAc;AAAA,IACvC;AAAA,IACA,oBAAAC;AAAA,EACF,CAAC;AAED,SAAO,YAAY;AACrB;",
|
|
6
6
|
"names": ["git", "fs"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/git/getChangedFiles.ts"],
|
|
4
4
|
"sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nimport {\n ABSENT,\n FILEPATH,\n HEAD,\n MODIFIED,\n STAGE,\n UNMODIFIED,\n WORKDIR,\n} from './statusMatrix';\n\ntype ChangedFileState = 'added' | 'modified' | 'deleted';\nexport interface ChangedFile {\n path: string;\n state: ChangedFileState;\n}\ninterface ChangedFilesParameters {\n dir: string;\n\n /**\n * File changes to exclude from the result.\n *\n * Defaults to `[]` (no exclusions).\n */\n ignore?: ChangedFile[];\n}\n\nconst mapState = (\n row: [string, 0 | 1, 0 | 1 | 2, 0 | 1 | 2 | 3],\n): ChangedFileState => {\n if (row[HEAD] === ABSENT) {\n return 'added';\n }\n\n if (row[WORKDIR] === MODIFIED) {\n return 'modified';\n }\n\n return 'deleted';\n};\n\n/**\n * Returns all the files which have been added, modified or deleted in the\n * working directory of the local Git repository since the last commit.\n */\nexport const getChangedFiles = async ({\n dir,\n\n ignore = [],\n}: ChangedFilesParameters): Promise<ChangedFile[]> => {\n const allFiles = await git.statusMatrix({ fs, dir });\n return allFiles\n .filter(\n (row) =>\n row[HEAD] !== UNMODIFIED ||\n row[WORKDIR] !== UNMODIFIED ||\n row[STAGE] !== UNMODIFIED,\n )\n .map((row) => ({ path: row[FILEPATH], state: mapState(row) }))\n .filter(\n (changedFile) =>\n !ignore.some(\n (i) => i.path === changedFile.path && i.state === changedFile.state,\n ),\n );\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAEhB,0BAQO;AAkBP,MAAM,WAAW,CACf,QACqB;AACrB,MAAI,IAAI,wBAAI,MAAM,4BAAQ;AACxB,WAAO;AAAA,EACT;AAEA,MAAI,IAAI,2BAAO,MAAM,8BAAU;AAC7B,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAMO,MAAM,kBAAkB,OAAO;AAAA,EACpC;AAAA,EAEA,SAAS,CAAC;AACZ,MAAsD;AACpD,QAAM,WAAW,MAAM,sBAAAA,QAAI,aAAa,EAAE,oBAAAC,SAAI,IAAI,CAAC;AACnD,SAAO,SACJ;AAAA,IACC,CAAC,QACC,IAAI,wBAAI,MAAM,kCACd,IAAI,2BAAO,MAAM,kCACjB,IAAI,yBAAK,MAAM;AAAA,EACnB,EACC,IAAI,CAAC,SAAS,EAAE,MAAM,IAAI,4BAAQ,GAAG,OAAO,SAAS,GAAG,EAAE,EAAE,EAC5D;AAAA,IACC,CAAC,gBACC,CAAC,OAAO;AAAA,MACN,CAAC,MAAM,EAAE,SAAS,YAAY,QAAQ,EAAE,UAAU,YAAY;AAAA,IAChE;AAAA,EACJ;AACJ;",
|
|
6
6
|
"names": ["git", "fs"]
|
|
7
7
|
}
|
package/lib/api/git/log.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/lib/api/git/log.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/git/log.ts"],
|
|
4
4
|
"sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\ninterface GetHeadCommitParameters {\n dir: string;\n env?: Record<string, string | undefined>;\n}\n\nconst EMPTY_GIT_LOG_ERROR = new Error('Git log does not contain any commits');\n\n/**\n * Gets the object ID of the head commit.\n *\n * This tries to extract the commit ID from common CI environment variables,\n * and falls back to the local Git repository log.\n */\nexport const getHeadCommitId = async ({\n dir,\n env = process.env,\n}: GetHeadCommitParameters) => {\n const oidFromEnv = env.BUILDKITE_COMMIT ?? env.GITHUB_SHA;\n\n if (oidFromEnv) {\n return oidFromEnv;\n }\n\n const [headResult] = await git.log({ depth: 1, dir, fs });\n\n if (!headResult) {\n throw EMPTY_GIT_LOG_ERROR;\n }\n\n return headResult.oid;\n};\n\n/**\n * Gets the message of the head commit.\n *\n * This tries to extract the message from common CI environment variables,\n * and falls back to the local Git repository log.\n */\nexport const getHeadCommitMessage = async ({\n dir,\n env = process.env,\n}: GetHeadCommitParameters) => {\n const messageFromEnv = env.BUILDKITE_MESSAGE;\n\n if (messageFromEnv) {\n return messageFromEnv;\n }\n\n const [headResult] = await git.log({ depth: 1, dir, fs });\n\n if (!headResult) {\n throw EMPTY_GIT_LOG_ERROR;\n }\n\n return headResult.commit.message;\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAOhB,MAAM,sBAAsB,IAAI,MAAM,sCAAsC;AAQrE,MAAM,kBAAkB,OAAO;AAAA,EACpC;AAAA,EACA,MAAM,QAAQ;AAChB,MAA+B;AAC7B,QAAM,aAAa,IAAI,oBAAoB,IAAI;AAE/C,MAAI,YAAY;AACd,WAAO;AAAA,EACT;AAEA,QAAM,CAAC,UAAU,IAAI,MAAM,sBAAAA,QAAI,IAAI,EAAE,OAAO,GAAG,KAAK,oBAAAC,QAAG,CAAC;AAExD,MAAI,CAAC,YAAY;AACf,UAAM;AAAA,EACR;AAEA,SAAO,WAAW;AACpB;AAQO,MAAM,uBAAuB,OAAO;AAAA,EACzC;AAAA,EACA,MAAM,QAAQ;AAChB,MAA+B;AAC7B,QAAM,iBAAiB,IAAI;AAE3B,MAAI,gBAAgB;AAClB,WAAO;AAAA,EACT;AAEA,QAAM,CAAC,UAAU,IAAI,MAAM,sBAAAD,QAAI,IAAI,EAAE,OAAO,GAAG,KAAK,oBAAAC,QAAG,CAAC;AAExD,MAAI,CAAC,YAAY;AACf,UAAM;AAAA,EACR;AAEA,SAAO,WAAW,OAAO;AAC3B;",
|
|
6
6
|
"names": ["git", "fs"]
|
|
7
7
|
}
|
package/lib/api/git/pull.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/lib/api/git/pull.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/git/pull.ts"],
|
|
4
4
|
"sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\nimport http from 'isomorphic-git/http/node';\n\nimport { apiTokenFromEnvironment } from '../github/environment';\n\nimport { getOwnerAndRepo } from './remote';\n\n/**\n * Use a GitHub app token to auth the Git push.\n *\n * This defaults to the `GITHUB_API_TOKEN` and `GITHUB_TOKEN` environment\n * variables if `token` is not provided.\n */\ninterface GitHubAppAuth {\n type: 'gitHubApp';\n token?: string;\n}\n\ninterface PullParameters {\n /**\n * The auth mechanism for the push.\n *\n * Currently, only GitHub app tokens are supported.\n */\n auth: GitHubAppAuth;\n\n dir: string;\n\n /**\n * The local branch to fast forward.\n */\n ref: string;\n\n remote?: string;\n\n /**\n * The branch or tag on the remote to reference.\n *\n * This defaults to `ref`.\n */\n remoteRef?: string;\n}\n\n/**\n * Fast forwards the specified `ref` on the local Git repository to match the remote branch.\n */\nexport const fastForwardBranch = async ({\n auth,\n dir,\n ref,\n remote,\n remoteRef,\n}: PullParameters) => {\n const { owner, repo } = await getOwnerAndRepo({ dir });\n\n const url = `https://github.com/${encodeURIComponent(\n owner,\n )}/${encodeURIComponent(repo)}`;\n\n return git.fastForward({\n onAuth: () => ({\n username: 'x-access-token',\n password: auth.token ?? apiTokenFromEnvironment(),\n }),\n dir,\n fs,\n http,\n ref,\n remote,\n remoteRef,\n url,\n singleBranch: true,\n });\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAChB,kBAAiB;AAEjB,yBAAwC;AAExC,oBAAgC;AAyCzB,MAAM,oBAAoB,OAAO;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAsB;AACpB,QAAM,EAAE,OAAO,KAAK,IAAI,UAAM,+BAAgB,EAAE,IAAI,CAAC;AAErD,QAAM,MAAM,sBAAsB;AAAA,IAChC;AAAA,EACF,KAAK,mBAAmB,IAAI;AAE5B,SAAO,sBAAAA,QAAI,YAAY;AAAA,IACrB,QAAQ,OAAO;AAAA,MACb,UAAU;AAAA,MACV,UAAU,KAAK,aAAS,4CAAwB;AAAA,IAClD;AAAA,IACA;AAAA,IACA,oBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,EAChB,CAAC;AACH;",
|
|
6
6
|
"names": ["git", "fs", "http"]
|
|
7
7
|
}
|
package/lib/api/git/push.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/lib/api/git/push.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/git/push.ts"],
|
|
4
4
|
"sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\nimport http from 'isomorphic-git/http/node';\n\nimport { apiTokenFromEnvironment } from '../github/environment';\n\nimport { getOwnerAndRepo } from './remote';\n\n/**\n * Use a GitHub app token to auth the Git push.\n *\n * This defaults to the `GITHUB_API_TOKEN` and `GITHUB_TOKEN` environment\n * variables if `token` is not provided.\n */\ninterface GitHubAppAuth {\n type: 'gitHubApp';\n token?: string;\n}\n\ninterface PushParameters {\n /**\n * The auth mechanism for the push.\n *\n * Currently, only GitHub app tokens are supported.\n */\n auth: GitHubAppAuth;\n\n dir: string;\n\n /**\n * The reference to push to the remote.\n *\n * This may be a commit, branch or tag in the local repository.\n */\n ref: string;\n\n remote?: string;\n\n /**\n * The destination branch or tag on the remote.\n *\n * This defaults to `ref`.\n */\n remoteRef?: string;\n\n /**\n * Forcefully override any conflicts.\n *\n * This defaults to `false`.\n */\n force?: boolean;\n}\n\n/**\n * Pushes the specified `ref` from the local Git repository to a remote.\n */\nexport const push = async ({\n auth,\n dir,\n ref,\n remote,\n remoteRef,\n force,\n}: PushParameters) => {\n const { owner, repo } = await getOwnerAndRepo({ dir });\n\n const url = `https://github.com/${encodeURIComponent(\n owner,\n )}/${encodeURIComponent(repo)}`;\n\n return git.push({\n onAuth: () => ({\n username: 'x-access-token',\n password: auth.token ?? apiTokenFromEnvironment(),\n }),\n dir,\n fs,\n http,\n ref,\n remote,\n remoteRef,\n url,\n force,\n });\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAChB,kBAAiB;AAEjB,yBAAwC;AAExC,oBAAgC;AAkDzB,MAAM,OAAO,OAAO;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAsB;AACpB,QAAM,EAAE,OAAO,KAAK,IAAI,UAAM,+BAAgB,EAAE,IAAI,CAAC;AAErD,QAAM,MAAM,sBAAsB;AAAA,IAChC;AAAA,EACF,KAAK,mBAAmB,IAAI;AAE5B,SAAO,sBAAAA,QAAI,KAAK;AAAA,IACd,QAAQ,OAAO;AAAA,MACb,UAAU;AAAA,MACV,UAAU,KAAK,aAAS,4CAAwB;AAAA,IAClD;AAAA,IACA;AAAA,IACA,oBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": ["git", "fs", "http"]
|
|
7
7
|
}
|
package/lib/api/git/remote.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/git/remote.ts"],
|
|
4
4
|
"sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\n/**\n * Matches the owner and repository names in a GitHub repository URL.\n *\n * For example, given the following input strings:\n *\n * ```console\n * git@github.com:seek-oss/skuba.git\n * https://github.com/seek-oss/skuba.git\n * ```\n *\n * This pattern will produce the following matches:\n *\n * 1. seek-oss\n * 2. skuba\n */\nconst ownerRepoRegex = /github.com(?::|\\/)(.+)\\/(.+).git$/;\n\nconst ownerAndRepoFromUrl = (url: string) => {\n const match = ownerRepoRegex.exec(url);\n\n const owner = match?.[1];\n const repo = match?.[2];\n\n return { owner, repo };\n};\n\ninterface GetOwnerAndRepoParameters {\n dir: string;\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Extracts the owner and repository names from CI environment variables,\n * falling back to local Git remotes.\n *\n * Currently, only GitHub repository URLs are supported:\n *\n * ```console\n * git@github.com:seek-oss/skuba.git\n * https://github.com/seek-oss/skuba.git\n * ```\n */\nexport const getOwnerAndRepo = async ({\n dir,\n env = process.env,\n}: GetOwnerAndRepoParameters): Promise<{ owner: string; repo: string }> => {\n if (env.GITHUB_REPOSITORY) {\n const [owner, repo] = env.GITHUB_REPOSITORY.split('/');\n\n if (owner && repo) {\n return { owner, repo };\n }\n }\n\n if (env.BUILDKITE_REPO) {\n const { owner, repo } = ownerAndRepoFromUrl(env.BUILDKITE_REPO);\n\n if (owner && repo) {\n return { owner, repo };\n }\n }\n\n const remotes = await git.listRemotes({ dir, fs });\n\n for (const { url } of remotes) {\n const { owner, repo } = ownerAndRepoFromUrl(url);\n\n if (owner && repo) {\n return { owner, repo };\n }\n }\n\n throw new Error('Could not find a GitHub remote');\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAiBhB,MAAM,iBAAiB;AAEvB,MAAM,sBAAsB,CAAC,QAAgB;AAC3C,QAAM,QAAQ,eAAe,KAAK,GAAG;AAErC,QAAM,QAAQ,QAAQ,CAAC;AACvB,QAAM,OAAO,QAAQ,CAAC;AAEtB,SAAO,EAAE,OAAO,KAAK;AACvB;AAkBO,MAAM,kBAAkB,OAAO;AAAA,EACpC;AAAA,EACA,MAAM,QAAQ;AAChB,MAA2E;AACzE,MAAI,IAAI,mBAAmB;AACzB,UAAM,CAAC,OAAO,IAAI,IAAI,IAAI,kBAAkB,MAAM,GAAG;AAErD,QAAI,SAAS,MAAM;AACjB,aAAO,EAAE,OAAO,KAAK;AAAA,IACvB;AAAA,EACF;AAEA,MAAI,IAAI,gBAAgB;AACtB,UAAM,EAAE,OAAO,KAAK,IAAI,oBAAoB,IAAI,cAAc;AAE9D,QAAI,SAAS,MAAM;AACjB,aAAO,EAAE,OAAO,KAAK;AAAA,IACvB;AAAA,EACF;AAEA,QAAM,UAAU,MAAM,sBAAAA,QAAI,YAAY,EAAE,KAAK,oBAAAC,QAAG,CAAC;AAEjD,aAAW,EAAE,IAAI,KAAK,SAAS;AAC7B,UAAM,EAAE,OAAO,KAAK,IAAI,oBAAoB,GAAG;AAE/C,QAAI,SAAS,MAAM;AACjB,aAAO,EAAE,OAAO,KAAK;AAAA,IACvB;AAAA,EACF;AAEA,QAAM,IAAI,MAAM,gCAAgC;AAClD;",
|
|
6
6
|
"names": ["git", "fs"]
|
|
7
7
|
}
|
package/lib/api/git/reset.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/lib/api/git/reset.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/git/reset.ts"],
|
|
4
4
|
"sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nimport { FILEPATH, STAGE, UNMODIFIED, WORKDIR } from './statusMatrix';\n\ninterface ResetParameters {\n dir: string;\n branch: string;\n commitId: string;\n hard?: boolean;\n}\n\n/**\n * Resets the specified branch in the local Git repository to a particular\n * commit.\n */\nexport const reset = async ({\n dir,\n branch,\n commitId,\n hard,\n}: ResetParameters): Promise<void> => {\n await fs.promises.writeFile(\n path.join(dir, '.git/refs/heads', branch),\n `${commitId}\\n`,\n );\n\n if (hard) {\n const allFiles = await git.statusMatrix({ dir, fs });\n // Get all files which have been modified or staged - does not include new untracked files or deleted files\n const modifiedFiles = allFiles\n .filter((row) => row[WORKDIR] > UNMODIFIED && row[STAGE] > UNMODIFIED)\n .map((row) => row[FILEPATH]);\n\n // Delete modified/staged files\n await Promise.all(\n modifiedFiles.map((filePath) => fs.promises.rm(filePath)),\n );\n\n // This will bring in the unmodified versions of files plus any files which were deleted\n await git.checkout({ dir, fs, ref: branch, force: true });\n }\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AACf,4BAAgB;AAEhB,0BAAqD;AAa9C,MAAM,QAAQ,OAAO;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAsC;AACpC,QAAM,gBAAAA,QAAG,SAAS;AAAA,IAChB,YAAAC,QAAK,KAAK,KAAK,mBAAmB,MAAM;AAAA,IACxC,GAAG;AAAA;AAAA,EACL;AAEA,MAAI,MAAM;AACR,UAAM,WAAW,MAAM,sBAAAC,QAAI,aAAa,EAAE,KAAK,oBAAAF,QAAG,CAAC;AAEnD,UAAM,gBAAgB,SACnB,OAAO,CAAC,QAAQ,IAAI,2BAAO,IAAI,kCAAc,IAAI,yBAAK,IAAI,8BAAU,EACpE,IAAI,CAAC,QAAQ,IAAI,4BAAQ,CAAC;AAG7B,UAAM,QAAQ;AAAA,MACZ,cAAc,IAAI,CAAC,aAAa,gBAAAA,QAAG,SAAS,GAAG,QAAQ,CAAC;AAAA,IAC1D;AAGA,UAAM,sBAAAE,QAAI,SAAS,EAAE,KAAK,oBAAAF,SAAI,KAAK,QAAQ,OAAO,KAAK,CAAC;AAAA,EAC1D;AACF;",
|
|
6
6
|
"names": ["fs", "path", "git"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/github/checkRun.ts"],
|
|
4
4
|
"sourcesContent": ["import { Octokit } from '@octokit/rest';\nimport type { Endpoints } from '@octokit/types';\n\nimport { pluralise } from '../../utils/logging';\nimport * as Git from '../git';\n\nimport { apiTokenFromEnvironment } from './environment';\n\ntype Output = NonNullable<\n Endpoints['POST /repos/{owner}/{repo}/check-runs']['parameters']['output']\n>;\n\nexport type Annotation = NonNullable<Output['annotations']>[number];\n\nconst GITHUB_MAX_ANNOTATIONS = 50;\n\n/**\n * Suffixes the title with the number of annotations added, e.g.\n *\n * ```text\n * Build #12 failed (24 annotations added)\n * ```\n */\nconst suffixTitle = (title: string, inputAnnotations: number): string => {\n const addedAnnotations =\n inputAnnotations > GITHUB_MAX_ANNOTATIONS\n ? GITHUB_MAX_ANNOTATIONS\n : inputAnnotations;\n\n return `${title} (${pluralise(addedAnnotations, 'annotation')} added)`;\n};\n\n/**\n * Enriches the summary with more context about the check run.\n */\nconst createEnrichedSummary = (\n summary: string,\n inputAnnotations: number,\n): string =>\n [\n summary,\n ...(inputAnnotations > GITHUB_MAX_ANNOTATIONS\n ? [\n `${inputAnnotations} annotations were provided, but only the first ${GITHUB_MAX_ANNOTATIONS} are visible in GitHub.`,\n ]\n : []),\n ].join('\\n\\n');\n\n/**\n * {@link https://docs.github.com/en/rest/reference/checks#create-a-check-run}\n */\ninterface CreateCheckRunParameters {\n /**\n * Adds information from your analysis to specific lines of code.\n * Annotations are visible on GitHub in the **Checks** and **Files changed**\n * tab of the pull request.\n */\n annotations: Annotation[];\n\n /**\n * The final conclusion of the check.\n */\n conclusion: 'failure' | 'success';\n\n /**\n * The name of the check. For example, \"code-coverage\".\n */\n name: string;\n\n /**\n * The summary of the check run. This parameter supports Markdown.\n */\n summary: string;\n\n /**\n * The details of the check run. This parameter supports Markdown.\n */\n text?: string;\n\n /**\n * The title of the check run.\n */\n title: string;\n}\n\n/**\n * Asynchronously creates a GitHub check run with annotations.\n *\n * The first 50 `annotations` are written in full to GitHub.\n *\n * A `GITHUB_API_TOKEN` or `GITHUB_TOKEN` with the `checks:write` permission\n * must be present on the environment.\n */\nexport const createCheckRun = async ({\n annotations,\n conclusion,\n name,\n summary,\n text,\n title,\n}: CreateCheckRunParameters): Promise<void> => {\n const dir = process.cwd();\n\n const [commitId, { owner, repo }] = await Promise.all([\n Git.getHeadCommitId({ dir }),\n Git.getOwnerAndRepo({ dir }),\n ]);\n\n const client = new Octokit({ auth: apiTokenFromEnvironment() });\n\n await client.checks.create({\n conclusion,\n head_sha: commitId,\n name,\n output: {\n annotations: annotations.slice(0, GITHUB_MAX_ANNOTATIONS),\n summary: createEnrichedSummary(summary, annotations.length),\n text,\n title: suffixTitle(title, annotations.length),\n },\n owner,\n repo,\n });\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAGxB,qBAA0B;AAC1B,UAAqB;AAErB,yBAAwC;AAQxC,MAAM,yBAAyB;AAS/B,MAAM,cAAc,CAAC,OAAe,qBAAqC;AACvE,QAAM,mBACJ,mBAAmB,yBACf,yBACA;AAEN,SAAO,GAAG,cAAU,0BAAU,kBAAkB,YAAY;AAC9D;AAKA,MAAM,wBAAwB,CAC5B,SACA,qBAEA;AAAA,EACE;AAAA,EACA,GAAI,mBAAmB,yBACnB;AAAA,IACE,GAAG,kEAAkE;AAAA,EACvE,IACA,CAAC;AACP,EAAE,KAAK,MAAM;AA+CR,MAAM,iBAAiB,OAAO;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA+C;AAC7C,QAAM,MAAM,QAAQ,IAAI;AAExB,QAAM,CAAC,UAAU,EAAE,OAAO,KAAK,CAAC,IAAI,MAAM,QAAQ,IAAI;AAAA,IACpD,IAAI,gBAAgB,EAAE,IAAI,CAAC;AAAA,IAC3B,IAAI,gBAAgB,EAAE,IAAI,CAAC;AAAA,EAC7B,CAAC;AAED,QAAM,SAAS,IAAI,oBAAQ,EAAE,UAAM,4CAAwB,EAAE,CAAC;AAE9D,QAAM,OAAO,OAAO,OAAO;AAAA,IACzB;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,QAAQ;AAAA,MACN,aAAa,YAAY,MAAM,GAAG,sBAAsB;AAAA,MACxD,SAAS,sBAAsB,SAAS,YAAY,MAAM;AAAA,MAC1D;AAAA,MACA,OAAO,YAAY,OAAO,YAAY,MAAM;AAAA,IAC9C;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,7 +33,11 @@ const buildNameFromEnvironment = (env = process.env) => {
|
|
|
33
33
|
}
|
|
34
34
|
return "Build";
|
|
35
35
|
};
|
|
36
|
-
const enabledFromEnvironment = (env = process.env) => (
|
|
36
|
+
const enabledFromEnvironment = (env = process.env) => (
|
|
37
|
+
// Running in a CI environment.
|
|
38
|
+
(0, import_env.isCiEnv)(env) && // Has an API token at the ready.
|
|
39
|
+
Boolean(apiTokenFromEnvironment(env))
|
|
40
|
+
);
|
|
37
41
|
const apiTokenFromEnvironment = (env = process.env) => env.GITHUB_API_TOKEN ?? env.GITHUB_TOKEN;
|
|
38
42
|
// Annotate the CommonJS export names for ESM import in node:
|
|
39
43
|
0 && (module.exports = {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/github/environment.ts"],
|
|
4
4
|
"sourcesContent": ["import { isCiEnv } from '../../utils/env';\n\n/**\n * Returns the name of the build as seen in GitHub status checks.\n *\n * This is driven off of environment variables and falls back to `Build`.\n */\nexport const buildNameFromEnvironment = (env = process.env): string => {\n if (env.BUILDKITE_BUILD_NUMBER) {\n return `Build #${env.BUILDKITE_BUILD_NUMBER}`;\n }\n\n if (env.GITHUB_RUN_NUMBER) {\n return `${env.GITHUB_WORKFLOW ?? 'Build'} #${env.GITHUB_RUN_NUMBER}`;\n }\n\n return 'Build';\n};\n\n/**\n * Whether GitHub API interactions should be enabled.\n *\n * This checks environment variables to see if the code is executing in a CI\n * environment and has access to a GitHub API token.\n */\nexport const enabledFromEnvironment = (env = process.env): boolean =>\n // Running in a CI environment.\n isCiEnv(env) &&\n // Has an API token at the ready.\n Boolean(apiTokenFromEnvironment(env));\n\n/**\n * Tries to return a GitHub API token from the environment.\n */\nexport const apiTokenFromEnvironment = (\n env = process.env,\n): string | undefined => env.GITHUB_API_TOKEN ?? env.GITHUB_TOKEN;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAwB;AAOjB,MAAM,2BAA2B,CAAC,MAAM,QAAQ,QAAgB;AACrE,MAAI,IAAI,wBAAwB;AAC9B,WAAO,UAAU,IAAI;AAAA,EACvB;AAEA,MAAI,IAAI,mBAAmB;AACzB,WAAO,GAAG,IAAI,mBAAmB,YAAY,IAAI;AAAA,EACnD;AAEA,SAAO;AACT;AAQO,MAAM,yBAAyB,CAAC,MAAM,QAAQ,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAwB;AAOjB,MAAM,2BAA2B,CAAC,MAAM,QAAQ,QAAgB;AACrE,MAAI,IAAI,wBAAwB;AAC9B,WAAO,UAAU,IAAI;AAAA,EACvB;AAEA,MAAI,IAAI,mBAAmB;AACzB,WAAO,GAAG,IAAI,mBAAmB,YAAY,IAAI;AAAA,EACnD;AAEA,SAAO;AACT;AAQO,MAAM,yBAAyB,CAAC,MAAM,QAAQ;AAAA;AAAA,MAEnD,oBAAQ,GAAG;AAAA,EAEX,QAAQ,wBAAwB,GAAG,CAAC;AAAA;AAK/B,MAAM,0BAA0B,CACrC,MAAM,QAAQ,QACS,IAAI,oBAAoB,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/github/issueComment.ts"],
|
|
4
4
|
"sourcesContent": ["import { Octokit } from '@octokit/rest';\n\nimport * as Git from '../git';\n\nimport { apiTokenFromEnvironment } from './environment';\nimport { getPullRequestNumber } from './pullRequest';\n\nconst getUserId = async (client: Octokit): Promise<number> => {\n const { data } = await client.users.getAuthenticated();\n\n return data.id;\n};\n\n/**\n * https://docs.github.com/en/rest/reference/issues#create-an-issue-comment\n */\ninterface PutIssueCommentParameters {\n /**\n * The body of the issue comment.\n */\n body: string;\n\n /**\n * An internal identifier for the issue comment.\n *\n * This can be used to scope a given `put` to a particular comment, preventing\n * it from clobbering other comments from the same bot or user.\n *\n * The identifier is embedded as hidden content in the comment body.\n */\n internalId?: string;\n\n env?: Record<string, string | undefined>;\n\n /**\n * The number that identifies the GitHub issue.\n *\n * If this is not provided, the number will be inferred from the GitHub Repos\n * API by finding the latest pull request associated with the head commit.\n *\n * https://docs.github.com/en/rest/reference/repos#list-pull-requests-associated-with-a-commit\n */\n issueNumber?: number;\n\n /**\n * The ID of authenticated bot or user that is putting the issue comment.\n *\n * This drives our `put` behaviour, which tries to locate and edit an existing\n * comment before creating a new one. If this is not provided, the ID will be\n * inferred from the GitHub Users API.\n *\n * https://docs.github.com/en/rest/reference/users#get-the-authenticated-user\n *\n * If you're at SEEK and using BuildAgency's GitHub API integration, you may\n * hardcode this to `87109344` as an optimisation to skip the user lookup.\n *\n * https://api.github.com/users/buildagencygitapitoken[bot]\n */\n userId?: number;\n}\n\ninterface IssueComment {\n id: number;\n}\n\n/**\n * Asynchronously creates or updates a GitHub issue comment.\n *\n * This emulates `put` behaviour by overwriting the first existing comment by\n * the same author on the issue, enabling use cases like a persistent bot\n * comment at the top of the pull request that reflects the current status of a\n * CI check.\n *\n * A `GITHUB_API_TOKEN` or `GITHUB_TOKEN` with write permissions must be present\n * on the environment.\n */\nexport const putIssueComment = async (\n params: PutIssueCommentParameters,\n): Promise<IssueComment> => {\n const env = params.env ?? process.env;\n\n const dir = process.cwd();\n\n const { owner, repo } = await Git.getOwnerAndRepo({ dir });\n\n const client = new Octokit({ auth: apiTokenFromEnvironment() });\n\n const issueNumber =\n params.issueNumber ?? (await getPullRequestNumber({ client, env }));\n\n if (!issueNumber) {\n throw new Error('Failed to infer an issue number');\n }\n\n const comments = await client.issues.listComments({\n issue_number: issueNumber,\n owner,\n repo,\n });\n\n const userId = params.userId ?? (await getUserId(client));\n\n const commentId = comments.data.find(\n (comment) =>\n comment.user?.id === userId &&\n (params.internalId\n ? comment.body?.endsWith(`\\n\\n<!-- ${params.internalId} -->`)\n : true),\n )?.id;\n\n const body = params.internalId\n ? [params.body.trim(), `<!-- ${params.internalId} -->`].join('\\n\\n')\n : params.body.trim();\n\n const response = await (commentId\n ? client.issues.updateComment({\n body,\n comment_id: commentId,\n issue_number: issueNumber,\n owner,\n repo,\n })\n : client.issues.createComment({\n body,\n issue_number: issueNumber,\n owner,\n repo,\n }));\n\n return {\n id: response.data.id,\n };\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,UAAqB;AAErB,yBAAwC;AACxC,yBAAqC;AAErC,MAAM,YAAY,OAAO,WAAqC;AAC5D,QAAM,EAAE,KAAK,IAAI,MAAM,OAAO,MAAM,iBAAiB;AAErD,SAAO,KAAK;AACd;AAiEO,MAAM,kBAAkB,OAC7B,WAC0B;AAC1B,QAAM,MAAM,OAAO,OAAO,QAAQ;AAElC,QAAM,MAAM,QAAQ,IAAI;AAExB,QAAM,EAAE,OAAO,KAAK,IAAI,MAAM,IAAI,gBAAgB,EAAE,IAAI,CAAC;AAEzD,QAAM,SAAS,IAAI,oBAAQ,EAAE,UAAM,4CAAwB,EAAE,CAAC;AAE9D,QAAM,cACJ,OAAO,eAAgB,UAAM,yCAAqB,EAAE,QAAQ,IAAI,CAAC;AAEnE,MAAI,CAAC,aAAa;AAChB,UAAM,IAAI,MAAM,iCAAiC;AAAA,EACnD;AAEA,QAAM,WAAW,MAAM,OAAO,OAAO,aAAa;AAAA,IAChD,cAAc;AAAA,IACd;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,SAAS,OAAO,UAAW,MAAM,UAAU,MAAM;AAEvD,QAAM,YAAY,SAAS,KAAK;AAAA,IAC9B,CAAC,YACC,QAAQ,MAAM,OAAO,WACpB,OAAO,aACJ,QAAQ,MAAM,SAAS;AAAA;AAAA,OAAY,OAAO,gBAAgB,IAC1D;AAAA,EACR,GAAG;AAEH,QAAM,OAAO,OAAO,aAChB,CAAC,OAAO,KAAK,KAAK,GAAG,QAAQ,OAAO,gBAAgB,EAAE,KAAK,MAAM,IACjE,OAAO,KAAK,KAAK;AAErB,QAAM,WAAW,OAAO,YACpB,OAAO,OAAO,cAAc;AAAA,IAC1B;AAAA,IACA,YAAY;AAAA,IACZ,cAAc;AAAA,IACd;AAAA,IACA;AAAA,EACF,CAAC,IACD,OAAO,OAAO,cAAc;AAAA,IAC1B;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,EACF,CAAC;AAEL,SAAO;AAAA,IACL,IAAI,SAAS,KAAK;AAAA,EACpB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/github/pullRequest.ts"],
|
|
4
4
|
"sourcesContent": ["import { Octokit } from '@octokit/rest';\n\nimport * as Git from '../git';\n\nimport { apiTokenFromEnvironment } from './environment';\n\ninterface GetPullRequestParameters {\n /**\n * A preconstructed Octokit client to interact with GitHub's APIs.\n *\n * A `GITHUB_API_TOKEN` or `GITHUB_TOKEN` with write permissions must be\n * present on the environment if this is not provided.\n */\n client?: Octokit;\n\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Gets the number of the current pull request.\n *\n * This tries to extract the pull request from common CI environment variables,\n * and falls back to querying the GitHub Repos API for the latest pull request\n * associated with the head commit. An error is thrown if there are no\n * associated pull requests, or if they are all closed or locked.\n */\nexport const getPullRequestNumber = async (\n params: GetPullRequestParameters = {},\n): Promise<number> => {\n const env = params.env ?? process.env;\n\n const dir = process.cwd();\n\n const number = Number(\n env.BUILDKITE_PULL_REQUEST ??\n env.GITHUB_REF?.replace(/^refs\\/pull\\/(\\d+).*$/, '$1'),\n );\n\n if (Number.isSafeInteger(number)) {\n return number;\n }\n\n const client =\n params.client ?? new Octokit({ auth: apiTokenFromEnvironment() });\n\n const [commitId, { owner, repo }] = await Promise.all([\n Git.getHeadCommitId({ dir, env }),\n Git.getOwnerAndRepo({ dir }),\n ]);\n\n const response = await client.repos.listPullRequestsAssociatedWithCommit({\n commit_sha: commitId,\n owner,\n repo,\n });\n\n const data = response.data\n .filter((pr) => pr.state === 'open' && !pr.locked)\n .sort((a, b) => b.updated_at.localeCompare(a.updated_at));\n\n if (!data.length) {\n throw new Error(\n `Commit ${commitId} is not associated with an open GitHub pull request`,\n );\n }\n\n return data[0].number;\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,UAAqB;AAErB,yBAAwC;AAsBjC,MAAM,uBAAuB,OAClC,SAAmC,CAAC,MAChB;AACpB,QAAM,MAAM,OAAO,OAAO,QAAQ;AAElC,QAAM,MAAM,QAAQ,IAAI;AAExB,QAAM,SAAS;AAAA,IACb,IAAI,0BACF,IAAI,YAAY,QAAQ,yBAAyB,IAAI;AAAA,EACzD;AAEA,MAAI,OAAO,cAAc,MAAM,GAAG;AAChC,WAAO;AAAA,EACT;AAEA,QAAM,SACJ,OAAO,UAAU,IAAI,oBAAQ,EAAE,UAAM,4CAAwB,EAAE,CAAC;AAElE,QAAM,CAAC,UAAU,EAAE,OAAO,KAAK,CAAC,IAAI,MAAM,QAAQ,IAAI;AAAA,IACpD,IAAI,gBAAgB,EAAE,KAAK,IAAI,CAAC;AAAA,IAChC,IAAI,gBAAgB,EAAE,IAAI,CAAC;AAAA,EAC7B,CAAC;AAED,QAAM,WAAW,MAAM,OAAO,MAAM,qCAAqC;AAAA,IACvE,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,OAAO,SAAS,KACnB,OAAO,CAAC,OAAO,GAAG,UAAU,UAAU,CAAC,GAAG,MAAM,EAChD,KAAK,CAAC,GAAG,MAAM,EAAE,WAAW,cAAc,EAAE,UAAU,CAAC;AAE1D,MAAI,CAAC,KAAK,QAAQ;AAChB,UAAM,IAAI;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,EACF;AAEA,SAAO,KAAK,CAAC,EAAE;AACjB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/api/github/push.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/github/push.ts"],
|
|
4
4
|
"sourcesContent": ["import { graphql } from '@octokit/graphql';\nimport type {\n CreateCommitOnBranchInput,\n FileAddition,\n FileDeletion,\n} from '@octokit/graphql-schema';\nimport fs from 'fs-extra';\n\nimport * as Git from '../git';\n\nimport { apiTokenFromEnvironment } from './environment';\n\ninterface CreateCommitResult {\n createCommitOnBranch: {\n commit: {\n oid: string;\n };\n };\n}\n\ninterface UploadAllFileChangesParams {\n dir: string;\n /**\n * The branch name\n */\n branch: string;\n /**\n * The headline of the commit message\n */\n messageHeadline: string;\n\n /**\n * File changes to exclude from the upload.\n *\n * Defaults to `[]` (no exclusions).\n */\n ignore?: Git.ChangedFile[];\n /**\n * The body of the commit message\n */\n messageBody?: string;\n /**\n * Updates the local Git repository to match the new remote branch state\n */\n updateLocal?: boolean;\n}\n\n/**\n * Retrieves all file changes from the local Git repository using\n * `getChangedFiles`, then uploads the changes to a specified GitHub branch\n * using `uploadFileChanges`.\n *\n * Returns the commit ID, or `undefined` if there are no changes to commit.\n *\n * The file changes will appear as verified commits on GitHub.\n *\n * This will not update the local Git repository unless `updateLocal` is\n * specified.\n */\nexport const uploadAllFileChanges = async ({\n branch,\n dir,\n messageHeadline,\n\n ignore,\n messageBody,\n updateLocal = false,\n}: UploadAllFileChangesParams): Promise<string | undefined> => {\n const changedFiles = await Git.getChangedFiles({ dir, ignore });\n\n if (!changedFiles.length) {\n return;\n }\n\n const fileChanges = await readFileChanges(changedFiles);\n\n const commitId = await uploadFileChanges({\n dir,\n branch,\n messageHeadline,\n messageBody,\n fileChanges,\n });\n\n if (updateLocal) {\n await Promise.all(\n [...fileChanges.additions, ...fileChanges.deletions].map((file) =>\n fs.rm(file.path),\n ),\n );\n\n await Git.fastForwardBranch({\n ref: branch,\n auth: { type: 'gitHubApp' },\n dir,\n });\n }\n\n return commitId;\n};\n\nexport interface FileChanges {\n additions: FileAddition[];\n deletions: FileDeletion[];\n}\n\n/**\n * Takes a list of `ChangedFiles`, reads them from the file system, and maps\n * them to GitHub GraphQL `FileChanges`.\n *\n * https://docs.github.com/en/graphql/reference/input-objects#filechanges\n */\nexport const readFileChanges = async (\n changedFiles: Git.ChangedFile[],\n): Promise<FileChanges> => {\n const { added, deleted } = changedFiles.reduce<{\n added: string[];\n deleted: string[];\n }>(\n (files, changedFile) => {\n const filePath = changedFile.path;\n if (changedFile.state === 'deleted') {\n files.deleted.push(filePath);\n } else {\n files.added.push(filePath);\n }\n\n return files;\n },\n { added: [], deleted: [] },\n );\n\n const additions: FileAddition[] = await Promise.all(\n added.map(async (filePath) => ({\n path: filePath,\n contents: await fs.promises.readFile(filePath, {\n encoding: 'base64',\n }),\n })),\n );\n\n const deletions: FileDeletion[] = deleted.map((filePath) => ({\n path: filePath,\n }));\n\n return {\n additions,\n deletions,\n };\n};\n\ninterface UploadFileChangesParams {\n dir: string;\n /**\n * The branch name\n */\n branch: string;\n /**\n * The headline of the commit message\n */\n messageHeadline: string;\n /**\n * The body of the commit message\n */\n messageBody?: string;\n /**\n * File additions and deletions\n */\n fileChanges: FileChanges;\n}\n\n/**\n * Uploads file changes from the local workspace to a specified GitHub branch.\n *\n * The file changes will appear as verified commits on GitHub.\n *\n * This will not update the local Git repository.\n */\nexport const uploadFileChanges = async ({\n dir,\n branch,\n messageHeadline,\n messageBody,\n fileChanges,\n}: UploadFileChangesParams): Promise<string> => {\n const authToken = apiTokenFromEnvironment();\n if (!authToken) {\n throw new Error(\n 'Could not read a GitHub API token from the environment. Please set GITHUB_API_TOKEN or GITHUB_TOKEN.',\n );\n }\n\n const [{ owner, repo }, headCommitId] = await Promise.all([\n Git.getOwnerAndRepo({ dir }),\n Git.getHeadCommitId({ dir }),\n ]);\n\n const input: CreateCommitOnBranchInput = {\n branch: {\n repositoryNameWithOwner: `${owner}/${repo}`,\n branchName: branch,\n },\n message: {\n headline: messageHeadline,\n body: messageBody,\n },\n expectedHeadOid: headCommitId,\n clientMutationId: 'skuba',\n fileChanges,\n };\n\n const result = await graphql<CreateCommitResult>(\n `\n mutation Mutation($input: CreateCommitOnBranchInput!) {\n createCommitOnBranch(input: $input) {\n commit {\n oid\n }\n }\n }\n `,\n {\n input,\n headers: {\n authorization: `Bearer ${authToken}`,\n },\n },\n );\n\n return result.createCommitOnBranch.commit.oid;\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AAMxB,sBAAe;AAEf,UAAqB;AAErB,yBAAwC;AAiDjC,MAAM,uBAAuB,OAAO;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA,cAAc;AAChB,MAA+D;AAC7D,QAAM,eAAe,MAAM,IAAI,gBAAgB,EAAE,KAAK,OAAO,CAAC;AAE9D,MAAI,CAAC,aAAa,QAAQ;AACxB;AAAA,EACF;AAEA,QAAM,cAAc,MAAM,gBAAgB,YAAY;AAEtD,QAAM,WAAW,MAAM,kBAAkB;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,MAAI,aAAa;AACf,UAAM,QAAQ;AAAA,MACZ,CAAC,GAAG,YAAY,WAAW,GAAG,YAAY,SAAS,EAAE;AAAA,QAAI,CAAC,SACxD,gBAAAA,QAAG,GAAG,KAAK,IAAI;AAAA,MACjB;AAAA,IACF;AAEA,UAAM,IAAI,kBAAkB;AAAA,MAC1B,KAAK;AAAA,MACL,MAAM,EAAE,MAAM,YAAY;AAAA,MAC1B;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;AAaO,MAAM,kBAAkB,OAC7B,iBACyB;AACzB,QAAM,EAAE,OAAO,QAAQ,IAAI,aAAa;AAAA,IAItC,CAAC,OAAO,gBAAgB;AACtB,YAAM,WAAW,YAAY;AAC7B,UAAI,YAAY,UAAU,WAAW;AACnC,cAAM,QAAQ,KAAK,QAAQ;AAAA,MAC7B,OAAO;AACL,cAAM,MAAM,KAAK,QAAQ;AAAA,MAC3B;AAEA,aAAO;AAAA,IACT;AAAA,IACA,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,EAAE;AAAA,EAC3B;AAEA,QAAM,YAA4B,MAAM,QAAQ;AAAA,IAC9C,MAAM,IAAI,OAAO,cAAc;AAAA,MAC7B,MAAM;AAAA,MACN,UAAU,MAAM,gBAAAA,QAAG,SAAS,SAAS,UAAU;AAAA,QAC7C,UAAU;AAAA,MACZ,CAAC;AAAA,IACH,EAAE;AAAA,EACJ;AAEA,QAAM,YAA4B,QAAQ,IAAI,CAAC,cAAc;AAAA,IAC3D,MAAM;AAAA,EACR,EAAE;AAEF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;AA6BO,MAAM,oBAAoB,OAAO;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAgD;AAC9C,QAAM,gBAAY,4CAAwB;AAC1C,MAAI,CAAC,WAAW;AACd,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,CAAC,EAAE,OAAO,KAAK,GAAG,YAAY,IAAI,MAAM,QAAQ,IAAI;AAAA,IACxD,IAAI,gBAAgB,EAAE,IAAI,CAAC;AAAA,IAC3B,IAAI,gBAAgB,EAAE,IAAI,CAAC;AAAA,EAC7B,CAAC;AAED,QAAM,QAAmC;AAAA,IACvC,QAAQ;AAAA,MACN,yBAAyB,GAAG,SAAS;AAAA,MACrC,YAAY;AAAA,IACd;AAAA,IACA,SAAS;AAAA,MACP,UAAU;AAAA,MACV,MAAM;AAAA,IACR;AAAA,IACA,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,IAClB;AAAA,EACF;AAEA,QAAM,SAAS,UAAM;AAAA,IACnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA;AAAA,MACE;AAAA,MACA,SAAS;AAAA,QACP,eAAe,UAAU;AAAA,MAC3B;AAAA,IACF;AAAA,EACF;AAEA,SAAO,OAAO,qBAAqB,OAAO;AAC5C;",
|
|
6
6
|
"names": ["fs"]
|
|
7
7
|
}
|
package/lib/api/jest/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ type DefaultOptions = 'collectCoverage' | 'collectCoverageFrom' | 'coveragePathI
|
|
|
11
11
|
*
|
|
12
12
|
* This concatenates array options like `testPathIgnorePatterns`.
|
|
13
13
|
*/
|
|
14
|
-
export declare const mergePreset: <AdditionalOptions extends "filter" | "json" | "silent" | "cache" | "runtime" | "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" | "preset" | "prettierPath" | "resetMocks" | "resetModules" | "resolver" | "restoreMocks" | "rootDir" | "roots" | "sandboxInjectedGlobals" | "setupFiles" | "setupFilesAfterEnv" | "skipFilter" | "skipNodeResolution" | "slowTestThreshold" | "snapshotResolver" | "snapshotSerializers" | "snapshotFormat" | "testEnvironment" | "testEnvironmentOptions" | "testMatch" | "testLocationInResults" | "testPathIgnorePatterns" | "testRegex" | "testRunner" | "transform" | "transformIgnorePatterns" | "watchPathIgnorePatterns" | "unmockedModulePathPatterns" | "workerIdleMemoryLimit" | "bail" | "ci" | "changedFilesWithAncestor" | "changedSince" | "collectCoverage" | "collectCoverageFrom" | "coverageDirectory" | "coverageProvider" | "coverageReporters" | "coverageThreshold" | "expand" | "findRelatedTests" | "forceExit" | "reporters" | "logHeapUsage" | "lastCommit" | "listTests" | "maxConcurrency" | "maxWorkers" | "noStackTrace" | "notify" | "notifyMode" | "onlyChanged" | "onlyFailures" | "outputFile" | "passWithNoTests" | "replname" | "runTestsByPath" | "showSeed" | "testFailureExitCode" | "testNamePattern" | "testResultsProcessor" | "testSequencer" | "testTimeout" | "updateSnapshot" | "useStderr" | "verbose" | "
|
|
14
|
+
export declare const mergePreset: <AdditionalOptions extends "filter" | "json" | "silent" | "cache" | "runtime" | "watch" | "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" | "preset" | "prettierPath" | "resetMocks" | "resetModules" | "resolver" | "restoreMocks" | "rootDir" | "roots" | "sandboxInjectedGlobals" | "setupFiles" | "setupFilesAfterEnv" | "skipFilter" | "skipNodeResolution" | "slowTestThreshold" | "snapshotResolver" | "snapshotSerializers" | "snapshotFormat" | "testEnvironment" | "testEnvironmentOptions" | "testMatch" | "testLocationInResults" | "testPathIgnorePatterns" | "testRegex" | "testRunner" | "transform" | "transformIgnorePatterns" | "watchPathIgnorePatterns" | "unmockedModulePathPatterns" | "workerIdleMemoryLimit" | "bail" | "ci" | "changedFilesWithAncestor" | "changedSince" | "collectCoverage" | "collectCoverageFrom" | "coverageDirectory" | "coverageProvider" | "coverageReporters" | "coverageThreshold" | "expand" | "findRelatedTests" | "forceExit" | "reporters" | "logHeapUsage" | "lastCommit" | "listTests" | "maxConcurrency" | "maxWorkers" | "noStackTrace" | "notify" | "notifyMode" | "onlyChanged" | "onlyFailures" | "outputFile" | "passWithNoTests" | "replname" | "runTestsByPath" | "showSeed" | "testFailureExitCode" | "testNamePattern" | "testResultsProcessor" | "testSequencer" | "testTimeout" | "updateSnapshot" | "useStderr" | "verbose" | "watchAll" | "watchman" | "watchPlugins">(options: Pick<Partial<{
|
|
15
15
|
automock: boolean;
|
|
16
16
|
bail: number | boolean;
|
|
17
17
|
cache: boolean;
|
package/lib/api/jest/index.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/jest/index.ts"],
|
|
4
4
|
"sourcesContent": ["import type { Config } from '@jest/types';\n\nimport jestPreset from '../../../jest-preset';\nimport { mergeRaw } from '../../cli/configure/processing/record';\n\n/**\n * Set of Jest options that are recommended and supported for customisation.\n *\n * While we technically accept anything compatible with `Config.InitialOptions`,\n * these are tacitly endorsed for our use cases and receive IntelliSense.\n */\ntype DefaultOptions =\n | 'collectCoverage'\n | 'collectCoverageFrom'\n | 'coveragePathIgnorePatterns'\n | 'coverageThreshold'\n | 'displayName'\n | 'globals'\n | 'globalSetup'\n | 'globalTeardown'\n | 'projects'\n | 'setupFiles'\n | 'setupFilesAfterEnv'\n | 'snapshotSerializers'\n | 'testEnvironment'\n | 'testPathIgnorePatterns'\n | 'testTimeout'\n | 'watchPathIgnorePatterns';\n\n/**\n * Merge additional Jest options into the **skuba** preset.\n *\n * This concatenates array options like `testPathIgnorePatterns`.\n */\nexport const mergePreset = <\n AdditionalOptions extends keyof Config.InitialOptions,\n>(\n options: Pick<Config.InitialOptions, AdditionalOptions | DefaultOptions>,\n): Config.InitialOptions => mergeRaw(jestPreset, options);\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,yBAAuB;AACvB,oBAAyB;AA+BlB,MAAM,cAAc,CAGzB,gBAC0B,wBAAS,mBAAAA,SAAY,OAAO;",
|
|
6
6
|
"names": ["jestPreset"]
|
|
7
7
|
}
|
package/lib/api/net/socket.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/api/net/socket.ts"],
|
|
4
4
|
"sourcesContent": ["import net from 'net';\n\nexport interface SocketAddress {\n host: string;\n port: number;\n}\n\nconst trySocket = async (host: string, port: number) =>\n new Promise((resolve) => {\n const socket = new net.Socket();\n\n const onFailure = () => {\n socket.destroy();\n resolve(false);\n };\n\n const onSuccess = () => socket.end(() => resolve(true));\n\n socket\n .connect(port, host, onSuccess)\n .once('error', onFailure)\n .once('timeout', onFailure)\n .setTimeout(1_000);\n });\n\nexport const pollSocket = async (host: string, port: number, timeout: number) =>\n new Promise<void>((resolve, reject) => {\n const callPort = async () => {\n const success = await trySocket(host, port);\n\n if (!success) {\n return;\n }\n\n clearTimeout(intervalId);\n clearTimeout(timeoutId);\n\n resolve();\n };\n\n const intervalId = setInterval(() => {\n callPort().catch(() => undefined);\n }, 250);\n\n const timeoutId = setTimeout(() => {\n clearTimeout(intervalId);\n clearTimeout(timeoutId);\n\n reject(Error(`could not reach ${host}:${port} within ${timeout}ms`));\n }, timeout);\n\n callPort().catch(() => undefined);\n });\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAgB;AAOhB,MAAM,YAAY,OAAO,MAAc,SACrC,IAAI,QAAQ,CAAC,YAAY;AACvB,QAAM,SAAS,IAAI,WAAAA,QAAI,OAAO;AAE9B,QAAM,YAAY,MAAM;AACtB,WAAO,QAAQ;AACf,YAAQ,KAAK;AAAA,EACf;AAEA,QAAM,YAAY,MAAM,OAAO,IAAI,MAAM,QAAQ,IAAI,CAAC;AAEtD,SACG,QAAQ,MAAM,MAAM,SAAS,EAC7B,KAAK,SAAS,SAAS,EACvB,KAAK,WAAW,SAAS,EACzB,WAAW,GAAK;AACrB,CAAC;AAEI,MAAM,aAAa,OAAO,MAAc,MAAc,YAC3D,IAAI,QAAc,CAAC,SAAS,WAAW;AACrC,QAAM,WAAW,YAAY;AAC3B,UAAM,UAAU,MAAM,UAAU,MAAM,IAAI;AAE1C,QAAI,CAAC,SAAS;AACZ;AAAA,IACF;AAEA,iBAAa,UAAU;AACvB,iBAAa,SAAS;AAEtB,YAAQ;AAAA,EACV;AAEA,QAAM,aAAa,YAAY,MAAM;AACnC,aAAS,EAAE,MAAM,MAAM,MAAS;AAAA,EAClC,GAAG,GAAG;AAEN,QAAM,YAAY,WAAW,MAAM;AACjC,iBAAa,UAAU;AACvB,iBAAa,SAAS;AAEtB,WAAO,MAAM,mBAAmB,QAAQ,eAAe,WAAW,CAAC;AAAA,EACrE,GAAG,OAAO;AAEV,WAAS,EAAE,MAAM,MAAM,MAAS;AAClC,CAAC;",
|
|
6
6
|
"names": ["net"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -41,7 +45,7 @@ const runESLint = async (mode, logger) => {
|
|
|
41
45
|
logger.debug("Initialising ESLint...");
|
|
42
46
|
const engine = new import_eslint.ESLint({
|
|
43
47
|
cache: true,
|
|
44
|
-
extensions: ["js", "ts", "tsx"],
|
|
48
|
+
extensions: ["js", "ts", "tsx", "yaml", "yml"],
|
|
45
49
|
fix: mode === "format",
|
|
46
50
|
reportUnusedDisableDirectives: "error"
|
|
47
51
|
});
|
|
@@ -50,7 +54,12 @@ const runESLint = async (mode, logger) => {
|
|
|
50
54
|
const start = process.hrtime.bigint();
|
|
51
55
|
const ogConsoleError = console.error;
|
|
52
56
|
console.error = (...args) => {
|
|
53
|
-
if (args[0] !==
|
|
57
|
+
if (args[0] !== // `eslint-plugin-react` prints this annoying error on non-React repos.
|
|
58
|
+
// We still want to support React linting for repos that have React code,
|
|
59
|
+
// so we have to manually suppress it.
|
|
60
|
+
//
|
|
61
|
+
// https://github.com/yannickcr/eslint-plugin-react/blob/7484acaca8351a8568fa99344bc811c5cd8396bd/lib/util/version.js#L61-L65
|
|
62
|
+
'Warning: React version was set to "detect" in eslint-plugin-react settings, but the "react" package is not installed. Assuming latest React version for linting.') {
|
|
54
63
|
ogConsoleError(...args);
|
|
55
64
|
}
|
|
56
65
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/adapter/eslint.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport chalk from 'chalk';\nimport type { Linter } from 'eslint';\nimport { ESLint } from 'eslint';\n\nimport type { Logger } from '../../utils/logging';\nimport { pluralise } from '../../utils/logging';\n\nconst symbolForResult = (result: ESLint.LintResult) => {\n if (result.errorCount) {\n return chalk.red('\u25CB');\n }\n\n return result.warningCount ? chalk.yellow('\u25CD') : chalk.green('\u25CB');\n};\n\nexport interface ESLintResult {\n messages: Linter.LintMessage[];\n filePath: string;\n}\n\nexport interface ESLintOutput {\n errors: ESLintResult[];\n fixable: boolean;\n ok: boolean;\n output: string;\n warnings: ESLintResult[];\n}\n\nexport const runESLint = async (\n mode: 'format' | 'lint',\n logger: Logger,\n): Promise<ESLintOutput> => {\n logger.debug('Initialising ESLint...');\n\n const engine = new ESLint({\n cache: true,\n extensions: ['js', 'ts', 'tsx'],\n fix: mode === 'format',\n reportUnusedDisableDirectives: 'error',\n });\n\n const cwd = process.cwd();\n\n logger.debug('Processing files...');\n\n const start = process.hrtime.bigint();\n\n /* eslint-disable no-console */\n const ogConsoleError = console.error;\n console.error = (...args: unknown[]) => {\n if (\n args[0] !==\n // `eslint-plugin-react` prints this annoying error on non-React repos.\n // We still want to support React linting for repos that have React code,\n // so we have to manually suppress it.\n //\n // https://github.com/yannickcr/eslint-plugin-react/blob/7484acaca8351a8568fa99344bc811c5cd8396bd/lib/util/version.js#L61-L65\n 'Warning: React version was set to \"detect\" in eslint-plugin-react settings, but the \"react\" package is not installed. Assuming latest React version for linting.'\n ) {\n ogConsoleError(...args);\n }\n };\n\n const [formatter, results] = await Promise.all([\n engine.loadFormatter(),\n engine.lintFiles('.'),\n ]);\n\n console.error = ogConsoleError;\n /* eslint-enable no-console */\n\n const end = process.hrtime.bigint();\n\n logger.plain(\n `Processed ${pluralise(results.length, 'file')} in ${logger.timing(\n start,\n end,\n )}.`,\n );\n\n const errors: ESLintResult[] = [];\n const warnings: ESLintResult[] = [];\n let fixable = false;\n\n for (const result of results) {\n const relativePath = path.relative(cwd, result.filePath);\n if (result.fixableErrorCount + result.fixableWarningCount) {\n fixable = true;\n }\n\n if (result.errorCount) {\n errors.push({\n filePath: relativePath,\n messages: result.messages,\n });\n }\n\n if (result.warningCount) {\n warnings.push({\n filePath: relativePath,\n messages: result.messages,\n });\n }\n\n logger.debug(symbolForResult(result), relativePath);\n }\n\n const ok = errors.length === 0;\n\n await ESLint.outputFixes(results);\n\n const output = await formatter.format(results);\n\n if (output) {\n logger.plain(output);\n }\n\n return { errors, fixable, ok, output, warnings };\n};\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport chalk from 'chalk';\nimport type { Linter } from 'eslint';\nimport { ESLint } from 'eslint';\n\nimport type { Logger } from '../../utils/logging';\nimport { pluralise } from '../../utils/logging';\n\nconst symbolForResult = (result: ESLint.LintResult) => {\n if (result.errorCount) {\n return chalk.red('\u25CB');\n }\n\n return result.warningCount ? chalk.yellow('\u25CD') : chalk.green('\u25CB');\n};\n\nexport interface ESLintResult {\n messages: Linter.LintMessage[];\n filePath: string;\n}\n\nexport interface ESLintOutput {\n errors: ESLintResult[];\n fixable: boolean;\n ok: boolean;\n output: string;\n warnings: ESLintResult[];\n}\n\nexport const runESLint = async (\n mode: 'format' | 'lint',\n logger: Logger,\n): Promise<ESLintOutput> => {\n logger.debug('Initialising ESLint...');\n\n const engine = new ESLint({\n cache: true,\n extensions: ['js', 'ts', 'tsx', 'yaml', 'yml'],\n fix: mode === 'format',\n reportUnusedDisableDirectives: 'error',\n });\n\n const cwd = process.cwd();\n\n logger.debug('Processing files...');\n\n const start = process.hrtime.bigint();\n\n /* eslint-disable no-console */\n const ogConsoleError = console.error;\n console.error = (...args: unknown[]) => {\n if (\n args[0] !==\n // `eslint-plugin-react` prints this annoying error on non-React repos.\n // We still want to support React linting for repos that have React code,\n // so we have to manually suppress it.\n //\n // https://github.com/yannickcr/eslint-plugin-react/blob/7484acaca8351a8568fa99344bc811c5cd8396bd/lib/util/version.js#L61-L65\n 'Warning: React version was set to \"detect\" in eslint-plugin-react settings, but the \"react\" package is not installed. Assuming latest React version for linting.'\n ) {\n ogConsoleError(...args);\n }\n };\n\n const [formatter, results] = await Promise.all([\n engine.loadFormatter(),\n engine.lintFiles('.'),\n ]);\n\n console.error = ogConsoleError;\n /* eslint-enable no-console */\n\n const end = process.hrtime.bigint();\n\n logger.plain(\n `Processed ${pluralise(results.length, 'file')} in ${logger.timing(\n start,\n end,\n )}.`,\n );\n\n const errors: ESLintResult[] = [];\n const warnings: ESLintResult[] = [];\n let fixable = false;\n\n for (const result of results) {\n const relativePath = path.relative(cwd, result.filePath);\n if (result.fixableErrorCount + result.fixableWarningCount) {\n fixable = true;\n }\n\n if (result.errorCount) {\n errors.push({\n filePath: relativePath,\n messages: result.messages,\n });\n }\n\n if (result.warningCount) {\n warnings.push({\n filePath: relativePath,\n messages: result.messages,\n });\n }\n\n logger.debug(symbolForResult(result), relativePath);\n }\n\n const ok = errors.length === 0;\n\n await ESLint.outputFixes(results);\n\n const output = await formatter.format(results);\n\n if (output) {\n logger.plain(output);\n }\n\n return { errors, fixable, ok, output, warnings };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,mBAAkB;AAElB,oBAAuB;AAGvB,qBAA0B;AAE1B,MAAM,kBAAkB,CAAC,WAA8B;AACrD,MAAI,OAAO,YAAY;AACrB,WAAO,aAAAA,QAAM,IAAI,QAAG;AAAA,EACtB;AAEA,SAAO,OAAO,eAAe,aAAAA,QAAM,OAAO,QAAG,IAAI,aAAAA,QAAM,MAAM,QAAG;AAClE;AAeO,MAAM,YAAY,OACvB,MACA,WAC0B;AAC1B,SAAO,MAAM,wBAAwB;AAErC,QAAM,SAAS,IAAI,qBAAO;AAAA,IACxB,OAAO;AAAA,IACP,YAAY,CAAC,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA,IAC7C,KAAK,SAAS;AAAA,IACd,+BAA+B;AAAA,EACjC,CAAC;AAED,QAAM,MAAM,QAAQ,IAAI;AAExB,SAAO,MAAM,qBAAqB;AAElC,QAAM,QAAQ,QAAQ,OAAO,OAAO;AAGpC,QAAM,iBAAiB,QAAQ;AAC/B,UAAQ,QAAQ,IAAI,SAAoB;AACtC,QACE,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,IAMN,oKACA;AACA,qBAAe,GAAG,IAAI;AAAA,IACxB;AAAA,EACF;AAEA,QAAM,CAAC,WAAW,OAAO,IAAI,MAAM,QAAQ,IAAI;AAAA,IAC7C,OAAO,cAAc;AAAA,IACrB,OAAO,UAAU,GAAG;AAAA,EACtB,CAAC;AAED,UAAQ,QAAQ;AAGhB,QAAM,MAAM,QAAQ,OAAO,OAAO;AAElC,SAAO;AAAA,IACL,iBAAa,0BAAU,QAAQ,QAAQ,MAAM,QAAQ,OAAO;AAAA,MAC1D;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,SAAyB,CAAC;AAChC,QAAM,WAA2B,CAAC;AAClC,MAAI,UAAU;AAEd,aAAW,UAAU,SAAS;AAC5B,UAAM,eAAe,YAAAC,QAAK,SAAS,KAAK,OAAO,QAAQ;AACvD,QAAI,OAAO,oBAAoB,OAAO,qBAAqB;AACzD,gBAAU;AAAA,IACZ;AAEA,QAAI,OAAO,YAAY;AACrB,aAAO,KAAK;AAAA,QACV,UAAU;AAAA,QACV,UAAU,OAAO;AAAA,MACnB,CAAC;AAAA,IACH;AAEA,QAAI,OAAO,cAAc;AACvB,eAAS,KAAK;AAAA,QACZ,UAAU;AAAA,QACV,UAAU,OAAO;AAAA,MACnB,CAAC;AAAA,IACH;AAEA,WAAO,MAAM,gBAAgB,MAAM,GAAG,YAAY;AAAA,EACpD;AAEA,QAAM,KAAK,OAAO,WAAW;AAE7B,QAAM,qBAAO,YAAY,OAAO;AAEhC,QAAM,SAAS,MAAM,UAAU,OAAO,OAAO;AAE7C,MAAI,QAAQ;AACV,WAAO,MAAM,MAAM;AAAA,EACrB;AAEA,SAAO,EAAE,QAAQ,SAAS,IAAI,QAAQ,SAAS;AACjD;",
|
|
6
6
|
"names": ["chalk", "path"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/adapter/prettier.ts"],
|
|
4
4
|
"sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport type { Options, SupportLanguage } from 'prettier';\nimport { check, format, getSupportInfo, resolveConfig } from 'prettier';\n\nimport { crawlDirectory } from '../../utils/dir';\nimport type { Logger } from '../../utils/logging';\nimport { pluralise } from '../../utils/logging';\nimport { getConsumerManifest } from '../../utils/manifest';\nimport { formatPackage, parsePackage } from '../configure/processing/package';\n\nlet languages: SupportLanguage[] | undefined;\n\n/**\n * Infers a parser for the specified filepath.\n *\n * This is a cut-down version of Prettier's built-in function of the same name;\n * ours operates purely on the `filepath` string and does not perform file I/O.\n * Prettier's internal `getInterpreter` function can open a file to read the\n * shebang, and its file descriptor usage can throw warnings on worker threads:\n *\n * ```console\n * Warning: File descriptor 123 closed but not opened in unmanaged mode\n * at Object.closeSync (node:fs:530:11)\n * at Object.closeSync (node_modules/graceful-fs/graceful-fs.js:74:20)\n * ...\n * ```\n *\n * References:\n *\n * - https://github.com/prettier/prettier/blob/2.4.1/src/main/options.js#L167\n * - seek-oss/skuba#659\n */\nexport const inferParser = (filepath: string): string | undefined => {\n const filename = path.basename(filepath).toLowerCase();\n\n languages ??= getSupportInfo().languages.filter((language) => language.since);\n\n const firstLanguage = languages.find(\n (language) =>\n language.extensions?.some((extension) => filename.endsWith(extension)) ||\n language.filenames?.some((name) => name.toLowerCase() === filename),\n );\n\n return firstLanguage?.parsers[0];\n};\n\nconst isPackageJsonOk = ({\n data,\n filepath,\n}: {\n data: string;\n filepath: string;\n}): boolean => {\n if (path.basename(filepath) !== 'package.json') {\n return true;\n }\n\n try {\n const packageJson = parsePackage(data);\n\n return !packageJson || formatPackage(packageJson) === data;\n } catch {\n // Be more lenient about our custom formatting and don't throw if it errors.\n }\n\n return true;\n};\n\ninterface File {\n data: string;\n options: Options;\n filepath: string;\n}\n\ninterface Result {\n count: number;\n errored: Array<{ err?: unknown; filepath: string }>;\n touched: string[];\n unparsed: string[];\n}\n\nconst formatOrLintFile = (\n { data, filepath, options }: File,\n mode: 'format' | 'lint',\n result: Result,\n): string | undefined => {\n if (mode === 'lint') {\n let ok: boolean;\n try {\n ok = check(data, options) && isPackageJsonOk({ data, filepath });\n } catch (err) {\n result.errored.push({ err, filepath });\n return;\n }\n\n if (!ok) {\n result.errored.push({ filepath });\n }\n\n return;\n }\n\n let formatted: string;\n try {\n formatted = format(data, options);\n } catch (err) {\n result.errored.push({ err, filepath });\n return;\n }\n\n // Perform additional formatting (i.e. sorting) on a `package.json` manifest.\n try {\n if (path.basename(filepath) === 'package.json') {\n const packageJson = parsePackage(formatted);\n if (packageJson) {\n formatted = formatPackage(packageJson);\n }\n }\n } catch {\n // Be more lenient about our custom formatting and don't throw if it errors.\n }\n\n if (formatted === data) {\n return;\n }\n\n result.touched.push(filepath);\n return formatted;\n};\n\nexport interface PrettierOutput {\n ok: boolean;\n result: Result;\n}\n\n/**\n * Formats/lints files with Prettier.\n *\n * Prettier doesn't provide a higher-level Node.js API that replicates the\n * behaviour of its CLI, so we have to plumb together its lower-level functions.\n * On the other hand, this affords more flexibility in how we track and report\n * on progress and results.\n */\nexport const runPrettier = async (\n mode: 'format' | 'lint',\n logger: Logger,\n): Promise<PrettierOutput> => {\n logger.debug('Initialising Prettier...');\n\n const start = process.hrtime.bigint();\n\n let directory = process.cwd();\n\n const manifest = await getConsumerManifest();\n if (manifest) {\n directory = path.dirname(manifest.path);\n }\n\n logger.debug(\n manifest ? 'Detected project root:' : 'Detected working directory:',\n directory,\n );\n\n logger.debug('Discovering files...');\n\n // Match Prettier's opinion of not respecting `.gitignore`.\n // This avoids exhibiting different behaviour than a Prettier IDE integration,\n // and the headache of conflicting `.gitignore` and `.prettierignore` rules.\n const filepaths = await crawlDirectory(directory, '.prettierignore');\n\n logger.debug(`Discovered ${pluralise(filepaths.length, 'file')}.`);\n\n const result: Result = {\n count: filepaths.length,\n errored: [],\n touched: [],\n unparsed: [],\n };\n\n logger.debug(mode === 'format' ? 'Formatting' : 'Linting', 'files...');\n\n for (const filepath of filepaths) {\n // Infer parser upfront so we can skip unsupported files.\n const parser = inferParser(filepath);\n\n logger.debug(filepath);\n logger.debug(' parser:', parser ?? '-');\n\n if (!parser) {\n result.unparsed.push(filepath);\n continue;\n }\n\n const [config, data] = await Promise.all([\n resolveConfig(filepath),\n fs.promises.readFile(filepath, 'utf-8'),\n ]);\n\n const file: File = {\n data,\n filepath,\n options: { ...config, filepath },\n };\n\n const formatted = formatOrLintFile(file, mode, result);\n\n if (typeof formatted === 'string') {\n await fs.promises.writeFile(filepath, formatted);\n }\n }\n\n const end = process.hrtime.bigint();\n\n logger.plain(\n `Processed ${pluralise(\n result.count - result.unparsed.length,\n 'file',\n )} in ${logger.timing(start, end)}.`,\n );\n\n if (result.touched.length) {\n logger.plain(`Formatted ${pluralise(result.touched.length, 'file')}:`);\n for (const filepath of result.touched) {\n logger.warn(filepath);\n }\n }\n\n if (result.errored.length) {\n logger.plain(`Flagged ${pluralise(result.errored.length, 'file')}:`);\n for (const { err, filepath } of result.errored) {\n logger.warn(filepath, ...(err ? [String(err)] : []));\n }\n }\n\n return { ok: result.errored.length === 0, result };\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AAEf,sBAA6D;AAE7D,iBAA+B;AAE/B,qBAA0B;AAC1B,sBAAoC;AACpC,qBAA4C;AAE5C,IAAI;AAsBG,MAAM,cAAc,CAAC,aAAyC;AACnE,QAAM,WAAW,YAAAA,QAAK,SAAS,QAAQ,EAAE,YAAY;AAErD,gCAAc,gCAAe,EAAE,UAAU,OAAO,CAAC,aAAa,SAAS,KAAK;AAE5E,QAAM,gBAAgB,UAAU;AAAA,IAC9B,CAAC,aACC,SAAS,YAAY,KAAK,CAAC,cAAc,SAAS,SAAS,SAAS,CAAC,KACrE,SAAS,WAAW,KAAK,CAAC,SAAS,KAAK,YAAY,MAAM,QAAQ;AAAA,EACtE;AAEA,SAAO,eAAe,QAAQ,CAAC;AACjC;AAEA,MAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA;AACF,MAGe;AACb,MAAI,YAAAA,QAAK,SAAS,QAAQ,MAAM,gBAAgB;AAC9C,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,kBAAc,6BAAa,IAAI;AAErC,WAAO,CAAC,mBAAe,8BAAc,WAAW,MAAM;AAAA,EACxD,QAAE;AAAA,EAEF;AAEA,SAAO;AACT;AAeA,MAAM,mBAAmB,CACvB,EAAE,MAAM,UAAU,QAAQ,GAC1B,MACA,WACuB;AACvB,MAAI,SAAS,QAAQ;AACnB,QAAI;AACJ,QAAI;AACF,eAAK,uBAAM,MAAM,OAAO,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAAA,IACjE,SAAS,KAAP;AACA,aAAO,QAAQ,KAAK,EAAE,KAAK,SAAS,CAAC;AACrC;AAAA,IACF;AAEA,QAAI,CAAC,IAAI;AACP,aAAO,QAAQ,KAAK,EAAE,SAAS,CAAC;AAAA,IAClC;AAEA;AAAA,EACF;AAEA,MAAI;AACJ,MAAI;AACF,oBAAY,wBAAO,MAAM,OAAO;AAAA,EAClC,SAAS,KAAP;AACA,WAAO,QAAQ,KAAK,EAAE,KAAK,SAAS,CAAC;AACrC;AAAA,EACF;AAGA,MAAI;AACF,QAAI,YAAAA,QAAK,SAAS,QAAQ,MAAM,gBAAgB;AAC9C,YAAM,kBAAc,6BAAa,SAAS;AAC1C,UAAI,aAAa;AACf,wBAAY,8BAAc,WAAW;AAAA,MACvC;AAAA,IACF;AAAA,EACF,QAAE;AAAA,EAEF;AAEA,MAAI,cAAc,MAAM;AACtB;AAAA,EACF;AAEA,SAAO,QAAQ,KAAK,QAAQ;AAC5B,SAAO;AACT;AAeO,MAAM,cAAc,OACzB,MACA,WAC4B;AAC5B,SAAO,MAAM,0BAA0B;AAEvC,QAAM,QAAQ,QAAQ,OAAO,OAAO;AAEpC,MAAI,YAAY,QAAQ,IAAI;AAE5B,QAAM,WAAW,UAAM,qCAAoB;AAC3C,MAAI,UAAU;AACZ,gBAAY,YAAAA,QAAK,QAAQ,SAAS,IAAI;AAAA,EACxC;AAEA,SAAO;AAAA,IACL,WAAW,2BAA2B;AAAA,IACtC;AAAA,EACF;AAEA,SAAO,MAAM,sBAAsB;AAKnC,QAAM,YAAY,UAAM,2BAAe,WAAW,iBAAiB;AAEnE,SAAO,MAAM,kBAAc,0BAAU,UAAU,QAAQ,MAAM,IAAI;AAEjE,QAAM,SAAiB;AAAA,IACrB,OAAO,UAAU;AAAA,IACjB,SAAS,CAAC;AAAA,IACV,SAAS,CAAC;AAAA,IACV,UAAU,CAAC;AAAA,EACb;AAEA,SAAO,MAAM,SAAS,WAAW,eAAe,WAAW,UAAU;AAErE,aAAW,YAAY,WAAW;AAEhC,UAAM,SAAS,YAAY,QAAQ;AAEnC,WAAO,MAAM,QAAQ;AACrB,WAAO,MAAM,aAAa,UAAU,GAAG;AAEvC,QAAI,CAAC,QAAQ;AACX,aAAO,SAAS,KAAK,QAAQ;AAC7B;AAAA,IACF;AAEA,UAAM,CAAC,QAAQ,IAAI,IAAI,MAAM,QAAQ,IAAI;AAAA,UACvC,+BAAc,QAAQ;AAAA,MACtB,gBAAAC,QAAG,SAAS,SAAS,UAAU,OAAO;AAAA,IACxC,CAAC;AAED,UAAM,OAAa;AAAA,MACjB;AAAA,MACA;AAAA,MACA,SAAS,EAAE,GAAG,QAAQ,SAAS;AAAA,IACjC;AAEA,UAAM,YAAY,iBAAiB,MAAM,MAAM,MAAM;AAErD,QAAI,OAAO,cAAc,UAAU;AACjC,YAAM,gBAAAA,QAAG,SAAS,UAAU,UAAU,SAAS;AAAA,IACjD;AAAA,EACF;AAEA,QAAM,MAAM,QAAQ,OAAO,OAAO;AAElC,SAAO;AAAA,IACL,iBAAa;AAAA,MACX,OAAO,QAAQ,OAAO,SAAS;AAAA,MAC/B;AAAA,IACF,QAAQ,OAAO,OAAO,OAAO,GAAG;AAAA,EAClC;AAEA,MAAI,OAAO,QAAQ,QAAQ;AACzB,WAAO,MAAM,iBAAa,0BAAU,OAAO,QAAQ,QAAQ,MAAM,IAAI;AACrE,eAAW,YAAY,OAAO,SAAS;AACrC,aAAO,KAAK,QAAQ;AAAA,IACtB;AAAA,EACF;AAEA,MAAI,OAAO,QAAQ,QAAQ;AACzB,WAAO,MAAM,eAAW,0BAAU,OAAO,QAAQ,QAAQ,MAAM,IAAI;AACnE,eAAW,EAAE,KAAK,SAAS,KAAK,OAAO,SAAS;AAC9C,aAAO,KAAK,UAAU,GAAI,MAAM,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAE;AAAA,IACrD;AAAA,EACF;AAEA,SAAO,EAAE,IAAI,OAAO,QAAQ,WAAW,GAAG,OAAO;AACnD;",
|
|
6
6
|
"names": ["path", "fs"]
|
|
7
7
|
}
|