@weft-js/create 0.1.2 → 0.1.4

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/README.md +362 -38
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,9 +1,74 @@
1
- # @weft-js/create
1
+ <p align="center">
2
+ <a href="https://github.com/Ravonus/weft">
3
+ <img src="https://raw.githubusercontent.com/Ravonus/weft/main/site/public/logo.svg" width="88" height="88" alt="Weft">
4
+ </a>
5
+ </p>
2
6
 
3
- > **Early release (0.1.x).** APIs can change between minor versions.
7
+ <h1 align="center">@weft-js/create</h1>
4
8
 
5
- Starts a new [Weft](https://github.com/Ravonus/weft) app: pages, a server, a database, sign-in and Warp's components,
6
- wired up and ready for `weft dev`.
9
+ <p align="center">
10
+ <strong>Start a Weft app: pages, a server, a database, sign-in and Warp's components, wired up.</strong><br>
11
+ The new app passes <code>weft check</code> as made, and comes with an <code>AGENTS.md</code> for the Weft it installed.
12
+ </p>
13
+
14
+ <p align="center">
15
+ <a href="https://www.npmjs.com/package/@weft-js/create"><img src="https://img.shields.io/npm/v/@weft-js/create?color=145c3c&label=npm" alt="npm version"></a>
16
+ <a href="https://github.com/Ravonus/weft/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-145c3c" alt="MIT license"></a>
17
+ <a href="https://github.com/Ravonus/weft/actions"><img src="https://img.shields.io/github/actions/workflow/status/Ravonus/weft/quality.yml?branch=main&label=checks" alt="checks"></a>
18
+ <img src="https://img.shields.io/badge/node-%3E%3D24-145c3c" alt="Node 24 or later">
19
+ </p>
20
+
21
+ <p align="center">
22
+ <a href="#quick-start">Quick start</a> ·
23
+ <a href="https://github.com/Ravonus/weft/blob/main/site/content/learn/installation.md">Docs</a> ·
24
+ <a href="https://github.com/Ravonus/weft/tree/main/packages/create/templates">Templates</a> ·
25
+ <a href="https://github.com/Ravonus/weft/blob/main/CHANGELOG.md">Changelog</a> ·
26
+ <a href="https://github.com/Ravonus/weft">GitHub</a>
27
+ </p>
28
+
29
+ > [!IMPORTANT]
30
+ > **Early release (0.1.x).** The scaffolds install and check clean, and flags and generated files can still change
31
+ > between minor versions.
32
+
33
+ `@weft-js/create` is what runs when you type `npm create @weft-js`. It writes a new
34
+ [Weft](https://github.com/Ravonus/weft) app into an empty folder: a home page, an about page, a todo list on server
35
+ functions, sign-in, and the config, types and editor setup around them. Then it installs the dependencies, starts a git
36
+ repository and writes an `AGENTS.md` from the Weft it just installed.
37
+
38
+ In a terminal it asks what the flags don't answer, with the default already picked. Without one (an agent, CI), it never
39
+ prompts.
40
+
41
+ ## Highlights
42
+
43
+ - **One question per choice, or none.** UI kit, database, data layer, sign-in, runtime, config format and package
44
+ manager. A flag answers its question, and `--yes` takes every default.
45
+ - **A full stack by default.** `--yes` gives Warp, SQLite through Drizzle, and Better Auth, with a guarded todo list
46
+ that works before you write a line.
47
+ - **Four UI choices.** Warp's components, Warp's behavior and tokens with your own markup, Tailwind, or plain CSS.
48
+ - **Three databases, three data layers.** SQLite, Postgres or MySQL, through Drizzle, Prisma or plain SQL migrations.
49
+ - **Four starting apps.** `--template todo`, `admin`, `catalog` or `landing`: real apps with their own look and
50
+ their own migrations.
51
+ - **Pinned versions.** Every dependency is pinned to the version the test matrix ran, and Weft's own packages to the
52
+ version of this scaffold.
53
+ - **Agent-ready.** `AGENTS.md`, `weft check --json` and `weft docs` are there from the first run.
54
+
55
+ ## Contents
56
+
57
+ - [Quick start](#quick-start)
58
+ - [Flags](#flags)
59
+ - [The questions](#the-questions)
60
+ - [UI](#ui)
61
+ - [Database and data layer](#database-and-data-layer)
62
+ - [Sign-in](#sign-in)
63
+ - [Templates](#templates)
64
+ - [What gets generated](#what-gets-generated)
65
+ - [Package managers and runtimes](#package-managers-and-runtimes)
66
+ - [Recipes](#recipes)
67
+ - [Using it from code](#using-it-from-code)
68
+ - [Troubleshooting](#troubleshooting)
69
+ - [Related packages](#related-packages)
70
+
71
+ ## Quick start
7
72
 
8
73
  ```bash
9
74
  npm create @weft-js my-app
@@ -21,58 +86,317 @@ bun create @weft-js my-app
21
86
  deno run -A npm:@weft-js/create my-app
22
87
  ```
23
88
 
24
- In a terminal it asks what the flags don't answer, with the default already picked. `--yes` takes every default: Warp,
25
- SQLite through Drizzle, and Better Auth. Then:
89
+ Then:
26
90
 
27
91
  ```bash
28
92
  cd my-app
93
+ npx weft db generate # with a database: the first migration
29
94
  npx weft dev
30
95
  ```
31
96
 
32
- With a database, run `npx weft db generate` first. The new app has a home page, an about page, a todo list on server
33
- functions, a sign-in page, and an `AGENTS.md` written for the installed Weft. `weft check` passes on it as made; its one
34
- warning asks for `site.url` before you deploy.
97
+ The last thing it prints is the exact commands for your package manager. Open the URL `weft dev` prints, sign up, and
98
+ the todo list at `/todos` is yours.
99
+
100
+ You need Node 24 or later, or Bun or Deno in its place.
35
101
 
36
102
  ## Flags
37
103
 
38
- | Flag | Values | Default |
104
+ | Flag | Values | Default | What it does |
105
+ |---|---|---|---|
106
+ | `[dir]` | a folder that's missing or empty | asked; `my-weft-app` with `--yes` | Where the app goes |
107
+ | `--template` | `todo`, `admin`, `catalog`, `landing` | none | Starts from a fuller app ([below](#templates)) |
108
+ | `--ui` | `warp`, `headless`, `tailwind`, `none` | `warp` | The UI kit ([below](#ui)) |
109
+ | `--db` | `sqlite`, `postgres`, `mysql`, `none` | `sqlite` | The database |
110
+ | `--layer` | `drizzle`, `prisma`, `native` | `drizzle` | The data layer. `native` is SQL migrations with no ORM. Asked only with a database |
111
+ | `--auth`, `--no-auth` | | on, with a database | Sign-in |
112
+ | `--auth-provider` | `better-auth`, `custom` | `better-auth` | `custom` writes a stub for your own provider |
113
+ | `--runtime` | `node`, `bun`, `deno` | the one running it | What `weft build` targets |
114
+ | `--config` | `ts`, `json`, `yaml` | `ts` | The format of the Weft config |
115
+ | `--pm` | `npm`, `pnpm`, `bun`, `deno`, `yarn` | the one you ran it with | The package manager |
116
+ | `--git`, `--no-git` | | on | Start a git repository |
117
+ | `--install`, `--no-install` | | on; off with no terminal and no `--yes` | Install the dependencies, then write `AGENTS.md` |
118
+ | `--name` | a package name | the folder's name | The `name` in `package.json`, and the app's title |
119
+ | `--tarballs` | a folder with `tarballs.json` | none | Pins Weft's packages to local tarballs, for testing a checkout |
120
+ | `--yes`, `-y` | | | Take the defaults for anything not given |
121
+ | `--help`, `-h` | | | Print the usage |
122
+
123
+ With npm, flags go after `--`:
124
+
125
+ ```bash
126
+ npm create @weft-js my-app -- --ui tailwind --db none
127
+ ```
128
+
129
+ > [!NOTE]
130
+ > With no terminal and no `[dir]`, it prints the usage and exits 1: it can't ask where to put the app. With no terminal
131
+ > and no `--yes`, it writes the app and runs nothing else, so git and the install stay off unless you ask for them.
132
+
133
+ ## The questions
134
+
135
+ In a terminal, each question is a list: the arrow keys move, Enter picks. Enter all the way through is the same app as
136
+ `--yes`.
137
+
138
+ | # | Question | Options | Default | Asked when |
139
+ |---|---|---|---|---|
140
+ | 1 | UI | Warp, Headless, Tailwind, None | Warp | always |
141
+ | 2 | Database | SQLite, Postgres, MySQL, none | SQLite | always |
142
+ | 3 | Data layer | Drizzle, Prisma, Native (no ORM) | Drizzle | there's a database |
143
+ | 4 | Sign-in | Better Auth, Bring your own, None | Better Auth | there's a database |
144
+ | 5 | Runtime | Node, Bun, Deno | the one running it | always |
145
+ | 6 | Config file | TypeScript, JSON, YAML | TypeScript | always |
146
+ | 7 | Package manager | npm, pnpm, Bun, Deno, Yarn | the one you ran it with | always |
147
+ | 8 | Start a git repository | Yes, No | Yes | always |
148
+ | 9 | Install dependencies | Yes, No | Yes | always |
149
+
150
+ A flag skips its question, and a template skips the ones it settles.
151
+
152
+ ## UI
153
+
154
+ | `--ui` | What you get | Dependencies |
39
155
  |---|---|---|
40
- | `[dir]` | A folder that's missing or empty | asked; `my-weft-app` with `--yes` |
41
- | `--template` | `todo`, `admin`, `catalog`, `landing`: a fuller starting app (below) | none |
42
- | `--ui` | `warp`, `headless` (Warp's behaviour and tokens, your markup), `tailwind`, `none` | `warp` |
43
- | `--db` | `sqlite`, `postgres`, `mysql`, `none` | `sqlite` |
44
- | `--layer` | `drizzle`, `prisma`, `native` (SQL migrations, no ORM) | `drizzle` |
45
- | `--auth`, `--no-auth` | Sign-in, when there's a database | on |
46
- | `--auth-provider` | `better-auth`, `custom` (a stub for your own) | `better-auth` |
47
- | `--runtime` | `node`, `bun`, `deno`: what `weft build` targets | the one running it |
48
- | `--config` | `ts`, `json`, `yaml`: the format of the Weft config | `ts` |
49
- | `--pm` | `npm`, `pnpm`, `bun`, `deno`, `yarn` | the one you ran it with |
50
- | `--git`, `--no-git` | Start a git repository | on |
51
- | `--install`, `--no-install` | Install the dependencies | on, or off with no terminal and no `--yes` |
52
- | `--name` | The package name | the folder's name |
53
- | `--yes`, `-y` | Take the defaults for anything not given | |
54
-
55
- With npm, flags go after `--`: `npm create @weft-js my-app -- --ui tailwind --db none`.
156
+ | `warp` | Warp's components (`Card`, `Button`, `Badge`…) and the `warp()` plugin in the config. The look is `warp({ seed, dials, radius, fonts, tokens })`, and `weft check` fails with D010 if a color pair can't pass contrast | `@weft-js/warp` |
157
+ | `headless` | Warp's behavior and tokens, your markup. `src/app.css` styles plain elements over Warp's `--warp-*` tokens, and the layout imports `@weft-js/warp-core/styles/warp.css` | [`@weft-js/warp-core`](https://www.npmjs.com/package/@weft-js/warp-core) |
158
+ | `tailwind` | Tailwind utilities. Writes `vite.config.ts` and `src/app.css`, the same files `weft add tailwind` writes | Tailwind, as dev dependencies |
159
+ | `none` | A small `src/app.css` on system colors, and nothing else | none |
160
+
161
+ ## Database and data layer
162
+
163
+ `--db` picks the engine, and `--layer` how the app talks to it.
164
+
165
+ | `--layer` | Schema | Migrations | `ctx.db` | Packages |
166
+ |---|---|---|---|---|
167
+ | `drizzle` | `src/db/schema.ts` | `drizzle/`, from `weft db generate` | Drizzle, from `@weft-js/start/db/<engine>` | `drizzle-orm`, `drizzle-zod`, `drizzle-kit` |
168
+ | `prisma` | `prisma/schema.prisma` | `weft db generate` | a Prisma client with the engine's adapter | `@prisma/client`, `prisma`, `@weft-js/db` |
169
+ | `native` | SQL | `migrations/0000_todos.sql`; `weft db generate <name>` starts a new one | `@weft-js/db/plugin-native/<engine>` | `@weft-js/db` |
170
+
171
+ | `--db` | `DATABASE_URL` in `.env` | Driver |
172
+ |---|---|---|
173
+ | `sqlite` | `file:.data/app.db` | none |
174
+ | `postgres` | `postgres://localhost:5432/<name>` | `postgres` |
175
+ | `mysql` | `mysql://root@localhost:3306/<name>` | `mysql2` |
176
+
177
+ `src/env.server.ts` checks the environment with `@t3-oss/env-core` and `zod`. Migrations apply on the next request, so
178
+ after `weft db generate` there's nothing else to run. With Prisma, `postinstall` runs `prisma generate`, and its
179
+ client goes to `src/generated/`, which `.gitignore` leaves out.
180
+
181
+ ## Sign-in
182
+
183
+ Sign-in needs a database: `--auth` with `--db none` is refused.
184
+
185
+ | Choice | What it writes |
186
+ |---|---|
187
+ | Better Auth (`--auth`, the default) | `src/auth.server.ts` on Better Auth, with its tables in your schema; `src/server/session.ts`; a sign-in and sign-up page at `/login`; a guard on `/todos`; and a `BETTER_AUTH_SECRET` that's new for every scaffold |
188
+ | Bring your own (`--auth-provider custom`) | `src/auth.server.ts` with `defineAuth` from `@weft-js/start/auth`: a `session` and a `handler` to fill in. The app compiles, with no one signed in, and the todo list is public |
189
+ | None (`--no-auth`) | No sign-in. The todo list is public |
190
+
191
+ Login with Better Auth is an opaque session in the database, in an HTTP-only cookie, never a JWT. `ctx.user` is the
192
+ signed-in user in every server function, and `auth: 'user'` on a `query` or `mutation` requires one.
56
193
 
57
194
  ## Templates
58
195
 
59
- A template is a fuller app on Postgres. It sets `--db postgres` and the sign-in it needs, and keeps the other flags.
196
+ A template is a real app laid over the scaffold, in place of the default todo app. Each runs on Postgres, uses Warp and
197
+ Drizzle, has a TypeScript config, and ships its own look, migrations and pages.
198
+
199
+ | Template | What it is | Pages | Sign-in | Look |
200
+ |---|---|---|---|---|
201
+ | `todo` | Sign-in and sign-up, and a todo list | `/`, `/login`, `/signup`, `/todos` | on | quiet, cozy, sharp corners, a serif display face |
202
+ | `admin` | An admin area with an orders table, order pages and nested layouts, behind sign-in | `/`, `/login`, `/signup`, `/admin`, `/admin/orders`, `/admin/orders/[id]`, `/admin/nested`, `/admin/per-row`, `/admin/slow` | on | balanced, compact, soft corners, system fonts |
203
+ | `catalog` | A shop: categories, product pages and a cart, with seed data in `seed.sql` | `/`, `/c/[slug]`, `/p/[slug]`, `/cart` | off | balanced, comfortable, round corners |
204
+ | `landing` | A landing page with pricing, a privacy page and a sign-up list | `/`, `/pricing`, `/privacy`, `/joined` | off | vivid, round corners, the Figtree font |
205
+
206
+ A template settles what it needs, and refuses a flag that conflicts rather than ignoring it:
207
+
208
+ | Setting | Every template |
209
+ |---|---|
210
+ | `--db` | `postgres` |
211
+ | `--ui` | `warp` |
212
+ | `--layer` | `drizzle` |
213
+ | `--config` | `ts` (fonts and media are plugin options in code) |
214
+ | sign-in | as in the table above |
215
+
216
+ `todo` and `admin` also add [`@weft-js/warp-icons`](https://www.npmjs.com/package/@weft-js/warp-icons). `landing` adds `@weft-js/warp-icons`, [`@weft-js/plugin-media`](https://www.npmjs.com/package/@weft-js/plugin-media) and
217
+ [`@weft-js/text`](https://www.npmjs.com/package/@weft-js/text), with its hero image and font in `assets/`.
218
+
219
+ A template's `drizzle/` ships with it, written so it runs on a fresh database and on one that already has these tables.
220
+ Set `DATABASE_URL` in `.env` to an empty Postgres database and start the app: `drizzle/` applies on the first request,
221
+ and there's no `weft db generate` to run. The theme is `src/theme.css` plus `warp({ seed, dials, radius })` in the config.
222
+
223
+ ```bash
224
+ npm create @weft-js shop -- --template catalog
225
+ ```
226
+
227
+ ## What gets generated
228
+
229
+ The default app (`--yes`):
230
+
231
+ | File | What it is |
232
+ |---|---|
233
+ | `package.json` | `dev`, `build`, `check`, `typecheck`, `start` and `db:generate` scripts, each a `weft` command. `@weft-js/cli` and TypeScript 7 as dev dependencies |
234
+ | `weft.config.ts` | `site` (name, title, description), `plugins`, and `runtime` when it isn't Node |
235
+ | `tsconfig.json` | Strict, `jsxImportSource: '@weft-js/core'`, the `#/*` alias for `src/*`, and the `@weft-js/cli/ts-plugin` editor plugin |
236
+ | `.vscode/settings.json` | Points VS Code's TypeScript at that plugin |
237
+ | `.gitignore` | `node_modules/`, `.weft/` (except the plugin lock), `.output/`, `dist/`, and with a database `.env` and `.data/` |
238
+ | `.weft/plugins.lock.json` | The plugins you chose, with the permissions they declare |
239
+ | `AGENTS.md` | A short guide; after the install, `weft agents-md` writes the full one over it |
240
+ | `.env`, `.env.example` | `DATABASE_URL`, and with Better Auth `BETTER_AUTH_SECRET` and `BETTER_AUTH_URL` |
241
+ | `src/env.server.ts` | The environment, checked |
242
+ | `src/context.server.ts` | What `ctx` holds in server functions |
243
+ | `src/routes/_layout.tsx` | The shell: links, and sign in or sign out |
244
+ | `src/routes/index.tsx` | The home page: a counter in a card |
245
+ | `src/routes/about.tsx` | The about page |
246
+ | `src/routes/todos/index.tsx`, `_layout.tsx` | The todo list, and the guard that sends a signed-out visitor to sign in |
247
+ | `src/routes/login.tsx` | Sign in and sign up |
248
+ | `src/server/todos.ts` | The todo list's `query` and `mutation` functions |
249
+ | `src/server/session.ts` | `me`, `signUp`, `signIn` and `signOut` |
250
+ | `src/auth.server.ts` | Better Auth |
251
+ | `drizzle.config.ts`, `src/db/schema.ts`, `src/db/index.server.ts` | The database |
252
+
253
+ Other choices change that list:
60
254
 
61
- | Template | Pages |
255
+ | Choice | Adds | Drops |
256
+ |---|---|---|
257
+ | `--ui headless`, `none` | `src/app.css` | |
258
+ | `--ui tailwind` | `src/app.css`, `vite.config.ts` | |
259
+ | `--db none` | | the database, server and sign-in files, and the layout's Todos link |
260
+ | `--layer prisma` | `prisma/schema.prisma`, `prisma.config.ts`, a `postinstall` script | `drizzle.config.ts`, `src/db/schema.ts` |
261
+ | `--layer native` | `migrations/0000_todos.sql` | `drizzle.config.ts`, `src/db/schema.ts` |
262
+ | `--no-auth` | | the sign-in files, the guard and the auth secret |
263
+ | `--config json`, `yaml` | `weft.config.json` or `.yaml`, with a `$schema` for editor completion | `weft.config.ts` |
264
+ | `--pm pnpm` | `pnpm-workspace.yaml`, which settles the build scripts pnpm would stop at | |
265
+ | `--template <t>` | the template's files, and `src/db/auth.ts` when it has sign-in | the about page and the default todo app |
266
+
267
+ Everything else in `.weft/` is generated by `weft` itself on the first `weft dev` or `weft check`, so a scaffold never
268
+ goes stale against the CLI.
269
+
270
+ `weft check` passes on the new app as made. Its one finding is the warning H001, which asks for `site.url` in the
271
+ config before you deploy.
272
+
273
+ ### Pinned versions
274
+
275
+ | Package | Version |
62
276
  |---|---|
63
- | `todo` | Sign-in and sign-up, and a todo list |
64
- | `admin` | An admin area with an orders table, order pages and nested layouts, behind sign-in |
65
- | `catalog` | A shop: categories, product pages and a cart |
66
- | `landing` | A landing page with pricing, a privacy page and a sign-up list |
277
+ | `@weft-js/*` | the version of this package |
278
+ | `typescript` | 7.0.2 |
279
+ | `drizzle-orm`, `drizzle-kit`, `drizzle-zod` | 0.45.4, 0.31.11, 0.8.3 |
280
+ | `prisma`, `@prisma/client`, `@prisma/adapter-*` | 7.10.1 |
281
+ | `better-auth` | 1.7.14 |
282
+ | `postgres`, `mysql2` | 4.0.0, 3.24.6 |
283
+ | `kysely` (native layer with sign-in) | 0.29.7 |
284
+ | `@t3-oss/env-core`, `zod` | 0.13.11, 4.6.7 |
285
+ | `@types/node` | 26.6.5 |
286
+
287
+ ## Package managers and runtimes
288
+
289
+ `--pm` picks the package manager for the install and for the commands it prints at the end. Without it, a run under Node
290
+ uses the one that started it (from `npm_config_user_agent`), and a run under Bun or Deno uses that one.
291
+
292
+ | `--pm` | How to start it | The `weft` command it prints |
293
+ |---|---|---|
294
+ | `npm` | `npm create @weft-js my-app` | `npx weft` |
295
+ | `pnpm` | `pnpm create @weft-js my-app` | `pnpm exec weft` |
296
+ | `bun` | `bun create @weft-js my-app` | `bunx --bun weft` |
297
+ | `deno` | `deno run -A npm:@weft-js/create my-app` | `deno run -A npm:@weft-js/cli` |
298
+ | `yarn` | `yarn create @weft-js my-app` | `yarn weft` |
299
+
300
+ `--runtime` is separate: it's what `weft build` targets and `weft start` runs. Without it, the scaffold picks the one
301
+ running it, since a machine may have only that one. Anything but Node is written into the config as `runtime`.
302
+
303
+ ## Recipes
304
+
305
+ A front end with no server code:
67
306
 
68
- ## Docs
307
+ ```bash
308
+ npm create @weft-js site -- --db none --yes
309
+ ```
310
+
311
+ Postgres with Prisma and your own auth:
312
+
313
+ ```bash
314
+ pnpm create @weft-js app --db postgres --layer prisma \
315
+ --auth-provider custom --yes
316
+ ```
317
+
318
+ Tailwind on MySQL with plain SQL, a YAML config, and no install:
319
+
320
+ ```bash
321
+ bun create @weft-js app --ui tailwind --db mysql \
322
+ --layer native --config yaml --no-install --yes
323
+ ```
324
+
325
+ For an agent or CI: no prompts, and everything run.
326
+
327
+ ```bash
328
+ npm create @weft-js my-app -- --yes
329
+ ```
330
+
331
+ ## Using it from code
332
+
333
+ The package exports what the command is built from. `weft add db` and `weft add auth` use `./stack`.
334
+
335
+ | Import | Exports |
336
+ |---|---|
337
+ | `@weft-js/create` | `scaffold(dir, options)`, `template(options)`, `withTemplate(options)`, and the choice lists `UI`, `DB`, `LAYERS`, `RUNTIMES`, `CONFIGS`, `TEMPLATES` |
338
+ | `@weft-js/create/stack` | `stackDeps`, `stackFiles`, `authFiles`, `VERSIONS`, `VERSION` and the page builders: the database and auth part of a scaffold |
339
+
340
+ ```js
341
+ import { scaffold, template } from '@weft-js/create'
342
+
343
+ // Every file as { path: text }, written nowhere
344
+ const files = template({
345
+ name: 'shop',
346
+ ui: 'warp',
347
+ db: 'sqlite',
348
+ auth: true,
349
+ })
350
+
351
+ // The same, written into an empty folder
352
+ const { files: written } = scaffold('./shop', {
353
+ ui: 'warp',
354
+ db: 'sqlite',
355
+ auth: true,
356
+ })
357
+ ```
358
+
359
+ > [!NOTE]
360
+ > `template()` and `scaffold()` don't apply the wizard's defaults: without `db` there's no database, and without
361
+ > `auth` no sign-in. They don't install or start git either.
362
+
363
+ ## Troubleshooting
364
+
365
+ | Message | Why | Fix |
366
+ |---|---|---|
367
+ | `<dir> is not empty` | It only writes into a missing or empty folder | Pick another name, or empty it |
368
+ | `--auth keeps users in a database` | Sign-in with `--db none` | Add `--db sqlite`, `postgres` or `mysql`, or `--no-auth` |
369
+ | `the <name> template needs --db postgres` (or `--ui warp`, `--layer drizzle`, `--config ts`, sign-in on or off) | A flag conflicts with the template | Drop the flag, or use the value it names |
370
+ | `--ui must be one of …` and the like | An unknown value | Use one from [Flags](#flags) |
371
+ | `The install didn't finish; run … yourself.` | The package manager failed. The app is already written | Run the command it prints. The run exits 1 |
372
+ | `git init didn't finish` | git isn't installed, or failed | The app is fine; run `git init` when you want it |
373
+
374
+ ## Related packages
375
+
376
+ | Package | What it is |
377
+ |---|---|
378
+ | [`@weft-js/cli`](https://www.npmjs.com/package/@weft-js/cli) <sup>[source](https://github.com/Ravonus/weft/tree/main/packages/cli)</sup> | The `weft` command every new app uses |
379
+ | [`@weft-js/core`](https://www.npmjs.com/package/@weft-js/core) <sup>[source](https://github.com/Ravonus/weft/tree/main/packages/core)</sup> | The runtime, the compiler binding, the Vite plugin, SSR and test utilities |
380
+ | [`@weft-js/start`](https://www.npmjs.com/package/@weft-js/start) <sup>[source](https://github.com/Ravonus/weft/tree/main/packages/start)</sup> | File routes, server functions, SSR, the database, auth and live data |
381
+ | [`@weft-js/db`](https://www.npmjs.com/package/@weft-js/db) <sup>[source](https://github.com/Ravonus/weft/tree/main/packages/db)</sup> | The Prisma and native SQL data layers |
382
+ | [`@weft-js/warp`](https://www.npmjs.com/package/@weft-js/warp) <sup>[source](https://github.com/Ravonus/weft/tree/main/packages/warp)</sup> | Warp's components, and the `warp()` theming plugin |
69
383
 
70
384
  [Installation](https://github.com/Ravonus/weft/blob/main/site/content/learn/installation.md) walks through every file in
71
385
  a new app, and how to run, check, build and deploy it.
72
386
 
73
- ## Links
387
+ ## Contributing
388
+
389
+ [CONTRIBUTING.md](https://github.com/Ravonus/weft/blob/main/CONTRIBUTING.md) has the setup. To work on this package:
390
+
391
+ ```bash
392
+ pnpm --filter @weft-js/create test
393
+ ```
394
+
395
+ A template is a folder in
396
+ [`packages/create/templates`](https://github.com/Ravonus/weft/tree/main/packages/create/templates) with a
397
+ `template.json` (what it `requires`, its `pages`, its `warp()` options and `dependencies`) and a `files/` folder that's
398
+ copied as it is.
399
+
400
+ ## License
74
401
 
75
- - [Source](https://github.com/Ravonus/weft/tree/main/packages/create)
76
- - [Weft on GitHub](https://github.com/Ravonus/weft): the framework, the docs and every package
77
- - [Changelog](https://github.com/Ravonus/weft/blob/main/CHANGELOG.md)
78
- - [Issues](https://github.com/Ravonus/weft/issues)
402
+ [MIT](https://github.com/Ravonus/weft/blob/main/LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weft-js/create",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Scaffold a weft app: npm create @weft-js",
5
5
  "keywords": [
6
6
  "weft"
@@ -35,6 +35,6 @@
35
35
  "access": "public"
36
36
  },
37
37
  "engines": {
38
- "node": ">=26"
38
+ "node": ">=24"
39
39
  }
40
40
  }