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

strip elements marked with @internal jsdoc tag #388

Closed
eladb opened this issue Mar 18, 2019 · 1 comment · Fixed by #390
Closed

strip elements marked with @internal jsdoc tag #388

eladb opened this issue Mar 18, 2019 · 1 comment · Fixed by #390

Comments

@eladb
Copy link
Contributor

eladb commented Mar 18, 2019

In accordance with typescript's --strip-internal, we should enable this feature by default and omit any declarations marked @internal from the jsii manifest so they don't appear in the API (similar to underscore prefix).

@eladb
Copy link
Contributor Author

eladb commented Mar 18, 2019

Related aws/aws-cdk#2044

eladb pushed a commit that referenced this issue Mar 18, 2019
strips classes, interfaces, enums or members that have an "@internal"
jsdoc tag both from the jsii assembly manifest and .d.ts

fixes #388
eladb pushed a commit that referenced this issue Mar 18, 2019
strips classes, interfaces, enums or members that have an "@internal"
jsdoc tag both from the jsii assembly manifest and .d.ts

fixes #388
eladb pushed a commit that referenced this issue Mar 19, 2019
Respect the `@internal` jsdoc tag on types and members. Any type of member marked internal will not be exposed in the API of the module and in .d.ts. files (through `--strip-internal`).

Members (properties/methods) that are marked as `@internal` must also have an underscore prefix (i.e. `_myMethod`) and vice versa in order to ensure that implementers or subclasses won't modify  accessibility.

If a class implements (or an interface extends) an internal or private interface, that interface is erased from the implementer's API. So it is possible to use internal interfaces as bases, while still maintaining API integrity (related to #287).

Fixes #388

BREAKING CHANGE: member names that begin with underscore now must be marked as "@internal" in their jsdocs, which will cause them to disappear from type declaration files and jsii APIs.
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

Successfully merging a pull request may close this issue.

1 participant