@dragonshorn-studios/elyseum-cli 1.0.2 → 1.0.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.
package/dist/index.js CHANGED
@@ -25042,15 +25042,15 @@ class GithubPRCommentCoverageReporter {
25042
25042
  else {
25043
25043
  coverageQualityText += `> [!TIP]\n> ### Coverage Quality Gate Passed 🟩\n`;
25044
25044
  }
25045
- coverageQualityText += `> ${this.getIcon(diffCoverage.lines.percent)} Lines: ${diffCoverage.lines.percent.toFixed(2)}% (baseline: ${qualityGate}%)\n`;
25046
- coverageQualityText += `> ${this.getIcon(diffCoverage.functions.percent)} Functions: ${diffCoverage.functions.percent.toFixed(2)}% (baseline: ${qualityGate}%)\n`;
25047
- coverageQualityText += `> ${this.getIcon(diffCoverage.branches.percent)} Branches: ${diffCoverage.branches.percent.toFixed(2)}% (baseline: ${qualityGate}%)\n\n`;
25045
+ coverageQualityText += `> ${this.getIcon(diffCoverage.lines.percent, qualityGate, qualityGateFail)} Lines: ${diffCoverage.lines.percent.toFixed(2)}% (baseline: ${qualityGate}%, failing: ${qualityGateFail}%)\n`;
25046
+ coverageQualityText += `> ${this.getIcon(diffCoverage.functions.percent, qualityGate, qualityGateFail)} Functions: ${diffCoverage.functions.percent.toFixed(2)}% (baseline: ${qualityGate}%, failing: ${qualityGateFail}%)\n`;
25047
+ coverageQualityText += `> ${this.getIcon(diffCoverage.branches.percent, qualityGate, qualityGateFail)} Branches: ${diffCoverage.branches.percent.toFixed(2)}% (baseline: ${qualityGate}%, failing: ${qualityGateFail}%)\n\n`;
25048
25048
  }
25049
25049
  let summary = `| Type | Total | Covered | Percent |\n`;
25050
25050
  summary += `|-----------|-------|---------|---------|\n`;
25051
- summary += `| Lines | ${diffCoverage.lines.total} | ${diffCoverage.lines.covered} | ${this.getIcon(diffCoverage.lines.percent)} ${diffCoverage.lines.percent.toFixed(2)}% |\n`;
25052
- summary += `| Functions | ${diffCoverage.functions.total} | ${diffCoverage.functions.covered} | ${this.getIcon(diffCoverage.functions.percent)} ${diffCoverage.functions.percent.toFixed(2)}% |\n`;
25053
- summary += `| Branches | ${diffCoverage.branches.total} | ${diffCoverage.branches.covered} | ${this.getIcon(diffCoverage.branches.percent)} ${diffCoverage.branches.percent.toFixed(2)}% |\n`;
25051
+ summary += `| Lines | ${diffCoverage.lines.total} | ${diffCoverage.lines.covered} | ${this.getIcon(diffCoverage.lines.percent, qualityGate, qualityGateFail)} ${diffCoverage.lines.percent.toFixed(2)}% |\n`;
25052
+ summary += `| Functions | ${diffCoverage.functions.total} | ${diffCoverage.functions.covered} | ${this.getIcon(diffCoverage.functions.percent, qualityGate, qualityGateFail)} ${diffCoverage.functions.percent.toFixed(2)}% |\n`;
25053
+ summary += `| Branches | ${diffCoverage.branches.total} | ${diffCoverage.branches.covered} | ${this.getIcon(diffCoverage.branches.percent, qualityGate, qualityGateFail)} ${diffCoverage.branches.percent.toFixed(2)}% |\n`;
25054
25054
  markdown += `### Coverage Summary\n\n${summary}`;
25055
25055
  markdown += coverageQualityText;
25056
25056
  let detailsTable = `\n<details>\n<summary>Coverage Details</summary>\n\n`;
@@ -25125,16 +25125,10 @@ class GithubPRCommentCoverageReporter {
25125
25125
  : qualityGateWarning
25126
25126
  ? "neutral"
25127
25127
  : "success",
25128
- output: {
25129
- title: "Coverage Quality Gate",
25130
- summary: `Coverage Quality Gate ${qualityGateFailed
25131
- ? "Failed"
25132
- : qualityGateWarning
25133
- ? "Warning"
25134
- : "Passed"}`,
25135
- text: markdown,
25136
- annotations: annotations,
25137
- },
25128
+ title: "Coverage Quality Gate",
25129
+ summary: `Coverage Quality Gate ${qualityGateFailed ? "Failed" : qualityGateWarning ? "Warning" : "Passed"}`,
25130
+ text: markdown,
25131
+ annotations: annotations,
25138
25132
  };
25139
25133
  fs$1.writeFileSync(annotationFilePath, JSON.stringify(checkData));
25140
25134
  }
@@ -25163,22 +25157,20 @@ class GithubPRCommentCoverageReporter {
25163
25157
  name: "Quality Gate",
25164
25158
  head_sha: process.env.GITHUB_SHA,
25165
25159
  status: "failure",
25166
- output: {
25167
- title: "Coverage Quality Gate",
25168
- summary: message,
25169
- text: JSON.stringify(details),
25170
- },
25160
+ title: "Coverage Quality Gate",
25161
+ summary: message,
25162
+ text: JSON.stringify(details),
25171
25163
  };
25172
25164
  fs$1.writeFileSync(annotationFilePath, JSON.stringify(checkData));
25173
25165
  }
25174
25166
  }
25175
- getIcon(percent) {
25167
+ getIcon(percent, qualityGate, qualityGateFail) {
25176
25168
  // emoji based
25177
- if (percent >= 80) {
25169
+ if (percent >= qualityGate) {
25178
25170
  // green circle
25179
25171
  return "🟢";
25180
25172
  }
25181
- else if (percent >= 50) {
25173
+ else if (percent >= qualityGateFail) {
25182
25174
  return "🟡";
25183
25175
  }
25184
25176
  else {