Skip to content

Commit 271f209

Browse files
committed
fix(vscode): bundle vscode-languageclient via esbuild
The previous VSIX shipped without node_modules (excluded by .vscodeignore) so the extension failed to activate at runtime with "Cannot find module 'vscode-languageclient/node'". Switch the build script to esbuild — the language client and any future runtime deps are inlined into a single 348 KB dist/extension.js, no node_modules in the VSIX. tsc is kept around as a type-checker via `npm run compile --noEmit` so we still catch TypeScript errors.
1 parent fa58de0 commit 271f209

5 files changed

Lines changed: 461 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# Local VSIX build artifacts (see `make vscode-vsix`)
88
editors/vscode/server/
99
editors/vscode/out/
10+
editors/vscode/dist/
1011
editors/vscode/node_modules/
1112
editors/vscode/*.vsix
1213

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ vscode-vsix:
5555
mkdir -p $(VSCODE_DIR)/server
5656
cp target/release/sqlshield-lsp $(VSCODE_DIR)/server/sqlshield-lsp
5757
chmod +x $(VSCODE_DIR)/server/sqlshield-lsp
58-
cd $(VSCODE_DIR) && npm ci && npm run compile
58+
cd $(VSCODE_DIR) && npm ci && npm run bundle
5959
mkdir -p $(DIST_DIR)
6060
cd $(VSCODE_DIR) && npx --yes @vscode/vsce package \
6161
--out ../../$(DIST_DIR)/sqlshield-host.vsix
@@ -82,14 +82,14 @@ vscode-vsix-target:
8282
cp target/$(TARGET)/release/sqlshield-lsp $(VSCODE_DIR)/server/sqlshield-lsp; \
8383
chmod +x $(VSCODE_DIR)/server/sqlshield-lsp; \
8484
fi
85-
cd $(VSCODE_DIR) && npm ci && npm run compile
85+
cd $(VSCODE_DIR) && npm ci && npm run bundle
8686
mkdir -p $(DIST_DIR)
8787
cd $(VSCODE_DIR) && npx --yes @vscode/vsce package \
8888
--target $(VSCE_TARGET) \
8989
--out ../../$(DIST_DIR)/sqlshield-$(VSCE_TARGET).vsix
9090

9191
vscode-clean:
92-
rm -rf $(VSCODE_DIR)/server $(VSCODE_DIR)/out $(DIST_DIR)
92+
rm -rf $(VSCODE_DIR)/server $(VSCODE_DIR)/out $(VSCODE_DIR)/dist $(DIST_DIR)
9393

9494
.PHONY: hooks venv deps develop dev-setup build test all clean \
9595
vscode-vsix vscode-vsix-target vscode-clean

editors/vscode/.vscodeignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
.vscode/**
22
.vscode-test/**
33
src/**
4+
out/**
45
.gitignore
56
.eslintrc.json
67
**/tsconfig.json
78
**/*.map
89
**/*.ts
910
node_modules
11+
package-lock.json

0 commit comments

Comments
 (0)