zerostarter 0.0.18-canary.0 → 0.0.18
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/bin/index.mjs +1 -1
- package/package.json +1 -1
package/dist/bin/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"../convert-DMU8fiBc.mjs";import{basename as f,join as p,resolve as m}from"node:path";import{existsSync as h,readdirSync as g}from"node:fs";import{createInterface as _}from"node:readline/promises";import{parseArgs as v}from"node:util";import{execFileSync as y}from"node:child_process";import{randomBytes as b}from"node:crypto";var ee={name:`zerostarter`,version:`0.0.18
|
|
2
|
+
import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"../convert-DMU8fiBc.mjs";import{basename as f,join as p,resolve as m}from"node:path";import{existsSync as h,readdirSync as g}from"node:fs";import{createInterface as _}from"node:readline/promises";import{parseArgs as v}from"node:util";import{execFileSync as y}from"node:child_process";import{randomBytes as b}from"node:crypto";var ee={name:`zerostarter`,version:`0.0.18`,description:`Go from zero to a production-ready SaaS, rebranded and ready to ship.`,keywords:[`cli`,`saas`,`scaffold`,`starter`,`template`,`zerostarter`],homepage:`https://github.com/nrjdalal/zerostarter#readme`,bugs:`https://github.com/nrjdalal/zerostarter/issues`,license:`MIT`,author:{name:`Neeraj Dalal`,email:`admin@nrjdalal.com`,url:`https://nrjdalal.com`},repository:`nrjdalal/zerostarter`,funding:`https://github.com/sponsors/nrjdalal`,bin:{zerostarter:`dist/bin/index.mjs`},files:[`dist`],type:`module`,types:`./dist/index.d.mts`,exports:`./dist/index.mjs`,scripts:{build:`tsdown`,"check-types":`tsc --noEmit`,dev:`tsdown --watch`,test:`bun test`},devDependencies:{"@packages/config":`workspace:*`,"@types/bun":`catalog:`,"@types/node":`catalog:`,tsdown:`catalog:`,typescript:`catalog:`}};const x=()=>!!(process.stdin.isTTY&&process.stdout.isTTY),S=(e,t=e)=>process.stdout.isTTY?`\x1b]8;;${e}\x07${t}\x1b]8;;\x07`:e,C=(e,t=process.stdout)=>n=>t.isTTY?`\x1b[${e}m${n}\x1b[0m`:n,w=C(`38;5;208`),T=C(`38;2;63;185;80`),E=C(`38;2;210;153;34`),D=C(`38;2;248;81;73`,process.stderr),te=async(e,t=``)=>{let n=_({input:process.stdin,output:process.stdout});try{return(await n.question(`${e}${t?` (${t})`:``}: `)).trim()||t}finally{n.close()}},O=async(e,t=!0)=>{let n=_({input:process.stdin,output:process.stdout});try{let r=(await n.question(`${e} (${t?`Y/n`:`y/N`}) `)).trim().toLowerCase();return r?r===`y`||r===`yes`:t}finally{n.close()}},k=`pglaunch@5.5.7`,A=(e,t,n)=>y(e,t,{cwd:n,encoding:`utf8`,maxBuffer:1<<26,stdio:[`ignore`,`pipe`,`pipe`]}),ne=()=>{try{return y(`docker`,[`info`],{stdio:`ignore`}),!0}catch{return!1}},j=e=>{let r=p(e,`.env`);if(!s(r)){let i=p(e,`.env.example`);n(r,s(i)?t(i):``)}return r},M=(e,n)=>{let r=`${n}=`,i=t(e).split(`
|
|
3
3
|
`).find(e=>e.startsWith(r));return i?i.slice(r.length).trim():``},N=(e,r,i)=>{let a=`${r}=`,o=t(e).split(`
|
|
4
4
|
`),s=o.findIndex(e=>e.startsWith(a));if(s>=0)o[s]=`${a}${i}`;else{for(;o.length&&o[o.length-1]===``;)o.pop();o.push(`${a}${i}`,``)}n(e,o.join(`
|
|
5
5
|
`))},P=e=>{let t=j(e);M(t,`BETTER_AUTH_SECRET`)||N(t,`BETTER_AUTH_SECRET`,b(32).toString(`base64`))},F=e=>{let t=p(e,`.env`);return s(t)&&M(t,`POSTGRES_URL`)!==``},re=e=>{let t=e.match(/postgres(?:ql)?:\/\/[\w.:@\-/%?=&]+/);if(!t)return null;let n=e.match(/name "([^" ]+) :\d+" started/),r=e.match(/similar name "([^"]+)"/);return{url:t[0],container:n?n[1]:r?r[1]:``,reused:!n}},I=(e,t)=>{let n=t?[k,`-k`,`-c`]:[k,`-k`],r;try{r=A(`bunx`,n,e)}catch(e){let t=e;r=[t.stdout,t.stderr].filter(Boolean).join(`
|