Repository navigation
Conversation
Auth and admin render every screen through the ui kit, but the scaffold
path never wired it: `urlcode init --with auth,admin` emitted
`authExtension({service, csrfKey, projectSha256})` and an extensions block
with no `ui` at all, and `--with auth,admin,ui` declared ui last. The
runtime activates extensions in the order `urlcode.yaml` declares them, so
ui has to come first.
Auth's scaffold now refuses a request whose `names` omit `ui` or place it
after `auth`, the way admin's already refuses a host without `auth`; admin
refuses the same way. Both host entries take the `ui` object the ui setup
defines, and `initAuthentication`/`initAdministration` compose ui's
fragments ahead of their own so the single-package initializers produce the
same ui-first layout.
Closes the first two source-evidence items in #217. Not addressed here:
`packages/ui/src/host/scaffold.ts` still passes `sources: []`, so auth's and
admin's catalogues are not registered with the kit, and there is no
generated-consumer regression showing a local template or copy override
reaching an auth or admin screen.
Note: this makes ui mandatory for the auth and admin scaffolds, so
`urlcode init --with auth` and `urlcode-auth init` no longer produce an
auth-only site. That is a deliberate tightening, not a runtime requirement:
`authExtension` still accepts an absent `ui` at activation.
Verified with `npm run verify` at the repo root (exit 0): core 523, ui 57,
auth 209, admin 69 tests, plus test:workspace-integration.
Co-Authored-By: Claude Opus 5 <[email protected]>
|
Closing as superseded by #220, which retires the UI primitive fallback outright and includes this scaffold fix as a consequence of it. The two arrived at the same approach independently — auth's scaffold refuses the way admin's already refused a host without Not carried over, and worth picking up separately — these are real improvements #220 does not contain:
Nothing here is lost by closing; it is recorded above so a follow-up can take it. |
Ports the documentation and CLI changes from #219, which is closed as superseded by this branch. Auth and admin render only through the kit and the runtime activates extensions in declaration order, so every documented invocation now names ui first. Two files #219 did not reach were stale the same way: DEVELOPMENT-PIPELINE.md and CI-FOLLOWUP-2026-09-19.md both wrote `--with auth,admin,ui`, which is the one order the scaffolds now refuse. The admin README keeps this branch's wording rather than #219's: that PR documented the host entry as `adminExtension({..., ui, authMount: '/account'})`, while the code here emits `authMount` first. Co-Authored-By: Claude Opus 5 <[email protected]>
…#220) * Retire the UI primitive fallback; settle the provider execution model Auth and admin each had two render paths: through the urlcode-ui kit when the host supplied and activated the `ui` extension, and through shared primitives otherwise. Every screen was tested twice. The kit path is now the only path. `@jimhoyd/urlcode-ui` was already a required peer of both packages, so nothing new needs installing; what changes is that the extension must be supplied and active. Both refuse at activation, naming what is missing, rather than failing per request. Activation order follows `urlcode.yaml` declaration order, not the host array, so `ui` must be declared first -- the errors and docs say so. Scaffolding follows: ui's scaffold reads the composed `names` and registers each peer's copy and templates with the kit, auth's and admin's refuse when `ui` is absent or ordered after them, and the standalone `init` paths compose the kit themselves. Without this, every generated project would have thrown at boot. Two defects surfaced on the way: admin wrapped its kit layout with a different presentation context than it rendered with (`lang="en"` around translated copy), and `initAuthentication` never created parent directories for nested scaffold files. Separately, the provider execution model is decided: projects using `function` or `middleware` deploy as one trusted Node process. Per-route Lambda compilation is declined, and the AWS/Vercel refusal is now a settled position rather than a gap awaiting an adapter. Its spike is archived as the analysis behind that decision, and the roadmap's stale middleware-package references are corrected -- that package was withdrawn, not migrated. Co-Authored-By: Claude Opus 5 <[email protected]> * Name ui first in the scaffold docs and CLI usage Ports the documentation and CLI changes from #219, which is closed as superseded by this branch. Auth and admin render only through the kit and the runtime activates extensions in declaration order, so every documented invocation now names ui first. Two files #219 did not reach were stale the same way: DEVELOPMENT-PIPELINE.md and CI-FOLLOWUP-2026-09-19.md both wrote `--with auth,admin,ui`, which is the one order the scaffolds now refuse. The admin README keeps this branch's wording rather than #219's: that PR documented the host entry as `adminExtension({..., ui, authMount: '/account'})`, while the code here emits `authMount` first. Co-Authored-By: Claude Opus 5 <[email protected]> --------- Co-authored-by: Claude Opus 5 <[email protected]>
#219 landed while this branch was open: `init --with` now names ui explicitly and composes the kit into the auth scaffold, and `--with auth,admin` refuses rather than emitting a project that throws at activation. Resolved in favour of both changes. The auth scaffold keeps main's ui composition and gains this branch's pin resolution ahead of mkdir; `@jimhoyd/urlcode-ui` is a declared peer of auth, so the kit the scaffold now emits is pinned by the same pass that pins auth itself. The integration test's role expectation was written when nobody named ui and it arrived only as a peer. The invocation now names it, so its role is genuinely `extension`; the expectation and its comment are corrected rather than the assertion weakened. No real composition reaches the peer role any more, so the comment points at test/project-dependencies.test.ts, which covers it against synthetic packages -- the first wording claimed `--with auth,admin` covered it, which is wrong now that the case refuses. Co-Authored-By: Claude Opus 5 <[email protected]>
#219 landed while this branch was open: `init --with` now names ui explicitly and composes the kit into the auth scaffold, and `--with auth,admin` refuses rather than emitting a project that throws at activation. Resolved in favour of both changes. The auth scaffold keeps main's ui composition and gains this branch's pin resolution ahead of mkdir; `@jimhoyd/urlcode-ui` is a declared peer of auth, so the kit the scaffold now emits is pinned by the same pass that pins auth itself. The integration test's role expectation was written when nobody named ui and it arrived only as a peer. The invocation now names it, so its role is genuinely `extension`; the expectation and its comment are corrected rather than the assertion weakened. No real composition reaches the peer role any more, so the comment points at test/project-dependencies.test.ts, which covers it against synthetic packages -- the first wording claimed `--with auth,admin` covered it, which is wrong now that the case refuses. Co-Authored-By: Claude Opus 5 <[email protected]>
) (#221) * Record exact runtime and extension pins for generated applications `urlcode init --with` resolved whatever extension packages happened to be installed and wrote nothing about which versions those were, so a generated site's reproducibility depended entirely on a manifest it did not have (#212). The auth initializer wrote a package.json with no dependencies at all. `init --with` now resolves core, every named extension and every package those extensions declare in peerDependencies, validates the whole set against every declared peer range, and writes a private package.json pinning each one at the version actually resolved. An incompatible set or a missing required peer refuses before the destination directory exists. `urlcode-auth init` pins this package and its peers the same way. Route-only `urlcode init` is unchanged and still writes no manifest; `--manifest` opts a route-only project into pinning the runtime, and `--no-manifest` opts a --with site out. `--pin <package>=<specifier>` records a local tarball or checkout, and a package npm installed from a local path is detected from npm's own install record and pinned by that path without a flag. No package manager is ever run: producing package-lock.json remains an explicit `npm install` the operator runs after reviewing the manifest, which the command output, the generated README and the docs all say. There is no upgrade command, and the docs say that plainly. Range satisfaction is a small local implementation (comparators, ^ and ~ over a complete x.y.z, || alternatives, npm's prerelease rule) because semver is a devDependency here and core takes no new runtime dependency; unsupported range syntax refuses rather than guessing. No extension implementation is imported: only package manifests are read, by name. Verified: npm run lint, npm run typecheck, npm run check and npm test (530 tests) pass, as do npm run test:workspace-integration against the real built auth/admin/ui packages and the auth package's scaffold suites and typecheck. Not verified: no actual `npm install` of a generated manifest was run (that needs a registry or a published tarball), and the auth package's full test suite was not run. Co-Authored-By: Claude Opus 5 <[email protected]> * Fix the two CodeQL findings in the new dependency code CodeQL is a required check and it caught two real defects this branch introduced. js/polynomial-redos, src/project-dependencies.ts: `manifestName` trimmed with /^[._-]+|[-._]+$/, whose anchored trailing quantifier is retried from every start position -- quadratic on a directory name of many dashes, and the input is a path the caller supplies. Trimmed with indices instead. Verified behaviour-identical on ten cases spanning the previous regex's branches, and 60k dashes now trims in about a millisecond. js/incomplete-sanitization, test/project-dependencies.test.ts: the expected message was built into a RegExp escaping only dots. A version can carry prerelease and build punctuation, so it now escapes every metacharacter. Co-Authored-By: Claude Opus 5 <[email protected]> * Rebase onto the ui-first scaffolds #219 landed while this branch was open: `init --with` now names ui explicitly and composes the kit into the auth scaffold, and `--with auth,admin` refuses rather than emitting a project that throws at activation. Resolved in favour of both changes. The auth scaffold keeps main's ui composition and gains this branch's pin resolution ahead of mkdir; `@jimhoyd/urlcode-ui` is a declared peer of auth, so the kit the scaffold now emits is pinned by the same pass that pins auth itself. The integration test's role expectation was written when nobody named ui and it arrived only as a peer. The invocation now names it, so its role is genuinely `extension`; the expectation and its comment are corrected rather than the assertion weakened. No real composition reaches the peer role any more, so the comment points at test/project-dependencies.test.ts, which covers it against synthetic packages -- the first wording claimed `--with auth,admin` covered it, which is wrong now that the case refuses. Co-Authored-By: Claude Opus 5 <[email protected]> --------- Co-authored-by: Claude Opus 5 <[email protected]>
Summary
Auth and admin render every screen through the ui kit, but the scaffold path never wired it.
urlcode init <dir> --with auth,adminemittedauthExtension({service, csrfKey, projectSha256})and anextensions:block with nouiat all;--with auth,admin,uideclared ui last. The runtime activates extensions in the orderurlcode.yamldeclares them (Object.entries(declarations)insrc/extensions.ts), so ui has to be declared first.Closes the first two source-evidence items in #217.
What changed
Approach: auth's scaffold refuses, the way admin's already refuses a host without
auth— no core change needed, sincesrc/init-with.tsalready composes in--withorder.packages/auth/src/scaffold.ts—scaffold()throws whenuiis absent fromnames, and throws again whenuicomes afterauth. Host entry is nowauthExtension({service, csrfKey, projectSha256, ui}).initAuthenticationcomposes ui's scaffold ahead of auth's (yaml, host, files, README section), sourlcode-auth initalso emits a ui-first project;hostModuletakes an array of results and releases in reverse.packages/admin/src/scaffold.ts— the same two refusals forui; entry isadminExtension({service, csrfKey, projectSha256, ui, authMount: '/account'});initAdministrationsplices on the new auth marker and putsuifirst in the generated document.test/workspace-scaffold.integration.ts, which now runs--with ui,auth,adminand asserts three refusals:ui,admin(no auth),auth,admin(no ui),auth,admin,ui(ui last).docs/EXTENSIONS.md,docs/FRAMEWORK.md,src/cli.tsusage, both package READMEs andllms.txtfiles, regeneratedllms-full.txt.A generated site now yields
extensions: [ui.registration, authExtension({...ui}), adminExtension({...ui})]and declaresui→auth→admin.Judgment calls, flagged explicitly
This makes ui mandatory for the auth and admin scaffolds.
urlcode init --with authandurlcode-auth initno longer produce an auth-only site. #217 says "preserve standalone configurations", so this cuts against that line of the issue. It is a deliberate tightening of the scaffold, not a runtime requirement:authExtensionandadminExtensionboth still accept an absentuiat activation (ui?: UiHost), so a hand-written host without ui keeps working. If standalone auth scaffolding should be kept, the refusal is the one piece to drop — the ui-first ordering and theuihost argument stand on their own.Not addressed here (still open under #217)
packages/ui/src/host/scaffold.tsstill passessources: [], so auth's and admin's English catalogues are not registered with the kit.packages/ui/README.mdstill claiming auth/admin have not adopted the kit.Verification
npm run verifyat the repo root, exit 0: lint, typecheck, check (schema/reference/llms-full/cookbook-index/plugin generation all regenerated and clean), build, core 523 tests, thenverify:workspaces— ui 57, auth 209, admin 69 — andtest:workspace-integration(1). No assertion was weakened or deleted.CI passing is not an independent security review.
🤖 Generated with Claude Code