@dragonshorn-studios/elyseum-cli 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/command.d.ts.map +1 -1
- package/dist/commands/coverage-command.d.ts.map +1 -1
- package/dist/commands/diff-coverage-command.d.ts.map +1 -1
- package/dist/index.js +46 -6
- package/dist/index.js.map +1 -1
- package/dist/utils/logger.d.ts +7 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/commands/command.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/commands/command.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,MAAM,WAAW,OAAO;IACtB,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,qBAAa,cAAc;IACzB,QAAQ,EAAE,UAAU,CAAM;;IAO1B,UAAU,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,GAAG,SAAS;IAU1C,oBAAoB;IASpB,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI;CAiBjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage-command.d.ts","sourceRoot":"","sources":["../../src/commands/coverage-command.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEhD,qBAAa,eAAgB,YAAW,OAAO;IAC7C,IAAI,EAAE,MAAM,CAAc;gBACd,QAAQ,EAAE,UAAU;IAInB,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;YAoB5B,iBAAiB;
|
|
1
|
+
{"version":3,"file":"coverage-command.d.ts","sourceRoot":"","sources":["../../src/commands/coverage-command.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEhD,qBAAa,eAAgB,YAAW,OAAO;IAC7C,IAAI,EAAE,MAAM,CAAc;gBACd,QAAQ,EAAE,UAAU;IAInB,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;YAoB5B,iBAAiB;YA8DjB,iBAAiB;CAWhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-coverage-command.d.ts","sourceRoot":"","sources":["../../src/commands/diff-coverage-command.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAChD,OAAe,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"diff-coverage-command.d.ts","sourceRoot":"","sources":["../../src/commands/diff-coverage-command.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAChD,OAAe,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGjD,qBAAa,mBAAoB,YAAW,OAAO;IACjD,IAAI,EAAE,MAAM,CAAmB;IAC/B,MAAM,CAAC,EAAE,YAAY,CAmBnB;gBACU,QAAQ,EAAE,UAAU;IAInB,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;YAuE5B,qBAAqB;YAuIrB,iBAAiB;YAYjB,eAAe;CA4E9B"}
|
package/dist/index.js
CHANGED
|
@@ -9964,12 +9964,12 @@ class GithubPRCommentCoverageReporter {
|
|
|
9964
9964
|
this.config = {
|
|
9965
9965
|
"comment-file-path": {
|
|
9966
9966
|
help: "The file path to write the coverage report to",
|
|
9967
|
-
type: "
|
|
9967
|
+
type: "str",
|
|
9968
9968
|
default: "coverage/github.pr.coverage.md",
|
|
9969
9969
|
},
|
|
9970
9970
|
"comment-name": {
|
|
9971
9971
|
help: "The name of the comment",
|
|
9972
|
-
type: "
|
|
9972
|
+
type: "str",
|
|
9973
9973
|
default: "coverage/github.pr.coverage.md",
|
|
9974
9974
|
},
|
|
9975
9975
|
"quality-gate": {
|
|
@@ -10228,6 +10228,8 @@ class CoverageCommand {
|
|
|
10228
10228
|
}
|
|
10229
10229
|
async calculateCoverage(coverage) {
|
|
10230
10230
|
const coverageResult = {
|
|
10231
|
+
headSha: "",
|
|
10232
|
+
baseSha: "",
|
|
10231
10233
|
lines: {
|
|
10232
10234
|
total: 0,
|
|
10233
10235
|
covered: 0,
|
|
@@ -39112,22 +39114,43 @@ function getCoverageExcludes(configDir) {
|
|
|
39112
39114
|
return excludes;
|
|
39113
39115
|
}
|
|
39114
39116
|
|
|
39117
|
+
class Logger {
|
|
39118
|
+
static debug(message) {
|
|
39119
|
+
console.debug(`[DEBUG] ${message}`);
|
|
39120
|
+
}
|
|
39121
|
+
static info(message) {
|
|
39122
|
+
console.info(`[INFO] ${message}`);
|
|
39123
|
+
}
|
|
39124
|
+
static warn(message) {
|
|
39125
|
+
console.warn(`[WARN] ${message}`);
|
|
39126
|
+
}
|
|
39127
|
+
static error(message) {
|
|
39128
|
+
console.error(`[ERROR] ${message}`);
|
|
39129
|
+
}
|
|
39130
|
+
}
|
|
39131
|
+
|
|
39115
39132
|
class DiffCoverageCommand {
|
|
39116
39133
|
constructor(commands) {
|
|
39117
39134
|
this.name = "diff-coverage";
|
|
39118
39135
|
this.config = {
|
|
39119
39136
|
base: {
|
|
39120
39137
|
help: "The base branch/sha to compare against",
|
|
39121
|
-
type: "
|
|
39138
|
+
type: "str",
|
|
39122
39139
|
required: false,
|
|
39123
39140
|
default: process.env.GITHUB_BASE_REF || "origin/main",
|
|
39124
39141
|
},
|
|
39125
39142
|
head: {
|
|
39126
39143
|
help: "The head branch/sha to compare against",
|
|
39127
|
-
type: "
|
|
39144
|
+
type: "str",
|
|
39128
39145
|
required: false,
|
|
39129
39146
|
default: process.env.GITHUB_SHA || "HEAD",
|
|
39130
39147
|
},
|
|
39148
|
+
"changed-files": {
|
|
39149
|
+
help: "Comma separated list of changed files",
|
|
39150
|
+
type: "str",
|
|
39151
|
+
required: false,
|
|
39152
|
+
default: "",
|
|
39153
|
+
},
|
|
39131
39154
|
};
|
|
39132
39155
|
commands[this.name] = this;
|
|
39133
39156
|
}
|
|
@@ -39149,6 +39172,7 @@ class DiffCoverageCommand {
|
|
|
39149
39172
|
"**/*.vue",
|
|
39150
39173
|
];
|
|
39151
39174
|
try {
|
|
39175
|
+
let changedFiles = Config$1.get(this.name, "changed-files", "");
|
|
39152
39176
|
let headSha = await git.resolveRef({
|
|
39153
39177
|
fs: fs$2,
|
|
39154
39178
|
dir: process.cwd(),
|
|
@@ -39159,7 +39183,20 @@ class DiffCoverageCommand {
|
|
|
39159
39183
|
dir: process.cwd(),
|
|
39160
39184
|
ref: Config$1.get(this.name, "base"),
|
|
39161
39185
|
});
|
|
39162
|
-
|
|
39186
|
+
Logger.debug(`Head SHA: ${headSha}`);
|
|
39187
|
+
Logger.debug(`Base SHA: ${baseSha}`);
|
|
39188
|
+
let files = [];
|
|
39189
|
+
if (!changedFiles) {
|
|
39190
|
+
files = await this.getChangedFiles(process.cwd(), headSha, baseSha);
|
|
39191
|
+
}
|
|
39192
|
+
else {
|
|
39193
|
+
files = changedFiles.split(",").map((file) => {
|
|
39194
|
+
return {
|
|
39195
|
+
path: file,
|
|
39196
|
+
};
|
|
39197
|
+
});
|
|
39198
|
+
}
|
|
39199
|
+
Logger.debug(`Changed files: ${files.map((file) => file.path).join(", ")}`);
|
|
39163
39200
|
files = files.filter((file) => {
|
|
39164
39201
|
return (!coverageExcludes.some((exclude) => {
|
|
39165
39202
|
return minimatch(file.path.replace(/^\//, ""), exclude);
|
|
@@ -39395,13 +39432,16 @@ class CommandFactory {
|
|
|
39395
39432
|
}
|
|
39396
39433
|
getCommand(args) {
|
|
39397
39434
|
try {
|
|
39435
|
+
Logger.debug(`Fetching command: ${args.command}`); // Add debug log
|
|
39398
39436
|
return this.commands[args.command];
|
|
39399
39437
|
}
|
|
39400
39438
|
catch (error) {
|
|
39439
|
+
Logger.error(`Error fetching command: ${error.message}`); // Add error log
|
|
39401
39440
|
return undefined;
|
|
39402
39441
|
}
|
|
39403
39442
|
}
|
|
39404
39443
|
getAvailableCommands() {
|
|
39444
|
+
Logger.debug("Fetching available commands"); // Add debug log
|
|
39405
39445
|
let availableCommands = [];
|
|
39406
39446
|
for (const command of Object.keys(this.commands)) {
|
|
39407
39447
|
availableCommands.push(command);
|
|
@@ -39409,6 +39449,7 @@ class CommandFactory {
|
|
|
39409
39449
|
return availableCommands;
|
|
39410
39450
|
}
|
|
39411
39451
|
addCommandArgs(yargs) {
|
|
39452
|
+
Logger.debug("Adding command arguments"); // Add debug log
|
|
39412
39453
|
for (const command of this.getAvailableCommands()) {
|
|
39413
39454
|
const commandInstance = this.commands[command];
|
|
39414
39455
|
const commandGroup = yargs.add_argument_group({
|
|
@@ -39467,7 +39508,6 @@ parser.add_argument("--reporter.coverage.quality-gate", {
|
|
|
39467
39508
|
});
|
|
39468
39509
|
for (let reporter of Object.keys(COVERAGE_REPORTERS)) {
|
|
39469
39510
|
const reporterConfig = COVERAGE_REPORTERS[reporter].config || {};
|
|
39470
|
-
// add group for specific reporter so it looks better in help
|
|
39471
39511
|
const reporterGroup = parser.add_argument_group({
|
|
39472
39512
|
title: `Coverage reporter: ${reporter}`,
|
|
39473
39513
|
});
|