From 02daa25010d04a025f497f9b0ea3e44aea02dc0c Mon Sep 17 00:00:00 2001 From: Jan Chren ~rindeal Date: Sun, 8 Sep 2024 22:28:52 +0200 Subject: [PATCH] update --- dist/{GitCommand.d.ts => GitCommand.d.mts} | 0 dist/GitCommand.js.map | 1 - dist/{GitCommand.js => GitCommand.mjs} | 17 +- dist/GitCommand.mjs.map | 1 + ...ndManager.d.ts => GitCommandManager.d.mts} | 0 dist/GitCommandManager.js | 33 --- dist/GitCommandManager.js.map | 1 - dist/GitCommandManager.mjs | 30 +++ dist/GitCommandManager.mjs.map | 1 + .../{LsRemote.d.ts => LsRemote.d.mts} | 2 +- dist/GitCommands/LsRemote.js.map | 1 - .../GitCommands/{LsRemote.js => LsRemote.mjs} | 11 +- dist/GitCommands/LsRemote.mjs.map | 1 + .../{Version.d.ts => Version.d.mts} | 2 +- dist/GitCommands/Version.js.map | 1 - dist/GitCommands/{Version.js => Version.mjs} | 17 +- dist/GitCommands/Version.mjs.map | 1 + ...oteOutput.d.ts => GitLsRemoteOutput.d.mts} | 2 +- dist/GitLsRemoteOutput.js | 8 - dist/GitLsRemoteOutput.js.map | 1 - dist/GitLsRemoteOutput.mjs | 7 + dist/GitLsRemoteOutput.mjs.map | 1 + ...putCmp.d.ts => GitLsRemoteOutputCmp.d.mts} | 4 +- dist/GitLsRemoteOutputCmp.js | 42 ---- dist/GitLsRemoteOutputCmp.js.map | 1 - dist/GitLsRemoteOutputCmp.mjs | 39 ++++ dist/GitLsRemoteOutputCmp.mjs.map | 1 + ...oteParser.d.ts => GitLsRemoteParser.d.mts} | 2 +- dist/GitLsRemoteParser.js.map | 1 - ...sRemoteParser.js => GitLsRemoteParser.mjs} | 29 ++- dist/GitLsRemoteParser.mjs.map | 1 + ...eRefDiff.d.ts => GitLsRemoteRefDiff.d.mts} | 10 +- dist/GitLsRemoteRefDiff.js.map | 1 - ...emoteRefDiff.js => GitLsRemoteRefDiff.mjs} | 27 +-- dist/GitLsRemoteRefDiff.mjs.map | 1 + dist/{GitRefDiff.d.ts => GitRefDiff.d.mts} | 8 +- dist/GitRefDiff.js.map | 1 - dist/{GitRefDiff.js => GitRefDiff.mjs} | 13 +- dist/GitRefDiff.mjs.map | 1 + ...tRefDiffType.d.ts => GitRefDiffType.d.mts} | 2 +- dist/GitRefDiffType.js.map | 1 - .../{GitRefDiffType.js => GitRefDiffType.mjs} | 10 +- dist/GitRefDiffType.mjs.map | 1 + .../{GitRemoteRef.d.ts => GitRemoteRef.d.mts} | 0 dist/GitRemoteRef.js.map | 1 - dist/{GitRemoteRef.js => GitRemoteRef.mjs} | 8 +- dist/GitRemoteRef.mjs.map | 1 + ...emoteRefMap.d.ts => GitRemoteRefMap.d.mts} | 2 +- dist/GitRemoteRefMap.js.map | 1 - ...GitRemoteRefMap.js => GitRemoteRefMap.mjs} | 7 +- dist/GitRemoteRefMap.mjs.map | 1 + ...oteRefsCmp.d.ts => GitRemoteRefsCmp.d.mts} | 10 +- dist/GitRemoteRefsCmp.js | 36 ---- dist/GitRemoteRefsCmp.js.map | 1 - dist/GitRemoteRefsCmp.mjs | 40 ++++ dist/GitRemoteRefsCmp.mjs.map | 1 + dist/Logger.d.mts | 7 + dist/Logger.d.ts | 20 -- dist/Logger.js | 73 ------- dist/Logger.js.map | 1 - dist/Logger.mjs | 26 +++ dist/Logger.mjs.map | 1 + dist/{Utils.d.ts => Utils.d.mts} | 0 dist/Utils.js | 49 ----- dist/Utils.js.map | 1 - dist/Utils.mjs | 24 +++ dist/Utils.mjs.map | 1 + dist/index.d.mts | 17 ++ dist/index.d.ts | 13 -- dist/index.js | 15 -- dist/index.js.map | 1 - dist/index.mjs | 20 ++ dist/index.mjs.map | 1 + dist/logger.d.ts | 20 -- dist/logger.js | 68 ------ dist/logger.js.map | 1 - dist/{main.d.ts => main.d.mts} | 0 dist/main.js | 63 ------ dist/main.js.map | 1 - dist/main.mjs | 68 ++++++ dist/main.mjs.map | 1 + dist/repo.d.ts | 52 ----- dist/repo.js | 201 ------------------ dist/repo.js.map | 1 - src/{GitCommand.ts => GitCommand.mts} | 2 +- ...ommandManager.ts => GitCommandManager.mts} | 6 +- src/GitCommands/{LsRemote.ts => LsRemote.mts} | 2 +- src/GitCommands/{Version.ts => Version.mts} | 4 +- ...sRemoteOutput.ts => GitLsRemoteOutput.mts} | 2 +- ...eOutputCmp.ts => GitLsRemoteOutputCmp.mts} | 6 +- ...sRemoteParser.ts => GitLsRemoteParser.mts} | 10 +- ...emoteRefDiff.ts => GitLsRemoteRefDiff.mts} | 8 +- src/{GitRefDiff.ts => GitRefDiff.mts} | 6 +- src/{GitRefDiffType.ts => GitRefDiffType.mts} | 0 src/{GitRemoteRef.ts => GitRemoteRef.mts} | 0 ...GitRemoteRefMap.ts => GitRemoteRefMap.mts} | 2 +- ...tRemoteRefsCmp.ts => GitRemoteRefsCmp.mts} | 10 +- src/Logger.mts | 31 +++ src/Logger.ts | 86 -------- src/{Utils.ts => Utils.mts} | 0 src/{index.ts => index.mts} | 40 ++-- src/{main.ts => main.mts} | 48 +++-- tsconfig.json | 24 ++- 103 files changed, 500 insertions(+), 977 deletions(-) rename dist/{GitCommand.d.ts => GitCommand.d.mts} (100%) delete mode 100644 dist/GitCommand.js.map rename dist/{GitCommand.js => GitCommand.mjs} (55%) create mode 100644 dist/GitCommand.mjs.map rename dist/{GitCommandManager.d.ts => GitCommandManager.d.mts} (100%) delete mode 100644 dist/GitCommandManager.js delete mode 100644 dist/GitCommandManager.js.map create mode 100644 dist/GitCommandManager.mjs create mode 100644 dist/GitCommandManager.mjs.map rename dist/GitCommands/{LsRemote.d.ts => LsRemote.d.mts} (90%) delete mode 100644 dist/GitCommands/LsRemote.js.map rename dist/GitCommands/{LsRemote.js => LsRemote.mjs} (80%) create mode 100644 dist/GitCommands/LsRemote.mjs.map rename dist/GitCommands/{Version.d.ts => Version.d.mts} (85%) delete mode 100644 dist/GitCommands/Version.js.map rename dist/GitCommands/{Version.js => Version.mjs} (51%) create mode 100644 dist/GitCommands/Version.mjs.map rename dist/{GitLsRemoteOutput.d.ts => GitLsRemoteOutput.d.mts} (91%) delete mode 100644 dist/GitLsRemoteOutput.js delete mode 100644 dist/GitLsRemoteOutput.js.map create mode 100644 dist/GitLsRemoteOutput.mjs create mode 100644 dist/GitLsRemoteOutput.mjs.map rename dist/{GitLsRemoteOutputCmp.d.ts => GitLsRemoteOutputCmp.d.mts} (70%) delete mode 100644 dist/GitLsRemoteOutputCmp.js delete mode 100644 dist/GitLsRemoteOutputCmp.js.map create mode 100644 dist/GitLsRemoteOutputCmp.mjs create mode 100644 dist/GitLsRemoteOutputCmp.mjs.map rename dist/{GitLsRemoteParser.d.ts => GitLsRemoteParser.d.mts} (92%) delete mode 100644 dist/GitLsRemoteParser.js.map rename dist/{GitLsRemoteParser.js => GitLsRemoteParser.mjs} (57%) create mode 100644 dist/GitLsRemoteParser.mjs.map rename dist/{GitLsRemoteRefDiff.d.ts => GitLsRemoteRefDiff.d.mts} (82%) delete mode 100644 dist/GitLsRemoteRefDiff.js.map rename dist/{GitLsRemoteRefDiff.js => GitLsRemoteRefDiff.mjs} (63%) create mode 100644 dist/GitLsRemoteRefDiff.mjs.map rename dist/{GitRefDiff.d.ts => GitRefDiff.d.mts} (79%) delete mode 100644 dist/GitRefDiff.js.map rename dist/{GitRefDiff.js => GitRefDiff.mjs} (52%) create mode 100644 dist/GitRefDiff.mjs.map rename dist/{GitRefDiffType.d.ts => GitRefDiffType.d.mts} (83%) delete mode 100644 dist/GitRefDiffType.js.map rename dist/{GitRefDiffType.js => GitRefDiffType.mjs} (58%) create mode 100644 dist/GitRefDiffType.mjs.map rename dist/{GitRemoteRef.d.ts => GitRemoteRef.d.mts} (100%) delete mode 100644 dist/GitRemoteRef.js.map rename dist/{GitRemoteRef.js => GitRemoteRef.mjs} (82%) create mode 100644 dist/GitRemoteRef.mjs.map rename dist/{GitRemoteRefMap.d.ts => GitRemoteRefMap.d.mts} (97%) delete mode 100644 dist/GitRemoteRefMap.js.map rename dist/{GitRemoteRefMap.js => GitRemoteRefMap.mjs} (91%) create mode 100644 dist/GitRemoteRefMap.mjs.map rename dist/{GitRemoteRefsCmp.d.ts => GitRemoteRefsCmp.d.mts} (58%) delete mode 100644 dist/GitRemoteRefsCmp.js delete mode 100644 dist/GitRemoteRefsCmp.js.map create mode 100644 dist/GitRemoteRefsCmp.mjs create mode 100644 dist/GitRemoteRefsCmp.mjs.map create mode 100644 dist/Logger.d.mts delete mode 100644 dist/Logger.d.ts delete mode 100644 dist/Logger.js delete mode 100644 dist/Logger.js.map create mode 100644 dist/Logger.mjs create mode 100644 dist/Logger.mjs.map rename dist/{Utils.d.ts => Utils.d.mts} (100%) delete mode 100644 dist/Utils.js delete mode 100644 dist/Utils.js.map create mode 100644 dist/Utils.mjs create mode 100644 dist/Utils.mjs.map create mode 100644 dist/index.d.mts delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map create mode 100644 dist/index.mjs create mode 100644 dist/index.mjs.map delete mode 100644 dist/logger.d.ts delete mode 100644 dist/logger.js delete mode 100644 dist/logger.js.map rename dist/{main.d.ts => main.d.mts} (100%) delete mode 100644 dist/main.js delete mode 100644 dist/main.js.map create mode 100644 dist/main.mjs create mode 100644 dist/main.mjs.map delete mode 100644 dist/repo.d.ts delete mode 100644 dist/repo.js delete mode 100644 dist/repo.js.map rename src/{GitCommand.ts => GitCommand.mts} (97%) rename src/{GitCommandManager.ts => GitCommandManager.mts} (91%) rename src/GitCommands/{LsRemote.ts => LsRemote.mts} (97%) rename src/GitCommands/{Version.ts => Version.mts} (93%) rename src/{GitLsRemoteOutput.ts => GitLsRemoteOutput.mts} (95%) rename src/{GitLsRemoteOutputCmp.ts => GitLsRemoteOutputCmp.mts} (94%) rename src/{GitLsRemoteParser.ts => GitLsRemoteParser.mts} (91%) rename src/{GitLsRemoteRefDiff.ts => GitLsRemoteRefDiff.mts} (96%) rename src/{GitRefDiff.ts => GitRefDiff.mts} (92%) rename src/{GitRefDiffType.ts => GitRefDiffType.mts} (100%) rename src/{GitRemoteRef.ts => GitRemoteRef.mts} (100%) rename src/{GitRemoteRefMap.ts => GitRemoteRefMap.mts} (98%) rename src/{GitRemoteRefsCmp.ts => GitRemoteRefsCmp.mts} (88%) create mode 100644 src/Logger.mts delete mode 100644 src/Logger.ts rename src/{Utils.ts => Utils.mts} (100%) rename src/{index.ts => index.mts} (63%) rename src/{main.ts => main.mts} (72%) diff --git a/dist/GitCommand.d.ts b/dist/GitCommand.d.mts similarity index 100% rename from dist/GitCommand.d.ts rename to dist/GitCommand.d.mts diff --git a/dist/GitCommand.js.map b/dist/GitCommand.js.map deleted file mode 100644 index 7c8a7db..0000000 --- a/dist/GitCommand.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GitCommand.js","sourceRoot":"","sources":["../src/GitCommand.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iDAGsB;AACtB,qCAEiB;AAQjB,MAAe,UAAU;IACD;IAAtB,YAAsB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAAG,CAAC;IAI/B,OAAO,CAAC,IAAc;QAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,eAAM,CAAC,KAAK,CAAC,aAAa,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;YACpF,IAAA,wBAAQ,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;gBAC/C,gFAAgF;gBAC9E,IAAI,KAAK,EAAE,CAAC;oBACV,MAAM,CAAC,KAAK,CAAC,CAAA;gBACf,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,MAAM,CAAC,CAAA;gBACjB,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAtBC,gCAAU"} \ No newline at end of file diff --git a/dist/GitCommand.js b/dist/GitCommand.mjs similarity index 55% rename from dist/GitCommand.js rename to dist/GitCommand.mjs index 2c4f21b..5d958e9 100644 --- a/dist/GitCommand.js +++ b/dist/GitCommand.mjs @@ -1,13 +1,13 @@ -"use strict"; /** * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal * * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.GitCommand = void 0; -const child_process_1 = require("child_process"); -const Logger_1 = require("./Logger"); +import { execFile, +// exec, + } from 'child_process'; +import { Logger } from './Logger.mjs'; +export { GitCommand, }; class GitCommand { gitPath; constructor(gitPath) { @@ -15,8 +15,8 @@ class GitCommand { } execGit(args) { return new Promise((resolve, reject) => { - Logger_1.Logger.debug('Executing: ' + [this.gitPath, ...args].map(a => `\`${a}\``).join(' ')); - (0, child_process_1.execFile)(this.gitPath, args, (error, stdout) => { + Logger.debug('Executing: ' + [this.gitPath, ...args].map(a => `\`${a}\``).join(' ')); + execFile(this.gitPath, args, (error, stdout) => { // exec(`sleep 10 && ${[this.gitPath, ...args].join(' ')}`, (error, stdout) => { if (error) { reject(error); @@ -28,5 +28,4 @@ class GitCommand { }); } } -exports.GitCommand = GitCommand; -//# sourceMappingURL=GitCommand.js.map \ No newline at end of file +//# sourceMappingURL=GitCommand.mjs.map \ No newline at end of file diff --git a/dist/GitCommand.mjs.map b/dist/GitCommand.mjs.map new file mode 100644 index 0000000..5847168 --- /dev/null +++ b/dist/GitCommand.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GitCommand.mjs","sourceRoot":"","sources":["../src/GitCommand.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,QAAQ;AACR,QAAQ;EACT,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,MAAM,EACP,MAAM,cAAc,CAAA;AAGrB,OAAO,EACL,UAAU,GACX,CAAA;AAGD,MAAe,UAAU;IACD;IAAtB,YAAsB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAAG,CAAC;IAI/B,OAAO,CAAC,IAAc;QAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,CAAC,KAAK,CAAC,aAAa,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;YACpF,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;gBAC/C,gFAAgF;gBAC9E,IAAI,KAAK,EAAE,CAAC;oBACV,MAAM,CAAC,KAAK,CAAC,CAAA;gBACf,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,MAAM,CAAC,CAAA;gBACjB,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/GitCommandManager.d.ts b/dist/GitCommandManager.d.mts similarity index 100% rename from dist/GitCommandManager.d.ts rename to dist/GitCommandManager.d.mts diff --git a/dist/GitCommandManager.js b/dist/GitCommandManager.js deleted file mode 100644 index 8dea852..0000000 --- a/dist/GitCommandManager.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.GitCommandManager = void 0; -const Utils_1 = require("./Utils"); -const Version_1 = require("./GitCommands/Version"); -const LsRemote_1 = require("./GitCommands/LsRemote"); -class GitCommandManager { - gitVersion = ''; - gitPath = ''; - async init() { - this.gitPath = await (0, Utils_1.which)('git'); - if (!this.gitPath) { - throw new Error(); - } - const versionCmd = new Version_1.GitVersionCommand(this.gitPath); - this.gitVersion = await versionCmd.execute(); - } - isInitialized() { - return (!!this.gitPath); - } - async lsRemote(options) { - console.assert(this.gitPath); - const lsRemoteCommand = new LsRemote_1.GitLsRemoteCommand(this.gitPath, options); - return lsRemoteCommand.execute(); - } -} -exports.GitCommandManager = GitCommandManager; -//# sourceMappingURL=GitCommandManager.js.map \ No newline at end of file diff --git a/dist/GitCommandManager.js.map b/dist/GitCommandManager.js.map deleted file mode 100644 index 8ef6560..0000000 --- a/dist/GitCommandManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GitCommandManager.js","sourceRoot":"","sources":["../src/GitCommandManager.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,mCAEgB;AAChB,mDAE8B;AAC9B,qDAE+B;AAQ/B,MAAM,iBAAiB;IACX,UAAU,GAAW,EAAE,CAAA;IACvB,OAAO,GAAW,EAAE,CAAA;IAEvB,KAAK,CAAC,IAAI;QACf,IAAI,CAAC,OAAO,GAAG,MAAM,IAAA,aAAK,EAAC,KAAK,CAAC,CAAA;QACjC,IAAK,CAAE,IAAI,CAAC,OAAO,EAAG,CAAC;YACrB,MAAM,IAAI,KAAK,EAAE,CAAA;QACnB,CAAC;QACD,MAAM,UAAU,GAAG,IAAI,2BAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACtD,IAAI,CAAC,UAAU,GAAG,MAAM,UAAU,CAAC,OAAO,EAAE,CAAA;IAC9C,CAAC;IAEM,aAAa;QAClB,OAAO,CAAC,CAAC,CAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAC1B,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,OAMrB;QACC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC5B,MAAM,eAAe,GAAG,IAAI,6BAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACrE,OAAO,eAAe,CAAC,OAAO,EAAE,CAAA;IAClC,CAAC;CACF;AAhCC,8CAAiB"} \ No newline at end of file diff --git a/dist/GitCommandManager.mjs b/dist/GitCommandManager.mjs new file mode 100644 index 0000000..cb917fd --- /dev/null +++ b/dist/GitCommandManager.mjs @@ -0,0 +1,30 @@ +/** + * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal + * + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only + */ +import { which, } from './Utils.mjs'; +import { GitVersionCommand, } from './GitCommands/Version.mjs'; +import { GitLsRemoteCommand, } from './GitCommands/LsRemote.mjs'; +export { GitCommandManager, }; +class GitCommandManager { + gitVersion = ''; + gitPath = ''; + async init() { + this.gitPath = await which('git'); + if (!this.gitPath) { + throw new Error(); + } + const versionCmd = new GitVersionCommand(this.gitPath); + this.gitVersion = await versionCmd.execute(); + } + isInitialized() { + return (!!this.gitPath); + } + async lsRemote(options) { + console.assert(this.gitPath); + const lsRemoteCommand = new GitLsRemoteCommand(this.gitPath, options); + return lsRemoteCommand.execute(); + } +} +//# sourceMappingURL=GitCommandManager.mjs.map \ No newline at end of file diff --git a/dist/GitCommandManager.mjs.map b/dist/GitCommandManager.mjs.map new file mode 100644 index 0000000..2452218 --- /dev/null +++ b/dist/GitCommandManager.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GitCommandManager.mjs","sourceRoot":"","sources":["../src/GitCommandManager.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,GACN,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,iBAAiB,GAClB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,kBAAkB,GACnB,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EACL,iBAAiB,GAClB,CAAA;AAGD,MAAM,iBAAiB;IACX,UAAU,GAAW,EAAE,CAAA;IACvB,OAAO,GAAW,EAAE,CAAA;IAEvB,KAAK,CAAC,IAAI;QACf,IAAI,CAAC,OAAO,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,CAAA;QACjC,IAAK,CAAE,IAAI,CAAC,OAAO,EAAG,CAAC;YACrB,MAAM,IAAI,KAAK,EAAE,CAAA;QACnB,CAAC;QACD,MAAM,UAAU,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACtD,IAAI,CAAC,UAAU,GAAG,MAAM,UAAU,CAAC,OAAO,EAAE,CAAA;IAC9C,CAAC;IAEM,aAAa;QAClB,OAAO,CAAC,CAAC,CAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAC1B,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,OAMrB;QACC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC5B,MAAM,eAAe,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACrE,OAAO,eAAe,CAAC,OAAO,EAAE,CAAA;IAClC,CAAC;CACF"} \ No newline at end of file diff --git a/dist/GitCommands/LsRemote.d.ts b/dist/GitCommands/LsRemote.d.mts similarity index 90% rename from dist/GitCommands/LsRemote.d.ts rename to dist/GitCommands/LsRemote.d.mts index 3f0c7fb..f05ff9e 100644 --- a/dist/GitCommands/LsRemote.d.ts +++ b/dist/GitCommands/LsRemote.d.mts @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -import { GitCommand } from '../GitCommand'; +import { GitCommand } from '../GitCommand.mjs'; export { GitLsRemoteCommand, }; declare class GitLsRemoteCommand extends GitCommand { private options; diff --git a/dist/GitCommands/LsRemote.js.map b/dist/GitCommands/LsRemote.js.map deleted file mode 100644 index 283e6b9..0000000 --- a/dist/GitCommands/LsRemote.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"LsRemote.js","sourceRoot":"","sources":["../../src/GitCommands/LsRemote.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,8CAE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AM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;gBAC3C,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YACpB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;CACF;AAlDC,gDAAkB"} \ No newline at end of file diff --git a/dist/GitCommands/LsRemote.js b/dist/GitCommands/LsRemote.mjs similarity index 80% rename from dist/GitCommands/LsRemote.js rename to dist/GitCommands/LsRemote.mjs index 9bfea88..8ffa2a0 100644 --- a/dist/GitCommands/LsRemote.js +++ b/dist/GitCommands/LsRemote.mjs @@ -1,13 +1,11 @@ -"use strict"; /** * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal * * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.GitLsRemoteCommand = void 0; -const GitCommand_1 = require("../GitCommand"); -class GitLsRemoteCommand extends GitCommand_1.GitCommand { +import { GitCommand, } from '../GitCommand.mjs'; +export { GitLsRemoteCommand, }; +class GitLsRemoteCommand extends GitCommand { options; constructor(gitPath, options) { super(gitPath); @@ -45,5 +43,4 @@ class GitLsRemoteCommand extends GitCommand_1.GitCommand { return this.execGit(args); } } -exports.GitLsRemoteCommand = GitLsRemoteCommand; -//# sourceMappingURL=LsRemote.js.map \ No newline at end of file +//# sourceMappingURL=LsRemote.mjs.map \ No newline at end of file diff --git a/dist/GitCommands/LsRemote.mjs.map b/dist/GitCommands/LsRemote.mjs.map new file mode 100644 index 0000000..34818a2 --- /dev/null +++ b/dist/GitCommands/LsRemote.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"LsRemote.mjs","sourceRoot":"","sources":["../../src/GitCommands/LsRemote.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,UAAU,GACX,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,kBAAkB,GACnB,CAAA;AAGD,MA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K,CAAC,wBAAwB,CAAC,CAAA;gBAC3C,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YACpB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;CACF"} \ No newline at end of file diff --git a/dist/GitCommands/Version.d.ts b/dist/GitCommands/Version.d.mts similarity index 85% rename from dist/GitCommands/Version.d.ts rename to dist/GitCommands/Version.d.mts index 05fb6e9..8c04341 100644 --- a/dist/GitCommands/Version.d.ts +++ b/dist/GitCommands/Version.d.mts @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -import { GitCommand } from '../GitCommand'; +import { GitCommand } from '../GitCommand.mjs'; export { GitVersionCommand, }; declare class GitVersionCommand extends GitCommand { private static readonly versionRegex; diff --git a/dist/GitCommands/Version.js.map b/dist/GitCommands/Version.js.map deleted file mode 100644 index f7f7603..0000000 --- a/dist/GitCommands/Version.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Version.js","sourceRoot":"","sources":["../../src/GitCommands/Version.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,8CAEsB;AACtB,sCAEkB;AAQlB,MAAM,iBAAkB,SAAQ,uBAAU;IAChC,MAAM,CAAU,YAAY,GAAG,uCAAuC,CAAA;IAEvE,KAAK,CAAC,OAAO;QAClB,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;QACrD,MAAM,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAA;QACxE,IAAK,CAAE,YAAY,IAAI,CAAE,YAAY,CAAC,MAAM,EAAG,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;QACpD,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,oBAAoB,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QACpE,OAAO,YAAY,CAAC,CAAC,CAAC,CAAA;IACxB,CAAC;;AAfD,8CAAiB"} \ No newline at end of file diff --git a/dist/GitCommands/Version.js b/dist/GitCommands/Version.mjs similarity index 51% rename from dist/GitCommands/Version.js rename to dist/GitCommands/Version.mjs index d738f59..497ce8f 100644 --- a/dist/GitCommands/Version.js +++ b/dist/GitCommands/Version.mjs @@ -1,14 +1,12 @@ -"use strict"; /** * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal * * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.GitVersionCommand = void 0; -const GitCommand_1 = require("../GitCommand"); -const Logger_1 = require("../Logger"); -class GitVersionCommand extends GitCommand_1.GitCommand { +import { GitCommand, } from '../GitCommand.mjs'; +import { Logger, } from '../Logger.mjs'; +export { GitVersionCommand, }; +class GitVersionCommand extends GitCommand { static versionRegex = /git version (?\d+\.\d+\.\d+)/; async execute() { const versionOutput = await this.execGit(['version']); @@ -16,9 +14,8 @@ class GitVersionCommand extends GitCommand_1.GitCommand { if (!versionMatch || !versionMatch.groups) { throw new Error('Unable to determine Git version'); } - Logger_1.Logger.debug(`Git version is \`${versionMatch.groups['version']}\``); - return versionMatch[1]; + Logger.debug(`Git version is \`${versionMatch.groups['version']}\``); + return versionMatch.groups['version']; } } -exports.GitVersionCommand = GitVersionCommand; -//# sourceMappingURL=Version.js.map \ No newline at end of file +//# sourceMappingURL=Version.mjs.map \ No newline at end of file diff --git a/dist/GitCommands/Version.mjs.map b/dist/GitCommands/Version.mjs.map new file mode 100644 index 0000000..956c0ed --- /dev/null +++ b/dist/GitCommands/Version.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"Version.mjs","sourceRoot":"","sources":["../../src/GitCommands/Version.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,UAAU,GACX,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,MAAM,GACP,MAAM,eAAe,CAAA;AAGtB,OAAO,EACL,iBAAiB,GAClB,CAAA;AAGD,MAAM,iBAAkB,SAAQ,UAAU;IAChC,MAAM,CAAU,YAAY,GAAG,uCAAuC,CAAA;IAEvE,KAAK,CAAC,OAAO;QAClB,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;QACrD,MAAM,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAA;QACxE,IAAK,CAAE,YAAY,IAAI,CAAE,YAAY,CAAC,MAAM,EAAG,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;QACpD,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,oBAAoB,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QACpE,OAAO,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IACvC,CAAC"} \ No newline at end of file diff --git a/dist/GitLsRemoteOutput.d.ts b/dist/GitLsRemoteOutput.d.mts similarity index 91% rename from dist/GitLsRemoteOutput.d.ts rename to dist/GitLsRemoteOutput.d.mts index 12ad644..67bdd31 100644 --- a/dist/GitLsRemoteOutput.d.ts +++ b/dist/GitLsRemoteOutput.d.mts @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -import { GitRemoteRefMap } from './GitRemoteRefMap'; +import { GitRemoteRefMap } from './GitRemoteRefMap.mjs'; export { GitLsRemoteOutput, }; /** * Represents the parsed output of the `git ls-remote` command. diff --git a/dist/GitLsRemoteOutput.js b/dist/GitLsRemoteOutput.js deleted file mode 100644 index e2324ec..0000000 --- a/dist/GitLsRemoteOutput.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=GitLsRemoteOutput.js.map \ No newline at end of file diff --git a/dist/GitLsRemoteOutput.js.map b/dist/GitLsRemoteOutput.js.map deleted file mode 100644 index a115149..0000000 --- a/dist/GitLsRemoteOutput.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GitLsRemoteOutput.js","sourceRoot":"","sources":["../src/GitLsRemoteOutput.ts"],"names":[],"mappings":";AAAA;;;;GAIG"} \ No newline at end of file diff --git a/dist/GitLsRemoteOutput.mjs b/dist/GitLsRemoteOutput.mjs new file mode 100644 index 0000000..01d1872 --- /dev/null +++ b/dist/GitLsRemoteOutput.mjs @@ -0,0 +1,7 @@ +/** + * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal + * + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only + */ +export {}; +//# sourceMappingURL=GitLsRemoteOutput.mjs.map \ No newline at end of file diff --git a/dist/GitLsRemoteOutput.mjs.map b/dist/GitLsRemoteOutput.mjs.map new file mode 100644 index 0000000..29fc427 --- /dev/null +++ b/dist/GitLsRemoteOutput.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GitLsRemoteOutput.mjs","sourceRoot":"","sources":["../src/GitLsRemoteOutput.mts"],"names":[],"mappings":"AAAA;;;;GAIG"} \ No newline at end of file diff --git a/dist/GitLsRemoteOutputCmp.d.ts b/dist/GitLsRemoteOutputCmp.d.mts similarity index 70% rename from dist/GitLsRemoteOutputCmp.d.ts rename to dist/GitLsRemoteOutputCmp.d.mts index 10aaffc..5fdcba2 100644 --- a/dist/GitLsRemoteOutputCmp.d.ts +++ b/dist/GitLsRemoteOutputCmp.d.mts @@ -3,8 +3,8 @@ * * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -import { GitLsRemoteOutput } from './GitLsRemoteOutput'; -import { GitLsRemoteRefDiff } from './GitLsRemoteRefDiff'; +import { GitLsRemoteOutput } from './GitLsRemoteOutput.mjs'; +import { GitLsRemoteRefDiff } from './GitLsRemoteRefDiff.mjs'; export { GitLsRemoteOutputCmp, }; declare class GitLsRemoteOutputCmp { compare(source: GitLsRemoteOutput, target: GitLsRemoteOutput): Promise; diff --git a/dist/GitLsRemoteOutputCmp.js b/dist/GitLsRemoteOutputCmp.js deleted file mode 100644 index 8ec99eb..0000000 --- a/dist/GitLsRemoteOutputCmp.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.GitLsRemoteOutputCmp = void 0; -const Logger_1 = require("./Logger"); -const GitLsRemoteRefDiff_1 = require("./GitLsRemoteRefDiff"); -class GitLsRemoteOutputCmp { - async compare(source, target) { - Logger_1.Logger.trace(`Differ.diff() called`); - if (source.refMap.size === 0 || target.refMap.size === 0) { - const refDiff = new GitLsRemoteRefDiff_1.GitLsRemoteZeroRefsDiff({ source, target }); - Logger_1.Logger.error(await refDiff.message); - return refDiff; - } - if (source.refMap.size !== target.refMap.size) { - const refDiff = new GitLsRemoteRefDiff_1.GitLsRemoteRefCountMismatchDiff({ source, target }); - Logger_1.Logger.warn(await refDiff.message); - return refDiff; - } - for (const sourceRef of source.refMap.refs()) { - const targetRef = target.refMap.getRef(sourceRef.refname); - if (!targetRef) { - const refDiff = new GitLsRemoteRefDiff_1.GitLsRemoteRefNotFoundDiff({ source, target, sourceRef }); - Logger_1.Logger.warn(await refDiff.message); - return refDiff; - } - if (sourceRef.oid !== targetRef.oid) { - const refDiff = new GitLsRemoteRefDiff_1.GitLsRemoteOidMismatchDiff({ source, target, sourceRef, targetRef }); - Logger_1.Logger.warn(await refDiff.message); - return refDiff; - } - } - Logger_1.Logger.info(`No differences found`); - return null; - } -} -exports.GitLsRemoteOutputCmp = GitLsRemoteOutputCmp; -//# sourceMappingURL=GitLsRemoteOutputCmp.js.map \ No newline at end of file diff --git a/dist/GitLsRemoteOutputCmp.js.map b/dist/GitLsRemoteOutputCmp.js.map deleted file mode 100644 index 3af0bb0..0000000 --- a/dist/GitLsRemoteOutputCmp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GitLsRemoteOutputCmp.js","sourceRoot":"","sources":["../src/GitLsRemoteOutputCmp.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,qCAEiB;AAIjB,6DAM6B;AAQ7B,MAAM,oBAAoB;IACjB,KAAK,CAAC,OAAO,CAAC,MAAyB,EAAE,MAAyB;QACvE,eAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;QAEpC,IAAK,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;YAC3D,MAAM,OAAO,GAAG,IAAI,4CAAuB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;YAC/D,eAAM,CAAC,KAAK,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;YACnC,OAAO,OAAO,CAAA;QAChB,CAAC;QAED,IAAK,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAG,CAAC;YAChD,MAAM,OAAO,GAAG,IAAI,oDAA+B,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;YACvE,eAAM,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;YAClC,OAAO,OAAO,CAAA;QAChB,CAAC;QAED,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YAC7C,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;YACzD,IAAK,CAAE,SAAS,EAAG,CAAC;gBAClB,MAAM,OAAO,GAAG,IAAI,+CAA0B,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAA;gBAC7E,eAAM,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;gBAClC,OAAO,OAAO,CAAA;YAChB,CAAC;YACD,IAAK,SAAS,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,EAAG,CAAC;gBACtC,MAAM,OAAO,GAAG,IAAI,+CAA0B,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAA;gBACxF,eAAM,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;gBAClC,OAAO,OAAO,CAAA;YAChB,CAAC;QACH,CAAC;QAED,eAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;QACnC,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AArCC,oDAAoB"} \ No newline at end of file diff --git a/dist/GitLsRemoteOutputCmp.mjs b/dist/GitLsRemoteOutputCmp.mjs new file mode 100644 index 0000000..cf364ae --- /dev/null +++ b/dist/GitLsRemoteOutputCmp.mjs @@ -0,0 +1,39 @@ +/** + * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal + * + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only + */ +import { Logger, } from './Logger.mjs'; +import { GitLsRemoteZeroRefsDiff, GitLsRemoteRefCountMismatchDiff, GitLsRemoteRefNotFoundDiff, GitLsRemoteOidMismatchDiff, } from './GitLsRemoteRefDiff.mjs'; +export { GitLsRemoteOutputCmp, }; +class GitLsRemoteOutputCmp { + async compare(source, target) { + Logger.trace(`Differ.diff() called`); + if (source.refMap.size === 0 || target.refMap.size === 0) { + const refDiff = new GitLsRemoteZeroRefsDiff({ source, target }); + Logger.error(await refDiff.message); + return refDiff; + } + if (source.refMap.size !== target.refMap.size) { + const refDiff = new GitLsRemoteRefCountMismatchDiff({ source, target }); + Logger.warn(await refDiff.message); + return refDiff; + } + for (const sourceRef of source.refMap.refs()) { + const targetRef = target.refMap.getRef(sourceRef.refname); + if (!targetRef) { + const refDiff = new GitLsRemoteRefNotFoundDiff({ source, target, sourceRef }); + Logger.warn(await refDiff.message); + return refDiff; + } + if (sourceRef.oid !== targetRef.oid) { + const refDiff = new GitLsRemoteOidMismatchDiff({ source, target, sourceRef, targetRef }); + Logger.warn(await refDiff.message); + return refDiff; + } + } + Logger.info(`No differences found`); + return null; + } +} +//# sourceMappingURL=GitLsRemoteOutputCmp.mjs.map \ No newline at end of file diff --git a/dist/GitLsRemoteOutputCmp.mjs.map b/dist/GitLsRemoteOutputCmp.mjs.map new file mode 100644 index 0000000..98bc6ee --- /dev/null +++ b/dist/GitLsRemoteOutputCmp.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GitLsRemoteOutputCmp.mjs","sourceRoot":"","sources":["../src/GitLsRemoteOutputCmp.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,MAAM,GACP,MAAM,cAAc,CAAA;AAIrB,OAAO,EAEL,uBAAuB,EACvB,+BAA+B,EAC/B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,0BAA0B,CAAA;AAGjC,OAAO,EACL,oBAAoB,GACrB,CAAA;AAGD,MAAM,oBAAoB;IACjB,KAAK,CAAC,OAAO,CAAC,MAAyB,EAAE,MAAyB;QACvE,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;QAEpC,IAAK,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;YAC3D,MAAM,OAAO,GAAG,IAAI,uBAAuB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;YAC/D,MAAM,CAAC,KAAK,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;YACnC,OAAO,OAAO,CAAA;QAChB,CAAC;QAED,IAAK,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAG,CAAC;YAChD,MAAM,OAAO,GAAG,IAAI,+BAA+B,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;YACvE,MAAM,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;YAClC,OAAO,OAAO,CAAA;QAChB,CAAC;QAED,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YAC7C,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;YACzD,IAAK,CAAE,SAAS,EAAG,CAAC;gBAClB,MAAM,OAAO,GAAG,IAAI,0BAA0B,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAA;gBAC7E,MAAM,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;gBAClC,OAAO,OAAO,CAAA;YAChB,CAAC;YACD,IAAK,SAAS,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,EAAG,CAAC;gBACtC,MAAM,OAAO,GAAG,IAAI,0BAA0B,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAA;gBACxF,MAAM,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;gBAClC,OAAO,OAAO,CAAA;YAChB,CAAC;QACH,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;QACnC,OAAO,IAAI,CAAA;IACb,CAAC;CACF"} \ No newline at end of file diff --git a/dist/GitLsRemoteParser.d.ts b/dist/GitLsRemoteParser.d.mts similarity index 92% rename from dist/GitLsRemoteParser.d.ts rename to dist/GitLsRemoteParser.d.mts index 19998d5..fc17efa 100644 --- a/dist/GitLsRemoteParser.d.ts +++ b/dist/GitLsRemoteParser.d.mts @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -import { GitLsRemoteOutput } from './GitLsRemoteOutput'; +import { GitLsRemoteOutput } from './GitLsRemoteOutput.mjs'; export { GitLsRemoteParser, }; /** * Class to parse the output of `git ls-remote`. diff --git a/dist/GitLsRemoteParser.js.map b/dist/GitLsRemoteParser.js.map deleted file mode 100644 index 1207a3f..0000000 --- a/dist/GitLsRemoteParser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GitLsRemoteParser.js","sourceRoot":"","sources":["../src/GitLsRemoteParser.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,qCAEiB;AACjB,iDAGuB;AACvB,uDAE0B;AAW1B;;GAEG;AACH,MAAM,iBAAiB;IACrB;;;;;;;OAOG;IACI,KAAK,CAAC,iBAAyB,EAAE,SAAiB,EAAE;QACzD,IAAK,CAAE,iBAAiB,EAAG,CAAC;YAC1B,MAAM,QAAQ,GAAG,6CAA6C,CAAA;YAC9D,eAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,cAAc,MAAM,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;YACrE,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAA;QAC3B,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,iCAAe,EAAE,CAAA;QACpC,eAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,8BAA8B,MAAM,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAA;QAE/E,KAAM,MAAM,IAAI,IAAI,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAG,CAAC;YACnD,IAAK,CAAE,IAAI;gBAAG,MAAK,CAAE,MAAM;YAE3B,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,gBAAgB,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACzD,IAAK,gBAAgB,IAAI,CAAE,GAAG,IAAI,CAAE,OAAO,EAAG,CAAC;gBAC7C,MAAM,QAAQ,GAAG,4CAA4C,IAAI,IAAI,CAAA;gBACrE,eAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,cAAc,MAAM,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBACrE,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAA;YAC3B,CAAC;YAED,IAAI,GAAiB,CAAA;YACrB,IAAI,CAAC;gBACH,GAAG,GAAG,IAAI,iCAAkB,CAAC,EAAC,OAAO,EAAE,GAAG,EAAC,CAAC,CAAA;YAC9C,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,eAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,cAAc,MAAM,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;gBAC3D,MAAM,GAAG,CAAA;YACX,CAAC;YACD,eAAM,CAAC,KAAK,CAAC,iBAAiB,GAAG,CAAC,OAAO,kBAAkB,GAAG,CAAC,GAAG,IAAI,CAAC,CAAA;YAEvE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACpB,CAAC;QAED,MAAM,YAAY,GAAsB,EAAC,MAAM,EAAE,MAAM,EAAC,CAAA;QACxD,eAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,+BAA+B,MAAM,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAA;QAElF,OAAO,YAAY,CAAA;IACrB,CAAC;CACF;AArDC,8CAAiB"} \ No newline at end of file diff --git a/dist/GitLsRemoteParser.js b/dist/GitLsRemoteParser.mjs similarity index 57% rename from dist/GitLsRemoteParser.js rename to dist/GitLsRemoteParser.mjs index 9381347..8893990 100644 --- a/dist/GitLsRemoteParser.js +++ b/dist/GitLsRemoteParser.mjs @@ -1,14 +1,12 @@ -"use strict"; /** * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal * * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.GitLsRemoteParser = void 0; -const Logger_1 = require("./Logger"); -const GitRemoteRef_1 = require("./GitRemoteRef"); -const GitRemoteRefMap_1 = require("./GitRemoteRefMap"); +import { Logger, } from './Logger.mjs'; +import { SimpleGitRemoteRef, } from './GitRemoteRef.mjs'; +import { GitRemoteRefMap } from './GitRemoteRefMap.mjs'; +export { GitLsRemoteParser, }; /** * Class to parse the output of `git ls-remote`. */ @@ -24,35 +22,34 @@ class GitLsRemoteParser { parse(rawLsRemoteOutput, remote = '') { if (!rawLsRemoteOutput) { const errorMsg = "The `git ls-remote` output cannot be empty."; - Logger_1.Logger.error(remote ? `${errorMsg} Remote: \`${remote}\`` : errorMsg); + Logger.error(remote ? `${errorMsg} Remote: \`${remote}\`` : errorMsg); throw new Error(errorMsg); } - const refMap = new GitRemoteRefMap_1.GitRemoteRefMap(); - Logger_1.Logger.info(remote ? `Parsing refs for remote: \`${remote}\`` : 'Parsing refs'); + const refMap = new GitRemoteRefMap(); + Logger.info(remote ? `Parsing refs for remote: \`${remote}\`` : 'Parsing refs'); for (const line of rawLsRemoteOutput.split('\n')) { if (!line) break; // EOF const [oid, refname, extraFieldCanary] = line.split('\t'); if (extraFieldCanary || !oid || !refname) { const errorMsg = `Invalid \`git ls-remote\` output line: \`${line}\``; - Logger_1.Logger.error(remote ? `${errorMsg} Remote: \`${remote}\`` : errorMsg); + Logger.error(remote ? `${errorMsg} Remote: \`${remote}\`` : errorMsg); throw new Error(errorMsg); } let ref; try { - ref = new GitRemoteRef_1.SimpleGitRemoteRef({ refname, oid }); + ref = new SimpleGitRemoteRef({ refname, oid }); } catch (err) { - Logger_1.Logger.error(remote ? `${err} Remote: \`${remote}\`` : err); + Logger.error(remote ? `${err} Remote: \`${remote}\`` : err); throw err; } - Logger_1.Logger.silly(`Parsed ref: \`${ref.refname}\` with oid: \`${ref.oid}\``); + Logger.debug(`Parsed ref: \`${ref.refname}\` with oid: \`${ref.oid}\``); refMap.setRef(ref); } const parsedOutput = { remote, refMap }; - Logger_1.Logger.debug(remote ? `Parsed output for remote: \`${remote}\`` : 'Parsed output'); + Logger.debug(remote ? `Parsed output for remote: \`${remote}\`` : 'Parsed output'); return parsedOutput; } } -exports.GitLsRemoteParser = GitLsRemoteParser; -//# sourceMappingURL=GitLsRemoteParser.js.map \ No newline at end of file +//# sourceMappingURL=GitLsRemoteParser.mjs.map \ No newline at end of file diff --git a/dist/GitLsRemoteParser.mjs.map b/dist/GitLsRemoteParser.mjs.map new file mode 100644 index 0000000..4589c98 --- /dev/null +++ b/dist/GitLsRemoteParser.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GitLsRemoteParser.mjs","sourceRoot":"","sources":["../src/GitLsRemoteParser.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,MAAM,GACP,MAAM,cAAc,CAAA;AACrB,OAAO,EAEL,kBAAkB,GACnB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,eAAe,EAChB,MAAM,uBAAuB,CAAA;AAM9B,OAAO,EACL,iBAAiB,GAClB,CAAA;AAGD;;GAEG;AACH,MAAM,iBAAiB;IACrB;;;;;;;OAOG;IACI,KAAK,CAAC,iBAAyB,EAAE,SAAiB,EAAE;QACzD,IAAK,CAAE,iBAAiB,EAAG,CAAC;YAC1B,MAAM,QAAQ,GAAG,6CAA6C,CAAA;YAC9D,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,cAAc,MAAM,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;YACrE,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAA;QAC3B,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAA;QACpC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,8BAA8B,MAAM,IAAI,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,CAAA;QAElF,OAAO,YAAY,CAAA;IACrB,CAAC;CACF"} \ No newline at end of file diff --git a/dist/GitLsRemoteRefDiff.d.ts b/dist/GitLsRemoteRefDiff.d.mts similarity index 82% rename from dist/GitLsRemoteRefDiff.d.ts rename to dist/GitLsRemoteRefDiff.d.mts index 5f2ce3b..4438c22 100644 --- a/dist/GitLsRemoteRefDiff.d.ts +++ b/dist/GitLsRemoteRefDiff.d.mts @@ -1,12 +1,12 @@ /** * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal * - * SPDX-License: GPL-3.0-only OR GPL-2.0-only + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -import { GitLsRemoteOutput } from './GitLsRemoteOutput'; -import { GitRefDiff, GitRefDiffBase } from './GitRefDiff'; -import { GitRefDiffType } from './GitRefDiffType'; -import { GitRemoteRef } from './GitRemoteRef'; +import { GitLsRemoteOutput } from './GitLsRemoteOutput.mjs'; +import { GitRefDiff, GitRefDiffBase } from './GitRefDiff.mjs'; +import { GitRefDiffType } from './GitRefDiffType.mjs'; +import { GitRemoteRef } from './GitRemoteRef.mjs'; export { GitLsRemoteRefDiff, GitLsRemoteRefDiffBase, GitLsRemoteZeroRefsDiff, GitLsRemoteRefCountMismatchDiff, GitLsRemoteRefNotFoundDiff, GitLsRemoteOidMismatchDiff, }; interface GitLsRemoteRefDiff extends GitRefDiff { readonly sourceRemote: string; diff --git a/dist/GitLsRemoteRefDiff.js.map b/dist/GitLsRemoteRefDiff.js.map deleted file mode 100644 index 700a93c..0000000 --- a/dist/GitLsRemoteRefDiff.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GitLsRemoteRefDiff.js","sourceRoot":"","sources":["../src/GitLsRemoteRefDiff.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAKH,6CAGqB;AACrB,qDAEyB;AAqBzB,MAAe,sBAAuB,SAAQ,2BAAc;IAC1C,OAAO,CAAA;IACP,YAAY,CAAQ;IACpB,YAAY,CAAQ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AA;IAEzD,WAAW;QACnB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;QACjD,CAAC;QACD,OAAO,oBAAoB,IAAI,CAAC,SAAS,CAAC,OAAO,aAAa,IAAI,CAAC,YAAY,sBAAsB,IAAI,CAAC,YAAY,KAAK,CAAA;IAC7H,CAAC;CACF;AA3DC,gEAA0B;AA6D5B,MAAM,0BAA2B,SAAQ,sBAAsB;IAC7C,IAAI,GAAmB,+BAAc,CAAC,YAAY,CAAA;IAExD,WAAW;QACnB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAA;QAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAA;QAC7B,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,0BAA0B,MAAM,CAAC,OAAO,oBAAoB,MAAM,CAAC,GAAG,oBAAoB,MAAM,CAAC,GAAG,KAAK,CAAA;IAClH,CAAC;CACF;AAvEC,gEAA0B"} \ No newline at end of file diff --git a/dist/GitLsRemoteRefDiff.js b/dist/GitLsRemoteRefDiff.mjs similarity index 63% rename from dist/GitLsRemoteRefDiff.js rename to dist/GitLsRemoteRefDiff.mjs index 68a23b1..fbda4bd 100644 --- a/dist/GitLsRemoteRefDiff.js +++ b/dist/GitLsRemoteRefDiff.mjs @@ -1,14 +1,12 @@ -"use strict"; /** * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal * - * SPDX-License: GPL-3.0-only OR GPL-2.0-only + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.GitLsRemoteOidMismatchDiff = exports.GitLsRemoteRefNotFoundDiff = exports.GitLsRemoteRefCountMismatchDiff = exports.GitLsRemoteZeroRefsDiff = exports.GitLsRemoteRefDiffBase = void 0; -const GitRefDiff_1 = require("./GitRefDiff"); -const GitRefDiffType_1 = require("./GitRefDiffType"); -class GitLsRemoteRefDiffBase extends GitRefDiff_1.GitRefDiffBase { +import { GitRefDiffBase, } from './GitRefDiff.mjs'; +import { GitRefDiffType, } from './GitRefDiffType.mjs'; +export { GitLsRemoteRefDiffBase, GitLsRemoteZeroRefsDiff, GitLsRemoteRefCountMismatchDiff, GitLsRemoteRefNotFoundDiff, GitLsRemoteOidMismatchDiff, }; +class GitLsRemoteRefDiffBase extends GitRefDiffBase { message; sourceRemote; targetRemote; @@ -24,27 +22,24 @@ class GitLsRemoteRefDiffBase extends GitRefDiff_1.GitRefDiffBase { this.message = this._getMessage(); } } -exports.GitLsRemoteRefDiffBase = GitLsRemoteRefDiffBase; class GitLsRemoteZeroRefsDiff extends GitLsRemoteRefDiffBase { - type = GitRefDiffType_1.GitRefDiffType.ZERO_REFS; + type = GitRefDiffType.ZERO_REFS; _getMessage() { const srcLen = this.sourceRefMap.size; const dstLen = this.targetRefMap.size; return `Zero refs: \`${this.sourceRemote}\` has \`${srcLen}\` refs, \`${this.targetRemote}\` has \`${dstLen}\` refs.`; } } -exports.GitLsRemoteZeroRefsDiff = GitLsRemoteZeroRefsDiff; class GitLsRemoteRefCountMismatchDiff extends GitLsRemoteRefDiffBase { - type = GitRefDiffType_1.GitRefDiffType.REF_COUNT_MISMATCH; + type = GitRefDiffType.REF_COUNT_MISMATCH; _getMessage() { const srcLen = this.sourceRefMap.size; const dstLen = this.targetRefMap.size; return `Ref count mismatch: \`${this.sourceRemote}\` has \`${srcLen}\` refs, \`${this.targetRemote}\` has \`${dstLen}\` refs.`; } } -exports.GitLsRemoteRefCountMismatchDiff = GitLsRemoteRefCountMismatchDiff; class GitLsRemoteRefNotFoundDiff extends GitLsRemoteRefDiffBase { - type = GitRefDiffType_1.GitRefDiffType.REF_NOT_FOUND; + type = GitRefDiffType.REF_NOT_FOUND; _getMessage() { if (!this.sourceRef) { throw new Error('sourceRef is not initialized'); @@ -52,9 +47,8 @@ class GitLsRemoteRefNotFoundDiff extends GitLsRemoteRefDiffBase { return `Ref not found: \`${this.sourceRef.refname}\` from \`${this.sourceRemote}\` is missing in \`${this.targetRemote}\`.`; } } -exports.GitLsRemoteRefNotFoundDiff = GitLsRemoteRefNotFoundDiff; class GitLsRemoteOidMismatchDiff extends GitLsRemoteRefDiffBase { - type = GitRefDiffType_1.GitRefDiffType.OID_MISMATCH; + type = GitRefDiffType.OID_MISMATCH; _getMessage() { const srcRef = this.sourceRef; const dstRef = this.targetRef; @@ -64,5 +58,4 @@ class GitLsRemoteOidMismatchDiff extends GitLsRemoteRefDiffBase { return `OID mismatch for ref \`${srcRef.refname}\`: source has \`${srcRef.oid}\`, target has \`${dstRef.oid}\`.`; } } -exports.GitLsRemoteOidMismatchDiff = GitLsRemoteOidMismatchDiff; -//# sourceMappingURL=GitLsRemoteRefDiff.js.map \ No newline at end of file +//# sourceMappingURL=GitLsRemoteRefDiff.mjs.map \ No newline at end of file diff --git a/dist/GitLsRemoteRefDiff.mjs.map b/dist/GitLsRemoteRefDiff.mjs.map new file mode 100644 index 0000000..686cc45 --- /dev/null +++ b/dist/GitLsRemoteRefDiff.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GitLsRemoteRefDiff.mjs","sourceRoot":"","sources":["../src/GitLsRemoteRefDiff.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAEL,cAAc,GACf,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,cAAc,GACf,MAAM,sBAAsB,CAAA;AAM7B,OAAO,EAEL,sBAAsB,EACtB,uBAAuB,EACvB,+BAA+B,EAC/B,0BAA0B,EAC1B,0BAA0B,GAC3B,CAAA;AAQD,MAAe,sBAAuB,SAAQ,cAAc;IAC1C,OAAO,CAAA;IACP,YAAY,CAAQ;IACpB,YAAY,CAAQ;IAEpC,YAAmB,IAAgH;QACjI,KAAK,CAAC;YACJ,YAAY,EAAE,IAAI,CAAC,MAAM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,oBAAoB,IAAI,CAAC,SAAS,CAAC,OAAO,aAAa,IAAI,CAAC,YAAY,sBAAsB,IAAI,CAAC,YAAY,KAAK,CAAA;IAC7H,CAAC;CACF;AAED,MAAM,0BAA2B,SAAQ,sBAAsB;IAC7C,IAAI,GAAmB,cAAc,CAAC,YAAY,CAAA;IAExD,WAAW;QACnB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAA;QAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAA;QAC7B,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,0BAA0B,MAAM,CAAC,OAAO,oBAAoB,MAAM,CAAC,GAAG,oBAAoB,MAAM,CAAC,GAAG,KAAK,CAAA;IAClH,CAAC;CACF"} \ No newline at end of file diff --git a/dist/GitRefDiff.d.ts b/dist/GitRefDiff.d.mts similarity index 79% rename from dist/GitRefDiff.d.ts rename to dist/GitRefDiff.d.mts index efeeeb4..2bc1bc4 100644 --- a/dist/GitRefDiff.d.ts +++ b/dist/GitRefDiff.d.mts @@ -1,11 +1,11 @@ /** * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal * - * SPDX-License: GPL-3.0-only OR GPL-2.0-only + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -import { GitRemoteRef } from './GitRemoteRef'; -import { GitRemoteRefMap } from './GitRemoteRefMap'; -import { GitRefDiffType } from './GitRefDiffType'; +import { GitRemoteRef } from './GitRemoteRef.mjs'; +import { GitRemoteRefMap } from './GitRemoteRefMap.mjs'; +import { GitRefDiffType } from './GitRefDiffType.mjs'; export { GitRefDiff, GitRefDiffBase, }; interface GitRefDiff { readonly type: GitRefDiffType; diff --git a/dist/GitRefDiff.js.map b/dist/GitRefDiff.js.map deleted file mode 100644 index f5187c3..0000000 --- a/dist/GitRefDiff.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GitRefDiff.js","sourceRoot":"","sources":["../src/GitRefDiff.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAQH,qDAEyB;AAmBzB,MAAe,cAAc;IACX,IAAI,GAAmB,+BAAc,CAAC,OAAO,CAAA;IAC7C,OAAO,GAAW,EAAE,CAAA;IACpB,YAAY,CAAiB;IAC7B,YAAY,CAAiB;IAC7B,SAAS,CAAe;IACxB,SAAS,CAAe;IAExC,YAAmB,IAAwH;QACzI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAA;QACrC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAA;QACrC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAA;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAA;IACjC,CAAC;CACF;AA5BC,wCAAc"} \ No newline at end of file diff --git a/dist/GitRefDiff.js b/dist/GitRefDiff.mjs similarity index 52% rename from dist/GitRefDiff.js rename to dist/GitRefDiff.mjs index 1ae5af2..9890924 100644 --- a/dist/GitRefDiff.js +++ b/dist/GitRefDiff.mjs @@ -1,14 +1,12 @@ -"use strict"; /** * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal * - * SPDX-License: GPL-3.0-only OR GPL-2.0-only + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.GitRefDiffBase = void 0; -const GitRefDiffType_1 = require("./GitRefDiffType"); +import { GitRefDiffType, } from './GitRefDiffType.mjs'; +export { GitRefDiffBase, }; class GitRefDiffBase { - type = GitRefDiffType_1.GitRefDiffType.UNKNOWN; + type = GitRefDiffType.UNKNOWN; message = ''; sourceRefMap; targetRefMap; @@ -21,5 +19,4 @@ class GitRefDiffBase { this.targetRef = init.targetRef; } } -exports.GitRefDiffBase = GitRefDiffBase; -//# sourceMappingURL=GitRefDiff.js.map \ No newline at end of file +//# sourceMappingURL=GitRefDiff.mjs.map \ No newline at end of file diff --git a/dist/GitRefDiff.mjs.map b/dist/GitRefDiff.mjs.map new file mode 100644 index 0000000..2606996 --- /dev/null +++ b/dist/GitRefDiff.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GitRefDiff.mjs","sourceRoot":"","sources":["../src/GitRefDiff.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EACL,cAAc,GACf,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EAEL,cAAc,GACf,CAAA;AAaD,MAAe,cAAc;IACX,IAAI,GAAmB,cAAc,CAAC,OAAO,CAAA;IAC7C,OAAO,GAAW,EAAE,CAAA;IACpB,YAAY,CAAiB;IAC7B,YAAY,CAAiB;IAC7B,SAAS,CAAe;IACxB,SAAS,CAAe;IAExC,YAAmB,IAAwH;QACzI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAA;QACrC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAA;QACrC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAA;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAA;IACjC,CAAC;CACF"} \ No newline at end of file diff --git a/dist/GitRefDiffType.d.ts b/dist/GitRefDiffType.d.mts similarity index 83% rename from dist/GitRefDiffType.d.ts rename to dist/GitRefDiffType.d.mts index 01e8a57..6552b96 100644 --- a/dist/GitRefDiffType.d.ts +++ b/dist/GitRefDiffType.d.mts @@ -1,7 +1,7 @@ /** * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal * - * SPDX-License: GPL-3.0-only OR GPL-2.0-only + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ export { GitRefDiffType, }; declare enum GitRefDiffType { diff --git a/dist/GitRefDiffType.js.map b/dist/GitRefDiffType.js.map deleted file mode 100644 index e2f23d2..0000000 --- a/dist/GitRefDiffType.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GitRefDiffType.js","sourceRoot":"","sources":["../src/GitRefDiffType.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAOH,IAAK,cAMJ;AAND,WAAK,cAAc;IACjB,qCAAmB,CAAA;IACnB,yCAAuB,CAAA;IACvB,2DAAyC,CAAA;IACzC,iDAA+B,CAAA;IAC/B,+CAA6B,CAAA;AAC/B,CAAC,EANI,cAAc,8BAAd,cAAc,QAMlB"} \ No newline at end of file diff --git a/dist/GitRefDiffType.js b/dist/GitRefDiffType.mjs similarity index 58% rename from dist/GitRefDiffType.js rename to dist/GitRefDiffType.mjs index 6edd1f7..05af64e 100644 --- a/dist/GitRefDiffType.js +++ b/dist/GitRefDiffType.mjs @@ -1,11 +1,9 @@ -"use strict"; /** * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal * - * SPDX-License: GPL-3.0-only OR GPL-2.0-only + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.GitRefDiffType = void 0; +export { GitRefDiffType, }; var GitRefDiffType; (function (GitRefDiffType) { GitRefDiffType["UNKNOWN"] = "UNKNOWN"; @@ -13,5 +11,5 @@ var GitRefDiffType; GitRefDiffType["REF_COUNT_MISMATCH"] = "REF_COUNT_MISMATCH"; GitRefDiffType["REF_NOT_FOUND"] = "REF_NOT_FOUND"; GitRefDiffType["OID_MISMATCH"] = "OID_MISMATCH"; -})(GitRefDiffType || (exports.GitRefDiffType = GitRefDiffType = {})); -//# sourceMappingURL=GitRefDiffType.js.map \ No newline at end of file +})(GitRefDiffType || (GitRefDiffType = {})); +//# sourceMappingURL=GitRefDiffType.mjs.map \ No newline at end of file diff --git a/dist/GitRefDiffType.mjs.map b/dist/GitRefDiffType.mjs.map new file mode 100644 index 0000000..e4989a6 --- /dev/null +++ b/dist/GitRefDiffType.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GitRefDiffType.mjs","sourceRoot":"","sources":["../src/GitRefDiffType.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,cAAc,GACf,CAAA;AAGD,IAAK,cAMJ;AAND,WAAK,cAAc;IACjB,qCAAmB,CAAA;IACnB,yCAAuB,CAAA;IACvB,2DAAyC,CAAA;IACzC,iDAA+B,CAAA;IAC/B,+CAA6B,CAAA;AAC/B,CAAC,EANI,cAAc,KAAd,cAAc,QAMlB"} \ No newline at end of file diff --git a/dist/GitRemoteRef.d.ts b/dist/GitRemoteRef.d.mts similarity index 100% rename from dist/GitRemoteRef.d.ts rename to dist/GitRemoteRef.d.mts diff --git a/dist/GitRemoteRef.js.map b/dist/GitRemoteRef.js.map deleted file mode 100644 index 4ebae49..0000000 --- a/dist/GitRemoteRef.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GitRemoteRef.js","sourceRoot":"","sources":["../src/GitRemoteRef.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAsCH,MAAe,gBAAgB;IACb,OAAO,CAAQ;IACf,GAAG,CAAQ;IACjB,MAAM,CAAU,aAAa,GAAG,gBAAgB,CAAA;IAChD,MAAM,CAAU,iBAAiB,GAAG,2CAA2C,CAAA;IAEzF,YAAmB,EAAE,OAAO,EAAE,GAAG,EAAgB;QAC/C,IAAK,CAAE,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,EAAG,CAAC;YACjD,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAA;QAC5C,CAAC;QACD,IAAK,CAAE,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAG,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,sBAAsB,OAAO,IAAI,CAAC,CAAA;QACpD,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;IAChB,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,GAAW;QACnC,OAAO,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACjD,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,OAAe;QAC3C,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACzD,CAAC;;AAzDD,4CAAgB;AA4DlB;;;;;;;;;;;;GAYG;AACH,MAAM,kBAAmB,SAAQ,gBAAgB;CAAI;AAxEnD,gDAAkB"} \ No newline at end of file diff --git a/dist/GitRemoteRef.js b/dist/GitRemoteRef.mjs similarity index 82% rename from dist/GitRemoteRef.js rename to dist/GitRemoteRef.mjs index edfe405..b338559 100644 --- a/dist/GitRemoteRef.js +++ b/dist/GitRemoteRef.mjs @@ -1,11 +1,9 @@ -"use strict"; /** * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal * * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SimpleGitRemoteRef = exports.GitRemoteRefBase = void 0; +export { GitRemoteRefBase, SimpleGitRemoteRef, }; class GitRemoteRefBase { refname; oid; @@ -28,7 +26,6 @@ class GitRemoteRefBase { return GitRemoteRefBase._gitRefNameRegExp.test(refname); } } -exports.GitRemoteRefBase = GitRemoteRefBase; /** * A simple implementation of the GitRemoteRef interface. * @@ -44,5 +41,4 @@ exports.GitRemoteRefBase = GitRemoteRefBase; */ class SimpleGitRemoteRef extends GitRemoteRefBase { } -exports.SimpleGitRemoteRef = SimpleGitRemoteRef; -//# sourceMappingURL=GitRemoteRef.js.map \ No newline at end of file +//# sourceMappingURL=GitRemoteRef.mjs.map \ No newline at end of file diff --git a/dist/GitRemoteRef.mjs.map b/dist/GitRemoteRef.mjs.map new file mode 100644 index 0000000..325575f --- /dev/null +++ b/dist/GitRemoteRef.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GitRemoteRef.mjs","sourceRoot":"","sources":["../src/GitRemoteRef.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,GACnB,CAAA;AAgCD,MAAe,gBAAgB;IACb,OAAO,CAAQ;IACf,GAAG,CAAQ;IACjB,MAAM,CAAU,aAAa,GAAG,gBAAgB,CAAA;IAChD,MAAM,CAAU,iBAAiB,GAAG,2CAA2C,CAAA;IAEzF,YAAmB,EAAE,OAAO,EAAE,GAAG,EAAgB;QAC/C,IAAK,CAAE,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,EAAG,CAAC;YACjD,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAA;QAC5C,CAAC;QACD,IAAK,CAAE,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAG,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,sBAAsB,OAAO,IAAI,CAAC,CAAA;QACpD,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;IAChB,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,GAAW;QACnC,OAAO,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACjD,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,OAAe;QAC3C,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACzD,CAAC;;AAGH;;;;;;;;;;;;GAYG;AACH,MAAM,kBAAmB,SAAQ,gBAAgB;CAAI"} \ No newline at end of file diff --git a/dist/GitRemoteRefMap.d.ts b/dist/GitRemoteRefMap.d.mts similarity index 97% rename from dist/GitRemoteRefMap.d.ts rename to dist/GitRemoteRefMap.d.mts index 3cbac18..b44ba68 100644 --- a/dist/GitRemoteRefMap.d.ts +++ b/dist/GitRemoteRefMap.d.mts @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -import { GitRemoteRef } from './GitRemoteRef'; +import { GitRemoteRef } from './GitRemoteRef.mjs'; export { GitRemoteRefMap, }; /** * A map of reference names to their corresponding object IDs. diff --git a/dist/GitRemoteRefMap.js.map b/dist/GitRemoteRefMap.js.map deleted file mode 100644 index bee9658..0000000 --- a/dist/GitRemoteRefMap.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GitRemoteRefMap.js","sourceRoot":"","sources":["../src/GitRemoteRefMap.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAYH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,eAAgB,SAAQ,GAAmB;IAC/C,YAAmB,IAAqB;QACtC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAC5D,CAAC;IAED;;OAEG;IACI,CAAC,IAAI;QACV,KAAK,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;YAC5C,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAA;QACxB,CAAC;IACH,CAAC;IAED;;OAEG;IACI,CAAC,QAAQ;QACd,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YAClC,MAAM,OAAO,CAAA;QACf,CAAC;IACH,CAAC;IAED;;OAEG;IACI,CAAC,IAAI;QACV,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;YAChC,MAAM,GAAG,CAAA;QACX,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,GAAiB;QAC7B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,OAAe;QAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAC7B,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;IAC3C,CAAC;IAED;;;;OAIG;IACI,UAAU,CAAC,QAAqC;QACrD,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YAC9B,QAAQ,CAAC,GAAG,CAAC,CAAA;QACf,CAAC;IACH,CAAC;CACF;AArFC,0CAAe"} \ No newline at end of file diff --git a/dist/GitRemoteRefMap.js b/dist/GitRemoteRefMap.mjs similarity index 91% rename from dist/GitRemoteRefMap.js rename to dist/GitRemoteRefMap.mjs index 8e73075..6e329a2 100644 --- a/dist/GitRemoteRefMap.js +++ b/dist/GitRemoteRefMap.mjs @@ -1,11 +1,9 @@ -"use strict"; /** * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal * * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.GitRemoteRefMap = void 0; +export { GitRemoteRefMap, }; /** * A map of reference names to their corresponding object IDs. * @@ -82,5 +80,4 @@ class GitRemoteRefMap extends Map { } } } -exports.GitRemoteRefMap = GitRemoteRefMap; -//# sourceMappingURL=GitRemoteRefMap.js.map \ No newline at end of file +//# sourceMappingURL=GitRemoteRefMap.mjs.map \ No newline at end of file diff --git a/dist/GitRemoteRefMap.mjs.map b/dist/GitRemoteRefMap.mjs.map new file mode 100644 index 0000000..6b3107a --- /dev/null +++ b/dist/GitRemoteRefMap.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GitRemoteRefMap.mjs","sourceRoot":"","sources":["../src/GitRemoteRefMap.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,EACL,eAAe,GAChB,CAAA;AAGD;;;;;;;;;;;;;;;;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C,GAAG,CAAC,CAAA;QACf,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/dist/GitRemoteRefsCmp.d.ts b/dist/GitRemoteRefsCmp.d.mts similarity index 58% rename from dist/GitRemoteRefsCmp.d.ts rename to dist/GitRemoteRefsCmp.d.mts index fcbc695..0761694 100644 --- a/dist/GitRemoteRefsCmp.d.ts +++ b/dist/GitRemoteRefsCmp.d.mts @@ -3,10 +3,10 @@ * * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only */ -import { GitCommandManager } from './GitCommandManager'; -import { GitLsRemoteParser } from './GitLsRemoteParser'; -import { GitLsRemoteOutputCmp } from './GitLsRemoteOutputCmp'; -import { GitLsRemoteRefDiff } from './GitLsRemoteRefDiff'; +import { GitCommandManager } from './GitCommandManager.mjs'; +import { GitLsRemoteParser } from './GitLsRemoteParser.mjs'; +import { GitLsRemoteOutputCmp } from './GitLsRemoteOutputCmp.mjs'; +import { GitLsRemoteRefDiff } from './GitLsRemoteRefDiff.mjs'; export { GitRemoteRefsCmp, }; declare class GitRemoteRefsCmp { git: GitCommandManager; @@ -14,6 +14,8 @@ declare class GitRemoteRefsCmp { lsRemoteCmp: GitLsRemoteOutputCmp; constructor(); init(): Promise; + isInitialized(): boolean; + ensureIsInitialized(): Promise; private processRemote; compare(sourceRemote: string, targetRemote: string): Promise; } diff --git a/dist/GitRemoteRefsCmp.js b/dist/GitRemoteRefsCmp.js deleted file mode 100644 index a515a53..0000000 --- a/dist/GitRemoteRefsCmp.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.GitRemoteRefsCmp = void 0; -const GitCommandManager_1 = require("./GitCommandManager"); -const GitLsRemoteParser_1 = require("./GitLsRemoteParser"); -const GitLsRemoteOutputCmp_1 = require("./GitLsRemoteOutputCmp"); -class GitRemoteRefsCmp { - git; - parser; - lsRemoteCmp; - constructor() { - this.git = new GitCommandManager_1.GitCommandManager(); - this.parser = new GitLsRemoteParser_1.GitLsRemoteParser(); - this.lsRemoteCmp = new GitLsRemoteOutputCmp_1.GitLsRemoteOutputCmp(); - } - async init() { - await this.git.init(); - } - async processRemote(remote) { - const rawOutput = await this.git.lsRemote({ remote }); - return this.parser.parse(rawOutput, remote); - } - async compare(sourceRemote, targetRemote) { - console.assert(this.git.isInitialized()); - const promises = [sourceRemote, targetRemote].map(this.processRemote); - const [source, target] = await Promise.all(promises); - return this.lsRemoteCmp.compare(source, target); - } -} -exports.GitRemoteRefsCmp = GitRemoteRefsCmp; -//# sourceMappingURL=GitRemoteRefsCmp.js.map \ No newline at end of file diff --git a/dist/GitRemoteRefsCmp.js.map b/dist/GitRemoteRefsCmp.js.map deleted file mode 100644 index 01e6c7b..0000000 --- a/dist/GitRemoteRefsCmp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GitRemoteRefsCmp.js","sourceRoot":"","sources":["../src/GitRemoteRefsCmp.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,2DAE4B;AAC5B,2DAE4B;AAC5B,iEAE+B;AAc/B,MAAM,gBAAgB;IACpB,GAAG,CAAmB;IACtB,MAAM,CAAmB;IACzB,WAAW,CAAsB;IAEjC;QACE,IAAI,CAAC,GAAG,GAAG,IAAI,qCAAiB,EAAE,CAAA;QAClC,IAAI,CAAC,MAAM,GAAG,IAAI,qCAAiB,EAAE,CAAA;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,2CAAoB,EAAE,CAAA;IAC/C,CAAC;IAEM,KAAK,CAAC,IAAI;QACf,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;IACvB,CAAC;IAEO,KAAK,CAAC,aAAa,CAAC,MAAc;QACxC,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;QACrD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;IAC7C,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,YAAoB,EAAE,YAAoB;QAC7D,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,CAAA;QACxC,MAAM,QAAQ,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QACrE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACpD,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjD,CAAC;CACF;AA9BC,4CAAgB"} \ No newline at end of file diff --git a/dist/GitRemoteRefsCmp.mjs b/dist/GitRemoteRefsCmp.mjs new file mode 100644 index 0000000..8f258c7 --- /dev/null +++ b/dist/GitRemoteRefsCmp.mjs @@ -0,0 +1,40 @@ +/** + * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal + * + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only + */ +import { GitCommandManager, } from './GitCommandManager.mjs'; +import { GitLsRemoteParser, } from './GitLsRemoteParser.mjs'; +import { GitLsRemoteOutputCmp, } from './GitLsRemoteOutputCmp.mjs'; +export { GitRemoteRefsCmp, }; +class GitRemoteRefsCmp { + git; + parser; + lsRemoteCmp; + constructor() { + this.git = new GitCommandManager(); + this.parser = new GitLsRemoteParser(); + this.lsRemoteCmp = new GitLsRemoteOutputCmp(); + } + async init() { + await this.git.init(); + } + isInitialized() { + return this.git.isInitialized(); + } + async ensureIsInitialized() { + if (!this.isInitialized()) { + await this.init(); + } + } + async processRemote(remote) { + const rawOutput = await this.git.lsRemote({ remote }); + return this.parser.parse(rawOutput, remote); + } + async compare(sourceRemote, targetRemote) { + await this.ensureIsInitialized(); + const [source, target] = await Promise.all([sourceRemote, targetRemote].map(this.processRemote)); + return this.lsRemoteCmp.compare(source, target); + } +} +//# sourceMappingURL=GitRemoteRefsCmp.mjs.map \ No newline at end of file diff --git a/dist/GitRemoteRefsCmp.mjs.map b/dist/GitRemoteRefsCmp.mjs.map new file mode 100644 index 0000000..135beec --- /dev/null +++ b/dist/GitRemoteRefsCmp.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GitRemoteRefsCmp.mjs","sourceRoot":"","sources":["../src/GitRemoteRefsCmp.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,iBAAiB,GAClB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,iBAAiB,GAClB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,oBAAoB,GACrB,MAAM,4BAA4B,CAAA;AASnC,OAAO,EACL,gBAAgB,GACjB,CAAA;AAGD,MAAM,gBAAgB;IACpB,GAAG,CAAmB;IACtB,MAAM,CAAmB;IACzB,WAAW,CAAsB;IAEjC;QACE,IAAI,CAAC,GAAG,GAAG,IAAI,iBAAiB,EAAE,CAAA;QAClC,IAAI,CAAC,MAAM,GAAG,IAAI,iBAAiB,EAAE,CAAA;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,oBAAoB,EAAE,CAAA;IAC/C,CAAC;IAEM,KAAK,CAAC,IAAI;QACf,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;IACvB,CAAC;IAEM,aAAa;QAClB,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAA;IACjC,CAAC;IAEM,KAAK,CAAC,mBAAmB;QAC9B,IAAK,CAAE,IAAI,CAAC,aAAa,EAAE,EAAG,CAAC;YAC7B,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;QACnB,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,aAAa,CAAC,MAAc;QACxC,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;QACrD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;IAC7C,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,YAAoB,EAAE,YAAoB;QAC7D,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAA;QAChC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CACxC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CACrD,CAAA;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjD,CAAC;CACF"} \ No newline at end of file diff --git a/dist/Logger.d.mts b/dist/Logger.d.mts new file mode 100644 index 0000000..5364a25 --- /dev/null +++ b/dist/Logger.d.mts @@ -0,0 +1,7 @@ +/** + * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal + * + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only + */ +declare const Logger: Console; +export { Logger, }; diff --git a/dist/Logger.d.ts b/dist/Logger.d.ts deleted file mode 100644 index 896554c..0000000 --- a/dist/Logger.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ -export { Logger, }; -declare class Logger { - static logLevel: string; - static log(level: string, message: unknown): void; - static silly(message: unknown): void; - static trace(message: unknown): void; - static debug(message: unknown): void; - static info(message: unknown): void; - static warn(message: unknown): void; - static error(message: unknown): void; - static fatal(message: unknown): void; - static shouldLog(level: string): boolean; - static getColor(level: string): string; - static getEmoji(level: string): string; -} diff --git a/dist/Logger.js b/dist/Logger.js deleted file mode 100644 index 495ef71..0000000 --- a/dist/Logger.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Logger = void 0; -// Logger.silly(), Logger.trace(), Logger.debug(), Logger.info(), Logger.warn(), Logger.error(), Logger.fatal() -class Logger { - static logLevel = process.env['RUNNER_DEBUG'] === '1' ? 'silly' : 'fatal'; - static log(level, message) { - if (!Logger.shouldLog(level)) - return; - const color = Logger.getColor(level); - const emoji = Logger.getEmoji(level); - const levelStr = `[${level.toUpperCase()}]`; - const isString = typeof message === 'string'; - const logFunction = ['error', 'fatal'].includes(level) ? console.error : console.log; - logFunction(`${color}${emoji} ${levelStr} %s${Logger.getColor('')}`, isString ? message : '', isString ? '' : message); - } - static silly(message) { - Logger.log('silly', message); - } - static trace(message) { - Logger.log('trace', message); - } - static debug(message) { - Logger.log('debug', message); - } - static info(message) { - Logger.log('info', message); - } - static warn(message) { - Logger.log('warn', message); - } - static error(message) { - Logger.log('error', message); - } - static fatal(message) { - Logger.log('fatal', message); - } - static shouldLog(level) { - const levels = ['silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal']; - return levels.indexOf(level) >= levels.indexOf(Logger.logLevel); - } - static getColor(level) { - switch (level) { - case 'silly': return '\x1b[35m'; // Magenta - case 'trace': return '\x1b[34m'; // Blue - case 'debug': return '\x1b[36m'; // Cyan - case 'info': return '\x1b[32m'; // Green - case 'warn': return '\x1b[33m'; // Yellow - case 'error': return '\x1b[31m'; // Red - case 'fatal': return '\x1b[41m'; // Red background - default: return '\x1b[0m'; // Reset - } - } - static getEmoji(level) { - switch (level) { - case 'silly': return 'ðŸĪŠ'; - case 'trace': return '🔍'; - case 'debug': return '🐛'; - case 'info': return 'â„đïļ '; - case 'warn': return '⚠ïļ '; - case 'error': return '❌'; - case 'fatal': return '💀'; - default: return ''; - } - } -} -exports.Logger = Logger; -//# sourceMappingURL=Logger.js.map \ No newline at end of file diff --git a/dist/Logger.js.map b/dist/Logger.js.map deleted file mode 100644 index c77ec37..0000000 --- a/dist/Logger.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../src/Logger.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAMH,+GAA+G;AAE/G,MAAM,MAAM;IACH,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAA;IAEzE,MAAM,CAAC,GAAG,CAAC,KAAa,EAAE,OAAgB;QAC/C,IAAK,CAAE,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;YAAG,OAAM;QAEvC,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QACpC,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QACpC,MAAM,QAAQ,GAAG,IAAI,KAAK,CAAC,WAAW,EAAE,GAAG,CAAA;QAC3C,MAAM,QAAQ,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAA;QAE5C,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA;QACpF,WAAW,CAAC,GAAG,KAAK,GAAG,KAAK,IAAI,QAAQ,MAAM,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;IACxH,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,OAAgB;QAClC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,C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M,CAAC,CAAC,OAAO,UAAU,CAAA,CAAC,QAAQ;YACvC,KAAK,MAAM,CAAC,CAAC,OAAO,UAAU,CAAA,CAAC,SAAS;YACxC,KAAK,OAAO,CAAC,CAAC,OAAO,UAAU,CAAA,CAAC,MAAM;YACtC,KAAK,OAAO,CAAC,CAAC,OAAO,UAAU,CAAA,CAAC,iBAAiB;YACjD,OAAO,CAAC,CAAC,OAAO,SAAS,CAAA,CAAC,QAAQ;QACpC,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAa;QAClC,QAAQ,KAAK,EAAE,CAAC;YACd,KAAK,OAAO,CAAC,CAAC,OAAO,IAAI,CAAA;YACzB,KAAK,OAAO,CAAC,CAAC,OAAO,IAAI,CAAA;YACzB,KAAK,OAAO,CAAC,CAAC,OAAO,IAAI,CAAA;YACzB,KAAK,MAAM,CAAC,CAAC,OAAO,KAAK,CAAA;YACzB,KAAK,MAAM,CAAC,CAAC,OAAO,KAAK,CAAA;YACzB,KAAK,OAAO,CAAC,CAAC,OAAO,GAAG,CAAA;YACxB,KAAK,OAAO,CAAC,CAAC,OAAO,IAAI,CAAA;YACzB,OAAO,CAAC,CAAC,OAAO,EAAE,CAAA;QACpB,CAAC;IACH,CAAC;;AA7ED,wBAAM"} \ No newline at end of file diff --git a/dist/Logger.mjs b/dist/Logger.mjs new file mode 100644 index 0000000..b92fb71 --- /dev/null +++ b/dist/Logger.mjs @@ -0,0 +1,26 @@ +/** + * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal + * + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only + */ +// import { Logger as TsLogger } from 'tslog' +// Define the enum for log levels +// enum LogLevel { +// Silly = 0, +// Trace = 1, +// Debug = 2, +// Info = 3, +// Warn = 4, +// Error = 5, +// Fatal = 6 +// } +// Create the logger instance using the enum +// const Logger = new TsLogger({ +// name: '@foo/bar', +// minLevel: process.env['RUNNER_DEBUG'] === '1' ? LogLevel.Silly : LogLevel.Fatal +// }) +const Logger = console; +export { Logger, +// LogLevel, + }; +//# sourceMappingURL=Logger.mjs.map \ No newline at end of file diff --git a/dist/Logger.mjs.map b/dist/Logger.mjs.map new file mode 100644 index 0000000..47e7a07 --- /dev/null +++ b/dist/Logger.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"Logger.mjs","sourceRoot":"","sources":["../src/Logger.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,6CAA6C;AAE7C,iCAAiC;AACjC,kBAAkB;AAClB,eAAe;AACf,eAAe;AACf,eAAe;AACf,cAAc;AACd,cAAc;AACd,eAAe;AACf,cAAc;AACd,IAAI;AAEJ,4CAA4C;AAC5C,iCAAiC;AACjC,uBAAuB;AACvB,qFAAqF;AACrF,KAAK;AAEL,MAAM,MAAM,GAAG,OAAO,CAAA;AAEtB,OAAO,EACL,MAAM;AACN,YAAY;EACb,CAAA"} \ No newline at end of file diff --git a/dist/Utils.d.ts b/dist/Utils.d.mts similarity index 100% rename from dist/Utils.d.ts rename to dist/Utils.d.mts diff --git a/dist/Utils.js b/dist/Utils.js deleted file mode 100644 index 1679661..0000000 --- a/dist/Utils.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.which = which; -const path = __importStar(require("path")); -const fs = __importStar(require("fs/promises")); -async function which(executable) { - const dirs = process.env.PATH?.split(path.delimiter) || []; - const checks = dirs.map(async (dir) => { - const fullPath = path.join(dir, executable); - try { - await fs.access(fullPath, fs.constants.X_OK); - return fullPath; - } - catch { - return ''; - } - }); - const results = await Promise.all(checks); - return results.find(result => result) ?? ''; -} -//# sourceMappingURL=Utils.js.map \ No newline at end of file diff --git a/dist/Utils.js.map b/dist/Utils.js.map deleted file mode 100644 index 5ba60bb..0000000 --- a/dist/Utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../src/Utils.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;AAOD,sBAAK;AALP,2CAA4B;AAC5B,gDAAiC;AAQjC,KAAK,UAAU,KAAK,CAAC,UAAkB;IACrC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;IAC1D,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;QAC3C,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YAC5C,OAAO,QAAQ,CAAA;QACjB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAA;QACX,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACzC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;AAC7C,CAAC"} \ No newline at end of file diff --git a/dist/Utils.mjs b/dist/Utils.mjs new file mode 100644 index 0000000..58626ed --- /dev/null +++ b/dist/Utils.mjs @@ -0,0 +1,24 @@ +/** + * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal + * + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only + */ +import * as path from 'path'; +import * as fs from 'fs/promises'; +export { which, }; +async function which(executable) { + const dirs = process.env.PATH?.split(path.delimiter) || []; + const checks = dirs.map(async (dir) => { + const fullPath = path.join(dir, executable); + try { + await fs.access(fullPath, fs.constants.X_OK); + return fullPath; + } + catch { + return ''; + } + }); + const results = await Promise.all(checks); + return results.find(result => result) ?? ''; +} +//# sourceMappingURL=Utils.mjs.map \ No newline at end of file diff --git a/dist/Utils.mjs.map b/dist/Utils.mjs.map new file mode 100644 index 0000000..d63ddc1 --- /dev/null +++ b/dist/Utils.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"Utils.mjs","sourceRoot":"","sources":["../src/Utils.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AAGjC,OAAO,EACL,KAAK,GACN,CAAA;AAGD,KAAK,UAAU,KAAK,CAAC,UAAkB;IACrC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;IAC1D,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;QAC3C,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YAC5C,OAAO,QAAQ,CAAA;QACjB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAA;QACX,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACzC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;AAC7C,CAAC"} \ No newline at end of file diff --git a/dist/index.d.mts b/dist/index.d.mts new file mode 100644 index 0000000..de7a963 --- /dev/null +++ b/dist/index.d.mts @@ -0,0 +1,17 @@ +/** + * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal + * + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only + */ +import { GitLsRemoteRefDiff } from './GitLsRemoteRefDiff.mjs'; +export { GitCommandManager, } from './GitCommandManager.mjs'; +export { GitLsRemoteOutput, } from './GitLsRemoteOutput.mjs'; +export { GitLsRemoteOutputCmp, } from './GitLsRemoteOutputCmp.mjs'; +export { GitLsRemoteParser, } from './GitLsRemoteParser.mjs'; +export { GitLsRemoteRefDiff, GitLsRemoteZeroRefsDiff, GitLsRemoteRefCountMismatchDiff, GitLsRemoteRefNotFoundDiff, GitLsRemoteOidMismatchDiff, } from './GitLsRemoteRefDiff.mjs'; +export { GitRefDiff, } from './GitRefDiff.mjs'; +export { GitRefDiffType, } from './GitRefDiffType.mjs'; +export { GitRemoteRefsCmp, } from './GitRemoteRefsCmp.mjs'; +export { Logger, } from './Logger.mjs'; +export { gitRemoteRefsCmp, }; +declare function gitRemoteRefsCmp(sourceRemote: string, targetRemote: string): Promise; diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index b63e511..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ -import { GitLsRemoteRefDiff } from './GitLsRemoteRefDiff'; -export type { GitLsRemoteRefDiff, GitLsRemoteZeroRefsDiff, GitLsRemoteRefCountMismatchDiff, GitLsRemoteRefNotFoundDiff, GitLsRemoteOidMismatchDiff, } from './GitLsRemoteRefDiff'; -export type { GitRefDiff, } from './GitRefDiff'; -export type { GitRefDiffType, } from './GitRefDiffType'; -export type { GitRemoteRefsCmp, } from './GitRemoteRefsCmp'; -export type { Logger, } from './Logger'; -export { gitRemoteRefsCmp, }; -declare function gitRemoteRefsCmp(sourceRemote: string, targetRemote: string): Promise; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index b71dddf..0000000 --- a/dist/index.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.gitRemoteRefsCmp = gitRemoteRefsCmp; -const GitRemoteRefsCmp_1 = require("./GitRemoteRefsCmp"); -async function gitRemoteRefsCmp(sourceRemote, targetRemote) { - const cmp = new GitRemoteRefsCmp_1.GitRemoteRefsCmp(); - await cmp.init(); - return cmp.compare(sourceRemote, targetRemote); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index 969978d..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAgCD,4CAAgB;AA3BlB,yDAE2B;AA6B3B,KAAK,UAAU,gBAAgB,CAAC,YAAoB,EAAE,YAAoB;IACxE,MAAM,GAAG,GAAG,IAAI,mCAAgB,EAAE,CAAA;IAClC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAA;IAChB,OAAO,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA;AAChD,CAAC"} \ No newline at end of file diff --git a/dist/index.mjs b/dist/index.mjs new file mode 100644 index 0000000..c90e0b5 --- /dev/null +++ b/dist/index.mjs @@ -0,0 +1,20 @@ +/** + * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal + * + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only + */ +import { GitRemoteRefsCmp, } from './GitRemoteRefsCmp.mjs'; +export { GitCommandManager, } from './GitCommandManager.mjs'; +export { GitLsRemoteOutputCmp, } from './GitLsRemoteOutputCmp.mjs'; +export { GitLsRemoteParser, } from './GitLsRemoteParser.mjs'; +export { GitLsRemoteZeroRefsDiff, GitLsRemoteRefCountMismatchDiff, GitLsRemoteRefNotFoundDiff, GitLsRemoteOidMismatchDiff, } from './GitLsRemoteRefDiff.mjs'; +export { GitRefDiffType, } from './GitRefDiffType.mjs'; +export { GitRemoteRefsCmp, } from './GitRemoteRefsCmp.mjs'; +export { Logger, } from './Logger.mjs'; +export { gitRemoteRefsCmp, }; +async function gitRemoteRefsCmp(sourceRemote, targetRemote) { + const cmp = new GitRemoteRefsCmp(); + await cmp.init(); + return cmp.compare(sourceRemote, targetRemote); +} +//# sourceMappingURL=index.mjs.map \ No newline at end of file diff --git a/dist/index.mjs.map b/dist/index.mjs.map new file mode 100644 index 0000000..281e7e8 --- /dev/null +++ b/dist/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EACL,gBAAgB,GACjB,MAAM,wBAAwB,CAAA;AAG/B,OAAO,EACL,iBAAiB,GAClB,MAAM,yBAAyB,CAAA;AAIhC,OAAO,EACL,oBAAoB,GACrB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,iBAAiB,GAClB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAEL,uBAAuB,EACvB,+BAA+B,EAC/B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,0BAA0B,CAAA;AAIjC,OAAO,EACL,cAAc,GACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,gBAAgB,GACjB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,MAAM,GACP,MAAM,cAAc,CAAA;AAGrB,OAAO,EACL,gBAAgB,GACjB,CAAA;AAGD,KAAK,UAAU,gBAAgB,CAAC,YAAoB,EAAE,YAAoB;IACxE,MAAM,GAAG,GAAG,IAAI,gBAAgB,EAAE,CAAA;IAClC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAA;IAChB,OAAO,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA;AAChD,CAAC"} \ No newline at end of file diff --git a/dist/logger.d.ts b/dist/logger.d.ts deleted file mode 100644 index d2a0f09..0000000 --- a/dist/logger.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ -declare class Logger { - static logLevel: string; - static log(level: string, message: unknown): void; - static silly(message: unknown): void; - static trace(message: unknown): void; - static debug(message: unknown): void; - static info(message: unknown): void; - static warn(message: unknown): void; - static error(message: unknown): void; - static fatal(message: unknown): void; - static shouldLog(level: string): boolean; - static getColor(level: string): string; - static getEmoji(level: string): string; -} -export { Logger }; diff --git a/dist/logger.js b/dist/logger.js deleted file mode 100644 index 393a446..0000000 --- a/dist/logger.js +++ /dev/null @@ -1,68 +0,0 @@ -"use strict"; -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Logger = void 0; -class Logger { - static logLevel = process.env['RUNNER_DEBUG'] === '1' ? 'silly' : 'fatal'; - static log(level, message) { - if (Logger.shouldLog(level)) { - const isString = typeof message === 'string'; - console.log(`${Logger.getColor(level)}%s${Logger.getColor('')}`, `${Logger.getEmoji(level)} [${level.toUpperCase()}] ${isString ? message : ''}`, isString ? '' : message); - } - } - static silly(message) { - Logger.log('silly', message); - } - static trace(message) { - Logger.log('trace', message); - } - static debug(message) { - Logger.log('debug', message); - } - static info(message) { - Logger.log('info', message); - } - static warn(message) { - Logger.log('warn', message); - } - static error(message) { - Logger.log('error', message); - } - static fatal(message) { - Logger.log('fatal', message); - } - static shouldLog(level) { - const levels = ['silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal']; - return levels.indexOf(level) >= levels.indexOf(Logger.logLevel); - } - static getColor(level) { - switch (level) { - case 'silly': return '\x1b[35m'; // Magenta - case 'trace': return '\x1b[34m'; // Blue - case 'debug': return '\x1b[36m'; // Cyan - case 'info': return '\x1b[32m'; // Green - case 'warn': return '\x1b[33m'; // Yellow - case 'error': return '\x1b[31m'; // Red - case 'fatal': return '\x1b[41m'; // Red background - default: return '\x1b[0m'; // Reset - } - } - static getEmoji(level) { - switch (level) { - case 'silly': return 'ðŸĪŠ'; - case 'trace': return '🔍'; - case 'debug': return '🐛'; - case 'info': return 'â„đïļ '; - case 'warn': return '⚠ïļ '; - case 'error': return '❌'; - case 'fatal': return '💀'; - default: return ''; - } - } -} -exports.Logger = Logger; -//# sourceMappingURL=logger.js.map \ No newline at end of file diff --git a/dist/logger.js.map b/dist/logger.js.map deleted file mode 100644 index a287a52..0000000 --- a/dist/logger.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,MAAM,MAAM;IACR,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAA;IAEzE,MAAM,C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K,OAAO,CAAC,CAAC,OAAO,GAAG,CAAA;YACxB,KAAK,OAAO,CAAC,CAAC,OAAO,IAAI,CAAA;YACzB,OAAO,CAAC,CAAC,OAAO,EAAE,CAAA;QACpB,CAAC;IACH,CAAC;;AAGM,wBAAM"} \ No newline at end of file diff --git a/dist/main.d.ts b/dist/main.d.mts similarity index 100% rename from dist/main.d.ts rename to dist/main.d.mts diff --git a/dist/main.js b/dist/main.js deleted file mode 100644 index 36051aa..0000000 --- a/dist/main.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict"; -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ -Object.defineProperty(exports, "__esModule", { value: true }); -const GitCommandManager_1 = require("./GitCommandManager"); -const GitLsRemoteParser_1 = require("./GitLsRemoteParser"); -const GitLsRemoteOutputCmp_1 = require("./GitLsRemoteOutputCmp"); -const Logger_1 = require("./Logger"); -const GitRemoteRefMap_1 = require("./GitRemoteRefMap"); -if (require.main === module) { - (async () => { - Logger_1.Logger.logLevel = 'silly'; - const git = new GitCommandManager_1.GitCommandManager(); - await git.init(); - const parser = new GitLsRemoteParser_1.GitLsRemoteParser(); - const lsRemoteCmp = new GitLsRemoteOutputCmp_1.GitLsRemoteOutputCmp(); - // Smoke test real mirrored repository, should not differ - const sourceRemote = 'https://git.launchpad.net/beautifulsoup'; - const targetRemote = 'https://github.com/facsimiles/beautifulsoup.git'; - const [source, target] = await Promise.all([sourceRemote, targetRemote].map(async (remote) => parser.parse(await git.lsRemote({ remote }), remote))); - const diff = await lsRemoteCmp.compare(source, target); - if (diff) { - Logger_1.Logger.info('The repositories differ:'); - Logger_1.Logger.info(diff); - Logger_1.Logger.info(diff.type.toString()); - } - else { - Logger_1.Logger.info('The repositories are exact clones.'); - } - const runSmokeTest = async (testName, output1, output2) => { - Logger_1.Logger.silly(''.padStart(79, '-')); - Logger_1.Logger.warn(`Smoke test: ${testName}`); - const diff = await lsRemoteCmp.compare(output1, output2); - if (diff) { - Logger_1.Logger.info('The repositories differ:'); - Logger_1.Logger.info(diff); - Logger_1.Logger.info(diff.type.toString()); - } - else { - Logger_1.Logger.info('The repositories are exact clones.'); - } - }; - // REF_COUNT_MISMATCH - const oneRefOutput = { remote: 'one-ref-remote', refMap: new GitRemoteRefMap_1.GitRemoteRefMap([{ refname: 'one', oid: ''.padStart(40, '0') }]) }; - const twoRefOutput = { remote: 'two-ref-remote', refMap: new GitRemoteRefMap_1.GitRemoteRefMap([{ refname: 'one', oid: ''.padStart(40, '0') }, { refname: 'two', oid: ''.padStart(40, '0') }]) }; - await runSmokeTest('REF_COUNT_MISMATCH', oneRefOutput, twoRefOutput); - // ZERO_REFS - const emptyOutput = { remote: 'empty-remote', refMap: new GitRemoteRefMap_1.GitRemoteRefMap() }; - await runSmokeTest('ZERO_REFS', emptyOutput, emptyOutput); - // REF_NOT_FOUND - const fooOutput = { remote: 'foo-remote', refMap: new GitRemoteRefMap_1.GitRemoteRefMap([{ refname: 'foo', oid: ''.padStart(40, '0') }]) }; - const barOutput = { remote: 'bar-remote', refMap: new GitRemoteRefMap_1.GitRemoteRefMap([{ refname: 'bar', oid: ''.padStart(40, '0') }]) }; - await runSmokeTest('REF_NOT_FOUND', fooOutput, barOutput); - // OID_MISMATCH - const fooZeroOutput = { remote: 'foo-zero-remote', refMap: new GitRemoteRefMap_1.GitRemoteRefMap([{ refname: 'foo', oid: ''.padStart(40, '0') }]) }; - const fooOneOutput = { remote: 'foo-one-remote', refMap: new GitRemoteRefMap_1.GitRemoteRefMap([{ refname: 'foo', oid: ''.padStart(40, '1') }]) }; - await runSmokeTest('OID_MISMATCH', fooZeroOutput, fooOneOutput); - })(); -} -//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/dist/main.js.map b/dist/main.js.map deleted file mode 100644 index 88311c6..0000000 --- a/dist/main.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.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git a/dist/main.mjs b/dist/main.mjs new file mode 100644 index 0000000..a6dcd19 --- /dev/null +++ b/dist/main.mjs @@ -0,0 +1,68 @@ +/** + * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal + * + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only + */ +import { GitCommandManager, } from './GitCommandManager.mjs'; +import { GitLsRemoteParser, } from './GitLsRemoteParser.mjs'; +import { GitLsRemoteOutputCmp, } from './GitLsRemoteOutputCmp.mjs'; +// import { +// Logger as libLogger, +// LogLevel, +// } from './Logger.mjs' +import { GitRemoteRefMap, } from './GitRemoteRefMap.mjs'; +// import { Logger as TsLogger } from 'tslog' +// if (require.main === module) { +(async () => { + // libLogger.settings.minLevel = LogLevel.Silly + // const logger = new TsLogger({name: "main", minLevel: LogLevel.Silly}) + const logger = console; + // Logger.logLevel = 'silly' + const git = new GitCommandManager(); + await git.init(); + const parser = new GitLsRemoteParser(); + const lsRemoteCmp = new GitLsRemoteOutputCmp(); + // Smoke test real mirrored repository, should not differ + const sourceRemote = 'https://git.launchpad.net/beautifulsoup'; + const targetRemote = 'https://github.com/facsimiles/beautifulsoup.git'; + const [source, target] = await Promise.all([sourceRemote, targetRemote].map(async (remote) => parser.parse(await git.lsRemote({ remote }), remote))); + const diff = await lsRemoteCmp.compare(source, target); + if (diff) { + logger.info('The repositories differ:'); + logger.info(diff); + logger.info(diff.type.toString()); + } + else { + logger.info('The repositories are exact clones.'); + } + const runSmokeTest = async (testName, output1, output2) => { + logger.debug(''.padStart(79, '-')); + logger.warn(`Smoke test: ${testName}`); + const diff = await lsRemoteCmp.compare(output1, output2); + if (diff) { + logger.info('The repositories differ:'); + logger.info(diff); + logger.info(diff.type.toString()); + } + else { + logger.info('The repositories are exact clones.'); + } + }; + // REF_COUNT_MISMATCH + const oneRefOutput = { remote: 'one-ref-remote', refMap: new GitRemoteRefMap([{ refname: 'one', oid: ''.padStart(40, '0') }]) }; + const twoRefOutput = { remote: 'two-ref-remote', refMap: new GitRemoteRefMap([{ refname: 'one', oid: ''.padStart(40, '0') }, { refname: 'two', oid: ''.padStart(40, '0') }]) }; + await runSmokeTest('REF_COUNT_MISMATCH', oneRefOutput, twoRefOutput); + // ZERO_REFS + const emptyOutput = { remote: 'empty-remote', refMap: new GitRemoteRefMap() }; + await runSmokeTest('ZERO_REFS', emptyOutput, emptyOutput); + // REF_NOT_FOUND + const fooOutput = { remote: 'foo-remote', refMap: new GitRemoteRefMap([{ refname: 'foo', oid: ''.padStart(40, '0') }]) }; + const barOutput = { remote: 'bar-remote', refMap: new GitRemoteRefMap([{ refname: 'bar', oid: ''.padStart(40, '0') }]) }; + await runSmokeTest('REF_NOT_FOUND', fooOutput, barOutput); + // OID_MISMATCH + const fooZeroOutput = { remote: 'foo-zero-remote', refMap: new GitRemoteRefMap([{ refname: 'foo', oid: ''.padStart(40, '0') }]) }; + const fooOneOutput = { remote: 'foo-one-remote', refMap: new GitRemoteRefMap([{ refname: 'foo', oid: ''.padStart(40, '1') }]) }; + await runSmokeTest('OID_MISMATCH', fooZeroOutput, fooOneOutput); +})(); +// } +//# sourceMappingURL=main.mjs.map \ No newline at end of file diff --git a/dist/main.mjs.map b/dist/main.mjs.map new file mode 100644 index 0000000..55cd58b --- /dev/null +++ b/dist/main.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"main.mjs","sourceRoot":"","sources":["../src/main.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,iBAAiB,GAClB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,iBAAiB,GAClB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,oBAAoB,GACrB,MAAM,4BAA4B,CAAA;AAInC,WAAW;AACT,uBAAuB;AACvB,YAAY;AACd,wBAAwB;AACxB,OAAO,EACL,eAAe,GAChB,MAAM,uBAAuB,CAAA;AAE9B,6CAA6C;AAG7C,iCAAiC;AAC/B,CAAC,KAAK,IAAI,EAAE;IACV,+CAA+C;IAC/C,wEAAwE;IAC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,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAA;IAC3I,MAAM,SAAS,GAAsB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAA;IAC3I,MAAM,YAAY,CAAC,eAAe,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;IAEzD,eAAe;IACf,MAAM,aAAa,GAAsB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,IAAI,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAA;IACpJ,MAAM,YAAY,GAAsB,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAA;IAClJ,MAAM,YAAY,CAAC,cAAc,EAAE,aAAa,EAAE,YAAY,CAAC,CAAA;AACjE,CAAC,CAAC,EAAE,CAAA;AACN,IAAI"} \ No newline at end of file diff --git a/dist/repo.d.ts b/dist/repo.d.ts deleted file mode 100644 index 1aa48ef..0000000 --- a/dist/repo.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ -export interface Ref { - name: string; - hash: string; -} -export declare class RefDiff { - type: string; - sourceRepo: Repo; - targetRepo: Repo; - sourceRef?: Ref; - targetRef?: Ref; - constructor(init: { - sourceRepo: Repo; - targetRepo: Repo; - sourceRef?: Ref; - targetRef?: Ref; - }); - getMessage(): Promise; -} -export declare class ZeroRefs extends RefDiff { - type: string; - getMessage(): Promise; -} -export declare class RefCountMismatch extends RefDiff { - type: string; - getMessage(): Promise; -} -export declare class RefNotFound extends RefDiff { - type: string; - getMessage(): Promise; -} -export declare class HashMismatch extends RefDiff { - type: string; - getMessage(): Promise; -} -export declare class Repo { - url: string; - private _refs?; - private _refNameIndex?; - private _refHashIndex?; - constructor(repoUrl: string); - getRefs(): Promise; - fetchRefs(): Promise; - _buildRefIndexes(): Promise; - getRefByName(name: string): Promise; - getRefByHash(hash: string): Promise; - refsDiffer(targetRepo: Repo): Promise; -} diff --git a/dist/repo.js b/dist/repo.js deleted file mode 100644 index f5ea860..0000000 --- a/dist/repo.js +++ /dev/null @@ -1,201 +0,0 @@ -"use strict"; -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Repo = exports.HashMismatch = exports.RefNotFound = exports.RefCountMismatch = exports.ZeroRefs = exports.RefDiff = void 0; -const logger_1 = require("./logger"); -const child_process_1 = require("child_process"); -class RefDiff { - type = 'NO_TYPE'; - sourceRepo; - targetRepo; - sourceRef; - targetRef; - constructor(init) { - this.sourceRepo = init.sourceRepo; - this.targetRepo = init.targetRepo; - this.sourceRef = init.sourceRef; - this.targetRef = init.targetRef; - } - getMessage() { throw new Error("Method not implemented."); } -} -exports.RefDiff = RefDiff; -class ZeroRefs extends RefDiff { - type = 'ZERO_REFS'; - async getMessage() { - const srcUrl = this.sourceRepo.url; - const dstUrl = this.targetRepo.url; - const srcRefsLen = (await this.sourceRepo.getRefs()).length; - const dstRefsLen = (await this.targetRepo.getRefs()).length; - return `Zero refs: \`${srcUrl}\` has \`${srcRefsLen}\` refs, \`${dstUrl}\` has \`${dstRefsLen}\` refs.`; - } -} -exports.ZeroRefs = ZeroRefs; -class RefCountMismatch extends RefDiff { - type = 'REF_COUNT_MISMATCH'; - async getMessage() { - const srcUrl = this.sourceRepo.url; - const dstUrl = this.targetRepo.url; - const srcRefsLen = (await this.sourceRepo.getRefs()).length; - const dstRefsLen = (await this.targetRepo.getRefs()).length; - return `Ref count mismatch: \`${srcUrl}\` has \`${srcRefsLen}\` refs, \`${dstUrl}\` has \`${dstRefsLen}\` refs.`; - } -} -exports.RefCountMismatch = RefCountMismatch; -class RefNotFound extends RefDiff { - type = 'REF_NOT_FOUND'; - async getMessage() { - if (!this.sourceRef) { - throw new Error('sourceRef is not initialized'); - } - return `Ref not found: \`${this.sourceRef.name}\` is missing in \`${this.targetRepo.url}\`.`; - } -} -exports.RefNotFound = RefNotFound; -class HashMismatch extends RefDiff { - type = 'HASH_MISMATCH'; - async getMessage() { - const srcRef = this.sourceRef; - const dstRef = this.targetRef; - if (!srcRef || !dstRef) { - throw new Error('sourceRef or targetRef is not initialized'); - } - return `Hash mismatch for ref \`${srcRef.name}\`: source repo has \`${srcRef.hash}\`, target repo has \`${dstRef.hash}\`.`; - } -} -exports.HashMismatch = HashMismatch; -class Repo { - url; - _refs; - _refNameIndex; - _refHashIndex; - constructor(repoUrl) { - this.url = repoUrl; - logger_1.Logger.info(`GitLsRemote.Repo instance created for \`${repoUrl}\``); - } - async getRefs() { - if (this._refs) { - logger_1.Logger.debug(`Returning cached refs for \`${this.url}\``); - return this._refs; - } - else { - logger_1.Logger.debug(`Fetching refs for \`${this.url}\``); - return await this.fetchRefs(); - } - } - async fetchRefs() { - logger_1.Logger.trace(`fetchRefs() called for \`${this.url}\``); - const result = await new Promise((resolve, reject) => { - if (!this.url.startsWith("https://")) { - const errorMsg = `URL doesn't start with https://: \`${this.url}\``; - logger_1.Logger.error(errorMsg); - throw new Error(errorMsg); - } - logger_1.Logger.debug(`Executing \`git ls-remote\` for \`${this.url}\``); - (0, child_process_1.execFile)('git', ['ls-remote', '--quiet', '--exit-code', '--', this.url], {}, (error, stdout /*, stderr*/) => { - if (error) { - logger_1.Logger.error(`Error fetching refs for \`${this.url}\`: \`${error.message}\``); - reject(error); - } - else { - logger_1.Logger.info(`Successfully fetched refs for \`${this.url}\``); - resolve(stdout); - } - }); - }); - const refs = result.split('\n') - .filter(line => line) - .map(line => { - const [hash, name] = line.split('\t'); - logger_1.Logger.silly(`Parsed ref: \`${name}\` with hash: \`${hash}\` from \`${this.url}\``); - return { name, hash }; - }); - this._refs = refs; - logger_1.Logger.debug(`Fetched \`${refs.length}\` refs for \`${this.url}\``); - return refs; - } - async _buildRefIndexes() { - logger_1.Logger.trace(`GitLsRemote.Repo._buildRefIndexes() called for \`${this.url}\``); - if (!this._refs) { - logger_1.Logger.debug(`No cached refs found, fetching refs for \`${this.url}\``); - await this.fetchRefs(); - } - this._refNameIndex = new Map(); - this._refHashIndex = new Map(); - for (const ref of this._refs) { - this._refNameIndex.set(ref.name, ref); - this._refHashIndex.set(ref.hash, ref); - logger_1.Logger.silly(`Indexed ref: \`${ref.name}\` with hash: \`${ref.hash}\``); - } - logger_1.Logger.info(`Built ref indexes for \`${this.url}\``); - } - async getRefByName(name) { - logger_1.Logger.trace(`getRefByName() called with name: \`${name}\``); - if (!this._refNameIndex) { - logger_1.Logger.debug(`Ref name index not built, building now for \`${this.url}\``); - await this._buildRefIndexes(); - } - const ref = this._refNameIndex.get(name); - if (ref) { - logger_1.Logger.info(`Found ref \`${ref.hash}\` by name \`${name}\` in \`${this.url}\``); - } - else { - logger_1.Logger.warn(`No ref found with name \`${name}\` in \`${this.url}\``); - } - return ref; - } - async getRefByHash(hash) { - logger_1.Logger.trace(`getRefByHash() called with hash: \`${hash}\``); - if (!this._refHashIndex) { - logger_1.Logger.debug(`Ref hash index not built, building now for \`${this.url}\``); - await this._buildRefIndexes(); - } - const ref = this._refHashIndex.get(hash); - if (ref) { - logger_1.Logger.info(`Found ref \`${ref.name}\` by hash: \`${hash}\` in \`${this.url}\``); - } - else { - logger_1.Logger.warn(`No ref found with hash: \`${hash}\` in \`${this.url}\``); - } - return ref; - } - async refsDiffer(targetRepo) { - // eslint-disable-next-line @typescript-eslint/no-this-alias - const sourceRepo = this; - logger_1.Logger.trace(`refsDiffer() called between \`${sourceRepo.url}\` and \`${targetRepo.url}\``); - const [sourceRefs, targetRefs] = await Promise.all([ - sourceRepo.getRefs(), - targetRepo.getRefs(), - ]); - if (sourceRefs.length === 0 || targetRefs.length === 0) { - const refDiff = new ZeroRefs({ sourceRepo, targetRepo }); - logger_1.Logger.error(await refDiff.getMessage()); - return refDiff; - } - if (sourceRefs.length !== targetRefs.length) { - const refDiff = new RefCountMismatch({ sourceRepo, targetRepo }); - logger_1.Logger.warn(await refDiff.getMessage()); - return refDiff; - } - for (const sourceRef of sourceRefs) { - const targetRef = await targetRepo.getRefByName(sourceRef.name); - if (!targetRef) { - const refDiff = new RefNotFound({ sourceRepo, targetRepo, sourceRef }); - logger_1.Logger.warn(await refDiff.getMessage()); - return refDiff; - } - if (sourceRef.hash !== targetRef.hash) { - const refDiff = new HashMismatch({ sourceRepo, targetRepo, sourceRef, targetRef }); - logger_1.Logger.warn(await refDiff.getMessage()); - return refDiff; - } - } - logger_1.Logger.info(`No differences found between \`${sourceRepo.url}\` and \`${targetRepo.url}\``); - return null; - } -} -exports.Repo = Repo; -//# sourceMappingURL=repo.js.map \ No newline at end of file diff --git a/dist/repo.js.map b/dist/repo.js.map deleted file mode 100644 index b9e5348..0000000 --- a/dist/repo.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"repo.js","sourceRoot":"","sources":["../src/repo.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,qCAAiC;AAEjC,iDAAwC;AAQxC,MAAa,OAAO;IAClB,IAAI,GAAW,SAAS,CAAA;IACxB,UAAU,CAAM;IAChB,UAAU,CAAM;IAChB,S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,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YAC/D,IAAK,CAAE,SAAS,EAAG,CAAC;gBAClB,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,EAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC,CAAC,CAAA;gBACpE,eAAM,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;gBACvC,OAAO,OAAO,CAAA;YAChB,CAAC;YACD,IAAK,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,EAAG,CAAC;gBACxC,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,EAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAC,CAAC,CAAA;gBAChF,eAAM,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;gBACvC,OAAO,OAAO,CAAA;YAChB,CAAC;QACH,CAAC;QACD,eAAM,CAAC,IAAI,CAAC,kCAAkC,UAAU,CAAC,GAAG,YAAY,UAAU,CAAC,GAAG,IAAI,CAAC,CAAA;QAC3F,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAvID,oBAuIC"} \ No newline at end of file diff --git a/src/GitCommand.ts b/src/GitCommand.mts similarity index 97% rename from src/GitCommand.ts rename to src/GitCommand.mts index 201f8f6..576a8d3 100644 --- a/src/GitCommand.ts +++ b/src/GitCommand.mts @@ -10,7 +10,7 @@ import { } from 'child_process' import { Logger -} from './Logger' +} from './Logger.mjs' export { diff --git a/src/GitCommandManager.ts b/src/GitCommandManager.mts similarity index 91% rename from src/GitCommandManager.ts rename to src/GitCommandManager.mts index 2ff1bec..39d10a5 100644 --- a/src/GitCommandManager.ts +++ b/src/GitCommandManager.mts @@ -6,13 +6,13 @@ import { which, -} from './Utils' +} from './Utils.mjs' import { GitVersionCommand, -} from './GitCommands/Version' +} from './GitCommands/Version.mjs' import { GitLsRemoteCommand, -} from './GitCommands/LsRemote' +} from './GitCommands/LsRemote.mjs' export { diff --git a/src/GitCommands/LsRemote.ts b/src/GitCommands/LsRemote.mts similarity index 97% rename from src/GitCommands/LsRemote.ts rename to src/GitCommands/LsRemote.mts index 28e23ec..b10ac06 100644 --- a/src/GitCommands/LsRemote.ts +++ b/src/GitCommands/LsRemote.mts @@ -6,7 +6,7 @@ import { GitCommand, -} from '../GitCommand' +} from '../GitCommand.mjs' export { diff --git a/src/GitCommands/Version.ts b/src/GitCommands/Version.mts similarity index 93% rename from src/GitCommands/Version.ts rename to src/GitCommands/Version.mts index b2c0096..48bd74f 100644 --- a/src/GitCommands/Version.ts +++ b/src/GitCommands/Version.mts @@ -6,10 +6,10 @@ import { GitCommand, -} from '../GitCommand' +} from '../GitCommand.mjs' import { Logger, -} from '../Logger' +} from '../Logger.mjs' export { diff --git a/src/GitLsRemoteOutput.ts b/src/GitLsRemoteOutput.mts similarity index 95% rename from src/GitLsRemoteOutput.ts rename to src/GitLsRemoteOutput.mts index b79f71d..d878f62 100644 --- a/src/GitLsRemoteOutput.ts +++ b/src/GitLsRemoteOutput.mts @@ -6,7 +6,7 @@ import { GitRemoteRefMap, -} from './GitRemoteRefMap' +} from './GitRemoteRefMap.mjs' export { diff --git a/src/GitLsRemoteOutputCmp.ts b/src/GitLsRemoteOutputCmp.mts similarity index 94% rename from src/GitLsRemoteOutputCmp.ts rename to src/GitLsRemoteOutputCmp.mts index 6ead66b..0fc3a73 100644 --- a/src/GitLsRemoteOutputCmp.ts +++ b/src/GitLsRemoteOutputCmp.mts @@ -6,17 +6,17 @@ import { Logger, -} from './Logger' +} from './Logger.mjs' import { GitLsRemoteOutput, -} from './GitLsRemoteOutput' +} from './GitLsRemoteOutput.mjs' import { GitLsRemoteRefDiff, GitLsRemoteZeroRefsDiff, GitLsRemoteRefCountMismatchDiff, GitLsRemoteRefNotFoundDiff, GitLsRemoteOidMismatchDiff, -} from './GitLsRemoteRefDiff' +} from './GitLsRemoteRefDiff.mjs' export { diff --git a/src/GitLsRemoteParser.ts b/src/GitLsRemoteParser.mts similarity index 91% rename from src/GitLsRemoteParser.ts rename to src/GitLsRemoteParser.mts index ef842e6..6656bd0 100644 --- a/src/GitLsRemoteParser.ts +++ b/src/GitLsRemoteParser.mts @@ -6,17 +6,17 @@ import { Logger, -} from './Logger' +} from './Logger.mjs' import { GitRemoteRef, SimpleGitRemoteRef, -} from './GitRemoteRef' +} from './GitRemoteRef.mjs' import { GitRemoteRefMap -} from './GitRemoteRefMap' +} from './GitRemoteRefMap.mjs' import { GitLsRemoteOutput, -} from './GitLsRemoteOutput' +} from './GitLsRemoteOutput.mjs' export { @@ -63,7 +63,7 @@ class GitLsRemoteParser { Logger.error(remote ? `${err} Remote: \`${remote}\`` : err) throw err } - Logger.silly(`Parsed ref: \`${ref.refname}\` with oid: \`${ref.oid}\``) + Logger.debug(`Parsed ref: \`${ref.refname}\` with oid: \`${ref.oid}\``) refMap.setRef(ref) } diff --git a/src/GitLsRemoteRefDiff.ts b/src/GitLsRemoteRefDiff.mts similarity index 96% rename from src/GitLsRemoteRefDiff.ts rename to src/GitLsRemoteRefDiff.mts index 9c4fcab..417a13f 100644 --- a/src/GitLsRemoteRefDiff.ts +++ b/src/GitLsRemoteRefDiff.mts @@ -6,17 +6,17 @@ import { GitLsRemoteOutput, -} from './GitLsRemoteOutput' +} from './GitLsRemoteOutput.mjs' import { GitRefDiff, GitRefDiffBase, -} from './GitRefDiff' +} from './GitRefDiff.mjs' import { GitRefDiffType, -} from './GitRefDiffType' +} from './GitRefDiffType.mjs' import { GitRemoteRef, -} from './GitRemoteRef' +} from './GitRemoteRef.mjs' export { diff --git a/src/GitRefDiff.ts b/src/GitRefDiff.mts similarity index 92% rename from src/GitRefDiff.ts rename to src/GitRefDiff.mts index 958247d..db23b52 100644 --- a/src/GitRefDiff.ts +++ b/src/GitRefDiff.mts @@ -6,13 +6,13 @@ import { GitRemoteRef, -} from './GitRemoteRef' +} from './GitRemoteRef.mjs' import { GitRemoteRefMap, -} from './GitRemoteRefMap' +} from './GitRemoteRefMap.mjs' import { GitRefDiffType, -} from './GitRefDiffType' +} from './GitRefDiffType.mjs' export { diff --git a/src/GitRefDiffType.ts b/src/GitRefDiffType.mts similarity index 100% rename from src/GitRefDiffType.ts rename to src/GitRefDiffType.mts diff --git a/src/GitRemoteRef.ts b/src/GitRemoteRef.mts similarity index 100% rename from src/GitRemoteRef.ts rename to src/GitRemoteRef.mts diff --git a/src/GitRemoteRefMap.ts b/src/GitRemoteRefMap.mts similarity index 98% rename from src/GitRemoteRefMap.ts rename to src/GitRemoteRefMap.mts index ba89ea2..fef9a41 100644 --- a/src/GitRemoteRefMap.ts +++ b/src/GitRemoteRefMap.mts @@ -6,7 +6,7 @@ import { GitRemoteRef, -} from './GitRemoteRef' +} from './GitRemoteRef.mjs' export { diff --git a/src/GitRemoteRefsCmp.ts b/src/GitRemoteRefsCmp.mts similarity index 88% rename from src/GitRemoteRefsCmp.ts rename to src/GitRemoteRefsCmp.mts index e6214de..e64effc 100644 --- a/src/GitRemoteRefsCmp.ts +++ b/src/GitRemoteRefsCmp.mts @@ -6,19 +6,19 @@ import { GitCommandManager, -} from './GitCommandManager' +} from './GitCommandManager.mjs' import { GitLsRemoteParser, -} from './GitLsRemoteParser' +} from './GitLsRemoteParser.mjs' import { GitLsRemoteOutputCmp, -} from './GitLsRemoteOutputCmp' +} from './GitLsRemoteOutputCmp.mjs' import { GitLsRemoteOutput, -} from './GitLsRemoteOutput' +} from './GitLsRemoteOutput.mjs' import { GitLsRemoteRefDiff, -} from './GitLsRemoteRefDiff' +} from './GitLsRemoteRefDiff.mjs' export { diff --git a/src/Logger.mts b/src/Logger.mts new file mode 100644 index 0000000..181ae33 --- /dev/null +++ b/src/Logger.mts @@ -0,0 +1,31 @@ +/** + * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal + * + * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only + */ + +// import { Logger as TsLogger } from 'tslog' + +// Define the enum for log levels +// enum LogLevel { +// Silly = 0, +// Trace = 1, +// Debug = 2, +// Info = 3, +// Warn = 4, +// Error = 5, +// Fatal = 6 +// } + +// Create the logger instance using the enum +// const Logger = new TsLogger({ +// name: '@foo/bar', +// minLevel: process.env['RUNNER_DEBUG'] === '1' ? LogLevel.Silly : LogLevel.Fatal +// }) + +const Logger = console + +export { + Logger, + // LogLevel, +} diff --git a/src/Logger.ts b/src/Logger.ts deleted file mode 100644 index ad243b6..0000000 --- a/src/Logger.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2024 Jan Chren ~rindeal - * - * SPDX-License-Identifier: GPL-3.0-only OR GPL-2.0-only - */ - -export { - Logger, -} - -// Logger.silly(), Logger.trace(), Logger.debug(), Logger.info(), Logger.warn(), Logger.error(), Logger.fatal() - -class Logger { - public static logLevel = process.env['RUNNER_DEBUG'] === '1' ? 'silly' : 'fatal' - - public static log(level: string, message: unknown) { - if ( ! Logger.shouldLog(level) ) return - - const color = Logger.getColor(level) - const emoji = Logger.getEmoji(level) - const levelStr = `[${level.toUpperCase()}]` - const isString = typeof message === 'string' - - const logFunction = ['error', 'fatal'].includes(level) ? console.error : console.log - logFunction(`${color}${emoji} ${levelStr} %s${Logger.getColor('')}`, isString ? message : '', isString ? '' : message) - } - - public static silly(message: unknown) { - Logger.log('silly', message) - } - - public static trace(message: unknown) { - Logger.log('trace', message) - } - - public static debug(message: unknown) { - Logger.log('debug', message) - } - - public static info(message: unknown) { - Logger.log('info', message) - } - - public static warn(message: unknown) { - Logger.log('warn', message) - } - - public static error(message: unknown) { - Logger.log('error', message) - } - - public static fatal(message: unknown) { - Logger.log('fatal', message) - } - - public static shouldLog(level: string): boolean { - const levels = ['silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'] - return levels.indexOf(level) >= levels.indexOf(Logger.logLevel) - } - - public static getColor(level: string): string { - switch (level) { - case 'silly': return '\x1b[35m' // Magenta - case 'trace': return '\x1b[34m' // Blue - case 'debug': return '\x1b[36m' // Cyan - case 'info': return '\x1b[32m' // Green - case 'warn': return '\x1b[33m' // Yellow - case 'error': return '\x1b[31m' // Red - case 'fatal': return '\x1b[41m' // Red background - default: return '\x1b[0m' // Reset - } - } - - public static getEmoji(level: string): string { - switch (level) { - case 'silly': return 'ðŸĪŠ' - case 'trace': return '🔍' - case 'debug': return '🐛' - case 'info': return 'â„đïļ ' - case 'warn': return '⚠ïļ ' - case 'error': return '❌' - case 'fatal': return '💀' - default: return '' - } - } -} diff --git a/src/Utils.ts b/src/Utils.mts similarity index 100% rename from src/Utils.ts rename to src/Utils.mts diff --git a/src/index.ts b/src/index.mts similarity index 63% rename from src/index.ts rename to src/index.mts index ebe82aa..b169025 100644 --- a/src/index.ts +++ b/src/index.mts @@ -6,43 +6,43 @@ import { GitLsRemoteRefDiff, -} from './GitLsRemoteRefDiff' +} from './GitLsRemoteRefDiff.mjs' import { GitRemoteRefsCmp, -} from './GitRemoteRefsCmp' +} from './GitRemoteRefsCmp.mjs' -export type { +export { GitCommandManager, -} from './GitCommandManager' -export type { +} from './GitCommandManager.mjs' +export { GitLsRemoteOutput, -} from './GitLsRemoteOutput' -export type { +} from './GitLsRemoteOutput.mjs' +export { GitLsRemoteOutputCmp, -} from './GitLsRemoteOutputCmp' -export type { +} from './GitLsRemoteOutputCmp.mjs' +export { GitLsRemoteParser, -} from './GitLsRemoteParser' -export type { +} from './GitLsRemoteParser.mjs' +export { GitLsRemoteRefDiff, GitLsRemoteZeroRefsDiff, GitLsRemoteRefCountMismatchDiff, GitLsRemoteRefNotFoundDiff, GitLsRemoteOidMismatchDiff, -} from './GitLsRemoteRefDiff' -export type { +} from './GitLsRemoteRefDiff.mjs' +export { GitRefDiff, -} from './GitRefDiff' -export type { +} from './GitRefDiff.mjs' +export { GitRefDiffType, -} from './GitRefDiffType' -export type { +} from './GitRefDiffType.mjs' +export { GitRemoteRefsCmp, -} from './GitRemoteRefsCmp' -export type { +} from './GitRemoteRefsCmp.mjs' +export { Logger, -} from './Logger' +} from './Logger.mjs' export { diff --git a/src/main.ts b/src/main.mts similarity index 72% rename from src/main.ts rename to src/main.mts index 6098851..6586fa6 100644 --- a/src/main.ts +++ b/src/main.mts @@ -6,25 +6,33 @@ import { GitCommandManager, -} from './GitCommandManager' +} from './GitCommandManager.mjs' import { GitLsRemoteParser, -} from './GitLsRemoteParser' +} from './GitLsRemoteParser.mjs' import { GitLsRemoteOutputCmp, -} from './GitLsRemoteOutputCmp' +} from './GitLsRemoteOutputCmp.mjs' import { GitLsRemoteOutput, -} from './GitLsRemoteOutput' +} from './GitLsRemoteOutput.mjs' +// import { + // Logger as libLogger, + // LogLevel, +// } from './Logger.mjs' import { - Logger, -} from './Logger' -import { GitRemoteRefMap } from './GitRemoteRefMap' + GitRemoteRefMap, +} from './GitRemoteRefMap.mjs' +// import { Logger as TsLogger } from 'tslog' -if (require.main === module) { + +// if (require.main === module) { (async () => { - Logger.logLevel = 'silly' + // libLogger.settings.minLevel = LogLevel.Silly + // const logger = new TsLogger({name: "main", minLevel: LogLevel.Silly}) + const logger = console + // Logger.logLevel = 'silly' const git = new GitCommandManager() await git.init() @@ -44,23 +52,23 @@ if (require.main === module) { const diff = await lsRemoteCmp.compare(source, target) if (diff) { - Logger.info('The repositories differ:') - Logger.info(diff) - Logger.info(diff.type.toString()) + logger.info('The repositories differ:') + logger.info(diff) + logger.info(diff.type.toString()) } else { - Logger.info('The repositories are exact clones.') + logger.info('The repositories are exact clones.') } const runSmokeTest = async (testName: string, output1: GitLsRemoteOutput, output2: GitLsRemoteOutput) => { - Logger.silly(''.padStart(79, '-')) - Logger.warn(`Smoke test: ${testName}`) + logger.debug(''.padStart(79, '-')) + logger.warn(`Smoke test: ${testName}`) const diff = await lsRemoteCmp.compare(output1, output2) if (diff) { - Logger.info('The repositories differ:') - Logger.info(diff) - Logger.info(diff.type.toString()) + logger.info('The repositories differ:') + logger.info(diff) + logger.info(diff.type.toString()) } else { - Logger.info('The repositories are exact clones.') + logger.info('The repositories are exact clones.') } } @@ -83,4 +91,4 @@ if (require.main === module) { const fooOneOutput: GitLsRemoteOutput = { remote: 'foo-one-remote', refMap: new GitRemoteRefMap([{ refname: 'foo', oid: ''.padStart(40, '1') }]) } await runSmokeTest('OID_MISMATCH', fooZeroOutput, fooOneOutput) })() -} +// } diff --git a/tsconfig.json b/tsconfig.json index 86f0a99..ed47f53 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,26 @@ { "extends": "@tsconfig/node20/tsconfig.json", "compilerOptions": { - "declaration": true, - "sourceMap": true, "alwaysStrict": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": false, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "./dist", "pretty": true, - "outDir": "./dist" + "resolveJsonModule": true, + "sourceMap": true }, - "include": ["src/**/*.ts"], - "exclude": ["node_modules", "**/*.test.ts"] + "include": [ + "src/**/*.ts", + "src/**/*.mts" + ], + "exclude": [ + "node_modules", + "**/__tests__", + "**/*.test.ts" + ] }