-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(compartment-mapper): Relax package discovery (#2642)
Closes: #2636 ## Description The compartment mapper is currently strict about the interpretation of `peerDependencies` and `peerDependenciesMeta.optional` as opposed to `optionalDependencies` and is technically correct, but that correctness and understanding is not evenly distributed among tools in the ecosystem. If the Compartment Mapper instead tolerates the physical absence of expected packages, it defers an error that would be experienced under `mapNodeModules` to `link/load` since that might attempt to load a module from the missing package. This is not a particularly observable difference in behavior, but the error message will be slightly less informative. In this change, we relax the behavior by default and provide a `strict` option to provide the more informative error and tolerate fewer ecosystem defficiencies. ### Security Considerations None. ### Scaling Considerations None. ### Documentation Considerations News updated. We do not yet publish API documentation for Compartment Mapper, but the necessary annotations are present when these devices are more public. ### Testing Considerations Includes positive and negative tests for the `strict` behavior. ### Compatibility Considerations The nature of some errors during bundling may change. Bundling errors are not observed on Agoric’s chain, so that sensitivity should not cause problems. ### Upgrade Considerations None.
- Loading branch information
Showing
10 changed files
with
124 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
3 changes: 2 additions & 1 deletion
3
packages/compartment-mapper/test/fixtures-0/node_modules/app/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
packages/compartment-mapper/test/fixtures-strict/node_modules/app/main.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
packages/compartment-mapper/test/fixtures-strict/node_modules/app/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.