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 - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + + + + + + +

AWS CDK Automation

🚧 👀

Aaron Costley

🐛 💻 🥅 🤔 👀

Abdallah Hodieb

🐛

Adam Ruka

🐛 💻 🚧 👀

Alex Pulver

🐛

Andy Slezak

💻

Anshul Guleria

🤔

Abdallah Hodieb

🐛

ajnarang

🤔

Alex Pulver

🐛

Andy Slezak

💻

Anshul Guleria

🤔

Ari Palo

🤔

Hamza Assyad

🐛 💻 🥅 🤔 👀

Ari Palo

🤔

Bartłomiej Jurek

🐛

Ben Walters

🤔

Benjamin Maizels

💻 👀

Bill Cauchois

🤔

Brecht Verhoeve

🤔

Breland Miley

💻

AWS CDK Automation

🚧 👀

Ben Walters

🤔

Bartłomiej Jurek

🐛

Benjamin Maizels

💻 👀

Brecht Verhoeve

🤔

CaerusKaru

💻 🚧

Campion Fellin

💻 ☕️

CaerusKaru

💻 🚧

Campion Fellin

💻 ☕️

Carter Van Deuren

🐛

Christopher Currie

💻 🤔

CyrusNajmabadi

🐛 🤔

Daniel Dinu

🐛 💻

Daniel Schroeder

🐛 💻 📖 🤔 🚧

Carter Van Deuren

🐛

Christopher Currie

💻 🤔

Raphael

🐛

Aaron Costley

🐛 💻 🥅 🤔 👀

CyrusNajmabadi

🐛 🤔

Dongie Agnir

💻 ☕️ 👀

Daniel Dinu

🐛 💻

Dave Slotnick

🐛

Donald Stufft

🐛 💻 🤔 🐍 👀

Dongie Agnir

💻 ☕️ 👀

Eduardo Sena S. Rosa

🐛

Elad Ben-Israel

🐛 💻 🤔 ☕️ 🚧 👀 📢

Eli Polonsky

🐛 💻 🤔 🚧 👀

Eric Z. Beard

📆

dependabot-preview[bot]

🐛 🚧

dependabot[bot]

🚧

dheffx

🐛

Shane Witbeck

🤔

Donald Stufft

🐛 💻 🤔 🐍 👀

Junix

🐛

Elad Ben-Israel

🐛 💻 🤔 ☕️ 🚧 👀 📢

Erik Karlsson

🐛

Eugene Kozlov

💻

Fabio Gentile

🐛

Florian Eitel

🤔

Graham Lea

🤔 👀

Hamza Assyad

🐛 💻 🥅 🤔 👀

Hari Pachuveetil

📝

Eric Z. Beard

📆

Fabio Gentile

🐛

James Mead

💻

Jason Fulghum

🤔 📆 👀

Mitch Garnaat

🐛 💻 🤔 🐍 👀

The Gitter Badger

💻 🚧

Graham Lea

🤔 👀

Hsing-Hui Hsu

💻 📖 🚶‍♀️ 🤔 👀

James Mead

💻

James Siri

💻 🚧

Jason Del Ponte

🚶‍♀️ 🤔 👀

Jason Fulghum

🤔 📆 👀

Jerry Kindall

📖 🤔

Jimmy Gaussen

🤔

gregswdl

🐛

Thorsten Hoeger

💻

Eli Polonsky

🐛 💻 🤔 🚧 👀

James Siri

💻 🚧

Jason Del Ponte

🚶‍♀️ 🤔 👀

Jerry Kindall

📖 🤔

Joseph Lawson

👀

Jon Steinich

🐛 🤔

Joseph Lawson

👀

Joseph Martin

🐛

Junix

🐛

Justin Taylor

🐛

Kyle Thomson

☕️ 👀

Leandro Padua

🐛

Joseph Martin

🐛

Justin Taylor

🐛

Jon Steinich

🐛 🤔 💻

Quentin Loos

🤔

Kyle Thomson

☕️ 👀

Eugene Kozlov

💻

Vladimir Shchur

🐛

Maja S Bratseth

🐛

Marcos Diez

🐛

Matthew Bonig

🐛 📝

Matthew Pirocchi

💻 🥅 🤔 👀

Mike Lane

🐛

Mitch Garnaat

🐛 💻 🤔 🐍 👀

Mitchell Valine

🐛 💻 🚶‍♀️ 🤔 🚧 👀

Leandro Padua

🐛

Marcos Diez

🐛

Matthew Bonig

🐛 📝

Erik Karlsson

🐛

mergify[bot]

🚧

Mike Lane

🐛

Breland Miley

💻

Neta Nir

💻 🤔 🚧 👀

Nick Lynch

🐛 💻 🚧 👀

Niranjan Jayakar

🐛 💻 🤔 🚧 👀

Noah Litov

💻 🚧 👀

PIDZ - Bart

🤔

Petra Barus

💻

Philip Cali

🤔

Matthew Pirocchi

💻 🥅 🤔 👀

Mitchell Valine

🐛 💻 🚶‍♀️ 🤔 🚧 👀

Neta Nir

💻 🤔 🚧 👀

Noah Litov

💻 🚧 👀

Niranjan Jayakar

🐛 💻 🤔 🚧 👀

Nick Lynch

🐛 💻 🚧 👀

Jimmy Gaussen

🤔

Quentin Loos

🤔

Raphael

🐛

Richard H Boyd

🐛

Rico Huijbers

🐛 💻 🤔 🚧 🐍 👀

Romain Marcadier

🐛 💻 🎨 🥅 🚶‍♀️ 🤔 ☕️ 🚧 🐍 👀

SADIK KUZU

👀

SK

🤔

Petra Barus

💻

Philip Cali

🤔

PIDZ - Bart

🤔

Richard H Boyd

🐛

Rico Huijbers

🐛 💻 🤔 🚧 🐍 👀

Romain Marcadier

🐛 💻 🎨 🥅 🚶‍♀️ 🤔 ☕️ 🚧 🐍 👀 📝

SADIK KUZU

👀

Sam Fink

💻 👀

Sam Goodwin

👀

Sebastian Korfmann

🐛 💻 🤔

Shane Witbeck

🤔

Shiv Lakshminarayan

💻 🚧 👀

Somaya

💻 🤔 🚧 👀

The Gitter Badger

💻 🚧

Sam Goodwin

👀

seiyashima42

🐛 💻 📖

Tim Wagner

🐛 🤔

Shiv Lakshminarayan

💻 🚧 👀

SK

🤔

Adam Ruka

🐛 💻 🚧 👀

Sebastian Korfmann

🐛 💻 🤔

Thomas Poignant

🐛

Thomas Steinbach

🐛

Thorsten Hoeger

💻

Tim Wagner

🐛 🤔

Tobias Lidskog

💻

Ty Coghlan

🐛

Tyler van Hensbergen

🤔

Hsing-Hui Hsu

💻 📖 🚶‍♀️ 🤔 👀

Somaya

💻 🤔 🚧 👀

Sam Fink

💻 👀

sullis

💻

Thomas Poignant

🐛

Tobias Lidskog

💻

Tyler van Hensbergen

🤔

Vlad Hrybok

🐛

Vladimir Shchur

🐛

Yan Zhulanow

💻

ajnarang

🤔

deccy-mcc

🐛

dependabot-preview[bot]

🐛 🚧

dependabot[bot]

🚧

Daniel Schroeder

🐛 💻 📖 🤔 🚧

vaneek

🐛

Vlad Hrybok

🐛

Bill Cauchois

🤔

Florian Eitel

🤔

Yan Zhulanow

💻

Eduardo Sena S. Rosa

🐛

dheffx

🐛

gregswdl

🐛

mergify[bot]

🚧

seiyashima42

🐛 💻 📖

sullis

💻

vaneek

🐛

Hari Pachuveetil

📝 📖

deccy-mcc

🐛

Thomas Steinbach

🐛

Ty Coghlan

🐛

Dave Slotnick

🐛

Maja S Bratseth

🐛

Ben Bridts

📖

Mohamad Soufan

📖

Christopher Rybicki

📖

Benjamin Macher

📖
- + - 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(new System.Type[]{}, new object[]{})!; } + + /// A base class. + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace.Base), fullyQualifiedName: "@scope/jsii-calc-base.Base")] + internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace.Base + { + private _Proxy(ByRefValue reference): base(reference) + { + } + } } } @@ -133,55 +142,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace `; -exports[`Generated code for "@scope/jsii-calc-base": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BasePropsProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IBaseProps), fullyQualifiedName: "@scope/jsii-calc-base.BaseProps")] - internal sealed class BasePropsProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace.IBaseProps - { - private BasePropsProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Bar - { - get => GetInstanceProperty()!; - } - - [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-base-of-base.Very\\"}")] - public Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.Very Foo - { - get => GetInstanceProperty()!; - } - } -} - -`; - -exports[`Generated code for "@scope/jsii-calc-base": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BaseProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace -{ - /// A base class. - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace.Base), fullyQualifiedName: "@scope/jsii-calc-base.Base")] - internal sealed class BaseProxy : Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace.Base - { - private BaseProxy(ByRefValue reference): base(reference) - { - } - } -} - -`; - exports[`Generated code for "@scope/jsii-calc-base": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/IBaseInterface.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -194,35 +154,25 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace { [JsiiMethod(name: "bar")] void Bar(); - } -} - -`; - -exports[`Generated code for "@scope/jsii-calc-base": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/IBaseInterfaceProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IBaseInterface), fullyQualifiedName: "@scope/jsii-calc-base.IBaseInterface")] - internal sealed class IBaseInterfaceProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace.IBaseInterface - { - private IBaseInterfaceProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IBaseInterface), fullyQualifiedName: "@scope/jsii-calc-base.IBaseInterface")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace.IBaseInterface { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "bar")] - public void Bar() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); - } + [JsiiMethod(name: "bar")] + public void Bar() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } - [JsiiMethod(name: "foo")] - public void Foo() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + [JsiiMethod(name: "foo")] + public void Foo() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } } } } @@ -244,6 +194,26 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace { get; } + + [JsiiTypeProxy(nativeType: typeof(IBaseProps), fullyQualifiedName: "@scope/jsii-calc-base.BaseProps")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace.IBaseProps + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Bar + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-base-of-base.Very\\"}")] + public Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.Very Foo + { + get => GetInstanceProperty()!; + } + } } } @@ -287,12 +257,10 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` ┃ ┃ ┗━ 📁 DependencyResolution ┃ ┃ ┗━ 📄 Anchor.cs ┃ ┣━ 📄 IVeryBaseInterface.cs - ┃ ┣━ 📄 IVeryBaseInterfaceProxy.cs ┃ ┣━ 📄 IVeryBaseProps.cs ┃ ┣━ 📄 StaticConsumer.cs ┃ ┣━ 📄 Very.cs - ┃ ┣━ 📄 VeryBaseProps.cs - ┃ ┗━ 📄 VeryBasePropsProxy.cs + ┃ ┗━ 📄 VeryBaseProps.cs ┣━ 📄 Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId.csproj ┣━ 📄 AssemblyInfo.cs ┗━ 📄 scope-jsii-calc-base-of-base-0.0.0.tgz @@ -329,7 +297,10 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": /dotnet/Ama + 0612,0618 + + 0108,0109 @@ -348,29 +319,19 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace { [JsiiMethod(name: "foo")] void Foo(); - } -} - -`; - -exports[`Generated code for "@scope/jsii-calc-base-of-base": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/IVeryBaseInterfaceProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IVeryBaseInterface), fullyQualifiedName: "@scope/jsii-calc-base-of-base.IVeryBaseInterface")] - internal sealed class IVeryBaseInterfaceProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.IVeryBaseInterface - { - private IVeryBaseInterfaceProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IVeryBaseInterface), fullyQualifiedName: "@scope/jsii-calc-base-of-base.IVeryBaseInterface")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.IVeryBaseInterface { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "foo")] - public void Foo() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + [JsiiMethod(name: "foo")] + public void Foo() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } } } } @@ -392,6 +353,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace { get; } + + [JsiiTypeProxy(nativeType: typeof(IVeryBaseProps), fullyQualifiedName: "@scope/jsii-calc-base-of-base.VeryBaseProps")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.IVeryBaseProps + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-base-of-base.Very\\"}")] + public Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.Very Foo + { + get => GetInstanceProperty()!; + } + } } } @@ -514,30 +489,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace `; -exports[`Generated code for "@scope/jsii-calc-base-of-base": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/VeryBasePropsProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IVeryBaseProps), fullyQualifiedName: "@scope/jsii-calc-base-of-base.VeryBaseProps")] - internal sealed class VeryBasePropsProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.IVeryBaseProps - { - private VeryBasePropsProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-base-of-base.Very\\"}")] - public Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.Very Foo - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "@scope/jsii-calc-base-of-base": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/AssemblyInfo.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -558,32 +509,23 @@ exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` ┃ ┃ ┗━ 📁 LibNamespace ┃ ┃ ┣━ 📄 EnumFromScopedModule.cs ┃ ┃ ┣━ 📄 IDoublable.cs - ┃ ┃ ┣━ 📄 IDoublableProxy.cs ┃ ┃ ┣━ 📄 IFriendly.cs - ┃ ┃ ┣━ 📄 IFriendlyProxy.cs ┃ ┃ ┣━ 📄 IMyFirstStruct.cs ┃ ┃ ┣━ 📁 Internal ┃ ┃ ┃ ┗━ 📁 DependencyResolution ┃ ┃ ┃ ┗━ 📄 Anchor.cs ┃ ┃ ┣━ 📄 IStructWithOnlyOptionals.cs ┃ ┃ ┣━ 📄 IThreeLevelsInterface.cs - ┃ ┃ ┣━ 📄 IThreeLevelsInterfaceProxy.cs ┃ ┃ ┣━ 📄 MyFirstStruct.cs - ┃ ┃ ┣━ 📄 MyFirstStructProxy.cs ┃ ┃ ┣━ 📄 Number.cs ┃ ┃ ┣━ 📄 NumericValue.cs - ┃ ┃ ┣━ 📄 NumericValueProxy.cs ┃ ┃ ┣━ 📄 Operation.cs - ┃ ┃ ┣━ 📄 OperationProxy.cs - ┃ ┃ ┣━ 📄 StructWithOnlyOptionals.cs - ┃ ┃ ┗━ 📄 StructWithOnlyOptionalsProxy.cs + ┃ ┃ ┗━ 📄 StructWithOnlyOptionals.cs ┃ ┗━ 📁 CustomSubmoduleName ┃ ┣━ 📄 IReflectable.cs ┃ ┣━ 📄 IReflectableEntry.cs - ┃ ┣━ 📄 IReflectableProxy.cs ┃ ┣━ 📄 NestingClass.cs ┃ ┣━ 📄 ReflectableEntry.cs - ┃ ┣━ 📄 ReflectableEntryProxy.cs ┃ ┗━ 📄 Reflector.cs ┣━ 📄 Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj ┣━ 📄 AssemblyInfo.cs @@ -623,7 +565,10 @@ exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII. + 0612,0618 + + 0108,0109 @@ -688,38 +633,28 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { get; } - } -} - -`; - -exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IDoublableProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace -{ - /// (deprecated) The general contract for a concrete number. - /// - /// Stability: Deprecated - /// - [JsiiTypeProxy(nativeType: typeof(IDoublable), fullyQualifiedName: "@scope/jsii-calc-lib.IDoublable")] - [System.Obsolete()] - internal sealed class IDoublableProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IDoublable - { - private IDoublableProxy(ByRefValue reference): base(reference) - { - } + /// (deprecated) The general contract for a concrete number. /// /// Stability: Deprecated /// - [JsiiProperty(name: "doubleValue", typeJson: "{\\"primitive\\":\\"number\\"}")] + [JsiiTypeProxy(nativeType: typeof(IDoublable), fullyQualifiedName: "@scope/jsii-calc-lib.IDoublable")] [System.Obsolete()] - public double DoubleValue + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IDoublable { - get => GetInstanceProperty()!; + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// + /// Stability: Deprecated + /// + [JsiiProperty(name: "doubleValue", typeJson: "{\\"primitive\\":\\"number\\"}")] + [System.Obsolete()] + public double DoubleValue + { + get => GetInstanceProperty()!; + } } } } @@ -751,42 +686,32 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] [System.Obsolete()] string Hello(); - } -} -`; - -exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IFriendlyProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace -{ - /// (deprecated) Applies to classes that are considered friendly. - /// - /// These classes can be greeted with - /// a "hello" or "goodbye" blessing and they will respond back in a fun and friendly manner. - /// - /// Stability: Deprecated - /// - [JsiiTypeProxy(nativeType: typeof(IFriendly), fullyQualifiedName: "@scope/jsii-calc-lib.IFriendly")] - [System.Obsolete()] - internal sealed class IFriendlyProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly - { - private IFriendlyProxy(ByRefValue reference): base(reference) - { - } - - /// (deprecated) Say hello! + /// (deprecated) Applies to classes that are considered friendly. /// + /// These classes can be greeted with + /// a "hello" or "goodbye" blessing and they will respond back in a fun and friendly manner. + /// /// Stability: Deprecated /// - [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] + [JsiiTypeProxy(nativeType: typeof(IFriendly), fullyQualifiedName: "@scope/jsii-calc-lib.IFriendly")] [System.Obsolete()] - public string Hello() + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// (deprecated) Say hello! + /// + /// Stability: Deprecated + /// + [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] + [System.Obsolete()] + public string Hello() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } } } } @@ -843,6 +768,52 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace return null; } } + + /// (deprecated) This is the first struct we have created in jsii. + /// + /// Stability: Deprecated + /// + [JsiiTypeProxy(nativeType: typeof(IMyFirstStruct), fullyQualifiedName: "@scope/jsii-calc-lib.MyFirstStruct")] + [System.Obsolete()] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IMyFirstStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// (deprecated) An awesome number value. + /// + /// Stability: Deprecated + /// + [JsiiProperty(name: "anumber", typeJson: "{\\"primitive\\":\\"number\\"}")] + [System.Obsolete()] + public double Anumber + { + get => GetInstanceProperty()!; + } + + /// (deprecated) A string value. + /// + /// Stability: Deprecated + /// + [JsiiProperty(name: "astring", typeJson: "{\\"primitive\\":\\"string\\"}")] + [System.Obsolete()] + public string Astring + { + get => GetInstanceProperty()!; + } + + /// + /// Stability: Deprecated + /// + [JsiiOptional] + [JsiiProperty(name: "firstOptional", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"string\\"},\\"kind\\":\\"array\\"}}", isOptional: true)] + [System.Obsolete()] + public string[]? FirstOptional + { + get => GetInstanceProperty(); + } + } } } @@ -905,6 +876,53 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace return null; } } + + /// (deprecated) This is a struct with only optional properties. + /// + /// Stability: Deprecated + /// + [JsiiTypeProxy(nativeType: typeof(IStructWithOnlyOptionals), fullyQualifiedName: "@scope/jsii-calc-lib.StructWithOnlyOptionals")] + [System.Obsolete()] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IStructWithOnlyOptionals + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// (deprecated) The first optional! + /// + /// Stability: Deprecated + /// + [JsiiOptional] + [JsiiProperty(name: "optional1", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + [System.Obsolete()] + public string? Optional1 + { + get => GetInstanceProperty(); + } + + /// + /// Stability: Deprecated + /// + [JsiiOptional] + [JsiiProperty(name: "optional2", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] + [System.Obsolete()] + public double? Optional2 + { + get => GetInstanceProperty(); + } + + /// + /// Stability: Deprecated + /// + [JsiiOptional] + [JsiiProperty(name: "optional3", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] + [System.Obsolete()] + public bool? Optional3 + { + get => GetInstanceProperty(); + } + } } } @@ -934,53 +952,43 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace [JsiiMethod(name: "baz")] [System.Obsolete()] void Baz(); - } -} - -`; - -exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IThreeLevelsInterfaceProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace -{ - /// (deprecated) Interface that inherits from packages 2 levels up the tree. - /// - /// Their presence validates that .NET/Java/jsii-reflect can track all fields - /// far enough up the tree. - /// - /// Stability: Deprecated - /// - [JsiiTypeProxy(nativeType: typeof(IThreeLevelsInterface), fullyQualifiedName: "@scope/jsii-calc-lib.IThreeLevelsInterface")] - [System.Obsolete()] - internal sealed class IThreeLevelsInterfaceProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IThreeLevelsInterface - { - private IThreeLevelsInterfaceProxy(ByRefValue reference): base(reference) - { - } + /// (deprecated) Interface that inherits from packages 2 levels up the tree. /// + /// Their presence validates that .NET/Java/jsii-reflect can track all fields + /// far enough up the tree. + /// /// Stability: Deprecated /// - [JsiiMethod(name: "baz")] + [JsiiTypeProxy(nativeType: typeof(IThreeLevelsInterface), fullyQualifiedName: "@scope/jsii-calc-lib.IThreeLevelsInterface")] [System.Obsolete()] - public void Baz() + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IThreeLevelsInterface { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "bar")] - public void Bar() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); - } + /// + /// Stability: Deprecated + /// + [JsiiMethod(name: "baz")] + [System.Obsolete()] + public void Baz() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } - [JsiiMethod(name: "foo")] - public void Foo() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + [JsiiMethod(name: "bar")] + public void Bar() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } + + [JsiiMethod(name: "foo")] + public void Foo() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } } } } @@ -1060,62 +1068,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace `; -exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace -{ - /// (deprecated) This is the first struct we have created in jsii. - /// - /// Stability: Deprecated - /// - [JsiiTypeProxy(nativeType: typeof(IMyFirstStruct), fullyQualifiedName: "@scope/jsii-calc-lib.MyFirstStruct")] - [System.Obsolete()] - internal sealed class MyFirstStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IMyFirstStruct - { - private MyFirstStructProxy(ByRefValue reference): base(reference) - { - } - - /// (deprecated) An awesome number value. - /// - /// Stability: Deprecated - /// - [JsiiProperty(name: "anumber", typeJson: "{\\"primitive\\":\\"number\\"}")] - [System.Obsolete()] - public double Anumber - { - get => GetInstanceProperty()!; - } - - /// (deprecated) A string value. - /// - /// Stability: Deprecated - /// - [JsiiProperty(name: "astring", typeJson: "{\\"primitive\\":\\"string\\"}")] - [System.Obsolete()] - public string Astring - { - get => GetInstanceProperty()!; - } - - /// - /// Stability: Deprecated - /// - [JsiiOptional] - [JsiiProperty(name: "firstOptional", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"string\\"},\\"kind\\":\\"array\\"}}", isOptional: true)] - [System.Obsolete()] - public string[]? FirstOptional - { - get => GetInstanceProperty(); - } - } -} - -`; - exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Number.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -1237,39 +1189,29 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { get; } - } -} - -`; - -exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/NumericValueProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace -{ - /// (deprecated) Abstract class which represents a numeric value. - /// - /// Stability: Deprecated - /// - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue), fullyQualifiedName: "@scope/jsii-calc-lib.NumericValue")] - [System.Obsolete()] - internal sealed class NumericValueProxy : Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue - { - private NumericValueProxy(ByRefValue reference): base(reference) - { - } - /// (deprecated) The value. + /// (deprecated) Abstract class which represents a numeric value. /// /// Stability: Deprecated /// - [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"number\\"}")] + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue), fullyQualifiedName: "@scope/jsii-calc-lib.NumericValue")] [System.Obsolete()] - public override double Value + internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue { - get => GetInstanceProperty()!; + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// (deprecated) The value. + /// + /// Stability: Deprecated + /// + [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"number\\"}")] + [System.Obsolete()] + public override double Value + { + get => GetInstanceProperty()!; + } } } } @@ -1317,50 +1259,40 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace [System.Obsolete()] public override abstract string ToString(); - } -} - -`; - -exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/OperationProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace -{ - /// (deprecated) Represents an operation on values. - /// - /// Stability: Deprecated - /// - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Operation), fullyQualifiedName: "@scope/jsii-calc-lib.Operation")] - [System.Obsolete()] - internal sealed class OperationProxy : Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Operation - { - private OperationProxy(ByRefValue reference): base(reference) - { - } - /// (deprecated) The value. + /// (deprecated) Represents an operation on values. /// /// Stability: Deprecated /// - [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"number\\"}")] + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Operation), fullyQualifiedName: "@scope/jsii-calc-lib.Operation")] [System.Obsolete()] - public override double Value + new internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Operation { - get => GetInstanceProperty()!; - } + private _Proxy(ByRefValue reference): base(reference) + { + } - /// (deprecated) String representation of the value. - /// - /// Stability: Deprecated - /// - [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] - [System.Obsolete()] - public override string ToString() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + /// (deprecated) The value. + /// + /// Stability: Deprecated + /// + [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"number\\"}")] + [System.Obsolete()] + public override double Value + { + get => GetInstanceProperty()!; + } + + /// (deprecated) String representation of the value. + /// + /// Stability: Deprecated + /// + [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + [System.Obsolete()] + public override string ToString() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } } } } @@ -1422,85 +1354,50 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace `; -exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionalsProxy.cs 1`] = ` +exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CustomSubmoduleName/IReflectable.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace +namespace Amazon.JSII.Tests.CustomSubmoduleName { - /// (deprecated) This is a struct with only optional properties. /// /// Stability: Deprecated /// - [JsiiTypeProxy(nativeType: typeof(IStructWithOnlyOptionals), fullyQualifiedName: "@scope/jsii-calc-lib.StructWithOnlyOptionals")] + [JsiiInterface(nativeType: typeof(IReflectable), fullyQualifiedName: "@scope/jsii-calc-lib.submodule.IReflectable")] [System.Obsolete()] - internal sealed class StructWithOnlyOptionalsProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IStructWithOnlyOptionals + public interface IReflectable { - private StructWithOnlyOptionalsProxy(ByRefValue reference): base(reference) - { - } - - /// (deprecated) The first optional! - /// - /// Stability: Deprecated - /// - [JsiiOptional] - [JsiiProperty(name: "optional1", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - [System.Obsolete()] - public string? Optional1 - { - get => GetInstanceProperty(); - } - /// /// Stability: Deprecated /// - [JsiiOptional] - [JsiiProperty(name: "optional2", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] + [JsiiProperty(name: "entries", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"@scope/jsii-calc-lib.submodule.ReflectableEntry\\"},\\"kind\\":\\"array\\"}}")] [System.Obsolete()] - public double? Optional2 + Amazon.JSII.Tests.CustomSubmoduleName.IReflectableEntry[] Entries { - get => GetInstanceProperty(); + get; } /// /// Stability: Deprecated /// - [JsiiOptional] - [JsiiProperty(name: "optional3", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] + [JsiiTypeProxy(nativeType: typeof(IReflectable), fullyQualifiedName: "@scope/jsii-calc-lib.submodule.IReflectable")] [System.Obsolete()] - public bool? Optional3 + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CustomSubmoduleName.IReflectable { - get => GetInstanceProperty(); - } - } -} - -`; - -exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CustomSubmoduleName/IReflectable.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 + private _Proxy(ByRefValue reference): base(reference) + { + } -namespace Amazon.JSII.Tests.CustomSubmoduleName -{ - /// - /// Stability: Deprecated - /// - [JsiiInterface(nativeType: typeof(IReflectable), fullyQualifiedName: "@scope/jsii-calc-lib.submodule.IReflectable")] - [System.Obsolete()] - public interface IReflectable - { - /// - /// Stability: Deprecated - /// - [JsiiProperty(name: "entries", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"@scope/jsii-calc-lib.submodule.ReflectableEntry\\"},\\"kind\\":\\"array\\"}}")] - [System.Obsolete()] - Amazon.JSII.Tests.CustomSubmoduleName.IReflectableEntry[] Entries - { - get; + /// + /// Stability: Deprecated + /// + [JsiiProperty(name: "entries", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"@scope/jsii-calc-lib.submodule.ReflectableEntry\\"},\\"kind\\":\\"array\\"}}")] + [System.Obsolete()] + public Amazon.JSII.Tests.CustomSubmoduleName.IReflectableEntry[] Entries + { + get => GetInstanceProperty()!; + } } } } @@ -1540,37 +1437,37 @@ namespace Amazon.JSII.Tests.CustomSubmoduleName { get; } - } -} - -`; - -exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CustomSubmoduleName/IReflectableProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; -#pragma warning disable CS0672,CS0809,CS1591 + /// + /// Stability: Deprecated + /// + [JsiiTypeProxy(nativeType: typeof(IReflectableEntry), fullyQualifiedName: "@scope/jsii-calc-lib.submodule.ReflectableEntry")] + [System.Obsolete()] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CustomSubmoduleName.IReflectableEntry + { + private _Proxy(ByRefValue reference): base(reference) + { + } -namespace Amazon.JSII.Tests.CustomSubmoduleName -{ - /// - /// Stability: Deprecated - /// - [JsiiTypeProxy(nativeType: typeof(IReflectable), fullyQualifiedName: "@scope/jsii-calc-lib.submodule.IReflectable")] - [System.Obsolete()] - internal sealed class IReflectableProxy : DeputyBase, Amazon.JSII.Tests.CustomSubmoduleName.IReflectable - { - private IReflectableProxy(ByRefValue reference): base(reference) - { - } + /// + /// Stability: Deprecated + /// + [JsiiProperty(name: "key", typeJson: "{\\"primitive\\":\\"string\\"}")] + [System.Obsolete()] + public string Key + { + get => GetInstanceProperty()!; + } - /// - /// Stability: Deprecated - /// - [JsiiProperty(name: "entries", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"@scope/jsii-calc-lib.submodule.ReflectableEntry\\"},\\"kind\\":\\"array\\"}}")] - [System.Obsolete()] - public Amazon.JSII.Tests.CustomSubmoduleName.IReflectableEntry[] Entries - { - get => GetInstanceProperty()!; + /// + /// Stability: Deprecated + /// + [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"any\\"}")] + [System.Obsolete()] + public object Value + { + get => GetInstanceProperty()!; + } } } } @@ -1666,29 +1563,30 @@ namespace Amazon.JSII.Tests.CustomSubmoduleName { get; } - } - /// (deprecated) This is a struct, nested within a class. - /// - /// Normal. - /// - /// Stability: Deprecated - /// - [JsiiTypeProxy(nativeType: typeof(INestedStruct), fullyQualifiedName: "@scope/jsii-calc-lib.submodule.NestingClass.NestedStruct")] - [System.Obsolete()] - internal sealed class NestedStructProxy : DeputyBase, Amazon.JSII.Tests.CustomSubmoduleName.NestingClass.INestedStruct - { - private NestedStructProxy(ByRefValue reference): base(reference) - { - } + /// (deprecated) This is a struct, nested within a class. /// + /// Normal. + /// /// Stability: Deprecated /// - [JsiiProperty(name: "name", typeJson: "{\\"primitive\\":\\"string\\"}")] + [JsiiTypeProxy(nativeType: typeof(INestedStruct), fullyQualifiedName: "@scope/jsii-calc-lib.submodule.NestingClass.NestedStruct")] [System.Obsolete()] - public string Name + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CustomSubmoduleName.NestingClass.INestedStruct { - get => GetInstanceProperty()!; + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// + /// Stability: Deprecated + /// + [JsiiProperty(name: "name", typeJson: "{\\"primitive\\":\\"string\\"}")] + [System.Obsolete()] + public string Name + { + get => GetInstanceProperty()!; + } } } #pragma warning disable CS8618 @@ -1759,48 +1657,6 @@ namespace Amazon.JSII.Tests.CustomSubmoduleName `; -exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CustomSubmoduleName/ReflectableEntryProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CustomSubmoduleName -{ - /// - /// Stability: Deprecated - /// - [JsiiTypeProxy(nativeType: typeof(IReflectableEntry), fullyQualifiedName: "@scope/jsii-calc-lib.submodule.ReflectableEntry")] - [System.Obsolete()] - internal sealed class ReflectableEntryProxy : DeputyBase, Amazon.JSII.Tests.CustomSubmoduleName.IReflectableEntry - { - private ReflectableEntryProxy(ByRefValue reference): base(reference) - { - } - - /// - /// Stability: Deprecated - /// - [JsiiProperty(name: "key", typeJson: "{\\"primitive\\":\\"string\\"}")] - [System.Obsolete()] - public string Key - { - get => GetInstanceProperty()!; - } - - /// - /// Stability: Deprecated - /// - [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"any\\"}")] - [System.Obsolete()] - public object Value - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CustomSubmoduleName/Reflector.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -1872,11 +1728,8 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┗━ 📁 CalculatorNamespace ┃ ┣━ 📄 AbstractClass.cs ┃ ┣━ 📄 AbstractClassBase.cs - ┃ ┣━ 📄 AbstractClassBaseProxy.cs - ┃ ┣━ 📄 AbstractClassProxy.cs ┃ ┣━ 📄 AbstractClassReturner.cs ┃ ┣━ 📄 AbstractSuite.cs - ┃ ┣━ 📄 AbstractSuiteProxy.cs ┃ ┣━ 📄 Add.cs ┃ ┣━ 📄 AllowedMethodNames.cs ┃ ┣━ 📄 AllTypes.cs @@ -1888,14 +1741,10 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 BaseJsii976.cs ┃ ┣━ 📄 Bell.cs ┃ ┣━ 📄 BinaryOperation.cs - ┃ ┣━ 📄 BinaryOperationProxy.cs ┃ ┣━ 📄 BurriedAnonymousObject.cs - ┃ ┣━ 📄 BurriedAnonymousObjectProxy.cs ┃ ┣━ 📄 Calculator.cs ┃ ┣━ 📄 CalculatorProps.cs - ┃ ┣━ 📄 CalculatorPropsProxy.cs ┃ ┣━ 📄 ChildStruct982.cs - ┃ ┣━ 📄 ChildStruct982Proxy.cs ┃ ┣━ 📄 ClassThatImplementsTheInternalInterface.cs ┃ ┣━ 📄 ClassThatImplementsThePrivateInterface.cs ┃ ┣━ 📄 ClassWithCollections.cs @@ -1904,11 +1753,9 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 ClassWithMutableObjectLiteralProperty.cs ┃ ┣━ 📄 ClassWithPrivateConstructorAndAutomaticProperties.cs ┃ ┣━ 📁 Composition - ┃ ┃ ┣━ 📄 CompositeOperation.cs - ┃ ┃ ┗━ 📄 CompositeOperationProxy.cs + ┃ ┃ ┗━ 📄 CompositeOperation.cs ┃ ┣━ 📄 ConfusingToJackson.cs ┃ ┣━ 📄 ConfusingToJacksonStruct.cs - ┃ ┣━ 📄 ConfusingToJacksonStructProxy.cs ┃ ┣━ 📄 ConstructorPassesThisOut.cs ┃ ┣━ 📄 Constructors.cs ┃ ┣━ 📄 ConsumePureInterface.cs @@ -1920,20 +1767,14 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 DeprecatedClass.cs ┃ ┣━ 📄 DeprecatedEnum.cs ┃ ┣━ 📄 DeprecatedStruct.cs - ┃ ┣━ 📄 DeprecatedStructProxy.cs ┃ ┣━ 📁 DerivedClassHasNoProperties ┃ ┃ ┣━ 📄 Base.cs ┃ ┃ ┗━ 📄 Derived.cs ┃ ┣━ 📄 DerivedStruct.cs - ┃ ┣━ 📄 DerivedStructProxy.cs ┃ ┣━ 📄 DiamondInheritanceBaseLevelStruct.cs - ┃ ┣━ 📄 DiamondInheritanceBaseLevelStructProxy.cs ┃ ┣━ 📄 DiamondInheritanceFirstMidLevelStruct.cs - ┃ ┣━ 📄 DiamondInheritanceFirstMidLevelStructProxy.cs ┃ ┣━ 📄 DiamondInheritanceSecondMidLevelStruct.cs - ┃ ┣━ 📄 DiamondInheritanceSecondMidLevelStructProxy.cs ┃ ┣━ 📄 DiamondInheritanceTopLevelStruct.cs - ┃ ┣━ 📄 DiamondInheritanceTopLevelStructProxy.cs ┃ ┣━ 📄 DisappointingCollectionSource.cs ┃ ┣━ 📄 DocumentedClass.cs ┃ ┣━ 📄 DoNotOverridePrivates.cs @@ -1943,43 +1784,30 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 DynamicPropertyBearer.cs ┃ ┣━ 📄 DynamicPropertyBearerChild.cs ┃ ┣━ 📄 Entropy.cs - ┃ ┣━ 📄 EntropyProxy.cs ┃ ┣━ 📄 EnumDispenser.cs ┃ ┣━ 📄 EraseUndefinedHashValues.cs ┃ ┣━ 📄 EraseUndefinedHashValuesOptions.cs - ┃ ┣━ 📄 EraseUndefinedHashValuesOptionsProxy.cs ┃ ┣━ 📄 ExperimentalClass.cs ┃ ┣━ 📄 ExperimentalEnum.cs ┃ ┣━ 📄 ExperimentalStruct.cs - ┃ ┣━ 📄 ExperimentalStructProxy.cs ┃ ┣━ 📄 ExportedBaseClass.cs ┃ ┣━ 📄 ExtendsInternalInterface.cs - ┃ ┣━ 📄 ExtendsInternalInterfaceProxy.cs ┃ ┣━ 📄 ExternalClass.cs ┃ ┣━ 📄 ExternalEnum.cs ┃ ┣━ 📄 ExternalStruct.cs - ┃ ┣━ 📄 ExternalStructProxy.cs ┃ ┣━ 📄 GiveMeStructs.cs ┃ ┣━ 📄 Greetee.cs - ┃ ┣━ 📄 GreeteeProxy.cs ┃ ┣━ 📄 GreetingAugmenter.cs ┃ ┣━ 📄 IAnonymousImplementationProvider.cs - ┃ ┣━ 📄 IAnonymousImplementationProviderProxy.cs ┃ ┣━ 📄 IAnonymouslyImplementMe.cs - ┃ ┣━ 📄 IAnonymouslyImplementMeProxy.cs ┃ ┣━ 📄 IAnotherPublicInterface.cs - ┃ ┣━ 📄 IAnotherPublicInterfaceProxy.cs ┃ ┣━ 📄 IBell.cs - ┃ ┣━ 📄 IBellProxy.cs ┃ ┣━ 📄 IBellRinger.cs - ┃ ┣━ 📄 IBellRingerProxy.cs ┃ ┣━ 📄 ICalculatorProps.cs ┃ ┣━ 📄 IChildStruct982.cs ┃ ┣━ 📄 IConcreteBellRinger.cs - ┃ ┣━ 📄 IConcreteBellRingerProxy.cs ┃ ┣━ 📄 IConfusingToJacksonStruct.cs ┃ ┣━ 📄 IDeprecatedInterface.cs - ┃ ┣━ 📄 IDeprecatedInterfaceProxy.cs ┃ ┣━ 📄 IDeprecatedStruct.cs ┃ ┣━ 📄 IDerivedStruct.cs ┃ ┣━ 📄 IDiamondInheritanceBaseLevelStruct.cs @@ -1988,44 +1816,27 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 IDiamondInheritanceTopLevelStruct.cs ┃ ┣━ 📄 IEraseUndefinedHashValuesOptions.cs ┃ ┣━ 📄 IExperimentalInterface.cs - ┃ ┣━ 📄 IExperimentalInterfaceProxy.cs ┃ ┣━ 📄 IExperimentalStruct.cs ┃ ┣━ 📄 IExtendsInternalInterface.cs ┃ ┣━ 📄 IExtendsPrivateInterface.cs - ┃ ┣━ 📄 IExtendsPrivateInterfaceProxy.cs ┃ ┣━ 📄 IExternalInterface.cs - ┃ ┣━ 📄 IExternalInterfaceProxy.cs ┃ ┣━ 📄 IExternalStruct.cs ┃ ┣━ 📄 IFriendlier.cs - ┃ ┣━ 📄 IFriendlierProxy.cs ┃ ┣━ 📄 IFriendlyRandomGenerator.cs - ┃ ┣━ 📄 IFriendlyRandomGeneratorProxy.cs ┃ ┣━ 📄 IGreetee.cs ┃ ┣━ 📄 IImplictBaseOfBase.cs ┃ ┣━ 📄 IInterfaceImplementedByAbstractClass.cs - ┃ ┣━ 📄 IInterfaceImplementedByAbstractClassProxy.cs ┃ ┣━ 📄 IInterfaceThatShouldNotBeADataType.cs - ┃ ┣━ 📄 IInterfaceThatShouldNotBeADataTypeProxy.cs ┃ ┣━ 📄 IInterfaceWithInternal.cs - ┃ ┣━ 📄 IInterfaceWithInternalProxy.cs ┃ ┣━ 📄 IInterfaceWithMethods.cs - ┃ ┣━ 📄 IInterfaceWithMethodsProxy.cs ┃ ┣━ 📄 IInterfaceWithOptionalMethodArguments.cs - ┃ ┣━ 📄 IInterfaceWithOptionalMethodArgumentsProxy.cs ┃ ┣━ 📄 IInterfaceWithProperties.cs ┃ ┣━ 📄 IInterfaceWithPropertiesExtension.cs - ┃ ┣━ 📄 IInterfaceWithPropertiesExtensionProxy.cs - ┃ ┣━ 📄 IInterfaceWithPropertiesProxy.cs ┃ ┣━ 📄 IJSII417Derived.cs - ┃ ┣━ 📄 IJSII417DerivedProxy.cs ┃ ┣━ 📄 IJSII417PublicBaseOfBase.cs - ┃ ┣━ 📄 IJSII417PublicBaseOfBaseProxy.cs ┃ ┣━ 📄 IJsii487External.cs ┃ ┣━ 📄 IJsii487External2.cs - ┃ ┣━ 📄 IJsii487External2Proxy.cs - ┃ ┣━ 📄 IJsii487ExternalProxy.cs ┃ ┣━ 📄 IJsii496.cs - ┃ ┣━ 📄 IJsii496Proxy.cs ┃ ┣━ 📄 ILevelOneProps.cs ┃ ┣━ 📄 ILoadBalancedFargateServiceProps.cs ┃ ┣━ 📄 Implementation.cs @@ -2034,22 +1845,17 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 ImplementsInterfaceWithInternalSubclass.cs ┃ ┣━ 📄 ImplementsPrivateInterface.cs ┃ ┣━ 📄 ImplictBaseOfBase.cs - ┃ ┣━ 📄 ImplictBaseOfBaseProxy.cs ┃ ┣━ 📄 IMutableObjectLiteral.cs - ┃ ┣━ 📄 IMutableObjectLiteralProxy.cs ┃ ┣━ 📄 InbetweenClass.cs ┃ ┣━ 📄 INestedStruct.cs ┃ ┣━ 📄 INonInternalInterface.cs - ┃ ┣━ 📄 INonInternalInterfaceProxy.cs ┃ ┣━ 📄 InterfaceCollections.cs ┃ ┣━ 📁 InterfaceInNamespaceIncludesClasses ┃ ┃ ┣━ 📄 Foo.cs ┃ ┃ ┣━ 📄 Hello.cs - ┃ ┃ ┣━ 📄 HelloProxy.cs ┃ ┃ ┗━ 📄 IHello.cs ┃ ┣━ 📁 InterfaceInNamespaceOnlyInterface ┃ ┃ ┣━ 📄 Hello.cs - ┃ ┃ ┣━ 📄 HelloProxy.cs ┃ ┃ ┗━ 📄 IHello.cs ┃ ┣━ 📄 InterfacesMaker.cs ┃ ┣━ 📁 Internal @@ -2057,42 +1863,30 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┃ ┗━ 📄 Anchor.cs ┃ ┣━ 📄 INullShouldBeTreatedAsUndefinedData.cs ┃ ┣━ 📄 IObjectWithProperty.cs - ┃ ┣━ 📄 IObjectWithPropertyProxy.cs ┃ ┣━ 📄 IOptionalMethod.cs - ┃ ┣━ 📄 IOptionalMethodProxy.cs ┃ ┣━ 📄 IOptionalStruct.cs ┃ ┣━ 📄 IParentStruct982.cs ┃ ┣━ 📄 IPrivatelyImplemented.cs - ┃ ┣━ 📄 IPrivatelyImplementedProxy.cs ┃ ┣━ 📄 IPublicInterface.cs ┃ ┣━ 📄 IPublicInterface2.cs - ┃ ┣━ 📄 IPublicInterface2Proxy.cs - ┃ ┣━ 📄 IPublicInterfaceProxy.cs ┃ ┣━ 📄 IRandomNumberGenerator.cs - ┃ ┣━ 📄 IRandomNumberGeneratorProxy.cs ┃ ┣━ 📄 IReturnJsii976.cs - ┃ ┣━ 📄 IReturnJsii976Proxy.cs ┃ ┣━ 📄 IReturnsNumber.cs - ┃ ┣━ 📄 IReturnsNumberProxy.cs ┃ ┣━ 📄 IRootStruct.cs ┃ ┣━ 📄 ISecondLevelStruct.cs ┃ ┣━ 📄 ISmellyStruct.cs ┃ ┣━ 📄 Isomorphism.cs - ┃ ┣━ 📄 IsomorphismProxy.cs ┃ ┣━ 📄 IStableInterface.cs - ┃ ┣━ 📄 IStableInterfaceProxy.cs ┃ ┣━ 📄 IStableStruct.cs ┃ ┣━ 📄 IStructA.cs ┃ ┣━ 📄 IStructB.cs ┃ ┣━ 📄 IStructParameterType.cs ┃ ┣━ 📄 IStructReturningDelegate.cs - ┃ ┣━ 📄 IStructReturningDelegateProxy.cs ┃ ┣━ 📄 IStructWithJavaReservedWords.cs ┃ ┣━ 📄 ISupportsNiceJavaBuilderProps.cs ┃ ┣━ 📄 ITopLevelStruct.cs ┃ ┣━ 📄 IUnionProperties.cs ┃ ┣━ 📄 IWallClock.cs - ┃ ┣━ 📄 IWallClockProxy.cs ┃ ┣━ 📄 JavaReservedWords.cs ┃ ┣━ 📄 JSII417Derived.cs ┃ ┣━ 📄 JSII417PublicBaseOfBase.cs @@ -2105,20 +1899,16 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 JsonFormatter.cs ┃ ┣━ 📄 LevelOne.cs ┃ ┣━ 📄 LevelOneProps.cs - ┃ ┣━ 📄 LevelOnePropsProxy.cs ┃ ┣━ 📄 LoadBalancedFargateServiceProps.cs - ┃ ┣━ 📄 LoadBalancedFargateServicePropsProxy.cs ┃ ┣━ 📄 MethodNamedProperty.cs ┃ ┣━ 📄 Multiply.cs ┃ ┣━ 📄 NamespaceDoc.cs ┃ ┣━ 📄 Negate.cs ┃ ┣━ 📄 NestedClassInstance.cs ┃ ┣━ 📄 NestedStruct.cs - ┃ ┣━ 📄 NestedStructProxy.cs ┃ ┣━ 📄 NodeStandardLibrary.cs ┃ ┣━ 📄 NullShouldBeTreatedAsUndefined.cs ┃ ┣━ 📄 NullShouldBeTreatedAsUndefinedData.cs - ┃ ┣━ 📄 NullShouldBeTreatedAsUndefinedDataProxy.cs ┃ ┣━ 📄 NumberGenerator.cs ┃ ┣━ 📄 ObjectRefsInCollections.cs ┃ ┣━ 📄 ObjectWithPropertyProvider.cs @@ -2127,13 +1917,10 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 OptionalConstructorArgument.cs ┃ ┣━ 📄 OptionalStruct.cs ┃ ┣━ 📄 OptionalStructConsumer.cs - ┃ ┣━ 📄 OptionalStructProxy.cs ┃ ┣━ 📄 OverridableProtectedMember.cs ┃ ┣━ 📄 OverrideReturnsObject.cs ┃ ┣━ 📄 ParentStruct982.cs - ┃ ┣━ 📄 ParentStruct982Proxy.cs ┃ ┣━ 📄 PartiallyInitializedThisConsumer.cs - ┃ ┣━ 📄 PartiallyInitializedThisConsumerProxy.cs ┃ ┣━ 📄 Polymorphism.cs ┃ ┣━ 📄 Power.cs ┃ ┣━ 📄 PropertyNamedProperty.cs @@ -2143,49 +1930,40 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┃ ┣━ 📄 ClassWithSelf.cs ┃ ┃ ┣━ 📄 ClassWithSelfKwarg.cs ┃ ┃ ┣━ 📄 IInterfaceWithSelf.cs - ┃ ┃ ┣━ 📄 IInterfaceWithSelfProxy.cs ┃ ┃ ┣━ 📄 IStructWithSelf.cs - ┃ ┃ ┣━ 📄 StructWithSelf.cs - ┃ ┃ ┗━ 📄 StructWithSelfProxy.cs + ┃ ┃ ┗━ 📄 StructWithSelf.cs ┃ ┣━ 📄 ReferenceEnumFromScopedPackage.cs ┃ ┣━ 📄 ReturnsPrivateImplementationOfInterface.cs ┃ ┣━ 📄 RootStruct.cs - ┃ ┣━ 📄 RootStructProxy.cs ┃ ┣━ 📄 RootStructValidator.cs ┃ ┣━ 📄 RuntimeTypeChecking.cs ┃ ┣━ 📄 SecondLevelStruct.cs - ┃ ┣━ 📄 SecondLevelStructProxy.cs ┃ ┣━ 📄 SingleInstanceTwoTypes.cs ┃ ┣━ 📄 SingletonInt.cs ┃ ┣━ 📄 SingletonIntEnum.cs ┃ ┣━ 📄 SingletonString.cs ┃ ┣━ 📄 SingletonStringEnum.cs ┃ ┣━ 📄 SmellyStruct.cs - ┃ ┣━ 📄 SmellyStructProxy.cs ┃ ┣━ 📄 SomeTypeJsii976.cs ┃ ┣━ 📄 StableClass.cs ┃ ┣━ 📄 StableEnum.cs ┃ ┣━ 📄 StableStruct.cs - ┃ ┣━ 📄 StableStructProxy.cs ┃ ┣━ 📄 StaticContext.cs + ┃ ┣━ 📄 StaticHelloChild.cs + ┃ ┣━ 📄 StaticHelloParent.cs ┃ ┣━ 📄 Statics.cs ┃ ┣━ 📄 StringEnum.cs ┃ ┣━ 📄 StripInternal.cs ┃ ┣━ 📄 StructA.cs - ┃ ┣━ 📄 StructAProxy.cs ┃ ┣━ 📄 StructB.cs - ┃ ┣━ 📄 StructBProxy.cs ┃ ┣━ 📄 StructParameterType.cs - ┃ ┣━ 📄 StructParameterTypeProxy.cs ┃ ┣━ 📄 StructPassing.cs ┃ ┣━ 📄 StructUnionConsumer.cs ┃ ┣━ 📄 StructWithJavaReservedWords.cs - ┃ ┣━ 📄 StructWithJavaReservedWordsProxy.cs ┃ ┣━ 📁 Submodule ┃ ┃ ┣━ 📁 BackReferences ┃ ┃ ┃ ┣━ 📄 IMyClassReference.cs - ┃ ┃ ┃ ┣━ 📄 MyClassReference.cs - ┃ ┃ ┃ ┗━ 📄 MyClassReferenceProxy.cs + ┃ ┃ ┃ ┗━ 📄 MyClassReference.cs ┃ ┃ ┣━ 📁 Child ┃ ┃ ┃ ┣━ 📄 Awesomeness.cs ┃ ┃ ┃ ┣━ 📄 Goodness.cs @@ -2194,42 +1972,32 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┃ ┃ ┣━ 📄 ISomeStruct.cs ┃ ┃ ┃ ┣━ 📄 IStructure.cs ┃ ┃ ┃ ┣━ 📄 KwargsProps.cs - ┃ ┃ ┃ ┣━ 📄 KwargsPropsProxy.cs ┃ ┃ ┃ ┣━ 📄 OuterClass.cs ┃ ┃ ┃ ┣━ 📄 SomeEnum.cs ┃ ┃ ┃ ┣━ 📄 SomeStruct.cs - ┃ ┃ ┃ ┣━ 📄 SomeStructProxy.cs - ┃ ┃ ┃ ┣━ 📄 Structure.cs - ┃ ┃ ┃ ┗━ 📄 StructureProxy.cs + ┃ ┃ ┃ ┗━ 📄 Structure.cs ┃ ┃ ┣━ 📁 Isolated ┃ ┃ ┃ ┗━ 📄 Kwargs.cs ┃ ┃ ┣━ 📄 MyClass.cs ┃ ┃ ┣━ 📁 NestedSubmodule ┃ ┃ ┃ ┣━ 📁 DeeplyNested - ┃ ┃ ┃ ┃ ┣━ 📄 INamespaced.cs - ┃ ┃ ┃ ┃ ┗━ 📄 INamespacedProxy.cs - ┃ ┃ ┃ ┣━ 📄 Namespaced.cs - ┃ ┃ ┃ ┗━ 📄 NamespacedProxy.cs + ┃ ┃ ┃ ┃ ┗━ 📄 INamespaced.cs + ┃ ┃ ┃ ┗━ 📄 Namespaced.cs ┃ ┃ ┣━ 📁 Param ┃ ┃ ┃ ┣━ 📄 ISpecialParameter.cs - ┃ ┃ ┃ ┣━ 📄 SpecialParameter.cs - ┃ ┃ ┃ ┗━ 📄 SpecialParameterProxy.cs + ┃ ┃ ┃ ┗━ 📄 SpecialParameter.cs ┃ ┃ ┗━ 📁 Returnsparam ┃ ┃ ┗━ 📄 ReturnsSpecialParameter.cs ┃ ┣━ 📄 Sum.cs ┃ ┣━ 📄 SupportsNiceJavaBuilder.cs ┃ ┣━ 📄 SupportsNiceJavaBuilderProps.cs - ┃ ┣━ 📄 SupportsNiceJavaBuilderPropsProxy.cs ┃ ┣━ 📄 SupportsNiceJavaBuilderWithRequiredProps.cs ┃ ┣━ 📄 SyncVirtualMethods.cs ┃ ┣━ 📄 Thrower.cs ┃ ┣━ 📄 TopLevelStruct.cs - ┃ ┣━ 📄 TopLevelStructProxy.cs ┃ ┣━ 📄 UmaskCheck.cs ┃ ┣━ 📄 UnaryOperation.cs - ┃ ┣━ 📄 UnaryOperationProxy.cs ┃ ┣━ 📄 UnionProperties.cs - ┃ ┣━ 📄 UnionPropertiesProxy.cs ┃ ┣━ 📄 UpcasingReflectable.cs ┃ ┣━ 📄 UseBundledDependency.cs ┃ ┣━ 📄 UseCalcBase.cs @@ -2238,7 +2006,6 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 VariadicMethod.cs ┃ ┣━ 📄 VirtualMethodPlayground.cs ┃ ┣━ 📄 VoidCallback.cs - ┃ ┣━ 📄 VoidCallbackProxy.cs ┃ ┗━ 📄 WithPrivatePropertyInConstructor.cs ┣━ 📄 Amazon.JSII.Tests.CalculatorPackageId.csproj ┣━ 📄 AssemblyInfo.cs @@ -2281,7 +2048,10 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.Calcu + 0612,0618 + + 0108,0109 @@ -2331,6 +2101,26 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get => GetInstanceProperty()!; } + + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClass), fullyQualifiedName: "jsii-calc.AbstractClass")] + new internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.AbstractClass + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "abstractProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + public override string AbstractProperty + { + get => GetInstanceProperty()!; + } + + [JsiiMethod(name: "abstractMethod", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"name\\":\\"name\\",\\"type\\":{\\"primitive\\":\\"string\\"}}]")] + public override string AbstractMethod(string name) + { + return InvokeInstanceMethod(new System.Type[]{typeof(string)}, new object[]{name})!; + } + } } } @@ -2369,59 +2159,19 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassBaseProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClassBase), fullyQualifiedName: "jsii-calc.AbstractClassBase")] - internal sealed class AbstractClassBaseProxy : Amazon.JSII.Tests.CalculatorNamespace.AbstractClassBase - { - private AbstractClassBaseProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "abstractProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - public override string AbstractProperty - { - get => GetInstanceProperty()!; - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClass), fullyQualifiedName: "jsii-calc.AbstractClass")] - internal sealed class AbstractClassProxy : Amazon.JSII.Tests.CalculatorNamespace.AbstractClass - { - private AbstractClassProxy(ByRefValue reference): base(reference) - { - } - [JsiiProperty(name: "abstractProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - public override string AbstractProperty + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClassBase), fullyQualifiedName: "jsii-calc.AbstractClassBase")] + internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.AbstractClassBase { - get => GetInstanceProperty()!; - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "abstractMethod", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"name\\":\\"name\\",\\"type\\":{\\"primitive\\":\\"string\\"}}]")] - public override string AbstractMethod(string name) - { - return InvokeInstanceMethod(new System.Type[]{typeof(string)}, new object[]{name})!; + [JsiiProperty(name: "abstractProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + public override string AbstractProperty + { + get => GetInstanceProperty()!; + } } } } @@ -2525,37 +2275,27 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get; set; } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractSuiteProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// Ensures abstract members implementations correctly register overrides in various languages. - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractSuite), fullyQualifiedName: "jsii-calc.AbstractSuite")] - internal sealed class AbstractSuiteProxy : Amazon.JSII.Tests.CalculatorNamespace.AbstractSuite - { - private AbstractSuiteProxy(ByRefValue reference): base(reference) + /// Ensures abstract members implementations correctly register overrides in various languages. + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractSuite), fullyQualifiedName: "jsii-calc.AbstractSuite")] + internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.AbstractSuite { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"string\\"}")] - protected override string Property - { - get => GetInstanceProperty()!; - set => SetInstanceProperty(value); - } + [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"string\\"}")] + protected override string Property + { + get => GetInstanceProperty()!; + set => SetInstanceProperty(value); + } - [JsiiMethod(name: "someMethod", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"name\\":\\"str\\",\\"type\\":{\\"primitive\\":\\"string\\"}}]")] - protected override string SomeMethod(string str) - { - return InvokeInstanceMethod(new System.Type[]{typeof(string)}, new object[]{str})!; + [JsiiMethod(name: "someMethod", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"name\\":\\"str\\",\\"type\\":{\\"primitive\\":\\"string\\"}}]")] + protected override string SomeMethod(string str) + { + return InvokeInstanceMethod(new System.Type[]{typeof(string)}, new object[]{str})!; + } } } } @@ -3216,46 +2956,36 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get => GetInstanceProperty()!; } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperationProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// Represents an operation with two operands. - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.BinaryOperation), fullyQualifiedName: "jsii-calc.BinaryOperation")] - internal sealed class BinaryOperationProxy : Amazon.JSII.Tests.CalculatorNamespace.BinaryOperation - { - private BinaryOperationProxy(ByRefValue reference): base(reference) + /// Represents an operation with two operands. + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.BinaryOperation), fullyQualifiedName: "jsii-calc.BinaryOperation")] + internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.BinaryOperation { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - /// (deprecated) The value. - /// - /// Stability: Deprecated - /// - [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"number\\"}")] - [System.Obsolete()] - public override double Value - { - get => GetInstanceProperty()!; - } + /// (deprecated) The value. + /// + /// Stability: Deprecated + /// + [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"number\\"}")] + [System.Obsolete()] + public override double Value + { + get => GetInstanceProperty()!; + } - /// (deprecated) String representation of the value. - /// - /// Stability: Deprecated - /// - [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] - [System.Obsolete()] - public override string ToString() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + /// (deprecated) String representation of the value. + /// + /// Stability: Deprecated + /// + [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + [System.Obsolete()] + public override string ToString() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } } } } @@ -3303,33 +3033,23 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiMethod(name: "giveItBack", returnsJson: "{\\"type\\":{\\"primitive\\":\\"any\\"}}", parametersJson: "[{\\"docs\\":{\\"summary\\":\\"the value that should be returned.\\"},\\"name\\":\\"value\\",\\"type\\":{\\"primitive\\":\\"any\\"}}]")] public abstract object GiveItBack(object @value); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BurriedAnonymousObjectProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// See https://github.com/aws/aws-cdk/issues/7977. - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.BurriedAnonymousObject), fullyQualifiedName: "jsii-calc.BurriedAnonymousObject")] - internal sealed class BurriedAnonymousObjectProxy : Amazon.JSII.Tests.CalculatorNamespace.BurriedAnonymousObject - { - private BurriedAnonymousObjectProxy(ByRefValue reference): base(reference) + /// See https://github.com/aws/aws-cdk/issues/7977. + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.BurriedAnonymousObject), fullyQualifiedName: "jsii-calc.BurriedAnonymousObject")] + internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.BurriedAnonymousObject { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - /// Implement this method and have it return it's parameter. - /// the value that should be returned. - /// \`value\` - [JsiiMethod(name: "giveItBack", returnsJson: "{\\"type\\":{\\"primitive\\":\\"any\\"}}", parametersJson: "[{\\"docs\\":{\\"summary\\":\\"the value that should be returned.\\"},\\"name\\":\\"value\\",\\"type\\":{\\"primitive\\":\\"any\\"}}]")] - public override object GiveItBack(object @value) - { - return InvokeInstanceMethod(new System.Type[]{typeof(object)}, new object[]{@value})!; + /// Implement this method and have it return it's parameter. + /// the value that should be returned. + /// \`value\` + [JsiiMethod(name: "giveItBack", returnsJson: "{\\"type\\":{\\"primitive\\":\\"any\\"}}", parametersJson: "[{\\"docs\\":{\\"summary\\":\\"the value that should be returned.\\"},\\"name\\":\\"value\\",\\"type\\":{\\"primitive\\":\\"any\\"}}]")] + public override object GiveItBack(object @value) + { + return InvokeInstanceMethod(new System.Type[]{typeof(object)}, new object[]{@value})!; + } } } } @@ -3514,103 +3234,30 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorPropsProxy.cs 1`] = ` +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ChildStruct982.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 namespace Amazon.JSII.Tests.CalculatorNamespace { - /// Properties for Calculator. - [JsiiTypeProxy(nativeType: typeof(ICalculatorProps), fullyQualifiedName: "jsii-calc.CalculatorProps")] - internal sealed class CalculatorPropsProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.ICalculatorProps + #pragma warning disable CS8618 + + [JsiiByValue(fqn: "jsii-calc.ChildStruct982")] + public class ChildStruct982 : Amazon.JSII.Tests.CalculatorNamespace.IChildStruct982 { - private CalculatorPropsProxy(ByRefValue reference): base(reference) + [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"number\\"}", isOverride: true)] + public double Bar { + get; + set; } - /// The initial value of the calculator. - /// - /// NOTE: Any number works here, it's fine. - /// - /// Default: 0 - /// - [JsiiOptional] - [JsiiProperty(name: "initialValue", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] - public double? InitialValue + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + public string Foo { - get => GetInstanceProperty(); - } - - /// The maximum value the calculator can store. - /// - /// Default: none - /// - [JsiiOptional] - [JsiiProperty(name: "maximumValue", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] - public double? MaximumValue - { - get => GetInstanceProperty(); - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ChildStruct982.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - #pragma warning disable CS8618 - - [JsiiByValue(fqn: "jsii-calc.ChildStruct982")] - public class ChildStruct982 : Amazon.JSII.Tests.CalculatorNamespace.IChildStruct982 - { - [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"number\\"}", isOverride: true)] - public double Bar - { - get; - set; - } - - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] - public string Foo - { - get; - set; - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ChildStruct982Proxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IChildStruct982), fullyQualifiedName: "jsii-calc.ChildStruct982")] - internal sealed class ChildStruct982Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IChildStruct982 - { - private ChildStruct982Proxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"number\\"}")] - public double Bar - { - get => GetInstanceProperty()!; - } - - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Foo - { - get => GetInstanceProperty()!; + get; + set; } } } @@ -4074,34 +3721,24 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Composition [JsiiEnumMember(name: "DECORATED")] DECORATED } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Composition/CompositeOperationProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.Composition -{ - /// Abstract operation composed from an expression of other operations. - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.Composition.CompositeOperation), fullyQualifiedName: "jsii-calc.composition.CompositeOperation")] - internal sealed class CompositeOperationProxy : Amazon.JSII.Tests.CalculatorNamespace.Composition.CompositeOperation - { - private CompositeOperationProxy(ByRefValue reference): base(reference) + /// Abstract operation composed from an expression of other operations. + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.Composition.CompositeOperation), fullyQualifiedName: "jsii-calc.composition.CompositeOperation")] + internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.Composition.CompositeOperation { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - /// The expression that this operation consists of. - /// - /// Must be implemented by derived classes. - /// - [JsiiProperty(name: "expression", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-lib.NumericValue\\"}")] - public override Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue Expression - { - get => GetInstanceProperty()!; + /// The expression that this operation consists of. + /// + /// Must be implemented by derived classes. + /// + [JsiiProperty(name: "expression", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-lib.NumericValue\\"}")] + public override Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue Expression + { + get => GetInstanceProperty()!; + } } } } @@ -4182,31 +3819,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJacksonStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IConfusingToJacksonStruct), fullyQualifiedName: "jsii-calc.ConfusingToJacksonStruct")] - internal sealed class ConfusingToJacksonStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IConfusingToJacksonStruct - { - private ConfusingToJacksonStructProxy(ByRefValue reference): base(reference) - { - } - - [JsiiOptional] - [JsiiProperty(name: "unionProperty", typeJson: "{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"@scope/jsii-calc-lib.IFriendly\\"},{\\"collection\\":{\\"elementtype\\":{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"@scope/jsii-calc-lib.IFriendly\\"},{\\"fqn\\":\\"jsii-calc.AbstractClass\\"}]}},\\"kind\\":\\"array\\"}}]}}", isOptional: true)] - public object? UnionProperty - { - get => GetInstanceProperty(); - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConstructorPassesThisOut.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -4801,38 +4413,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DeprecatedStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// - /// Stability: Deprecated - /// - [JsiiTypeProxy(nativeType: typeof(IDeprecatedStruct), fullyQualifiedName: "jsii-calc.DeprecatedStruct")] - [System.Obsolete("it just wraps a string")] - internal sealed class DeprecatedStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDeprecatedStruct - { - private DeprecatedStructProxy(ByRefValue reference): base(reference) - { - } - - /// - /// Stability: Deprecated - /// - [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - [System.Obsolete("well, yeah")] - public string ReadonlyProperty - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Base.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -5004,99 +4584,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// A struct which derives from another struct. - [JsiiTypeProxy(nativeType: typeof(IDerivedStruct), fullyQualifiedName: "jsii-calc.DerivedStruct")] - internal sealed class DerivedStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDerivedStruct - { - private DerivedStructProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "anotherRequired", typeJson: "{\\"primitive\\":\\"date\\"}")] - public System.DateTime AnotherRequired - { - get => GetInstanceProperty()!; - } - - [JsiiProperty(name: "bool", typeJson: "{\\"primitive\\":\\"boolean\\"}")] - public bool Bool - { - get => GetInstanceProperty()!; - } - - /// An example of a non primitive property. - [JsiiProperty(name: "nonPrimitive", typeJson: "{\\"fqn\\":\\"jsii-calc.DoubleTrouble\\"}")] - public Amazon.JSII.Tests.CalculatorNamespace.DoubleTrouble NonPrimitive - { - get => GetInstanceProperty()!; - } - - /// This is optional. - [JsiiOptional] - [JsiiProperty(name: "anotherOptional", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"@scope/jsii-calc-lib.NumericValue\\"},\\"kind\\":\\"map\\"}}", isOptional: true)] - public System.Collections.Generic.IDictionary? AnotherOptional - { - get => GetInstanceProperty?>(); - } - - [JsiiOptional] - [JsiiProperty(name: "optionalAny", typeJson: "{\\"primitive\\":\\"any\\"}", isOptional: true)] - public object? OptionalAny - { - get => GetInstanceProperty(); - } - - [JsiiOptional] - [JsiiProperty(name: "optionalArray", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"string\\"},\\"kind\\":\\"array\\"}}", isOptional: true)] - public string[]? OptionalArray - { - get => GetInstanceProperty(); - } - - /// (deprecated) An awesome number value. - /// - /// Stability: Deprecated - /// - [JsiiProperty(name: "anumber", typeJson: "{\\"primitive\\":\\"number\\"}")] - [System.Obsolete()] - public double Anumber - { - get => GetInstanceProperty()!; - } - - /// (deprecated) A string value. - /// - /// Stability: Deprecated - /// - [JsiiProperty(name: "astring", typeJson: "{\\"primitive\\":\\"string\\"}")] - [System.Obsolete()] - public string Astring - { - get => GetInstanceProperty()!; - } - - /// - /// Stability: Deprecated - /// - [JsiiOptional] - [JsiiProperty(name: "firstOptional", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"string\\"},\\"kind\\":\\"array\\"}}", isOptional: true)] - [System.Obsolete()] - public string[]? FirstOptional - { - get => GetInstanceProperty(); - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DiamondInheritanceBaseLevelStruct.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -5120,31 +4607,37 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DiamondInheritanceBaseLevelStructProxy.cs 1`] = ` +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DiamondInheritanceFirstMidLevelStruct.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(nativeType: typeof(IDiamondInheritanceBaseLevelStruct), fullyQualifiedName: "jsii-calc.DiamondInheritanceBaseLevelStruct")] - internal sealed class DiamondInheritanceBaseLevelStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceBaseLevelStruct + #pragma warning disable CS8618 + + [JsiiByValue(fqn: "jsii-calc.DiamondInheritanceFirstMidLevelStruct")] + public class DiamondInheritanceFirstMidLevelStruct : Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceFirstMidLevelStruct { - private DiamondInheritanceBaseLevelStructProxy(ByRefValue reference): base(reference) + [JsiiProperty(name: "firstMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + public string FirstMidLevelProperty { + get; + set; } - [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] public string BaseLevelProperty { - get => GetInstanceProperty()!; + get; + set; } } } `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DiamondInheritanceFirstMidLevelStruct.cs 1`] = ` +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DiamondInheritanceSecondMidLevelStruct.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 @@ -5153,11 +4646,11 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { #pragma warning disable CS8618 - [JsiiByValue(fqn: "jsii-calc.DiamondInheritanceFirstMidLevelStruct")] - public class DiamondInheritanceFirstMidLevelStruct : Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceFirstMidLevelStruct + [JsiiByValue(fqn: "jsii-calc.DiamondInheritanceSecondMidLevelStruct")] + public class DiamondInheritanceSecondMidLevelStruct : Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceSecondMidLevelStruct { - [JsiiProperty(name: "firstMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] - public string FirstMidLevelProperty + [JsiiProperty(name: "secondMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + public string SecondMidLevelProperty { get; set; @@ -5174,104 +4667,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DiamondInheritanceFirstMidLevelStructProxy.cs 1`] = ` +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DiamondInheritanceTopLevelStruct.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(nativeType: typeof(IDiamondInheritanceFirstMidLevelStruct), fullyQualifiedName: "jsii-calc.DiamondInheritanceFirstMidLevelStruct")] - internal sealed class DiamondInheritanceFirstMidLevelStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceFirstMidLevelStruct - { - private DiamondInheritanceFirstMidLevelStructProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "firstMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string FirstMidLevelProperty - { - get => GetInstanceProperty()!; - } - - [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string BaseLevelProperty - { - get => GetInstanceProperty()!; - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DiamondInheritanceSecondMidLevelStruct.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - #pragma warning disable CS8618 - - [JsiiByValue(fqn: "jsii-calc.DiamondInheritanceSecondMidLevelStruct")] - public class DiamondInheritanceSecondMidLevelStruct : Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceSecondMidLevelStruct - { - [JsiiProperty(name: "secondMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] - public string SecondMidLevelProperty - { - get; - set; - } - - [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] - public string BaseLevelProperty - { - get; - set; - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DiamondInheritanceSecondMidLevelStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IDiamondInheritanceSecondMidLevelStruct), fullyQualifiedName: "jsii-calc.DiamondInheritanceSecondMidLevelStruct")] - internal sealed class DiamondInheritanceSecondMidLevelStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceSecondMidLevelStruct - { - private DiamondInheritanceSecondMidLevelStructProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "secondMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string SecondMidLevelProperty - { - get => GetInstanceProperty()!; - } - - [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string BaseLevelProperty - { - get => GetInstanceProperty()!; - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DiamondInheritanceTopLevelStruct.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - #pragma warning disable CS8618 + #pragma warning disable CS8618 [JsiiByValue(fqn: "jsii-calc.DiamondInheritanceTopLevelStruct")] public class DiamondInheritanceTopLevelStruct : Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceTopLevelStruct @@ -5308,48 +4711,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DiamondInheritanceTopLevelStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IDiamondInheritanceTopLevelStruct), fullyQualifiedName: "jsii-calc.DiamondInheritanceTopLevelStruct")] - internal sealed class DiamondInheritanceTopLevelStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceTopLevelStruct - { - private DiamondInheritanceTopLevelStructProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "topLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string TopLevelProperty - { - get => GetInstanceProperty()!; - } - - [JsiiProperty(name: "firstMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string FirstMidLevelProperty - { - get => GetInstanceProperty()!; - } - - [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string BaseLevelProperty - { - get => GetInstanceProperty()!; - } - - [JsiiProperty(name: "secondMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string SecondMidLevelProperty - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DisappointingCollectionSource.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -5778,33 +5139,23 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiMethod(name: "repeat", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"docs\\":{\\"summary\\":\\"the value to return.\\"},\\"name\\":\\"word\\",\\"type\\":{\\"primitive\\":\\"string\\"}}]")] public abstract string Repeat(string word); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/EntropyProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// This class is used to validate that serialization and deserialization does not interpret ISO-8601-formatted timestampts to the native date/time object, as the jsii protocol has a $jsii$date wrapper for this purpose (node's JSON parsing does *NOT* detect dates automatically in this way, so host libraries should not either). - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.Entropy), fullyQualifiedName: "jsii-calc.Entropy")] - internal sealed class EntropyProxy : Amazon.JSII.Tests.CalculatorNamespace.Entropy - { - private EntropyProxy(ByRefValue reference): base(reference) + /// This class is used to validate that serialization and deserialization does not interpret ISO-8601-formatted timestampts to the native date/time object, as the jsii protocol has a $jsii$date wrapper for this purpose (node's JSON parsing does *NOT* detect dates automatically in this way, so host libraries should not either). + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.Entropy), fullyQualifiedName: "jsii-calc.Entropy")] + internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.Entropy { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - /// Implement this method such that it returns \`word\`. - /// the value to return. - /// \`word\`. - [JsiiMethod(name: "repeat", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"docs\\":{\\"summary\\":\\"the value to return.\\"},\\"name\\":\\"word\\",\\"type\\":{\\"primitive\\":\\"string\\"}}]")] - public override string Repeat(string word) - { - return InvokeInstanceMethod(new System.Type[]{typeof(string)}, new object[]{word})!; + /// Implement this method such that it returns \`word\`. + /// the value to return. + /// \`word\`. + [JsiiMethod(name: "repeat", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"docs\\":{\\"summary\\":\\"the value to return.\\"},\\"name\\":\\"word\\",\\"type\\":{\\"primitive\\":\\"string\\"}}]")] + public override string Repeat(string word) + { + return InvokeInstanceMethod(new System.Type[]{typeof(string)}, new object[]{word})!; + } } } } @@ -5938,38 +5289,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/EraseUndefinedHashValuesOptionsProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IEraseUndefinedHashValuesOptions), fullyQualifiedName: "jsii-calc.EraseUndefinedHashValuesOptions")] - internal sealed class EraseUndefinedHashValuesOptionsProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IEraseUndefinedHashValuesOptions - { - private EraseUndefinedHashValuesOptionsProxy(ByRefValue reference): base(reference) - { - } - - [JsiiOptional] - [JsiiProperty(name: "option1", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - public string? Option1 - { - get => GetInstanceProperty(); - } - - [JsiiOptional] - [JsiiProperty(name: "option2", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - public string? Option2 - { - get => GetInstanceProperty(); - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExperimentalClass.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -6095,36 +5414,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExperimentalStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// - /// Stability: Experimental - /// - [JsiiTypeProxy(nativeType: typeof(IExperimentalStruct), fullyQualifiedName: "jsii-calc.ExperimentalStruct")] - internal sealed class ExperimentalStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IExperimentalStruct - { - private ExperimentalStructProxy(ByRefValue reference): base(reference) - { - } - - /// - /// Stability: Experimental - /// - [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string ReadonlyProperty - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExportedBaseClass.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -6193,36 +5482,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExtendsInternalInterfaceProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IExtendsInternalInterface), fullyQualifiedName: "jsii-calc.ExtendsInternalInterface")] - internal sealed class ExtendsInternalInterfaceProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IExtendsInternalInterface - { - private ExtendsInternalInterfaceProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "boom", typeJson: "{\\"primitive\\":\\"boolean\\"}")] - public bool Boom - { - get => GetInstanceProperty()!; - } - - [JsiiProperty(name: "prop", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Prop - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExternalClass.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -6348,36 +5607,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExternalStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// - /// External: true - /// - [JsiiTypeProxy(nativeType: typeof(IExternalStruct), fullyQualifiedName: "jsii-calc.ExternalStruct")] - internal sealed class ExternalStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IExternalStruct - { - private ExternalStructProxy(ByRefValue reference): base(reference) - { - } - - /// - /// External: true - /// - [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string ReadonlyProperty - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GiveMeStructs.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -6464,47 +5693,17 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GreeteeProxy.cs 1`] = ` +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GreetingAugmenter.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 namespace Amazon.JSII.Tests.CalculatorNamespace { - /// These are some arguments you can pass to a method. - [JsiiTypeProxy(nativeType: typeof(IGreetee), fullyQualifiedName: "jsii-calc.Greetee")] - internal sealed class GreeteeProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IGreetee + [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.GreetingAugmenter), fullyQualifiedName: "jsii-calc.GreetingAugmenter")] + public class GreetingAugmenter : DeputyBase { - private GreeteeProxy(ByRefValue reference): base(reference) - { - } - - /// The name of the greetee. - /// - /// Default: world - /// - [JsiiOptional] - [JsiiProperty(name: "name", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - public string? Name - { - get => GetInstanceProperty(); - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GreetingAugmenter.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.GreetingAugmenter), fullyQualifiedName: "jsii-calc.GreetingAugmenter")] - public class GreetingAugmenter : DeputyBase - { - public GreetingAugmenter(): base(new DeputyProps(System.Array.Empty())) + public GreetingAugmenter(): base(new DeputyProps(System.Array.Empty())) { } @@ -6547,36 +5746,26 @@ namespace Amazon.JSII.Tests.CalculatorNamespace Amazon.JSII.Tests.CalculatorNamespace.Implementation ProvideAsClass(); [JsiiMethod(name: "provideAsInterface", returnsJson: "{\\"type\\":{\\"fqn\\":\\"jsii-calc.IAnonymouslyImplementMe\\"}}")] Amazon.JSII.Tests.CalculatorNamespace.IAnonymouslyImplementMe ProvideAsInterface(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IAnonymousImplementationProviderProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// We can return an anonymous interface implementation from an override without losing the interface declarations. - [JsiiTypeProxy(nativeType: typeof(IAnonymousImplementationProvider), fullyQualifiedName: "jsii-calc.IAnonymousImplementationProvider")] - internal sealed class IAnonymousImplementationProviderProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IAnonymousImplementationProvider - { - private IAnonymousImplementationProviderProxy(ByRefValue reference): base(reference) + /// We can return an anonymous interface implementation from an override without losing the interface declarations. + [JsiiTypeProxy(nativeType: typeof(IAnonymousImplementationProvider), fullyQualifiedName: "jsii-calc.IAnonymousImplementationProvider")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IAnonymousImplementationProvider { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "provideAsClass", returnsJson: "{\\"type\\":{\\"fqn\\":\\"jsii-calc.Implementation\\"}}")] - public Amazon.JSII.Tests.CalculatorNamespace.Implementation ProvideAsClass() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; - } + [JsiiMethod(name: "provideAsClass", returnsJson: "{\\"type\\":{\\"fqn\\":\\"jsii-calc.Implementation\\"}}")] + public Amazon.JSII.Tests.CalculatorNamespace.Implementation ProvideAsClass() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } - [JsiiMethod(name: "provideAsInterface", returnsJson: "{\\"type\\":{\\"fqn\\":\\"jsii-calc.IAnonymouslyImplementMe\\"}}")] - public Amazon.JSII.Tests.CalculatorNamespace.IAnonymouslyImplementMe ProvideAsInterface() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + [JsiiMethod(name: "provideAsInterface", returnsJson: "{\\"type\\":{\\"fqn\\":\\"jsii-calc.IAnonymouslyImplementMe\\"}}")] + public Amazon.JSII.Tests.CalculatorNamespace.IAnonymouslyImplementMe ProvideAsInterface() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } } } } @@ -6600,35 +5789,25 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiMethod(name: "verb", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] string Verb(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IAnonymouslyImplementMeProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IAnonymouslyImplementMe), fullyQualifiedName: "jsii-calc.IAnonymouslyImplementMe")] - internal sealed class IAnonymouslyImplementMeProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IAnonymouslyImplementMe - { - private IAnonymouslyImplementMeProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IAnonymouslyImplementMe), fullyQualifiedName: "jsii-calc.IAnonymouslyImplementMe")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IAnonymouslyImplementMe { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"number\\"}")] - public double Value - { - get => GetInstanceProperty()!; - } + [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"number\\"}")] + public double Value + { + get => GetInstanceProperty()!; + } - [JsiiMethod(name: "verb", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] - public string Verb() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + [JsiiMethod(name: "verb", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] + public string Verb() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } } } } @@ -6651,30 +5830,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get; set; } - } -} - -`; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IAnotherPublicInterfaceProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IAnotherPublicInterface), fullyQualifiedName: "jsii-calc.IAnotherPublicInterface")] - internal sealed class IAnotherPublicInterfaceProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IAnotherPublicInterface - { - private IAnotherPublicInterfaceProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IAnotherPublicInterface), fullyQualifiedName: "jsii-calc.IAnotherPublicInterface")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IAnotherPublicInterface { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "a", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string A - { - get => GetInstanceProperty()!; - set => SetInstanceProperty(value); + [JsiiProperty(name: "a", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string A + { + get => GetInstanceProperty()!; + set => SetInstanceProperty(value); + } } } } @@ -6693,29 +5862,19 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiMethod(name: "ring")] void Ring(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IBellProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IBell), fullyQualifiedName: "jsii-calc.IBell")] - internal sealed class IBellProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IBell - { - private IBellProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IBell), fullyQualifiedName: "jsii-calc.IBell")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IBell { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "ring")] - public void Ring() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + [JsiiMethod(name: "ring")] + public void Ring() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } } } } @@ -6735,30 +5894,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiMethod(name: "yourTurn", parametersJson: "[{\\"name\\":\\"bell\\",\\"type\\":{\\"fqn\\":\\"jsii-calc.IBell\\"}}]")] void YourTurn(Amazon.JSII.Tests.CalculatorNamespace.IBell bell); - } -} - -`; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IBellRingerProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// Takes the object parameter as an interface. - [JsiiTypeProxy(nativeType: typeof(IBellRinger), fullyQualifiedName: "jsii-calc.IBellRinger")] - internal sealed class IBellRingerProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IBellRinger - { - private IBellRingerProxy(ByRefValue reference): base(reference) + /// Takes the object parameter as an interface. + [JsiiTypeProxy(nativeType: typeof(IBellRinger), fullyQualifiedName: "jsii-calc.IBellRinger")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IBellRinger { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "yourTurn", parametersJson: "[{\\"name\\":\\"bell\\",\\"type\\":{\\"fqn\\":\\"jsii-calc.IBell\\"}}]")] - public void YourTurn(Amazon.JSII.Tests.CalculatorNamespace.IBell bell) - { - InvokeInstanceVoidMethod(new System.Type[]{typeof(Amazon.JSII.Tests.CalculatorNamespace.IBell)}, new object[]{bell}); + [JsiiMethod(name: "yourTurn", parametersJson: "[{\\"name\\":\\"bell\\",\\"type\\":{\\"fqn\\":\\"jsii-calc.IBell\\"}}]")] + public void YourTurn(Amazon.JSII.Tests.CalculatorNamespace.IBell bell) + { + InvokeInstanceVoidMethod(new System.Type[]{typeof(Amazon.JSII.Tests.CalculatorNamespace.IBell)}, new object[]{bell}); + } } } } @@ -6805,6 +5954,39 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } + + /// Properties for Calculator. + [JsiiTypeProxy(nativeType: typeof(ICalculatorProps), fullyQualifiedName: "jsii-calc.CalculatorProps")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.ICalculatorProps + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// The initial value of the calculator. + /// + /// NOTE: Any number works here, it's fine. + /// + /// Default: 0 + /// + [JsiiOptional] + [JsiiProperty(name: "initialValue", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] + public double? InitialValue + { + get => GetInstanceProperty(); + } + + /// The maximum value the calculator can store. + /// + /// Default: none + /// + [JsiiOptional] + [JsiiProperty(name: "maximumValue", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] + public double? MaximumValue + { + get => GetInstanceProperty(); + } + } } } @@ -6825,6 +6007,26 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } + + [JsiiTypeProxy(nativeType: typeof(IChildStruct982), fullyQualifiedName: "jsii-calc.ChildStruct982")] + new internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IChildStruct982 + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"number\\"}")] + public double Bar + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Foo + { + get => GetInstanceProperty()!; + } + } } } @@ -6843,30 +6045,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiMethod(name: "yourTurn", parametersJson: "[{\\"name\\":\\"bell\\",\\"type\\":{\\"fqn\\":\\"jsii-calc.Bell\\"}}]")] void YourTurn(Amazon.JSII.Tests.CalculatorNamespace.Bell bell); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IConcreteBellRingerProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// Takes the object parameter as a calss. - [JsiiTypeProxy(nativeType: typeof(IConcreteBellRinger), fullyQualifiedName: "jsii-calc.IConcreteBellRinger")] - internal sealed class IConcreteBellRingerProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IConcreteBellRinger - { - private IConcreteBellRingerProxy(ByRefValue reference): base(reference) + /// Takes the object parameter as a calss. + [JsiiTypeProxy(nativeType: typeof(IConcreteBellRinger), fullyQualifiedName: "jsii-calc.IConcreteBellRinger")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IConcreteBellRinger { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "yourTurn", parametersJson: "[{\\"name\\":\\"bell\\",\\"type\\":{\\"fqn\\":\\"jsii-calc.Bell\\"}}]")] - public void YourTurn(Amazon.JSII.Tests.CalculatorNamespace.Bell bell) - { - InvokeInstanceVoidMethod(new System.Type[]{typeof(Amazon.JSII.Tests.CalculatorNamespace.Bell)}, new object[]{bell}); + [JsiiMethod(name: "yourTurn", parametersJson: "[{\\"name\\":\\"bell\\",\\"type\\":{\\"fqn\\":\\"jsii-calc.Bell\\"}}]")] + public void YourTurn(Amazon.JSII.Tests.CalculatorNamespace.Bell bell) + { + InvokeInstanceVoidMethod(new System.Type[]{typeof(Amazon.JSII.Tests.CalculatorNamespace.Bell)}, new object[]{bell}); + } } } } @@ -6892,6 +6084,21 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } + + [JsiiTypeProxy(nativeType: typeof(IConfusingToJacksonStruct), fullyQualifiedName: "jsii-calc.ConfusingToJacksonStruct")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IConfusingToJacksonStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiOptional] + [JsiiProperty(name: "unionProperty", typeJson: "{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"@scope/jsii-calc-lib.IFriendly\\"},{\\"collection\\":{\\"elementtype\\":{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"@scope/jsii-calc-lib.IFriendly\\"},{\\"fqn\\":\\"jsii-calc.AbstractClass\\"}]}},\\"kind\\":\\"array\\"}}]}}", isOptional: true)] + public object? UnionProperty + { + get => GetInstanceProperty(); + } + } } } @@ -6934,49 +6141,39 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiMethod(name: "method")] [System.Obsolete("services no purpose")] void Method(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDeprecatedInterfaceProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// - /// Stability: Deprecated - /// - [JsiiTypeProxy(nativeType: typeof(IDeprecatedInterface), fullyQualifiedName: "jsii-calc.IDeprecatedInterface")] - [System.Obsolete("useless interface")] - internal sealed class IDeprecatedInterfaceProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDeprecatedInterface - { - private IDeprecatedInterfaceProxy(ByRefValue reference): base(reference) - { - } /// /// Stability: Deprecated /// - [JsiiOptional] - [JsiiProperty(name: "mutableProperty", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] - [System.Obsolete("could be better")] - public double? MutableProperty + [JsiiTypeProxy(nativeType: typeof(IDeprecatedInterface), fullyQualifiedName: "jsii-calc.IDeprecatedInterface")] + [System.Obsolete("useless interface")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDeprecatedInterface { - get => GetInstanceProperty(); - set => SetInstanceProperty(value); - } + private _Proxy(ByRefValue reference): base(reference) + { + } - /// - /// Stability: Deprecated - /// - [JsiiMethod(name: "method")] - [System.Obsolete("services no purpose")] - public void Method() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + /// + /// Stability: Deprecated + /// + [JsiiOptional] + [JsiiProperty(name: "mutableProperty", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] + [System.Obsolete("could be better")] + public double? MutableProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + /// + /// Stability: Deprecated + /// + [JsiiMethod(name: "method")] + [System.Obsolete("services no purpose")] + public void Method() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } } } } @@ -7006,6 +6203,28 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } + + /// + /// Stability: Deprecated + /// + [JsiiTypeProxy(nativeType: typeof(IDeprecatedStruct), fullyQualifiedName: "jsii-calc.DeprecatedStruct")] + [System.Obsolete("it just wraps a string")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDeprecatedStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// + /// Stability: Deprecated + /// + [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + [System.Obsolete("well, yeah")] + public string ReadonlyProperty + { + get => GetInstanceProperty()!; + } + } } } @@ -7071,13 +6290,96 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } - } -} -`; + /// A struct which derives from another struct. + [JsiiTypeProxy(nativeType: typeof(IDerivedStruct), fullyQualifiedName: "jsii-calc.DerivedStruct")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDerivedStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDiamondInheritanceBaseLevelStruct.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; + [JsiiProperty(name: "anotherRequired", typeJson: "{\\"primitive\\":\\"date\\"}")] + public System.DateTime AnotherRequired + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "bool", typeJson: "{\\"primitive\\":\\"boolean\\"}")] + public bool Bool + { + get => GetInstanceProperty()!; + } + + /// An example of a non primitive property. + [JsiiProperty(name: "nonPrimitive", typeJson: "{\\"fqn\\":\\"jsii-calc.DoubleTrouble\\"}")] + public Amazon.JSII.Tests.CalculatorNamespace.DoubleTrouble NonPrimitive + { + get => GetInstanceProperty()!; + } + + /// This is optional. + [JsiiOptional] + [JsiiProperty(name: "anotherOptional", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"@scope/jsii-calc-lib.NumericValue\\"},\\"kind\\":\\"map\\"}}", isOptional: true)] + public System.Collections.Generic.IDictionary? AnotherOptional + { + get => GetInstanceProperty?>(); + } + + [JsiiOptional] + [JsiiProperty(name: "optionalAny", typeJson: "{\\"primitive\\":\\"any\\"}", isOptional: true)] + public object? OptionalAny + { + get => GetInstanceProperty(); + } + + [JsiiOptional] + [JsiiProperty(name: "optionalArray", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"string\\"},\\"kind\\":\\"array\\"}}", isOptional: true)] + public string[]? OptionalArray + { + get => GetInstanceProperty(); + } + + /// (deprecated) An awesome number value. + /// + /// Stability: Deprecated + /// + [JsiiProperty(name: "anumber", typeJson: "{\\"primitive\\":\\"number\\"}")] + [System.Obsolete()] + public double Anumber + { + get => GetInstanceProperty()!; + } + + /// (deprecated) A string value. + /// + /// Stability: Deprecated + /// + [JsiiProperty(name: "astring", typeJson: "{\\"primitive\\":\\"string\\"}")] + [System.Obsolete()] + public string Astring + { + get => GetInstanceProperty()!; + } + + /// + /// Stability: Deprecated + /// + [JsiiOptional] + [JsiiProperty(name: "firstOptional", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"string\\"},\\"kind\\":\\"array\\"}}", isOptional: true)] + [System.Obsolete()] + public string[]? FirstOptional + { + get => GetInstanceProperty(); + } + } + } +} + +`; + +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDiamondInheritanceBaseLevelStruct.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 @@ -7091,6 +6393,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } + + [JsiiTypeProxy(nativeType: typeof(IDiamondInheritanceBaseLevelStruct), fullyQualifiedName: "jsii-calc.DiamondInheritanceBaseLevelStruct")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceBaseLevelStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string BaseLevelProperty + { + get => GetInstanceProperty()!; + } + } } } @@ -7111,6 +6427,26 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } + + [JsiiTypeProxy(nativeType: typeof(IDiamondInheritanceFirstMidLevelStruct), fullyQualifiedName: "jsii-calc.DiamondInheritanceFirstMidLevelStruct")] + new internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceFirstMidLevelStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "firstMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string FirstMidLevelProperty + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string BaseLevelProperty + { + get => GetInstanceProperty()!; + } + } } } @@ -7131,6 +6467,26 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } + + [JsiiTypeProxy(nativeType: typeof(IDiamondInheritanceSecondMidLevelStruct), fullyQualifiedName: "jsii-calc.DiamondInheritanceSecondMidLevelStruct")] + new internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceSecondMidLevelStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "secondMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string SecondMidLevelProperty + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string BaseLevelProperty + { + get => GetInstanceProperty()!; + } + } } } @@ -7151,6 +6507,38 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } + + [JsiiTypeProxy(nativeType: typeof(IDiamondInheritanceTopLevelStruct), fullyQualifiedName: "jsii-calc.DiamondInheritanceTopLevelStruct")] + new internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceTopLevelStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "topLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string TopLevelProperty + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "firstMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string FirstMidLevelProperty + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string BaseLevelProperty + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "secondMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string SecondMidLevelProperty + { + get => GetInstanceProperty()!; + } + } } } @@ -7185,6 +6573,28 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } + + [JsiiTypeProxy(nativeType: typeof(IEraseUndefinedHashValuesOptions), fullyQualifiedName: "jsii-calc.EraseUndefinedHashValuesOptions")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IEraseUndefinedHashValuesOptions + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiOptional] + [JsiiProperty(name: "option1", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + public string? Option1 + { + get => GetInstanceProperty(); + } + + [JsiiOptional] + [JsiiProperty(name: "option2", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + public string? Option2 + { + get => GetInstanceProperty(); + } + } } } @@ -7224,46 +6634,36 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// [JsiiMethod(name: "method")] void Method(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExperimentalInterfaceProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// - /// Stability: Experimental - /// - [JsiiTypeProxy(nativeType: typeof(IExperimentalInterface), fullyQualifiedName: "jsii-calc.IExperimentalInterface")] - internal sealed class IExperimentalInterfaceProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IExperimentalInterface - { - private IExperimentalInterfaceProxy(ByRefValue reference): base(reference) - { - } /// /// Stability: Experimental /// - [JsiiOptional] - [JsiiProperty(name: "mutableProperty", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] - public double? MutableProperty + [JsiiTypeProxy(nativeType: typeof(IExperimentalInterface), fullyQualifiedName: "jsii-calc.IExperimentalInterface")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IExperimentalInterface { - get => GetInstanceProperty(); - set => SetInstanceProperty(value); - } + private _Proxy(ByRefValue reference): base(reference) + { + } - /// - /// Stability: Experimental - /// - [JsiiMethod(name: "method")] - public void Method() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + /// + /// Stability: Experimental + /// + [JsiiOptional] + [JsiiProperty(name: "mutableProperty", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] + public double? MutableProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + /// + /// Stability: Experimental + /// + [JsiiMethod(name: "method")] + public void Method() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } } } } @@ -7291,6 +6691,26 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } + + /// + /// Stability: Experimental + /// + [JsiiTypeProxy(nativeType: typeof(IExperimentalStruct), fullyQualifiedName: "jsii-calc.ExperimentalStruct")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IExperimentalStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// + /// Stability: Experimental + /// + [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string ReadonlyProperty + { + get => GetInstanceProperty()!; + } + } } } @@ -7317,6 +6737,26 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } + + [JsiiTypeProxy(nativeType: typeof(IExtendsInternalInterface), fullyQualifiedName: "jsii-calc.ExtendsInternalInterface")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IExtendsInternalInterface + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "boom", typeJson: "{\\"primitive\\":\\"boolean\\"}")] + public bool Boom + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "prop", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Prop + { + get => GetInstanceProperty()!; + } + } } } @@ -7344,36 +6784,26 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get; set; } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExtendsPrivateInterfaceProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IExtendsPrivateInterface), fullyQualifiedName: "jsii-calc.IExtendsPrivateInterface")] - internal sealed class IExtendsPrivateInterfaceProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IExtendsPrivateInterface - { - private IExtendsPrivateInterfaceProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IExtendsPrivateInterface), fullyQualifiedName: "jsii-calc.IExtendsPrivateInterface")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IExtendsPrivateInterface { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "moreThings", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"string\\"},\\"kind\\":\\"array\\"}}")] - public string[] MoreThings - { - get => GetInstanceProperty()!; - } + [JsiiProperty(name: "moreThings", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"string\\"},\\"kind\\":\\"array\\"}}")] + public string[] MoreThings + { + get => GetInstanceProperty()!; + } - [JsiiProperty(name: "private", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Private - { - get => GetInstanceProperty()!; - set => SetInstanceProperty(value); + [JsiiProperty(name: "private", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Private + { + get => GetInstanceProperty()!; + set => SetInstanceProperty(value); + } } } } @@ -7414,12 +6844,43 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// [JsiiMethod(name: "method")] void Method(); + + /// + /// External: true + /// + [JsiiTypeProxy(nativeType: typeof(IExternalInterface), fullyQualifiedName: "jsii-calc.IExternalInterface")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IExternalInterface + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// + /// External: true + /// + [JsiiOptional] + [JsiiProperty(name: "mutableProperty", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] + public double? MutableProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + /// + /// External: true + /// + [JsiiMethod(name: "method")] + public void Method() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } + } } } `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExternalInterfaceProxy.cs 1`] = ` +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExternalStruct.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 @@ -7429,64 +6890,43 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// /// External: true /// - [JsiiTypeProxy(nativeType: typeof(IExternalInterface), fullyQualifiedName: "jsii-calc.IExternalInterface")] - internal sealed class IExternalInterfaceProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IExternalInterface + [JsiiInterface(nativeType: typeof(IExternalStruct), fullyQualifiedName: "jsii-calc.ExternalStruct")] + public interface IExternalStruct { - private IExternalInterfaceProxy(ByRefValue reference): base(reference) - { - } - /// /// External: true /// - [JsiiOptional] - [JsiiProperty(name: "mutableProperty", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] - public double? MutableProperty + [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + string ReadonlyProperty { - get => GetInstanceProperty(); - set => SetInstanceProperty(value); + get; } /// /// External: true /// - [JsiiMethod(name: "method")] - public void Method() + [JsiiTypeProxy(nativeType: typeof(IExternalStruct), fullyQualifiedName: "jsii-calc.ExternalStruct")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IExternalStruct { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// + /// External: true + /// + [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string ReadonlyProperty + { + get => GetInstanceProperty()!; + } } } } `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExternalStruct.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// - /// External: true - /// - [JsiiInterface(nativeType: typeof(IExternalStruct), fullyQualifiedName: "jsii-calc.ExternalStruct")] - public interface IExternalStruct - { - /// - /// External: true - /// - [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - string ReadonlyProperty - { - get; - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlier.cs 1`] = ` +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlier.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 @@ -7504,50 +6944,40 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// A goodbye blessing. [JsiiMethod(name: "goodbye", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] string Goodbye(); - } -} -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlierProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// Even friendlier classes can implement this interface. - [JsiiTypeProxy(nativeType: typeof(IFriendlier), fullyQualifiedName: "jsii-calc.IFriendlier")] - internal sealed class IFriendlierProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IFriendlier - { - private IFriendlierProxy(ByRefValue reference): base(reference) + /// Even friendlier classes can implement this interface. + [JsiiTypeProxy(nativeType: typeof(IFriendlier), fullyQualifiedName: "jsii-calc.IFriendlier")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IFriendlier { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - /// Say farewell. - [JsiiMethod(name: "farewell", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] - public string Farewell() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; - } + /// Say farewell. + [JsiiMethod(name: "farewell", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] + public string Farewell() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } - /// Say goodbye. - /// A goodbye blessing. - [JsiiMethod(name: "goodbye", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] - public string Goodbye() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; - } + /// Say goodbye. + /// A goodbye blessing. + [JsiiMethod(name: "goodbye", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] + public string Goodbye() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } - /// (deprecated) Say hello! - /// - /// Stability: Deprecated - /// - [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] - [System.Obsolete()] - public string Hello() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + /// (deprecated) Say hello! + /// + /// Stability: Deprecated + /// + [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] + [System.Obsolete()] + public string Hello() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } } } } @@ -7564,42 +6994,32 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiInterface(nativeType: typeof(IFriendlyRandomGenerator), fullyQualifiedName: "jsii-calc.IFriendlyRandomGenerator")] public interface IFriendlyRandomGenerator : Amazon.JSII.Tests.CalculatorNamespace.IRandomNumberGenerator, Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly { - } -} -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlyRandomGeneratorProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IFriendlyRandomGenerator), fullyQualifiedName: "jsii-calc.IFriendlyRandomGenerator")] - internal sealed class IFriendlyRandomGeneratorProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IFriendlyRandomGenerator - { - private IFriendlyRandomGeneratorProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IFriendlyRandomGenerator), fullyQualifiedName: "jsii-calc.IFriendlyRandomGenerator")] + new internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IFriendlyRandomGenerator { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - /// Returns another random number. - /// A random number. - [JsiiMethod(name: "next", returnsJson: "{\\"type\\":{\\"primitive\\":\\"number\\"}}")] - public double Next() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; - } + /// Returns another random number. + /// A random number. + [JsiiMethod(name: "next", returnsJson: "{\\"type\\":{\\"primitive\\":\\"number\\"}}")] + public double Next() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } - /// (deprecated) Say hello! - /// - /// Stability: Deprecated - /// - [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] - [System.Obsolete()] - public string Hello() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + /// (deprecated) Say hello! + /// + /// Stability: Deprecated + /// + [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] + [System.Obsolete()] + public string Hello() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } } } } @@ -7630,6 +7050,26 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } + + /// These are some arguments you can pass to a method. + [JsiiTypeProxy(nativeType: typeof(IGreetee), fullyQualifiedName: "jsii-calc.Greetee")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IGreetee + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// The name of the greetee. + /// + /// Default: world + /// + [JsiiOptional] + [JsiiProperty(name: "name", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + public string? Name + { + get => GetInstanceProperty(); + } + } } } @@ -7650,6 +7090,32 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } + + [JsiiTypeProxy(nativeType: typeof(IImplictBaseOfBase), fullyQualifiedName: "jsii-calc.ImplictBaseOfBase")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IImplictBaseOfBase + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "goo", typeJson: "{\\"primitive\\":\\"date\\"}")] + public System.DateTime Goo + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Bar + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-base-of-base.Very\\"}")] + public Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.Very Foo + { + get => GetInstanceProperty()!; + } + } } } @@ -7671,30 +7137,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceImplementedByAbstractClassProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// awslabs/jsii#220 Abstract return type. - [JsiiTypeProxy(nativeType: typeof(IInterfaceImplementedByAbstractClass), fullyQualifiedName: "jsii-calc.IInterfaceImplementedByAbstractClass")] - internal sealed class IInterfaceImplementedByAbstractClassProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IInterfaceImplementedByAbstractClass - { - private IInterfaceImplementedByAbstractClassProxy(ByRefValue reference): base(reference) + /// awslabs/jsii#220 Abstract return type. + [JsiiTypeProxy(nativeType: typeof(IInterfaceImplementedByAbstractClass), fullyQualifiedName: "jsii-calc.IInterfaceImplementedByAbstractClass")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IInterfaceImplementedByAbstractClass { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "propFromInterface", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string PropFromInterface - { - get => GetInstanceProperty()!; + [JsiiProperty(name: "propFromInterface", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string PropFromInterface + { + get => GetInstanceProperty()!; + } } } } @@ -7717,42 +7173,32 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } - } -} - -`; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceThatShouldNotBeADataTypeProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// Even though this interface has only properties, it is disqualified from being a datatype because it inherits from an interface that is not a datatype. - [JsiiTypeProxy(nativeType: typeof(IInterfaceThatShouldNotBeADataType), fullyQualifiedName: "jsii-calc.IInterfaceThatShouldNotBeADataType")] - internal sealed class IInterfaceThatShouldNotBeADataTypeProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IInterfaceThatShouldNotBeADataType - { - private IInterfaceThatShouldNotBeADataTypeProxy(ByRefValue reference): base(reference) + /// Even though this interface has only properties, it is disqualified from being a datatype because it inherits from an interface that is not a datatype. + [JsiiTypeProxy(nativeType: typeof(IInterfaceThatShouldNotBeADataType), fullyQualifiedName: "jsii-calc.IInterfaceThatShouldNotBeADataType")] + new internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IInterfaceThatShouldNotBeADataType { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "otherValue", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string OtherValue - { - get => GetInstanceProperty()!; - } + [JsiiProperty(name: "otherValue", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string OtherValue + { + get => GetInstanceProperty()!; + } - [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Value - { - get => GetInstanceProperty()!; - } + [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Value + { + get => GetInstanceProperty()!; + } - [JsiiMethod(name: "doThings")] - public void DoThings() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + [JsiiMethod(name: "doThings")] + public void DoThings() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } } } } @@ -7771,29 +7217,19 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiMethod(name: "visible")] void Visible(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithInternalProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IInterfaceWithInternal), fullyQualifiedName: "jsii-calc.IInterfaceWithInternal")] - internal sealed class IInterfaceWithInternalProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IInterfaceWithInternal - { - private IInterfaceWithInternalProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IInterfaceWithInternal), fullyQualifiedName: "jsii-calc.IInterfaceWithInternal")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IInterfaceWithInternal { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "visible")] - public void Visible() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + [JsiiMethod(name: "visible")] + public void Visible() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } } } } @@ -7817,35 +7253,25 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiMethod(name: "doThings")] void DoThings(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithMethodsProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IInterfaceWithMethods), fullyQualifiedName: "jsii-calc.IInterfaceWithMethods")] - internal sealed class IInterfaceWithMethodsProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IInterfaceWithMethods - { - private IInterfaceWithMethodsProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IInterfaceWithMethods), fullyQualifiedName: "jsii-calc.IInterfaceWithMethods")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IInterfaceWithMethods { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Value - { - get => GetInstanceProperty()!; - } + [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Value + { + get => GetInstanceProperty()!; + } - [JsiiMethod(name: "doThings")] - public void DoThings() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + [JsiiMethod(name: "doThings")] + public void DoThings() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } } } } @@ -7865,30 +7291,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiMethod(name: "hello", parametersJson: "[{\\"name\\":\\"arg1\\",\\"type\\":{\\"primitive\\":\\"string\\"}},{\\"name\\":\\"arg2\\",\\"optional\\":true,\\"type\\":{\\"primitive\\":\\"number\\"}}]")] void Hello(string arg1, double? arg2 = null); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithOptionalMethodArgumentsProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// awslabs/jsii#175 Interface proxies (and builders) do not respect optional arguments in methods. - [JsiiTypeProxy(nativeType: typeof(IInterfaceWithOptionalMethodArguments), fullyQualifiedName: "jsii-calc.IInterfaceWithOptionalMethodArguments")] - internal sealed class IInterfaceWithOptionalMethodArgumentsProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IInterfaceWithOptionalMethodArguments - { - private IInterfaceWithOptionalMethodArgumentsProxy(ByRefValue reference): base(reference) + /// awslabs/jsii#175 Interface proxies (and builders) do not respect optional arguments in methods. + [JsiiTypeProxy(nativeType: typeof(IInterfaceWithOptionalMethodArguments), fullyQualifiedName: "jsii-calc.IInterfaceWithOptionalMethodArguments")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IInterfaceWithOptionalMethodArguments { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "hello", parametersJson: "[{\\"name\\":\\"arg1\\",\\"type\\":{\\"primitive\\":\\"string\\"}},{\\"name\\":\\"arg2\\",\\"optional\\":true,\\"type\\":{\\"primitive\\":\\"number\\"}}]")] - public void Hello(string arg1, double? arg2 = null) - { - InvokeInstanceVoidMethod(new System.Type[]{typeof(string), typeof(double)}, new object?[]{arg1, arg2}); + [JsiiMethod(name: "hello", parametersJson: "[{\\"name\\":\\"arg1\\",\\"type\\":{\\"primitive\\":\\"string\\"}},{\\"name\\":\\"arg2\\",\\"optional\\":true,\\"type\\":{\\"primitive\\":\\"number\\"}}]")] + public void Hello(string arg1, double? arg2 = null) + { + InvokeInstanceVoidMethod(new System.Type[]{typeof(string), typeof(double)}, new object?[]{arg1, arg2}); + } } } } @@ -7917,6 +7333,27 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get; set; } + + [JsiiTypeProxy(nativeType: typeof(IInterfaceWithProperties), fullyQualifiedName: "jsii-calc.IInterfaceWithProperties")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IInterfaceWithProperties + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "readOnlyString", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string ReadOnlyString + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "readWriteString", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string ReadWriteString + { + get => GetInstanceProperty()!; + set => SetInstanceProperty(value); + } + } } } @@ -7938,74 +7375,33 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get; set; } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtensionProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IInterfaceWithPropertiesExtension), fullyQualifiedName: "jsii-calc.IInterfaceWithPropertiesExtension")] - internal sealed class IInterfaceWithPropertiesExtensionProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IInterfaceWithPropertiesExtension - { - private IInterfaceWithPropertiesExtensionProxy(ByRefValue reference): base(reference) - { - } - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] - public double Foo + [JsiiTypeProxy(nativeType: typeof(IInterfaceWithPropertiesExtension), fullyQualifiedName: "jsii-calc.IInterfaceWithPropertiesExtension")] + new internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IInterfaceWithPropertiesExtension { - get => GetInstanceProperty()!; - set => SetInstanceProperty(value); - } - - [JsiiProperty(name: "readOnlyString", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string ReadOnlyString - { - get => GetInstanceProperty()!; - } - - [JsiiProperty(name: "readWriteString", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string ReadWriteString - { - get => GetInstanceProperty()!; - set => SetInstanceProperty(value); - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 + private _Proxy(ByRefValue reference): base(reference) + { + } -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IInterfaceWithProperties), fullyQualifiedName: "jsii-calc.IInterfaceWithProperties")] - internal sealed class IInterfaceWithPropertiesProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IInterfaceWithProperties - { - private IInterfaceWithPropertiesProxy(ByRefValue reference): base(reference) - { - } + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] + public double Foo + { + get => GetInstanceProperty()!; + set => SetInstanceProperty(value); + } - [JsiiProperty(name: "readOnlyString", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string ReadOnlyString - { - get => GetInstanceProperty()!; - } + [JsiiProperty(name: "readOnlyString", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string ReadOnlyString + { + get => GetInstanceProperty()!; + } - [JsiiProperty(name: "readWriteString", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string ReadWriteString - { - get => GetInstanceProperty()!; - set => SetInstanceProperty(value); + [JsiiProperty(name: "readWriteString", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string ReadWriteString + { + get => GetInstanceProperty()!; + set => SetInstanceProperty(value); + } } } } @@ -8031,53 +7427,43 @@ namespace Amazon.JSII.Tests.CalculatorNamespace void Bar(); [JsiiMethod(name: "baz")] void Baz(); - } -} -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IJSII417DerivedProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IJSII417Derived), fullyQualifiedName: "jsii-calc.IJSII417Derived")] - internal sealed class IJSII417DerivedProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IJSII417Derived - { - private IJSII417DerivedProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IJSII417Derived), fullyQualifiedName: "jsii-calc.IJSII417Derived")] + new internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IJSII417Derived { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Property - { - get => GetInstanceProperty()!; - } + [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Property + { + get => GetInstanceProperty()!; + } - [JsiiProperty(name: "hasRoot", typeJson: "{\\"primitive\\":\\"boolean\\"}")] - public bool HasRoot - { - get => GetInstanceProperty()!; - } + [JsiiProperty(name: "hasRoot", typeJson: "{\\"primitive\\":\\"boolean\\"}")] + public bool HasRoot + { + get => GetInstanceProperty()!; + } - [JsiiMethod(name: "bar")] - public void Bar() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); - } + [JsiiMethod(name: "bar")] + public void Bar() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } - [JsiiMethod(name: "baz")] - public void Baz() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); - } + [JsiiMethod(name: "baz")] + public void Baz() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } - [JsiiMethod(name: "foo")] - public void Foo() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + [JsiiMethod(name: "foo")] + public void Foo() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } } } } @@ -8101,35 +7487,25 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiMethod(name: "foo")] void Foo(); - } -} - -`; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IJSII417PublicBaseOfBaseProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IJSII417PublicBaseOfBase), fullyQualifiedName: "jsii-calc.IJSII417PublicBaseOfBase")] - internal sealed class IJSII417PublicBaseOfBaseProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IJSII417PublicBaseOfBase - { - private IJSII417PublicBaseOfBaseProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IJSII417PublicBaseOfBase), fullyQualifiedName: "jsii-calc.IJSII417PublicBaseOfBase")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IJSII417PublicBaseOfBase { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "hasRoot", typeJson: "{\\"primitive\\":\\"boolean\\"}")] - public bool HasRoot - { - get => GetInstanceProperty()!; - } + [JsiiProperty(name: "hasRoot", typeJson: "{\\"primitive\\":\\"boolean\\"}")] + public bool HasRoot + { + get => GetInstanceProperty()!; + } - [JsiiMethod(name: "foo")] - public void Foo() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + [JsiiMethod(name: "foo")] + public void Foo() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } } } } @@ -8146,6 +7522,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiInterface(nativeType: typeof(IJsii487External), fullyQualifiedName: "jsii-calc.IJsii487External")] public interface IJsii487External { + + [JsiiTypeProxy(nativeType: typeof(IJsii487External), fullyQualifiedName: "jsii-calc.IJsii487External")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IJsii487External + { + private _Proxy(ByRefValue reference): base(reference) + { + } + } } } @@ -8161,41 +7545,13 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiInterface(nativeType: typeof(IJsii487External2), fullyQualifiedName: "jsii-calc.IJsii487External2")] public interface IJsii487External2 { - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IJsii487External2Proxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IJsii487External2), fullyQualifiedName: "jsii-calc.IJsii487External2")] - internal sealed class IJsii487External2Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IJsii487External2 - { - private IJsii487External2Proxy(ByRefValue reference): base(reference) - { - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IJsii487ExternalProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IJsii487External), fullyQualifiedName: "jsii-calc.IJsii487External")] - internal sealed class IJsii487ExternalProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IJsii487External - { - private IJsii487ExternalProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IJsii487External2), fullyQualifiedName: "jsii-calc.IJsii487External2")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IJsii487External2 { + private _Proxy(ByRefValue reference): base(reference) + { + } } } } @@ -8212,23 +7568,13 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiInterface(nativeType: typeof(IJsii496), fullyQualifiedName: "jsii-calc.IJsii496")] public interface IJsii496 { - } -} -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IJsii496Proxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IJsii496), fullyQualifiedName: "jsii-calc.IJsii496")] - internal sealed class IJsii496Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IJsii496 - { - private IJsii496Proxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IJsii496), fullyQualifiedName: "jsii-calc.IJsii496")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IJsii496 { + private _Proxy(ByRefValue reference): base(reference) + { + } } } } @@ -8250,6 +7596,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } + + [JsiiTypeProxy(nativeType: typeof(ILevelOneProps), fullyQualifiedName: "jsii-calc.LevelOneProps")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.ILevelOneProps + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.LevelOne.PropProperty\\"}")] + public Amazon.JSII.Tests.CalculatorNamespace.LevelOne.IPropProperty Prop + { + get => GetInstanceProperty()!; + } + } } } @@ -8361,6 +7721,96 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } + + /// jsii#298: show default values in sphinx documentation, and respect newlines. + [JsiiTypeProxy(nativeType: typeof(ILoadBalancedFargateServiceProps), fullyQualifiedName: "jsii-calc.LoadBalancedFargateServiceProps")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.ILoadBalancedFargateServiceProps + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// The container port of the application load balancer attached to your Fargate service. + /// + /// Corresponds to container port mapping. + /// + /// Default: 80 + /// + [JsiiOptional] + [JsiiProperty(name: "containerPort", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] + public double? ContainerPort + { + get => GetInstanceProperty(); + } + + /// The number of cpu units used by the task. + /// + /// Valid values, which determines your range of valid values for the memory parameter: + /// 256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB + /// 512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB + /// 1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB + /// 2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments + /// 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments + /// + /// This default is set in the underlying FargateTaskDefinition construct. + /// + /// Default: 256 + /// + [JsiiOptional] + [JsiiProperty(name: "cpu", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + public string? Cpu + { + get => GetInstanceProperty(); + } + + /// The amount (in MiB) of memory used by the task. + /// + /// This field is required and you must use one of the following values, which determines your range of valid values + /// for the cpu parameter: + /// + /// 0.5GB, 1GB, 2GB - Available cpu values: 256 (.25 vCPU) + /// + /// 1GB, 2GB, 3GB, 4GB - Available cpu values: 512 (.5 vCPU) + /// + /// 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB - Available cpu values: 1024 (1 vCPU) + /// + /// Between 4GB and 16GB in 1GB increments - Available cpu values: 2048 (2 vCPU) + /// + /// Between 8GB and 30GB in 1GB increments - Available cpu values: 4096 (4 vCPU) + /// + /// This default is set in the underlying FargateTaskDefinition construct. + /// + /// Default: 512 + /// + [JsiiOptional] + [JsiiProperty(name: "memoryMiB", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + public string? MemoryMiB + { + get => GetInstanceProperty(); + } + + /// Determines whether the Application Load Balancer will be internet-facing. + /// + /// Default: true + /// + [JsiiOptional] + [JsiiProperty(name: "publicLoadBalancer", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] + public bool? PublicLoadBalancer + { + get => GetInstanceProperty(); + } + + /// Determines whether your Fargate Service will be assigned a public IP address. + /// + /// Default: false + /// + [JsiiOptional] + [JsiiProperty(name: "publicTasks", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] + public bool? PublicTasks + { + get => GetInstanceProperty(); + } + } } } @@ -8382,30 +7832,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get; set; } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IMutableObjectLiteralProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IMutableObjectLiteral), fullyQualifiedName: "jsii-calc.IMutableObjectLiteral")] - internal sealed class IMutableObjectLiteralProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IMutableObjectLiteral - { - private IMutableObjectLiteralProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IMutableObjectLiteral), fullyQualifiedName: "jsii-calc.IMutableObjectLiteral")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IMutableObjectLiteral { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Value - { - get => GetInstanceProperty()!; - set => SetInstanceProperty(value); + [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Value + { + get => GetInstanceProperty()!; + set => SetInstanceProperty(value); + } } } } @@ -8428,6 +7868,21 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } + + [JsiiTypeProxy(nativeType: typeof(INestedStruct), fullyQualifiedName: "jsii-calc.NestedStruct")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.INestedStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// When provided, must be > 0. + [JsiiProperty(name: "numberProp", typeJson: "{\\"primitive\\":\\"number\\"}")] + public double NumberProp + { + get => GetInstanceProperty()!; + } + } } } @@ -8456,44 +7911,34 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get; set; } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/INonInternalInterfaceProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(INonInternalInterface), fullyQualifiedName: "jsii-calc.INonInternalInterface")] - internal sealed class INonInternalInterfaceProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.INonInternalInterface - { - private INonInternalInterfaceProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(INonInternalInterface), fullyQualifiedName: "jsii-calc.INonInternalInterface")] + new internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.INonInternalInterface { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "b", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string B - { - get => GetInstanceProperty()!; - set => SetInstanceProperty(value); - } + [JsiiProperty(name: "b", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string B + { + get => GetInstanceProperty()!; + set => SetInstanceProperty(value); + } - [JsiiProperty(name: "c", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string C - { - get => GetInstanceProperty()!; - set => SetInstanceProperty(value); - } + [JsiiProperty(name: "c", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string C + { + get => GetInstanceProperty()!; + set => SetInstanceProperty(value); + } - [JsiiProperty(name: "a", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string A - { - get => GetInstanceProperty()!; - set => SetInstanceProperty(value); + [JsiiProperty(name: "a", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string A + { + get => GetInstanceProperty()!; + set => SetInstanceProperty(value); + } } } } @@ -8525,6 +7970,27 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } + + [JsiiTypeProxy(nativeType: typeof(INullShouldBeTreatedAsUndefinedData), fullyQualifiedName: "jsii-calc.NullShouldBeTreatedAsUndefinedData")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.INullShouldBeTreatedAsUndefinedData + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "arrayWithThreeElementsAndUndefinedAsSecondArgument", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"any\\"},\\"kind\\":\\"array\\"}}")] + public object[] ArrayWithThreeElementsAndUndefinedAsSecondArgument + { + get => GetInstanceProperty()!; + } + + [JsiiOptional] + [JsiiProperty(name: "thisShouldBeUndefined", typeJson: "{\\"primitive\\":\\"any\\"}", isOptional: true)] + public object? ThisShouldBeUndefined + { + get => GetInstanceProperty(); + } + } } } @@ -8549,37 +8015,27 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiMethod(name: "wasSet", returnsJson: "{\\"type\\":{\\"primitive\\":\\"boolean\\"}}")] bool WasSet(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IObjectWithPropertyProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// Make sure that setters are properly called on objects with interfaces. - [JsiiTypeProxy(nativeType: typeof(IObjectWithProperty), fullyQualifiedName: "jsii-calc.IObjectWithProperty")] - internal sealed class IObjectWithPropertyProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IObjectWithProperty - { - private IObjectWithPropertyProxy(ByRefValue reference): base(reference) + /// Make sure that setters are properly called on objects with interfaces. + [JsiiTypeProxy(nativeType: typeof(IObjectWithProperty), fullyQualifiedName: "jsii-calc.IObjectWithProperty")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IObjectWithProperty { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Property - { - get => GetInstanceProperty()!; - set => SetInstanceProperty(value); - } + [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Property + { + get => GetInstanceProperty()!; + set => SetInstanceProperty(value); + } - [JsiiMethod(name: "wasSet", returnsJson: "{\\"type\\":{\\"primitive\\":\\"boolean\\"}}")] - public bool WasSet() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + [JsiiMethod(name: "wasSet", returnsJson: "{\\"type\\":{\\"primitive\\":\\"boolean\\"}}")] + public bool WasSet() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } } } } @@ -8599,30 +8055,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiMethod(name: "optional", returnsJson: "{\\"optional\\":true,\\"type\\":{\\"primitive\\":\\"string\\"}}")] string? Optional(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IOptionalMethodProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// Checks that optional result from interface method code generates correctly. - [JsiiTypeProxy(nativeType: typeof(IOptionalMethod), fullyQualifiedName: "jsii-calc.IOptionalMethod")] - internal sealed class IOptionalMethodProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IOptionalMethod - { - private IOptionalMethodProxy(ByRefValue reference): base(reference) + /// Checks that optional result from interface method code generates correctly. + [JsiiTypeProxy(nativeType: typeof(IOptionalMethod), fullyQualifiedName: "jsii-calc.IOptionalMethod")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IOptionalMethod { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "optional", returnsJson: "{\\"optional\\":true,\\"type\\":{\\"primitive\\":\\"string\\"}}")] - public string? Optional() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{}); + [JsiiMethod(name: "optional", returnsJson: "{\\"optional\\":true,\\"type\\":{\\"primitive\\":\\"string\\"}}")] + public string? Optional() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{}); + } } } } @@ -8645,7 +8091,22 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get { - return null; + return null; + } + } + + [JsiiTypeProxy(nativeType: typeof(IOptionalStruct), fullyQualifiedName: "jsii-calc.OptionalStruct")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IOptionalStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiOptional] + [JsiiProperty(name: "field", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + public string? Field + { + get => GetInstanceProperty(); } } } @@ -8669,6 +8130,21 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } + + /// https://github.com/aws/jsii/issues/982. + [JsiiTypeProxy(nativeType: typeof(IParentStruct982), fullyQualifiedName: "jsii-calc.ParentStruct982")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IParentStruct982 + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Foo + { + get => GetInstanceProperty()!; + } + } } } @@ -8689,29 +8165,19 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPrivatelyImplementedProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IPrivatelyImplemented), fullyQualifiedName: "jsii-calc.IPrivatelyImplemented")] - internal sealed class IPrivatelyImplementedProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IPrivatelyImplemented - { - private IPrivatelyImplementedProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IPrivatelyImplemented), fullyQualifiedName: "jsii-calc.IPrivatelyImplemented")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IPrivatelyImplemented { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "success", typeJson: "{\\"primitive\\":\\"boolean\\"}")] - public bool Success - { - get => GetInstanceProperty()!; + [JsiiProperty(name: "success", typeJson: "{\\"primitive\\":\\"boolean\\"}")] + public bool Success + { + get => GetInstanceProperty()!; + } } } } @@ -8730,6 +8196,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiMethod(name: "bye", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] string Bye(); + + [JsiiTypeProxy(nativeType: typeof(IPublicInterface), fullyQualifiedName: "jsii-calc.IPublicInterface")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IPublicInterface + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiMethod(name: "bye", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] + public string Bye() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } + } } } @@ -8747,53 +8227,19 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiMethod(name: "ciao", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] string Ciao(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPublicInterface2Proxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IPublicInterface2), fullyQualifiedName: "jsii-calc.IPublicInterface2")] - internal sealed class IPublicInterface2Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IPublicInterface2 - { - private IPublicInterface2Proxy(ByRefValue reference): base(reference) - { - } - - [JsiiMethod(name: "ciao", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] - public string Ciao() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPublicInterfaceProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IPublicInterface), fullyQualifiedName: "jsii-calc.IPublicInterface")] - internal sealed class IPublicInterfaceProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IPublicInterface - { - private IPublicInterfaceProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IPublicInterface2), fullyQualifiedName: "jsii-calc.IPublicInterface2")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IPublicInterface2 { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "bye", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] - public string Bye() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + [JsiiMethod(name: "ciao", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] + public string Ciao() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } } } } @@ -8815,32 +8261,22 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// A random number. [JsiiMethod(name: "next", returnsJson: "{\\"type\\":{\\"primitive\\":\\"number\\"}}")] double Next(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IRandomNumberGeneratorProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// Generates random numbers. - [JsiiTypeProxy(nativeType: typeof(IRandomNumberGenerator), fullyQualifiedName: "jsii-calc.IRandomNumberGenerator")] - internal sealed class IRandomNumberGeneratorProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IRandomNumberGenerator - { - private IRandomNumberGeneratorProxy(ByRefValue reference): base(reference) + /// Generates random numbers. + [JsiiTypeProxy(nativeType: typeof(IRandomNumberGenerator), fullyQualifiedName: "jsii-calc.IRandomNumberGenerator")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IRandomNumberGenerator { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - /// Returns another random number. - /// A random number. - [JsiiMethod(name: "next", returnsJson: "{\\"type\\":{\\"primitive\\":\\"number\\"}}")] - public double Next() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + /// Returns another random number. + /// A random number. + [JsiiMethod(name: "next", returnsJson: "{\\"type\\":{\\"primitive\\":\\"number\\"}}")] + public double Next() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } } } } @@ -8863,30 +8299,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnJsii976Proxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// Returns a subclass of a known class which implements an interface. - [JsiiTypeProxy(nativeType: typeof(IReturnJsii976), fullyQualifiedName: "jsii-calc.IReturnJsii976")] - internal sealed class IReturnJsii976Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IReturnJsii976 - { - private IReturnJsii976Proxy(ByRefValue reference): base(reference) + /// Returns a subclass of a known class which implements an interface. + [JsiiTypeProxy(nativeType: typeof(IReturnJsii976), fullyQualifiedName: "jsii-calc.IReturnJsii976")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IReturnJsii976 { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] - public double Foo - { - get => GetInstanceProperty()!; + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] + public double Foo + { + get => GetInstanceProperty()!; + } } } } @@ -8910,35 +8336,25 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiMethod(name: "obtainNumber", returnsJson: "{\\"type\\":{\\"fqn\\":\\"@scope/jsii-calc-lib.IDoublable\\"}}")] Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IDoublable ObtainNumber(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnsNumberProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IReturnsNumber), fullyQualifiedName: "jsii-calc.IReturnsNumber")] - internal sealed class IReturnsNumberProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IReturnsNumber - { - private IReturnsNumberProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IReturnsNumber), fullyQualifiedName: "jsii-calc.IReturnsNumber")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IReturnsNumber { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "numberProp", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-lib.Number\\"}")] - public Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number NumberProp - { - get => GetInstanceProperty()!; - } + [JsiiProperty(name: "numberProp", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-lib.Number\\"}")] + public Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number NumberProp + { + get => GetInstanceProperty()!; + } - [JsiiMethod(name: "obtainNumber", returnsJson: "{\\"type\\":{\\"fqn\\":\\"@scope/jsii-calc-lib.IDoublable\\"}}")] - public Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IDoublable ObtainNumber() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + [JsiiMethod(name: "obtainNumber", returnsJson: "{\\"type\\":{\\"fqn\\":\\"@scope/jsii-calc-lib.IDoublable\\"}}")] + public Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IDoublable ObtainNumber() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } } } } @@ -8976,6 +8392,33 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } + + /// This is here to check that we can pass a nested struct into a kwargs by specifying it as an in-line dictionary. + /// + /// This is cheating with the (current) declared types, but this is the "more + /// idiomatic" way for Pythonists. + /// + [JsiiTypeProxy(nativeType: typeof(IRootStruct), fullyQualifiedName: "jsii-calc.RootStruct")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IRootStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// May not be empty. + [JsiiProperty(name: "stringProp", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string StringProp + { + get => GetInstanceProperty()!; + } + + [JsiiOptional] + [JsiiProperty(name: "nestedStruct", typeJson: "{\\"fqn\\":\\"jsii-calc.NestedStruct\\"}", isOptional: true)] + public Amazon.JSII.Tests.CalculatorNamespace.INestedStruct? NestedStruct + { + get => GetInstanceProperty(); + } + } } } @@ -9008,6 +8451,29 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } + + [JsiiTypeProxy(nativeType: typeof(ISecondLevelStruct), fullyQualifiedName: "jsii-calc.SecondLevelStruct")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.ISecondLevelStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// It's long and required. + [JsiiProperty(name: "deeperRequiredProp", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string DeeperRequiredProp + { + get => GetInstanceProperty()!; + } + + /// It's long, but you'll almost never pass it. + [JsiiOptional] + [JsiiProperty(name: "deeperOptionalProp", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + public string? DeeperOptionalProp + { + get => GetInstanceProperty(); + } + } } } @@ -9034,6 +8500,26 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } + + [JsiiTypeProxy(nativeType: typeof(ISmellyStruct), fullyQualifiedName: "jsii-calc.SmellyStruct")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.ISmellyStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Property + { + get => GetInstanceProperty()!; + } + + [JsiiProperty(name: "yetAnoterOne", typeJson: "{\\"primitive\\":\\"boolean\\"}")] + public bool YetAnoterOne + { + get => GetInstanceProperty()!; + } + } } } @@ -9064,37 +8550,27 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiMethod(name: "method")] void Method(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IStableInterfaceProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IStableInterface), fullyQualifiedName: "jsii-calc.IStableInterface")] - internal sealed class IStableInterfaceProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStableInterface - { - private IStableInterfaceProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IStableInterface), fullyQualifiedName: "jsii-calc.IStableInterface")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStableInterface { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiOptional] - [JsiiProperty(name: "mutableProperty", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] - public double? MutableProperty - { - get => GetInstanceProperty(); - set => SetInstanceProperty(value); - } + [JsiiOptional] + [JsiiProperty(name: "mutableProperty", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] + public double? MutableProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } - [JsiiMethod(name: "method")] - public void Method() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + [JsiiMethod(name: "method")] + public void Method() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } } } } @@ -9116,6 +8592,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } + + [JsiiTypeProxy(nativeType: typeof(IStableStruct), fullyQualifiedName: "jsii-calc.StableStruct")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStableStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string ReadonlyProperty + { + get => GetInstanceProperty()!; + } + } } } @@ -9157,6 +8647,35 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } + + /// We can serialize and deserialize structs without silently ignoring optional fields. + [JsiiTypeProxy(nativeType: typeof(IStructA), fullyQualifiedName: "jsii-calc.StructA")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStructA + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "requiredString", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string RequiredString + { + get => GetInstanceProperty()!; + } + + [JsiiOptional] + [JsiiProperty(name: "optionalNumber", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] + public double? OptionalNumber + { + get => GetInstanceProperty(); + } + + [JsiiOptional] + [JsiiProperty(name: "optionalString", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + public string? OptionalString + { + get => GetInstanceProperty(); + } + } } } @@ -9198,6 +8717,35 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } + + /// This intentionally overlaps with StructA (where only requiredString is provided) to test htat the kernel properly disambiguates those. + [JsiiTypeProxy(nativeType: typeof(IStructB), fullyQualifiedName: "jsii-calc.StructB")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStructB + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "requiredString", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string RequiredString + { + get => GetInstanceProperty()!; + } + + [JsiiOptional] + [JsiiProperty(name: "optionalBoolean", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] + public bool? OptionalBoolean + { + get => GetInstanceProperty(); + } + + [JsiiOptional] + [JsiiProperty(name: "optionalStructA", typeJson: "{\\"fqn\\":\\"jsii-calc.StructA\\"}", isOptional: true)] + public Amazon.JSII.Tests.CalculatorNamespace.IStructA? OptionalStructA + { + get => GetInstanceProperty(); + } + } } } @@ -9227,9 +8775,34 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [Amazon.JSII.Runtime.Deputy.JsiiOptional] bool? Props { - get + get + { + return null; + } + } + + /// Verifies that, in languages that do keyword lifting (e.g: Python), having a struct member with the same name as a positional parameter results in the correct code being emitted. + /// + /// See: https://github.com/aws/aws-cdk/issues/4302 + /// + [JsiiTypeProxy(nativeType: typeof(IStructParameterType), fullyQualifiedName: "jsii-calc.StructParameterType")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStructParameterType + { + private _Proxy(ByRefValue reference): base(reference) { - return null; + } + + [JsiiProperty(name: "scope", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Scope + { + get => GetInstanceProperty()!; + } + + [JsiiOptional] + [JsiiProperty(name: "props", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] + public bool? Props + { + get => GetInstanceProperty(); } } } @@ -9250,30 +8823,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiMethod(name: "returnStruct", returnsJson: "{\\"type\\":{\\"fqn\\":\\"jsii-calc.StructB\\"}}")] Amazon.JSII.Tests.CalculatorNamespace.IStructB ReturnStruct(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IStructReturningDelegateProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// Verifies that a "pure" implementation of an interface works correctly. - [JsiiTypeProxy(nativeType: typeof(IStructReturningDelegate), fullyQualifiedName: "jsii-calc.IStructReturningDelegate")] - internal sealed class IStructReturningDelegateProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStructReturningDelegate - { - private IStructReturningDelegateProxy(ByRefValue reference): base(reference) + /// Verifies that a "pure" implementation of an interface works correctly. + [JsiiTypeProxy(nativeType: typeof(IStructReturningDelegate), fullyQualifiedName: "jsii-calc.IStructReturningDelegate")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStructReturningDelegate { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "returnStruct", returnsJson: "{\\"type\\":{\\"fqn\\":\\"jsii-calc.StructB\\"}}")] - public Amazon.JSII.Tests.CalculatorNamespace.IStructB ReturnStruct() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + [JsiiMethod(name: "returnStruct", returnsJson: "{\\"type\\":{\\"fqn\\":\\"jsii-calc.StructB\\"}}")] + public Amazon.JSII.Tests.CalculatorNamespace.IStructB ReturnStruct() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } } } } @@ -9325,6 +8888,41 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } + + [JsiiTypeProxy(nativeType: typeof(IStructWithJavaReservedWords), fullyQualifiedName: "jsii-calc.StructWithJavaReservedWords")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStructWithJavaReservedWords + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "default", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Default + { + get => GetInstanceProperty()!; + } + + [JsiiOptional] + [JsiiProperty(name: "assert", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + public string? Assert + { + get => GetInstanceProperty(); + } + + [JsiiOptional] + [JsiiProperty(name: "result", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + public string? Result + { + get => GetInstanceProperty(); + } + + [JsiiOptional] + [JsiiProperty(name: "that", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + public string? That + { + get => GetInstanceProperty(); + } + } } } @@ -9360,6 +8958,32 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } + + [JsiiTypeProxy(nativeType: typeof(ISupportsNiceJavaBuilderProps), fullyQualifiedName: "jsii-calc.SupportsNiceJavaBuilderProps")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.ISupportsNiceJavaBuilderProps + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// Some number, like 42. + [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"number\\"}")] + public double Bar + { + get => GetInstanceProperty()!; + } + + /// An \`id\` field here is terrible API design, because the constructor of \`SupportsNiceJavaBuilder\` already has a parameter named \`id\`. + /// + /// But here we are, doing it like we didn't care. + /// + [JsiiOptional] + [JsiiProperty(name: "id", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + public string? Id + { + get => GetInstanceProperty(); + } + } } } @@ -9399,6 +9023,36 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } + + [JsiiTypeProxy(nativeType: typeof(ITopLevelStruct), fullyQualifiedName: "jsii-calc.TopLevelStruct")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.ITopLevelStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// This is a required field. + [JsiiProperty(name: "required", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Required + { + get => GetInstanceProperty()!; + } + + /// A union to really stress test our serialization. + [JsiiProperty(name: "secondLevel", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"number\\"},{\\"fqn\\":\\"jsii-calc.SecondLevelStruct\\"}]}}")] + public object SecondLevel + { + get => GetInstanceProperty()!; + } + + /// You don't have to pass this. + [JsiiOptional] + [JsiiProperty(name: "optional", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + public string? Optional + { + get => GetInstanceProperty(); + } + } } } @@ -9429,6 +9083,27 @@ namespace Amazon.JSII.Tests.CalculatorNamespace return null; } } + + [JsiiTypeProxy(nativeType: typeof(IUnionProperties), fullyQualifiedName: "jsii-calc.UnionProperties")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IUnionProperties + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "bar", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"string\\"},{\\"primitive\\":\\"number\\"},{\\"fqn\\":\\"jsii-calc.AllTypes\\"}]}}")] + public object Bar + { + get => GetInstanceProperty()!; + } + + [JsiiOptional] + [JsiiProperty(name: "foo", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"string\\"},{\\"primitive\\":\\"number\\"}]}}", isOptional: true)] + public object? Foo + { + get => GetInstanceProperty(); + } + } } } @@ -9448,31 +9123,21 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Returns the current time, formatted as an ISO-8601 string. [JsiiMethod(name: "iso8601Now", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] string Iso8601Now(); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IWallClockProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// Implement this interface. - [JsiiTypeProxy(nativeType: typeof(IWallClock), fullyQualifiedName: "jsii-calc.IWallClock")] - internal sealed class IWallClockProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IWallClock - { - private IWallClockProxy(ByRefValue reference): base(reference) + /// Implement this interface. + [JsiiTypeProxy(nativeType: typeof(IWallClock), fullyQualifiedName: "jsii-calc.IWallClock")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IWallClock { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - /// Returns the current time, formatted as an ISO-8601 string. - [JsiiMethod(name: "iso8601Now", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] - public string Iso8601Now() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + /// Returns the current time, formatted as an ISO-8601 string. + [JsiiMethod(name: "iso8601Now", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] + public string Iso8601Now() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } } } } @@ -9702,42 +9367,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBaseProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IImplictBaseOfBase), fullyQualifiedName: "jsii-calc.ImplictBaseOfBase")] - internal sealed class ImplictBaseOfBaseProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IImplictBaseOfBase - { - private ImplictBaseOfBaseProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "goo", typeJson: "{\\"primitive\\":\\"date\\"}")] - public System.DateTime Goo - { - get => GetInstanceProperty()!; - } - - [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Bar - { - get => GetInstanceProperty()!; - } - - [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-base-of-base.Very\\"}")] - public Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.Very Foo - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InbetweenClass.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -9895,30 +9524,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceIncludesClas `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/HelloProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceIncludesClasses -{ - [JsiiTypeProxy(nativeType: typeof(IHello), fullyQualifiedName: "jsii-calc.InterfaceInNamespaceIncludesClasses.Hello")] - internal sealed class HelloProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceIncludesClasses.IHello - { - private HelloProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] - public double Foo - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/IHello.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -9934,6 +9539,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceIncludesClas { get; } + + [JsiiTypeProxy(nativeType: typeof(IHello), fullyQualifiedName: "jsii-calc.InterfaceInNamespaceIncludesClasses.Hello")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceIncludesClasses.IHello + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] + public double Foo + { + get => GetInstanceProperty()!; + } + } } } @@ -9962,30 +9581,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceOnlyInterfac `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceOnlyInterface/HelloProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceOnlyInterface -{ - [JsiiTypeProxy(nativeType: typeof(IHello), fullyQualifiedName: "jsii-calc.InterfaceInNamespaceOnlyInterface.Hello")] - internal sealed class HelloProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceOnlyInterface.IHello - { - private HelloProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] - public double Foo - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceOnlyInterface/IHello.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -10001,6 +9596,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceOnlyInterfac { get; } + + [JsiiTypeProxy(nativeType: typeof(IHello), fullyQualifiedName: "jsii-calc.InterfaceInNamespaceOnlyInterface.Hello")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceOnlyInterface.IHello + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] + public double Foo + { + get => GetInstanceProperty()!; + } + } } } @@ -10097,28 +9706,18 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; } - } -} - -`; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IsomorphismProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// Checks the "same instance" isomorphism is preserved within the constructor. - /// - /// Create a subclass of this, and assert that this.myself() actually returns - /// this from within the constructor. - /// - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.Isomorphism), fullyQualifiedName: "jsii-calc.Isomorphism")] - internal sealed class IsomorphismProxy : Amazon.JSII.Tests.CalculatorNamespace.Isomorphism - { - private IsomorphismProxy(ByRefValue reference): base(reference) + /// Checks the "same instance" isomorphism is preserved within the constructor. + /// + /// Create a subclass of this, and assert that this.myself() actually returns + /// this from within the constructor. + /// + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.Isomorphism), fullyQualifiedName: "jsii-calc.Isomorphism")] + internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.Isomorphism { + private _Proxy(ByRefValue reference): base(reference) + { + } } } } @@ -10967,18 +10566,19 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } - } - [JsiiTypeProxy(nativeType: typeof(IPropBooleanValue), fullyQualifiedName: "jsii-calc.LevelOne.PropBooleanValue")] - internal sealed class PropBooleanValueProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.LevelOne.IPropBooleanValue - { - private PropBooleanValueProxy(ByRefValue reference): base(reference) - { - } - [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"boolean\\"}")] - public bool Value + [JsiiTypeProxy(nativeType: typeof(IPropBooleanValue), fullyQualifiedName: "jsii-calc.LevelOne.PropBooleanValue")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.LevelOne.IPropBooleanValue { - get => GetInstanceProperty()!; + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"boolean\\"}")] + public bool Value + { + get => GetInstanceProperty()!; + } } } #pragma warning disable CS8618 @@ -11001,18 +10601,19 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get; } - } - [JsiiTypeProxy(nativeType: typeof(IPropProperty), fullyQualifiedName: "jsii-calc.LevelOne.PropProperty")] - internal sealed class PropPropertyProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.LevelOne.IPropProperty - { - private PropPropertyProxy(ByRefValue reference): base(reference) - { - } - [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.LevelOne.PropBooleanValue\\"}")] - public Amazon.JSII.Tests.CalculatorNamespace.LevelOne.IPropBooleanValue Prop + [JsiiTypeProxy(nativeType: typeof(IPropProperty), fullyQualifiedName: "jsii-calc.LevelOne.PropProperty")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.LevelOne.IPropProperty { - get => GetInstanceProperty()!; + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.LevelOne.PropBooleanValue\\"}")] + public Amazon.JSII.Tests.CalculatorNamespace.LevelOne.IPropBooleanValue Prop + { + get => GetInstanceProperty()!; + } } } #pragma warning disable CS8618 @@ -11037,42 +10638,18 @@ using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - #pragma warning disable CS8618 - - [JsiiByValue(fqn: "jsii-calc.LevelOneProps")] - public class LevelOneProps : Amazon.JSII.Tests.CalculatorNamespace.ILevelOneProps - { - [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.LevelOne.PropProperty\\"}", isOverride: true)] - public Amazon.JSII.Tests.CalculatorNamespace.LevelOne.IPropProperty Prop - { - get; - set; - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LevelOnePropsProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(ILevelOneProps), fullyQualifiedName: "jsii-calc.LevelOneProps")] - internal sealed class LevelOnePropsProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.ILevelOneProps - { - private LevelOnePropsProxy(ByRefValue reference): base(reference) - { - } +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + #pragma warning disable CS8618 - [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.LevelOne.PropProperty\\"}")] + [JsiiByValue(fqn: "jsii-calc.LevelOneProps")] + public class LevelOneProps : Amazon.JSII.Tests.CalculatorNamespace.ILevelOneProps + { + [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.LevelOne.PropProperty\\"}", isOverride: true)] public Amazon.JSII.Tests.CalculatorNamespace.LevelOne.IPropProperty Prop { - get => GetInstanceProperty()!; + get; + set; } } } @@ -11180,106 +10757,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServicePropsProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// jsii#298: show default values in sphinx documentation, and respect newlines. - [JsiiTypeProxy(nativeType: typeof(ILoadBalancedFargateServiceProps), fullyQualifiedName: "jsii-calc.LoadBalancedFargateServiceProps")] - internal sealed class LoadBalancedFargateServicePropsProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.ILoadBalancedFargateServiceProps - { - private LoadBalancedFargateServicePropsProxy(ByRefValue reference): base(reference) - { - } - - /// The container port of the application load balancer attached to your Fargate service. - /// - /// Corresponds to container port mapping. - /// - /// Default: 80 - /// - [JsiiOptional] - [JsiiProperty(name: "containerPort", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] - public double? ContainerPort - { - get => GetInstanceProperty(); - } - - /// The number of cpu units used by the task. - /// - /// Valid values, which determines your range of valid values for the memory parameter: - /// 256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB - /// 512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB - /// 1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB - /// 2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments - /// 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments - /// - /// This default is set in the underlying FargateTaskDefinition construct. - /// - /// Default: 256 - /// - [JsiiOptional] - [JsiiProperty(name: "cpu", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - public string? Cpu - { - get => GetInstanceProperty(); - } - - /// The amount (in MiB) of memory used by the task. - /// - /// This field is required and you must use one of the following values, which determines your range of valid values - /// for the cpu parameter: - /// - /// 0.5GB, 1GB, 2GB - Available cpu values: 256 (.25 vCPU) - /// - /// 1GB, 2GB, 3GB, 4GB - Available cpu values: 512 (.5 vCPU) - /// - /// 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB - Available cpu values: 1024 (1 vCPU) - /// - /// Between 4GB and 16GB in 1GB increments - Available cpu values: 2048 (2 vCPU) - /// - /// Between 8GB and 30GB in 1GB increments - Available cpu values: 4096 (4 vCPU) - /// - /// This default is set in the underlying FargateTaskDefinition construct. - /// - /// Default: 512 - /// - [JsiiOptional] - [JsiiProperty(name: "memoryMiB", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - public string? MemoryMiB - { - get => GetInstanceProperty(); - } - - /// Determines whether the Application Load Balancer will be internet-facing. - /// - /// Default: true - /// - [JsiiOptional] - [JsiiProperty(name: "publicLoadBalancer", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] - public bool? PublicLoadBalancer - { - get => GetInstanceProperty(); - } - - /// Determines whether your Fargate Service will be assigned a public IP address. - /// - /// Default: false - /// - [JsiiOptional] - [JsiiProperty(name: "publicTasks", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] - public bool? PublicTasks - { - get => GetInstanceProperty(); - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/MethodNamedProperty.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -11563,31 +11040,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NestedStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(INestedStruct), fullyQualifiedName: "jsii-calc.NestedStruct")] - internal sealed class NestedStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.INestedStruct - { - private NestedStructProxy(ByRefValue reference): base(reference) - { - } - - /// When provided, must be > 0. - [JsiiProperty(name: "numberProp", typeJson: "{\\"primitive\\":\\"number\\"}")] - public double NumberProp - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NodeStandardLibrary.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -11742,37 +11194,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NullShouldBeTreatedAsUndefinedDataProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(INullShouldBeTreatedAsUndefinedData), fullyQualifiedName: "jsii-calc.NullShouldBeTreatedAsUndefinedData")] - internal sealed class NullShouldBeTreatedAsUndefinedDataProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.INullShouldBeTreatedAsUndefinedData - { - private NullShouldBeTreatedAsUndefinedDataProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "arrayWithThreeElementsAndUndefinedAsSecondArgument", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"any\\"},\\"kind\\":\\"array\\"}}")] - public object[] ArrayWithThreeElementsAndUndefinedAsSecondArgument - { - get => GetInstanceProperty()!; - } - - [JsiiOptional] - [JsiiProperty(name: "thisShouldBeUndefined", typeJson: "{\\"primitive\\":\\"any\\"}", isOptional: true)] - public object? ThisShouldBeUndefined - { - get => GetInstanceProperty(); - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NumberGenerator.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -12116,31 +11537,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IOptionalStruct), fullyQualifiedName: "jsii-calc.OptionalStruct")] - internal sealed class OptionalStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IOptionalStruct - { - private OptionalStructProxy(ByRefValue reference): base(reference) - { - } - - [JsiiOptional] - [JsiiProperty(name: "field", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - public string? Field - { - get => GetInstanceProperty(); - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OverridableProtectedMember.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -12269,31 +11665,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ParentStruct982Proxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// https://github.com/aws/jsii/issues/982. - [JsiiTypeProxy(nativeType: typeof(IParentStruct982), fullyQualifiedName: "jsii-calc.ParentStruct982")] - internal sealed class ParentStruct982Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IParentStruct982 - { - private ParentStruct982Proxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Foo - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PartiallyInitializedThisConsumer.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -12325,29 +11696,19 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiMethod(name: "consumePartiallyInitializedThis", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"name\\":\\"obj\\",\\"type\\":{\\"fqn\\":\\"jsii-calc.ConstructorPassesThisOut\\"}},{\\"name\\":\\"dt\\",\\"type\\":{\\"primitive\\":\\"date\\"}},{\\"name\\":\\"ev\\",\\"type\\":{\\"fqn\\":\\"jsii-calc.AllTypesEnum\\"}}]")] public abstract string ConsumePartiallyInitializedThis(Amazon.JSII.Tests.CalculatorNamespace.ConstructorPassesThisOut obj, System.DateTime dt, Amazon.JSII.Tests.CalculatorNamespace.AllTypesEnum ev); - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PartiallyInitializedThisConsumerProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.PartiallyInitializedThisConsumer), fullyQualifiedName: "jsii-calc.PartiallyInitializedThisConsumer")] - internal sealed class PartiallyInitializedThisConsumerProxy : Amazon.JSII.Tests.CalculatorNamespace.PartiallyInitializedThisConsumer - { - private PartiallyInitializedThisConsumerProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.PartiallyInitializedThisConsumer), fullyQualifiedName: "jsii-calc.PartiallyInitializedThisConsumer")] + internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.PartiallyInitializedThisConsumer { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "consumePartiallyInitializedThis", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"name\\":\\"obj\\",\\"type\\":{\\"fqn\\":\\"jsii-calc.ConstructorPassesThisOut\\"}},{\\"name\\":\\"dt\\",\\"type\\":{\\"primitive\\":\\"date\\"}},{\\"name\\":\\"ev\\",\\"type\\":{\\"fqn\\":\\"jsii-calc.AllTypesEnum\\"}}]")] - public override string ConsumePartiallyInitializedThis(Amazon.JSII.Tests.CalculatorNamespace.ConstructorPassesThisOut obj, System.DateTime dt, Amazon.JSII.Tests.CalculatorNamespace.AllTypesEnum ev) - { - return InvokeInstanceMethod(new System.Type[]{typeof(Amazon.JSII.Tests.CalculatorNamespace.ConstructorPassesThisOut), typeof(System.DateTime), typeof(Amazon.JSII.Tests.CalculatorNamespace.AllTypesEnum)}, new object[]{obj, dt, ev})!; + [JsiiMethod(name: "consumePartiallyInitializedThis", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"name\\":\\"obj\\",\\"type\\":{\\"fqn\\":\\"jsii-calc.ConstructorPassesThisOut\\"}},{\\"name\\":\\"dt\\",\\"type\\":{\\"primitive\\":\\"date\\"}},{\\"name\\":\\"ev\\",\\"type\\":{\\"fqn\\":\\"jsii-calc.AllTypesEnum\\"}}]")] + public override string ConsumePartiallyInitializedThis(Amazon.JSII.Tests.CalculatorNamespace.ConstructorPassesThisOut obj, System.DateTime dt, Amazon.JSII.Tests.CalculatorNamespace.AllTypesEnum ev) + { + return InvokeInstanceMethod(new System.Type[]{typeof(Amazon.JSII.Tests.CalculatorNamespace.ConstructorPassesThisOut), typeof(System.DateTime), typeof(Amazon.JSII.Tests.CalculatorNamespace.AllTypesEnum)}, new object[]{obj, dt, ev})!; + } } } } @@ -12853,29 +12214,19 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.PythonSelf { [JsiiMethod(name: "method", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"name\\":\\"self\\",\\"type\\":{\\"primitive\\":\\"number\\"}}]")] string Method(double self); - } -} - -`; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PythonSelf/IInterfaceWithSelfProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.PythonSelf -{ - [JsiiTypeProxy(nativeType: typeof(IInterfaceWithSelf), fullyQualifiedName: "jsii-calc.PythonSelf.IInterfaceWithSelf")] - internal sealed class IInterfaceWithSelfProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.PythonSelf.IInterfaceWithSelf - { - private IInterfaceWithSelfProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(IInterfaceWithSelf), fullyQualifiedName: "jsii-calc.PythonSelf.IInterfaceWithSelf")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.PythonSelf.IInterfaceWithSelf { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "method", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"name\\":\\"self\\",\\"type\\":{\\"primitive\\":\\"number\\"}}]")] - public string Method(double self) - { - return InvokeInstanceMethod(new System.Type[]{typeof(double)}, new object[]{self})!; + [JsiiMethod(name: "method", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"name\\":\\"self\\",\\"type\\":{\\"primitive\\":\\"number\\"}}]")] + public string Method(double self) + { + return InvokeInstanceMethod(new System.Type[]{typeof(double)}, new object[]{self})!; + } } } } @@ -12897,52 +12248,42 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.PythonSelf { get; } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PythonSelf/StructWithSelf.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace.PythonSelf -{ - #pragma warning disable CS8618 - - [JsiiByValue(fqn: "jsii-calc.PythonSelf.StructWithSelf")] - public class StructWithSelf : Amazon.JSII.Tests.CalculatorNamespace.PythonSelf.IStructWithSelf - { - [JsiiProperty(name: "self", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] - public string Self + [JsiiTypeProxy(nativeType: typeof(IStructWithSelf), fullyQualifiedName: "jsii-calc.PythonSelf.StructWithSelf")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.PythonSelf.IStructWithSelf { - get; - set; + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "self", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Self + { + get => GetInstanceProperty()!; + } } } } `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PythonSelf/StructWithSelfProxy.cs 1`] = ` +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PythonSelf/StructWithSelf.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 namespace Amazon.JSII.Tests.CalculatorNamespace.PythonSelf { - [JsiiTypeProxy(nativeType: typeof(IStructWithSelf), fullyQualifiedName: "jsii-calc.PythonSelf.StructWithSelf")] - internal sealed class StructWithSelfProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.PythonSelf.IStructWithSelf - { - private StructWithSelfProxy(ByRefValue reference): base(reference) - { - } + #pragma warning disable CS8618 - [JsiiProperty(name: "self", typeJson: "{\\"primitive\\":\\"string\\"}")] + [JsiiByValue(fqn: "jsii-calc.PythonSelf.StructWithSelf")] + public class StructWithSelf : Amazon.JSII.Tests.CalculatorNamespace.PythonSelf.IStructWithSelf + { + [JsiiProperty(name: "self", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] public string Self { - get => GetInstanceProperty()!; + get; + set; } } } @@ -13082,43 +12423,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/RootStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// This is here to check that we can pass a nested struct into a kwargs by specifying it as an in-line dictionary. - /// - /// This is cheating with the (current) declared types, but this is the "more - /// idiomatic" way for Pythonists. - /// - [JsiiTypeProxy(nativeType: typeof(IRootStruct), fullyQualifiedName: "jsii-calc.RootStruct")] - internal sealed class RootStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IRootStruct - { - private RootStructProxy(ByRefValue reference): base(reference) - { - } - - /// May not be empty. - [JsiiProperty(name: "stringProp", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string StringProp - { - get => GetInstanceProperty()!; - } - - [JsiiOptional] - [JsiiProperty(name: "nestedStruct", typeJson: "{\\"fqn\\":\\"jsii-calc.NestedStruct\\"}", isOptional: true)] - public Amazon.JSII.Tests.CalculatorNamespace.INestedStruct? NestedStruct - { - get => GetInstanceProperty(); - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/RootStructValidator.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -13237,39 +12541,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SecondLevelStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(ISecondLevelStruct), fullyQualifiedName: "jsii-calc.SecondLevelStruct")] - internal sealed class SecondLevelStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.ISecondLevelStruct - { - private SecondLevelStructProxy(ByRefValue reference): base(reference) - { - } - - /// It's long and required. - [JsiiProperty(name: "deeperRequiredProp", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string DeeperRequiredProp - { - get => GetInstanceProperty()!; - } - - /// It's long, but you'll almost never pass it. - [JsiiOptional] - [JsiiProperty(name: "deeperOptionalProp", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - public string? DeeperOptionalProp - { - get => GetInstanceProperty(); - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SingleInstanceTwoTypes.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -13466,36 +12737,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SmellyStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(ISmellyStruct), fullyQualifiedName: "jsii-calc.SmellyStruct")] - internal sealed class SmellyStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.ISmellyStruct - { - private SmellyStructProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Property - { - get => GetInstanceProperty()!; - } - - [JsiiProperty(name: "yetAnoterOne", typeJson: "{\\"primitive\\":\\"boolean\\"}")] - public bool YetAnoterOne - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SomeTypeJsii976.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -13635,69 +12876,135 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StableStructProxy.cs 1`] = ` +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StaticContext.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(nativeType: typeof(IStableStruct), fullyQualifiedName: "jsii-calc.StableStruct")] - internal sealed class StableStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStableStruct + /// This is used to validate the ability to use \`this\` from within a static context. + /// + /// https://github.com/awslabs/aws-cdk/issues/2304 + /// + [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticContext), fullyQualifiedName: "jsii-calc.StaticContext")] + public class StaticContext : DeputyBase { - private StableStructProxy(ByRefValue reference): base(reference) + /// Used by jsii to construct an instance of this class from a Javascript-owned object reference + /// The Javascript-owned object reference + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected StaticContext(ByRefValue reference): base(reference) { } - [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string ReadonlyProperty + /// Used by jsii to construct an instance of this class from DeputyProps + /// The deputy props + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected StaticContext(DeputyProps props): base(props) { - get => GetInstanceProperty()!; + } + + [JsiiMethod(name: "canAccessStaticContext", returnsJson: "{\\"type\\":{\\"primitive\\":\\"boolean\\"}}")] + public static bool CanAccessStaticContext() + { + return InvokeStaticMethod(typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticContext), new System.Type[]{}, new object[]{})!; + } + + [JsiiProperty(name: "staticVariable", typeJson: "{\\"primitive\\":\\"boolean\\"}")] + public static bool StaticVariable + { + get => GetStaticProperty(typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticContext))!; + set => SetStaticProperty(typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticContext), value); } } } `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StaticContext.cs 1`] = ` +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StaticHelloChild.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 namespace Amazon.JSII.Tests.CalculatorNamespace { - /// This is used to validate the ability to use \`this\` from within a static context. + [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticHelloChild), fullyQualifiedName: "jsii-calc.StaticHelloChild")] + public class StaticHelloChild : Amazon.JSII.Tests.CalculatorNamespace.StaticHelloParent + { + /// Used by jsii to construct an instance of this class from a Javascript-owned object reference + /// The Javascript-owned object reference + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected StaticHelloChild(ByRefValue reference): base(reference) + { + } + + /// Used by jsii to construct an instance of this class from DeputyProps + /// The deputy props + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected StaticHelloChild(DeputyProps props): base(props) + { + } + + [JsiiMethod(name: "method", isOverride: true)] + public static new void Method() + { + InvokeStaticVoidMethod(typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticHelloChild), new System.Type[]{}, new object[]{}); + } + + [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"number\\"}")] + public static new double Property + { + get => GetStaticProperty(typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticHelloChild))!; + } + } +} + +`; + +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StaticHelloParent.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// 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. /// - /// https://github.com/awslabs/aws-cdk/issues/2304 + /// 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. /// - [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticContext), fullyQualifiedName: "jsii-calc.StaticContext")] - public class StaticContext : DeputyBase + [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticHelloParent), fullyQualifiedName: "jsii-calc.StaticHelloParent")] + public class StaticHelloParent : DeputyBase { + public StaticHelloParent(): base(new DeputyProps(System.Array.Empty())) + { + } + /// Used by jsii to construct an instance of this class from a Javascript-owned object reference /// The Javascript-owned object reference [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - protected StaticContext(ByRefValue reference): base(reference) + protected StaticHelloParent(ByRefValue reference): base(reference) { } /// Used by jsii to construct an instance of this class from DeputyProps /// The deputy props [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - protected StaticContext(DeputyProps props): base(props) + protected StaticHelloParent(DeputyProps props): base(props) { } - [JsiiMethod(name: "canAccessStaticContext", returnsJson: "{\\"type\\":{\\"primitive\\":\\"boolean\\"}}")] - public static bool CanAccessStaticContext() + [JsiiMethod(name: "method")] + public static void Method() { - return InvokeStaticMethod(typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticContext), new System.Type[]{}, new object[]{})!; + InvokeStaticVoidMethod(typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticHelloParent), new System.Type[]{}, new object[]{}); } - [JsiiProperty(name: "staticVariable", typeJson: "{\\"primitive\\":\\"boolean\\"}")] - public static bool StaticVariable + [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"number\\"}")] + public static double Property { - get => GetStaticProperty(typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticContext))!; - set => SetStaticProperty(typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticContext), value); + get => GetStaticProperty(typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticHelloParent))!; } } } @@ -13837,115 +13144,36 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.StripInternal), fullyQualifiedName: "jsii-calc.StripInternal")] public class StripInternal : DeputyBase { - public StripInternal(): base(new DeputyProps(System.Array.Empty())) - { - } - - /// Used by jsii to construct an instance of this class from a Javascript-owned object reference - /// The Javascript-owned object reference - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - protected StripInternal(ByRefValue reference): base(reference) - { - } - - /// Used by jsii to construct an instance of this class from DeputyProps - /// The deputy props - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - protected StripInternal(DeputyProps props): base(props) - { - } - - [JsiiProperty(name: "youSeeMe", typeJson: "{\\"primitive\\":\\"string\\"}")] - public virtual string YouSeeMe - { - get => GetInstanceProperty()!; - set => SetInstanceProperty(value); - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructA.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - #pragma warning disable CS8618 - - /// We can serialize and deserialize structs without silently ignoring optional fields. - [JsiiByValue(fqn: "jsii-calc.StructA")] - public class StructA : Amazon.JSII.Tests.CalculatorNamespace.IStructA - { - [JsiiProperty(name: "requiredString", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] - public string RequiredString - { - get; - set; - } - - [JsiiOptional] - [JsiiProperty(name: "optionalNumber", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true, isOverride: true)] - public double? OptionalNumber - { - get; - set; - } - - [JsiiOptional] - [JsiiProperty(name: "optionalString", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] - public string? OptionalString - { - get; - set; - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructAProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// We can serialize and deserialize structs without silently ignoring optional fields. - [JsiiTypeProxy(nativeType: typeof(IStructA), fullyQualifiedName: "jsii-calc.StructA")] - internal sealed class StructAProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStructA - { - private StructAProxy(ByRefValue reference): base(reference) + public StripInternal(): base(new DeputyProps(System.Array.Empty())) { } - [JsiiProperty(name: "requiredString", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string RequiredString + /// Used by jsii to construct an instance of this class from a Javascript-owned object reference + /// The Javascript-owned object reference + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected StripInternal(ByRefValue reference): base(reference) { - get => GetInstanceProperty()!; } - [JsiiOptional] - [JsiiProperty(name: "optionalNumber", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] - public double? OptionalNumber + /// Used by jsii to construct an instance of this class from DeputyProps + /// The deputy props + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected StripInternal(DeputyProps props): base(props) { - get => GetInstanceProperty(); } - [JsiiOptional] - [JsiiProperty(name: "optionalString", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - public string? OptionalString + [JsiiProperty(name: "youSeeMe", typeJson: "{\\"primitive\\":\\"string\\"}")] + public virtual string YouSeeMe { - get => GetInstanceProperty(); + get => GetInstanceProperty()!; + set => SetInstanceProperty(value); } } } `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructB.cs 1`] = ` +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructA.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 @@ -13954,9 +13182,9 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { #pragma warning disable CS8618 - /// This intentionally overlaps with StructA (where only requiredString is provided) to test htat the kernel properly disambiguates those. - [JsiiByValue(fqn: "jsii-calc.StructB")] - public class StructB : Amazon.JSII.Tests.CalculatorNamespace.IStructB + /// We can serialize and deserialize structs without silently ignoring optional fields. + [JsiiByValue(fqn: "jsii-calc.StructA")] + public class StructA : Amazon.JSII.Tests.CalculatorNamespace.IStructA { [JsiiProperty(name: "requiredString", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] public string RequiredString @@ -13966,16 +13194,16 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "optionalBoolean", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true, isOverride: true)] - public bool? OptionalBoolean + [JsiiProperty(name: "optionalNumber", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true, isOverride: true)] + public double? OptionalNumber { get; set; } [JsiiOptional] - [JsiiProperty(name: "optionalStructA", typeJson: "{\\"fqn\\":\\"jsii-calc.StructA\\"}", isOptional: true, isOverride: true)] - public Amazon.JSII.Tests.CalculatorNamespace.IStructA? OptionalStructA + [JsiiProperty(name: "optionalString", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + public string? OptionalString { get; set; @@ -13985,39 +13213,40 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructBProxy.cs 1`] = ` +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructB.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 namespace Amazon.JSII.Tests.CalculatorNamespace { + #pragma warning disable CS8618 + /// This intentionally overlaps with StructA (where only requiredString is provided) to test htat the kernel properly disambiguates those. - [JsiiTypeProxy(nativeType: typeof(IStructB), fullyQualifiedName: "jsii-calc.StructB")] - internal sealed class StructBProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStructB + [JsiiByValue(fqn: "jsii-calc.StructB")] + public class StructB : Amazon.JSII.Tests.CalculatorNamespace.IStructB { - private StructBProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "requiredString", typeJson: "{\\"primitive\\":\\"string\\"}")] + [JsiiProperty(name: "requiredString", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] public string RequiredString { - get => GetInstanceProperty()!; + get; + set; } [JsiiOptional] - [JsiiProperty(name: "optionalBoolean", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] + [JsiiProperty(name: "optionalBoolean", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true, isOverride: true)] public bool? OptionalBoolean { - get => GetInstanceProperty(); + get; + set; } [JsiiOptional] - [JsiiProperty(name: "optionalStructA", typeJson: "{\\"fqn\\":\\"jsii-calc.StructA\\"}", isOptional: true)] + [JsiiProperty(name: "optionalStructA", typeJson: "{\\"fqn\\":\\"jsii-calc.StructA\\"}", isOptional: true, isOverride: true)] public Amazon.JSII.Tests.CalculatorNamespace.IStructA? OptionalStructA { - get => GetInstanceProperty(); + get; + set; } } } @@ -14059,41 +13288,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructParameterTypeProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// Verifies that, in languages that do keyword lifting (e.g: Python), having a struct member with the same name as a positional parameter results in the correct code being emitted. - /// - /// See: https://github.com/aws/aws-cdk/issues/4302 - /// - [JsiiTypeProxy(nativeType: typeof(IStructParameterType), fullyQualifiedName: "jsii-calc.StructParameterType")] - internal sealed class StructParameterTypeProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStructParameterType - { - private StructParameterTypeProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "scope", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Scope - { - get => GetInstanceProperty()!; - } - - [JsiiOptional] - [JsiiProperty(name: "props", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] - public bool? Props - { - get => GetInstanceProperty(); - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructPassing.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -14226,51 +13420,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructWithJavaReservedWordsProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IStructWithJavaReservedWords), fullyQualifiedName: "jsii-calc.StructWithJavaReservedWords")] - internal sealed class StructWithJavaReservedWordsProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStructWithJavaReservedWords - { - private StructWithJavaReservedWordsProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "default", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Default - { - get => GetInstanceProperty()!; - } - - [JsiiOptional] - [JsiiProperty(name: "assert", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - public string? Assert - { - get => GetInstanceProperty(); - } - - [JsiiOptional] - [JsiiProperty(name: "result", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - public string? Result - { - get => GetInstanceProperty(); - } - - [JsiiOptional] - [JsiiProperty(name: "that", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - public string? That - { - get => GetInstanceProperty(); - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/BackReferences/IMyClassReference.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -14286,6 +13435,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.BackReferences { get; } + + [JsiiTypeProxy(nativeType: typeof(IMyClassReference), fullyQualifiedName: "jsii-calc.submodule.back_references.MyClassReference")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.Submodule.BackReferences.IMyClassReference + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "reference", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.MyClass\\"}")] + public Amazon.JSII.Tests.CalculatorNamespace.Submodule.MyClass Reference + { + get => GetInstanceProperty()!; + } + } } } @@ -14314,30 +13477,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.BackReferences `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/BackReferences/MyClassReferenceProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.BackReferences -{ - [JsiiTypeProxy(nativeType: typeof(IMyClassReference), fullyQualifiedName: "jsii-calc.submodule.back_references.MyClassReference")] - internal sealed class MyClassReferenceProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.Submodule.BackReferences.IMyClassReference - { - private MyClassReferenceProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "reference", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.MyClass\\"}")] - public Amazon.JSII.Tests.CalculatorNamespace.Submodule.MyClass Reference - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/Child/Awesomeness.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -14401,6 +13540,27 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child return null; } } + + [JsiiTypeProxy(nativeType: typeof(IKwargsProps), fullyQualifiedName: "jsii-calc.submodule.child.KwargsProps")] + new internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.IKwargsProps + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiOptional] + [JsiiProperty(name: "extra", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] + public string? Extra + { + get => GetInstanceProperty(); + } + + [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.child.SomeEnum\\"}")] + public Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.SomeEnum Prop + { + get => GetInstanceProperty()!; + } + } } } @@ -14421,6 +13581,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child { get; } + + [JsiiTypeProxy(nativeType: typeof(ISomeStruct), fullyQualifiedName: "jsii-calc.submodule.child.SomeStruct")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.ISomeStruct + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.child.SomeEnum\\"}")] + public Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.SomeEnum Prop + { + get => GetInstanceProperty()!; + } + } } } @@ -14441,6 +13615,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child { get; } + + [JsiiTypeProxy(nativeType: typeof(IStructure), fullyQualifiedName: "jsii-calc.submodule.child.Structure")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.IStructure + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "bool", typeJson: "{\\"primitive\\":\\"boolean\\"}")] + public bool Bool + { + get => GetInstanceProperty()!; + } + } } } @@ -14514,37 +13702,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/Child/KwargsPropsProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child -{ - [JsiiTypeProxy(nativeType: typeof(IKwargsProps), fullyQualifiedName: "jsii-calc.submodule.child.KwargsProps")] - internal sealed class KwargsPropsProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.IKwargsProps - { - private KwargsPropsProxy(ByRefValue reference): base(reference) - { - } - - [JsiiOptional] - [JsiiProperty(name: "extra", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - public string? Extra - { - get => GetInstanceProperty(); - } - - [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.child.SomeEnum\\"}")] - public Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.SomeEnum Prop - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/Child/OuterClass.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -14615,57 +13772,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child #pragma warning disable CS8618 [JsiiByValue(fqn: "jsii-calc.submodule.child.SomeStruct")] - public class SomeStruct : Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.ISomeStruct - { - [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.child.SomeEnum\\"}", isOverride: true)] - public Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.SomeEnum Prop - { - get; - set; - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/Child/SomeStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child -{ - [JsiiTypeProxy(nativeType: typeof(ISomeStruct), fullyQualifiedName: "jsii-calc.submodule.child.SomeStruct")] - internal sealed class SomeStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.ISomeStruct - { - private SomeStructProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.child.SomeEnum\\"}")] - public Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.SomeEnum Prop - { - get => GetInstanceProperty()!; - } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/Child/Structure.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child -{ - #pragma warning disable CS8618 - - [JsiiByValue(fqn: "jsii-calc.submodule.child.Structure")] - public class Structure : Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.IStructure + public class SomeStruct : Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.ISomeStruct { - [JsiiProperty(name: "bool", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOverride: true)] - public bool Bool + [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.child.SomeEnum\\"}", isOverride: true)] + public Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.SomeEnum Prop { get; set; @@ -14675,24 +13785,23 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/Child/StructureProxy.cs 1`] = ` +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/Child/Structure.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child { - [JsiiTypeProxy(nativeType: typeof(IStructure), fullyQualifiedName: "jsii-calc.submodule.child.Structure")] - internal sealed class StructureProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.IStructure - { - private StructureProxy(ByRefValue reference): base(reference) - { - } + #pragma warning disable CS8618 - [JsiiProperty(name: "bool", typeJson: "{\\"primitive\\":\\"boolean\\"}")] + [JsiiByValue(fqn: "jsii-calc.submodule.child.Structure")] + public class Structure : Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.IStructure + { + [JsiiProperty(name: "bool", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOverride: true)] public bool Bool { - get => GetInstanceProperty()!; + get; + set; } } } @@ -14819,29 +13928,19 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.NestedSubmodule.Deeply { get; } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/NestedSubmodule/DeeplyNested/INamespacedProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.NestedSubmodule.DeeplyNested -{ - [JsiiTypeProxy(nativeType: typeof(INamespaced), fullyQualifiedName: "jsii-calc.submodule.nested_submodule.deeplyNested.INamespaced")] - internal sealed class INamespacedProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.Submodule.NestedSubmodule.DeeplyNested.INamespaced - { - private INamespacedProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(INamespaced), fullyQualifiedName: "jsii-calc.submodule.nested_submodule.deeplyNested.INamespaced")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.Submodule.NestedSubmodule.DeeplyNested.INamespaced { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "definedAt", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string DefinedAt - { - get => GetInstanceProperty()!; + [JsiiProperty(name: "definedAt", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string DefinedAt + { + get => GetInstanceProperty()!; + } } } } @@ -14883,29 +13982,19 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.NestedSubmodule { get; } - } -} -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/NestedSubmodule/NamespacedProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.NestedSubmodule -{ - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.Submodule.NestedSubmodule.Namespaced), fullyQualifiedName: "jsii-calc.submodule.nested_submodule.Namespaced")] - internal sealed class NamespacedProxy : Amazon.JSII.Tests.CalculatorNamespace.Submodule.NestedSubmodule.Namespaced - { - private NamespacedProxy(ByRefValue reference): base(reference) + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.Submodule.NestedSubmodule.Namespaced), fullyQualifiedName: "jsii-calc.submodule.nested_submodule.Namespaced")] + internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.Submodule.NestedSubmodule.Namespaced { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiProperty(name: "goodness", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.child.Goodness\\"}")] - public override Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.Goodness Goodness - { - get => GetInstanceProperty()!; + [JsiiProperty(name: "goodness", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.child.Goodness\\"}")] + public override Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.Goodness Goodness + { + get => GetInstanceProperty()!; + } } } } @@ -14927,6 +14016,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Param { get; } + + [JsiiTypeProxy(nativeType: typeof(ISpecialParameter), fullyQualifiedName: "jsii-calc.submodule.param.SpecialParameter")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.Submodule.Param.ISpecialParameter + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Value + { + get => GetInstanceProperty()!; + } + } } } @@ -14955,30 +14058,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Param `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/Param/SpecialParameterProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Param -{ - [JsiiTypeProxy(nativeType: typeof(ISpecialParameter), fullyQualifiedName: "jsii-calc.submodule.param.SpecialParameter")] - internal sealed class SpecialParameterProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.Submodule.Param.ISpecialParameter - { - private SpecialParameterProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Value - { - get => GetInstanceProperty()!; - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/Returnsparam/ReturnsSpecialParameter.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -15153,42 +14232,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SupportsNiceJavaBuilderPropsProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(ISupportsNiceJavaBuilderProps), fullyQualifiedName: "jsii-calc.SupportsNiceJavaBuilderProps")] - internal sealed class SupportsNiceJavaBuilderPropsProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.ISupportsNiceJavaBuilderProps - { - private SupportsNiceJavaBuilderPropsProxy(ByRefValue reference): base(reference) - { - } - - /// Some number, like 42. - [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"number\\"}")] - public double Bar - { - get => GetInstanceProperty()!; - } - - /// An \`id\` field here is terrible API design, because the constructor of \`SupportsNiceJavaBuilder\` already has a parameter named \`id\`. - /// - /// But here we are, doing it like we didn't care. - /// - [JsiiOptional] - [JsiiProperty(name: "id", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - public string? Id - { - get => GetInstanceProperty(); - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SupportsNiceJavaBuilderWithRequiredProps.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -15456,46 +14499,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/TopLevelStructProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(ITopLevelStruct), fullyQualifiedName: "jsii-calc.TopLevelStruct")] - internal sealed class TopLevelStructProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.ITopLevelStruct - { - private TopLevelStructProxy(ByRefValue reference): base(reference) - { - } - - /// This is a required field. - [JsiiProperty(name: "required", typeJson: "{\\"primitive\\":\\"string\\"}")] - public string Required - { - get => GetInstanceProperty()!; - } - - /// A union to really stress test our serialization. - [JsiiProperty(name: "secondLevel", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"number\\"},{\\"fqn\\":\\"jsii-calc.SecondLevelStruct\\"}]}}")] - public object SecondLevel - { - get => GetInstanceProperty()!; - } - - /// You don't have to pass this. - [JsiiOptional] - [JsiiProperty(name: "optional", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] - public string? Optional - { - get => GetInstanceProperty(); - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UmaskCheck.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -15569,46 +14572,36 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get => GetInstanceProperty()!; } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperationProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// An operation on a single operand. - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.UnaryOperation), fullyQualifiedName: "jsii-calc.UnaryOperation")] - internal sealed class UnaryOperationProxy : Amazon.JSII.Tests.CalculatorNamespace.UnaryOperation - { - private UnaryOperationProxy(ByRefValue reference): base(reference) + /// An operation on a single operand. + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.UnaryOperation), fullyQualifiedName: "jsii-calc.UnaryOperation")] + internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.UnaryOperation { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - /// (deprecated) The value. - /// - /// Stability: Deprecated - /// - [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"number\\"}")] - [System.Obsolete()] - public override double Value - { - get => GetInstanceProperty()!; - } + /// (deprecated) The value. + /// + /// Stability: Deprecated + /// + [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"number\\"}")] + [System.Obsolete()] + public override double Value + { + get => GetInstanceProperty()!; + } - /// (deprecated) String representation of the value. - /// - /// Stability: Deprecated - /// - [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] - [System.Obsolete()] - public override string ToString() - { - return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + /// (deprecated) String representation of the value. + /// + /// Stability: Deprecated + /// + [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + [System.Obsolete()] + public override string ToString() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } } } } @@ -15646,37 +14639,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionPropertiesProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 - -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - [JsiiTypeProxy(nativeType: typeof(IUnionProperties), fullyQualifiedName: "jsii-calc.UnionProperties")] - internal sealed class UnionPropertiesProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IUnionProperties - { - private UnionPropertiesProxy(ByRefValue reference): base(reference) - { - } - - [JsiiProperty(name: "bar", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"string\\"},{\\"primitive\\":\\"number\\"},{\\"fqn\\":\\"jsii-calc.AllTypes\\"}]}}")] - public object Bar - { - get => GetInstanceProperty()!; - } - - [JsiiOptional] - [JsiiProperty(name: "foo", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"string\\"},{\\"primitive\\":\\"number\\"}]}}", isOptional: true)] - public object? Foo - { - get => GetInstanceProperty(); - } - } -} - -`; - exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UpcasingReflectable.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -16048,37 +15010,27 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { get => GetInstanceProperty()!; } - } -} - -`; - -exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VoidCallbackProxy.cs 1`] = ` -using Amazon.JSII.Runtime.Deputy; - -#pragma warning disable CS0672,CS0809,CS1591 -namespace Amazon.JSII.Tests.CalculatorNamespace -{ - /// This test is used to validate the runtimes can return correctly from a void callback. - /// - /// - /// Implement overrideMe (method does not have to do anything). - /// Invoke callMe - /// Verify that methodWasCalled is true. - /// - /// - [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.VoidCallback), fullyQualifiedName: "jsii-calc.VoidCallback")] - internal sealed class VoidCallbackProxy : Amazon.JSII.Tests.CalculatorNamespace.VoidCallback - { - private VoidCallbackProxy(ByRefValue reference): base(reference) + /// This test is used to validate the runtimes can return correctly from a void callback. + /// + /// + /// Implement overrideMe (method does not have to do anything). + /// Invoke callMe + /// Verify that methodWasCalled is true. + /// + /// + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.VoidCallback), fullyQualifiedName: "jsii-calc.VoidCallback")] + internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.VoidCallback { - } + private _Proxy(ByRefValue reference): base(reference) + { + } - [JsiiMethod(name: "overrideMe")] - protected override void OverrideMe() - { - InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + [JsiiMethod(name: "overrideMe")] + protected override void OverrideMe() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } } } } diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap index 830a8f78b8..dab69630b2 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap @@ -17,7 +17,7 @@ module github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbase go 1.15 require ( - github.com/aws-cdk/jsii/jsii-experimental v0.0.0 + github.com/aws/jsii-runtime-go v0.0.0 github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbaseofbase v0.0.0 ) @@ -27,7 +27,7 @@ exports[`Generated code for "@scope/jsii-calc-base": /go/scopejsiicalcba package jsii import ( - rt "github.com/aws-cdk/jsii/jsii-experimental" + rt "github.com/aws/jsii-runtime-go" "sync" // Initialization endpoints of dependencies scopejsiicalcbaseofbase "github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbaseofbase/jsii" @@ -56,7 +56,7 @@ exports[`Generated code for "@scope/jsii-calc-base": /go/scopejsiicalcba package scopejsiicalcbase import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" _init_ "github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbase/jsii" "reflect" "github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbaseofbase" @@ -186,7 +186,7 @@ module github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbaseofbase go 1.15 require ( - github.com/aws-cdk/jsii/jsii-experimental v0.0.0 + github.com/aws/jsii-runtime-go v0.0.0 ) `; @@ -195,7 +195,7 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejs package jsii import ( - rt "github.com/aws-cdk/jsii/jsii-experimental" + rt "github.com/aws/jsii-runtime-go" "sync" ) @@ -219,7 +219,7 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejs package scopejsiicalcbaseofbase import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" _init_ "github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbaseofbase/jsii" "reflect" ) @@ -346,7 +346,7 @@ module github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalclib go 1.15 require ( - github.com/aws-cdk/jsii/jsii-experimental v0.0.0 + github.com/aws/jsii-runtime-go v0.0.0 github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbase v0.0.0 github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbaseofbase v0.0.0 ) @@ -357,7 +357,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib package jsii import ( - rt "github.com/aws-cdk/jsii/jsii-experimental" + rt "github.com/aws/jsii-runtime-go" "sync" // Initialization endpoints of dependencies scopejsiicalcbase "github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbase/jsii" @@ -388,7 +388,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib package scopejsiicalclib import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" _init_ "github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalclib/jsii" "reflect" "github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbaseofbase" @@ -840,7 +840,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib package submodule import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" _init_ "github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalclib/jsii" "reflect" ) @@ -1094,7 +1094,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/compos package composition import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" _init_ "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/jsii" "reflect" "github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalclib" @@ -1273,7 +1273,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnop package derivedclasshasnoproperties import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" _init_ "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/jsii" "reflect" ) @@ -1375,7 +1375,7 @@ module github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc go 1.15 require ( - github.com/aws-cdk/jsii/jsii-experimental v0.0.0 + github.com/aws/jsii-runtime-go v0.0.0 github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbase v0.0.0 github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbaseofbase v0.0.0 github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalclib v0.0.0 @@ -1387,7 +1387,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/interfaceinnamespa package interfaceinnamespaceincludesclasses import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" _init_ "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/jsii" "reflect" ) @@ -1465,7 +1465,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/interfaceinnamespa package interfaceinnamespaceonlyinterface import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" "reflect" ) @@ -1498,7 +1498,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/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 scopejsiicalcbase "github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalcbase/jsii" @@ -1531,7 +1531,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc.go 1`] = package jsiicalc import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" _init_ "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/jsii" "reflect" "github.com/aws-cdk/jsii/jsii-calc/go/scopejsiicalclib" @@ -11630,6 +11630,90 @@ func StaticContext_SetStaticVariable(val bool) { ) } +// Class interface +type StaticHelloChildIface interface { +} + +// Struct proxy +type StaticHelloChild struct { +} + +func StaticHelloChild_Method() { + _init_.Initialize() + var returns interface{} + _jsii_.InvokeStatic( + "jsii-calc.StaticHelloChild", + "method", + []interface{}{}, + false, + &returns, + map[reflect.Type]reflect.Type{}, + ) +} + +func StaticHelloChild_Property() float64 { + _init_.Initialize() + var returns float64 + _jsii_.StaticGet( + "jsii-calc.StaticHelloChild", + "property", + &returns, + map[reflect.Type]reflect.Type{}, + ) + return returns +} + +// Class interface +type StaticHelloParentIface interface { +} + +// 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. +// Struct proxy +type StaticHelloParent struct { +} + +func NewStaticHelloParent() StaticHelloParentIface { + _init_.Initialize() + self := StaticHelloParent{} + _jsii_.Create( + "jsii-calc.StaticHelloParent", + []interface{}{}, + []_jsii_.FQN{}, + []_jsii_.Override{}, + &self, + ) + return &self +} + +func StaticHelloParent_Method() { + _init_.Initialize() + var returns interface{} + _jsii_.InvokeStatic( + "jsii-calc.StaticHelloParent", + "method", + []interface{}{}, + false, + &returns, + map[reflect.Type]reflect.Type{}, + ) +} + +func StaticHelloParent_Property() float64 { + _init_.Initialize() + var returns float64 + _jsii_.StaticGet( + "jsii-calc.StaticHelloParent", + "property", + &returns, + map[reflect.Type]reflect.Type{}, + ) + return returns +} + // Class interface type StaticsIface interface { GetValue() string @@ -13477,7 +13561,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythons package pythonself import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" _init_ "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/jsii" "reflect" ) @@ -13616,7 +13700,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/backrefe package backreferences import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" "reflect" "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/submodule" ) @@ -13652,7 +13736,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/ch package child import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" _init_ "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/jsii" "reflect" ) @@ -13874,7 +13958,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/nestedsu package deeplynested import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" "reflect" ) @@ -13902,7 +13986,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/nestedsu package nestedsubmodule import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" "reflect" "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/submodule/nestedsubmodule/deeplynested" "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/submodule/child" @@ -13953,7 +14037,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/param/pa package param import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" "reflect" ) @@ -13986,7 +14070,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/returnsp package returnsparam import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" _init_ "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/jsii" "reflect" "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/submodule/param" @@ -14036,7 +14120,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/submodul package submodule import ( - _jsii_ "github.com/aws-cdk/jsii/jsii-experimental" + _jsii_ "github.com/aws/jsii-runtime-go" _init_ "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/jsii" "reflect" "github.com/aws-cdk/jsii/jsii-calc/go/jsiicalc/submodule/nestedsubmodule/deeplynested" diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap index 841ec61b7a..4af33898ae 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap @@ -2694,6 +2694,8 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 StableEnum.java ┃ ┣━ 📄 StableStruct.java ┃ ┣━ 📄 StaticContext.java + ┃ ┣━ 📄 StaticHelloChild.java + ┃ ┣━ 📄 StaticHelloParent.java ┃ ┣━ 📄 Statics.java ┃ ┣━ 📄 StringEnum.java ┃ ┣━ 📄 StripInternal.java @@ -16679,6 +16681,89 @@ public class StaticContext extends software.amazon.jsii.JsiiObject { `; +exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/StaticHelloChild.java 1`] = ` +package software.amazon.jsii.tests.calculator; + +/** + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.StaticHelloChild") +public class StaticHelloChild extends software.amazon.jsii.tests.calculator.StaticHelloParent { + + protected StaticHelloChild(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + } + + protected StaticHelloChild(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { + super(initializationMode); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public static void method() { + software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.jsii.tests.calculator.StaticHelloChild.class, "method", software.amazon.jsii.NativeType.VOID); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public static @org.jetbrains.annotations.NotNull java.lang.Number getProperty() { + return software.amazon.jsii.JsiiObject.jsiiStaticGet(software.amazon.jsii.tests.calculator.StaticHelloChild.class, "property", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); + } +} + +`; + +exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/StaticHelloParent.java 1`] = ` +package software.amazon.jsii.tests.calculator; + +/** + * 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. + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.StaticHelloParent") +public class StaticHelloParent extends software.amazon.jsii.JsiiObject { + + protected StaticHelloParent(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + } + + protected StaticHelloParent(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { + super(initializationMode); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public StaticHelloParent() { + super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); + software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public static void method() { + software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.jsii.tests.calculator.StaticHelloParent.class, "method", software.amazon.jsii.NativeType.VOID); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public static @org.jetbrains.annotations.NotNull java.lang.Number getProperty() { + return software.amazon.jsii.JsiiObject.jsiiStaticGet(software.amazon.jsii.tests.calculator.StaticHelloParent.class, "property", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); + } +} + +`; + exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/Statics.java 1`] = ` package software.amazon.jsii.tests.calculator; @@ -21382,6 +21467,8 @@ jsii-calc.StableClass=software.amazon.jsii.tests.calculator.StableClass jsii-calc.StableEnum=software.amazon.jsii.tests.calculator.StableEnum jsii-calc.StableStruct=software.amazon.jsii.tests.calculator.StableStruct jsii-calc.StaticContext=software.amazon.jsii.tests.calculator.StaticContext +jsii-calc.StaticHelloChild=software.amazon.jsii.tests.calculator.StaticHelloChild +jsii-calc.StaticHelloParent=software.amazon.jsii.tests.calculator.StaticHelloParent jsii-calc.Statics=software.amazon.jsii.tests.calculator.Statics jsii-calc.StringEnum=software.amazon.jsii.tests.calculator.StringEnum jsii-calc.StripInternal=software.amazon.jsii.tests.calculator.StripInternal diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap index 4917348311..1a7b07282e 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap @@ -86,7 +86,8 @@ kwargs = json.loads( "Programming Language :: Python :: 3.9", "Typing :: Typed", "License :: OSI Approved" - ] + ], + "scripts": [] } """ ) @@ -333,7 +334,8 @@ kwargs = json.loads( "Programming Language :: Python :: 3.9", "Typing :: Typed", "License :: OSI Approved" - ] + ], + "scripts": [] } """ ) @@ -576,7 +578,8 @@ kwargs = json.loads( "Typing :: Typed", "Development Status :: 7 - Inactive", "License :: OSI Approved" - ] + ], + "scripts": [] } """ ) @@ -1287,6 +1290,8 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┣━ 📄 __init__.py ┣━ 📁 _jsii ┃ ┣━ 📄 __init__.py + ┃ ┣━ 📁 bin + ┃ ┃ ┗━ 📄 calc ┃ ┗━ 📄 jsii-calc@0.0.0.jsii.tgz ┣━ 📁 composition ┃ ┗━ 📄 __init__.py @@ -1429,6 +1434,9 @@ kwargs = json.loads( "Development Status :: 5 - Production/Stable", "License :: OSI Approved", "Test :: Classifier :: Is Dummy" + ], + "scripts": [ + "src/jsii_calc/_jsii/bin/calc" ] } """ @@ -7037,6 +7045,31 @@ class StaticContext(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.StaticContext" jsii.sset(cls, "staticVariable", value) +class StaticHelloParent( + metaclass=jsii.JSIIMeta, + jsii_type="jsii-calc.StaticHelloParent", +): + """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. + """ + + def __init__(self) -> None: + jsii.create(StaticHelloParent, self, []) + + @jsii.member(jsii_name="method") + @builtins.classmethod + def method(cls) -> None: + return jsii.sinvoke(cls, "method", []) + + @jsii.python.classproperty # type: ignore + @jsii.member(jsii_name="property") + def property(cls) -> jsii.Number: + return jsii.sget(cls, "property") + + class Statics(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Statics"): def __init__(self, value: builtins.str) -> None: """ @@ -8469,6 +8502,22 @@ class Negate(UnaryOperation, metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Negat return jsii.get(self, "value") +class StaticHelloChild( + StaticHelloParent, + metaclass=jsii.JSIIMeta, + jsii_type="jsii-calc.StaticHelloChild", +): + @jsii.member(jsii_name="method") + @builtins.classmethod + def method(cls) -> None: + return jsii.sinvoke(cls, "method", []) + + @jsii.python.classproperty # type: ignore + @jsii.member(jsii_name="property") + def property(cls) -> jsii.Number: + return jsii.sget(cls, "property") + + class SupportsNiceJavaBuilder( SupportsNiceJavaBuilderWithRequiredProps, metaclass=jsii.JSIIMeta, @@ -8687,6 +8736,8 @@ __all__ = [ "StableEnum", "StableStruct", "StaticContext", + "StaticHelloChild", + "StaticHelloParent", "Statics", "StringEnum", "StripInternal", @@ -8748,6 +8799,20 @@ publication.publish() `; +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/_jsii/bin/calc 1`] = ` +#!/usr/bin/env python + +import jsii +import sys + +__jsii_assembly__ = jsii.JSIIAssembly.load( + "jsii-calc", "0.0.0", "jsii_calc", "jsii-calc@0.0.0.jsii.tgz" +) + +__jsii_assembly__.invokeBinScript("jsii-calc", "calc", sys.argv[1:]) + +`; + exports[`Generated code for "jsii-calc": /python/src/jsii_calc/_jsii/jsii-calc@0.0.0.jsii.tgz 1`] = `python/src/jsii_calc/_jsii/jsii-calc@0.0.0.jsii.tgz is a tarball`; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/composition/__init__.py 1`] = ` diff --git a/packages/jsii-reflect/package.json b/packages/jsii-reflect/package.json index 5b026f43a2..f2a25b525e 100644 --- a/packages/jsii-reflect/package.json +++ b/packages/jsii-reflect/package.json @@ -38,15 +38,15 @@ "colors": "^1.4.0", "fs-extra": "^9.0.1", "oo-ascii-tree": "^0.0.0", - "yargs": "^16.1.1" + "yargs": "^16.2.0" }, "devDependencies": { "@scope/jsii-calc-lib": "^0.0.0", "@types/fs-extra": "^8.1.1", - "@types/jest": "^26.0.16", - "@types/node": "^10.17.48", - "@types/yargs": "^15.0.11", - "eslint": "^7.15.0", + "@types/jest": "^26.0.20", + "@types/node": "^10.17.50", + "@types/yargs": "^15.0.12", + "eslint": "^7.17.0", "jest": "^26.6.3", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", diff --git a/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap b/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap index 6853d66d31..11a3320089 100644 --- a/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap +++ b/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap @@ -1664,6 +1664,26 @@ exports[`jsii-tree --all 1`] = ` │ │ └─┬ static staticVariable property (stable) │ │ ├── static │ │ └── type: boolean + │ ├─┬ class StaticHelloChild (stable) + │ │ ├── base: StaticHelloParent + │ │ └─┬ members + │ │ ├─┬ static method() method (stable) + │ │ │ ├── static + │ │ │ └── returns: void + │ │ └─┬ static property property (stable) + │ │ ├── immutable + │ │ ├── static + │ │ └── type: number + │ ├─┬ class StaticHelloParent (stable) + │ │ └─┬ members + │ │ ├── () initializer (stable) + │ │ ├─┬ static method() method (stable) + │ │ │ ├── static + │ │ │ └── returns: void + │ │ └─┬ static property property (stable) + │ │ ├── immutable + │ │ ├── static + │ │ └── type: number │ ├─┬ class Statics (stable) │ │ └─┬ members │ │ ├─┬ (value) initializer (stable) @@ -2967,6 +2987,9 @@ exports[`jsii-tree --inheritance 1`] = ` │ ├── class SomeTypeJsii976 │ ├── class StableClass │ ├── class StaticContext + │ ├─┬ class StaticHelloChild + │ │ └── base: StaticHelloParent + │ ├── class StaticHelloParent │ ├── class Statics │ ├── class StripInternal │ ├── class StructPassing @@ -3903,6 +3926,15 @@ exports[`jsii-tree --members 1`] = ` │ │ └─┬ members │ │ ├── static canAccessStaticContext() method │ │ └── static staticVariable property + │ ├─┬ class StaticHelloChild + │ │ └─┬ members + │ │ ├── static method() method + │ │ └── static property property + │ ├─┬ class StaticHelloParent + │ │ └─┬ members + │ │ ├── () initializer + │ │ ├── static method() method + │ │ └── static property property │ ├─┬ class Statics │ │ └─┬ members │ │ ├── (value) initializer @@ -4574,6 +4606,8 @@ exports[`jsii-tree --types 1`] = ` │ ├── class SomeTypeJsii976 │ ├── class StableClass │ ├── class StaticContext + │ ├── class StaticHelloChild + │ ├── class StaticHelloParent │ ├── class Statics │ ├── class StripInternal │ ├── class StructPassing diff --git a/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap b/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap index 17a9ea824f..4a41f1aa3e 100644 --- a/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap +++ b/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap @@ -1745,6 +1745,26 @@ exports[`showAll 1`] = ` │ │ └─┬ static staticVariable property │ │ ├── static │ │ └── type: boolean + │ ├─┬ class StaticHelloChild + │ │ ├── base: StaticHelloParent + │ │ └─┬ members + │ │ ├─┬ static method() method + │ │ │ ├── static + │ │ │ └── returns: void + │ │ └─┬ static property property + │ │ ├── immutable + │ │ ├── static + │ │ └── type: number + │ ├─┬ class StaticHelloParent + │ │ └─┬ members + │ │ ├── () initializer + │ │ ├─┬ static method() method + │ │ │ ├── static + │ │ │ └── returns: void + │ │ └─┬ static property property + │ │ ├── immutable + │ │ ├── static + │ │ └── type: number │ ├─┬ class Statics │ │ └─┬ members │ │ ├─┬ (value) initializer @@ -3044,6 +3064,8 @@ exports[`types 1`] = ` │ ├── class SomeTypeJsii976 │ ├── class StableClass │ ├── class StaticContext + │ ├── class StaticHelloChild + │ ├── class StaticHelloParent │ ├── class Statics │ ├── class StripInternal │ ├── class StructPassing diff --git a/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap b/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap index 14c74fcae6..f54f6bacff 100644 --- a/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap +++ b/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap @@ -125,6 +125,8 @@ Array [ "jsii-calc.SomeTypeJsii976", "jsii-calc.StableClass", "jsii-calc.StaticContext", + "jsii-calc.StaticHelloChild", + "jsii-calc.StaticHelloParent", "jsii-calc.Statics", "jsii-calc.StripInternal", "jsii-calc.StructPassing", diff --git a/packages/jsii-rosetta/package.json b/packages/jsii-rosetta/package.json index 4c6c0574d5..3fa4a917d7 100644 --- a/packages/jsii-rosetta/package.json +++ b/packages/jsii-rosetta/package.json @@ -18,11 +18,11 @@ "devDependencies": { "@types/commonmark": "^0.27.4", "@types/fs-extra": "^8.1.1", - "@types/jest": "^26.0.16", + "@types/jest": "^26.0.20", "@types/mock-fs": "^4.13.0", - "@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", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", @@ -32,11 +32,11 @@ }, "dependencies": { "@jsii/spec": "^0.0.0", - "commonmark": "^0.29.2", + "commonmark": "^0.29.3", "fs-extra": "^9.0.1", "typescript": "~3.9.7", "xmldom": "^0.4.0", - "yargs": "^16.1.1" + "yargs": "^16.2.0" }, "license": "Apache-2.0", "author": { diff --git a/packages/jsii/bin/jsii.ts b/packages/jsii/bin/jsii.ts index a1ff14fc65..4c27849d3e 100644 --- a/packages/jsii/bin/jsii.ts +++ b/packages/jsii/bin/jsii.ts @@ -15,43 +15,46 @@ const warningTypes = Object.keys(enabledWarnings); (async () => { const argv = yargs .env('JSII') - .command(['$0', 'compile'], 'Compiles a jsii/TypeScript project', (argv) => - argv - .positional('PROJECT_ROOT', { - type: 'string', - desc: 'The root of the project to be compiled', - default: '.', - normalize: true, - }) - .option('watch', { - alias: 'w', - type: 'boolean', - desc: 'Watch for file changes and recompile automatically', - }) - .option('project-references', { - alias: 'r', - type: 'boolean', - desc: - 'Generate TypeScript project references (also [package.json].jsii.projectReferences)', - }) - .option('fix-peer-dependencies', { - type: 'boolean', - default: true, - desc: - 'Automatically add missing entries in the peerDependencies section of package.json', - }) - .options('fail-on-warnings', { - alias: 'Werr', - type: 'boolean', - desc: 'Treat warnings as errors', - }) - .option('silence-warnings', { - type: 'array', - default: [], - desc: `List of warnings to silence (warnings: ${warningTypes.join( - ',', - )})`, - }), + .command( + ['$0 [PROJECT_ROOT]', 'compile [PROJECT_ROOT]'], + 'Compiles a jsii/TypeScript project', + (argv) => + argv + .positional('PROJECT_ROOT', { + type: 'string', + desc: 'The root of the project to be compiled', + default: '.', + normalize: true, + }) + .option('watch', { + alias: 'w', + type: 'boolean', + desc: 'Watch for file changes and recompile automatically', + }) + .option('project-references', { + alias: 'r', + type: 'boolean', + desc: + 'Generate TypeScript project references (also [package.json].jsii.projectReferences)', + }) + .option('fix-peer-dependencies', { + type: 'boolean', + default: true, + desc: + 'Automatically add missing entries in the peerDependencies section of package.json', + }) + .options('fail-on-warnings', { + alias: 'Werr', + type: 'boolean', + desc: 'Treat warnings as errors', + }) + .option('silence-warnings', { + type: 'array', + default: [], + desc: `List of warnings to silence (warnings: ${warningTypes.join( + ',', + )})`, + }), ) .option('verbose', { alias: 'v', diff --git a/packages/jsii/lib/assembler.ts b/packages/jsii/lib/assembler.ts index e09d865ca7..11cee8cff7 100644 --- a/packages/jsii/lib/assembler.ts +++ b/packages/jsii/lib/assembler.ts @@ -200,6 +200,7 @@ export class Assembler implements Emitter { docs, readme, jsiiVersion, + bin: this.projectInfo.bin, fingerprint: '', }; @@ -958,6 +959,12 @@ export class Assembler implements Emitter { for (const clause of clauses) { for (const node of clause.types) { const parentType = this._typeChecker.getTypeAtLocation(node); + if (parentType.symbol == null) { + // The parent type won't have a symbol if it's an "error type" inserted by the type checker when the original + // code contains a compilation error. In such cases, the TypeScript compiler will already have reported about + // the incoherent declarations, so we'll just not re-validate it there (we'd fail anyway). + continue; + } // For some reason, we cannot trust parentType.isClassOrInterface() const badDecl = parentType.symbol.declarations.find( (decl) => diff --git a/packages/jsii/lib/compiler.ts b/packages/jsii/lib/compiler.ts index 377a647575..5ae76571cb 100644 --- a/packages/jsii/lib/compiler.ts +++ b/packages/jsii/lib/compiler.ts @@ -203,7 +203,7 @@ export class Compiler implements Emitter { }, // Make the references absolute for the compiler projectReferences: tsconf.references?.map((ref) => ({ - path: path.resolve(ref.path), + path: path.resolve(path.dirname(this.configPath), ref.path), })), host: this.compilerHost, }); diff --git a/packages/jsii/lib/project-info.ts b/packages/jsii/lib/project-info.ts index 2d037a82ac..cb5ba2a1ce 100644 --- a/packages/jsii/lib/project-info.ts +++ b/packages/jsii/lib/project-info.ts @@ -52,6 +52,7 @@ export interface ProjectInfo { readonly excludeTypescript: string[]; readonly projectReferences?: boolean; readonly tsc?: TSCompilerOptions; + readonly bin?: { readonly [name: string]: string }; } export async function loadProjectInfo( @@ -217,6 +218,7 @@ export async function loadProjectInfo( outDir: pkg.jsii?.tsc?.outDir, rootDir: pkg.jsii?.tsc?.rootDir, }, + bin: pkg.bin, diagnostics: _loadDiagnostics(pkg.jsii?.diagnostics), }; } diff --git a/packages/jsii/package.json b/packages/jsii/package.json index 435e6c44bd..2fde8a1897 100644 --- a/packages/jsii/package.json +++ b/packages/jsii/package.json @@ -45,19 +45,19 @@ "sort-json": "^2.0.0", "spdx-license-list": "^6.3.0", "typescript": "~3.9.7", - "yargs": "^16.1.1" + "yargs": "^16.2.0" }, "devDependencies": { "@types/clone": "^2.1.0", "@types/deep-equal": "^1.0.1", "@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/semver": "^7.3.4", - "@types/yargs": "^15.0.11", + "@types/yargs": "^15.0.12", "clone": "^2.1.2", - "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/oo-ascii-tree/package.json b/packages/oo-ascii-tree/package.json index a4d8716b35..00aaf9b44b 100644 --- a/packages/oo-ascii-tree/package.json +++ b/packages/oo-ascii-tree/package.json @@ -31,9 +31,9 @@ "package": "package-js" }, "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", diff --git a/superchain/Dockerfile b/superchain/Dockerfile index 7263c0c891..95ba16eae0 100644 --- a/superchain/Dockerfile +++ b/superchain/Dockerfile @@ -25,18 +25,20 @@ ENV LANG="C.UTF-8" # Also upgrading anything already installed, and adding some common dependencies for included tools RUN yum -y upgrade \ && yum -y install deltarpm tar \ - make system-rpm-config \ + make system-rpm-config yum-utils \ git gzip openssl rsync unzip which zip \ && yum clean all && rm -rf /var/cache/yum # Install .NET Core, mono & PowerShell COPY gpg/mono.asc /tmp/mono.asc RUN rpm --import "https://packages.microsoft.com/keys/microsoft.asc" \ - && rpm -Uvh "https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm" \ + && rpm -Uvh "https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm" \ && rpm --import /tmp/mono.asc && rm -f /tmp/mono.asc \ && curl -sSL "https://download.mono-project.com/repo/centos7-stable.repo" \ | tee /etc/yum.repos.d/mono-centos7-stable.repo \ && yum -y install dotnet-sdk-3.1 mono-devel powershell \ + && yum-config-manager --disable packages-microsoft-com-prod \ + && yum-config-manager --disable mono-centos7-stable \ && yum clean all && rm -rf /var/cache/yum # Install Python 3 @@ -109,9 +111,4 @@ LABEL org.opencontainers.image.created=${BUILD_TIMESTAMP} org.opencontainers.image.revision=$COMMIT_ID \ org.opencontainers.image.authors="Amazon Web Services (https://aws.amazon.com)" -# Upgrade all packages that weren't up-to-date just yet (last so it risks invalidating cache less) -# This is the second time we do it (this layer may be empty)... It's in case we re-used a cached layer the first time -RUN yum -y upgrade \ - && yum clean all && rm -rf /var/cache/yum - CMD ["/bin/bash"] diff --git a/yarn.lock b/yarn.lock index c8415c2be1..786cbac7fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,61 +2,60 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.0.0-beta.36", "@babel/code-frame@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" - integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.0.0-beta.36", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" + integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== dependencies: "@babel/highlight" "^7.10.4" "@babel/core@^7.0.0-beta.39", "@babel/core@^7.1.0", "@babel/core@^7.7.5": - version "7.12.9" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.9.tgz#fd450c4ec10cdbb980e2928b7aa7a28484593fc8" - integrity sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ== + version "7.12.10" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.10.tgz#b79a2e1b9f70ed3d84bbfb6d8c4ef825f606bccd" + integrity sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w== dependencies: "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.12.5" + "@babel/generator" "^7.12.10" "@babel/helper-module-transforms" "^7.12.1" "@babel/helpers" "^7.12.5" - "@babel/parser" "^7.12.7" + "@babel/parser" "^7.12.10" "@babel/template" "^7.12.7" - "@babel/traverse" "^7.12.9" - "@babel/types" "^7.12.7" + "@babel/traverse" "^7.12.10" + "@babel/types" "^7.12.10" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.1" json5 "^2.1.2" lodash "^4.17.19" - resolve "^1.3.2" semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.12.5": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.5.tgz#a2c50de5c8b6d708ab95be5e6053936c1884a4de" - integrity sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A== +"@babel/generator@^7.12.10", "@babel/generator@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.11.tgz#98a7df7b8c358c9a37ab07a24056853016aba3af" + integrity sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA== dependencies: - "@babel/types" "^7.12.5" + "@babel/types" "^7.12.11" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-function-name@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz#d2d3b20c59ad8c47112fa7d2a94bc09d5ef82f1a" - integrity sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ== +"@babel/helper-function-name@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz#1fd7738aee5dcf53c3ecff24f1da9c511ec47b42" + integrity sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA== dependencies: - "@babel/helper-get-function-arity" "^7.10.4" - "@babel/template" "^7.10.4" - "@babel/types" "^7.10.4" + "@babel/helper-get-function-arity" "^7.12.10" + "@babel/template" "^7.12.7" + "@babel/types" "^7.12.11" -"@babel/helper-get-function-arity@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz#98c1cbea0e2332f33f9a4661b8ce1505b2c19ba2" - integrity sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A== +"@babel/helper-get-function-arity@^7.12.10": + version "7.12.10" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz#b158817a3165b5faa2047825dfa61970ddcc16cf" + integrity sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag== dependencies: - "@babel/types" "^7.10.4" + "@babel/types" "^7.12.10" -"@babel/helper-member-expression-to-functions@^7.12.1": +"@babel/helper-member-expression-to-functions@^7.12.7": version "7.12.7" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz#aa77bd0396ec8114e5e30787efa78599d874a855" integrity sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw== @@ -85,12 +84,12 @@ "@babel/types" "^7.12.1" lodash "^4.17.19" -"@babel/helper-optimise-call-expression@^7.10.4": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.7.tgz#7f94ae5e08721a49467346aa04fd22f750033b9c" - integrity sha512-I5xc9oSJ2h59OwyUqjv95HRyzxj53DAubUERgQMrpcCEYQyToeHA+NEcUEsVWB4j53RDeskeBJ0SgRAYHDBckw== +"@babel/helper-optimise-call-expression@^7.12.10": + version "7.12.10" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.10.tgz#94ca4e306ee11a7dd6e9f42823e2ac6b49881e2d" + integrity sha512-4tpbU0SrSTjjt65UMWSrUOPZTsgvPgGG4S8QSTNHacKzpS51IVWGDj0yCwyeZND/i+LSN2g/O63jEXEWm49sYQ== dependencies: - "@babel/types" "^7.12.7" + "@babel/types" "^7.12.10" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.8.0": version "7.10.4" @@ -98,14 +97,14 @@ integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== "@babel/helper-replace-supers@^7.12.1": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz#f009a17543bbbbce16b06206ae73b63d3fca68d9" - integrity sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA== + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.12.11.tgz#ea511658fc66c7908f923106dd88e08d1997d60d" + integrity sha512-q+w1cqmhL7R0FNzth/PLLp2N+scXEK/L2AHbXUyydxp828F4FEa5WcVoqui9vFRiHDQErj9Zof8azP32uGVTRA== dependencies: - "@babel/helper-member-expression-to-functions" "^7.12.1" - "@babel/helper-optimise-call-expression" "^7.10.4" - "@babel/traverse" "^7.12.5" - "@babel/types" "^7.12.5" + "@babel/helper-member-expression-to-functions" "^7.12.7" + "@babel/helper-optimise-call-expression" "^7.12.10" + "@babel/traverse" "^7.12.10" + "@babel/types" "^7.12.11" "@babel/helper-simple-access@^7.12.1": version "7.12.1" @@ -114,17 +113,17 @@ dependencies: "@babel/types" "^7.12.1" -"@babel/helper-split-export-declaration@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz#f8a491244acf6a676158ac42072911ba83ad099f" - integrity sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg== +"@babel/helper-split-export-declaration@^7.11.0", "@babel/helper-split-export-declaration@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz#1b4cc424458643c47d37022223da33d76ea4603a" + integrity sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g== dependencies: - "@babel/types" "^7.11.0" + "@babel/types" "^7.12.11" -"@babel/helper-validator-identifier@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" - integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== +"@babel/helper-validator-identifier@^7.10.4", "@babel/helper-validator-identifier@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" + integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== "@babel/helpers@^7.12.5": version "7.12.5" @@ -144,10 +143,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.12.7": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.7.tgz#fee7b39fe809d0e73e5b25eecaf5780ef3d73056" - integrity sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg== +"@babel/parser@^7.1.0", "@babel/parser@^7.12.10", "@babel/parser@^7.12.11", "@babel/parser@^7.12.7": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.11.tgz#9ce3595bcd74bc5c466905e86c535b8b25011e79" + integrity sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -249,27 +248,27 @@ "@babel/parser" "^7.12.7" "@babel/types" "^7.12.7" -"@babel/traverse@^7.0.0-beta.39", "@babel/traverse@^7.1.0", "@babel/traverse@^7.12.1", "@babel/traverse@^7.12.5", "@babel/traverse@^7.12.9": - version "7.12.9" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.9.tgz#fad26c972eabbc11350e0b695978de6cc8e8596f" - integrity sha512-iX9ajqnLdoU1s1nHt36JDI9KG4k+vmI8WgjK5d+aDTwQbL2fUnzedNedssA645Ede3PM2ma1n8Q4h2ohwXgMXw== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.12.5" - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-split-export-declaration" "^7.11.0" - "@babel/parser" "^7.12.7" - "@babel/types" "^7.12.7" +"@babel/traverse@^7.0.0-beta.39", "@babel/traverse@^7.1.0", "@babel/traverse@^7.12.1", "@babel/traverse@^7.12.10", "@babel/traverse@^7.12.5": + version "7.12.12" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.12.tgz#d0cd87892704edd8da002d674bc811ce64743376" + integrity sha512-s88i0X0lPy45RrLM8b9mz8RPH5FqO9G9p7ti59cToE44xFm1Q+Pjh5Gq4SXBbtb88X7Uy7pexeqRIQDDMNkL0w== + dependencies: + "@babel/code-frame" "^7.12.11" + "@babel/generator" "^7.12.11" + "@babel/helper-function-name" "^7.12.11" + "@babel/helper-split-export-declaration" "^7.12.11" + "@babel/parser" "^7.12.11" + "@babel/types" "^7.12.12" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.19" -"@babel/types@^7.0.0", "@babel/types@^7.0.0-beta.39", "@babel/types@^7.10.4", "@babel/types@^7.11.0", "@babel/types@^7.12.1", "@babel/types@^7.12.5", "@babel/types@^7.12.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.7.tgz#6039ff1e242640a29452c9ae572162ec9a8f5d13" - integrity sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ== +"@babel/types@^7.0.0", "@babel/types@^7.0.0-beta.39", "@babel/types@^7.12.1", "@babel/types@^7.12.10", "@babel/types@^7.12.11", "@babel/types@^7.12.12", "@babel/types@^7.12.5", "@babel/types@^7.12.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.12.12" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.12.tgz#4608a6ec313abbd87afa55004d373ad04a96c299" + integrity sha512-lnIX7piTxOH22xE7fDXDbSHg9MM1/6ORnafpJmov5rs0kX5g4BZxeXNJLXsMRiO0U5Rb8/FvMS6xlTnTHvxonQ== dependencies: - "@babel/helper-validator-identifier" "^7.10.4" + "@babel/helper-validator-identifier" "^7.12.11" lodash "^4.17.19" to-fast-properties "^2.0.0" @@ -286,6 +285,11 @@ exec-sh "^0.3.2" minimist "^1.2.0" +"@discoveryjs/json-ext@^0.5.0": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz#8f03a22a04de437254e8ce8cc84ba39689288752" + integrity sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg== + "@eslint/eslintrc@^0.2.2": version "0.2.2" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.2.2.tgz#d01fc791e2fc33e88a29d6f3dc7e93d0cd784b76" @@ -1259,18 +1263,18 @@ call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" -"@nodelib/fs.scandir@2.1.3": - version "2.1.3" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b" - integrity sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw== +"@nodelib/fs.scandir@2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz#d4b3549a5db5de2683e0c1071ab4f140904bbf69" + integrity sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA== dependencies: - "@nodelib/fs.stat" "2.0.3" + "@nodelib/fs.stat" "2.0.4" run-parallel "^1.1.9" -"@nodelib/fs.stat@2.0.3", "@nodelib/fs.stat@^2.0.2": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz#34dc5f4cabbc720f4e60f75a747e7ecd6c175bd3" - integrity sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA== +"@nodelib/fs.stat@2.0.4", "@nodelib/fs.stat@^2.0.2": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz#a3f2dd61bab43b8db8fa108a121cfffe4c676655" + integrity sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q== "@nodelib/fs.stat@^1.1.2": version "1.1.3" @@ -1278,11 +1282,11 @@ integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== "@nodelib/fs.walk@^1.2.3": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz#011b9202a70a6366e436ca5c065844528ab04976" - integrity sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ== + version "1.2.6" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz#cce9396b30aa5afe9e3756608f5831adcb53d063" + integrity sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow== dependencies: - "@nodelib/fs.scandir" "2.1.3" + "@nodelib/fs.scandir" "2.1.4" fastq "^1.6.0" "@octokit/auth-token@^2.4.0", "@octokit/auth-token@^2.4.4": @@ -1322,15 +1326,10 @@ "@octokit/types" "^6.0.0" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^1.2.0": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-1.2.2.tgz#55d927436c07ef148ec927fbf4d55580a19bd68e" - integrity sha512-vrKDLd/Rq4IE16oT+jJkDBx0r29NFkdkU8GwqVSP4RajsAvP23CMGtFhVK0pedUhAiMvG1bGnFcTC/xCKaKgmw== - -"@octokit/openapi-types@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-2.0.0.tgz#6d8f8ad9db3b75a39115f5def2654df8bed39f28" - integrity sha512-J4bfM7lf8oZvEAdpS71oTvC1ofKxfEZgU5vKVwzZKi4QPiL82udjpseJwxPid9Pu2FNmyRQOX4iEj6W1iOSnPw== +"@octokit/openapi-types@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-2.2.0.tgz#123e0438a0bc718ccdac3b5a2e69b3dd00daa85b" + integrity sha512-274lNUDonw10kT8wHg8fCcUc1ZjZHbWv0/TbAwb0ojhBQqZYc1cQ/4yqTVTtPMDeZ//g7xVEYe/s3vURkRghPg== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" @@ -1345,9 +1344,9 @@ "@octokit/types" "^2.0.1" "@octokit/plugin-paginate-rest@^2.6.2": - version "2.6.2" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.6.2.tgz#45d13dbf5ff8aed54f1a3716b1d57fdc62720c5f" - integrity sha512-3Dy7/YZAwdOaRpGQoNHPeT0VU1fYLpIUdPyvR37IyFLgd6XSij4j9V/xN/+eSjF2KKvmfIulEh9LF1tRPjIiDA== + version "2.7.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.7.0.tgz#6bb7b043c246e0654119a6ec4e72a172c9e2c7f3" + integrity sha512-+zARyncLjt9b0FjqPAbJo4ss7HOlBi1nprq+cPlw5vu2+qjy7WvlXhtXFdRHQbSL1Pt+bfAKaLADEkkvg8sP8w== dependencies: "@octokit/types" "^6.0.1" @@ -1443,20 +1442,12 @@ dependencies: "@types/node" ">= 8" -"@octokit/types@^6.0.0", "@octokit/types@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.0.1.tgz#a43a667ac8fff45012d23b771b7c3199f4491910" - integrity sha512-H/DnTKC+U09en2GFLH/MfAPNDaYb1isieD4Hx4NLpEt/I1PgtZP/8a+Ehc/j9GHuVF/UvGtOVD8AF9XXvws53w== - dependencies: - "@octokit/openapi-types" "^1.2.0" - "@types/node" ">= 8" - -"@octokit/types@^6.0.3", "@octokit/types@^6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.1.0.tgz#126197ceb802220fee920d5ea6d568c2c63365cc" - integrity sha512-bMWBmg77MQTiRkOVyf50qK3QECWOEy43rLy/6fTWZ4HEwAhNfqzMcjiBDZAowkILwTrFvzE1CpP6gD0MuPHS+A== +"@octokit/types@^6.0.0", "@octokit/types@^6.0.1", "@octokit/types@^6.0.3", "@octokit/types@^6.1.0": + version "6.2.1" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.2.1.tgz#7f881fe44475ab1825776a4a59ca1ae082ed1043" + integrity sha512-jHs9OECOiZxuEzxMZcXmqrEO8GYraHF+UzNVH2ACYh8e/Y7YoT+hUf9ldvVd6zIvWv4p3NdxbQ0xx3ku5BnSiA== dependencies: - "@octokit/openapi-types" "^2.0.0" + "@octokit/openapi-types" "^2.2.0" "@types/node" ">= 8" "@sinonjs/commons@^1.7.0": @@ -1500,9 +1491,9 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": - version "7.0.16" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.16.tgz#0bbbf70c7bc4193210dd27e252c51260a37cd6a7" - integrity sha512-S63Dt4CZOkuTmpLGGWtT/mQdVORJOpx6SZWGVaP56dda/0Nx5nEe82K7/LAm8zYr6SfMq+1N2OreIOrHAx656w== + version "7.11.0" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.11.0.tgz#b9a1efa635201ba9bc850323a8793ee2d36c04a0" + integrity sha512-kSjgDMZONiIfSH1Nxcr5JIRMwUetDki63FSQfpTCz8ogF3Ulqm8+mr5f78dUYs6vMiB6gBusQqfQmBvHZj/lwg== dependencies: "@babel/types" "^7.3.0" @@ -1605,10 +1596,10 @@ dependencies: "@types/jest" "*" -"@types/jest@*", "@types/jest@26.x", "@types/jest@^26.0.16": - version "26.0.16" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.16.tgz#b47abd50f6ed0503f589db8e126fc8eb470cf87c" - integrity sha512-Gp12+7tmKCgv9JjtltxUXokohCAEZfpJaEW5tn871SGRp8I+bRWBonQO7vW5NHwnAHe5dd50+Q4zyKuN35i09g== +"@types/jest@*", "@types/jest@26.x", "@types/jest@^26.0.20": + version "26.0.20" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.20.tgz#cd2f2702ecf69e86b586e1f5223a60e454056307" + integrity sha512-9zi2Y+5USJRxd0FsahERhBwlcvFh6D2GLQnY2FH2BzK8J9s9omvNHIbvABwIluXa0fD8XVKMLTO0aOEuUfACAA== dependencies: jest-diff "^26.0.0" pretty-format "^26.0.0" @@ -1648,14 +1639,14 @@ "@types/node" "*" "@types/node@*", "@types/node@>= 8": - version "14.14.10" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.10.tgz#5958a82e41863cfc71f2307b3748e3491ba03785" - integrity sha512-J32dgx2hw8vXrSbu4ZlVhn1Nm3GbeCFNw2FWL8S5QKucHGY0cyNwjdQdO+KMBZ4wpmC7KhLCiNsdk1RFRIYUQQ== + version "14.14.20" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.20.tgz#f7974863edd21d1f8a494a73e8e2b3658615c340" + integrity sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A== -"@types/node@^10.17.48": - version "10.17.48" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.48.tgz#726e7f25d00bf58d79c8f00dd586dd9a10d06a4f" - integrity sha512-Agl6xbYP6FOMDeAsr3QVZ+g7Yzg0uhPHWx0j5g4LFdUBHVtqtU+gH660k/lCEe506jJLOGbEzsnqPDTZGJQLag== +"@types/node@^10.17.50": + version "10.17.50" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.50.tgz#7a20902af591282aa9176baefc37d4372131c32d" + integrity sha512-vwX+/ija9xKc/z9VqMCdbf4WYcMTGsI0I/L/6shIF3qXURxZOhPQlPRHtjTpiNhAwn0paMJzlOQqw6mAGEQnTA== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -1663,9 +1654,9 @@ integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== "@types/prettier@^2.0.0": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.1.5.tgz#b6ab3bba29e16b821d84e09ecfaded462b816b00" - integrity sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ== + version "2.1.6" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.1.6.tgz#f4b1efa784e8db479cdb8b14403e2144b1e9ff03" + integrity sha512-6gOkRe7OIioWAXfnO/2lFiv+SJichKVSys1mSsgyrYHSEjk8Ctv4tSR/Odvnu+HWlH2C8j53dahU03XmQdd5fA== "@types/semver@^7.3.4": version "7.3.4" @@ -1686,9 +1677,9 @@ "@types/tar-stream" "*" "@types/tar-stream@*": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@types/tar-stream/-/tar-stream-2.1.0.tgz#884b1cbe6c35ff459c05a5eba86b406805943ef6" - integrity sha512-s1UQxQUVMHbSkCC0X4qdoiWgHF8DoyY1JjQouFsnk/8ysoTdBaiCHud/exoAZzKDbzAXVc+ah6sczxGVMAohFw== + version "2.2.0" + resolved "https://registry.yarnpkg.com/@types/tar-stream/-/tar-stream-2.2.0.tgz#2778ef8e328a520959a39681c15c83c53553426f" + integrity sha512-sRTpT180sVigzD4SiCWJQQrqcdkWnmscWvx+cXvAoPtXbLFC5+QmKi2xwRcPe4iRu0GcVl1qTeJKUTS5hULfrw== dependencies: "@types/node" "*" @@ -1708,72 +1699,73 @@ "@types/node" "*" "@types/yargs-parser@*": - version "15.0.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d" - integrity sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw== + version "20.2.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" + integrity sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA== -"@types/yargs@^15.0.0", "@types/yargs@^15.0.11": - version "15.0.11" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.11.tgz#361d7579ecdac1527687bcebf9946621c12ab78c" - integrity sha512-jfcNBxHFYJ4nPIacsi3woz1+kvUO6s1CyeEhtnDHBjHUMNj5UlW2GynmnSgiJJEdNg9yW5C8lfoNRZrHGv5EqA== +"@types/yargs@^15.0.0", "@types/yargs@^15.0.12": + version "15.0.12" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.12.tgz#6234ce3e3e3fa32c5db301a170f96a599c960d74" + integrity sha512-f+fD/fQAo3BCbCDlrUpznF1A5Zp9rB0noS5vnoormHSIPFKL0Z2DcUJ3Gxp5ytH4uLRNxy7AwYUC9exZzqGMAw== dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^4.9.0": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.9.0.tgz#8fde15743413661fdc086c9f1f5d74a80b856113" - integrity sha512-WrVzGMzzCrgrpnQMQm4Tnf+dk+wdl/YbgIgd5hKGa2P+lnJ2MON+nQnbwgbxtN9QDLi8HO+JAq0/krMnjQK6Cw== +"@typescript-eslint/eslint-plugin@^4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.13.0.tgz#5f580ea520fa46442deb82c038460c3dd3524bb6" + integrity sha512-ygqDUm+BUPvrr0jrXqoteMqmIaZ/bixYOc3A4BRwzEPTZPi6E+n44rzNZWaB0YvtukgP+aoj0i/fyx7FkM2p1w== dependencies: - "@typescript-eslint/experimental-utils" "4.9.0" - "@typescript-eslint/scope-manager" "4.9.0" + "@typescript-eslint/experimental-utils" "4.13.0" + "@typescript-eslint/scope-manager" "4.13.0" debug "^4.1.1" functional-red-black-tree "^1.0.1" + lodash "^4.17.15" regexpp "^3.0.0" semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@4.9.0": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.9.0.tgz#23a296b85d243afba24e75a43fd55aceda5141f0" - integrity sha512-0p8GnDWB3R2oGhmRXlEnCvYOtaBCijtA5uBfH5GxQKsukdSQyI4opC4NGTUb88CagsoNQ4rb/hId2JuMbzWKFQ== +"@typescript-eslint/experimental-utils@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.13.0.tgz#9dc9ab375d65603b43d938a0786190a0c72be44e" + integrity sha512-/ZsuWmqagOzNkx30VWYV3MNB/Re/CGv/7EzlqZo5RegBN8tMuPaBgNK6vPBCQA8tcYrbsrTdbx3ixMRRKEEGVw== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/scope-manager" "4.9.0" - "@typescript-eslint/types" "4.9.0" - "@typescript-eslint/typescript-estree" "4.9.0" + "@typescript-eslint/scope-manager" "4.13.0" + "@typescript-eslint/types" "4.13.0" + "@typescript-eslint/typescript-estree" "4.13.0" eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@^4.9.0": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.9.0.tgz#bb65f1214b5e221604996db53ef77c9d62b09249" - integrity sha512-QRSDAV8tGZoQye/ogp28ypb8qpsZPV6FOLD+tbN4ohKUWHD2n/u0Q2tIBnCsGwQCiD94RdtLkcqpdK4vKcLCCw== +"@typescript-eslint/parser@^4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.13.0.tgz#c413d640ea66120cfcc37f891e8cb3fd1c9d247d" + integrity sha512-KO0J5SRF08pMXzq9+abyHnaGQgUJZ3Z3ax+pmqz9vl81JxmTTOUfQmq7/4awVfq09b6C4owNlOgOwp61pYRBSg== dependencies: - "@typescript-eslint/scope-manager" "4.9.0" - "@typescript-eslint/types" "4.9.0" - "@typescript-eslint/typescript-estree" "4.9.0" + "@typescript-eslint/scope-manager" "4.13.0" + "@typescript-eslint/types" "4.13.0" + "@typescript-eslint/typescript-estree" "4.13.0" debug "^4.1.1" -"@typescript-eslint/scope-manager@4.9.0": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.9.0.tgz#5eefe305d6b71d1c85af6587b048426bfd4d3708" - integrity sha512-q/81jtmcDtMRE+nfFt5pWqO0R41k46gpVLnuefqVOXl4QV1GdQoBWfk5REcipoJNQH9+F5l+dwa9Li5fbALjzg== +"@typescript-eslint/scope-manager@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.13.0.tgz#5b45912a9aa26b29603d8fa28f5e09088b947141" + integrity sha512-UpK7YLG2JlTp/9G4CHe7GxOwd93RBf3aHO5L+pfjIrhtBvZjHKbMhBXTIQNkbz7HZ9XOe++yKrXutYm5KmjWgQ== dependencies: - "@typescript-eslint/types" "4.9.0" - "@typescript-eslint/visitor-keys" "4.9.0" + "@typescript-eslint/types" "4.13.0" + "@typescript-eslint/visitor-keys" "4.13.0" -"@typescript-eslint/types@4.9.0": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.9.0.tgz#3fe8c3632abd07095c7458f7451bd14c85d0033c" - integrity sha512-luzLKmowfiM/IoJL/rus1K9iZpSJK6GlOS/1ezKplb7MkORt2dDcfi8g9B0bsF6JoRGhqn0D3Va55b+vredFHA== +"@typescript-eslint/types@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.13.0.tgz#6a7c6015a59a08fbd70daa8c83dfff86250502f8" + integrity sha512-/+aPaq163oX+ObOG00M0t9tKkOgdv9lq0IQv/y4SqGkAXmhFmCfgsELV7kOCTb2vVU5VOmVwXBXJTDr353C1rQ== -"@typescript-eslint/typescript-estree@4.9.0": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.9.0.tgz#38a98df6ee281cfd6164d6f9d91795b37d9e508c" - integrity sha512-rmDR++PGrIyQzAtt3pPcmKWLr7MA+u/Cmq9b/rON3//t5WofNR4m/Ybft2vOLj0WtUzjn018ekHjTsnIyBsQug== +"@typescript-eslint/typescript-estree@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.13.0.tgz#cf6e2207c7d760f5dfd8d18051428fadfc37b45e" + integrity sha512-9A0/DFZZLlGXn5XA349dWQFwPZxcyYyCFX5X88nWs2uachRDwGeyPz46oTsm9ZJE66EALvEns1lvBwa4d9QxMg== dependencies: - "@typescript-eslint/types" "4.9.0" - "@typescript-eslint/visitor-keys" "4.9.0" + "@typescript-eslint/types" "4.13.0" + "@typescript-eslint/visitor-keys" "4.13.0" debug "^4.1.1" globby "^11.0.1" is-glob "^4.0.1" @@ -1781,170 +1773,146 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/visitor-keys@4.9.0": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.9.0.tgz#f284e9fac43f2d6d35094ce137473ee321f266c8" - integrity sha512-sV45zfdRqQo1A97pOSx3fsjR+3blmwtdCt8LDrXgCX36v4Vmz4KHrhpV6Fo2cRdXmyumxx11AHw0pNJqCNpDyg== +"@typescript-eslint/visitor-keys@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.13.0.tgz#9acb1772d3b3183182b6540d3734143dce9476fe" + integrity sha512-6RoxWK05PAibukE7jElqAtNMq+RWZyqJ6Q/GdIxaiUj2Ept8jh8+FUVlbq9WxMYxkmEOPvCE5cRSyupMpwW31g== dependencies: - "@typescript-eslint/types" "4.9.0" + "@typescript-eslint/types" "4.13.0" eslint-visitor-keys "^2.0.0" -"@webassemblyjs/ast@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" - integrity sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA== +"@webassemblyjs/ast@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.0.tgz#a5aa679efdc9e51707a4207139da57920555961f" + integrity sha512-kX2W49LWsbthrmIRMbQZuQDhGtjyqXfEmmHyEi4XWnSZtPmxY0+3anPIzsnRb45VH/J55zlOfWvZuY47aJZTJg== dependencies: - "@webassemblyjs/helper-module-context" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/wast-parser" "1.9.0" + "@webassemblyjs/helper-numbers" "1.11.0" + "@webassemblyjs/helper-wasm-bytecode" "1.11.0" -"@webassemblyjs/floating-point-hex-parser@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz#3c3d3b271bddfc84deb00f71344438311d52ffb4" - integrity sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA== - -"@webassemblyjs/helper-api-error@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz#203f676e333b96c9da2eeab3ccef33c45928b6a2" - integrity sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw== - -"@webassemblyjs/helper-buffer@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz#a1442d269c5feb23fcbc9ef759dac3547f29de00" - integrity sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA== +"@webassemblyjs/floating-point-hex-parser@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.0.tgz#34d62052f453cd43101d72eab4966a022587947c" + integrity sha512-Q/aVYs/VnPDVYvsCBL/gSgwmfjeCb4LW8+TMrO3cSzJImgv8lxxEPM2JA5jMrivE7LSz3V+PFqtMbls3m1exDA== -"@webassemblyjs/helper-code-frame@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz#647f8892cd2043a82ac0c8c5e75c36f1d9159f27" - integrity sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA== - dependencies: - "@webassemblyjs/wast-printer" "1.9.0" +"@webassemblyjs/helper-api-error@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.0.tgz#aaea8fb3b923f4aaa9b512ff541b013ffb68d2d4" + integrity sha512-baT/va95eXiXb2QflSx95QGT5ClzWpGaa8L7JnJbgzoYeaA27FCvuBXU758l+KXWRndEmUXjP0Q5fibhavIn8w== -"@webassemblyjs/helper-fsm@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz#c05256b71244214671f4b08ec108ad63b70eddb8" - integrity sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw== +"@webassemblyjs/helper-buffer@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.0.tgz#d026c25d175e388a7dbda9694e91e743cbe9b642" + integrity sha512-u9HPBEl4DS+vA8qLQdEQ6N/eJQ7gT7aNvMIo8AAWvAl/xMrcOSiI2M0MAnMCy3jIFke7bEee/JwdX1nUpCtdyA== -"@webassemblyjs/helper-module-context@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz#25d8884b76839871a08a6c6f806c3979ef712f07" - integrity sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g== +"@webassemblyjs/helper-numbers@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.0.tgz#7ab04172d54e312cc6ea4286d7d9fa27c88cd4f9" + integrity sha512-DhRQKelIj01s5IgdsOJMKLppI+4zpmcMQ3XboFPLwCpSNH6Hqo1ritgHgD0nqHeSYqofA6aBN/NmXuGjM1jEfQ== dependencies: - "@webassemblyjs/ast" "1.9.0" + "@webassemblyjs/floating-point-hex-parser" "1.11.0" + "@webassemblyjs/helper-api-error" "1.11.0" + "@xtuc/long" "4.2.2" -"@webassemblyjs/helper-wasm-bytecode@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz#4fed8beac9b8c14f8c58b70d124d549dd1fe5790" - integrity sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw== +"@webassemblyjs/helper-wasm-bytecode@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.0.tgz#85fdcda4129902fe86f81abf7e7236953ec5a4e1" + integrity sha512-MbmhvxXExm542tWREgSFnOVo07fDpsBJg3sIl6fSp9xuu75eGz5lz31q7wTLffwL3Za7XNRCMZy210+tnsUSEA== -"@webassemblyjs/helper-wasm-section@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz#5a4138d5a6292ba18b04c5ae49717e4167965346" - integrity sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw== +"@webassemblyjs/helper-wasm-section@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.0.tgz#9ce2cc89300262509c801b4af113d1ca25c1a75b" + integrity sha512-3Eb88hcbfY/FCukrg6i3EH8H2UsD7x8Vy47iVJrP967A9JGqgBVL9aH71SETPx1JrGsOUVLo0c7vMCN22ytJew== dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-buffer" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/wasm-gen" "1.9.0" + "@webassemblyjs/ast" "1.11.0" + "@webassemblyjs/helper-buffer" "1.11.0" + "@webassemblyjs/helper-wasm-bytecode" "1.11.0" + "@webassemblyjs/wasm-gen" "1.11.0" -"@webassemblyjs/ieee754@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz#15c7a0fbaae83fb26143bbacf6d6df1702ad39e4" - integrity sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg== +"@webassemblyjs/ieee754@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.0.tgz#46975d583f9828f5d094ac210e219441c4e6f5cf" + integrity sha512-KXzOqpcYQwAfeQ6WbF6HXo+0udBNmw0iXDmEK5sFlmQdmND+tr773Ti8/5T/M6Tl/413ArSJErATd8In3B+WBA== dependencies: "@xtuc/ieee754" "^1.2.0" -"@webassemblyjs/leb128@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.9.0.tgz#f19ca0b76a6dc55623a09cffa769e838fa1e1c95" - integrity sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw== +"@webassemblyjs/leb128@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.0.tgz#f7353de1df38aa201cba9fb88b43f41f75ff403b" + integrity sha512-aqbsHa1mSQAbeeNcl38un6qVY++hh8OpCOzxhixSYgbRfNWcxJNJQwe2rezK9XEcssJbbWIkblaJRwGMS9zp+g== dependencies: "@xtuc/long" "4.2.2" -"@webassemblyjs/utf8@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.9.0.tgz#04d33b636f78e6a6813227e82402f7637b6229ab" - integrity sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w== +"@webassemblyjs/utf8@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.0.tgz#86e48f959cf49e0e5091f069a709b862f5a2cadf" + integrity sha512-A/lclGxH6SpSLSyFowMzO/+aDEPU4hvEiooCMXQPcQFPPJaYcPQNKGOCLUySJsYJ4trbpr+Fs08n4jelkVTGVw== -"@webassemblyjs/wasm-edit@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz#3fe6d79d3f0f922183aa86002c42dd256cfee9cf" - integrity sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-buffer" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/helper-wasm-section" "1.9.0" - "@webassemblyjs/wasm-gen" "1.9.0" - "@webassemblyjs/wasm-opt" "1.9.0" - "@webassemblyjs/wasm-parser" "1.9.0" - "@webassemblyjs/wast-printer" "1.9.0" - -"@webassemblyjs/wasm-gen@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz#50bc70ec68ded8e2763b01a1418bf43491a7a49c" - integrity sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA== +"@webassemblyjs/wasm-edit@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.0.tgz#ee4a5c9f677046a210542ae63897094c2027cb78" + integrity sha512-JHQ0damXy0G6J9ucyKVXO2j08JVJ2ntkdJlq1UTiUrIgfGMmA7Ik5VdC/L8hBK46kVJgujkBIoMtT8yVr+yVOQ== + dependencies: + "@webassemblyjs/ast" "1.11.0" + "@webassemblyjs/helper-buffer" "1.11.0" + "@webassemblyjs/helper-wasm-bytecode" "1.11.0" + "@webassemblyjs/helper-wasm-section" "1.11.0" + "@webassemblyjs/wasm-gen" "1.11.0" + "@webassemblyjs/wasm-opt" "1.11.0" + "@webassemblyjs/wasm-parser" "1.11.0" + "@webassemblyjs/wast-printer" "1.11.0" + +"@webassemblyjs/wasm-gen@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.0.tgz#3cdb35e70082d42a35166988dda64f24ceb97abe" + integrity sha512-BEUv1aj0WptCZ9kIS30th5ILASUnAPEvE3tVMTrItnZRT9tXCLW2LEXT8ezLw59rqPP9klh9LPmpU+WmRQmCPQ== dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/ieee754" "1.9.0" - "@webassemblyjs/leb128" "1.9.0" - "@webassemblyjs/utf8" "1.9.0" + "@webassemblyjs/ast" "1.11.0" + "@webassemblyjs/helper-wasm-bytecode" "1.11.0" + "@webassemblyjs/ieee754" "1.11.0" + "@webassemblyjs/leb128" "1.11.0" + "@webassemblyjs/utf8" "1.11.0" -"@webassemblyjs/wasm-opt@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz#2211181e5b31326443cc8112eb9f0b9028721a61" - integrity sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A== +"@webassemblyjs/wasm-opt@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.0.tgz#1638ae188137f4bb031f568a413cd24d32f92978" + integrity sha512-tHUSP5F4ywyh3hZ0+fDQuWxKx3mJiPeFufg+9gwTpYp324mPCQgnuVKwzLTZVqj0duRDovnPaZqDwoyhIO8kYg== dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-buffer" "1.9.0" - "@webassemblyjs/wasm-gen" "1.9.0" - "@webassemblyjs/wasm-parser" "1.9.0" + "@webassemblyjs/ast" "1.11.0" + "@webassemblyjs/helper-buffer" "1.11.0" + "@webassemblyjs/wasm-gen" "1.11.0" + "@webassemblyjs/wasm-parser" "1.11.0" -"@webassemblyjs/wasm-parser@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz#9d48e44826df4a6598294aa6c87469d642fff65e" - integrity sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA== +"@webassemblyjs/wasm-parser@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.0.tgz#3e680b8830d5b13d1ec86cc42f38f3d4a7700754" + integrity sha512-6L285Sgu9gphrcpDXINvm0M9BskznnzJTE7gYkjDbxET28shDqp27wpruyx3C2S/dvEwiigBwLA1cz7lNUi0kw== dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-api-error" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/ieee754" "1.9.0" - "@webassemblyjs/leb128" "1.9.0" - "@webassemblyjs/utf8" "1.9.0" - -"@webassemblyjs/wast-parser@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz#3031115d79ac5bd261556cecc3fa90a3ef451914" - integrity sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/floating-point-hex-parser" "1.9.0" - "@webassemblyjs/helper-api-error" "1.9.0" - "@webassemblyjs/helper-code-frame" "1.9.0" - "@webassemblyjs/helper-fsm" "1.9.0" - "@xtuc/long" "4.2.2" + "@webassemblyjs/ast" "1.11.0" + "@webassemblyjs/helper-api-error" "1.11.0" + "@webassemblyjs/helper-wasm-bytecode" "1.11.0" + "@webassemblyjs/ieee754" "1.11.0" + "@webassemblyjs/leb128" "1.11.0" + "@webassemblyjs/utf8" "1.11.0" -"@webassemblyjs/wast-printer@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz#4935d54c85fef637b00ce9f52377451d00d47899" - integrity sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA== +"@webassemblyjs/wast-printer@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.0.tgz#680d1f6a5365d6d401974a8e949e05474e1fab7e" + integrity sha512-Fg5OX46pRdTgB7rKIUojkh9vXaVN6sGYCnEiJN1GYkb0RPwShZXp6KTDqmoMdQPKhcroOXh3fEzmkWmCYaKYhQ== dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/wast-parser" "1.9.0" + "@webassemblyjs/ast" "1.11.0" "@xtuc/long" "4.2.2" -"@webpack-cli/info@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.1.0.tgz#c596d5bc48418b39df00c5ed7341bf0f102dbff1" - integrity sha512-uNWSdaYHc+f3LdIZNwhdhkjjLDDl3jP2+XBqAq9H8DjrJUvlOKdP8TNruy1yEaDfgpAIgbSAN7pye4FEHg9tYQ== +"@webpack-cli/info@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.2.1.tgz#af98311f983d0b9fce7284cfcf1acaf1e9f4879c" + integrity sha512-fLnDML5HZ5AEKzHul8xLAksoKN2cibu6MgonkUj8R9V7bbeVRkd1XbGEGWrAUNYHbX1jcqCsDEpBviE5StPMzQ== dependencies: envinfo "^7.7.3" -"@webpack-cli/serve@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.1.0.tgz#13ad38f89b6e53d1133bac0006a128217a6ebf92" - integrity sha512-7RfnMXCpJ/NThrhq4gYQYILB18xWyoQcBey81oIyVbmgbc6m5ZHHyFK+DyH7pLHJf0p14MxL4mTsoPAgBSTpIg== +"@webpack-cli/serve@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.2.1.tgz#7513d7a769e3f97958de799b5b49874425ae3396" + integrity sha512-Zj1z6AyS+vqV6Hfi7ngCjFGdHV5EwZNIHo6QfFTNe9PyW+zBU1zJ9BiOW1pmUEq950RC4+Dym6flyA/61/vhyw== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -2042,7 +2010,7 @@ ajv-keywords@^3.5.2: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: +ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -2052,6 +2020,16 @@ ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.0.3.tgz#13ae747eff125cafb230ac504b2406cf371eece2" + integrity sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + all-contributors-cli@^6.19.0: version "6.19.0" resolved "https://registry.yarnpkg.com/all-contributors-cli/-/all-contributors-cli-6.19.0.tgz#7e4550973afede2476b62bd159fee6d72a1ad802" @@ -2185,11 +2163,6 @@ arr-union@^3.1.0: resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= -array-back@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/array-back/-/array-back-4.0.1.tgz#9b80312935a52062e1a233a9c7abeb5481b30e90" - integrity sha512-Z/JnaVEXv+A9xabHzN43FiiiWEE7gPCRXMrVmRm00tWbjZRul1iHm7ECzlyNq1p4a4ATXz+G9FJ3GqGOkOV3fg== - array-differ@^2.0.3: version "2.1.0" resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-2.1.0.tgz#4b9c1c3f14b906757082925769e8ab904f4801b1" @@ -2279,10 +2252,10 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== +astral-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== async@^3.0.1: version "3.2.0" @@ -2309,7 +2282,7 @@ atob@^2.1.2: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== -available-typed-arrays@^1.0.0, available-typed-arrays@^1.0.2: +available-typed-arrays@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz#6b098ca9d8039079ee3f77f7b783c4480ba513f5" integrity sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ== @@ -2362,9 +2335,9 @@ babel-plugin-jest-hoist@^26.6.2: "@types/babel__traverse" "^7.0.6" babel-preset-current-node-syntax@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.0.tgz#cf5feef29551253471cfa82fc8e0f5063df07a77" - integrity sha512-mGkvkpocWJes1CmMKtgGUwCeeq0pOhALyymozzDWYomHTbDLwueDYG6p4TK1YOeYHCzBzYPsWkgTto10JubI1Q== + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" + integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== dependencies: "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-bigint" "^7.8.3" @@ -2469,15 +2442,15 @@ browser-process-hrtime@^1.0.0: integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== browserslist@^4.14.5: - version "4.15.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.15.0.tgz#3d48bbca6a3f378e86102ffd017d9a03f122bdb0" - integrity sha512-IJ1iysdMkGmjjYeRlDU8PQejVwxvVO5QOfXH7ylW31GO6LwNRSmm/SgRXtNsEXqMLl2e+2H5eEJ7sfynF8TCaQ== + version "4.16.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.1.tgz#bf757a2da376b3447b800a16f0f1c96358138766" + integrity sha512-UXhDrwqsNcpTYJBTZsbGATDxZbiVDsx6UjpmRUmtnP10pr8wAYr5LgFoEFw9ixriQH2mv/NX2SfGzE/o8GndLA== dependencies: - caniuse-lite "^1.0.30001164" + caniuse-lite "^1.0.30001173" colorette "^1.2.1" - electron-to-chromium "^1.3.612" + electron-to-chromium "^1.3.634" escalade "^3.1.1" - node-releases "^1.1.67" + node-releases "^1.1.69" bs-logger@0.x: version "0.2.6" @@ -2637,10 +2610,10 @@ camelcase@^6.0.0, camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== -caniuse-lite@^1.0.30001164: - version "1.0.30001164" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001164.tgz#5bbfd64ca605d43132f13cc7fdabb17c3036bfdc" - integrity sha512-G+A/tkf4bu0dSp9+duNiXc7bGds35DioCyC6vgK2m/rjA4Krpy5WeZgZyfH2f0wj2kI6yAWWucyap6oOwmY1mg== +caniuse-lite@^1.0.30001173: + version "1.0.30001173" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001173.tgz#3c47bbe3cd6d7a9eda7f50ac016d158005569f56" + integrity sha512-R3aqmjrICdGCTAnSXtNyvWYMK3YtV5jwudbq0T7nN9k4kmE4CBuwPqyJ+KBzepSTh0huivV2gLbSMEzTTmfeYw== capture-exit@^2.0.0: version "2.0.0" @@ -2865,30 +2838,20 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -command-line-usage@^6.1.0: - version "6.1.1" - resolved "https://registry.yarnpkg.com/command-line-usage/-/command-line-usage-6.1.1.tgz#c908e28686108917758a49f45efb4f02f76bc03f" - integrity sha512-F59pEuAR9o1SF/bD0dQBDluhpT4jJQNWUHEuVBqpDmCUo6gPjCi+m9fCWnWZVR/oG6cMTUms4h+3NPl74wGXvA== - dependencies: - array-back "^4.0.1" - chalk "^2.4.2" - table-layout "^1.0.1" - typical "^5.2.0" - commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== commander@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.0.tgz#b990bfb8ac030aedc6d11bc04d1488ffef56db75" - integrity sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q== + version "6.2.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" + integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== -commonmark@^0.29.2: - version "0.29.2" - resolved "https://registry.yarnpkg.com/commonmark/-/commonmark-0.29.2.tgz#e7bd5582400f2a45421f2f64eca19fc89cbd4e1b" - integrity sha512-spe43MvEIaPpHss1T7z4yQaFQfLGmMu+yvCwv6xqhELIwkG/ZGgDpxOPzKxnuYzYT2c+aziCCc8m2rBVLA7jUA== +commonmark@^0.29.3: + version "0.29.3" + resolved "https://registry.yarnpkg.com/commonmark/-/commonmark-0.29.3.tgz#bb1d5733bfe3ea213b412f33f16439cc12999c2c" + integrity sha512-fvt/NdOFKaL2gyhltSy6BC4LxbbxbnPxBMl923ittqO/JBM0wQHaoYZliE4tp26cRxX/ZZtRsJlZzQrVdUkXAA== dependencies: entities "~2.0" mdurl "~1.0.1" @@ -2951,7 +2914,7 @@ contains-path@^0.1.0: resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= -conventional-changelog-angular@^5.0.11, conventional-changelog-angular@^5.0.3: +conventional-changelog-angular@^5.0.12, conventional-changelog-angular@^5.0.3: version "5.0.12" resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.12.tgz#c979b8b921cbfe26402eb3da5bbfda02d865a2b9" integrity sha512-5GLsbnkR/7A89RyHLvvoExbiGbd9xKdKqDTrArnPbOqBqG/2wIosu0fHwpeIRI8Tl94MhVNBXcLJZl92ZQ5USw== @@ -2959,14 +2922,14 @@ conventional-changelog-angular@^5.0.11, conventional-changelog-angular@^5.0.3: compare-func "^2.0.0" q "^1.5.1" -conventional-changelog-atom@^2.0.7: +conventional-changelog-atom@^2.0.8: version "2.0.8" resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-2.0.8.tgz#a759ec61c22d1c1196925fca88fe3ae89fd7d8de" integrity sha512-xo6v46icsFTK3bb7dY/8m2qvc8sZemRgdqLb/bjpBsH2UyOS8rKNTgcb5025Hri6IpANPApbXMg15QLb1LJpBw== dependencies: q "^1.5.1" -conventional-changelog-codemirror@^2.0.7: +conventional-changelog-codemirror@^2.0.8: version "2.0.8" resolved "https://registry.yarnpkg.com/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.8.tgz#398e9530f08ce34ec4640af98eeaf3022eb1f7dc" integrity sha512-z5DAsn3uj1Vfp7po3gpt2Boc+Bdwmw2++ZHa5Ak9k0UKsYAO5mH1UBTN0qSCuJZREIhX6WU4E1p3IW2oRCNzQw== @@ -2978,16 +2941,7 @@ conventional-changelog-config-spec@2.1.0: resolved "https://registry.yarnpkg.com/conventional-changelog-config-spec/-/conventional-changelog-config-spec-2.1.0.tgz#874a635287ef8b581fd8558532bf655d4fb59f2d" integrity sha512-IpVePh16EbbB02V+UA+HQnnPIohgXvJRxHcS5+Uwk4AT5LjzCZJm5sp/yqs5C6KZJ1jMsV4paEV13BN1pvDuxQ== -conventional-changelog-conventionalcommits@4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.4.0.tgz#8d96687141c9bbd725a89b95c04966d364194cd4" - integrity sha512-ybvx76jTh08tpaYrYn/yd0uJNLt5yMrb1BphDe4WBredMlvPisvMghfpnJb6RmRNcqXeuhR6LfGZGewbkRm9yA== - dependencies: - compare-func "^2.0.0" - lodash "^4.17.15" - q "^1.5.1" - -conventional-changelog-conventionalcommits@^4.4.0: +conventional-changelog-conventionalcommits@4.5.0, conventional-changelog-conventionalcommits@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.5.0.tgz#a02e0b06d11d342fdc0f00c91d78265ed0bc0a62" integrity sha512-buge9xDvjjOxJlyxUnar/+6i/aVEVGA7EEh4OafBCXPlLUQPGbRUBhBUveWRxzvR8TEjhKEP4BdepnpG2FSZXw== @@ -3015,17 +2969,17 @@ conventional-changelog-core@^3.1.6: read-pkg-up "^3.0.0" through2 "^3.0.0" -conventional-changelog-core@^4.2.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-4.2.1.tgz#f811ad98ab2ff080becafc61407509420c9b447d" - integrity sha512-8cH8/DEoD3e5Q6aeogdR5oaaKs0+mG6+f+Om0ZYt3PNv7Zo0sQhu4bMDRsqAF+UTekTAtP1W/C41jH/fkm8Jtw== +conventional-changelog-core@^4.2.1: + version "4.2.2" + resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-4.2.2.tgz#f0897df6d53b5d63dec36b9442bd45354f8b3ce5" + integrity sha512-7pDpRUiobQDNkwHyJG7k9f6maPo9tfPzkSWbRq97GGiZqisElhnvUZSvyQH20ogfOjntB5aadvv6NNcKL1sReg== dependencies: add-stream "^1.0.0" conventional-changelog-writer "^4.0.18" conventional-commits-parser "^3.2.0" dateformat "^3.0.0" get-pkg-repo "^1.0.0" - git-raw-commits "2.0.0" + git-raw-commits "^2.0.8" git-remote-origin-url "^2.0.0" git-semver-tags "^4.1.1" lodash "^4.17.15" @@ -3036,35 +2990,35 @@ conventional-changelog-core@^4.2.0: shelljs "^0.8.3" through2 "^4.0.0" -conventional-changelog-ember@^2.0.8: +conventional-changelog-ember@^2.0.9: version "2.0.9" resolved "https://registry.yarnpkg.com/conventional-changelog-ember/-/conventional-changelog-ember-2.0.9.tgz#619b37ec708be9e74a220f4dcf79212ae1c92962" integrity sha512-ulzIReoZEvZCBDhcNYfDIsLTHzYHc7awh+eI44ZtV5cx6LVxLlVtEmcO+2/kGIHGtw+qVabJYjdI5cJOQgXh1A== dependencies: q "^1.5.1" -conventional-changelog-eslint@^3.0.8: +conventional-changelog-eslint@^3.0.9: version "3.0.9" resolved "https://registry.yarnpkg.com/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.9.tgz#689bd0a470e02f7baafe21a495880deea18b7cdb" integrity sha512-6NpUCMgU8qmWmyAMSZO5NrRd7rTgErjrm4VASam2u5jrZS0n38V7Y9CzTtLT2qwz5xEChDR4BduoWIr8TfwvXA== dependencies: q "^1.5.1" -conventional-changelog-express@^2.0.5: +conventional-changelog-express@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/conventional-changelog-express/-/conventional-changelog-express-2.0.6.tgz#420c9d92a347b72a91544750bffa9387665a6ee8" integrity sha512-SDez2f3iVJw6V563O3pRtNwXtQaSmEfTCaTBPCqn0oG0mfkq0rX4hHBq5P7De2MncoRixrALj3u3oQsNK+Q0pQ== dependencies: q "^1.5.1" -conventional-changelog-jquery@^3.0.10: +conventional-changelog-jquery@^3.0.11: version "3.0.11" resolved "https://registry.yarnpkg.com/conventional-changelog-jquery/-/conventional-changelog-jquery-3.0.11.tgz#d142207400f51c9e5bb588596598e24bba8994bf" integrity sha512-x8AWz5/Td55F7+o/9LQ6cQIPwrCjfJQ5Zmfqi8thwUEKHstEn4kTIofXub7plf1xvFA2TqhZlq7fy5OmV6BOMw== dependencies: q "^1.5.1" -conventional-changelog-jshint@^2.0.8: +conventional-changelog-jshint@^2.0.9: version "2.0.9" resolved "https://registry.yarnpkg.com/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.9.tgz#f2d7f23e6acd4927a238555d92c09b50fe3852ff" integrity sha512-wMLdaIzq6TNnMHMy31hql02OEQ8nCQfExw1SE0hYL5KvU+JCTuPaDO+7JiogGT2gJAxiUGATdtYYfh+nT+6riA== @@ -3078,9 +3032,9 @@ conventional-changelog-preset-loader@^2.1.1, conventional-changelog-preset-loade integrity sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g== conventional-changelog-writer@^4.0.18, conventional-changelog-writer@^4.0.6: - version "4.0.18" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.18.tgz#10b73baa59c7befc69b360562f8b9cd19e63daf8" - integrity sha512-mAQDCKyB9HsE8Ko5cCM1Jn1AWxXPYV0v8dFPabZRkvsiWUul2YyAqbIaoMKF88Zf2ffnOPSvKhboLf3fnjo5/A== + version "4.1.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.1.0.tgz#1ca7880b75aa28695ad33312a1f2366f4b12659f" + integrity sha512-WwKcUp7WyXYGQmkLsX4QmU42AZ1lqlvRW9mqoyiQzdD+rJWbTepdWoKJuwXTS+yq79XKnQNa93/roViPQrAQgw== dependencies: compare-func "^2.0.0" conventional-commits-filter "^2.0.7" @@ -3093,24 +3047,24 @@ conventional-changelog-writer@^4.0.18, conventional-changelog-writer@^4.0.6: split "^1.0.0" through2 "^4.0.0" -conventional-changelog@3.1.23: - version "3.1.23" - resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-3.1.23.tgz#d696408021b579a3814aba79b38729ed86478aea" - integrity sha512-sScUu2NHusjRC1dPc5p8/b3kT78OYr95/Bx7Vl8CPB8tF2mG1xei5iylDTRjONV5hTlzt+Cn/tBWrKdd299b7A== - dependencies: - conventional-changelog-angular "^5.0.11" - conventional-changelog-atom "^2.0.7" - conventional-changelog-codemirror "^2.0.7" - conventional-changelog-conventionalcommits "^4.4.0" - conventional-changelog-core "^4.2.0" - conventional-changelog-ember "^2.0.8" - conventional-changelog-eslint "^3.0.8" - conventional-changelog-express "^2.0.5" - conventional-changelog-jquery "^3.0.10" - conventional-changelog-jshint "^2.0.8" +conventional-changelog@3.1.24: + version "3.1.24" + resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-3.1.24.tgz#ebd180b0fd1b2e1f0095c4b04fd088698348a464" + integrity sha512-ed6k8PO00UVvhExYohroVPXcOJ/K1N0/drJHx/faTH37OIZthlecuLIRX/T6uOp682CAoVoFpu+sSEaeuH6Asg== + dependencies: + conventional-changelog-angular "^5.0.12" + conventional-changelog-atom "^2.0.8" + conventional-changelog-codemirror "^2.0.8" + conventional-changelog-conventionalcommits "^4.5.0" + conventional-changelog-core "^4.2.1" + conventional-changelog-ember "^2.0.9" + conventional-changelog-eslint "^3.0.9" + conventional-changelog-express "^2.0.6" + conventional-changelog-jquery "^3.0.11" + conventional-changelog-jshint "^2.0.9" conventional-changelog-preset-loader "^2.3.4" -conventional-commits-filter@^2.0.2, conventional-commits-filter@^2.0.6, conventional-commits-filter@^2.0.7: +conventional-commits-filter@^2.0.2, conventional-commits-filter@^2.0.7: version "2.0.7" resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz#f8d9b4f182fce00c9af7139da49365b136c8a0b3" integrity sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA== @@ -3118,7 +3072,7 @@ conventional-commits-filter@^2.0.2, conventional-commits-filter@^2.0.6, conventi lodash.ismatch "^4.4.0" modify-values "^1.0.0" -conventional-commits-parser@^3.0.3, conventional-commits-parser@^3.1.0, conventional-commits-parser@^3.2.0: +conventional-commits-parser@^3.0.3, conventional-commits-parser@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.0.tgz#9e261b139ca4b7b29bcebbc54460da36894004ca" integrity sha512-XmJiXPxsF0JhAKyfA2Nn+rZwYKJ60nanlbSWwwkGwLQFbugsc0gv1rzc7VbbUWAzJfR1qR87/pNgv9NgmxtBMQ== @@ -3131,18 +3085,18 @@ conventional-commits-parser@^3.0.3, conventional-commits-parser@^3.1.0, conventi through2 "^4.0.0" trim-off-newlines "^1.0.0" -conventional-recommended-bump@6.0.10: - version "6.0.10" - resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-6.0.10.tgz#ac2fb3e31bad2aeda80086b345bf0c52edd1d1b3" - integrity sha512-2ibrqAFMN3ZA369JgVoSbajdD/BHN6zjY7DZFKTHzyzuQejDUCjQ85S5KHxCRxNwsbDJhTPD5hOKcis/jQhRgg== +conventional-recommended-bump@6.0.11: + version "6.0.11" + resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-6.0.11.tgz#fcc39acb51d1946b63fc478737d1e52712f36356" + integrity sha512-FciYBMwzwwBZ1K4NS8c57rsOfSc51e1V6UVSNIosrjH+A6xXkyiA4ELwoWyRKdMhJ+m3O6ru9ZJ7F2QFjjYJdQ== dependencies: concat-stream "^2.0.0" conventional-changelog-preset-loader "^2.3.4" - conventional-commits-filter "^2.0.6" - conventional-commits-parser "^3.1.0" + conventional-commits-filter "^2.0.7" + conventional-commits-parser "^3.2.0" git-raw-commits "2.0.0" - git-semver-tags "^4.1.0" - meow "^7.0.0" + git-semver-tags "^4.1.1" + meow "^8.0.0" q "^1.5.1" conventional-recommended-bump@^5.0.0: @@ -3214,7 +3168,7 @@ cross-spawn@^6.0.0: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.0, cross-spawn@^7.0.2: +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -3259,6 +3213,11 @@ dargs@^4.0.1: dependencies: number-is-nan "^1.0.0" +dargs@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" + integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -3377,11 +3336,6 @@ deep-equal@^2.0.5: which-collection "^1.0.1" which-typed-array "^1.1.2" -deep-extend@~0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -3577,10 +3531,10 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -electron-to-chromium@^1.3.612: - version "1.3.613" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.613.tgz#5ad7ec1e19d28c81edb6d61b9d4990d1c9716182" - integrity sha512-c3gkahddiUalk7HLhTC7PsKzPZmovYFtgh+g3rZJ+dGokk4n4dzEoOBnoV8VU8ptvnGJMhrjM/lyXKSltqf2hQ== +electron-to-chromium@^1.3.634: + version "1.3.634" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.634.tgz#82ea400f520f739c4f6ff00c1f7524827a917d25" + integrity sha512-QPrWNYeE/A0xRvl/QP3E0nkaEvYUvH3gM04ZWYtIa6QlSpEetRlRI1xvQ7hiMIySHHEV+mwDSX8Kj4YZY6ZQAw== emittery@^0.7.1: version "0.7.2" @@ -3616,13 +3570,13 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@^5.3.1: - version "5.3.2" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.3.2.tgz#142295dda51aaaff049cf256459dc9a82a0b67f3" - integrity sha512-G28GCrglCAH6+EqMN2D+Q2wCUS1O1vVQJBn8ME2I/Api41YBe4vLWWRBOUbwDH7vwzSZdljxwTRVqnf+sm6XqQ== +enhanced-resolve@^5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.6.0.tgz#ad19a1665f230a6e384724a30acf3f7332b2b3f0" + integrity sha512-C3GGDfFZmqUa21o10YRKbZN60DPl0HyXKXxoEnQMWso9u7KMU23L7CBHfr/rVxORddY/8YQZaU2MZ1ewTS8Pcw== dependencies: graceful-fs "^4.2.4" - tapable "^2.0.0" + tapable "^2.2.0" enquirer@^2.3.5, enquirer@^2.3.6: version "2.3.6" @@ -3658,7 +3612,7 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.17.0-next.1, es-abstract@^1.17.4, es-abstract@^1.17.5: +es-abstract@^1.17.0-next.1: version "1.17.7" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.7.tgz#a4de61b2f66989fc7421676c1cb9787573ace54c" integrity sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g== @@ -3675,7 +3629,7 @@ es-abstract@^1.17.0-next.1, es-abstract@^1.17.4, es-abstract@^1.17.5: string.prototype.trimend "^1.0.1" string.prototype.trimstart "^1.0.1" -es-abstract@^1.18.0-next.0, es-abstract@^1.18.0-next.1: +es-abstract@^1.18.0-next.1: version "1.18.0-next.1" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" integrity sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA== @@ -3760,12 +3714,10 @@ escodegen@^1.14.1: optionalDependencies: source-map "~0.6.1" -eslint-config-prettier@^6.15.0: - version "6.15.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz#7f93f6cb7d45a92f1537a70ecc06366e1ac6fed9" - integrity sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw== - dependencies: - get-stdin "^6.0.0" +eslint-config-prettier@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-7.1.0.tgz#5402eb559aa94b894effd6bddfa0b1ca051c858f" + integrity sha512-9sm5/PxaFG7qNJvJzTROMM1Bk1ozXVTKI0buKOyb0Bsr1hrwi0H/TzxF/COtf1uxikIK8SwhX7K6zg78jAzbeA== eslint-import-resolver-node@^0.3.4: version "0.3.4" @@ -3813,10 +3765,10 @@ eslint-plugin-import@^2.22.1: resolve "^1.17.0" tsconfig-paths "^3.9.0" -eslint-plugin-prettier@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.2.0.tgz#af391b2226fa0e15c96f36c733f6e9035dbd952c" - integrity sha512-kOUSJnFjAUFKwVxuzy6sA5yyMx6+o9ino4gCdShzBNx4eyFRudWRYKCFolKjoM40PEiuU6Cn7wBLfq3WsGg7qg== +eslint-plugin-prettier@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz#7079cfa2497078905011e6f82e8dd8453d1371b7" + integrity sha512-Rq3jkcFY8RYeQLgk2cCwuc0P7SEFwDravPhsJZOQ5N4YI4DSg50NyqJ/9gdZHzQlHf8MvafSesbNJCcP/FF6pQ== dependencies: prettier-linter-helpers "^1.0.0" @@ -3845,10 +3797,10 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@^7.15.0: - version "7.15.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.15.0.tgz#eb155fb8ed0865fcf5d903f76be2e5b6cd7e0bc7" - integrity sha512-Vr64xFDT8w30wFll643e7cGrIkPEU50yIiI36OdSIDoSGguIeaLzBo0vpGvzo9RECUqq7htURfwEtKqwytkqzA== +eslint@^7.17.0: + version "7.17.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.17.0.tgz#4ccda5bf12572ad3bf760e6f195886f50569adb0" + integrity sha512-zJk08MiBgwuGoxes5sSQhOtibZ75pz0J35XTRlZOk9xMffhpA9BTbQZxoXZzOl5zMbleShbGwtw+1kGferfFwQ== dependencies: "@babel/code-frame" "^7.0.0" "@eslint/eslintrc" "^0.2.2" @@ -3884,7 +3836,7 @@ eslint@^7.15.0: semver "^7.2.1" strip-ansi "^6.0.0" strip-json-comments "^3.1.0" - table "^5.2.3" + table "^6.0.4" text-table "^0.2.0" v8-compile-cache "^2.0.3" @@ -3959,7 +3911,7 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^4.0.0, execa@^4.1.0: +execa@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== @@ -3974,6 +3926,21 @@ execa@^4.0.0, execa@^4.1.0: signal-exit "^3.0.2" strip-final-newline "^2.0.0" +execa@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.0.0.tgz#4029b0007998a841fbd1032e5f4de86a3c1e3376" + integrity sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -4101,10 +4068,15 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fastest-levenshtein@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2" + integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow== + fastq@^1.6.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.9.0.tgz#e16a72f338eaca48e91b5c23593bcc2ef66b7947" - integrity sha512-i7FVWL8HhVY+CTkwFxkN2mk3h+787ixS5S63eb78diVRc1MCssarHq3W5cj0av7YDSwmaV928RNag+U1etRQ7w== + version "1.10.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.10.0.tgz#74dbefccade964932cdf500473ef302719c652bb" + integrity sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA== dependencies: reusify "^1.0.4" @@ -4188,6 +4160,14 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -4309,9 +4289,9 @@ fs.realpath@^1.0.0: integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fsevents@^2.1.2: - version "2.2.1" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.2.1.tgz#1fb02ded2036a8ac288d507a65962bd87b97628d" - integrity sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA== + version "2.3.1" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.1.tgz#b209ab14c61012636c8863507edf7fb68cc54e9f" + integrity sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw== function-bind@^1.1.1: version "1.1.1" @@ -4352,10 +4332,10 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.0, get-intrinsic@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.1.tgz#94a9768fcbdd0595a1c9273aacf4c89d075631be" - integrity sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg== +get-intrinsic@^1.0.0, get-intrinsic@^1.0.1, get-intrinsic@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.2.tgz#6820da226e50b24894e08859469dc68361545d49" + integrity sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg== dependencies: function-bind "^1.1.1" has "^1.0.3" @@ -4387,11 +4367,6 @@ get-stdin@^4.0.1: resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4= -get-stdin@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" - integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== - get-stream@^4.0.0, get-stream@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -4406,6 +4381,11 @@ get-stream@^5.0.0: dependencies: pump "^3.0.0" +get-stream@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.0.tgz#3e0012cb6827319da2706e601a1583e8629a6718" + integrity sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg== + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -4429,6 +4409,17 @@ git-raw-commits@2.0.0: split2 "^2.0.0" through2 "^2.0.0" +git-raw-commits@^2.0.8: + version "2.0.9" + resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.9.tgz#5cbc707a615cb77b71e687f8a1ee54af46208b22" + integrity sha512-hSpNpxprVno7IOd4PZ93RQ+gNdzPAIrW0x8av6JQDJGV4k1mR9fE01dl8sEqi2P7aKmmwiGUn1BCPuf16Ae0Qw== + dependencies: + dargs "^7.0.0" + lodash.template "^4.0.2" + meow "^8.0.0" + split2 "^3.0.0" + through2 "^4.0.0" + git-remote-origin-url@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz#5282659dae2107145a11126112ad3216ec5fa65f" @@ -4445,7 +4436,7 @@ git-semver-tags@^2.0.3: meow "^4.0.0" semver "^6.0.0" -git-semver-tags@^4.0.0, git-semver-tags@^4.1.0, git-semver-tags@^4.1.1: +git-semver-tags@^4.0.0, git-semver-tags@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-4.1.1.tgz#63191bcd809b0ec3e151ba4751c16c444e5b5780" integrity sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA== @@ -4462,9 +4453,9 @@ git-up@^4.0.0: parse-url "^5.0.0" git-url-parse@^11.1.2: - version "11.4.0" - resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-11.4.0.tgz#f2bb1f2b00f05552540e95a62e31399a639a6aa6" - integrity sha512-KlIa5jvMYLjXMQXkqpFzobsyD/V2K5DRHl5OAf+6oDFPlPLxrGDVQlIdI63c4/Kt6kai4kALENSALlzTGST3GQ== + version "11.4.3" + resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-11.4.3.tgz#1610284edf1f14964180f5b3399ec68b692cfd87" + integrity sha512-LZTTk0nqJnKN48YRtOpR8H5SEfp1oM2tls90NuZmBxN95PnCvmuXGzqQ4QmVirBgKx2KPYfPGteX3/raWjKenQ== dependencies: git-up "^4.0.0" @@ -4525,9 +4516,9 @@ globals@^12.1.0: type-fest "^0.8.1" globby@^11.0.1: - version "11.0.1" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.1.tgz#9a2bf107a068f3ffeabc49ad702c79ede8cfd357" - integrity sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ== + version "11.0.2" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.2.tgz#1af538b766a3b540ebfb58a32b2e2d5897321d83" + integrity sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" @@ -4707,6 +4698,11 @@ human-signals@^1.1.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" @@ -4759,9 +4755,9 @@ import-fresh@^2.0.0: resolve-from "^3.0.0" import-fresh@^3.0.0, import-fresh@^3.2.1: - version "3.2.2" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.2.tgz#fc129c160c5d68235507f4331a6baad186bdbc3e" - integrity sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw== + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== dependencies: parent-module "^1.0.0" resolve-from "^4.0.0" @@ -4823,9 +4819,9 @@ inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== ini@^1.3.2, ini@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + version "1.3.8" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" + integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== init-package-json@^1.10.3: version "1.10.3" @@ -4914,24 +4910,28 @@ is-accessor-descriptor@^1.0.0: kind-of "^6.0.0" is-arguments@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.0.4.tgz#3faf966c7cba0ff437fb31f6250082fcf0448cf3" - integrity sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA== + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9" + integrity sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg== + dependencies: + call-bind "^1.0.0" is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= -is-bigint@^1.0.0: +is-bigint@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.1.tgz#6923051dfcbc764278540b9ce0e6b3213aa5ebc2" integrity sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg== -is-boolean-object@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.1.tgz#10edc0900dd127697a92f6f9807c7617d68ac48e" - integrity sha512-TqZuVwa/sppcrhUCAYkGBk7w0yxfQQnxq28fjkO53tnK9FQXmdwz2JS5+GjsWQ6RByES1K40nI+yDic5c9/aAQ== +is-boolean-object@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.0.tgz#e2aaad3a3a8fca34c28f6eee135b156ed2587ff0" + integrity sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA== + dependencies: + call-bind "^1.0.0" is-buffer@^1.1.5: version "1.1.6" @@ -5063,16 +5063,16 @@ is-glob@^4.0.0, is-glob@^4.0.1: is-extglob "^2.1.1" is-map@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.1.tgz#520dafc4307bb8ebc33b813de5ce7c9400d644a1" - integrity sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw== + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" + integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== is-negative-zero@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.0.tgz#9553b121b0fac28869da9ed459e20c7543788461" - integrity sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE= + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" + integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== -is-number-object@^1.0.3: +is-number-object@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197" integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw== @@ -5129,9 +5129,9 @@ is-regex@^1.1.1: has-symbols "^1.0.1" is-set@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.1.tgz#d1604afdab1724986d30091575f54945da7e5f43" - integrity sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA== + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.2.tgz#90755fa4c2562dc1c5d4024760d6119b94ca18ec" + integrity sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g== is-ssh@^1.3.0: version "1.3.2" @@ -5150,12 +5150,12 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== -is-string@^1.0.4, is-string@^1.0.5: +is-string@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== -is-symbol@^1.0.2: +is-symbol@^1.0.2, is-symbol@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== @@ -5170,12 +5170,13 @@ is-text-path@^1.0.1: text-extensions "^1.0.0" is-typed-array@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.3.tgz#a4ff5a5e672e1a55f99c7f54e59597af5c1df04d" - integrity sha512-BSYUBOK/HJibQ30wWkWold5txYwMUXQct9YHAQJr8fSwvZoiglcqB0pd7vEN23+Tsi9IUEjztdOSzl4qLVYGTQ== + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.4.tgz#1f66f34a283a3c94a4335434661ca53fff801120" + integrity sha512-ILaRgn4zaSrVNXNGtON6iFNotXW3hAPF3+0fB1usg2jFlWqo5fEDdmJkz0zBfoi7Dgskr8Khi2xZ8cXqZEfXNA== dependencies: - available-typed-arrays "^1.0.0" - es-abstract "^1.17.4" + available-typed-arrays "^1.0.2" + call-bind "^1.0.0" + es-abstract "^1.18.0-next.1" foreach "^2.0.5" has-symbols "^1.0.1" @@ -5676,7 +5677,7 @@ jest-watcher@^26.6.2: jest-util "^26.6.2" string-length "^4.0.1" -jest-worker@^26.6.1, jest-worker@^26.6.2: +jest-worker@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== @@ -5700,9 +5701,9 @@ js-tokens@^4.0.0: integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.1: - version "3.14.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" - integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -5773,6 +5774,11 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" @@ -5971,10 +5977,10 @@ load-json-file@^5.3.0: strip-bom "^3.0.0" type-fest "^0.3.0" -loader-runner@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.1.0.tgz#f70bc0c29edbabdf2043e7ee73ccc3fe1c96b42d" - integrity sha512-oR4lB4WvwFoC70ocraKhn5nkKSs23t57h9udUgw8o0iH8hMXeEoRuUgfcvgUwAJ1ZpRqBvcou4N2SMvM1DwMrA== +loader-runner@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384" + integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== loader-utils@^1.1.0: version "1.4.0" @@ -5985,15 +5991,6 @@ loader-utils@^1.1.0: emojis-list "^3.0.0" json5 "^1.0.1" -loader-utils@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0" - integrity sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^2.1.2" - locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -6017,6 +6014,13 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + lodash._reinterpolate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" @@ -6072,7 +6076,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.11.2, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.2.1: +lodash@^4.11.2, lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.2.1: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== @@ -6241,27 +6245,10 @@ meow@^4.0.0: redent "^2.0.0" trim-newlines "^2.0.0" -meow@^7.0.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/meow/-/meow-7.1.1.tgz#7c01595e3d337fcb0ec4e8eed1666ea95903d306" - integrity sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA== - dependencies: - "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "4.1.0" - normalize-package-data "^2.5.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.13.1" - yargs-parser "^18.1.3" - meow@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-8.0.0.tgz#1aa10ee61046719e334ffdc038bb5069250ec99a" - integrity sha512-nbsTRz2fwniJBFgUkcdISq8y/q9n9VbiHYbfwklFh5V4V2uAcxtKQkDc0yCLPM/kP0d+inZBewn3zJqewHE7kg== + version "8.1.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.0.tgz#0fcaa267e35e4d58584b8205923df6021ddcc7ba" + integrity sha512-fNWkgM1UVMey2kf24yLiccxLihc5W+6zVus3/N0b+VfnJgxV99E9u04X6NAiKdg6ED7DAQBX5sy36NM0QJZkWA== dependencies: "@types/minimist" "^1.2.0" camelcase-keys "^6.2.2" @@ -6312,17 +6299,17 @@ micromatch@^4.0.2: braces "^3.0.1" picomatch "^2.0.5" -mime-db@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" - integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== +mime-db@1.45.0: + version "1.45.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.45.0.tgz#cceeda21ccd7c3a745eba2decd55d4b73e7879ea" + integrity sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w== mime-types@^2.1.12, mime-types@^2.1.27, mime-types@~2.1.19: - version "2.1.27" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" - integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== + version "2.1.28" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.28.tgz#1160c4757eab2c5363888e005273ecf79d2a0ecd" + integrity sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ== dependencies: - mime-db "1.44.0" + mime-db "1.45.0" mimic-fn@^1.0.0: version "1.2.0" @@ -6468,11 +6455,16 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= -ms@2.1.2, ms@^2.0.0, ms@^2.1.1: +ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +ms@^2.0.0, ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + multimatch@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-3.0.0.tgz#0e2534cc6bc238d9ab67e1b9cd5fcd85a6dbf70b" @@ -6576,9 +6568,9 @@ node-modules-regexp@^1.0.0: integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= node-notifier@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.0.tgz#a7eee2d51da6d0f7ff5094bc7108c911240c1620" - integrity sha512-46z7DUmcjoYdaWyXouuFNNfUo6eFa94t23c53c+lG/9Cvauk4a98rAUp9672X5dxGdQmLpPzTxzu8f/OeEPaFA== + version "8.0.1" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.1.tgz#f86e89bbc925f2b068784b31f382afdc6ca56be1" + integrity sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA== dependencies: growly "^1.3.0" is-wsl "^2.2.0" @@ -6587,10 +6579,10 @@ node-notifier@^8.0.0: uuid "^8.3.0" which "^2.0.2" -node-releases@^1.1.67: - version "1.1.67" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.67.tgz#28ebfcccd0baa6aad8e8d4d8fe4cbc49ae239c12" - integrity sha512-V5QF9noGFl3EymEwUYzO+3NTDpGfQB4ve6Qfnzf3UNydMhjQRVPR1DZTuvWiLzaFJYw2fmDwAfnRNEVb64hSIg== +node-releases@^1.1.69: + version "1.1.69" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.69.tgz#3149dbde53b781610cd8b486d62d86e26c3725f6" + integrity sha512-DGIjo79VDEyAnRlfSqYTsy+yoHd2IOjJiKUozD2MV2D85Vso6Bug56mb9tT/fY5Urt0iqk01H7x+llAruDR2zA== nopt@^4.0.1: version "4.0.3" @@ -6698,7 +6690,7 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -npm-run-path@^4.0.0: +npm-run-path@^4.0.0, npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== @@ -6749,7 +6741,7 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-inspect@^1.8.0: +object-inspect@^1.8.0, object-inspect@^1.9.0: version "1.9.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a" integrity sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw== @@ -6829,7 +6821,7 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" -onetime@^5.1.0: +onetime@^5.1.0, onetime@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== @@ -6910,7 +6902,7 @@ p-limit@^2.0.0, p-limit@^2.2.0: dependencies: p-try "^2.0.0" -p-limit@^3.0.2: +p-limit@^3.0.2, p-limit@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== @@ -6938,6 +6930,13 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + p-map-series@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-map-series/-/p-map-series-1.0.0.tgz#bf98fe575705658a9e1351befb85ae4c1f07bdca" @@ -7203,6 +7202,13 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +pkg-dir@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" + integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== + dependencies: + find-up "^5.0.0" + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -7478,7 +7484,7 @@ read@1, read@~1.0.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" -"readable-stream@2 || 3", readable-stream@3, readable-stream@^3.0.2: +"readable-stream@2 || 3", readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -7545,11 +7551,6 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" -reduce-flatten@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27" - integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== - regenerator-runtime@^0.13.4: version "0.13.7" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" @@ -7645,6 +7646,11 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" @@ -7684,7 +7690,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.3.2, resolve@^1.9.0: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.9.0: version "1.19.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== @@ -7916,14 +7922,15 @@ shellwords@^0.1.1: integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== side-channel@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.3.tgz#cdc46b057550bbab63706210838df5d4c19519c3" - integrity sha512-A6+ByhlLkksFoUepsGxfj5x1gTSrs+OydsRptUxeNCabQpCFUvcwIczgOigI8vhY/OJCnPnyE9rGiwgvr9cS1g== + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== dependencies: - es-abstract "^1.18.0-next.0" - object-inspect "^1.8.0" + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" -signal-exit@^3.0.0, signal-exit@^3.0.2: +signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== @@ -7943,14 +7950,14 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" slide@^1.1.6: version "1.1.6" @@ -8029,17 +8036,14 @@ source-list-map@^2.0.1: resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== -source-map-loader@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/source-map-loader/-/source-map-loader-1.1.3.tgz#7dbc2fe7ea09d3e43c51fd9fc478b7f016c1f820" - integrity sha512-6YHeF+XzDOrT/ycFJNI53cgEsp/tHTMl37hi7uVyqFAlTXW109JazaQCkbc+jjoL2637qkH1amLi+JzrIpt5lA== +source-map-loader@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/source-map-loader/-/source-map-loader-2.0.0.tgz#6651dc5a46beb2b914abacd00b8f9dd0e7757820" + integrity sha512-DJLK+gR9hlx+58yGU54EDAQZzR/TksgrtvRtyEBWnd5DR7O4n0RgdyO/KBwJ76zF+wDiFRT/1vdV3SdLUR68Lg== dependencies: abab "^2.0.5" iconv-lite "^0.6.2" - loader-utils "^2.0.0" - schema-utils "^3.0.0" source-map "^0.6.1" - whatwg-mimetype "^2.3.0" source-map-resolve@^0.5.0: version "0.5.3" @@ -8125,6 +8129,13 @@ split2@^2.0.0: dependencies: through2 "^2.0.2" +split2@^3.0.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" + integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== + dependencies: + readable-stream "^3.0.0" + split@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" @@ -8166,21 +8177,21 @@ stack-utils@^2.0.2: dependencies: escape-string-regexp "^2.0.0" -standard-version@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-9.0.0.tgz#814055add91eec8679a773768927f927183fc818" - integrity sha512-eRR04IscMP3xW9MJTykwz13HFNYs8jS33AGuDiBKgfo5YrO0qX0Nxb4rjupVwT5HDYL/aR+MBEVLjlmVFmFEDQ== +standard-version@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-9.1.0.tgz#07589469324d967ffe665fa86ef612949a858a80" + integrity sha512-EJcbKUGKBuHjiDSUL5XjPhT1KGVM+UCvv/ti70fHnJwJyJqTSJWl0mWj/Wj0WwsoskyvKWURESzBsZmCCMUZzg== dependencies: chalk "^2.4.2" - conventional-changelog "3.1.23" + conventional-changelog "3.1.24" conventional-changelog-config-spec "2.1.0" - conventional-changelog-conventionalcommits "4.4.0" - conventional-recommended-bump "6.0.10" + conventional-changelog-conventionalcommits "4.5.0" + conventional-recommended-bump "6.0.11" detect-indent "^6.0.0" detect-newline "^3.1.0" dotgitignore "^2.1.0" figures "^3.1.0" - find-up "^4.1.0" + find-up "^5.0.0" fs-access "^1.0.1" git-semver-tags "^4.0.0" semver "^7.1.1" @@ -8425,30 +8436,20 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -table-layout@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-1.0.1.tgz#8411181ee951278ad0638aea2f779a9ce42894f9" - integrity sha512-dEquqYNJiGwY7iPfZ3wbXDI944iqanTSchrACLL2nOB+1r+h1Nzu2eH+DuPPvWvm5Ry7iAPeFlgEtP5bIp5U7Q== - dependencies: - array-back "^4.0.1" - deep-extend "~0.6.0" - typical "^5.2.0" - wordwrapjs "^4.0.0" - -table@^5.2.3: - version "5.4.6" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" - integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== - dependencies: - ajv "^6.10.2" - lodash "^4.17.14" - slice-ansi "^2.1.0" - string-width "^3.0.0" +table@^6.0.4: + version "6.0.7" + resolved "https://registry.yarnpkg.com/table/-/table-6.0.7.tgz#e45897ffbcc1bcf9e8a87bf420f2c9e5a7a52a34" + integrity sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g== + dependencies: + ajv "^7.0.2" + lodash "^4.17.20" + slice-ansi "^4.0.0" + string-width "^4.2.0" -tapable@^2.0.0, tapable@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.1.1.tgz#b01cc1902d42a7bb30514e320ce21c456f72fd3f" - integrity sha512-Wib1S8m2wdpLbmQz0RBEVosIyvb/ykfKXf3ZIDqvWoMg/zTNm6G/tDSuUM61J1kNCDXWJrLHGSFeMhAG+gAGpQ== +tapable@^2.1.1, tapable@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b" + integrity sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw== tar@^4.4.10, tar@^4.4.12, tar@^4.4.8: version "4.4.13" @@ -8463,10 +8464,10 @@ tar@^4.4.10, tar@^4.4.12, tar@^4.4.8: safe-buffer "^5.1.2" yallist "^3.0.3" -tar@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.0.5.tgz#bde815086e10b39f1dcd298e89d596e1535e200f" - integrity sha512-0b4HOimQHj9nXNEAA7zWwMM91Zhhba3pspja6sQbgTpynOJf+bkjBnfybNYzbpLbnwXnbyB4LOREvlyXLkCHSg== +tar@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.0.tgz#d1724e9bcc04b977b18d5c573b333a2207229a83" + integrity sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" @@ -8500,19 +8501,19 @@ terminal-link@^2.0.0: ansi-escapes "^4.2.1" supports-hyperlinks "^2.0.0" -terser-webpack-plugin@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.0.3.tgz#ec60542db2421f45735c719d2e17dabfbb2e3e42" - integrity sha512-zFdGk8Lh9ZJGPxxPE6jwysOlATWB8GMW8HcfGULWA/nPal+3VdATflQvSBSLQJRCmYZnfFJl6vkRTiwJGNgPiQ== +terser-webpack-plugin@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.1.1.tgz#7effadee06f7ecfa093dbbd3e9ab23f5f3ed8673" + integrity sha512-5XNNXZiR8YO6X6KhSGXfY0QrGrCRlSwAEjIIrlRQR4W8nP69TaJUlh3bkuac6zzgspiGPfKEHcY295MMVExl5Q== dependencies: - jest-worker "^26.6.1" - p-limit "^3.0.2" + jest-worker "^26.6.2" + p-limit "^3.1.0" schema-utils "^3.0.0" serialize-javascript "^5.0.1" source-map "^0.6.1" - terser "^5.3.8" + terser "^5.5.1" -terser@^5.3.8: +terser@^5.5.1: version "5.5.1" resolved "https://registry.yarnpkg.com/terser/-/terser-5.5.1.tgz#540caa25139d6f496fdea056e414284886fb2289" integrity sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ== @@ -8704,10 +8705,10 @@ ts-jest@^26.4.4: semver "7.x" yargs-parser "20.x" -ts-node@^9.1.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.1.0.tgz#95eae4c6d0f94f2545884078e1eb1b14d2155639" - integrity sha512-0yqcL4sgruCvM+w64LiAfNJo6+lHfCYc5Ajj4yiLNkJ9oZ2HWaa+Kso7htYOOxVQ7+csAjdUjffOe9PIqC4pMg== +ts-node@^9.1.1: + version "9.1.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.1.1.tgz#51a9a450a3e959401bda5f004a72d54b936d376d" + integrity sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg== dependencies: arg "^4.1.0" create-require "^1.1.0" @@ -8732,9 +8733,9 @@ tslib@^1.8.1, tslib@^1.9.0: integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== tsutils@^3.17.1: - version "3.17.1" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" - integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== + version "3.18.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.18.0.tgz#38add50a28ec97e988cb43c5b32e55d1ff4a222a" + integrity sha512-D9Tu8nE3E7D1Bsf/V29oMHceMf+gnVO+pDguk/A5YRo1cLpkiQ48ZnbbS57pvvHeY+OIeNQx1vf4ASPlEtRpcA== dependencies: tslib "^1.8.1" @@ -8774,11 +8775,6 @@ type-fest@^0.11.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== -type-fest@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934" - integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg== - type-fest@^0.18.0: version "0.18.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" @@ -8811,36 +8807,31 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript-json-schema@^0.45.0: - version "0.45.0" - resolved "https://registry.yarnpkg.com/typescript-json-schema/-/typescript-json-schema-0.45.0.tgz#2f244e99518e589a442ee5f9c1d2c85a1ec7dc84" - integrity sha512-4MeX0HIODRd+K1/sIbkPryGXG43PVQ9cvIC8gDYml6yBgcsWLjvPMpTNr9VV+bQwpDLncB8Ie4qSenuKUwNZpg== +typescript-json-schema@^0.47.0: + version "0.47.0" + resolved "https://registry.yarnpkg.com/typescript-json-schema/-/typescript-json-schema-0.47.0.tgz#84dde5460b127c6774da81bf70b23c7e04857b13" + integrity sha512-A6NVwSOTSsNDHfaqDcDeKwwyXEeKqBHoAr20jcetnYj4e8C6zVFofAVhAuwsBXCRYiWEE/lyHrcxpsSpbIk0Mg== dependencies: "@types/json-schema" "^7.0.6" glob "^7.1.6" json-stable-stringify "^1.0.1" - typescript "^4.1.2" - yargs "^16.1.1" + typescript "^4.1.3" + yargs "^16.2.0" -typescript@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.2.tgz#6369ef22516fe5e10304aae5a5c4862db55380e9" - integrity sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ== +typescript@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.3.tgz#519d582bd94cba0cf8934c7d8e8467e473f53bb7" + integrity sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg== typescript@~3.9.7: version "3.9.7" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa" integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw== -typical@^5.0.0, typical@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/typical/-/typical-5.2.0.tgz#4daaac4f2b5315460804f0acf6cb69c52bb93066" - integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg== - uglify-js@^3.1.4: - version "3.12.1" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.12.1.tgz#78307f539f7b9ca5557babb186ea78ad30cc0375" - integrity sha512-o8lHP20KjIiQe5b/67Rh68xEGRrc2SRsCuuoYclXXoC74AfSRGblU1HKzJWH3HxPZ+Ort85fWHpSX7KwBUC9CQ== + version "3.12.4" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.12.4.tgz#93de48bb76bb3ec0fc36563f871ba46e2ee5c7ee" + integrity sha512-L5i5jg/SHkEqzN18gQMTWsZk3KelRsfD1wUVNqtq0kzqWQqcJjyL8yc1o8hJgRrWqrAl2mUFbhfznEIoi7zi2A== uid-number@0.0.6: version "0.0.6" @@ -8951,9 +8942,9 @@ uuid@^3.0.1, uuid@^3.3.2: integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== uuid@^8.3.0: - version "8.3.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.1.tgz#2ba2e6ca000da60fce5a196954ab241131e05a31" - integrity sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg== + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== v8-compile-cache@^2.0.3, v8-compile-cache@^2.2.0: version "2.2.0" @@ -8961,9 +8952,9 @@ v8-compile-cache@^2.0.3, v8-compile-cache@^2.2.0: integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== v8-to-istanbul@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-7.0.0.tgz#b4fe00e35649ef7785a9b7fcebcea05f37c332fc" - integrity sha512-fLL2rFuQpMtm9r8hrAV2apXX/WqHJ6+IC4/eQVdMDGBUgH/YMV4Gv3duk3kjmyg6uiQWBAA9nJwue4iJUOkHeA== + version "7.1.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-7.1.0.tgz#5b95cef45c0f83217ec79f8fc7ee1c8b486aee07" + integrity sha512-uXUVqNUCLa0AH1vuVxzi+MI4RfxEOKt9pBgKwHbgH7st8Kv2P1m+jvWNnektzBh5QShF3ODgKmUFCf38LnVz1g== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" @@ -9034,9 +9025,9 @@ wasm-loader@^1.3.0: wasm-dce "^1.0.0" watchpack@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.0.1.tgz#2f2192c542c82a3bcde76acd3411470c120426a8" - integrity sha512-vO8AKGX22ZRo6PiOFM9dC0re8IcKh8Kd/aH2zeqUc6w4/jBGlTy2P7fTC6ekT0NjVeGjgU2dGC5rNstKkeLEQg== + version "2.1.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.1.0.tgz#e63194736bf3aa22026f7b191cd57907b0f9f696" + integrity sha512-UjgD1mqjkG99+3lgG36at4wPnUXNvis2v1utwTgQ43C22c4LD71LsYMExdWXh4HZ+RmW+B0t1Vrg2GpXAkTOQw== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -9077,21 +9068,21 @@ webidl-conversions@^6.1.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== -webpack-cli@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.2.0.tgz#10a09030ad2bd4d8b0f78322fba6ea43ec56aaaa" - integrity sha512-EIl3k88vaF4fSxWSgtAQR+VwicfLMTZ9amQtqS4o+TDPW9HGaEpbFBbAZ4A3ZOT5SOnMxNOzROsSTPiE8tBJPA== +webpack-cli@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.3.1.tgz#87a7873bc9c6a4708aa657759274b691e72a04a8" + integrity sha512-/F4+9QNZM/qKzzL9/06Am8NXIkGV+/NqQ62Dx7DSqudxxpAgBqYn6V7+zp+0Y7JuWksKUbczRY3wMTd+7Uj6OA== dependencies: - "@webpack-cli/info" "^1.1.0" - "@webpack-cli/serve" "^1.1.0" + "@discoveryjs/json-ext" "^0.5.0" + "@webpack-cli/info" "^1.2.1" + "@webpack-cli/serve" "^1.2.1" colorette "^1.2.1" - command-line-usage "^6.1.0" commander "^6.2.0" enquirer "^2.3.6" - execa "^4.1.0" + execa "^5.0.0" + fastest-levenshtein "^1.0.12" import-local "^3.0.2" interpret "^2.2.0" - leven "^3.1.0" rechoir "^0.7.0" v8-compile-cache "^2.2.0" webpack-merge "^4.2.2" @@ -9111,33 +9102,32 @@ webpack-sources@^2.1.1: source-list-map "^2.0.1" source-map "^0.6.1" -webpack@^5.9.0: - version "5.9.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.9.0.tgz#af2e9cf9d6c7867cdcf214ea3bb5eb77aece6895" - integrity sha512-YnnqIV/uAS5ZrNpctSv378qV7HmbJ74DL+XfvMxzbX1bV9e7eeT6eEWU4wuUw33CNr/HspBh7R/xQlVjTEyAeA== +webpack@^5.13.0: + version "5.13.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.13.0.tgz#275351b043bd212562f4390e903619d07d5a2fcf" + integrity sha512-NPhMEtfhSVegp1FNPkCM1MPygDm0GHwpreG10dh//0Gr0epfB0br9nlgEfxSghxJqrQ7j9XzgO91CGGLWZiHeA== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.45" - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-module-context" "1.9.0" - "@webassemblyjs/wasm-edit" "1.9.0" - "@webassemblyjs/wasm-parser" "1.9.0" + "@webassemblyjs/ast" "1.11.0" + "@webassemblyjs/wasm-edit" "1.11.0" + "@webassemblyjs/wasm-parser" "1.11.0" acorn "^8.0.4" browserslist "^4.14.5" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.3.1" + enhanced-resolve "^5.6.0" eslint-scope "^5.1.1" events "^3.2.0" glob-to-regexp "^0.4.1" graceful-fs "^4.2.4" json-parse-better-errors "^1.0.2" - loader-runner "^4.1.0" + loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" - pkg-dir "^4.2.0" + pkg-dir "^5.0.0" schema-utils "^3.0.0" tapable "^2.1.1" - terser-webpack-plugin "^5.0.3" + terser-webpack-plugin "^5.1.1" watchpack "^2.0.0" webpack-sources "^2.1.1" @@ -9172,15 +9162,15 @@ whatwg-url@^8.0.0: webidl-conversions "^6.1.0" which-boxed-primitive@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.1.tgz#cbe8f838ebe91ba2471bb69e9edbda67ab5a5ec1" - integrity sha512-7BT4TwISdDGBgaemWU0N0OU7FeAEJ9Oo2P1PHRm/FCWoEi2VLWC9b6xvxAA3C/NMpxg3HXVgi0sMmGbNUbNepQ== + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== dependencies: - is-bigint "^1.0.0" - is-boolean-object "^1.0.0" - is-number-object "^1.0.3" - is-string "^1.0.4" - is-symbol "^1.0.2" + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" which-collection@^1.0.1: version "1.0.1" @@ -9198,12 +9188,13 @@ which-module@^2.0.0: integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= which-typed-array@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.2.tgz#e5f98e56bda93e3dac196b01d47c1156679c00b2" - integrity sha512-KT6okrd1tE6JdZAy3o2VhMoYPh3+J6EMZLyrxBQsZflI1QCZIxMrIYLkosd8Twf+YfknVIHmYQPgJt238p8dnQ== + version "1.1.4" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.4.tgz#8fcb7d3ee5adf2d771066fba7cf37e32fe8711ff" + integrity sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA== dependencies: available-typed-arrays "^1.0.2" - es-abstract "^1.17.5" + call-bind "^1.0.0" + es-abstract "^1.18.0-next.1" foreach "^2.0.5" function-bind "^1.1.1" has-symbols "^1.0.1" @@ -9247,14 +9238,6 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= -wordwrapjs@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/wordwrapjs/-/wordwrapjs-4.0.0.tgz#9aa9394155993476e831ba8e59fb5795ebde6800" - integrity sha512-Svqw723a3R34KvsMgpjFBYCgNOSdcW3mQFK4wIfhGQhtaFVOJmdYoXgi63ne3dTlWgatVcUc7t4HtQ/+bUVIzQ== - dependencies: - reduce-flatten "^2.0.0" - typical "^5.0.0" - wrap-ansi@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" @@ -9339,9 +9322,9 @@ write-pkg@^3.1.0: write-json-file "^2.2.0" ws@^7.2.3: - version "7.4.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.0.tgz#a5dd76a24197940d4a8bb9e0e152bb4503764da7" - integrity sha512-kyFwXuV/5ymf+IXhS6f0+eAFvydbaBW3zjpT6hUdAh/hbVjTIB5EHBGi0bPoCLSK2wcuz3BrEkB9LrYv1Nm4NQ== + version "7.4.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.2.tgz#782100048e54eb36fe9843363ab1c68672b261dd" + integrity sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA== xml-name-validator@^3.0.0: version "3.0.0" @@ -9401,7 +9384,7 @@ yargs-parser@^15.0.1: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^18.1.2, yargs-parser@^18.1.3: +yargs-parser@^18.1.2: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== @@ -9443,10 +9426,10 @@ yargs@^15.0.1, yargs@^15.3.1, yargs@^15.4.1: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^16.1.1: - version "16.1.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.1.1.tgz#5a4a095bd1ca806b0a50d0c03611d38034d219a1" - integrity sha512-hAD1RcFP/wfgfxgMVswPE+z3tlPFtxG8/yWUrG2i17sTWGCGqWnxKcLTF4cUKDUK8fzokwsmO9H0TDkRbMHy8w== +yargs@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== dependencies: cliui "^7.0.2" escalade "^3.1.1"