Skip to content

Commit

Permalink
feat(init): add template to git ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahdi Karimi committed Dec 19, 2021
1 parent 039245a commit 26f4d51
Show file tree
Hide file tree
Showing 36 changed files with 10,658 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/node_modules
/packages/client/node_modules
/packages/extension/node_modules
/packages/extension/vue-dist
/packages/client/dist
/packages/extension/dist
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tabWidth": 4
}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"johnsoncodehk.volar",
"dbaeumer.vscode-eslint",
"amodio.tsl-problem-matcher"
]
}
31 changes: 31 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// A launch configuration that compiles the extension and then opens it 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": "Run Extension",
// "type": "extensionHost",
// "request": "launch",
// "args": [],
// "outFiles": [],
// "preLaunchTask": "Run extension"
// }
// {
// "name": "Extension Tests",
// "type": "extensionHost",
// "request": "launch",
// "args": [
// "--extensionDevelopmentPath=${workspaceFolder}",
// "--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
// ],
// "outFiles": [
// "${workspaceFolder}/out/**/*.js",
// "${workspaceFolder}/dist/**/*.js"
// ],
// "preLaunchTask": "tasks: watch-tests"
// }
]
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"files.exclude": {
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
},
"search.exclude": {
"out": true, // set this to false to include "out" folder in search results
"dist": true // set this to false to include "dist" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
39 changes: 39 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
// {
// "type": "npm",
// "script": "build",
// "path": "packages/client/",
// "group": "build",
// "problemMatcher": [],
// "label": "Build client",
// "detail": "vue-tsc --noEmit && vite build"
// },
// {
// "type": "npm",
// "script": "compile",
// "path": "packages/extension/",
// "group": "build",
// "problemMatcher": [],
// "label": "Build extension",
// "detail": "webpack"
// },
// {
// "type": "npm",
// "script": "dev",
// "path": "packages/extension/",
// "group": "build",
// "problemMatcher": [],
// "label": "Run instance",
// "detail": "webpack"
// },
// {
// "label": "Run extension",
// "dependsOrder": "sequence",
// "dependsOn": ["Build client", "Build extension", "Run instance"]
// }
]
}
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": ["packages/*"],
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true
}
18 changes: 18 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"restartable": "rs",
"ignore": [
".git",
"node_modules/**/node_modules",
"packages/client/node_modules/**/node_modules",
"packages/extension/node_modules/**/node_modules",
"packages/extension/dist",
"packages/extension/vue-dist"
],
"verbose": true,
"delay": 2500,
"watch": ["packages/*"],
"env": {
"NODE_ENV": "development"
},
"ext": "js,json,ts,vue"
}
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "venom-gui",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"lerna": "^4.0.0",
"nodemon": "^2.0.15",
"typescript": "^4.4.4"
},
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"watch": "nodemon pipeline.js"
}
}
5 changes: 5 additions & 0 deletions packages/client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.DS_Store
dist
dist-ssr
*.local
3 changes: 3 additions & 0 deletions packages/client/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tabWidth": 4
}
7 changes: 7 additions & 0 deletions packages/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Vue 3 + Vite

This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

## Recommended IDE Setup

- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
13 changes: 13 additions & 0 deletions packages/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
16 changes: 16 additions & 0 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "vite-project",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.2.25"
},
"devDependencies": {
"@vitejs/plugin-vue": "^2.0.0",
"vite": "^2.7.2"
}
}
Binary file added packages/client/public/favicon.ico
Binary file not shown.
43 changes: 43 additions & 0 deletions packages/client/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<template>
<div class="centered-screen">
<span class="text-larger">vscode webvue</span>
<span class="text-large">vscode extension development template using vue 3 and vite!</span>
<button @click="increment">increment {{ counter }}</button>
</div>
</template>

<script lang="ts">
export default {
name: 'App',
data: () => ({
counter: 0
}),
methods: {
increment() {
this.counter += 1
vscode.postMessage({
message: 'extension can listen to vue events by using postMessage method!'
})
},
}
}
</script>

<style>
.centered-screen {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.text-larger {
font-size: x-large;
margin-bottom: 1rem;
}
.text-large {
font-size: large;
margin-bottom: 1rem;
}
</style>
8 changes: 8 additions & 0 deletions packages/client/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="vite/client" />

declare module '*.vue' {
import { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
}
4 changes: 4 additions & 0 deletions packages/client/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { createApp } from 'vue'
import App from './App.vue'

createApp(App).mount('#app')
21 changes: 21 additions & 0 deletions packages/client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
},
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "src/main.js"],
"exclude": ["node_modules"]
}
22 changes: 22 additions & 0 deletions packages/client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";

export default defineConfig({
resolve: {
alias: {
"@": resolve(__dirname, "src"),
},
},
plugins: [vue()],
build: {
outDir: "../extension/vue-dist",
rollupOptions: {
output: {
entryFileNames: `assets/[name].js`,
chunkFileNames: `assets/[name].js`,
assetFileNames: `assets/[name].[ext]`,
},
},
},
});
Loading

0 comments on commit 26f4d51

Please sign in to comment.