@ultimat3/cli 31.31.0 → 31.33.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/package.json +29 -29
- package/src/admin-registration.ts +6 -5
- package/src/affected.ts +3 -2
- package/src/api-registration.ts +7 -5
- package/src/app-agents-md.ts +1 -1
- package/src/app-boundaries.ts +12 -8
- package/src/app-layout.ts +6 -5
- package/src/app-load.ts +1 -1
- package/src/app-manifest.ts +1 -1
- package/src/app-mcp.ts +11 -9
- package/src/app-openapi.ts +7 -5
- package/src/app-reload-graph.ts +9 -7
- package/src/app-runtime.ts +9 -6
- package/src/async-pages.ts +6 -5
- package/src/browser-launcher.ts +9 -5
- package/src/browser-transport.ts +8 -5
- package/src/budgets.ts +4 -3
- package/src/cdp-shot-driver.ts +21 -5
- package/src/cdp-shot-errors.ts +7 -5
- package/src/cdp-shot-page.ts +6 -5
- package/src/cdp-shot-watch.ts +7 -5
- package/src/ci-log.ts +6 -5
- package/src/ci-runs.ts +7 -3
- package/src/cmd-auth.ts +5 -4
- package/src/cmd-build.ts +13 -7
- package/src/cmd-ci.ts +9 -6
- package/src/cmd-clean.ts +9 -6
- package/src/cmd-db-backfill.ts +8 -5
- package/src/cmd-db-branch.ts +3 -2
- package/src/cmd-db.ts +2 -2
- package/src/cmd-deploy-compose.ts +8 -5
- package/src/cmd-deploy.ts +2 -1
- package/src/cmd-dev.ts +1 -0
- package/src/cmd-env.ts +1 -1
- package/src/cmd-errors.ts +2 -3
- package/src/cmd-generate.ts +2 -0
- package/src/cmd-i18n.ts +8 -6
- package/src/cmd-jobs.ts +3 -2
- package/src/cmd-manifest.ts +1 -0
- package/src/cmd-new.ts +2 -0
- package/src/cmd-planned.ts +2 -1
- package/src/cmd-pr.ts +7 -6
- package/src/cmd-registries.ts +5 -4
- package/src/cmd-repro.ts +8 -2
- package/src/cmd-secrets.ts +1 -1
- package/src/cmd-shot-island.ts +4 -2
- package/src/cmd-shot.ts +1 -0
- package/src/cmd-tasks.ts +7 -5
- package/src/cmd-test.ts +13 -8
- package/src/db-backfill.ts +4 -3
- package/src/db-branch.ts +2 -2
- package/src/db-generate.ts +1 -1
- package/src/db-schema-refresh.ts +5 -4
- package/src/db-seed.ts +3 -2
- package/src/dev-child-watch.ts +7 -6
- package/src/dev-environment.ts +6 -5
- package/src/dev-lock.ts +5 -2
- package/src/dev-n-plus-one.ts +7 -5
- package/src/dev-reload.ts +7 -5
- package/src/dev-restart-retire.ts +7 -5
- package/src/dev-supervisor.ts +9 -6
- package/src/dev-watch-tree.ts +9 -7
- package/src/dev-watch.ts +7 -5
- package/src/document-styles.ts +7 -5
- package/src/drift.ts +9 -5
- package/src/duplicate-packages.ts +12 -6
- package/src/error-contract.ts +4 -2
- package/src/error-fixes.ts +7 -6
- package/src/error-unthrown.ts +7 -5
- package/src/errors.ts +11 -10
- package/src/fix-imports.ts +1 -1
- package/src/flag-number.ts +2 -1
- package/src/flag-reads.ts +1 -1
- package/src/framework-schema-apply.ts +7 -5
- package/src/framework-scope.ts +1 -1
- package/src/generate-files.ts +1 -1
- package/src/generate-follow-ups.ts +8 -5
- package/src/generate-kinds.ts +2 -2
- package/src/generate-shadow.ts +6 -4
- package/src/generate-sibling.ts +6 -4
- package/src/gh-target.ts +3 -2
- package/src/guards.ts +4 -3
- package/src/handle-registration.ts +4 -3
- package/src/i18n-audit.ts +4 -4
- package/src/i18n-registration.ts +7 -4
- package/src/import-closure.ts +7 -6
- package/src/island-bundle.ts +7 -6
- package/src/island-cache-inputs.ts +2 -1
- package/src/island-capture.ts +5 -4
- package/src/island-realtime-state.ts +6 -5
- package/src/island-realtime.ts +8 -6
- package/src/island-shot-errors.ts +2 -1
- package/src/island-shot.ts +6 -5
- package/src/load-findings.ts +8 -5
- package/src/local-cli.ts +8 -6
- package/src/mcp-db-target.ts +2 -2
- package/src/mcp-errors.ts +3 -1
- package/src/mcp-ui-diff.ts +8 -5
- package/src/mcp-ui-inspect.ts +8 -6
- package/src/mcp-ui-interact.ts +9 -6
- package/src/mcp-ui.ts +11 -9
- package/src/measure-database.ts +8 -6
- package/src/measure-paths.ts +7 -5
- package/src/measure-scope.ts +10 -8
- package/src/migrations.ts +2 -0
- package/src/page-navigation.ts +9 -7
- package/src/page-speculation.ts +8 -6
- package/src/parse.ts +3 -3
- package/src/path-segments.ts +2 -1
- package/src/pr-threads.ts +2 -1
- package/src/prerender.ts +4 -4
- package/src/role-start.ts +3 -2
- package/src/role-sync.ts +2 -1
- package/src/runtime-assets.ts +8 -6
- package/src/runtime-bindings.ts +2 -0
- package/src/runtime-cache.ts +7 -5
- package/src/runtime-live-feed.ts +7 -5
- package/src/runtime-overrides.ts +7 -5
- package/src/runtime-queue.ts +6 -5
- package/src/schema-drift.ts +11 -14
- package/src/script-csp.ts +4 -2
- package/src/secrets-rotation.ts +7 -5
- package/src/serve-boot.ts +8 -6
- package/src/serve.ts +8 -5
- package/src/server-barrels.ts +7 -5
- package/src/shell-quote.ts +8 -1
- package/src/shot-locale.ts +2 -1
- package/src/shot-route.ts +2 -1
- package/src/shot-theme.ts +8 -6
- package/src/site-config.ts +2 -1
- package/src/site-llms-pages.ts +8 -2
- package/src/source-list-edit.ts +8 -6
- package/src/static-cards.ts +2 -2
- package/src/static-report.ts +22 -18
- package/src/sync-authenticator.ts +6 -5
- package/src/templates/admin-page.ts +8 -5
- package/src/templates/admin.ts +6 -5
- package/src/templates/guard-animated-layout-property.ts +7 -5
- package/src/templates/guard-focus-visible.ts +7 -5
- package/src/templates/guard-image-dimensions.ts +8 -5
- package/src/templates/guard-island-without-states.ts +5 -3
- package/src/templates/guard-semantic-interactive.ts +1 -0
- package/src/templates/island.ts +9 -6
- package/src/templates/resource-form-island.ts +3 -2
- package/src/templates/resource-page.ts +8 -6
- package/src/templates/route.ts +1 -0
- package/src/templates/scaffold-docs.ts +7 -6
- package/src/templates/scaffold-entries.ts +7 -5
- package/src/templates/scaffold-errors.ts +8 -6
- package/src/templates/scaffold-repo.ts +5 -4
- package/src/templates/scaffold-shell.ts +7 -5
- package/src/templates/scaffold-site.ts +7 -5
- package/src/test-housekeeping.ts +3 -6
- package/src/test-select.ts +3 -3
- package/src/ts-scan.ts +6 -4
- package/src/tsconfig-references.ts +6 -6
- package/src/verify-checks.ts +9 -9
- package/src/verify-e2e.ts +8 -6
- package/src/verify-floor.ts +8 -8
- package/src/verify-pace.ts +3 -1
- package/src/verify-role-load.ts +8 -5
- package/src/verify-services.ts +2 -1
- package/src/verify-tests.ts +2 -2
- package/src/verify-typecheck.ts +7 -5
- package/src/version-loader.ts +1 -1
- package/src/worker-bundle.ts +7 -5
- package/src/workspace-checks.ts +6 -3
- package/src/workspace-external-deps.ts +4 -2
- package/src/workspace-graph.ts +4 -3
- package/src/write-line.ts +1 -1
package/src/dev-reload.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// One rebuild at a time
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// One rebuild at a time: the in-flight guard over the dev loop's reloads.
|
|
2
|
+
//
|
|
3
|
+
// A reload is a full `appManifest()` plus a `buildIslands()` over every island, and the watcher had
|
|
4
|
+
// no in-flight guard: a 45ms drip of writes — a slow `git checkout`, a formatter walking the tree,
|
|
5
|
+
// `x db gen` — started one per file, 40 for 40 files, each assigning the same two state slots in
|
|
6
|
+
// COMPLETION order. So a slower earlier rebuild could land on top of a newer one, and the dev
|
|
7
|
+
// server then served a manifest built from source that had already changed.
|
|
6
8
|
|
|
7
9
|
/** What a tick does while a rebuild is already running: nothing, except become the next one. */
|
|
8
10
|
export type ReloadTrigger = (file: string) => void;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// `x dev`'s restart, worker first (issue #677)
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// `x dev`'s restart, worker first (issue #677): retire the worker, then drain.
|
|
2
|
+
//
|
|
3
|
+
// A save that reaches a primitive-defining module restarts the child, and the drain that ends it
|
|
4
|
+
// used to be the FIRST thing it did: a job that ran past the drain budget was aborted `X_DRAINING`
|
|
5
|
+
// and requeued, so a non-idempotent one (a bank login) ran twice. The worker is retired first —
|
|
6
|
+
// `stop()` claims nothing and aborts nothing — and only then is the drain asked to release the
|
|
7
|
+
// port, the lock and the embedded database.
|
|
6
8
|
|
|
7
9
|
import { drain, logger, markRetiring, renderThrowable } from '@ultimat3/core';
|
|
8
10
|
import type { Worker } from '@ultimat3/jobs';
|
package/src/dev-supervisor.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
// `x dev` as two processes: this one supervises, a child serves
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
1
|
+
// `x dev` as two processes: this one supervises, a child serves — and a fresh child boots on
|
|
2
|
+
// the same port when a save reaches a module that defines a primitive.
|
|
3
|
+
//
|
|
4
|
+
// A save that reaches a module which DEFINES a primitive (`app-reload-graph.ts`'s pinned modules —
|
|
5
|
+
// a query over a slice's service, an admin page's view under `defineAdmin`) cannot be served by
|
|
6
|
+
// re-importing: the registries and the route table hold that module's first instance. The child
|
|
7
|
+
// exits `DEV_RESTART_EXIT_CODE` instead of logging "reloaded" over stale code, and this loop boots
|
|
8
|
+
// a fresh one on the same port. Every other save stays the in-process reload it was — a restart is
|
|
9
|
+
// paid only where nothing else works.
|
|
7
10
|
|
|
8
11
|
import type { StalePin } from './app-reload-graph';
|
|
9
12
|
import { devSpec } from './cmd-dev-spec';
|
package/src/dev-watch-tree.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
// The app root watched one directory at a time, because the watch SET is a registration
|
|
2
|
-
// and not a filter.
|
|
3
|
-
//
|
|
4
|
-
// `
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
1
|
+
// The app root watched one directory at a time, because the watch SET is a registration
|
|
2
|
+
// decision and not a filter.
|
|
3
|
+
//
|
|
4
|
+
// `watch(root, { recursive: true })` takes an inotify descriptor per directory in the tree —
|
|
5
|
+
// including every directory the dev loop then discards events from — so `.git/`, `node_modules/`
|
|
6
|
+
// and `.x/` (which this very process writes to, continuously) each cost a descriptor, a kernel
|
|
7
|
+
// queue entry and a JS callback per write, against a per-user descriptor budget of 8192 on many
|
|
8
|
+
// distributions. Bun 1.4.0's `fs.watch` takes no ignore option, so the only place the answer can be
|
|
9
|
+
// given early is at registration.
|
|
8
10
|
|
|
9
11
|
// why: Bun exposes no filesystem watcher, no directory listing and no synchronous stat —
|
|
10
12
|
// `Bun.file().exists()` is async and answers false for a DIRECTORY, which is the one thing this
|
package/src/dev-watch.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// Which paths under the app root `x dev` must not watch
|
|
2
|
-
// filtering
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Which paths under the app root `x dev` must not watch — decided at REGISTRATION, not by
|
|
2
|
+
// filtering events.
|
|
3
|
+
//
|
|
4
|
+
// `watch(root, { recursive: true })` takes one inotify descriptor per directory before any filter
|
|
5
|
+
// runs, so an answer given after the event has already cost the kernel queue, a JS callback and a
|
|
6
|
+
// slot out of `max_user_watches`. Measured on a monorepo root: 1901 descriptors, 1490 of them under
|
|
7
|
+
// `.git/` and `node_modules/`, and one `git status` delivering 5 events.
|
|
6
8
|
//
|
|
7
9
|
// The ignore set is the app's own `.gitignore`, read with git's own anchoring (`gitignore.ts`),
|
|
8
10
|
// plus a floor of directory names an ignore file need not name. It was seven hand-listed names,
|
package/src/document-styles.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// One question the gate asks of what a render actually emits: does the document carry its
|
|
2
|
-
// style layer?
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// One question the gate asks of what a render actually emits: does the document carry its
|
|
2
|
+
// global style layer?
|
|
3
|
+
//
|
|
4
|
+
// Every rule `@ultimat3/ui` emits reads a custom property — `background:rgb(var( --color-bg)/1)`,
|
|
5
|
+
// `padding:var(--space-8)` — so CSS with no `:root` definitions is a document the browser drops
|
|
6
|
+
// every one of those declarations from, byte-for-byte identical to a working page apart from the
|
|
7
|
+
// styling nobody sees missing. A silent failure is exactly what axiom 3 exists for.
|
|
6
8
|
|
|
7
9
|
import { ERROR_DOCS_URL } from '@ultimat3/core';
|
|
8
10
|
import type { Surface } from '@ultimat3/render';
|
package/src/drift.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
// Source drift: the app's schema *source* against what migrations recorded.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Source drift: the app's schema *source* against what migrations recorded.
|
|
2
|
+
//
|
|
3
|
+
// `x db gen` writes the hash of the entity schema next to the migration it produced, so drift here
|
|
4
|
+
// is "the schema hashes to something no migration recorded". The hash is committed beside the
|
|
5
|
+
// migration, so a fresh clone answers with no local state and CI needs no database. An app with NO
|
|
6
|
+
// migration at all is the one case that also asks how many entities are declared — see
|
|
7
|
+
// `checkSourceDrift`.
|
|
6
8
|
//
|
|
7
9
|
// This is not the post-migrate verification and deliberately cannot be: that one is the live
|
|
8
10
|
// database against the ledger (`checkDrift`, `@ultimat3/db`), asked by `runMigrations` where a
|
|
9
11
|
// connection is open. Same `X_DB_DRIFT`, two conditions — an entity edited with no migration
|
|
10
12
|
// generated, versus a database that does not match the migrations it ran.
|
|
11
13
|
|
|
14
|
+
// why: the probes are of DIRECTORIES, which `Bun.file().exists()` answers false for; Bun ships no
|
|
15
|
+
// path API, and `join` builds the paths under the app root.
|
|
12
16
|
import { existsSync } from 'node:fs';
|
|
13
17
|
import { join } from 'node:path';
|
|
14
18
|
// `canonicalJson` is core's, the one serializer every content hash in the framework uses. A private
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// Two installed copies of one registry-holding framework package, found before either registry
|
|
2
|
-
// asked anything.
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Two installed copies of one registry-holding framework package, found before either registry
|
|
2
|
+
// is asked anything.
|
|
3
|
+
//
|
|
4
|
+
// `@ultimat3/i18n`, `@ultimat3/policy` and `@ultimat3/entity` each keep their registry at MODULE
|
|
5
|
+
// scope, so a second module instance is a second, EMPTY registry: an app whose `packages/i18n`
|
|
6
|
+
// workspace pinned `@ultimat3/i18n@19.0.0` while its root had 19.1.0 registered every catalog into
|
|
7
|
+
// the workspace's copy, the CLI read the root's, and `x i18n check` answered
|
|
6
8
|
// `X_CATALOG_UNREGISTERED` with a fix that said to move a `defineCatalogs()` call that was already
|
|
7
9
|
// exactly where the fix said to put it (one adopter, 2026-09-05). The same split is the one
|
|
8
10
|
// `local-cli.ts` hands over for — a global `x` is a second copy of `@ultimat3/entity` — except this
|
|
@@ -225,7 +227,11 @@ const manifestOf = (from: string): string | undefined =>
|
|
|
225
227
|
* app-relative one an agent can open.
|
|
226
228
|
*/
|
|
227
229
|
export function duplicateCause(root: string, duplicate: DuplicateInstall): string {
|
|
228
|
-
|
|
230
|
+
// The package name is data: `constructor` is a published package, and the bare read answered
|
|
231
|
+
// `Object`'s own function into the cause.
|
|
232
|
+
const registry = Object.hasOwn(REGISTRY_PACKAGES, duplicate.pkg)
|
|
233
|
+
? REGISTRY_PACKAGES[duplicate.pkg]
|
|
234
|
+
: 'registry';
|
|
229
235
|
const copies = duplicate.copies.map((copy) => renderCopy(root, copy)).join(' and ');
|
|
230
236
|
return (
|
|
231
237
|
`${duplicate.copies.length} copies of ${duplicate.pkg} are installed: ${copies} — each is ` +
|
package/src/error-contract.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
// The error contract, enforced (axiom 3:
|
|
1
|
+
// The error contract, enforced (axiom 3): every `fix:` executable and every code documented,
|
|
2
|
+
// decided before the code runs.
|
|
3
|
+
//
|
|
2
4
|
// Axiom 4 says an error is an instruction, so a `fix:` an agent cannot act on is a defect in the
|
|
3
5
|
// error, not a matter of taste — and a code no reference page documents strands whoever hits it.
|
|
4
6
|
// Both halves are decidable before the code runs, which is why they are a gate step and not a
|
|
5
7
|
// runtime assertion nobody sees until the failure they describe has already happened.
|
|
6
8
|
|
|
7
|
-
// `join` is `node:`-only by necessity: Bun exposes no path-join primitive.
|
|
9
|
+
// why: `join` is `node:`-only by necessity: Bun exposes no path-join primitive.
|
|
8
10
|
import { join } from 'node:path';
|
|
9
11
|
import { ERROR_DOCS_URL } from '@ultimat3/core';
|
|
10
12
|
import { citedCommandProblem, loadCommandCatalog } from './fix-command';
|
package/src/error-fixes.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
// Every `X_*` code's REAL `fix:`, read off the throw site that raises it.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Every `X_*` code's REAL `fix:`, read off the throw site that raises it.
|
|
2
|
+
//
|
|
3
|
+
// `x errors explain` used to answer `x verify --json` for every code the CLI does not own — 327 of
|
|
4
|
+
// 378 — which is a shrug, not an instruction. The framework already writes an executable fix at
|
|
5
|
+
// each throw site and the `errors` gate step already proves each one runnable, so the answer is to
|
|
6
|
+
// project that text rather than to restate it in a second table nobody keeps current (axiom 2).
|
|
6
7
|
|
|
7
|
-
// Bun ships no path join: the scan needs an absolute path per globbed, scope-relative entry.
|
|
8
|
+
// why: Bun ships no path join: the scan needs an absolute path per globbed, scope-relative entry.
|
|
8
9
|
import { join } from 'node:path';
|
|
9
10
|
import { staticFix } from './error-contract';
|
|
10
11
|
import { frameworkScopeDir } from './framework-scope';
|
package/src/error-unthrown.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
// A registered code nothing constructs
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// A registered code nothing constructs, reported unless listed in `UNTHROWN_CODES`.
|
|
2
|
+
//
|
|
3
|
+
// The registry and the reference keep a shipped code alive forever — which is right — and that is
|
|
4
|
+
// exactly why a code can outlive its last thrower with no gate noticing: `X_RPC_FAILED` sat
|
|
5
|
+
// registered and documented as live after the transport change took its only throw site away. It
|
|
6
|
+
// has to be LISTED as unthrown (`UNTHROWN_CODES`), or this reports it.
|
|
6
7
|
|
|
8
|
+
// why: Bun ships no path API; `join` builds the absolute path of each scanned file.
|
|
7
9
|
import { join } from 'node:path';
|
|
8
10
|
import { ERROR_DOCS_URL, maskLiterals, stripComments } from '@ultimat3/core';
|
|
9
11
|
import { RESERVED_HEADING } from './error-contract';
|
package/src/errors.ts
CHANGED
|
@@ -17,7 +17,7 @@ export class UnknownCommandError extends UltimateError {
|
|
|
17
17
|
super({
|
|
18
18
|
code: 'X_CLI_UNKNOWN_COMMAND',
|
|
19
19
|
cause: `"x ${input.path}" is not a command (known: ${input.known.join(', ')})${input.why === undefined ? '' : ` — ${input.why}`}`,
|
|
20
|
-
fix: input.suggestion === undefined ? 'x help' : `x ${input.suggestion}`,
|
|
20
|
+
fix: input.suggestion === undefined ? 'x help' : `x ${quoteArg(input.suggestion.split(' '))}`,
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -32,7 +32,7 @@ export class BadFlagError extends UltimateError {
|
|
|
32
32
|
super({
|
|
33
33
|
code: 'X_CLI_BAD_FLAG',
|
|
34
34
|
cause: `--${input.flag} on "x ${input.command}": ${input.reason}`,
|
|
35
|
-
fix: input.fix ?? `x ${input.command} --help`,
|
|
35
|
+
fix: input.fix ?? `x ${quoteArg(input.command.split(' '))} --help`,
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -111,7 +111,7 @@ export class MissingSubcommandError extends UltimateError {
|
|
|
111
111
|
super({
|
|
112
112
|
code: 'X_CLI_BAD_FLAG',
|
|
113
113
|
cause: `"x ${input.command}" takes a subcommand and got none (one of: ${input.known.join(', ')})`,
|
|
114
|
-
fix: `x help ${input.command}`,
|
|
114
|
+
fix: `x help ${quoteArg(input.command.split(' '))}`,
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
}
|
|
@@ -245,7 +245,7 @@ export class CatalogExistsError extends UltimateError {
|
|
|
245
245
|
super({
|
|
246
246
|
code: 'X_GENERATE_CONFLICT',
|
|
247
247
|
cause: `${input.path} already exists`,
|
|
248
|
-
fix: `x i18n sync ${input.locale}`,
|
|
248
|
+
fix: `x i18n sync ${quoteArg(input.locale)}`,
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
251
|
}
|
|
@@ -277,7 +277,7 @@ export class ErrorCodeUnknownError extends UltimateError {
|
|
|
277
277
|
fix:
|
|
278
278
|
input.suggestion === undefined
|
|
279
279
|
? 'x errors list --json'
|
|
280
|
-
: `x errors explain ${input.suggestion}`,
|
|
280
|
+
: `x errors explain ${quoteArg(input.suggestion)}`,
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
283
|
}
|
|
@@ -302,8 +302,8 @@ export class DeclarationUnknownError extends UltimateError {
|
|
|
302
302
|
cause: `no ${input.singular} named "${input.name}" is registered (${input.known.length} known)`,
|
|
303
303
|
fix:
|
|
304
304
|
input.suggestion === undefined
|
|
305
|
-
? `x ${input.kind} list --json`
|
|
306
|
-
: `x ${input.kind} ${input.verb ?? 'show'} ${input.suggestion}`,
|
|
305
|
+
? `x ${quoteArg(input.kind)} list --json`
|
|
306
|
+
: `x ${quoteArg(input.kind)} ${quoteArg(input.verb ?? 'show')} ${quoteArg(input.suggestion)}`,
|
|
307
307
|
});
|
|
308
308
|
}
|
|
309
309
|
}
|
|
@@ -332,7 +332,7 @@ export class FixTargetUnknownError extends UltimateError {
|
|
|
332
332
|
fix:
|
|
333
333
|
input.suggestion === undefined
|
|
334
334
|
? 'x routes --json # every registered route file, app-root-relative'
|
|
335
|
-
: `x fix boundary ${input.suggestion}`,
|
|
335
|
+
: `x fix boundary ${quoteArg(input.suggestion)}`,
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
}
|
|
@@ -347,7 +347,7 @@ export class IslandBuildFailedError extends UltimateError {
|
|
|
347
347
|
super({
|
|
348
348
|
code: 'X_BUILD_FAILED',
|
|
349
349
|
cause: `${input.file} is an island entry point and would not bundle: ${input.logs}`,
|
|
350
|
-
fix: `bun build --target browser ${input.file}`,
|
|
350
|
+
fix: `bun build --target browser ${quoteArg(input.file)}`,
|
|
351
351
|
});
|
|
352
352
|
}
|
|
353
353
|
}
|
|
@@ -450,10 +450,11 @@ export class PortInvalidError extends UltimateError {
|
|
|
450
450
|
/** `name` so the scrape port reports itself; the code stays one, because the fault is one. */
|
|
451
451
|
constructor(input: { value: string; name?: string }) {
|
|
452
452
|
const name = input.name ?? 'PORT';
|
|
453
|
+
const example = quoteArg(`${name}=${name === 'PORT' ? 3000 : 9090}`);
|
|
453
454
|
super({
|
|
454
455
|
code: 'X_PORT_INVALID',
|
|
455
456
|
cause: `${name}="${input.value}" is not a TCP port number between 0 and 65535`,
|
|
456
|
-
fix: `docker run -e ${
|
|
457
|
+
fix: `docker run -e ${example} my-app:latest`,
|
|
457
458
|
});
|
|
458
459
|
}
|
|
459
460
|
}
|
package/src/fix-imports.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// `packages/ui/src/errors.ts` and every fix it is handed is written in `icons/build-icons.ts`.
|
|
3
3
|
// One specifier, one file read, one parameter position — deliberately still not `tsc`.
|
|
4
4
|
|
|
5
|
-
// `dirname`/`join` are `node:`-only by necessity: Bun exposes no path-join primitive.
|
|
5
|
+
// why: `dirname`/`join` are `node:`-only by necessity: Bun exposes no path-join primitive.
|
|
6
6
|
import { dirname, join } from 'node:path';
|
|
7
7
|
import { endOfLiteral, maskLiterals } from '@ultimat3/core';
|
|
8
8
|
import type { FixHelper } from './fix-scan';
|
package/src/flag-number.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { UltimateError } from '@ultimat3/core';
|
|
|
7
7
|
import { BadFlagError } from './errors';
|
|
8
8
|
import type { ParsedArgs } from './parse';
|
|
9
9
|
import { flagString } from './parse';
|
|
10
|
+
import { quoteArg } from './shell-quote';
|
|
10
11
|
|
|
11
12
|
export interface IntFlag {
|
|
12
13
|
readonly name: string;
|
|
@@ -93,7 +94,7 @@ class SyncPortUnavailableError extends UltimateError {
|
|
|
93
94
|
super({
|
|
94
95
|
code: 'X_PORT_INVALID',
|
|
95
96
|
cause: `the sync role binds PORT + 1, and PORT=${input.port} is the top of the range — it would ask for ${input.port + 1}, which is not a TCP port`,
|
|
96
|
-
fix: `x dev --port ${neighbouringPort(input.port)} # leaves ${PORT_RANGE.max} free for the sync node`,
|
|
97
|
+
fix: `x dev --port ${quoteArg(String(neighbouringPort(input.port)))} # leaves ${PORT_RANGE.max} free for the sync node`,
|
|
97
98
|
meta: { port: input.port },
|
|
98
99
|
});
|
|
99
100
|
}
|
package/src/flag-reads.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// plan JSON, where nothing read the field; that flag is deleted rather than wired, and a second
|
|
8
8
|
// one of its shape would pass here too.
|
|
9
9
|
|
|
10
|
-
// `join`/`relative` are `node:`-only by necessity: Bun exposes no path-join primitive.
|
|
10
|
+
// why: `join`/`relative` are `node:`-only by necessity: Bun exposes no path-join primitive.
|
|
11
11
|
import { join, relative } from 'node:path';
|
|
12
12
|
import { ERROR_DOCS_URL, stripComments } from '@ultimat3/core';
|
|
13
13
|
import type { Finding } from './output';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// The three ways a boot meets the framework schema (plan 101, s1-con #5):
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// `
|
|
1
|
+
// The three ways a boot meets the framework schema (plan 101, s1-con #5): locked apply, verify
|
|
2
|
+
// only, or ensure — apply only when this build is absent from the stamp.
|
|
3
|
+
//
|
|
4
|
+
// `applyLockedSchema` runs the DDL in ONE transaction behind the migration advisory lock with a
|
|
5
|
+
// bounded `lock_timeout`, then stamps the build; `verifySchema` (`framework-schema-verify.ts`) runs
|
|
6
|
+
// none; `ensureSchema` reads the stamp and applies only when this build is absent from it. Which
|
|
7
|
+
// boot takes which is `runtime-queue.ts`'s `SchemaMode`.
|
|
6
8
|
|
|
7
9
|
import { frameworkVersion, logger } from '@ultimat3/core';
|
|
8
10
|
import type { DbClient } from '@ultimat3/db';
|
package/src/framework-scope.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// the docs `x docs` quotes and the `fix:` lines `x errors explain` projects come from the same
|
|
4
4
|
// directory or they describe different builds.
|
|
5
5
|
|
|
6
|
-
// `node:fs`/`node:path` because Bun ships neither: `dirname` walks a resolved module up to the
|
|
6
|
+
// why: `node:fs`/`node:path` because Bun ships neither: `dirname` walks a resolved module up to the
|
|
7
7
|
// directory that owns it, `basename` names the two segments the store layout is recognised by,
|
|
8
8
|
// and `existsSync` is what says which directory is really there.
|
|
9
9
|
import { existsSync } from 'node:fs';
|
package/src/generate-files.ts
CHANGED
|
@@ -335,7 +335,7 @@ export function generate(options: GenerateOptions): readonly GeneratedFile[] {
|
|
|
335
335
|
default:
|
|
336
336
|
throw new NotImplementedError({
|
|
337
337
|
cause: `generator "${String(options.kind)}" is not implemented in this build`,
|
|
338
|
-
fix: `x g ${GENERATORS.join('
|
|
338
|
+
fix: `x help g # one of: ${GENERATORS.join(', ')}`,
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
341
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
// Everything `x g` edits OUTSIDE the files it creates, in the one order they have to happen
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Everything `x g` edits OUTSIDE the files it creates, in the one order they have to happen,
|
|
2
|
+
// over one disk seam so a real run and a dry run are the same code.
|
|
3
|
+
//
|
|
4
|
+
// In order: a declared permission granted to a role, a primitive listed in `defineApi`, an entity
|
|
5
|
+
// added to the typed handle, an `--admin` override wired, a contract test's exercise entry
|
|
6
|
+
// declared, each new workspace edge declared, and every catalog made selectable. One function over
|
|
7
|
+
// one disk seam, so a real run and a dry run are the same code — and the dry run's list of touched
|
|
8
|
+
// files is what the run touches, not a second guess at it.
|
|
6
9
|
|
|
7
10
|
import { registerAdminResources } from './admin-registration';
|
|
8
11
|
import { registerGeneratedPrimitives } from './api-registration';
|
package/src/generate-kinds.ts
CHANGED
|
@@ -61,7 +61,7 @@ export function assertSurfaceSupported(kind: Generator, surface: Surface, name:
|
|
|
61
61
|
reason: 'a resource slice is app-surface — site/ ships 0kb JS and may not import app/',
|
|
62
62
|
// The caller's own name, not `<name>`: a `fix:` is copied and run verbatim, and `x g resource
|
|
63
63
|
// <name>` is a shell redirect (`bash: name: No such file or directory`), not a command.
|
|
64
|
-
fix: `x g resource ${name} && x g route ${name} --surface site`,
|
|
64
|
+
fix: `x g resource ${quoteArg(name)} && x g route ${quoteArg(name)} --surface site`,
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -134,7 +134,7 @@ export function readSurface(raw: string | undefined, kind: Generator, name: stri
|
|
|
134
134
|
flag: 'surface',
|
|
135
135
|
command: 'g',
|
|
136
136
|
reason: `"${raw}" is not a surface (site, app)`,
|
|
137
|
-
fix: `x g ${kind} ${name} --surface app`,
|
|
137
|
+
fix: `x g ${quoteArg(kind)} ${quoteArg(name)} --surface app`,
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
|
package/src/generate-shadow.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// A generator name whose type spelling the emitted code ALSO uses as a global or a
|
|
2
|
-
//
|
|
1
|
+
// A generator name whose type or value spelling the emitted code ALSO uses as a global or a
|
|
2
|
+
// local alias, decided on the planned files themselves.
|
|
3
|
+
//
|
|
4
|
+
// A type: `x g resource promise` imports `type { Promise }` beside `Promise<Row>`, and `row` writes
|
|
3
5
|
// `type Row = Row`. Decided on the planned files themselves, so a template that starts using
|
|
4
|
-
// another global is covered the day it does — and the names that clash nowhere stay allowed.
|
|
5
|
-
//
|
|
6
|
+
// another global is covered the day it does — and the names that clash nowhere stay allowed. The
|
|
7
|
+
// same for a VALUE: `x g job job` imports `{ job }` from `@ultimat3/jobs` and declares
|
|
6
8
|
// `export const job = job(…)` beside it, which is TS2440 in the module the run just wrote.
|
|
7
9
|
|
|
8
10
|
import { BadFlagError } from './errors';
|
package/src/generate-sibling.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// Whether a feature's `entity.ts` makes the next `x g entity --feature` a SIBLING
|
|
2
|
-
// (`entity-<name>.ts`)
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
2
|
+
// (`entity-<name>.ts`), decided conservatively on what the file READABLY declares.
|
|
3
|
+
//
|
|
4
|
+
// Decided on what the file READABLY declares, and conservatively: the sibling path skips the
|
|
5
|
+
// conflict on `entity.ts`, so taking the same table for "another one" — because it is spelled as a
|
|
6
|
+
// template literal, or held in a constant — wrote a second module for one table where the run
|
|
7
|
+
// should have refused.
|
|
6
8
|
|
|
7
9
|
import { endOfLiteral, maskLiterals, QUOTES } from '@ultimat3/core';
|
|
8
10
|
import { names } from './templates/naming';
|
package/src/gh-target.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { t } from '@ultimat3/schema';
|
|
|
7
7
|
import { BadFlagError } from './errors';
|
|
8
8
|
import type { GhHost } from './gh';
|
|
9
9
|
import { GhFailedError, ghJson } from './gh';
|
|
10
|
+
import { quoteArg } from './shell-quote';
|
|
10
11
|
|
|
11
12
|
/** `owner/name`, split once so a caller never re-splits it and never re-joins it wrong. */
|
|
12
13
|
export interface GhRepo {
|
|
@@ -53,14 +54,14 @@ export async function resolveRepo(
|
|
|
53
54
|
flag: 'repo',
|
|
54
55
|
command,
|
|
55
56
|
reason: `"${flag}" is not an owner/name repository reference`,
|
|
56
|
-
fix: `x ${command} --repo developerz-ai/ultimate --json`,
|
|
57
|
+
fix: `x ${quoteArg(command.split(' '))} --repo developerz-ai/ultimate --json`,
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
60
|
return repoOf(flag);
|
|
60
61
|
}
|
|
61
62
|
const viewed = await ghJson(host, ['repo', 'view', '--json', 'nameWithOwner'], REPO_VIEW, {
|
|
62
63
|
label: 'gh repo view',
|
|
63
|
-
fix: `x ${command} --repo developerz-ai/ultimate --json`,
|
|
64
|
+
fix: `x ${quoteArg(command.split(' '))} --repo developerz-ai/ultimate --json`,
|
|
64
65
|
});
|
|
65
66
|
return repoOf(viewed.nameWithOwner);
|
|
66
67
|
}
|
package/src/guards.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// every guard the framework ships (`guards-built-in.ts`). The framework decides what a guard IS —
|
|
4
4
|
// a function returning findings, held to the error contract — and nothing about what it checks.
|
|
5
5
|
|
|
6
|
-
// Bun ships no equivalent for either: `join` builds the host-separator path, and
|
|
7
|
-
// the only spelling of an absolute path `import()` accepts on every host.
|
|
6
|
+
// why: Bun ships no equivalent for either: `join` builds the host-separator path, and
|
|
7
|
+
// `pathToFileURL` is the only spelling of an absolute path `import()` accepts on every host.
|
|
8
8
|
import { join } from 'node:path';
|
|
9
9
|
import { pathToFileURL } from 'node:url';
|
|
10
10
|
import { ERROR_DOCS_URL, renderCauseValue, renderThrowable } from '@ultimat3/core';
|
|
@@ -25,6 +25,7 @@ export { GUARD_DIR, guardPaths } from './guards-paths';
|
|
|
25
25
|
|
|
26
26
|
import { vendoredCopy, vendoredFinding } from './guards-vendored';
|
|
27
27
|
import type { Finding } from './output';
|
|
28
|
+
import { quoteArg } from './shell-quote';
|
|
28
29
|
import { readVerifyFloor } from './verify-floor';
|
|
29
30
|
import type { GuardBaseline } from './verify-guard-baseline';
|
|
30
31
|
import { guardNameOf, judgeGuardBaseline, orphanedBaselineFindings } from './verify-guard-baseline';
|
|
@@ -151,7 +152,7 @@ const notAGuard = (path: string, exported: unknown): Finding => {
|
|
|
151
152
|
const notADirectory: Finding = {
|
|
152
153
|
code: 'X_GUARD_INVALID',
|
|
153
154
|
cause: `${GUARD_DIR} is not a directory, so none of this app's own guards can run beside the shipped ones`,
|
|
154
|
-
fix: `mv ${GUARD_DIR} ${GUARD_DIR}.txt && mkdir ${GUARD_DIR} && x verify --only boundaries --json # ${GUARD_DIR}/ is the directory the gate discovers; a rule of yours goes in it as ${GUARD_DIR}/<name>.ts`,
|
|
155
|
+
fix: `mv ${quoteArg(GUARD_DIR)} ${quoteArg(GUARD_DIR)}.txt && mkdir ${quoteArg(GUARD_DIR)} && x verify --only boundaries --json # ${GUARD_DIR}/ is the directory the gate discovers; a rule of yours goes in it as ${GUARD_DIR}/<name>.ts`,
|
|
155
156
|
docs: ERROR_DOCS_URL,
|
|
156
157
|
at: GUARD_DIR,
|
|
157
158
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
// `x g entity` / `x g resource` hand the entity they wrote to the app's typed database handle.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// `x g entity` / `x g resource` hand the entity they wrote to the app's typed database handle.
|
|
2
|
+
//
|
|
3
|
+
// The generated `repo.ts` reads `db.<table>`, and a table is on the handle only when its entity is
|
|
4
|
+
// in the set `packages/db/src/client.ts` passes to `database()` — an edit nothing made, so the repo
|
|
4
5
|
// did not compile. Performed here; where the file is not the scaffold's shape, the finding names
|
|
5
6
|
// the two lines.
|
|
6
7
|
|
package/src/i18n-audit.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// key sets. No CLI shapes and no msg() — an app root in, plain data out, so every path here is
|
|
3
3
|
// testable without a ParsedArgs or a rendered message.
|
|
4
4
|
|
|
5
|
-
// `node:` and not Bun: Bun
|
|
6
|
-
// `catalogs/` directory reads as "nothing shipped" instead of a throw
|
|
7
|
-
// `join` builds the absolute path `Bun.file` reads; `posixRelative` turns it
|
|
8
|
-
// root-relative POSIX shape every CLI-reported path is keyed by.
|
|
5
|
+
// why: `node:` and not Bun: `Bun.file().exists()` answers false for a directory, and `existsSync`
|
|
6
|
+
// is how a missing `catalogs/` directory reads as "nothing shipped" instead of a throw; Bun has no
|
|
7
|
+
// path API at all — `join` builds the absolute path `Bun.file` reads; `posixRelative` turns it
|
|
8
|
+
// back into the root-relative POSIX shape every CLI-reported path is keyed by.
|
|
9
9
|
import { existsSync } from 'node:fs';
|
|
10
10
|
import { join } from 'node:path';
|
|
11
11
|
import { DEFAULT_LOCALE, renderThrowable } from '@ultimat3/core';
|
package/src/i18n-registration.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// Every finding about an app's strings, and the one composition `x i18n check` and `x verify`'s
|
|
2
2
|
// `i18n` step both report — two callers, one answer, so the command and the gate can never
|
|
3
|
-
// disagree.
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// disagree.
|
|
4
|
+
//
|
|
5
|
+
// The runtime half is here because nothing else could ask it: `i18n-audit.ts` compares source
|
|
6
|
+
// against files on disk and was green for every string of a shipped app whose catalog module
|
|
7
|
+
// nothing imported (issue #249).
|
|
6
8
|
|
|
7
9
|
// why: Bun ships no path API, so `join` is the only way to reach the app's own i18n module on
|
|
8
10
|
// the host's separator.
|
|
@@ -30,6 +32,7 @@ import { localeParityFindings } from './i18n-locale-parity';
|
|
|
30
32
|
import { mailPreviewFindings } from './mail-preview-findings';
|
|
31
33
|
import type { Finding } from './output';
|
|
32
34
|
import { findingFrom } from './output';
|
|
35
|
+
import { quoteArg } from './shell-quote';
|
|
33
36
|
import { CATALOG_ROOT, catalogPath } from './templates/locales';
|
|
34
37
|
|
|
35
38
|
/** The one package this check probes for a duplicate: its registry is the one it reads. */
|
|
@@ -212,7 +215,7 @@ export function unregisteredFix(
|
|
|
212
215
|
// report a registered locale as unregistered, which is the direction that costs trust.
|
|
213
216
|
if (index.includes(`${CATALOG_ROOT.split('/').pop() ?? 'catalogs'}/${locale}.json`)) return {};
|
|
214
217
|
return {
|
|
215
|
-
fix: `x i18n sync ${locale} # re-derives ${APP_CATALOGS_PATH} from the catalogs on disk`,
|
|
218
|
+
fix: `x i18n sync ${quoteArg(locale)} # re-derives ${APP_CATALOGS_PATH} from the catalogs on disk`,
|
|
216
219
|
};
|
|
217
220
|
}
|
|
218
221
|
|
package/src/import-closure.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
// The modules a set of entry files can EXECUTE, followed name by name through barrels.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
1
|
+
// The modules a set of entry files can EXECUTE, followed name by name through barrels.
|
|
2
|
+
//
|
|
3
|
+
// A package barrel re-exports its whole surface by name (the house forbids `export *`), so a
|
|
4
|
+
// closure taken module by module reaches every server file of every package an island touches —
|
|
5
|
+
// `@ultimat3/action`'s barrel reaches `http.ts` — while a bundler with honest `sideEffects` keeps
|
|
6
|
+
// only the modules the imported NAMES live in. This follows the names, which is what makes
|
|
7
|
+
// "browser-reachable" a question with a useful answer instead of "everything".
|
|
7
8
|
//
|
|
8
9
|
// Pure over an injected reader, so a test's fixture tree is a Map rather than files on disk.
|
|
9
10
|
|