docs(readme): 补 test 脚本与 query helper 步骤
- scripts 表加 `bun run test` - Add a feature 拆出 `src/client/queries/<feature>.ts` 步骤,与 AGENTS.md 对齐
This commit is contained in:
@@ -24,6 +24,7 @@ RPC endpoint: `/api/rpc` · OpenAPI docs: `/api/docs` · Spec: `/api/spec.json`
|
||||
| `bun run compile` | Single-binary `out/server-<target>` via `bun build --compile` |
|
||||
| `bun run cli <cmd>` | Run a CLI subcommand in source (`serve`, `migrate`) |
|
||||
| `bun run typecheck` | `tsc --noEmit` |
|
||||
| `bun run test` | `bun test` (colocated `*.test.ts`) |
|
||||
| `bun run fix` | Biome lint + format + organize imports |
|
||||
| `bun run db:push` | Dev-only schema sync (no migration files) |
|
||||
| `bun run db:generate` | Write SQL migrations to `./drizzle` |
|
||||
@@ -42,8 +43,9 @@ Contract-first, additive. Create or touch files in this order:
|
||||
4. `src/server/api/contracts/index.ts` — add `post` to the `contract` object.
|
||||
5. `src/server/api/routers/post.router.ts` — implement `os.post.*.handler(...)`.
|
||||
6. `src/server/api/routers/index.ts` — add `post` to the `router` object.
|
||||
7. `src/routes/<page>.tsx` — UI with `useSuspenseQuery` + loader `ensureQueryData`; invalidate affected list queries in mutation `onSuccess` handlers.
|
||||
8. `bun run db:generate` — emit SQL migrations to `./drizzle`.
|
||||
7. `src/client/queries/post.ts` — export `useInvalidatePosts` (or finer-grained helpers) for affected list keys.
|
||||
8. `src/routes/<page>.tsx` — UI with `useSuspenseQuery` + loader `ensureQueryData`; call the helper from mutation `onSuccess`.
|
||||
9. `bun run db:generate` — emit SQL migrations to `./drizzle`.
|
||||
|
||||
## Deploy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user