Skip to content

Conversation

@Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Jan 14, 2026

This is a follow up to #3793, which introduces custom manifests (e.g., one for production, one for development), allowing a custom manifest to extend another manifest. Right now, the entire production manifest would need to be copied to the development manifest. After this change it's possible to do the following:

// snap.manifest.dev.json
{
  "extends": "./snap.manifest.json",
  "initialConnections": {
    "http://example.com": {}
  }
}

With a base manifest like:

// snap.manifest.json
{
  "proposedName": "My Snap",
  "other": "properties"
}

After which the manifests would be merged like this:

{
  "proposedName": "My Snap",
  "other": "properties",
  "initialConnections": {
    "http://example.com": {}
  }
}

Right now this is mainly useful for local development, but may be used for bundling production Snaps in the future.

Breaking changes

  • The checkManifest function now returns ExtendableSnapFiles, which contains an ExtendableSnapManifest.

Note

Enables manifest inheritance by allowing a manifest to extends another, producing a merged manifest for tooling.

  • Core: Add loadManifest to recursively load/merge manifests (cycle detection), introduce ExtendableManifest/ExtendableSnapFiles and DeepPartial; update schema to allow extends.
  • Validation: Validators read from manifest.mergedManifest and write fixes to manifest.mainManifest; checkManifest now returns ExtendableSnapFiles (BREAKING).
  • Webpack/Watch: SnapsWatchPlugin takes manifestPath and watches all files from loadManifest; config and snapshots updated.
  • Dev server: /snap.manifest.json serves the merged manifest JSON; allowed static paths computed from merged manifest.
  • Examples: bip32/snap.manifest.dev.json now extends base manifest.
  • Tests/Coverage: Extensive new/updated tests; coverage numbers adjusted.

Written by Cursor Bugbot for commit 4eabac7. This will update automatically on new commits. Configure here.

/**
* A utility type that makes all properties of a type optional, recursively.
*/
type DeepPartial<Type> = {
Copy link
Member

Choose a reason for hiding this comment

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

Do we not have this somewhere already?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just one that works on objects in snaps-cli's test utils. I couldn't find a general one.

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.34%. Comparing base (15a9666) to head (4eabac7).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3802   +/-   ##
=======================================
  Coverage   98.33%   98.34%           
=======================================
  Files         422      422           
  Lines       12073    12127   +54     
  Branches     1875     1885   +10     
=======================================
+ Hits        11872    11926   +54     
  Misses        201      201           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Mrtenz Mrtenz marked this pull request as ready for review January 16, 2026 13:33
@Mrtenz Mrtenz requested a review from a team as a code owner January 16, 2026 13:33
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Mrtenz and others added 2 commits January 20, 2026 15:04
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
const mainManifest = await readJsonFile(manifestPath);
files.add(manifestPath);

if (!isPlainObject(mainManifest.result)) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we care that these objects are plain? E.g. versus isObject?

Same question for a lot of this file.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really, but unsure when to use isObject or isPlainObject or what the benefit is of one over the other 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to isObject.

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
@Mrtenz Mrtenz enabled auto-merge January 20, 2026 14:30
@Mrtenz Mrtenz added this pull request to the merge queue Jan 20, 2026
Merged via the queue into main with commit f5bb314 Jan 20, 2026
126 checks passed
@Mrtenz Mrtenz deleted the mrtenz/extendable-manifests branch January 20, 2026 14:42
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.

3 participants