Skip to content

Commit ba3a991

Browse files
authored
Merge pull request #280 from lumaxis/feature/add-browser-compatibility
Add compatibility with browser-based versions of VS Code
2 parents 535a2c4 + f7845e5 commit ba3a991

28 files changed

+7368
-979
lines changed

.eslintrc.json

+6-14
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,19 @@
1111
"project": "./tsconfig.json",
1212
"sourceType": "module"
1313
},
14-
"plugins": ["@typescript-eslint"],
14+
"plugins": [
15+
"@typescript-eslint"
16+
],
1517
"rules": {
16-
"@typescript-eslint/naming-convention": [
17-
"warn",
18-
{
19-
"selector": "class",
20-
"format": ["PascalCase"]
21-
}
22-
],
18+
"@typescript-eslint/naming-convention": "warn",
2319
"@typescript-eslint/semi": "warn",
2420
"curly": "warn",
2521
"eqeqeq": "warn",
2622
"no-throw-literal": "warn",
2723
"semi": "off",
2824
"indent": ["error", "tab"]
2925
},
30-
"ignorePatterns": ["**/fixtures/**"],
31-
"overrides": [
32-
{
33-
"files": ["**/*.ts"],
34-
"excludedFiles": ["**/fixtures/**"]
35-
}
26+
"ignorePatterns": [
27+
"**/*.d.ts"
3628
]
3729
}

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
src/test/fixtures/crlf-ruby-example.rb eol=crlf
1+
src/web/test/fixtures/crlf-ruby-example.rb eol=crlf
22
*.sketch filter=lfs diff=lfs merge=lfs -text

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
node-version: [12, 14]
19+
node-version: [14, 16]
2020

2121
steps:
2222
- uses: actions/checkout@v2

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
out
1+
dist
22
node_modules
33
.vscode-test/
4+
.vscode-test-web/
45
*.vsix
56
*.vsix.zip

.vscode/extensions.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// See http://go.microsoft.com/fwlink/?LinkId=827846
33
// for the documentation about the extensions.json format
44
"recommendations": [
5-
"dbaeumer.vscode-eslint"
5+
"dbaeumer.vscode-eslint",
6+
"amodio.tsl-problem-matcher"
67
]
78
}

.vscode/launch.json

+14-12
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,36 @@
66
"version": "0.2.0",
77
"configurations": [
88
{
9-
"name": "Run Extension",
10-
"type": "extensionHost",
9+
"name": "Run Web Extension ",
10+
"type": "pwa-extensionHost",
11+
"debugWebWorkerHost": true,
1112
"request": "launch",
12-
"runtimeExecutable": "${execPath}",
1313
"args": [
14-
"${workspaceFolder}/src/test/fixtures",
14+
"${workspaceFolder}/src/web/test/fixtures",
1515
"--disable-extensions",
16-
"--extensionDevelopmentPath=${workspaceFolder}"
16+
"--extensionDevelopmentPath=${workspaceFolder}",
17+
"--extensionDevelopmentKind=web"
1718
],
1819
"outFiles": [
19-
"${workspaceFolder}/out/**/*.js"
20+
"${workspaceFolder}/dist/web/**/*.js"
2021
],
21-
"preLaunchTask": "${defaultBuildTask}"
22+
"preLaunchTask": "npm: watch-web"
2223
},
2324
{
2425
"name": "Extension Tests",
2526
"type": "extensionHost",
27+
"debugWebWorkerHost": true,
2628
"request": "launch",
27-
"runtimeExecutable": "${execPath}",
2829
"args": [
29-
"--disable-extensions",
30+
"${workspaceFolder}/src/web/test/fixtures",
3031
"--extensionDevelopmentPath=${workspaceFolder}",
31-
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
32+
"--extensionDevelopmentKind=web",
33+
"--extensionTestsPath=${workspaceFolder}/dist/web/test/suite/index"
3234
],
3335
"outFiles": [
34-
"${workspaceFolder}/out/test/**/*.js"
36+
"${workspaceFolder}/dist/web/**/*.js"
3537
],
36-
"preLaunchTask": "${defaultBuildTask}"
38+
"preLaunchTask": "npm: watch-web"
3739
}
3840
]
3941
}

.vscode/settings.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
3-
"files.exclude": {
4-
"out": false // set this to true to hide the "out" folder with the compiled JS files
5-
},
6-
"search.exclude": {
7-
"out": true // set this to false to include "out" folder in search results
8-
},
9-
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
10-
"typescript.tsc.autoDetect": "off",
11-
"editor.codeActionsOnSave": {
12-
"source.organizeImports": true
13-
}
3+
"files.exclude": {
4+
"out": false // set this to true to hide the "out" folder with the compiled JS files
5+
},
6+
"search.exclude": {
7+
"out": true // set this to false to include "out" folder in search results
8+
},
9+
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
10+
"typescript.tsc.autoDetect": "off",
11+
"editor.codeActionsOnSave": {
12+
"source.organizeImports": true
13+
}
1414
}

.vscode/tasks.json

+16-7
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,25 @@
55
"tasks": [
66
{
77
"type": "npm",
8-
"script": "watch",
9-
"problemMatcher": "$tsc-watch",
10-
"isBackground": true,
11-
"presentation": {
12-
"reveal": "never"
13-
},
8+
"script": "compile-web",
149
"group": {
1510
"kind": "build",
1611
"isDefault": true
17-
}
12+
},
13+
"problemMatcher": [
14+
"$ts-webpack",
15+
"$tslint-webpack"
16+
]
17+
},
18+
{
19+
"type": "npm",
20+
"script": "watch-web",
21+
"group": "build",
22+
"isBackground": true,
23+
"problemMatcher": [
24+
"$ts-webpack-watch",
25+
"$tslint-webpack-watch"
26+
]
1827
}
1928
]
2029
}

.vscodeignore

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
.github/**
22
.vscode/**
3-
.vscode-test/**
4-
images/**
5-
out/test/**
3+
.vscode-test-web/**
64
src/**
5+
out/**
6+
dist/**/test/**
7+
images/**
8+
!images/icon.png
9+
node_modules/**
710
.gitignore
811
vsc-extension-quickstart.md
12+
webpack.config.js
13+
.yarnrc
914
**/tsconfig.json
1015
**/.eslintrc.json
1116
**/*.map
1217
**/*.ts
13-
!images/icon.png

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## [2.0.0]
4+
5+
Snippet copy is now a [web extension](https://code.visualstudio.com/api/extension-guides/web-extensions)! This means you can now also use it in browser-based versions of VS Code, for example GitHub Codespaces or on vscode.dev
6+
37
## [1.0.0]
48

59
First stable release 🎉

0 commit comments

Comments
 (0)