Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support and enforce peerDependencies #292

Closed
eladb opened this issue Nov 6, 2018 · 1 comment
Closed

Support and enforce peerDependencies #292

eladb opened this issue Nov 6, 2018 · 1 comment

Comments

@eladb
Copy link
Contributor

eladb commented Nov 6, 2018

When a module's API includes types from another dependency, the right way to ensure that a consumer actually passes in objects that are semantically compatible is by ensuring that the object was instantiated from the exact same version, as long as it's semantically compatible.

The jsii compiler should emit warnings if a module's API includes types of other modules but those other modules are not defined also under peerDependencies of the package.json file.

We should also provide a tool to help "fix" package.json files by inspecting the jsii spec.

Related: aws/aws-cdk#979

eladb pushed a commit to aws/aws-cdk that referenced this issue Nov 6, 2018
Adds "peerDependencies" to all modules for all dependencies that
include types that are used in the module's public API.

Also, add "@aws-cdk/cdk" to "peerDependencies" for the typescript
library cdk-init template.

This will be enforced by jsii when aws/jsii#292 is introduced.
Prerequisite for #272
Fixes #979
eladb pushed a commit to aws/aws-cdk that referenced this issue Nov 6, 2018
Adds "peerDependencies" to all modules for all dependencies that
include types that are used in the module's public API.

Also, add "@aws-cdk/cdk" to "peerDependencies" for the typescript
library cdk-init template.

This will be enforced by jsii when aws/jsii#292 is introduced.
Prerequisite for #272
Fixes #979
@eladb
Copy link
Contributor Author

eladb commented Nov 7, 2018

Fixed by #294

@eladb eladb closed this as completed Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant