Skip to content

Commit

Permalink
feat: automatically install Sprocket from GitHub releases. (#7)
Browse files Browse the repository at this point in the history
* fix: fix verbose, information, and quiet levels for latest `sprocket` CLI.

* feat: automatically install Sprocket from GitHub releases.

This commit adds a feature to the VSCode extension to automatically download
the latest stable Sprocket from GitHub releases.

It does this by first querying `crates.io` for the latest stable `sprocket`
crate version; it then fetches the GitHub release artifact corresponding to
that version.

The extension will also check for newer versions to what has been previously
downloaded and prompt to download and update to the next version.

A new setting has been added to control checking for updates on startup.

* chore: format source.

* refactor: refactor the sprocket installation code.

This commit refactors the installation code to be a little more readable.

* fix: use `msvc` package for Windows.

Also fixes:

* SVG isn't allowed from the marketplace when building the extension.
* The asset path doesn't like the `./` prefix when building the extension.
  • Loading branch information
peterhuene authored Oct 21, 2024
1 parent 3003073 commit eeffe89
Show file tree
Hide file tree
Showing 4 changed files with 835 additions and 408 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<p align="center">
<p align="center">
<a href="https://marketplace.visualstudio.com/items?itemName=stjude-rust-labs.sprocket-vscode">
<img src="https://vsmarketplacebadges.dev/version/stjude-rust-labs.sprocket-vscode.svg" alt="Visual Studio Marketplace">
<img src="https://vsmarketplacebadges.dev/version/stjude-rust-labs.sprocket-vscode.png" alt="Visual Studio Marketplace">
</a>
<a href="https://github.com/stjude-rust-labs/sprocket-vscode/blob/main/LICENSE-APACHE" target="_blank">
<img alt="License: Apache 2.0" src="https://img.shields.io/badge/license-Apache 2.0-blue.svg" />
Expand Down
17 changes: 15 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Sprocket",
"publisher": "stjude-rust-labs",
"description": "Workflow Definition Language (WDL) support for Visual Studio Code",
"icon": "./assets/sprocket-logo-square.png",
"icon": "assets/sprocket-logo-square.png",
"repository": {
"type": "git",
"url": "https://github.com/stjude-rust-labs/sprocket-vscode"
Expand Down Expand Up @@ -66,9 +66,14 @@
{
"title": "Sprocket",
"properties": {
"sprocket.server.checkForUpdates": {
"type": "boolean",
"markdownDescription": "Whether or not to check for updates to the latest stable Sprocket release when the extension starts.",
"default": true
},
"sprocket.server.path": {
"type": "string",
"markdownDescription": "The path to the `sprocket` command line tool; defaults to finding `sprocket` on your PATH."
"markdownDescription": "The path to a locally installed Sprocket; defaults to automatically installing the latest stable Sprocket."
},
"sprocket.server.outputLevel": {
"type": "string",
Expand Down Expand Up @@ -101,7 +106,15 @@
"lint": "eslint src --ext ts",
"test": "vscode-test"
},
"extensionDependencies": [
"mindaro-dev.file-downloader"
],
"dependencies": {
"@microsoft/vscode-file-downloader-api": "^1.0.1",
"extract-zip": "^2.0.1",
"node-fetch": "2",
"semver": "^7.6.3",
"tar": "^7.4.3",
"vscode-languageclient": "^9.0.1"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit eeffe89

Please sign in to comment.