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

fix(jsii): incorrectly allowed unexported type in constructor params #3147

Merged
merged 4 commits into from
Nov 10, 2021

Conversation

RomainMuller
Copy link
Contributor

The compiler incorrectly allowed un-epxorted types to be used in a
constructor parameter, resulting in invalid assemblies (where a
reference to the un-exported type exists, but the type itself does not).

Added a test that validates this is now checked against, and improved
the error experience by providing source anchors for where the
problematic type is being used.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The compiler incorrectly allowed un-epxorted types to be used in a
constructor parameter, resulting in invalid assemblies (where a
reference to the un-exported type exists, but the type itself does not).

Added a test that validates this is now checked against, and improved
the error experience by providing source anchors for where the
problematic type is being used.
@RomainMuller RomainMuller requested a review from a team November 9, 2021 16:26
@RomainMuller RomainMuller self-assigned this Nov 9, 2021
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Nov 9, 2021
@mergify
Copy link
Contributor

mergify bot commented Nov 10, 2021

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Nov 10, 2021
@mergify
Copy link
Contributor

mergify bot commented Nov 10, 2021

Merging (with squash)...

@mergify
Copy link
Contributor

mergify bot commented Nov 10, 2021

Merging (with squash)...

@mergify mergify bot merged commit 7cd59fc into main Nov 10, 2021
@mergify mergify bot deleted the rmuller/unexported-constructor-param-type branch November 10, 2021 11:44
@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Nov 10, 2021
mergify bot pushed a commit to cdklabs/jsii-docgen that referenced this pull request Nov 16, 2021
Based on our experience from construct hub, adding a few surgical error handling:

### Uninstallable Packages

Some packages cannot be installed. We've observed the following:

- No spec declared in a `package.json` dependency. For example: https://github.com/markusl/cdk-codepipeline-bitbucket-build-result-reporter/blob/v0.0.7/package.json#L35. 
- Dependency conflict caused by a fixed peerDependency. For example: https://github.com/opencdk8s/cdk8s-mongo-sts/blob/v0.0.7/package.json#L60

### Corrupt Assembly

Some packages have a corrupt assembly. We've observed the following:

- Packages suspcestable to aws/jsii#3147. For example: `@epilot/cdk-constructs@1.0.7`
- Packages who's peerDependency underwent a breaking change in a minor version. For example `@pahud/cdktf-aws-eks@0.0.14`

### Unsupported Language

Added this detection here to further alleviate burden from callers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants