zerostarter 0.0.0-091adc1

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.
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+ import{n as e,t}from"../convert-BzMTXW9D.mjs";import{basename as n,join as r,resolve as i}from"node:path";import{existsSync as a,readdirSync as o}from"node:fs";import{parseArgs as s}from"node:util";import{execFileSync as c}from"node:child_process";import{createInterface as l}from"node:readline/promises";var u={name:`zerostarter`,version:`0.0.0-091adc1`,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 d=(e,t,n)=>c(e,t,{cwd:n,encoding:`utf8`,stdio:[`ignore`,`pipe`,`pipe`]}),f=(e,t=`main`)=>{d(`bunx`,[`gitpick@5.4.1`,`https://github.com/nrjdalal/zerostarter/tree/${t}`,e])},p=e=>{d(`bun`,[`install`],e)},m=e=>{d(`git`,[`init`,`-q`],e)},h=(e,t)=>{d(`git`,[`add`,`-A`],e);try{d(`git`,[`commit`,`--no-verify`,`-q`,`-m`,t],e)}catch{}},g=()=>!!(process.stdin.isTTY&&process.stdout.isTTY),_=e=>t=>process.stdout.isTTY?`\x1b[${e}m${t}\x1b[0m`:t,v=_(`38;5;208`),y=_(`38;2;63;185;80`),b=async(e,t=``)=>{let n=l({input:process.stdin,output:process.stdout});try{return(await n.question(`${e}${t?` (${t})`:``}: `)).trim()||t}finally{n.close()}},x=async(e,t=!0)=>{let n=l({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()}},S=e=>!a(e)||o(e).filter(e=>e!==`.git`).length===0,C=t=>e(r(t,`packages/config/src/site.ts`)),w=async a=>{let{positionals:o,values:c}=s({allowPositionals:!0,args:a,options:{"dry-run":{type:`boolean`},help:{short:`h`,type:`boolean`},yes:{short:`y`,type:`boolean`}}});if(c.help){console.log(`Usage:
3
+ $ zerostarter init [dir] [options]
4
+
5
+ Scaffold ZeroStarter into dir (default .) as a fresh product. The author's
6
+ content, public assets, and agent skills are left out for you to supply; the
7
+ dir name becomes the project name and site.ts + package.json are rebranded. If
8
+ the dir already holds a ZeroStarter clone it is used in place; otherwise the
9
+ latest ZeroStarter is fetched into it first.
10
+
11
+ Options:
12
+ -y, --yes Skip prompts; fail instead of prompting when input is needed
13
+ --dry-run Print the plan without writing anything
14
+ -h, --help Display help`);return}let l=g()&&!c.yes,u=o[0]??`.`,d=i(u),_=C(d);if(!_&&!S(d)){if(!l)throw Error(`Target directory is not empty. Pass an empty target dir, for example: zerostarter init my-product`);let e=await b(`Target directory is not empty. New project directory`);if(!e)throw Error(`No directory name provided.`);u=e}let w=i(u),T=n(w),E={name:T};if(c[`dry-run`]){console.log(`zerostarter init (dry run)`),console.log(` target: ${w}`),console.log(` name: ${T}`),console.log(` mode: ${C(w)?`in place`:`fetch first`}`);return}if(_&&l&&!await x(`Convert ${w} in place? This rewrites files and commits.`,!1)){console.log(`Aborted.`);return}C(w)||(console.log(`Fetching the latest ZeroStarter ...`),f(w)),e(r(w,`.git`))||(m(w),h(w,`chore: scaffold from zerostarter`)),console.log(`Removing starter content and rebranding ...`),t(w,E),console.log(`Installing dependencies ...`),p(w),h(w,`chore: re-baseline as ${T}`);let D=[[`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${y(`✓`)} ${T} is ready.\n`),console.log(`Next steps:`),w!==process.cwd()&&console.log(` ${v(`cd ${u}`)}`),console.log(` ${v(`cp .env.example .env`)} # add your secrets`),console.log(` ${v(`bun dev`)}`),console.log(`
15
+ Make it yours:`);for(let[e,t]of D)console.log(` ${e.padEnd(29)} ${t}`)},T=async e=>{console.log(`zerostarter sync is not implemented yet.`),console.log(`Planned: a gitpick overlay of the latest zerostarter onto an existing fork, then a`),console.log(`prune of starter-only artifacts while preserving the fork's product and branding.`)},{author:E,name:D,version:O}=u,k=`Version:
16
+ ${D}@${O}
17
+
18
+ Go from zero to a production-ready SaaS, rebranded and ready to ship.
19
+
20
+ Usage:
21
+ $ ${D} <command> [options]
22
+
23
+ Commands:
24
+ init [dir] Scaffold ZeroStarter into dir (default .) as a fresh product.
25
+ The dir name becomes the project name.
26
+ sync Re-baseline an existing fork on ZeroStarter's latest scaffold
27
+
28
+ Options:
29
+ -v, --version Display version
30
+ -h, --help Display help
31
+
32
+ Author:
33
+ ${E.name} <${E.email}> (${E.url})`;(async()=>{try{let e=process.argv.slice(2),t=e[0],n=e.slice(1);switch(t){case`init`:return await w(n);case`sync`:return await T(n);case void 0:case`-h`:case`--help`:console.log(k);return;case`-v`:case`--version`:console.log(`${D}@${O}`);return;default:console.error(`Unknown command: ${t}\n`),console.log(k),process.exit(1)}}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exit(1)}})();export{};
@@ -0,0 +1,110 @@
1
+ import{dirname as e,join as t}from"node:path";import{existsSync as n,mkdirSync as r,readFileSync as i,rmSync as a,writeFileSync as o}from"node:fs";const s=e=>n(e),c=e=>i(e,`utf8`),l=(t,n)=>{r(e(t),{recursive:!0}),o(t,n)},u=e=>{a(e,{force:!0,recursive:!0})},d=e=>JSON.parse(c(e)),f=(e,t)=>{l(e,`${JSON.stringify(t,null,2)}\n`)},p=(e,t)=>{if(!n(e))return!1;let r=c(e),i=r;for(let[e,n]of t)i=i.split(e).join(n);return i===r?!1:(o(e,i),!0)},m=({name:e})=>{let t=e.charAt(0).toUpperCase()+e.slice(1);return`// Brand identity for this app: the single source a fork edits to rebrand. web reads it via lib/config.ts.
2
+ export const site = {
3
+ name: "${t}",
4
+ description: "${t} is just getting started. Tell its story here.",
5
+ tagline: "Your tagline, ready when you are.",
6
+ social: {
7
+ github: "",
8
+ x: "",
9
+ discord: "",
10
+ },
11
+ // Local-only dev agent identity (api/hono agents router).
12
+ agent: {
13
+ name: "LocalAgent",
14
+ email: "agent@local.host",
15
+ },
16
+ // Injectable long-form text blocks. A product sets its own, or leaves them empty.
17
+ apiReferenceDescription: "",
18
+ llmsFullPreamble: "",
19
+ } as const
20
+
21
+ export type Site = typeof site
22
+ `},h=()=>`import { redirect } from "next/navigation"
23
+
24
+ // Fresh fork: redirect to the waitlist until you build your real home page.
25
+ export default function Home() {
26
+ redirect("/waitlist")
27
+ }
28
+ `,g=()=>`# AGENTS.md
29
+
30
+ Guidance for AI coding agents working in this repository.
31
+ `,_=()=>`---
32
+ slug: /docs
33
+ title: Introduction
34
+ description: Documentation.
35
+ ---
36
+
37
+ # Introduction
38
+
39
+ This is your documentation home. Start writing, this page is yours.
40
+ `,v=()=>`---
41
+ slug: /console/docs
42
+ title: Introduction
43
+ description: Internal documentation.
44
+ ---
45
+
46
+ # Introduction
47
+
48
+ Your team's internal docs live here.
49
+ `,y=e=>`---
50
+ title: Blog
51
+ description: Latest articles and updates
52
+ createdAt: ${e}
53
+ ---
54
+
55
+ ## Recent Posts
56
+
57
+ <BlogPostList />
58
+ `,b=e=>`---
59
+ title: Hello World
60
+ description: The first post on your new blog.
61
+ createdAt: ${e}
62
+ publishedAt: ${e}
63
+ ---
64
+
65
+ ## Hello World
66
+
67
+ Your very first post. Replace it with something worth reading.
68
+ `,x=()=>`import type { DocsConfig } from "./src/lib/docs/types"
69
+
70
+ const docsConfig = {
71
+ docs: {
72
+ "Getting Started": [
73
+ {
74
+ "/docs": {
75
+ title: "Introduction",
76
+ description: "Documentation.",
77
+ },
78
+ },
79
+ ],
80
+ },
81
+ console: {
82
+ "Getting Started": [
83
+ {
84
+ "/console/docs": {
85
+ title: "Introduction",
86
+ description: "Internal documentation.",
87
+ },
88
+ },
89
+ ],
90
+ },
91
+ } satisfies DocsConfig
92
+
93
+ export default docsConfig
94
+ `,S=(e,...n)=>t(e,...n),C=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`app`,w=[`web/next/content`,`web/next/public`,`.agents/skills`,`.claude/skills`,`.github/skills`],T=[`packages/cli`,`.github/workflows/cli-release.yml`,`.github/audit`,`.github/reviews`,`.infisical.json`,`.github/assets/graph-build.svg`,`.github/assets/cli.tape`,`.github/assets/setup.sh`,`.github/assets/cli.gif`,`.github/FUNDING.yml`,`LICENSE.md`,`CHANGELOG.md`,`bun.lock`,`skills-lock.json`,`web/next/src/app/hire`,`web/next/src/app/resume`,`web/next/src/fonts/caveat-latin-wght-normal.woff2`,`web/next/src/fonts/newsreader-latin-wght-normal.woff2`,`web/next/src/fonts/newsreader-latin-wght-italic.woff2`],E=e=>{let t=new Date,n=t.toISOString().slice(0,10),r=[t.getFullYear(),t.getMonth()+1,t.getDate()].map(e=>String(e).padStart(2,`0`)).join(`-`),i=r<n?r:n;l(S(e,`web/next/content/docs/index.mdx`),_()),l(S(e,`web/next/content/blog/index.mdx`),y(i)),l(S(e,`web/next/content/blog/hello-world.mdx`),b(i)),l(S(e,`web/next/content/console/docs/index.mdx`),v()),l(S(e,`web/next/docs.config.ts`),x()),l(S(e,`web/next/public/.gitkeep`),``),l(S(e,`web/next/src/app/page.tsx`),h()),l(S(e,`AGENTS.md`),g())},D=e=>{let t=p(S(e,`web/next/src/components/navbar/home.tsx`),[[` { href: "/hire", label: "Hire" },
95
+ `,``]]),n=p(S(e,`web/next/src/lib/fonts.ts`),[[`
96
+ export const caveat = localFont({
97
+ src: "../fonts/caveat-latin-wght-normal.woff2",
98
+ variable: "--font-caveat",
99
+ weight: "400 700",
100
+ })
101
+ `,``]]),r=p(S(e,`web/next/src/lib/fonts.ts`),[[`
102
+ export const newsreader = localFont({
103
+ src: [
104
+ { path: "../fonts/newsreader-latin-wght-normal.woff2", style: "normal" },
105
+ { path: "../fonts/newsreader-latin-wght-italic.woff2", style: "italic" },
106
+ ],
107
+ variable: "--font-newsreader",
108
+ weight: "200 800",
109
+ })
110
+ `,``]]);if(!n||!r)throw Error(`fonts.ts: caveat/newsreader exports not found, but their woff2 files were removed (template drift). Update packages/cli/src/convert.ts.`);if(!t)throw Error(`navbar/home.tsx: /hire entry not found (template drift). Update packages/cli/src/convert.ts.`)},O=(e,t)=>{l(S(e,`packages/config/src/site.ts`),m(t));let n=S(e,`package.json`),r=d(n);r.name=C(t.name),r.version=`0.0.0`,delete r.homepage,delete r.bugs,delete r.license,delete r.author,delete r.repository,delete r.funding,f(n,r)},k=(e,t)=>{for(let t of[...w,...T])u(S(e,t));E(e),D(e),O(e,t)};export{s as n,k as t};
@@ -0,0 +1,9 @@
1
+ //#region src/templates.d.ts
2
+ interface Brand {
3
+ name: string;
4
+ }
5
+ //#endregion
6
+ //#region src/convert.d.ts
7
+ declare const convertRepo: (root: string, brand: Brand) => void;
8
+ //#endregion
9
+ export { type Brand, convertRepo };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{t as e}from"./convert-BzMTXW9D.mjs";export{e as convertRepo};
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "zerostarter",
3
+ "version": "0.0.0-091adc1",
4
+ "description": "Go from zero to a production-ready SaaS, rebranded and ready to ship.",
5
+ "keywords": [
6
+ "cli",
7
+ "saas",
8
+ "scaffold",
9
+ "starter",
10
+ "template",
11
+ "zerostarter"
12
+ ],
13
+ "homepage": "https://github.com/nrjdalal/zerostarter#readme",
14
+ "bugs": "https://github.com/nrjdalal/zerostarter/issues",
15
+ "license": "MIT",
16
+ "author": {
17
+ "name": "Neeraj Dalal",
18
+ "email": "admin@nrjdalal.com",
19
+ "url": "https://nrjdalal.com"
20
+ },
21
+ "repository": "nrjdalal/zerostarter",
22
+ "funding": "https://github.com/sponsors/nrjdalal",
23
+ "bin": {
24
+ "zerostarter": "dist/bin/index.mjs"
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "type": "module",
30
+ "types": "./dist/index.d.mts",
31
+ "exports": "./dist/index.mjs"
32
+ }