skuba 13.0.0-custom-conditions-exports-20250923055337 → 13.0.0-custom-conditions-exports-20251007055842
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/cli/build/assets.js +3 -7
- package/lib/cli/build/assets.js.map +2 -2
- package/lib/cli/build/esbuild.d.ts +2 -1
- package/lib/cli/build/esbuild.js +4 -3
- package/lib/cli/build/esbuild.js.map +2 -2
- package/lib/cli/build/index.js +8 -4
- package/lib/cli/build/index.js.map +2 -2
- package/lib/cli/init/git.js +1 -1
- package/lib/cli/init/git.js.map +2 -2
- package/lib/cli/init/index.js +4 -4
- package/lib/cli/init/index.js.map +3 -3
- package/lib/cli/lint/annotate/buildkite/eslint.js +1 -1
- package/lib/cli/lint/annotate/buildkite/eslint.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/index.js +1 -1
- package/lib/cli/lint/annotate/buildkite/index.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/internal.js +1 -1
- package/lib/cli/lint/annotate/buildkite/internal.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/prettier.js +1 -1
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/tsc.js +1 -1
- 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 +2 -2
- package/lib/cli/lint/annotate/github/index.js +3 -4
- package/lib/cli/lint/annotate/github/index.js.map +2 -2
- package/lib/cli/lint/annotate/github/internal.d.ts +1 -1
- package/lib/cli/lint/annotate/github/internal.js.map +2 -2
- package/lib/cli/lint/annotate/github/prettier.d.ts +1 -1
- package/lib/cli/lint/annotate/github/prettier.js.map +2 -2
- package/lib/cli/lint/annotate/github/tsc.d.ts +1 -1
- package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
- package/lib/cli/lint/autofix.d.ts +1 -1
- package/lib/cli/lint/autofix.js +3 -3
- package/lib/cli/lint/autofix.js.map +2 -2
- package/lib/cli/lint/internalLints/patchRenovateConfig.js +1 -1
- package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
- package/lib/{api/buildkite → cli/lint/internalLints/upgrade/patches/12.3.0}/index.js +17 -9
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +100 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +99 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.d.ts +2 -0
- package/lib/{api/net → cli/lint/internalLints/upgrade/patches/12.4.0}/index.js +12 -6
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +101 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/{12.2.0 → 13.0.0}/configureTsConfigForESM.js +9 -7
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/configureTsConfigForESM.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/index.d.ts +2 -0
- package/lib/cli/lint/internalLints/upgrade/patches/{12.2.0 → 13.0.0}/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.d.ts +13 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.js +225 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.js.map +7 -0
- package/lib/cli/test/reporters/github/annotations.d.ts +1 -1
- package/lib/cli/test/reporters/github/annotations.js.map +1 -1
- package/lib/cli/test/reporters/github/index.js +3 -4
- package/lib/cli/test/reporters/github/index.js.map +2 -2
- package/lib/index.d.ts +4 -4
- package/lib/index.js +4 -4
- package/lib/index.js.map +2 -2
- package/lib/utils/dir.js +2 -2
- package/lib/utils/dir.js.map +3 -3
- package/lib/utils/manifest.d.ts +5 -1
- package/lib/utils/manifest.js +16 -7
- package/lib/utils/manifest.js.map +2 -2
- package/package.json +4 -3
- package/template/base/_pnpm-workspace.yaml +1 -0
- package/template/express-rest-api/Dockerfile +1 -1
- package/template/express-rest-api/Dockerfile.dev-deps +0 -2
- package/template/express-rest-api/package.json +1 -1
- package/template/greeter/Dockerfile +0 -2
- package/template/greeter/package.json +2 -2
- package/template/koa-rest-api/Dockerfile +1 -1
- package/template/koa-rest-api/Dockerfile.dev-deps +0 -2
- package/template/koa-rest-api/package.json +1 -1
- package/template/lambda-sqs-worker-cdk/Dockerfile +0 -2
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +1 -1
- package/template/lambda-sqs-worker-cdk/package.json +2 -2
- package/template/oss-npm-package/.github/workflows/release.yml +1 -1
- package/template/oss-npm-package/README.md +1 -1
- package/lib/api/buildkite/annotate.d.ts +0 -28
- package/lib/api/buildkite/annotate.js +0 -62
- package/lib/api/buildkite/annotate.js.map +0 -7
- package/lib/api/buildkite/index.d.ts +0 -3
- package/lib/api/buildkite/index.js.map +0 -7
- package/lib/api/buildkite/md.d.ts +0 -6
- package/lib/api/buildkite/md.js +0 -33
- package/lib/api/buildkite/md.js.map +0 -7
- package/lib/api/git/commit.d.ts +0 -15
- package/lib/api/git/commit.js +0 -52
- package/lib/api/git/commit.js.map +0 -7
- package/lib/api/git/commitAllChanges.d.ts +0 -19
- package/lib/api/git/commitAllChanges.js +0 -83
- package/lib/api/git/commitAllChanges.js.map +0 -7
- package/lib/api/git/currentBranch.d.ts +0 -10
- package/lib/api/git/currentBranch.js +0 -59
- package/lib/api/git/currentBranch.js.map +0 -7
- package/lib/api/git/findRoot.d.ts +0 -9
- package/lib/api/git/findRoot.js +0 -52
- package/lib/api/git/findRoot.js.map +0 -7
- package/lib/api/git/getChangedFiles.d.ts +0 -20
- package/lib/api/git/getChangedFiles.js +0 -81
- package/lib/api/git/getChangedFiles.js.map +0 -7
- package/lib/api/git/index.d.ts +0 -12
- package/lib/api/git/index.js +0 -61
- package/lib/api/git/index.js.map +0 -7
- package/lib/api/git/isFileGitIgnored.d.ts +0 -4
- package/lib/api/git/isFileGitIgnored.js +0 -49
- package/lib/api/git/isFileGitIgnored.js.map +0 -7
- package/lib/api/git/log.d.ts +0 -19
- package/lib/api/git/log.js +0 -71
- package/lib/api/git/log.js.map +0 -7
- package/lib/api/git/pull.d.ts +0 -35
- package/lib/api/git/pull.js +0 -69
- package/lib/api/git/pull.js.map +0 -7
- package/lib/api/git/push.d.ts +0 -52
- package/lib/api/git/push.js +0 -70
- package/lib/api/git/push.js.map +0 -7
- package/lib/api/git/remote.d.ts +0 -20
- package/lib/api/git/remote.js +0 -73
- package/lib/api/git/remote.js.map +0 -7
- package/lib/api/git/reset.d.ts +0 -12
- package/lib/api/git/reset.js +0 -62
- package/lib/api/git/reset.js.map +0 -7
- package/lib/api/git/statusMatrix.d.ts +0 -7
- package/lib/api/git/statusMatrix.js +0 -47
- package/lib/api/git/statusMatrix.js.map +0 -7
- package/lib/api/github/checkRun.d.ts +0 -44
- package/lib/api/github/checkRun.js +0 -81
- package/lib/api/github/checkRun.js.map +0 -7
- package/lib/api/github/environment.d.ts +0 -17
- package/lib/api/github/environment.js +0 -48
- package/lib/api/github/environment.js.map +0 -7
- package/lib/api/github/index.d.ts +0 -7
- package/lib/api/github/index.js +0 -48
- package/lib/api/github/index.js.map +0 -7
- package/lib/api/github/issueComment.d.ts +0 -61
- package/lib/api/github/issueComment.js +0 -99
- package/lib/api/github/issueComment.js.map +0 -7
- package/lib/api/github/octokit.d.ts +0 -6
- package/lib/api/github/octokit.js +0 -42
- package/lib/api/github/octokit.js.map +0 -7
- package/lib/api/github/pullRequest.d.ts +0 -21
- package/lib/api/github/pullRequest.js +0 -69
- package/lib/api/github/pullRequest.js.map +0 -7
- package/lib/api/github/push.d.ts +0 -85
- package/lib/api/github/push.js +0 -166
- package/lib/api/github/push.js.map +0 -7
- package/lib/api/net/compose.d.ts +0 -4
- package/lib/api/net/compose.js +0 -51
- package/lib/api/net/compose.js.map +0 -7
- package/lib/api/net/index.d.ts +0 -1
- package/lib/api/net/index.js.map +0 -7
- package/lib/api/net/socket.d.ts +0 -5
- package/lib/api/net/socket.js +0 -68
- package/lib/api/net/socket.js.map +0 -7
- package/lib/api/net/waitFor.d.ts +0 -22
- package/lib/api/net/waitFor.js +0 -40
- package/lib/api/net/waitFor.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/configureTsConfigForESM.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/rewriteSrcImports.d.ts +0 -6
- package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/rewriteSrcImports.js +0 -110
- package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/rewriteSrcImports.js.map +0 -7
- /package/lib/cli/lint/internalLints/upgrade/patches/{12.2.0 → 12.3.0}/index.d.ts +0 -0
- /package/lib/cli/lint/internalLints/upgrade/patches/{12.2.0 → 13.0.0}/configureTsConfigForESM.d.ts +0 -0
- /package/lib/cli/lint/internalLints/upgrade/patches/{12.2.0 → 13.0.0}/index.js +0 -0
package/lib/api/git/findRoot.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
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.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var findRoot_exports = {};
|
|
30
|
-
__export(findRoot_exports, {
|
|
31
|
-
findRoot: () => findRoot
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(findRoot_exports);
|
|
34
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
35
|
-
var import_isomorphic_git = __toESM(require("isomorphic-git"));
|
|
36
|
-
const findRoot = async ({
|
|
37
|
-
dir
|
|
38
|
-
}) => {
|
|
39
|
-
try {
|
|
40
|
-
return await import_isomorphic_git.default.findRoot({ filepath: dir, fs: import_fs_extra.default });
|
|
41
|
-
} catch (err) {
|
|
42
|
-
if (err instanceof import_isomorphic_git.default.Errors.NotFoundError) {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
throw err;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
-
0 && (module.exports = {
|
|
50
|
-
findRoot
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=findRoot.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/api/git/findRoot.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\ninterface FindRootParameters {\n dir: string;\n}\n\n/**\n * Returns the first Git root directory encountered walking up from the provided\n * `dir`.\n */\nexport const findRoot = async ({\n dir,\n}: FindRootParameters): Promise<string | null> => {\n try {\n return await git.findRoot({ filepath: dir, fs });\n } catch (err) {\n if (err instanceof git.Errors.NotFoundError) {\n return null;\n }\n\n throw err;\n }\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAUT,MAAM,WAAW,OAAO;AAAA,EAC7B;AACF,MAAkD;AAChD,MAAI;AACF,WAAO,MAAM,sBAAAA,QAAI,SAAS,EAAE,UAAU,KAAK,oBAAAC,QAAG,CAAC;AAAA,EACjD,SAAS,KAAK;AACZ,QAAI,eAAe,sBAAAD,QAAI,OAAO,eAAe;AAC3C,aAAO;AAAA,IACT;AAEA,UAAM;AAAA,EACR;AACF;",
|
|
6
|
-
"names": ["git", "fs"]
|
|
7
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
type ChangedFileState = 'added' | 'modified' | 'deleted';
|
|
2
|
-
export interface ChangedFile {
|
|
3
|
-
path: string;
|
|
4
|
-
state: ChangedFileState;
|
|
5
|
-
}
|
|
6
|
-
interface ChangedFilesParameters {
|
|
7
|
-
dir: string;
|
|
8
|
-
/**
|
|
9
|
-
* File changes to exclude from the result.
|
|
10
|
-
*
|
|
11
|
-
* Defaults to `[]` (no exclusions).
|
|
12
|
-
*/
|
|
13
|
-
ignore?: ChangedFile[];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Returns all the files which have been added, modified or deleted in the
|
|
17
|
-
* working directory of the local Git repository since the last commit.
|
|
18
|
-
*/
|
|
19
|
-
export declare const getChangedFiles: ({ dir, ignore, }: ChangedFilesParameters) => Promise<ChangedFile[]>;
|
|
20
|
-
export {};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
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.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var getChangedFiles_exports = {};
|
|
30
|
-
__export(getChangedFiles_exports, {
|
|
31
|
-
getChangedFiles: () => getChangedFiles
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(getChangedFiles_exports);
|
|
34
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
35
|
-
var import_ignore = __toESM(require("ignore"));
|
|
36
|
-
var import_isomorphic_git = __toESM(require("isomorphic-git"));
|
|
37
|
-
var import_statusMatrix = require("./statusMatrix.js");
|
|
38
|
-
const mapState = (row) => {
|
|
39
|
-
if (row[import_statusMatrix.HEAD] === import_statusMatrix.ABSENT) {
|
|
40
|
-
return "added";
|
|
41
|
-
}
|
|
42
|
-
if (row[import_statusMatrix.WORKDIR] === import_statusMatrix.MODIFIED) {
|
|
43
|
-
return "modified";
|
|
44
|
-
}
|
|
45
|
-
return "deleted";
|
|
46
|
-
};
|
|
47
|
-
const getChangedFiles = async ({
|
|
48
|
-
dir,
|
|
49
|
-
ignore = []
|
|
50
|
-
}) => {
|
|
51
|
-
const gitRoot = await (0, import_isomorphic_git.findRoot)({ fs: import_fs_extra.default, filepath: dir });
|
|
52
|
-
const [allFiles, isLfs] = await Promise.all([
|
|
53
|
-
import_isomorphic_git.default.statusMatrix({ fs: import_fs_extra.default, dir: gitRoot ?? dir }),
|
|
54
|
-
createIsLfsFilter(gitRoot)
|
|
55
|
-
]);
|
|
56
|
-
return allFiles.filter(
|
|
57
|
-
(row) => row[import_statusMatrix.HEAD] !== import_statusMatrix.UNMODIFIED || row[import_statusMatrix.WORKDIR] !== import_statusMatrix.UNMODIFIED || row[import_statusMatrix.STAGE] !== import_statusMatrix.UNMODIFIED
|
|
58
|
-
).map((row) => ({ path: row[import_statusMatrix.FILEPATH], state: mapState(row) })).filter(
|
|
59
|
-
(changedFile) => !ignore.some(
|
|
60
|
-
(i) => i.path === changedFile.path && i.state === changedFile.state
|
|
61
|
-
) && !isLfs(changedFile.path)
|
|
62
|
-
);
|
|
63
|
-
};
|
|
64
|
-
const createIsLfsFilter = async (gitRoot) => {
|
|
65
|
-
if (!gitRoot) {
|
|
66
|
-
return () => false;
|
|
67
|
-
}
|
|
68
|
-
const lfsFile = `${gitRoot}/.gitattributes`;
|
|
69
|
-
if (!await import_fs_extra.default.pathExists(lfsFile)) {
|
|
70
|
-
return () => false;
|
|
71
|
-
}
|
|
72
|
-
const filter = (0, import_ignore.default)().add(
|
|
73
|
-
(await import_fs_extra.default.readFile(lfsFile, "utf8")).split("\n").map((l) => l.trim()).filter((l) => !l.startsWith("#") && l.includes("filter=lfs")).map((l) => l.split(/\s+/)[0]).flatMap((l) => l ? [l] : [])
|
|
74
|
-
);
|
|
75
|
-
return (pathname) => filter.ignores(pathname);
|
|
76
|
-
};
|
|
77
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
78
|
-
0 && (module.exports = {
|
|
79
|
-
getChangedFiles
|
|
80
|
-
});
|
|
81
|
-
//# sourceMappingURL=getChangedFiles.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/api/git/getChangedFiles.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from 'fs-extra';\nimport ignoreFilter from 'ignore';\nimport git, { findRoot } from 'isomorphic-git';\n\nimport {\n ABSENT,\n FILEPATH,\n HEAD,\n MODIFIED,\n STAGE,\n UNMODIFIED,\n WORKDIR,\n} from './statusMatrix.js';\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 gitRoot = await findRoot({ fs, filepath: dir });\n const [allFiles, isLfs] = await Promise.all([\n git.statusMatrix({ fs, dir: gitRoot ?? dir }),\n createIsLfsFilter(gitRoot),\n ]);\n\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 ) && !isLfs(changedFile.path),\n );\n};\n\nconst createIsLfsFilter = async (\n gitRoot: string | null,\n): Promise<(pathname: string) => boolean> => {\n if (!gitRoot) {\n return () => false;\n }\n\n const lfsFile = `${gitRoot}/.gitattributes`;\n if (!(await fs.pathExists(lfsFile))) {\n return () => false;\n }\n\n const filter = ignoreFilter().add(\n (await fs.readFile(lfsFile, 'utf8'))\n .split('\\n')\n .map((l) => l.trim())\n .filter((l) => !l.startsWith('#') && l.includes('filter=lfs'))\n .map((l) => l.split(/\\s+/)[0])\n .flatMap((l) => (l ? [l] : [])),\n );\n\n return (pathname) => filter.ignores(pathname);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,oBAAyB;AACzB,4BAA8B;AAE9B,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,UAAU,UAAM,gCAAS,EAAE,oBAAAA,SAAI,UAAU,IAAI,CAAC;AACpD,QAAM,CAAC,UAAU,KAAK,IAAI,MAAM,QAAQ,IAAI;AAAA,IAC1C,sBAAAC,QAAI,aAAa,EAAE,oBAAAD,SAAI,KAAK,WAAW,IAAI,CAAC;AAAA,IAC5C,kBAAkB,OAAO;AAAA,EAC3B,CAAC;AAED,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,KAAK,CAAC,MAAM,YAAY,IAAI;AAAA,EAChC;AACJ;AAEA,MAAM,oBAAoB,OACxB,YAC2C;AAC3C,MAAI,CAAC,SAAS;AACZ,WAAO,MAAM;AAAA,EACf;AAEA,QAAM,UAAU,GAAG,OAAO;AAC1B,MAAI,CAAE,MAAM,gBAAAA,QAAG,WAAW,OAAO,GAAI;AACnC,WAAO,MAAM;AAAA,EACf;AAEA,QAAM,aAAS,cAAAE,SAAa,EAAE;AAAA,KAC3B,MAAM,gBAAAF,QAAG,SAAS,SAAS,MAAM,GAC/B,MAAM,IAAI,EACV,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EACnB,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,KAAK,EAAE,SAAS,YAAY,CAAC,EAC5D,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,EAAE,CAAC,CAAC,EAC5B,QAAQ,CAAC,MAAO,IAAI,CAAC,CAAC,IAAI,CAAC,CAAE;AAAA,EAClC;AAEA,SAAO,CAAC,aAAa,OAAO,QAAQ,QAAQ;AAC9C;",
|
|
6
|
-
"names": ["fs", "git", "ignoreFilter"]
|
|
7
|
-
}
|
package/lib/api/git/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { commit } from './commit.js';
|
|
2
|
-
export { commitAllChanges } from './commitAllChanges.js';
|
|
3
|
-
export { currentBranch } from './currentBranch.js';
|
|
4
|
-
export { findRoot } from './findRoot.js';
|
|
5
|
-
export type { ChangedFile } from './getChangedFiles.js';
|
|
6
|
-
export { getChangedFiles } from './getChangedFiles.js';
|
|
7
|
-
export { getHeadCommitId, getHeadCommitMessage } from './log.js';
|
|
8
|
-
export { getOwnerAndRepo } from './remote.js';
|
|
9
|
-
export { push } from './push.js';
|
|
10
|
-
export { fastForwardBranch } from './pull.js';
|
|
11
|
-
export { reset } from './reset.js';
|
|
12
|
-
export { isFileGitIgnored } from './isFileGitIgnored.js';
|
package/lib/api/git/index.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var git_exports = {};
|
|
20
|
-
__export(git_exports, {
|
|
21
|
-
commit: () => import_commit.commit,
|
|
22
|
-
commitAllChanges: () => import_commitAllChanges.commitAllChanges,
|
|
23
|
-
currentBranch: () => import_currentBranch.currentBranch,
|
|
24
|
-
fastForwardBranch: () => import_pull.fastForwardBranch,
|
|
25
|
-
findRoot: () => import_findRoot.findRoot,
|
|
26
|
-
getChangedFiles: () => import_getChangedFiles.getChangedFiles,
|
|
27
|
-
getHeadCommitId: () => import_log.getHeadCommitId,
|
|
28
|
-
getHeadCommitMessage: () => import_log.getHeadCommitMessage,
|
|
29
|
-
getOwnerAndRepo: () => import_remote.getOwnerAndRepo,
|
|
30
|
-
isFileGitIgnored: () => import_isFileGitIgnored.isFileGitIgnored,
|
|
31
|
-
push: () => import_push.push,
|
|
32
|
-
reset: () => import_reset.reset
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(git_exports);
|
|
35
|
-
var import_commit = require("./commit.js");
|
|
36
|
-
var import_commitAllChanges = require("./commitAllChanges.js");
|
|
37
|
-
var import_currentBranch = require("./currentBranch.js");
|
|
38
|
-
var import_findRoot = require("./findRoot.js");
|
|
39
|
-
var import_getChangedFiles = require("./getChangedFiles.js");
|
|
40
|
-
var import_log = require("./log.js");
|
|
41
|
-
var import_remote = require("./remote.js");
|
|
42
|
-
var import_push = require("./push.js");
|
|
43
|
-
var import_pull = require("./pull.js");
|
|
44
|
-
var import_reset = require("./reset.js");
|
|
45
|
-
var import_isFileGitIgnored = require("./isFileGitIgnored.js");
|
|
46
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
-
0 && (module.exports = {
|
|
48
|
-
commit,
|
|
49
|
-
commitAllChanges,
|
|
50
|
-
currentBranch,
|
|
51
|
-
fastForwardBranch,
|
|
52
|
-
findRoot,
|
|
53
|
-
getChangedFiles,
|
|
54
|
-
getHeadCommitId,
|
|
55
|
-
getHeadCommitMessage,
|
|
56
|
-
getOwnerAndRepo,
|
|
57
|
-
isFileGitIgnored,
|
|
58
|
-
push,
|
|
59
|
-
reset
|
|
60
|
-
});
|
|
61
|
-
//# sourceMappingURL=index.js.map
|
package/lib/api/git/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/api/git/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { commit } from './commit.js';\nexport { commitAllChanges } from './commitAllChanges.js';\nexport { currentBranch } from './currentBranch.js';\nexport { findRoot } from './findRoot.js';\nexport type { ChangedFile } from './getChangedFiles.js';\nexport { getChangedFiles } from './getChangedFiles.js';\nexport { getHeadCommitId, getHeadCommitMessage } from './log.js';\nexport { getOwnerAndRepo } from './remote.js';\nexport { push } from './push.js';\nexport { fastForwardBranch } from './pull.js';\nexport { reset } from './reset.js';\nexport { isFileGitIgnored } from './isFileGitIgnored.js';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AACvB,8BAAiC;AACjC,2BAA8B;AAC9B,sBAAyB;AAEzB,6BAAgC;AAChC,iBAAsD;AACtD,oBAAgC;AAChC,kBAAqB;AACrB,kBAAkC;AAClC,mBAAsB;AACtB,8BAAiC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
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.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var isFileGitIgnored_exports = {};
|
|
30
|
-
__export(isFileGitIgnored_exports, {
|
|
31
|
-
isFileGitIgnored: () => isFileGitIgnored
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(isFileGitIgnored_exports);
|
|
34
|
-
var import_path = __toESM(require("path"));
|
|
35
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
36
|
-
var import_isomorphic_git = __toESM(require("isomorphic-git"));
|
|
37
|
-
const isFileGitIgnored = ({
|
|
38
|
-
absolutePath,
|
|
39
|
-
gitRoot
|
|
40
|
-
}) => import_isomorphic_git.default.isIgnored({
|
|
41
|
-
dir: gitRoot,
|
|
42
|
-
filepath: import_path.default.relative(gitRoot, absolutePath),
|
|
43
|
-
fs: import_fs_extra.default
|
|
44
|
-
});
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
isFileGitIgnored
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=isFileGitIgnored.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/api/git/isFileGitIgnored.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nexport const isFileGitIgnored = ({\n absolutePath,\n gitRoot,\n}: {\n absolutePath: string;\n gitRoot: string;\n}): Promise<boolean> =>\n git.isIgnored({\n dir: gitRoot,\n filepath: path.relative(gitRoot, absolutePath),\n fs,\n });\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AACf,4BAAgB;AAET,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AACF,MAIE,sBAAAA,QAAI,UAAU;AAAA,EACZ,KAAK;AAAA,EACL,UAAU,YAAAC,QAAK,SAAS,SAAS,YAAY;AAAA,EAC7C,oBAAAC;AACF,CAAC;",
|
|
6
|
-
"names": ["git", "path", "fs"]
|
|
7
|
-
}
|
package/lib/api/git/log.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
interface GetHeadCommitParameters {
|
|
2
|
-
dir: string;
|
|
3
|
-
env?: Record<string, string | undefined>;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Gets the object ID of the head commit.
|
|
7
|
-
*
|
|
8
|
-
* This tries to extract the commit ID from common CI environment variables,
|
|
9
|
-
* and falls back to the local Git repository log.
|
|
10
|
-
*/
|
|
11
|
-
export declare const getHeadCommitId: ({ dir, env, }: GetHeadCommitParameters) => Promise<string>;
|
|
12
|
-
/**
|
|
13
|
-
* Gets the message of the head commit.
|
|
14
|
-
*
|
|
15
|
-
* This tries to extract the message from common CI environment variables,
|
|
16
|
-
* and falls back to the local Git repository log.
|
|
17
|
-
*/
|
|
18
|
-
export declare const getHeadCommitMessage: ({ dir, env, }: GetHeadCommitParameters) => Promise<string>;
|
|
19
|
-
export {};
|
package/lib/api/git/log.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
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.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var log_exports = {};
|
|
30
|
-
__export(log_exports, {
|
|
31
|
-
getHeadCommitId: () => getHeadCommitId,
|
|
32
|
-
getHeadCommitMessage: () => getHeadCommitMessage
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(log_exports);
|
|
35
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
36
|
-
var import_isomorphic_git = __toESM(require("isomorphic-git"));
|
|
37
|
-
const EMPTY_GIT_LOG_ERROR = new Error("Git log does not contain any commits");
|
|
38
|
-
const getHeadCommitId = async ({
|
|
39
|
-
dir,
|
|
40
|
-
env = process.env
|
|
41
|
-
}) => {
|
|
42
|
-
const oidFromEnv = env.BUILDKITE_COMMIT ?? env.GITHUB_SHA;
|
|
43
|
-
if (oidFromEnv) {
|
|
44
|
-
return oidFromEnv;
|
|
45
|
-
}
|
|
46
|
-
const [headResult] = await import_isomorphic_git.default.log({ depth: 1, dir, fs: import_fs_extra.default });
|
|
47
|
-
if (!headResult) {
|
|
48
|
-
throw EMPTY_GIT_LOG_ERROR;
|
|
49
|
-
}
|
|
50
|
-
return headResult.oid;
|
|
51
|
-
};
|
|
52
|
-
const getHeadCommitMessage = async ({
|
|
53
|
-
dir,
|
|
54
|
-
env = process.env
|
|
55
|
-
}) => {
|
|
56
|
-
const messageFromEnv = env.BUILDKITE_MESSAGE;
|
|
57
|
-
if (messageFromEnv) {
|
|
58
|
-
return messageFromEnv;
|
|
59
|
-
}
|
|
60
|
-
const [headResult] = await import_isomorphic_git.default.log({ depth: 1, dir, fs: import_fs_extra.default });
|
|
61
|
-
if (!headResult) {
|
|
62
|
-
throw EMPTY_GIT_LOG_ERROR;
|
|
63
|
-
}
|
|
64
|
-
return headResult.commit.message;
|
|
65
|
-
};
|
|
66
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
-
0 && (module.exports = {
|
|
68
|
-
getHeadCommitId,
|
|
69
|
-
getHeadCommitMessage
|
|
70
|
-
});
|
|
71
|
-
//# sourceMappingURL=log.js.map
|
package/lib/api/git/log.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/api/git/log.ts"],
|
|
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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
-
"names": ["git", "fs"]
|
|
7
|
-
}
|
package/lib/api/git/pull.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
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 local branch to fast forward.
|
|
21
|
-
*/
|
|
22
|
-
ref: string;
|
|
23
|
-
remote?: string;
|
|
24
|
-
/**
|
|
25
|
-
* The branch or tag on the remote to reference.
|
|
26
|
-
*
|
|
27
|
-
* This defaults to `ref`.
|
|
28
|
-
*/
|
|
29
|
-
remoteRef?: string;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Fast forwards the specified `ref` on the local Git repository to match the remote branch.
|
|
33
|
-
*/
|
|
34
|
-
export declare const fastForwardBranch: ({ auth, dir, ref, remote, remoteRef, }: PullParameters) => Promise<void>;
|
|
35
|
-
export {};
|
package/lib/api/git/pull.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
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.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var pull_exports = {};
|
|
30
|
-
__export(pull_exports, {
|
|
31
|
-
fastForwardBranch: () => fastForwardBranch
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(pull_exports);
|
|
34
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
35
|
-
var import_isomorphic_git = __toESM(require("isomorphic-git"));
|
|
36
|
-
var import_node = __toESM(require("isomorphic-git/http/node"));
|
|
37
|
-
var import_environment = require("../github/environment.js");
|
|
38
|
-
var import_remote = require("./remote.js");
|
|
39
|
-
const fastForwardBranch = async ({
|
|
40
|
-
auth,
|
|
41
|
-
dir,
|
|
42
|
-
ref,
|
|
43
|
-
remote,
|
|
44
|
-
remoteRef
|
|
45
|
-
}) => {
|
|
46
|
-
const { owner, repo } = await (0, import_remote.getOwnerAndRepo)({ dir });
|
|
47
|
-
const url = `https://github.com/${encodeURIComponent(
|
|
48
|
-
owner
|
|
49
|
-
)}/${encodeURIComponent(repo)}`;
|
|
50
|
-
return import_isomorphic_git.default.fastForward({
|
|
51
|
-
onAuth: () => ({
|
|
52
|
-
username: "x-access-token",
|
|
53
|
-
password: auth.token ?? (0, import_environment.apiTokenFromEnvironment)()
|
|
54
|
-
}),
|
|
55
|
-
dir,
|
|
56
|
-
fs: import_fs_extra.default,
|
|
57
|
-
http: import_node.default,
|
|
58
|
-
ref,
|
|
59
|
-
remote,
|
|
60
|
-
remoteRef,
|
|
61
|
-
url,
|
|
62
|
-
singleBranch: true
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
-
0 && (module.exports = {
|
|
67
|
-
fastForwardBranch
|
|
68
|
-
});
|
|
69
|
-
//# sourceMappingURL=pull.js.map
|
package/lib/api/git/pull.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/api/git/pull.ts"],
|
|
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.js';\n\nimport { getOwnerAndRepo } from './remote.js';\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): Promise<void> => {\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAqC;AACnC,QAAM,EAAE,OAAO,KAAK,IAAI,UAAM,+BAAgB,EAAE,IAAI,CAAC;AAErD,QAAM,MAAM,sBAAsB;AAAA,IAChC;AAAA,EACF,CAAC,IAAI,mBAAmB,IAAI,CAAC;AAE7B,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
|
-
"names": ["git", "fs", "http"]
|
|
7
|
-
}
|
package/lib/api/git/push.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
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 PushParameters {
|
|
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 reference to push to the remote.
|
|
21
|
-
*
|
|
22
|
-
* This may be a commit, branch or tag in the local repository.
|
|
23
|
-
*/
|
|
24
|
-
ref: string;
|
|
25
|
-
remote?: string;
|
|
26
|
-
/**
|
|
27
|
-
* The destination branch or tag on the remote.
|
|
28
|
-
*
|
|
29
|
-
* This defaults to `ref`.
|
|
30
|
-
*/
|
|
31
|
-
remoteRef?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Forcefully override any conflicts.
|
|
34
|
-
*
|
|
35
|
-
* This defaults to `false`.
|
|
36
|
-
*/
|
|
37
|
-
force?: boolean;
|
|
38
|
-
}
|
|
39
|
-
interface PushResult {
|
|
40
|
-
ok: boolean;
|
|
41
|
-
error: string | null;
|
|
42
|
-
refs: Record<string, {
|
|
43
|
-
ok: boolean;
|
|
44
|
-
error: string;
|
|
45
|
-
}>;
|
|
46
|
-
headers?: Record<string, string> | undefined;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Pushes the specified `ref` from the local Git repository to a remote.
|
|
50
|
-
*/
|
|
51
|
-
export declare const push: ({ auth, dir, ref, remote, remoteRef, force, }: PushParameters) => Promise<PushResult>;
|
|
52
|
-
export {};
|