Skip to content

Commit 6420602

Browse files
committed
feat: devtools extension
1 parent b984682 commit 6420602

File tree

19 files changed

+1495
-211
lines changed

19 files changed

+1495
-211
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
out
2+
dist
23
node_modules
34
*.tsbuildinfo

.vscode/launch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
{
3+
"version": "0.2.0",
4+
"configurations": [
5+
{
6+
"name": "Launch DevTools",
7+
"type": "extensionHost",
8+
"request": "launch",
9+
"runtimeExecutable": "${execPath}",
10+
"args": [
11+
"--extensionDevelopmentPath=${workspaceRoot}/packages/devtools"
12+
],
13+
"outFiles": [
14+
"${workspaceRoot}/*/*/out/**/*.js"
15+
],
16+
},
17+
],
18+
}

packages/devtools/.vscodeignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
src
2+
out
3+
scripts
4+
tsconfig.build.json
5+
tsconfig.build.tsbuildinfo

packages/devtools/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023-present Johnson Chu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/devtools/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# DevTools
2+
3+
...

packages/devtools/images/btn.svg

Lines changed: 20 additions & 0 deletions
Loading

packages/devtools/images/icon.png

76.7 KB
Loading

packages/devtools/package.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"private": true,
3+
"name": "volarjs-devtools",
4+
"version": "1.5.4",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/volarjs/volar.js.git",
8+
"directory": "packages/devtools"
9+
},
10+
"sponsor": {
11+
"url": "https://github.com/sponsors/johnsoncodehk"
12+
},
13+
"icon": "images/icon.png",
14+
"displayName": "DevTools for Volar.js",
15+
"description": "DevTools for Volar.js",
16+
"author": "johnsoncodehk",
17+
"publisher": "johnsoncodehk",
18+
"engines": {
19+
"vscode": "^1.67.0"
20+
},
21+
"activationEvents": [
22+
"onView:volar-servers",
23+
"onView:volar-virtual-files"
24+
],
25+
"main": "./dist/extension.js",
26+
"contributes": {
27+
"viewsContainers": {
28+
"activitybar": [
29+
{
30+
"id": "volar-devtools",
31+
"title": "Volar.js DevTools",
32+
"icon": "images/btn.svg"
33+
}
34+
]
35+
},
36+
"views": {
37+
"volar-devtools": [
38+
{
39+
"id": "volar-servers",
40+
"name": "Servers",
41+
"icon": "images/btn.svg",
42+
"contextualTitle": "Volar.js"
43+
},
44+
{
45+
"id": "volar-virtual-files",
46+
"name": "Virtual Files",
47+
"icon": "images/btn.svg",
48+
"contextualTitle": "Volar.js"
49+
}
50+
]
51+
}
52+
},
53+
"scripts": {
54+
"build": "node scripts/build",
55+
"watch": "npm run build -- --watch",
56+
"prepack": "npm run build -- --minify",
57+
"pack": "npm run prepack && vsce package",
58+
"release": "npm run prepack && vsce publish"
59+
},
60+
"devDependencies": {
61+
"@types/vscode": "1.67.0",
62+
"@volar/language-server": "1.5.4",
63+
"@volar/source-map": "1.5.4",
64+
"@volar/vscode": "1.5.4",
65+
"esbuild": "0.15.18",
66+
"vsce": "latest",
67+
"vscode-languageclient": "^8.1.0"
68+
}
69+
}

packages/devtools/scripts/build.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require('esbuild').build({
2+
entryPoints: {
3+
extension: './out/extension.js',
4+
},
5+
bundle: true,
6+
metafile: process.argv.includes('--metafile'),
7+
outdir: './dist',
8+
external: [
9+
'vscode',
10+
],
11+
format: 'cjs',
12+
platform: 'node',
13+
tsconfig: '../../tsconfig.build.json',
14+
define: { 'process.env.NODE_ENV': '"production"' },
15+
minify: process.argv.includes('--minify'),
16+
watch: process.argv.includes('--watch'),
17+
}).catch(() => process.exit(1))

0 commit comments

Comments
 (0)