Skip to content

Commit f780677

Browse files
committed
feat(vscode-extension): add package-vsix script and local vsce devDependency
Collapses the multi-step VSIX build into a single `pnpm package-vsix` command and removes the requirement for a global `@vscode/vsce` install. Also adds a `repository` field to the extension package.json (required by vsce to resolve relative README links) and gitignores *.vsix artefacts.
1 parent 890a487 commit f780677

5 files changed

Lines changed: 1963 additions & 14 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ packages/grigson-text-renderer/dist/
1414
packages/grigson-svg-renderer/dist/
1515
packages/language-server/dist/
1616
packages/vscode-extension/dist/
17+
packages/vscode-extension/*.vsix
1718
packages/website/_site/
1819
packages/font-explorer/_data/fonts/
1920
packages/font-explorer/_site/

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,13 @@ To rebuild after making changes: stop the host (`Shift+F5`), run `pnpm build` fr
9595

9696
Package the extension into a `.vsix` file and install it permanently into your VS Code.
9797

98-
**Prerequisites:** `@vscode/vsce` — install it once with `npm install -g @vscode/vsce`.
99-
10098
```sh
101-
# Build all packages (grigson → language-server → extension, in order)
102-
pnpm build
103-
104-
# Package into a .vsix
105-
cd packages/vscode-extension
106-
vsce package
107-
# → produces vscode-grigson-0.1.0.vsix
99+
# Build all packages and produce the .vsix
100+
pnpm package-vsix
101+
# → produces packages/vscode-extension/vscode-grigson-0.1.0.vsix
108102

109103
# Install into VS Code
110-
code --install-extension vscode-grigson-0.1.0.vsix
104+
code --install-extension packages/vscode-extension/vscode-grigson-0.1.0.vsix
111105
```
112106

113107
After installing, reload VS Code (`Cmd+Shift+P`**Developer: Reload Window**). The extension activates automatically when you open a `.chart` file.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"test": "turbo test",
88
"lint": "turbo lint",
99
"format": "oxfmt \"packages/**/*.{ts,js,json,md}\"",
10-
"prepare": "git config core.hooksPath .githooks"
10+
"prepare": "git config core.hooksPath .githooks",
11+
"package-vsix": "pnpm build && pnpm --filter vscode-grigson run package"
1112
},
1213
"devDependencies": {
1314
"@eslint/js": "^10.0.1",

packages/vscode-extension/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,22 @@
66
"categories": [
77
"Programming Languages"
88
],
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/nelstrom/grigson.git"
12+
},
913
"main": "./dist/extension.js",
1014
"scripts": {
11-
"build": "tsc -p tsconfig.json"
15+
"build": "tsc -p tsconfig.json",
16+
"package": "vsce package --no-dependencies"
1217
},
1318
"dependencies": {
1419
"grigson-language-server": "workspace:*",
1520
"vscode-languageclient": "^9.0.0"
1621
},
1722
"devDependencies": {
1823
"@types/vscode": "^1.90.0",
24+
"@vscode/vsce": "^3.0.0",
1925
"typescript": "^5.0.0"
2026
},
2127
"contributes": {

0 commit comments

Comments
 (0)