@ultimat3/cli 31.13.1 → 31.15.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 +1 -1
- package/README.md +2 -1
- package/package.json +29 -29
- package/src/budgets-requests.ts +37 -0
- package/src/budgets.ts +20 -1
- package/src/dev-boot.ts +2 -2
- package/src/dev-route-table.ts +5 -9
- package/src/document-options.ts +0 -7
- package/src/island-bundle.ts +52 -12
- package/src/island-disposer.ts +1 -1
- package/src/island-group-cache.ts +4 -0
- package/src/island-link-check.ts +73 -0
- package/src/island-realtime.ts +9 -3
- package/src/island-vendor.ts +183 -0
- package/src/job-registration.ts +10 -14
- package/src/mcp-errors.ts +1 -1
- package/src/prerender.ts +7 -7
- package/src/route-islands-preload.ts +54 -11
- package/src/runtime-admin.ts +2 -4
- package/src/runtime-render-document.ts +34 -13
- package/src/runtime-render.ts +58 -30
- package/src/serve-web.ts +8 -11
- package/src/static-images.ts +25 -4
- package/src/static-precompress.ts +57 -0
- package/src/style-bundle.ts +28 -6
- package/src/templates/guard-island-mount-clears.ts +151 -0
- package/src/templates/guard-raw-interval.ts +3 -2
- package/src/templates/island.ts +8 -7
- package/src/templates/resource-form-island.ts +12 -9
- package/src/templates/scaffold-docs.ts +2 -1
- package/src/templates/scaffold-guards.ts +4 -1
- package/src/templates/scaffold-shell.ts +12 -9
- package/src/theme-brand.ts +18 -20
- package/wiki/Client-Data.md +54 -2
- package/wiki/Configuration.md +1 -0
- package/wiki/Home.md +3 -3
- package/wiki/Jobs-And-Workflows.md +48 -6
- package/wiki/Known-Gaps.md +4 -3
- package/wiki/MCP-And-AI.md +42 -1
- package/wiki/Notify.md +6 -0
- package/wiki/PWA-And-Offline.md +11 -0
- package/wiki/Queries-And-Live-Queries.md +1 -1
- package/wiki/Realtime.md +28 -7
- package/wiki/SEO.md +1 -1
- package/wiki/Scheduled-Tasks.md +36 -0
- package/wiki/Scraping.md +3 -1
- package/wiki/Static-Assets.md +30 -3
- package/wiki/Theming.md +6 -6
- package/wiki/Upgrading.md +16 -0
package/wiki/Static-Assets.md
CHANGED
|
@@ -98,6 +98,30 @@ unsatisfiable range gets a `416`. Safari will not play a `<video>` without this.
|
|
|
98
98
|
`favicon.ico` stays at `apps/web/site/favicon.ico` and the install icon at `apps/web/site/icon.png`.
|
|
99
99
|
Browsers ask for those at fixed URLs, so they are not hashed.
|
|
100
100
|
|
|
101
|
+
## Precompressed siblings in a static export
|
|
102
|
+
|
|
103
|
+
`x build --target static` writes `<file>.br` (brotli 11) and `<file>.gz` (gzip 9) beside every
|
|
104
|
+
island chunk (`/islands/*.js`) and surface stylesheet (`/styles/*.css`). Each sibling decodes to its
|
|
105
|
+
file byte for byte. A file under 1 KiB, or one a coding would not shrink, gets none. The coders
|
|
106
|
+
are `@ultimat3/http`'s `PRECODERS`, the same ones the container uses to precode its immutable
|
|
107
|
+
answers. `packages/cli/src/static-precompress.ts`. `As of 2026-11`.
|
|
108
|
+
|
|
109
|
+
A host serves the siblings only if it is configured to. The rules, for any host:
|
|
110
|
+
|
|
111
|
+
| Rule | Why |
|
|
112
|
+
|---|---|
|
|
113
|
+
| answer `<file>.br` when `Accept-Encoding` names `br`, else `<file>.gz` for `gzip`, else `<file>` | a client that refused a coding must never be handed it |
|
|
114
|
+
| `Content-Encoding: br` / `gzip` on the sibling, and the ORIGINAL's `Content-Type` (`text/css`, `text/javascript`) | `application/x-brotli` is a download, not a stylesheet |
|
|
115
|
+
| `Vary: Accept-Encoding` on all three answers | otherwise a shared cache hands one client's coding to the next |
|
|
116
|
+
| `Cache-Control: public, max-age=31536000, immutable` on `/islands/*` and `/styles/*` | the name is the content hash, so the bytes never change under it |
|
|
117
|
+
| never serve a `.br`/`.gz` URL directly as its own resource | it exists to be negotiated, not linked |
|
|
118
|
+
|
|
119
|
+
| Host | Setting |
|
|
120
|
+
|---|---|
|
|
121
|
+
| nginx | `gzip_static on;` and, with the brotli module, `brotli_static on;` |
|
|
122
|
+
| Caddy | `file_server { precompressed br gzip }` |
|
|
123
|
+
| a host or CDN that compresses on its own | ignores the siblings. They are extra bytes in the artifact and change nothing |
|
|
124
|
+
|
|
101
125
|
## `<Image>`
|
|
102
126
|
|
|
103
127
|
| Prop | Meaning |
|
|
@@ -116,7 +140,7 @@ Everything else is `loading="lazy"`, `fetchpriority="auto"` and `decoding="async
|
|
|
116
140
|
|
|
117
141
|
`responsiveImage()` from `@ultimat3/seo` mints `?w=&f=` URLs, which only `/media` answers — a dumb
|
|
118
142
|
file server ignores the query and hands back the full original under `<source type="image/webp">`.
|
|
119
|
-
So under `x build --target static` every candidate is a FILE instead: `/_img/<
|
|
143
|
+
So under `x build --target static` every candidate is a FILE instead: `/_img/<variant hash>-<width>.<ext>`,
|
|
120
144
|
written through core's pipeline after the documents render, one per width in every offered format.
|
|
121
145
|
`As of 2026-11`.
|
|
122
146
|
|
|
@@ -128,8 +152,11 @@ written through core's pipeline after the documents render, one per width in eve
|
|
|
128
152
|
| what is written | only the candidates an EXPORTED document names: a page rendered just to be weighed writes nothing |
|
|
129
153
|
| a served page | keeps the `?w=&f=` URLs, which `/assets` answers itself — [below](#responsive-images-on-a-served-page). The seam is installed by the export alone |
|
|
130
154
|
|
|
131
|
-
The name
|
|
132
|
-
|
|
155
|
+
The name hashes everything the variant's bytes are a function of: the source's bytes, the width,
|
|
156
|
+
the format and the encoder (the framework version and Bun's, `imageEncoderIdentity()` in
|
|
157
|
+
`packages/cli/src/static-images.ts`). A changed image is a new URL, and so is an upgrade that may
|
|
158
|
+
re-encode it, so every file can be served `immutable` and one URL is always one byte string — the
|
|
159
|
+
#1075 rule islands follow. `As of 31.15.0` every `/_img/` URL changed once. `examples/dummy`'s landing page (`apps/web/site/page.tsx`) is the worked example.
|
|
133
160
|
|
|
134
161
|
## Responsive images on a served page
|
|
135
162
|
|
package/wiki/Theming.md
CHANGED
|
@@ -194,11 +194,11 @@ export const brand = defineTheme({ preset: 'scifi' });
|
|
|
194
194
|
| Who | Does |
|
|
195
195
|
|---|---|
|
|
196
196
|
| the app | exports `brand` from `apps/web/shared/theme.ts`. Nothing else: no `<style>` in a layout, no CSP edit |
|
|
197
|
-
| `x dev`, the container (`ROLE=web`), `x build`'s static export |
|
|
198
|
-
| the served processes |
|
|
199
|
-
| an app with no `shared/theme.ts`, or one whose brand renders no CSS | nothing:
|
|
197
|
+
| `x dev`, the container (`ROLE=web`), `x build`'s static export | append `brand.css` to the END of every surface stylesheet (`/styles/<hash>.css`), so every document — `ssr`, `stream`, `static`, `isr`, and every `/admin` screen — gets it from the `<link>` it already has, last in the cascade, and the brand wins at equal specificity. No inline `<style>` (`As of 2026-11`; before, a 6,130-byte `<style>` rode every document) |
|
|
198
|
+
| the served processes | nothing for `style-src`: the stylesheet is a same-origin file `'self'` admits, so no `sha256` source is added |
|
|
199
|
+
| an app with no `shared/theme.ts`, or one whose brand renders no CSS | nothing: the sheets are unchanged |
|
|
200
200
|
|
|
201
|
-
One file, one reader: `packages/cli/src/theme-brand.ts`.
|
|
201
|
+
One file, one reader: `packages/cli/src/theme-brand.ts`; the append is `packages/cli/src/style-bundle.ts`. Every page that links the `app/` sheet gets the brand, including the `/_x` dev dashboard and `x shot`'s harness. A change to the brand is a new sheet hash, so a cached old sheet is never served under it. No JavaScript is added: the brand is CSS, and the theme toggle and dark mode work as before — the brand answers `html[data-theme]` and `prefers-color-scheme` at every level `theme.scss` does, so the boot script and `ThemeToggle` flip between the brand's two palettes. A save to `theme.ts` is applied on the next `x dev`.
|
|
202
202
|
|
|
203
203
|
| Failure | Code | When |
|
|
204
204
|
|---|---|---|
|
|
@@ -218,7 +218,7 @@ const brand = defineTheme({
|
|
|
218
218
|
});
|
|
219
219
|
|
|
220
220
|
brand.css; // the four CSS blocks, as a string
|
|
221
|
-
brandStyleTag(brand); // '<style>…</style>' —
|
|
221
|
+
brandStyleTag(brand); // '<style>…</style>' — for a page you render yourself; the framework links it in the sheet
|
|
222
222
|
```
|
|
223
223
|
|
|
224
224
|
| Field | Shape | Notes |
|
|
@@ -233,7 +233,7 @@ Returns a frozen `{ css: string }`. It emits `:root`, `html[data-theme='light']`
|
|
|
233
233
|
|
|
234
234
|
### Values are validated, never escaped
|
|
235
235
|
|
|
236
|
-
The output
|
|
236
|
+
The output can land in a `<style>` element (`brandStyleTag`), so a value that could close it is refused rather than sanitised.
|
|
237
237
|
|
|
238
238
|
| Slot | Accepted | Refused |
|
|
239
239
|
|---|---|---|
|
package/wiki/Upgrading.md
CHANGED
|
@@ -251,6 +251,22 @@ A setter still on a package's `.` barrel is `X_ADAPTER_PORT_INCOMPLETE` on the `
|
|
|
251
251
|
| an on-time `jobs.scheduler.dispatched` logs at `debug` (**31.13.0**); a catch-up fire and `jobs.scheduler.already-fired` stay `info` | an alert or dashboard keyed on `jobs.scheduler.dispatched` at `info` keys on `catchUp: true` for missed fires, or sets `LOG_LEVEL=debug` on the `scheduler` role to keep every line |
|
|
252
252
|
| with a proven wake, an idle worker rests up to 60 s between claims (**31.13.0**; was ≤ 5 s). An enqueue due within 60 s now notifies (was within 1 s), so a delayed job another process queues still starts at its `runAt`; a worker that stops holding a retry or `step.sleep` due soon announces it (`JobDriver.wake`). Only a driver with `wake` rests — Redis keeps the 5 s poll | nothing for the shipped drivers. A custom `JobDriver` whose enqueues reach every worker adds `wake(queue?)` to let its workers rest; without it they keep the 2–5 s poll |
|
|
253
253
|
| a custom `JobDriver` or `OutboxStore` proved with `behavesLike(jobDriverConformance, …)` / `behavesLike(outboxStoreConformance, …)` (`@ultimat3/testing/conformance`) meets new checks (**31.13.0**): an empty claim calls `ClaimOptions.onEmpty(dueInMs)` (`null`, a delayed row, a held lease), a claimed row carries `steps`, and an empty outbox `claim(limit, { onEmpty })` reports a held row's lease | implement them — `memoryJobDriver` and `memoryOutboxStore` are the shapes to copy — or keep the driver unproved: each is optional on the interface, and a driver without them keeps the 2–5 s poll and the per-attempt step list |
|
|
254
|
+
| the first boot on **31.14.0** adds `x_jobs.expires_at`, `x_jobs.settle_owed` (`boolean not null default false`) with the partial index `x_jobs_settle_owed_idx`, `x_jobs.debounced_id` (`uuid`) with the partial index `x_jobs_debounced_idx`, and `x_outbox.on_conflict` / `x_outbox.expires_at`, inside the locked framework-schema apply — additive, no row rewritten. An app that commits the framework schema dump (`packages/db/schema/framework/`) sees `X_SCHEMA_DUMP_DRIFT` on `x_jobs` and `x_outbox` until it regenerates it | `x db gen` once and commit the regenerated `04_tables/x_jobs.sql`, `04_tables/x_outbox.sql` and `05_indexes/x_jobs.sql`; no migration |
|
|
255
|
+
| `onSettled` can now run more than once for one ending (**31.14.0**): a failure, a dead letter, a `whenBusy: 'fail'` refusal or a completion whose body returned `undefined`, when the worker died between the settle and the hook's return — re-driven by the scheduler leader with `settled.redriven === true`, `reason: 'lost'`. A completion that returned a value, a final-attempt lease lapse the claim buried and an expired row are still told at most once | write the hook to be repeated: an upsert or a guarded update, a notification keyed by `settled.input` and the outcome. Branch on `settled.redriven` where a repeat must be told apart |
|
|
256
|
+
| `jobs.step.output-too-large` (`X_STEP_OUTPUT_TOO_LARGE`) at `warn`, once per job and step, for a `step.run` output past 256 KiB of JSON (**31.14.0**). Stored as before; refused by default from the next major | `step.run(name, async () => { await storage.put(key, bytes); return key; })` — persist the payload and return its key; or declare `job({ stepOutputMax: <bytes> })`, which refuses past it now (terminal) |
|
|
257
|
+
| `x verify` reports `X_PARTITIONS_UNMAINTAINED` in an app with an entity declaring `partitionBy` and no `partitions()` job, where a job carrying a `<name>.schedule` task — a `cronJob()`, or one built by hand that way — used to satisfy it (**31.14.0**: a maintainer is recognised by identity, `isPartitionsJob`) | export `partitions()` (`@ultimat3/jobs`) from a module listed under `jobs` in `apps/web/api/index.ts` and its `.schedule` under `tasks`, then `x verify --only manifest --json` — the error's own `fix:` |
|
|
258
|
+
| a custom `JobDriver` or `OutboxStore` proved with `behavesLike(jobDriverConformance, …)` / `behavesLike(outboxStoreConformance, …)` meets new checks (**31.14.0**): `onConflict: 'replace'` (fenced by request order, a repeat after the holder ran included) and `expiresAt` on `enqueue`, `backlog(queue, cap)`, `holds(name, key, tenantId?)`, the `settleDebt` debt, a requeue that clears expiry and debt, and a staged row keeping `onConflict` / `expiresAt` | implement them — `memoryJobDriver` (`driver-memory-enqueue.ts`, `driver-memory-settle.ts`) and `memoryOutboxStore` are the shapes to copy — or keep the driver unproved: `backlog` and `settleDebt` are optional, and without them a job declaring `maxPending` is `X_INVARIANT` at enqueue and `onSettled` stays at most once |
|
|
259
|
+
| a realtime hook created inside a component is released when that component is disposed (**31.14.0**): `x build`'s island bootstrap calls `installRealtime({ signal: createSignal, cleanup: onCleanup })`, and every `use*` hook registers its own `release()` through it. Before, it lived until the island called `release()` — or, forgotten, until the page unloaded, holding a socket subscription and a cap slot. A handle the island kept using after its component went (stored in a module variable or a parent's state) now reads nothing new | create a long-lived handle outside any component — at module scope or in `mount`, before `render()`: no owner, nothing registered, its `release()` is yours. A hand-built island (one that calls `installRealtime` itself) adds `cleanup: onCleanup` from its own `solid-js`; without it every `release()` stays the island's. An `onCleanup(() => h.release())` already written is harmless: a release runs once. Optional: delete it |
|
|
260
|
+
| `x doctor` lists `raw-interval` as differing from the shipped template after the **31.14.0** hop: its `fix:` now names `useQuery(ref, input, { poll: pollEvery(ms) })` for a query's timed re-read, before `visibleInterval(run, ms)`. The rule is the same; nothing new is reported | `x g guard raw-interval --force` — it rewrites `guards/raw-interval.ts` **and** its `.test.ts`, so review the diff and keep any rule you edited on purpose. Then `x verify` |
|
|
261
|
+
| a replicator restart chains (**31.14.0**): the change envelope is version 2 — a run's first envelope carries `from`, and a clean stop publishes a handover on `x.change.-handover` — so a deploy of the `replicator` role after a clean stop re-snapshots no live window. A crash still costs one re-read per window. During a roll, an old node reading a new replicator, or a new node reading an old one, reads the restart as a gap, exactly as before | roll the `sync` role before the `replicator` role. Either order is safe; only nodes already on 31.14.0 chain the replicator's own restart. A custom `ChangeFeed` (`@ultimat3/realtime/server`) chains only once it implements the optional `position()` and `onResume` |
|
|
262
|
+
| an island whose render throws can show its server HTML instead of a blank box (**31.15.0**): `mountOver(el, draw)` from `@ultimat3/render/client` clears the wrapper, draws, and puts the server markup back on a throw (then rethrows, so `data-x-failed` and `clientErrors` still fire). `x g island`, `x new` and the resource form island write it; an older island keeps working as it was | `x g guard island-mount-clears`, then `x verify --only boundaries`: for each finding delete `el.textContent = ''` and end `mount` with `return mountOver(el, (root) => render(() => <Island {...props} />, root))`, adding `import { mountOver } from '@ultimat3/render/client'` |
|
|
263
|
+
| every `/_img/` URL a static export writes changes once (**31.15.0**): a variant is named by the hash of its source bytes, width, format and encoder (framework + Bun version), no longer the source hash alone, so an upgrade that may re-encode an image never serves other bytes under an `immutable` name | nothing. A CDN fetches each image once again |
|
|
264
|
+
| an exposed LIST query's MCP tool answers at most 500 rows and 256 KiB of JSON per call (**31.15.0**), with `truncated` and a `nextCursor` when cut short; an agent or test that read every row from one call now gets the first page | follow `nextCursor`: call the tool again with `_after: <nextCursor>` until it is `null`. An answer that fits is the bare rows, as before |
|
|
265
|
+
| unauthenticated MCP failures are counted per IPv6 /64, not per address (**31.15.0**) — the key `@ultimat3/http`'s limiter uses — and `mcp.auth.*` lines log that network, never the full address; `mcp.auth.missing-token` logs at `info` | IPv6 clients sharing a /64 now share one allowance of 20 a minute: where that is legitimate traffic, raise `defineAppMcp({ rateLimits: { unauthenticated } })` (or `mcpHttpRoute`'s). An alert keyed on `mcp.auth.missing-token` at `warn` keys on `info` |
|
|
266
|
+
| an `llm()` / `generate` / `stream` call that stops early now spends budget (**31.15.0**): a stream abandoned, cut or aborted after its first provider byte records the running usage; any call aborted after its request was sent records the prompt's estimate. Before, all of these released the whole reservation. Only a call never sent, or refused by the provider, is free | raise `tokensPerRun`, `costPerRun` or an actor/org ceiling that was tuned against the old under-count. A custom `Provider` reports nothing and keeps the old release |
|
|
267
|
+
| a `postgresVectorStore` search runs in a read-only transaction that widens the HNSW scan (**31.15.0**: `hnsw.iterative_scan = relaxed_order` on pgvector ≥ 0.8, else `hnsw.ef_search = max(40, k × 10)`), 2–3 round trips where it was 1, so a small tenant gets `k` hits | nothing. On pgvector < 0.8, upgrade the extension for the cheaper iterative scan |
|
|
268
|
+
| `x build --target static` writes `.br` (brotli 11) and `.gz` (gzip 9) siblings beside each island chunk and stylesheet (**31.15.0**), and the app brand ships at the end of each surface stylesheet instead of an inline `<style>` | a static host may serve the siblings (nginx `gzip_static on;` / `brotli_static on;`, Caddy `file_server { precompressed br gzip }`, with `Vary: Accept-Encoding`) or ignore them — [Static assets](Static-Assets#precompressed-siblings-in-a-static-export). A hand-written CSP that allowed the brand's `sha256` may drop it |
|
|
269
|
+
| a cacheable `ssr` document (not `no-store`) carries a strong content `ETag` and answers `If-None-Match` with `304` (**31.15.0**); every document sends a `Link` header (stylesheet preload + the modulepreloads its tags name) a CDN turns into 103 Early Hints | nothing. A test that expected `200` to `If-None-Match: *` on such a page expects `304` |
|
|
254
270
|
|
|
255
271
|
## 29.x → 30.0.0, entry by entry
|
|
256
272
|
|