Repository navigation
feat(ui): publish ui-presentation as a separate signed catalog entry (#522) - #643
Merged
Merged
Conversation
…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
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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-presentationis a new extension-bundle catalog entry, distinct from the existinguientry. It lockspackages/ui/dist/index.js(the root.export:renderDocument,createPresentation,escapeHtml,table,field,button, and the rest of the Node-free presentation surface) — neverpackages/ui/dist/host/index.js(ui's host-activation entry:createUiExtension,loadProjectUi, CSRF helpers).scripts/prepare-extension-bundles.tsgainsextraCatalogEntries: additional named, independently signed and integrity-locked catalog entries built from an already-staged package's module tree, with no secondnpm install.ui-presentationships through the same signed[email protected]mechanism as every other bundle, soloadExtensionBundlefrom@jimhoyd/urlcode/extension-bundlescan load it into a plain trusted function with no host file, noextensions.uiconfig, and no/assets/ui/*mount:ui'sscaffoldstill names itselfui, sourlcode init --with ui-presentationfails a clear "scaffold must return a result named ui-presentation" check rather than doing something unexpected.docs/EXTENSIONS.md(new "Primitives-only entries, separate from host activation" section) andpackages/ui/README.md;docs/RUNTIME-IMPLEMENTATION.md'sRIM-EXT-BUNDLE-001card is extended to cover the pattern.@jimhoyd/urlcode-ui: minor).Scope
Scoped to
packages/uionly, per the task. I checkedauth,admin,storeandforms: 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 typechecknpm run check(includescheck-agent-facts.ts, which cross-checksscripts/prepare-extension-bundles.ts's built names againstBUNDLE_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 withorigin/main)npm run test:packagetest/workspace-scaffold.integration.ts: installs and loadsui-presentationthrough the real signed-bundle machinery (local packer mirroringscripts/prepare-extension-bundles.ts) and calls a real exported primitive (escapeHtml), and asserts host-activation-only exports (createUiExtension) are absent from this entrytest/cli.test.ts,test/extension-bundles.test.ts,test/init-with.test.tsnow expect the 6-name catalogCloses #522
🤖 Generated with Claude Code