Skip to content

Commit c4d5466

Browse files
authored
Replace webpack with esbuild, remove gradle (#66)
Signed-off-by: Ben Sherman <[email protected]>
1 parent b594a12 commit c4d5466

19 files changed

+1349
-1906
lines changed

.vscode/launch.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
1+
// See: https://go.microsoft.com/fwlink/?linkid=830387
22
{
33
"version": "0.2.0",
44
"configurations": [
55
{
66
"name": "Extension",
77
"type": "extensionHost",
88
"request": "launch",
9-
"runtimeExecutable": "${execPath}",
10-
"args": ["--extensionDevelopmentPath=${workspaceRoot}/build" ]
9+
"args": [
10+
"--extensionDevelopmentPath=${workspaceRoot}/build"
11+
],
12+
"preLaunchTask": "${defaultBuildTask}"
1113
}
1214
]
1315
}

.vscode/tasks.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// See: https://go.microsoft.com/fwlink/?LinkId=733558
2+
{
3+
"version": "2.0.0",
4+
"tasks": [
5+
{
6+
"label": "npm: compile",
7+
"type": "npm",
8+
"script": "compile",
9+
"presentation": {
10+
"reveal": "never"
11+
},
12+
"group": {
13+
"kind": "build",
14+
"isDefault": true
15+
}
16+
}
17+
]
18+
}

.vscodeignore

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
.vscode/**
2-
.vscode-test/**
3-
.gitignore
4-
vsc-extension-quickstart.md
1+
.vscode
2+
node_modules
3+
src/**
4+
package-lock.json
5+
tsconfig.json
6+
esbuild.js
7+
**/*.map

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
all: clean server package
2+
3+
clean:
4+
rm -rf build
5+
6+
server:
7+
cd language-server ; ./gradlew build
8+
9+
package:
10+
npm run package
11+
12+
install: all
13+
code --install-extension build/nextflow.vsix

README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ VS Code extension for [Nextflow](https://www.nextflow.io/) that provides languag
44

55
![nextflow vscode extension](images/vscode-nextflow.png)
66

7-
Read the [blog post](https://seqera.io/blog/modernizing-nextflow-developer-experience/) and the [docs](https://nextflow.io/docs/latest/vscode.html) for more information.
7+
Read the blog posts ([part 1](https://seqera.io/blog/modernizing-nextflow-developer-experience/), [part 2](https://seqera.io/blog/modernizing-nextflow-developer-experience-part-2/)) and the [docs](https://nextflow.io/docs/latest/vscode.html) for more information.
88

99
See also:
1010

@@ -34,32 +34,30 @@ Clone this repository:
3434

3535
```bash
3636
git clone https://github.com/nextflow-io/vscode-language-nextflow
37+
cd vscode-language-nextflow
3738
```
3839

39-
Clone the language server into this repository:
40+
If you need to edit the language server, clone the repository and build it:
4041

4142
```bash
42-
cd vscode-language-nextflow
4343
git clone https://github.com/nextflow-io/language-server
44+
make server
4445
```
4546

46-
Build the extension:
47+
Otherwise, you can simply download a language server release into the following subdirectory:
4748

4849
```bash
49-
./gradlew build
50+
mkdir -p language-server/build/libs
51+
wget -P language-server/build/libs https://github.com/nextflow-io/language-server/releases/download/$VERSION/language-server-all.jar
5052
```
5153

52-
From VS Code, you can press `F5` to launch a new VS Code window with the extension loaded.
53-
54-
Alternatively, you can install the extension into your environment (reload required):
55-
56-
```bash
57-
./gradlew install
58-
```
54+
Finally, press `F5` to build the extension and launch a new VS Code window with the extension loaded.
5955

6056
## Publishing
6157

62-
Update the extension version number in `package.json` and `.vscode/launch.json`, then run the "Deploy Extension" action to publish the extension to the VSCode marketplace and Open VSX.
58+
1. Update the extension version number in `package.json`.
59+
2. Update the changelog in `CHANGELOG.md`.
60+
3. Run the "Deploy Extension" action to publish the extension to the VSCode marketplace and Open VSX.
6361

6462
## Contributing
6563

build.gradle

Lines changed: 0 additions & 57 deletions
This file was deleted.

esbuild.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
const { build } = require('esbuild');
2+
const { copy } = require('esbuild-plugin-copy');
3+
4+
const production = process.argv.includes('--production');
5+
6+
async function main() {
7+
const files = {
8+
'images/**': './images',
9+
'snippets/**': './snippets',
10+
'syntaxes/**': './syntaxes',
11+
'CHANGELOG.md': './CHANGELOG.md',
12+
'LICENSE.md': './LICENSE.md',
13+
'README.md': './README.md',
14+
'language-configuration.json': './language-configuration.json',
15+
'package.json': './package.json',
16+
'language-server/build/libs/language-server-all.jar': 'bin',
17+
'node_modules/mermaid/dist/mermaid.min.js': 'media',
18+
};
19+
await build({
20+
entryPoints: [
21+
'src/extension.ts'
22+
],
23+
bundle: true,
24+
format: 'cjs',
25+
minify: production,
26+
sourcemap: !production,
27+
sourcesContent: false,
28+
platform: 'node',
29+
outfile: 'build/extension.js',
30+
external: ['vscode'],
31+
logLevel: 'silent',
32+
plugins: [
33+
copy({
34+
assets: Object.entries(files).map(([from, to]) => {
35+
return { from, to };
36+
}),
37+
}),
38+
],
39+
});
40+
}
41+
42+
main().catch(e => {
43+
console.error(e);
44+
process.exit(1);
45+
});

gradle/wrapper/gradle-wrapper.jar

-42.4 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)