Commit 3d18cfb7 authored by 郭铭瑶's avatar 郭铭瑶 🤘

完善&打包

parent 0191e472
# my-cli README ## my-cli
This is the README for your extension "my-cli". After writing up a brief description, we recommend including the following sections. A tool to generate frontend project with template
## Features ---
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. ### usage
For example if there is an image subfolder under your extension project workspace: ![](https://git.omniview.pro/yaominguo/my-cli/record.gif)
\!\[feature X\]\(images/feature-x.png\) #### or
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. `ctrl + f10` for win
## Requirements `cmd + f10` for mac
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
## Extension Settings
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
For example:
This extension contributes the following settings:
* `myExtension.enable`: enable/disable this extension
* `myExtension.thing`: set to `blah` to do something
## Known Issues
Calling out known issues can help limit users opening duplicate issues against your extension.
## Release Notes
Users appreciate release notes as you update your extension.
### 1.0.0
Initial release of ...
### 1.0.1
Fixed issue #.
### 1.1.0
Added features X, Y, and Z.
-----------------------------------------------------------------------------------------------------------
## Following extension guidelines
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines)
## Working with Markdown
**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux)
* Toggle preview (`Shift+CMD+V` on macOS or `Shift+Ctrl+V` on Windows and Linux)
* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (macOS) to see a list of Markdown snippets
### For more information
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
**Enjoy!**
import{p as e,a as t,o as a,c as l,r as n,w as s,b as o,d as i,e as c,f as d,g as u,v as r,F as m,h as p,i as v,j as y,k as g,t as b,l as f}from"./vendor.f6a3a0fc.js";const k={name:"MyLoader",displayName:"m-loader",props:{background:{type:String,default:"rgba(0,0,0,0.3)"}}},C=s();e("data-v-6ecfd4d3");const L=o("div",{class:"my-loader"},[o("div",{class:"outer"}),o("div",{class:"middle"}),o("div",{class:"inner"})],-1);t();const h=C(((e,t,s,o,i,c)=>(a(),l("div",{class:"my-loader-mask",style:`background:${s.background}`},[L,n(e.$slots,"default",{},void 0,!0)],4))));k.render=h,k.__scopeId="data-v-6ecfd4d3";const w={name:"Main",components:{Loader:k},setup(){const e=i([{title:"Vue3版大屏",desc:"Vue3.0 + TypeScript + Vite2.0大屏用",url:"gitee:guomingyao/my-view"},{title:"Vue2大屏",desc:"Vue2.0大屏用",url:"gitee:guomingyao/monitor-template"},{title:"Vite App",desc:"Vue3.0 + Vite2.0 普通项目用",url:"gitee:guomingyao/my-vite-app"},{title:"微前端",desc:"微前端父项目模板",url:"gitee:guomingyao/micfrontend-template"}]),t=i(1),a=i(null),l=i(null),n=i(!1),s=i(null),o=i(null),u=e=>{const{command:i,data:c}=e.data;switch(i){case"DIRECTORY":o.value=c.text;break;case"CLOSE_LOADER":n.value=!1,t.value=1,a.value=null,l.value=null,s.value=null,o.value=null}};c((()=>{window.addEventListener("message",u)})),d((()=>{window.removeEventListener("message",u)}));return{step:t,curIndex:a,curData:l,templates:e,filename:s,directory:o,onClick:(e,t)=>{l.value=e,a.value=t},selectDirectory:()=>{vscode.postMessage({command:"SELECT_FOLDER"})},toStep:e=>{t.value=e},submit:()=>{n.value=!0,vscode.postMessage({command:"FETCH_PROJECT",data:{url:l.value.url,filePath:o.value,filename:s.value}})},showLoader:n}}},E=s();e("data-v-2de735e0");const V=o("h2",null,"选择模板",-1),D={class:"wrapper"},S=o("h2",null,"项目配置",-1),_={class:"item"},M={class:"item directory"};t();const x=E(((e,t,n,s,i,c)=>{const d=g("Loader");return a(),l("main",null,[u(o("section",null,[V,o("div",D,[(a(!0),l(m,null,p(s.templates,((e,t)=>(a(),l("div",{key:e.title},[o("div",{class:["inner",{on:s.curIndex===t}],onClick:a=>s.onClick(e,t)},[o("h3",null,b(e.title),1),o("span",null,b(e.desc),1)],10,["onClick"])])))),128))]),o("button",{onClick:t[1]||(t[1]=e=>s.toStep(2)),class:""+(s.curData?"btn":"disable-btn")},"下一步",2)],512),[[r,1===s.step]]),u(o("section",null,[S,o("div",_,[u(o("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=e=>s.filename=e),title:s.filename,placeholder:"请输入项目名称"},null,8,["title"]),[[v,s.filename]])]),o("div",M,[o("input",{value:s.directory,title:s.directory,type:"text",placeholder:"请选择项目存放路径",readonly:""},null,8,["value","title"]),o("button",{class:"btn",onClick:t[3]||(t[3]=(...e)=>s.selectDirectory&&s.selectDirectory(...e))},"选择")]),o("button",{onClick:t[4]||(t[4]=(...e)=>s.submit&&s.submit(...e)),class:""+(s.filename&&s.directory?"btn":"disable-btn")},"完成",2),o("button",{onClick:t[5]||(t[5]=e=>s.toStep(1)),class:"btn"},"上一步")],512),[[r,2===s.step]]),s.showLoader?(a(),l(d,{key:0})):y("",!0)])}));w.render=x,w.__scopeId="data-v-2de735e0";const I={name:"App",components:{Main:w}};I.render=function(e,t,n,s,o,i){const c=g("Main");return a(),l(c)};f(I).mount("#app");
import{p as e,a as t,o as a,c as l,r as s,w as n,b as o,d as i,e as c,f as d,g as r,v as u,F as m,h as p,i as v,j as y,k as b,t as g,l as f}from"./vendor.f6a3a0fc.js";const k={name:"MyLoader",displayName:"m-loader",props:{background:{type:String,default:"rgba(0,0,0,0.3)"}}},C=n();e("data-v-6ecfd4d3");const L=o("div",{class:"my-loader"},[o("div",{class:"outer"}),o("div",{class:"middle"}),o("div",{class:"inner"})],-1);t();const h=C(((e,t,n,o,i,c)=>(a(),l("div",{class:"my-loader-mask",style:`background:${n.background}`},[L,s(e.$slots,"default",{},void 0,!0)],4))));k.render=h,k.__scopeId="data-v-6ecfd4d3";const w={name:"Main",components:{Loader:k},setup(){const e=i(null),t=i(1),a=i(null),l=i(null),s=i(!1),n=i([{title:"Vue3版大屏",desc:"Vue3.0 + TypeScript + Vite2.0大屏用",url:"gitee:guomingyao/my-view"},{title:"Vue2大屏",desc:"Vue2.0大屏用",url:"gitee:guomingyao/monitor-template"},{title:"Vite App",desc:"Vue3.0 + Vite2.0 普通项目用",url:"gitee:guomingyao/my-vite-app"},{title:"微前端",desc:"微前端父项目模板",url:"gitee:guomingyao/micfrontend-template"}]),o=i(null),r=i(null),u=e=>{const{command:t,data:a}=e.data;switch(t){case"DIRECTORY":r.value=a.text;break;case"CLOSE_LOADER":s.value=!1}};c((()=>{window.addEventListener("message",u)})),d((()=>{window.removeEventListener("message",u)}));return{fileRef:e,step:t,curIndex:a,curData:l,templates:n,filename:o,directory:r,onClick:(e,t)=>{l.value=e,a.value=t},selectDirectory:()=>{vscode.postMessage({command:"SELECT_FOLDER"})},toStep:e=>{t.value=e},submit:()=>{s.value=!0,vscode.postMessage({command:"FETCH_PROJECT",data:{url:l.value.url,filePath:r.value,filename:o.value}})},showLoader:s}}},E=n();e("data-v-12b72188");const V=o("h2",null,"选择模板",-1),D={class:"wrapper"},S=o("h2",null,"项目配置",-1),_={class:"item"},M={class:"item directory"};t();const R=E(((e,t,s,n,i,c)=>{const d=b("Loader");return a(),l("main",null,[r(o("section",null,[V,o("div",D,[(a(!0),l(m,null,p(n.templates,((e,t)=>(a(),l("div",{key:e.title},[o("div",{class:["inner",{on:n.curIndex===t}],onClick:a=>n.onClick(e,t)},[o("h3",null,g(e.title),1),o("span",null,g(e.desc),1)],10,["onClick"])])))),128))]),o("button",{onClick:t[1]||(t[1]=e=>n.toStep(2)),class:""+(n.curData?"btn":"disable-btn")},"下一步",2)],512),[[u,1===n.step]]),r(o("section",null,[S,o("div",_,[r(o("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=e=>n.filename=e),title:n.filename,placeholder:"请输入项目名称"},null,8,["title"]),[[v,n.filename]])]),o("div",M,[o("input",{value:n.directory,title:n.directory,type:"text",placeholder:"请选择项目存放路径",readonly:""},null,8,["value","title"]),o("button",{class:"btn",onClick:t[3]||(t[3]=(...e)=>n.selectDirectory&&n.selectDirectory(...e))},"选择")]),o("button",{onClick:t[4]||(t[4]=(...e)=>n.submit&&n.submit(...e)),class:""+(n.filename&&n.directory?"btn":"disable-btn")},"完成",2),o("button",{onClick:t[5]||(t[5]=e=>n.toStep(1)),class:"btn"},"上一步")],512),[[u,2===n.step]]),n.showLoader?(a(),l(d,{key:0})):y("",!0)])}));w.render=R,w.__scopeId="data-v-12b72188";const x={name:"App",components:{Main:w}};x.render=function(e,t,s,n,o,i){const c=b("Main");return a(),l(c)};f(x).mount("#app");
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Cli</title> <title>My Cli</title>
<script type="module" crossorigin src="./assets/index.81937249.js"></script> <script type="module" crossorigin src="./assets/index.6ed84c4a.js"></script>
<link rel="modulepreload" href="./assets/vendor.f6a3a0fc.js"> <link rel="modulepreload" href="./assets/vendor.f6a3a0fc.js">
<link rel="stylesheet" href="./assets/index.bbf0b1ef.css"> <link rel="stylesheet" href="./assets/index.32d76172.css">
</head> </head>
<body> <body>
......
...@@ -35,11 +35,6 @@ export default { ...@@ -35,11 +35,6 @@ export default {
name: 'Main', name: 'Main',
components: {Loader}, components: {Loader},
setup() { setup() {
const fileRef = ref(null)
const step = ref(1)
const curIndex = ref(null)
const curData = ref(null)
const showLoader = ref(false)
const templates = ref([ const templates = ref([
{ {
title: 'Vue3版大屏', title: 'Vue3版大屏',
...@@ -62,6 +57,10 @@ export default { ...@@ -62,6 +57,10 @@ export default {
url: 'gitee:guomingyao/micfrontend-template', url: 'gitee:guomingyao/micfrontend-template',
}, },
]) ])
const step = ref(1)
const curIndex = ref(null)
const curData = ref(null)
const showLoader = ref(false)
const filename = ref(null) const filename = ref(null)
const directory = ref(null) const directory = ref(null)
const onClick = (data, i) => { const onClick = (data, i) => {
...@@ -76,6 +75,11 @@ export default { ...@@ -76,6 +75,11 @@ export default {
break; break;
case 'CLOSE_LOADER': case 'CLOSE_LOADER':
showLoader.value = false showLoader.value = false
step.value = 1
curIndex.value = null
curData.value = null
filename.value = null
directory.value = null
break; break;
default: default:
break; break;
...@@ -108,7 +112,6 @@ export default { ...@@ -108,7 +112,6 @@ export default {
}) })
} }
return { return {
fileRef,
step, step,
curIndex, curIndex,
curData, curData,
......
logo.png

1.48 KB

This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
"description": "A tool to generate frontend project with template", "description": "A tool to generate frontend project with template",
"version": "0.0.1", "version": "0.0.1",
"publisher": "GuoMingyao", "publisher": "GuoMingyao",
"icon": "logo.png",
"license": "MIT",
"engines": { "engines": {
"vscode": "^1.57.0" "vscode": "^1.58.0"
}, },
"categories": [ "categories": [
"Other" "Other"
...@@ -60,7 +62,7 @@ ...@@ -60,7 +62,7 @@
"@types/glob": "^7.1.3", "@types/glob": "^7.1.3",
"@types/mocha": "^8.2.2", "@types/mocha": "^8.2.2",
"@types/node": "14.x", "@types/node": "14.x",
"@types/vscode": "^1.57.0", "@types/vscode": "^1.58.0",
"@typescript-eslint/eslint-plugin": "^4.26.0", "@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0", "@typescript-eslint/parser": "^4.26.0",
"eslint": "^7.27.0", "eslint": "^7.27.0",
...@@ -73,6 +75,7 @@ ...@@ -73,6 +75,7 @@
"webpack-cli": "^4.7.0" "webpack-cli": "^4.7.0"
}, },
"dependencies": { "dependencies": {
"got": "^11.8.2",
"npm-gitee-lw": "^1.0.3" "npm-gitee-lw": "^1.0.3"
} }
} }
record.gif

37.2 KB

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment