From b7332c07ecd7563343c820d4cde08b95e1c9bf44 Mon Sep 17 00:00:00 2001 From: SIDANWhatever Date: Mon, 9 Dec 2024 18:21:45 +0800 Subject: [PATCH] feat: updating vscode ext publishing --- .github/workflows/publish-vscode.yml | 39 +++++++++++++++++++ .gitignore | 4 +- snippet-extension/.gitattributes | 2 - snippet-extension/.gitignore | 3 -- snippet-extension/.vscode/launch.json | 17 -------- snippet-extension/.vscodeignore | 4 -- snippet-extension/CHANGELOG.md | 9 ----- snippet-extension/README.md | 28 ------------- snippet-extension/package.json | 24 ------------ .../snippets/meshsdk-txbuilder.json | 20 ---------- .../snippets/meshsdk-wallet-hooks.json | 16 -------- 11 files changed, 42 insertions(+), 124 deletions(-) create mode 100644 .github/workflows/publish-vscode.yml delete mode 100644 snippet-extension/.gitattributes delete mode 100644 snippet-extension/.gitignore delete mode 100644 snippet-extension/.vscode/launch.json delete mode 100644 snippet-extension/.vscodeignore delete mode 100644 snippet-extension/CHANGELOG.md delete mode 100644 snippet-extension/README.md delete mode 100644 snippet-extension/package.json delete mode 100644 snippet-extension/snippets/meshsdk-txbuilder.json delete mode 100644 snippet-extension/snippets/meshsdk-wallet-hooks.json diff --git a/.github/workflows/publish-vscode.yml b/.github/workflows/publish-vscode.yml new file mode 100644 index 0000000..8470ec6 --- /dev/null +++ b/.github/workflows/publish-vscode.yml @@ -0,0 +1,39 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Publish Cardano Devkit VSCode Extension + +on: + push: + branches: + - main + release: + types: + - created + +jobs: + build: + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + defaults: + run: + working-directory: vscode-extension + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 18.x + - run: yarn install + - run: xvfb-run -a yarn test + if: runner.os == 'Linux' + - run: yarn test + if: runner.os != 'Linux' + - name: Publish + if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest' + run: yarn deploy + env: + VSCE_PAT: ${{ secrets.VSCE_PAT }} diff --git a/.gitignore b/.gitignore index 0056726..9b3387e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,6 @@ !.vscode/launch.json !.vscode/extensions.json -.DS_Store \ No newline at end of file +.DS_Store + +vscode-extension/.vscode-test \ No newline at end of file diff --git a/snippet-extension/.gitattributes b/snippet-extension/.gitattributes deleted file mode 100644 index 70e63ff..0000000 --- a/snippet-extension/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Set default behavior to automatically normalize line endings. -* text=auto diff --git a/snippet-extension/.gitignore b/snippet-extension/.gitignore deleted file mode 100644 index cebabfc..0000000 --- a/snippet-extension/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -*.vsix -test.* \ No newline at end of file diff --git a/snippet-extension/.vscode/launch.json b/snippet-extension/.vscode/launch.json deleted file mode 100644 index 44a86ab..0000000 --- a/snippet-extension/.vscode/launch.json +++ /dev/null @@ -1,17 +0,0 @@ -// A launch configuration that launches the extension inside a new window -// Use IntelliSense to learn about possible attributes. -// Hover to view descriptions of existing attributes. -// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Extension", - "type": "extensionHost", - "request": "launch", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}" - ] - } - ] -} diff --git a/snippet-extension/.vscodeignore b/snippet-extension/.vscodeignore deleted file mode 100644 index f369b5e..0000000 --- a/snippet-extension/.vscodeignore +++ /dev/null @@ -1,4 +0,0 @@ -.vscode/** -.vscode-test/** -.gitignore -vsc-extension-quickstart.md diff --git a/snippet-extension/CHANGELOG.md b/snippet-extension/CHANGELOG.md deleted file mode 100644 index c2bfb55..0000000 --- a/snippet-extension/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -# Change Log - -All notable changes to the "cardano-dev-snippet" extension will be documented in this file. - -Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. - -## [Unreleased] - -- Initial release \ No newline at end of file diff --git a/snippet-extension/README.md b/snippet-extension/README.md deleted file mode 100644 index 79d9dfa..0000000 --- a/snippet-extension/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# cardano-dev-snippet - -## 🚧 Under Construction 🚧 - -## Introduction - -Snippets for Cardano Development - -## Contribution - -Add or modify the JSON files in the `snippets` folder. The file name should be the language identifier. For example, `mesh-react-hooks.json` for hooks in `@meshsdk/react`. - -## Publishing the Extension -Before publishing, make sure you have the Visual Studio Code Extension Manager installed: -```bash -npm install -g @vscode/vsce -``` - -To generate the `.vsix` file: -```bash -vsce package -``` -* You can install the extension from the `.vsix` file to test it locally. - -To publish the extension to VS Code Marketplace: -```bash -vsce publish -``` \ No newline at end of file diff --git a/snippet-extension/package.json b/snippet-extension/package.json deleted file mode 100644 index 0160b6d..0000000 --- a/snippet-extension/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "cardano-dev-snippet", - "displayName": "cardano-dev-snippet", - "description": "A snippet extension for cardano development", - "version": "0.0.1", - "engines": { - "vscode": "^0.10.5" - }, - "categories": [ - "Snippets" - ], - "contributes": { - "snippets": [ - { - "language": "typescript", - "path": "./snippets/meshsdk-txbuilder.json" - }, - { - "language": "typescript", - "path": "./snippets/meshsdk-wallet-hooks.json" - } - ] - } -} diff --git a/snippet-extension/snippets/meshsdk-txbuilder.json b/snippet-extension/snippets/meshsdk-txbuilder.json deleted file mode 100644 index eacc813..0000000 --- a/snippet-extension/snippets/meshsdk-txbuilder.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "sendLovelace": { - "prefix": "sendLovelace", - "body": [ - "import { Transaction } from '@meshsdk/core';", - "const tx = new Transaction({ initiator: wallet }).sendLovelace('address','1000000');", - "const unsignedTx = await tx.build();", - "const signedTx = await wallet.signTx(unsignedTx);", - "const txHash = await wallet.submitTx(signedTx);" - ], - "description": "Using Mesh Tx Builder to build a transaction to send lovelace to the recipient's address" - }, - "useWalletList": { - "prefix": "walletList", - "body": [ - "const wallets = useWalletList();" - ], - "description": "useWalletList hook" - } -} diff --git a/snippet-extension/snippets/meshsdk-wallet-hooks.json b/snippet-extension/snippets/meshsdk-wallet-hooks.json deleted file mode 100644 index 6c6d954..0000000 --- a/snippet-extension/snippets/meshsdk-wallet-hooks.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "useWallet": { - "prefix": "useWallet", - "body": [ - "const { wallet, connected, name, connecting, connect, disconnect, error } = useWallet();" - ], - "description": "useWallet hook" - }, - "useWalletList": { - "prefix": "useWalletList", - "body": [ - "const wallets = useWalletList();" - ], - "description": "useWalletList hook" - } -}