Repository navigation
fix(cli): extensions add/remove preserve YAML formatting; list --strict accepts library-only add-ons; add-on authoring rules (#715, #718, #712) - #728
Merged
Conversation
Re-serialising the parsed app/urlcode.yaml respaced flow collections, folded long scalars and normalised spacing across the whole file, and no yaml toString option preserves source spacing. add and remove now splice text only at the source range of the extensions.<name> entry and the includes item they change (block or flow, LF or CRLF), re-parse after each edit, and refuse with the block to write by hand, rather than reformat, when the result does not parse to the same data as the document edit. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
An installed extension package that app/urlcode.yaml does not declare and
host.mjs does not import (in any form) is now a library install: listed
with mode "library" ("extension" when wired, "artifact" for artifacts)
and shown as (library) in text output. Its package.json URL, lock
integrity/resolved URL and nested copies are still checked strictly, but
the missing declaration and import are no longer drift. Drift is reported
only when one of urlcode.yaml or host.mjs names it and the other does not.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
… authoring-rules batch (#711, #715, #712) Unpacked 2650 -> 2700 KiB (content reached about 2653 KiB) and packed 650 -> 660 KiB (about 646 KiB, inside npm gzip variance of the old budget); rationale recorded next to the budget as for earlier raises. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
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.
Problem and change
extensions add/removeno longer reformatapp/urlcode.yaml. Theyamllibrary's serializer can't keep untouched lines byte-identical, even withkeepSourceTokens,lineWidth: 0orflowCollectionPadding: false. It still rewrote spacing inside[...]/{...}, afterkey:and before comments.yamlInsertEntry,yamlAppendItem,yamlDeleteinpackages/core/src/addon-install.ts) change the file only at the source span of theextensions.<name>entry orincludesitem being added or removed. They handle indented blocks and one-line{...}/[...]layouts, CRLF, and files with no final newline.checkedYamlEditre-parses the result and compares its data with the previous in-memory edit. If that fails, or the layout isn't one the helpers support, the command refuses and prints the block to add by hand. The normal rollback runs, and the file is never reformatted.--exampleadd, a second add and both removes. The round trip gives back the original hand-written file exactly.extensions list --strictaccepts library-only add-ons. An installed add-on that is neither declared inapp/urlcode.yamlnor imported byhost.mjsas an extension is reported asmode: "library".requires.host.mjsnames the add-on.docs/EXTENSIONS.mdwith five "must" rules. It covers owning only your declared surface, explicit cross-extension dependencies, prerequisites-only scaffolds with opt-inexample(), inert artifacts, and a second-provider fixture for every seam.create-extensionREADME/AGENTS templates and next steps.Verification
Run on Node v26.10.0:
npm run verify(on this stack before it was moved ontomain, same tree plus feat: per-key quota, relative form date bounds, store-owned CRUD screen, capability-only extension installs (#703, #705, #709, #711) #727's CI-plan fix):audit:packageson the unpacked budget (2716737 > 2713600). After the budget commit,audit:packagesandtest:addons(4/4) pass.npm run test:package: passes on the rebased branch ("Packed installation and starter/cookbook checks passed"; 661684 packed, 2716275 unpacked bytes).npm run lint,typecheck:tooling,check.Compatibility and security
[Bug]: urlcode extensions add reformats the whole app/urlcode.yaml #715: a YAML layout the text editor can't handle safely (for example an empty
extensions:value, orincludes: x) is now refused with the block to add by hand, instead of the file being rewritten. Comment lines just above a removed entry are kept.[Request]: extensions list --strict should accept an add-on installed only as a library #718:
extensions list --jsongainsmode(extension|library|artifact).--strictnow passes for library-only installs whose pins are correct.No change to runtime behaviour.
Changes match the documented portable contract; docs/examples are updated where needed.
Relevant tests and package checks pass, or limitations are explained above.
No credentials, customer data or private project material are included.
Runtime/starter changes remain aligned where applicable.
🤖 Generated with Claude Code
https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
Generated by Claude Code