@sma1lboy/kobe 0.8.162 → 0.8.164

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/cli/kobe.js CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{join as b}from"node:path";import{createInterface as f}from"node:readline/promises";import{pathToFileURL as h}from"node:url";import{spawnSync as M}from"node:child_process";import{constants as O,accessSync as _}from"node:fs";import{homedir as w}from"node:os";import{basename as E,delimiter as I,dirname as R,join as Y}from"node:path";import{fileURLToPath as C}from"node:url";var P="ROVE_BUN",U="ROVE_NO_BUN_BOOTSTRAP",B=(z)=>{try{return _(z,O.X_OK),!0}catch{return!1}},y=(z)=>z==="win32"?"bun.exe":"bun";function N(z={}){let H=z.env??process.env,J=z.platform??process.platform,X=z.home??H.HOME??H.USERPROFILE??w(),K=y(J),Q=[],q=H[P]?.trim();if(q)Q.push(q);for(let A of(H.PATH??H.Path??"").split(I))if(A)Q.push(Y(A,K));let G=H.BUN_INSTALL?.trim();if(G)Q.push(Y(G,"bin",K));if(X)Q.push(Y(X,".bun","bin",K));let Z=z.launcherDir;if(Z)Q.push(Y(Z,"..","..","node_modules","bun","bin",K)),Q.push(Y(Z,"..","..","..","bun","bin",K));return Q}function $(z={}){let H=z.isExecutable??B;return N(z).find((J)=>H(J))??null}function x(z){return R(C(z))}function V(z){return E(C(z)).replace(/\.[cm]?[jt]s$/,"")}function k(z=process.platform){return z==="win32"?["powershell","-NoProfile","-Command","irm bun.sh/install.ps1 | iex"]:["bash","-c","curl -fsSL https://bun.sh/install | bash"]}function g(z="rove",H=process.platform){let J=H==="win32"?'powershell -c "irm bun.sh/install.ps1 | iex"':"curl -fsSL https://bun.sh/install | bash";return[`${z}: Rove runs on the Bun runtime, and no Bun was found on this machine.`,"","Install Bun, then run this command again:",` ${J}`," npm install -g bun # any platform, if you already have npm","","Or install Bun and Rove together in one step:"," curl -fsSL https://rove.sma1lboy.me/install.sh | sh","",`Already have Bun somewhere unusual? Point Rove at it: ${P}=/path/to/bun`,""].join(`
3
- `)}function j(z=process.env,H=process.stdin,J=process.stdout){if(z[U]==="1")return!1;if(z.CI==="true"||z.CI==="1")return!1;return Boolean(H.isTTY&&J.isTTY)}function L(z={},H=M){let J=z.platform??process.platform,[X,...K]=k(J);if(!X)return null;let Q=H(X,K,{stdio:"inherit"});if(Q.error||Q.status!==0)return null;return $(z)}function v(z){if(typeof z.status==="number")return z.status;if(z.signal)return 128+(Object.hasOwn(F,z.signal)?F[z.signal]:0);return 1}var F={SIGINT:2,SIGQUIT:3,SIGKILL:9,SIGTERM:15};function T(z,H,J,X=M){let K=X(z,[H,...J],{stdio:"inherit"});if(K.error)return process.stderr.write(`rove: could not start Bun at ${z}: ${K.error.message}
4
- `),1;return v(K)}var S=x(import.meta.url),W=V(import.meta.url),D=b(S,`${W}-run.js`);async function m(z){let H=f({input:process.stdin,output:process.stdout});try{let J=(await H.question(z)).trim().toLowerCase();return J===""||J==="y"||J==="yes"}finally{H.close()}}async function c(){let z={launcherDir:S},H=$(z);if(H)return H;if(!j())return null;let J=`${W}: Rove runs on the Bun runtime, and none is installed. Install Bun now? [Y/n] `;if(!await m(J))return null;return L(z)}if(typeof globalThis.Bun<"u")await import(h(D).href);else{let z=await c();if(!z)process.stderr.write(g(W)),process.exit(1);process.exit(T(z,D,process.argv.slice(2)))}
2
+ import{join as l}from"node:path";import{createInterface as s}from"node:readline/promises";import{pathToFileURL as r}from"node:url";import{spawnSync as w}from"node:child_process";import{constants as N,accessSync as f}from"node:fs";import{homedir as S}from"node:os";import{basename as y,delimiter as _,dirname as v,join as $}from"node:path";import{fileURLToPath as x}from"node:url";var W="rove",Y="kobe";var A="ROVE_INVOKED_AS";function V(z=process.env){return z[A]===W?W:Y}var U="ROVE_BUN",p="ROVE_NO_BUN_BOOTSTRAP",E=(z)=>{try{return f(z,N.X_OK),!0}catch{return!1}},m=(z)=>z==="win32"?"bun.exe":"bun";function d(z={}){let H=z.env??process.env,J=z.platform??process.platform,Z=z.home??H.HOME??H.USERPROFILE??S(),Q=m(J),X=[],G=H[U]?.trim();if(G)X.push(G);for(let L of(H.PATH??H.Path??"").split(_))if(L)X.push($(L,Q));let j=H.BUN_INSTALL?.trim();if(j)X.push($(j,"bin",Q));if(Z)X.push($(Z,".bun","bin",Q));let q=z.launcherDir;if(q)X.push($(q,"..","..","node_modules","bun","bin",Q)),X.push($(q,"..","..","..","bun","bin",Q));return X}function F(z={}){let H=z.isExecutable??E;return d(z).find((J)=>H(J))??null}function b(z){return v(x(z))}function B(z){return y(x(z)).replace(/\.[cm]?[jt]s$/,"")}function c(z=process.platform){return z==="win32"?["powershell","-NoProfile","-Command","irm bun.sh/install.ps1 | iex"]:["bash","-c","curl -fsSL https://bun.sh/install | bash"]}function D(z=V(),H=process.platform){let J=H==="win32"?'powershell -c "irm bun.sh/install.ps1 | iex"':"curl -fsSL https://bun.sh/install | bash";return[`${z}: Rove runs on the Bun runtime, and no Bun was found on this machine.`,"","Install Bun, then run this command again:",` ${J}`," npm install -g bun # any platform, if you already have npm","","Or install Bun and Rove together in one step:"," curl -fsSL https://rove.sma1lboy.me/install.sh | sh","",`Already have Bun somewhere unusual? Point Rove at it: ${U}=/path/to/bun`,""].join(`
3
+ `)}function M(z=process.env,H=process.stdin,J=process.stdout){if(z[p]==="1")return!1;if(z.CI==="true"||z.CI==="1")return!1;return Boolean(H.isTTY&&J.isTTY)}function k(z={},H=w){let J=z.platform??process.platform,[Z,...Q]=c(J);if(!Z)return null;let X=H(Z,Q,{stdio:"inherit"});if(X.error||X.status!==0)return null;return F(z)}function u(z){if(typeof z.status==="number")return z.status;if(z.signal)return 128+(Object.hasOwn(K,z.signal)?K[z.signal]:0);return 1}var K={SIGINT:2,SIGQUIT:3,SIGKILL:9,SIGTERM:15};function C(z,H,J,Z=w){let Q=Z(z,[H,...J],{stdio:"inherit"});if(Q.error)return process.stderr.write(`rove: could not start Bun at ${z}: ${Q.error.message}
4
+ `),1;return u(Q)}var T=b(import.meta.url),P=B(import.meta.url),g=l(T,`${P}-run.js`);async function i(z){let H=s({input:process.stdin,output:process.stdout});try{let J=(await H.question(z)).trim().toLowerCase();return J===""||J==="y"||J==="yes"}finally{H.close()}}async function o(){let z={launcherDir:T},H=F(z);if(H)return H;if(!M())return null;let J=`${P}: Rove runs on the Bun runtime, and none is installed. Install Bun now? [Y/n] `;if(!await i(J))return null;return k(z)}if(typeof globalThis.Bun<"u")await import(r(g).href);else{let z=await o();if(!z)process.stderr.write(D(P)),process.exit(1);process.exit(C(z,g,process.argv.slice(2)))}