From e4419b856b6e8cf2116d8b0c949dd5519eb382c8 Mon Sep 17 00:00:00 2001 From: DevKayo Date: Tue, 7 Mar 2023 20:47:26 -0800 Subject: [PATCH 1/2] docs (typescript-restrictions): Clarify non-jsii deps --- .../user-guides/lib-author/typescript-restrictions.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gh-pages/content/user-guides/lib-author/typescript-restrictions.md b/gh-pages/content/user-guides/lib-author/typescript-restrictions.md index b157635bd8..2476cee445 100644 --- a/gh-pages/content/user-guides/lib-author/typescript-restrictions.md +++ b/gh-pages/content/user-guides/lib-author/typescript-restrictions.md @@ -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. !!! info For more information on `package.json` file contents, refer to the [npm documentation][package-json]. From b694e54c13ded030d4733d731bbcb724edf1650b Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Tue, 14 Nov 2023 09:30:31 +0000 Subject: [PATCH 2/2] Update gh-pages/content/user-guides/lib-author/typescript-restrictions.md --- .../content/user-guides/lib-author/typescript-restrictions.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gh-pages/content/user-guides/lib-author/typescript-restrictions.md b/gh-pages/content/user-guides/lib-author/typescript-restrictions.md index fc3e671511..9ab1bc1f22 100644 --- a/gh-pages/content/user-guides/lib-author/typescript-restrictions.md +++ b/gh-pages/content/user-guides/lib-author/typescript-restrictions.md @@ -20,7 +20,8 @@ Occasionally, a dependency on a *non-jsii module* is useful. Since such dependen 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. Typescript files that include a non-jsii dependency (Eg. a lambda handler for a CDK Construct) must be excluded in the tsconfig. +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 (e.g. a lambda handler for an AWS CDK Construct) cannot be exported from the `main`/`types` entry point. !!! info For more information on `package.json` file contents, refer to the [npm documentation][package-json].