zen-app-plugin 0.0.2 → 0.0.4

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=require("fs"),{join:a,dirname:f,resolve:u,extname:d}=require("path"),p=require("cos-nodejs-sdk-v5");let l,g,m,x;function y(e){const t=a(e,"package.json"),n=o.readFileSync(t,"utf8");return JSON.parse(n)}function S(e,t){o.readdirSync(e).forEach((n=>{if(0===n.indexOf(".")||n.indexOf(".html")>-1)return;let i=a(e,n),c=o.statSync(i);if(c.isDirectory()&&S(i,a(t,n)),c.isFile()){let e=a(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(o.readFileSync(i,"utf8")))):c.Body=o.createReadStream(i),g.putObject(c,((e,t)=>{}))}}))}function O(e){const t=d(e);if(0===e.indexOf(".")||".html"===t)return;let i;if(i=e.indexOf("dist")>-1?l+e.substr(x.length+5):l+e.substr(x.length+7),n.mkdir("-p",f(i)),!r.includes(t))return n.cp(e,i);const u=o.readFileSync(e,"utf8").replace(c,(e=>e.indexOf("'")>-1||e.indexOf('"')>-1?e:function(e){const t=e.substr(e.indexOf(".vip")+4),s=a(l,t);if(!o.existsSync(s)){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)));o.writeFileSync(i,Buffer.from(s.gzip(u)),"utf8")}function h(e){const t=o.readdirSync(e);for(const n of t){if(n.startsWith("."))continue;const t=a(e,n),s=o.statSync(t);s.isDirectory()?h(t):s.isFile()&&O(t)}}exports.remote=function(t){x=t,m=JSON.parse(o.readFileSync(a(e.homedir(),".cos.json"))),g=new p({SecretId:m.id,SecretKey:m.key});const n=y(t);i.branchLocal(((e,s)=>{let i=n.name,c=s.current;const r=a(t,"dist"),f=a(t,"public");S(r,`${i}/${c}`),o.existsSync(f)&&S(f,`${i}/${c}`)}))},exports.locale=function(e){x=e;const t=y(e).name;n.exec(`rm -rf ../${t}/src/main/resources/static`),l=u(e,"..",t,"src","main","resources","static");const s=a(e,"public"),i=a(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 > "${a(s,e)}"`;n.exec(t)})),h(i),o.existsSync(s)&&h(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("./"),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:l,extname:d}=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=d(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 l=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=d(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(l)),"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=l(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 install -U&&mvn package -Dlocal=true -f pom.xml`)}}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-app-plugin",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "app代码生成器",
5
5
  "main": "index.js",
6
6
  "author": "zen",