diff --git a/.all-contributorsrc b/.all-contributorsrc
index 005d41080c..5d362b32f7 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -490,7 +490,8 @@
"profile": "https://github.com/jsteinich",
"contributions": [
"bug",
- "ideas"
+ "ideas",
+ "code"
]
},
{
@@ -742,7 +743,8 @@
"java",
"maintenance",
"python",
- "review"
+ "review",
+ "blog"
]
},
{
@@ -971,7 +973,8 @@
"avatar_url": "https://avatars2.githubusercontent.com/u/171072?v=4",
"profile": "https://harimenon.com/",
"contributions": [
- "blog"
+ "blog",
+ "doc"
]
},
{
@@ -1018,6 +1021,42 @@
"contributions": [
"bug"
]
+ },
+ {
+ "login": "benbridts",
+ "name": "Ben Bridts",
+ "avatar_url": "https://avatars0.githubusercontent.com/u/1301221?v=4",
+ "profile": "http://twiiter.com/benbridts",
+ "contributions": [
+ "doc"
+ ]
+ },
+ {
+ "login": "MohamadSoufan",
+ "name": "Mohamad Soufan",
+ "avatar_url": "https://avatars3.githubusercontent.com/u/28849417?v=4",
+ "profile": "https://github.com/MohamadSoufan",
+ "contributions": [
+ "doc"
+ ]
+ },
+ {
+ "login": "Chriscbr",
+ "name": "Christopher Rybicki",
+ "avatar_url": "https://avatars2.githubusercontent.com/u/5008987?v=4",
+ "profile": "https://rybicki.io/",
+ "contributions": [
+ "doc"
+ ]
+ },
+ {
+ "login": "bmacher",
+ "name": "Benjamin Macher",
+ "avatar_url": "https://avatars0.githubusercontent.com/u/32685580?v=4",
+ "profile": "http://macher.dev",
+ "contributions": [
+ "doc"
+ ]
}
],
"repoType": "github",
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index e7df1a3ff7..8d4f14cf31 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -2,7 +2,7 @@ version: 2
updates:
- package-ecosystem: npm
- directory: "/"
+ directory: '/'
schedule:
interval: daily
open-pull-requests-limit: 10
@@ -12,13 +12,13 @@ updates:
ignore:
- dependency-name: typescript
versions:
- - ">= 3.10.a"
- - dependency-name: "@types/node"
+ - '>= 3.10.a'
+ - dependency-name: '@types/node'
versions:
- - ">= 11.a"
+ - '>= 11.a'
- package-ecosystem: nuget
- directory: "/packages/@jsii/dotnet-runtime/src"
+ directory: '/packages/@jsii/dotnet-runtime/src'
schedule:
interval: daily
open-pull-requests-limit: 10
@@ -27,7 +27,7 @@ updates:
- language/dotnet
- package-ecosystem: nuget
- directory: "/packages/@jsii/dotnet-runtime-test/test"
+ directory: '/packages/@jsii/dotnet-runtime-test/test'
schedule:
interval: daily
open-pull-requests-limit: 10
@@ -36,15 +36,24 @@ updates:
- language/dotnet
- package-ecosystem: pip
- directory: "/packages/@jsii/python-runtime"
+ directory: '/packages/@jsii/python-runtime'
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- dependencies
- language/python
-
+
+ - package-ecosystem: pip
+ directory: '/gh-pages'
+ schedule:
+ interval: daily
+ open-pull-requests-limit: 10
+ labels:
+ - dependencies
+ - language/python
+
- package-ecosystem: github-actions
- directory: "/"
+ directory: '/'
schedule:
interval: daily
diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml
index 3f708e84b3..9ce8ce0469 100644
--- a/.github/workflows/docker-images.yml
+++ b/.github/workflows/docker-images.yml
@@ -70,17 +70,6 @@ jobs:
-w${{ github.workspace }} \
'jsii/superchain:nightly' \
bash -c "yarn install --frozen-lockfile && yarn build && yarn test"
- - name: Dump Image
- if: steps.should-run.outputs.result == 'true'
- run: |-
- docker image save 'jsii/superchain:nightly' \
- > ${{ runner.temp }}/jsii-superchain.nightly.tar
- - name: Upload Artifact
- if: steps.should-run.outputs.result == 'true'
- uses: actions/upload-artifact@v2
- with:
- name: 'jsii-superchain.nightly'
- path: ${{ runner.temp }}/jsii-superchain.nightly.tar
# Only when puhsing to main/release from now on
- name: Publish (nightly)
@@ -92,4 +81,3 @@ jobs:
run: |-
docker tag jsii/superchain:nightly jsii/superchain:latest
docker push jsii/superchain:latest
-
diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml
new file mode 100644
index 0000000000..570ff901fb
--- /dev/null
+++ b/.github/workflows/gh-pages.yml
@@ -0,0 +1,79 @@
+# Workflow that publishes to the gh-pacges branch
+name: GitHub Pages
+
+on:
+ pull_request:
+ branches: [main]
+ push:
+ branches: [main]
+ paths: [gh-pages/**]
+
+jobs:
+ build:
+ name: build
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: '3.8'
+ - name: Check out
+ uses: actions/checkout@v2
+ - name: Locate Caches
+ id: cache-locations
+ run: |-
+ echo "::set-output name=pip-cache::$(python3 -m pip cache dir)"
+ - name: Cache
+ uses: actions/cache@v2
+ with:
+ path: ${{ steps.cache-locations.outputs.pip-cache }}
+ key: ${{ runner.os }}-${{ hashFiles('**/requirements-dev.txt') }}
+ restore-keys: ${{ runner.os }}-
+ - name: Install Dependencies
+ run: |-
+ pip install -r requirements-dev.txt
+ working-directory: gh-pages
+ - name: Build DocSite
+ run: |-
+ mkdir -p ${{ runner.temp }}/site
+ mkdocs build \
+ --strict \
+ --site-dir ${{ runner.temp }}/site
+ working-directory: gh-pages
+ - name: Upload Artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: doc-site
+ path: ${{ runner.temp }}/site/
+
+ publish:
+ name: Publish
+ needs: build
+ if: github.event_name == 'push'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out
+ uses: actions/checkout@v2
+ with:
+ ref: gh-pages
+ token: ${{ secrets.AUTO_APPROVE_GITHUB_TOKEN }}
+ - name: Download Artifact
+ uses: actions/download-artifact@v2
+ with:
+ name: doc-site
+ path: ${{ runner.temp }}/site
+ - name: Configure Git
+ run: |-
+ git config user.name "AWS CDK Automation"
+ git config user.email "aws-cdk+automation@amazon.com"
+ - name: Prepare Commit
+ run: |-
+ rsync --delete --exclude=.git --recursive ${{ runner.temp }}/site/ ./
+ touch .nojekyll
+ git add .
+ git diff --cached --exit-code >/dev/null || (
+ git commit -am 'docs: publish from ${{ github.sha }}'
+ )
+ - name: Push
+ run: |-
+ git push origin gh-pages:gh-pages
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index f26ef90d19..69a66e53fb 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -31,7 +31,7 @@ jobs:
with:
java-version: '8'
- name: Set up Node 12
- uses: actions/setup-node@v2.1.2
+ uses: actions/setup-node@v2.1.4
with:
node-version: '12'
- name: Set up Python 3.6
@@ -118,7 +118,7 @@ jobs:
with:
java-version: '8'
- name: Set up Node 12
- uses: actions/setup-node@v2.1.2
+ uses: actions/setup-node@v2.1.4
with:
node-version: '12'
- name: Set up Python 3.6
@@ -257,7 +257,7 @@ jobs:
with:
java-version: ${{ matrix.java }}
- name: Set up Node ${{ matrix.node }}
- uses: actions/setup-node@v2.1.2
+ uses: actions/setup-node@v2.1.4
with:
node-version: ${{ matrix.node }}
- name: Set up Python ${{ matrix.python }}
@@ -351,7 +351,7 @@ jobs:
with:
java-version: '8'
- name: Set up Node 10
- uses: actions/setup-node@v2.1.2
+ uses: actions/setup-node@v2.1.4
with:
node-version: '10'
- name: Set up Python 3.6
diff --git a/.github/workflows/push-go-runtime.yml b/.github/workflows/push-go-runtime.yml
new file mode 100644
index 0000000000..0fc79d11f9
--- /dev/null
+++ b/.github/workflows/push-go-runtime.yml
@@ -0,0 +1,78 @@
+# Workflows pertaining to the jsii/superchain Docker image
+name: Push Jsii Runtime Go
+
+on:
+ push:
+ branches: [main]
+
+jobs:
+ push-go-runtime:
+ name: Build and Publish
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out
+ uses: actions/checkout@v2
+ - name: Set up Node 10
+ uses: actions/setup-node@v2.1.4
+ with:
+ node-version: '10'
+ - uses: actions/cache@v2
+ with:
+ path: '**/node_modules'
+ key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
+ - name: Install Dependencies
+ run: |-
+ # TypeScript project dependencies
+ yarn install --frozen-lockfile
+ - name: Align Versions
+ run: |-
+ ./scripts/align-version.sh
+ - name: Build dependencies
+ run: |-
+ yarn build \
+ --scope codemaker \
+ --scope @jsii/spec \
+ --scope @jsii/kernel \
+ --scope @jsii/runtime
+ - name: Build
+ run: |-
+ yarn build \
+ --scope @jsii/go-runtime
+ - name: Build Repo Directory
+ id: build-repo-dir
+ working-directory: ${{ github.workspace }}/packages/@jsii/go-runtime
+ env:
+ JSII_RUNTIME_REPO_NAME: ${{ secrets.JSII_RUNTIME_REPO_NAME }}
+ JSII_RUNTIME_REPO_USERNAME: ${{ secrets.JSII_RUNTIME_REPO_USERNAME }}
+ JSII_RUNTIME_REPO_TOKEN: ${{ secrets.AUTO_APPROVE_GITHUB_TOKEN }}
+ run: |-
+ REPO_DIR=$(mktemp -d)
+ yarn ts-node ./build-tools/build-repo-dir.ts $REPO_DIR
+ echo "::set-output name=repodir::$REPO_DIR"
+ - name: Check for changes
+ id: check-for-changes
+ run: |-
+ # Change directory manually as using `working-directory` doesn't seem to support using outputs from the previous step
+ cd ${{ steps.build-repo-dir.outputs.repodir }}
+ git fetch --depth=1 --quiet origin main
+ git add .
+ # Check for modifications in tracked files
+ changed=$(git diff --name-only origin/main)
+ if [-z "$changed"]; then
+ echo "::set-output name=result::false"
+ else
+ echo "::set-output name=result::true"
+ fi
+ - name: Commit and Push
+ if: steps.check-for-changes.outputs.result == 'true'
+ env:
+ JSII_RUNTIME_REPO_NAME: ${{ secrets.JSII_RUNTIME_REPO_NAME }}
+ JSII_RUNTIME_REPO_USERNAME: ${{ secrets.JSII_RUNTIME_REPO_USERNAME }}
+ JSII_RUNTIME_REPO_TOKEN: ${{ secrets.AUTO_APPROVE_GITHUB_TOKEN }}
+ run: |-
+ MESSAGE=$(git log -1 --format=%s)
+ cd ${{ steps.build-repo-dir.outputs.repodir }}
+ git config user.name "$JSII_RUNTIME_REPO_USERNAME"
+ git config user.email "aws-cdk+automation@amazon.com"
+ git commit -m "$MESSAGE"
+ git push https://$JSII_RUNTIME_REPO_USERNAME:$JSII_RUNTIME_REPO_TOKEN@github.com/$JSII_RUNTIME_REPO_NAME.git main
diff --git a/.github/workflows/yarn-upgrade.yml b/.github/workflows/yarn-upgrade.yml
index 97c29c265a..0e2d4b538a 100644
--- a/.github/workflows/yarn-upgrade.yml
+++ b/.github/workflows/yarn-upgrade.yml
@@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@v2
- name: Set up Node
- uses: actions/setup-node@v2.1.2
+ uses: actions/setup-node@v2.1.4
with:
node-version: 10
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d72bc68cd1..4bd72f8431 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,24 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+## [1.17.0](https://github.com/aws/jsii/compare/v1.16.0...v1.17.0) (2021-01-13)
+
+
+### Features
+
+* add support for bin-scripts (python only) ([#1941](https://github.com/aws/jsii/issues/1941)) ([61ef5ed](https://github.com/aws/jsii/commit/61ef5edc9696c41a45984c907dc30771c675e20b))
+* **dotnet,java:** kernel process inherits host's STDERR ([#2248](https://github.com/aws/jsii/issues/2248)) ([70ce153](https://github.com/aws/jsii/commit/70ce15312d7553bc44c2e4f8981b596563b5ecd7))
+
+
+### Bug Fixes
+
+* bad working directory in go runtime push ([#2356](https://github.com/aws/jsii/issues/2356)) ([53457e2](https://github.com/aws/jsii/commit/53457e2f6063e5f0202eac7040ad03e1ed64805e))
+* **dotnet:** Use nested classes for proxies to avoid name collision ([#2368](https://github.com/aws/jsii/issues/2368)) ([90b17e2](https://github.com/aws/jsii/commit/90b17e2a7da159879a7e618ce6f2edca336f316e)), closes [#2367](https://github.com/aws/jsii/issues/2367)
+* **go:** generated code runtime dependency version ([#2399](https://github.com/aws/jsii/issues/2399)) ([f1a06e5](https://github.com/aws/jsii/commit/f1a06e5f71e599fcf6efccaa0906cee8cd93d3e1))
+* **jsii:** errors when invoking with a project root argument ([#2351](https://github.com/aws/jsii/issues/2351)) ([9c66340](https://github.com/aws/jsii/commit/9c66340d2471db36175000c6673d1d498f4ec2c5))
+* **jsii:** unknown error in Assembler._validateHeritageClauses ([#2350](https://github.com/aws/jsii/issues/2350)) ([3120bf4](https://github.com/aws/jsii/commit/3120bf448cc160cb0249aa57a0a2bd62e35c1659)), closes [#2349](https://github.com/aws/jsii/issues/2349)
+* **pacmak:** illegal static overrides in java & c# ([#2373](https://github.com/aws/jsii/issues/2373)) ([4672e4b](https://github.com/aws/jsii/commit/4672e4b5f37a83ebfe6e2296c81839af6b296d8f)), closes [#2358](https://github.com/aws/jsii/issues/2358)
+
## [1.16.0](https://github.com/aws/jsii/compare/v1.15.0...v1.16.0) (2020-12-07)
diff --git a/README.md b/README.md
index c7d8b7cf3f..42edc866c4 100644
--- a/README.md
+++ b/README.md
@@ -16,325 +16,9 @@
A class library written in **TypeScript** can be used in projects authored in **TypeScript** or **Javascript** (as
usual), but also in **Python**, **Java**, **C#** (and other languages from the _.NET_ family), ...
-> NOTE: Due to performance of the hosted **Javascript** engine and marshaling costs, `jsii` modules are best suited for
-> development and build tools, as opposed to performance-sensitive or resource-constrained applications.
->
-> See [Runtime Architecture] for more information.
->
-> [runtime architecture]: ./docs/runtime-architecture.md
+## :question: Documentation
-### An example is worth a thousand words
-
-Consider the following **TypeScript** class:
-
-```ts
-export class HelloJsii {
- public sayHello(name: string) {
- return `Hello, ${name}!`;
- }
-}
-```
-
-By compiling our source module using `jsii`, we can now package it as modules in one of the supported target languages.
-Each target module has the exact same API as the source. This allows users of that target language to use `HelloJsii`
-like any other class:
-
-- In **Python**:
- ```python
- hello = HelloJsii()
- hello.say_hello("World"); # => Hello, World!
- ```
-- In **Java**
- ```java
- final HelloJsii hello = new HelloJsii();
- hello.sayHello("World"); // => Hello, World!
- ```
-- In **C#**
- ```csharp
- var hello = new HelloJsii();
- hello.SayHello("World"); // => Hello, World!
- ```
-- ... and more to come!
-
-## Toolchain
-
-**jsii** consists of multiple single-purposed programs which can be used to compose various workflows.
-
-> We are considering creating an "umbrella entrypoint" to make it easier to consume.
-
-| Name | Stability | Description |
-| ---------------- | ------------ | --------------------------------------------------------------------- |
-| [`jsii`] | Stable | Compiles TypeScript to jsii module |
-| [`jsii-pacmak`] | Stable | Creates ready-to-publish language-specific packages from jsii modules |
-| [`jsii-reflect`] | Stable | Strong-typed reflection library for jsii type systems |
-| [`jsii-diff`] | Stable | API backwards compatibility checker |
-| [`jsii-rosetta`] | Experimental | Transpile code snippets (in docs) from TypeScript to jsii languages |
-| [`jsii-config`] | Experimental | Interactive tool for generating jsii configuration |
-| [`jsii-release`] | Community | Publishes jsii modules to all supported package managers |
-| [`jsii-srcmak`] | Community | Generates relocatable source code in jsii languages from typescript |
-| [`jsii-docgen`] | Community | Generates markdown API documentation for jsii modules |
-
-[`jsii`]: https://github.com/aws/jsii/tree/main/packages/jsii
-[`jsii-pacmak`]: https://github.com/aws/jsii/tree/main/packages/jsii-pacmak
-[`jsii-reflect`]: https://github.com/aws/jsii/tree/main/packages/jsii-reflect
-[`jsii-config`]: https://github.com/aws/jsii/tree/main/packages/jsii-config
-[`jsii-diff`]: https://github.com/aws/jsii/tree/main/packages/jsii-diff
-[`jsii-rosetta`]: https://github.com/aws/jsii/tree/main/packages/jsii-rosetta
-[`jsii-release`]: https://github.com/eladb/jsii-release
-[`jsii-srcmak`]: https://github.com/eladb/jsii-srcmak
-[`jsii-docgen`]: https://github.com/eladb/jsii-docgen
-
-> _"Community"_: a community-maintained project, not officially supported by the jsii team.
-
-## Getting Started
-
-Let's create our first jsii TypeScript module (actual outputs may slightly differ):
-
-```console
-$ mkdir hello-jsii
-$ cd hello-jsii
-$ npm init -y
-Wrote to /tmp/hello-jsii/package.json:
-
-{
- "name": "hello-jsii",
- "version": "1.0.0",
- "description": "",
- "main": "index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "keywords": [],
- "author": "",
- "license": "ISC"
-}
-$ npm i --save-dev jsii jsii-pacmak
-npm notice created a lockfile as package-lock.json. You should commit this file.
-npm WARN hello-jsii@1.0.0 No description
-npm WARN hello-jsii@1.0.0 No repository field.
-
-+ jsii-pacmak@0.14.3
-+ jsii@0.14.3
-added 65 packages from 54 contributors and audited 191 packages in 7.922s
-found 0 vulnerabilities
-```
-
-Edit the `package.json` file:
-
-```js
-/// package.json
-{
- // ...
- "main": "lib/index.js",
- "types": "lib/index.d.ts",
- "scripts": {
- "build": "jsii",
- "build:watch": "jsii -w",
- "package": "jsii-pacmak"
- },
- "jsii": {
- "outdir": "dist",
- "targets": {
- "python": {
- "distName": "acme.hello-jsii",
- "module": "acme.hello_jsii"
- },
- "java": {
- "package": "com.acme.hello",
- "maven": {
- "groupId": "com.acme.hello",
- "artifactId": "hello-jsii"
- }
- },
- "dotnet": {
- "namespace": "Acme.HelloNamespace",
- "packageId": "Acme.HelloPackage"
- }
- }
- },
- "author": {
- "name": "John Doe"
- },
- "repository": {
- "url": "https://github.com/acme/hello-jsii.git"
- }
- // ...
-}
-```
-
-Read more about what those configuration entries do in the [configuration] documentation.
-
-[configuration]: ./docs/configuration.md
-
-Okay, we are ready to write some code. Create a `lib/index.ts` file:
-
-```ts
-/// lib/index.ts
-export class HelloJsii {
- public sayHello(name: string) {
- return `Hello, ${name}!`;
- }
-}
-```
-
-Build your module:
-
-```console
-$ npm run build
-```
-
-If build succeeds, you will see the resulting `lib/index.js` and `lib/index.d.ts` files were produced, as well as the
-`.jsii` file (contents may vary):
-
-```js
-/// .jsii
-{
- "author": {
- "name": "John Doe",
- "roles": [
- "author"
- ]
- },
- "description": "hello-jsii",
- "homepage": "https://github.com/acme/hello-jsii.git",
- "jsiiVersion": "0.14.3 (build 1b1062d)",
- "license": "ISC",
- "name": "hello-jsii",
- "repository": {
- "type": "git",
- "url": "https://github.com/acme/hello-jsii.git"
- },
- "schema": "jsii/0.10.0",
- "targets": {
- "dotnet": {
- "namespace": "Acme.HelloNamespace",
- "packageId": "Acme.HelloPackage"
- },
- "java": {
- "maven": {
- "artifactId": "hello-jsii",
- "groupId": "com.acme.hello"
- },
- "package": "com.acme.hello"
- },
- "js": {
- "npm": "hello-jsii"
- },
- "python": {
- "distName": "acme.hello-jsii",
- "module": "acme.hello_jsii"
- }
- },
- "types": {
- "hello-jsii.HelloJsii": {
- "assembly": "hello-jsii",
- "fqn": "hello-jsii.HelloJsii",
- "initializer": {},
- "kind": "class",
- "locationInModule": {
- "filename": "lib/index.ts",
- "line": 1
- },
- "methods": [
- {
- "locationInModule": {
- "filename": "lib/index.ts",
- "line": 2
- },
- "name": "sayHello",
- "parameters": [
- {
- "name": "name",
- "type": {
- "primitive": "string"
- }
- }
- ],
- "returns": {
- "type": {
- "primitive": "string"
- }
- }
- }
- ],
- "name": "HelloJsii"
- }
- },
- "version": "1.0.0",
- "fingerprint": "XYWYOiOupH4MmIjFj84wTSRfWqSw8hW37vHkVMO7iuY="
-}
-```
-
-This file includes all the information needed in order to package your module into every `jsii`-supported language. It
-contains the module metadata from `package.json` and a full declaration of your module's public API.
-
-Okay, now the magic happens:
-
-```console
-$ npm run package
-
-> hello-jsii@1.0.0 package /Users/rmuller/Development/Demos/hello-jsii
-> jsii-pacmak -v
-
-[jsii-pacmak] [INFO] Building hello-jsii (python,java,dotnet,js) into dist
-[jsii-pacmak] [INFO] Packaged. java (4.3s) | dotnet (2.0s) | python (0.9s) | npm pack (0.5s) | js (0.0s)
-```
-
-Now, if you check out the contents of `dist`, you'll find:
-
-```
-dist
-├── dotnet
-│ ├── Acme.HelloPackage.1.0.0.nupkg
-│ └── Acme.HelloPackage.1.0.0.symbols.nupkg
-├── java
-│ └── com
-│ └── acme
-│ └── hello
-│ └── hello-jsii
-│ ├── 1.0.0
-│ │ ├── hello-jsii-1.0.0-javadoc.jar
-│ │ ├── hello-jsii-1.0.0-javadoc.jar.md5
-│ │ ├── hello-jsii-1.0.0-javadoc.jar.sha1
-│ │ ├── hello-jsii-1.0.0-sources.jar
-│ │ ├── hello-jsii-1.0.0-sources.jar.md5
-│ │ ├── hello-jsii-1.0.0-sources.jar.sha1
-│ │ ├── hello-jsii-1.0.0.jar
-│ │ ├── hello-jsii-1.0.0.jar.md5
-│ │ ├── hello-jsii-1.0.0.jar.sha1
-│ │ ├── hello-jsii-1.0.0.pom
-│ │ ├── hello-jsii-1.0.0.pom.md5
-│ │ └── hello-jsii-1.0.0.pom.sha1
-│ ├── maven-metadata.xml
-│ ├── maven-metadata.xml.md5
-│ └── maven-metadata.xml.sha1
-├── js
-│ └── hello-jsii@1.0.0.jsii.tgz
-└── python
- ├── acme.hello-jsii-1.0.0.tar.gz
- └── acme.hello_jsii-1.0.0-py3-none-any.whl
-```
-
-These files are ready-to-publish artifacts for each target language. You can see the npm tarball under `js`, the
-`python` package under `python`, the Maven repo under `java`, etc...
-
-That's it. You are ready to rock!
-
-## Features
-
-### Source Languages
-
-- **TypeScript** with [some restrictions](docs/typescript-restrictions.md)
-
-### Target Languages
-
-- **Javascript** - generates an NPM package implicitly (no configuration required).
-- **Python** - generates a ready-to-publish PyPI package.
-- **Java** - generates a ready-to-publish Maven package.
-- **.NET** - generates a ready-to-publish NuGet package.
-
-See the [configuration](./docs/configuration.md#targets) documentation for more information on configuring the various
-targets.
+Head over to our [documentation website](https://aws.github.io/jsii)!
# :book: Blog Posts
@@ -343,12 +27,17 @@ Here's a collection of blog posts (in chronological order) related to `jsii`:
- **2020-01-11:** [How to Create CDK Constructs][mbonig-2020-01-11], by [Matthew Bonig][@mbonig]
- **2020-05-27:** [Generate Python, Java, and .NET software libraries from a TypeScript
source][floydpink-2020-05-27], by [Hari Pachuveetil][@floydpink]
+- **2020-12-23:** [How the jsii open source framework meets developers where they are
+ ][romain-2020-12-23], by [Romain Marcadier][@RomainMuller]
[mbonig-2020-01-11]: https://www.matthewbonig.com/2020/01/11/creating-constructs/
[floydpink-2020-05-27]:
https://aws.amazon.com/fr/blogs/opensource/generate-python-java-dotnet-software-libraries-from-typescript-source/
+[romain-2020-12-23]:
+ https://aws.amazon.com/blogs/opensource/how-the-jsii-open-source-framework-meets-developers-where-they-are/
[@mbonig]: http://www.matthewbonig.com/
[@floydpink]: https://harimenon.com/
+[@romainmuller]: https://github.com/RomainMuller
> :information_source: If you wrote blog posts about `jsii` and would like to have them referenced here, do not hesitate
> to file a pull request to add the links here!
@@ -366,135 +55,140 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
-
+
-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification.
diff --git a/docs/.prettierrc.yaml b/docs/.prettierrc.yaml
deleted file mode 100644
index 68eb9c7c5b..0000000000
--- a/docs/.prettierrc.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-printWidth: 120
-proseWrap: always
-semi: true
-singleQuote: true
-quoteProps: as-needed
-trailingComma: all
diff --git a/docs/assembly.md b/docs/assembly.md
deleted file mode 100644
index f4015a509e..0000000000
--- a/docs/assembly.md
+++ /dev/null
@@ -1,184 +0,0 @@
-# `.jsii` Assemblies
-
-This document describes the contents of the `.jsii` assembly documents generated
-by the `jsii` compiler, and explains the semantics behind the various entities
-it represents. This serves as a reference for front-end language implementors.
-
-## Schema
-
-`.jsii` assemblies are JSON-formatted documents. The specification is hosted
-under the [`jsii-spec`](../packages/jsii-spec) package. Refer to the inline
-documentation in the [`spec.ts`](../packages/jsii-spec/lib/spec.ts) file for
-more information about the general content of the assembly documents.
-
-The most important part of the assembly documentation, which is described in
-detail in this document, is the `types` map, which contains the descriptions of
-all types declared by the `.jsii` assembly. It is a map from `jsii` fully-
-qualified type names to a type specification.
-
-All `boolean` attributes in the document specification are optional, and are
-left out (`undefined`) when `false`.
-
-### Common Attributes
-
-Certain optional attributes are shared by API entities (types and members):
-
-* `docs` - documentation attached to the API entity
- * `deprecated` - contains a message explaining why an API was deprecated
- and/or how users should migrate away
- * `stability` - the stability level of the API entity. The ultimate meaning of
- the stability level is up to the package maintainer, but a baseline
- interpretation of the valid values follows:
- + `experimental` denotes an API that is actively worked on and are not
- subject to semantic versioning gurantees (they may receive breaking
- change on a *minor* version release)
- + `stable` denotes an API that is safe to use in production systems and
- are subject ot semantic versioning guarantees (they may not receive
- breaking changes without a *major* version bump)
- + `deprecated` denotes an API that should no longer be used. The
- `deprecated` entry in the `docs` object should contain a message
- explaining how users should migrate away
- + `external` denotes an API that is not owned by the package's maintainer
- and may change in unexpected ways. Such APIs are usually derived from
- external artifacts, which the package maintainers do not have control
- over.
- * additional entries represent user-defined `JSDoc` tags with meaning defined
- by convention and/or the package maintainer
-* `locationInModule` - coordinates of the declaration in the source
- * `fileName` - the path to the source file, relative to the package root
- * `line` - the line number on which the entity is declared (or the first line
- when a declaration spans multiple lines)
-
-### Types
-
-#### Classes
-
-Attribute | Type | Description
--------------|-------------|----------------------------------------------------
-`kind` |`'class'` |Discriminator to identify classes
-`abstract` |`boolean` |Whether this class is *abstract*
-`assembly` |`string` |The name of the assembly this class is a part of
-`base` |`string` |The fully-qualified name of the parent class of this class
-`fqn` |`string` |The fully-qualified name of the class
-`initializer`|`Constructor`|The class' [constructor]
-`interfaces` |`string[]` |The fully-qualified names of interfaces implemented by this class
-`methods` |`Method[]` |The [methods] declared by this class
-`name` |`string` |The simple name of the class
-`properties` |`Property[]` |The [properties] declared by this class
-
-[constructor]: #constructors
-[interfaces]: #interfaces
-[methods]: #methods
-[properties]: #properties
-
-#### Interfaces
-
-`jsii` interfaces are declarations of type signatures that can be implemented by
-classes. *Interface* names must be prefixed with an `I` (e.g: `IFoo`).
-
-Attribute | Type | Description
--------------|-------------|----------------------------------------------------
-`kind` |`'interface'`|Discriminator to identify interfaces
-`assembly` |`string` |The name of the assembly this interface is a part of
-`fqn` |`string` |The fully-qualified name of the interface
-`interfaces` |`string[]` |The fully-qualified names of interfaces extended by this interface
-`methods` |`Method[]` |The [methods] declared by this interface
-`name` |`string` |The simple name of the interface
-`properties` |`Property[]` |The [properties] declared by this interface
-
-#### Structs (a.k.a. Data Types)
-
-*Structs* (or *Data Types*) are immutable, data-only interfaces:
-* They declare no methods
-* All [properties] they declare are `readonly`
-* They can only implement other *structs*
-* They cannot be extended by interfaces that are not *structs*
-* They cannot be implemented by *classes*
-
-Unlike regular *interfaces*, `jsii` *struct* names are not required to have
-any particular prefix.
-
-Since those are immutable, pure data objects, the `jsii-runtime` exchanges
-instances of those *by value*, instead of *by reference*, allowing to save
-cross-language communication overhead when working with the data.
-
-Attribute | Type | Description
--------------|--------------|----------------------------------------------------
-`kind` |`'interface'` |Discriminator to identify interfaces
-`datatype` |`true` |Indicates a *struct* / *data type* declaration
-`assembly` |`string` |The name of the assembly this struct is a part of
-`fqn` |`string` |The fully-qualified name of the struct
-`interfaces` |`string[]` |The fully-qualified names of *struct* extended by this *struct*
-`name` |`string` |The simple name of the struct
-`properties` |`Property[]` |The [properties] declared by this struct (all `readonly`)
-
-#### Enums
-
-Attribute | Type | Description
--------------|--------------|---------------------------------------------------
-`kind` |`'enum'` |Discriminator to identify enums
-`assembly` |`string` |The name of the assembly this enum is a part of
-`fqn` |`string` |The fully-qualified name of the enum
-`members` |`EnumMember[]`|The [enum members] declared by this enum
-`name` |`string` |The simple name of the enum
-
-[enum members]: #enum-members
-
-### Members
-
-#### Constructors
-
-Attribute | Type | Description
--------------|--------------|---------------------------------------------------
-`overrides` |`string` |The fully-qualified name of the class/interface that declares the overridden constructor
-`parameters` |`Parameter[]` |Parameters of this constructor
-`protected` |`boolean` |Whether this constructor is protected
-`variadic` |`boolean` |Whether the last parameter is `variadic`
-
-#### Enum Members
-
-Attribute | Type | Description
--------------|--------------|---------------------------------------------------
-`name` |`string` |The name of the enum member. Must be `UPPER_SNAKE_CASED`
-
-#### Methods
-
-Attribute | Type | Description
--------------|---------------|--------------------------------------------------
-`abstract` |`boolean` |Whether this method is `abstract`
-`async` |`boolean` |Whether this method is asynchronous
-`name` |`string` |The name of the method
-`overrides` |`string` |The fully-qualified name of the class/interface that declares the overridden method
-`parameters` |`Parameter[]` |Parameters of this method
-`protected` |`boolean` |Whether this method is protected
-`returns` |`OptionalValue`|The return type of the method
-`static` |`boolean` |Whether this method is `static`
-`variadic` |`boolean` |Whether the last parameter is `variadic`
-
-Methods with the `abstract` feature may only be members of `abstract` classes or
-[interfaces], and all methods that are members of [interfaces] must be
-`abstract`.
-
-Methods that are `static` cannot feature the `overrides` attribute, as `static`
-members are not inherited.
-
-#### Properties
-
-Attribute | Type | Description
--------------|---------------|--------------------------------------------------
-`abstract` |`boolean` |Whether this property is `abstract`
-`const` |`boolean` |Whether this property is a constant (implies `static` and `immutable`)
-`immutable` |`boolean` |Whether this property is immutable
-`name` |`string` |The name of the property
-`optional` |`boolean` |Whether this property is optional
-`overrides` |`string` |The fully-qualified name of the class/interface that declares the overridden property
-`protected` |`boolean` |Whether this constructor is protected
-`static` |`boolean` |Whether this property is `static`
-`type` |`TypeReference`|The type of the property
-
-Properties that are `const` must have a `name` that is `UPPER_SNAKE_CASED`. They
-represent constants similar to [Enum Members], which can be proactively resolved
-by the `jsii` runtimes.
-
-Properties that are `static` cannot feature the `overrides` attribute, as
-`static` members are not inherited.
diff --git a/docs/handbooks/language-implementation.md b/docs/handbooks/language-implementation.md
deleted file mode 100644
index 931ab54f7d..0000000000
--- a/docs/handbooks/language-implementation.md
+++ /dev/null
@@ -1,217 +0,0 @@
-# Language Implementation Handbook
-
-This handbook provides an overview of the process that should be followed when
-looking to implement support for a new programming language in *jsii*. It
-attempts to provide a step-by-step procedure, while drawing the reader's
-attention on points that have been found to cause problems in the past.
-
-__Table of Contents__
-1. [Foreword](#foreword)
-1. [Scoping & Planning](#scoping-&-planning)
- 1. [Language Proposition RFC](#language-proposition-rfc)
-1. [Code Generation](#code-generation)
-1. [Host Library](#host-library)
-1. [Building & Packaging](#building-&-packaging)
-1. [Documentation](#documentation)
-1. [Developer Preview](#developer-preview)
-1. [General Availability](#general-availability)
-
---------------------------------------------------------------------------------
-
-## Foreword
-
-Implementing a new language in *jsii* is not just a matter of implementing code
-generation. Mapping the *[jsii type system]* to a new programming language means
-finding how to represent an API originally designed in TypeScript to a form that
-is as idiomatic as possible in the new language. This is a craft that often
-requires trial and error, and the best (if not only) way to validate a proposal
-is to put it in front of users and seek feedback. As a consequence, this
-endeavor should be expected to span months, not weeks.
-
-
-## Scoping & Planning
-
-The first step of most successful projects is to start by scoping work out and
-establishing a baseline plan to execute on. For contributors not yet familiar
-with *jsii*, the [specification] document is a great place to start. In
-particular, the [New Language Intake] document provides a high-level view of the
-recommended process for implementing new language support.
-
-The work of implementing support for a new language involves many different
-components:
-- The [`jsii`] compiler emits warnings when a language's reserved words are used
- to name types, methods or properties; as this will later require slugification
- or escaping in the generated code - usually resulting in a degraded developer
- experience.
-- The [`jsii-pacmak`] tool includes code generators for all supported languages,
- and a new implementation must be provided for the new language.
-- Code generation usually requires specific configuration to be provided in
- order to be able to generate valid packages (for example, the **Java** code
- generator requires a base java package to generate into, as well as a Maven
- group and artifact ID for the package). The [`jsii-config`] tool needs to be
- updated with support generating a configuration block with the required
- entries for the new code generator.
-- [`jsii-rosetta`] tool translates **TypeScript** example code found in the
- original documentation into the new target language. A new translation
- implementation needs to be added for the new language.
-- Building and publishing infrastructure elements are provided by
- [`aws-delivlib`] to make it easier for *jsii* users to publish their libraries
- to all supported package registries.
-
-### Language Proposition RFC
-
-The recommended way to formalize the initial plan is to write it into an RFC
-hosted in the [CDK RFC repository]. Enough time has to be spent considering the
-requirements in order to get the work scoped and planned well, ensuring smooth
-execution.
-
-An additional benefit of following the RFC process is that it makes it easier
-to track learnings accumulated through the implementation process, as those will
-be tracked as comments or iterations on the RFC document.
-
-It is possible (and sometimes desirable) to start prototyping code-generation
-for the new language, as this can highlight implementation challenges that need
-to be discussed in the RFC document. In any case, examples of the API signatures
-that are expected to be rendered allow early feedback to be provided by possible
-future users, and still helps identify challenges.
-
-The following questions should be answered as early as possible in the process,
-to avoid surprises later on that result in significant re-engineering effort:
-
-* What do the generated APIs look like, for the typical API idioms?
- - *Classes* (constructors, properties, methods, inheritance strategy, abstract
- members, ...)
- + The [AWS CDK] (one of the main consumers of *jsii*) uses specific patterns
- to offer a better experience in many programming languages. For example,
- constructor signatures where the last argument is a *jsii struct* allows
- for keyword argument lifting in **Python**, and convenient `Builder` APIs
- in **Java**.
- - *Enums*
- - *Interfaces* and *Structs* (properties, methods, inheritance strategy,
- implementation, ...). In particular, how are new optional properties handled
- (those are not considered breaking change within the [jsii type system]).
- - *Structs* (properties, inheritance strategy, implementation, ...)
-* What information is needed in order for the code-generator to produce
- artifacts? What should the configuration block look like?
-* What is the standard way to publish packages for the new language?
- - Are there any requirements (code signature, special metadata, ...) that need
- to be implemented in order to publish valid packages?
- - How are dependencies modeled? If [semantic versioning] is not the norm,
- what is the strategy to correctly represent semantic version ranges?
-* What are the toolchain and platform requirements?
- - For example, **Java** requires an OpenJDK 8 distribution and `maven`,
- **Python** requires `python` 3.6 or above, etc...
-
-## Code Generation
-
-First, implement a first version of the code generation for the new language
-before getting too far into the *[host library](#host-library)* implementation.
-This top-down approach ensures the requirements for the lower level parts of
-the implementation are well-defined before they are implemented (reducing the
-chances that significant re-work has to be done), and enables using the [Standard
-Compliance Suite] to ensure the overall implementation is *correct* according
-to the [specification] (since the code necessary to implement the test cases
-will be available right from the start).
-
-This work happens within the [`jsii-pacmak`] package.
-
-Focus initially on the API signatures before getting into their implementation.
-The first version may even throw a *not implemented* exception when called.
-
-The [`jsii-calc`] package, can be used as a sample consuming library which uses
-*jsii* to generate code in all target languages. Start by making sure a decent
-API is generated from this package and its dependencies, and use those to
-implement the tests from the [Standard Compliance Suite]. You'll also get a
-feeling for whether the generated code achieves a good developer experience or
-not.
-
-## Host Library
-
-Now that we are generating "empty shell" APIs that represent the necessary
-entities to back the [Standard Compliance Suite] tests, start implementing the
-*host library* and update the code generator until all the tests pass. It is
-possible to publish artifacts even when tests in the suite are failing. As soon
-as basic features are working, work on [Building and
-Packaging](#building-and-packaging) can start, so early feedback can be
-gathered.
-
-> :construction: A standard architecture for the *host library* has not been
-> documented yet. Upcoming language implementations should contribute to this
-> process by documenting a general architecture that should be implementable
-> in any programming languages (and thus, abstracting away language
-> specificities).
-
-## Building & Packaging
-
-The necessary toolchains should be added to he [`jsii/superchain`] Docker image,
-so that the [`jsii-pacmak`] generation can be changed to support building ready
-to publish artifacts instead of just code.
-
-Before publishing any artifacts, ensure all packages (the *host library* as well
-as generated artifacts) are designated as *experimental* (e.g: **Python**
-packages were annotated with the `Development Status :: 4 - Beta` trove
-classifier on PyPI, and **NuGet** packages were published with a pre-release
-version such as `1.2.3-pre`).
-
-Additionally, [`aws-delivlib`] needs to be augmented to support publishing
-artifacts to the language's package repository.
-
-> :construction: The package publishing is being extracted from [`aws-delivlib`]
-> into a standalone library, currently hosted at
-> [`eladb/jsii-release`](https://github.com/eladb/jsii-release).
-
-## Documentation
-
-Before releasing the new language support to *Developer Preview*, basic
-documentation needs to be produced to explain how to configure a *jsii* project
-to support the new language, and any peculiarities in working with libraries
-generated by [`jsii-pacmak`] for this language.
-
-Support for example code translation should also be built into [`jsii-rosetta`].
-
-## Developer Preview
-
-Once the full [Standard Compliance Suite] passes (possibly with the exception of
-certain fringy features), and the documentation covering all aspects of using
-the language bindings have been produced, the new language can be released to
-*Developer Preview*.
-
-It is recommended that new languages stay in *Developer Preview* for a minimum
-of 4 weeks, ideally until they have received sufficient usage to have built
-confidence that there are no major usability concerns: once out of *Developer
-Preview*, it will no longer be possible to introduce breaking changes to the
-generated code in order to address usability issues or bugs.
-
-In order to improve the chances of catching usability issues, focused user
-experience studies will be conducted with an audience composed of developers
-with varied degrees of experience with the new language.
-
-> :construction: A user experience template will be provided to ensure coverage
-> of critical aspects of the experience. Any critical user experience issue
-> (for example, issues that required breaking changes to the generated code)
-> discovered but not covered in the template should be added to the template so
-> that subsequent language implementations do not fall to the same problem.
-
-## General Availability
-
-Once the new language has been in *Developer Preview* without any significant
-usability issues or bugs for a sufficient amount of time and is used in
-real-world use-cases such as for [AWS CDK] applications, it becomes a candidate
-to be declared *Generally Available*. At this point, breaking changes are no
-longer possible on the generated code.
-
-
-[jsii type system]: ../specifications/2-type-system.md
-[specification]: ../specifications/1-introduction.md
-[New Language Intake]: ../specifications/5-new-language-intake.md
-[CDK RFC repository]: https://github.com/awslabs/aws-cdk-rfcs#readme
-[`jsii`]: ../../packages/jsii
-[`jsii-calc`]: ../../packages/jsii-calc
-[`jsii-config`]: ../../packages/jsii-config
-[`jsii-pacmak`]: ../../packages/jsii-pacmak
-[`jsii-rosetta`]: ../../packages/jsii-rosetta
-[Standard Compliance Suite]: ../specifications/4-standard-compliance-suite.md
-[`jsii/superchain`]: ../../superchain
-[`aws-delivlib`]: https://github.com/awslabs/aws-delivlib
-[AWS CDK]: https://github.com/aws/aws-cdk
-[semantic versioning]: https://semver.org
diff --git a/docs/specifications/1-introduction.md b/docs/specifications/1-introduction.md
deleted file mode 100644
index b43133de1c..0000000000
--- a/docs/specifications/1-introduction.md
+++ /dev/null
@@ -1,210 +0,0 @@
-# Introduction
-
-This document provides a high level overview of *jsii*, starting with its
-design tenets. It introduces the concepts and components that compose *jsii*.
-
-
-## Updating the Specification
-
-### Introduction
-
-The *jsii* specification follows the guiding principles of an RFC. It is a
-living document that describes the current understanding of how the various
-[components](#components) of *jsii* are operating, as well as the approaches
-used to ensure consistent behavior across the various supported languages.
-
-The document is hosted with the *jsii* codebase, making it easy to determine
-what specification was in place at the time of a give *jsii* release (by ways of
-referring to the `vX.Y.Z` git tag). A single version of the specification is
-considered **active** at any given time: the version of the specification that
-is represented on the `HEAD` commit of the `main` branch of the [`aws/jsii`]
-repository. The **active** specification must be the base version for any update
-proposal.
-
-[`aws/jsii`]: https://github.com/aws/jsii
-
-The process to update the specification is intended to be as lightweight as
-possible, while ensuring sufficient conversation takes place before implementing
-significant (and breaking) changes. Since the process to update the
-specification is part of the specification itself, it is amenable to be changed
-following the process described in the currently **active** specification.
-
-### Process
-
-While the general process for updating the specification is to create a GitHub
-pull request against the [`aws/jsii`] repository, the exact requirements for
-what should be included in the pull request vary depending on the type of update
-that is proposed:
-
-- [:warning: Changing Behavior](#new-behavior) describes the process to be
- followed when introducing changes to the behavior of any component of *jsii*:
- new features, breaking changes to existing features, ...
-- [:mag: Addressing Gaps](#addressing-gaps) is the process used for adding
- specification around existing but unspecified behavior.
-- [:thumbsup: Trivial Changes](#trivial) explains how to propose changes that
- improve the specification without changing its meaning.
-
-#### :warning: Changing Behavior
-
-If the change is **not backwards compatible** (it is a breaking change to an
-existing feature, or it is a new feature that requires all runtime libraries
-implement support immediately), a new RFC should be created in the
-[`awslabs/aws-cdk-rfcs`] repository, following the [RFC Process]. This ensures
-enough time is spent considering alternatives to breaking changes, and to create
-consensus that the change is desirable before time is spent implementing it.
-
-[`awslabs/aws-cdk-rfcs`]: https://github.com/awslabs/aws-cdk-rfcs
-[RFC Process]: https://github.com/aws/aws-cdk-rfcs#what-the-process-is
-
-> While going through the RFC process upfront is **strongly recommended**,
-> contributors may choose not to file an RFC for a behavior change. In this case
-> however, any core maintainer may decide that an RFC is required and block the
-> contribution until the RFC process has been followed.
->
-> It is worth noting that a draft pull request with proposed modifications to
-> the specification (and possibly a proof-of-concept implementation), can b
-
-When the RFC is **ready**, a GitHub pull request is created that must contain:
-
-- Relevant additions or modifications to the specification documents
-- Relevant additions or modifications to the compliance suite
-- Implementation of the new behavior, including new or updated tests in all the
- language bindings
-
-The pull request's body must reference the RFC if there has been one, and
-otherwise must include all discussion necessary to explain the reasoning behind
-the proposal (including alternatives considered, risks, ...).
-
-#### :mag: Addressing Gaps
-
-Proposals that increase the specification's coverage (desribing behavior that
-already exists) are handled as GitHub pull requests that must contain the
-following elements:
-
-- Relevant additions to the specification documents
-- New compliance test(s) that enshrine the described behavior
-- Implementation of the new compliance test(s) for all *Generally Available*
- language bindings
-
-The pull request body should provide pointers to any and all elements that can
-be used to verify that the behavior that is described is indeed what is
-currently implemented.
-
-#### :thumbsup: Trivial Changes
-
-Proposal of trivial changes, such as correcting typos in the document, or
-re-phrasing elements of the specification without altering the meaning
-(typically to improve clarity) are handled in a simple GitHub pull request.
-
-
-## Design Tenets (unless you know better ones)
-
-* *jsii* APIs strive to feel idiomatic in all supported languages.
-* *jsii* applications behave identically regardless of the language they are
- written in. It favors correctness over performance.
-* *jsii* **does not** attempt to support all TypeScript idioms (many features of
- TypeScript cannot be expressed in some target languages).
- * Unsupported idioms will cause a compile-time error to be emitted.
- * When prohibiting an idiom, *jsii* strives to provide an error message that
- gives the user insight into why the pattern cannot be supported.
-* *jsii* does not force API design opinions on the developer:
- * Reserved names are limited to a minimum.
- * TypeScript API design patterns that are known to result in poor developer
- experience when represented in other languages will cause warnings to be
- issued, but the developer is ultimately entitled to decide whether they want
- to take or leave the advice.
-* *jsii* produces artifacts compatible with idiomatic tools whenever possible:
- * Generated libraries can be easily published to the "standard" package
- repository for the language.
- * Standard tools can be used to work with the generated libraries, and do not
- require any special configuration.
-
-
-## Annotations
-
-Annotations are present in the *jsii* specification to provide additional
-information to the reader that is non-normative. Those take the form of
-block-quotes that use the following chart:
-
-- > :construction: Is used to annotate parts of the specification that are known
- > to be partially or incorrectly implemented in the current releases. Those
- > are known issues in the current implementation that will be addressed in the
- > future.
-
-- > :question: Is used to annotate open questions. They are typically in parts
- > of the specification that is likely to change in future releases, and that
- > may be good candidates for introducing RFCs.
-
-- > :warning: Is used to draw the reader's attention on specific points. They
- > are used primarily to help the reader identify areas of the specification
- > that, when incorrectly implemented, may result in hard-to-troubleshoot bugs;
- > or to identify behavior that is intentionally undefined.
-
-- > :information_source: Is used to provide additional context which may not be
- > obvious to the reader. They typically contain trivia that can help the
- > reader understand the motivation for certain behaviors that are not always
- > intuitive.
-
-## Concepts
-
-*jsii* allows developers to author code once in **TypeScript**, while allowing
-use in a variety of other programming languages (including **C#**, **Java** and
-**Python**).
-
-### Assemblies
-
-The *jsii Assembly* document contains a specific representation of the API
-exported by the **TypeScript** module. Similar to a header file in the **C++**
-world, it contains only information about the signatures of APIs (type names
-with method and property signatures, associated documentation elements, ...) and
-no implementation.
-
-The *npm* package produced as a result of compiling the **TypeScript** source
-remains the source of truth with respects to implementation of the API.
-
-### Host & Kernel
-
-The [*jsii* runtime architecture] defines two processes:
-
-1. The *host* process runs the users' code native environment (a Java virtual
- machine, the .NET Runtime, ...).
-2. The *kernel* process hosts the **JavaScript** code from the standard *npm*
- package defined by the user (and their dependencies), which is loaded and
- managed by a standardized `@jsii/kernel` package.
-
-The *host* process is responsible for starting the *kernel* process as needed. A
-designated *host runtime library* provides helper functions that will perform
-the necessary initialization when needed, so the *host* app does not need to
-include any special boilerplate code.
-
-The two processes exchange messages over a designated communication channel (for
-example, using pipes), using a *kernel API* that is standardized in the *jsii
-specification*.
-
-[*jsii* runtime architecture]: ../runtime-architecture.md
-
-
-## Components
-
-Several tools are involved in making this possible:
-
-* [`jsii`] is a modified **TypeScript** compiler. In addition to generating
- **JavaScript** code from the source, it produces a *jsii Assembly* document.
-* [`jsii-pacmak`] generates language bindings from a package compiled using
- `jsii`. It generates code in *host* languages that expose the API declared in
- the *jsii Assembly* document.
-* *Host runtime libraries* centralize features used by code generated by
- [`jsii-pacmak`], such as primitives to interact with the *kernel* process, so
- that this code does not need to be duplicated in every generated module.
-* [`@jsii/kernel`] (and [`@jsii/runtime`]) provide the functionality exposed by
- the *kernel* process, and allow the *host* code to seamlessly interact with
- the **JavaScript** implementation.
-
-[`jsii`]: ../../../packages/jsii
-[`jsii-pacmak`]: ../../../packages/jsii-pacmak
-[`@jsii/kernel`]: ../../../packages/@jsii/kernel
-[`@jsii/runtime`]: ../../../packages/@jsii/runtime
-
---------------------------------------------------------------------------------
-
-Continue to [Type System](./2-type-system.md)
diff --git a/docs/specifications/2-type-system.md b/docs/specifications/2-type-system.md
deleted file mode 100644
index ab906b4421..0000000000
--- a/docs/specifications/2-type-system.md
+++ /dev/null
@@ -1,420 +0,0 @@
-# The *jsii* type system
-
-## Preamble
-The base language for authoring *jsii* libraries for re-use from other languages
-is **TypeScript**, which compiles to **JavaScript**. Consequently, the base type
-system that *jsii* sources from is that of **TypeScript**.
-
-When used from another language than **TypeScript** or **JavaScript**, *jsii*
-libraries are running the **JavaScript** code in a child *node* process, and
-data is exchanged using **JSON**-based protocol.
-
-This document describes how **TypeScript** types map into the *jsii* type
-system.
-
-The API represented by the *jsii* assembly only covers declarations that are
-exported from the main file in the **TypeScript** project (as specified in the
-`package.json` file by the `types` attribute). Restrictions described in this
-document only apply to such declarations, the rest of the module can leverage
-any **TypeScript** feature.
-
-## Basic Types
-
-### Introduction
-In order to build useful programs, the simplest units of data need to be
-modeled: booleans, numbers, strings, etc... Those basic building blocks are the
-foundations on which APIs stand. *jsii* supports much of the same types that
-**TypeScript** and **JavaScript** support, although with notable differences.
-
-### Boolean
-The *jsii* type system mirrors **TypeScript**'s `boolean`, which is the simplest
-primitive data types, with only two supported values: `true` and `false`.
-
-### Number
-The *jsii* type system mirrors **TypeScript**'s `number`. All numbers are
-floating point values.
-
-### String
-The *jsii* type system mirrors **TypeScript**'s `string`. Strings are used to
-represent textual data.
-
-### List
-**TypeScript** arrays (`Array`, `T[]`, `ReadonlyArray` and `readonly T[]`)
-are represented as *lists* in the *jsii* type model. Lists are shared between
-the *node* process and the host process by-value, meaning a copy of the array is
-produced each time it is passed through the process boundary.
-
-> :information_source: Items in the list may be passed by-reference (according
-> to their type's specification), in which case mutating operations performed on
-> those may be visible across the process boundary.
-
-### Enum
-As in many languages, `enum` can be used to represent a group of related
-constants. While **TypeScript** `enum` entries are associated with a value that
-is either a `string` or a `number`, the *jsii* type system does not allow for
-those to be down-casted to their value type (e.g: a `string`-valued `enum` entry
-cannot be directly passed into a `string` parameter).
-
-> :information_source: Unlike in certain languages such as **Java**, `enum`
-> types cannot declare new properties or methods.
-
-### Any and Unknown
-**TypeScript** defines two opaque types: `any` and `unknown` that can be used to
-represent a value of arbitary type. The difference between them is that while
-`any` is assignable to any other type, `unknown` requires a type assertion or
-explicit cast to be performed before it can be assigned.
-
-Both of these types map to an `Any` *primitive type* in the *jsii* type system,
-and the subtle distinction between `any` and `unknown` is lost in the process.
-
-> :information_source: It is important to note that, contrary to the other types
-> in the **TypeScript** type system, `any` and `unknown` types are inherently
-> `null`-able.
-
-### Void
-As in most languages, the `void` type is used to denote a method does not return
-anything.
-
-### Null and Undefined
-**JavaScript** differentiates `undefined` and `null` values. While `undefined`
-denotes that *no value* has been set, `null` denotes an intentional signal of
-there being *no data*. Most other programming languages (particularly statically
-typed languages) however lack this distinction, and the *jsii* type model
-consequently considers `null` and `undefined` are semantically equivalent.
-
-> :information_source: Unlike certain other programming languages, such as
-> **Java**, **TypeScript** does not allow `null` (or `undefined`) values unless
-> the type signature expressedly supports that (with the exception of `any` and
-> `unknown`, which are implicitly `null`-able, as was discussed earlier).
-
-### Object
-**TypeScript**'s `object` type denotes anything that is not a *primitive* type,
-meaning anything other than a `number`, `string`, `boolean`, `bigint`, `symbol`,
-`null` or `undefined`.
-
-In the *jsii* type model, `object` indicates a block of structured data that can
-be shared by-value across the process boundary. As a consequence, they may not
-include any method.
-
-> :construction: This type is called `Json` in the current implementation.
-
-> :question: The by-value nature of `object` is problematic because
-> **TypeScript** makes no guarantee with respects to the absence of methods on
-> `object`, and properties may be dynamic.
-
-### Promises
-*jsii* supports asynchronous methods, and the **TypeScript** `Promise` type
-has to be used as the result of `async` methods. Promises can only be used as
-the result type of methods, not as the type of a property or parameter.
-
-### Unsupported **TypeScript** basic types
-Due to how such types cannot be represented in many other programming languages,
-the *jsii* type model does not support the following **TypeScript** entities:
-- Tuples, a group of arbitrarily-typed values, often used as the result type for
- multi-valued functions.
-- The `never` type, which is used as the return type of functions that will not
- yield control back to their invoker (infinite loops, `process.exit()`, ...).
-- `bigint` and `symbol` don't have equivalents in many other programming
- languages and are generally of limited value in API design.
-
-
-## Complex Types
-The goal of the *jsii* is to enable cross-language re-use of class libraries.
-**TypeScript** enables representing classic object-oriented concepts, such as
-*classes* and *interfaces*. The *jsii* type system supports some
-additional nuances on top of those, to better represent **TypeScript** and
-**JavaScript** idioms in a way that enables generating convenient APIs in other
-languages.
-
-### Classes
-Exported **TypeScript** classes are represented in the *jsii* type system, with
-the following restrictions from plain **TypeScript**:
-- Methods overloads are not supported.
-- Overridden methods or properties must retain the exact same type signature as
- the one declared in a parent type. The **jsii** type system strictly enforces
- the [Liskov substitution principle].
-
-[Liskov substitution principle]: https://en.wikipedia.org/wiki/Liskov_substitution_principle
-
-### Interfaces & Structs
-Exported **TypeScript** interfaces are interpreted as one of two entities in the
-*jsii* type system:
-- If the `interface` name is prefixed with an `I` (e.g: `ISomething`), it is
- interpreted as a *behavioral interface*.
-- Otherwise (e.g: `Something`), it is interpreted as a *struct*.
-
-#### Behavioral Interfaces
-*Behavioral interfaces* are the usual object-oriented interface: they can extend
-other *behavioral interfaces*, and can be extended by *classes*. They may
-however not extend *structs*.
-
-#### Structs
-*Structs* are used to model the **JavaScript** idiom of receiving options as an
-object literal passed as the last parameter of a function. They are a formal
-description of a bag of properties, and are not meant to be implemented by other
-types. Since those types are used as inputs, they can be handled as pure-data,
-immutable objects, and the following restrictions apply:
-- A *struct* cannot declare any *method*: they must be kept behavior-free.
-- All properties declared by a *struct* must be `readonly`. The values of the
- properties may however be mutable.
-
-*Structs* may extend one or more other *structs*, but cannot extend or be
-extended by *behavioral interfaces*, and may not be implemented by *classes*.
-
-### Type Unions
-In certain cases, several different kinds of values are acceptable for a given
-parameter or return type. **TypeScript** models those cases using *type unions*,
-which are represented as `TypeA | TypeB`. The *jsii* type model supports those,
-however most other statically typed languages do not have such a concept, making
-those parameters or return values difficult to use from those languages, as the
-value has to be declared using the most generic reference type available (for
-example, in **Java**, those are returned as `java.lang.Object`).
-
-When used as inputs (parameters, or properties of a *struct*), it may be
-possible to generate method overloads that will allow for a convenient API in
-languages that support overloads.
-
-In general however, *type unions* are discouraged and should only be used when
-there is no alternative way to model the API.
-
-
-## Serialization Behavior
-
-When values are passed between the *host* process and the `node` process, they
-are serialized as JSON documents. They can be passed by value or by reference,
-depending on the type of the value as well as the declared type of the transfer
-point (method return type, property type, argument type, ...).
-
-The table below describes the serialization behavior applied for each possible
-*declared* type (rows) for a value of a given dynamic type (columns). The :x:
-sign expresses cases that are illegal and should cause immediate failure. The
-term *primitive* encompasses `boolean`, `string`, and `number`.
-
- | `undefined` | `Date` | *primitive* | `Array` | *instance* | `object`
-------------|-------------|-------------|-------------|-------------|-------------|-------------
-`void` | `undefined` | `undefined` | `undefined` | `undefined` | `undefined` | `undefined`
-`Date` | `undefined` | [Date] | :x: | :x: | :x: | :x:
-*primitive* | `undefined` | :x: | [Identity] | :x: | :x: | :x:
-`enum` | `undefined` | :x: | [Enum] | :x: | :x: | :x:
-`List` | `undefined` | :x: | :x: | [Array] | :x: | :x:
-`Map` | `undefined` | :x: | :x: | :x: | :x: | [Mapping]
-`interface` | `undefined` | :x: | :x: | :x: | [Reference] | [Reference]
-`struct` | `undefined` | :x: | :x: | :x: | :x: | [Value]
-`class` | `undefined` | :x: | :x: | :x: | [Reference] | [Reference]
-`any` | `undefined` | [Date] | [Identity] | [Array] | [Reference] | [Value] or [Reference]
-
-In the case of `object` being passed though `any`, the value may be serialized
-by [Value] only if the value being passed does not have any method or dynamic
-accessor. Otherwise, it must be passed by [Reference] instead.
-
-> :warning: The serialization behavior around `undefined` values is affected by
-> the `optional` attribute of the declared type. As discussed earlier, the `any`
-> type is implicitly `optional`; but all other types' serialization process will
-> only allow serialization of `undefined` if they were declared `optional`.
-
-
-### Array Serialization
-[Array]: #array-serialization
-
-Arrays are serialized into the standard JSON representation for them. Each value
-in the array is serialized according to the behavior dictated by the declared
-element type of the list, combined with the dynamic type of the value itself.
-
-### Date Serialization
-[Date]: #date-serialization
-
-JSON has no standard expression for `Date`. A special JSON object representation
-is used to allow unambiguously conveying a date. The wrapper has a single key
-(`$jsii.date`) with the [ISO 8601-1] UTC representation of the `Date` value:
-
-```json
-{ "$jsii.date": "2020-01-20T14:04:00.000Z" }
-```
-
-[ISO 8601-1]: https://www.iso.org/obp/ui#iso:std:iso:8601:-1:ed-1:v1:en
-
-### Enum Serialization
-[Enum]: #enum-serialization
-
-In **JavaScript**, `enum` entries are represented by their value equivalent. In
-order to support statically typed representations in other languages, these are
-serialized using a dedicated wrapper object, using a single key (`$jsii.enum`)
-with the fully qualified name of the `enum` entry:
-
-```json
-{ "$jsii.enum": "@scope/module.EnumType.ENTRY_NAME" }
-```
-
-### Identity Serialization
-[Identity]: #identity-serialization
-
-The identity serialization is achieved by using the standard JSON representation
-of the primitive type. JSON strings are expressed using the `UTF-8` character
-set.
-
-### Mapping Serialization
-[Mapping]: #mapping-serialization
-
-Key-value pairs are passed by-value between the processes and is wrapped using a
-single-key (`$jsii.map`) associated with the JSON representation of the encoded
-object; where values are serialized according to the behavior dictated by the
-element type of the mapping, combined with the dynamic type of the value itself:
-
-```json
-{
- "$jsii.map": {
- "foo": {
- "date": { "$jsii.date": "2020-01-20T14:04:00.000Z" },
- "map": { "$jsii.map": {} }
- }
- }
-}
-```
-
-### Reference Serialization
-[Reference]: #reference-serialization
-
-Objects serialized by reference are passed using a special object that provides
-sufficient information to tie back to the instance within its owning process.
-It includes a `$jsii.byref` key associated with a string that uniquely
-identifies the instance, and an optional `$jsii.interfaces` key that provides a
-list of interfaces that the object implements.
-
-```js
-{
- "$jsii.byref": "@scope/module.Foo@1337",
- "$jsii.interfaces": ["@scope/module.IBar", "@scope/module.IBaz"]
-}
-```
-
-### Value Serialization
-[Value]: #value-serialization
-
-*Structs* can be serialized by-value. In those cases, the value is wrapped using
-a special object that encapsulates the type information for the provided data as
-well as the *struct*'s members.
-
-The wrapper uses a single `$jsii.struct` key with a `fqn` key that indicates the
-fully qualified name of the *struct* type, and a `data` key that contains the
-members of the *struct*, serialized according to the behavior described in this
-document.
-
-```js
-{
- "$jsii.struct": {
- "fqn": "@scope/module.StructType",
- "data": {
- "enumValue": { "$jsii.enum": "@scope/module.EnumType.ENTRY_NAME" },
- "stringProperty": "Hello, I'm a string!"
- }
- }
-}
-```
-
-## Submodules
-
-> :construction: The *submodules* feature is still under active development and
-> the specific behavior around it (in particular with respects to code
-> generation) are still subject to change.
-
-### Overview
-
-Typescript allows grouping declarations together in *namespaces*, which are
-interpreted by *jsii* as *submodules*. *Submodules* names are the fully
-qualified name of the namespace from the package's root (if a package `foo`
-defines a namespace `ns1`, which itself contains `ns2`, the submodule for `ns2`
-will be named `foo.ns1.ns2`).
-
-*Submodules* are delcared in the *jsii* assembly under the `submodules` key.
-This is also where specific [configuration](#submodule-configuration)
-is registered, if different from the parent submodule or package.
-
-*Submodules* are hierarchical, and their fully qualified name is representative
-of the relationship. For example the `assm.foo.bar` submodule is considered to
-be nested under the `assm.foo` submodule.
-
-### Restrictions
-
-*Submodules* cannot be involved in dependency cycles. While it is possible to
-build such cycles in **JavaScript**, that configuration cannot be reliably
-reprensented in certain other programming languages (e.g: **Python**).
-
-> :construction: [`jsii`] does not currently check for circular submodule
-> dependencies. Invalid dependency patterns may result in errors at code
-> generation by [`jsii-pacmak`], or at runtime.
-
-Since this would result in ambiguity that cannot be consistently resolved, a
-given type can only be exported as part of one *submodule*.
-
-[`jsii`]: ../../packages/jsii
-[`jsii-pacmak`]: ../../packages/jsii-pacmak
-
-### Declaration
-
-There are two supported ways to introduce *submodules*:
-* Using the namespaced export syntax:
- ```ts
- export * as ns from './module';
- ```
-* Using an explicit namespace declaration:
- ```ts
- export namespace ns { /* ... */ }
- ```
-
-*Submodules* declared using the `export * as ns from './module';` syntax can be
-documented using a markdown document located at `./module/README.md`.
-
-> :construction: The `./module/README.md` file support is not yet implemented.
-
-### Submodule Configuration
-
-In languages where this is relevant (e.g: **Python**), *submodules* are rendered
-as native *submodules*. In languages where a namespace system exists (**Java**
-uses *packages*, **C#** uses *namespaces*, ...), *submodules* are rendered using
-that.
-
-By default, *submodule* names are rendered appropriately in the target language
-(this typically involves adjusting the case of *submodule* name fragments to the
-idiomatic form in the language). In certain cases however, a developer can
-choose to use a different configuration by defining the *submodule* using the
-namespaced-export syntax (`export * as namespace from './module-name';`) ny
-placing a `.jsiirc.json` file next to the entry point of the namespaced module.
-For example, if `./module-name`'s entry point is `foo/bar/module-name/index.ts`,
-the *submodule* configuration resides in `foo/bar/module-name/.jsiirc.json`.
-
-Since *submodules* are hierarchical, the configuration of a given *submodule*
-defines the default configuration of *submodules* nested under it.
-
-## Code Generation
-
-In order to generate code in various programming languages, [`jsii-pacmak`]
-needs configuration that provides naming directives (e.g: **Java** package
-names, **C#** namespaces, **Python** module names, ...). This configuration is
-language-specific and each language implementation specifies and documents its
-own configuration schema.
-
-Configuration is sourced in the `package.json` file at the root of the npm
-package, under the special `jsii` key. The general schema is described in the
-[configuration] document.
-
-> :construction: There is a proposition to allow this configuration to be placed
-> in a `.jsiirc.json` file, which would take precedence over what is specified
-> in `package.json`. *Submodules* introduced using the
-> `export * as ns from './module';` syntax would then be able to define
-> *submodule*-local configuration using the `./module/.jsiirc.json` file.
-
-[configuration]: ../configuration.md
-
-## References
-
-The [**TypeScript** Handbook] describes the language's type system and syntax
-elements that serve as the basis for the *jsii* type system. Additionally, the
-**JavaScript** type system is described in the [**JavaScript** Fundamentals]
-document.
-
-[**JavaScript** Fundamentals]: https://javascript.info/types
-[**TypeScript** Handbook]: https://www.typescriptlang.org/docs/handbook/basic-types.html
-
---------------------------------------------------------------------------------
-
-Continue to [Kernel API](./3-kernel-api.md)
diff --git a/docs/specifications/4-standard-compliance-suite.md b/docs/specifications/4-standard-compliance-suite.md
deleted file mode 100644
index 4adde7ff1b..0000000000
--- a/docs/specifications/4-standard-compliance-suite.md
+++ /dev/null
@@ -1,513 +0,0 @@
-# Standard Compliance Suite
-
-## Goal
-The goal of the standard compliance suite is to be a normative description of
-the behaviors that all language runtime implementations (*host runtime library*
-in combination with *code generation*) must implement. This description takes
-the form of a collection of test cases that must be re-implemented in each
-*host* language, so that compliance can be asserted.
-
-Since the goal of *jsii* is to expose a single Object-Oriented API to multiple
-programming languages, it is important to ensure the behavior is consistent
-across all of them. This can be achieved by making sure that the interactions
-between the *host* and *kernel* processes are the same for a given use-case.
-
-## Format
-In order to assert whether a new runtime implementation is correct, a formal
-compliance test suite is defined, that all language runtimes must fully
-implement before they can be deemed eligible for General Availability.
-
-This document describes these tests, as well as a general approach for ensuring
-conformance requirements are met in a systematic manner.
-
-### Categories
-Test cases in the standard compliance suite are grouped by categories, which
-help implementors direct their effort in the early stages of the implementation
-of new language bindings. Each category is declared in an `H3` title (a line
-that starts with `### `) within the [`## Test Suite`] title. A description of
-the category immediately follows the opening title. The category ends with the
-end of the document, or whenever another `H2` title is reached.
-
-[`## Test Suite`]: #test-suite
-
-### Test Case
-Within a category title, test cases are delimited by `H4` (`#### `) titles,
-which correspond to the test case name. The test case name should be kept
-concise (ideally within 75 characters) and try to be as descriptive as possible.
-
-Immediately after the `H4` title is an English language description of the test
-case that explains the property the test is designed to validate in as much
-detail as possible. As much as possible, test case descriptions should be
-self-sufficient.
-
-After the attributes table, a **TypeScript** block of code describes the
-canonical form of the test. It includes any type declaration that is used by the
-test (so the code example is self-contained). Assertions performed by the test
-should be written in the form of [`jest`] expectations.
-
-> :question: The assertion code is intended as a formal representation of the
-> tests' normative procedure. It is not currently executed against the *kernel*,
-> but this could be achieved in the future. Additionally, we might be able to
-> automatically transliterate the tests to other languages using
-> [`jsii-rosetta`].
-
-[`jest`]: https://jestjs.io/docs/en/getting-started
-[`jsii-rosetta`]: ../../../packages/jsii-rosetta
-
-Finally, another code block details the sequence of messages that should be
-exchanged between the *host* and `node` processes during the execution of the
-test case, such that implementations can assert coherent behavior.
-
-Initial messages corresponding to the `hello` and `load` calls can be omitted at
-the beginning of the kernel trace. Those messages are typically identical
-across tests and there is little value in asserting around those. However, any `load`
-call happening after the first call that is neither the `hello` message or
-another `load` call **must** be included.
-
-The dialogue is the sequence of JSON formatted messages, from the perspective of
-the *host* app, using the following notation:
-
-* Messages sent by the *host* runtime to the `node` process:
- ```
- > { "api": "foo" }
- ```
-* Messages received by the *host* runtime from the `node` process:
- ```
- < { "result": "bar" }
- ```
-* Comments to improve readability of the trace:
- ```
- # Comment continues until the end of the line
- ```
-* Blank lines can be added to logically group trace elements
-
-> :question: is there a need to support some form of a capture mechanism to
-> provision for non-deterministic results, or non-normative elements such as
-> the exact Object IDs issued for created instances?
-
-Show Template
-
-Below is the template markdown to copy-paste when introducing a new test case in
-the compliance suite. New tests should always be added at the very end of the
-category they belong to, right after the last test in said category.
-
-````md
-### Test Category
-#### Test Case Name
-
-A short english language description of what property this test verifies. The
-description should include enough detail for a reader to be able to understand
-the test without having to search for any additional information. Prefer a long,
-unambiguous description to a terse one that could be subject to interpretation.
-
-Show test
-
-##### Reference Implementation
-```ts
-// GIVEN
-export class Foo { /* ... */ }
-
-// WHEN
-const bar = new Foo().bar();
-
-// THEN
-expect(bar.baz).toBeUndefined();
-```
-
-##### Reference Kernel Messaging
-```
-## You can omit the initial hello/load messages
-# < { "hello": "@jsii/runtime@1.2.3" }
-# > { "load": { "name": "test-case-001", "version": "1.2.3", "tarball": "/tmp/jsii-kernel-test/lib.tgz" } }
-# < { "assembly": "test-case-001", "types": 3 }
-```
-
-````
-
-
-## Compliance
-In order to be able to assert compliance of language binding libraries to the
-standard test suite, implementations are responsible for providing a test
-harness (typically as part of the runtime library) that can produce a
-standardized test report in the form of a JSON document that follows the
-following schema:
-
-```ts
-interface TestReport {
- /** The report is broken down by test category, using the name as-is */
- [category: string]: {
- /** For each test in the category, using its name as-is */
- [test: string]: {
- /** Whether the test passed or failed */
- status: 'PASS' | 'FAIL';
- /** The kernel messages captured during the test */
- kernelTrace: Array;
- };
- };
-}
-
-interface KernelMessage {
- /** The direction the message was sent (Host -> Kernel / Kernel -> Host) */
- direction: 'FromKernel' | 'ToKernel';
- /** The message, as a JSON object */
- message: { [key: string]: unknown };
-}
-```
-
-The `@jsii/compliance` package provides the necessary tools to consume such a
-test report, together with the Markdown document describing the compliance suite,
-and procuces a report describing compliance test coverage as well as information
-about any non-conformant test result.
-
-> :construction: The `@jsii/compliance` tool does not exist yet.
-
-> :question: Should a "somewhat standard" format such as XUnit test report be
-> used instead of rolling our own JSON document?
-
-## Test Suite
-
-### Legacy
-This section is due to contain all compliance tests that were implemented before
-the *jsii specification* was initially written. They are going to be gradually
-replaced by more focused tests with better descriptions.
-
-#### Type Unions are correctly disambiguated by the Kernel
-In certain cases, two or more types in a *Type Union* can overlap in such a way
-that they are all valid structural types for the value. Statically typed
-languages however will not be satisfied with structural typing only, and require
-the correct declared type to be preserved.
-
-Show test
-
-##### Reference Implementation
-```ts
-// GIVEN
-export interface BluePill {
- readonly offeredTo: string;
- readonly makesYouForgetTheMatrix?: boolean;
-}
-export interface RedPill {
- readonly offeredTo: string;
- readonly makesYouExitTheMatrix?: boolean;
-}
-export class Morpheus {
- public static isBlue(pill: BluePill | RedPill): pill is BluePill {
- const keys = new Set(Object.keys(pill));
- switch (keys.size) {
- case 1:
- return keys.has('offeredTo');
- case 2:
- return keys.has('offeredTo') && keys.has('makesYouForgetTheMatrix');
- default:
- return false;
- }
- }
- public static isRed(pill: BluePill | RedPill): pill is RedPill {
- const keys = new Set(Object.keys(pill));
- switch (keys.size) {
- case 1:
- return keys.has('offeredTo');
- case 2:
- return keys.has('offeredTo') && keys.has('makesYouExitTheMatrix');
- default:
- return false;
- }
- }
- private constructor(){}
-}
-export class Neo {
- public readonly tookBlue: boolean;
- public readonly tookRed: boolean;
-
- public constructor(public readonly pill: BluePill | RedPill) {
- this.tookBlue = pill.offeredTo == 'Neo' && Morpheus.isBlue(pill);
- this.tookRed = pill.offeredTo == 'Neo' && Morpheus.isRed(pill);
- }
-}
-
-// WHEN
-const bluePillA = new Neo({ offeredTo: 'not Neo' });
-const bluePillB = new Neo({ offeredTo: 'Neo', makesYouForgetTheMatrix: true });
-const redPillA = new Neo({ offeredTo: 'not Neo' });
-const redPillB = new Neo({ offeredTo: 'Neo', makesYouExitTheMatrix: true });
-
-// THEN
-expect(bluePillA.pill instanceof BluePill).toBeTruthy();
-expect(bluePillA.tookBlue).toBeFalsy();
-expect(bluePillA.tookRed).toBeFalsy();
-
-expect(bluePillB.pill instanceof BluePill).toBeTruthy();
-expect(bluePillA.tookBlue).toBeTruthy();
-expect(bluePillA.tookRed).toBeFalsy();
-
-expect(redPillA.pill instanceof RedPill).toBeTruthy();
-expect(bluePillA.tookBlue).toBeFalsy();
-expect(bluePillA.tookRed).toBeFalsy();
-
-expect(redPillB.pill instanceof RedPill).toBeTruthy();
-expect(bluePillA.tookBlue).toBeFalsy();
-expect(bluePillA.tookRed).toBeTruthy();
-```
-
-##### Kernel Trace
-```
-```
-
-
-#### Partially initialized object consumption
-When a constructor passes `this` out from **JavaScript** to the *host* app, the
-reference must be correctly identified and passed across.
-
-> :construction: The .NET Runtime does not currently honor object identity,
-> meaning that despite the same object reference is returned twice, two distinct
-> proxies exist for it in the *host* .NET app.
->
-> Generally speaking, using pure object identity on *jsii* language front-ends
-> is dangerous, as certain statically typed language will require the runtime to
-> have different instances for different static types a given object reference
-> is surfaced as. It may be necessary to introduce a helper akin to
-> `Jsii.isSameObject(a, b)` to enable identity predicates to be used. Other
-> helper functions may be necessary, too, such as one to obtain a "consistent"
-> object hash for instances in Java (so they can be safely used with `HashMap`,
-> ...).
-
-Show test
-
-##### Reference Implementation
-```ts
-// GIVEN
-export abstract class PartiallyInitializedThisConsumer {
- public abstract consumePartiallyInitializedThis(obj: ConstructorPassesThisOut): void;
-}
-export class ConstructorPassesThisOut {
- public constructor(consumer: PartiallyInitializedThisConsumer) {
- consumer.consumePartiallyInitializedThis(this);
- }
-}
-
-// WHEN
-class MyConsumer extends PartiallyInitializedThisConsumer {
- public obj?: ConstructorPassesThisOut = null;
-
- public consumePartiallyInitializedThis(obj: ConstructorPassesThisOut) {
- this.obj = obj;
- }
-}
-const consumer = new MyConsumer();
-const object = new ConstructorPassesThisOut(consumer);
-
-// THEN
-expect(consumer.obj).toBe(object);
-```
-
-##### Kernel Trace
-```
-# < {"hello":"@jsii/runtime@..."}
-# > {"api":"load","name":"...","version":"...","tarball":"..."}
-# < {"ok":{"assembly":"...","types":2}}
-
-> {"api":"create","fqn":"test.PartiallyInitializedThisConsumer","args":[],"overrides":[{"method":"consumePartiallyInitializedThis"}],"interfaces":[]}
-< {"ok":{"$jsii.byref":"test.PartiallyInitializedThisConsumer@10000"}}
-> {"api":"create","fqn":"test.ConstructorPassesThisOut","args":[{"$jsii.byref":"test.PartiallyInitializedThisConsumer@10000","$jsii.interfaces":[]}],"overrides":[],"interfaces":[]}
-< {"callback":{"cbid":"jsii::callback::20000","invoke":{"objref":{"$jsii.byref":"test.PartiallyInitializedThisConsumer@10000"},"method":"consumePartiallyInitializedThis","args":[{"$jsii.byref":"test.ConstructorPassesThisOut@10001"}]}}}
-> {"complete":{"api":"complete","cbid":"jsii::callback::20000"}}
-< {"ok":{"$jsii.byref":"test.ConstructorPassesThisOut@10001"}}
-```
-
-
-### Interfaces
-Tests in this section ensure correct behavior of *behavioral interfaces*.
-
-#### Host app can implement an interface "from scratch"
-It is possible for a "pure" host interface implementation to be passed across
-the language boundary, it's methods and properties can be used by **JavaScript**
-code within the Kernel process.
-
-> :construction: The .NET Runtime currently requires that pure interfaces
-> implementations extend from `Amazon.JSII.Rutime.Deputy.DepytyBase`.
-
-> :construction: The Python Runtime currently expects a somewhat un-pythonic way
-> to implement interfaces, which requires decorating the implementing class with
-> `@jsii.implements("implemented-type.JsiiInterfaceFQN")`.
-
-Show test
-
-##### Reference Implementation
-```ts
-// GIVEN
-export interface IBehavioralInterface {
- methodCall(): string;
- readonly property: number;
-}
-export class InterfaceConsumer {
- constructor(private readonly iface: IBehavioralInterface) { }
-
- public composeResult() {
- return `${this.iface.methodCall()} / ${this.iface.property}`;
- }
-}
-
-// WHEN
-class Implementation implements IBehavioralInterface {
- public readonly property = 1337;
- public methodCall() { return "Hello!"; }
-}
-const impl = new Implementation();
-const consumer = new InterfaceConsumer(impl);
-
-// THEN
-expect(consumer.composeResult()).toBe("Hello! / 1337")
-```
-
-##### Kernel Trace
-```
-# < {"hello":"@jsii/runtime@..."}
-# > {"api":"load","name":"...","version":"...","tarball":"..."}
-# < {"ok":{"assembly":"...","types":2}}
-
-> {"api":"create","fqn":"Object","args":[],"overrides":[{"method":"methodCall"},{"property":"property"}],"interfaces":["test.IBehavioralInterface"]}
-< {"ok":{"$jsii.byref":"Object@10000","$jsii.interfaces":["test.IBehavioralInterface"]}}
-> {"api":"create","fqn":"test.InterfaceConsumer","args":[{"$jsii.byref":"Object@10000","$jsii.interfaces":[]}],"overrides":[],"interfaces":[]}
-< {"ok":{"$jsii.byref":"test.InterfaceConsumer@10001"}}
-> {"api":"invoke","objref":{"$jsii.byref":"test.InterfaceConsumer@10001"},"method":"composeResult","args":[]}
-< {"callback":{"cbid":"jsii::callback::20000","invoke":{"objref":{"$jsii.byref":"Object@10000","$jsii.interfaces":["test.IBehavioralInterface"]},"method":"methodCall","args":[]}}}
-> {"complete":{"api":"complete","cbid":"jsii::callback::20000","result":"Hello!"}}
-< {"callback":{"cbid":"jsii::callback::20001","get":{"objref":{"$jsii.byref":"Object@10000","$jsii.interfaces":["test.IBehavioralInterface"]},"property":"property"}}}
-> {"complete":{"api":"complete","cbid":"jsii::callback::20001","result":1337.0}}
-< {"ok":{"result":"Hello! / 1337"}}
-```
-
-
-### Structs & Keyword Arguments
-
-#### Ambiguous arguments are handled correctly
-When a method accepts both a positional parameter named `foo` and a struct
-parameter with a property named `foo`, the respective values are passed in the
-correct parameter location when calling into the **JavaScript** code.
-
-Show test
-
-##### Reference Implementation
-```ts
-// GIVEN
-export interface StructType {
- readonly foo: string;
-}
-export class ClassType {
- public constructor(
- public readonly foo: number,
- public readonly opts: StructType,
- ) {}
-}
-
-// WHEN
-var result = new ClassType('Bazinga!', { foo: 1337 });
-
-// THEN
-expect(typeof result.foo).toBe(1337);
-expect(typeof result.opts.foo).toBe('Bazinga!');
-```
-
-##### Kernel Trace
-```
-# < {"hello":"@jsii/runtime@..."}
-# > {"api":"load","name":"...","version":"...","tarball":"..."}
-# < {"ok":{"assembly":"...","types":2}}
-
-> {"api":"create","fqn":"test.ClassType","args":[1337.0,{"$jsii.struct":{"fqn":"test.StructType","data":{"foo":"Bazinga!"}}}],"overrides":[],"interfaces":[]}
-< {"ok":{"$jsii.byref":"test.ClassType@10000"}}
-> {"api":"get","objref":{"$jsii.byref":"test.ClassType@10000"},"property":"foo"}
-< {"ok":{"value":1337}}
-> {"api":"get","objref":{"$jsii.byref":"test.ClassType@10000"},"property":"opts"}
-< {"ok":{"value":{"$jsii.byref":"Object@10001","$jsii.interfaces":["test.StructType"]}}}
-> {"api":"get","objref":{"$jsii.byref":"Object@10001"},"property":"foo"}
-< {"ok":{"value":"Bazinga!"}}
-```
-
-
-### Collections
-Tests in this section ensure correct behavior of collections (`List` and `Map`).
-
-#### Struct elements of `List` are deserialized to the correct apparent type
-When the declared element type of a `List` is a *struct*, the resulting list
-must contain elements of the correct static type. This is a requirement for
-statically typed languages such as Java where type parameters are reified.
-
-Show test
-
-##### Reference Implementation
-```ts
-// GIVEN
-export interface StructType {
- readonly property: string;
-}
-export class StructProvider {
- public static provide(): StructType[] {
- return [{ property: 'value' }];
- }
-}
-
-// WHEN
-const items = StructProvider.provide();
-
-// THEN
-expect(items.length).toBeGreaterThan(0);
-for (const item of items) {
- expect(item instanceof StructType).toBeTruthy();
-}
-```
-
-##### Kernel Trace
-```
-# < {"hello":"@jsii/runtime@..."}
-# > {"api":"load","name":"...","version":"...","tarball":"..."}
-# < {"ok":{"assembly":"...","types":2}}
-
-> {"api":"sinvoke","fqn":"test.StructProvider","method":"provide","args":[]}
-< {"ok":{"result":[{"$jsii.byref":"Object@10000","$jsii.interfaces":["test.StructType"]}]}}
-```
-
-
-#### Struct elements of `Map` are deserialized to the correct apparent type
-When the declared element type of a `Map` is a *struct*, the resulting list
-must contain elements of the correct static type. This is a requirement for
-statically typed languages such as Java where type parameters are reified.
-
-Show test
-
-##### Reference Implementation
-```ts
-// GIVEN
-export interface StructType {
- readonly property: string;
-}
-export class StructProvider {
- public static provide(): { [key: string]: StructType } {
- return { foo: { property: 'value' } };
- }
-}
-
-// WHEN
-const items = StructProvider.provide();
-
-// THEN
-expect(items.length).toBeGreaterThan(0);
-for (const item of Object.values(items)) {
- expect(item instanceof StructType).toBeTruthy();
-}
-```
-
-##### Kernel Trace
-```
-# < {"hello":"@jsii/runtime@..."}
-# > {"api":"load","name":"...","version":"...","tarball":"..."}
-# < {"ok":{"assembly":"...","types":2}}
-
-> {"api":"sinvoke","fqn":"test.StructProvider","method":"provide","args":[]}
-< {"ok":{"result":{"$jsii.map":{"foo":{"$jsii.byref":"Object@10000","$jsii.interfaces":["test.StructType"]}}}}}
-```
-
-
---------------------------------------------------------------------------------
-
-Continue to [New Language Intake](./5-new-language-intake.md)
diff --git a/docs/specifications/5-new-language-intake.md b/docs/specifications/5-new-language-intake.md
deleted file mode 100644
index b8357b21d3..0000000000
--- a/docs/specifications/5-new-language-intake.md
+++ /dev/null
@@ -1,138 +0,0 @@
-# New Language Intake
-This document outlines the process to be followed when introducing a new *jsii*
-target language, including an estimated timeline (the exact timeline may vary
-significantly depending on the specifics of the language being added).
-
-The estimated total duration for the process is 4 to 6 months.
-
-## Planning
-
-**:alarm_clock: Estimated Duration:** 2 weeks
-
-The first step is to study the *jsii* specification, as well as existing
-language implementations, in order to have the knowledge necessary to write a
-new language support proposal [RFC]. The [RFC] document produced will evolve and
-be polished as development of the new language support progresses, but the
-following elements must be present before any implementation begins:
-
-* Identification of the language's standard package repository
-* Proposal for the binding's configuration block
-* Sample API representations in the proposed language
- + In particular, any element from the *jsii* type model that does not
- naturally map into the proposed new language needs to be represented
- + Where several options exist, links to prior art are instrumental to validate
- the direction chosen
-* Toolchain and platform requirements
-
-[RFC]: https://github.com/awslabs/aws-cdk-rfcs#readme
-
-## Code Generation (`jsii-pacmak`)
-
-**:alarm_clock: Estimated Duration:** 4 to 6 weeks
-
-The necessary code must be added to [`jsii-pacmak`] in order to map the *jsii*
-assembly's declared types into the proposed language. While this code ought to
-leverage the new language's *host* runtime library, we begin with writing the
-code generator in order to ensure the appropriate developer experience is
-achieved in the new language before writing the back-end components.
-
-Code generators are authored in **TypeScript**.
-
-The necessary reserved words need to be registered in the `jsii` compiler, so
-that warnings are produced when identifiers are used in **TypeScript** code that
-require slugification or escaping in the target language (and will hence cause a
-degraded developer experience).
-
-[`jsii-pacmak`]: ../../packages/jsii-pacmak
-
-## Runtime Library
-
-**:alarm_clock: Estimated Duration:** 4 to 6 weeks
-
-Now that the appropriate developer experience has been identified, the *host*
-runtime library supporting the generated code can be written. This component
-must be written in the new language.
-
-> :construction: A reference architecture for *host* runtime libraries is to be
-> developed, in order to ensure consistent naming and behavior across all the
-> runtimes, reducing the cost of maintaining many of those.
-
-## Building & Packaging
-
-**:alarm_clock: Estimated Duration:** 2 weeks
-
-Once code is generated and it has a *host* runtime library to rely on,
-[`jsii-pacmak`] needs to receive the additional logic required to compile and
-package the generated libraries as required, producing ready-to-publish
-artifacts.
-
-The necessary toolchain needs to be added to the [`jsii/superchain`] *Docker*
-image, so that `jsii` customers can rely on this to build artifacts for any of
-the supported languages.
-
-In addition to this, standardized *Amazon CodePipeline* actions need to be
-developed in order to support publishing to the relevant idiomatic package
-managers.
-
-[`jsii/superchain`]: ../../superchain
-
-## Compliance Tests
-
-**:alarm_clock: Estimated Duration:** 6 weeks
-
-The full standard compliance suite must be implemented for the new language.
-Leveraging the new code generator, *host* runtime library and compilation logic,
-the tests demonstrate that the new library behaves consistently with all other
-language bindings.
-
-While it is possible to declare *developer preview* on a new language before all
-the tests pass, full compliance is a pre-requisite to declaring *general
-availability* of the new language.
-
-## Documentation
-
-**:alarm_clock: Estimated Duration:** 1 week
-
-The necessary documentation needs to be provided to support customers who want
-to onboard the new language. This also includes updating [`jsii-config`] with
-support for the new languages' configuration block.
-
-[`jsii-config`]: ../../packages/jsii-config
-
-## Developer Preview
-
-**:alarm_clock: Recommended Duration:** 4 to 8 weeks
-
-It is possible to declare *Developer Preview* for a new language support as soon
-as the code generation and *host* runtime library are mature enough to be useful,
-and cover the majority of use-cases. While certain edge-cases may still be
-uncovered at the beginning of *Developer Preview*, a clear plan should exist
-that ensures a path exists to address any known gaps. It is required to have
-implemented most of the standard compliance suite prior to declaring *Developer
-Preview*.
-
-During the *Developer Preview* phase, user experience studies should be
-conducted to validate assumptions made during the code generator's design. If
-any significant change is dictated by the results of the user experience studies,
-fluback studies should be performed in order to confirm that the desired impact
-has been achieved.
-
-> :construction: A standard set of user experience study tasks will be
-> developed, ensuring the learnings from previous experiences is factored into
-> subsequent studies conducted.
-
-Finally, it is essential to give time to the community to use and vet the new
-language support prior to considering *General Availability*. A minimum of a
-full month without a major bug reported is advised. During this period,
-intentional hands-on usage of the product msut be performed by engineers
-familiar with the new language as well as engineers unfamilar with it. This
-ensures the new experience is considered holistically, in a manner unbiased by
-knowledge of the implementation.
-
-## General Availability
-
-Once the new language support has been *Developer Preview* for long enough and
-the engineers involved have gained confidence that the API is stable, covers all
-known use-cases reliably, and behaves consistently with other *Generally
-Available* languages, the new support can be considered for *General
-Availability*.
diff --git a/docs/typescript-restrictions.md b/docs/typescript-restrictions.md
deleted file mode 100644
index b1fb961458..0000000000
--- a/docs/typescript-restrictions.md
+++ /dev/null
@@ -1,223 +0,0 @@
-# Restrictions over vanilla **TypeScript**
-
-`jsii` can only accept APIs that can be represented in all the supported target
-languages, and **TypeScript** is a feature-rich, modern programming language. As a
-consequence, `jsii` needs to impose restrictions on what **TypeScript** language
-features can be used. Certain common **Javascript** idioms are also interpreted
-specially by `jsii` in order to support providing a more consistent developer
-experience across various languages.
-
-As `jsii` only needs to represent those types that are part of the *exported*
-APIs of the package, the restrictions outlined in this document do not apply to
-*private* (or *internal*) types and functions.
-
-## Reserved Words
-
-### Target language considerations
-
-`jsii` will emit warnings if reserved words are used as identifiers for any API
-element (which will cause a compilation failure if `--fail-on-warnings` is set).
-The list of reserved words (which are not also reserved in **TypeScript**),
-derived from [`jsii/lib/reserved-words.ts`] is:
-
-**C#** | **Java** | **Python** | **Go**
----------------|----------------|--------------|-------------
-`abstract` | `abstract` | `False` | `break`
-`base` | `assert` | `None` | `case`
-`bool` | `boolean` | `True` | `chan`
-`byte` | `byte` | `and` | `const`
-`char` | `char` | `assert` | `continue`
-`checked` | `double` | `def` | `default`
-`decimal` | `final` | `del` | `defer`
-`delegate` | `float` | `elif` | `else`
-`double` | `goto` | `except` | `fallthrough`
-`event` | `int` | `from` | `for`
-`explicit` | `long` | `global` | `func`
-`extern` | `native` | `is` | `go`
-`fixed` | `short` | `lambda` | `goto`
-`float` | `strictfp` | `nonlocal` | `if`
-`foreach` | `synchronized` | `not` | `import`
-`goto` | `throws` | `or` | `interface`
-`implicit` | `transient` | `pass` | `map`
-`int` | `volatile` | `raise` | `package`
-`internal` | | | `range`
-`is` | | | `return`
-`lock` | | | `select`
-`long` | | | `struct`
-`namespace` | | | `switch`
-`object` | | | `type`
-`operator` | | | `var`
-`out` | | |
-`override` | | |
-`params` | | |
-`readonly` | | |
-`ref` | | |
-`sbyte` | | |
-`sealed` | | |
-`short` | | |
-`sizeof` | | |
-`stackalloc` | | |
-`string` | | |
-`struct` | | |
-`uint` | | |
-`ulong` | | |
-`unchecked` | | |
-`unsafe` | | |
-`ushort` | | |
-`using` | | |
-`virtual` | | |
-`volatile` | | |
-
-Code generators from `jsii-pacmak` will try to work around those reserved words
-when they are encountered, but may resort to using names that could clash with
-other identifiers used in your API, or result in suboptimal experience for
-users in languages with conflicts.
-
-[`jsii/lib/reserved-words.ts`]: ../packages/jsii/lib/reserved-words.ts
-
-## Type Members
-
-### Naming
-
-Methods and properties declared on *classes* cannot be named after the class (
-meaning they cannot share the same PascalCased representation), as this results
-in illegal **C#** code:
-
-> :memo: Due to existing usage (in such cases, an `_` is appended at the end of
-> the **type** name, effectively breaking existing .NET code if such a member
-> is introduced post-release), this restriction is only enforced when `jsii` is
-> invoked with the `--strict` parameter.
->
-> It will be upgraded to *always* be an error in a future release.
-
-```ts
-export class Name {
- // ⛔️ Illegal property name
- public name: string;
-}
-
-export class Name {
- // ⛔️ Illegal method name
- public name(): void { /* ... */ }
-}
-```
-
-### Overriding
-
-The visibility of a type member cannot be changed when it is overridden, even if
-the change increases the visibility of said member, as this would result in
-illegal **C#** code:
-
-```ts
-export class Base {
- protected method(): void { /* ... */ }
-}
-
-export class Child {
- // ⛔️ Illegal change of visibility when overriding a member
- public method(): void { /* ... */ }
-}
-```
-
-Additionally, **C#** does not allow changing the type signature of members while
-overriding them, even if the updated type signature is a strict specialization
-of the original one, and this is consequently also forbidden in `jsii`:
-
-```ts
-export class Base {
- public method(): any { /* ... */ }
-}
-
-export class Child {
- // ⛔️ Illegal change of signature when overriding a member
- public method(): string { /* ... */ }
-}
-```
-
-## Behavioral Interfaces & Structs
-
-`jsii` considers **TypeScript** interfaces in two distinct categories: *Structs*
-and *Behavioral Interfaces*. Both of those entities are represeted using
-**TypeScript** interfaces, but have distinct sets of requirements.
-
-### Behavioral Interfaces
-
-Behavioral interfaces are the specification of a contract that a type can elect
-to adhere to. They can define a number of `public` members which can be
-properties or methods. `jsii` requires that behavioral interfaces have names
-prefixed with an uppercase `I`.
-
-```ts
-// ⛔️ Illegal name
-export interface Foo { /* ... */ }
-// ✅ Legal
-export interface IFoo { /* ... */ }
-
-// ⛔️ Illegal name
-export interface InstanceProvider { /* ... */ }
-// ✅ Legal
-export interface IInstanceProvider { /* ... */ }
-
-// ⛔️ Illegal extension of a struct
-export interface IBar extends SomeStruct { /* ... */ }
-```
-
-Interfaces can be implemented by classes or extended by other interfaces, but
-may not extend (or be extended by) structs.
-
-### Structs
-
-Structs, on the other hand, are pure data constructs. They may not declare
-methods, only `readonly` properties. Those types model what **Javascript**
-developers use to model keyword arguments, where they typically pass an object
-literal with configuration values to a method or constructor. Structs do not
-have names starting with an uppercase `I` (making it possible to define a
-behavioral interface that only declares read-only properties as part of its
-contract).
-
-```ts
-// ⛔️ Illegal
-export interface Foo {
- foo(): void; // Structs cannot define methods
-}
-
-// ⛔️ Illegal
-export interface Bar {
- foo: number; // Struct members must be readonly
-}
-// ✅ Legal
-export interface Baz {
- readonly foo: number;
-}
-
-// ⛔️ Illegal extension of a behavioral interface
-export interface SomeStruct extends IBehavioralInterface { /* ... */ }
-// ✅ Legal
-export interface SomeStruct extends OtherStruct { /* ... */ }
-
-// ⛔️ Illegal implementation of a struct
-export class BazImpl implements Baz { /* ... */ }
-```
-
-Structs can be extended by other structs, but may not extend (or be extended by)
-behavioral interfaces, nor can they be implemented by classes.
-
-## Parameterized Types (a.k.a. "Generics")
-
-Due to the lack of a *generics* concept in certain candidate programming
-languages (such as **go**), **TypeScript** parameterized types are not
-supported by `jsii`, with the exception of standard promises (`Promise`) as
-well as arrays (`Array`, which is equivalent to `T[]`).
-
-```ts
-// ⛔️ Illegal
-export interface Provider {
- get(): ValueType;
-}
-
-// ✅ Legal
-export interface AsyncFooMaker {
- makeFoo(): Promise;
- makeFoos(count: number): Array>;
-}
-```
diff --git a/gh-pages/.gitignore b/gh-pages/.gitignore
new file mode 100644
index 0000000000..21d0b898ff
--- /dev/null
+++ b/gh-pages/.gitignore
@@ -0,0 +1 @@
+.venv/
diff --git a/gh-pages/content/assets/images/favicon.png b/gh-pages/content/assets/images/favicon.png
new file mode 100644
index 0000000000..25353cd6f3
Binary files /dev/null and b/gh-pages/content/assets/images/favicon.png differ
diff --git a/gh-pages/content/assets/images/logo.png b/gh-pages/content/assets/images/logo.png
new file mode 100644
index 0000000000..be9c9e39d9
Binary files /dev/null and b/gh-pages/content/assets/images/logo.png differ
diff --git a/gh-pages/content/assets/stylesheets/amazon-ember-display.css b/gh-pages/content/assets/stylesheets/amazon-ember-display.css
new file mode 100644
index 0000000000..5cf596d04b
--- /dev/null
+++ b/gh-pages/content/assets/stylesheets/amazon-ember-display.css
@@ -0,0 +1,36 @@
+@font-face {
+ font-family: 'AmazonEmberDisplay';
+ src: url('../typefaces/AmazonEmberDisplay_Lt.woff2') format('woff2'),
+ url('../typefaces/AmazonEmberDisplay_Lt.woff') format('woff'),
+ url('../typefaces/AmazonEmberDisplay_Lt.eot') format('embedded-opentype'),
+ url('../typefaces/AmazonEmberDisplay_Lt.ttf') format('truetype');
+ font-weight: 300;
+ font-style: normal;
+}
+@font-face {
+ font-family: 'AmazonEmberDisplay';
+ src: url('../typefaces/AmazonEmberDisplay_Rg.woff2') format('woff2'),
+ url('../typefaces/AmazonEmberDisplay_Rg.woff') format('woff'),
+ url('../typefaces/AmazonEmberDisplay_Rg.eot') format('embedded-opentype'),
+ url('../typefaces/AmazonEmberDisplay_Rg.ttf') format('truetype');
+ font-weight: 400;
+ font-style: normal;
+}
+@font-face {
+ font-family: 'AmazonEmberDisplay';
+ src: url('../typefaces/AmazonEmberDisplay_Md.woff2') format('woff2'),
+ url('../typefaces/AmazonEmberDisplay_Md.woff') format('woff'),
+ url('../typefaces/AmazonEmberDisplay_Md.eot') format('embedded-opentype'),
+ url('../typefaces/AmazonEmberDisplay_Md.ttf') format('truetype');
+ font-weight: 500;
+ font-style: normal;
+}
+@font-face {
+ font-family: 'AmazonEmberDisplay';
+ src: url('../typefaces/AmazonEmberDisplay_Bd.woff2') format('woff2'),
+ url('../typefaces/AmazonEmberDisplay_Bd.woff') format('woff'),
+ url('../typefaces/AmazonEmberDisplay_Bd.eot') format('embedded-opentype'),
+ url('../typefaces/AmazonEmberDisplay_Bd.ttf') format('truetype');
+ font-weight: 700;
+ font-style: normal;
+}
diff --git a/gh-pages/content/assets/stylesheets/extra.css b/gh-pages/content/assets/stylesheets/extra.css
new file mode 100644
index 0000000000..d921a3e0cb
--- /dev/null
+++ b/gh-pages/content/assets/stylesheets/extra.css
@@ -0,0 +1,96 @@
+:root {
+ --amazon-orange: #ff9900;
+ --amazon-squid-ink: #232f3e;
+
+ --md-primary-bg-color: white;
+ --md-primary-fg-color: var(--amazon-squid-ink);
+ --md-accent-fg-color: var(--amazon-orange);
+
+ --md-default-fg-color--light: #606060;
+ --md-default-fg-color--lighter: #909090;
+ --md-default-fg-color--lightest: #c0c0c0;
+}
+
+:root .highlight > * {
+ /* Code color shades */
+ --md-code-fg-color: #c9d1d9;
+ --md-code-bg-color: #0d1117;
+
+ /* Code highlighting color shades */
+ --md-code-hl-color: rgba(187, 128, 9, 0.25);
+ --md-code-hl-number-color: #56d364;
+ --md-code-hl-special-color: #388bfd;
+ --md-code-hl-function-color: #d2a8ff;
+ --md-code-hl-constant-color: #79c0ff;
+ --md-code-hl-keyword-color: #ff7b72;
+ --md-code-hl-string-color: #a5d6ff;
+ --md-code-hl-name-color: #d2a8ff;
+ --md-code-hl-operator-color: #79c0ff;
+ --md-code-hl-punctuation-color: #c9d1d9;
+ --md-code-hl-comment-color: #8b949e;
+ --md-code-hl-generic-color: #c9d1d9;
+ --md-code-hl-variable-color: #ffa657;
+
+ /* Typeset color shades */
+ --md-typeset-color: var(--md-primary-fg-color);
+ --md-typeset-a-color: var(--md-accent-fg-color);
+
+ /* Typeset `mark` color shades */
+ --md-typeset-mark-color: #f00;
+
+ /* Typeset `del` and `ins` color shades */
+ --md-typeset-del-color: rgba(218, 54, 51, 0.15);
+ --md-typeset-ins-color: rgba(35, 134, 54, 0.15);
+
+ /* Footer color shades */
+ --md-footer-fg-color: white;
+ --md-footer-fg-color--light: var(--md-default-fg-color--lighter);
+ --md-footer-fg-color--lighter: var(--md-default-fg-color--lightest);
+ --md-footer-bg-color: var(--amazon-squid-ink);
+ --md-footer-bg-color--dark: var(--amazon-squid-ink);
+}
+
+body {
+ font-family: 'AmazonEmberDisplay', 'Helvetica Neue', Roboto, Arial, sans-serif;
+}
+
+code,
+pre,
+kbd {
+ font-family: Monaco, Menlo, Consolas, 'Courier Prime', Courier, 'Courier New',
+ monospace;
+}
+
+.md-logo img {
+ width: auto !important;
+}
+
+.md-tabs__link--active,
+.md-nav__item .md-nav__link--active {
+ color: var(--md-accent-fg-color);
+ font-weight: bolder;
+}
+
+/* Custom look for highlighted lines */
+.highlight .hll {
+ box-shadow: inset 4px 0 0 var(--amazon-orange);
+ border-collapse: collapse;
+}
+
+/* Custom look for console session rendering */
+.highlight .gp {
+ color: var(--md-code-hl-special-color);
+}
+.highlight .go {
+ color: var(--md-code-hl-comment-color);
+}
+
+/* Custom look for arbitrary names */
+.highlight .nx {
+ color: var(--md-code-hl-name-color);
+}
+
+/* Custom look for links */
+.md-typeset a {
+ color: #5b79a0;
+}
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.eot b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.eot
new file mode 100755
index 0000000000..94f8dc019b
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.eot differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.ttf b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.ttf
new file mode 100755
index 0000000000..ffc978a642
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.ttf differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.woff b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.woff
new file mode 100755
index 0000000000..5b0146ebc5
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.woff differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.woff2 b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.woff2
new file mode 100755
index 0000000000..7031e15152
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.woff2 differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.eot b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.eot
new file mode 100755
index 0000000000..06f73d8017
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.eot differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.ttf b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.ttf
new file mode 100755
index 0000000000..c52e7151f8
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.ttf differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.woff b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.woff
new file mode 100755
index 0000000000..6cd516bfc0
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.woff differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.woff2 b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.woff2
new file mode 100755
index 0000000000..73c5cc3d78
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.woff2 differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.eot b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.eot
new file mode 100755
index 0000000000..a340601238
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.eot differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.ttf b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.ttf
new file mode 100644
index 0000000000..c54166f847
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.ttf differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.woff b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.woff
new file mode 100755
index 0000000000..0851c05370
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.woff differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.woff2 b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.woff2
new file mode 100755
index 0000000000..28a10bec94
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.woff2 differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.eot b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.eot
new file mode 100755
index 0000000000..7bb09cc491
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.eot differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.ttf b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.ttf
new file mode 100755
index 0000000000..7a70e55c01
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.ttf differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.woff b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.woff
new file mode 100755
index 0000000000..3a804d6632
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.woff differ
diff --git a/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.woff2 b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.woff2
new file mode 100755
index 0000000000..15003bbcb4
Binary files /dev/null and b/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.woff2 differ
diff --git a/gh-pages/content/consumer-guide/index.md b/gh-pages/content/consumer-guide/index.md
new file mode 100644
index 0000000000..6fdce3de36
--- /dev/null
+++ b/gh-pages/content/consumer-guide/index.md
@@ -0,0 +1,11 @@
+# Prerequisites
+
+## :fontawesome-brands-node-js: Common Runtime
+
+Regardless of which language or platform your application is developed in, using *jsii modules* requires a compatible
+`node` runtime to be available in `$PATH`(see [Runtime Architecture]). Current `node` runtime versions support status is
+as follows:
+
+--8<-- "partials/node-support-table.md"
+
+[runtime architecture]: ../home/runtime-architecture.md
diff --git a/gh-pages/content/consumer-guide/python.md b/gh-pages/content/consumer-guide/python.md
new file mode 100644
index 0000000000..e56ae6360c
--- /dev/null
+++ b/gh-pages/content/consumer-guide/python.md
@@ -0,0 +1,85 @@
+# :fontawesome-brands-python: Python
+
+Due to the use of a [custom metaclass][metaclass] as part of the *jsii runtime for Python*, certain **Python** idioms
+require unusual syntax when *jsii modules* are involved.
+
+[metaclass]: https://docs.python.org/3/reference/datamodel.html#metaclasses
+
+!!! info
+ Our intention is to make working with *jsii modules* from **Python** as idiomatic as possible. Removing the [custom
+ metaclass][metaclass] usage without breaking existing code is a challenging task, and the situation may consequently
+ remain sub-optional for the near future at least.
+
+## Implementing Interfaces
+
+Traditionally, **Python** developers expect to be able to either *implicitly* implement an interface by declaring all
+required members, or *explicitly* implement interfaces by simply adding the interface to their class' or interface's
+inheritance chain (and implementing all required members):
+
+!!! bug "Incorrect Use"
+
+ ```py hl_lines="3"
+ from jsii_dependency import IJsiiInterface
+
+ class MyNewClass(IJsiiInterface):
+ """ Traditional implementation of an interface in Python.
+
+ This will not work with interfaces defined by jsii modules, as this will
+ likely cause a metaclass conflict that the user cannot solve.
+ """
+
+ # Member implementations...
+
+ ...
+ ```
+
+The [jsii type system][jsii-type-system] however does not support *structural typing*, and interfaces must **always** be
+*explicitly* implemented. In order to correctly declare implementation of an interface from a *jsii module*, the
+following syntax is used:
+
+```py hl_lines="1 4"
+import jsii
+from jsii_dependency import IJsiiInterface
+
+@jsii.implements(IJsiiInterface)
+class MyNewClass():
+ """ A jsii-supported implementation of the `IJsiiInterface` interface
+
+ This will correctly register the explicit interface implementation on the
+ type's metadata, and ensure instances get correctly serialized to and from
+ the jsii kernel.
+ """
+
+ # Member implementations...
+
+ ...
+```
+
+[jsii-type-system]: ../specification/2-type-system.md
+
+## Property Overrides
+
+When extending or implementing types provided by *jsii modules*, properties must always be implemented using a dynamic
+accessor, ensuring the *jsii runtime for Python* is able to correctly process access to those by the *jsii kernel*. This
+leverages **Python**'s standard `#!py @property` decorator:
+
+```py hl_lines="10 14"
+from jsii_greeter import Greeter
+
+class Shouter(Greeter):
+ """ Shouter extends Greeter up-cases the greetee's name.
+
+ The replacement is implemented using a dynamic @property implementation so
+ it works properly with the jsii kernel.
+ """
+
+ @property
+ def greetee(self) -> str:
+ return super().greetee.upper()
+
+ @greetee.setter
+ def greetee(self, value):
+ super().greetee = value
+
+ ...
+```
diff --git a/docs/configuration.md b/gh-pages/content/dev-guide/configuration/index.md
similarity index 51%
rename from docs/configuration.md
rename to gh-pages/content/dev-guide/configuration/index.md
index 77388954c7..0fd93d4d21 100644
--- a/docs/configuration.md
+++ b/gh-pages/content/dev-guide/configuration/index.md
@@ -1,4 +1,4 @@
-# Configuration
+# Overview
The configuration for `jsii` is recorded in the `package.json` file, which is the standard package manifest for NPM
packages. This document describes the constraints and extensions `jsii` adds to the [package.json schema].
@@ -7,7 +7,7 @@ packages. This document describes the constraints and extensions `jsii` adds to
## jsii-config
-Use [jsii-config](../packages/jsii-config) to aid in configuring a new jsii module.
+Use [jsii-config](https://github.com/aws/jsii/tree/main/packages/jsii-config) to aid in configuring a new jsii module.
## Additional Requirements & Extensions
@@ -17,14 +17,14 @@ optional in the standard [package.json schema] are required by `jsii`.
For example, Maven Central requires packages to carry [sufficient metadata], such as _developer information_ and
_license_, in order to be valid for publishing.
-| Field | Required | Extensions |
-| ------------ | -------- | -------------------------------- |
-| `author` | Required | `author.organization` |
-| `license` | Required |
-| `main` | Required |
-| `repository` | Required |
-| `stability` | | The field itself is an extension |
-| `types` | Required |
+| Field | Required | Extensions |
+| ------------ |:-------------------------------:| -------------------------------- |
+| `author` | :octicons-check-circle-fill-24: | `author.organization` |
+| `license` | :octicons-check-circle-fill-24: | |
+| `main` | :octicons-check-circle-fill-24: | |
+| `repository` | :octicons-check-circle-fill-24: | |
+| `stability` | | The field itself is an extension |
+| `types` | :octicons-check-circle-fill-24: | |
[sufficient metadata]: https://central.sonatype.org/pages/requirements.html#sufficient-metadata
@@ -84,11 +84,11 @@ exported from the `types` file.
### Package-level API Stability
-The [`.jsii` assembly document](./assembly.md) allows representing API stability levels on individual API elements. The
-default value set for API elements for which a stability declaration is not found can be configured using the
-`stability` field of the `package.json` file. It can be set to one of the following values: `experimental`, `stable`,
-`deprecated` and `external`. While the exact semantic value of those fields is defined by the package maintainer, the
-generic interpretation for those on packages is:
+The [`.jsii` assembly document](../../language-support/assembly.md) allows representing API stability levels on
+individual API elements. The default value set for API elements for which a stability declaration is not found can be
+configured using the `stability` field of the `package.json` file. It can be set to one of the following values:
+`experimental`, `stable`, `deprecated` and `external`. While the exact semantic value of those fields is defined by the
+package maintainer, the generic interpretation for those on packages is:
- `experimental` - the package is not yet ready for production usage, as it is still in the early stages of its
development.
@@ -104,14 +104,14 @@ generic interpretation for those on packages is:
In order to configure the behavior of `jsii`, the `package.json` file must include a `jsii` section that can contain the
following entries:
-| Field | Type | Required | Default |
-| ------------------- | ---------- | -------- | ------------------------------- |
-| `excludeTypescript` | `string[]` | | _none_ |
-| `metadata` | `object` | | _none_ |
-| `projectReferences` | `boolean` | | `true` |
-| `targets` | `object` | Required |
-| `tsc` | `object` | | `{ outDir: '.', rootDir: '.' }` |
-| `versionFormat` | `short | full` | | `full` |
+| Field | Type | Required | Default |
+| ------------------- | ----------------------- |:-------------------------------:| ------------------------------------ |
+| `excludeTypescript` | `#!ts string[]` | | _none_ |
+| `metadata` | `#!ts object` | | _none_ |
+| `projectReferences` | `#!ts boolean` | | `#!ts true` |
+| `targets` | `#!ts object` | :octicons-check-circle-fill-24: | |
+| `tsc` | `#!ts object` | | `#!ts { outDir: '.', rootDir: '.' }` |
+| `versionFormat` | `#!ts 'short' | 'full'` | | `#!ts 'full'` |
### `excludeTypescript`
@@ -125,8 +125,9 @@ excluded from the `TypeScript` compiler input.
### `metadata`
The `metadata` section can be used to record additional metadata as key-value pairs that will be recorded as-is into the
-`.jsii` assembly file. That metadata can later be inspected using [`jsii-reflect`](../packages/jsii-reflect) utilities,
-for example.
+`.jsii` assembly file. That metadata can later be inspected using [`jsii-reflect`][jsii-reflect] utilities, for example.
+
+[jsii-reflect]: https://github.com/aws/jsii/tree/main/packages/jsii-reflect
### `targets`
@@ -134,167 +135,12 @@ The `targets` section is where `jsii` packages define which target languages the
generators with the additional information they require in order to name generated artifacts. Configuration is provided
as a mapping from target name to a configuration object.
-#### Configuring `Python`
-
-The `python` target requires two configuration entries:
-
-- `module` - the name of the generated **Python** module, which will be used by users in `import` directives.
-- `distName` - the [PyPI] distribution name for the package.
-- `classifiers` - a list of [trove classifiers] to declare on the package. It is the user's responsibility to specify
- _valid_ values (the authoritative list of valid [trove classifiers] is defined in the [pypa/trove-classifiers]
- package).
- - Some classifiers are automatically included (and should not be added to the `classifiers` property) based on
- relevant configuration from the `package.json` file:
- - `Development Status :: ` is determined based on the package's `stability`
- - `License ::` is determined based on the package's `license`
- - `Operating System :: OS Independent` is always set
- - `Typing :: Typed` is always set
- - Additionally, the following `Programming Language ::` classifiers are already set (more could be added by the user
- if relevant):
- - `Programming Language :: Python :: 3 :: Only`
- - `Programming Language :: Python :: 3.6`
- - `Programming Language :: Python :: 3.7`
- - `Programming Language :: Python :: 3.8`
-
-Example:
-
-```js
-{
- "jsii": {
- "targets": {
- "python": {
- "module": "hello_jsii", // Required
- "distName": "hello-jsii", // Required
- "classifiers": [ // Optional
- "Framework :: AWS CDK",
- "Framework :: AWS CDK :: 1"
- ]
- },
- // ...
- }
- // ...
- },
- // ...
-}
-```
-
-The resulting package can be published to [PyPI].
-
-[pypi]: https://pypi.org/
-[trove classifiers]: https://www.python.org/dev/peps/pep-0301/#distutils-trove-classification
-[pypa/trove-classifiers]: https://github.com/pypa/trove-classifiers
-
-##### Prerelease Versions
-
-The original `npm` package may feature a version number that includes a [SemVer 2.0][semver]-compliant prerelease
-identifer (e.g: `1.2.3-pre.4`). Python packages distributed to [PyPI] must however use a different format to express
-prerelease versions, as specified in [PEP-440]. In order to generate valid packages, only certain prerelease identifiers
-are accepted by `jsii-pacmak`, and are translated according to the following table:
-
-| Source Version (`npm`) | Python Version ([PEP-440]) | Notes |
-| ---------------------- | -------------------------- | -------------------------------- |
-| `X.Y.Z.dev.N` | `X.Y.Z.devN` | Development, iteration `N`. |
-| `X.Y.Z.pre.N` | `X.Y.Z.devN` | Development, iteration `N` |
-| `X.Y.Z.alpha.N` | `X.Y.Z.aN` | Alpha release, iteration `N` |
-| `X.Y.Z.beta.N` | `X.Y.Z.bN` | Beta release, iteration `N` |
-| `X.Y.Z.rc.N` | `X.Y.Z.rcN` | Release candidate, iteration `N` |
-
-[semver]: https://semver.org/spec/v2.0.0.html
-[pep-440]: https://www.python.org/dev/peps/pep-0440/#pre-releases
-
-#### Configuring `Java`
-
-The `java` target requires the following configuration:
-
-- `maven` - the `groupId` and `artifactId` for the **Maven** package.
- - Optionally a `versionSuffix` can be provided that will be appended at the end of the **Maven** package's `version`
- field. The suffix must start with a `.` or a `-`.
-- `package` - the root **Java** package name under which the types will be declared.
-
-Example:
-
-```js
-{
- "jsii": {
- "java": {
- "package": "acme.jsii.hello", // Required
- "maven": {
- "groupId": "acme", // Required
- "artifactId": "jsii-hello", // Required
- "versionSuffix": ".PREVIEW" // Optional
- }
- },
- // ...
- },
- // ...
-}
-```
-
-The resulting artifact is a **Maven** package that can be deployed to [Maven Central] using the
-`deploy-staged-repository` command of the [nexus-staging-maven-plugin].
+The specific configuration accepted for each supported language is presented in dedicated pages:
-[maven central]: https://search.maven.org
-[nexus-staging-maven-plugin]: https://mvnrepository.com/artifact/org.sonatype.plugins/nexus-staging-maven-plugin
-
-#### Configuring `.NET`
-
-The `dotnet` target requires the following configuration:
-
-- `namespace` - the root namespace under which types will be declared.
-- `packageId` - the identified of the package in the NuGet registry.
-- `iconUrl` - the URL of the icon to be shown in the [NuGet Gallery][nuget]. It should be at least 64x64 pixels and a
- transparent background is recommended. See the [.NET documentation] for more information.
-- `versionSuffix` - an optional suffix that will be appended at the end of the NuGet package's `version` field. The
- suffix must start with a `-`.
-- `signAssembly` - whether the assembly should be strong-name signed. Defaults to `false` when not specified.
-- `assemblyOriginatorKeyFile`- the path to the strong-name signing key to be used. When not specified or if the file
- referred to does not exist, the assembly will not be strong-name signed.
-
-Example:
-
-```js
-{
- "jsii": {
- "dotnet": {
- "namespace": "Acme.HelloJsii", // Required
- "packageId": "Acme.HelloJsii", // Required
- "iconUrl": "https://cdn.acme.com/icon.png", // Optional
- "signAssembly": true, // Optional
- "assemblyOriginatorKeyFile": "./key.snk", // Optional
- "versionSuffix": "-preview" // Optional
- },
- // ...
- },
- // ...
-}
-```
-
-The resulting artifact is a NuGet package that can be published to [NuGet] using the standard [`nuget push`][nuget-push]
-command.
-
-[nuget]: https://www.nuget.org
-[nuget-push]: https://docs.microsoft.com/fr-fr/nuget/nuget-org/publish-a-package
-[.net documentation]: https://docs.microsoft.com/en-us/dotnet/core/tools/csproj#packageiconurl
-
-#### Configuring `GoLang` - **Experimental**
-
-The `go` target is currently unstable and not suitable for production use. To enable go package generation, add the `go`
-key with an empty object to the jsii targets configuration.
-
-This will add generated go package code to your specified `outDir` for testing and experimentation.
-
-```js
-{
- "jsii": {
- "targets": {
- "go": {},
- // ...
- },
- // ...
- },
- // ...
-}
-```
+- [:octicons-book-24: .NET Target](targets/dotnet.md)
+- [:octicons-book-24: Go Target](targets/go.md)
+- [:octicons-book-24: Java Target](targets/java.md)
+- [:octicons-book-24: Python Target](targets/python.md)
### `tsc`
@@ -331,15 +177,13 @@ generation problems.
### Diagnostics
-JSII produces a number of diagnostic information. These have been categorized
-into "error", "warning", "suggestion" and "message", by default. Diagnostics
-categorized as "error" will fail the jsii compiler and the rest will be
-printed to console.
+JSII produces a number of diagnostic information. These have been categorized into "error", "warning", "suggestion" and
+"message", by default. Diagnostics categorized as "error" will fail the jsii compiler and the rest will be printed to
+console.
-These can be re-configured to a different category under the `diagnostics` key
-as so -
+These can be re-configured to a different category under the `diagnostics` key as so -
-```js
+```json
"jsii": {
// ...
"diagnostics": {
@@ -351,15 +195,15 @@ as so -
}
```
-As noted in the example above, the diagnostic code can be the human readable
-string, or the numeric code prefixed with `JSII`.
+As noted in the example above, the diagnostic code can be the human readable string, or the numeric code prefixed with
+`JSII`.
The full list of diagnostic codes can be found in
-[`jsii-diagnostic.ts`](./lib/jsii-diagnostic.ts).
+[`jsii-diagnostic.ts`](https://github.com/aws/jsii/tree/main/packages/jsii/lib/jsii-diagnostic.ts).
## Dependency considerations
-Like any node library, `jsii` packages can declare runtime dependencies using the [`dependencies`][npm-reps] section of
+Like any node library, `jsii` packages can declare runtime dependencies using the [`dependencies`][npm-deps] section of
`package.json`.
[npm-deps]: https://docs.npmjs.com/files/package.json#dependencies
diff --git a/gh-pages/content/dev-guide/configuration/targets/dotnet.md b/gh-pages/content/dev-guide/configuration/targets/dotnet.md
new file mode 100644
index 0000000000..53afbb9ffc
--- /dev/null
+++ b/gh-pages/content/dev-guide/configuration/targets/dotnet.md
@@ -0,0 +1,39 @@
+# :fontawesome-brands-microsoft: .NET
+
+The `dotnet` target requires the following configuration:
+
+- `namespace` - the root namespace under which types will be declared.
+- `packageId` - the identified of the package in the NuGet registry.
+- `iconUrl` - the URL of the icon to be shown in the [NuGet Gallery][nuget]. It should be at least 64x64 pixels and a
+ transparent background is recommended. See the [.NET documentation] for more information.
+- `versionSuffix` - an optional suffix that will be appended at the end of the NuGet package's `version` field. The
+ suffix must start with a `-`.
+- `signAssembly` - whether the assembly should be strong-name signed. Defaults to `false` when not specified.
+- `assemblyOriginatorKeyFile`- the path to the strong-name signing key to be used. When not specified or if the file
+ referred to does not exist, the assembly will not be strong-name signed.
+
+Example:
+
+```js
+{
+ "jsii": {
+ "dotnet": {
+ "namespace": "Acme.HelloJsii", // Required
+ "packageId": "Acme.HelloJsii", // Required
+ "iconUrl": "https://cdn.acme.com/icon.png", // Optional
+ "signAssembly": true, // Optional
+ "assemblyOriginatorKeyFile": "./key.snk", // Optional
+ "versionSuffix": "-preview" // Optional
+ },
+ // ...
+ },
+ // ...
+}
+```
+
+The resulting artifact is a NuGet package that can be published to [NuGet] using the standard [`nuget push`][nuget-push]
+command.
+
+[nuget]: https://www.nuget.org
+[nuget-push]: https://docs.microsoft.com/fr-fr/nuget/nuget-org/publish-a-package
+[.net documentation]: https://docs.microsoft.com/en-us/dotnet/core/tools/csproj#packageiconurl
diff --git a/gh-pages/content/dev-guide/configuration/targets/go.md b/gh-pages/content/dev-guide/configuration/targets/go.md
new file mode 100644
index 0000000000..78756aa74d
--- /dev/null
+++ b/gh-pages/content/dev-guide/configuration/targets/go.md
@@ -0,0 +1,21 @@
+# Go
+
+!!! danger
+ The **go** target is currently unstable and not suitable for production use.
+
+To enable go package generation, add the **go** key with an empty object to the jsii targets configuration.
+
+This will add generated go package code to your specified `outDir` for testing and experimentation.
+
+```json
+{
+ "jsii": {
+ "targets": {
+ "go": {},
+ // ...
+ },
+ // ...
+ },
+ // ...
+}
+```
diff --git a/gh-pages/content/dev-guide/configuration/targets/java.md b/gh-pages/content/dev-guide/configuration/targets/java.md
new file mode 100644
index 0000000000..cb63b36d59
--- /dev/null
+++ b/gh-pages/content/dev-guide/configuration/targets/java.md
@@ -0,0 +1,33 @@
+# :fontawesome-brands-java: Java
+
+The `java` target requires the following configuration:
+
+- `maven` - the `groupId` and `artifactId` for the **Maven** package.
+ - Optionally a `versionSuffix` can be provided that will be appended at the end of the **Maven** package's `version`
+ field. The suffix must start with a `.` or a `-`.
+- `package` - the root **Java** package name under which the types will be declared.
+
+Example:
+
+```js
+{
+ "jsii": {
+ "java": {
+ "package": "acme.jsii.hello", // Required
+ "maven": {
+ "groupId": "acme", // Required
+ "artifactId": "jsii-hello", // Required
+ "versionSuffix": ".PREVIEW" // Optional
+ }
+ },
+ // ...
+ },
+ // ...
+}
+```
+
+The resulting artifact is a **Maven** package that can be deployed to [Maven Central] using the
+`deploy-staged-repository` command of the [nexus-staging-maven-plugin].
+
+[maven central]: https://search.maven.org
+[nexus-staging-maven-plugin]: https://mvnrepository.com/artifact/org.sonatype.plugins/nexus-staging-maven-plugin
diff --git a/gh-pages/content/dev-guide/configuration/targets/python.md b/gh-pages/content/dev-guide/configuration/targets/python.md
new file mode 100644
index 0000000000..372fab2206
--- /dev/null
+++ b/gh-pages/content/dev-guide/configuration/targets/python.md
@@ -0,0 +1,68 @@
+# :fontawesome-brands-python: Python
+
+The `python` target requires two configuration entries:
+
+- `module` - the name of the generated **Python** module, which will be used by users in `import` directives.
+- `distName` - the [PyPI] distribution name for the package.
+- `classifiers` - a list of [trove classifiers] to declare on the package. It is the user's responsibility to specify
+ _valid_ values (the authoritative list of valid [trove classifiers] is defined in the [pypa/trove-classifiers]
+ package).
+ - Some classifiers are automatically included (and should not be added to the `classifiers` property) based on
+ relevant configuration from the `package.json` file:
+ - `Development Status :: ` is determined based on the package's `stability`
+ - `License ::` is determined based on the package's `license`
+ - `Operating System :: OS Independent` is always set
+ - `Typing :: Typed` is always set
+ - Additionally, the following `Programming Language ::` classifiers are already set (more could be added by the user
+ if relevant):
+ - `Programming Language :: Python :: 3 :: Only`
+ - `Programming Language :: Python :: 3.6`
+ - `Programming Language :: Python :: 3.7`
+ - `Programming Language :: Python :: 3.8`
+ - `Programming Language :: Python :: 3.9`
+
+Example:
+
+```js
+{
+ "jsii": {
+ "targets": {
+ "python": {
+ "module": "hello_jsii", // Required
+ "distName": "hello-jsii", // Required
+ "classifiers": [ // Optional
+ "Framework :: AWS CDK",
+ "Framework :: AWS CDK :: 1"
+ ]
+ },
+ // ...
+ }
+ // ...
+ },
+ // ...
+}
+```
+
+The resulting package can be published to [PyPI].
+
+[pypi]: https://pypi.org/
+[trove classifiers]: https://www.python.org/dev/peps/pep-0301/#distutils-trove-classification
+[pypa/trove-classifiers]: https://github.com/pypa/trove-classifiers
+
+## Prerelease Versions
+
+The original `npm` package may feature a version number that includes a [SemVer 2.0][semver]-compliant prerelease
+identifer (e.g: `1.2.3-pre.4`). Python packages distributed to [PyPI] must however use a different format to express
+prerelease versions, as specified in [PEP-440]. In order to generate valid packages, only certain prerelease identifiers
+are accepted by `jsii-pacmak`, and are translated according to the following table:
+
+| Source Version (`npm`) | Python Version ([PEP-440]) | Notes |
+| ---------------------- | -------------------------- | -------------------------------- |
+| `X.Y.Z.dev.N` | `X.Y.Z.devN` | Development, iteration `N`. |
+| `X.Y.Z.pre.N` | `X.Y.Z.devN` | Development, iteration `N` |
+| `X.Y.Z.alpha.N` | `X.Y.Z.aN` | Alpha release, iteration `N` |
+| `X.Y.Z.beta.N` | `X.Y.Z.bN` | Beta release, iteration `N` |
+| `X.Y.Z.rc.N` | `X.Y.Z.rcN` | Release candidate, iteration `N` |
+
+[semver]: https://semver.org/spec/v2.0.0.html
+[pep-440]: https://www.python.org/dev/peps/pep-0440/#pre-releases
diff --git a/gh-pages/content/dev-guide/index.md b/gh-pages/content/dev-guide/index.md
new file mode 100644
index 0000000000..beeb89dd75
--- /dev/null
+++ b/gh-pages/content/dev-guide/index.md
@@ -0,0 +1,45 @@
+# Prerequisites
+
+## :fontawesome-brands-node-js: Common Runtime
+
+Whether you are developing _jsii modules_ or consuming them (see [Runtime Architecture]), a compatible `node` runtime
+must be available. Current `node` runtime versions support status is as follows:
+
+--8<-- "partials/node-support-table.md"
+
+[runtime architecture]: ../home/runtime-architecture.md
+
+## :octicons-file-code-24: Other Languages
+
+When developing _jsii modules_, the SDK for each desired target language must be available for `jsii-pacmak` to be able
+to produce releasable artifacts.
+
+| Language/Platform | SDK Requirement |
+| ----------------- | ---------------------------- |
+| .NET | .NET Core ≥ 3.1 / .NET ≥ 5.0 |
+| Go | Go ≥ 1.15 |
+| Java | JDK ≥ 8 *and* Maven ≥ 3.6 |
+| Python | Python ≥ 3.6 |
+
+
+## :octicons-desktop-download-24: Download Locations
+
+This table provides typical download locations for the prerequisites mentioned in this document. Most of these tools can
+also be installed using traidtional package managers (standard for the operating system and platform).
+
+| Tool | Description | Location |
+| --------------- | ---------------------------------------- | ------------------------|
+| .NET | Official Microsoft .NET SDK distribution | [Download][dl-dotnet] |
+| Amazon Corretto | Amazon's free OpenJDK distribution | [Download][dl-corretto] |
+| Go | Official Go distribution | [Download][dl-go] |
+| OpenJDK | Oracle OpenJDK distribution | [Download][dl-openjdk] |
+| Maven | Official Maven distribution | [Download][dl-mvn] |
+| Node | Official NodeJS distribution | [Download][dl-node] |
+
+[dl-dotnet]: https://dotnet.microsoft.com/download
+[dl-go]: https://golang.org/dl/
+[dl-openjdk]: https://openjdk.java.net/install/index.html
+[dl-corretto]: https://aws.amazon.com/fr/corretto/
+[dl-mvn]: https://maven.apache.org/download.cgi
+[dl-python]: https://www.python.org/downloads/
+[dl-node]: https://nodejs.org/en/download/
diff --git a/gh-pages/content/dev-guide/set-up.md b/gh-pages/content/dev-guide/set-up.md
new file mode 100644
index 0000000000..98ef644469
--- /dev/null
+++ b/gh-pages/content/dev-guide/set-up.md
@@ -0,0 +1,128 @@
+# Set Up
+
+## Creating a new _npm_ package
+
+Start by creating a new empty _npm_ package:
+
+```console
+# mkdir project-name
+# cd project-name
+# npm init -y
+Wrote to /Users/rmuller/Downloads/project-name/package.json:
+
+{
+ "name": "project-name",
+ "version": "1.0.0",
+ "description": "",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "keywords": [],
+ "author": "",
+ "license": "ISC"
+}
+```
+
+## Adding mandatory metadata
+
+Then, add the mandatory information to the new `package.json` file that was created. Specifically, _jsii modules_ must
+have an `author` and `repository` setting (those are necessary to generate _valid_ libraries for certain distribution
+points, such as _Maven Central_):
+
+```json hl_lines="4 10-13 14-16"
+{
+ "name": "project-name",
+ "version": "1.0.0",
+ "description": "A demonstration jsii library",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "keywords": [],
+ "author": {
+ "name": "John Doe",
+ "email": "john.doe@acme.com"
+ },
+ "repository": {
+ "url": "https://github.com/acme/project-name.git"
+ },
+ "license": "ISC"
+}
+```
+
+## Setting up the _jsii_ configuration
+
+Finish up the configuration by running `jsii-config`, and letting the assistant guide you through the process:
+
+```console
+# npx jsii-config
+? Target Languages (Press to select, to toggle all, to invert selection)
+❯◯ java
+ ◯ python
+ ◯ dotnet
+...
+Success!
+```
+
+## Install Dependencies
+
+Now, you're ready to install the basic tools into the packages' dependency closure. The exact instructions depend on the
+**JavaScript** package manager you want to be using:
+
+=== "yarn"
+
+ ```console
+ # yarn add -D jsii jsii-pacmak
+ yarn add v1.22.10
+ info No lockfile found.
+ [1/4] 🔍 Resolving packages...
+ [2/4] 🚚 Fetching packages...
+ [3/4] 🔗 Linking dependencies...
+ [4/4] 🔨 Building fresh packages...
+ success Saved lockfile.
+ success Saved 66 new dependencies.
+ ...
+ ```
+
+=== "npm"
+
+ ```console
+ # npm install --save-dev jsii jsii-pacmak
+
+ added 107 packages, and audited 107 packages in 4s
+
+ 39 packages are looking for funding
+ run `npm fund` for details
+
+ found 0 vulnerabilities
+ ```
+
+## Set up essential scripts
+
+Finally, you might want to configure convenience scripts in your `package.json` file in order to facilitate working with
+your project:
+
+```json hl_lines="7-9"
+{
+ "name": "project-name",
+ "version": "1.0.0",
+ "description": "A demonstration jsii library",
+ "main": "index.js",
+ "scripts": {
+ "build": "jsii",
+ "build:watch": "jsii --watch",
+ "package": "jsii-pacmak"
+ },
+ "keywords": []
+ // ...
+}
+```
+
+Those scripts have the following effect:
+
+| Script | Description |
+| ------------- | ------------------------------------------------- |
+| `build` | Compiles the project |
+| `build:watch` | Watches for file changes and recompiles as needed |
+| `package` | Generates libraries for all languages |
diff --git a/gh-pages/content/dev-guide/typescript-restrictions.md b/gh-pages/content/dev-guide/typescript-restrictions.md
new file mode 100644
index 0000000000..499828a201
--- /dev/null
+++ b/gh-pages/content/dev-guide/typescript-restrictions.md
@@ -0,0 +1,239 @@
+# TypeScript Restrictions
+
+Since the API exported by *jsii modules* will be represented in a variety of other languages, certain restrictions are
+enforced by the `jsii` compiler.
+
+!!! info
+ Since those restrictions are solely intended to ensure the exported API can be represented in other languages, they
+ do not apply to any internal declarations such as `#!ts private` members and declarations annotated with the
+ `#!ts /** @internal */` tag.
+
+## Dependencies
+
+A *jsii module* can declare dependencies on any other *jsii module* by adding entries in the `dependencies` key in the
+`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`.
+
+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.
+
+!!! info
+ For more information on `package.json` file contents, refer to the [npm documentation][package-json].
+
+ [package-json]: https://docs.npmjs.com/cli/v6/configuring-npm/package-json
+
+## Naming
+
+### Class Members
+
+Members of *classes* cannot share the same *PascalCased* representation as the declaring *class* itself, as this results
+in invalid **C#** code:
+
+```ts hl_lines="2-3 7-8"
+export class Foo {
+ // 💥 Illegal property name
+ public foo: string;
+}
+
+export class Bar {
+ // 💥 Illegal method name
+ public bar(): void { /* ... */ }
+}
+```
+
+!!! danger
+ Due to existing usage, this restriction is only enforced when `jsii` is invoked with the `--strict` option. The
+ generated **C#** class name will receive a `_` suffix if any of it's members conflict, which is a breaking change to
+ existing **.NET** consumers when a conflicting member is introduced after the initial release.
+
+### Interfaces
+
+The `jsii` type model distinguishes two kinds of *interfaces*:
+
+- *Behavioral interfaces*, which can declare methods and properties
+- *Structs*, which are immutable pure data entities, and can consequently only declare `#!ts readonly` properties
+
+A name convention is used to distinguish between these two: *behavioral interfaces* must have a name that starts with a
+`I` prefix, while *structs* must not have such a prefix.
+
+```ts hl_lines="5-8"
+/**
+ * Since there is no `I` prefix, Foo is considered to be a struct.
+ */
+export interface Foo {
+ // 💥 Structs are not allowed to declare methods
+ foo(): void;
+ // 💥 Structs are not allowed to declare mutable properties
+ mutableProperty: number;
+ // ✅ Structs can declare immutable properties
+ readonly immutableProperty: string;
+}
+
+/**
+ * Since there is an `I` prefix, IFoo is considered to be a behavioral interface.
+ */
+export interface IFoo {
+ // ✅ Behavioral interfaces can declare methods
+ foo(): void;
+ // ✅ Behavioral interfaces can declare mutable properties
+ mutableProperty: number;
+ // ✅ Behavioral interfaces can declare immutable properties
+ readonly immutableProperty: string;
+}
+```
+
+## Inheritance
+
+### Structs
+
+As *structs* are pure data entities, they can only be extended by other *structs*:
+
+```ts hl_lines="3-4 6-7"
+export interface Struct { /* ...readonly properties... */ }
+
+// 💥 Structs cannot be extended by behavioral interfaces
+export interface IBehavioralInterface extends Struct { /* ... */ }
+
+// 💥 Structs cannot be implemented by classes
+export class ConcreteType implements Struct { /* ... */ }
+
+// ✅ Structs can extend other structs
+export interface SuperStruct extends Struct { /* ...readonly properties */ }
+```
+
+### Member Visibility
+
+The **C#** language does not allow overriding members to change the visibility of the overridden declaration, even if
+the updated visibility is more permissive. As a consequence, overridden members are required to retain the same
+visibility as their parents.
+
+!!! danger
+ This makes changing the visibility of a `#!ts protected` member to `#!ts public` is a breaking change in `jsii`
+ libraries!
+
+```ts hl_lines="6-7"
+export class Base {
+ protected method(): void { /* ... */ }
+}
+
+export class Subclass extends Base {
+ // 💥 Illegal change of visibility from protected to public
+ public method(): void { /* ... */ }
+}
+```
+
+### Covariant Overrides & Parameter List Changes
+
+In **TypeScript**, overriding members can have a signature that differs from the overridden member as long as the new
+signature is compatible with the parent. This is however not supported as:
+
+- **Java** and **C#** do not support omitting parameters when overriding or implementing a member
+- **C#** does not support overriding or implementing a member using covariant parameter or return types
+
+!!! note
+ **C# 9** introduces support for covariant return types, which would allow relaxing this restriction, however `jsii`
+ must build code targetting the `.NET Core 3.1` runtime, which only supports **C# 8**. Once `.NET Core 3.1` becimes
+ end-of-life, this may change.
+
+```ts hl_lines="6-7 9-10 12-13"
+export class Base {
+ public method(param: any): any { /* ... */ }
+}
+
+export class Child extends Base {
+ // 💥 Parameter signatures do not match
+ public method(): any { /* ... */ }
+
+ // 💥 Parameter types do not match, even though they are covariant
+ public method(param: string): any { /* ... */ }
+
+ // 💥 Return type does not match, even though it is covariant
+ public method(param: any): string { /* ... */ }
+}
+```
+
+## Parameterized Types (aka: Generics)
+
+Parameterized types are not consistently supported in all supported target languages. **Go** does not currently support
+generics, and the differences in generic semantics between **TypeScript**, **C#** and **Java** make it difficult to
+correctly represent such types in all those languages. As a consequence, `jsii` does not support declaring parameterized
+types.
+
+Only certain *built-in* parameterized types can be used in `jsii` modules:
+- `Array`, which is equivalent to `T[]`
+- `Record`, which is equivalent to `{ [key: string]: T }`
+- `Promise`, which is the return type of any *asynchronous* method
+
+```ts hl_lines="1-4"
+// 💥 Parameterized types cannot be introduced
+export interface Parameterized {
+ readonly value: T;
+}
+
+export interface IAsyncFooMaker {
+ // ✅ Asynchronous methods must return promises
+ makeFoo(): Promise;
+ // ✅ Arrays are supported
+ makeFoos(count: number): Array>;
+}
+```
+
+# Soft-Reserved Words
+
+In order to guarantee a consistent developer experience across all supported languages, `jsii` emits warnings whenever
+a declaration is named after any target language's *reserved words*, as those will need renaming in target languages:
+
+**C#** | **Java** | **Python** | **Go**
+---------------|----------------|--------------|-------------
+`abstract` | `abstract` | `False` | `break`
+`base` | `assert` | `None` | `case`
+`bool` | `boolean` | `True` | `chan`
+`byte` | `byte` | `and` | `const`
+`char` | `char` | `assert` | `continue`
+`checked` | `double` | `def` | `default`
+`decimal` | `final` | `del` | `defer`
+`delegate` | `float` | `elif` | `else`
+`double` | `goto` | `except` | `fallthrough`
+`event` | `int` | `from` | `for`
+`explicit` | `long` | `global` | `func`
+`extern` | `native` | `is` | `go`
+`fixed` | `short` | `lambda` | `goto`
+`float` | `strictfp` | `nonlocal` | `if`
+`foreach` | `synchronized` | `not` | `import`
+`goto` | `throws` | `or` | `interface`
+`implicit` | `transient` | `pass` | `map`
+`int` | `volatile` | `raise` | `package`
+`internal` | | | `range`
+`is` | | | `return`
+`lock` | | | `select`
+`long` | | | `struct`
+`namespace` | | | `switch`
+`object` | | | `type`
+`operator` | | | `var`
+`out` | | |
+`override` | | |
+`params` | | |
+`readonly` | | |
+`ref` | | |
+`sbyte` | | |
+`sealed` | | |
+`short` | | |
+`sizeof` | | |
+`stackalloc` | | |
+`string` | | |
+`struct` | | |
+`uint` | | |
+`ulong` | | |
+`unchecked` | | |
+`unsafe` | | |
+`ushort` | | |
+`using` | | |
+`virtual` | | |
+`volatile` | | |
+
+!!! info
+ The list of reserved words is derived from [`jsii/lib/reserved-words.ts`][reserved-words.ts].
+
+ [reserved-words.ts]: https://github.com/aws/jsii/tree/main/packages/jsii/lib/reserved-words.ts
diff --git a/gh-pages/content/dev-guide/write-code.md b/gh-pages/content/dev-guide/write-code.md
new file mode 100644
index 0000000000..df4cad3be5
--- /dev/null
+++ b/gh-pages/content/dev-guide/write-code.md
@@ -0,0 +1,70 @@
+# Write Code
+
+## The `index.ts` content
+
+Create a new `index.ts` file with your initial code:
+
+```ts
+export interface GreeterProps {
+ readonly greetee: string;
+}
+
+export class Greeter {
+ private readonly greetee: string;
+
+ public constructor(props: GreeterProps) {
+ this.greetee = props.greetee;
+ }
+
+ public greet(): string {
+ return `Hello, ${this.greetee}!`
+ }
+}
+```
+
+## Iterate
+
+Either run the `build` or `build:watch` script from the [Set Up](set-up.md) step in order to compile the project. The
+necessary `tsconfig.json` is automatically created so the **TypeScript** compiler produces the correct output.
+
+## Generate Targets
+
+Once you are satisfied with the library, bindings in all supproted languages can be generated by running `jsii-pacmak`,
+typically by using the `package` script from the [Set Up](set-up.md) step. Publishable artifacts will be generated and
+placed in per-language sub-directories of the `dist` folder:
+
+```console
+$ tree dist
+dist
+├── dotnet
+│ ├── Acme.ProjectName.1.0.0.nupkg
+│ └── Acme.ProjectName.1.0.0.snupkg
+├── java
+│ └── com
+│ └── acme
+│ └── sample
+│ └── project-name
+│ ├── 1.0.0
+│ │ ├── project-name-1.0.0-javadoc.jar
+│ │ ├── project-name-1.0.0-javadoc.jar.md5
+│ │ ├── project-name-1.0.0-javadoc.jar.sha1
+│ │ ├── project-name-1.0.0-sources.jar
+│ │ ├── project-name-1.0.0-sources.jar.md5
+│ │ ├── project-name-1.0.0-sources.jar.sha1
+│ │ ├── project-name-1.0.0.jar
+│ │ ├── project-name-1.0.0.jar.md5
+│ │ ├── project-name-1.0.0.jar.sha1
+│ │ ├── project-name-1.0.0.pom
+│ │ ├── project-name-1.0.0.pom.md5
+│ │ └── project-name-1.0.0.pom.sha1
+│ ├── maven-metadata.xml
+│ ├── maven-metadata.xml.md5
+│ └── maven-metadata.xml.sha1
+├── js
+│ └── project-name@1.0.0.jsii.tgz
+└── python
+ ├── project-name-1.0.0.tar.gz
+ └── project_name-1.0.0-py3-none-any.whl
+
+9 directories, 20 files
+```
diff --git a/gh-pages/content/home/features.md b/gh-pages/content/home/features.md
new file mode 100644
index 0000000000..bf6f1c1fc9
--- /dev/null
+++ b/gh-pages/content/home/features.md
@@ -0,0 +1,49 @@
+# Features
+
+## TypeScript Support
+
+The `jsii` compiler leverages the original [TypeScript] compiler API to compile **TypeScript** source files and produce
+**JavaScript** output and _TypeScript declaration files_, while also extracting the compiled module's API signatures in
+a _jsii assembly file_.
+
+To determine the version of **TypeScript** that is in use by the installed release of `jsii`, simply look at the
+`jsii --version` output:
+
+```console
+# jsii --version
+1.15.0 (build 585166b), typescript 3.9.7
+```
+
+You can then refer to the [TypeScript] documentation to determine which language features are available in that specific
+[TypeScript] release.
+
+!!! warning
+ The `jsii` compiler imposes some restrictions on what **TypeScript** features can be used to declare the APIs
+ exported by a *jsii module*, in order to ensure those APIs can be consistently represented in other languages. For
+ more information, refer to the [TypeScript Restrictions page][restrictions].
+
+ [restrictions]: ../dev-guide/typescript-restrictions.md
+
+[typescript]: https://www.typescriptlang.org
+
+## Target Languages
+
+The following target languages are currently offered by `jsii-pacmak`, or are currently being developed:
+
+| Language | Status |
+| ---------- | ---------------------------------------------- |
+| C# | :octicons-check-circle-24: Generally Available |
+| Go | :octicons-tools-24: Development |
+| Java | :octicons-check-circle-24: Generally Available |
+| JavaScript | :octicons-check-circle-24: Generally Available |
+| Kotlin | :octicons-tools-24: Development |
+| Python | :octicons-check-circle-24: Generally Available |
+| TypeScript | :octicons-check-circle-24: Generally Available |
+
+??? question "Status Definitions"
+ - **:octicons-check-circle-24: Generally Available** languages are fully supported. The generated APIs will not
+ change in breaking ways across minor and patch releases.
+ - **:octicons-beaker-24: Developer Preview** languages are experimental. The generated APIs may change in breaking
+ ways across minor releases.
+ - **:octicons-tools-24: Development** languages are not yet ready for consumption. They are actively developed and
+ may still lack certain essential features.
diff --git a/docs/runtime-architecture.md b/gh-pages/content/home/runtime-architecture.md
similarity index 97%
rename from docs/runtime-architecture.md
rename to gh-pages/content/home/runtime-architecture.md
index 6756f46274..2fbf684280 100644
--- a/docs/runtime-architecture.md
+++ b/gh-pages/content/home/runtime-architecture.md
@@ -3,7 +3,7 @@
When using `jsii-pacmak` to generate libraries in different programming
languages, the **Javascript** code is bundled within the generated library, so
-that it can be used during at runtime. This is the reason why a `node` runtime
+that it can be used at runtime. This is the reason why a `node` runtime
needs to be available in order to execute code that depends on *jsii* libraries.
The generated libraries have a dependency on a *Runtime client* library for the
@@ -42,7 +42,10 @@ A simplified representation of the execution environment of an application using
└─────────────────────────────────────────────────────────────────┘
```
+## Serialization Strategy
+
The initialization workflow can be described as:
+
1. The *host* (**Java**, **.NET**, ...) application starts on its own runtime
(JVM, .NET Runtime, ...)
2. When the *host* code encounters a *jsii* entity for the first time (creating
diff --git a/gh-pages/content/home/toolchain.md b/gh-pages/content/home/toolchain.md
new file mode 100644
index 0000000000..1fc3e11611
--- /dev/null
+++ b/gh-pages/content/home/toolchain.md
@@ -0,0 +1,38 @@
+# Toolchain
+
+**jsii** consists of multiple single-purposed programs which can be used to compose various workflows.
+
+!!! info
+ We are considering creating an "umbrella entrypoint" to make it easier to consume.
+
+| Name | Stability | Description |
+| -------------- | ------------ | --------------------------------------------------------------------- |
+| [jsii] | Stable | Compiles TypeScript to jsii module |
+| [jsii-pacmak] | Stable | Creates ready-to-publish language-specific packages from jsii modules |
+| [jsii-reflect] | Stable | Strong-typed reflection library for jsii type systems |
+| [jsii-diff] | Stable | API backwards compatibility checker |
+| [jsii-rosetta] | Experimental | Transpile code snippets (in docs) from TypeScript to jsii languages |
+| [jsii-config] | Experimental | Interactive tool for generating jsii configuration |
+| [jsii-release] | Community | Publishes jsii modules to all supported package managers |
+| [jsii-srcmak] | Community | Generates relocatable source code in jsii languages from typescript |
+| [jsii-docgen] | Community | Generates markdown API documentation for jsii modules |
+
+??? question "Stability Definitions"
+ - **Stable**: Projects that comply with the [Semantic Versioning][semver] specification, and will hence not change
+ behavior or receive other breaking changes across minor and patch version bumps.
+ - **Experimental**: Projects that are under active development and may change behavior or receive other breaking
+ changes across minor releases.
+ - **Community**: a community-maintained project, not officially supported by the *jsii core team*.
+
+ [semver]: https://semver.org/spec/v2.0.0.html
+
+
+[jsii]: https://github.com/aws/jsii/tree/main/packages/jsii
+[jsii-pacmak]: https://github.com/aws/jsii/tree/main/packages/jsii-pacmak
+[jsii-reflect]: https://github.com/aws/jsii/tree/main/packages/jsii-reflect
+[jsii-config]: https://github.com/aws/jsii/tree/main/packages/jsii-config
+[jsii-diff]: https://github.com/aws/jsii/tree/main/packages/jsii-diff
+[jsii-rosetta]: https://github.com/aws/jsii/tree/main/packages/jsii-rosetta
+[jsii-release]: https://github.com/eladb/jsii-release
+[jsii-srcmak]: https://github.com/eladb/jsii-srcmak
+[jsii-docgen]: https://github.com/eladb/jsii-docgen
diff --git a/gh-pages/content/index.md b/gh-pages/content/index.md
new file mode 100644
index 0000000000..ca9efd6bab
--- /dev/null
+++ b/gh-pages/content/index.md
@@ -0,0 +1,104 @@
+# Introduction
+
+`jsii` allows code in any language to naturally interact with **JavaScript** classes. It is the technology that enables
+the [AWS Cloud Development Kit][cdk] to deliver polyglot libraries from a single codebase!
+
+[cdk]: https://github.com/aws/aws-cdk
+
+A class library written in **TypeScript** can be used in projects authored in **TypeScript** or **Javascript** (as
+usual), but also in **C#** (and other languages from the _.NET_ family), **Go**, **Java**, **Python**, ... More
+languages will be added in the future!
+
+!!! warning
+ Due to *JSON* marshaling costs and the absence of a distributed garbage collector feature, `jsii` modules are best
+ suited for development and build tools, as opposed to performance-sensitive or resource-constrained applications.
+
+ See [Runtime Architecture] for more information.
+
+ [runtime architecture]: home/runtime-architecture.md
+
+## An example is worth a thousand words
+
+Consider the following **TypeScript** class:
+
+```ts
+/**
+ * A simple greeter, hello world style.
+ */
+export class Greeter {
+ /**
+ * Greets the designated person.
+ *
+ * @param name the person to greet.
+ *
+ * @returns a greeting.
+ */
+ public greet(name: string) {
+ return `Hello, ${name}!`;
+ }
+}
+```
+
+By compiling our source module using `jsii`, we can now package it as modules in one of the supported target languages.
+Each target module has the exact same API as the source. This allows users of that target language to use `Greeter` like
+any other native type:
+
+=== "C#"
+
+ ```csharp
+ var greeter = new Greeter();
+ greeter.Greet("World"); // => Hello, World!
+ ```
+
+=== "Go"
+
+ ```go
+ greeter := NewGreeter()
+ greeter.Greet("World") // => Hello, World!
+ ```
+
+=== "Java"
+
+ ```java
+ final Greeter greeter = new Greeter();
+ greeter.greet("World"); // => Hello, World!
+ ```
+
+=== "JavaScript"
+
+ ```java
+ const greeter = new Greeter();
+ greeter.greet("World"); // => Hello, World!
+ ```
+
+=== "Python"
+
+ ```python
+ greeter = Greeter()
+ greeter.greet("World") # => Hello, World!
+ ```
+
+## How to use this website
+
+The documentation in this website is separated in four different topics, which are intended for different audiences:
+
+- The [Author Guide](dev-guide/index.md) is intended for developers who are looking to author libraries using *jsii*
+ to enable polyglot support for their work.
+- The [Consumer Guide](consumer-guide/index.md) is intended for developers who are consuming libraries generated by
+ *jsii* in the various supported target languages.
+- The [Language Implementation](language-support/index.md) is intended for developers who are looking to add support for
+ a new *target language* in *jsii*.
+- The [Specification](specification/1-introduction.md) provides detailed information on the internal components of
+ *jsii*.
+
+## How to contribute
+
+The [*jsii project*](https://github.com/aws/jsii) welcomes all kind of contributions. You can refer to the
+[Contribution Guide](https://github.com/aws/jsii/trees/main/CONTRIBUTING.md) on GitHub to get more information about how
+to contribute to the project in general.
+
+!!! tip
+ You can submit pull requests for documentation updates without leaving the comfort of your web browser!
+
+ All pages of this website have a :material-pencil: icon on the top right of each page that links to a GitHub web
+ editor for the source of the page in question.
diff --git a/gh-pages/content/language-support/assembly.md b/gh-pages/content/language-support/assembly.md
new file mode 100644
index 0000000000..08f8e57ae7
--- /dev/null
+++ b/gh-pages/content/language-support/assembly.md
@@ -0,0 +1,174 @@
+# `.jsii` Assemblies
+
+This document describes the contents of the `.jsii` assembly documents generated by the `jsii` compiler, and explains
+the semantics behind the various entities it represents. This serves as a reference for front-end language implementors.
+
+## Schema
+
+`.jsii` assemblies are JSON-formatted documents. The specification is hosted under the [`jsii-spec`][jsii-spec] package.
+Refer to the inline documentation in the [`spec.ts`][spec.ts] file for more information about the general content of the
+assembly documents.
+
+The most important part of the assembly documentation, which is described in detail in this document, is the `types`
+map, which contains the descriptions of all types declared by the `.jsii` assembly. It is a map from `jsii` fully-
+qualified type names to a type specification.
+
+All `boolean` attributes in the document specification are optional, and are left out (`undefined`) when `false`.
+
+[jsii-spec]: https://github.com/aws/jsii/tree/main/packages/jsii-spec
+[spec.ts]: https://github.com/aws/jsii/tree/main/packages/jsii-spec/lib/spec.ts
+
+### Common Attributes
+
+Certain optional attributes are shared by API entities (types and members):
+
+- `docs` - documentation attached to the API entity
+ - `deprecated` - contains a message explaining why an API was deprecated and/or how users should migrate away
+ - `stability` - the stability level of the API entity. The ultimate meaning of the stability level is up to the
+ package maintainer, but a baseline interpretation of the valid values follows:
+ - `experimental` denotes an API that is actively worked on and are not subject to semantic versioning gurantees
+ (they may receive breaking change on a _minor_ version release)
+ - `stable` denotes an API that is safe to use in production systems and are subject ot semantic versioning
+ guarantees (they may not receive breaking changes without a _major_ version bump)
+ - `deprecated` denotes an API that should no longer be used. The `deprecated` entry in the `docs` object should
+ contain a message explaining how users should migrate away
+ - `external` denotes an API that is not owned by the package's maintainer and may change in unexpected ways. Such
+ APIs are usually derived from external artifacts, which the package maintainers do not have control over.
+ - additional entries represent user-defined `JSDoc` tags with meaning defined by convention and/or the package
+ maintainer
+- `locationInModule` - coordinates of the declaration in the source
+ - `fileName` - the path to the source file, relative to the package root
+ - `line` - the line number on which the entity is declared (or the first line when a declaration spans multiple lines)
+
+### Types
+
+#### Classes
+
+| Attribute | Type | Description |
+| ------------- | ------------- | ----------------------------------------------------------------- |
+| `kind` | `'class'` | Discriminator to identify classes |
+| `abstract` | `boolean` | Whether this class is _abstract_ |
+| `assembly` | `string` | The name of the assembly this class is a part of |
+| `base` | `string` | The fully-qualified name of the parent class of this class |
+| `fqn` | `string` | The fully-qualified name of the class |
+| `initializer` | `Constructor` | The class' [constructor] |
+| `interfaces` | `string[]` | The fully-qualified names of interfaces implemented by this class |
+| `methods` | `Method[]` | The [methods] declared by this class |
+| `name` | `string` | The simple name of the class |
+| `properties` | `Property[]` | The [properties] declared by this class |
+
+[constructor]: #constructors
+[interfaces]: #interfaces
+[methods]: #methods
+[properties]: #properties
+
+#### Interfaces
+
+`jsii` interfaces are declarations of type signatures that can be implemented by classes. _Interface_ names must be
+prefixed with an `I` (e.g: `IFoo`).
+
+| Attribute | Type | Description |
+| ------------ | ------------- | ------------------------------------------------------------------ |
+| `kind` | `'interface'` | Discriminator to identify interfaces |
+| `assembly` | `string` | The name of the assembly this interface is a part of |
+| `fqn` | `string` | The fully-qualified name of the interface |
+| `interfaces` | `string[]` | The fully-qualified names of interfaces extended by this interface |
+| `methods` | `Method[]` | The [methods] declared by this interface |
+| `name` | `string` | The simple name of the interface |
+| `properties` | `Property[]` | The [properties] declared by this interface |
+
+#### Structs (a.k.a. Data Types)
+
+_Structs_ (or _Data Types_) are immutable, data-only interfaces:
+
+- They declare no methods
+- All [properties] they declare are `readonly`
+- They can only implement other _structs_
+- They cannot be extended by interfaces that are not _structs_
+- They cannot be implemented by _classes_
+
+Unlike regular _interfaces_, `jsii` _struct_ names are not required to have any particular prefix.
+
+Since those are immutable, pure data objects, the `jsii-runtime` exchanges instances of those _by value_, instead of _by
+reference_, allowing to save cross-language communication overhead when working with the data.
+
+| Attribute | Type | Description |
+| ------------ | ------------- | --------------------------------------------------------------- |
+| `kind` | `'interface'` | Discriminator to identify interfaces |
+| `datatype` | `true` | Indicates a _struct_ / _data type_ declaration |
+| `assembly` | `string` | The name of the assembly this struct is a part of |
+| `fqn` | `string` | The fully-qualified name of the struct |
+| `interfaces` | `string[]` | The fully-qualified names of _struct_ extended by this _struct_ |
+| `name` | `string` | The simple name of the struct |
+| `properties` | `Property[]` | The [properties] declared by this struct (all `readonly`) |
+
+#### Enums
+
+| Attribute | Type | Description |
+| ---------- | -------------- | ----------------------------------------------- |
+| `kind` | `'enum'` | Discriminator to identify enums |
+| `assembly` | `string` | The name of the assembly this enum is a part of |
+| `fqn` | `string` | The fully-qualified name of the enum |
+| `members` | `EnumMember[]` | The [enum members] declared by this enum |
+| `name` | `string` | The simple name of the enum |
+
+[enum members]: #enum-members
+
+### Members
+
+#### Constructors
+
+| Attribute | Type | Description |
+| ------------ | ------------- | ---------------------------------------------------------------------------------------- |
+| `overrides` | `string` | The fully-qualified name of the class/interface that declares the overridden constructor |
+| `parameters` | `Parameter[]` | Parameters of this constructor |
+| `protected` | `boolean` | Whether this constructor is protected |
+| `variadic` | `boolean` | Whether the last parameter is `variadic` |
+
+#### Enum Members
+
+| Attribute | Type | Description |
+| --------- | -------- | -------------------------------------------------------- |
+| `name` | `string` | The name of the enum member. Must be `UPPER_SNAKE_CASED` |
+
+#### Methods
+
+| Attribute | Type | Description |
+| ------------ | --------------- | ----------------------------------------------------------------------------------- |
+| `abstract` | `boolean` | Whether this method is `abstract` |
+| `async` | `boolean` | Whether this method is asynchronous |
+| `name` | `string` | The name of the method |
+| `overrides` | `string` | The fully-qualified name of the class/interface that declares the overridden method |
+| `parameters` | `Parameter[]` | Parameters of this method |
+| `protected` | `boolean` | Whether this method is protected |
+| `returns` | `OptionalValue` | The return type of the method |
+| `static` | `boolean` | Whether this method is `static` |
+| `variadic` | `boolean` | Whether the last parameter is `variadic` |
+
+Methods with the `abstract` feature may only be members of `abstract` classes or [interfaces], and all methods that are
+members of [interfaces] must be `abstract`.
+
+Methods that are `static` cannot feature the `overrides` attribute, as `static` members are not inherited.
+
+#### Properties
+
+| Attribute | Type | Description |
+| ----------- | --------------- | ------------------------------------------------------------------------------------- |
+| `abstract` | `boolean` | Whether this property is `abstract` |
+| `const` | `boolean` | Whether this property is a constant (implies `static` and `immutable`) |
+| `immutable` | `boolean` | Whether this property is immutable |
+| `name` | `string` | The name of the property |
+| `optional` | `boolean` | Whether this property is optional |
+| `overrides` | `string` | The fully-qualified name of the class/interface that declares the overridden property |
+| `protected` | `boolean` | Whether this constructor is protected |
+| `static` | `boolean` | Whether this property is `static` |
+| `type` | `TypeReference` | The type of the property |
+
+Properties that are `const` must have a `name` that is `UPPER_SNAKE_CASED`. They represent constants similar to [Enum
+Members], which can be proactively resolved by the `jsii` runtimes.
+
+!!! danger
+ Properties and methods that are `static` **can** feature the `overrides` attribute, as `static` members are
+ inherited with the prototype in **JavaScript** (as part of the ES6 specification). Not all target languages have
+ this capability (most, like **C#** and **Java**, only support *hiding* static declarations), and consequently code
+ generators may ignore this (or explicitly hide parent declarations) instead.
diff --git a/docs/whitepapers/callbacks.md b/gh-pages/content/language-support/callbacks.md
similarity index 86%
rename from docs/whitepapers/callbacks.md
rename to gh-pages/content/language-support/callbacks.md
index 5ca3352aa9..ce641f1dd4 100644
--- a/docs/whitepapers/callbacks.md
+++ b/gh-pages/content/language-support/callbacks.md
@@ -15,10 +15,11 @@ The _jsii kernel_ allows _foreign_ code to register overrides for the following
- Overriding a class' non-static member
- Implementing an abstract member (including interface members)
-> :bulb: It is possible for _foreign_ code to override a class' constructor, but those cannot be registered in the _jsii
-> kernel_ as it cannot trigger instantiation of a _foreign_ class directly. _Foreign_ constructors always delegate to
-> the **JavaScript** constructor, which is happens via the [`create`][kernel.create] operation, during which overrides
-> are registered.
+!!! info
+ It is possible for _foreign_ code to override a class' constructor, but those cannot be registered in the _jsii
+ kernel_ as it cannot trigger instantiation of a _foreign_ class directly. _Foreign_ constructors always delegate to
+ the **JavaScript** constructor, which is happens via the [`create`][kernel.create] operation, during which overrides
+ are registered.
All cases where _foreign_ code should be executed in lieu of **JavaScript** code must be identified and declared
properly, as the _jsii kernel_ otherwise has no way to determine a _foreign_ implementation exists.
@@ -41,20 +42,22 @@ Each override declaration may optionally include a `cookie`: this string will no
any way, and will simply be passed back passed back with any request to invoke the overridden member's foreign
implementation.
-> :bulb: It is possible to register overrides to members that do not formally exist on a type. Since the _jsii kernel_
-> has no type information available for those, it will handle them as follows:
->
-> - Method overrides are assumed to have the following signature:
-> ```ts
-> overridden(...args: any[]): any
-> ```
-> - Property overrides are assumed to be `any`-valued and mutable
->
-> :warning: This should generally be avoided as it can result in incoherent data serialization happening when the _jsii
-> kernel_ receives and returns values.
-
-[kernel.create]: ../specifications/3-kernel-api.md#creating-objects
-[kernel.create.overrides]: ../specifications/3-kernel-api.md#overrides
+!!! info
+ It is possible to register overrides to members that do not formally exist on a type. Since the _jsii kernel_ has no
+ type information available for those, it will handle them as follows:
+
+ - Method overrides are assumed to have the following signature:
+ ```ts
+ overridden(...args: any[]): any
+ ```
+ - Property overrides are assumed to be `any`-valued and mutable
+
+ !!! danger
+ This should generally be avoided as it can result in incoherent data serialization happening when the _jsii
+ kernel_ receives and returns values.
+
+[kernel.create]: ../specification/3-kernel-api.md#creating-objects
+[kernel.create.overrides]: ../specification/3-kernel-api.md#overrides
## Invoking Overrides
@@ -72,7 +75,7 @@ corresponding implementation (for example, using reflection).
When needed, the _original_ **JavaScript** implementation can be delegated to (many languages refer to this as
`super(...)` or some similar idiom).
-[kernel.callback]: ../specifications/3-kernel-api.md#a-note-about-callbacks
+[kernel.callback]: ../specification/3-kernel-api.md#a-note-about-callbacks
### Example
@@ -150,5 +153,5 @@ The schematized exchange between the _jsii runtime library_ and the _jsii kernem
## See Also
-- [The _jsii_ runtime architecture](../runtime-architecture.md)
-- [The _jsii_ kernel API](../specifications/3-kernel-api.md)
+- [The _jsii_ runtime architecture](../home/runtime-architecture.md)
+- [The _jsii_ kernel API](../specification/3-kernel-api.md)
diff --git a/docs/whitepapers/callbacks.monopic b/gh-pages/content/language-support/callbacks.monopic
similarity index 100%
rename from docs/whitepapers/callbacks.monopic
rename to gh-pages/content/language-support/callbacks.monopic
diff --git a/gh-pages/content/language-support/index.md b/gh-pages/content/language-support/index.md
new file mode 100644
index 0000000000..351e4fdfbd
--- /dev/null
+++ b/gh-pages/content/language-support/index.md
@@ -0,0 +1,171 @@
+# Language Implementation
+
+This handbook provides an overview of the process that should be followed when looking to implement support for a new
+programming language in _jsii_. It attempts to provide a step-by-step procedure, while drawing the reader's attention on
+points that have been found to cause problems in the past.
+
+## Foreword
+
+Implementing a new language in _jsii_ is not just a matter of implementing code generation. Mapping the _[jsii type
+system]_ to a new programming language means finding how to represent an API originally designed in TypeScript to a form
+that is as idiomatic as possible in the new language. This is a craft that often requires trial and error, and the best
+(if not only) way to validate a proposal is to put it in front of users and seek feedback. As a consequence, this
+endeavor should be expected to span months, not weeks.
+
+## Scoping & Planning
+
+The first step of most successful projects is to start by scoping work out and establishing a baseline plan to execute
+on. For contributors not yet familiar with _jsii_, the [specification] document is a great place to start. In
+particular, the [New Language Intake] document provides a high-level view of the recommended process for implementing
+new language support.
+
+The work of implementing support for a new language involves many different components:
+
+- The [`jsii`] compiler emits warnings when a language's reserved words are used to name types, methods or properties;
+ as this will later require slugification or escaping in the generated code - usually resulting in a degraded developer
+ experience.
+- The [`jsii-pacmak`] tool includes code generators for all supported languages, and a new implementation must be
+ provided for the new language.
+- Code generation usually requires specific configuration to be provided in order to be able to generate valid packages
+ (for example, the **Java** code generator requires a base java package to generate into, as well as a Maven group and
+ artifact ID for the package). The [`jsii-config`] tool needs to be updated with support generating a configuration
+ block with the required entries for the new code generator.
+- [`jsii-rosetta`] tool translates **TypeScript** example code found in the original documentation into the new target
+ language. A new translation implementation needs to be added for the new language.
+- Building and publishing infrastructure elements are provided by [`aws-delivlib`] to make it easier for _jsii_ users to
+ publish their libraries to all supported package registries.
+
+### Language Proposition RFC
+
+The recommended way to formalize the initial plan is to write it into an RFC hosted in the [CDK RFC repository]. Enough
+time has to be spent considering the requirements in order to get the work scoped and planned well, ensuring smooth
+execution.
+
+An additional benefit of following the RFC process is that it makes it easier to track learnings accumulated through the
+implementation process, as those will be tracked as comments or iterations on the RFC document.
+
+It is possible (and sometimes desirable) to start prototyping code-generation for the new language, as this can
+highlight implementation challenges that need to be discussed in the RFC document. In any case, examples of the API
+signatures that are expected to be rendered allow early feedback to be provided by possible future users, and still
+helps identify challenges.
+
+The following questions should be answered as early as possible in the process, to avoid surprises later on that result
+in significant re-engineering effort:
+
+- What do the generated APIs look like, for the typical API idioms?
+ - _Classes_ (constructors, properties, methods, inheritance strategy, abstract members, ...)
+ - The [AWS CDK] (one of the main consumers of _jsii_) uses specific patterns to offer a better experience in many
+ programming languages. For example, constructor signatures where the last argument is a _jsii struct_ allows for
+ keyword argument lifting in **Python**, and convenient `Builder` APIs in **Java**.
+ - _Enums_
+ - _Interfaces_ and _Structs_ (properties, methods, inheritance strategy, implementation, ...). In particular, how are
+ new optional properties handled (those are not considered breaking change within the [jsii type system]).
+ - _Structs_ (properties, inheritance strategy, implementation, ...)
+- What information is needed in order for the code-generator to produce artifacts? What should the configuration block
+ look like?
+- What is the standard way to publish packages for the new language?
+ - Are there any requirements (code signature, special metadata, ...) that need to be implemented in order to publish
+ valid packages?
+ - How are dependencies modeled? If [semantic versioning] is not the norm, what is the strategy to correctly represent
+ semantic version ranges?
+- What are the toolchain and platform requirements?
+ - For example, **Java** requires an OpenJDK 8 distribution and `maven`, **Python** requires `python` 3.6 or above,
+ etc...
+
+## Code Generation
+
+First, implement a first version of the code generation for the new language before getting too far into the
+_[host library](#host-library)_ implementation. This top-down approach ensures the requirements for the lower level
+parts of the implementation are well-defined before they are implemented (reducing the chances that significant re-work
+has to be done), and enables using the [Standard Compliance Suite] to ensure the overall implementation is _correct_
+according to the [specification] (since the code necessary to implement the test cases will be available right from the
+start).
+
+This work happens within the [`jsii-pacmak`] package.
+
+Focus initially on the API signatures before getting into their implementation. The first version may even throw a _not
+implemented_ exception when called.
+
+The [`jsii-calc`] package, can be used as a sample consuming library which uses _jsii_ to generate code in all target
+languages. Start by making sure a decent API is generated from this package and its dependencies, and use those to
+implement the tests from the [Standard Compliance Suite]. You'll also get a feeling for whether the generated code
+achieves a good developer experience or not.
+
+## Host Library
+
+Now that we are generating "empty shell" APIs that represent the necessary entities to back the [Standard Compliance
+Suite] tests, start implementing the _host library_ and update the code generator until all the tests pass. It is
+possible to publish artifacts even when tests in the suite are failing. As soon as basic features are working, work on
+[Building and Packaging](#building-and-packaging) can start, so early feedback can be gathered.
+
+!!! bug "Unimplemented"
+ A standard architecture for the _host library_ has not been documented yet. Upcoming language implementations should
+ contribute to this process by documenting a general architecture that should be implementable in any programming
+ languages (and thus, abstracting away language specificities).
+
+## Building & Packaging
+
+The necessary toolchains should be added to he [`jsii/superchain`] Docker image, so that the [`jsii-pacmak`] generation
+can be changed to support building ready to publish artifacts instead of just code.
+
+Before publishing any artifacts, ensure all packages (the _host library_ as well as generated artifacts) are designated
+as _experimental_ (e.g: **Python** packages were annotated with the `Development Status :: 4 - Beta` trove classifier on
+PyPI, and **NuGet** packages were published with a pre-release version such as `1.2.3-pre`).
+
+Additionally, [`aws-delivlib`] needs to be augmented to support publishing artifacts to the language's package
+repository.
+
+!!! bug "Unimplemented"
+ The package publishing is being extracted from [`aws-delivlib`] into a standalone library, currently hosted at
+ [`eladb/jsii-release`](https://github.com/eladb/jsii-release).
+
+## Documentation
+
+Before releasing the new language support to _Developer Preview_, basic documentation needs to be produced to explain
+how to configure a _jsii_ project to support the new language, and any peculiarities in working with libraries generated
+by [`jsii-pacmak`] for this language.
+
+Support for example code translation should also be built into [`jsii-rosetta`].
+
+## Developer Preview
+
+Once the full [Standard Compliance Suite] passes (possibly with the exception of certain fringy features), and the
+documentation covering all aspects of using the language bindings have been produced, the new language can be released
+to _Developer Preview_.
+
+It is recommended that new languages stay in _Developer Preview_ for a minimum of 4 weeks, ideally until they have
+received sufficient usage to have built confidence that there are no major usability concerns: once out of _Developer
+Preview_, it will no longer be possible to introduce breaking changes to the generated code in order to address
+usability issues or bugs.
+
+In order to improve the chances of catching usability issues, focused user experience studies will be conducted with an
+audience composed of developers with varied degrees of experience with the new language.
+
+!!! bug "Unimplemented"
+ A user experience template will be provided to ensure coverage of critical aspects of the experience. Any critical
+ user experience issue (for example, issues that required breaking changes to the generated code) discovered but not
+ covered in the template should be added to the template so that subsequent language implementations do not fall to
+ the same problem.
+
+## General Availability
+
+Once the new language has been in _Developer Preview_ without any significant usability issues or bugs for a sufficient
+amount of time and is used in real-world use-cases such as for [AWS CDK] applications, it becomes a candidate to be
+declared _Generally Available_. At this point, breaking changes are no longer possible on the generated code.
+
+
+
+[jsii type system]: ../specification/2-type-system.md
+[specification]: ../specification/1-introduction.md
+[new language intake]: ../specification/5-new-language-intake.md
+[cdk rfc repository]: https://github.com/awslabs/aws-cdk-rfcs#readme
+[`jsii`]: ../../packages/jsii
+[`jsii-calc`]: ../../packages/jsii-calc
+[`jsii-config`]: ../../packages/jsii-config
+[`jsii-pacmak`]: ../../packages/jsii-pacmak
+[`jsii-rosetta`]: ../../packages/jsii-rosetta
+[standard compliance suite]: ../specification/4-standard-compliance-suite.md
+[`jsii/superchain`]: ../../superchain
+[`aws-delivlib`]: https://github.com/awslabs/aws-delivlib
+[aws cdk]: https://github.com/aws/aws-cdk
+[semantic versioning]: https://semver.org
diff --git a/gh-pages/content/specification/1-introduction.md b/gh-pages/content/specification/1-introduction.md
new file mode 100644
index 0000000000..de307e5ec9
--- /dev/null
+++ b/gh-pages/content/specification/1-introduction.md
@@ -0,0 +1,173 @@
+# Introduction
+
+This document provides a high level overview of _jsii_, starting with its design tenets. It introduces the concepts and
+components that compose _jsii_.
+
+## Updating the Specification
+
+### Introduction
+
+The _jsii_ specification follows the guiding principles of an RFC. It is a living document that describes the current
+understanding of how the various [components](#components) of _jsii_ are operating, as well as the approaches used to
+ensure consistent behavior across the various supported languages.
+
+The document is hosted with the _jsii_ codebase, making it easy to determine what specification was in place at the time
+of a give _jsii_ release (by ways of referring to the `vX.Y.Z` git tag). A single version of the specification is
+considered **active** at any given time: the version of the specification that is represented on the `HEAD` commit of
+the `main` branch of the [`aws/jsii`][aws/jsii] repository. The **active** specification must be the base version for
+any update proposal.
+
+[aws/jsii]: https://github.com/aws/jsii
+
+The process to update the specification is intended to be as lightweight as possible, while ensuring sufficient
+conversation takes place before implementing significant (and breaking) changes. Since the process to update the
+specification is part of the specification itself, it is amenable to be changed following the process described in the
+currently **active** specification.
+
+### Process
+
+While the general process for updating the specification is to create a GitHub pull request against the
+[`aws/jsii`][aws/jsii] repository, the exact requirements for what should be included in the pull request vary depending
+on the type of update that is proposed:
+
+- [:warning: Changing Behavior](#new-behavior) describes the process to be followed when introducing changes to the
+ behavior of any component of _jsii_: new features, breaking changes to existing features, ...
+- [:mag: Addressing Gaps](#addressing-gaps) is the process used for adding specification around existing but unspecified
+ behavior.
+- [:thumbsup: Trivial Changes](#trivial) explains how to propose changes that improve the specification without changing
+ its meaning.
+
+#### :warning: Changing Behavior
+
+If the change is **not backwards compatible** (it is a breaking change to an existing feature, or it is a new feature
+that requires all runtime libraries implement support immediately), a new RFC should be created in the
+[`awslabs/aws-cdk-rfcs`][awslabs/aws-cdk-rfcs] repository, following the [RFC Process]. This ensures enough time is
+spent considering alternatives to breaking changes, and to create consensus that the change is desirable before time is
+spent implementing it.
+
+[awslabs/aws-cdk-rfcs]: https://github.com/awslabs/aws-cdk-rfcs
+[rfc process]: https://github.com/aws/aws-cdk-rfcs#what-the-process-is
+
+!!! note
+ While going through the RFC process upfront is **strongly recommended**, contributors may choose not to file an RFC
+ for a behavior change. In this case however, any core maintainer may decide that an RFC is required and block the
+ contribution until the RFC process has been followed.
+
+ It is worth noting that a draft pull request with proposed modifications to the specification (and possibly a
+ proof-of-concept implementation), can be extremely useful.
+
+When the RFC is **ready**, a GitHub pull request is created that must contain:
+
+- Relevant additions or modifications to the specification documents
+- Relevant additions or modifications to the compliance suite
+- Implementation of the new behavior, including new or updated tests in all the language bindings
+
+The pull request's body must reference the RFC if there has been one, and otherwise must include all discussion
+necessary to explain the reasoning behind the proposal (including alternatives considered, risks, ...).
+
+#### :mag: Addressing Gaps
+
+Proposals that increase the specification's coverage (desribing behavior that already exists) are handled as GitHub pull
+requests that must contain the following elements:
+
+- Relevant additions to the specification documents
+- New compliance test(s) that enshrine the described behavior
+- Implementation of the new compliance test(s) for all _Generally Available_ language bindings
+
+The pull request body should provide pointers to any and all elements that can be used to verify that the behavior that
+is described is indeed what is currently implemented.
+
+#### :thumbsup: Trivial Changes
+
+Proposal of trivial changes, such as correcting typos in the document, or re-phrasing elements of the specification
+without altering the meaning (typically to improve clarity) are handled in a simple GitHub pull request.
+
+## Design Tenets (unless you know better ones)
+
+- _jsii_ APIs strive to feel idiomatic in all supported languages.
+- _jsii_ applications behave identically regardless of the language they are written in. It favors correctness over
+ performance.
+- _jsii_ **does not** attempt to support all TypeScript idioms (many features of TypeScript cannot be expressed in some
+ target languages).
+ - Unsupported idioms will cause a compile-time error to be emitted.
+ - When prohibiting an idiom, _jsii_ strives to provide an error message that gives the user insight into why the
+ pattern cannot be supported.
+- _jsii_ does not force API design opinions on the developer:
+ - Reserved names are limited to a minimum.
+ - TypeScript API design patterns that are known to result in poor developer experience when represented in other
+ languages will cause warnings to be issued, but the developer is ultimately entitled to decide whether they want to
+ take or leave the advice.
+- _jsii_ produces artifacts compatible with idiomatic tools whenever possible:
+ - Generated libraries can be easily published to the "standard" package repository for the language.
+ - Standard tools can be used to work with the generated libraries, and do not require any special configuration.
+
+## Annotations
+
+Annotations are present in the _jsii_ specification to provide additional information to the reader that is
+non-normative. Those take the form of block-quotes that use the following chart:
+
+!!! bug "Unimplemented"
+ Is used to annotate parts of the specification that are known to be partially or incorrectly implemented in the
+ current releases. Those are known issues in the current implementation that will be addressed in the future.
+
+!!! question
+ Is used to annotate open questions. They are typically in parts of the specification that is likely to change in
+ future releases, and that may be good candidates for introducing RFCs.
+
+!!! danger
+ Is used to draw the reader's attention on specific points. They are used primarily to help the reader identify areas
+ of the specification that, when incorrectly implemented, may result in hard-to-troubleshoot bugs; or to identify
+ behavior that is intentionally undefined.
+
+!!! info
+ Is used to provide additional context which may not be obvious to the reader. They typically contain trivia that can
+ help the reader understand the motivation for certain behaviors that are not always intuitive.
+
+## Concepts
+
+_jsii_ allows developers to author code once in **TypeScript**, while allowing use in a variety of other programming
+languages (including **C#**, **Java** and **Python**).
+
+### Assemblies
+
+The _jsii Assembly_ document contains a specific representation of the API exported by the **TypeScript** module.
+Similar to a header file in the **C++** world, it contains only information about the signatures of APIs (type names
+with method and property signatures, associated documentation elements, ...) and no implementation.
+
+The _npm_ package produced as a result of compiling the **TypeScript** source remains the source of truth with respects
+to implementation of the API.
+
+### Host & Kernel
+
+The [_jsii_ runtime architecture][runtime-architecture] defines two processes:
+
+1. The _host_ process runs the users' code native environment (a Java virtual machine, the .NET Runtime, ...).
+2. The _kernel_ process hosts the **JavaScript** code from the standard _npm_ package defined by the user (and their
+ dependencies), which is loaded and managed by a standardized `@jsii/kernel` package.
+
+The _host_ process is responsible for starting the _kernel_ process as needed. A designated _host runtime library_
+provides helper functions that will perform the necessary initialization when needed, so the _host_ app does not need to
+include any special boilerplate code.
+
+The two processes exchange messages over a designated communication channel (for example, using pipes), using a _kernel
+API_ that is standardized in the _jsii specification_.
+
+[runtime-architecture]: ../home/runtime-architecture.md
+
+## Components
+
+Several tools are involved in making this possible:
+
+- [`jsii`][jsii] is a modified **TypeScript** compiler. In addition to generating **JavaScript** code from the source, it
+ produces a _jsii Assembly_ document.
+- [`jsii-pacmak`][jsii-pacmak] generates language bindings from a package compiled using `jsii`. It generates code in _host_
+ languages that expose the API declared in the _jsii Assembly_ document.
+- _Host runtime libraries_ centralize features used by code generated by [`jsii-pacmak`][jsii-pacmak], such as primitives to interact
+ with the _kernel_ process, so that this code does not need to be duplicated in every generated module.
+- [`@jsii/kernel`][@jsii/kernel] (and [`@jsii/runtime`][@jsii/runtime]) provide the functionality exposed by the _kernel_ process, and allow the
+ _host_ code to seamlessly interact with the **JavaScript** implementation.
+
+[jsii]: https://github.com/aws/jsii/tree/main/packages/jsii
+[jsii-pacmak]: https://github.com/aws/jsii/tree/main/packages/jsii-pacmak
+[@jsii/kernel]: https://github.com/aws/jsii/tree/main/packages/@jsii/kernel
+[@jsii/runtime]: https://github.com/aws/jsii/tree/main/packages/@jsii/runtime
diff --git a/gh-pages/content/specification/2-type-system.md b/gh-pages/content/specification/2-type-system.md
new file mode 100644
index 0000000000..2fbfaf91b6
--- /dev/null
+++ b/gh-pages/content/specification/2-type-system.md
@@ -0,0 +1,394 @@
+# The _jsii_ type system
+
+## Preamble
+
+The base language for authoring _jsii_ libraries for re-use from other languages is **TypeScript**, which compiles to
+**JavaScript**. Consequently, the base type system that _jsii_ sources from is that of **TypeScript**.
+
+When used from another language than **TypeScript** or **JavaScript**, _jsii_ libraries are running the **JavaScript**
+code in a child _node_ process, and data is exchanged using **JSON**-based protocol.
+
+This document describes how **TypeScript** types map into the _jsii_ type system.
+
+The API represented by the _jsii_ assembly only covers declarations that are exported from the main file in the
+**TypeScript** project (as specified in the `package.json` file by the `types` attribute). Restrictions described in
+this document only apply to such declarations, the rest of the module can leverage any **TypeScript** feature.
+
+## Basic Types
+
+### Introduction
+
+In order to build useful programs, the simplest units of data need to be modeled: booleans, numbers, strings, etc...
+Those basic building blocks are the foundations on which APIs stand. _jsii_ supports much of the same types that
+**TypeScript** and **JavaScript** support, although with notable differences.
+
+### Boolean
+
+The _jsii_ type system mirrors **TypeScript**'s `boolean`, which is the simplest primitive data types, with only two
+supported values: `true` and `false`.
+
+### Number
+
+The _jsii_ type system mirrors **TypeScript**'s `number`. All numbers are floating point values.
+
+### String
+
+The _jsii_ type system mirrors **TypeScript**'s `string`. Strings are used to represent textual data.
+
+### List
+
+**TypeScript** arrays (`Array`, `T[]`, `ReadonlyArray` and `readonly T[]`) are represented as _lists_ in the
+_jsii_ type model. Lists are shared between the _node_ process and the host process by-value, meaning a copy of the
+array is produced each time it is passed through the process boundary.
+
+!!! info
+ Items in the list may be passed by-reference (according to their type's specification), in which case mutating
+ operations performed on those may be visible across the process boundary.
+
+### Enum
+
+As in many languages, `enum` can be used to represent a group of related constants. While **TypeScript** `enum` entries
+are associated with a value that is either a `string` or a `number`, the _jsii_ type system does not allow for those to
+be down-casted to their value type (e.g: a `string`-valued `enum` entry cannot be directly passed into a `string`
+parameter).
+
+!!! info
+ Unlike in certain languages such as **Java**, `enum` types cannot declare new properties or methods.
+
+### Any and Unknown
+
+**TypeScript** defines two opaque types: `any` and `unknown` that can be used to represent a value of arbitary type. The
+difference between them is that while `any` is assignable to any other type, `unknown` requires a type assertion or
+explicit cast to be performed before it can be assigned.
+
+Both of these types map to an `Any` _primitive type_ in the _jsii_ type system, and the subtle distinction between `any`
+and `unknown` is lost in the process.
+
+!!! info
+ It is important to note that, contrary to the other types in the **TypeScript** type system, `any` and `unknown`
+ types are inherently `null`-able.
+
+### Void
+
+As in most languages, the `void` type is used to denote a method does not return anything.
+
+### Null and Undefined
+
+**JavaScript** differentiates `undefined` and `null` values. While `undefined` denotes that _no value_ has been set,
+`null` denotes an intentional signal of there being _no data_. Most other programming languages (particularly statically
+typed languages) however lack this distinction, and the _jsii_ type model consequently considers `null` and `undefined`
+are semantically equivalent.
+
+!!! info
+ Unlike certain other programming languages, such as **Java**, **TypeScript** does not allow `null` (or `undefined`)
+ values unless the type signature expressedly supports that (with the exception of `any` and `unknown`, which are
+ implicitly `null`-able, as was discussed earlier).
+
+### Object
+
+**TypeScript**'s `object` type denotes anything that is not a _primitive_ type, meaning anything other than a `number`,
+`string`, `boolean`, `bigint`, `symbol`, `null` or `undefined`.
+
+In the _jsii_ type model, `object` indicates a block of structured data that can be shared by-value across the process
+boundary. As a consequence, they may not include any method.
+
+!!! bug "Unimplemented"
+ This type is called `Json` in the current implementation.
+
+!!! question
+ The by-value nature of `object` is problematic because **TypeScript** makes no guarantee with respects to the
+ absence of methods on `object`, and properties may be dynamic.
+
+### Promises
+
+_jsii_ supports asynchronous methods, and the **TypeScript** `Promise` type has to be used as the result of `async`
+methods. Promises can only be used as the result type of methods, not as the type of a property or parameter.
+
+### Unsupported **TypeScript** basic types
+
+Due to how such types cannot be represented in many other programming languages, the _jsii_ type model does not support
+the following **TypeScript** entities:
+
+- Tuples, a group of arbitrarily-typed values, often used as the result type for multi-valued functions.
+- The `never` type, which is used as the return type of functions that will not yield control back to their invoker
+ (infinite loops, `process.exit()`, ...).
+- `bigint` and `symbol` don't have equivalents in many other programming languages and are generally of limited value in
+ API design.
+
+## Complex Types
+
+The goal of the _jsii_ is to enable cross-language re-use of class libraries. **TypeScript** enables representing
+classic object-oriented concepts, such as _classes_ and _interfaces_. The _jsii_ type system supports some additional
+nuances on top of those, to better represent **TypeScript** and **JavaScript** idioms in a way that enables generating
+convenient APIs in other languages.
+
+### Classes
+
+Exported **TypeScript** classes are represented in the _jsii_ type system, with the following restrictions from plain
+**TypeScript**:
+
+- Methods overloads are not supported.
+- Overridden methods or properties must retain the exact same type signature as the one declared in a parent type. The
+ **jsii** type system strictly enforces the [Liskov substitution principle].
+
+[liskov substitution principle]: https://en.wikipedia.org/wiki/Liskov_substitution_principle
+
+### Interfaces & Structs
+
+Exported **TypeScript** interfaces are interpreted as one of two entities in the _jsii_ type system:
+
+- If the `interface` name is prefixed with an `I` (e.g: `ISomething`), it is interpreted as a _behavioral interface_.
+- Otherwise (e.g: `Something`), it is interpreted as a _struct_.
+
+#### Behavioral Interfaces
+
+_Behavioral interfaces_ are the usual object-oriented interface: they can extend other _behavioral interfaces_, and can
+be extended by _classes_. They may however not extend _structs_.
+
+#### Structs
+
+_Structs_ are used to model the **JavaScript** idiom of receiving options as an object literal passed as the last
+parameter of a function. They are a formal description of a bag of properties, and are not meant to be implemented by
+other types. Since those types are used as inputs, they can be handled as pure-data, immutable objects, and the
+following restrictions apply:
+
+- A _struct_ cannot declare any _method_: they must be kept behavior-free.
+- All properties declared by a _struct_ must be `readonly`. The values of the properties may however be mutable.
+
+_Structs_ may extend one or more other _structs_, but cannot extend or be extended by _behavioral interfaces_, and may
+not be implemented by _classes_.
+
+### Type Unions
+
+In certain cases, several different kinds of values are acceptable for a given parameter or return type. **TypeScript**
+models those cases using _type unions_, which are represented as `TypeA | TypeB`. The _jsii_ type model supports those,
+however most other statically typed languages do not have such a concept, making those parameters or return values
+difficult to use from those languages, as the value has to be declared using the most generic reference type available
+(for example, in **Java**, those are returned as `java.lang.Object`).
+
+When used as inputs (parameters, or properties of a _struct_), it may be possible to generate method overloads that will
+allow for a convenient API in languages that support overloads.
+
+In general however, _type unions_ are discouraged and should only be used when there is no alternative way to model the
+API.
+
+## Serialization Behavior
+
+When values are passed between the _host_ process and the `node` process, they are serialized as JSON documents. They
+can be passed by value or by reference, depending on the type of the value as well as the declared type of the transfer
+point (method return type, property type, argument type, ...).
+
+The table below describes the serialization behavior applied for each possible _declared_ type (rows) for a value of a
+given dynamic type (columns). The :x: sign expresses cases that are illegal and should cause immediate failure. The term
+_primitive_ encompasses `boolean`, `string`, and `number`.
+
+| | `undefined` | `Date` | _primitive_ | `Array` | _instance_ | `object` |
+| ----------- | ----------- | ----------- | ----------- | ----------- | ----------- | ---------------------- |
+| `void` | `undefined` | `undefined` | `undefined` | `undefined` | `undefined` | `undefined` |
+| `Date` | `undefined` | [Date] | :x: | :x: | :x: | :x: |
+| _primitive_ | `undefined` | :x: | [Identity] | :x: | :x: | :x: |
+| `enum` | `undefined` | :x: | [Enum] | :x: | :x: | :x: |
+| `List` | `undefined` | :x: | :x: | [Array] | :x: | :x: |
+| `Map` | `undefined` | :x: | :x: | :x: | :x: | [Mapping] |
+| `interface` | `undefined` | :x: | :x: | :x: | [Reference] | [Reference] |
+| `struct` | `undefined` | :x: | :x: | :x: | :x: | [Value] |
+| `class` | `undefined` | :x: | :x: | :x: | [Reference] | [Reference] |
+| `any` | `undefined` | [Date] | [Identity] | [Array] | [Reference] | [Value] or [Reference] |
+
+In the case of `object` being passed though `any`, the value may be serialized by [Value] only if the value being passed
+does not have any method or dynamic accessor. Otherwise, it must be passed by [Reference] instead.
+
+!!! danger
+ The serialization behavior around `undefined` values is affected by the `optional` attribute of the declared type.
+ As discussed earlier, the `any` type is implicitly `optional`; but all other types' serialization process will only
+ allow serialization of `undefined` if they were declared `optional`.
+
+### Array Serialization
+
+[array]: #array-serialization
+
+Arrays are serialized into the standard JSON representation for them. Each value in the array is serialized according to
+the behavior dictated by the declared element type of the list, combined with the dynamic type of the value itself.
+
+### Date Serialization
+
+[date]: #date-serialization
+
+JSON has no standard expression for `Date`. A special JSON object representation is used to allow unambiguously
+conveying a date. The wrapper has a single key (`$jsii.date`) with the [ISO 8601-1] UTC representation of the `Date`
+value:
+
+```json
+{ "$jsii.date": "2020-01-20T14:04:00.000Z" }
+```
+
+[iso 8601-1]: https://www.iso.org/obp/ui#iso:std:iso:8601:-1:ed-1:v1:en
+
+### Enum Serialization
+
+[enum]: #enum-serialization
+
+In **JavaScript**, `enum` entries are represented by their value equivalent. In order to support statically typed
+representations in other languages, these are serialized using a dedicated wrapper object, using a single key
+(`$jsii.enum`) with the fully qualified name of the `enum` entry:
+
+```json
+{ "$jsii.enum": "@scope/module.EnumType.ENTRY_NAME" }
+```
+
+### Identity Serialization
+
+[identity]: #identity-serialization
+
+The identity serialization is achieved by using the standard JSON representation of the primitive type. JSON strings are
+expressed using the `UTF-8` character set.
+
+### Mapping Serialization
+
+[mapping]: #mapping-serialization
+
+Key-value pairs are passed by-value between the processes and is wrapped using a single-key (`$jsii.map`) associated
+with the JSON representation of the encoded object; where values are serialized according to the behavior dictated by
+the element type of the mapping, combined with the dynamic type of the value itself:
+
+```json
+{
+ "$jsii.map": {
+ "foo": {
+ "date": { "$jsii.date": "2020-01-20T14:04:00.000Z" },
+ "map": { "$jsii.map": {} }
+ }
+ }
+}
+```
+
+### Reference Serialization
+
+[reference]: #reference-serialization
+
+Objects serialized by reference are passed using a special object that provides sufficient information to tie back to
+the instance within its owning process. It includes a `$jsii.byref` key associated with a string that uniquely
+identifies the instance, and an optional `$jsii.interfaces` key that provides a list of interfaces that the object
+implements.
+
+```json
+{
+ "$jsii.byref": "@scope/module.Foo@1337",
+ "$jsii.interfaces": ["@scope/module.IBar", "@scope/module.IBaz"]
+}
+```
+
+### Value Serialization
+
+[value]: #value-serialization
+
+_Structs_ can be serialized by-value. In those cases, the value is wrapped using a special object that encapsulates the
+type information for the provided data as well as the _struct_'s members.
+
+The wrapper uses a single `$jsii.struct` key with a `fqn` key that indicates the fully qualified name of the _struct_
+type, and a `data` key that contains the members of the _struct_, serialized according to the behavior described in this
+document.
+
+```json
+{
+ "$jsii.struct": {
+ "fqn": "@scope/module.StructType",
+ "data": {
+ "enumValue": { "$jsii.enum": "@scope/module.EnumType.ENTRY_NAME" },
+ "stringProperty": "Hello, I'm a string!"
+ }
+ }
+}
+```
+
+## Submodules
+
+### Overview
+
+Typescript allows grouping declarations together in _namespaces_, which are interpreted by _jsii_ as _submodules_.
+_Submodules_ names are the fully qualified name of the namespace from the package's root (if a package `foo` defines a
+namespace `ns1`, which itself contains `ns2`, the submodule for `ns2` will be named `foo.ns1.ns2`).
+
+_Submodules_ are delcared in the _jsii_ assembly under the `submodules` key. This is also where specific
+[configuration](#submodule-configuration) is registered, if different from the parent submodule or package.
+
+_Submodules_ are hierarchical, and their fully qualified name is representative of the relationship. For example the
+`assm.foo.bar` submodule is considered to be nested under the `assm.foo` submodule.
+
+### Restrictions
+
+_Submodules_ cannot be involved in dependency cycles. While it is possible to build such cycles in **JavaScript**, that
+configuration cannot be reliably reprensented in certain other programming languages (e.g: **Python**).
+
+!!! bug "Unimplemented"
+ [`jsii`][jsii] does not currently check for circular submodule dependencies. Invalid dependency patterns may result
+ in errors at code generation by [`jsii-pacmak`][jsii-pacmak], or at runtime.
+
+Since this would result in ambiguity that cannot be consistently resolved, a given type can only be exported as part of
+one _submodule_.
+
+[jsii]: https://github.com/aws/jsii/tree/main/packages/jsii
+[jsii-pacmak]: https://github.com/aws/jsii/tree/main/packages/jsii-pacmak
+
+### Declaration
+
+There are two supported ways to introduce _submodules_:
+
+- Using the namespaced export syntax:
+ ```ts
+ export * as ns from './module';
+ ```
+- Using an explicit namespace declaration:
+ ```ts
+ export namespace ns {
+ /* ... */
+ }
+ ```
+
+_Submodules_ declared using the `export * as ns from './module';` syntax can be documented using a markdown document
+located at `./module/README.md`.
+
+!!! bug "Unimplemented"
+ The `./module/README.md` file support is not yet implemented.
+
+### Submodule Configuration
+
+In languages where this is relevant (e.g: **Python**), _submodules_ are rendered as native _submodules_. In languages
+where a namespace system exists (**Java** uses _packages_, **C#** uses _namespaces_, ...), _submodules_ are rendered
+using that.
+
+By default, _submodule_ names are rendered appropriately in the target language (this typically involves adjusting the
+case of _submodule_ name fragments to the idiomatic form in the language). In certain cases however, a developer can
+choose to use a different configuration by defining the _submodule_ using the namespaced-export syntax
+(`export * as namespace from './module-name';`) ny placing a `.jsiirc.json` file next to the entry point of the
+namespaced module. For example, if `./module-name`'s entry point is `foo/bar/module-name/index.ts`, the _submodule_
+configuration resides in `foo/bar/module-name/.jsiirc.json`.
+
+Since _submodules_ are hierarchical, the configuration of a given _submodule_ defines the default configuration of
+_submodules_ nested under it.
+
+## Code Generation
+
+In order to generate code in various programming languages, [`jsii-pacmak`] needs configuration that provides naming
+directives (e.g: **Java** package names, **C#** namespaces, **Python** module names, ...). This configuration is
+language-specific and each language implementation specifies and documents its own configuration schema.
+
+Configuration is sourced in the `package.json` file at the root of the npm package, under the special `jsii` key. The
+general schema is described in the [configuration] document.
+
+!!! bug "Unimplemented"
+ There is a proposition to allow this configuration to be placed in a `.jsiirc.json` file, which would take
+ precedence over what is specified in `package.json`. _Submodules_ introduced using the
+ `export * as ns from './module';` syntax would then be able to define _submodule_-local configuration using the
+ `./module/.jsiirc.json` file.
+
+[configuration]: ../dev-guide/configuration/index.md
+
+## References
+
+The [**TypeScript** Handbook][ts-handbook] describes the language's type system and syntax elements that serve as the
+basis for the _jsii_ type system. Additionally, the **JavaScript** type system is described in the
+[**JavaScript** Fundamentals][js-fundamentals] document.
+
+[js-fundamentals]: https://javascript.info/types
+[ts-handbook]: https://www.typescriptlang.org/docs/handbook/basic-types.html
diff --git a/docs/specifications/3-kernel-api.md b/gh-pages/content/specification/3-kernel-api.md
similarity index 53%
rename from docs/specifications/3-kernel-api.md
rename to gh-pages/content/specification/3-kernel-api.md
index e69bab7daf..624018dab1 100644
--- a/docs/specifications/3-kernel-api.md
+++ b/gh-pages/content/specification/3-kernel-api.md
@@ -1,18 +1,18 @@
-# The *jsii* kernel API
-This document describes the API for the `@jsii/kernel` module, which is to be
-used by all *host* libraries. It provides the fundamental features necessary for
-*host* processes to interact with the original module's code.
+# The _jsii_ kernel API
-> :construction: Currently, `@jsii/kernel` contains the bulk of the logic,
-> however a separate `@jsii/runtime` package owns the dialogue between the
-> *host* and *kernel* processes. The `@jsii/runtime` is a very thin glue layer
-> and it will eventually be merged into `@jsii/kernel`.
+This document describes the API for the `@jsii/kernel` module, which is to be used by all _host_ libraries. It provides
+the fundamental features necessary for _host_ processes to interact with the original module's code.
+
+!!! note
+ Currently, `@jsii/kernel` contains the bulk of the logic, however a separate `@jsii/runtime` package owns the
+ dialogue between the _host_ and _kernel_ processes. The `@jsii/runtime` is a very thin glue layer and it will
+ eventually be merged into `@jsii/kernel`.
## Errors
-Most of the calls described in this document may result in an error being
-raised. It is the responsibility of the *host* runtime library to deal with such
-errors correctly: action retries, propagate the error to the *host* app's code,
-and so on.
+
+Most of the calls described in this document may result in an error being raised. It is the responsibility of the _host_
+runtime library to deal with such errors correctly: action retries, propagate the error to the _host_ app's code, and so
+on.
Error responses are signaled by the `error` key:
@@ -25,64 +25,65 @@ export interface ErrorResponse {
}
```
-Where possible, the *host* runtime libraries should make sure to affix their own
-stack trace information where relevant to the *kernel* process's stack trace
-when such errors are propagated to *host* app's code, in order to offer as much
+Where possible, the _host_ runtime libraries should make sure to affix their own stack trace information where relevant
+to the _kernel_ process's stack trace when such errors are propagated to _host_ app's code, in order to offer as much
relevant context information as possible.
## Initialization - the `hello` message
-The *host* library is responsible for spawning the `node` process that will run
-the original module's code. This `node` process runs the `@jsii/kernel`
-application, and API messages are exchanged via the `node` processes' standard
-input and output pipes.
-Upon initialization, the `@jsii/kernel` process introduces itself to the *host*
-application by emitting a single JSON message:
+The _host_ library is responsible for spawning the `node` process that will run the original module's code. This `node`
+process runs the `@jsii/kernel` application, and API messages are exchanged via the `node` processes' standard input and
+output pipes.
+
+Upon initialization, the `@jsii/kernel` process introduces itself to the _host_ application by emitting a single JSON
+message:
-```js
+```json
{
- // The package name@version of the @jsii/kernel in use
- "hello": "@jsii/runtime@0.21.1",
+ "hello": "@jsii/runtime@0.21.1"
}
```
-Any additional key present on the `hello` message will be silently ignored by a
-*host* library that does not know how to process it, ensuring forward
-compatibility of this message, if and when new attributes are added.
+Any additional key present on the `hello` message will be silently ignored by a _host_ library that does not know how to
+process it, ensuring forward compatibility of this message, if and when new attributes are added.
-> :construction: In the future, this message may be augmented with additional
-> keys to enable feature negotiation between the *host* application and the
-> `@jsii/kernel`.
+!!! note
+ In the future, this message may be augmented with additional keys to enable feature negotiation between the _host_
+ application and the `@jsii/kernel`.
## General Kernel API
-Once the `hello` handshake is complete, a sequence of request and responses are
-exchanged with the `@jsii/kernel`. Requests take the form of JSON-encoded
-messages that all follow the following pattern:
+
+Once the `hello` handshake is complete, a sequence of request and responses are exchanged with the `@jsii/kernel`.
+Requests take the form of JSON-encoded messages that all follow the following pattern:
```ts
interface Request {
/**
* This field discriminates the various request types.
*/
- api: 'load' // Loading jsii assemblies into the Kernel
- | 'naming' // Obtaining naming information for loaded assemblies
- | 'stats' // Obtaining statistics about the Kernel usage
- | 'create' // Creating objects
- | 'del' // Destroying objects
- | 'invoke' | 'sinvoke' // Invoking methods (and static methods)
- | 'get' | 'sget' // Invoking getters (and static getters)
- | 'set' | 'sset' // Invoking setters (and static setters)
- | 'begin' | 'end' // Asynchronous method invocation
- ;
+ api:
+ | 'load' // Loading jsii assemblies into the Kernel
+ | 'naming' // Obtaining naming information for loaded assemblies
+ | 'stats' // Obtaining statistics about the Kernel usage
+ | 'create' // Creating objects
+ | 'del' // Destroying objects
+ | 'invoke'
+ | 'sinvoke' // Invoking methods (and static methods)
+ | 'get'
+ | 'sget' // Invoking getters (and static getters)
+ | 'set'
+ | 'sset' // Invoking setters (and static setters)
+ | 'begin'
+ | 'end'; // Asynchronous method invocation
// ... request-type specific fields ...
}
```
-### Loading *jsii* assemblies into the Kernel
-Before any *jsii* type can be used, the assembly that provides it must be loaded
-into the kernel. Similarly, all dependencies of a given *jsii* module must have
-been loaded into the kernel before the module itself can be loaded (the
+### Loading _jsii_ assemblies into the Kernel
+
+Before any _jsii_ type can be used, the assembly that provides it must be loaded into the kernel. Similarly, all
+dependencies of a given _jsii_ module must have been loaded into the kernel before the module itself can be loaded (the
`@jsii/kernel` does not perform any kind of dependency resolution).
Loading new assemblies into the `@jsii/kernel` is done using the `load` API:
@@ -101,9 +102,8 @@ interface LoadRequest {
}
```
-The response to the `load` call provides some high-level information pertaining
-to the loaded assembly, which may be used by the *host* app to validate the
-result of the operation:
+The response to the `load` call provides some high-level information pertaining to the loaded assembly, which may be
+used by the _host_ app to validate the result of the operation:
```ts
interface LoadResponse {
@@ -117,9 +117,9 @@ interface LoadResponse {
Once a module is loaded, all the types it declares immediately become available.
### Obtaining naming information for loaded assemblies
-In certain cases, *host* runtime libraries may need to obtain naming information
-from assemblies in order to determine the translation table from a *jsii*
-fully-qualified name to a *host*-native name. This can be retrieved using the
+
+In certain cases, _host_ runtime libraries may need to obtain naming information from assemblies in order to determine
+the translation table from a _jsii_ fully-qualified name to a _host_-native name. This can be retrieved using the
`naming` call:
```ts
@@ -132,8 +132,8 @@ export interface NamingRequest {
}
```
-In response to the `naming` call, the `@jsii/kernel` returns the configuration
-block for each language supported by the named `assembly`:
+In response to the `naming` call, the `@jsii/kernel` returns the configuration block for each language supported by the
+named `assembly`:
```ts
export interface NamingResponse {
@@ -149,9 +149,9 @@ export interface NamingResponse {
```
### Obtaining statistics about the Kernel usage
-The `stats` call can be used to obtain information about the current `Kernel`
-instance, which can be leveraged by unit tests or in order to produce metrics
-for tracking the health of a long-running *jsii* app.
+
+The `stats` call can be used to obtain information about the current `Kernel` instance, which can be leveraged by unit
+tests or in order to produce metrics for tracking the health of a long-running _jsii_ app.
```ts
export interface StatsRequest {
@@ -160,8 +160,7 @@ export interface StatsRequest {
}
```
-The response to the `stats` call contains synthetic information about the
-current state of the `Kernel`:
+The response to the `stats` call contains synthetic information about the current state of the `Kernel`:
```ts
export interface StatsResponse {
@@ -171,13 +170,12 @@ export interface StatsResponse {
```
### Creating objects
-Most *jsii* workflows start with creating instances of objects. This can mean
-creating a pure **JavaScript** object, instantiating a sub-class of some
-**JavaScript** class, or even creating a pure-*host* instance that implements
-a collection of *behavioral interfaces*.
-Creating objects is achieved using the `create` API, which accepts the following
-parameters:
+Most _jsii_ workflows start with creating instances of objects. This can mean creating a pure **JavaScript** object,
+instantiating a sub-class of some **JavaScript** class, or even creating a pure-_host_ instance that implements a
+collection of _behavioral interfaces_.
+
+Creating objects is achieved using the `create` API, which accepts the following parameters:
```ts
interface CreateRequest {
@@ -195,9 +193,8 @@ interface CreateRequest {
}
```
-The response to the object call is a decorated `ObjectReference` object (which
-is a common parameter to other calls in the `@jsii/kernel` API, used to refer
-to a particular instance):
+The response to the object call is a decorated `ObjectReference` object (which is a common parameter to other calls in
+the `@jsii/kernel` API, used to refer to a particular instance):
```ts
interface ObjectReference {
@@ -211,8 +208,7 @@ interface CreateResponse extends ObjectReference {
}
```
-The value of the `'$jsii.byref'` field of the `ObjectReference` type is
-formatted in the following way:
+The value of the `'$jsii.byref'` field of the `ObjectReference` type is formatted in the following way:
```
@aws-cdk/core.Stack@10003
@@ -221,39 +217,34 @@ formatted in the following way:
└─ Object instance's base class' jsii fully qualified name
```
-The first part of the reference identifier can have the special un-qualified
-value `Object` to denote the absence of a *jsii*-known base class (for example
-when the object *only* implements a *jsii* interface).
+The first part of the reference identifier can have the special un-qualified value `Object` to denote the absence of a
+_jsii_-known base class (for example when the object _only_ implements a _jsii_ interface).
#### Additional Interfaces
-Sometimes, the *host* app will extend a *jsii* class and implement new *jsii*
-interfaces that were not present on the original type. Such interfaces must be
-declared by providing their *jsii* fully qualified name as an entry in the
+
+Sometimes, the _host_ app will extend a _jsii_ class and implement new _jsii_ interfaces that were not present on the
+original type. Such interfaces must be declared by providing their _jsii_ fully qualified name as an entry in the
`interfaces` list.
-Providing interfaces in this list that are implicitly present from another
-delcaration (either because they are already implemented by the class denoted by
-the `fqn` field, or because another entry in the `interfaces` list extends it)
-is valid, but not necessary. The `@jsii/kernel` is responsible for correctly
-handling redundant declarations.
+Providing interfaces in this list that are implicitly present from another delcaration (either because they are already
+implemented by the class denoted by the `fqn` field, or because another entry in the `interfaces` list extends it) is
+valid, but not necessary. The `@jsii/kernel` is responsible for correctly handling redundant declarations.
-**:warning:** while declared `interfaces` may contain redundant declarations of
-members already declared by other `interfaces` or by the type denoted by `fqn`,
-undefined behavior results if any such declaration is not identical to the
-others (e.g: property `foo` declared with type `boolean` on one of the
-`interfaces`, and with type `string` on another).
+!!! danger
+ While declared `interfaces` may contain redundant declarations of members already declared by other `interfaces` or
+ by the type denoted by `fqn`, undefined behavior results if any such declaration is not identical to the others
+ (e.g: property `foo` declared with type `boolean` on one of the `interfaces`, and with type `string` on another).
#### Overrides
-For any method that is implemented or overridden from the *host* app, the
-`create` call must specify an `override` entry. This will inform the Kernel that
-calls to these methods must be relayed to the *host* app for execution, instead
+
+For any method that is implemented or overridden from the _host_ app, the `create` call must specify an `override`
+entry. This will inform the Kernel that calls to these methods must be relayed to the _host_ app for execution, instead
of executing the original library's version.
-An optional `cookie` string can be provided. This string will be recorded on the
-**Javascript** proxying implementation, and will be provided to the **host** app
-with any *callback* request. This information can be used, for example, to
-improve the performance of implementation lookups in the *host* app, where the
-necessary reflection calls would otherwise be prohibitively expensive.
+An optional `cookie` string can be provided. This string will be recorded on the **Javascript** proxying implementation,
+and will be provided to the **host** app with any _callback_ request. This information can be used, for example, to
+improve the performance of implementation lookups in the _host_ app, where the necessary reflection calls would
+otherwise be prohibitively expensive.
Override declarations adhere to the following schema:
@@ -276,18 +267,16 @@ type Override = MethodOverride | PropertyOverride;
```
#### A note about callbacks
-All `@jsii/runtime` calls that interact with object instances (that is, any call
-except for `load`, `naming` and `stats`; as well as the `del` call since *jsii*
-does not support customized destructors or finalizers) may result in the need to
-execute code that is defined in the *host* app, when the code path traverses a
-method or property that was implemented or overridden in the *host* app.
-Such cases will result in a callback request substituting itself to the response
-of the original call being made; execution of which will resume once the
-callback response is provided.
+All `@jsii/runtime` calls that interact with object instances (that is, any call except for `load`, `naming` and
+`stats`; as well as the `del` call since _jsii_ does not support customized destructors or finalizers) may result in the
+need to execute code that is defined in the _host_ app, when the code path traverses a method or property that was
+implemented or overridden in the _host_ app.
+
+Such cases will result in a callback request substituting itself to the response of the original call being made;
+execution of which will resume once the callback response is provided.
-A callback request is sent from the `@jsii/kernel`'s `node` process to the
-*host* app and has the following schema:
+A callback request is sent from the `@jsii/kernel`'s `node` process to the _host_ app and has the following schema:
```ts
interface CallbackRequest {
@@ -324,14 +313,12 @@ interface SetCallback extends CallbackBase {
type Callback = InvokeCallback | GetCallback | SetCallback;
```
-In order to fulfill the callback request, the *host* app may need to perform
-futher API calls (loading new assemblies, creating new instances, invoking
-methods - including delegating to the `super` implementation, ...). Such calls
-will behave as they otherwise would (including the possible introduction of
-further callback requests).
+In order to fulfill the callback request, the _host_ app may need to perform futher API calls (loading new assemblies,
+creating new instances, invoking methods - including delegating to the `super` implementation, ...). Such calls will
+behave as they otherwise would (including the possible introduction of further callback requests).
-Once the *host* app has fulfilled the request, it must signal the result of
-that execution back to the `@jsii/kernel` process by using the `complete` call:
+Once the _host_ app has fulfilled the request, it must signal the result of that execution back to the `@jsii/kernel`
+process by using the `complete` call:
```ts
interface CompleteBase {
@@ -355,12 +342,10 @@ interface CallbackFailure extends CompleteBase {
type CompleteRequest = CallbackSuccess | CallbackFailure;
```
-As discussed earlier, the response to the `complete` call is the result of
-resuming execution of the code path that triggered the callback request. This
-may be another callback request, or the final result of that call.
+As discussed earlier, the response to the `complete` call is the result of resuming execution of the code path that
+triggered the callback request. This may be another callback request, or the final result of that call.
-The `callbacks` call may be used to determine the list of all outstanding
-callback requests:
+The `callbacks` call may be used to determine the list of all outstanding callback requests:
```ts
interface CallbacksRequest {
@@ -379,9 +364,9 @@ interface CallbacksResponse {
```
### Destroying Objects
-Once the *host* app no longer needs a particular object, it can be discarded.
-This can happen for example when the *host* reference to an object is garbage
-collected or freed. In order to allow the **JavaScript** process to also
+
+Once the _host_ app no longer needs a particular object, it can be discarded. This can happen for example when the
+_host_ reference to an object is garbage collected or freed. In order to allow the **JavaScript** process to also
reclaim the associated memory footprint, the `del` API must be used:
```ts
@@ -394,29 +379,28 @@ interface DelRequest {
}
```
-> **:warning:** Failure to use the `del` API will result in memory leakage as
-> the **JavaScript** process accumulates garbage in its Kernel instance. This
-> can eventually result in a *Javascript heap out of memory* error, and the
-> abnormal termination of the `node` process, and consequently of the *host* app.
+!!! danger
+ Failure to use the `del` API will result in memory leakage as the **JavaScript** process accumulates garbage in its
+ Kernel instance. This can eventually result in a _Javascript heap out of memory_ error, and the abnormal termination
+ of the `node` process, and consequently of the _host_ app.
-> :construction: The existing *host* runtime libraries do not implement this
-> behavior!
+!!! bug "Unimplemented"
+ The existing _host_ runtime libraries do not implement this behavior!
-> :question: There is currently no provision for the `node` process to inform
-> the *host* app about object references it dropped. This mechanism is necessary
-> in order to support garbage collection of resources that involve
-> *host*-implemented code (in such cases, the *host* app must hold on to any
-> instance it passed to **JavaScript** until it is no longer reachable from
-> there).
+!!! question
+ There is currently no provision for the `node` process to inform the _host_ app about object references it dropped.
+ This mechanism is necessary in order to support garbage collection of resources that involve _host_-implemented code
+ (in such cases, the _host_ app must hold on to any instance it passed to **JavaScript** until it is no longer
+ reachable from there).
-Upon successfully deleting an object reference, the `@jsii/kernel` will return
-an empty response object:
+Upon successfully deleting an object reference, the `@jsii/kernel` will return an empty response object:
```ts
export interface DelResponse {}
```
### Invoking methods (and static methods)
+
Invoking methods is done via the `invoke` call:
```ts
@@ -433,8 +417,7 @@ interface InvokeRequest {
}
```
-Static method invocations do not have a receiving instance, and instead are
-implemented by way of the `sinvoke` call:
+Static method invocations do not have a receiving instance, and instead are implemented by way of the `sinvoke` call:
```ts
interface StaticInvokeRequest {
@@ -450,9 +433,8 @@ interface StaticInvokeRequest {
}
```
-Note that, unlike in certain programming languages such as **Java**, it is
-illegal to attempt invoking a static method on the static type of some instance
-using the `invoke` call. All static invocations *must* be done using `sinvoke`.
+Note that, unlike in certain programming languages such as **Java**, it is illegal to attempt invoking a static method
+on the static type of some instance using the `invoke` call. All static invocations _must_ be done using `sinvoke`.
Both the `invoke` and `sinvoke` calls result in the same response:
@@ -463,18 +445,16 @@ interface InvokeResponse {
}
```
-When the method's return type is `void`, the `result` value should typically be
-`undefined`, however it may not be ?? (**TypeScript** may in certain circumstances
-allow returning a value from a `void` method): the *host* app should ignore such
-values.
+When the method's return type is `void`, the `result` value should typically be `undefined`, however it may not be ??
+(**TypeScript** may in certain circumstances allow returning a value from a `void` method): the _host_ app should ignore
+such values.
#### Asynchronous method invocation
-The `invoke` call can only be used to invoke *synchronous* methods. In order to
-invoke *asynchronous* methods, the `begin` and `end` calls must be used instead.
-Once the *host* app has entered an asynchronous workflow (after it makes the
-first `begin` call), and until it has completed all asynchronous operations
-(after all `begin` class are matched with an `end` call), no *synchronous*
-operation (including synchronous callbacks) may be initiated.
+
+The `invoke` call can only be used to invoke _synchronous_ methods. In order to invoke _asynchronous_ methods, the
+`begin` and `end` calls must be used instead. Once the _host_ app has entered an asynchronous workflow (after it makes
+the first `begin` call), and until it has completed all asynchronous operations (after all `begin` class are matched
+with an `end` call), no _synchronous_ operation (including synchronous callbacks) may be initiated.
```ts
interface BeginRequest {
@@ -490,7 +470,8 @@ interface BeginRequest {
}
```
-> :construction: There is no static form of this call. Should there be one?
+!!! question
+ There is no static form of this call. Should there be one?
The `begin` call results in a promise being made:
@@ -504,8 +485,8 @@ interface BeginResponse {
}
```
-Whenever the *host* app needs to obtain the promised value (possibly in a
-blocking way), it makes the corresponding `end` call:
+Whenever the _host_ app needs to obtain the promised value (possibly in a blocking way), it makes the corresponding
+`end` call:
```ts
interface EndRequest {
@@ -526,11 +507,12 @@ interface EndResponse {
}
```
-> **:warning:** All `begin` calls must be matched with an `end` call. Failure to
-> do so may result in unhandled promise rejections that might cause the
-> application to terminate in certain environments.
+!!! danger
+ All `begin` calls must be matched with an `end` call. Failure to do so may result in unhandled promise rejections
+ that might cause the application to terminate in certain environments.
### Invoking getters (and static getters)
+
In order to obtain the value of properties, the `get` call is used:
```ts
@@ -545,8 +527,8 @@ interface GetRequest {
}
```
-When operating on static properties, or in order to obtain the value of `enum`
-constants, the `sget` API must be used instead:
+When operating on static properties, or in order to obtain the value of `enum` constants, the `sget` API must be used
+instead:
```ts
interface StaticGetRequest {
@@ -570,6 +552,7 @@ interface GetResponse {
```
### Invoking setters (and static setters)
+
In order to change the value of a property, the `set` call is used:
```ts
@@ -602,13 +585,8 @@ interface StaticSetRequest {
}
```
-Both the `set` and `sset` calls result in the same response, which is an empty
-object:
+Both the `set` and `sset` calls result in the same response, which is an empty object:
```ts
interface SetResponse {}
```
-
---------------------------------------------------------------------------------
-
-Continue to [Standard Compliance Suite](./4-standard-compliance-suite.md)
diff --git a/gh-pages/content/specification/4-standard-compliance-suite.md b/gh-pages/content/specification/4-standard-compliance-suite.md
new file mode 100644
index 0000000000..ea220c1ca1
--- /dev/null
+++ b/gh-pages/content/specification/4-standard-compliance-suite.md
@@ -0,0 +1,504 @@
+# Standard Compliance Suite
+
+## Goal
+
+The goal of the standard compliance suite is to be a normative description of the behaviors that all language runtime
+implementations (_host runtime library_ in combination with _code generation_) must implement. This description takes
+the form of a collection of test cases that must be re-implemented in each _host_ language, so that compliance can be
+asserted.
+
+Since the goal of _jsii_ is to expose a single Object-Oriented API to multiple programming languages, it is important to
+ensure the behavior is consistent across all of them. This can be achieved by making sure that the interactions between
+the _host_ and _kernel_ processes are the same for a given use-case.
+
+## Format
+
+In order to assert whether a new runtime implementation is correct, a formal compliance test suite is defined, that all
+language runtimes must fully implement before they can be deemed eligible for General Availability.
+
+This document describes these tests, as well as a general approach for ensuring conformance requirements are met in a
+systematic manner.
+
+### Categories
+
+Test cases in the standard compliance suite are grouped by categories, which help implementors direct their effort in
+the early stages of the implementation of new language bindings. Each category is declared in an `H3` title (a line that
+starts with `### `) within the [`## Test Suite`] title. A description of the category immediately follows the opening
+title. The category ends with the end of the document, or whenever another `H2` title is reached.
+
+[`## test suite`]: #test-suite
+
+### Test Case
+
+Within a category title, test cases are delimited by `H4` (`#### `) titles, which correspond to the test case name. The
+test case name should be kept concise (ideally within 75 characters) and try to be as descriptive as possible.
+
+Immediately after the `H4` title is an English language description of the test case that explains the property the test
+is designed to validate in as much detail as possible. As much as possible, test case descriptions should be
+self-sufficient.
+
+After the attributes table, a **TypeScript** block of code describes the canonical form of the test. It includes any
+type declaration that is used by the test (so the code example is self-contained). Assertions performed by the test
+should be written in the form of [`jest`] expectations.
+
+!!! question
+ The assertion code is intended as a formal representation of the tests' normative procedure. It is not currently
+ executed against the _kernel_, but this could be achieved in the future. Additionally, we might be able to
+ automatically transliterate the tests to other languages using [`jsii-rosetta`].
+
+[`jest`]: https://jestjs.io/docs/en/getting-started
+[`jsii-rosetta`]: https://github.com/aws/jsii/tree/main/packages/jsii-rosetta
+
+Finally, another code block details the sequence of messages that should be exchanged between the _host_ and `node`
+processes during the execution of the test case, such that implementations can assert coherent behavior.
+
+Initial messages corresponding to the `hello` and `load` calls can be omitted at the beginning of the kernel trace.
+Those messages are typically identical across tests and there is little value in asserting around those. However, any
+`load` call happening after the first call that is neither the `hello` message or another `load` call **must** be
+included.
+
+The dialogue is the sequence of JSON formatted messages, from the perspective of the _host_ app, using the following
+notation:
+
+- Messages sent by the _host_ runtime to the `node` process:
+ ```
+ > { "api": "foo" }
+ ```
+- Messages received by the _host_ runtime from the `node` process:
+ ```
+ < { "result": "bar" }
+ ```
+- Comments to improve readability of the trace:
+ ```
+ # Comment continues until the end of the line
+ ```
+- Blank lines can be added to logically group trace elements
+
+!!! question
+ Is there a need to support some form of a capture mechanism to provision for non-deterministic results, or
+ non-normative elements such as the exact Object IDs issued for created instances?
+
+??? example "Show Template"
+ Below is the template markdown to copy-paste when introducing a new test case in the compliance suite. New tests should
+ always be added at the very end of the category they belong to, right after the last test in said category.
+
+ ````md
+ ### Test Category
+
+ #### Test Case Name
+
+ A short english language description of what property this test verifies. The description should include enough detail
+ for a reader to be able to understand the test without having to search for any additional information. Prefer a long,
+ unambiguous description to a terse one that could be subject to interpretation.
+
+ Show test
+
+ ##### Reference Implementation
+
+ ```ts
+ // GIVEN
+ export class Foo {
+ /* ... */
+ }
+
+ // WHEN
+ const bar = new Foo().bar();
+
+ // THEN
+ expect(bar.baz).toBeUndefined();
+ ```
+
+ ##### Reference Kernel Messaging
+
+ ```
+ ## You can omit the initial hello/load messages
+ # < { "hello": "@jsii/runtime@1.2.3" }
+ # > { "load": { "name": "test-case-001", "version": "1.2.3", "tarball": "/tmp/jsii-kernel-test/lib.tgz" } }
+ # < { "assembly": "test-case-001", "types": 3 }
+ ```
+
+
+ ````
+
+## Compliance
+
+In order to be able to assert compliance of language binding libraries to the standard test suite, implementations are
+responsible for providing a test harness (typically as part of the runtime library) that can produce a standardized test
+report in the form of a JSON document that follows the following schema:
+
+```ts
+interface TestReport {
+ /** The report is broken down by test category, using the name as-is */
+ [category: string]: {
+ /** For each test in the category, using its name as-is */
+ [test: string]: {
+ /** Whether the test passed or failed */
+ status: 'PASS' | 'FAIL';
+ /** The kernel messages captured during the test */
+ kernelTrace: Array;
+ };
+ };
+}
+
+interface KernelMessage {
+ /** The direction the message was sent (Host -> Kernel / Kernel -> Host) */
+ direction: 'FromKernel' | 'ToKernel';
+ /** The message, as a JSON object */
+ message: { [key: string]: unknown };
+}
+```
+
+The `@jsii/compliance` package provides the necessary tools to consume such a test report, together with the Markdown
+document describing the compliance suite, and procuces a report describing compliance test coverage as well as
+information about any non-conformant test result.
+
+!!! bug "Unimplemented"
+ The `@jsii/compliance` tool does not exist yet.
+
+!!! question
+ Should a "somewhat standard" format such as XUnit test report be used instead of rolling our own JSON document?
+
+## Test Suite
+
+### Legacy
+
+This section is due to contain all compliance tests that were implemented before the _jsii specification_ was initially
+written. They are going to be gradually replaced by more focused tests with better descriptions.
+
+#### Type Unions are correctly disambiguated by the Kernel
+
+In certain cases, two or more types in a _Type Union_ can overlap in such a way that they are all valid structural types
+for the value. Statically typed languages however will not be satisfied with structural typing only, and require the
+correct declared type to be preserved.
+
+??? example "Show test"
+ ##### Reference Implementation
+
+ ```ts
+ // GIVEN
+ export interface BluePill {
+ readonly offeredTo: string;
+ readonly makesYouForgetTheMatrix?: boolean;
+ }
+ export interface RedPill {
+ readonly offeredTo: string;
+ readonly makesYouExitTheMatrix?: boolean;
+ }
+ export class Morpheus {
+ public static isBlue(pill: BluePill | RedPill): pill is BluePill {
+ const keys = new Set(Object.keys(pill));
+ switch (keys.size) {
+ case 1:
+ return keys.has('offeredTo');
+ case 2:
+ return keys.has('offeredTo') && keys.has('makesYouForgetTheMatrix');
+ default:
+ return false;
+ }
+ }
+ public static isRed(pill: BluePill | RedPill): pill is RedPill {
+ const keys = new Set(Object.keys(pill));
+ switch (keys.size) {
+ case 1:
+ return keys.has('offeredTo');
+ case 2:
+ return keys.has('offeredTo') && keys.has('makesYouExitTheMatrix');
+ default:
+ return false;
+ }
+ }
+ private constructor() {}
+ }
+ export class Neo {
+ public readonly tookBlue: boolean;
+ public readonly tookRed: boolean;
+
+ public constructor(public readonly pill: BluePill | RedPill) {
+ this.tookBlue = pill.offeredTo == 'Neo' && Morpheus.isBlue(pill);
+ this.tookRed = pill.offeredTo == 'Neo' && Morpheus.isRed(pill);
+ }
+ }
+
+ // WHEN
+ const bluePillA = new Neo({ offeredTo: 'not Neo' });
+ const bluePillB = new Neo({ offeredTo: 'Neo', makesYouForgetTheMatrix: true });
+ const redPillA = new Neo({ offeredTo: 'not Neo' });
+ const redPillB = new Neo({ offeredTo: 'Neo', makesYouExitTheMatrix: true });
+
+ // THEN
+ expect(bluePillA.pill instanceof BluePill).toBeTruthy();
+ expect(bluePillA.tookBlue).toBeFalsy();
+ expect(bluePillA.tookRed).toBeFalsy();
+
+ expect(bluePillB.pill instanceof BluePill).toBeTruthy();
+ expect(bluePillA.tookBlue).toBeTruthy();
+ expect(bluePillA.tookRed).toBeFalsy();
+
+ expect(redPillA.pill instanceof RedPill).toBeTruthy();
+ expect(bluePillA.tookBlue).toBeFalsy();
+ expect(bluePillA.tookRed).toBeFalsy();
+
+ expect(redPillB.pill instanceof RedPill).toBeTruthy();
+ expect(bluePillA.tookBlue).toBeFalsy();
+ expect(bluePillA.tookRed).toBeTruthy();
+ ```
+
+ ##### Kernel Trace
+
+ ```
+
+ ```
+
+#### Partially initialized object consumption
+
+When a constructor passes `this` out from **JavaScript** to the _host_ app, the reference must be correctly identified
+and passed across.
+
+!!! bug "Unimplemented"
+ The .NET Runtime does not currently honor object identity, meaning that despite the same object reference is
+ returned twice, two distinct proxies exist for it in the _host_ .NET app.
+
+ Generally speaking, using pure object identity on _jsii_ language front-ends is dangerous, as certain statically
+ typed language will require the runtime to have different instances for different static types a given object
+ reference is surfaced as. It may be necessary to introduce a helper akin to `Jsii.isSameObject(a, b)` to enable
+ identity predicates to be used. Other helper functions may be necessary, too, such as one to obtain a "consistent"
+ object hash for instances in Java (so they can be safely used with `HashMap`, ...).
+
+??? example "Show test"
+ ##### Reference Implementation
+
+ ```ts
+ // GIVEN
+ export abstract class PartiallyInitializedThisConsumer {
+ public abstract consumePartiallyInitializedThis(obj: ConstructorPassesThisOut): void;
+ }
+ export class ConstructorPassesThisOut {
+ public constructor(consumer: PartiallyInitializedThisConsumer) {
+ consumer.consumePartiallyInitializedThis(this);
+ }
+ }
+
+ // WHEN
+ class MyConsumer extends PartiallyInitializedThisConsumer {
+ public obj?: ConstructorPassesThisOut = null;
+
+ public consumePartiallyInitializedThis(obj: ConstructorPassesThisOut) {
+ this.obj = obj;
+ }
+ }
+ const consumer = new MyConsumer();
+ const object = new ConstructorPassesThisOut(consumer);
+
+ // THEN
+ expect(consumer.obj).toBe(object);
+ ```
+
+ ##### Kernel Trace
+
+ ```
+ # < {"hello":"@jsii/runtime@..."}
+ # > {"api":"load","name":"...","version":"...","tarball":"..."}
+ # < {"ok":{"assembly":"...","types":2}}
+
+ > {"api":"create","fqn":"test.PartiallyInitializedThisConsumer","args":[],"overrides":[{"method":"consumePartiallyInitializedThis"}],"interfaces":[]}
+ < {"ok":{"$jsii.byref":"test.PartiallyInitializedThisConsumer@10000"}}
+ > {"api":"create","fqn":"test.ConstructorPassesThisOut","args":[{"$jsii.byref":"test.PartiallyInitializedThisConsumer@10000","$jsii.interfaces":[]}],"overrides":[],"interfaces":[]}
+ < {"callback":{"cbid":"jsii::callback::20000","invoke":{"objref":{"$jsii.byref":"test.PartiallyInitializedThisConsumer@10000"},"method":"consumePartiallyInitializedThis","args":[{"$jsii.byref":"test.ConstructorPassesThisOut@10001"}]}}}
+ > {"complete":{"api":"complete","cbid":"jsii::callback::20000"}}
+ < {"ok":{"$jsii.byref":"test.ConstructorPassesThisOut@10001"}}
+ ```
+
+### Interfaces
+
+Tests in this section ensure correct behavior of _behavioral interfaces_.
+
+#### Host app can implement an interface "from scratch"
+
+It is possible for a "pure" host interface implementation to be passed across the language boundary, it's methods and
+properties can be used by **JavaScript** code within the Kernel process.
+
+!!! bug
+ The .NET Runtime currently requires that pure interfaces implementations extend from
+ `Amazon.JSII.Rutime.Deputy.DepytyBase`.
+
+!!! bug
+ The Python Runtime currently expects a somewhat un-pythonic way to implement interfaces, which requires decorating
+ the implementing class with `@jsii.implements("implemented-type.JsiiInterfaceFQN")`.
+
+??? example "Show test"
+ ##### Reference Implementation
+
+ ```ts
+ // GIVEN
+ export interface IBehavioralInterface {
+ methodCall(): string;
+ readonly property: number;
+ }
+ export class InterfaceConsumer {
+ constructor(private readonly iface: IBehavioralInterface) {}
+
+ public composeResult() {
+ return `${this.iface.methodCall()} / ${this.iface.property}`;
+ }
+ }
+
+ // WHEN
+ class Implementation implements IBehavioralInterface {
+ public readonly property = 1337;
+ public methodCall() {
+ return 'Hello!';
+ }
+ }
+ const impl = new Implementation();
+ const consumer = new InterfaceConsumer(impl);
+
+ // THEN
+ expect(consumer.composeResult()).toBe('Hello! / 1337');
+ ```
+
+ ##### Kernel Trace
+
+ ```
+ # < {"hello":"@jsii/runtime@..."}
+ # > {"api":"load","name":"...","version":"...","tarball":"..."}
+ # < {"ok":{"assembly":"...","types":2}}
+
+ > {"api":"create","fqn":"Object","args":[],"overrides":[{"method":"methodCall"},{"property":"property"}],"interfaces":["test.IBehavioralInterface"]}
+ < {"ok":{"$jsii.byref":"Object@10000","$jsii.interfaces":["test.IBehavioralInterface"]}}
+ > {"api":"create","fqn":"test.InterfaceConsumer","args":[{"$jsii.byref":"Object@10000","$jsii.interfaces":[]}],"overrides":[],"interfaces":[]}
+ < {"ok":{"$jsii.byref":"test.InterfaceConsumer@10001"}}
+ > {"api":"invoke","objref":{"$jsii.byref":"test.InterfaceConsumer@10001"},"method":"composeResult","args":[]}
+ < {"callback":{"cbid":"jsii::callback::20000","invoke":{"objref":{"$jsii.byref":"Object@10000","$jsii.interfaces":["test.IBehavioralInterface"]},"method":"methodCall","args":[]}}}
+ > {"complete":{"api":"complete","cbid":"jsii::callback::20000","result":"Hello!"}}
+ < {"callback":{"cbid":"jsii::callback::20001","get":{"objref":{"$jsii.byref":"Object@10000","$jsii.interfaces":["test.IBehavioralInterface"]},"property":"property"}}}
+ > {"complete":{"api":"complete","cbid":"jsii::callback::20001","result":1337.0}}
+ < {"ok":{"result":"Hello! / 1337"}}
+ ```
+
+### Structs & Keyword Arguments
+
+#### Ambiguous arguments are handled correctly
+
+When a method accepts both a positional parameter named `foo` and a struct parameter with a property named `foo`, the
+respective values are passed in the correct parameter location when calling into the **JavaScript** code.
+
+??? example "Show test"
+ ##### Reference Implementation
+
+ ```ts
+ // GIVEN
+ export interface StructType {
+ readonly foo: string;
+ }
+ export class ClassType {
+ public constructor(public readonly foo: number, public readonly opts: StructType) {}
+ }
+
+ // WHEN
+ var result = new ClassType('Bazinga!', { foo: 1337 });
+
+ // THEN
+ expect(typeof result.foo).toBe(1337);
+ expect(typeof result.opts.foo).toBe('Bazinga!');
+ ```
+
+ ##### Kernel Trace
+
+ ```
+ # < {"hello":"@jsii/runtime@..."}
+ # > {"api":"load","name":"...","version":"...","tarball":"..."}
+ # < {"ok":{"assembly":"...","types":2}}
+
+ > {"api":"create","fqn":"test.ClassType","args":[1337.0,{"$jsii.struct":{"fqn":"test.StructType","data":{"foo":"Bazinga!"}}}],"overrides":[],"interfaces":[]}
+ < {"ok":{"$jsii.byref":"test.ClassType@10000"}}
+ > {"api":"get","objref":{"$jsii.byref":"test.ClassType@10000"},"property":"foo"}
+ < {"ok":{"value":1337}}
+ > {"api":"get","objref":{"$jsii.byref":"test.ClassType@10000"},"property":"opts"}
+ < {"ok":{"value":{"$jsii.byref":"Object@10001","$jsii.interfaces":["test.StructType"]}}}
+ > {"api":"get","objref":{"$jsii.byref":"Object@10001"},"property":"foo"}
+ < {"ok":{"value":"Bazinga!"}}
+ ```
+
+### Collections
+
+Tests in this section ensure correct behavior of collections (`List` and `Map`).
+
+#### Struct elements of `List` are deserialized to the correct apparent type
+
+When the declared element type of a `List` is a _struct_, the resulting list must contain elements of the correct static
+type. This is a requirement for statically typed languages such as Java where type parameters are reified.
+
+??? example "Show test"
+ ##### Reference Implementation
+
+ ```ts
+ // GIVEN
+ export interface StructType {
+ readonly property: string;
+ }
+ export class StructProvider {
+ public static provide(): StructType[] {
+ return [{ property: 'value' }];
+ }
+ }
+
+ // WHEN
+ const items = StructProvider.provide();
+
+ // THEN
+ expect(items.length).toBeGreaterThan(0);
+ for (const item of items) {
+ expect(item instanceof StructType).toBeTruthy();
+ }
+ ```
+
+ ##### Kernel Trace
+
+ ```
+ # < {"hello":"@jsii/runtime@..."}
+ # > {"api":"load","name":"...","version":"...","tarball":"..."}
+ # < {"ok":{"assembly":"...","types":2}}
+
+ > {"api":"sinvoke","fqn":"test.StructProvider","method":"provide","args":[]}
+ < {"ok":{"result":[{"$jsii.byref":"Object@10000","$jsii.interfaces":["test.StructType"]}]}}
+ ```
+
+#### Struct elements of `Map` are deserialized to the correct apparent type
+
+When the declared element type of a `Map` is a _struct_, the resulting list must contain elements of the correct static
+type. This is a requirement for statically typed languages such as Java where type parameters are reified.
+
+??? example "Show test"
+ ##### Reference Implementation
+
+ ```ts
+ // GIVEN
+ export interface StructType {
+ readonly property: string;
+ }
+ export class StructProvider {
+ public static provide(): { [key: string]: StructType } {
+ return { foo: { property: 'value' } };
+ }
+ }
+
+ // WHEN
+ const items = StructProvider.provide();
+
+ // THEN
+ expect(items.length).toBeGreaterThan(0);
+ for (const item of Object.values(items)) {
+ expect(item instanceof StructType).toBeTruthy();
+ }
+ ```
+
+ ##### Kernel Trace
+
+ ```
+ # < {"hello":"@jsii/runtime@..."}
+ # > {"api":"load","name":"...","version":"...","tarball":"..."}
+ # < {"ok":{"assembly":"...","types":2}}
+
+ > {"api":"sinvoke","fqn":"test.StructProvider","method":"provide","args":[]}
+ < {"ok":{"result":{"$jsii.map":{"foo":{"$jsii.byref":"Object@10000","$jsii.interfaces":["test.StructType"]}}}}}
+ ```
diff --git a/gh-pages/content/specification/5-new-language-intake.md b/gh-pages/content/specification/5-new-language-intake.md
new file mode 100644
index 0000000000..52c970a17a
--- /dev/null
+++ b/gh-pages/content/specification/5-new-language-intake.md
@@ -0,0 +1,118 @@
+# New Language Intake
+
+This document outlines the process to be followed when introducing a new _jsii_ target language, including an estimated
+timeline (the exact timeline may vary significantly depending on the specifics of the language being added).
+
+The estimated total duration for the process is 4 to 6 months.
+
+## Planning
+
+**:alarm_clock: Estimated Duration:** 2 weeks
+
+The first step is to study the _jsii_ specification, as well as existing language implementations, in order to have the
+knowledge necessary to write a new language support proposal [RFC]. The [RFC] document produced will evolve and be
+polished as development of the new language support progresses, but the following elements must be present before any
+implementation begins:
+
+- Identification of the language's standard package repository
+- Proposal for the binding's configuration block
+- Sample API representations in the proposed language
+ - In particular, any element from the _jsii_ type model that does not naturally map into the proposed new language
+ needs to be represented
+ - Where several options exist, links to prior art are instrumental to validate the direction chosen
+- Toolchain and platform requirements
+
+[rfc]: https://github.com/awslabs/aws-cdk-rfcs#readme
+
+## Code Generation (`jsii-pacmak`)
+
+**:alarm_clock: Estimated Duration:** 4 to 6 weeks
+
+The necessary code must be added to [`jsii-pacmak`] in order to map the _jsii_ assembly's declared types into the
+proposed language. While this code ought to leverage the new language's _host_ runtime library, we begin with writing
+the code generator in order to ensure the appropriate developer experience is achieved in the new language before
+writing the back-end components.
+
+Code generators are authored in **TypeScript**.
+
+The necessary reserved words need to be registered in the `jsii` compiler, so that warnings are produced when
+identifiers are used in **TypeScript** code that require slugification or escaping in the target language (and will
+hence cause a degraded developer experience).
+
+[`jsii-pacmak`]: https://github.com/aws/jsii/tree/main/packages/jsii-pacmak
+
+## Runtime Library
+
+**:alarm_clock: Estimated Duration:** 4 to 6 weeks
+
+Now that the appropriate developer experience has been identified, the _host_ runtime library supporting the generated
+code can be written. This component must be written in the new language.
+
+!!! bug "Unimplemented"
+ A reference architecture for _host_ runtime libraries is to be developed, in order to ensure consistent naming and
+ behavior across all the runtimes, reducing the cost of maintaining many of those.
+
+## Building & Packaging
+
+**:alarm_clock: Estimated Duration:** 2 weeks
+
+Once code is generated and it has a _host_ runtime library to rely on, [`jsii-pacmak`] needs to receive the additional
+logic required to compile and package the generated libraries as required, producing ready-to-publish artifacts.
+
+The necessary toolchain needs to be added to the [`jsii/superchain`] _Docker_ image, so that `jsii` customers can rely
+on this to build artifacts for any of the supported languages.
+
+In addition to this, standardized _Amazon CodePipeline_ actions need to be developed in order to support publishing to
+the relevant idiomatic package managers.
+
+[`jsii/superchain`]: https://github.com/aws/jsii/tree/main/superchain
+
+## Compliance Tests
+
+**:alarm_clock: Estimated Duration:** 6 weeks
+
+The full standard compliance suite must be implemented for the new language. Leveraging the new code generator, _host_
+runtime library and compilation logic, the tests demonstrate that the new library behaves consistently with all other
+language bindings.
+
+While it is possible to declare _developer preview_ on a new language before all the tests pass, full compliance is a
+pre-requisite to declaring _general availability_ of the new language.
+
+## Documentation
+
+**:alarm_clock: Estimated Duration:** 1 week
+
+The necessary documentation needs to be provided to support customers who want to onboard the new language. This also
+includes updating [`jsii-config`] with support for the new languages' configuration block.
+
+[`jsii-config`]: https://github.com/aws/jsii/tree/main/packages/jsii-config
+
+## Developer Preview
+
+**:alarm_clock: Recommended Duration:** 4 to 8 weeks
+
+It is possible to declare _Developer Preview_ for a new language support as soon as the code generation and _host_
+runtime library are mature enough to be useful, and cover the majority of use-cases. While certain edge-cases may still
+be uncovered at the beginning of _Developer Preview_, a clear plan should exist that ensures a path exists to address
+any known gaps. It is required to have implemented most of the standard compliance suite prior to declaring _Developer
+Preview_.
+
+During the _Developer Preview_ phase, user experience studies should be conducted to validate assumptions made during
+the code generator's design. If any significant change is dictated by the results of the user experience studies,
+fluback studies should be performed in order to confirm that the desired impact has been achieved.
+
+!!! bug "Unimplemented"
+ A standard set of user experience study tasks will be developed, ensuring the learnings from previous experiences is
+ factored into subsequent studies conducted.
+
+Finally, it is essential to give time to the community to use and vet the new language support prior to considering
+_General Availability_. A minimum of a full month without a major bug reported is advised. During this period,
+intentional hands-on usage of the product msut be performed by engineers familiar with the new language as well as
+engineers unfamilar with it. This ensures the new experience is considered holistically, in a manner unbiased by
+knowledge of the implementation.
+
+## General Availability
+
+Once the new language support has been _Developer Preview_ for long enough and the engineers involved have gained
+confidence that the API is stable, covers all known use-cases reliably, and behaves consistently with other _Generally
+Available_ languages, the new support can be considered for _General Availability_.
diff --git a/gh-pages/mkdocs.yml b/gh-pages/mkdocs.yml
new file mode 100644
index 0000000000..4f7b2cfb94
--- /dev/null
+++ b/gh-pages/mkdocs.yml
@@ -0,0 +1,83 @@
+site_name: The jsii reference
+site_description: jsii allows code in any language to naturally interact with JavaScript classes.
+repo_name: aws/jsii
+repo_url: https://github.com/aws/jsii
+site_url: https://aws.github.io/jsii/
+edit_uri: edit/main/gh-pages/content/
+copyright: Copyright © 2020 Amazon Web Services, Inc.
+
+docs_dir: content
+extra_css:
+ - assets/stylesheets/amazon-ember-display.css
+ - assets/stylesheets/extra.css
+
+nav:
+ - Home:
+ - index.md
+ - home/features.md
+ - home/toolchain.md
+ - home/runtime-architecture.md
+ - Author Guide:
+ - dev-guide/index.md
+ - Quick Start:
+ - dev-guide/set-up.md
+ - dev-guide/write-code.md
+ - dev-guide/typescript-restrictions.md
+ - Configuration Reference:
+ - dev-guide/configuration/index.md
+ - Targets:
+ - .NET: dev-guide/configuration/targets/dotnet.md
+ - Go: dev-guide/configuration/targets/go.md
+ - Java: dev-guide/configuration/targets/java.md
+ - Python: dev-guide/configuration/targets/python.md
+ - Consumer Guide:
+ - consumer-guide/index.md
+ - Language Specifics:
+ - Python: consumer-guide/python.md
+ - Language Implementation:
+ - language-support/index.md
+ - .jsii Assemblies: language-support/assembly.md
+ - language-support/callbacks.md
+ - Specification:
+ - specification/1-introduction.md
+ - The jsii type system: specification/2-type-system.md
+ - The jsii kernel API: specification/3-kernel-api.md
+ - specification/4-standard-compliance-suite.md
+ - specification/5-new-language-intake.md
+
+extra:
+ social:
+ - icon: fontawesome/brands/aws
+ name: Amazon Web Services, Inc.
+ link: https://aws.amazon.com
+
+theme:
+ name: material
+ font: false
+ logo: assets/images/logo.png
+ icon:
+ logo: fontawesome/brands/aws
+ repo: fontawesome/brands/github
+ favicon: assets/images/favicon.png
+ palette:
+ scheme: default
+ features:
+ - navigation.expand
+ - navigation.instant
+ - navigation.tabs
+
+markdown_extensions:
+ - admonition
+ - pymdownx.details
+ - pymdownx.highlight
+ - pymdownx.inlinehilite
+ - pymdownx.snippets
+ - pymdownx.superfences
+ - pymdownx.tabbed
+ - pymdownx.emoji:
+ emoji_index: !!python/name:materialx.emoji.twemoji
+ emoji_generator: !!python/name:materialx.emoji.to_svg
+
+plugins:
+ - git-revision-date
+ - search
diff --git a/gh-pages/partials/node-support-table.md b/gh-pages/partials/node-support-table.md
new file mode 100644
index 0000000000..90102663b8
--- /dev/null
+++ b/gh-pages/partials/node-support-table.md
@@ -0,0 +1,24 @@
+| Release | Status |
+| --------- | ---------------------------- |
+| `<10.3.0` | :x: Defunct |
+| `^10.3.0` | :white_check_mark: Supported |
+| `^11.0.0` | :warning: Unsupported |
+| `^12.0.0` | :white_check_mark: Supported |
+| `^13.0.0` | :warning: Unsupported |
+| `^14.0.0` | :white_check_mark: Supported |
+| `^15.0.0` | :test_tube: Best effort |
+
+??? question "Status Definitions"
+ - **:white_check_mark: Supported**: Long Term Support (LTS) releases (those with an even major version) are
+ supported and bugs specific to those releases are addressed with the highest priority. Every `jsii` release is
+ automatically tested against those releases.
+ - **:test_tube: Best effort**: Development releases (those with an odd major version) are supported on a best-effort
+ basis. No automated testing is performed against those releases.
+ - **:warning: Unsupported**: End-of-Life releases are not supported. Bugs affecting those may not be fixed, and
+ users are strongly advised to migrate to more recent releases.
+ - **:x: Defunct**: Very old releases (these have been End-of-Live for a while now) are unlikely to work at all.
+
+ The [node releases schedule][node-releases] provides up-to-date information on the current status of all active
+ releases, and indicates the timelines for support (including planned End-of-Life dates for each).
+
+ [node-releases]: https://nodejs.org/en/about/releases/
diff --git a/gh-pages/requirements-dev.txt b/gh-pages/requirements-dev.txt
new file mode 100644
index 0000000000..0e11f6dde5
--- /dev/null
+++ b/gh-pages/requirements-dev.txt
@@ -0,0 +1,3 @@
+mkdocs~=1.1.2
+mkdocs-material~=6.2.3
+mkdocs-git-revision-date-plugin~=0.3.1
diff --git a/lerna.json b/lerna.json
index 5baa431d17..da8d0b206c 100644
--- a/lerna.json
+++ b/lerna.json
@@ -10,5 +10,5 @@
"rejectCycles": true
}
},
- "version": "1.16.0"
+ "version": "1.17.0"
}
diff --git a/package.json b/package.json
index 1898e93a1c..6f0cd63f76 100644
--- a/package.json
+++ b/package.json
@@ -16,23 +16,23 @@
},
"devDependencies": {
"@jest/types": "^26.6.2",
- "@typescript-eslint/eslint-plugin": "^4.9.0",
- "@typescript-eslint/parser": "^4.9.0",
+ "@typescript-eslint/eslint-plugin": "^4.13.0",
+ "@typescript-eslint/parser": "^4.13.0",
"all-contributors-cli": "^6.19.0",
- "eslint": "^7.15.0",
- "eslint-config-prettier": "^6.15.0",
+ "eslint": "^7.17.0",
+ "eslint-config-prettier": "^7.1.0",
"eslint-import-resolver-node": "^0.3.4",
"eslint-import-resolver-typescript": "^2.3.0",
"eslint-plugin-import": "^2.22.1",
- "eslint-plugin-prettier": "^3.2.0",
+ "eslint-plugin-prettier": "^3.3.1",
"jest-circus": "^26.6.3",
"jest-config": "^26.6.3",
"jest-expect-message": "^1.0.2",
"lerna": "^3.22.1",
"prettier": "^2.2.1",
- "standard-version": "^9.0.0",
+ "standard-version": "^9.1.0",
"ts-jest": "^26.4.4",
- "ts-node": "^9.1.0",
+ "ts-node": "^9.1.1",
"typescript": "~3.9.7"
},
"repository": {
diff --git a/packages/@jsii/Directory.Build.targets b/packages/@jsii/Directory.Build.targets
index e330b47866..de768ce1ec 100644
--- a/packages/@jsii/Directory.Build.targets
+++ b/packages/@jsii/Directory.Build.targets
@@ -2,7 +2,7 @@
-
+
@@ -17,7 +17,5 @@
-
-
diff --git a/packages/@jsii/dotnet-runtime-test/package.json b/packages/@jsii/dotnet-runtime-test/package.json
index 70e39521ba..a8e717f319 100644
--- a/packages/@jsii/dotnet-runtime-test/package.json
+++ b/packages/@jsii/dotnet-runtime-test/package.json
@@ -31,7 +31,7 @@
},
"devDependencies": {
"@jsii/dotnet-runtime": "^0.0.0",
- "@types/node": "^10.17.48",
+ "@types/node": "^10.17.50",
"jsii-calc": "^0.0.0",
"jsii-pacmak": "^0.0.0",
"typescript": "~3.9.7"
diff --git a/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests.FSharp/Amazon.JSII.Runtime.IntegrationTests.FSharp.fsproj b/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests.FSharp/Amazon.JSII.Runtime.IntegrationTests.FSharp.fsproj
index 0eaff07412..43ff8ed915 100644
--- a/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests.FSharp/Amazon.JSII.Runtime.IntegrationTests.FSharp.fsproj
+++ b/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests.FSharp/Amazon.JSII.Runtime.IntegrationTests.FSharp.fsproj
@@ -30,7 +30,6 @@
-
diff --git a/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj b/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj
index 25d75596bf..411ca0bdcb 100644
--- a/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj
+++ b/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj
@@ -27,7 +27,6 @@
-
diff --git a/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ServiceContainerFixture.cs b/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ServiceContainerFixture.cs
index 8ee32af60b..9a2a31142b 100644
--- a/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ServiceContainerFixture.cs
+++ b/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ServiceContainerFixture.cs
@@ -28,4 +28,4 @@ void IDisposable.Dispose()
JsiiTypeAttributeBase.Reset();
}
}
-}
\ No newline at end of file
+}
diff --git a/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/XUnitLogger.cs b/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/XUnitLogger.cs
index ed5f69e8c9..a86031077e 100644
--- a/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/XUnitLogger.cs
+++ b/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/XUnitLogger.cs
@@ -4,33 +4,33 @@
namespace Amazon.JSII.Runtime.IntegrationTests
{
- public sealed class XUnitLoggerFactory : ILoggerFactory
+ internal sealed class XUnitLoggerFactory : ILoggerFactory
{
- readonly ITestOutputHelper _output;
+ private readonly ITestOutputHelper _output;
public XUnitLoggerFactory(ITestOutputHelper output)
{
_output = output ?? throw new ArgumentNullException(nameof(output));
}
- public void AddProvider(ILoggerProvider provider)
+ void ILoggerFactory.AddProvider(ILoggerProvider provider)
{
}
- public ILogger CreateLogger(string categoryName)
+ ILogger ILoggerFactory.CreateLogger(string categoryName)
{
return new XUnitLogger(_output, categoryName);
}
- public void Dispose()
+ void IDisposable.Dispose()
{
}
}
- public sealed class XUnitLogger : ILogger, IDisposable
+ internal sealed class XUnitLogger : ILogger, IDisposable
{
- readonly ITestOutputHelper _output;
- readonly string _categoryName;
+ private readonly ITestOutputHelper _output;
+ private readonly string _categoryName;
public XUnitLogger(ITestOutputHelper output, string categoryName)
{
@@ -38,7 +38,7 @@ public XUnitLogger(ITestOutputHelper output, string categoryName)
_categoryName = categoryName ?? throw new ArgumentNullException(nameof(categoryName));
}
- public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter)
+ void ILogger.Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter)
{
var str = state?.ToString() ?? "";
// Only log lines starting with > or < (kernel traces)
@@ -48,17 +48,17 @@ public void Log(LogLevel logLevel, EventId eventId, TState state, Except
}
}
- public IDisposable BeginScope(TState state)
+ IDisposable ILogger.BeginScope(TState state)
{
return this;
}
- public bool IsEnabled(LogLevel logLevel)
+ bool ILogger.IsEnabled(LogLevel logLevel)
{
return true;
}
- public void Dispose()
+ void IDisposable.Dispose()
{
}
}
diff --git a/packages/@jsii/dotnet-runtime/.gitignore b/packages/@jsii/dotnet-runtime/.gitignore
index f9ae73407a..a113478365 100644
--- a/packages/@jsii/dotnet-runtime/.gitignore
+++ b/packages/@jsii/dotnet-runtime/.gitignore
@@ -25,3 +25,4 @@ bin/
cli/
obj/
*.DotSettings.user
+.nuget/
diff --git a/packages/@jsii/dotnet-runtime/package.json b/packages/@jsii/dotnet-runtime/package.json
index 26da061bd4..03c564715f 100644
--- a/packages/@jsii/dotnet-runtime/package.json
+++ b/packages/@jsii/dotnet-runtime/package.json
@@ -39,7 +39,7 @@
},
"devDependencies": {
"@jsii/runtime": "^0.0.0",
- "@types/node": "^10.17.48",
+ "@types/node": "^10.17.50",
"@types/semver": "^7.3.4",
"jsii-build-tools": "^0.0.0",
"semver": "^7.3.4",
diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Amazon.JSII.Analyzers.UnitTests.csproj b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Amazon.JSII.Analyzers.UnitTests.csproj
index 28791b6179..31acdd2ac4 100644
--- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Amazon.JSII.Analyzers.UnitTests.csproj
+++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Amazon.JSII.Analyzers.UnitTests.csproj
@@ -19,7 +19,6 @@
-
diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Amazon.JSII.Runtime.UnitTests.csproj b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Amazon.JSII.Runtime.UnitTests.csproj
index 11594899cf..1a41780b23 100644
--- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Amazon.JSII.Runtime.UnitTests.csproj
+++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Amazon.JSII.Runtime.UnitTests.csproj
@@ -19,7 +19,6 @@
-
diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Client/RuntimeTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Client/RuntimeTests.cs
index 1f433a0cbe..632d6486cc 100644
--- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Client/RuntimeTests.cs
+++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Client/RuntimeTests.cs
@@ -11,17 +11,15 @@ public sealed class RuntimeTests
private const string Prefix = "Runtime.";
private INodeProcess _nodeProcessMock;
-
+
private IRuntime _sut;
public RuntimeTests()
{
_nodeProcessMock = Substitute.For();
var standardOutputMock = Substitute.For();
- var standardErrorMock = Substitute.For();
_nodeProcessMock.StandardOutput.Returns(standardOutputMock);
- _nodeProcessMock.StandardError.Returns(standardErrorMock);
_sut = new Services.Runtime(_nodeProcessMock);
}
@@ -30,10 +28,9 @@ public RuntimeTests()
public void ThrowsJsiiExceptionWhenResponseNotReceived()
{
_nodeProcessMock.StandardOutput.ReadLine().ReturnsNull();
- _nodeProcessMock.StandardError.ReadToEnd().Returns("This is a test.");
var ex = Assert.Throws(() => _sut.ReadResponse());
- Assert.Equal("Child process exited unexpectedly: This is a test.", ex.Message);
+ Assert.Equal("Child process exited unexpectedly!", ex.Message);
}
}
-}
\ No newline at end of file
+}
diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/DeputyBase.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/DeputyBase.cs
index c49862460f..5d77f36cb5 100644
--- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/DeputyBase.cs
+++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/DeputyBase.cs
@@ -120,7 +120,7 @@ protected DeputyBase(ByRefValue reference)
referenceMap.AddNativeReference(Reference, this);
}
- public ByRefValue Reference { get; }
+ internal ByRefValue Reference { get; }
#region GetProperty
@@ -476,7 +476,7 @@ private static JsiiMethodAttribute GetMethodAttributeCore(System.Type type, stri
///
/// Unsafely obtains a proxy of a given type for this instance. This method allows obtaining a proxy instance
/// that is not known to be supported by the backing object instance; in which case the behavior of any
- /// operation that is not supported by the backing instance is undefined.
+ /// operation that is not supported by the backing instance is undefined.
///
///
/// A jsii-managed interface to obtain a proxy for.
@@ -535,7 +535,7 @@ object IConvertible.ToType(System.Type conversionType, IFormatProvider? provider
bool ToTypeCore(out object? result)
{
if (!conversionType.IsInstanceOfType(this)) return MakeProxy(conversionType, false, out result);
-
+
result = this;
return true;
@@ -549,7 +549,7 @@ private bool MakeProxy(Type interfaceType, bool force, [NotNullWhen(true)] out o
result = null;
return false;
}
-
+
var interfaceAttribute = interfaceType.GetCustomAttribute();
if (interfaceAttribute == null)
{
@@ -581,7 +581,7 @@ private bool MakeProxy(Type interfaceType, bool force, [NotNullWhen(true)] out o
result = constructorInfo.Invoke(new object[]{ Reference.ForProxy() });
return true;
-
+
bool TryFindSupportedInterface(string declaredFqn, string[] availableFqns, ITypeCache types, out string? foundFqn)
{
var declaredType = types.GetInterfaceType(declaredFqn);
diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/INodeProcess.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/INodeProcess.cs
index 344cab0303..78c5361bb4 100644
--- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/INodeProcess.cs
+++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/INodeProcess.cs
@@ -8,7 +8,5 @@ internal interface INodeProcess : IDisposable
TextWriter StandardInput { get; }
TextReader StandardOutput { get; }
-
- TextReader StandardError { get; }
}
}
diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/NodeProcess.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/NodeProcess.cs
index 670e477621..e670d0093f 100644
--- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/NodeProcess.cs
+++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/NodeProcess.cs
@@ -3,6 +3,7 @@
using System.Globalization;
using System.IO;
using System.Reflection;
+using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using Microsoft.Extensions.Logging;
@@ -13,11 +14,14 @@ internal sealed class NodeProcess : INodeProcess
{
readonly Process _process;
readonly ILogger _logger;
+
private const string JsiiRuntime = "JSII_RUNTIME";
private const string JsiiDebug = "JSII_DEBUG";
private const string JsiiAgent = "JSII_AGENT";
private const string JsiiAgentVersionString = "DotNet/{0}/{1}/{2}";
+ private bool Disposed = false;
+
public NodeProcess(IJsiiRuntimeProvider jsiiRuntimeProvider, ILoggerFactory loggerFactory)
{
loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
@@ -28,53 +32,79 @@ public NodeProcess(IJsiiRuntimeProvider jsiiRuntimeProvider, ILoggerFactory logg
runtimePath = jsiiRuntimeProvider.JsiiRuntimePath;
var utf8 = new UTF8Encoding(false /* no BOM */);
- _process = new Process
+ var startInfo = new ProcessStartInfo
{
- StartInfo = new ProcessStartInfo
- {
- FileName = "node",
- Arguments = $"--max-old-space-size=4096 {runtimePath}",
- RedirectStandardInput = true,
- StandardInputEncoding = utf8,
- RedirectStandardOutput = true,
- StandardOutputEncoding = utf8,
- RedirectStandardError = true,
- StandardErrorEncoding = utf8
- }
+ FileName = "node",
+ Arguments = $"--max-old-space-size=4096 {runtimePath}",
+ RedirectStandardInput = true,
+ StandardInputEncoding = utf8,
+ RedirectStandardOutput = true,
+ StandardOutputEncoding = utf8,
+ UseShellExecute = false,
};
var assemblyVersion = GetAssemblyFileVersion();
- _process.StartInfo.EnvironmentVariables.Add(JsiiAgent,
+ startInfo.EnvironmentVariables.Add(JsiiAgent,
string.Format(CultureInfo.InvariantCulture, JsiiAgentVersionString, Environment.Version,
assemblyVersion.Item1, assemblyVersion.Item2));
var debug = Environment.GetEnvironmentVariable(JsiiDebug);
- if (!string.IsNullOrWhiteSpace(debug) && !_process.StartInfo.EnvironmentVariables.ContainsKey(JsiiDebug))
- _process.StartInfo.EnvironmentVariables.Add(JsiiDebug, debug);
+ if (!string.IsNullOrWhiteSpace(debug) && !startInfo.EnvironmentVariables.ContainsKey(JsiiDebug))
+ startInfo.EnvironmentVariables.Add(JsiiDebug, debug);
_logger.LogDebug("Starting jsii runtime...");
- _logger.LogDebug($"{_process.StartInfo.FileName} {_process.StartInfo.Arguments}");
+ _logger.LogDebug($"{startInfo.FileName} {startInfo.Arguments}");
// Registering shutdown hook to have JS process gracefully terminate.
AppDomain.CurrentDomain.ProcessExit += (snd, evt) => {
((IDisposable)this).Dispose();
};
- _process.Start();
- }
+ _process = Process.Start(startInfo);
- public TextWriter StandardInput => _process.StandardInput;
+ StandardInput = _process.StandardInput;
+ StandardOutput = _process.StandardOutput;
+ }
- public TextReader StandardOutput => _process.StandardOutput;
+ public TextWriter StandardInput { get; }
- public TextReader StandardError => _process.StandardError;
+ public TextReader StandardOutput { get; }
+ [MethodImpl(MethodImplOptions.Synchronized)]
void IDisposable.Dispose()
{
- StandardInput.Dispose();
- StandardOutput.Dispose();
- StandardError.Dispose();
- _process.Dispose();
+ if (Disposed) return;
+
+ Disposed = true;
+
+ // If the child process has already exited, we simply need to dispose of it
+ if (_process.HasExited)
+ {
+ _process.Dispose();
+ return;
+ }
+
+ // Closing the jsii Kernel's STDIN is how we instruct it to shut down
+ StandardInput.Close();
+
+ try
+ {
+ // Give the kernel 5 seconds to clean up after itself
+ if (!_process.WaitForExit(5_000)) {
+ // Kill the child process if needed
+ _process.Kill();
+ }
+ }
+ catch (InvalidOperationException)
+ {
+ // This means the process had already exited, because it was faster to clean up
+ // than we were to process it's termination. We still re-check if the process has
+ // exited and re-throw if not (meaning it was a different issue).
+ if (!_process.HasExited)
+ {
+ throw;
+ }
+ }
}
///
diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/Runtime.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/Runtime.cs
index d624257822..7e2adadb4a 100644
--- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/Runtime.cs
+++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/Runtime.cs
@@ -1,5 +1,4 @@
using System;
-using System.Threading.Tasks;
namespace Amazon.JSII.Runtime.Services
{
@@ -10,10 +9,6 @@ internal sealed class Runtime : IRuntime
public Runtime(INodeProcess nodeProcess)
{
_nodeProcess = nodeProcess ?? throw new ArgumentNullException(nameof(nodeProcess));
- if (Environment.GetEnvironmentVariable("JSII_DEBUG") != null)
- {
- Task.Run(() => RedirectStandardError());
- }
}
public string ReadResponse()
@@ -21,8 +16,7 @@ public string ReadResponse()
var response = _nodeProcess.StandardOutput.ReadLine();
if (string.IsNullOrEmpty(response))
{
- var errorMessage = _nodeProcess.StandardError.ReadToEnd();
- throw new JsiiException("Child process exited unexpectedly: " + errorMessage);
+ throw new JsiiException("Child process exited unexpectedly!");
}
return response;
@@ -43,13 +37,5 @@ public void WriteRequest(string request)
_nodeProcess.StandardInput.WriteLine(request);
_nodeProcess.StandardInput.Flush();
}
-
- private void RedirectStandardError()
- {
- while (true)
- {
- Console.Error.WriteLine(_nodeProcess.StandardError.ReadLine());
- }
- }
}
}
diff --git a/packages/@jsii/dotnet-runtime/src/NuGet.Config b/packages/@jsii/dotnet-runtime/src/NuGet.Config
new file mode 100644
index 0000000000..00fb09ef41
--- /dev/null
+++ b/packages/@jsii/dotnet-runtime/src/NuGet.Config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/packages/@jsii/go-runtime/build-tools/.eslintrc.yaml b/packages/@jsii/go-runtime/build-tools/.eslintrc.yaml
new file mode 100644
index 0000000000..adc30f56f6
--- /dev/null
+++ b/packages/@jsii/go-runtime/build-tools/.eslintrc.yaml
@@ -0,0 +1,8 @@
+---
+extends: ../../../../eslint-config.yaml
+rules:
+ 'import/no-extraneous-dependencies':
+ - error
+ - devDependencies: ['**/build-tools/**'] # Only allow importing devDependencies from tests
+ optionalDependencies: false # Disallow importing optional dependencies (those shouldn't be used here)
+ peerDependencies: false # Disallow importing peer dependencies (those shouldn't be used here)
diff --git a/packages/@jsii/go-runtime/build-tools/_constants.ts b/packages/@jsii/go-runtime/build-tools/_constants.ts
index 1b16c657fb..6193453d99 100644
--- a/packages/@jsii/go-runtime/build-tools/_constants.ts
+++ b/packages/@jsii/go-runtime/build-tools/_constants.ts
@@ -8,7 +8,6 @@ export function runCommand(
const result = spawnSync(command, args, {
...opts,
shell: process.platform === 'win32',
- stdio: 'inherit',
});
if (result.error) {
throw result.error;
diff --git a/packages/@jsii/go-runtime/build-tools/build-repo-dir.ts b/packages/@jsii/go-runtime/build-tools/build-repo-dir.ts
new file mode 100755
index 0000000000..3f93cdf431
--- /dev/null
+++ b/packages/@jsii/go-runtime/build-tools/build-repo-dir.ts
@@ -0,0 +1,84 @@
+#!/usr/bin/env npx ts-node
+
+import { SpawnOptions } from 'child_process';
+import * as fs from 'fs-extra';
+import * as path from 'path';
+
+import { runCommand } from './_constants';
+
+// Constants
+const RUNTIME_DIR = path.resolve(__dirname, '..', 'jsii-experimental');
+// Destination repo configuration
+const REPO_NAME = process.env.JSII_RUNTIME_REPO_NAME;
+const USERNAME = process.env.JSII_RUNTIME_REPO_USERNAME;
+const TOKEN = process.env.JSII_RUNTIME_REPO_TOKEN;
+const REMOTE =
+ USERNAME && TOKEN
+ ? `https://${USERNAME}:${TOKEN}@github.com/${REPO_NAME}.git`
+ : `https://github.com${REPO_NAME}.git`;
+
+// Always preserve these files/paths from the cloned repo
+const PRESERVE = ['.git', '.gitignore'];
+// Copy these files from the root of the JSII repository
+const ROOT_FILES = ['CODE_OF_CONDUCT.md', 'LICENSE', 'NOTICE'];
+// Copy these files from build-tools/repo-files to the jsii-runtime-go repo
+const LOCAL_FILES = ['README.md', 'CONTRIBUTING.md'];
+// Exclude all of these files from being overwritten when copying.
+const DONT_OVERWRITE = [...PRESERVE, ...ROOT_FILES, ...LOCAL_FILES];
+
+async function main() {
+ const args = process.argv.slice(2);
+ console.log(args[0]);
+ await makeRepoDir(args[0]);
+}
+
+async function makeRepoDir(dir: string) {
+ const runRepoCmd = (
+ cmd: string,
+ args: readonly string[],
+ opts: SpawnOptions = {},
+ ) => runCommand(cmd, args, { cwd: dir, ...opts });
+ runRepoCmd('git', ['clone', REMOTE, '.'], { stdio: 'inherit' });
+
+ // Clone repo and delete its contents except nodes in the PRESERVE list.
+ const clonedFiles = await fs.readdir(dir);
+ await Promise.all(
+ clonedFiles.map((node) => {
+ if (PRESERVE.includes(node)) {
+ return Promise.resolve();
+ }
+ return fs.remove(path.resolve(dir, node));
+ }),
+ );
+
+ // Copy relevant files from the jsii repo root.
+ await Promise.all(
+ ROOT_FILES.map((node) => {
+ const filePath = path.resolve(__dirname, '..', '..', '..', '..', node);
+ return fs.copy(filePath, path.resolve(dir, node));
+ }),
+ );
+
+ // Copy relevant files from the repo-files dir.
+ await Promise.all(
+ LOCAL_FILES.map((node) => {
+ const filePath = path.resolve(__dirname, 'repo-files', node);
+ return fs.copy(filePath, path.resolve(dir, node));
+ }),
+ );
+
+ // Copy All source files from the @jsii/go-runtime package. Throw an error if
+ // any conflicts exist.
+ const sourceFiles = await fs.readdir(RUNTIME_DIR);
+ await Promise.all(
+ sourceFiles.map((node) => {
+ if (DONT_OVERWRITE.includes(node)) {
+ return Promise.reject(`${RUNTIME_DIR} contains ${node}!`);
+ }
+
+ return fs.copy(path.resolve(RUNTIME_DIR, node), path.resolve(dir, node));
+ }),
+ );
+}
+
+main().catch(console.error);
diff --git a/packages/@jsii/go-runtime/build-tools/gen-calc.ts b/packages/@jsii/go-runtime/build-tools/gen-calc.ts
index f879fe2372..bbdeb1c82b 100644
--- a/packages/@jsii/go-runtime/build-tools/gen-calc.ts
+++ b/packages/@jsii/go-runtime/build-tools/gen-calc.ts
@@ -2,6 +2,7 @@
import { removeSync } from 'fs-extra';
import { join, resolve } from 'path';
+
import { runCommand } from './_constants';
const genRoot = join(__dirname, '..', 'jsii-calc');
@@ -19,4 +20,5 @@ runCommand(
'--recurse',
resolve(__dirname, '..', '..', '..', 'jsii-calc'),
],
+ { stdio: 'inherit' },
);
diff --git a/packages/@jsii/go-runtime/build-tools/gen.ts b/packages/@jsii/go-runtime/build-tools/gen.ts
index 6b83fcdc96..de78bb2497 100644
--- a/packages/@jsii/go-runtime/build-tools/gen.ts
+++ b/packages/@jsii/go-runtime/build-tools/gen.ts
@@ -56,11 +56,13 @@ code.closeFile(RUNTIME_FILE);
code.openFile(VERSION_FILE);
code.line('package jsii');
code.line();
+
+// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
const thisVersion = require('../package.json').version;
code.line(`const version = ${JSON.stringify(thisVersion)}`);
code.closeFile(VERSION_FILE);
-code.save(OUTPUT_DIR);
+code.save(OUTPUT_DIR).catch(console.error);
function getByteSlice(path: string) {
const fileData = readFileSync(path).toString('hex');
diff --git a/packages/@jsii/go-runtime/build-tools/repo-files/CONTRIBUTING.md b/packages/@jsii/go-runtime/build-tools/repo-files/CONTRIBUTING.md
new file mode 100644
index 0000000000..f8ce9463e3
--- /dev/null
+++ b/packages/@jsii/go-runtime/build-tools/repo-files/CONTRIBUTING.md
@@ -0,0 +1 @@
+The go JSII runtime source code is managed in [the main JSII repository](https://github.com/aws/jsii). See the [contributing](https://github.com/aws/jsii/blob/main/CONTRIBUTING.md) guide for details on filing issues and PRs.
diff --git a/packages/@jsii/go-runtime/build-tools/repo-files/README.md b/packages/@jsii/go-runtime/build-tools/repo-files/README.md
new file mode 100644
index 0000000000..8e831d68f2
--- /dev/null
+++ b/packages/@jsii/go-runtime/build-tools/repo-files/README.md
@@ -0,0 +1,3 @@
+# JSII Go Runtime
+
+This is the JSII runtime for go. This repository is used only for publishing the go module. The source code is managed in [the main JSII repository](https://github.com/aws/jsii). Refer to the [go-runtime readme there](https://github.com/aws/jsii/blob/main/packages/%40jsii/go-runtime/README.md) for details on building and testing the module.
diff --git a/packages/@jsii/go-runtime/build-tools/tsconfig.json b/packages/@jsii/go-runtime/build-tools/tsconfig.json
new file mode 100644
index 0000000000..e286e0804d
--- /dev/null
+++ b/packages/@jsii/go-runtime/build-tools/tsconfig.json
@@ -0,0 +1,6 @@
+{
+ "extends": "../../../../tsconfig-base",
+ "include": [
+ "**/*.ts"
+ ]
+}
diff --git a/packages/@jsii/go-runtime/go.mod b/packages/@jsii/go-runtime/go.mod
index 2af1ba9b2d..9a82319dda 100644
--- a/packages/@jsii/go-runtime/go.mod
+++ b/packages/@jsii/go-runtime/go.mod
@@ -5,7 +5,7 @@ go 1.15
require (
github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc v0.0.0
github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalclib v0.0.0
- github.com/aws-cdk/jsii/jsii-experimental v0.0.0
+ github.com/aws/jsii-runtime-go v0.0.0
)
replace (
@@ -13,5 +13,5 @@ replace (
github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbase v0.0.0 => ./jsii-calc/go/scopejsiicalcbase
github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbaseofbase v0.0.0 => ./jsii-calc/go/scopejsiicalcbaseofbase
github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalclib v0.0.0 => ./jsii-calc/go/scopejsiicalclib
- github.com/aws-cdk/jsii/jsii-experimental v0.0.0 => ./jsii-experimental
+ github.com/aws/jsii-runtime-go v0.0.0 => ./jsii-experimental
)
diff --git a/packages/@jsii/go-runtime/jsii-calc-test/main_test.go b/packages/@jsii/go-runtime/jsii-calc-test/main_test.go
index ba23e8f8bf..10573de239 100644
--- a/packages/@jsii/go-runtime/jsii-calc-test/main_test.go
+++ b/packages/@jsii/go-runtime/jsii-calc-test/main_test.go
@@ -6,7 +6,7 @@ import (
param "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/submodule/param"
returnsParam "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/submodule/returnsparam"
calclib "github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalclib"
- "github.com/aws-cdk/jsii/jsii-experimental"
+ "github.com/aws/jsii-runtime-go"
"math"
"os"
"reflect"
diff --git a/packages/@jsii/go-runtime/jsii-experimental/go.mod b/packages/@jsii/go-runtime/jsii-experimental/go.mod
index 71104dfec8..d7711d50c9 100644
--- a/packages/@jsii/go-runtime/jsii-experimental/go.mod
+++ b/packages/@jsii/go-runtime/jsii-experimental/go.mod
@@ -1,3 +1,3 @@
-module github.com/aws-cdk/jsii/jsii-experimental
+module github.com/aws/jsii-runtime-go
go 1.15
diff --git a/packages/@jsii/go-runtime/package.json b/packages/@jsii/go-runtime/package.json
index a9289d7c14..4882f15d8d 100644
--- a/packages/@jsii/go-runtime/package.json
+++ b/packages/@jsii/go-runtime/package.json
@@ -5,11 +5,13 @@
"description": "",
"main": "index.js",
"scripts": {
+ "build": "npm run gen:rt && (cd ./jsii-experimental && go build)",
"fmt": "go fmt ./jsii-experimental ./jsii-calc-test",
"gen:calc": "ts-node build-tools/gen-calc.ts",
"gen:rt": "ts-node build-tools/gen.ts",
"generate": "npm run gen:rt && npm run gen:calc",
- "build": "npm run generate && (cd ./jsii-experimental && go build)",
+ "lint": "eslint . --ext .ts --ignore-path=.gitignore",
+ "lint:fix": "yarn lint --fix",
"test": "(cd ./jsii-experimental && go test) && npm run test:calc",
"test:calc": "npm run gen:calc && go test ./jsii-calc-test"
},
@@ -21,12 +23,14 @@
},
"devDependencies": {
"@types/fs-extra": "^8.1.1",
- "@types/node": "^10.17.48",
+ "@types/node": "^10.17.50",
"codemaker": "^0.0.0",
+ "eslint": "^7.17.0",
"fs-extra": "^9.0.1",
"jsii-calc": "^0.0.0",
"jsii-pacmak": "^0.0.0",
- "ts-node": "^9.1.0",
+ "prettier": "^2.2.1",
+ "ts-node": "^9.1.1",
"typescript": "~3.9.7"
}
}
diff --git a/packages/@jsii/integ-test/package.json b/packages/@jsii/integ-test/package.json
index eac24c99b3..83b6b98c8d 100644
--- a/packages/@jsii/integ-test/package.json
+++ b/packages/@jsii/integ-test/package.json
@@ -24,15 +24,15 @@
"jsii": "^0.0.0",
"jsii-pacmak": "^0.0.0",
"jsii-rosetta": "^0.0.0",
- "tar": "^6.0.5"
+ "tar": "^6.1.0"
},
"devDependencies": {
"@types/dotenv": "^8.2.0",
"@types/fs-extra": "^8.1.1",
- "@types/jest": "^26.0.16",
- "@types/node": "^10.17.48",
+ "@types/jest": "^26.0.20",
+ "@types/node": "^10.17.50",
"@types/tar": "^4.0.4",
- "eslint": "^7.15.0",
+ "eslint": "^7.17.0",
"prettier": "^2.2.1",
"typescript": "~3.9.7"
}
diff --git a/packages/@jsii/java-runtime/package.json b/packages/@jsii/java-runtime/package.json
index 0a9d3edf4a..c9beefeb99 100644
--- a/packages/@jsii/java-runtime/package.json
+++ b/packages/@jsii/java-runtime/package.json
@@ -33,7 +33,7 @@
},
"devDependencies": {
"@jsii/runtime": "^0.0.0",
- "@types/node": "^10.17.48",
+ "@types/node": "^10.17.50",
"jsii-build-tools": "^0.0.0",
"typescript": "~3.9.7"
}
diff --git a/packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/JsiiRuntime.java b/packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/JsiiRuntime.java
index 2445020ee8..e0b993e4ae 100644
--- a/packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/JsiiRuntime.java
+++ b/packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/JsiiRuntime.java
@@ -31,11 +31,6 @@ public final class JsiiRuntime {
*/
private static final String VERSION_BUILD_PART_REGEX = "\\+[a-z0-9]+$";
- /**
- * True to print server traces to STDERR.
- */
- private static boolean traceEnabled = false;
-
/**
*
*/
@@ -51,11 +46,6 @@ public final class JsiiRuntime {
*/
private Process childProcess;
- /**
- * Child's standard error.
- */
- private BufferedReader stderr;
-
/**
* Child's standard output.
*/
@@ -213,12 +203,6 @@ synchronized void terminate() {
stdout = null;
}
- // Cleaning up stderr (ensuring buffers are flushed, etc...)
- if (stderr != null) {
- stderr.close();
- stderr = null;
- }
-
// We shut down already, no need for the shutdown hook anymore
if (this.shutdownHook != null) {
try {
@@ -243,12 +227,10 @@ private synchronized void startRuntimeIfNeeded() {
// If JSII_DEBUG is set, enable traces.
String jsiiDebug = System.getenv("JSII_DEBUG");
- if (jsiiDebug != null
+ boolean traceEnabled = jsiiDebug != null
&& !jsiiDebug.isEmpty()
&& !jsiiDebug.equalsIgnoreCase("false")
- && !jsiiDebug.equalsIgnoreCase("0")) {
- traceEnabled = true;
- }
+ && !jsiiDebug.equalsIgnoreCase("0");
// If JSII_RUNTIME is set, use it to find the jsii-server executable
// otherwise, we default to "jsii-runtime" from PATH.
@@ -261,7 +243,10 @@ private synchronized void startRuntimeIfNeeded() {
System.err.println("jsii-runtime: " + jsiiRuntimeExecutable);
}
- ProcessBuilder pb = new ProcessBuilder("node", jsiiRuntimeExecutable);
+ ProcessBuilder pb = new ProcessBuilder("node", jsiiRuntimeExecutable)
+ .redirectInput(ProcessBuilder.Redirect.PIPE)
+ .redirectOutput(ProcessBuilder.Redirect.PIPE)
+ .redirectError(ProcessBuilder.Redirect.INHERIT);
if (traceEnabled) {
pb.environment().put("JSII_DEBUG", "1");
@@ -279,21 +264,13 @@ private synchronized void startRuntimeIfNeeded() {
OutputStreamWriter stdinStream = new OutputStreamWriter(this.childProcess.getOutputStream(), StandardCharsets.UTF_8);
InputStreamReader stdoutStream = new InputStreamReader(this.childProcess.getInputStream(), StandardCharsets.UTF_8);
- InputStreamReader stderrStream = new InputStreamReader(this.childProcess.getErrorStream(), StandardCharsets.UTF_8);
- this.stderr = new BufferedReader(stderrStream);
this.stdout = new BufferedReader(stdoutStream);
this.stdin = new BufferedWriter(stdinStream);
handshake();
this.client = new JsiiClient(this);
-
- // if trace is enabled, start a thread that continuously reads from the child process's
- // STDERR and prints to my STDERR.
- if (traceEnabled) {
- startPipeErrorStreamThread();
- }
}
/**
@@ -320,8 +297,7 @@ JsonNode readNextResponse() {
try {
String responseLine = this.stdout.readLine();
if (responseLine == null) {
- String error = this.stderr.lines().collect(Collectors.joining("\n\t"));
- throw new JsiiException("Child process exited unexpectedly: " + error);
+ throw new JsiiException("Child process exited unexpectedly!");
}
final JsonNode response = JsiiObjectMapper.INSTANCE.readTree(responseLine);
JsiiRuntime.notifyInspector(response, MessageInspector.MessageType.Response);
@@ -331,28 +307,6 @@ JsonNode readNextResponse() {
}
}
- /**
- * Starts a thread that pipes STDERR from the child process to our STDERR.
- */
- private void startPipeErrorStreamThread() {
- Thread daemon = new Thread(() -> {
- while (true) {
- try {
- String line = stderr.readLine();
- System.err.println(line);
- if (line == null) {
- break;
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- });
-
- daemon.setDaemon(true);
- daemon.start();
- }
-
/**
* This will return the server process in case it is not already started.
* @return A {@link JsiiClient} connected to the server process.
@@ -365,13 +319,6 @@ public JsiiClient getClient() {
return this.client;
}
- /**
- * Prints jsii-server traces to STDERR.
- */
- public static void enableTrace() {
- traceEnabled = true;
- }
-
/**
* Asserts that a peer runtimeVersion is compatible with this Java runtime version, which means
* they share the same version components, with the possible exception of the build number.
diff --git a/packages/@jsii/kernel/lib/api.ts b/packages/@jsii/kernel/lib/api.ts
index 1eb4f7b416..113077df57 100644
--- a/packages/@jsii/kernel/lib/api.ts
+++ b/packages/@jsii/kernel/lib/api.ts
@@ -100,6 +100,19 @@ export interface LoadResponse {
readonly types: number;
}
+export interface InvokeScriptRequest {
+ readonly assembly: string;
+ readonly script: string;
+ readonly args?: string[];
+}
+
+export interface InvokeScriptResponse {
+ readonly status: number | null;
+ readonly stdout: Buffer;
+ readonly stderr: Buffer;
+ readonly signal: string | null;
+}
+
export interface CreateRequest {
/**
* The FQN of the class of which an instance is requested (or "Object")
diff --git a/packages/@jsii/kernel/lib/kernel.ts b/packages/@jsii/kernel/lib/kernel.ts
index 7f112bfd9a..d6f5f220d8 100644
--- a/packages/@jsii/kernel/lib/kernel.ts
+++ b/packages/@jsii/kernel/lib/kernel.ts
@@ -1,4 +1,5 @@
import * as spec from '@jsii/spec';
+import * as cp from 'child_process';
import * as fs from 'fs-extra';
import * as os from 'os';
import * as path from 'path';
@@ -8,6 +9,7 @@ import * as vm from 'vm';
import * as api from './api';
import { TOKEN_REF } from './api';
import { ObjectTable, tagJsiiConstructor } from './objects';
+import * as onExit from './on-exit';
import * as wire from './serialization';
export class Kernel {
@@ -65,24 +67,11 @@ export class Kernel {
);
}
- if (!this.installDir) {
- this.installDir = fs.mkdtempSync(path.join(os.tmpdir(), 'jsii-kernel-'));
- fs.mkdirpSync(path.join(this.installDir, 'node_modules'));
- this._debug('creating jsii-kernel modules workdir:', this.installDir);
-
- process.on('exit', () => {
- if (this.installDir) {
- this._debug('removing install dir', this.installDir);
- fs.removeSync(this.installDir); // can't use async version during exit
- }
- });
- }
-
const pkgname = req.name;
const pkgver = req.version;
// check if we already have such a module
- const packageDir = path.join(this.installDir, 'node_modules', pkgname);
+ const packageDir = this._getPackageDir(pkgname);
if (fs.pathExistsSync(packageDir)) {
// module exists, verify version
const epkg = fs.readJsonSync(path.join(packageDir, 'package.json'));
@@ -147,6 +136,50 @@ export class Kernel {
};
}
+ public invokeBinScript(
+ req: api.InvokeScriptRequest,
+ ): api.InvokeScriptResponse {
+ const packageDir = this._getPackageDir(req.assembly);
+ if (fs.pathExistsSync(packageDir)) {
+ // module exists, verify version
+ const epkg = fs.readJsonSync(path.join(packageDir, 'package.json'));
+
+ if (!epkg.bin) {
+ throw new Error('There is no bin scripts defined for this package.');
+ }
+
+ const scriptPath = epkg.bin[req.script];
+
+ if (!epkg.bin) {
+ throw new Error(`Script with name ${req.script} was not defined.`);
+ }
+
+ const result = cp.spawnSync(
+ path.join(packageDir, scriptPath),
+ req.args ?? [],
+ {
+ encoding: 'utf-8',
+ env: {
+ ...process.env,
+ // Make sure the current NODE_OPTIONS are honored if we shell out to node
+ NODE_OPTIONS: process.execArgv.join(' '),
+ // Make sure "this" node is ahead of $PATH just in case
+ PATH: `${path.dirname(process.execPath)}:${process.env.PATH}`,
+ },
+ shell: true,
+ },
+ );
+
+ return {
+ stdout: result.stdout,
+ stderr: result.stderr,
+ status: result.status,
+ signal: result.signal,
+ };
+ }
+ throw new Error(`Package with name ${req.assembly} was not loaded.`);
+ }
+
public create(req: api.CreateRequest): api.CreateResponse {
return this._create(req);
}
@@ -493,6 +526,17 @@ export class Kernel {
}
}
+ private _getPackageDir(pkgname: string): string {
+ if (!this.installDir) {
+ this.installDir = fs.mkdtempSync(path.join(os.tmpdir(), 'jsii-kernel-'));
+ fs.mkdirpSync(path.join(this.installDir, 'node_modules'));
+ this._debug('creating jsii-kernel modules workdir:', this.installDir);
+
+ onExit.removeSync(this.installDir);
+ }
+ return path.join(this.installDir, 'node_modules', pkgname);
+ }
+
// prefixed with _ to allow calling this method internally without
// getting it recorded for testing.
private _create(req: api.CreateRequest): api.CreateResponse {
diff --git a/packages/@jsii/kernel/lib/on-exit.ts b/packages/@jsii/kernel/lib/on-exit.ts
new file mode 100644
index 0000000000..1a6fbdfb46
--- /dev/null
+++ b/packages/@jsii/kernel/lib/on-exit.ts
@@ -0,0 +1,32 @@
+import * as fs from 'fs-extra';
+import * as process from 'process';
+
+const removeSyncPaths = new Array();
+
+export function removeSync(path: string): void {
+ registerIfNeeded();
+ removeSyncPaths.push(path);
+}
+
+let registered = false;
+
+/**
+ * Registers the exist handler if it has not been registered already. This is done exactly ocne per
+ * process, so that processes with multiple kernels don't end up creating too many exit handlers, as
+ * this reduces the chances they will correctly run.
+ */
+function registerIfNeeded() {
+ if (registered) {
+ return;
+ }
+ process.once('exit', onExitHandler);
+ registered = true;
+
+ function onExitHandler() {
+ if (removeSyncPaths.length > 0) {
+ for (const path of removeSyncPaths) {
+ fs.removeSync(path);
+ }
+ }
+ }
+}
diff --git a/packages/@jsii/kernel/package.json b/packages/@jsii/kernel/package.json
index abe4635f42..4dc3119814 100644
--- a/packages/@jsii/kernel/package.json
+++ b/packages/@jsii/kernel/package.json
@@ -33,17 +33,17 @@
"dependencies": {
"@jsii/spec": "^0.0.0",
"fs-extra": "^9.0.1",
- "tar": "^6.0.5"
+ "tar": "^6.1.0"
},
"devDependencies": {
"@scope/jsii-calc-base": "^0.0.0",
"@scope/jsii-calc-lib": "^0.0.0",
"@types/fs-extra": "^8.1.1",
- "@types/jest": "^26.0.16",
+ "@types/jest": "^26.0.20",
"@types/jest-expect-message": "^1.0.3",
- "@types/node": "^10.17.48",
+ "@types/node": "^10.17.50",
"@types/tar": "^4.0.4",
- "eslint": "^7.15.0",
+ "eslint": "^7.17.0",
"jest": "^26.6.3",
"jest-expect-message": "^1.0.2",
"jsii-build-tools": "^0.0.0",
diff --git a/packages/@jsii/kernel/test/kernel.test.ts b/packages/@jsii/kernel/test/kernel.test.ts
index 16f903f35d..a0d0f956b7 100644
--- a/packages/@jsii/kernel/test/kernel.test.ts
+++ b/packages/@jsii/kernel/test/kernel.test.ts
@@ -2134,6 +2134,18 @@ defineTest('Override transitive property', (sandbox) => {
expect(propValue).toBe('N3W');
});
+defineTest('invokeBinScript() return output', (sandbox) => {
+ const result = sandbox.invokeBinScript({
+ assembly: 'jsii-calc',
+ script: 'calc',
+ });
+
+ expect(result.stdout).toEqual('Hello World!\n');
+ expect(result.stderr).toEqual('');
+ expect(result.status).toEqual(0);
+ expect(result.signal).toBeNull();
+});
+
// =================================================================================================
const testNames: { [name: string]: boolean } = {};
@@ -2204,7 +2216,7 @@ async function preparePackage(module: string, useCache = true) {
});
const stdout = new Array();
child.stdout.on('data', (chunk) => stdout.push(Buffer.from(chunk)));
- child.once('exit', (code, signal) => {
+ child.once('close', (code, signal) => {
if (code === 0) {
return ok();
}
diff --git a/packages/@jsii/kernel/test/recording.ts b/packages/@jsii/kernel/test/recording.ts
index 2fe16911ec..0dd1f995c0 100644
--- a/packages/@jsii/kernel/test/recording.ts
+++ b/packages/@jsii/kernel/test/recording.ts
@@ -31,12 +31,11 @@ export function recordInteraction(kernel: Kernel, inputOutputLogPath: string) {
const logfile = fs.createWriteStream(inputOutputLogPath);
(kernel as any).logfile = logfile;
- Object.getOwnPropertyNames(Kernel.prototype)
- .filter((p) => !p.startsWith('_'))
- .forEach((api) => {
- const old = Object.getOwnPropertyDescriptor(Kernel.prototype, api)!;
-
+ Object.entries(Object.getOwnPropertyDescriptors(Kernel.prototype))
+ .filter(([p, v]) => !p.startsWith('_') && typeof v.value === 'function')
+ .forEach(([api, old]) => {
Object.defineProperty(kernel, api, {
+ ...old,
value(...args: any[]) {
logInput({ api, ...args[0] });
try {
@@ -68,12 +67,10 @@ export function recordInteraction(kernel: Kernel, inputOutputLogPath: string) {
});
function logInput(obj: any) {
- const inputLine = `${JSON.stringify(obj)}\n`;
- logfile.write(`> ${inputLine}`);
+ logfile.write(`> ${JSON.stringify(obj)}\n`);
}
function logOutput(obj: any) {
- const outputLine = `${JSON.stringify(obj)}\n`;
- logfile.write(`< ${outputLine}`);
+ logfile.write(`< ${JSON.stringify(obj)}\n`);
}
}
diff --git a/packages/@jsii/python-runtime/package.json b/packages/@jsii/python-runtime/package.json
index 520a75b2cb..2631358c21 100644
--- a/packages/@jsii/python-runtime/package.json
+++ b/packages/@jsii/python-runtime/package.json
@@ -41,7 +41,7 @@
"jsii-build-tools": "^0.0.0",
"jsii-calc": "^0.0.0",
"jsii-pacmak": "^0.0.0",
- "ts-node": "^9.1.0",
+ "ts-node": "^9.1.1",
"typescript": "~3.9.7"
}
}
diff --git a/packages/@jsii/python-runtime/requirements.txt b/packages/@jsii/python-runtime/requirements.txt
index 327ee927a8..e782c0987c 100644
--- a/packages/@jsii/python-runtime/requirements.txt
+++ b/packages/@jsii/python-runtime/requirements.txt
@@ -1,8 +1,8 @@
black~=20.8b1
-pytest~=6.1
+pytest~=6.2
pytest-mypy~=0.8
pip~=20.3
-setuptools~=51.0
+setuptools~=51.1
wheel~=0.36
-e .
diff --git a/packages/@jsii/python-runtime/src/jsii/_kernel/__init__.py b/packages/@jsii/python-runtime/src/jsii/_kernel/__init__.py
index 984f180bc8..ebf137cf48 100644
--- a/packages/@jsii/python-runtime/src/jsii/_kernel/__init__.py
+++ b/packages/@jsii/python-runtime/src/jsii/_kernel/__init__.py
@@ -33,6 +33,7 @@
GetResponse,
InvokeRequest,
InvokeResponse,
+ InvokeScriptRequest,
KernelResponse,
LoadRequest,
ObjRef,
@@ -242,6 +243,20 @@ def __init__(self, provider_class: Type[BaseProvider] = ProcessProvider) -> None
def load(self, name: str, version: str, tarball: str) -> None:
self.provider.load(LoadRequest(name=name, version=version, tarball=tarball))
+ def invokeBinScript(
+ self, pkgname: str, script: str, args: Optional[List[Any]] = None
+ ) -> None:
+ if args is None:
+ args = []
+
+ self.provider.invokeBinScript(
+ InvokeScriptRequest(
+ pkgname=pkgname,
+ script=script,
+ args=_make_reference_for_native(self, args),
+ )
+ )
+
# TODO: Is there a way to say that obj has to be an instance of klass?
def create(self, klass: Type, obj: Any, args: Optional[List[Any]] = None) -> ObjRef:
if args is None:
diff --git a/packages/@jsii/python-runtime/src/jsii/_kernel/providers/base.py b/packages/@jsii/python-runtime/src/jsii/_kernel/providers/base.py
index 145c654804..06ba5347e5 100644
--- a/packages/@jsii/python-runtime/src/jsii/_kernel/providers/base.py
+++ b/packages/@jsii/python-runtime/src/jsii/_kernel/providers/base.py
@@ -11,6 +11,8 @@
GetResponse,
InvokeRequest,
InvokeResponse,
+ InvokeScriptRequest,
+ InvokeScriptResponse,
DeleteRequest,
DeleteResponse,
SetRequest,
@@ -45,6 +47,10 @@ class BaseProvider(metaclass=abc.ABCMeta):
def load(self, request: LoadRequest) -> LoadResponse:
...
+ @abc.abstractmethod
+ def invokeBinScript(self, request: InvokeScriptRequest) -> InvokeScriptResponse:
+ ...
+
@abc.abstractmethod
def create(self, request: CreateRequest) -> CreateResponse:
...
diff --git a/packages/@jsii/python-runtime/src/jsii/_kernel/providers/process.py b/packages/@jsii/python-runtime/src/jsii/_kernel/providers/process.py
index 1fb6fac3ee..ac178785cd 100644
--- a/packages/@jsii/python-runtime/src/jsii/_kernel/providers/process.py
+++ b/packages/@jsii/python-runtime/src/jsii/_kernel/providers/process.py
@@ -38,6 +38,8 @@
GetResponse,
InvokeRequest,
InvokeResponse,
+ InvokeScriptRequest,
+ InvokeScriptResponse,
SetRequest,
SetResponse,
StaticGetRequest,
@@ -158,6 +160,10 @@ def __init__(self):
LoadRequest,
_with_api_key("load", self._serializer.unstructure_attrs_asdict),
)
+ self._serializer.register_unstructure_hook(
+ InvokeScriptRequest,
+ _with_api_key("invokeBinScript", self._serializer.unstructure_attrs_asdict),
+ )
self._serializer.register_unstructure_hook(
CreateRequest,
_with_api_key("create", self._serializer.unstructure_attrs_asdict),
@@ -343,6 +349,9 @@ def _process(self) -> _NodeProcess:
def load(self, request: LoadRequest) -> LoadResponse:
return self._process.send(request, LoadResponse)
+ def invokeBinScript(self, request: InvokeScriptRequest) -> InvokeScriptResponse:
+ return self._process.send(request, InvokeScriptResponse)
+
def create(self, request: CreateRequest) -> CreateResponse:
return self._process.send(request, CreateResponse)
diff --git a/packages/@jsii/python-runtime/src/jsii/_kernel/types.py b/packages/@jsii/python-runtime/src/jsii/_kernel/types.py
index 8adf783748..cc0f73c022 100644
--- a/packages/@jsii/python-runtime/src/jsii/_kernel/types.py
+++ b/packages/@jsii/python-runtime/src/jsii/_kernel/types.py
@@ -47,6 +47,23 @@ class LoadResponse:
types: int
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class InvokeScriptRequest:
+
+ pkgname: str
+ script: str
+ args: List[Any] = attr.Factory(list)
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class InvokeScriptResponse:
+
+ status: int
+ stdout: str
+ stderr: str
+ output: List[str]
+
+
@attr.s(auto_attribs=True, frozen=True, slots=True)
class CreateRequest:
@@ -226,6 +243,7 @@ class StatsResponse:
GetRequest,
StaticGetRequest,
InvokeRequest,
+ InvokeScriptRequest,
StaticInvokeRequest,
StatsRequest,
]
@@ -237,6 +255,7 @@ class StatsResponse:
DeleteResponse,
GetResponse,
InvokeResponse,
+ InvokeScriptResponse,
SetResponse,
StatsResponse,
Callback,
diff --git a/packages/@jsii/python-runtime/src/jsii/_runtime.py b/packages/@jsii/python-runtime/src/jsii/_runtime.py
index c632035556..b756c72cf9 100644
--- a/packages/@jsii/python-runtime/src/jsii/_runtime.py
+++ b/packages/@jsii/python-runtime/src/jsii/_runtime.py
@@ -45,6 +45,10 @@ def load(cls, *args, _kernel=kernel, **kwargs):
# Give our record of the assembly back to the caller.
return assembly
+ def invokeBinScript(cls, pkgname, script, *args, _kernel=kernel):
+ response = _kernel.invokeBinScript(pkgname, script, *args)
+ print(response.stdout)
+
class JSIIMeta(_ClassPropertyMeta, type):
def __new__(cls, name, bases, attrs, *, jsii_type=None):
diff --git a/packages/@jsii/python-runtime/tests/test_compliance.py b/packages/@jsii/python-runtime/tests/test_compliance.py
index 9262679811..28aa6b6220 100644
--- a/packages/@jsii/python-runtime/tests/test_compliance.py
+++ b/packages/@jsii/python-runtime/tests/test_compliance.py
@@ -85,7 +85,6 @@
from scope.jsii_calc_lib import IFriendly, EnumFromScopedModule, Number
from scope.jsii_calc_lib.custom_submodule_name import IReflectable, ReflectableEntry
-
# Note: The names of these test functions have been chosen to map as closely to the
# Java Compliance tests as possible.
# Note: While we could write more expressive and better tests using the functionality
diff --git a/packages/@jsii/runtime/package.json b/packages/@jsii/runtime/package.json
index 1e83e915cd..6072d5611e 100644
--- a/packages/@jsii/runtime/package.json
+++ b/packages/@jsii/runtime/package.json
@@ -40,18 +40,18 @@
"devDependencies": {
"@scope/jsii-calc-base": "^0.0.0",
"@scope/jsii-calc-lib": "^0.0.0",
- "@types/jest": "^26.0.16",
- "@types/node": "^10.17.48",
- "eslint": "^7.15.0",
+ "@types/jest": "^26.0.20",
+ "@types/node": "^10.17.50",
+ "eslint": "^7.17.0",
"jest": "^26.6.3",
"jsii-build-tools": "^0.0.0",
"jsii-calc": "^0.0.0",
"prettier": "^2.2.1",
- "source-map-loader": "^1.1.3",
+ "source-map-loader": "^2.0.0",
"ts-jest": "^26.4.4",
"typescript": "~3.9.7",
"wasm-loader": "^1.3.0",
- "webpack": "^5.9.0",
- "webpack-cli": "^4.2.0"
+ "webpack": "^5.13.0",
+ "webpack-cli": "^4.3.1"
}
}
diff --git a/packages/@jsii/spec/lib/assembly.ts b/packages/@jsii/spec/lib/assembly.ts
index 51663e47ad..1502da404a 100644
--- a/packages/@jsii/spec/lib/assembly.ts
+++ b/packages/@jsii/spec/lib/assembly.ts
@@ -143,6 +143,13 @@ export interface Assembly extends AssemblyConfiguration, Documentable {
* @default none
*/
readme?: { markdown: string };
+
+ /**
+ * List of bin-scripts
+ *
+ * @default none
+ */
+ bin?: { readonly [script: string]: string };
}
/**
diff --git a/packages/@jsii/spec/package.json b/packages/@jsii/spec/package.json
index c9f8e9ad22..386e8e31b5 100644
--- a/packages/@jsii/spec/package.json
+++ b/packages/@jsii/spec/package.json
@@ -34,13 +34,13 @@
"jsonschema": "^1.4.0"
},
"devDependencies": {
- "@types/jest": "^26.0.16",
- "@types/node": "^10.17.48",
- "eslint": "^7.15.0",
+ "@types/jest": "^26.0.20",
+ "@types/node": "^10.17.50",
+ "eslint": "^7.17.0",
"jest": "^26.6.3",
"jsii-build-tools": "^0.0.0",
"prettier": "^2.2.1",
"typescript": "~3.9.7",
- "typescript-json-schema": "^0.45.0"
+ "typescript-json-schema": "^0.47.0"
}
}
diff --git a/packages/@scope/jsii-calc-base-of-base/package.json b/packages/@scope/jsii-calc-base-of-base/package.json
index adda0aa0f8..f74ce98729 100644
--- a/packages/@scope/jsii-calc-base-of-base/package.json
+++ b/packages/@scope/jsii-calc-base-of-base/package.json
@@ -30,7 +30,7 @@
"test:update": "npm run build && UPDATE_DIFF=1 npm run test"
},
"devDependencies": {
- "@types/node": "^10.17.48",
+ "@types/node": "^10.17.50",
"jsii": "^0.0.0",
"jsii-build-tools": "^0.0.0",
"jsii-rosetta": "^0.0.0",
diff --git a/packages/@scope/jsii-calc-base/package.json b/packages/@scope/jsii-calc-base/package.json
index 91d10d7d87..f76dc8941b 100644
--- a/packages/@scope/jsii-calc-base/package.json
+++ b/packages/@scope/jsii-calc-base/package.json
@@ -35,7 +35,7 @@
"@scope/jsii-calc-base-of-base": "^0.0.0"
},
"devDependencies": {
- "@types/node": "^10.17.48",
+ "@types/node": "^10.17.50",
"jsii": "^0.0.0",
"jsii-build-tools": "^0.0.0",
"jsii-rosetta": "^0.0.0",
diff --git a/packages/@scope/jsii-calc-lib/package.json b/packages/@scope/jsii-calc-lib/package.json
index cb26e3a6fe..4f95c18888 100644
--- a/packages/@scope/jsii-calc-lib/package.json
+++ b/packages/@scope/jsii-calc-lib/package.json
@@ -39,7 +39,7 @@
"@scope/jsii-calc-base-of-base": "^0.0.0"
},
"devDependencies": {
- "@types/node": "^10.17.48",
+ "@types/node": "^10.17.50",
"jsii": "^0.0.0",
"jsii-build-tools": "^0.0.0",
"jsii-rosetta": "^0.0.0",
diff --git a/packages/codemaker/package.json b/packages/codemaker/package.json
index 7b8d0610db..32fbae1629 100644
--- a/packages/codemaker/package.json
+++ b/packages/codemaker/package.json
@@ -37,9 +37,9 @@
},
"devDependencies": {
"@types/fs-extra": "^8.1.1",
- "@types/jest": "^26.0.16",
- "@types/node": "^10.17.48",
- "eslint": "^7.15.0",
+ "@types/jest": "^26.0.20",
+ "@types/node": "^10.17.50",
+ "eslint": "^7.17.0",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"typescript": "~3.9.7"
diff --git a/packages/jsii-calc/bin/run b/packages/jsii-calc/bin/run
new file mode 100755
index 0000000000..ea7dde785e
--- /dev/null
+++ b/packages/jsii-calc/bin/run
@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+require('./run.js');
diff --git a/packages/jsii-calc/bin/run.cmd b/packages/jsii-calc/bin/run.cmd
new file mode 100644
index 0000000000..8c083b0bff
--- /dev/null
+++ b/packages/jsii-calc/bin/run.cmd
@@ -0,0 +1,2 @@
+@echo off
+node "%~dp0\run" %*
diff --git a/packages/jsii-calc/bin/run.ts b/packages/jsii-calc/bin/run.ts
new file mode 100755
index 0000000000..296a77b93d
--- /dev/null
+++ b/packages/jsii-calc/bin/run.ts
@@ -0,0 +1,5 @@
+#!/usr/bin/env node
+
+/* eslint-disable no-console */
+
+console.info('Hello World!');
diff --git a/packages/jsii-calc/lib/compliance.ts b/packages/jsii-calc/lib/compliance.ts
index e07576b709..9a396fa4b1 100644
--- a/packages/jsii-calc/lib/compliance.ts
+++ b/packages/jsii-calc/lib/compliance.ts
@@ -2840,3 +2840,36 @@ export namespace LevelOne {
readonly value: boolean;
}
}
+
+/**
+ * Static methods that override parent class are technically overrides (the
+ * inheritance of statics is part of the ES6 specification), but certain other
+ * languages such as Java do not carry statics in the inheritance chain at all,
+ * so they cannot be overridden, only hidden.
+ *
+ * The difference is fairly minor (for typical use-cases, the end result is the
+ * same), however this has implications on what the generated code should look
+ * like.
+ */
+export class StaticHelloParent {
+ public static get property(): number {
+ return 1337;
+ }
+
+ public static method(): void {
+ /* A static method */
+ }
+}
+export class StaticHelloChild extends StaticHelloParent {
+ public static get property(): number {
+ return 42;
+ }
+
+ public static method(): void {
+ /* An ES6 Override */
+ }
+
+ private constructor() {
+ super();
+ }
+}
diff --git a/packages/jsii-calc/package.json b/packages/jsii-calc/package.json
index 6bcf20ec04..8c0871a4f8 100644
--- a/packages/jsii-calc/package.json
+++ b/packages/jsii-calc/package.json
@@ -14,6 +14,9 @@
"bugs": {
"url": "https://github.com/aws/jsii/issues"
},
+ "bin": {
+ "calc": "bin/run"
+ },
"repository": {
"type": "git",
"url": "https://github.com/aws/jsii.git",
@@ -49,8 +52,8 @@
"@scope/jsii-calc-lib": "^0.0.0"
},
"devDependencies": {
- "@types/node": "^10.17.48",
- "eslint": "^7.15.0",
+ "@types/node": "^10.17.50",
+ "eslint": "^7.17.0",
"jsii": "^0.0.0",
"jsii-build-tools": "^0.0.0",
"jsii-rosetta": "^0.0.0",
diff --git a/packages/jsii-calc/test/assembly.jsii b/packages/jsii-calc/test/assembly.jsii
index 4e4cdd3388..d5b8f36e7a 100644
--- a/packages/jsii-calc/test/assembly.jsii
+++ b/packages/jsii-calc/test/assembly.jsii
@@ -7,6 +7,9 @@
],
"url": "https://aws.amazon.com"
},
+ "bin": {
+ "calc": "bin/run"
+ },
"bundled": {
"@fixtures/jsii-calc-bundled": "^0.19.0"
},
@@ -11419,6 +11422,102 @@
}
]
},
+ "jsii-calc.StaticHelloChild": {
+ "assembly": "jsii-calc",
+ "base": "jsii-calc.StaticHelloParent",
+ "docs": {
+ "stability": "stable"
+ },
+ "fqn": "jsii-calc.StaticHelloChild",
+ "kind": "class",
+ "locationInModule": {
+ "filename": "lib/compliance.ts",
+ "line": 2863
+ },
+ "methods": [
+ {
+ "docs": {
+ "stability": "stable"
+ },
+ "locationInModule": {
+ "filename": "lib/compliance.ts",
+ "line": 2868
+ },
+ "name": "method",
+ "overrides": "jsii-calc.StaticHelloParent",
+ "static": true
+ }
+ ],
+ "name": "StaticHelloChild",
+ "properties": [
+ {
+ "docs": {
+ "stability": "stable"
+ },
+ "immutable": true,
+ "locationInModule": {
+ "filename": "lib/compliance.ts",
+ "line": 2864
+ },
+ "name": "property",
+ "overrides": "jsii-calc.StaticHelloParent",
+ "static": true,
+ "type": {
+ "primitive": "number"
+ }
+ }
+ ]
+ },
+ "jsii-calc.StaticHelloParent": {
+ "assembly": "jsii-calc",
+ "docs": {
+ "remarks": "The difference is fairly minor (for typical use-cases, the end result is the\nsame), however this has implications on what the generated code should look\nlike.",
+ "stability": "stable",
+ "summary": "Static methods that override parent class are technically overrides (the inheritance of statics is part of the ES6 specification), but certain other languages such as Java do not carry statics in the inheritance chain at all, so they cannot be overridden, only hidden."
+ },
+ "fqn": "jsii-calc.StaticHelloParent",
+ "initializer": {
+ "docs": {
+ "stability": "stable"
+ }
+ },
+ "kind": "class",
+ "locationInModule": {
+ "filename": "lib/compliance.ts",
+ "line": 2854
+ },
+ "methods": [
+ {
+ "docs": {
+ "stability": "stable"
+ },
+ "locationInModule": {
+ "filename": "lib/compliance.ts",
+ "line": 2859
+ },
+ "name": "method",
+ "static": true
+ }
+ ],
+ "name": "StaticHelloParent",
+ "properties": [
+ {
+ "docs": {
+ "stability": "stable"
+ },
+ "immutable": true,
+ "locationInModule": {
+ "filename": "lib/compliance.ts",
+ "line": 2855
+ },
+ "name": "property",
+ "static": true,
+ "type": {
+ "primitive": "number"
+ }
+ }
+ ]
+ },
"jsii-calc.Statics": {
"assembly": "jsii-calc",
"docs": {
@@ -14342,5 +14441,5 @@
}
},
"version": "0.0.0",
- "fingerprint": "55ZmA4GbUYPUmTXM2oFDEND8/Yk2Vzw1FThRWEOigAM="
+ "fingerprint": "8y6c87ScX7dJInuohtU3oLM8TCUz8yoYZ+j14fnHG9s="
}
diff --git a/packages/jsii-config/package.json b/packages/jsii-config/package.json
index e3e95b3ed9..5854c1f84c 100644
--- a/packages/jsii-config/package.json
+++ b/packages/jsii-config/package.json
@@ -20,11 +20,11 @@
},
"devDependencies": {
"@types/inquirer": "^7.3.1",
- "@types/jest": "^26.0.16",
+ "@types/jest": "^26.0.20",
"@types/jest-expect-message": "^1.0.3",
- "@types/node": "^10.17.48",
- "@types/yargs": "^15.0.11",
- "eslint": "^7.15.0",
+ "@types/node": "^10.17.50",
+ "@types/yargs": "^15.0.12",
+ "eslint": "^7.17.0",
"jest": "^26.6.3",
"jest-expect-message": "^1.0.2",
"prettier": "^2.2.1",
@@ -33,6 +33,6 @@
"dependencies": {
"@jsii/spec": "^0.0.0",
"inquirer": "^7.3.3",
- "yargs": "^16.1.1"
+ "yargs": "^16.2.0"
}
}
diff --git a/packages/jsii-diff/package.json b/packages/jsii-diff/package.json
index 370892e75e..0e89ae3085 100644
--- a/packages/jsii-diff/package.json
+++ b/packages/jsii-diff/package.json
@@ -38,16 +38,16 @@
"jsii-reflect": "^0.0.0",
"log4js": "^6.3.0",
"typescript": "~3.9.7",
- "yargs": "^16.1.1"
+ "yargs": "^16.2.0"
},
"devDependencies": {
"@types/fs-extra": "^8.1.1",
- "@types/jest": "^26.0.16",
+ "@types/jest": "^26.0.20",
"@types/jest-expect-message": "^1.0.3",
- "@types/node": "^10.17.48",
+ "@types/node": "^10.17.50",
"@types/tar-fs": "^2.0.0",
- "@types/yargs": "^15.0.11",
- "eslint": "^7.15.0",
+ "@types/yargs": "^15.0.12",
+ "eslint": "^7.17.0",
"jest": "^26.6.3",
"jest-expect-message": "^1.0.2",
"jsii": "^0.0.0",
diff --git a/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts
index 69d086ec59..9524d5ec03 100644
--- a/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts
+++ b/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts
@@ -163,14 +163,14 @@ export class DotNetGenerator extends Generator {
}
protected onEndInterface(ifc: spec.InterfaceType) {
+ // emit interface proxy class
+ this.emitInterfaceProxy(ifc);
+
const interfaceName = this.nameutils.convertInterfaceName(ifc);
this.code.closeBlock();
const namespace = this.namespaceFor(this.assembly, ifc);
this.closeFileIfNeeded(interfaceName, namespace, this.isNested(ifc));
- // emit interface proxy class
- this.emitInterfaceProxy(ifc);
-
// emit implementation class
// TODO: If datatype then we may not need the interface proxy to be created, We could do with just the interface impl?
if (ifc.datatype) {
@@ -361,14 +361,14 @@ export class DotNetGenerator extends Generator {
}
protected onEndClass(cls: spec.ClassType) {
+ if (cls.abstract) {
+ this.emitInterfaceProxy(cls);
+ }
+
this.code.closeBlock();
const className = this.nameutils.convertClassName(cls);
const namespace = this.namespaceFor(this.assembly, cls);
this.closeFileIfNeeded(className, namespace, this.isNested(cls));
-
- if (cls.abstract) {
- this.emitInterfaceProxy(cls);
- }
}
protected onField(
@@ -476,7 +476,7 @@ export class DotNetGenerator extends Generator {
const returnType = method.returns
? this.typeresolver.toDotNetType(method.returns.type)
: 'void';
- let staticKeyWord = '';
+ const staticKeyWord = method.static ? 'static ' : '';
let overrideKeyWord = '';
let virtualKeyWord = '';
@@ -496,12 +496,14 @@ export class DotNetGenerator extends Generator {
overrides = true;
}
}
- if (method.static) {
- staticKeyWord = 'static ';
- } else if (overrides) {
- // Add the override key word if the method is emitted for a proxy or data type or is defined on an ancestor
- overrideKeyWord = 'override ';
+ if (overrides) {
+ // Add the override key word if the method is emitted for a proxy or data type or is defined on an ancestor. If
+ // the member is static, use the "new" keyword instead, to indicate we are intentionally hiding the ancestor
+ // declaration (as C# does not inherit statics, they can be hidden but not overridden). The "new" keyword is
+ // optional in this context, but helps clarify intention.
+ overrideKeyWord = method.static ? 'new ' : 'override ';
} else if (
+ !method.static &&
(method.abstract || !definedOnAncestor) &&
!emitForProxyOrDatatype
) {
@@ -509,8 +511,10 @@ export class DotNetGenerator extends Generator {
// Methods should always be virtual when possible
virtualKeyWord = 'virtual ';
}
+
const access = this.renderAccessLevel(method);
const methodName = this.nameutils.convertMethodName(method.name);
+
const isOptional = method.returns && method.returns.optional ? '?' : '';
const signature = `${returnType}${isOptional} ${methodName}(${this.renderMethodParameters(
method,
@@ -635,19 +639,24 @@ export class DotNetGenerator extends Generator {
* Emits an interface proxy for an interface or an abstract class.
*/
private emitInterfaceProxy(ifc: spec.InterfaceType | spec.ClassType): void {
- // No need to slugify for a proxy
- const name = `${this.nameutils.convertTypeName(ifc.name)}Proxy`;
+ const name = '_Proxy';
const namespace = this.namespaceFor(this.assembly, ifc);
- const isNested = this.isNested(ifc);
+ const isNested = true;
this.openFileIfNeeded(name, namespace, isNested);
+ this.code.line();
this.dotnetDocGenerator.emitDocs(ifc);
this.dotnetRuntimeGenerator.emitAttributesForInterfaceProxy(ifc);
+
const interfaceFqn = this.typeresolver.toNativeFqn(ifc.fqn);
const suffix = spec.isInterfaceType(ifc)
? `: DeputyBase, ${interfaceFqn}`
: `: ${interfaceFqn}`;
- this.code.openBlock(`internal sealed class ${name} ${suffix}`);
+ const newModifier = this.proxyMustUseNewModifier(ifc) ? 'new ' : '';
+
+ this.code.openBlock(
+ `${newModifier}internal sealed class ${name} ${suffix}`,
+ );
// Create the private constructor
this.code.openBlock(
@@ -666,6 +675,46 @@ export class DotNetGenerator extends Generator {
this.closeFileIfNeeded(name, namespace, isNested);
}
+ /**
+ * Determines whether any ancestor of the given type must use the `new`
+ * modifier when introducing it's own proxy.
+ *
+ * If the type is a `class`, then it must use `new` if it extends another
+ * abstract class defined in the same assembly (since proxies are internal,
+ * external types' proxies are not visible in that context).
+ *
+ * If the type is an `interface`, then it must use `new` if it extends another
+ * interface from the same assembly.
+ *
+ * @param type the tested proxy-able type (an abstract class or an interface).
+ *
+ * @returns true if any ancestor of this type has a visible proxy.
+ */
+ private proxyMustUseNewModifier(
+ type: spec.ClassType | spec.InterfaceType,
+ ): boolean {
+ if (spec.isClassType(type)) {
+ if (type.base == null) {
+ return false;
+ }
+
+ const base = this.findType(type.base) as spec.ClassType;
+ return (
+ base.assembly === type.assembly &&
+ (base.abstract
+ ? true
+ : // An abstract class could extend a concrete class... We must walk up the inheritance tree in this case...
+ this.proxyMustUseNewModifier(base))
+ );
+ }
+
+ return (
+ type.interfaces?.find(
+ (fqn) => this.findType(fqn).assembly === type.assembly,
+ ) != null
+ );
+ }
+
/**
* Emits an Interface Datatype class
*
@@ -832,8 +881,11 @@ export class DotNetGenerator extends Generator {
prop,
);
if (implementedInBase || datatype || proxy) {
- // Override if the property is in a datatype or proxy class or declared in a parent class
- isOverrideKeyWord = 'override ';
+ // Override if the property is in a datatype or proxy class or declared in a parent class. If the member is
+ // static, use the "new" keyword instead, to indicate we are intentionally hiding the ancestor declaration (as
+ // C# does not inherit statics, they can be hidden but not overridden).The "new" keyword is optional in this
+ // context, but helps clarify intention.
+ isOverrideKeyWord = prop.static ? 'new ' : 'override ';
} else if (prop.abstract) {
// Abstract members get decorated as such
isAbstractKeyword = 'abstract ';
@@ -845,7 +897,7 @@ export class DotNetGenerator extends Generator {
const propTypeFQN = this.typeresolver.toDotNetType(prop.type);
const isOptional = prop.optional ? '?' : '';
- const statement = `${access} ${isAbstractKeyword}${isVirtualKeyWord}${isOverrideKeyWord}${staticKeyWord}${propTypeFQN}${isOptional} ${propName}`;
+ const statement = `${access} ${isAbstractKeyword}${isVirtualKeyWord}${staticKeyWord}${isOverrideKeyWord}${propTypeFQN}${isOptional} ${propName}`;
this.code.openBlock(statement);
// Emit getters
diff --git a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts
index 9055f67b40..929cc808f7 100644
--- a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts
+++ b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts
@@ -135,9 +135,21 @@ export class FileGenerator {
}
});
+ const warnings = rootNode.ele('PropertyGroup');
// Suppress warnings about [Obsolete] members, this is the author's choice!
- rootNode.ele('PropertyGroup').ele('NoWarn').text('0612,0618');
-
+ warnings.comment('Silence [Obsolete] warnings');
+ warnings.ele('NoWarn').text('0612,0618');
+ // Treat select warnings as errors, as these are likely codegen bugs:
+ warnings.comment(
+ 'Treat warnings symptomatic of code generation bugs as errors',
+ );
+ warnings.ele(
+ 'WarningsAsErrors',
+ [
+ '0108', // 'member1' hides inherited member 'member2'. Use the new keyword if hiding was intended.
+ '0109', // The member 'member' does not hide an inherited member. The new keyword is not required.
+ ].join(','),
+ );
const xml = rootNode.end({ pretty: true, spaceBeforeSlash: true });
// Sending the xml content to the codemaker to ensure the file is written
diff --git a/packages/jsii-pacmak/lib/targets/go/package.ts b/packages/jsii-pacmak/lib/targets/go/package.ts
index 7ae2127621..300717d0e5 100644
--- a/packages/jsii-pacmak/lib/targets/go/package.ts
+++ b/packages/jsii-pacmak/lib/targets/go/package.ts
@@ -221,7 +221,13 @@ export class RootPackage extends Package {
code.line(`go ${GO_VERSION}`);
code.line();
code.open('require (');
- code.line(`${JSII_RT_MODULE_NAME} v${this.assembly.jsiiVersion}`);
+ // Strip " (build abcdef)" from the jsii version
+ code.line(
+ `${JSII_RT_MODULE_NAME} v${this.assembly.jsiiVersion.replace(
+ / .*$/,
+ '',
+ )}`,
+ );
for (const dep of this.packageDependencies) {
code.line(`${dep.goModuleName} v${dep.version}`);
}
diff --git a/packages/jsii-pacmak/lib/targets/go/runtime/constants.ts b/packages/jsii-pacmak/lib/targets/go/runtime/constants.ts
index e4043e9d55..0285d73a3d 100644
--- a/packages/jsii-pacmak/lib/targets/go/runtime/constants.ts
+++ b/packages/jsii-pacmak/lib/targets/go/runtime/constants.ts
@@ -1,5 +1,5 @@
// JSII go runtime module name
-export const JSII_RT_MODULE_NAME = 'github.com/aws-cdk/jsii/jsii-experimental';
+export const JSII_RT_MODULE_NAME = 'github.com/aws/jsii-runtime-go';
export const JSII_RT_ALIAS = '_jsii_';
// Jsii initializer package name
diff --git a/packages/jsii-pacmak/lib/targets/java.ts b/packages/jsii-pacmak/lib/targets/java.ts
index aa7e7b2778..78185e5de3 100644
--- a/packages/jsii-pacmak/lib/targets/java.ts
+++ b/packages/jsii-pacmak/lib/targets/java.ts
@@ -1274,7 +1274,7 @@ class JavaGenerator extends Generator {
if (includeGetter) {
this.code.line();
this.addJavaDocs(prop);
- if (overrides) {
+ if (overrides && !prop.static) {
this.code.line('@Override');
}
this.emitStabilityAnnotations(prop);
@@ -1307,7 +1307,7 @@ class JavaGenerator extends Generator {
for (const type of setterTypes) {
this.code.line();
this.addJavaDocs(prop);
- if (overrides) {
+ if (overrides && !prop.static) {
this.code.line('@Override');
}
this.emitStabilityAnnotations(prop);
@@ -1364,7 +1364,7 @@ class JavaGenerator extends Generator {
this.code.line();
this.addJavaDocs(method);
this.emitStabilityAnnotations(method);
- if (overrides) {
+ if (overrides && !method.static) {
this.code.line('@Override');
}
if (method.abstract && !defaultImpl) {
diff --git a/packages/jsii-pacmak/lib/targets/python.ts b/packages/jsii-pacmak/lib/targets/python.ts
index cb22d01db2..0e8c730e95 100644
--- a/packages/jsii-pacmak/lib/targets/python.ts
+++ b/packages/jsii-pacmak/lib/targets/python.ts
@@ -1482,6 +1482,56 @@ class PythonModule implements PythonType {
code.line('publication.publish()');
}
+ /**
+ * Emit the bin scripts if bin section defined.
+ */
+ public emitBinScripts(code: CodeMaker): string[] {
+ const scripts = new Array();
+ if (this.loadAssembly) {
+ if (this.assembly.bin != null) {
+ for (const name of Object.keys(this.assembly.bin)) {
+ const script_file = path.join(
+ 'src',
+ pythonModuleNameToFilename(this.pythonName),
+ 'bin',
+ name,
+ );
+ code.openFile(script_file);
+ code.line('#!/usr/bin/env python');
+ code.line();
+ code.line('import jsii');
+ code.line('import sys');
+ code.line();
+ emitList(
+ code,
+ '__jsii_assembly__ = jsii.JSIIAssembly.load(',
+ [
+ JSON.stringify(this.assembly.name),
+ JSON.stringify(this.assembly.version),
+ JSON.stringify(this.pythonName.replace('._jsii', '')),
+ `${JSON.stringify(this.assemblyFilename)}`,
+ ],
+ ')',
+ );
+ code.line();
+ emitList(
+ code,
+ '__jsii_assembly__.invokeBinScript(',
+ [
+ JSON.stringify(this.assembly.name),
+ JSON.stringify(name),
+ 'sys.argv[1:]',
+ ],
+ ')',
+ );
+ code.closeFile(script_file);
+ scripts.push(script_file.replace(/\\/g, '/'));
+ }
+ }
+ }
+ return scripts;
+ }
+
/**
* Emit the README as module docstring if this is the entry point module (it loads the assembly)
*/
@@ -1635,6 +1685,8 @@ class Package {
a.pythonName.localeCompare(b.pythonName),
);
+ const scripts = new Array();
+
// Iterate over all of our modules, and write them out to disk.
for (const mod of modules) {
const filename = path.join(
@@ -1646,6 +1698,8 @@ class Package {
code.openFile(filename);
mod.emit(code, context);
code.closeFile(filename);
+
+ scripts.push(...mod.emitBinScripts(code));
}
// Handle our package data.
@@ -1725,6 +1779,7 @@ class Package {
'Programming Language :: Python :: 3.9',
'Typing :: Typed',
],
+ scripts,
};
switch (this.metadata.docs?.stability) {
diff --git a/packages/jsii-pacmak/package.json b/packages/jsii-pacmak/package.json
index 76b0d33121..5b3c590215 100644
--- a/packages/jsii-pacmak/package.json
+++ b/packages/jsii-pacmak/package.json
@@ -40,7 +40,7 @@
"@jsii/spec": "^0.0.0",
"clone": "^2.1.2",
"codemaker": "^0.0.0",
- "commonmark": "^0.29.2",
+ "commonmark": "^0.29.3",
"escape-string-regexp": "^4.0.0",
"fs-extra": "^9.0.1",
"jsii-reflect": "^0.0.0",
@@ -48,7 +48,7 @@
"semver": "^7.3.4",
"spdx-license-list": "^6.3.0",
"xmlbuilder": "^15.1.1",
- "yargs": "^16.1.1"
+ "yargs": "^16.2.0"
},
"devDependencies": {
"@jsii/dotnet-runtime": "^0.0.0",
@@ -57,11 +57,11 @@
"@types/clone": "^2.1.0",
"@types/commonmark": "^0.27.4",
"@types/fs-extra": "^8.1.1",
- "@types/jest": "^26.0.16",
- "@types/node": "^10.17.48",
+ "@types/jest": "^26.0.20",
+ "@types/node": "^10.17.50",
"@types/semver": "^7.3.4",
- "@types/yargs": "^15.0.11",
- "eslint": "^7.15.0",
+ "@types/yargs": "^15.0.12",
+ "eslint": "^7.17.0",
"jest": "^26.6.3",
"jsii-build-tools": "^0.0.0",
"jsii-calc": "^0.0.0",
diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.ts.snap
index 8feb75b5ba..abde1bc22a 100644
--- a/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.ts.snap
+++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.ts.snap
@@ -87,7 +87,10 @@ exports[`foo@1.2.3 depends on bar@^2.0.0-rc.42: /dotnet/Com.Acme.Foo/Com
+
0612,0618
+
+ 0108,0109
@@ -128,7 +131,7 @@ module foo
go 1.15
require (
- github.com/aws-cdk/jsii/jsii-experimental v1337.42.1337
+ github.com/aws/jsii-runtime-go v1337.42.1337
bar v2.0.0-rc.42
)
@@ -138,7 +141,7 @@ exports[`foo@1.2.3 depends on bar@^2.0.0-rc.42: /go/foo/jsii/jsii.go 1`]
package jsii
import (
- rt "github.com/aws-cdk/jsii/jsii-experimental"
+ rt "github.com/aws/jsii-runtime-go"
"sync"
// Initialization endpoints of dependencies
bar "/bar/jsii"
@@ -457,7 +460,8 @@ kwargs = json.loads(
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Typing :: Typed"
- ]
+ ],
+ "scripts": []
}
"""
)
@@ -584,7 +588,10 @@ exports[`foo@1.2.3 depends on bar@^4.5.6-pre.1337: /dotnet/Com.Acme.Foo/
+
0612,0618
+
+ 0108,0109
@@ -625,7 +632,7 @@ module foo
go 1.15
require (
- github.com/aws-cdk/jsii/jsii-experimental v1337.42.1337
+ github.com/aws/jsii-runtime-go v1337.42.1337
bar v4.5.6-pre.1337
)
@@ -635,7 +642,7 @@ exports[`foo@1.2.3 depends on bar@^4.5.6-pre.1337: /go/foo/jsii/jsii.go
package jsii
import (
- rt "github.com/aws-cdk/jsii/jsii-experimental"
+ rt "github.com/aws/jsii-runtime-go"
"sync"
// Initialization endpoints of dependencies
bar "/bar/jsii"
@@ -954,7 +961,8 @@ kwargs = json.loads(
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Typing :: Typed"
- ]
+ ],
+ "scripts": []
}
"""
)
@@ -1080,7 +1088,10 @@ exports[`foo@2.0.0-rc.42: /dotnet/Com.Acme.Foo/Com.Acme.Foo.csproj 1`] =
+
0612,0618
+
+ 0108,0109
@@ -1120,7 +1131,7 @@ module foo
go 1.15
require (
- github.com/aws-cdk/jsii/jsii-experimental v1337.42.1337
+ github.com/aws/jsii-runtime-go v1337.42.1337
)
`;
@@ -1129,7 +1140,7 @@ exports[`foo@2.0.0-rc.42: /go/foo/jsii/jsii.go 1`] = `
package jsii
import (
- rt "github.com/aws-cdk/jsii/jsii-experimental"
+ rt "github.com/aws/jsii-runtime-go"
"sync"
)
@@ -1429,7 +1440,8 @@ kwargs = json.loads(
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Typing :: Typed"
- ]
+ ],
+ "scripts": []
}
"""
)
@@ -1553,7 +1565,10 @@ exports[`foo@4.5.6-pre.1337: /dotnet/Com.Acme.Foo/Com.Acme.Foo.csproj 1`
+
0612,0618
+
+ 0108,0109
@@ -1593,7 +1608,7 @@ module foo
go 1.15
require (
- github.com/aws-cdk/jsii/jsii-experimental v1337.42.1337
+ github.com/aws/jsii-runtime-go v1337.42.1337
)
`;
@@ -1602,7 +1617,7 @@ exports[`foo@4.5.6-pre.1337: /go/foo/jsii/jsii.go 1`] = `
package jsii
import (
- rt "github.com/aws-cdk/jsii/jsii-experimental"
+ rt "github.com/aws/jsii-runtime-go"
"sync"
)
@@ -1902,7 +1917,8 @@ kwargs = json.loads(
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Typing :: Typed"
- ]
+ ],
+ "scripts": []
}
"""
)
diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap
index e3cf5c9e76..319f66a73f 100644
--- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap
+++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap
@@ -11,10 +11,7 @@ exports[`Generated code for "@scope/jsii-calc-base": / 1`] = `
┃ ┗━ 📁 BaseNamespace
┃ ┣━ 📄 Base.cs
┃ ┣━ 📄 BaseProps.cs
- ┃ ┣━ 📄 BasePropsProxy.cs
- ┃ ┣━ 📄 BaseProxy.cs
┃ ┣━ 📄 IBaseInterface.cs
- ┃ ┣━ 📄 IBaseInterfaceProxy.cs
┃ ┣━ 📄 IBaseProps.cs
┃ ┗━ 📁 Internal
┃ ┗━ 📁 DependencyResolution
@@ -56,7 +53,10 @@ exports[`Generated code for "@scope/jsii-calc-base": /dotnet/Amazon.JSII
+
0612,0618
+
+ 0108,0109
@@ -98,6 +98,15 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace
{
return InvokeInstanceMethod