@ultimat3/cli 30.5.0 → 30.7.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.
- package/CLAUDE.md +2 -1
- package/package.json +28 -28
- package/src/cmd-exercise.ts +13 -2
- package/src/cmd-generate.ts +15 -2
- package/src/cmd-new.ts +4 -2
- package/src/error-codes.ts +2 -0
- package/src/exercise-entry-edit.ts +169 -0
- package/src/exercise-findings.ts +74 -4
- package/src/exercise-registration.ts +10 -14
- package/src/generate-exercise.ts +77 -0
- package/src/generate-follow-ups.ts +16 -3
- package/src/mcp-errors.ts +2 -0
- package/src/messages.ts +2 -0
- package/src/templates/action-exercise.ts +71 -0
- package/src/templates/action-tests.ts +10 -34
- package/src/templates/action.ts +8 -3
- package/src/templates/naming.ts +7 -0
- package/src/templates/resource-create.ts +10 -4
- package/src/templates/scaffold-auth.ts +17 -1
- package/src/templates/scaffold-exercise.ts +2 -1
- package/wiki/Actions.md +1 -1
- package/wiki/CLI-Reference.md +1 -1
- package/wiki/Policies-And-Authz.md +3 -2
- package/wiki/Testing.md +39 -23
- package/wiki/Tutorial-02-First-Feature.md +3 -3
- package/wiki/Tutorial-03-Auth-And-Admin.md +1 -1
|
@@ -50,7 +50,7 @@ bunx x g resource todo --dry-run
|
|
|
50
50
|
+ apps/web/shared/roles.ts
|
|
51
51
|
+ apps/web/api/index.ts
|
|
52
52
|
+ packages/db/src/client.ts
|
|
53
|
-
✓ would write
|
|
53
|
+
✓ would write 38 file(s) for resource todo — nothing written
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
**The form is an island, not a `ui/` component** — `todo-form.island.tsx` beside the slice rather than under `ui/`. A `createSignal` needs the browser, `.island.tsx` is what puts a module in the client bundle graph, and the route's `budget.js` is what bounds it. Everything under `ui/` renders on the server and ships no JS.
|
|
@@ -62,7 +62,7 @@ bunx x g resource todo
|
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
```text
|
|
65
|
-
✓ wrote
|
|
65
|
+
✓ wrote 40 file(s) for resource todo — next: …
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
`x g` never clobbers — an existing file is `X_GENERATE_CONFLICT`; the i18n catalog is merged key-by-key rather than overwritten; and a **slice module** (`entity.ts`, `repo.ts`, `policy.ts`, `errors.ts`) the slice already has is skipped, `--force` included, because it belongs to the slice rather than to the generator that needed it. The last three lines are the wiring: the grants in `roles.ts`, the slice's actions, query and job in `api/index.ts`, and its entity in the db client (`packages/db/src/client.ts`). A file the run would leave unchanged — a catalog merge that gains no key, wiring a previous slice already wrote — is skipped rather than counted. Here `bun run setup` has written `x.manifest.json` and `openapi.json` ([tutorial 1](Tutorial-01-First-App)), so the run re-projects both and prints 39; in an app with neither it prints 37. In a `x new --no-example` app, whose two `package.json`s do not yet name the workspace packages, the same runs print 39 and 41 (42 with `--admin`).
|
|
@@ -71,7 +71,7 @@ bunx x g resource todo
|
|
|
71
71
|
|
|
72
72
|
| Generator | Emits |
|
|
73
73
|
|---|---|
|
|
74
|
-
| `x g resource <n>` | the whole slice above —
|
|
74
|
+
| `x g resource <n>` | the whole slice above — 38 files on a dry run in tutorial 1's app, 41 with `--admin` (`As of 2026-11-08`); a real run after `bun run setup` adds the two re-projected artifacts |
|
|
75
75
|
| `x g entity` / `policy` / `action` / `mutator` / `query` / `job` / `task` | that primitive plus its test — **and the slice modules its own source imports**, when the slice has none: `x g job` is 5 files into a bare slice, `x g action` 8. Which ones differ per generator, so a job plants no `policy.ts` ([CLI reference § x g](CLI-Reference)) |
|
|
76
76
|
| `x g route <path> --surface site\|app` | `page.tsx`, its stylesheet, its test, its catalog keys |
|
|
77
77
|
|
|
@@ -272,7 +272,7 @@ lists the override under `resources:` in `apps/admin/app/admin/admin.ts` in the
|
|
|
272
272
|
`todo` slice and its wiring:
|
|
273
273
|
|
|
274
274
|
```text
|
|
275
|
-
✓ wrote
|
|
275
|
+
✓ wrote 43 file(s) for resource note — next: …
|
|
276
276
|
``` The
|
|
277
277
|
override is the only hand-written part; fields, operations, filters and forms derive from the entity.
|
|
278
278
|
|