Repository navigation
refactor!: one add-on shape, composeHost, site layout, extensions/artifacts add/remove - #663
Merged
Merged
Conversation
…ifacts add/remove Extensions and artifacts become two parallel add-on kinds with one shape: an @jimhoyd/urlcode-<name> workspace with a generated urlcode.json descriptor, versioned with core and pinned by sha512 in core's dist/addons.json. They install through npm (--ignore-scripts) as top-level URL dependencies, once each, so nested add-ons (admin -> auth -> ui) share one copy. - core: defineExtension (one definition per extension: descriptor fields, scaffold, host), composeHost for host.mjs, addon-install (add/remove/list for both kinds with pin checks and rollback), static validation of declared extensions against installed schemas, relative --host-file, --project defaulting to app/ in a site. - init always writes one site layout: app/, host.mjs, package.json. - every extension package gets ./extension; forms gains a scaffold; mcp servers become optional; store-schema is an artifact package generated from the store definition. - removed: signed extension bundles and artifact catalogs, their lockfiles, caches, CLI groups, flags and workflows; urlcode-auth/urlcode-admin init; project-dependencies; the old scaffold contract fields. - action: installs a site exactly as pinned and checks its add-ons. - docs, starter, recipes and generated agent assets follow. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… error The action job's sites installed a packed core that still carried the development manifest, so extensions list --strict correctly refused the installed tarballs. Pack those cores with the same pins, as a release does. The host run now uses an mcp-only site (no routes, so no fixtures) with an explicit origin, and the action refuses host-file without origin. The missing-origin error is a ConfigError, so the CLI shows it instead of a generic failure. Co-Authored-By: Claude Opus 5.5 <[email protected]>
test/install.test.ts rebuilds this checkout's dist/ while other files run, so a test importing host.mjs through a symlink to it failed intermittently. The in-place test checks init's package.json handling and the commands; composeHost has its own tests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Sep 24, 2026
Merged
Closed
Merged
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
First of three PRs that replace the extension/artifact distribution with one clean model (plan agreed in session; the owner is the only user, so no back-compat).
One shape, two kinds. Extensions (
packages/<name>, executable) and artifacts (artifacts/<name>, inert JSON) are both@jimhoyd/urlcode-<name>workspaces with a generatedurlcode.jsondescriptor, versioned with core. Core carriesdist/addons.json, which pins every add-on (kind, requires, URL, sha512). No catalogs, custom lockfiles, caches orghrequirement.One site layout.
urlcode init <dir>always writesapp/(route project),host.mjs(operator host),package.json(exact core pin + scripts), AGENTS.md, .mcp.json, Makefile and CI. Commands default--projecttoappfrom the site root;--host-filemay be relative.Commands.
urlcode extensions|artifacts available|add|remove|list [--strict], andinit --with= init +extensions add.add: requirements are added too, each once at top level, vianpm install --ignore-scripts. The lock is checked against core's pin; the extension's scaffold then writes its YAML block,app/routes/<name>.yaml, operator files and onehost.mjsline.remove: refuses while another add-on requires it or the project still uses it. It never deletes data.list --strict: fails on a pin mismatch, a nested copy or drift between the three files.One definition per extension.
defineExtension({name, description, requires, schema, …, contributes, scaffold, host}).host.mjsisexport default await composeHost(import.meta.url, [ui(), auth(), admin()]).ctx.get, and pass templates to ui viacontributes.ui.serversis optional.Validation without a host.
validatewithout--host-filechecks declared extensions statically against the installed schemas.Action.
npm ci --ignore-scripts), then runsextensions list --strictandartifacts list --strict.host-filewhen given.Removed.
extension-bundles.yml,artifacts.yml,workspace-integration.yml).extension-bundlesandextension-artifactsgroups;--bundle-release*,--artifact-release,--pin,--manifest.urlcode-auth init,urlcode-admin init,project-dependencies, and the old scaffold contract fields.Product bugs fixed along the way:
mcp print-configdefaulted to the site root instead ofapp.init.app/app.Not in this PR
v*tag ships core to npm plus the add-on tarballs to the GitHub Release. It writes the pinnedaddons.jsonand makesci.ymlcallable from a rewrittenrelease.yml. Until thendist/addons.jsonis the development manifest (file:sources), soextensions addonly works from a checkout build.urlcode upgrade.urlcode-templateneeds the site layout.init --withcannot succeed on 0.5.9: bundle attestation source ref is main, not the release tag #579 becomes obsolete once a release ships this.Evidence
npm run verify: lint, typecheck, checks, build and 841 core tests passed.npm run verify:workspaces: mcp 20, store 35, ui 95, auth 220, forms 14 and admin 65 tests. The descriptor check and the package audit pass for all 8 packages.test/addons.integration.ts(real npm, packed tarballs pinned by sha512):extensions addof every extension, with exactly one copy of core, ui and auth;list --strict, plus static and fullvalidate;/account/login,/api/todos,/contactand/privatethroughcomposeHost, with/admin/hidden (404, no-store);npm run test:package: packed install and starter checks pass.This is not an independent security review. What changes security-wise: add-on install now trusts core's npm provenance plus sha512 pins, instead of per-release GitHub attestations.
🤖 Generated with Claude Code