Skip to content

Commit 40e8a5a

Browse files
author
Natallia Harshunova
committed
Use import.meta.dirname instead of process.cwd()
1 parent a54aa00 commit 40e8a5a

File tree

4 files changed

+6
-16600
lines changed

4 files changed

+6
-16600
lines changed

src/DevtoolsUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function normalizeUrl(url: string): string {
6262
* that are actually used by the IssuesAggregator
6363
*/
6464
export class FakeIssuesManager extends Common.ObjectWrapper.ObjectWrapper<IssuesManager.EventTypes> {
65-
issues(): Issue.Issue[] {
65+
issues(): Issue[] {
6666
return [];
6767
}
6868
}

src/McpResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66
import {
7-
AggregatedIssue, Marked, MarkdownIssueDescription
7+
AggregatedIssue, Marked, findTitleFromMarkdownAst
88
} from '../node_modules/chrome-devtools-frontend/mcp/mcp.js';
99

1010
import type {ConsoleMessageData} from './formatters/consoleFormatter.js';
@@ -318,7 +318,7 @@ export class McpResponse implements Response {
318318
};
319319
}
320320
const markdownAst = Marked.Marked.lexer(rawMarkdown);
321-
const title = MarkdownIssueDescription.findTitleFromMarkdownAst(markdownAst);
321+
const title = findTitleFromMarkdownAst(markdownAst);
322322
return {
323323
consoleMessageStableId,
324324
type: 'issue',

src/issue-descriptions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import * as fs from 'node:fs';
88
import * as path from 'node:path';
99

1010
const DESCRIPTIONS_PATH = path.join(
11-
process.cwd(),
12-
'node_modules/chrome-devtools-frontend/front_end/models/issues_manager/descriptions',
11+
import.meta.dirname,
12+
'../node_modules/chrome-devtools-frontend/front_end/models/issues_manager/descriptions',
1313
);
1414

15-
let issueDescriptions: Record<string, string>= {};
15+
let issueDescriptions: Record<string, string> = {};
1616

1717
/**
1818
* Reads all issue descriptions from the filesystem into memory.

0 commit comments

Comments
 (0)