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

docs(typescript-restrictions): clarify non-jsii deps #3995

Merged
merged 5 commits into from
Nov 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ A *jsii module* can declare dependencies on any other *jsii module* by adding en
`package.json` file. Since most other platforms do not support multiple different versions of the same library to
coexist in the same closure, it is recommended to also declare all such dependencies as `peerDependencies`.

### non-jsii dependencies

Occasionally, a dependency on a *non-jsii module* is useful. Since such dependencies do not have generated bindings in
all the supported languages, they must be bundled with the *jsii module* that depends on them, by adding the library
into the `bundleDependencies` array in `package.json`. The API of the *jsii module* can not expose any type from bundled
dependencies, since those types would not be available in other languages.
into the `bundleDependencies` array in `package.json`.

The API of the *jsii module* can not expose any type from bundled dependencies, since those types would not be available in other languages. Typescript files that include a non-jsii dependency (Eg. a lambda handler for a CDK Construct) must be excluded in the tsconfig.
mrgrain marked this conversation as resolved.
Show resolved Hide resolved
mrgrain marked this conversation as resolved.
Show resolved Hide resolved

!!! info
For more information on `package.json` file contents, refer to the [npm documentation][package-json].
Expand Down