@dragonshorn-studios/elyseum-cli 0.1.3 → 0.1.4
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.
|
@@ -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;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;
|
|
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;YAajB,eAAe;CA4E9B"}
|
package/dist/index.js
CHANGED
|
@@ -39074,6 +39074,21 @@ minimatch.Minimatch = Minimatch;
|
|
|
39074
39074
|
minimatch.escape = escape;
|
|
39075
39075
|
minimatch.unescape = unescape;
|
|
39076
39076
|
|
|
39077
|
+
class Logger {
|
|
39078
|
+
static debug(message) {
|
|
39079
|
+
console.debug(`[DEBUG] ${message}`);
|
|
39080
|
+
}
|
|
39081
|
+
static info(message) {
|
|
39082
|
+
console.info(`[INFO] ${message}`);
|
|
39083
|
+
}
|
|
39084
|
+
static warn(message) {
|
|
39085
|
+
console.warn(`[WARN] ${message}`);
|
|
39086
|
+
}
|
|
39087
|
+
static error(message) {
|
|
39088
|
+
console.error(`[ERROR] ${message}`);
|
|
39089
|
+
}
|
|
39090
|
+
}
|
|
39091
|
+
|
|
39077
39092
|
function readCoverageConfig(filePath) {
|
|
39078
39093
|
if (!fs$1.existsSync(filePath)) {
|
|
39079
39094
|
return null;
|
|
@@ -39095,18 +39110,18 @@ function readCoverageConfig(filePath) {
|
|
|
39095
39110
|
return JSON.parse(coverageConfig);
|
|
39096
39111
|
}
|
|
39097
39112
|
function getCoverageExcludes(configDir) {
|
|
39098
|
-
const tools = ["vitest", "jest", "mocha"];
|
|
39113
|
+
const tools = ["vitest", "jest", "mocha", "vite"];
|
|
39099
39114
|
let excludes = [];
|
|
39100
39115
|
for (const tool of tools) {
|
|
39101
39116
|
const configPaths = [
|
|
39102
|
-
path$2.join(configDir, `vite.config.js`),
|
|
39103
|
-
path$2.join(configDir, `vite.config.mjs`),
|
|
39104
39117
|
path$2.join(configDir, `${tool}.config.js`),
|
|
39105
39118
|
path$2.join(configDir, `${tool}.config.mjs`),
|
|
39106
39119
|
];
|
|
39107
39120
|
for (const configPath of configPaths) {
|
|
39108
39121
|
const config = readCoverageConfig(configPath);
|
|
39109
39122
|
if (config) {
|
|
39123
|
+
Logger.debug(`Found coverage config in ${configPath}`);
|
|
39124
|
+
Logger.debug(`Excludes: ${config.exclude.join(", ")}`);
|
|
39110
39125
|
return config.exclude;
|
|
39111
39126
|
}
|
|
39112
39127
|
}
|
|
@@ -39114,21 +39129,6 @@ function getCoverageExcludes(configDir) {
|
|
|
39114
39129
|
return excludes;
|
|
39115
39130
|
}
|
|
39116
39131
|
|
|
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
|
-
|
|
39132
39132
|
class DiffCoverageCommand {
|
|
39133
39133
|
constructor(commands) {
|
|
39134
39134
|
this.name = "diff-coverage";
|
|
@@ -39185,6 +39185,7 @@ class DiffCoverageCommand {
|
|
|
39185
39185
|
});
|
|
39186
39186
|
Logger.debug(`Head SHA: ${headSha}`);
|
|
39187
39187
|
Logger.debug(`Base SHA: ${baseSha}`);
|
|
39188
|
+
Logger.debug(`Changed files: ${changedFiles}`);
|
|
39188
39189
|
let files = [];
|
|
39189
39190
|
if (!changedFiles) {
|
|
39190
39191
|
files = await this.getChangedFiles(process.cwd(), headSha, baseSha);
|
|
@@ -39196,7 +39197,6 @@ class DiffCoverageCommand {
|
|
|
39196
39197
|
};
|
|
39197
39198
|
});
|
|
39198
39199
|
}
|
|
39199
|
-
Logger.debug(`Changed files: ${files.map((file) => file.path).join(", ")}`);
|
|
39200
39200
|
files = files.filter((file) => {
|
|
39201
39201
|
return (!coverageExcludes.some((exclude) => {
|
|
39202
39202
|
return minimatch(file.path.replace(/^\//, ""), exclude);
|
|
@@ -39205,6 +39205,8 @@ class DiffCoverageCommand {
|
|
|
39205
39205
|
return minimatch(file.path.replace(/^\//, ""), include);
|
|
39206
39206
|
}));
|
|
39207
39207
|
});
|
|
39208
|
+
Logger.debug(`Files: ${files.map((file) => file.path).join(", ")}`);
|
|
39209
|
+
// normalize file paths
|
|
39208
39210
|
let coverage = await this.getCoverageReport("coverage/lcov.info");
|
|
39209
39211
|
let diffCoverage = await this.calculateDiffCoverage(files, coverage, {
|
|
39210
39212
|
headSha,
|
|
@@ -39343,6 +39345,7 @@ class DiffCoverageCommand {
|
|
|
39343
39345
|
}
|
|
39344
39346
|
async getCoverageReport(file) {
|
|
39345
39347
|
const lcov = await fs$2.readFile(file, "utf-8");
|
|
39348
|
+
Logger.debug(`Coverage report loaded from ${file}`);
|
|
39346
39349
|
return new Promise((resolve, reject) => {
|
|
39347
39350
|
parse$1(lcov, (err, data) => {
|
|
39348
39351
|
if (err) {
|