Skip to content

feat: Key-value names for files - #723

Open
adamspofford-dfinity wants to merge 3 commits into
spofford/plugin-kvfrom
spofford/named-files
Open

feat: Key-value names for files#723
adamspofford-dfinity wants to merge 3 commits into
spofford/plugin-kvfrom
spofford/named-files

Conversation

@adamspofford-dfinity

Copy link
Copy Markdown
Contributor

Allows plugins to assign semantic meaning to files and directories that are preopened with named fields.

Looks like:

type: plugin
files:
  config: config.json
  applies-to: [a.txt, b.txt]

File and directory entries in the wit interface gain a key: option<string>. When a name contains a list, all the entries will have the same key. The old unstructured list form is valid and results in the option being unset.


Stack created with GitHub Stacks CLIGive Feedback 💬

Copilot AI balanced review requested due to automatic review settings August 20, 2026 16:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds semantic keys to plugin file and directory inputs while preserving plain-list manifest support.

Changes:

  • Adds keyed map forms for dirs and files.
  • Propagates keys through bundling, runtime, and WIT inputs.
  • Updates schemas, documentation, examples, and tests.

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Cargo.toml Enables IndexMap schema support.
Cargo.lock Records the schema dependency update.
crates/icp/src/manifest/adapter/plugin.rs Parses and preserves named paths.
crates/icp/src/manifest/canister.rs Boxes plugin steps and updates fixtures.
crates/icp/src/canister/sync/plugin.rs Converts manifest paths into keyed runtime inputs.
crates/icp-sync-plugin/sync-plugin.wit Adds keys and structured directory inputs.
crates/icp-sync-plugin/src/runtime.rs Passes keys across the component boundary.
crates/icp-sync-plugin/src/lib.rs Exports the keyed path type.
crates/icp-sync-plugin/DESIGN.md Documents keyed-path architecture.
crates/icp-sync-plugin/tests/fixtures/test-plugin/src/lib.rs Adds key propagation behavior.
crates/icp-cli/src/operations/bundle.rs Preserves keys while relocating paths.
crates/icp-cli/tests/sync_tests.rs Tests map-form directories end to end.
crates/icp-cli/tests/bundle_tests.rs Tests keyed paths during bundling.
examples/icp-sync-plugin/plugin/src/lib.rs Adapts the example to structured directories.
docs/schemas/icp-yaml-schema.json Describes named paths in project manifests.
docs/schemas/canister-yaml-schema.json Describes named paths in canister manifests.
docs/reference/configuration.md Documents map-form configuration.
docs/guides/writing-sync-plugins.md Updates plugin author guidance.
docs/concepts/sync-plugins.md Explains key semantics in plugin inputs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/icp-sync-plugin/sync-plugin.wit
@adamspofford-dfinity
adamspofford-dfinity marked this pull request as ready for review August 24, 2026 16:49
@adamspofford-dfinity
adamspofford-dfinity requested a review from a team as a code owner August 24, 2026 16:49
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.

2 participants