zen-app-plugin 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/compress.js +1 -1
  2. package/package.json +1 -1
package/compress.js CHANGED
@@ -1 +1 @@
1
- !function(){const e=require("os"),t=require("simple-git"),n=require("shelljs"),s=require("pako"),i=t("./"),c=new RegExp("(https?:)?//((b|a)\\.(ebus))\\.vip/.+?\\.(svg|js|png|gif|jpe?g|ttf|woff2?|eot|css)","gi"),r=[".js",".css",".svg"],o=[".js",".css",".xml"],a=require("fs"),{join:u,dirname:f,resolve:d,extname:l}=require("path"),p=require("cos-nodejs-sdk-v5");let g,x,m,y;function S(e){const t=u(e,"package.json"),n=a.readFileSync(t,"utf8");return JSON.parse(n)}function O(e,t){a.readdirSync(e).forEach((n=>{if(0===n.indexOf(".")||n.indexOf(".html")>-1)return;let i=u(e,n),c=a.statSync(i);if(c.isDirectory()&&O(i,u(t,n)),c.isFile()){let e=u(t,n).replace(/\\/gi,"/"),c={Bucket:m.bucket,Region:m.region,Key:e,StorageClass:"STANDARD"},r=e.indexOf(".js")>-1;r||e.indexOf(".css")>-1?(c.Headers={"Content-Encoding":"gzip","Content-Type":r?"application/javascript":"text/css"},c.Body=Buffer.from(s.gzip(a.readFileSync(i,"utf8")))):c.Body=a.createReadStream(i),x.putObject(c,((e,t)=>{}))}}))}function h(e){const t=l(e);if(0===e.indexOf(".")||".html"===t)return;let i;if(i=e.indexOf("dist")>-1?g+e.substr(y.length+5):g+e.substr(y.length+7),n.mkdir("-p",f(i)),!r.includes(t))return n.cp(e,i);const d=a.readFileSync(e,"utf8").replace(c,(e=>e.indexOf("'")>-1||e.indexOf('"')>-1?e:function(e){const t=e.substr(e.indexOf(".vip")+4),s=u(g,t),i=l(s);if(!a.existsSync(s)||o.includes(i)){n.mkdir("-p",f(s));const t=`wget --timeout=15 -O "${s}" "${e.indexOf(":")>-1?e:`https:${e}`}"`;if(0!==n.exec(t).code)return e}return t}(e)));a.writeFileSync(i,Buffer.from(s.gzip(d)),"utf8")}function j(e){const t=a.readdirSync(e);for(const n of t){if(n.startsWith("."))continue;const t=u(e,n),s=a.statSync(t);s.isDirectory()?j(t):s.isFile()&&h(t)}}exports.remote=function(t){y=t,m=JSON.parse(a.readFileSync(u(e.homedir(),".cos.json"))),x=new p({SecretId:m.id,SecretKey:m.key});const n=S(t);i.branchLocal(((e,s)=>{let i=n.name,c=s.current;const r=u(t,"dist"),o=u(t,"public");O(r,`${i}/${c}`),a.existsSync(o)&&O(o,`${i}/${c}`)}))},exports.locale=function(e){y=e;const t=S(e).name;g=d(e,"..",t,"src","main","resources","static");const s=u(e,"public"),i=u(e,"dist");["zen.js","zen.css","zen.wap.js","zen.wap.css"].forEach((e=>{const t=`wget --timeout=15 "https://b.ebus.vip/zeto/latest/${e}" -O - | gunzip > "${u(s,e)}"`;n.exec(t)})),j(i),a.existsSync(s)&&j(s),n.exec(`cd ../${t} &&mvn clean&&mvn package -Dlocal=true -f pom.xml`)}}();
1
+ !function(){const e=require("os"),t=require("simple-git"),n=require("shelljs"),s=require("pako"),i=t("./"),r=new RegExp("(https?:)?//((b|a)\\.(ebus))\\.vip/.+?\\.(svg|js|png|gif|jpe?g|ttf|woff2?|eot|css)","gi"),c=[".js",".css",".svg"],o=[".js",".css",".xml"],u=require("fs"),{join:f,dirname:a,resolve:d,extname:p}=require("path"),l=require("cos-nodejs-sdk-v5");let g,x,y,S;function m(e){const t=f(e,"package.json"),n=u.readFileSync(t,"utf8");return JSON.parse(n)}function O(e,t){u.readdirSync(e).forEach((n=>{if(0===n.indexOf(".")||n.indexOf(".html")>-1)return;let i=f(e,n),r=u.statSync(i);if(r.isDirectory()&&O(i,f(t,n)),r.isFile()){let e=f(t,n).replace(/\\/gi,"/"),r={Bucket:y.bucket,Region:y.region,Key:e,StorageClass:"STANDARD"},c=e.indexOf(".js")>-1;c||e.indexOf(".css")>-1?(r.Headers={"Content-Encoding":"gzip","Content-Type":c?"application/javascript":"text/css"},r.Body=Buffer.from(s.gzip(u.readFileSync(i,"utf8")))):r.Body=u.createReadStream(i),x.putObject(r,((e,t)=>{}))}}))}function h(e){const t=p(e);if(0===e.indexOf(".")||".html"===t)return;let i;if(i=e.indexOf("dist")>-1?g+e.substr(S.length+5):g+e.substr(S.length+7),n.mkdir("-p",a(i)),!c.includes(t))return n.cp(e,i);const d=u.readFileSync(e,"utf8").replace(r,(e=>e.indexOf("'")>-1||e.indexOf('"')>-1?e:function(e){const t=e.substr(e.indexOf(".vip")+4),s=f(g,t),i=p(s);if(!u.existsSync(s)||o.includes(i)){n.mkdir("-p",a(s));const t=`wget --timeout=15 -O "${s}" "${e.indexOf(":")>-1?e:`https:${e}`}"`;if(0!==n.exec(t).code)return e}return t}(e)));u.writeFileSync(i,Buffer.from(s.gzip(d)),"utf8")}function j(e){const t=u.readdirSync(e);for(const n of t){if(n.startsWith("."))continue;const t=f(e,n),s=u.statSync(t);s.isDirectory()?j(t):s.isFile()&&h(t)}}exports.remote=function(t){S=t,y=JSON.parse(u.readFileSync(f(e.homedir(),".cos.json"))),x=new l({SecretId:y.id,SecretKey:y.key});const n=m(t);i.branchLocal(((e,s)=>{let i=n.name,r=s.current;const c=f(t,"dist"),o=f(t,"public");O(c,`${i}/${r}`),u.existsSync(o)&&O(o,`${i}/${r}`)}))},exports.locale=function(e){S=e;const t=m(e).name;g=d(e,"..",t,"src","main","resources","static");const s=f(e,"public"),i=f(e,"dist");["zen.js","zen.css","zen.wap.js","zen.wap.css"].forEach((e=>{const t=`wget --timeout=15 "https://b.ebus.vip/zeto/latest/${e}" -O - | gunzip > "${f(s,e)}"`;n.exec(t)})),j(i),u.existsSync(s)&&j(s)}}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-app-plugin",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "app代码生成器",
5
5
  "main": "index.js",
6
6
  "author": "zen",