Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace webpack with esbuild, remove gradle #66

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
// See: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}/build" ]
"args": [
"--extensionDevelopmentPath=${workspaceRoot}/build"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
18 changes: 18 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// See: https://go.microsoft.com/fwlink/?LinkId=733558
{
"version": "2.0.0",
"tasks": [
{
"label": "npm: compile",
"type": "npm",
"script": "compile",
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
11 changes: 7 additions & 4 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.vscode/**
.vscode-test/**
.gitignore
vsc-extension-quickstart.md
.vscode
node_modules
src/**
package-lock.json
tsconfig.json
esbuild.js
**/*.map
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
all: clean server package

clean:
rm -rf build

server:
cd language-server ; ./gradlew build

package:
npm run package

install: all
code --install-extension build/nextflow.vsix
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ VS Code extension for [Nextflow](https://www.nextflow.io/) that provides languag

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

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.
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.

See also:

Expand Down Expand Up @@ -34,32 +34,30 @@ Clone this repository:

```bash
git clone https://github.com/nextflow-io/vscode-language-nextflow
cd vscode-language-nextflow
```

Clone the language server into this repository:
If you need to edit the language server, clone the repository and build it:

```bash
cd vscode-language-nextflow
git clone https://github.com/nextflow-io/language-server
make server
```

Build the extension:
Otherwise, you can simply download a language server release into the following subdirectory:

```bash
./gradlew build
mkdir -p language-server/build/libs
wget -P language-server/build/libs https://github.com/nextflow-io/language-server/releases/download/$VERSION/language-server-all.jar
```

From VS Code, you can press `F5` to launch a new VS Code window with the extension loaded.

Alternatively, you can install the extension into your environment (reload required):

```bash
./gradlew install
```
Finally, press `F5` to build the extension and launch a new VS Code window with the extension loaded.

## Publishing

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.
1. Update the extension version number in `package.json`.
2. Update the changelog in `CHANGELOG.md`.
3. Run the "Deploy Extension" action to publish the extension to the VSCode marketplace and Open VSX.

## Contributing

Expand Down
57 changes: 0 additions & 57 deletions build.gradle

This file was deleted.

45 changes: 45 additions & 0 deletions esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const { build } = require('esbuild');
const { copy } = require('esbuild-plugin-copy');

const production = process.argv.includes('--production');

async function main() {
const files = {
'images/**': './images',
'snippets/**': './snippets',
'syntaxes/**': './syntaxes',
'CHANGELOG.md': './CHANGELOG.md',
'LICENSE.md': './LICENSE.md',
'README.md': './README.md',
'language-configuration.json': './language-configuration.json',
'package.json': './package.json',
'language-server/build/libs/language-server-all.jar': 'bin',
'node_modules/mermaid/dist/mermaid.min.js': 'media',
};
await build({
entryPoints: [
'src/extension.ts'
],
bundle: true,
format: 'cjs',
minify: production,
sourcemap: !production,
sourcesContent: false,
platform: 'node',
outfile: 'build/extension.js',
external: ['vscode'],
logLevel: 'silent',
plugins: [
copy({
assets: Object.entries(files).map(([from, to]) => {
return { from, to };
}),
}),
],
});
}

main().catch(e => {
console.error(e);
process.exit(1);
});
Binary file removed gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 0 additions & 7 deletions gradle/wrapper/gradle-wrapper.properties

This file was deleted.

Loading