Skip to content

feat(ui): publish ui-presentation as a separate signed catalog entry (#522) - #643

Merged
jimhoyd merged 3 commits into
mainfrom
claude/ui-presentation-bundle-522
Sep 24, 2026
Merged

jimhoyd merged 3 commits into
mainfrom
claude/ui-presentation-bundle-522

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Implements the [Gap]: signed ui extension bundle locks the runtime-extension entry, not the presentation primitives (renderDocument etc.) #522 triage decision for packages/ui, the issue's concrete case: an extension may publish a separately named, signed public entry for safe project-consumption primitives, versioned and integrity-locked independently from its host-activation entry — never exposing internals or making the full package surface implicitly public.
  • ui-presentation is a new extension-bundle catalog entry, distinct from the existing ui entry. It locks packages/ui/dist/index.js (the root . export: renderDocument, createPresentation, escapeHtml, table, field, button, and the rest of the Node-free presentation surface) — never packages/ui/dist/host/index.js (ui's host-activation entry: createUiExtension, loadProjectUi, CSRF helpers).
  • scripts/prepare-extension-bundles.ts gains extraCatalogEntries: additional named, independently signed and integrity-locked catalog entries built from an already-staged package's module tree, with no second npm install.
  • ui-presentation ships through the same signed [email protected] mechanism as every other bundle, so loadExtensionBundle from @jimhoyd/urlcode/extension-bundles can load it into a plain trusted function with no host file, no extensions.ui config, and no /assets/ui/* mount:
    urlcode extension-bundles install ui-presentation --bundle-release [email protected] --project app
    import { loadExtensionBundle } from '@jimhoyd/urlcode/extension-bundles';
    const { renderDocument, table, escapeHtml } = await loadExtensionBundle('/absolute/site/app', 'ui-presentation');
  • It is deliberately not a scaffoldable extension: ui's scaffold still names itself ui, so urlcode init --with ui-presentation fails a clear "scaffold must return a result named ui-presentation" check rather than doing something unexpected.
  • Documented in docs/EXTENSIONS.md (new "Primitives-only entries, separate from host activation" section) and packages/ui/README.md; docs/RUNTIME-IMPLEMENTATION.md's RIM-EXT-BUNDLE-001 card is extended to cover the pattern.
  • Added a changeset (@jimhoyd/urlcode-ui: minor).

Scope

Scoped to packages/ui only, per the task. I checked auth, admin, store and forms: each currently has a single package-root . export used directly as its bundle entry (no separate host-only entry), so none has a similar primitives-vs-host-activation split today. No follow-up issue filed since there's nothing concrete to act on yet — worth revisiting if/when another extension package grows a comparable split.

Test plan

  • npm run typecheck
  • npm run check (includes check-agent-facts.ts, which cross-checks scripts/prepare-extension-bundles.ts's built names against BUNDLE_CATALOG_NAMES)
  • npm run verify (lint, typecheck, check, build, root test suite, verify:workspaces — full workspace build + tests across ui/auth/admin/store/forms + test:workspace-integration), run twice (once pre-merge, once post-merge with origin/main)
  • npm run test:package
  • New test in test/workspace-scaffold.integration.ts: installs and loads ui-presentation through the real signed-bundle machinery (local packer mirroring scripts/prepare-extension-bundles.ts) and calls a real exported primitive (escapeHtml), and asserts host-activation-only exports (createUiExtension) are absent from this entry
  • Updated fixtures: test/cli.test.ts, test/extension-bundles.test.ts, test/init-with.test.ts now expect the 6-name catalog

Closes #522

🤖 Generated with Claude Code

jimhoyd and others added 3 commits September 23, 2026 22:41
…522)

Extension bundles can now ship a separately named, signed public entry for
safe project-consumption primitives, versioned and integrity-locked
independently from the extension's host-activation entry, per the #522
triage decision. packages/ui is the concrete case: ui-presentation locks
packages/ui/dist/index.js (renderDocument, createPresentation, escapeHtml,
table, and the rest of the Node-free presentation surface) as its own
catalog row, distinct from the existing ui entry (which still locks
dist/host/index.js). It ships through the same [email protected]
mechanism, so loadExtensionBundle can load it into a plain trusted function
with no host file, no extensions.ui config, and no /assets/ui/* mount.

- scripts/prepare-extension-bundles.ts: add extraCatalogEntries, reusing
  an already-staged package's module tree to build additional named,
  independently signed/versioned bundle assets with no second npm install.
- packages/core/src/extension-bundles.ts: add ui-presentation to
  BUNDLE_CATALOG_NAMES.
- docs/EXTENSIONS.md, packages/ui/README.md: document consumption via
  `urlcode extension-bundles install ui-presentation` + loadExtensionBundle,
  and that it is not meant for `init --with` (ui's scaffold still names
  itself ui).
- docs/RUNTIME-IMPLEMENTATION.md: extend the RIM-EXT-BUNDLE-001 card.
- test/workspace-scaffold.integration.ts: extend the local bundle packer
  with extra-entry support and add a test that locks and loads
  ui-presentation and calls a real primitive (escapeHtml).
- test/cli.test.ts, test/extension-bundles.test.ts, test/init-with.test.ts,
  scripts/check-agent-facts.ts: update the known-bundle-name fixtures/checks
  to include the new entry.

Scoped to packages/ui only, the issue's concrete case; auth, admin, store
and forms each currently have a single package-root export used as their
bundle entry, so none has a similar primitives-vs-host-activation split
today.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n-bundle-522

# Conflicts:
#	docs/RUNTIME-IMPLEMENTATION.md
#	llms-full.txt
@jimhoyd
jimhoyd merged commit adb68d6 into main Sep 24, 2026
21 checks passed
@jimhoyd
jimhoyd deleted the claude/ui-presentation-bundle-522 branch September 24, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Gap]: signed ui extension bundle locks the runtime-extension entry, not the presentation primitives (renderDocument etc.)

1 participant