snaps
snaps copied to clipboard
Restructure packages
In the current situation snaps-rpc-methods, snaps-controllers, snaps-utils, etc., are heavily coupled together. snaps-controllers exports functionality from snaps-rpc-methods, snaps-types exports from numerous packages, and so on. This results in all of these packages being included in Snap bundles as well.
Some ideas:
- Move Node.js-specific exports to a
/nodeentrypoint (e.g.,@metamask/snaps-utils/node). See@metamask/utilsfor example. - Extract execution services (currently in
snaps-controllers) into a separate package, and export the Node.js execution services from a separate entrypoint. - Reconsider the
snaps-typesandsnaps-rpc-methodsstructure, to maybe remove the dependency fromsnaps-typesonsnaps-rpc-methods. - Separate utils that we expect snaps devs to internal-only utils. Maybe we can introduce a
snaps-internalspackage.
We need to design a new architecture for these packages.