@mahameru/cli 0.0.14 → 0.0.15
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/dist/index.js +9 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* ┌────────────────────────────────────────────┐
|
|
4
4
|
* │ │
|
|
5
5
|
* │ ▲ MahameruJS - CLI UTILITY │
|
|
6
|
-
* │ Version: 0.0.
|
|
6
|
+
* │ Version: 0.0.15 │
|
|
7
7
|
* │ Built: 2026 │
|
|
8
8
|
* │ │
|
|
9
9
|
* │ Copyright (c) Bintan <hello@bintvn.co> │
|
|
@@ -34,7 +34,7 @@ bgCyanBright:e("[106m","[49m"),bgWhiteBright:e("[107m","[49m")}};t.exports=a
|
|
|
34
34
|
;function O(t){var e=b[t];if(void 0!==e)return e.exports;var i=b[t]={exports:{}};return v[t](i,i.exports,O),i.exports}
|
|
35
35
|
O.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return O.d(e,{a:e}),e},O.d=(t,e)=>{
|
|
36
36
|
for(var i in e)O.o(e,i)&&!O.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},
|
|
37
|
-
O.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const x={rE:"0.0.
|
|
37
|
+
O.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const x={rE:"0.0.15"
|
|
38
38
|
},y=(t=0)=>e=>`[${e+t}m`,w=(t=0)=>e=>`[${38+t};5;${e}m`,C=(t=0)=>(e,i,r)=>`[${38+t};2;${e};${i};${r}m`,T={modifier:{
|
|
39
39
|
reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],
|
|
40
40
|
strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],
|
|
@@ -648,10 +648,11 @@ return`\n import mahameru from "mahameru";\n\n mahameru(${JSON.str
|
|
|
648
648
|
const e=parseInt(t,10);if(!isNaN(e))return e}function We(t,i,r){return new Promise((s,n)=>{
|
|
649
649
|
const o=e(process.execPath,[t,...i],{stdio:"inherit",cwd:r});o.on("close",t=>s(t??1)),o.on("error",n)})}function Be(t){
|
|
650
650
|
return new Promise(e=>{t&&null===t.exitCode&&!t.killed?(t.once("close",()=>e()),t.kill("SIGTERM")):e()})}function Fe(){
|
|
651
|
-
const t=new Map,e=r(Re,"mahameru.config.ts");o(e)&&t.set(e,
|
|
652
|
-
;const
|
|
653
|
-
if(i.startsWith("."))continue;const
|
|
654
|
-
return t}function Ne(t){return s(Re,t)||t}(async()=>{
|
|
651
|
+
const t=new Map,e=r(Re,"mahameru.config.ts"),i=r(Re,"global.d.ts");o(e)&&t.set(e,Ne(e)),o(i)&&t.set(i,Ne(i))
|
|
652
|
+
;const s=r(Re,"src");if(!o(s))return t;const n=[s];for(;n.length>0;){const e=n.pop();for(const i of l(e)){
|
|
653
|
+
if(i.startsWith("."))continue;const s=r(e,i),o=h(s);o.isDirectory()?n.push(s):t.set(s,`${o.mtimeMs}:${o.size}`)}}
|
|
654
|
+
return t}function Ne(t){const e=h(t);return`${e.mtimeMs}:${e.size}`}function De(t){return s(Re,t)||t}(async()=>{
|
|
655
|
+
const t=new Pe,{rE:i}=x;try{
|
|
655
656
|
t.name("mahameru").description(`${Oe().bold(Oe().cyan("▲ Mahameru"))} ${Oe().dim(`CLI v${i}`)}`).version(i,"-v, --version","Display help for command"),
|
|
656
657
|
t.command("dev").option("-p, --port <number>","Port to run the server on",Ge).option("-h, --host <string>","Host to run the server on").action(async({host:t,port:s})=>{
|
|
657
658
|
Me()||(console.error(Oe().red(" Current directory is not a Node.js project.")),process.exit(1));const n=function(){
|
|
@@ -679,8 +680,8 @@ h||l||(e?console.error(Oe().red(`Mahameru dev server stopped by signal ${e}.`)):
|
|
|
679
680
|
})}catch(t){console.error(Oe().red("Failed to start dev server. Watching for changes...")),console.error(t),
|
|
680
681
|
0===u&&console.log(Oe().dim("Fix the error above and save a file to try again.\n"))}finally{l=!1}}},f=t=>{
|
|
681
682
|
h||(o&&clearTimeout(o),o=setTimeout(()=>{p(t)},200))},g=()=>{if(!h&&!c){c=!0;try{const t=Fe(),e=function(t,e){
|
|
682
|
-
for(const[i,r]of e){if(!t.has(i))return
|
|
683
|
-
for(const i of t.keys())if(!e.has(i))return
|
|
683
|
+
for(const[i,r]of e){if(!t.has(i))return De(i);if(t.get(i)!==r)return De(i)}
|
|
684
|
+
for(const i of t.keys())if(!e.has(i))return De(i);return null}(m,t);m=t,e&&f(e)}finally{c=!1}}},_=async(t=0)=>{h||(h=!0,
|
|
684
685
|
o&&clearTimeout(o),a&&clearInterval(a),await Be(n),process.exit(t))};process.once("SIGINT",()=>{_(0)}),
|
|
685
686
|
process.once("SIGTERM",()=>{_(0)
|
|
686
687
|
}),a=setInterval(g,300),console.log(Oe().dim("Watching src/** and mahameru.config.ts for changes...\n")),await p(),
|
package/package.json
CHANGED