Skip to content

Commit 15948ab

Browse files
committed
typedoc map
1 parent 37d46ed commit 15948ab

File tree

3 files changed

+56
-26
lines changed

3 files changed

+56
-26
lines changed

dist/index.js

Lines changed: 27 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/scripts/testing.ts

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,33 @@ export const testing = async (
9393

9494
export const typeDoc = async (command: Command): Promise<StepResponse> => {
9595
const [response, commandOutput] = await runCommand(command);
96-
let outputStr =
97-
"<table><tr><th>File</th><th>Line</th><th>Column</th><th>Message</th></tr>";
98-
outputStr += commandOutput.split("\n").forEach((line) => {
99-
console.log("line: ", line);
100-
let match = line.match(/(.*):(\d+):(\d+) - (.*)/);
101-
console.log("match: ", match);
102-
if (match) {
103-
const [_, filePath, line, column, message] = match;
104-
return `<tr><td>${filePath}</td><td>${line}</td><td>${column}</td><td>${message}</td></tr>`;
105-
}
106-
});
107-
outputStr += "</table>";
96+
console.log("commandOutput: ", commandOutput);
10897

109-
return await buildComment(response, outputStr, command.label);
98+
if (response.error) {
99+
const lines = commandOutput.split("\n");
100+
const table = lines
101+
.map((line) => {
102+
const match = line.match(/^(.*?):(\d+):(\d+): (.*)$/);
103+
if (match) {
104+
const [_, file, line, column, message] = match;
105+
return `<tr><td>${file}</td><td>${line}</td><td>${column}</td><td>${message}</td></tr>`;
106+
}
107+
return "";
108+
})
109+
.join("");
110+
const outputStr = `<table><tr><th>File</th><th>Line</th><th>Column</th><th>Message</th></tr>${table}</table>`;
111+
return await buildComment(response, outputStr, command.label);
112+
}
113+
return await buildComment(response, "", command.label);
114+
115+
// outputStr += commandOutput.split("\n").forEach((line) => {
116+
// console.log("line: ", line);
117+
// let match = line.match(/(.*):(\d+):(\d+) - (.*)/);
118+
// console.log("match: ", match);
119+
// if (match) {
120+
// const [_, filePath, line, column, message] = match;
121+
// return `<tr><td>${filePath}</td><td>${line}</td><td>${column}</td><td>${message}</td></tr>`;
122+
// }
123+
// });
124+
// outputStr += "</table>";
110125
};

0 commit comments

Comments
 (0)