zerostarter 0.1.1 → 0.1.2-canary.0

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.
Files changed (2) hide show
  1. package/dist/bin/index.mjs +22 -22
  2. package/package.json +1 -1
@@ -1,16 +1,16 @@
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-HXDPuaZU.mjs";import{basename as f,delimiter as p,dirname as m,join as h,parse as g,resolve as _}from"node:path";import{existsSync as v,readFileSync as y,readdirSync as ee}from"node:fs";import{spawn as b}from"node:child_process";import{access as x}from"node:fs/promises";import{createInterface as te}from"node:readline/promises";import{randomBytes as ne}from"node:crypto";import{parseArgs as re}from"node:util";import{homedir as ie}from"node:os";const S=(e,t,n=process.stdout)=>r=>n.isTTY?`\x1b[${e}m${r}\x1b[${t}m`:r,C=S(`36`,`39`),w=S(`32`,`39`),T=S(`33`,`39`),E=S(`90`,`39`),D=S(`2`,`22`),O=S(`31`,`39`,process.stderr),ae=S(`2`,`22`,process.stderr),k=S(`38;5;208`,`39`),A=[`◇`,`◆`],j=(e,t)=>{let n=(e%A.length+A.length)%A.length;return`${C(A[n])} ${t}`},M={barStart:`┌`,bar:`│`,barEnd:`└`,active:`◆`,submit:`◇`,radioOn:`●`,radioOff:`○`,warn:`▲`,error:`■`,barH:`─`,cornerTR:`╮`,connectL:`├`,cornerBL:`╰`,cornerBR:`╯`};var oe=class extends Error{constructor(...e){super(...e),this.name=`SubprocessError`,this.stdout=``,this.stderr=``}};const se=[`.exe`,`.com`],N=e=>e.replaceAll(/([()\][%!^"`<>&|;, *?])/g,`^$1`),ce=e=>N(N(`"${e.replaceAll(/(\\*)"/g,`$1$1\\"`).replace(/(\\*)$/,`$1$1`)}"`)),le=async(e,t,n)=>{if(se.some(t=>e.toLowerCase().endsWith(t)))return!0;let r=(n.PATH||n.Path||``).split(p).filter(Boolean).map(e=>e.replace(/^"(.*)"$/,`$1`));try{return await Promise.any([t,...r].flatMap(t=>se.map(n=>x(`${_(t,e)}${n}`)))),!0}catch{return!1}},ue=async(e,t,n,r=process.platform===`win32`)=>{let i=n.cwd?String(n.cwd):`.`,a=n.env||process.env;return r&&!n.shell&&!await le(e,i,a)?[N(e),t.map(ce),{...n,shell:!0}]:[e,t,n]},P=async(e,t,n,r)=>{let i=[e,...t].join(` `),[a,o,s]=await ue(e,t,n);s.shell&&o.length>0&&(a=[a,...o].join(` `),o=[]);let c=b(a,o,s),l=``,u=``;return new Promise((e,t)=>{let n=(e,n,r)=>{let i=new oe(e,r?{cause:r}:void 0);i.stdout=l,i.stderr=u,i.exitCode=n,t(i)},a=e=>{e.code!==`ERR_STREAM_PREMATURE_CLOSE`&&e.code!==`EPIPE`&&n(`Command failed: ${i}`,void 0,e)};c.stdout&&(c.stdout.setEncoding(`utf8`),c.stdout.on(`data`,e=>{l+=e,r?.(e)}),c.stdout.on(`error`,a)),c.stderr&&(c.stderr.setEncoding(`utf8`),c.stderr.on(`data`,e=>{u+=e,r?.(e)}),c.stderr.on(`error`,a)),c.on(`error`,e=>n(`Command failed: ${i}`,void 0,e)),c.on(`close`,(t,r)=>{if(r)return n(`Command was terminated with ${r}: ${i}`);if(t!==0)return n(`Command failed with exit code ${t}: ${i}`,t??void 0);e({stdout:l,stderr:u})})})},F=async(e,t,n)=>{let{stdout:r}=await P(e,t,{cwd:n,stdio:[`ignore`,`pipe`,`pipe`]});return r},de=async(e,t,n)=>{await P(e,t,{cwd:n,stdio:`inherit`})},I=async(e,t)=>{try{return await P(e,t,{stdio:`ignore`}),!0}catch{return!1}},fe=RegExp(`\x1B\\[[0-9;?]*[a-zA-Z]`,`g`),pe=e=>e.replace(fe,``),me=new WeakSet,he=e=>{if(process.stderr.write(`\n ${O(e instanceof Error?e.message:String(e))}\n`),!(e instanceof oe)||me.has(e))return;let t=(e.stderr||e.stdout||``).trim();if(!t)return;let n=pe(t).split(`
3
- `).map(e=>e.trimEnd()).filter(Boolean).slice(-12);for(let e of n)process.stderr.write(` ${ae(e)}\n`)},ge=async(e,t,n)=>{let r=process.stdout,i=n.label??``;if(!r.isTTY){i&&r.write(` ${C(M.active)} ${i}\n`),await de(e,t,n.cwd);return}let a=n.lines??3,o=[],s=0,c=0,l=``,u=``,d=()=>(r.columns||80)-1,f=e=>{r.write(e?`\x1B[?7h`:`\x1B[?7l`)},p=()=>{c>0&&(r.write(`[${c}A`),c=0)},m=()=>{p();let e=0;r.write(` ${j(s,i)}\n`),e++;for(let t of o.slice(-a))r.write(` ${E(M.bar)} ${D(t.slice(0,Math.max(0,d()-5)))}\n`),e++;c=e},h=e=>{u+=e,l+=e;let t=l.split(`
4
- `);l=t.pop()??``;for(let e of t)o.push(pe(e).replace(/\r/g,``).replace(/\t/g,` `).trimEnd()),m()};m(),f(!1);let g=()=>{f(!0),process.exit(130)};process.once(`SIGINT`,g);let _=setInterval(()=>{s+=1,m()},400),v=()=>{clearInterval(_),process.removeListener(`SIGINT`,g)};try{await P(e,t,{cwd:n.cwd,stdio:[`ignore`,`pipe`,`pipe`]},h)}catch(e){throw v(),p(),f(!0),r.write(u),e&&typeof e==`object`&&me.add(e),e}v(),p(),f(!0),r.write(` ${C(M.active)} ${n.done??i}\n`);for(let e of o.slice(-a))r.write(` ${E(M.bar)} ${D(e.slice(0,Math.max(0,d()-5)))}\n`)};var _e={name:`zerostarter`,version:`0.1.1`,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 L=()=>!!(process.stdin.isTTY&&process.stdout.isTTY),ve=(e,t=e)=>process.stdout.isTTY?`\x1b]8;;${e}\x07${t}\x1b]8;;\x07`:e,R=e=>ve(e,C(e)),z=e=>{process.stdout.write(`\n ${E(M.barStart)} ${e}\n ${E(M.bar)}\n`)},B=e=>{process.stdout.write(` ${E(M.bar)}\n ${E(M.barEnd)} ${e}\n`)},V=(e=`Cancelled`)=>{process.stdout.write(` ${E(M.barEnd)} ${O(e)}\n`)},H=e=>e.replace(RegExp(`\x1B\\[[0-9;?]*[a-zA-Z]`,`g`),``).replace(RegExp(`\x1B\\]8;;.*?\\x07`,`g`),``).length,U=(e,t=``,n=!1)=>{let r=`\n${e}\n`.split(`
5
- `),i=H(t),a=r.reduce((e,t)=>Math.max(e,H(t)),i),o=Math.max(a,54)+2,s=r.map(e=>` ${E(M.bar)} ${e}${` `.repeat(o-H(e))}${E(M.bar)}`).join(`
6
- `),c=n?M.cornerBL:M.connectL;process.stdout.write(` ${C(M.active)} ${t} ${E(M.barH.repeat(Math.max(o-i-1,1))+M.cornerTR)}\n${s}\n ${E(c+M.barH.repeat(o+2)+M.cornerBR)}\n`)},W=(e,t=[])=>{process.stdout.write(` ${C(M.active)} ${e}\n`);for(let e of t)process.stdout.write(` ${E(M.bar)} ${e}\n`)},ye=e=>{process.stdout.write(` ${w(M.active)} ${w(e)}\n`)},G=(e,t=[])=>{process.stdout.write(` ${T(M.warn)} ${T(e)}\n`);for(let e of t)process.stdout.write(` ${E(M.bar)} ${T(e)}\n`)},be=async(e,t,n)=>{let r=process.stdout,i=null;if(r.isTTY){let t=0;r.write(` ${j(0,e)}`),i=setInterval(()=>{t+=1,r.write(`\r\x1b[K ${j(t,e)}`)},400)}try{let e=await n();return i&&clearInterval(i),r.write(r.isTTY?`\r\x1b[K ${C(M.active)} ${t}\n`:` ${C(M.active)} ${t}\n`),e}catch(e){throw i&&clearInterval(i),r.isTTY&&r.write(`\r\x1B[K`),e}},xe=e=>{let t=e?`${w(M.radioOn)} Yes`:D(`${M.radioOff} Yes`),n=e?D(`${M.radioOff} No`):`${w(M.radioOn)} No`;return` ${E(M.bar)} ${t} ${D(`/`)} ${n}`},K=async(e,t=!0)=>{let n=process.stdout;return L()?new Promise(r=>{let i=t,a=process.stdin,o=Math.max(1,Math.ceil((5+H(e))/(n.columns||80)));n.write(` ${C(M.submit)} ${e}\n`),n.write(xe(i)),a.setRawMode(!0),a.resume(),a.setEncoding(`utf8`);let s=()=>{a.setRawMode(!1),a.pause(),a.removeListener(`data`,u)},c=()=>{n.write(`\r\x1b[K\x1b[${o}A\r\x1b[0J`)},l=()=>{s(),c(),r(i)};function u(t){t===``?(s(),c(),n.write(` ${C(M.submit)} ${D(e)}\n`),V(),process.exit(130)):t===`\r`||t===`
7
- `?l():t===`y`||t===`Y`?(i=!0,l()):t===`n`||t===`N`?(i=!1,l()):(t===`\x1B[C`||t===`\x1B[D`||t===`\x1B[A`||t===`\x1B[B`||t===`h`||t===`l`)&&(i=!i,n.write(`\r\x1b[K${xe(i)}`))}a.on(`data`,u)}):(n.write(` ${C(M.active)} ${e} ${D(t?`Yes`:`No`)}\n`),t)},Se=async(e,t=``)=>{process.stdout.write(` ${C(M.submit)} ${e}${t?` ${D(`(${t})`)}`:``}\n`);let n=te({input:process.stdin,output:process.stdout});try{return(await n.question(` ${E(M.bar)} `)).trim()||t}finally{n.close()}},Ce=`pglaunch@5.5.7`,we=async()=>I(`docker`,[`info`]),Te=t=>{let n=h(t,`.env`);if(!e(n)){let r=h(t,`.env.example`);d(n,e(r)?l(r):``)}return n},Ee=(e,t)=>{let n=`${t}=`,r=l(e).split(`
8
- `).find(e=>e.startsWith(n));return r?r.slice(n.length).trim():``},De=(e,t,n)=>{let r=`${t}=`,i=l(e).split(`
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-HXDPuaZU.mjs";import{basename as f,delimiter as p,dirname as m,join as h,parse as g,resolve as _}from"node:path";import{existsSync as v,readFileSync as y,readdirSync as b}from"node:fs";import{spawn as ee}from"node:child_process";import{access as x}from"node:fs/promises";import{createInterface as S}from"node:readline/promises";import{randomBytes as te}from"node:crypto";import{parseArgs as ne}from"node:util";import{homedir as re}from"node:os";const C=(e,t,n=process.stdout)=>r=>n.isTTY?`\x1b[${e}m${r}\x1b[${t}m`:r,w=C(`36`,`39`),T=C(`32`,`39`),E=C(`33`,`39`),D=C(`90`,`39`),O=C(`2`,`22`),k=C(`31`,`39`,process.stderr),ie=C(`2`,`22`,process.stderr),A=C(`38;5;208`,`39`),j=[`◇`,`◆`],M=(e,t)=>{let n=(e%j.length+j.length)%j.length;return`${w(j[n])} ${t}`},N={barStart:`┌`,bar:`│`,barEnd:`└`,active:`◆`,submit:`◇`,radioOn:`●`,radioOff:`○`,warn:`▲`,error:`■`,barH:`─`,cornerTR:`╮`,connectL:`├`,cornerBL:`╰`,cornerBR:`╯`};var ae=class extends Error{constructor(...e){super(...e),this.name=`SubprocessError`,this.stdout=``,this.stderr=``}};const oe=[`.exe`,`.com`],P=e=>e.replaceAll(/([()\][%!^"`<>&|;, *?])/g,`^$1`),se=e=>P(P(`"${e.replaceAll(/(\\*)"/g,`$1$1\\"`).replace(/(\\*)$/,`$1$1`)}"`)),ce=async(e,t,n)=>{if(oe.some(t=>e.toLowerCase().endsWith(t)))return!0;let r=(n.PATH||n.Path||``).split(p).filter(Boolean).map(e=>e.replace(/^"(.*)"$/,`$1`));try{return await Promise.any([t,...r].flatMap(t=>oe.map(n=>x(`${_(t,e)}${n}`)))),!0}catch{return!1}},le=async(e,t,n,r=process.platform===`win32`)=>{let i=n.cwd?String(n.cwd):`.`,a=n.env||process.env;return r&&!n.shell&&!await ce(e,i,a)?[P(e),t.map(se),{...n,shell:!0}]:[e,t,n]},F=async(e,t,n,r)=>{let i=[e,...t].join(` `),[a,o,s]=await le(e,t,n);s.shell&&o.length>0&&(a=[a,...o].join(` `),o=[]);let c=ee(a,o,s),l=``,u=``;return new Promise((e,t)=>{let n=(e,n,r)=>{let i=new ae(e,r?{cause:r}:void 0);i.stdout=l,i.stderr=u,i.exitCode=n,t(i)},a=e=>{e.code!==`ERR_STREAM_PREMATURE_CLOSE`&&e.code!==`EPIPE`&&n(`Command failed: ${i}`,void 0,e)};c.stdout&&(c.stdout.setEncoding(`utf8`),c.stdout.on(`data`,e=>{l+=e,r?.(e)}),c.stdout.on(`error`,a)),c.stderr&&(c.stderr.setEncoding(`utf8`),c.stderr.on(`data`,e=>{u+=e,r?.(e)}),c.stderr.on(`error`,a)),c.on(`error`,e=>n(`Command failed: ${i}`,void 0,e)),c.on(`close`,(t,r)=>{if(r)return n(`Command was terminated with ${r}: ${i}`);if(t!==0)return n(`Command failed with exit code ${t}: ${i}`,t??void 0);e({stdout:l,stderr:u})})})},I=async(e,t,n)=>{let{stdout:r}=await F(e,t,{cwd:n,stdio:[`ignore`,`pipe`,`pipe`]});return r},ue=async(e,t,n)=>{await F(e,t,{cwd:n,stdio:`inherit`})},L=async(e,t)=>{try{return await F(e,t,{stdio:`ignore`}),!0}catch{return!1}},de=RegExp(`\x1B\\[[0-9;?]*[a-zA-Z]`,`g`),fe=e=>e.replace(de,``),pe=new WeakSet,me=e=>{if(process.stderr.write(`\n ${k(e instanceof Error?e.message:String(e))}\n`),!(e instanceof ae)||pe.has(e))return;let t=(e.stderr||e.stdout||``).trim();if(!t)return;let n=fe(t).split(`
3
+ `).map(e=>e.trimEnd()).filter(Boolean).slice(-12);for(let e of n)process.stderr.write(` ${ie(e)}\n`)},he=async(e,t,n)=>{let r=process.stdout,i=n.label??``;if(!r.isTTY){i&&r.write(` ${w(N.active)} ${i}\n`),await ue(e,t,n.cwd);return}let a=n.lines??3,o=[],s=0,c=0,l=``,u=``,d=()=>(r.columns||80)-1,f=e=>{r.write(e?`\x1B[?7h`:`\x1B[?7l`)},p=()=>{c>0&&(r.write(`[${c}A`),c=0)},m=()=>{p();let e=0;r.write(` ${M(s,i)}\n`),e++;for(let t of o.slice(-a))r.write(` ${D(N.bar)} ${O(t.slice(0,Math.max(0,d()-5)))}\n`),e++;c=e},h=e=>{u+=e,l+=e;let t=l.split(`
4
+ `);l=t.pop()??``;for(let e of t)o.push(fe(e).replace(/\r/g,``).replace(/\t/g,` `).trimEnd()),m()};m(),f(!1);let g=()=>{f(!0),process.exit(130)};process.once(`SIGINT`,g);let _=setInterval(()=>{s+=1,m()},400),v=()=>{clearInterval(_),process.removeListener(`SIGINT`,g)};try{await F(e,t,{cwd:n.cwd,stdio:[`ignore`,`pipe`,`pipe`]},h)}catch(e){throw v(),p(),f(!0),r.write(u),e&&typeof e==`object`&&pe.add(e),e}v(),p(),f(!0),r.write(` ${w(N.active)} ${n.done??i}\n`);for(let e of o.slice(-a))r.write(` ${D(N.bar)} ${O(e.slice(0,Math.max(0,d()-5)))}\n`)};var ge={name:`zerostarter`,version:`0.1.2-canary.0`,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 R=()=>!!(process.stdin.isTTY&&process.stdout.isTTY),_e=(e,t=e)=>process.stdout.isTTY?`\x1b]8;;${e}\x07${t}\x1b]8;;\x07`:e,z=e=>_e(e,w(e)),B=e=>{process.stdout.write(`\n ${D(N.barStart)} ${e}\n ${D(N.bar)}\n`)},V=e=>{process.stdout.write(` ${D(N.bar)}\n ${D(N.barEnd)} ${e}\n`)},H=(e=`Cancelled`)=>{process.stdout.write(` ${D(N.barEnd)} ${k(e)}\n`)},U=e=>e.replace(RegExp(`\x1B\\[[0-9;?]*[a-zA-Z]`,`g`),``).replace(RegExp(`\x1B\\]8;;.*?\\x07`,`g`),``).length,W=(e,t=``,n=!1)=>{let r=`\n${e}\n`.split(`
5
+ `),i=U(t),a=r.reduce((e,t)=>Math.max(e,U(t)),i),o=Math.max(a,54)+2,s=r.map(e=>` ${D(N.bar)} ${e}${` `.repeat(o-U(e))}${D(N.bar)}`).join(`
6
+ `),c=n?N.cornerBL:N.connectL;process.stdout.write(` ${w(N.active)} ${t} ${D(N.barH.repeat(Math.max(o-i-1,1))+N.cornerTR)}\n${s}\n ${D(c+N.barH.repeat(o+2)+N.cornerBR)}\n`)},G=(e,t=[])=>{process.stdout.write(` ${w(N.active)} ${e}\n`);for(let e of t)process.stdout.write(` ${D(N.bar)} ${e}\n`)},ve=e=>{process.stdout.write(` ${T(N.active)} ${T(e)}\n`)},K=(e,t=[])=>{process.stdout.write(` ${E(N.warn)} ${E(e)}\n`);for(let e of t)process.stdout.write(` ${D(N.bar)} ${E(e)}\n`)},ye=async(e,t,n)=>{let r=process.stdout,i=null;if(r.isTTY){let t=0;r.write(` ${M(0,e)}`),i=setInterval(()=>{t+=1,r.write(`\r\x1b[K ${M(t,e)}`)},400)}try{let e=await n();return i&&clearInterval(i),r.write(r.isTTY?`\r\x1b[K ${w(N.active)} ${t}\n`:` ${w(N.active)} ${t}\n`),e}catch(e){throw i&&clearInterval(i),r.isTTY&&r.write(`\r\x1B[K`),e}},be=e=>{let t=e?`${T(N.radioOn)} Yes`:O(`${N.radioOff} Yes`),n=e?O(`${N.radioOff} No`):`${T(N.radioOn)} No`;return` ${D(N.bar)} ${t} ${O(`/`)} ${n}`},q=async(e,t=!0)=>{let n=process.stdout;return R()?new Promise(r=>{let i=t,a=process.stdin,o=Math.max(1,Math.ceil((5+U(e))/(n.columns||80)));n.write(` ${w(N.submit)} ${e}\n`),n.write(be(i)),a.setRawMode(!0),a.resume(),a.setEncoding(`utf8`);let s=()=>{a.setRawMode(!1),a.pause(),a.removeListener(`data`,u)},c=()=>{n.write(`\r\x1b[K\x1b[${o}A\r\x1b[0J`)},l=()=>{s(),c(),r(i)};function u(t){t===``?(s(),c(),n.write(` ${w(N.submit)} ${O(e)}\n`),H(),process.exit(130)):t===`\r`||t===`
7
+ `?l():t===`y`||t===`Y`?(i=!0,l()):t===`n`||t===`N`?(i=!1,l()):(t===`\x1B[C`||t===`\x1B[D`||t===`\x1B[A`||t===`\x1B[B`||t===`h`||t===`l`)&&(i=!i,n.write(`\r\x1b[K${be(i)}`))}a.on(`data`,u)}):(n.write(` ${w(N.active)} ${e} ${O(t?`Yes`:`No`)}\n`),t)},xe=async(e,t=``)=>{process.stdout.write(` ${w(N.submit)} ${e}${t?` ${O(`(${t})`)}`:``}\n`);let n=S({input:process.stdin,output:process.stdout});try{return(await n.question(` ${D(N.bar)} `)).trim()||t}finally{n.close()}},Se=`pglaunch@5.5.7`,Ce=async()=>L(`docker`,[`info`]),we=t=>{let n=h(t,`.env`);if(!e(n)){let r=h(t,`.env.example`);d(n,e(r)?l(r):``)}return n},Te=(e,t)=>{let n=`${t}=`,r=l(e).split(`
8
+ `).find(e=>e.startsWith(n));return r?r.slice(n.length).trim():``},Ee=(e,t,n)=>{let r=`${t}=`,i=l(e).split(`
9
9
  `),a=i.findIndex(e=>e.startsWith(r));if(a>=0)i[a]=`${r}${n}`;else{for(;i.length&&i[i.length-1]===``;)i.pop();i.push(`${r}${n}`,``)}d(e,i.join(`
10
- `))},Oe=e=>{let t=Te(e);Ee(t,`BETTER_AUTH_SECRET`)||De(t,`BETTER_AUTH_SECRET`,ne(32).toString(`base64`))},q=t=>{let n=h(t,`.env`);return e(n)&&Ee(n,`POSTGRES_URL`)!==``},ke=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]:``}},Ae=async(e,t)=>{let n=t?[`--bun`,Ce,`-k`,`-c`]:[`--bun`,Ce,`-k`],r;try{r=await F(`bunx`,n,e)}catch(e){let t=e;r=[t.stdout,t.stderr].filter(Boolean).join(`
11
- `)}return{launch:ke(r),out:r}},je=e=>new Promise(t=>setTimeout(t,e)),Me=async e=>{if(e)for(let t=0;t<30;t++){if(await I(`docker`,[`exec`,e,`pg_isready`,`-U`,`postgres`]))return;await je(1e3)}},Ne=async e=>{let t=Te(e),n=await Ae(e,!1),r=n.launch?n:await Ae(e,!0);if(!r.launch)throw Error(r.out.trim()||`pglaunch did not print a connection URL`);De(t,`POSTGRES_URL`,r.launch.url),await Me(r.launch.container),await ge(`bun`,[`run`,`db:migrate`],{cwd:e,label:`Provisioning a local Postgres database`,done:`Provisioned a local Postgres database`})},J=async e=>{await ge(`bun`,[`install`],{cwd:e,label:`Installing dependencies`,done:`Installed dependencies`})},Pe=async()=>{if(!await I(`bun`,[`--version`]))throw Error(`bun is not on PATH`)},Fe=async(e=Pe,t=!!process.versions.bun,n=process.env.npm_config_user_agent||``)=>{if(t||n.startsWith(`bun/`))return!0;try{return await e(),!0}catch{return!1}},Ie=async(e,t=`main`)=>{await F(`bunx`,[`--bun`,`gitpick@6.0.0`,`https://github.com/nrjdalal/zerostarter/tree/${t}`,e])},Le=async(e,t=`main`)=>{await F(`bunx`,[`--bun`,`gitpick@6.0.0`,`https://github.com/nrjdalal/zerostarter/tree/${t}`,e,`-o`])},Re=async(e=`main`)=>{let t=`https://raw.githubusercontent.com/nrjdalal/zerostarter/${e}/.gitpickignore`,n=await fetch(t);if(!n.ok)throw Error(`Could not fetch .gitpickignore from ${e} (HTTP ${n.status}).`);return n.text()},ze=async e=>(await F(`git`,[`status`,`--porcelain`],e)).trim()===``,Be=async(e,t)=>{for(let n of t)try{await F(`git`,[`checkout`,`--`,n],e),await F(`git`,[`clean`,`-fd`,`--`,n],e)}catch{}},Ve=async e=>{await F(`git`,[`reset`,`--hard`,`HEAD`],e),await F(`git`,[`clean`,`-fd`],e)},He=async(t,n,r)=>{if(!e(h(t,`.git`)))throw Error(n);if(!await ze(t))throw Error(r)},Ue=async(e,t,n)=>{try{await n()}catch(n){throw await Ve(e),console.log(t),n}},We=async e=>{await F(`git`,[`init`,`-q`,`-b`,`canary`],e)},Ge=async(e,t)=>{await F(`git`,[`branch`,t],e)},Y=async(e,t)=>{await F(`git`,[`add`,`-A`],e);try{await F(`git`,[`commit`,`--no-verify`,`-q`,`-m`,t],e)}catch{}},X=(e,t)=>{try{return re(t)}catch(t){process.stderr.write(`${O(t instanceof Error?t.message:String(t))}\n\n`),process.stdout.write(`${e}\n`),process.exit(1)}},Ke=(e=process.env.npm_config_user_agent||``)=>e.startsWith(`bun/`)?`bunx`:e.startsWith(`pnpm/`)?`pnpm dlx`:e.startsWith(`yarn/`)?`yarn dlx`:e.startsWith(`npm/`)?`npx`:`unknown`,qe=(e=process.platform)=>e===`win32`?{cmd:`powershell`,args:[`-Command`,`irm bun.sh/install.ps1 | iex`]}:{cmd:`bash`,args:[`-c`,`curl -fsSL https://bun.sh/install | bash`]},Je=(e=process.argv.slice(2))=>[`zerostarter`,...e].join(` `),Ye=()=>h(process.env.BUN_INSTALL||h(ie(),`.bun`),`bin`),Z=async(e=!1)=>{if(await Fe())return;let t=Ke(),n=`bunx --bun ${Je()}`;if(console.error(O(`Seems like you are using ${t===`unknown`?`npx/pnpx`:t} or Windows, try using:`)),console.error(k(` ${n}`)),console.error(``),e||L()&&await K(`Or install bun now and continue?`,!0)){let{cmd:e,args:t}=qe();console.error(`Installing bun from https://bun.sh/install ...`);try{if(await de(e,t),process.env.PATH=`${Ye()}${p}${process.env.PATH||``}`,await Fe())return;console.error(O(`
12
- bun is installed but isn't on this shell's PATH yet. Open a new terminal and re-run:`)),console.error(k(` ${n}`))}catch{console.error(O(`
13
- Could not install bun. Install it from https://bun.sh, then re-run:`)),console.error(k(` ${n}`))}}process.exit(1)},Xe=`Usage:
10
+ `))},De=e=>{let t=we(e);Te(t,`BETTER_AUTH_SECRET`)||Ee(t,`BETTER_AUTH_SECRET`,te(32).toString(`base64`))},J=t=>{let n=h(t,`.env`);return e(n)&&Te(n,`POSTGRES_URL`)!==``},Oe=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]:``}},ke=async(e,t)=>{let n=t?[`--bun`,Se,`-k`,`-c`]:[`--bun`,Se,`-k`],r;try{r=await I(`bunx`,n,e)}catch(e){let t=e;r=[t.stdout,t.stderr].filter(Boolean).join(`
11
+ `)}return{launch:Oe(r),out:r}},Ae=e=>new Promise(t=>setTimeout(t,e)),je=async e=>{if(e)for(let t=0;t<30;t++){if(await L(`docker`,[`exec`,e,`pg_isready`,`-U`,`postgres`]))return;await Ae(1e3)}},Me=async e=>{let t=we(e),n=await ke(e,!1),r=n.launch?n:await ke(e,!0);if(!r.launch)throw Error(r.out.trim()||`pglaunch did not print a connection URL`);Ee(t,`POSTGRES_URL`,r.launch.url),await je(r.launch.container),await he(`bun`,[`run`,`db:migrate`],{cwd:e,label:`Provisioning a local Postgres database`,done:`Provisioned a local Postgres database`})},Y=async e=>{await he(`bun`,[`install`],{cwd:e,label:`Installing dependencies`,done:`Installed dependencies`})},Ne=async()=>{if(!await L(`bun`,[`--version`]))throw Error(`bun is not on PATH`)},Pe=async(e=Ne,t=!!process.versions.bun,n=process.env.npm_config_user_agent||``)=>{if(t||n.startsWith(`bun/`))return!0;try{return await e(),!0}catch{return!1}},Fe=async(e,t=`main`)=>{await I(`bunx`,[`--bun`,`gitpick@6.0.0`,`https://github.com/nrjdalal/zerostarter/tree/${t}`,e])},Ie=async(e,t=`main`)=>{await I(`bunx`,[`--bun`,`gitpick@6.0.0`,`https://github.com/nrjdalal/zerostarter/tree/${t}`,e,`-o`])},Le=async(e=`main`)=>{let t=`https://raw.githubusercontent.com/nrjdalal/zerostarter/${e}/.gitpickignore`,n=await fetch(t);if(!n.ok)throw Error(`Could not fetch .gitpickignore from ${e} (HTTP ${n.status}).`);return n.text()},Re=async e=>(await I(`git`,[`status`,`--porcelain`],e)).trim()===``,ze=async(e,t)=>{for(let n of t)try{await I(`git`,[`checkout`,`--`,n],e),await I(`git`,[`clean`,`-fd`,`--`,n],e)}catch{}},Be=async e=>{await I(`git`,[`reset`,`--hard`,`HEAD`],e),await I(`git`,[`clean`,`-fd`],e)},Ve=async(t,n,r)=>{if(!e(h(t,`.git`)))throw Error(n);if(!await Re(t))throw Error(r)},He=async(e,t,n)=>{try{await n()}catch(n){throw await Be(e),console.log(t),n}},Ue=async e=>{await I(`git`,[`init`,`-q`,`-b`,`canary`],e)},We=async(e,t)=>{await I(`git`,[`branch`,t],e)},X=async(e,t)=>{await I(`git`,[`add`,`-A`],e);try{await I(`git`,[`commit`,`--no-verify`,`-q`,`-m`,t],e)}catch{}},Z=(e,t)=>{try{return ne(t)}catch(t){process.stderr.write(`${k(t instanceof Error?t.message:String(t))}\n\n`),process.stdout.write(`${e}\n`),process.exit(1)}},Ge=(e=process.env.npm_config_user_agent||``)=>e.startsWith(`bun/`)?`bunx`:e.startsWith(`pnpm/`)?`pnpm dlx`:e.startsWith(`yarn/`)?`yarn dlx`:e.startsWith(`npm/`)?`npx`:`unknown`,Ke=(e=process.platform)=>e===`win32`?{cmd:`powershell`,args:[`-Command`,`irm bun.sh/install.ps1 | iex`]}:{cmd:`bash`,args:[`-c`,`curl -fsSL https://bun.sh/install | bash`]},qe=(e=process.argv.slice(2))=>[`zerostarter`,...e].join(` `),Je=()=>h(process.env.BUN_INSTALL||h(re(),`.bun`),`bin`),Q=async(e=!1)=>{if(await Pe())return;let t=Ge(),n=`bunx --bun ${qe()}`;if(console.error(k(`Seems like you are using ${t===`unknown`?`npx/pnpx`:t} or Windows, try using:`)),console.error(A(` ${n}`)),console.error(``),e||R()&&await q(`Or install bun now and continue?`,!0)){let{cmd:e,args:t}=Ke();console.error(`Installing bun from https://bun.sh/install ...`);try{if(await ue(e,t),process.env.PATH=`${Je()}${p}${process.env.PATH||``}`,await Pe())return;console.error(k(`
12
+ bun is installed but isn't on this shell's PATH yet. Open a new terminal and re-run:`)),console.error(A(` ${n}`))}catch{console.error(k(`
13
+ Could not install bun. Install it from https://bun.sh, then re-run:`)),console.error(A(` ${n}`))}}process.exit(1)},Ye=`Usage:
14
14
  $ bunx zerostarter init [dir] [options]
15
15
 
16
16
  Scaffold ZeroStarter into dir (default .) as a fresh product. The author's
@@ -24,10 +24,10 @@ Options:
24
24
  --canary Scaffold from the canary branch instead of main (for testing)
25
25
  --db Provision a local Postgres (pglaunch) and migrate; needs Docker
26
26
  --dry-run Print the plan without writing anything
27
- -h, --help Display help`,Ze=e=>!v(e)||ee(e).filter(e=>e!==`.git`).length===0,Q=t=>e(h(t,`packages/config/src/site.ts`)),Qe=e=>{let t=e,{root:n}=g(t);for(;;){if(v(h(t,`bun.lock`))||v(h(t,`bun.lockb`)))return t;let e=h(t,`package.json`);if(v(e))try{if(JSON.parse(y(e,`utf8`)).workspaces)return t}catch{}if(t===n)return null;t=m(t)}},$e=async t=>{let{positionals:n,values:r}=X(Xe,{allowPositionals:!0,args:t,options:{canary:{type:`boolean`},db:{type:`boolean`},"dry-run":{type:`boolean`},help:{short:`h`,type:`boolean`},yes:{short:`y`,type:`boolean`}}});if(r.help){console.log(Xe);return}r[`dry-run`]||await Z(!!r.yes);let i=L()&&!r.yes,a=r.canary?`canary`:`main`,o=n[0]??`.`,s=_(o),c=Q(s),l=!c&&!Ze(s);if(!c&&!r[`dry-run`]){let e=Qe(l?process.cwd():m(s));if(e)throw Error(`Cannot scaffold inside an existing project (a workspace was found at ${e}). Run it in a fresh directory outside that project.`)}if(r[`dry-run`]||z(R(`https://zerostarter.dev`)),l){if(!i)throw Error(`Directory is not empty. Run it in an empty directory, or pass a project name: bunx zerostarter init <name>`);let e=await Se(`What should we name your project?`);if(!e)throw Error(`No directory name provided.`);o=e}let d=_(o),p=f(d),g={name:p};if(r[`dry-run`]){console.log(`bunx zerostarter init (dry run)`),console.log(` target: ${d}`),console.log(` name: ${p}`),console.log(` mode: ${Q(d)?`in place`:`fetch ${a}`}`);return}if(c&&i&&!await K(`Convert ${p} in place? This rewrites files and commits.`,!1)){V(`Aborted`);return}if(Q(d))r.canary&&G(`--canary ignored: converting the existing checkout in place, so nothing is fetched.`);else{let e=r.canary?` (canary)`:``;await be(`Fetching the latest ZeroStarter${e}`,`Fetched the latest ZeroStarter${e}`,()=>Ie(d,a))}e(h(d,`.git`))||(await We(d),await Y(d,`ci(init): scaffold from zerostarter`),await Ge(d,`main`)),await be(`Rebranding to ${p}`,`Rebranded to ${p}`,()=>u(d,g)),await J(d),await Y(d,`ci(init): re-baseline as ${p}`),Oe(d);let v=!1,y=await we(),ee=q(d),b=!1;if(ee?r.db&&G(`--db ignored: POSTGRES_URL is already set in .env.`):b=r.db?!0:i?await K(`Provision a local Postgres database?`,y):y,b&&y)try{await Ne(d),v=!0}catch(e){if(q(d))G(`Postgres is provisioned, but the migration failed; run bun run db:migrate.`);else{let t=e instanceof Error?e.message.trim():String(e);G(`Database setup failed; set POSTGRES_URL in .env yourself.`,t?t.split(`
28
- `).filter(e=>e.trim()).slice(-5):[])}}else b&&G(`Docker isn't running, so the database wasn't provisioned. Set POSTGRES_URL in .env, or start Docker and re-run for automatic setup.`);U([`${k(`packages/config/src/site.ts`)} and ${k(`web/next/content`)}`,`to manage branding and blogs & docs respectively`].join(`
29
- `),`Edit and make it yours`),ye(`${p} is ready`);let x=[];d!==process.cwd()&&x.push(k(`cd ${o}`)),q(d)||x.push(`set POSTGRES_URL in .env`),v||x.push(k(`bun run db:migrate`)),x.push(k(`bun run dev`)),U(x.join(`
30
- `),`Next steps`),B(`Learn more ${R(`https://zerostarter.dev/docs`)}`)},et=`Usage:
27
+ -h, --help Display help`,Xe=e=>!v(e)||b(e).filter(e=>e!==`.git`).length===0,$=t=>e(h(t,`packages/config/src/site.ts`)),Ze=e=>{let t=e,{root:n}=g(t);for(;;){if(v(h(t,`bun.lock`))||v(h(t,`bun.lockb`)))return t;let e=h(t,`package.json`);if(v(e))try{if(JSON.parse(y(e,`utf8`)).workspaces)return t}catch{}if(t===n)return null;t=m(t)}},Qe=async t=>{let{positionals:n,values:r}=Z(Ye,{allowPositionals:!0,args:t,options:{canary:{type:`boolean`},db:{type:`boolean`},"dry-run":{type:`boolean`},help:{short:`h`,type:`boolean`},yes:{short:`y`,type:`boolean`}}});if(r.help){console.log(Ye);return}r[`dry-run`]||await Q(!!r.yes);let i=R()&&!r.yes,a=r.canary?`canary`:`main`,o=n[0]??`.`,s=_(o),c=$(s),l=!c&&!Xe(s);if(!c&&!r[`dry-run`]){let e=Ze(l?process.cwd():m(s));if(e)throw Error(`Cannot scaffold inside an existing project (a workspace was found at ${e}). Run it in a fresh directory outside that project.`)}if(r[`dry-run`]||B(z(`https://zerostarter.dev`)),l){if(!i)throw Error(`Directory is not empty. Run it in an empty directory, or pass a project name: bunx zerostarter init <name>`);let e=await xe(`What should we name your project?`);if(!e)throw Error(`No directory name provided.`);o=e}let d=_(o),p=f(d),g={name:p},v=`--canary ignored: converting the existing checkout in place, so nothing is fetched.`;if(r[`dry-run`]){console.log(`bunx zerostarter init (dry run)`),console.log(` target: ${d}`),console.log(` name: ${p}`),console.log(` mode: ${$(d)?`in place`:`fetch ${a}`}`),$(d)&&r.canary&&console.log(` note: ${v}`);return}if(c&&i&&!await q(`Convert ${p} in place? This rewrites files and commits.`,!1)){H(`Aborted`);return}if($(d))r.canary&&K(v);else{let e=r.canary?` (canary)`:``;await ye(`Fetching the latest ZeroStarter${e}`,`Fetched the latest ZeroStarter${e}`,()=>Fe(d,a))}e(h(d,`.git`))||(await Ue(d),await X(d,`ci(init): scaffold from zerostarter`),await We(d,`main`)),await ye(`Rebranding to ${p}`,`Rebranded to ${p}`,()=>u(d,g)),await Y(d),await X(d,`ci(init): re-baseline as ${p}`),De(d);let y=!1,b=await Ce(),ee=J(d),x=!1;if(ee?r.db&&K(`--db ignored: POSTGRES_URL is already set in .env.`):x=r.db?!0:i?await q(`Provision a local Postgres database?`,b):b,x&&b)try{await Me(d),y=!0}catch(e){if(J(d))K(`Postgres is provisioned, but the migration failed; run bun run db:migrate.`);else{let t=e instanceof Error?e.message.trim():String(e);K(`Database setup failed; set POSTGRES_URL in .env yourself.`,t?t.split(`
28
+ `).filter(e=>e.trim()).slice(-5):[])}}else x&&K(`Docker isn't running, so the database wasn't provisioned. Set POSTGRES_URL in .env, or start Docker and re-run for automatic setup.`);W([`${A(`packages/config/src/site.ts`)} and ${A(`web/next/content`)}`,`to manage branding and blogs & docs respectively`].join(`
29
+ `),`Edit and make it yours`),ve(`${p} is ready`);let S=[];d!==process.cwd()&&S.push(A(`cd ${o}`)),J(d)||S.push(`set POSTGRES_URL in .env`),y||S.push(A(`bun run db:migrate`)),S.push(A(`bun run dev`)),W(S.join(`
30
+ `),`Next steps`),V(`Learn more ${z(`https://zerostarter.dev/docs`)}`)},$e=`Usage:
31
31
  $ bunx zerostarter reinit [dir] [options]
32
32
 
33
33
  Re-scaffold an existing git repo (default .) as a fresh ZeroStarter: delete every
@@ -37,8 +37,8 @@ branch; push when ready.
37
37
 
38
38
  Options:
39
39
  -y, --yes Skip the confirmation prompt
40
- -h, --help Display help`,tt=async e=>{let{positionals:t,values:n}=X(et,{allowPositionals:!0,args:e,options:{help:{short:`h`,type:`boolean`},yes:{short:`y`,type:`boolean`}}});if(n.help){console.log(et);return}await Z(!!n.yes);let r=_(t[0]??`.`),a=f(r),o=L()&&!n.yes;if(await He(r,`No git repository in ${r}. reinit re-scaffolds an existing repo; use init for a new project.`,`Working tree has uncommitted changes. Commit or stash them first; reinit deletes every tracked file.`),z(R(`https://zerostarter.dev`)),o&&!await K(`Delete every file in ${a} (keeping .git and .env*) and re-scaffold?`,!1)){V(`Aborted`);return}await Ue(r,T(`reinit failed; restored your committed files (deleted gitignored files, except .env*, are gone).`),async()=>{i(r),await Le(r),W(`Fetched the latest ZeroStarter (kept .git and .env*)`),u(r,{name:a}),W(`Rebranded to ${a}`),await J(r),Oe(r),await Y(r,`ci(reinit): re-baseline as ${a}`)});let s=[];q(r)||s.push(`set POSTGRES_URL in .env`),s.push(k(`bun run db:migrate`)),s.push(k(`bun run dev`)),s.push(k(`git push`)),U(s.join(`
41
- `),`Next steps`),B(w(`${a} re-scaffolded; .git history, remote, and .env* files are intact`))},nt=`Usage:
40
+ -h, --help Display help`,et=async e=>{let{positionals:t,values:n}=Z($e,{allowPositionals:!0,args:e,options:{help:{short:`h`,type:`boolean`},yes:{short:`y`,type:`boolean`}}});if(n.help){console.log($e);return}await Q(!!n.yes);let r=_(t[0]??`.`),a=f(r),o=R()&&!n.yes;if(await Ve(r,`No git repository in ${r}. reinit re-scaffolds an existing repo; use init for a new project.`,`Working tree has uncommitted changes. Commit or stash them first; reinit deletes every tracked file.`),B(z(`https://zerostarter.dev`)),o&&!await q(`Delete every file in ${a} (keeping .git and .env*) and re-scaffold?`,!1)){H(`Aborted`);return}await He(r,E(`reinit failed; restored your committed files (deleted gitignored files, except .env*, are gone).`),async()=>{i(r),await Ie(r),G(`Fetched the latest ZeroStarter (kept .git and .env*)`),u(r,{name:a}),G(`Rebranded to ${a}`),await Y(r),De(r),await X(r,`ci(reinit): re-baseline as ${a}`)});let s=[];J(r)||s.push(`set POSTGRES_URL in .env`),s.push(A(`bun run db:migrate`)),s.push(A(`bun run dev`)),s.push(A(`git push`)),W(s.join(`
41
+ `),`Next steps`),V(T(`${a} re-scaffolded; .git history, remote, and .env* files are intact`))},tt=`Usage:
42
42
  $ bunx zerostarter sync [dir] [options]
43
43
 
44
44
  Re-baseline an existing fork (default .) on the latest ZeroStarter: a gitpick overlay
@@ -47,14 +47,14 @@ identity, and favicon are preserved. Requires a clean tree; lands as a reviewabl
47
47
  you commit yourself.
48
48
 
49
49
  Options:
50
- -h, --help Display help`,rt=async i=>{let{positionals:l,values:u}=X(nt,{allowPositionals:!0,args:i,options:{help:{short:`h`,type:`boolean`}}});if(u.help){console.log(nt);return}await Z();let d=_(l[0]??`.`);await He(d,`No git repository in ${d}. Run sync inside an existing fork.`,`Working tree has uncommitted changes. Commit or stash them first so the sync lands as a reviewable diff.`),z(R(`https://zerostarter.dev`));let f=h(d,`package.json`),p=new Map(s(d).map(e=>[e,t(e)])),m=r(await Re()).preserve;m.length===0&&G(`No PRESERVE_ON_SYNC directive found; fork-owned files may be overwritten.`),await Ue(d,T(`Sync failed; rolled the working tree back to your last commit.`),async()=>{await Le(d),o(d),a(h(d,`.gitpickignore`));for(let[r,i]of p)e(r)&&n(r,c(i,t(r),r===f));await Be(d,m)}),W(`Overlaid the latest ZeroStarter (content, public/marketing, and branding preserved)`),await J(d),U([`Starter files were updated (edits overwritten); your content, public/marketing, and branding were preserved.`,T(`Review the diff and commit: git -C ${d} status`)].join(`
51
- `),`Review the changes`),B(k(`Synced to the latest ZeroStarter`))},{author:it,name:$,version:at}=_e,ot=`Version:
52
- ${$}@${at}
50
+ -h, --help Display help`,nt=async i=>{let{positionals:l,values:u}=Z(tt,{allowPositionals:!0,args:i,options:{help:{short:`h`,type:`boolean`}}});if(u.help){console.log(tt);return}await Q();let d=_(l[0]??`.`);await Ve(d,`No git repository in ${d}. Run sync inside an existing fork.`,`Working tree has uncommitted changes. Commit or stash them first so the sync lands as a reviewable diff.`),B(z(`https://zerostarter.dev`));let f=h(d,`package.json`),p=new Map(s(d).map(e=>[e,t(e)])),m=r(await Le()).preserve;m.length===0&&K(`No PRESERVE_ON_SYNC directive found; fork-owned files may be overwritten.`),await He(d,E(`Sync failed; rolled the working tree back to your last commit.`),async()=>{await Ie(d),o(d),a(h(d,`.gitpickignore`));for(let[r,i]of p)e(r)&&n(r,c(i,t(r),r===f));await ze(d,m)}),G(`Overlaid the latest ZeroStarter (content, public/marketing, and branding preserved)`),await Y(d),W([`Starter files were updated (edits overwritten); your content, public/marketing, and branding were preserved.`,E(`Review the diff and commit: git -C ${d} status`)].join(`
51
+ `),`Review the changes`),V(A(`Synced to the latest ZeroStarter`))},{author:rt,name:it,version:at}=ge,ot=`Version:
52
+ ${it}@${at}
53
53
 
54
54
  Go from zero to a production-ready SaaS, rebranded and ready to ship.
55
55
 
56
56
  Usage:
57
- $ ${$} <command> [options]
57
+ $ ${it} <command> [options]
58
58
 
59
59
  Commands:
60
60
  init [dir] Scaffold ZeroStarter into dir (default .) as a fresh product.
@@ -67,4 +67,4 @@ Options:
67
67
  -h, --help Display help
68
68
 
69
69
  Author:
70
- ${it.name} <${it.email}> (${ve(it.url)})`;(async()=>{try{let e=process.argv.slice(2),t=e[0],n=e.slice(1);switch(t){case`init`:return await $e(n);case`reinit`:return await tt(n);case`sync`:return await rt(n);case void 0:case`-h`:case`--help`:console.log(ot);return;case`-v`:case`--version`:console.log(`${$}@${at}`);return;default:console.error(O(`Unknown command: ${t}\n`)),console.log(ot),process.exit(1)}}catch(e){he(e),process.exit(1)}})();export{};
70
+ ${rt.name} <${rt.email}> (${_e(rt.url)})`;(async()=>{try{let e=process.argv.slice(2),t=e[0],n=e.slice(1);switch(t){case`init`:return await Qe(n);case`reinit`:return await et(n);case`sync`:return await nt(n);case void 0:case`-h`:case`--help`:console.log(ot);return;case`-v`:case`--version`:console.log(`${it}@${at}`);return;default:console.error(k(`Unknown command: ${t}\n`)),console.log(ot),process.exit(1)}}catch(e){me(e),process.exit(1)}})();export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zerostarter",
3
- "version": "0.1.1",
3
+ "version": "0.1.2-canary.0",
4
4
  "description": "Go from zero to a production-ready SaaS, rebranded and ready to ship.",
5
5
  "keywords": [
6
6
  "cli",