Skip to content

Commit ec37b7c

Browse files
jqnatividadclaude
andcommitted
fix(mcpb): address Copilot review issues in package-mcpb.js
Fixed three issues identified in PR #3296 review: 1. Division by zero protection in progress calculation 2. Case-insensitive file filtering for node_modules 3. Safe error message access with optional chaining Also regenerated qsv-mcp-server.mcpb with the fixes applied. Addresses: #3296 (review) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9764dcd commit ec37b7c

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.claude/skills/qsv-mcp-server.mcpb

0 Bytes
Binary file not shown.

.claude/skills/scripts/package-mcpb.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ async function createArchive() {
9494
// Track progress
9595
let bytesProcessed = 0;
9696
archive.on('progress', (progress) => {
97-
const percent = Math.round((progress.fs.processedBytes / progress.fs.totalBytes) * 100);
97+
const totalBytes = progress.fs.totalBytes;
98+
const percent =
99+
totalBytes > 0
100+
? Math.round((progress.fs.processedBytes / totalBytes) * 100)
101+
: 0;
98102
if (progress.fs.processedBytes !== bytesProcessed) {
99103
process.stdout.write(`\r Progress: ${percent}% (${Math.round(progress.fs.processedBytes / 1024 / 1024)}MB)`);
100104
bytesProcessed = progress.fs.processedBytes;
@@ -136,12 +140,13 @@ async function createArchive() {
136140
// Exclude development dependencies and large files
137141
filter: (file) => {
138142
const name = file.name || '';
139-
// Exclude source maps, TypeScript definitions, and dev files
143+
const lowerName = name.toLowerCase();
144+
// Exclude source maps, TypeScript definitions, and dev files (case-insensitive)
140145
return !name.endsWith('.map') &&
141146
!name.endsWith('.ts') &&
142-
!name.includes('.github') &&
143-
!name.includes('test') &&
144-
!name.includes('example');
147+
!lowerName.includes('.github') &&
148+
!lowerName.includes('test') &&
149+
!lowerName.includes('example');
145150
}
146151
});
147152

@@ -206,7 +211,7 @@ async function main() {
206211
displaySummary();
207212

208213
} catch (error) {
209-
console.error('\n❌ Packaging failed:', error.message);
214+
console.error('\n❌ Packaging failed:', error?.message || String(error));
210215
process.exit(1);
211216
}
212217
}

0 commit comments

Comments
 (0)