Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mhdi-kr committed Jan 13, 2023
1 parent 5753eae commit 910dd92
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 613 deletions.
7 changes: 0 additions & 7 deletions .vscode/extensions.json

This file was deleted.

31 changes: 0 additions & 31 deletions .vscode/launch.json

This file was deleted.

12 changes: 0 additions & 12 deletions .vscode/settings.json

This file was deleted.

39 changes: 0 additions & 39 deletions .vscode/tasks.json

This file was deleted.

44 changes: 33 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,47 @@
# vscode-webvue

vscode webview extension template using vue 3 and vite ⚡
![static/header.png](static/header.png)

## 🚀 How to use it?
An easy solution for building visual studio code extensions using vue and vite ecosystem ⚡

The project is build with monorepo structure containing two packages. The first one is the client and the second one is the vscode extension code itself.
## 🚀 How to use

For running project in development mode use:
![](/static/helloworld.gif)

### Install dependencies

```bash
yarn
```

For running project in development mode use

```bash
yarn run watch
yarn watch
```

after vscode instance opened up use command pallate and then select the `hello world` command
### Adding more commands

Then after VSCode development host opens, use command pallet and select the `hello world` command.

To add more commands to your extension, edit the `package.json` located in the `/packages/extension` directory, and use the keys in your `extension.ts` file using `vscode.commands.registerCommand` method.

## 🔧 How it works

The project is built with monorepo structure containing two packages. The first one being the client, and the second being the visual studio code extension program.

when you start developing on the `/packages/client/` vue application directory, your changes will be watched using nodemon, then rebuilt and be opened inside vscode extension host ready to be used with vscode command pallet!

Here you can see your vue project already built and injected using vscode webview API. you can utilize the full functionality of vue such as its amazing reactivity and its available additions (like `vue-router`) out of the box!

Inside the vue application code, the `vscode` object is globally accessible and can be used to send messages to the vscode runtime and perform tasks such as read/writing files, etc.

![](/docs/screenshot.png)
![](/static/flow.jpg)

Here you can see your vue project already built and injected using vscode webview API. you can utilize the full functionality of vue such as its amazing reactivity and its available plugins out of the box!
## 📄 Blogs

when you start developing on the `/packages/client/` vue application directory, your changes will be watched using nodemon, then rebuilt and be opened inside vscode extension host ready to be used with vscode command pallate!
[Developing a VS Code Extension using Vue 3 and WebView Panels API](https://medium.com/@mhdi_kr/developing-a-vs-code-extension-using-vue-3-and-webview-panels-api-536d87ce653a)

Inside the vue application code, the `vscode` object is globally injected and can be used to send messages to the vscode runtime and perform tasks such as read/writing files, etc.
## 🤝 Contribution

![](/docs/flow.jpg)
If you have any questions or recommendations please create a new issue for it, and if you've hacked together any feature or enhancement, a pull request is more than welcome here! 🙏
Binary file removed docs/screenshot.png
Binary file not shown.
2 changes: 1 addition & 1 deletion nodemon.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"packages/client/node_modules/**/node_modules",
"packages/extension/node_modules/**/node_modules",
"packages/extension/dist",
"packages/extension/vue-dist"
"packages/extension/vue-dist/*"
],
"verbose": true,
"delay": 2500,
Expand Down
5 changes: 4 additions & 1 deletion pipeline.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const cp = require("child_process");
const util = require("util");

const childOptions = {
shell: "bash",
stdio: "inherit",
};
const util = require("util");

const exec = util.promisify(cp.exec);

(async () => {
await Promise.all([
cp.exec("cd packages/client/ && yarn run build", childOptions),
Expand Down
File renamed without changes
Binary file added static/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/helloworld.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 910dd92

Please sign in to comment.