Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update package constraints to allow multiple files. (#4611)
## Explanation Currently the only accepted path is `/dist`, this ensures that other files outside of dist can be included This will allow support for multiple files, which can be used for [subpath exports](https://nodejs.org/api/packages.html#subpath-exports). For example if a package wants to export `@metamask/my-controller/foo`, they will need to update the `exports` field **and the `files` field.** Real world examples: - Snaps Controller Package - [here](https://github.com/MetaMask/snaps/blob/main/packages/snaps-controllers/package.json#L31-L35) - Redux Toolkit - [here](https://github.com/reduxjs/redux-toolkit/blob/master/packages/toolkit/package.json#L117-L122) - Our team is exploring subpath exports too - [here](https://github.com/MetaMask/core/pull/4604/files#diff-7855eaf5406cbf1191aed59d02f2fd928544f17eefcf527a8d0feb7811032b5fR55-R57) ## References N/A <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? For example: * Fixes #12345 * Related to #67890 --> ## Changelog N/A <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". ### `@metamask/package-a` - **<CATEGORY>**: Your change here - **<CATEGORY>**: Your change here ### `@metamask/package-b` - **<CATEGORY>**: Your change here - **<CATEGORY>**: Your change here --> ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate
- Loading branch information