Skip to content

Commit

Permalink
refactor: streamline TypeDoc integration and enhance comment formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
DE7924 committed Jan 8, 2025
1 parent 069e92a commit 1059637
Show file tree
Hide file tree
Showing 7 changed files with 243 additions and 151 deletions.
197 changes: 122 additions & 75 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

30 changes: 18 additions & 12 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getBooleanInput, getInput, setFailed } from "@actions/core";
import { exec } from "@actions/exec";
import { getOctokit, context } from "@actions/github";
import { eslint, litAnalyzer } from "./scripts/analyze";
import { playwright, testing, typeDoc } from "./scripts/testing";
import { eslint, litAnalyzer, typeDoc } from "./scripts/analyze";
import { playwright, testing } from "./scripts/testing";
import { coverage, getCoverage } from "./scripts/coverage";
import { comment } from "./scripts/comment";
import { cwd, chdir } from "process";
Expand Down Expand Up @@ -71,11 +71,17 @@ export const buildComment = async (
): Promise<StepResponse> => {
if (response.error == true) {
if (problemsCount !== undefined && problemsCount > 0) {
response.output = `${failedEmoji} - ${label}: ${problemsCount} problem${
// response.output = `${failedEmoji} - ${label}: ${problemsCount} problem${
// problemsCount > 1 ? "s" : ""
// } found\n<details><summary>See Details</summary>${outputStr}</details>`;

response.output = `${failedEmoji} - <details><summary>${label}: ${problemsCount} problem${
problemsCount > 1 ? "s" : ""
} found\n<details><summary>See Details</summary>${outputStr}</details>`;
}</summary>${outputStr}</details>\n`;
} else {
response.output = `${failedEmoji} - ${label}\n<details><summary>See Details</summary>${outputStr}</details>`;
// response.output = `${failedEmoji} - ${label}\n<details><summary>See Details</summary>${outputStr}</details>`;

response.output = `${failedEmoji} - <details><summary>${label}</summary>${outputStr}</details>\n`;
}
} else {
response.output = `${passedEmoji} - ${label}\n`;
Expand Down Expand Up @@ -234,6 +240,13 @@ export async function run(): Promise<void> {
})
: undefined;

const typeDocStr: StepResponse | undefined = doStaticAnalysis
? await typeDoc({
label: "TypeDoc",
command: "npx typedoc --logLevel Warn",
})
: undefined;

let webComponentsSrcRoot = wcSrcDirectory.split("/").shift();
if (webComponentsSrcRoot?.isEmpty()) {
webComponentsSrcRoot = wcSrcDirectory.split("/")[1];
Expand Down Expand Up @@ -287,13 +300,6 @@ export async function run(): Promise<void> {
)
: undefined;

const typeDocStr: StepResponse | undefined = doTests
? await typeDoc({
label: "TypeDoc",
command: "npx typedoc --logLevel Warn",
})
: undefined;

const [checkModifiedFilesStr, modified]: [StepResponse, boolean] =
await checkModifiedFiles({
label: "Check for modified files",
Expand Down
Loading

0 comments on commit 1059637

Please sign in to comment.