aiot-project-templates
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,2 +0,2 @@ | ||
(()=>{var e=[(e,t,r)=>{const s=r(1),a=r(2),i=r(3),o={watch:"Vela","tv-h5":"MinaH5","tv-quickapp":"MinaQuickApp",phone:"QuickApp"};let n=i.resolve(__dirname,"./templates");function l(e){let t=i.resolve(n,e),r=i.resolve(t,"./src/manifest.json"),s=i.resolve(t,"./manifest.json"),a=i.resolve(t,"package.json");return new Promise((async(e,i)=>{try{let i={},n=await Promise.allSettled([c(r),c(s)]);for(var o of n)"fulfilled"===o.status&&(i.type=o.value.deviceTypeList[0]);let l=await c(a);l.privateDesc&&(i.detail=l.privateDesc),i.url=t,e(i)}catch(e){i(e)}}))}function c(e){return new Promise((async(t,r)=>{try{if(a.existsSync(e)){let r=await s.readFile(e);r=JSON.parse(r),t(r)}else r({msg:"文件不存在"})}catch(e){r(e)}}))}"dev"===process.env.NODE_ENV&&(n=i.resolve(__dirname,"../templates")),e.exports=function(){return new Promise((async(e,t)=>{try{let t=await s.readdir(n),a=await(r=t,new Promise((async(e,t)=>{try{let t=[],s={};for(let e of r)t.push(await l(e));for(let e of t){let t=o[e.type],r=e.detail||"default";t&&(!s[t]&&(s[t]={}),!s[t][r]&&(s[t][r]=e))}e(s)}catch(e){t(e)}})));e(a)}catch(e){t(e)}var r}))}},e=>{"use strict";e.exports=require("fs/promises")},e=>{"use strict";e.exports=require("fs")},e=>{"use strict";e.exports=require("path")}],t={};var r=function r(s){if(t[s])return t[s].exports;var a=t[s]={exports:{}};return e[s](a,a.exports,r),a.exports}(0);module.exports=r})(); | ||
(()=>{var e=[(e,t,r)=>{const s=r(1),a=r(2),i=r(3),o={watch:"Vela","tv-h5":"MinaH5","tv-quickapp":"MinaQuickApp",phone:"QuickApp"};let n=i.resolve(__dirname,"./templates");function l(e){let t=i.resolve(n,e),r=i.resolve(t,"./src/manifest.json"),s=i.resolve(t,"./manifest.json"),a=i.resolve(t,"package.json");return new Promise((async(e,o)=>{try{let o={},l=await Promise.allSettled([c(r),c(s)]);for(var n of l)"fulfilled"===n.status&&(o.type=n.value.deviceTypeList[0],o.icon=n.value.icon);let p=await c(a);p.privateDesc&&(o.detail=p.privateDesc),o.dest=t,o.icon=i.join(t,o.icon),e(o)}catch(e){o(e)}}))}function c(e){return new Promise((async(t,r)=>{try{if(a.existsSync(e)){let r=await s.readFile(e);r=JSON.parse(r),t(r)}else r({msg:"文件不存在"})}catch(e){r(e)}}))}"dev"===process.env.NODE_ENV&&(n=i.resolve(__dirname,"../templates")),e.exports=function(){return new Promise((async(e,t)=>{try{let t=await s.readdir(n),a=await(r=t,new Promise((async(e,t)=>{try{let t=[],s={};for(let e of r)t.push(await l(e));for(let e of t){let t=o[e.type];delete e.type;let r=e.detail||"default";delete e.detail,t&&(!s[t]&&(s[t]={}),!s[t][r]&&(s[t][r]=e))}e(s)}catch(e){t(e)}})));e(a)}catch(e){t(e)}var r}))}},e=>{"use strict";e.exports=require("fs/promises")},e=>{"use strict";e.exports=require("fs")},e=>{"use strict";e.exports=require("path")}],t={};var r=function r(s){if(t[s])return t[s].exports;var a=t[s]={exports:{}};return e[s](a,a.exports,r),a.exports}(0);module.exports=r})(); | ||
//# sourceMappingURL=main.js.map |
{ | ||
"name": "aiot-project-templates", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"main": "./dist/main.js", | ||
@@ -5,0 +5,0 @@ "author": "zhaoyinggang", |
@@ -1,1 +0,7 @@ | ||
## 在package.json文件中添加privateDesc字段,表示一个特殊的项目类别 | ||
## aiot-ide 项目管理插件的项目模板仓库 | ||
### 使用: | ||
```js | ||
// 调用getTemplates函数即可获取当前支持的所有模板;该方法返回一个Promise | ||
let getTemplates = require("aiot-project-templates"); | ||
``` |
Sorry, the diff of this file is not supported yet
5560480
152
8