If you are unable to use preview builds for testing, you can always build a package locally and link it to a project.
-
First, build the monorepo by running
yarn build. -
In the project, open
package.jsonand locate the entry independenciesfor the package you want to test. -
Replace the version range in the right-hand side of the entry to point to the local build:
"@metamask/<PACKAGE_NAME>@<VERSION_RANGE>": "file:<PATH_TO_CORE>/packages/<PACKAGE_NAME>"
where:
PACKAGE_NAMEis the name of your packageVERSION_RANGEis the version range of your package being used in production, usually starting with^PATH_TO_MONOREPOis the local path to the clone of this monorepo
-
Run
yarn install. (Note that due to the use of Yarn'sfile:protocol, you'll need to repeat this step each time you update the package in the monorepo.)
Example:
Given:
- You have changes to
@metamask/controller-utilsyou want to test@metamask/controller-utilsis listed at^1.1.4- You've cloned this repo next to the project
In this case, you would go to
dependenciesand replace the line:"@metamask/controller-utils": "^1.1.4"with:
"@metamask/controller-utils@^1.1.4": "file:../core/packages/controller-utils"