feat(lsp): add cannonfile fragment schema and include field#1857
Merged
dbeal-eth merged 3 commits intousecannon:devfrom Mar 7, 2026
Merged
feat(lsp): add cannonfile fragment schema and include field#1857dbeal-eth merged 3 commits intousecannon:devfrom
dbeal-eth merged 3 commits intousecannon:devfrom
Conversation
6e37fdf to
9e86c66
Compare
Contributor
Author
|
Updated to also include the |
dbeal-eth
approved these changes
Mar 1, 2026
dbeal-eth
requested changes
Mar 1, 2026
Contributor
Author
|
Good call — extracted the shared actions into |
Contributor
Author
|
Addressed review feedback: deduplicated the schemas by extracting a shared |
Contributor
Author
|
Inline review comment addressed in 66411d0 — deduplicated the fragment and full schemas so the full schema extends the fragment. Ready for re-review @dbeal-eth |
Add support for cannonfile fragments - TOML files that are meant to be included from a main cannonfile and don't require top-level metadata. Changes: - Add 'include' field to chainDefinitionSchema for importing other TOML files - Add cannonfileFragmentSchema for included fragments (no name/version required) - Update generateSchema.js to generate both schema.json and schema-fragment.json - Fragment schema omits: name, version, preset, include, privateSourceCode, description, keywords, deployers This allows IDEs to provide proper validation for both: - Full cannonfiles (with name, version, etc.) - Fragment files (included TOMLs with only actions)
Extract shared action definitions into cannonfileActionsSchema and reuse it in both chainDefinitionSchema and cannonfileFragmentSchema to eliminate code duplication.
656e683 to
b774417
Compare
Contributor
|
tests will not pass due to PR being contributed from external, so merging with bypassed rues. |
dbeal-eth
approved these changes
Mar 7, 2026
saturn-dbeal
added a commit
that referenced
this pull request
Mar 8, 2026
Release includes: - feat(website): add pagination feature (#1826) - feat(lsp): add cannonfile fragment schema and include field (#1857) - feat(cli): add --ipfs-superfluous flag to clean command (#1854) - feat(cli): sourcify verification (#1850) - feat(builder): create2 option support for router step (#1839) - fix(cli): prevent spinner output corruption (#1858) - fix(cli): viair does not work properly with cannon verify (#1847) - fix(cli): cleanup pitfalls and improve overall fetch UX (#1835) - fix(builder): prevent flaky/inconsistent rpcs from failing the build (#1848) - fix(builder): early return from computeTemplateAccesses (#1846) - fix(builder): deploy importExisting was not properly handling create2 contracts (#1853) - fix: bugs in package caching process (#1859) - Fix Select Safe dialog overflow (#1852)
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
This PR adds support for cannonfile fragments - TOML files that are meant to be included from a main cannonfile and don't require top-level metadata like
nameandversion.Changes
1. Add
includefield tochainDefinitionSchemaThis field was already parsed by the CLI but was missing from the schema, causing IDE warnings.
2. Add
cannonfileFragmentSchemaA new schema for included fragments that omits:
name(required for publishing)version(required for publishing)preset(optional in both)include(only main cannonfile should include)privateSourceCode(only main cannonfile should define)description(only main cannonfile should define)keywords(only main cannonfile should define)deployers(only main cannonfile should define)Fragments can contain all the same actions:
deploy,invoke,clone,pull,var,router,diamond, etc.3. Generate both schemas
schema.json- Full cannonfile schemaschema-fragment.json- Fragment schema for included filesUsage
IDEs/LSPs can now provide proper validation for:
nameandversion, can haveincludeExample Fragment (
tomls/core.toml)This fragment can be included from a main cannonfile without causing validation errors about missing
name/version.Draft PR - ready for review.