miru
Version:
web development server for bundlers and/or static files, parses terminal and DOM errors ( inline sourcemaps supported )
1 lines • 21.9 kB
JavaScript
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).miru=e()}(function(){return function i(s,a,c){function l(t,e){if(!a[t]){if(!s[t]){var o="function"==typeof require&&require;if(!e&&o)return o(t,!0);if(u)return u(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var n=a[t]={exports:{}};s[t][0].call(n.exports,function(e){return l(s[t][1][e]||e)},n,n.exports,i,s,a,c)}return a[t].exports}for(var u="function"==typeof require&&require,e=0;e<c.length;e++)l(c[e]);return l}({1:[function(we,e,t){(function(e){"use strict";var r,g=we("fs"),m=we("path"),i=we("child_process"),c=we("cross-spawn-with-kill"),l=(we("tree-kill"),we("find-root")),n=we(m.join(l(e),"assets.js")),o=we("redstar"),u=we("nozombie")();function t(){clearTimeout(r),process.exit()}process.on("SIGTERM",t),process.on("SIGINT",t),process.on("exit",function(){});var s,a,d,h=we("path-shorten"),f=we("passlint"),p={parse:we("ua-parser-js")},v=we("miteru"),w=we("wooster"),x=[],y=v.watch(function(e,t){var o,n;"add"!==e&&"init"!==e||(o=y.getWatched().length,clearTimeout(r),r=setTimeout(function(){var e=y.getWatched().length;o===e&&console.log("number of --files watched: "+o)},200)),"add"!==e&&"change"!==e||(n=m.relative(process.cwd(),t),x.forEach(function(r){console.log("command: "+r),r=r.split("$evt").join(e).split("$file").join(n),console.log("executing: "+r),i.exec(r,function(e,t,o){t&&console.log(t),o&&console.log(o),e&&e.code&&console.error("exec err code: "+e.code+", cmd: "+r)})}))}),b=v.watch(function(e,u){switch(e){case"add":case"change":g.readFile(u,"utf8",function(e,t){var o=!1;e&&(console.log(I.bgRed("warning: target file ["+I.magenta(h(u))+"] was unreadable")),console.log(e));var r,n,i,s,a=m.resolve(u),c=U[a],l=c&&c.w;if(l&&l.regex||($.timeout&&(r=" Ignoring output/target bundle (".concat(c.targetfilepath,") because an error was being debounced. ~").concat($.DEBOUNCE," milliseconds ago."),_.emit("info",r)),c&&!$.timeout&&(n=Date.now()-c.errorTimestamp,!c.errorTimestamp||200<n?(i="\n Clearing errors on any output/target bundle (".concat(c.targetfilepath,") file-changes detected without specified regex ( -r flag ) arguments.\n For best use please attach a regex ( -r flag ) argument to your watch command ( -w [ ... ] ) to parse successful builds.\n E.g. 'miru -w [ npm run watch:js -o bundle.js -r /bytes.written/ ]'\n "),_.emit("info",i),c.error=void 0,c.output=void 0):(s=" Ignoring output/target bundle (".concat(c.targetfilepath,") because an error was detected ").concat(200," milliseconds ago."),_.emit("info",s),_.emit("terminal-error",{target:c.targetfilepath,timestamp:c.errorTimestamp||Date.now(),output:c.output,error:c.error})))),c&&c.error&&(o=!0),!l||!l.regex)if(!1===o){if(Date.now()-c.emit_timestamp<750)return q("already recently emitted, ignoring");fe("file change detected",m.relative(process.cwd(),u)),c.emit_timestamp=Date.now(),_.emit("target-build",{target:u}),le(c.targetfilepath)}else q(" === target error detected ["+target+"] ignoring === ")})}}),E=we("string-width"),O=(we("assert"),we("http")),j=we("express"),T=we("cors"),k=we("body-parser"),D=we("compression"),S=j(),R=O.createServer(S),_=we("kiite")(R),C=we("os"),I=we("cli-color"),M=JSON.parse(n.packageJson),N=[],L="",A=!1,W=we("subarg")(process.argv.slice(2),{alias:{watch:["w","watcher","watched"],file:["f","files"],execute:["e","ex","exe","exec"],targets:["t","targets"],csslint:["lintcss"],jslint:["lintjs"],lint:[],reload:["force-reload","r","cssreload"],logs:["log"],debounce:[],throttle:[],"public-path":["public","p","path"],"no-wooster":[],"no-miru-connect":[],"no-clear":[],"no-info":["noinfo"],development:["D"],port:["P"],address:["A"],verbose:["v"],version:["V"],help:["h"]},boolean:["noflicker","nolimit","version","verbose","help","no-wooster","no-miru-connect","no-clear","no-info","development"],unknown:function(e){console.log("unknown argument: "+e)}}),F=!!W.reload,z=!!W.noinfo,B=!!W.verbose,U={};function q(){B&&console.log.apply(this,arguments)}W.targets&&(s=function(e){q("adding watch target: "+e),b.add(e);var t=m.resolve(e);q("initializing target: "+t),U[t]={error:void 0,output:void 0,emit_timestamp:0,targetfilepath:t},0==--d&&a()},a=function(){q("target files watched :"),q(b.getWatched())},"string"==typeof(P=W.targets)&&(P=[P]),P instanceof Array||(console.error("-t, --targets <string> parse error - missing file names?"),process.exit(1)),d=0,P.forEach(function(e){var t;o.hasMagic(e)?(t=e.trim(),d++,o(t,function(e,t,o){d--,(t||[]).forEach(function(e){d++,s(e)})})):(d++,s(e))})),q("verbose: "+B);var G=W["public-path"];G||(G=process.cwd(),q("-p, --public-path, --path, --public was unset, defaulting to process.cwd()")),q("publicPath is: "+(G=m.resolve(G)));var H,P,J,X=33,$={timeout:void 0,DEBOUNCE:33,THROTTLE:1e3,history:[]},V={},K=W.port||4040,Q=W.address||"0.0.0.0";W.version&&(console.log("miru version: "+M.version),process.exit(0)),W.help&&(H=n.usage,console.log(H),process.exit(0)),W.file&&("string"==typeof(P=W.file)&&(P=[P]),P instanceof Array||(console.error("-f, --file, --files <string> parse error - missing file names?"),process.exit(1)),P.forEach(function(e){q("adding watch file: "+e),y.add(e)}),q("watched files:"),q(y.getWatched())),W.execute&&("string"==typeof(J=W.execute)&&(J=[J]),J instanceof Array||(console.error("-e, --execute <string> parse error - missing commands?"),process.exit(1)),x=J),q("executions: "),q(x);var Y,Z=[];W.watch&&((Z=W.watch)instanceof Array||(Z=[Z]),q(Z),Y=[],Z.forEach(function(t){var e,o=t._.join(" ");t.o=t.o||t.output,t.r=t.r||t.regex,t.o instanceof Array&&(console.error("invalid --watch [ <command> -o <file> ] syntax detected."),console.error(" multiple -o args detected!"),console.error(" wrap your <command> inside string quotations \"<command>\" or '<command>'"),console.error(t),process.exit(1)),t.o||(console.error("invalid --watch [ <command> -o <file> ] syntax detected!"),console.error("Missing -o,--output <file>."),console.error("samples:"),console.error(" miru -w [ npm run watch:js -o dist/bundle.js ]"),console.error(" miru -w [ 'webpack --watch src/main.js -o dist/bundle.js' -o dist/bundle.js ]"),console.error(t),process.exit(1)),(t={command:o.trim(),targetfilepath:t.o.trim(),regex:t.r}).regex&&("/"===(e=t.regex=t.regex.trim())[0]&&"/"===e[e.length-1]&&(e=e.slice(1,-1)),t.RegExp=RegExp(e)),q("command: "+t.command),q("target file: "+t.targetfilepath),q("regex: "+t.regex),Y.push(t);var r=m.resolve(t.targetfilepath);q("initializing target: "+t.targetfilepath),U[r]={w:t,error:void 0,output:void 0,emit_timestamp:0,targetfilepath:r},b.add(r);try{g.statSync(m.resolve(t.targetfilepath))}catch(e){"ENOENT"===e.code?console.error("warning: watcher target file does not exist: "+t.targetfilepath):console.error("warning: could not access watcher target file: "+t.targetfilepath)}}),Z=Y),q("watchers: "),q(Z);var ee=n.miruConnectSource,te=m.join(G,"miru-connect.js");function oe(){try{W["no-miru-connect"]||re();try{if(g.readFileSync(te,"utf8")!==ne())throw new Error("failed to save miru-connect.js to: "+te);q("up to date miru-connect.js found at: "+te)}catch(e){throw q("failed to save miru-connect.js to: "+te),e}W.development&&(v.watch(ee,function(e,t){switch(e){case"add":case"change":re(),console.log("emitting reload on miru-connect.js change"),function(e,t){t?console.log("emitting: '".concat(e,"', ").concat(t)):console.log("emitting: '".concat(e,"'"));_.emit(e,t)}("reload","reloaded\nmiru-connect.js updated")}}),console.log("watching miru-connect.js"))}catch(e){throw q("failed to load or save miru-connect.js to users project"),e}}function re(){g.writeFileSync(te,ne()),q("miru-connect.js saved to: "+te)}function ne(){var e=g.readFileSync(ee,"utf8");return e="\n ;(function () {\n window.__miru = {\n port: ".concat(K,",\n verbose: ").concat(!!B,",\n enableLogs: ").concat(!!W.logs,",\n forceReload: ").concat(F,",\n hideInfo: ").concat(z,",\n styleFlicker: ").concat(!W.noflicker,",\n targets: ").concat(JSON.stringify(b.getWatched()),"\n }\n })();\n ").concat(e,"\n ")}q("[express]: cors"),S.options(T()),S.use(T()),S.use(D()),S.get("/favicon*",function(e,t){t.sendFile(n.favicon)}),S.get("/__miru/pesticide.css",function(e,t){t.sendFile(n.pesticide)}),S.post("/__miru/woosterify",k.json({limit:"50mb"}),function(e,t){var o,r=e.body,n=w.parseContext({prettify:!0,text:r.text,filename:r.filename,lineno:r.lineno,colno:r.colno}),i=se(e.headers["user-agent"]),s=w.createMessage({postintro:" "+I.bgWhite("DOM Error")+" ["+i+"]",message:r.message,filename:n.filename,ctx:n}),a=void 0;n.usedSourceMap&&(o=w.parseContext({prettify:!0,disableSourceMaps:!0,text:r.text,filename:r.filename,lineno:r.lineno,colno:r.colno}),a=w.createMessage({message:r.message,filename:o.filename,ctx:o})),function(){for(var e=Object.keys(U),t=0;t<e.length;t++){var o=e[t],r=U[o];if(o&&r&&r.output&&r.error)return q(" === TERMINAL ERROR FOUND: "+o),q(" === TERMINAL ERROR FOUND: "+o),q(" === TERMINAL ERROR FOUND: "+o)}}(),t.status(200).json({target:"DOM",name:"Error",message:s,origin:a}).end()}),S.post("/__miru/console",k.json({limit:"50mb"}),function(e,t){e.body.host;var o=se(e.get("user-agent"));V[o].logs=logs}),q("[express]: static directory: "+G),S.use(j.static(G)),S.get("/",function(e,t,o){t.sendFile(n.indexHTML)});var ie={};function se(e){var t=p.parse(e),o="";return o+=t.os.name,o+=" "+t.os.version,o+=" "+t.browser.name,o+=" "+t.browser.version,o+=" "+t.device.vendor,o+=" "+t.device.model,o=(o+=" "+t.device.type).split(/\s+/).filter(function(e){var t=e.toLowerCase().trim();return"other"!==t&&"0.0.0"!==t&&"undefined"!==t&&t}).join(" ").trim()}_.on("connect",function(n){var e=se(n.request.headers["user-agent"]),t={id:e};V[e]=t,n.miru={client:t},process.stdout.write(I.move.to(0,I.windowSize.height)),process.stdout.write(I.erase.line),process.stdout.write("client connected: "+e),process.stdout.write("\n"),A&&n.emit("pesticide",A),F&&n.emit("cssreload",F),z&&n.emit("hide-info",z),Object.keys(U).forEach(function(e){var t=U[e];t&&t.output&&t.error&&(console.log("emitting unresolved error to new connection"),console.log(e),t.errorTimestamp=Date.now(),n.emit("terminal-error",{timestamp:Date.now(),output:t.output,error:t.error}))}),n.on("ack",function(e){ie[e]=!0,setTimeout(function(){delete ie[e]},3e4)}),n.on("console",function(e){e.host;var t=n.miru.client.id,o=V[t],r=e.logs;r.forEach(function(e){}),o.logs=r}),n.on("disconnect",function(){n.miru.client.id}),n.on("print-dom-error-message",function(e){q("evt: print-dom-error-message"),setTimeout(function(){q("printing DOM Error (evt: print-dom-error-message)"),ge(e)},250)})});function ae(){console.log("LAN addresses: "+function(){var e,t,o=C.networkInterfaces(),r=[];for(e in o)for(t in o[e]){var n=o[e][t];"IPv4"!==n.family||n.internal||r.push(n.address)}return r}().join(","))}function ce(d){d.rw&&(q("closing recovery watcher, files watched: "+d.rw.getWatched().length),d.rw.clear(),d.rw.close(),0===d.rw.getWatched().length&&console.log("recovery watcher closed"),N=[],delete d.rw);var e=d.command;m.resolve(d.targetfilepath);"string"==typeof e&&(e=e.split(/\s+/));var t,o=e[0],r=e.slice(1),n=e.slice(-1)[0];try{"npm"!==o||(t=we(m.join(l(process.cwd()),"package.json")).scripts[n])&&(o=(e=t.split(/\s+/))[0],r=e.slice(1))}catch(e){}q("cmd: "+d.command),q("spawning: "+o+" "+r.join(" ")),q();var i,s=c(o,r);u.add(s.pid);function a(e){var t=e.toString("utf8");f+=t,clearTimeout(i),i=setTimeout(function(){var t=!1,e=f.split("\n");if(f="",e.forEach(function(e){-1!==e.toLowerCase().indexOf("error")&&(t=!0)}),e=e.filter(function(e){return-1===e.indexOf("node_modules")}),t){q(" == Errors found == ");var o=e.join("\n");ue(m.resolve(d.targetfilepath),o)}else{if(d.regex){for(var r,n,i=!1,s=d.RegExp,a=0;a<e.length;a++){var c,l=e[a],u=s.exec(l);s.lastIndex=0,null!=u?(i=!0,c=u[0],console.log(l.split(c).join(I.bgGreen(c)))):console.log(l)}i?(q(" ========= REGEX MATCHED ======= "),q(" ========= REGEX MATCHED ======= "),q(" ========= REGEX MATCHED ======= "),r=m.resolve(d.targetfilepath),n=U[r],q("clearing: "+r),n&&(n.error=void 0,n.output=void 0),function(e,o){e=m.resolve(e);var t=0,r=15,n=void 0,i=16;function s(){setTimeout(a,i)}function a(){if(r<t)return o("max attempts reached");t++,g.stat(e,function(e,t){return e?s():0<t.size&&n===t.size?o(null):(n=t.size,s())})}s()}(r,function(e){return e&&console.error(e),Date.now()-n.emit_timestamp<750?console.log("already recently emitted, ignoring"):(fe("stdout regex matched",m.relative(process.cwd(),r)),n.emit_timestamp=Date.now(),_.emit("target-build",{target:d.targetfilepath}),void le(d.targetfilepath))})):(q(" -- no regex match --"),q(" -- no regex match --"),q(" -- no regex match --"))}else e.forEach(function(e){console.log(e)});g.stat(m.resolve(d.targetfilepath),function(e,t){e&&("ENOENT"===e.code?console.error("warning: watcher target file does not exist: "+d.targetfilepath):console.error("warning: could not access watcher target file: "+d.targetfilepath))})}},X)}var f="";s.stdout.on("data",a),s.stderr.on("data",a),s.on("exit",function(){setTimeout(function(){console.log(" watcher exited [ "+d.command+" ], target: "+d.targetfilepath),function(o){console.log("launching recovery watcher for [ "+o.command+" ], target: "+o.targetfilepath);var r,n,e=o.targetfilepath;function t(e,t){switch("init"===e&&o.rw&&(clearTimeout(n),n=setTimeout(function(){N=o.rw.getWatched().slice(),console.log("recovery watcher watching "+N.length+" files - type 'recovery' to see list")},300)),e){case"add":case"change":q("recovery watcher change detected: "+t),clearTimeout(r),r=setTimeout(function(){o.rw&&(q("closing recovery watcher, files watched: "+o.rw.getWatched().length),o.rw.clear(),o.rw.close(),0===o.rw.getWatched().length&&q("recovery watcher closed"),N=[],delete o.rw),ce(o)},1500)}}0<e.indexOf(".css")||0<e.indexOf(".styl")||0<e.indexOf(".sass")||0<e.indexOf(".scss")||0<e.indexOf(".less")?(q("recovering style watcher"),o.rw=v.watch(t),o.rw.add("**/*.css"),o.rw.add("**/*.styl"),o.rw.add("**/*.sass"),o.rw.add("**/*.scss"),o.rw.add("**/*.less")):0<e.indexOf(".js")||0<e.indexOf(".jsx")?(q("recovering javascript watcher"),o.rw=v.watch(t),o.rw.add("**/*.js"),o.rw.add("**/*.jsx")):q("failed to setup recovery watcher, target not recognized: "+e)}(d)},100)})}function le(e){e=m.resolve(e);var t=g.readFileSync(e,"utf8"),o=void 0,r=m.extname(e).toLowerCase();if(".css"===r||"css"===r){if(!W.csslint&&!W.lint)return;o=f(t,"css")}if(".js"===r||"js"===r){if(!W.jslint&&!W.lint)return;o=f(t)}return o&&ue(e,e+":"+o)}function ue(o,e,t){var r=Date.now();q("handleError TOP target: "+o);var n,i,s={time:Date.now(),raw:e,target:o,ranking:t||0};if(!W["no-wooster"]&&(n=w.parse(e,{intro:" "}))?(s.text=n.text,s.context=n.context,(i=n.filename)&&(s.filename=i)):s.text=e,s.text===e&&0<=e.indexOf("console.error")&&e.indexOf("console.error")<=20)try{var a=e,c=a.indexOf('console.error("');0<=c&&(a=a.slice(c+'console.error("'.length));var l=a.lastIndexOf('");');0<=l&&(a=a.slice(0,l));var u={post:function(e){return 5<e.length?w.colorify(e,"magentaBright")+"\n":e}};s.text=h(a,u)}catch(e){console.log("info: failed to prettify watchify bundle error")}var d=$.history[$.history.length-1],f=!1;if(d&&r-d.time<$.THROTTLE&&(function(e,t){e=pe(e.toLowerCase()),t=pe(t.toLowerCase());var o=!1;o=e.length>=t.length?0<=e.indexOf(t):0<=t.indexOf(e);return q("family: "+o),o}(d.raw,s.raw)||d.raw===s.raw||d.text===s.text||s.context&&d.context===s.context)&&(s.ranking>d.ranking&&(d.text=s.text,q("duplicate error outranked")),q(I.blackBright("ignoring duplicate error")),f=!0),f)q("skipping error");else{for($.history.push(s);20<$.history.length;)$.history.shift();q("debouncing error"),clearTimeout($.timeout),q("handleError target: "+o);var g=U[o];g&&(g.error=void 0,g.output=void 0);var m="";m+=de()+" ",m+=s.text,(g=U[o]).error=s,g.output=m;var p=Date.now();clearTimeout($.timeout),$.timeout=setTimeout(function(){$.timeout=void 0;var t=U[o];if(!t||!t.output||!t.error)return console.log("errors.timeout exited -- no error found"),console.log("this can happen if your build watcher writes or embeds and error to the destination bundle during errors."),void console.log("By default miru treats a change in the destination bundle as a successful build -- you can instead listen to the stdin of the watch process to determine when a build has been succesfful by using the -r,--regex flag");me(),ge(t.output),t.errorTimestamp=Date.now(),_.emit("terminal-error",{target:o,timestamp:p,output:t.output,error:t.error}),[33,100,300,500].forEach(function(e){q("delay repeated terminal error broadcast: "+e),setTimeout(function(){_.emit("terminal-error",{target:o,timestamp:p,output:t.output,error:t.error})},e)})},$.DEBOUNCE)}return s}setTimeout(function(){oe(),0<b.getWatched().length?(q("[express]: starting server at "+Q+":"+K),R.listen(K,Q,function(){var e=R.address();console.log(),console.log("server listening at *:"+e.port+" ( "+e.family+" "+e.address+" )"),ae()})):(console.log("[miru]: no --targets ( or --watch ) specified"),console.log("[miru]: -> no need for server, server not started."))},700),Z.forEach(function(e){ce(e)});var de=we("cli-progress-box")({colors:["bgMagentaBright","bgBlueBright"],padding:1,width:2,margin:6,maxStep:4});function fe(e,t){console.log("("+I.blue(e)+") \n"+I.green("broadcasting")+": "+I.magenta(t))}function ge(e){var t=(L=e).split("\n"),o=t.length;o>I.windowSize.height&&(o=(t=t.filter(function(e){return 0<e.trim().length})).length),o>I.windowSize.height&&(t=t.slice(0,I.windowSize.height-1));var r=process.stdout.columns-1;W.nolimit&&(r=999),t.forEach(function(e){for(var t=!1;E(e)>r;)t=!0,e=e.slice(0,-1);t&&(e+=I.bgWhite(">")),"\n"!==e[e.length-1]&&(e+=I.white("\n")),process.stdout.write(e)})}function me(){var e=(new Date).toTimeString().split(" ")[0];B||process.env.MIRU_NOCLEAR?(console.log(),console.log(" === CLEAR === "+e),console.log()):process.stdout.write("c")}function pe(e){for(var t="",o=0;o<e.length;++o)"A"<=e[o]&&e[o]<="z"&&(t+=e[o]);return t}var he,ve={devices:function(){me(),Object.keys(V).forEach(function(e,t){var o=V[e];console.log(" "+t+": "+o.id)})},logs:function(e){var r=e[0];me(),Object.keys(V).forEach(function(e,t){var o;r&&t!=r||(o=V[e],console.log(" "+ +t+": "+o.id+" -- logs: "),(o.logs||[]).forEach(function(e){console.log.apply(this,[e.type+":"].concat(e.args))}))})},cssreload:function(e){var t=!1;switch(String(e[0]||"").trim()){case"false":case"off":case"0":case"":t=!1;break;default:t=!0}console.log("sending CSSReload: "+t),F=t,_.emit("cssreload",t)},noinfo:function(e){var t=!1;switch(String(e[0]||"").trim()){case"false":case"off":case"0":case"":t=!1;break;default:t=!0}console.log("sending noinfo: "+t),z=t,_.emit("hide-info",t)},reload:function(){_.emit("reload")},recovery:function(){var e=N;e.forEach(function(e){console.log(" "+e)}),console.log("recovery watcher watching "+e.length+" files")},previous:function(){L&&(me(),ge(L))},pesticide:function(e){var t=!1;switch(String(e[0]||"").trim()){case"false":case"off":case"0":case"":t=!1;break;default:t=!0}console.log("sending pesticide ( CSS debugger ): "+t),A=t,_.emit("pesticide",t)},address:ae,ip:ae,lan:ae,watchers:function(){console.log(" watchers: ");var n=0;Z.forEach(function(e){e.command.length>n&&(n=e.command.length)}),Z.forEach(function(e){var t=n-e.command.length+4;process.stdout.write(" "+e.command);for(var o=0;o<t;o++)process.stdout.write(" ");process.stdout.write(e.targetfilepath),process.stdout.write(", status: ");var r=U[m.resolve(e.targetfilepath)];r&&r.error?process.stdout.write("error"):process.stdout.write("ok"),process.stdout.write("\n")})},targets:function(e){var o=String(e[0]||"").trim(),t=b.getWatched().map(function(e){return m.relative(process.cwd(),e)}).sort();t.sort(function(e,t){var o=e.slice(e.lastIndexOf(".")+1),r=t.slice(t.lastIndexOf(".")+1);return o===e||r===t?0:r<o?1:o<r?-1:0}),o&&(t=t.filter(function(e){var t=e.slice(e.lastIndexOf("."));return"."===o[0]?t===o:0<=e.indexOf(o)})),t.forEach(function(e){console.log(" "+e)}),console.log("watched --targets: "+t.length)},error:function(){Object.keys(U).forEach(function(e){var t=U[e];t.output&&t.error&&(t.errorTimestamp=Date.now(),_.emit("terminal-error",{timestamp:Date.now(),output:t.output,error:t.error}),ge(t.output))})},executions:function(){console.log("executions: "+x.length),console.log(x)},files:function(e){var o=String(e[0]||"").trim(),t=y.getWatched().map(function(e){return m.relative(process.cwd(),e)}).sort();t.sort(function(e,t){var o=e.slice(e.lastIndexOf(".")+1),r=t.slice(t.lastIndexOf(".")+1);return o===e||r===t?0:r<o?1:o<r?-1:0}),o&&(t=t.filter(function(e){var t=e.slice(e.lastIndexOf("."));return"."===o[0]?t===o:0<=e.indexOf(o)})),t.forEach(function(e){console.log(" "+e)}),console.log("watched --files: "+t.length)}};process.stdin.on("data",function(e){var t=e.toString("utf8").toLowerCase().trim().split(/\s+/),o=t[0];if(!o&&he)return he();var r=t.slice(1),n=Object.keys(ve).filter(function(e){return 0<=e.indexOf(o)}).sort(function(e,t){return e.indexOf(o)-t.indexOf(o)}),i=ve[n[0]];"function"==typeof i?(he=function(){i(r)},i(r)):console.log("unknown command: "+o)})}).call(this,we("path").join(__dirname,"src","server"))},{assert:void 0,"body-parser":void 0,child_process:void 0,"cli-color":void 0,"cli-progress-box":void 0,compression:void 0,cors:void 0,"cross-spawn-with-kill":void 0,express:void 0,"find-root":void 0,fs:void 0,http:void 0,kiite:void 0,miteru:void 0,nozombie:void 0,os:void 0,passlint:void 0,path:void 0,"path-shorten":void 0,redstar:void 0,"string-width":void 0,subarg:void 0,"tree-kill":void 0,"ua-parser-js":void 0,wooster:void 0}]},{},[1])(1)});