Skip to content

Commit fdd6722

Browse files
committed
Address PR review comments & fix vsix archive
1 parent e544b3d commit fdd6722

File tree

7 files changed

+22
-17
lines changed

7 files changed

+22
-17
lines changed

.github/workflows/build-extension.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ jobs:
5757
5858
- name: Build Extension - Verify VSIX packaging
5959
working-directory: extensions/vscode
60-
run: npx @vscode/vsce package --out codeql-development-mcp-server.vsix
60+
run: npx @vscode/vsce package --no-dependencies --out codeql-development-mcp-server.vsix
6161

6262
- name: Build Extension - Verify VSIX contents
6363
working-directory: extensions/vscode
6464
run: |
6565
echo "## VSIX Contents" >> $GITHUB_STEP_SUMMARY
6666
echo '```' >> $GITHUB_STEP_SUMMARY
67-
npx @vscode/vsce ls 2>&1 | head -50 >> $GITHUB_STEP_SUMMARY
67+
npx @vscode/vsce ls --no-dependencies --tree 2>&1 | head -50 >> $GITHUB_STEP_SUMMARY
6868
echo '```' >> $GITHUB_STEP_SUMMARY
6969
7070
- name: Build Extension - Check for uncommitted changes

.github/workflows/release-vsix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ jobs:
8686
working-directory: extensions/vscode
8787
run: |
8888
VSIX_NAME="codeql-development-mcp-server.vsix"
89-
npx @vscode/vsce package --out "${VSIX_NAME}"
89+
npx @vscode/vsce package --no-dependencies --out "${VSIX_NAME}"
9090
echo "vsix_name=${VSIX_NAME}" >> $GITHUB_OUTPUT
9191
echo "✅ Packaged ${VSIX_NAME}"
9292
9393
- name: VSIX - Verify VSIX contents
9494
working-directory: extensions/vscode
9595
run: |
9696
echo "Verifying bundled server and tool query packs..."
97-
npx @vscode/vsce ls 2>&1 | tee /tmp/vsix-contents.txt
97+
npx @vscode/vsce ls --no-dependencies 2>&1 | tee /tmp/vsix-contents.txt
9898
9999
# Verify critical files are included
100100
for required in \

extensions/vscode/.vscodeignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
1+
# Source and config (not needed at runtime)
12
.vscode/**
23
.vscode-test/**
34
src/**
45
test/**
56
scripts/**
7+
__mocks__/**
68
node_modules/**
79
tsconfig.json
810
test/tsconfig.json
911
vitest.config.ts
1012
eslint.config.mjs
1113
esbuild.config.js
14+
.gitignore
15+
coverage/**
16+
17+
# Build artifacts that shouldn't be in the VSIX
1218
**/*.test.ts
1319
**/*.test.js
20+
**/*.test.cjs
1421
**/*.map
15-
coverage/**
22+
dist/test/**
1623

17-
# Include server/ bundle but exclude test/examples content
24+
# Bundled server: exclude test/examples content
1825
server/ql/*/tools/test/**
1926
server/ql/*/examples/**

extensions/vscode/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"license": "SEE LICENSE IN LICENSE",
88
"repository": {
99
"type": "git",
10-
"url": "git+https://github.com/advanced-security/codeql-development-mcp-server.git",
11-
"directory": "extensions/vscode"
10+
"url": "git+https://github.com/advanced-security/codeql-development-mcp-server.git"
1211
},
1312
"type": "module",
1413
"homepage": "https://github.com/advanced-security/codeql-development-mcp-server#readme",
@@ -132,7 +131,7 @@
132131
"clean": "rm -rf dist server *.vsix",
133132
"lint": "eslint src/ test/",
134133
"lint:fix": "eslint src/ test/ --fix",
135-
"package": "vsce package --out codeql-development-mcp-server.vsix",
134+
"package": "vsce package --no-dependencies --out codeql-development-mcp-server.vsix",
136135
"test": "vitest --run",
137136
"test:coverage": "vitest --run --coverage",
138137
"test:watch": "vitest --watch",

extensions/vscode/scripts/bundle-server.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,19 @@ if (existsSync(targetServerDir)) {
3535
rmSync(targetServerDir, { recursive: true, force: true });
3636
}
3737

38-
// --- Server dist ---
38+
// --- Server dist (JS only, no source maps) ---
3939
const serverDist = join(serverRoot, 'dist');
4040
const targetDist = join(targetServerDir, 'dist');
4141
if (!existsSync(serverDist)) {
4242
console.error('❌ Server dist/ not found. Run "npm run build -w server" first.');
4343
process.exit(1);
4444
}
4545
mkdirSync(targetDist, { recursive: true });
46-
cpSync(serverDist, targetDist, { recursive: true });
47-
console.log('✅ Copied server/dist/');
46+
// Copy only the JS bundle, not the source map (which contains ../../ paths
47+
// that cause vsce to traverse the entire monorepo)
48+
const serverJs = join(serverDist, 'codeql-development-mcp-server.js');
49+
cpSync(serverJs, join(targetDist, 'codeql-development-mcp-server.js'));
50+
console.log('✅ Copied server/dist/codeql-development-mcp-server.js');
4851

4952
// --- Server package.json ---
5053
const serverPkg = join(serverRoot, 'package.json');

extensions/vscode/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
"declaration": true,
1212
"outDir": "./dist",
1313
"rootDir": "./src",
14-
"resolveJsonModule": true,
15-
"composite": true
14+
"resolveJsonModule": true
1615
},
1716
"include": [
1817
"src/**/*"

tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
"references": [
1616
{
1717
"path": "./server"
18-
},
19-
{
20-
"path": "./extensions/vscode"
2118
}
2219
]
2320
}

0 commit comments

Comments
 (0)