create-sailor 1.10.1 → 2.0.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 (76) hide show
  1. package/README.md +34 -135
  2. package/dist/index.js +108 -2010
  3. package/package.json +16 -17
  4. package/templates/backends/python/README.md +0 -16
  5. package/templates/backends/python/_shared/__init__.py +0 -5
  6. package/templates/backends/python/pyproject.toml +0 -13
  7. package/templates/deploy/railway.toml +0 -13
  8. package/templates/deploy/vercel.json +0 -37
  9. package/templates/deploy/wrangler.gateway.toml +0 -11
  10. package/templates/deploy/wrangler.toml +0 -8
  11. package/templates/docs/docusaurus/README.md +0 -24
  12. package/templates/docs/docusaurus/docs/getting-started/develop.md +0 -20
  13. package/templates/docs/docusaurus/docs/getting-started/install.md +0 -11
  14. package/templates/docs/docusaurus/docs/intro.md +0 -15
  15. package/templates/docs/docusaurus/docusaurus.config.ts +0 -66
  16. package/templates/docs/docusaurus/package.json +0 -44
  17. package/templates/docs/docusaurus/sidebars.ts +0 -14
  18. package/templates/docs/docusaurus/src/css/custom.css +0 -22
  19. package/templates/docs/docusaurus/tsconfig.json +0 -7
  20. package/templates/docs/fumadocs/README.md +0 -46
  21. package/templates/docs/fumadocs/app/(home)/page.tsx +0 -22
  22. package/templates/docs/fumadocs/app/api/search/route.ts +0 -4
  23. package/templates/docs/fumadocs/app/docs/[[...slug]]/page.tsx +0 -39
  24. package/templates/docs/fumadocs/app/docs/layout.tsx +0 -11
  25. package/templates/docs/fumadocs/app/global.css +0 -10
  26. package/templates/docs/fumadocs/app/layout.tsx +0 -18
  27. package/templates/docs/fumadocs/content/docs/api.mdx +0 -31
  28. package/templates/docs/fumadocs/content/docs/concepts.mdx +0 -19
  29. package/templates/docs/fumadocs/content/docs/getting-started.mdx +0 -56
  30. package/templates/docs/fumadocs/content/docs/index.mdx +0 -17
  31. package/templates/docs/fumadocs/content/docs/meta.json +0 -4
  32. package/templates/docs/fumadocs/lib/source.ts +0 -7
  33. package/templates/docs/fumadocs/next.config.mjs +0 -20
  34. package/templates/docs/fumadocs/package.json +0 -33
  35. package/templates/docs/fumadocs/source.config.ts +0 -17
  36. package/templates/docs/fumadocs/tsconfig.json +0 -25
  37. package/templates/docs/mintlify/README.md +0 -25
  38. package/templates/docs/mintlify/api-reference/introduction.mdx +0 -25
  39. package/templates/docs/mintlify/introduction.mdx +0 -21
  40. package/templates/docs/mintlify/mint.json +0 -37
  41. package/templates/docs/mintlify/package.json +0 -14
  42. package/templates/docs/mintlify/quickstart.mdx +0 -26
  43. package/templates/docs/nextra/README.md +0 -35
  44. package/templates/docs/nextra/app/[[...mdxPath]]/page.tsx +0 -23
  45. package/templates/docs/nextra/app/layout.tsx +0 -36
  46. package/templates/docs/nextra/content/_meta.ts +0 -4
  47. package/templates/docs/nextra/content/getting-started.mdx +0 -35
  48. package/templates/docs/nextra/content/index.mdx +0 -18
  49. package/templates/docs/nextra/mdx-components.tsx +0 -10
  50. package/templates/docs/nextra/next.config.mjs +0 -9
  51. package/templates/docs/nextra/package.json +0 -25
  52. package/templates/docs/nextra/tsconfig.json +0 -21
  53. package/templates/docs/vitepress/.vitepress/config.ts +0 -35
  54. package/templates/docs/vitepress/README.md +0 -23
  55. package/templates/docs/vitepress/guide/getting-started.md +0 -26
  56. package/templates/docs/vitepress/guide/introduction.md +0 -12
  57. package/templates/docs/vitepress/index.md +0 -23
  58. package/templates/docs/vitepress/package.json +0 -18
  59. package/templates/docs/vitepress/tsconfig.json +0 -15
  60. package/templates/orm/drizzle/README.md +0 -58
  61. package/templates/orm/drizzle/drizzle.config.ts +0 -16
  62. package/templates/orm/drizzle/migrations/.gitkeep +0 -0
  63. package/templates/orm/drizzle/package.json +0 -30
  64. package/templates/orm/drizzle/src/index.ts +0 -31
  65. package/templates/orm/drizzle/src/schema/auth.ts +0 -73
  66. package/templates/orm/drizzle/src/schema/billing.ts +0 -37
  67. package/templates/orm/drizzle/src/schema/index.ts +0 -3
  68. package/templates/orm/drizzle/src/schema/tenant.ts +0 -57
  69. package/templates/orm/drizzle/tsconfig.json +0 -16
  70. package/templates/workflows/README.md +0 -9
  71. package/templates/workflows/inngest/README.md +0 -3
  72. package/templates/workflows/inngest/welcome-email.ts +0 -30
  73. package/templates/workflows/n8n/README.md +0 -3
  74. package/templates/workflows/n8n/example-flow.json +0 -6
  75. package/templates/workflows/pusher/README.md +0 -3
  76. package/templates/workflows/pusher/events.ts +0 -6
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # create-sailor
2
2
 
3
- > Governed scaffolding for AI-native SaaS. Bootstrap the Nebutra Sailor platform baseline with multi-tenant foundations, region-aware defaults, and production-ready AI integrations.
3
+ > Governed scaffolding for AI-native SaaS. One converged stack, zero questions: Next.js + Hono + Postgres + Better Auth + Stripe, with every capability live the moment you add its key.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/create-sailor.svg?color=0033FE)](https://www.npmjs.com/package/create-sailor)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-0033FE.svg)](https://opensource.org/licenses/MIT)
@@ -24,152 +24,52 @@ bunx create-sailor@latest
24
24
 
25
25
  ## What You Get
26
26
 
27
- - **Governed platform baseline** — web app, marketing site, API gateway, docs, Storybook, studio, and supporting infra packages scaffolded as one coherent monorepo
28
- - **Verified scaffolding path** — region-aware defaults, template checks, and reproducible project bootstrap instead of hand-assembling a starter stack
29
- - **AI runtime foundation** — provider registry, Vercel AI SDK v5, OpenAI-compatible endpoints, and agent-ready packages wired into the platform baseline
30
- - **Global + China delivery surface** — email, storage, monitoring, analytics, SMS, payments, and CN social login options selected through one scaffolding flow
31
- - **Brand, tenant, and compliance primitives** — white-label branding, multi-tenant foundations, and China-market compliance scaffolding already wired in
27
+ One stack, no questions. Every project is the same converged baseline that
28
+ Nebutra runs in production:
29
+
30
+ | Capability | Provider |
31
+ |---|---|
32
+ | App + API | Next.js + Hono gateway (mounted in Next, or deployed on its own) |
33
+ | Database | Postgres + Prisma |
34
+ | Auth | Better Auth |
35
+ | Payments | Stripe, plus WeChat Pay / Alipay for mainland China |
36
+ | Email | Resend |
37
+ | SMS | Twilio Verify, plus Aliyun for mainland China |
38
+ | Object storage | any S3-compatible bucket (Cloudflare R2, Aliyun OSS) |
39
+ | Queue / cache | QStash / Redis |
40
+ | Search | Postgres (pgvector) |
41
+ | Monitoring / analytics / captcha | Sentry / PostHog / Turnstile |
42
+
43
+ Nothing is pruned and nothing is picked at scaffold time. Every capability runs
44
+ locally with an empty `.env`; adding a provider key takes it live.
45
+ `nebutra status` shows what is live and what each capability still needs.
46
+
47
+ Mainland-China deployments set `NEBUTRA_LOCALE=cn` at runtime (ICP footer, AIGC
48
+ disclosure, phone-first login) — the same code, not a different scaffold.
32
49
 
33
50
  ## Usage
34
51
 
35
- ### Interactive (recommended)
36
-
37
52
  ```bash
38
- npx create-sailor@latest
53
+ npx create-sailor@latest my-app # the only question is where
54
+ npx create-sailor@latest . # into the current directory
55
+ npx create-sailor@latest my-app --json # NDJSON events, for agents and CI
39
56
  ```
40
57
 
41
- Interactive flow:
42
-
43
- 1. **Where** — new folder (name, default `my-app`) or current directory (smart default if cwd is empty)
44
- 2. **Region / Auth / AI topology**
45
- 3. **Plan** — compact summary; confirm or customize payment · email · storage · deploy
46
- 4. **Done** — short golden path (`cd` → env → migrate → dev)
47
-
48
- Everything else uses region-aware smart defaults (`--yes` skips prompts).
49
-
50
- ```bash
51
- npx create-sailor@latest my-app # new folder
52
- npx create-sailor@latest . # current directory
53
- ```
54
-
55
- The AI prompt is topology-first:
56
-
57
- - `gateway` — Multi-provider AI Gateway / router, the recommended default. The scaffold seeds a small provider registry for local development, but runtime provider enablement stays a governance/routing concern.
58
- - `direct` — Direct SDK/provider adapters for teams that intentionally want concrete providers wired at create time.
59
- - `custom` — OpenAI-compatible endpoint for proxy, local, or enterprise gateway deployments.
60
- - `none` — Skip AI scaffolding.
61
-
62
- ### Non-interactive (expert mode)
63
-
64
- ```bash
65
- npm create sailor@latest my-app \
66
- --region=cn \
67
- --auth=clerk \
68
- --social-login=wechat,dingtalk,feishu \
69
- --ai=deepseek,qwen,siliconflow \
70
- --email=aliyun-dm \
71
- --storage=aliyun-oss \
72
- --monitoring=sentry \
73
- --analytics=baidu \
74
- --sms=aliyun-sms \
75
- --payment=wechat \
76
- --deploy=selfhost \
77
- -y
78
- ```
79
-
80
- ## CLI Flags
81
-
82
- | Flag | Values | Default |
83
- |------|--------|---------|
84
- | `--region` | `global` · `cn` · `hybrid` | `global` |
85
- | `--auth` | `clerk` · `betterauth` · `nextauth` · `supabase` · `none` | `clerk` |
86
- | `--social-login` | `wechat,qq,dingtalk,workweixin,feishu,weibo` (comma-sep) | none |
87
- | `--payment` | `stripe` · `lemon` · `wechat` · `alipay` · `none` | region-based |
88
- | `--ai` | expert/non-interactive provider seed, comma-separated ids; omit it to use the governed gateway topology | gateway seed |
89
- | `--email` | `resend` · `postmark` · `ses` · `aliyun-dm` · `tencent-ses` · `netease` · `none` | region-based |
90
- | `--storage` | `r2` · `s3` · `supabase-storage` · `aliyun-oss` · `tencent-cos` · `qiniu` · `none` | region-based |
91
- | `--monitoring` | `sentry` · `datadog` · `aliyun-arms` · `tingyun` · `none` | region-based |
92
- | `--analytics` | `posthog` · `plausible` · `umami` · `baidu` · `sensors` · `none` | region-based |
93
- | `--sms` | `twilio` · `aliyun-sms` · `tencent-sms` · `yunpian` · `none` | region-based |
94
- | `--deploy` | `vercel` · `railway` · `cloudflare` · `selfhost` | `vercel` |
95
- | `--docs` | `fumadocs` · `mintlify` · `docusaurus` · `nextra` · `vitepress` · `none` | `fumadocs` |
96
- | `--orm` | `prisma` · `drizzle` · `none` | `prisma` |
97
- | `--db` | `postgres` · `mysql` · `sqlite` · `none` | `postgresql` |
98
- | `--queue` | `qstash` · `bullmq` · `upstash` · `sqs` · `none` | region-based |
99
- | `--search` | `meilisearch` · `typesense` · `algolia` · `pgvector` · `none` | region-based |
100
- | `--cache` | `upstash-redis` · `vercel-kv` · `redis` · `dragonfly` · `none` | region-based |
101
- | `--notifications` | `novu` · `knock` · `custom` · `none` | `none` |
102
- | `--webhooks` | `svix` · `custom` · `none` | `none` |
103
- | `--cms` | `sanity` · `contentful` · `strapi` · `none` | `none` |
104
- | `--feature-flags` | `vercel-flags` · `growthbook` · `configcat` · `none` | `none` |
105
- | `--captcha` | `turnstile` · `hcaptcha` · `aliyun-slide` · `none` | region-based |
106
- | `--mcp` | `on` · `off` | `on` |
107
- | `--metering` | `auto` · `on` · `off` | `auto` |
108
- | `--billing-mode` | `usage` · `seat` · `credits` | `usage` |
109
- | `--idp` | `clerk` · `oauth-server` | `clerk` |
110
- | `--access-gate` | `none` · `invite` | `none` |
111
- | `--cron-jobs` | `true` · `false` — scaffold scheduled cron handlers | `true` |
112
- | `--audit-log` | `true` · `false` — enable `/settings/audit-log` + arch test | `false` (`@nebutra/audit` is WIP) |
113
- | `--api-keys` | `true` · `false` — enable `/settings/api-keys` page | `true` |
114
- | `--command-palette` | `true` · `false` — enable ⌘K command palette | `true` |
115
- | `--cookie-consent` | `true` · `false` — enable GDPR/CCPA cookie banner | `true` |
116
- | `--legal-pages` | `true` · `false` — enable dynamic `/legal/[slug]` route | `true` |
117
- | `--china-compliance` | `true` · `false` — enable `@nebutra/china-compliance` + ICP footer | `true` when `--region=cn`, otherwise `false` |
118
- | `--i18n / --no-i18n` | boolean | `true` |
119
- | `-y, --yes` | accept all defaults (non-interactive) | — |
120
- | `--dry-run` | preview actions without writing | — |
121
- | `--json` | machine-readable output | — |
122
-
123
- `--deploy` remains a bootstrap shortcut. The generated project also writes a
124
- provider-switchable `deployTargets` map into `nebutra.config.json` and appends
125
- matching `DEPLOY_TARGET_*` values to `.env.example`:
126
-
127
- - `vercel` → Vercel frontends, Cloudflare Workers gateway, ECS Docker origin
128
- - `cloudflare` → Cloudflare Pages frontends, Cloudflare Workers gateway, ECS Docker origin
129
- - `railway` → Railway for frontends, gateway, and origin
130
- - `selfhost` → standalone frontends, ECS/Docker-style gateway and origin
131
-
132
- ## Region Presets
133
-
134
- | Region | Email | Storage | Analytics | Monitoring | SMS | Payment |
135
- |--------|-------|---------|-----------|------------|-----|---------|
136
- | `global` | Resend | R2 | PostHog | Sentry | Twilio | Stripe |
137
- | `cn` | Alibaba Cloud DirectMail | Alibaba Cloud OSS | Baidu Analytics | Sentry | Alibaba Cloud SMS | WeChat Pay |
138
- | `hybrid` | Resend | Alibaba Cloud OSS | PostHog | Sentry | Alibaba Cloud SMS | Stripe |
139
-
140
- ## Social login (CN)
141
-
142
- Adding `--social-login=wechat,dingtalk` extends your primary auth provider
143
- (Clerk or Better Auth) with China-region OAuth:
144
-
145
- - Generates `apps/web/src/app/api/auth/callback/<id>/route.ts` stubs with the
146
- correct token-exchange endpoints (WeChat / QQ / DingTalk / WeCom / Feishu / Weibo)
147
- - Generates `apps/web/src/components/auth/SocialLoginButtons.tsx` with one
148
- button per selected provider
149
- - Appends all required env vars to `.env.example`
150
-
151
- The primary auth provider still owns user/session lifecycle — the generated
152
- callbacks exchange `code` for provider access tokens and leave a
153
- intentional SAMPLE marker for primary-auth upsert for the user to wire up.
58
+ Options: `--pm`, `--no-install`, `--no-git`, `--yes`, `--dry-run`, `--json`,
59
+ `--no-color`. There are no stack flags.
154
60
 
155
61
  ## After Scaffolding
156
62
 
157
63
  ```bash
158
64
  cd my-app
159
- pnpm install
160
- # create .env.local and add your provider credentials
65
+ pnpm infra:up # local Postgres (optional)
161
66
  pnpm db:migrate
162
- pnpm db:seed
163
67
  pnpm dev
68
+ nebutra status # what is live, what needs a key
164
69
  ```
165
70
 
166
- Useful follow-ups:
167
-
168
- ```bash
169
- pnpm brand:init
170
- pnpm brand:apply
171
- pnpm generate:api-types
172
- ```
71
+ Deploy anywhere: the project builds Next `standalone` output and ships
72
+ Dockerfiles. The scaffold does not choose a platform for you.
173
73
 
174
74
  ## Why Sailor?
175
75
 
@@ -181,14 +81,13 @@ single monorepo you can extend instead of re-assembling from scratch.
181
81
  ## Roadmap
182
82
 
183
83
  - **Verified scaffolding** — immutable template delivery, scaffold smoke validation, and safer bootstrap defaults
184
- - **Remote feature registry** — `nebutra add` with compatibility checks, provider awareness, and controlled file application
185
84
  - **Harness runtime** — stronger MCP, agent, and automation primitives for AI-native SaaS workflows
186
85
  - **Upgrade path** — version-aware migrations, diagnostics, and guided adoption of new platform capabilities
187
86
 
188
87
  ## Documentation
189
88
 
190
- - **Getting Started**: [docs.nebutra.com/getting-started/installation](https://docs.nebutra.com/getting-started/installation)
191
- - **Customization Guide**: [docs.nebutra.com/customization/overview](https://docs.nebutra.com/customization/overview)
89
+ - **Getting Started**: [nebutra.com/docs/getting-started/installation](https://nebutra.com/docs/getting-started/installation)
90
+ - **Customization Guide**: [nebutra.com/docs/customization/overview](https://nebutra.com/docs/customization/overview)
192
91
  - **Licensing**: [nebutra.com/licensing](https://nebutra.com/licensing)
193
92
 
194
93
  ## License