core icon indicating copy to clipboard operation
core copied to clipboard

Add guidelines for dependencies

Open mcmire opened this issue 1 year ago • 1 comments

  • When to use dependencies, devDependencies, and peerDependencies for controllers
    • If your controller is talking to another controller via the messenger, you should place that controller in both devDependencies and peerDependencies. (Explain why.) This trumps all other rules.
      • Furthermore, the version range in peerDependencies should be set to the major to reduce the coupling between packages and makes upgrades in clients easier.
    • If you are importing a controller in production code, then you should place that controller in dependencies. Yes, this even includes types (because types show up in the published version of the package.)
    • If you are importing a controller in tests only, then you should place that controller in devDependencies.

mcmire avatar Feb 14 '25 16:02 mcmire

Also see: https://github.com/MetaMask/contributor-docs/issues/117

mcmire avatar Jun 03 '25 23:06 mcmire