zerostarter 0.0.17 → 0.0.18-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.
@@ -1,9 +1,9 @@
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-a1Am2aM1.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 x={name:`zerostarter`,version:`0.0.17`,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 S=()=>!!(process.stdin.isTTY&&process.stdout.isTTY),ee=(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`]}),j=()=>{try{return y(`docker`,[`info`],{stdio:`ignore`}),!0}catch{return!1}},M=e=>{let r=p(e,`.env`);if(!s(r)){let i=p(e,`.env.example`);n(r,s(i)?t(i):``)}return r},N=(e,n)=>{let r=`${n}=`,i=t(e).split(`
3
- `).find(e=>e.startsWith(r));return i?i.slice(r.length).trim():``},P=(e,r,i)=>{let a=`${r}=`,o=t(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-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-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 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
+ `).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
- `))},F=e=>{let t=M(e);N(t,`BETTER_AUTH_SECRET`)||P(t,`BETTER_AUTH_SECRET`,b(32).toString(`base64`))},I=e=>{let t=p(e,`.env`);return s(t)&&N(t,`POSTGRES_URL`)!==``},L=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}},R=(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(`
6
- `)}return L(r)},z=e=>{Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},ne=e=>{if(e)for(let t=0;t<30;t++)try{y(`docker`,[`exec`,e,`pg_isready`,`-U`,`postgres`],{stdio:`ignore`});return}catch{z(1e3)}},re=e=>{let t=M(e),n=n=>{P(t,`POSTGRES_URL`,n.url),ne(n.container),A(`bun`,[`run`,`db:migrate`],e)},r=R(e,!1);if(r&&r.reused){n(r);return}if(r)try{n(r);return}catch{}let i=R(e,!0);if(!i)throw Error(`pglaunch did not print a connection URL`);n(i)},B=(e,t,n)=>y(e,t,{cwd:n,encoding:`utf8`,stdio:[`ignore`,`pipe`,`pipe`]}),ie=(e,t=`main`)=>{B(`bunx`,[`gitpick@6.0.0`,`https://github.com/nrjdalal/zerostarter/tree/${t}`,e])},V=(e,t=`main`)=>{B(`bunx`,[`gitpick@6.0.0`,`https://github.com/nrjdalal/zerostarter/tree/${t}`,e,`-o`])},ae=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()},H=e=>B(`git`,[`status`,`--porcelain`],e).trim()===``,U=(e,t)=>{for(let n of t)try{B(`git`,[`checkout`,`--`,n],e),B(`git`,[`clean`,`-fd`,`--`,n],e)}catch{}},W=e=>{B(`git`,[`reset`,`--hard`,`HEAD`],e),B(`git`,[`clean`,`-fd`],e)},G=(e,t,n)=>{if(!s(p(e,`.git`)))throw Error(t);if(!H(e))throw Error(n)},K=async(e,t,n)=>{try{await n()}catch(n){throw W(e),console.log(t),n}},q=e=>{B(`bun`,[`install`],e)},oe=e=>{B(`git`,[`init`,`-q`,`-b`,`canary`],e)},se=(e,t)=>{B(`git`,[`branch`,t],e)},J=(e,t)=>{B(`git`,[`add`,`-A`],e);try{B(`git`,[`commit`,`--no-verify`,`-q`,`-m`,t],e)}catch{}},ce=e=>!h(e)||g(e).filter(e=>e!==`.git`).length===0,Y=e=>s(p(e,`packages/config/src/site.ts`)),le=async e=>{let{positionals:t,values:n}=v({allowPositionals:!0,args:e,options:{db:{type:`boolean`},"dry-run":{type:`boolean`},help:{short:`h`,type:`boolean`},yes:{short:`y`,type:`boolean`}}});if(n.help){console.log(`Usage:
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(`
6
+ `)}return re(r)},ie=e=>{Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},L=e=>{if(e)for(let t=0;t<30;t++)try{y(`docker`,[`exec`,e,`pg_isready`,`-U`,`postgres`],{stdio:`ignore`});return}catch{ie(1e3)}},ae=e=>{let t=j(e),n=n=>{N(t,`POSTGRES_URL`,n.url),L(n.container),A(`bun`,[`run`,`db:migrate`],e)},r=I(e,!1);if(r&&r.reused){n(r);return}if(r)try{n(r);return}catch{}let i=I(e,!0);if(!i)throw Error(`pglaunch did not print a connection URL`);n(i)},R=(e,t,n)=>y(e,t,{cwd:n,encoding:`utf8`,stdio:[`ignore`,`pipe`,`pipe`]}),oe=()=>{y(`bun`,[`--version`],{stdio:`ignore`})},z=(e=oe)=>{try{e()}catch(e){throw Error("ZeroStarter needs Bun, but `bun` isn't on your PATH. Install it from https://bun.sh, then re-run with `bunx zerostarter ...` (not `npx`). The CLI shells out to bun and bunx to fetch, install, and migrate.",{cause:e})}},se=(e,t=`main`)=>{R(`bunx`,[`gitpick@6.0.0`,`https://github.com/nrjdalal/zerostarter/tree/${t}`,e])},B=(e,t=`main`)=>{R(`bunx`,[`gitpick@6.0.0`,`https://github.com/nrjdalal/zerostarter/tree/${t}`,e,`-o`])},ce=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()},V=e=>R(`git`,[`status`,`--porcelain`],e).trim()===``,H=(e,t)=>{for(let n of t)try{R(`git`,[`checkout`,`--`,n],e),R(`git`,[`clean`,`-fd`,`--`,n],e)}catch{}},U=e=>{R(`git`,[`reset`,`--hard`,`HEAD`],e),R(`git`,[`clean`,`-fd`],e)},W=(e,t,n)=>{if(!s(p(e,`.git`)))throw Error(t);if(!V(e))throw Error(n)},G=async(e,t,n)=>{try{await n()}catch(n){throw U(e),console.log(t),n}},K=e=>{R(`bun`,[`install`],e)},le=e=>{R(`git`,[`init`,`-q`,`-b`,`canary`],e)},ue=(e,t)=>{R(`git`,[`branch`,t],e)},q=(e,t)=>{R(`git`,[`add`,`-A`],e);try{R(`git`,[`commit`,`--no-verify`,`-q`,`-m`,t],e)}catch{}},J=e=>!h(e)||g(e).filter(e=>e!==`.git`).length===0,Y=e=>s(p(e,`packages/config/src/site.ts`)),de=async e=>{let{positionals:t,values:n}=v({allowPositionals:!0,args:e,options:{db:{type:`boolean`},"dry-run":{type:`boolean`},help:{short:`h`,type:`boolean`},yes:{short:`y`,type:`boolean`}}});if(n.help){console.log(`Usage:
7
7
  $ bunx zerostarter init [dir] [options]
8
8
 
9
9
  Scaffold ZeroStarter into dir (default .) as a fresh product. The author's
@@ -16,11 +16,11 @@ Options:
16
16
  -y, --yes Skip prompts, taking defaults (provisions Postgres when Docker is running)
17
17
  --db Provision a local Postgres (pglaunch) and migrate; needs Docker
18
18
  --dry-run Print the plan without writing anything
19
- -h, --help Display help`);return}let r=S()&&!n.yes,i=t[0]??`.`,a=m(i),o=Y(a);if(!o&&!ce(a)){if(!r)throw Error(`Directory is not empty. Run it in an empty directory, or pass a project name: bunx zerostarter init <name>`);let e=await te(`Directory isn't empty. Project name`);if(!e)throw Error(`No directory name provided.`);i=e}let c=m(i),l=f(c),d={name:l};if(n[`dry-run`]){console.log(`bunx zerostarter init (dry run)`),console.log(` target: ${c}`),console.log(` name: ${l}`),console.log(` mode: ${Y(c)?`in place`:`fetch first`}`);return}if(o&&r&&!await O(E(`Convert ${c} in place? This rewrites files and commits.`),!1)){console.log(`Aborted.`);return}console.log(),Y(c)||(console.log(`Fetching the latest ZeroStarter ...`),ie(c)),s(p(c,`.git`))||(oe(c),J(c,`ci(init): scaffold from zerostarter`),se(c,`main`)),console.log(`Removing starter content and rebranding ...`),u(c,d),console.log(`Installing dependencies ...`),q(c),J(c,`ci(init): re-baseline as ${l}`),F(c);let h=!1,g=j(),_=I(c),y=!1;if(_?n.db&&console.log(E(` --db ignored: POSTGRES_URL is already set in .env.`)):y=n.db?!0:r?await O(`Provision a local Postgres database now?`,g):g,y&&g)try{console.log(`Provisioning a local database with pglaunch and migrating ...`),re(c),h=!0}catch(e){let t=e.stderr,n=t?String(t).trim():e instanceof Error?e.message:String(e);console.log(E(` Database setup failed; set POSTGRES_URL in .env yourself.`)),n&&console.log(E(` ${n}`))}else y&&console.log(E(` Docker isn't running, so the database wasn't provisioned. Set POSTGRES_URL in .env, or start Docker and re-run for automatic setup.`));let b=[[`packages/config/src/site.ts`,`your brand: name, tagline, links`],[`web/next/content`,`your docs and blog`],[`web/next/public`,`your logo and assets`]];console.log(`\n${T(`✓`)} ${l} is ready.\n`),console.log(`Next steps:`),c!==process.cwd()&&console.log(` ${w(`cd ${i}`)}`),h||(console.log(` ${w(`set POSTGRES_URL in .env`)} # your Postgres connection string`),console.log(` ${w(`bun run db:migrate`)}`)),console.log(` ${w(`bun run dev`)}`),console.log(`
19
+ -h, --help Display help`);return}n[`dry-run`]||z();let r=x()&&!n.yes,i=t[0]??`.`,a=m(i),o=Y(a);if(!o&&!J(a)){if(!r)throw Error(`Directory is not empty. Run it in an empty directory, or pass a project name: bunx zerostarter init <name>`);let e=await te(`Directory isn't empty. Project name`);if(!e)throw Error(`No directory name provided.`);i=e}let c=m(i),l=f(c),d={name:l};if(n[`dry-run`]){console.log(`bunx zerostarter init (dry run)`),console.log(` target: ${c}`),console.log(` name: ${l}`),console.log(` mode: ${Y(c)?`in place`:`fetch first`}`);return}if(o&&r&&!await O(E(`Convert ${c} in place? This rewrites files and commits.`),!1)){console.log(`Aborted.`);return}console.log(),Y(c)||(console.log(`Fetching the latest ZeroStarter ...`),se(c)),s(p(c,`.git`))||(le(c),q(c,`ci(init): scaffold from zerostarter`),ue(c,`main`)),console.log(`Removing starter content and rebranding ...`),u(c,d),console.log(`Installing dependencies ...`),K(c),q(c,`ci(init): re-baseline as ${l}`),P(c);let h=!1,g=ne(),_=F(c),y=!1;if(_?n.db&&console.log(E(` --db ignored: POSTGRES_URL is already set in .env.`)):y=n.db?!0:r?await O(`Provision a local Postgres database now?`,g):g,y&&g)try{console.log(`Provisioning a local database with pglaunch and migrating ...`),ae(c),h=!0}catch(e){let t=e.stderr,n=t?String(t).trim():e instanceof Error?e.message:String(e);console.log(E(` Database setup failed; set POSTGRES_URL in .env yourself.`)),n&&console.log(E(` ${n}`))}else y&&console.log(E(` Docker isn't running, so the database wasn't provisioned. Set POSTGRES_URL in .env, or start Docker and re-run for automatic setup.`));let b=[[`packages/config/src/site.ts`,`your brand: name, tagline, links`],[`web/next/content`,`your docs and blog`],[`web/next/public`,`your logo and assets`]];console.log(`\n${T(`✓`)} ${l} is ready.\n`),console.log(`Next steps:`),c!==process.cwd()&&console.log(` ${w(`cd ${i}`)}`),h||(console.log(` ${w(`set POSTGRES_URL in .env`)} # your Postgres connection string`),console.log(` ${w(`bun run db:migrate`)}`)),console.log(` ${w(`bun run dev`)}`),console.log(`
20
20
  Push to an empty GitHub repo when ready:`),console.log(` ${w(`git push origin canary`)}`),console.log(`canary becomes the default branch; your next push seeds main and opens the release PR.`),console.log(`
21
21
  Make it yours:`);for(let[e,t]of b)console.log(` ${e.padEnd(29)} ${t}`);console.log(h?`
22
22
  Everything works out of the box. Try it now; add OAuth or other credentials to .env whenever you like.`:`
23
- It needs a Postgres database to run: a hosted one like Neon works, or a local Docker one. OAuth and other credentials are optional.`)},ue=async t=>{let{positionals:n,values:r}=v({allowPositionals:!0,args:t,options:{help:{short:`h`,type:`boolean`},yes:{short:`y`,type:`boolean`}}});if(r.help){console.log(`Usage:
23
+ It needs a Postgres database to run: a hosted one like Neon works, or a local Docker one. OAuth and other credentials are optional.`)},fe=async t=>{let{positionals:n,values:r}=v({allowPositionals:!0,args:t,options:{help:{short:`h`,type:`boolean`},yes:{short:`y`,type:`boolean`}}});if(r.help){console.log(`Usage:
24
24
  $ bunx zerostarter reinit [dir] [options]
25
25
 
26
26
  Re-scaffold an existing git repo (default .) as a fresh ZeroStarter: delete every
@@ -30,7 +30,7 @@ branch; push when ready.
30
30
 
31
31
  Options:
32
32
  -y, --yes Skip the confirmation prompt
33
- -h, --help Display help`);return}let i=m(n[0]??`.`),a=f(i),o=S()&&!r.yes;if(G(i,`No git repository in ${i}. 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.`),o&&!await O(E(`Delete every file in ${i} (keeping .git and .env*) and re-scaffold as ${a}?`),!1)){console.log(`Aborted.`);return}console.log(),console.log(`Removing all files (keeping .git and your .env* files) ...`),await K(i,E(`reinit failed; restored your committed files (deleted gitignored files, except .env*, are gone).`),()=>{e(i),console.log(`Fetching the latest ZeroStarter ...`),V(i),console.log(`Rebranding ...`),u(i,{name:a}),console.log(`Installing dependencies ...`),q(i),F(i),J(i,`ci(reinit): re-baseline as ${a}`)}),console.log(`\n${T(`✓`)} ${a} re-scaffolded; .git history, remote, and .env* files are intact.`),console.log(`Next steps:`),I(i)||(console.log(` ${w(`set POSTGRES_URL in .env`)} # your Postgres connection string`),console.log(` ${w(`bun run db:migrate`)}`)),console.log(` ${w(`bun run dev`)}`),console.log(` ${w(`git push`)} # to your existing remote`)},de=async e=>{let{positionals:t,values:n}=v({allowPositionals:!0,args:e,options:{help:{short:`h`,type:`boolean`}}});if(n.help){console.log(`Usage:
33
+ -h, --help Display help`);return}z();let i=m(n[0]??`.`),a=f(i),o=x()&&!r.yes;if(W(i,`No git repository in ${i}. 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.`),o&&!await O(E(`Delete every file in ${i} (keeping .git and .env*) and re-scaffold as ${a}?`),!1)){console.log(`Aborted.`);return}console.log(),console.log(`Removing all files (keeping .git and your .env* files) ...`),await G(i,E(`reinit failed; restored your committed files (deleted gitignored files, except .env*, are gone).`),()=>{e(i),console.log(`Fetching the latest ZeroStarter ...`),B(i),console.log(`Rebranding ...`),u(i,{name:a}),console.log(`Installing dependencies ...`),K(i),P(i),q(i,`ci(reinit): re-baseline as ${a}`)}),console.log(`\n${T(`✓`)} ${a} re-scaffolded; .git history, remote, and .env* files are intact.`),console.log(`Next steps:`),F(i)||(console.log(` ${w(`set POSTGRES_URL in .env`)} # your Postgres connection string`),console.log(` ${w(`bun run db:migrate`)}`)),console.log(` ${w(`bun run dev`)}`),console.log(` ${w(`git push`)} # to your existing remote`)},pe=async e=>{let{positionals:t,values:n}=v({allowPositionals:!0,args:e,options:{help:{short:`h`,type:`boolean`}}});if(n.help){console.log(`Usage:
34
34
  $ bunx zerostarter sync [dir] [options]
35
35
 
36
36
  Re-baseline an existing fork (default .) on the latest ZeroStarter: a gitpick overlay
@@ -39,7 +39,7 @@ identity, and favicon are preserved. Requires a clean tree; lands as a reviewabl
39
39
  you commit yourself.
40
40
 
41
41
  Options:
42
- -h, --help Display help`);return}let u=m(t[0]??`.`);G(u,`No git repository in ${u}. Run sync inside an existing fork.`,`Working tree has uncommitted changes. Commit or stash them first so the sync lands as a reviewable diff.`);let f=p(u,`package.json`),h=new Map(l(u).map(e=>[e,a(e)])),g=i(await ae());g.length===0&&console.log(E(`Warning: no PRESERVE_ON_SYNC directive found; fork-owned files may be overwritten.`)),console.log(),console.log(`Overlaying the latest ZeroStarter (content, public/marketing, and site.ts preserved) ...`),await K(u,E(`Sync failed; rolled the working tree back to your last commit.`),()=>{V(u),o(u),d(p(u,`.gitpickignore`));for(let[e,t]of h)s(e)&&r(e,c(t,a(e),e===f));U(u,g)}),console.log(`Installing dependencies ...`),q(u),console.log(),console.log(w(`Synced to the latest ZeroStarter.`)),console.log(`Starter files were updated (edits to them were overwritten); files you added and your`),console.log(`content, public/marketing, and branding were preserved.`),console.log(E(`Review the diff and commit: git -C ${u} status`))},{author:X,name:Z,version:Q}=x,$=`Version:
42
+ -h, --help Display help`);return}z();let u=m(t[0]??`.`);W(u,`No git repository in ${u}. Run sync inside an existing fork.`,`Working tree has uncommitted changes. Commit or stash them first so the sync lands as a reviewable diff.`);let f=p(u,`package.json`),h=new Map(l(u).map(e=>[e,a(e)])),g=i(await ce());g.length===0&&console.log(E(`Warning: no PRESERVE_ON_SYNC directive found; fork-owned files may be overwritten.`)),console.log(),console.log(`Overlaying the latest ZeroStarter (content, public/marketing, and site.ts preserved) ...`),await G(u,E(`Sync failed; rolled the working tree back to your last commit.`),()=>{B(u),o(u),d(p(u,`.gitpickignore`));for(let[e,t]of h)s(e)&&r(e,c(t,a(e),e===f));H(u,g)}),console.log(`Installing dependencies ...`),K(u),console.log(),console.log(w(`Synced to the latest ZeroStarter.`)),console.log(`Starter files were updated (edits to them were overwritten); files you added and your`),console.log(`content, public/marketing, and branding were preserved.`),console.log(E(`Review the diff and commit: git -C ${u} status`))},{author:X,name:Z,version:Q}=ee,$=`Version:
43
43
  ${Z}@${Q}
44
44
 
45
45
  Go from zero to a production-ready SaaS, rebranded and ready to ship.
@@ -58,4 +58,4 @@ Options:
58
58
  -h, --help Display help
59
59
 
60
60
  Author:
61
- ${X.name} <${X.email}> (${ee(X.url)})`;(async()=>{try{let e=process.argv.slice(2),t=e[0],n=e.slice(1);switch(t){case`init`:return await le(n);case`reinit`:return await ue(n);case`sync`:return await de(n);case void 0:case`-h`:case`--help`:console.log($);return;case`-v`:case`--version`:console.log(`${Z}@${Q}`);return;default:console.error(D(`Unknown command: ${t}\n`)),console.log($),process.exit(1)}}catch(e){console.error(D(e instanceof Error?e.message:String(e))),process.exit(1)}})();export{};
61
+ ${X.name} <${X.email}> (${S(X.url)})`;(async()=>{try{let e=process.argv.slice(2),t=e[0],n=e.slice(1);switch(t){case`init`:return await de(n);case`reinit`:return await fe(n);case`sync`:return await pe(n);case void 0:case`-h`:case`--help`:console.log($);return;case`-v`:case`--version`:console.log(`${Z}@${Q}`);return;default:console.error(D(`Unknown command: ${t}\n`)),console.log($),process.exit(1)}}catch(e){console.error(D(e instanceof Error?e.message:String(e))),process.exit(1)}})();export{};
@@ -101,4 +101,4 @@ const docsConfig = {
101
101
 
102
102
  export default docsConfig
103
103
  `,P=(e,...n)=>t(e,...n),F=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`app`,I=e=>{let t=P(e,`.gitpickignore`);if(c(t)){for(let n of l(t).split(`
104
- `)){let t=n.trim();if(!(!t||t.startsWith(`#`))){if(/[*?![\]]/.test(t))throw Error(`.gitpickignore entry "${t}" is not a literal path; the in-place converter only supports literal paths (a glob or negation would diverge from gitpick's fetch).`);d(P(e,t))}}d(t)}},L=/\nexport const caveat = localFont\(\{[\s\S]*?\n\}\)\n/,R=/\nexport const newsreader = localFont\(\{[\s\S]*?\n\}\)\n/,z=/[ \t]*\{[^}\n]*href:[ \t]*["']\/hire["'][^}\n]*\},?[ \t]*\n/,B=(e,t)=>{let n=new Date,r=n.toISOString().slice(0,10),i=[n.getFullYear(),n.getMonth()+1,n.getDate()].map(e=>String(e).padStart(2,`0`)).join(`-`),a=i<r?i:r;u(P(e,`web/next/content/docs/index.mdx`),k()),u(P(e,`web/next/content/blog/index.mdx`),j(a)),u(P(e,`web/next/content/blog/hello-world.mdx`),M(a)),u(P(e,`web/next/content/console/docs/index.mdx`),A()),u(P(e,`web/next/docs.config.ts`),N()),u(P(e,`web/next/public/.gitkeep`),``),u(P(e,`web/next/src/app/page.tsx`),E()),u(P(e,`AGENTS.md`),D()),u(P(e,`README.md`),O(t))},V=e=>{let t=P(e,`web/next/src/lib/fonts.ts`),n=P(e,`web/next/src/components/navbar/home.tsx`);if(_(t,L),_(t,R),_(n,z),c(t)&&l(t).includes(`fonts/marketing/`))throw Error(`fonts.ts still references fonts/marketing/ after fixDangling (regex drift). Update packages/cli/src/convert.ts.`);if(c(n)&&/href:\s*["']\/hire["']/.test(l(n)))throw Error(`navbar/home.tsx still has the /hire entry after fixDangling (regex drift). Update packages/cli/src/convert.ts.`)},H=(e,t)=>{u(P(e,`packages/config/src/site.ts`),T(t));let n=P(e,`package.json`),r=h(n);r.name=F(t.name),r.version=`0.0.0`;for(let e of v)delete r[e];g(n,r)},U=(e,t)=>{I(e),B(e,t),V(e),H(e,t)};export{p as a,l as c,u as d,g as f,b as i,h as l,V as n,c as o,w as r,m as s,U as t,d as u};
104
+ `)){let t=n.trim();if(!(!t||t.startsWith(`#`))){if(/[*?![\]]/.test(t))throw Error(`.gitpickignore entry "${t}" is not a literal path; the in-place converter only supports literal paths (a glob or negation would diverge from gitpick's fetch).`);d(P(e,t))}}d(t)}},L=/\r?\nexport const caveat = localFont\(\{[\s\S]*?\r?\n\}\)\r?\n/,R=/\r?\nexport const newsreader = localFont\(\{[\s\S]*?\r?\n\}\)\r?\n/,z=/[ \t]*\{[^}\r\n]*href:[ \t]*["']\/hire["'][^}\r\n]*\},?[ \t]*\r?\n/,B=(e,t)=>{let n=new Date,r=n.toISOString().slice(0,10),i=[n.getFullYear(),n.getMonth()+1,n.getDate()].map(e=>String(e).padStart(2,`0`)).join(`-`),a=i<r?i:r;u(P(e,`web/next/content/docs/index.mdx`),k()),u(P(e,`web/next/content/blog/index.mdx`),j(a)),u(P(e,`web/next/content/blog/hello-world.mdx`),M(a)),u(P(e,`web/next/content/console/docs/index.mdx`),A()),u(P(e,`web/next/docs.config.ts`),N()),u(P(e,`web/next/public/.gitkeep`),``),u(P(e,`web/next/src/app/page.tsx`),E()),u(P(e,`AGENTS.md`),D()),u(P(e,`README.md`),O(t))},V=e=>{let t=P(e,`web/next/src/lib/fonts.ts`),n=P(e,`web/next/src/components/navbar/home.tsx`);if(_(t,L),_(t,R),_(n,z),c(t)&&l(t).includes(`fonts/marketing/`))throw Error(`fonts.ts still references fonts/marketing/ after fixDangling (regex drift). Update packages/cli/src/convert.ts.`);if(c(n)&&/href:\s*["']\/hire["']/.test(l(n)))throw Error(`navbar/home.tsx still has the /hire entry after fixDangling (regex drift). Update packages/cli/src/convert.ts.`)},H=(e,t)=>{u(P(e,`packages/config/src/site.ts`),T(t));let n=P(e,`package.json`),r=h(n);r.name=F(t.name),r.version=`0.0.0`;for(let e of v)delete r[e];g(n,r)},U=(e,t)=>{I(e),B(e,t),V(e),H(e,t)};export{p as a,l as c,u as d,g as f,b as i,h as l,V as n,c as o,w as r,m as s,U as t,d as u};
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./convert-a1Am2aM1.mjs";export{e as convertRepo};
1
+ import{t as e}from"./convert-DMU8fiBc.mjs";export{e as convertRepo};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zerostarter",
3
- "version": "0.0.17",
3
+ "version": "0.0.18-canary.0",
4
4
  "description": "Go from zero to a production-ready SaaS, rebranded and ready to ship.",
5
5
  "keywords": [
6
6
  "cli",