generated from MetaMask/metamask-module-template
-
Notifications
You must be signed in to change notification settings - Fork 5
feat(repo-tools): add bundleVats Vite plugin for vat bundling #834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Create a Vite plugin in @ocap/repo-tools that bundles vat source files as part of the Vite build pipeline, replacing the separate `ocap bundle` pre-build step for omnium-gatherum and extension. - Move vat bundler, strip-comments plugin, and export-metadata plugin from @ocap/cli to @ocap/repo-tools - Create `bundleVats()` plugin with `buildStart` (watch mode) and `generateBundle` (emit assets) hooks - Integrate plugin in omnium-gatherum (echo caplet + controller vat) and extension (sample-vat) - Move default-cluster.json from kernel-browser-runtime to extension with relative bundle paths - Simplify e2e CI scripts (no separate bundle/serve step needed) - Inline cluster config test data in kernel-ui tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a VatBundle type annotation in bundle.ts that ensures the repo-tools definition stays assignable to the kernel-utils definition. If either type drifts, the CLI build will fail with a type error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fa13659 to
12941f2
Compare
Member
Author
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
The e2e tests load minimal-cluster.json which references vat bundles at localhost:3000. These are test-only concerns that don't belong in the Vite config. Restore the script to bundle and serve test vats separately while production bundles (sample-vat) remain in the Vite plugin output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
grypez
approved these changes
Feb 11, 2026
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.
Rationalizes vat bundling in the extensions to forego the need of bundling and serving separately using the CLI. This ensures that changes to vat entry files are picked up during watched builds.
bundleVats()Vite plugin in@ocap/repo-toolsthat bundles vat source files as part of the Vite build pipeline, with watch mode support viaaddWatchFile@ocap/clito@ocap/repo-toolsocap bundlepre-build stepdefault-cluster.jsonfromkernel-browser-runtimetoextensionwith relative bundle paths (resolved against the extension root at runtime)ocap bundle/ocap serveneeded for omnium-gatherumkernel-browser-runtime/default-clusterdependencyNote
Medium Risk
Build and packaging behavior changes across the CLI and extension/omnium Vite configs, so regressions are most likely around watch mode, emitted asset paths, and runtime bundle resolution rather than core kernel logic.
Overview
Vat bundling is moved into the Vite build pipeline by adding
bundleVats(and exportingbundleVat/VatBundle) in@ocap/repo-tools, with tests, so vats are bundled and emitted as build assets and their sources are tracked for watch mode.The CLI’s
bundlecommand is updated to importbundleVatfrom@ocap/repo-tools, and@ocap/extensionand@ocap/omnium-gatherumare updated to usebundleVatsinvite.config.tsto produce required vat bundles during builds (and adjust static copy targets accordingly), eliminating bespoke pre-bundle steps.Cluster config and scripts are streamlined:
kernel-browser-runtimedrops itsdefault-clusterexport/shim, the extension now ships its owndefault-cluster.jsonwith relativebundleSpecvalues, kernel-ui tests inline cluster config fixtures, and e2e CI scripts/start scripts remove explicitocap start/bundle/serveflows in favor of running Playwright directly.Written by Cursor Bugbot for commit 12941f2. This will update automatically on new commits. Configure here.