zen-app-plugin 0.0.1 → 0.0.2
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.
- package/compress.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/zen-app-plugin-0.0.1.tgz +0 -0
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:
|
|
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`)}}();
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){let
|
|
1
|
+
!function(){let e=require("terser-webpack-plugin"),{VueLoaderPlugin:s}=require("vue-loader"),o=require("path"),n=require("fs"),t=require("body-parser"),r=require("./makeIndex"),{makeRootIndex:l,makeSonIndex:i}=r,u=require("./plugin");function a(e,s){if(s.length<2)return;let t,r=s.filter(((s,r)=>(0===r&&(t=o.join(e,s),n.existsSync(t)||n.mkdirSync(t)),r>0)));a(t,r)}var c={entry:{},output:{filename:"[name].js"},watchOptions:{ignored:["node_modules","dist","debug"],poll:300},externals:{vue:"Vue","router-view":"VueRouter","element-plus":"ElementPlus"},plugins:[new s],module:{noParse:/Vue|jquery/,rules:[{test:/\.jsx?$/,exclude:/(node_modules|bower_components)/,use:{loader:"babel-loader",options:{cacheDirectory:!0,presets:[["@vue/app",{modules:"commonjs",loose:!0,useBuiltIns:"entry"}]],plugins:["@babel/plugin-syntax-jsx"]}}},{test:/\.vue$/,loader:"vue-loader"},{test:/\.css$/,use:["style-loader","css-loader"]},{test:/\.scss$/,use:["style-loader","css-loader",{loader:"sass-loader",options:{implementation:require("sass")}}]}]}};module.exports=({target:s,mode:r,ROOT:d})=>{let p,m,g,j,y;for(y=n.readdirSync(o.resolve(d,"src")),g=0,j=y.length;g<j;g++)m=y[g],-1!==m.indexOf(".js")&&(p=o.basename(m),p=p.substr(0,p.length-3),c.entry[p]=o.resolve(d,"src",m));return c.resolve={alias:{"@":o.resolve(d,"src")},extensions:[".js",".vue",".jsx",".json"]},c.mode=r,c.optimization=function(s){return"production"===s?{splitChunks:!1,minimize:!0,minimizer:[new e({parallel:!0,extractComments:!1,exclude:/node_modules/,terserOptions:{compress:{drop_console:!0,collapse_vars:!0,reduce_vars:!0,drop_debugger:!0},mangle:{reserved:["zen","$"]},output:{comments:!1,ascii_only:!0},sourceMap:!1,toplevel:!0,ie8:!1,keep_fnames:!1,safari10:!1}})]}:{}}(r),"development"===r?(c.cache={type:"memory"},c.devServer={open:!0,hot:!1,client:!1,host:"127.0.0.1",allowedHosts:"all",historyApiFallback:!0,onAfterSetupMiddleware:function(e){const{app:s}=e;s.use(t.json());const r=o.join(d,"src","pages");s.post("/coder/read",(function(e,s){const{file:t,key:l}=e.body;if(!t)return s.json({code:10001,message:"参数错误"});const i=o.join(r,t);if(!n.existsSync(i))return s.json({code:1e4,data:null});let u={code:1e4,data:n.readFileSync(i,"utf-8")};s.json(u)})),s.post("/coder/write",(function(e,s){const{file:t,content:u,type:c}=e.body;if(!t)return s.json({code:10001,message:"参数错误"});const d=t.split("/");a(r,d);const p=o.join(r,t);if(n.writeFileSync(p,u),"page"===c){const e=d.splice(0,d.length-2),s=o.join(r,e.join(o.sep));if(0===e.length)return l(r);i(s,e.join("/"),r)}s.json({code:1e4,message:"操作成功"})}))},static:{directory:o.join(d,"public")},headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Headers":"*"}}):(c.devtool=!1,c.output.clean=!0,c.output.path=o.join(d,"dist")),c.plugins.push(new u(s)),c}}();
|
package/package.json
CHANGED
package/zen-app-plugin-0.0.1.tgz
DELETED
|
Binary file
|