Skip to content

feat!: Allow manifest to extend another manifest - #3802

Merged
Mrtenz merged 20 commits into
mainfrom
mrtenz/extendable-manifests
Jan 20, 2026
Merged

Mrtenz merged 20 commits into
mainfrom
mrtenz/extendable-manifests

Conversation

@Mrtenz

@Mrtenz Mrtenz commented Jan 14, 2026 •

Copy link
Copy Markdown
Member

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.

Comment thread packages/snaps-utils/src/types.ts Outdated
/**
* A utility type that makes all properties of a type optional, recursively.
*/
type DeepPartial<Type> = {

Copy link
Copy Markdown
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
Copy Markdown
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

codecov Bot commented Jan 16, 2026 •

Copy link
Copy Markdown

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.

Comment thread packages/snaps-utils/src/types.ts Resolved
cursor[bot]

This comment was marked as outdated.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

Comment thread packages/snaps-utils/src/types.ts Resolved
Comment thread packages/snaps-utils/src/types.ts Resolved
Comment thread packages/snaps-utils/src/types.ts Resolved
Comment thread packages/snaps-utils/src/types.ts Resolved
Comment thread packages/snaps-utils/src/types.ts Resolved
Mrtenz and others added 2 commits January 20, 2026 15:04
const mainManifest = await readJsonFile(manifestPath);
files.add(manifestPath);

if (!isPlainObject(mainManifest.result)) {

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

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