@ultimat3/cli 31.32.0 → 31.34.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 +1 -1
- 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-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/cmd-auth.ts +5 -4
- package/src/cmd-build.ts +2 -0
- package/src/cmd-ci.ts +8 -5
- package/src/cmd-clean.ts +9 -6
- 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 +1 -0
- 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 +5 -4
- package/src/cmd-jobs.ts +3 -2
- package/src/cmd-manifest.ts +1 -0
- package/src/cmd-new.ts +2 -0
- package/src/cmd-pr.ts +7 -6
- package/src/cmd-registries.ts +5 -4
- package/src/cmd-secrets.ts +1 -1
- package/src/cmd-shot.ts +1 -0
- package/src/cmd-tasks.ts +7 -5
- package/src/cmd-test.ts +8 -6
- 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 +1 -1
- package/src/dev-child-watch.ts +7 -6
- package/src/dev-environment.ts +6 -5
- package/src/dev-lock.ts +3 -0
- 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 +7 -5
- package/src/error-contract.ts +4 -2
- package/src/error-fixes.ts +7 -6
- package/src/error-unthrown.ts +7 -5
- package/src/fix-imports.ts +1 -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-follow-ups.ts +8 -5
- package/src/generate-shadow.ts +6 -4
- package/src/generate-sibling.ts +6 -4
- package/src/guards.ts +2 -2
- package/src/handle-registration.ts +4 -3
- package/src/i18n-audit.ts +4 -4
- package/src/i18n-registration.ts +5 -3
- 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-realtime-state.ts +6 -5
- package/src/island-realtime.ts +8 -6
- 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-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/path-segments.ts +2 -1
- package/src/prerender.ts +4 -4
- 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/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/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 +4 -3
- 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 +2 -2
- 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 +6 -7
- package/src/verify-pace.ts +3 -1
- package/src/verify-role-load.ts +8 -5
- 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 +2 -0
- package/src/workspace-graph.ts +4 -3
- package/src/write-line.ts +1 -1
package/src/runtime-overrides.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// The one place a host hands the framework a driver
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// The one place a host hands the framework a driver: `RuntimeOverrides`.
|
|
2
|
+
//
|
|
3
|
+
// `ServeOptions` had `{ root, env, role, port, metricsPort }` and nothing else, so the ONLY way to
|
|
4
|
+
// install a driver was to call an ambient setter from an app module — which `loadApp` imports
|
|
5
|
+
// *after* `startServices` has already captured its own. This type is the seam that removes the need
|
|
6
|
+
// to, and every field is read exactly once, as the first arm of
|
|
7
|
+
// `overrides?.x ?? <the env-selected default>`.
|
|
6
8
|
|
|
7
9
|
import type { IdempotencyStore, MeterStore } from '@ultimat3/action/adapter';
|
|
8
10
|
import type { Embedder, Gateway, SemanticCacheFactory } from '@ultimat3/ai/adapter';
|
package/src/runtime-queue.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
// The database and the job queue, started together and released together.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// The database and the job queue, started together and released together.
|
|
2
|
+
//
|
|
3
|
+
// Split from `runtime-services.ts` because `x jobs` needs exactly this pair and nothing else — and
|
|
4
|
+
// because a process that installs ambient accessors (`db()`, `jobDriver()`, the jobs facade, the
|
|
5
|
+
// event bus) must have one place that takes them all back, or the next command in the same process
|
|
6
|
+
// inherits a driver over a closed socket.
|
|
6
7
|
|
|
7
8
|
import {
|
|
8
9
|
type PostgresIdempotencyStore,
|
package/src/script-csp.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
// Every inline `<script>` body a served process can put in a document, as the `script-src`
|
|
2
|
-
// that admit it.
|
|
1
|
+
// Every inline `<script>` body a served process can put in a document, as the `script-src`
|
|
2
|
+
// sources that admit it.
|
|
3
|
+
//
|
|
4
|
+
// The mirror of `style-csp.ts`, and needed for the same reason: `script-src` was
|
|
3
5
|
// `'self' 'wasm-unsafe-eval'` while every document carrying an island shipped the hydration runtime
|
|
4
6
|
// INLINE, so under the enforced policy a container serves (`dev: false`) no island ever booted —
|
|
5
7
|
// invisible in `x dev`, where the policy is report-only.
|
package/src/secrets-rotation.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// A master-key rotation in an order a crash cannot turn into data loss.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// committed file
|
|
5
|
-
//
|
|
1
|
+
// A master-key rotation in an order a crash cannot turn into data loss.
|
|
2
|
+
//
|
|
3
|
+
// The new key is STAGED at `<key>.next` (owner-only: 0600, and an ACL on Windows) before anything
|
|
4
|
+
// is sealed with it, the committed file is sealed second, and the rename that makes the new key
|
|
5
|
+
// live is last. Interrupted anywhere, some key on disk opens the committed file — and
|
|
6
|
+
// `recoverRotation`, which every `x secrets` command runs first, finishes or abandons the move by
|
|
7
|
+
// asking the file which key it answers to.
|
|
6
8
|
|
|
7
9
|
import { existsSync, readFileSync, rmSync } from 'node:fs'; // why: Bun has no sync exists/remove; the key is WRITTEN and RENAMED only by core's owner-only writers.
|
|
8
10
|
import type { MasterKeyRef, SecretValues } from '@ultimat3/core';
|
package/src/serve-boot.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
// The serving roles' boot: the services started, the app loaded, its route table built, the
|
|
2
|
-
// started.
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
1
|
+
// The serving roles' boot: the services started, the app loaded, its route table built, the
|
|
2
|
+
// roles started.
|
|
3
|
+
//
|
|
4
|
+
// Behind ONE `await import()` in `serve.ts` (the entry points), so `ROLE=migrate` loads none of it;
|
|
5
|
+
// the rules that file's header states — the SAME boot `x dev` runs, minus the watcher, `/_x` and
|
|
6
|
+
// `dev: true` — are this file's. A role imports what it runs: the web surface (`serve-web.ts`) and
|
|
7
|
+
// the manifest projection are behind `await import()` in turn, so a worker's module graph holds
|
|
8
|
+
// neither.
|
|
7
9
|
|
|
8
10
|
import type { DrainConfig, LifecycleOptions, Role } from '@ultimat3/core';
|
|
9
11
|
import { configureLifecycle, logger, UltimateError } from '@ultimat3/core';
|
package/src/serve.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
// What a container starts
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// `
|
|
5
|
-
//
|
|
1
|
+
// What a container starts: the role, the port and the interface — the same boot `x dev` runs,
|
|
2
|
+
// minus the watcher, `/_x` and `dev: true`.
|
|
3
|
+
//
|
|
4
|
+
// `apps/web/server.ts` is three lines that call `runRole`, so the boot a production process
|
|
5
|
+
// performs is framework code with tests rather than app code the author has to get right — and it
|
|
6
|
+
// is the SAME code `x dev` runs, minus the watcher, minus `/_x`, minus `dev: true`. The only
|
|
7
|
+
// production-shaped decisions live here: which role, which port, and which interface — every one by
|
|
8
|
+
// default, because a container is reached through a port mapping.
|
|
6
9
|
|
|
7
10
|
import { assertNoDevSecretsOutsideLocal, frameworkVersion, logger } from '@ultimat3/core';
|
|
8
11
|
import { assertNoSchemaDrift, checkDrift, migrate } from '@ultimat3/db';
|
package/src/server-barrels.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// A package barrel a browser must not import, and the entry it imports instead.
|
|
2
|
-
//
|
|
3
|
-
// `@ultimat3/entity
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// A package barrel a browser must not import, and the entry it imports instead.
|
|
2
|
+
//
|
|
3
|
+
// `@ultimat3/entity`'s barrel reaches the SQL renderer and `@ultimat3/db` — about a megabyte in an
|
|
4
|
+
// island — while `@ultimat3/entity/record` is the browser half. DERIVED from each manifest's
|
|
5
|
+
// `exports`: a package that publishes a `./record`, `./browser` or `./client` subpath has said its
|
|
6
|
+
// barrel is the server half, so a new browser entry enters this rule by being published, never by
|
|
7
|
+
// being listed here.
|
|
6
8
|
|
|
7
9
|
import { stripComments } from '@ultimat3/core';
|
|
8
10
|
import { lineIndex } from './ts-scan';
|
package/src/shot-theme.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
// The script a capture runs ahead of the document when a theme was ASKED for.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
1
|
+
// The script a capture runs ahead of the document when a theme was ASKED for.
|
|
2
|
+
//
|
|
3
|
+
// Since 20.2.0 the boot inlines a theme script (`@ultimat3/render`'s `themeScriptBody`) whose
|
|
4
|
+
// fallback is the app's `theme.defaultMode`, and only a stored choice under `THEME_STORAGE_KEY`
|
|
5
|
+
// beats it — so emulating `prefers-color-scheme` alone photographs a `defaultMode: 'dark'` app dark
|
|
6
|
+
// whatever was requested (issue #489). A requested theme is therefore stored as the visitor's
|
|
7
|
+
// CHOICE, on the page's origin, before the boot reads it: the picture is then what a visitor who
|
|
8
|
+
// chose that theme sees.
|
|
7
9
|
|
|
8
10
|
import { THEME_STORAGE_KEY } from '@ultimat3/core';
|
|
9
11
|
import type { ShotColorScheme } from './browser-launcher-port';
|
package/src/site-config.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// loader (`app-config-load.ts`).
|
|
5
5
|
|
|
6
6
|
import type { Environment, SeoRobotsGroup, SeoSitemapConfig, SiteFavicon } from '@ultimat3/core';
|
|
7
|
+
import { trimTrailingSlashes } from '@ultimat3/core';
|
|
7
8
|
import { loadAppConfig } from './app-config-load';
|
|
8
9
|
|
|
9
10
|
export interface SiteSettings {
|
|
@@ -39,7 +40,7 @@ export const NO_SITE_SETTINGS: SiteSettings = {
|
|
|
39
40
|
llms: true,
|
|
40
41
|
};
|
|
41
42
|
|
|
42
|
-
const trimSlash = (origin: string): string => origin
|
|
43
|
+
const trimSlash = (origin: string): string => trimTrailingSlashes(origin);
|
|
43
44
|
|
|
44
45
|
export async function loadSiteSettings(root: string): Promise<SiteSettings> {
|
|
45
46
|
const config = await loadAppConfig(root);
|
package/src/site-llms-pages.ts
CHANGED
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
// `siteLlms` never runs a page's `load` after the build stopped answering the app's own queries.
|
|
4
4
|
|
|
5
5
|
import type { Environment } from '@ultimat3/core';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
ctxOf,
|
|
8
|
+
DEFAULT_ENVIRONMENT,
|
|
9
|
+
runWithContext,
|
|
10
|
+
trimTrailingSlashes,
|
|
11
|
+
tryResolveEnvironment,
|
|
12
|
+
} from '@ultimat3/core';
|
|
7
13
|
import type { PrerenderEntry, RouteEntry } from '@ultimat3/render';
|
|
8
14
|
import { metaContextFor, routeDataFor, routeEntries } from '@ultimat3/render';
|
|
9
15
|
import { enumeratePrerenderEntries, fillPath } from '@ultimat3/render/server';
|
|
@@ -60,7 +66,7 @@ export async function pageRecords(
|
|
|
60
66
|
const records: RouteRecord[] = [];
|
|
61
67
|
for (const page of await (options.enumerate ?? enumeratePrerenderEntries)(entry)) {
|
|
62
68
|
const path = fillPath(entry.pattern.source, page.params);
|
|
63
|
-
const ctx = { url: `${options.baseUrl
|
|
69
|
+
const ctx = { url: `${trimTrailingSlashes(options.baseUrl)}${path}`, params: page.params };
|
|
64
70
|
const meta = await runWithContext(
|
|
65
71
|
ctxOf({ role: 'web', locale: options.defaultLocale }),
|
|
66
72
|
async () => entry.config.meta(metaContextFor(ctx, await routeDataFor(entry.config, ctx))),
|
package/src/source-list-edit.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
// Adding an entry to an array literal in a file the app owns, read off the MASKED source.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
1
|
+
// Adding an entry to an array literal in a file the app owns, read off the MASKED source.
|
|
2
|
+
//
|
|
3
|
+
// Every generator that grows a list — a role's `grants`, `definePermissions([…])`, a `defineApi`
|
|
4
|
+
// list — found its `]` with `indexOf` and its entries with a quote regex, so an apostrophe in a
|
|
5
|
+
// comment was a string delimiter and a `]` in one closed the list: `x g entity` rewrote a role
|
|
6
|
+
// map's comments into permissions. Here a comment and a literal's contents are never read as code,
|
|
7
|
+
// and an edit that does not read back as "the same list plus the new entries" is refused, not
|
|
8
|
+
// written.
|
|
7
9
|
|
|
8
10
|
import { maskLiterals, stripComments } from '@ultimat3/core';
|
|
9
11
|
import { wrapList } from './templates/wrap';
|
package/src/static-cards.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
// why: Bun exposes no path-join primitive, and every card path is relative to the export root.
|
|
7
7
|
import { join } from 'node:path';
|
|
8
|
-
import { probeImage, transformImageBytes } from '@ultimat3/core';
|
|
8
|
+
import { probeImage, transformImageBytes, trimTrailingSlashes } from '@ultimat3/core';
|
|
9
9
|
import { systemClock } from '@ultimat3/core/adapter';
|
|
10
10
|
import type { OpenGraphImage } from '@ultimat3/seo';
|
|
11
11
|
import type { ShotDriver } from './browser-launcher-port';
|
|
@@ -20,7 +20,7 @@ export const STATIC_CARD_DIR = '_og';
|
|
|
20
20
|
|
|
21
21
|
/** `/og/post/hello` → `/_og/og/post/hello.png`; `/` → `/_og/index.png`. */
|
|
22
22
|
export function cardUrl(capturePath: string): string {
|
|
23
|
-
const trimmed = capturePath
|
|
23
|
+
const trimmed = trimTrailingSlashes(capturePath);
|
|
24
24
|
return `/${STATIC_CARD_DIR}${trimmed === '' ? '/index' : trimmed}.png`;
|
|
25
25
|
}
|
|
26
26
|
|
package/src/static-report.ts
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
// state the same thing. A skipped route with no reason is what turned "the island did not mount"
|
|
4
4
|
// into a bug report about a page that had never been in `.x/static/` at all (#242).
|
|
5
5
|
|
|
6
|
-
// `node:` twice, and only where Bun answers nothing: Bun ships no path API, and
|
|
7
|
-
// deletes a report that may not be there without a branch. `existsSync` was a
|
|
8
|
-
// `Bun.file(path).json()` already rejects on a missing file, into the catch
|
|
6
|
+
// why: `node:` twice, and only where Bun answers nothing: Bun ships no path API, and
|
|
7
|
+
// `rm(…, { force })` deletes a report that may not be there without a branch. `existsSync` was a
|
|
8
|
+
// third and is gone — `Bun.file(path).json()` already rejects on a missing file, into the catch
|
|
9
|
+
// that answers `undefined`.
|
|
9
10
|
import { rm } from 'node:fs/promises';
|
|
10
11
|
import { join } from 'node:path';
|
|
11
12
|
import type { RenderMode } from '@ultimat3/core';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
// The app's HTTP authenticator, seen as the `sync` node's.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// The app's HTTP authenticator, seen as the `sync` node's.
|
|
2
|
+
//
|
|
3
|
+
// Until this file `sync-node.ts` was handed no `authenticate` by any host, so every socket the
|
|
4
|
+
// framework ever opened carried `actorId: null` — and the channel guard, the live-query gate, the
|
|
5
|
+
// presence entry and the per-tenant subscription cap all decided against an anonymous actor.
|
|
6
|
+
// Realtime was single-tenant by wiring, not by design.
|
|
6
7
|
|
|
7
8
|
import type { Actor, Clock } from '@ultimat3/core';
|
|
8
9
|
import { finiteCount, systemClock } from '@ultimat3/core';
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
// `x g admin:page <name>` — a screen the admin derives from nothing: a reconciliation fixer, a
|
|
2
|
-
// proxy health board, a deploy button.
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
2
|
+
// proxy health board, a deploy button.
|
|
3
|
+
//
|
|
4
|
+
// What the template has to get right is what it does NOT emit: no `defineRoute`, because `pages:`
|
|
5
|
+
// is the one thing that puts a page in the admin's route table and `guardedPage()` is the one thing
|
|
6
|
+
// that decides it. A scaffold that wrote a route declaration here would hand back the unguarded
|
|
7
|
+
// second way in that seam exists to close.
|
|
6
8
|
|
|
9
|
+
import { trimTrailingSlashes } from '@ultimat3/core';
|
|
7
10
|
import { ADMIN_FILE } from '../admin-registration';
|
|
8
11
|
import { catalogJson } from './catalog-json';
|
|
9
12
|
import { sortedImports } from './imports';
|
|
@@ -208,7 +211,7 @@ export function adminPageFiles(
|
|
|
208
211
|
): readonly GeneratedFile[] {
|
|
209
212
|
const name = kebab(rawName);
|
|
210
213
|
// Trailing slashes trimmed exactly as `islandFiles` does — one `--at`, one normalization.
|
|
211
|
-
const dir = (options.dir ?? DEFAULT_ADMIN_PAGE_DIR)
|
|
214
|
+
const dir = trimTrailingSlashes(options.dir ?? DEFAULT_ADMIN_PAGE_DIR);
|
|
212
215
|
return [
|
|
213
216
|
{
|
|
214
217
|
path: `${dir}/${name}.tsx`,
|
package/src/templates/admin.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
// `x g resource <name> --admin` — the per-entity admin override.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// `x g resource <name> --admin` — the per-entity admin override.
|
|
2
|
+
//
|
|
3
|
+
// `defineAdmin()` already serves list/detail/create/edit for the entity with nothing written; this
|
|
4
|
+
// file is only what an app author would otherwise hand-write on top — the list columns, a page
|
|
5
|
+
// size, and from there scopes, a row scope and computed columns. `admin-registration.ts` lists it
|
|
6
|
+
// under `resources:` in the app's `defineAdmin()` call in the same run, so nothing is left to wire.
|
|
6
7
|
|
|
7
8
|
import type { FeatureTarget } from './entity';
|
|
8
9
|
import { entityFiles } from './entity';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// The `animated-layout-property` guard `x new` ships: only `transform` and `opacity` animate
|
|
2
|
-
// free.
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// The `animated-layout-property` guard `x new` ships: only `transform` and `opacity` animate
|
|
2
|
+
// for free.
|
|
3
|
+
//
|
|
4
|
+
// Everything else — a `top`, a `width`, a `margin`, a `box-shadow` — costs the browser a layout or
|
|
5
|
+
// a paint on EVERY frame, on the same main thread the app's own JavaScript is on, and feeds the
|
|
6
|
+
// layout-shift metric while it does it. `transition: all` is worse than any single one of them: it
|
|
7
|
+
// animates properties nobody chose, including the ones that have not been written yet.
|
|
6
8
|
|
|
7
9
|
import { guardCode } from './guard';
|
|
8
10
|
import type { GeneratedFile } from './naming';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// The `focus-visible` guard `x new` ships: a stylesheet never takes the focus ring away and
|
|
2
|
-
// nothing in its place.
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// The `focus-visible` guard `x new` ships: a stylesheet never takes the focus ring away and
|
|
2
|
+
// leaves nothing in its place.
|
|
3
|
+
//
|
|
4
|
+
// `outline: none` is the single most-copied line on the web and it deletes the only thing telling a
|
|
5
|
+
// keyboard user where they are — WCAG 2.2 SC 2.4.11 and 2.4.13 ask for an indicator at least 2px
|
|
6
|
+
// around the control at 3:1 against what is behind it. Nothing in the gate could see it:
|
|
7
|
+
// `x verify`'s `seo` and `i18n` steps read pages, and lint reads TypeScript.
|
|
6
8
|
|
|
7
9
|
import { guardCode } from './guard';
|
|
8
10
|
import type { GeneratedFile } from './naming';
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
// The `image-dimensions` guard `x new` ships: an image reserves its box before its bytes
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// The `image-dimensions` guard `x new` ships: an image reserves its box before its bytes
|
|
2
|
+
// arrive, and the image a page is judged by is never `loading="lazy"`.
|
|
3
|
+
//
|
|
4
|
+
// An unsized `<img>` is the largest single contributor to Cumulative Layout Shift — the page
|
|
5
|
+
// reflows under the reader's finger the moment the bytes land — and the second half is its mirror
|
|
6
|
+
// image: a `loading="lazy"` on the image the page is judged by is a deliberate delay on the one
|
|
7
|
+
// paint the metric measures. Both are decidable from the attributes and nothing in the gate could
|
|
8
|
+
// see either.
|
|
6
9
|
|
|
7
10
|
import { guardCode } from './guard';
|
|
8
11
|
import type { GeneratedFile } from './naming';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
// The `island-without-states` guard `x new` ships
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// The `island-without-states` guard `x new` ships: an island with no sibling
|
|
2
|
+
// `<name>.island.states.ts` has never been seen in the states `x shot --island` photographs.
|
|
3
|
+
//
|
|
4
|
+
// It closes a loop the framework already built half of: `x shot --island <name>` photographs every
|
|
5
|
+
// state the states file declares — including the ones nobody can reach by clicking: a save the
|
|
4
6
|
// server refused, a read that came back empty, a label three times as long in the next locale. An
|
|
5
7
|
// island with no states file has never been seen in any of them, by a reviewer or by a model.
|
|
6
8
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// The `semantic-interactive` guard `x new` ships: an element that answers a click IS a control.
|
|
2
|
+
//
|
|
2
3
|
// The cheapest a11y win there is, and the one an agent undoes by reflex — WebAIM's annual survey of
|
|
3
4
|
// a million home pages finds pages using ARIA average ~41% MORE detected errors than pages using
|
|
4
5
|
// none, because `role="button"` is a PROMISE (Space, Enter, focus, disabled) and only the native
|
package/src/templates/island.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
// `x g island <name>` — the one file on a route that ships JavaScript.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// `x g island <name>` — the one file on a route that ships JavaScript.
|
|
2
|
+
//
|
|
3
|
+
// Not a ninth primitive and not a component generator: an island is a client ENTRY POINT, so what
|
|
4
|
+
// the scaffold has to get right is the filename (the bundler discovers by it), the `mount` export
|
|
5
|
+
// (the hydration runtime calls it by name) and what `mount` DOES — Solid's `render`, the one client
|
|
6
|
+
// shape the island build compiles. All three are pinned by the emitted test, which builds the chunk
|
|
7
|
+
// and mounts it.
|
|
6
8
|
|
|
9
|
+
import { trimTrailingSlashes } from '@ultimat3/core';
|
|
7
10
|
import type { GeneratedFile } from './naming';
|
|
8
11
|
import { camel, kebab, pascal } from './naming';
|
|
9
12
|
|
|
@@ -198,7 +201,7 @@ export const ${camel(name)}States = defineIslandStates({
|
|
|
198
201
|
|
|
199
202
|
export function islandFiles(rawName: string, options: IslandOptions): readonly GeneratedFile[] {
|
|
200
203
|
const name = kebab(rawName);
|
|
201
|
-
const dir = options.dir
|
|
204
|
+
const dir = trimTrailingSlashes(options.dir);
|
|
202
205
|
return [
|
|
203
206
|
{ path: `${dir}/${name}.island.tsx`, contents: islandSource(name) },
|
|
204
207
|
{ path: `${dir}/${name}.module.scss`, contents: islandStyle() },
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
// is not a smaller version of this — the island glob never discovers it, and a server render drops
|
|
4
4
|
// every `on*` prop (`packages/render/src/html.ts`) and reads each signal exactly once.
|
|
5
5
|
|
|
6
|
-
// Bun ships no path API, and the one arithmetic this file does is a specifier: the island's
|
|
7
|
-
// seen from the page's directory, which `island-bundle.ts` resolves the same way at build
|
|
6
|
+
// why: Bun ships no path API, and the one arithmetic this file does is a specifier: the island's
|
|
7
|
+
// path seen from the page's directory, which `island-bundle.ts` resolves the same way at build
|
|
8
|
+
// time.
|
|
8
9
|
import { posix } from 'node:path';
|
|
9
10
|
import { upToAppRoot } from './island';
|
|
10
11
|
import type { GeneratedFile, NameSet } from './naming';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
// `x g resource <name>`'s page: the plural route a slice is reached at
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
1
|
+
// `x g resource <name>`'s page: the plural route a slice is reached at — its rows in a
|
|
2
|
+
// `DataTable`, read a page at a time, and the slice's form island.
|
|
3
|
+
//
|
|
4
|
+
// It READS — a `<Hole>` calls the slice's own query a page at a time as the request's actor, after
|
|
5
|
+
// the shell left — renders the rows in a link-mode `DataTable` (loading, failed, empty, ready;
|
|
6
|
+
// paged by URL, no script), and mounts the slice's form island. `x g route` writes a page with a
|
|
7
|
+
// heading and nothing to read; a resource has rows and a form, and a page that showed neither was a
|
|
8
|
+
// slice nobody could reach without wiring it by hand.
|
|
7
9
|
|
|
8
10
|
import { sortedImports } from './imports';
|
|
9
11
|
import type { GeneratedFile, NameSet } from './naming';
|
package/src/templates/route.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// `x g route <path>` — a URL, its render mode, its metadata, its offline strategy and its budget.
|
|
2
|
+
//
|
|
2
3
|
// Two generated tests, because the gate types a test by its filename: `page.test.ts` pins metadata
|
|
3
4
|
// presence and the budget declaration on the `unit` step, `page.e2e.test.ts` pins the offline
|
|
4
5
|
// fallback on the `e2e` step. A route with no title is an SEO regression and a route with no
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
// The human-authored half of what `x new` writes: the READMEs, the agent-facing convention
|
|
2
|
-
// the bin/ scripts and the optional dev compose.
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// `
|
|
1
|
+
// The human-authored half of what `x new` writes: the READMEs, the agent-facing convention
|
|
2
|
+
// files, the bin/ scripts and the optional dev compose.
|
|
3
|
+
//
|
|
4
|
+
// Separated from the config half so neither file has to be scrolled to find the other — one file,
|
|
5
|
+
// one job applies to templates too. The image, its ignore file, the production topology and the
|
|
6
|
+
// deploy page are `scaffold-container.ts`; the `.claude/` harness that reads CLAUDE.md is
|
|
7
|
+
// `scaffold-claude.ts`; the one workflow is `github/ci.yml.ts`.
|
|
7
8
|
|
|
8
9
|
import { LINE_CEILING } from '../workspace-checks';
|
|
9
10
|
import { githubFiles } from './github/ci.yml';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// The two entry files a deploy needs — `apps/web/server.ts` and `apps/web/prerender.ts`.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// The two entry files a deploy needs — `apps/web/server.ts` and `apps/web/prerender.ts`.
|
|
2
|
+
//
|
|
3
|
+
// Split out of `scaffold-app.ts` because that file is the three SURFACES and these are neither:
|
|
4
|
+
// they are what a container starts and what a CDN is handed. Both are deliberately thin — which
|
|
5
|
+
// role a container is, which port it binds, how it drains and what a static build enumerates are
|
|
6
|
+
// the framework's answers, so an upgrade moves them without a codemod in every app that ever
|
|
7
|
+
// shipped.
|
|
6
8
|
|
|
7
9
|
import type { GeneratedFile } from './naming';
|
|
8
10
|
import { baseRuntimeFiles } from './scaffold-runtime-ports';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
// The two error pages `x new` writes — `apps/web/site/errors/404.html` and `500.html
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
1
|
+
// The two error pages `x new` writes — `apps/web/site/errors/404.html` and `500.html` —
|
|
2
|
+
// self-contained documents by construction.
|
|
3
|
+
//
|
|
4
|
+
// `packages/cli/src/error-pages.ts` serves them verbatim for those statuses, and the static export
|
|
5
|
+
// carries `404.html`. A 500 is answered when the app's own stylesheet may be the thing that failed,
|
|
6
|
+
// so nothing here links a bundle, loads a font or runs a script. The `<style>` body is hashed into
|
|
7
|
+
// `style-src` at boot (`error-page-csp.ts`), which is what lets the enforced policy a container
|
|
8
|
+
// sends admit it.
|
|
7
9
|
|
|
8
10
|
import type { GeneratedFile, NameSet } from './naming';
|
|
9
11
|
import { titleCase } from './naming';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// The REPO ROOT half of what `x new` writes: `app.config.ts`, the tooling configs, the committed
|
|
2
|
-
// env files — and the one list that names every other scaffold module in write order.
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
2
|
+
// env files — and the one list that names every other scaffold module in write order.
|
|
3
|
+
//
|
|
4
|
+
// Committed defaults only, so a fresh clone boots with `x dev` and no env scavenger hunt. Each
|
|
5
|
+
// workspace package owns its own files (`scaffold-<name>-package.ts`); docs and shims are
|
|
6
|
+
// scaffold-docs.ts, container files scaffold-container.ts.
|
|
6
7
|
|
|
7
8
|
import { ENV_EXAMPLE_PATH } from '@ultimat3/core';
|
|
8
9
|
import { REQUIRED_BUN } from '../app-root';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// The generated app's frame — `apps/web/shared/shell.tsx` over the catalog's `AppShell` — and
|
|
2
|
-
// one island the scaffold ships, the theme toggle.
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// The generated app's frame — `apps/web/shared/shell.tsx` over the catalog's `AppShell` — and
|
|
2
|
+
// the one island the scaffold ships, the theme toggle.
|
|
3
|
+
//
|
|
4
|
+
// Split out of `scaffold-app.ts` because that file is the three surfaces and this is the chrome
|
|
5
|
+
// every `app/` page sits inside. Before this the dashboard was an `<h1>` in a panel and the
|
|
6
|
+
// scaffold imported nothing from `@ultimat3/ui`; an app that starts from it now starts from a
|
|
7
|
+
// designed product, and deletes what it does not want.
|
|
6
8
|
|
|
7
9
|
import { sortedImports } from './imports';
|
|
8
10
|
import { upToAppRoot } from './island';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// The generated landing page — `apps/web/site/page.tsx` and its stylesheet and test.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// The generated landing page — `apps/web/site/page.tsx` and its stylesheet and test.
|
|
2
|
+
//
|
|
3
|
+
// Split out of `scaffold-app.ts` when it grew from an `<h1>` and a link into a hero: a dot-grid
|
|
4
|
+
// ground, an eyebrow, a balanced headline, a lede, two calls to action and three feature cards,
|
|
5
|
+
// every string a catalog key and every colour a token. Still 0kb: `render: 'static'`,
|
|
6
|
+
// `hydrate: 'never'`, no island, and it does not wear the app shell — see the page's own header
|
|
7
|
+
// comment.
|
|
6
8
|
|
|
7
9
|
import { sortedImports } from './imports';
|
|
8
10
|
import type { GeneratedFile, NameSet } from './naming';
|
package/src/test-housekeeping.ts
CHANGED
|
@@ -78,12 +78,9 @@ const defaultConnect = async (url: string): Promise<ProbeServer> => {
|
|
|
78
78
|
async function strayStateDirs(root: string): Promise<readonly string[]> {
|
|
79
79
|
const found: string[] = [];
|
|
80
80
|
const walk = async (dir: string, top: boolean): Promise<void> => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
} catch {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
81
|
+
// A directory that cannot be listed holds nothing this sweep may touch: skipped, not fatal.
|
|
82
|
+
const entries = await readdir(dir, { withFileTypes: true }).catch(() => undefined);
|
|
83
|
+
if (entries === undefined) return;
|
|
87
84
|
if (!top && entries.some((entry) => entry.isFile() && entry.name === APP_CONFIG_FILE)) return;
|
|
88
85
|
for (const entry of entries) {
|
|
89
86
|
if (!entry.isDirectory()) continue;
|