Improvments#568
Conversation
|
|
||
| return formatResults(allChecks); | ||
| } catch (error) { | ||
| return `❌ Error checking certification readiness: ${error.message}`; |
There was a problem hiding this comment.
error might be unknown.
You can use something like this: (error instanceof Error) ? error.message : String(error). Please fix this in other codebase of this PR.
There was a problem hiding this comment.
I replaced the error handling with a safer check.
| servers: { | ||
| pbiviz: { | ||
| command: "npx", | ||
| args: ["pbiviz", "mcp"] |
There was a problem hiding this comment.
It is edge case, but still, if user does not have tools locally or globally, npx will search for pbiviz in npm (it is not exist there). So I think, better to use following args:
"args": ["-y", "powerbi-visuals-tools", "mcp"]
There was a problem hiding this comment.
Updated to npx -y powerbi-visuals-tools mcp
| "servers": { | ||
| "pbiviz": { | ||
| "command": "npx", | ||
| "args": ["pbiviz", "mcp"] |
There was a problem hiding this comment.
It is edge case, but still, if user does not have tools locally or globally, npx will search for pbiviz in npm (it is not exist there). So I think, better to use following args:
"args": ["-y", "powerbi-visuals-tools", "mcp"]
There was a problem hiding this comment.
Updated to npx -y powerbi-visuals-tools mcp.
|
|
||
| return formatVisualInfo(info); | ||
| } catch (error) { | ||
| return `❌ Error reading visual info: ${error.message}`; |
There was a problem hiding this comment.
error might be unknown.
You can use something like this: (error instanceof Error) ? error.message : String(error). Please fix this in other codebase of this PR.
There was a problem hiding this comment.
Fixed - I replaced the error handling
|
|
||
| return formatResults([...codeResults, ...eslintResults]); | ||
| } catch (error) { | ||
| return `❌ Error scanning project: ${error.message}`; |
There was a problem hiding this comment.
error might be unknown.
You can use something like this: (error instanceof Error) ? error.message : String(error). Please fix this in other codebase of this PR.
|
|
||
| for (const entry of entries) { | ||
| const fullPath = path.join(dir, entry.name); | ||
| if (entry.isDirectory() && entry.name !== 'node_modules') { |
There was a problem hiding this comment.
don't we want to exclude '.tmp' as well, samee as you do in another places?
if (entry.isDirectory() && entry.name !== 'node_modules' && entry.name !== '.tmp') {
And actually, I don't like the fact that you have similar getSourceFiles functions in different files. Define it in one single place (some utils file) and reuse it.
There was a problem hiding this comment.
I updated it to exclude .tmp as well, and moved the duplicated getSourceFiles logic into a shared util so all checks reuse the same implementation.
| const checks: CertificationCheck[] = []; | ||
|
|
||
| for (const { file, description } of REQUIRED_FILES) { | ||
| const exists = fs.existsSync(path.join(rootPath, file)); |
There was a problem hiding this comment.
RECOMMENDED_FILES use upper-case strings, but what if another developer have lower-case. That will work in windows, but for OS cross-platform support better to add case-insensitive method to utils file and use it for such case.
Method example (or do better):
/**
* Case-insensitive version of fs.existsSync.
* Reads the parent directory listing and compares filenames in lowercase.
*/
export function existsIgnoreCase(filePath: string): boolean {
const dir = path.dirname(filePath);
const name = path.basename(filePath).toLowerCase();
try {
const entries = fs.readdirSync(dir);
return entries.some(entry => entry.toLowerCase() === name);
} catch {
return false;
}
}
There was a problem hiding this comment.
I added a shared case-insensitive file existence check in utils and updated the recommended file validation to use it.
| public static async mcpInit(rootPath: string) { | ||
| await initMcpConfig(rootPath); | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Please end all files with a new line.
| name: 'fetchMoreData', | ||
| category: 'data', | ||
| description: 'Enables loading additional data in chunks. Essential for large datasets that exceed the initial row limit.', | ||
| minApiVersion: '2.6.0', codePatterns: [/fetchMoreData/], example: `// In update method |
There was a problem hiding this comment.
keep structure consistently, split fields by a new line
There was a problem hiding this comment.
I updated the structure to keep it consistent and split the fields into separate lines
| @@ -0,0 +1,166 @@ | |||
| /* | |||
There was a problem hiding this comment.
Can we add some tests for new MCP features?
No description provided.