diff --git a/.all-contributorsrc b/.all-contributorsrc
index e1b19c5024..ad598a8355 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -1321,6 +1321,24 @@
"contributions": [
"bug"
]
+ },
+ {
+ "login": "mmogylenko",
+ "name": "Mykola Mogylenko",
+ "avatar_url": "https://avatars.githubusercontent.com/u/7536624?v=4",
+ "profile": "https://github.com/mmogylenko",
+ "contributions": [
+ "bug"
+ ]
+ },
+ {
+ "login": "z3r0w0n",
+ "name": "Kaushik Borra",
+ "avatar_url": "https://avatars.githubusercontent.com/u/6740347?v=4",
+ "profile": "https://github.com/z3r0w0n",
+ "contributions": [
+ "bug"
+ ]
}
],
"repoType": "github",
diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml
index 45f08fe91e..8db02b4518 100644
--- a/.github/workflows/docker-images.yml
+++ b/.github/workflows/docker-images.yml
@@ -24,7 +24,7 @@ jobs:
DEFAULT_NODE_MAJOR_VERSION: 12
steps:
- name: Check out
- uses: actions/checkout@v2.4.0
+ uses: actions/checkout@v3
# Determine if we should run the validation or not
- name: Should this run?
diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml
index 2d3b74ad0e..baf512c1b1 100644
--- a/.github/workflows/gh-pages.yml
+++ b/.github/workflows/gh-pages.yml
@@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Python
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Check out
- uses: actions/checkout@v2.4.0
+ uses: actions/checkout@v3
- name: Locate Caches
id: cache-locations
run: |-
@@ -58,7 +58,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out
- uses: actions/checkout@v2.4.0
+ uses: actions/checkout@v3
with:
ref: gh-pages
token: ${{ secrets.AUTO_APPROVE_GITHUB_TOKEN }}
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index d5754248f3..401712ee0d 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -25,10 +25,10 @@ jobs:
steps:
# Check out the code
- name: Check out
- uses: actions/checkout@v2.4.0
+ uses: actions/checkout@v3
# Set up all of our standard runtimes
- name: Set up .NET 5
- uses: actions/setup-dotnet@v1
+ uses: actions/setup-dotnet@v2
with:
dotnet-version: '5.0.x'
- name: Set up Go 1.16
@@ -46,7 +46,7 @@ jobs:
cache: yarn
node-version: '12'
- name: Set up Python 3.6
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v3
with:
python-version: '3.6'
- name: Install python3-venv
@@ -119,10 +119,10 @@ jobs:
steps:
# Check out the code
- name: Check out
- uses: actions/checkout@v2.4.0
+ uses: actions/checkout@v3
# Set up all of our standard runtimes
- name: Set up .NET 5
- uses: actions/setup-dotnet@v1
+ uses: actions/setup-dotnet@v2
with:
dotnet-version: '5.0.x'
- name: Set up Go 1.16
@@ -140,7 +140,7 @@ jobs:
cache: yarn
node-version: '12'
- name: Set up Python 3.6
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v3
with:
python-version: '3.6'
- name: Install python3-venv
@@ -289,7 +289,7 @@ jobs:
rm built-tree.tgz
# Set up all of our standard runtimes (this is matrix-based)
- name: Set up .NET ${{ matrix.dotnet }}
- uses: actions/setup-dotnet@v1
+ uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ matrix.dotnet }}
include-prerelease: ${{ matrix.dotnet-prerelease }}
@@ -308,7 +308,7 @@ jobs:
cache: yarn
node-version: ${{ matrix.node }}
- name: Set up Python ${{ matrix.python }}
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: 'Linux: Install python3-venv'
diff --git a/.github/workflows/yarn-upgrade.yml b/.github/workflows/yarn-upgrade.yml
index 728c3c4258..3241c91fb4 100644
--- a/.github/workflows/yarn-upgrade.yml
+++ b/.github/workflows/yarn-upgrade.yml
@@ -15,7 +15,7 @@ jobs:
steps:
- name: Check Out
- uses: actions/checkout@v2.4.0
+ uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v2.5.1
@@ -115,7 +115,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check Out
- uses: actions/checkout@v2.4.0
+ uses: actions/checkout@v3
- name: Download patch
uses: actions/download-artifact@v2
diff --git a/.mergify/config.yml b/.mergify/config.yml
index 87f4fabe87..f31ef19350 100644
--- a/.mergify/config.yml
+++ b/.mergify/config.yml
@@ -30,7 +30,7 @@ pull_request_rules:
label:
add: [contribution/core]
conditions:
- - author~=^(eladb|RomainMuller|garnaat|nija-at|skinny85|rix0rrr|NGL321|Jerry-AWS|SomayaB|MrArnoldPalmer|NetaNir|iliapolo|njlynch|madeline-k|BenChaimberg|comcalvi|kaizen3031593|Chriscbr|corymhall|otaviomacedo)$
+ - author~=^(eladb|RomainMuller|garnaat|nija-at|skinny85|rix0rrr|NGL321|Jerry-AWS|SomayaB|MrArnoldPalmer|NetaNir|iliapolo|njlynch|madeline-k|BenChaimberg|comcalvi|kaizen3031593|Chriscbr|corymhall|otaviomacedo|yuth|TheRealAmazonKendra)$
- -label~="contribution/core"
- name: Tell them we're good now
actions:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1d23a5ebd0..fbbd472560 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,18 @@
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.55.0](https://github.com/aws/jsii/compare/v1.54.0...v1.55.0) (2022-03-10)
+
+
+### Features
+
+* rosetta go support ([#3376](https://github.com/aws/jsii/issues/3376)) ([015e663](https://github.com/aws/jsii/commit/015e66374a5a846741a54efd610cf351516dbe44))
+
+
+### Bug Fixes
+
+* **go:** lots of documentation is missing from generated code ([#3409](https://github.com/aws/jsii/issues/3409)) ([69d28bb](https://github.com/aws/jsii/commit/69d28bb467113c5d5e91493b0846616685c64678))
+
## [1.54.0](https://github.com/aws/jsii/compare/v1.53.0...v1.54.0) (2022-02-15)
diff --git a/README.md b/README.md
index 1c3326de47..53df719a0c 100644
--- a/README.md
+++ b/README.md
@@ -140,88 +140,92 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Junix 🐛 |
Justin Taylor 🐛 |
Kaizen Conroy 💻 🐛 |
+ Kaushik Borra 🐛 |
Kyle Thomson 💻 👀 |
Leandro Padua 🐛 |
- Liang Zhou 🐛 💻 |
+ Liang Zhou 🐛 💻 |
Madeline Kusters 💻 🐛 |
Maja S Bratseth 🐛 |
Marcos Diez 🐛 |
Mark Nielsen 💻 |
Matthew Bonig 🐛 📝 |
Matthew Pirocchi 💻 🤔 👀 |
- Meng Xin Zhu 🐛 |
+ Meng Xin Zhu 🐛 |
Michael Neil 🚧 |
Mike Lane 🐛 |
Mitch Garnaat 🐛 💻 🤔 👀 |
Mitchell Valine 🐛 💻 🤔 🚧 👀 |
Mohamad Soufan 📖 |
- Neta Nir 💻 🤔 🚧 👀 |
- Nick Lynch 🐛 💻 🚧 👀 |
+ Mykola Mogylenko 🐛 |
+ Neta Nir 💻 🤔 🚧 👀 |
+ Nick Lynch 🐛 💻 🚧 👀 |
Niranjan Jayakar 🐛 💻 🤔 🚧 👀 |
Noah Litov 💻 🚧 👀 |
Otavio Macedo 💻 🐛 |
PIDZ - Bart 🤔 |
Peter Woodworth 🚧 |
- Petr Kacer 🐛 |
- Petra Barus 💻 |
+ Petr Kacer 🐛 |
+ Petra Barus 💻 |
Philip Cali 🤔 |
Quentin Loos 🤔 |
Raphael 🐛 |
Richard H Boyd 🐛 |
Rico Huijbers 🐛 💻 🤔 🚧 👀 |
- Romain Marcadier 🐛 💻 🎨 🤔 🚧 👀 📝 |
- SADIK KUZU 👀 |
+ Romain Marcadier 🐛 💻 🎨 🤔 🚧 👀 📝 |
+ SADIK KUZU 👀 |
SK 🤔 |
Sam Fink 💻 👀 |
Sam Goodwin 👀 |
Sebastian Korfmann 🐛 💻 🤔 |
Shane Witbeck 🤔 |
- Shiv Lakshminarayan 💻 🚧 👀 |
- Somaya 💻 🤔 🚧 👀 |
+ Shiv Lakshminarayan 💻 🚧 👀 |
+ Somaya 💻 🤔 🚧 👀 |
The Gitter Badger 💻 🚧 |
Thomas Poignant 🐛 |
Thomas Steinbach 🐛 |
Thorsten Hoeger 💻 |
Tim Wagner 🐛 🤔 |
- Tobias Lidskog 💻 |
- Ty Coghlan 🐛 |
+ Tobias Lidskog 💻 |
+ Ty Coghlan 🐛 |
Tyler van Hensbergen 🤔 |
Vlad Hrybok 🐛 |
Vladimir Shchur 🐛 |
Yan Zhulanow 💻 |
Yigong Liu 🐛 🤔 |
- Zach Bienenfeld 🐛 |
- ajnarang 🤔 |
+ Zach Bienenfeld 🐛 |
+ ajnarang 🤔 |
aniljava 💻 |
arnogeurts-sqills 🐛 💻 |
deccy-mcc 🐛 |
dependabot-preview[bot] 🐛 🚧 |
dependabot[bot] 🚧 |
- dheffx 🐛 |
- gregswdl 🐛 |
+ dheffx 🐛 |
+ gregswdl 🐛 |
guyroberts21 📖 |
mattBrzezinski 📖 |
mergify 🚧 |
mergify[bot] 🚧 |
seiyashima42 🐛 💻 📖 |
+
+
sullis 💻 |
vaneek 🐛 |
diff --git a/gh-pages/requirements-dev.txt b/gh-pages/requirements-dev.txt
index 552a0d7832..94f4a72d40 100644
--- a/gh-pages/requirements-dev.txt
+++ b/gh-pages/requirements-dev.txt
@@ -1,4 +1,4 @@
mkdocs~=1.2.3
-mkdocs-awesome-pages-plugin~=2.6.0
-mkdocs-material~=8.1.10
+mkdocs-awesome-pages-plugin~=2.7.0
+mkdocs-material~=8.2.5
mkdocs-git-revision-date-plugin~=0.3.1
diff --git a/lerna.json b/lerna.json
index 726f8bb508..737fb4a331 100644
--- a/lerna.json
+++ b/lerna.json
@@ -10,5 +10,5 @@
"rejectCycles": true
}
},
- "version": "1.54.0"
+ "version": "1.55.0"
}
diff --git a/package.json b/package.json
index 0f27f7584a..497bed516b 100644
--- a/package.json
+++ b/package.json
@@ -16,11 +16,11 @@
},
"devDependencies": {
"@jest/types": "^27.5.1",
- "@typescript-eslint/eslint-plugin": "^5.11.0",
- "@typescript-eslint/parser": "^5.11.0",
+ "@typescript-eslint/eslint-plugin": "^5.13.0",
+ "@typescript-eslint/parser": "^5.13.0",
"all-contributors-cli": "^6.20.0",
- "eslint": "^8.8.0",
- "eslint-config-prettier": "^8.3.0",
+ "eslint": "^8.10.0",
+ "eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-node": "^0.3.6",
"eslint-import-resolver-typescript": "^2.5.0",
"eslint-plugin-import": "^2.25.4",
@@ -31,7 +31,7 @@
"prettier": "^2.5.1",
"standard-version": "^9.3.2",
"ts-jest": "^27.1.3",
- "ts-node": "^10.5.0",
+ "ts-node": "^10.7.0",
"typescript": "~3.9.10"
},
"repository": {
diff --git a/packages/@jsii/Directory.Build.targets b/packages/@jsii/Directory.Build.targets
index 184b8c3538..44d2832570 100644
--- a/packages/@jsii/Directory.Build.targets
+++ b/packages/@jsii/Directory.Build.targets
@@ -6,11 +6,11 @@
-
+
-
+
diff --git a/packages/@jsii/check-node/package.json b/packages/@jsii/check-node/package.json
index e3cda12705..3da862546e 100644
--- a/packages/@jsii/check-node/package.json
+++ b/packages/@jsii/check-node/package.json
@@ -41,8 +41,8 @@
},
"devDependencies": {
"@types/chalk": "^2.2.0",
- "@types/jest": "^27.4.0",
- "@types/node": "^12.20.43",
+ "@types/jest": "^27.4.1",
+ "@types/node": "^12.20.46",
"jest": "^27.5.1"
}
}
diff --git a/packages/@jsii/dotnet-runtime-test/package.json b/packages/@jsii/dotnet-runtime-test/package.json
index 91b3165ef8..304b573b51 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": "^12.20.43",
+ "@types/node": "^12.20.46",
"jsii-calc": "^3.20.120",
"jsii-pacmak": "^0.0.0",
"typescript": "~3.9.10"
diff --git a/packages/@jsii/dotnet-runtime/package.json b/packages/@jsii/dotnet-runtime/package.json
index 325ce1bce3..49a068a4da 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": "^12.20.43",
+ "@types/node": "^12.20.46",
"@types/semver": "^7.3.9",
"jsii-build-tools": "^0.0.0",
"semver": "^7.3.5",
diff --git a/packages/@jsii/go-runtime/package.json b/packages/@jsii/go-runtime/package.json
index 9b3bae600c..e578f6a573 100644
--- a/packages/@jsii/go-runtime/package.json
+++ b/packages/@jsii/go-runtime/package.json
@@ -24,14 +24,14 @@
},
"devDependencies": {
"@types/fs-extra": "^9.0.13",
- "@types/node": "^12.20.43",
+ "@types/node": "^12.20.46",
"codemaker": "^0.0.0",
- "eslint": "^8.8.0",
+ "eslint": "^8.10.0",
"fs-extra": "^9.1.0",
"jsii-build-tools": "^0.0.0",
"jsii-calc": "^3.20.120",
"prettier": "^2.5.1",
- "ts-node": "^10.5.0",
+ "ts-node": "^10.6.0",
"typescript": "~3.9.10"
}
}
diff --git a/packages/@jsii/integ-test/package.json b/packages/@jsii/integ-test/package.json
index e858bdf70e..d84d4f9f8f 100644
--- a/packages/@jsii/integ-test/package.json
+++ b/packages/@jsii/integ-test/package.json
@@ -29,10 +29,10 @@
"devDependencies": {
"@types/dotenv": "^8.2.0",
"@types/fs-extra": "^9.0.13",
- "@types/jest": "^27.4.0",
- "@types/node": "^12.20.43",
+ "@types/jest": "^27.4.1",
+ "@types/node": "^12.20.46",
"@types/tar": "^6.1.1",
- "eslint": "^8.8.0",
+ "eslint": "^8.10.0",
"prettier": "^2.5.1",
"typescript": "~3.9.10"
}
diff --git a/packages/@jsii/java-runtime/package.json b/packages/@jsii/java-runtime/package.json
index 9739c5b49e..76fe0f3d27 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": "^12.20.43",
+ "@types/node": "^12.20.46",
"jsii-build-tools": "^0.0.0",
"typescript": "~3.9.10"
}
diff --git a/packages/@jsii/kernel/package.json b/packages/@jsii/kernel/package.json
index a6e2dcd19d..0f008f47c3 100644
--- a/packages/@jsii/kernel/package.json
+++ b/packages/@jsii/kernel/package.json
@@ -39,10 +39,10 @@
"@scope/jsii-calc-base": "^0.0.0",
"@scope/jsii-calc-lib": "^0.0.0",
"@types/fs-extra": "^9.0.13",
- "@types/jest": "^27.4.0",
- "@types/node": "^12.20.43",
+ "@types/jest": "^27.4.1",
+ "@types/node": "^12.20.46",
"@types/tar": "^6.1.1",
- "eslint": "^8.8.0",
+ "eslint": "^8.10.0",
"jest": "^27.5.1",
"jest-expect-message": "^1.0.2",
"jsii-build-tools": "^0.0.0",
diff --git a/packages/@jsii/python-runtime/package.json b/packages/@jsii/python-runtime/package.json
index 8f6bbf9b51..d4dd650c9d 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": "^3.20.120",
"jsii-pacmak": "^0.0.0",
- "ts-node": "^10.5.0",
+ "ts-node": "^10.6.0",
"typescript": "~3.9.10"
}
}
diff --git a/packages/@jsii/runtime/package.json b/packages/@jsii/runtime/package.json
index c40cfb550d..375be91580 100644
--- a/packages/@jsii/runtime/package.json
+++ b/packages/@jsii/runtime/package.json
@@ -41,9 +41,9 @@
"devDependencies": {
"@scope/jsii-calc-base": "^0.0.0",
"@scope/jsii-calc-lib": "^0.0.0",
- "@types/jest": "^27.4.0",
- "@types/node": "^12.20.43",
- "eslint": "^8.8.0",
+ "@types/jest": "^27.4.1",
+ "@types/node": "^12.20.46",
+ "eslint": "^8.10.0",
"jest": "^27.5.1",
"jsii-build-tools": "^0.0.0",
"jsii-calc": "^3.20.120",
@@ -51,7 +51,7 @@
"source-map-loader": "^3.0.1",
"ts-jest": "^27.1.3",
"typescript": "~3.9.10",
- "webpack": "^5.68.0",
+ "webpack": "^5.69.1",
"webpack-cli": "^4.9.2"
}
}
diff --git a/packages/@jsii/spec/package.json b/packages/@jsii/spec/package.json
index f119a7c5b7..62022197d9 100644
--- a/packages/@jsii/spec/package.json
+++ b/packages/@jsii/spec/package.json
@@ -34,9 +34,9 @@
"jsonschema": "^1.4.0"
},
"devDependencies": {
- "@types/jest": "^27.4.0",
- "@types/node": "^12.20.43",
- "eslint": "^8.8.0",
+ "@types/jest": "^27.4.1",
+ "@types/node": "^12.20.46",
+ "eslint": "^8.10.0",
"jest": "^27.5.1",
"jsii-build-tools": "^0.0.0",
"prettier": "^2.5.1",
diff --git a/packages/@scope/jsii-calc-base-of-base/package.json b/packages/@scope/jsii-calc-base-of-base/package.json
index edd5ec374e..072f65b366 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": "^12.20.43",
+ "@types/node": "^12.20.46",
"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 3df53b4a32..99da94bd59 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": "^2.1.1"
},
"devDependencies": {
- "@types/node": "^12.20.43",
+ "@types/node": "^12.20.46",
"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 9a8f0b0423..120a7e0e0b 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": "^2.1.1"
},
"devDependencies": {
- "@types/node": "^12.20.43",
+ "@types/node": "^12.20.46",
"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 d793e353c3..4578fae69a 100644
--- a/packages/codemaker/package.json
+++ b/packages/codemaker/package.json
@@ -37,9 +37,9 @@
},
"devDependencies": {
"@types/fs-extra": "^9.0.13",
- "@types/jest": "^27.4.0",
- "@types/node": "^12.20.43",
- "eslint": "^8.8.0",
+ "@types/jest": "^27.4.1",
+ "@types/node": "^12.20.46",
+ "eslint": "^8.10.0",
"jest": "^27.5.1",
"prettier": "^2.5.1",
"typescript": "~3.9.10"
diff --git a/packages/jsii-calc/package.json b/packages/jsii-calc/package.json
index 452e158d81..e697306f7e 100644
--- a/packages/jsii-calc/package.json
+++ b/packages/jsii-calc/package.json
@@ -51,8 +51,8 @@
"@scope/jsii-calc-lib": "^0.0.0"
},
"devDependencies": {
- "@types/node": "^12.20.43",
- "eslint": "^8.8.0",
+ "@types/node": "^12.20.46",
+ "eslint": "^8.10.0",
"jsii": "^0.0.0",
"jsii-build-tools": "^0.0.0",
"jsii-rosetta": "^0.0.0",
diff --git a/packages/jsii-config/package.json b/packages/jsii-config/package.json
index 72732fa183..bbfa3ade2f 100644
--- a/packages/jsii-config/package.json
+++ b/packages/jsii-config/package.json
@@ -20,10 +20,10 @@
},
"devDependencies": {
"@types/inquirer": "^8.2.0",
- "@types/jest": "^27.4.0",
- "@types/node": "^12.20.43",
+ "@types/jest": "^27.4.1",
+ "@types/node": "^12.20.46",
"@types/yargs": "^17.0.8",
- "eslint": "^8.8.0",
+ "eslint": "^8.10.0",
"jest": "^27.5.1",
"jest-expect-message": "^1.0.2",
"prettier": "^2.5.1",
diff --git a/packages/jsii-diff/lib/type-comparison.ts b/packages/jsii-diff/lib/type-comparison.ts
index 2e8ceae719..e006cb889f 100644
--- a/packages/jsii-diff/lib/type-comparison.ts
+++ b/packages/jsii-diff/lib/type-comparison.ts
@@ -187,7 +187,7 @@ export abstract class ComparableType {
}
/**
- * Mark this type as occuring in an input rule.
+ * Mark this type as occurring in an input rule.
*
* All types reachable from this type will be marked as input types as well.
*/
@@ -201,7 +201,7 @@ export abstract class ComparableType {
}
/**
- * Mark this type as occuring in an input rule.
+ * Mark this type as occurring in an input rule.
*
* All types reachable from this type will be marked as input types as well.
*/
diff --git a/packages/jsii-diff/package.json b/packages/jsii-diff/package.json
index cec1f82e6a..dcbf85ab2d 100644
--- a/packages/jsii-diff/package.json
+++ b/packages/jsii-diff/package.json
@@ -43,10 +43,10 @@
},
"devDependencies": {
"@types/fs-extra": "^9.0.13",
- "@types/jest": "^27.4.0",
- "@types/node": "^12.20.43",
+ "@types/jest": "^27.4.1",
+ "@types/node": "^12.20.46",
"@types/tar-fs": "^2.0.1",
- "eslint": "^8.8.0",
+ "eslint": "^8.10.0",
"jest": "^27.5.1",
"jest-expect-message": "^1.0.2",
"jsii": "^0.0.0",
diff --git a/packages/jsii-pacmak/lib/targets/go/documentation.ts b/packages/jsii-pacmak/lib/targets/go/documentation.ts
index 38dbf33c67..497878f2b5 100644
--- a/packages/jsii-pacmak/lib/targets/go/documentation.ts
+++ b/packages/jsii-pacmak/lib/targets/go/documentation.ts
@@ -1,10 +1,13 @@
import { Stability } from '@jsii/spec';
import { CodeMaker } from 'codemaker';
import { Docs } from 'jsii-reflect';
-import { Rosetta } from 'jsii-rosetta';
+import { ApiLocation, Rosetta, TargetLanguage } from 'jsii-rosetta';
export class Documentation {
- public constructor(private readonly code: CodeMaker, _rosetta: Rosetta) {}
+ public constructor(
+ private readonly code: CodeMaker,
+ private readonly rosetta: Rosetta,
+ ) {}
/**
* Emits all documentation depending on what is available in the jsii model
@@ -13,11 +16,11 @@ export class Documentation {
* Order should be
* Summary + Remarks
* Returns
- * Examples TODO rosetta stuff
+ * Examples
* Link
* Stability/Deprecation description
*/
- public emit(docs: Docs): void {
+ public emit(docs: Docs, apiLocation: ApiLocation): void {
let firstLine = true;
if (docs.toString() !== '') {
this.emitComment(docs.toString());
@@ -38,7 +41,18 @@ export class Documentation {
}
firstLine = false;
// TODO: Translate code examples to Go with Rosetta (not implemented there yet)
- this.emitComment('TODO: EXAMPLE');
+ this.code.line('// Example:');
+ const goExample = this.rosetta.translateExample(
+ apiLocation,
+ docs.example,
+ TargetLanguage.GO,
+ false,
+ );
+ const lines = goExample.source.split('\n');
+ for (const line of lines) {
+ // Inline code needs to be intented one level deeper than regular text.
+ this.code.line(`// ${line}`.trim());
+ }
this.emitComment();
}
@@ -62,7 +76,16 @@ export class Documentation {
}
private emitComment(text = '') {
- for (const line of text.split('\n')) {
+ const lines = text.trim().split('\n');
+
+ // Ensure the comment always ends with a final period, conform with GoDoc conventions.
+ const lastLine = lines[lines.length - 1];
+ if (lastLine.trim() !== '' && !/\p{Sentence_Terminal}/u.test(lastLine)) {
+ lines[lines.length - 1] = `${lastLine.trim()}.`;
+ }
+
+ for (const line of lines) {
+ // Final trim() here is to avoid trailing whitespace on empty comment lines.
this.code.line(`// ${line}`.trim());
}
}
diff --git a/packages/jsii-pacmak/lib/targets/go/types/class.ts b/packages/jsii-pacmak/lib/targets/go/types/class.ts
index 95c9371038..e344d4a2d0 100644
--- a/packages/jsii-pacmak/lib/targets/go/types/class.ts
+++ b/packages/jsii-pacmak/lib/targets/go/types/class.ts
@@ -171,7 +171,7 @@ export class GoClass extends GoType {
protected emitInterface(context: EmitContext): void {
const { code, documenter } = context;
- documenter.emit(this.type.docs);
+ documenter.emit(this.type.docs, this.apiLocation);
code.openBlock(`type ${this.name} interface`);
// embed extended interfaces
@@ -313,7 +313,7 @@ export class GoClassConstructor extends GoMethod {
? ''
: this.parameters.map((p) => p.toString()).join(', ');
- documenter.emit(this.type.docs);
+ documenter.emit(this.type.docs, this.apiLocation);
code.openBlock(`func ${constr}(${paramString}) ${this.parent.name}`);
this.constructorRuntimeCall.emit(code);
code.closeBlock();
@@ -328,7 +328,7 @@ export class GoClassConstructor extends GoMethod {
const instanceVar = slugify(this.parent.name[0].toLowerCase(), params);
params.unshift(`${instanceVar} ${this.parent.name}`);
- documenter.emit(this.type.docs);
+ documenter.emit(this.type.docs, this.apiLocation);
code.openBlock(`func ${constr}(${params.join(', ')})`);
this.constructorRuntimeCall.emitOverride(code, instanceVar);
code.closeBlock();
@@ -348,11 +348,10 @@ export class ClassMethod extends GoMethod {
}
/* emit generates method implementation on the class */
- public emit({ code, documenter }: EmitContext) {
+ public emit({ code }: EmitContext) {
const name = this.name;
const returnTypeString = this.reference?.void ? '' : ` ${this.returnType}`;
- documenter.emit(this.method.docs);
code.openBlock(
`func (${this.instanceArg} *${
this.parent.proxyName
@@ -366,9 +365,9 @@ export class ClassMethod extends GoMethod {
}
/* emitDecl generates method declaration in the class interface */
- public emitDecl(context: EmitContext) {
- const { code } = context;
+ public emitDecl({ code, documenter }: EmitContext) {
const returnTypeString = this.reference?.void ? '' : ` ${this.returnType}`;
+ documenter.emit(this.method.docs, this.apiLocation);
code.line(`${this.name}(${this.paramString()})${returnTypeString}`);
}
@@ -400,7 +399,7 @@ export class StaticMethod extends ClassMethod {
const name = `${this.parent.name}_${this.name}`;
const returnTypeString = this.reference?.void ? '' : ` ${this.returnType}`;
- documenter.emit(this.method.docs);
+ documenter.emit(this.method.docs, this.apiLocation);
code.openBlock(`func ${name}(${this.paramString()})${returnTypeString}`);
this.runtimeCall.emit(code);
diff --git a/packages/jsii-pacmak/lib/targets/go/types/enum.ts b/packages/jsii-pacmak/lib/targets/go/types/enum.ts
index d98dd058d1..6028b01501 100644
--- a/packages/jsii-pacmak/lib/targets/go/types/enum.ts
+++ b/packages/jsii-pacmak/lib/targets/go/types/enum.ts
@@ -1,5 +1,6 @@
import { CodeMaker } from 'codemaker';
-import { EnumType, EnumMember } from 'jsii-reflect';
+import { EnumType, EnumMember, Docs } from 'jsii-reflect';
+import { ApiLocation } from 'jsii-rosetta';
import { SpecialDependencies } from '../dependencies';
import { EmitContext } from '../emit-context';
@@ -28,7 +29,7 @@ export class Enum extends GoType {
// Const values are prefixed by the wrapped value type
for (const member of this.members) {
- member.emit(code);
+ member.emit(context);
}
code.close(`)`);
@@ -64,13 +65,23 @@ export class Enum extends GoType {
class GoEnumMember {
public readonly name: string;
public readonly rawValue: string;
+ private readonly docs: Docs;
+ private readonly apiLocation: ApiLocation;
public constructor(private readonly parent: Enum, entry: EnumMember) {
this.name = `${parent.name}_${entry.name}`;
this.rawValue = entry.name;
+ this.docs = entry.docs;
+
+ this.apiLocation = {
+ api: 'member',
+ fqn: this.parent.fqn,
+ memberName: entry.name,
+ };
}
- public emit(code: CodeMaker) {
+ public emit({ code, documenter }: EmitContext) {
+ documenter.emit(this.docs, this.apiLocation);
code.line(`${this.name} ${this.parent.name} = "${this.rawValue}"`);
}
}
diff --git a/packages/jsii-pacmak/lib/targets/go/types/go-type.ts b/packages/jsii-pacmak/lib/targets/go/types/go-type.ts
index fc33aa968d..2ae0813df3 100644
--- a/packages/jsii-pacmak/lib/targets/go/types/go-type.ts
+++ b/packages/jsii-pacmak/lib/targets/go/types/go-type.ts
@@ -1,5 +1,6 @@
import { CodeMaker } from 'codemaker';
import { Type } from 'jsii-reflect';
+import { ApiLocation } from 'jsii-rosetta';
import { SpecialDependencies } from '../dependencies';
import { EmitContext } from '../emit-context';
@@ -12,6 +13,7 @@ export abstract class GoType {
public readonly name: string;
public readonly fqn: string;
public readonly proxyName: string;
+ protected readonly apiLocation: ApiLocation;
public constructor(public readonly pkg: Package, public readonly type: T) {
this.name = type.name;
@@ -30,6 +32,8 @@ export abstract class GoType {
this.proxyName = `jsiiProxy_${this.name}`;
this.fqn = type.fqn;
+
+ this.apiLocation = { api: 'type', fqn: this.fqn };
}
public abstract emit(context: EmitContext): void;
@@ -44,7 +48,7 @@ export abstract class GoType {
}
public emitDocs(context: EmitContext): void {
- context.documenter.emit(this.type.docs);
+ context.documenter.emit(this.type.docs, this.apiLocation);
}
protected emitStability(context: EmitContext): void {
diff --git a/packages/jsii-pacmak/lib/targets/go/types/interface.ts b/packages/jsii-pacmak/lib/targets/go/types/interface.ts
index f2e6db9e52..23bc46ab20 100644
--- a/packages/jsii-pacmak/lib/targets/go/types/interface.ts
+++ b/packages/jsii-pacmak/lib/targets/go/types/interface.ts
@@ -203,11 +203,14 @@ class InterfaceProperty extends GoProperty {
}
public emit({ code, documenter }: EmitContext) {
- documenter.emit(this.property.docs);
+ documenter.emit(this.property.docs, this.apiLocation);
code.line(`${this.name}() ${this.returnType}`);
if (!this.property.immutable) {
- documenter.emit(this.property.docs);
+ // For setters, only emit the stability. Copying the documentation from
+ // the getter might result in confusing documentation. This is an "okay"
+ // middle-ground.
+ documenter.emitStability(this.property.docs);
code.line(
`Set${this.name}(${this.name[0].toLowerCase()} ${this.returnType})`,
);
@@ -226,12 +229,8 @@ class InterfaceMethod extends GoMethod {
this.runtimeCall = new MethodCall(this);
}
- public emitDecl(context: EmitContext) {
- const docs = this.method.docs;
- if (docs) {
- context.documenter.emit(docs);
- }
- const { code } = context;
+ public emitDecl({ code, documenter }: EmitContext) {
+ documenter.emit(this.method.docs, this.apiLocation);
code.line(`${this.name}(${this.paramString()})${this.returnTypeString}`);
}
diff --git a/packages/jsii-pacmak/lib/targets/go/types/struct.ts b/packages/jsii-pacmak/lib/targets/go/types/struct.ts
index 5bf17162d0..f64c6567fb 100644
--- a/packages/jsii-pacmak/lib/targets/go/types/struct.ts
+++ b/packages/jsii-pacmak/lib/targets/go/types/struct.ts
@@ -44,7 +44,7 @@ export class Struct extends GoType {
public emit(context: EmitContext): void {
const { code, documenter } = context;
- documenter.emit(this.type.docs);
+ documenter.emit(this.type.docs, this.apiLocation);
code.openBlock(`type ${this.name} struct`);
for (const property of this.properties) {
property.emitStructMember(context);
diff --git a/packages/jsii-pacmak/lib/targets/go/types/type-member.ts b/packages/jsii-pacmak/lib/targets/go/types/type-member.ts
index bf4930a588..3305967997 100644
--- a/packages/jsii-pacmak/lib/targets/go/types/type-member.ts
+++ b/packages/jsii-pacmak/lib/targets/go/types/type-member.ts
@@ -1,10 +1,12 @@
import {
Callable,
+ MemberKind,
Method,
Parameter,
Property,
TypeReference,
} from 'jsii-reflect';
+import { ApiLocation } from 'jsii-rosetta';
import { jsiiToPascalCase } from '../../../naming-util';
import { SpecialDependencies } from '../dependencies';
@@ -34,6 +36,7 @@ export interface GoTypeMember {
export class GoProperty implements GoTypeMember {
public readonly name: string;
public readonly immutable: boolean;
+ protected readonly apiLocation: ApiLocation;
public constructor(
public parent: GoType,
@@ -41,6 +44,11 @@ export class GoProperty implements GoTypeMember {
) {
this.name = jsiiToPascalCase(this.property.name);
this.immutable = property.immutable;
+ this.apiLocation = {
+ api: 'member',
+ fqn: this.parent.fqn,
+ memberName: this.property.name,
+ };
}
public get reference(): GoTypeRef {
@@ -76,7 +84,7 @@ export class GoProperty implements GoTypeMember {
}
public emitStructMember({ code, documenter }: EmitContext) {
- documenter.emit(this.property.docs);
+ documenter.emit(this.property.docs, this.apiLocation);
const memberType =
this.reference?.type?.name === this.parent.name
? `*${this.returnType}`
@@ -89,16 +97,15 @@ export class GoProperty implements GoTypeMember {
// TODO add newline if not the last member
}
- public emitGetterDecl(context: EmitContext) {
- const { code } = context;
+ public emitGetterDecl({ code, documenter }: EmitContext) {
+ documenter.emit(this.property.docs, this.apiLocation);
code.line(`${this.name}() ${this.returnType}`);
}
- public emitGetter({ code, documenter }: EmitContext): void {
+ public emitGetter({ code }: EmitContext): void {
const receiver = this.parent.name;
const instanceArg = receiver.substring(0, 1).toLowerCase();
- documenter.emit(this.property.docs);
code.openBlock(
`func (${instanceArg} *${receiver}) Get${this.name}() ${this.returnType}`,
);
@@ -106,9 +113,12 @@ export class GoProperty implements GoTypeMember {
code.closeBlock();
}
- public emitSetterDecl(context: EmitContext) {
- const { code } = context;
+ public emitSetterDecl({ code, documenter }: EmitContext) {
if (!this.immutable) {
+ // For setters, only emit the stability. Copying the documentation from
+ // the getter might result in confusing documentation. This is an "okay"
+ // middle-ground.
+ documenter.emitStability(this.property.docs);
code.line(`Set${this.name}(val ${this.returnType})`);
}
}
@@ -150,6 +160,7 @@ export class GoProperty implements GoTypeMember {
export abstract class GoMethod implements GoTypeMember {
public readonly name: string;
public readonly parameters: GoParameter[];
+ protected readonly apiLocation: ApiLocation;
public constructor(
public readonly parent: GoClass | GoInterface,
@@ -159,6 +170,11 @@ export abstract class GoMethod implements GoTypeMember {
this.parameters = this.method.parameters.map(
(param) => new GoParameter(parent, param),
);
+
+ this.apiLocation =
+ method.kind === MemberKind.Initializer
+ ? { api: 'initializer', fqn: parent.fqn }
+ : { api: 'member', fqn: parent.fqn, memberName: method.name };
}
public abstract emit(context: EmitContext): void;
diff --git a/packages/jsii-pacmak/package.json b/packages/jsii-pacmak/package.json
index a6299b86e6..e293496638 100644
--- a/packages/jsii-pacmak/package.json
+++ b/packages/jsii-pacmak/package.json
@@ -59,10 +59,10 @@
"@types/clone": "^2.1.1",
"@types/commonmark": "^0.27.5",
"@types/fs-extra": "^9.0.13",
- "@types/jest": "^27.4.0",
- "@types/node": "^12.20.43",
+ "@types/jest": "^27.4.1",
+ "@types/node": "^12.20.46",
"@types/semver": "^7.3.9",
- "eslint": "^8.8.0",
+ "eslint": "^8.10.0",
"jest": "^27.5.1",
"jsii": "^0.0.0",
"jsii-build-tools": "^0.0.0",
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 198cf3c1b8..d8c02202d6 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
@@ -263,6 +263,7 @@ import (
// A base class.
type Base interface {
+ // Returns: the name of the class (to verify native type names are created for derived classes).
TypeName() interface{}
}
@@ -281,7 +282,6 @@ func NewBase_Override(b Base) {
)
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
func (b *jsiiProxy_Base) TypeName() interface{} {
var returns interface{}
@@ -771,6 +771,7 @@ func StaticConsumer_Consume(_args ...interface{}) {
// Something here.
// Experimental.
type Very interface {
+ // Experimental.
Hey() *float64
}
@@ -805,7 +806,6 @@ func NewVery_Override(v Very) {
)
}
-// Experimental.
func (v *jsiiProxy_Very) Hey() *float64 {
var returns *float64
@@ -1150,6 +1150,7 @@ type jsiiProxy_NestingClass struct {
// This class is here to show we can use nested classes across module boundaries.
// Deprecated.
type NestingClass_NestedClass interface {
+ // Deprecated.
Property() *string
}
@@ -1214,6 +1215,7 @@ type ReflectableEntry struct {
// Deprecated.
type Reflector interface {
+ // Deprecated.
AsMap(reflectable IReflectable) *map[string]interface{}
}
@@ -1248,7 +1250,6 @@ func NewReflector_Override(r Reflector) {
)
}
-// Deprecated.
func (r *jsiiProxy_Reflector) AsMap(reflectable IReflectable) *map[string]interface{} {
var returns *map[string]interface{}
@@ -1404,6 +1405,7 @@ import (
//
// Deprecated.
type BaseFor2647 interface {
+ // Deprecated.
Foo(obj jcb.IBaseInterface)
}
@@ -1438,7 +1440,6 @@ func NewBaseFor2647_Override(b BaseFor2647, very scopejsiicalcbaseofbase.Very) {
)
}
-// Deprecated.
func (b *jsiiProxy_BaseFor2647) Foo(obj jcb.IBaseInterface) {
_jsii_.InvokeVoid(
b,
@@ -1465,12 +1466,14 @@ type DiamondRight struct {
// Check that enums from \\@scoped packages can be references.
//
-// See awslabs/jsii#138
+// See awslabs/jsii#138.
// Deprecated.
type EnumFromScopedModule string
const (
+ // Deprecated.
EnumFromScopedModule_VALUE1 EnumFromScopedModule = "VALUE1"
+ // Deprecated.
EnumFromScopedModule_VALUE2 EnumFromScopedModule = "VALUE2"
)
@@ -1567,9 +1570,17 @@ type MyFirstStruct struct {
type Number interface {
NumericValue
IDoublable
+ // The number multiplied by 2.
+ // Deprecated.
DoubleValue() *float64
+ // The number.
+ // Deprecated.
Value() *float64
+ // String representation of the value.
+ // Deprecated.
ToString() *string
+ // Returns: the name of the class (to verify native type names are created for derived classes).
+ // Deprecated.
TypeName() interface{}
}
@@ -1628,8 +1639,6 @@ func NewNumber_Override(n Number, value *float64) {
)
}
-// String representation of the value.
-// Deprecated.
func (n *jsiiProxy_Number) ToString() *string {
var returns *string
@@ -1643,8 +1652,6 @@ func (n *jsiiProxy_Number) ToString() *string {
return returns
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
-// Deprecated.
func (n *jsiiProxy_Number) TypeName() interface{} {
var returns interface{}
@@ -1662,8 +1669,14 @@ func (n *jsiiProxy_Number) TypeName() interface{} {
// Deprecated.
type NumericValue interface {
jcb.Base
+ // The value.
+ // Deprecated.
Value() *float64
+ // String representation of the value.
+ // Deprecated.
ToString() *string
+ // Returns: the name of the class (to verify native type names are created for derived classes).
+ // Deprecated.
TypeName() interface{}
}
@@ -1694,8 +1707,6 @@ func NewNumericValue_Override(n NumericValue) {
)
}
-// String representation of the value.
-// Deprecated.
func (n *jsiiProxy_NumericValue) ToString() *string {
var returns *string
@@ -1709,8 +1720,6 @@ func (n *jsiiProxy_NumericValue) ToString() *string {
return returns
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
-// Deprecated.
func (n *jsiiProxy_NumericValue) TypeName() interface{} {
var returns interface{}
@@ -1728,8 +1737,14 @@ func (n *jsiiProxy_NumericValue) TypeName() interface{} {
// Deprecated.
type Operation interface {
NumericValue
+ // The value.
+ // Deprecated.
Value() *float64
+ // String representation of the value.
+ // Deprecated.
ToString() *string
+ // Returns: the name of the class (to verify native type names are created for derived classes).
+ // Deprecated.
TypeName() interface{}
}
@@ -1760,8 +1775,6 @@ func NewOperation_Override(o Operation) {
)
}
-// String representation of the value.
-// Deprecated.
func (o *jsiiProxy_Operation) ToString() *string {
var returns *string
@@ -1775,8 +1788,6 @@ func (o *jsiiProxy_Operation) ToString() *string {
return returns
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
-// Deprecated.
func (o *jsiiProxy_Operation) TypeName() interface{} {
var returns interface{}
@@ -2311,7 +2322,9 @@ import (
)
type Cdk16625 interface {
+ // Run this function to verify that everything is working as it should.
Test()
+ // Implement this functin to return \`gen.next()\`. It is extremely important that the \`donotimport\` submodule is NEVER explicitly loaded in the testing application (otherwise this test is void).
Unwrap(gen jsiicalc.IRandomNumberGenerator) *float64
}
@@ -2330,7 +2343,6 @@ func NewCdk16625_Override(c Cdk16625) {
)
}
-// Run this function to verify that everything is working as it should.
func (c *jsiiProxy_Cdk16625) Test() {
_jsii_.InvokeVoid(
c,
@@ -2339,7 +2351,6 @@ func (c *jsiiProxy_Cdk16625) Test() {
)
}
-// Implement this functin to return \`gen.next()\`. It is extremely important that the \`donotimport\` submodule is NEVER explicitly loaded in the testing application (otherwise this test is void).
func (c *jsiiProxy_Cdk16625) Unwrap(gen jsiicalc.IRandomNumberGenerator) *float64 {
var returns *float64
@@ -2401,6 +2412,9 @@ import (
//
type UnimportedSubmoduleType interface {
jsiicalc.IRandomNumberGenerator
+ // Not quite random, but it'll do.
+ //
+ // Returns: 1337.
Next() *float64
}
@@ -2433,9 +2447,6 @@ func NewUnimportedSubmoduleType_Override(u UnimportedSubmoduleType, value *float
)
}
-// Not quite random, but it'll do.
-//
-// Returns: 1337
func (u *jsiiProxy_UnimportedSubmoduleType) Next() *float64 {
var returns *float64
@@ -2501,15 +2512,24 @@ import (
// Abstract operation composed from an expression of other operations.
type CompositeOperation interface {
scopejsiicalclib.Operation
+ // A set of postfixes to include in a decorated .toString().
DecorationPostfixes() *[]*string
SetDecorationPostfixes(val *[]*string)
+ // A set of prefixes to include in a decorated .toString().
DecorationPrefixes() *[]*string
SetDecorationPrefixes(val *[]*string)
+ // The expression that this operation consists of.
+ //
+ // Must be implemented by derived classes.
Expression() scopejsiicalclib.NumericValue
+ // The .toString() style.
StringStyle() CompositeOperation_CompositionStringStyle
SetStringStyle(val CompositeOperation_CompositionStringStyle)
+ // The value.
Value() *float64
+ // String representation of the value.
ToString() *string
+ // Returns: the name of the class (to verify native type names are created for derived classes).
TypeName() interface{}
}
@@ -2603,7 +2623,6 @@ func (j *jsiiProxy_CompositeOperation) SetStringStyle(val CompositeOperation_Com
)
}
-// String representation of the value.
func (c *jsiiProxy_CompositeOperation) ToString() *string {
var returns *string
@@ -2617,7 +2636,6 @@ func (c *jsiiProxy_CompositeOperation) ToString() *string {
return returns
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
func (c *jsiiProxy_CompositeOperation) TypeName() interface{} {
var returns interface{}
@@ -2635,7 +2653,9 @@ func (c *jsiiProxy_CompositeOperation) TypeName() interface{} {
type CompositeOperation_CompositionStringStyle string
const (
+ // Normal string expression.
CompositeOperation_CompositionStringStyle_NORMAL CompositeOperation_CompositionStringStyle = "NORMAL"
+ // Decorated string expression.
CompositeOperation_CompositionStringStyle_DECORATED CompositeOperation_CompositionStringStyle = "DECORATED"
)
@@ -3229,6 +3249,7 @@ type AbstractSuite interface {
Property() *string
SetProperty(val *string)
SomeMethod(str *string) *string
+ // Sets \`seed\` to \`this.property\`, then calls \`someMethod\` with \`this.property\` and returns the result.
WorkItAll(seed *string) *string
}
@@ -3279,7 +3300,6 @@ func (a *jsiiProxy_AbstractSuite) SomeMethod(str *string) *string {
return returns
}
-// Sets \`seed\` to \`this.property\`, then calls \`someMethod\` with \`this.property\` and returns the result.
func (a *jsiiProxy_AbstractSuite) WorkItAll(seed *string) *string {
var returns *string
@@ -3296,11 +3316,17 @@ func (a *jsiiProxy_AbstractSuite) WorkItAll(seed *string) *string {
// The "+" binary operation.
type Add interface {
BinaryOperation
+ // Left-hand side operand.
Lhs() scopejsiicalclib.NumericValue
+ // Right-hand side operand.
Rhs() scopejsiicalclib.NumericValue
+ // The value.
Value() *float64
+ // Say hello!
Hello() *string
+ // String representation of the value.
ToString() *string
+ // Returns: the name of the class (to verify native type names are created for derived classes).
TypeName() interface{}
}
@@ -3366,7 +3392,6 @@ func NewAdd_Override(a Add, lhs scopejsiicalclib.NumericValue, rhs scopejsiicalc
)
}
-// Say hello!
func (a *jsiiProxy_Add) Hello() *string {
var returns *string
@@ -3380,7 +3405,6 @@ func (a *jsiiProxy_Add) Hello() *string {
return returns
}
-// String representation of the value.
func (a *jsiiProxy_Add) ToString() *string {
var returns *string
@@ -3394,7 +3418,6 @@ func (a *jsiiProxy_Add) ToString() *string {
return returns
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
func (a *jsiiProxy_Add) TypeName() interface{} {
var returns interface{}
@@ -3863,8 +3886,10 @@ const (
type AllowedMethodNames interface {
GetBar(_p1 *string, _p2 *float64)
+ // getXxx() is not allowed (see negatives), but getXxx(a, ...) is okay.
GetFoo(withParam *string) *string
SetBar(_x *string, _y *float64, _z *bool)
+ // setFoo(x) is not allowed (see negatives), but setXxx(a, b, ...) is okay.
SetFoo(_x *string, _y *float64)
}
@@ -3905,7 +3930,6 @@ func (a *jsiiProxy_AllowedMethodNames) GetBar(_p1 *string, _p2 *float64) {
)
}
-// getXxx() is not allowed (see negatives), but getXxx(a, ...) is okay.
func (a *jsiiProxy_AllowedMethodNames) GetFoo(withParam *string) *string {
var returns *string
@@ -3927,7 +3951,6 @@ func (a *jsiiProxy_AllowedMethodNames) SetBar(_x *string, _y *float64, _z *bool)
)
}
-// setFoo(x) is not allowed (see negatives), but setXxx(a, b, ...) is okay.
func (a *jsiiProxy_AllowedMethodNames) SetFoo(_x *string, _y *float64) {
_jsii_.InvokeVoid(
a,
@@ -4054,7 +4077,13 @@ func (a *jsiiProxy_AnonymousImplementationProvider) ProvideAsInterface() IAnonym
type AsyncVirtualMethods interface {
CallMe() *float64
+ // Just calls "overrideMeToo".
CallMe2() *float64
+ // This method calls the "callMe" async method indirectly, which will then invoke a virtual method.
+ //
+ // This is a "double promise" situation, which
+ // means that callbacks are not going to be available immediate, but only
+ // after an "immediates" cycle.
CallMeDoublePromise() *float64
DontOverrideMe() *float64
OverrideMe(mult *float64) *float64
@@ -4103,7 +4132,6 @@ func (a *jsiiProxy_AsyncVirtualMethods) CallMe() *float64 {
return returns
}
-// Just calls "overrideMeToo".
func (a *jsiiProxy_AsyncVirtualMethods) CallMe2() *float64 {
var returns *float64
@@ -4117,11 +4145,6 @@ func (a *jsiiProxy_AsyncVirtualMethods) CallMe2() *float64 {
return returns
}
-// This method calls the "callMe" async method indirectly, which will then invoke a virtual method.
-//
-// This is a "double promise" situation, which
-// means that callbacks are not going to be available immediate, but only
-// after an "immediates" cycle.
func (a *jsiiProxy_AsyncVirtualMethods) CallMeDoublePromise() *float64 {
var returns *float64
@@ -4367,11 +4390,19 @@ func (b *jsiiProxy_Bell) Ring() {
type BinaryOperation interface {
scopejsiicalclib.Operation
scopejsiicalclib.IFriendly
+ // Left-hand side operand.
Lhs() scopejsiicalclib.NumericValue
+ // Right-hand side operand.
Rhs() scopejsiicalclib.NumericValue
+ // The value.
+ // Deprecated.
Value() *float64
+ // Say hello!
Hello() *string
+ // String representation of the value.
+ // Deprecated.
ToString() *string
+ // Returns: the name of the class (to verify native type names are created for derived classes).
TypeName() interface{}
}
@@ -4423,7 +4454,6 @@ func NewBinaryOperation_Override(b BinaryOperation, lhs scopejsiicalclib.Numeric
)
}
-// Say hello!
func (b *jsiiProxy_BinaryOperation) Hello() *string {
var returns *string
@@ -4437,8 +4467,6 @@ func (b *jsiiProxy_BinaryOperation) Hello() *string {
return returns
}
-// String representation of the value.
-// Deprecated.
func (b *jsiiProxy_BinaryOperation) ToString() *string {
var returns *string
@@ -4452,7 +4480,6 @@ func (b *jsiiProxy_BinaryOperation) ToString() *string {
return returns
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
func (b *jsiiProxy_BinaryOperation) TypeName() interface{} {
var returns interface{}
@@ -4469,6 +4496,9 @@ func (b *jsiiProxy_BinaryOperation) TypeName() interface{} {
// See https://github.com/aws/aws-cdk/issues/7977.
type BurriedAnonymousObject interface {
Check() *bool
+ // Implement this method and have it return it's parameter.
+ //
+ // Returns: \`value\`.
GiveItBack(value interface{}) interface{}
}
@@ -4500,9 +4530,6 @@ func (b *jsiiProxy_BurriedAnonymousObject) Check() *bool {
return returns
}
-// Implement this method and have it return it's parameter.
-//
-// Returns: \`value\`
func (b *jsiiProxy_BurriedAnonymousObject) GiveItBack(value interface{}) interface{} {
var returns interface{}
@@ -4529,32 +4556,53 @@ func (b *jsiiProxy_BurriedAnonymousObject) GiveItBack(value interface{}) interfa
//
// I will repeat this example again, but in an @example tag.
//
-// TODO: EXAMPLE
+// Example:
+// calculator := calc.NewCalculator()
+// calculator.add(jsii.Number(5))
+// calculator.mul(jsii.Number(3))
+// fmt.Println(calculator.expression.value)
//
type Calculator interface {
composition.CompositeOperation
+ // The current value.
Curr() scopejsiicalclib.NumericValue
SetCurr(val scopejsiicalclib.NumericValue)
+ // A set of postfixes to include in a decorated .toString().
DecorationPostfixes() *[]*string
SetDecorationPostfixes(val *[]*string)
+ // A set of prefixes to include in a decorated .toString().
DecorationPrefixes() *[]*string
SetDecorationPrefixes(val *[]*string)
+ // Returns the expression.
Expression() scopejsiicalclib.NumericValue
+ // The maximum value allows in this calculator.
MaxValue() *float64
SetMaxValue(val *float64)
+ // A log of all operations.
OperationsLog() *[]scopejsiicalclib.NumericValue
+ // A map of per operation name of all operations performed.
OperationsMap() *map[string]*[]scopejsiicalclib.NumericValue
+ // The .toString() style.
StringStyle() composition.CompositeOperation_CompositionStringStyle
SetStringStyle(val composition.CompositeOperation_CompositionStringStyle)
+ // Example of a property that accepts a union of types.
UnionProperty() interface{}
SetUnionProperty(val interface{})
+ // The value.
Value() *float64
+ // Adds a number to the current value.
Add(value *float64)
+ // Multiplies the current value by a number.
Mul(value *float64)
+ // Negates the current value.
Neg()
+ // Raises the current value by a power.
Pow(value *float64)
+ // Returns teh value of the union property (if defined).
ReadUnionValue() *float64
+ // String representation of the value.
ToString() *string
+ // Returns: the name of the class (to verify native type names are created for derived classes).
TypeName() interface{}
}
@@ -4738,7 +4786,6 @@ func (j *jsiiProxy_Calculator) SetUnionProperty(val interface{}) {
)
}
-// Adds a number to the current value.
func (c *jsiiProxy_Calculator) Add(value *float64) {
_jsii_.InvokeVoid(
c,
@@ -4747,7 +4794,6 @@ func (c *jsiiProxy_Calculator) Add(value *float64) {
)
}
-// Multiplies the current value by a number.
func (c *jsiiProxy_Calculator) Mul(value *float64) {
_jsii_.InvokeVoid(
c,
@@ -4756,7 +4802,6 @@ func (c *jsiiProxy_Calculator) Mul(value *float64) {
)
}
-// Negates the current value.
func (c *jsiiProxy_Calculator) Neg() {
_jsii_.InvokeVoid(
c,
@@ -4765,7 +4810,6 @@ func (c *jsiiProxy_Calculator) Neg() {
)
}
-// Raises the current value by a power.
func (c *jsiiProxy_Calculator) Pow(value *float64) {
_jsii_.InvokeVoid(
c,
@@ -4774,7 +4818,6 @@ func (c *jsiiProxy_Calculator) Pow(value *float64) {
)
}
-// Returns teh value of the union property (if defined).
func (c *jsiiProxy_Calculator) ReadUnionValue() *float64 {
var returns *float64
@@ -4788,7 +4831,6 @@ func (c *jsiiProxy_Calculator) ReadUnionValue() *float64 {
return returns
}
-// String representation of the value.
func (c *jsiiProxy_Calculator) ToString() *string {
var returns *string
@@ -4802,7 +4844,6 @@ func (c *jsiiProxy_Calculator) ToString() *string {
return returns
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
func (c *jsiiProxy_Calculator) TypeName() interface{} {
var returns interface{}
@@ -5283,7 +5324,9 @@ func NewClassWithContainerTypes_Override(c ClassWithContainerTypes, array *[]*Du
//
// The docs are great. They're a bunch of tags.
//
-// TODO: EXAMPLE
+// Example:
+// func anExample() {
+// }
//
// See: https://aws.amazon.com/
//
@@ -5773,9 +5816,21 @@ func (c *jsiiProxy_ConsumePureInterface) WorkItBaby() *StructB {
// Check that if a JSII consumer implements IConsumerWithInterfaceParam, they can call
// the method on the argument that they're passed...
type ConsumerCanRingBell interface {
+ // ...if the interface is implemented using an object literal.
+ //
+ // Returns whether the bell was rung.
ImplementedByObjectLiteral(ringer IBellRinger) *bool
+ // ...if the interface is implemented using a private class.
+ //
+ // Return whether the bell was rung.
ImplementedByPrivateClass(ringer IBellRinger) *bool
+ // ...if the interface is implemented using a public class.
+ //
+ // Return whether the bell was rung.
ImplementedByPublicClass(ringer IBellRinger) *bool
+ // If the parameter is a concrete class instead of an interface.
+ //
+ // Return whether the bell was rung.
WhenTypedAsClass(ringer IConcreteBellRinger) *bool
}
@@ -5880,9 +5935,6 @@ func ConsumerCanRingBell_StaticWhenTypedAsClass(ringer IConcreteBellRinger) *boo
return returns
}
-// ...if the interface is implemented using an object literal.
-//
-// Returns whether the bell was rung.
func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByObjectLiteral(ringer IBellRinger) *bool {
var returns *bool
@@ -5896,9 +5948,6 @@ func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByObjectLiteral(ringer IBellR
return returns
}
-// ...if the interface is implemented using a private class.
-//
-// Return whether the bell was rung.
func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByPrivateClass(ringer IBellRinger) *bool {
var returns *bool
@@ -5912,9 +5961,6 @@ func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByPrivateClass(ringer IBellRi
return returns
}
-// ...if the interface is implemented using a public class.
-//
-// Return whether the bell was rung.
func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByPublicClass(ringer IBellRinger) *bool {
var returns *bool
@@ -5928,9 +5974,6 @@ func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByPublicClass(ringer IBellRin
return returns
}
-// If the parameter is a concrete class instead of an interface.
-//
-// Return whether the bell was rung.
func (c *jsiiProxy_ConsumerCanRingBell) WhenTypedAsClass(ringer IConcreteBellRinger) *bool {
var returns *bool
@@ -6263,11 +6306,15 @@ func Demonstrate982_TakeThisToo() *ParentStruct982 {
return returns
}
-// Deprecated: a pretty boring class
+// Deprecated: a pretty boring class.
type DeprecatedClass interface {
+ // Deprecated: shouldn't have been mutable.
MutableProperty() *float64
+ // Deprecated: shouldn't have been mutable.
SetMutableProperty(val *float64)
+ // Deprecated: this is not always "wazoo", be ready to be disappointed.
ReadonlyProperty() *string
+ // Deprecated: it was a bad idea.
Method()
}
@@ -6297,7 +6344,7 @@ func (j *jsiiProxy_DeprecatedClass) ReadonlyProperty() *string {
}
-// Deprecated: this constructor is "just" okay
+// Deprecated: this constructor is "just" okay.
func NewDeprecatedClass(readonlyString *string, mutableNumber *float64) DeprecatedClass {
_init_.Initialize()
@@ -6312,7 +6359,7 @@ func NewDeprecatedClass(readonlyString *string, mutableNumber *float64) Deprecat
return &j
}
-// Deprecated: this constructor is "just" okay
+// Deprecated: this constructor is "just" okay.
func NewDeprecatedClass_Override(d DeprecatedClass, readonlyString *string, mutableNumber *float64) {
_init_.Initialize()
@@ -6331,7 +6378,6 @@ func (j *jsiiProxy_DeprecatedClass) SetMutableProperty(val *float64) {
)
}
-// Deprecated: it was a bad idea
func (d *jsiiProxy_DeprecatedClass) Method() {
_jsii_.InvokeVoid(
d,
@@ -6340,17 +6386,19 @@ func (d *jsiiProxy_DeprecatedClass) Method() {
)
}
-// Deprecated: your deprecated selection of bad options
+// Deprecated: your deprecated selection of bad options.
type DeprecatedEnum string
const (
+ // Deprecated: option A is not great.
DeprecatedEnum_OPTION_A DeprecatedEnum = "OPTION_A"
+ // Deprecated: option B is kinda bad, too.
DeprecatedEnum_OPTION_B DeprecatedEnum = "OPTION_B"
)
-// Deprecated: it just wraps a string
+// Deprecated: it just wraps a string.
type DeprecatedStruct struct {
- // Deprecated: well, yeah
+ // Deprecated: well, yeah.
ReadonlyProperty *string \`json:"readonlyProperty" yaml:"readonlyProperty"\`
}
@@ -6407,7 +6455,7 @@ type DiamondInheritanceTopLevelStruct struct {
// Verifies that null/undefined can be returned for optional collections.
//
-// This source of collections is disappointing - it'll always give you nothing :(
+// This source of collections is disappointing - it'll always give you nothing :(.
type DisappointingCollectionSource interface {
}
@@ -6556,10 +6604,22 @@ func (d *jsiiProxy_DoNotRecognizeAnyAsOptional) Method(_requiredAny interface{},
//
// Multiple paragraphs are separated by an empty line.
//
-// TODO: EXAMPLE
+// Example:
+// x := 12 + 44
+// s1 := "string"
+// s2 := "string \\nwith new newlines" // see https://github.com/aws/jsii/issues/2569
+// s3 := "string\\n with\\n new lines"
//
type DocumentedClass interface {
+ // Greet the indicated person.
+ //
+ // This will print out a friendly greeting intended for the indicated person.
+ //
+ // Returns: A number that everyone knows very well and represents the answer
+ // to the ultimate question.
Greet(greetee *Greetee) *float64
+ // Say ¡Hola!
+ // Experimental.
Hola()
}
@@ -6592,12 +6652,6 @@ func NewDocumentedClass_Override(d DocumentedClass) {
)
}
-// Greet the indicated person.
-//
-// This will print out a friendly greeting intended for the indicated person.
-//
-// Returns: A number that everyone knows very well and represents the answer
-// to the ultimate question
func (d *jsiiProxy_DocumentedClass) Greet(greetee *Greetee) *float64 {
var returns *float64
@@ -6611,8 +6665,6 @@ func (d *jsiiProxy_DocumentedClass) Greet(greetee *Greetee) *float64 {
return returns
}
-// Say ¡Hola!
-// Experimental.
func (d *jsiiProxy_DocumentedClass) Hola() {
_jsii_.InvokeVoid(
d,
@@ -6674,7 +6726,9 @@ func (d *jsiiProxy_DontComplainAboutVariadicAfterOptional) OptionalAndVariadic(o
type DoubleTrouble interface {
IFriendlyRandomGenerator
+ // Say hello!
Hello() *string
+ // Returns another random number.
Next() *float64
}
@@ -6707,7 +6761,6 @@ func NewDoubleTrouble_Override(d DoubleTrouble) {
)
}
-// Say hello!
func (d *jsiiProxy_DoubleTrouble) Hello() *string {
var returns *string
@@ -6721,7 +6774,6 @@ func (d *jsiiProxy_DoubleTrouble) Hello() *string {
return returns
}
-// Returns another random number.
func (d *jsiiProxy_DoubleTrouble) Next() *float64 {
var returns *float64
@@ -6820,6 +6872,9 @@ type DynamicPropertyBearerChild interface {
OriginalValue() *string
ValueStore() *string
SetValueStore(val *string)
+ // Sets \`this.dynamicProperty\` to the new value, and returns the old value.
+ //
+ // Returns: the old value that was set.
OverrideValue(newValue *string) *string
}
@@ -6899,9 +6954,6 @@ func (j *jsiiProxy_DynamicPropertyBearerChild) SetValueStore(val *string) {
)
}
-// Sets \`this.dynamicProperty\` to the new value, and returns the old value.
-//
-// Returns: the old value that was set.
func (d *jsiiProxy_DynamicPropertyBearerChild) OverrideValue(newValue *string) *string {
var returns *string
@@ -6917,7 +6969,13 @@ func (d *jsiiProxy_DynamicPropertyBearerChild) OverrideValue(newValue *string) *
// 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).
type Entropy interface {
+ // Increases entropy by consuming time from the clock (yes, this is a long shot, please don't judge).
+ //
+ // Returns: the time from the \`WallClock\`.
Increase() *string
+ // Implement this method such that it returns \`word\`.
+ //
+ // Returns: \`word\`.
Repeat(word *string) *string
}
@@ -6937,9 +6995,6 @@ func NewEntropy_Override(e Entropy, clock IWallClock) {
)
}
-// Increases entropy by consuming time from the clock (yes, this is a long shot, please don't judge).
-//
-// Returns: the time from the \`WallClock\`.
func (e *jsiiProxy_Entropy) Increase() *string {
var returns *string
@@ -6953,9 +7008,6 @@ func (e *jsiiProxy_Entropy) Increase() *string {
return returns
}
-// Implement this method such that it returns \`word\`.
-//
-// Returns: \`word\`.
func (e *jsiiProxy_Entropy) Repeat(word *string) *string {
var returns *string
@@ -7097,9 +7149,13 @@ type EraseUndefinedHashValuesOptions struct {
// Experimental.
type ExperimentalClass interface {
+ // Experimental.
MutableProperty() *float64
+ // Experimental.
SetMutableProperty(val *float64)
+ // Experimental.
ReadonlyProperty() *string
+ // Experimental.
Method()
}
@@ -7163,7 +7219,6 @@ func (j *jsiiProxy_ExperimentalClass) SetMutableProperty(val *float64) {
)
}
-// Experimental.
func (e *jsiiProxy_ExperimentalClass) Method() {
_jsii_.InvokeVoid(
e,
@@ -7176,7 +7231,9 @@ func (e *jsiiProxy_ExperimentalClass) Method() {
type ExperimentalEnum string
const (
+ // Experimental.
ExperimentalEnum_OPTION_A ExperimentalEnum = "OPTION_A"
+ // Experimental.
ExperimentalEnum_OPTION_B ExperimentalEnum = "OPTION_B"
)
@@ -7358,8 +7415,11 @@ func (f *jsiiProxy_FullCombo) Method() *float64 {
type GiveMeStructs interface {
StructLiteral() *scopejsiicalclib.StructWithOnlyOptionals
+ // Accepts a struct of type DerivedStruct and returns a struct of type FirstStruct.
DerivedToFirst(derived *DerivedStruct) *scopejsiicalclib.MyFirstStruct
+ // Returns the boolean from a DerivedStruct struct.
ReadDerivedNonPrimitive(derived *DerivedStruct) DoubleTrouble
+ // Returns the "anumber" from a MyFirstStruct struct;.
ReadFirstNumber(first *scopejsiicalclib.MyFirstStruct) *float64
}
@@ -7403,7 +7463,6 @@ func NewGiveMeStructs_Override(g GiveMeStructs) {
)
}
-// Accepts a struct of type DerivedStruct and returns a struct of type FirstStruct.
func (g *jsiiProxy_GiveMeStructs) DerivedToFirst(derived *DerivedStruct) *scopejsiicalclib.MyFirstStruct {
var returns *scopejsiicalclib.MyFirstStruct
@@ -7417,7 +7476,6 @@ func (g *jsiiProxy_GiveMeStructs) DerivedToFirst(derived *DerivedStruct) *scopej
return returns
}
-// Returns the boolean from a DerivedStruct struct.
func (g *jsiiProxy_GiveMeStructs) ReadDerivedNonPrimitive(derived *DerivedStruct) DoubleTrouble {
var returns DoubleTrouble
@@ -7431,7 +7489,6 @@ func (g *jsiiProxy_GiveMeStructs) ReadDerivedNonPrimitive(derived *DerivedStruct
return returns
}
-// Returns the "anumber" from a MyFirstStruct struct;
func (g *jsiiProxy_GiveMeStructs) ReadFirstNumber(first *scopejsiicalclib.MyFirstStruct) *float64 {
var returns *float64
@@ -7648,13 +7705,13 @@ func (i *jsiiProxy_IConcreteBellRinger) YourTurn(bell Bell) {
)
}
-// Deprecated: useless interface
+// Deprecated: useless interface.
type IDeprecatedInterface interface {
- // Deprecated: services no purpose
+ // Deprecated: services no purpose.
Method()
- // Deprecated: could be better
+ // Deprecated: could be better.
MutableProperty() *float64
- // Deprecated: could be better
+ // Deprecated: could be better.
SetMutableProperty(m *float64)
}
@@ -10410,14 +10467,23 @@ type Multiply interface {
BinaryOperation
IFriendlier
IRandomNumberGenerator
+ // Left-hand side operand.
Lhs() scopejsiicalclib.NumericValue
+ // Right-hand side operand.
Rhs() scopejsiicalclib.NumericValue
+ // The value.
Value() *float64
+ // Say farewell.
Farewell() *string
+ // Say goodbye.
Goodbye() *string
+ // Say hello!
Hello() *string
+ // Returns another random number.
Next() *float64
+ // String representation of the value.
ToString() *string
+ // Returns: the name of the class (to verify native type names are created for derived classes).
TypeName() interface{}
}
@@ -10485,7 +10551,6 @@ func NewMultiply_Override(m Multiply, lhs scopejsiicalclib.NumericValue, rhs sco
)
}
-// Say farewell.
func (m *jsiiProxy_Multiply) Farewell() *string {
var returns *string
@@ -10499,7 +10564,6 @@ func (m *jsiiProxy_Multiply) Farewell() *string {
return returns
}
-// Say goodbye.
func (m *jsiiProxy_Multiply) Goodbye() *string {
var returns *string
@@ -10513,7 +10577,6 @@ func (m *jsiiProxy_Multiply) Goodbye() *string {
return returns
}
-// Say hello!
func (m *jsiiProxy_Multiply) Hello() *string {
var returns *string
@@ -10527,7 +10590,6 @@ func (m *jsiiProxy_Multiply) Hello() *string {
return returns
}
-// Returns another random number.
func (m *jsiiProxy_Multiply) Next() *float64 {
var returns *float64
@@ -10541,7 +10603,6 @@ func (m *jsiiProxy_Multiply) Next() *float64 {
return returns
}
-// String representation of the value.
func (m *jsiiProxy_Multiply) ToString() *string {
var returns *string
@@ -10555,7 +10616,6 @@ func (m *jsiiProxy_Multiply) ToString() *string {
return returns
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
func (m *jsiiProxy_Multiply) TypeName() interface{} {
var returns interface{}
@@ -10574,11 +10634,17 @@ type Negate interface {
UnaryOperation
IFriendlier
Operand() scopejsiicalclib.NumericValue
+ // The value.
Value() *float64
+ // Say farewell.
Farewell() *string
+ // Say goodbye.
Goodbye() *string
+ // Say hello!
Hello() *string
+ // String representation of the value.
ToString() *string
+ // Returns: the name of the class (to verify native type names are created for derived classes).
TypeName() interface{}
}
@@ -10633,7 +10699,6 @@ func NewNegate_Override(n Negate, operand scopejsiicalclib.NumericValue) {
)
}
-// Say farewell.
func (n *jsiiProxy_Negate) Farewell() *string {
var returns *string
@@ -10647,7 +10712,6 @@ func (n *jsiiProxy_Negate) Farewell() *string {
return returns
}
-// Say goodbye.
func (n *jsiiProxy_Negate) Goodbye() *string {
var returns *string
@@ -10661,7 +10725,6 @@ func (n *jsiiProxy_Negate) Goodbye() *string {
return returns
}
-// Say hello!
func (n *jsiiProxy_Negate) Hello() *string {
var returns *string
@@ -10675,7 +10738,6 @@ func (n *jsiiProxy_Negate) Hello() *string {
return returns
}
-// String representation of the value.
func (n *jsiiProxy_Negate) ToString() *string {
var returns *string
@@ -10689,7 +10751,6 @@ func (n *jsiiProxy_Negate) ToString() *string {
return returns
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
func (n *jsiiProxy_Negate) TypeName() interface{} {
var returns interface{}
@@ -10733,9 +10794,19 @@ type NestedStruct struct {
// Test fixture to verify that jsii modules can use the node standard library.
type NodeStandardLibrary interface {
+ // Returns the current os.platform() from the "os" node module.
OsPlatform() *string
+ // Uses node.js "crypto" module to calculate sha256 of a string.
+ //
+ // Returns: "6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50".
CryptoSha256() *string
+ // Reads a local resource file (resource.txt) asynchronously.
+ //
+ // Returns: "Hello, resource!"
FsReadFile() *string
+ // Sync version of fsReadFile.
+ //
+ // Returns: "Hello, resource! SYNC!"
FsReadFileSync() *string
}
@@ -10779,9 +10850,6 @@ func NewNodeStandardLibrary_Override(n NodeStandardLibrary) {
)
}
-// Uses node.js "crypto" module to calculate sha256 of a string.
-//
-// Returns: "6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50"
func (n *jsiiProxy_NodeStandardLibrary) CryptoSha256() *string {
var returns *string
@@ -10795,9 +10863,6 @@ func (n *jsiiProxy_NodeStandardLibrary) CryptoSha256() *string {
return returns
}
-// Reads a local resource file (resource.txt) asynchronously.
-//
-// Returns: "Hello, resource!"
func (n *jsiiProxy_NodeStandardLibrary) FsReadFile() *string {
var returns *string
@@ -10811,9 +10876,6 @@ func (n *jsiiProxy_NodeStandardLibrary) FsReadFile() *string {
return returns
}
-// Sync version of fsReadFile.
-//
-// Returns: "Hello, resource! SYNC!"
func (n *jsiiProxy_NodeStandardLibrary) FsReadFileSync() *string {
var returns *string
@@ -10997,7 +11059,9 @@ func (n *jsiiProxy_NumberGenerator) NextTimes100() *float64 {
// Verify that object references can be passed inside collections.
type ObjectRefsInCollections interface {
+ // Returns the sum of all values.
SumFromArray(values *[]scopejsiicalclib.NumericValue) *float64
+ // Returns the sum of all values in a map.
SumFromMap(values *map[string]scopejsiicalclib.NumericValue) *float64
}
@@ -11030,7 +11094,6 @@ func NewObjectRefsInCollections_Override(o ObjectRefsInCollections) {
)
}
-// Returns the sum of all values.
func (o *jsiiProxy_ObjectRefsInCollections) SumFromArray(values *[]scopejsiicalclib.NumericValue) *float64 {
var returns *float64
@@ -11044,7 +11107,6 @@ func (o *jsiiProxy_ObjectRefsInCollections) SumFromArray(values *[]scopejsiicalc
return returns
}
-// Returns the sum of all values in a map.
func (o *jsiiProxy_ObjectRefsInCollections) SumFromMap(values *map[string]scopejsiicalclib.NumericValue) *float64 {
var returns *float64
@@ -11083,8 +11145,11 @@ func ObjectWithPropertyProvider_Provide() IObjectWithProperty {
// Old class.
// Deprecated: Use the new class or the old class whatever you want because
-// whatever you like is always the best
+// whatever you like is always the best.
type Old interface {
+ // Doo wop that thing.
+ // Deprecated: Use the new class or the old class whatever you want because
+ // whatever you like is always the best.
DoAThing()
}
@@ -11094,7 +11159,7 @@ type jsiiProxy_Old struct {
}
// Deprecated: Use the new class or the old class whatever you want because
-// whatever you like is always the best
+// whatever you like is always the best.
func NewOld() Old {
_init_.Initialize()
@@ -11110,7 +11175,7 @@ func NewOld() Old {
}
// Deprecated: Use the new class or the old class whatever you want because
-// whatever you like is always the best
+// whatever you like is always the best.
func NewOld_Override(o Old) {
_init_.Initialize()
@@ -11121,9 +11186,6 @@ func NewOld_Override(o Old) {
)
}
-// Doo wop that thing.
-// Deprecated: Use the new class or the old class whatever you want because
-// whatever you like is always the best
func (o *jsiiProxy_Old) DoAThing() {
_jsii_.InvokeVoid(
o,
@@ -11542,17 +11604,28 @@ func (p *jsiiProxy_Polymorphism) SayHello(friendly scopejsiicalclib.IFriendly) *
// The power operation.
type Power interface {
composition.CompositeOperation
+ // The base of the power.
Base() scopejsiicalclib.NumericValue
+ // A set of postfixes to include in a decorated .toString().
DecorationPostfixes() *[]*string
SetDecorationPostfixes(val *[]*string)
+ // A set of prefixes to include in a decorated .toString().
DecorationPrefixes() *[]*string
SetDecorationPrefixes(val *[]*string)
+ // The expression that this operation consists of.
+ //
+ // Must be implemented by derived classes.
Expression() scopejsiicalclib.NumericValue
+ // The number of times to multiply.
Pow() scopejsiicalclib.NumericValue
+ // The .toString() style.
StringStyle() composition.CompositeOperation_CompositionStringStyle
SetStringStyle(val composition.CompositeOperation_CompositionStringStyle)
+ // The value.
Value() *float64
+ // String representation of the value.
ToString() *string
+ // Returns: the name of the class (to verify native type names are created for derived classes).
TypeName() interface{}
}
@@ -11682,7 +11755,6 @@ func (j *jsiiProxy_Power) SetStringStyle(val composition.CompositeOperation_Comp
)
}
-// String representation of the value.
func (p *jsiiProxy_Power) ToString() *string {
var returns *string
@@ -11696,7 +11768,6 @@ func (p *jsiiProxy_Power) ToString() *string {
return returns
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
func (p *jsiiProxy_Power) TypeName() interface{} {
var returns interface{}
@@ -12284,6 +12355,7 @@ func RootStructValidator_Validate(struct_ *RootStruct) {
type RuntimeTypeChecking interface {
MethodWithDefaultedArguments(arg1 *float64, arg2 *string, arg3 *time.Time)
MethodWithOptionalAnyArgument(arg interface{})
+ // Used to verify verification of number of method arguments.
MethodWithOptionalArguments(arg1 *float64, arg2 *string, arg3 *time.Time)
}
@@ -12332,7 +12404,6 @@ func (r *jsiiProxy_RuntimeTypeChecking) MethodWithOptionalAnyArgument(arg interf
)
}
-// Used to verify verification of number of method arguments.
func (r *jsiiProxy_RuntimeTypeChecking) MethodWithOptionalArguments(arg1 *float64, arg2 *string, arg3 *time.Time) {
_jsii_.InvokeVoid(
r,
@@ -12442,6 +12513,7 @@ func (s *jsiiProxy_SingletonInt) IsSingletonInt(value *float64) *bool {
type SingletonIntEnum string
const (
+ // Elite!
SingletonIntEnum_SINGLETON_INT SingletonIntEnum = "SINGLETON_INT"
)
@@ -12474,6 +12546,7 @@ func (s *jsiiProxy_SingletonString) IsSingletonString(value *string) *bool {
type SingletonStringEnum string
const (
+ // 1337.
SingletonStringEnum_SINGLETON_STRING SingletonStringEnum = "SINGLETON_STRING"
)
@@ -13126,17 +13199,27 @@ type StructWithJavaReservedWords struct {
// An operation that sums multiple values.
type Sum interface {
composition.CompositeOperation
+ // A set of postfixes to include in a decorated .toString().
DecorationPostfixes() *[]*string
SetDecorationPostfixes(val *[]*string)
+ // A set of prefixes to include in a decorated .toString().
DecorationPrefixes() *[]*string
SetDecorationPrefixes(val *[]*string)
+ // The expression that this operation consists of.
+ //
+ // Must be implemented by derived classes.
Expression() scopejsiicalclib.NumericValue
+ // The parts to sum.
Parts() *[]scopejsiicalclib.NumericValue
SetParts(val *[]scopejsiicalclib.NumericValue)
+ // The .toString() style.
StringStyle() composition.CompositeOperation_CompositionStringStyle
SetStringStyle(val composition.CompositeOperation_CompositionStringStyle)
+ // The value.
Value() *float64
+ // String representation of the value.
ToString() *string
+ // Returns: the name of the class (to verify native type names are created for derived classes).
TypeName() interface{}
}
@@ -13262,7 +13345,6 @@ func (j *jsiiProxy_Sum) SetStringStyle(val composition.CompositeOperation_Compos
)
}
-// String representation of the value.
func (s *jsiiProxy_Sum) ToString() *string {
var returns *string
@@ -13276,7 +13358,6 @@ func (s *jsiiProxy_Sum) ToString() *string {
return returns
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
func (s *jsiiProxy_Sum) TypeName() interface{} {
var returns interface{}
@@ -13293,6 +13374,7 @@ func (s *jsiiProxy_Sum) TypeName() interface{} {
type SupportsNiceJavaBuilder interface {
SupportsNiceJavaBuilderWithRequiredProps
Bar() *float64
+ // some identifier.
Id() *float64
PropId() *string
Rest() *[]*string
@@ -13390,6 +13472,7 @@ type SupportsNiceJavaBuilderProps struct {
// We can generate fancy builders in Java for classes which take a mix of positional & struct parameters.
type SupportsNiceJavaBuilderWithRequiredProps interface {
Bar() *float64
+ // some identifier of your choice.
Id() *float64
PropId() *string
}
@@ -13724,9 +13807,13 @@ func (s *jsiiProxy_SyncVirtualMethods) WriteA(value *float64) {
}
type TestStructWithEnum interface {
+ // Returns \`foo: StringEnum.A\`.
StructWithFoo() *StructWithEnum
+ // Returns \`foo: StringEnum.C\` and \`bar: AllTypesEnum.MY_ENUM_VALUE\`.
StructWithFooBar() *StructWithEnum
+ // Returns true if \`foo\` is \`StringEnum.A\`.
IsStringEnumA(input *StructWithEnum) *bool
+ // Returns true if \`foo\` is \`StringEnum.B\` and \`bar\` is \`AllTypesEnum.THIS_IS_GREAT\`.
IsStringEnumB(input *StructWithEnum) *bool
}
@@ -13780,7 +13867,6 @@ func NewTestStructWithEnum_Override(t TestStructWithEnum) {
)
}
-// Returns true if \`foo\` is \`StringEnum.A\`.
func (t *jsiiProxy_TestStructWithEnum) IsStringEnumA(input *StructWithEnum) *bool {
var returns *bool
@@ -13794,7 +13880,6 @@ func (t *jsiiProxy_TestStructWithEnum) IsStringEnumA(input *StructWithEnum) *boo
return returns
}
-// Returns true if \`foo\` is \`StringEnum.B\` and \`bar\` is \`AllTypesEnum.THIS_IS_GREAT\`.
func (t *jsiiProxy_TestStructWithEnum) IsStringEnumB(input *StructWithEnum) *bool {
var returns *bool
@@ -13863,9 +13948,12 @@ type TopLevelStruct struct {
//
type TwoMethodsWithSimilarCapitalization interface {
FooBar() *float64
+ // Deprecated: YES.
FooBAR() *float64
ToIsoString() *string
+ // Deprecated: python requires that all alternatives are deprecated.
ToIsOString() *string
+ // Deprecated: python requires that all alternatives are deprecated.
ToISOString() *string
}
@@ -13932,7 +14020,6 @@ func (t *jsiiProxy_TwoMethodsWithSimilarCapitalization) ToIsoString() *string {
return returns
}
-// Deprecated: python requires that all alternatives are deprecated
func (t *jsiiProxy_TwoMethodsWithSimilarCapitalization) ToIsOString() *string {
var returns *string
@@ -13946,7 +14033,6 @@ func (t *jsiiProxy_TwoMethodsWithSimilarCapitalization) ToIsOString() *string {
return returns
}
-// Deprecated: python requires that all alternatives are deprecated
func (t *jsiiProxy_TwoMethodsWithSimilarCapitalization) ToISOString() *string {
var returns *string
@@ -13991,8 +14077,13 @@ func UmaskCheck_Mode() *float64 {
type UnaryOperation interface {
scopejsiicalclib.Operation
Operand() scopejsiicalclib.NumericValue
+ // The value.
+ // Deprecated.
Value() *float64
+ // String representation of the value.
+ // Deprecated.
ToString() *string
+ // Returns: the name of the class (to verify native type names are created for derived classes).
TypeName() interface{}
}
@@ -14032,8 +14123,6 @@ func NewUnaryOperation_Override(u UnaryOperation, operand scopejsiicalclib.Numer
)
}
-// String representation of the value.
-// Deprecated.
func (u *jsiiProxy_UnaryOperation) ToString() *string {
var returns *string
@@ -14047,7 +14136,6 @@ func (u *jsiiProxy_UnaryOperation) ToString() *string {
return returns
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
func (u *jsiiProxy_UnaryOperation) TypeName() interface{} {
var returns interface{}
@@ -17040,7 +17128,9 @@ import (
type ExtendAndImplement interface {
scopejsiicalclib.BaseFor2647
scopejsiicalclib.IFriendly
+ // Deprecated.
Foo(obj jcb.IBaseInterface)
+ // Say hello!
Hello() *string
LocalMethod() *string
}
@@ -17077,7 +17167,6 @@ func NewExtendAndImplement_Override(e ExtendAndImplement, very scopejsiicalcbase
)
}
-// Deprecated.
func (e *jsiiProxy_ExtendAndImplement) Foo(obj jcb.IBaseInterface) {
_jsii_.InvokeVoid(
e,
@@ -17086,7 +17175,6 @@ func (e *jsiiProxy_ExtendAndImplement) Foo(obj jcb.IBaseInterface) {
)
}
-// Say hello!
func (e *jsiiProxy_ExtendAndImplement) Hello() *string {
var returns *string
@@ -17869,6 +17957,7 @@ func (b *jsiiProxy_Baz) IBaseInterface() {
type Class1 interface {
jcb.Base
Base()
+ // Returns: the name of the class (to verify native type names are created for derived classes).
TypeName() interface{}
}
@@ -17909,7 +17998,6 @@ func (c *jsiiProxy_Class1) Base() {
)
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
func (c *jsiiProxy_Class1) TypeName() interface{} {
var returns interface{}
@@ -17926,6 +18014,7 @@ func (c *jsiiProxy_Class1) TypeName() interface{} {
type Class2 interface {
jcb.Base
Base() *string
+ // Returns: the name of the class (to verify native type names are created for derived classes).
TypeName() interface{}
}
@@ -17969,7 +18058,6 @@ func NewClass2_Override(c Class2) {
)
}
-// Returns: the name of the class (to verify native type names are created for derived classes).
func (c *jsiiProxy_Class2) TypeName() interface{} {
var returns interface{}
@@ -18913,14 +19001,18 @@ import (
type Awesomeness string
const (
+ // It was awesome!
Awesomeness_AWESOME Awesomeness = "AWESOME"
)
type Goodness string
const (
+ // It's pretty good.
Goodness_PRETTY_GOOD Goodness = "PRETTY_GOOD"
+ // It's really good.
Goodness_REALLY_GOOD Goodness = "REALLY_GOOD"
+ // It's amazingly good.
Goodness_AMAZINGLY_GOOD Goodness = "AMAZINGLY_GOOD"
)
diff --git a/packages/jsii-reflect/package.json b/packages/jsii-reflect/package.json
index 9bd722c264..abdbcb6f7e 100644
--- a/packages/jsii-reflect/package.json
+++ b/packages/jsii-reflect/package.json
@@ -44,9 +44,9 @@
"devDependencies": {
"@scope/jsii-calc-lib": "^0.0.0",
"@types/fs-extra": "^9.0.13",
- "@types/jest": "^27.4.0",
- "@types/node": "^12.20.43",
- "eslint": "^8.8.0",
+ "@types/jest": "^27.4.1",
+ "@types/node": "^12.20.46",
+ "eslint": "^8.10.0",
"jest": "^27.5.1",
"jsii": "^0.0.0",
"jsii-build-tools": "^0.0.0",
diff --git a/packages/jsii-rosetta/lib/jsii/jsii-types.ts b/packages/jsii-rosetta/lib/jsii/jsii-types.ts
index 36302bdb7d..320c843dfa 100644
--- a/packages/jsii-rosetta/lib/jsii/jsii-types.ts
+++ b/packages/jsii-rosetta/lib/jsii/jsii-types.ts
@@ -7,8 +7,7 @@ import { hasAnyFlag, analyzeStructType, JsiiSymbol } from './jsii-utils';
export type JsiiType =
| { kind: 'unknown' }
| { kind: 'error'; message: string }
- | { kind: 'map'; elementType: JsiiType }
- | { kind: 'list'; elementType: JsiiType }
+ | { kind: 'map' | 'list'; elementType: JsiiType; elementTypeSymbol: ts.Symbol | undefined }
| { kind: 'namedType'; name: string }
| { kind: 'builtIn'; builtIn: BuiltInType };
@@ -28,6 +27,7 @@ export function determineJsiiType(typeChecker: ts.TypeChecker, type: ts.Type): J
elementType: mapValuesType.elementType
? determineJsiiType(typeChecker, mapValuesType.elementType)
: { kind: 'builtIn', builtIn: 'any' },
+ elementTypeSymbol: mapValuesType.elementType?.symbol,
};
}
@@ -38,12 +38,14 @@ export function determineJsiiType(typeChecker: ts.TypeChecker, type: ts.Type): J
return {
kind: 'list',
elementType: determineJsiiType(typeChecker, typeRef.typeArguments[0]),
+ elementTypeSymbol: typeRef.typeArguments[0].symbol,
};
}
return {
kind: 'list',
elementType: { kind: 'builtIn', builtIn: 'any' },
+ elementTypeSymbol: undefined,
};
}
@@ -66,6 +68,11 @@ export function determineJsiiType(typeChecker: ts.TypeChecker, type: ts.Type): J
message: `Type unions or intersections are not supported in examples, got: ${typeChecker.typeToString(type)}`,
};
}
+
+ if ((type.flags & (ts.TypeFlags.Void | ts.TypeFlags.VoidLike)) !== 0) {
+ return { kind: 'builtIn', builtIn: 'void' };
+ }
+
return { kind: 'unknown' };
}
diff --git a/packages/jsii-rosetta/lib/languages/csharp.ts b/packages/jsii-rosetta/lib/languages/csharp.ts
index b31daf9d39..505843d97a 100644
--- a/packages/jsii-rosetta/lib/languages/csharp.ts
+++ b/packages/jsii-rosetta/lib/languages/csharp.ts
@@ -669,6 +669,8 @@ export class CSharpVisitor extends DefaultVisitor {
return 'string';
case 'any':
return 'object';
+ case 'void':
+ return 'void';
}
}
}
diff --git a/packages/jsii-rosetta/lib/languages/default.ts b/packages/jsii-rosetta/lib/languages/default.ts
index bc82fde164..bef56096fe 100644
--- a/packages/jsii-rosetta/lib/languages/default.ts
+++ b/packages/jsii-rosetta/lib/languages/default.ts
@@ -45,6 +45,10 @@ export abstract class DefaultVisitor implements AstHandler {
return new OTree([JSON.stringify(node.text)]);
}
+ public numericLiteral(node: ts.NumericLiteral, _children: AstRenderer): OTree {
+ return new OTree([node.text]);
+ }
+
public identifier(node: ts.Identifier, _children: AstRenderer): OTree {
return new OTree([node.text]);
}
diff --git a/packages/jsii-rosetta/lib/languages/go.ts b/packages/jsii-rosetta/lib/languages/go.ts
new file mode 100644
index 0000000000..bb0b80743b
--- /dev/null
+++ b/packages/jsii-rosetta/lib/languages/go.ts
@@ -0,0 +1,1052 @@
+// import { JsiiSymbol, simpleName, namespaceName } from '../jsii/jsii-utils';
+// import { jsiiTargetParameter } from '../jsii/packages';
+import { AssertionError } from 'assert';
+import * as ts from 'typescript';
+
+import { analyzeObjectLiteral, determineJsiiType, JsiiType, ObjectLiteralStruct } from '../jsii/jsii-types';
+import { OTree } from '../o-tree';
+import { AstRenderer } from '../renderer';
+import { isExported, isPublic, isPrivate, isReadOnly, isStatic } from '../typescript/ast-utils';
+import { ImportStatement } from '../typescript/imports';
+import {
+ determineReturnType,
+ inferMapElementType,
+ inferredTypeOfExpression,
+ typeOfExpression,
+} from '../typescript/types';
+import { DefaultVisitor } from './default';
+import { TargetLanguage } from './target-language';
+
+interface GoLanguageContext {
+ /**
+ * Free floating symbols are made importable across packages by naming with a capital in Go.
+ */
+ isExported: boolean;
+
+ /**
+ * Whether type should be converted a pointer type
+ */
+ isPtr: boolean;
+
+ /**
+ * Whether this is the R-Value in an assignment expression to a pointer value.
+ */
+ isPtrAssignmentRValue: boolean;
+
+ /**
+ * Whether the current element is a parameter delcaration name.
+ */
+ isParameterName: boolean;
+
+ /**
+ * Whether context is within a struct declaration
+ */
+ isStruct: boolean;
+
+ /**
+ * Whether the context is within an interface delcaration.
+ */
+ isInterface: boolean;
+
+ /**
+ * Whether properties are being intialized within a `map` type
+ */
+ inMapLiteral: boolean;
+
+ /**
+ * Wheter to wrap a literal in a pointer constructor ie: jsii.String.
+ */
+ wrapPtr: boolean;
+}
+
+enum DeclarationType {
+ STRUCT,
+ INTERFACE,
+ FUNCTION,
+ BUILTIN,
+ UNKNOWN,
+}
+
+type GoRenderer = AstRenderer;
+
+interface FormattedId {
+ readonly type: DeclarationType;
+ readonly formatted: string;
+}
+export class GoVisitor extends DefaultVisitor {
+ /**
+ * Translation version
+ *
+ * Bump this when you change something in the implementation to invalidate
+ * existing cached translations.
+ */
+ public static readonly VERSION = '1';
+
+ public readonly indentChar = '\t';
+
+ public readonly language = TargetLanguage.GO;
+
+ private readonly idMap = new Map();
+
+ public readonly defaultContext: GoLanguageContext = {
+ isExported: false,
+ isPtr: false,
+ isPtrAssignmentRValue: false,
+ isStruct: false,
+ isInterface: false,
+ isParameterName: false,
+ inMapLiteral: false,
+ wrapPtr: false,
+ };
+
+ protected argumentList(args: readonly ts.Node[] | undefined, renderer: GoRenderer): OTree {
+ return new OTree([], args ? renderer.convertAll(args) : [], {
+ separator: ', ',
+ });
+ }
+
+ public block(node: ts.Block, renderer: GoRenderer): OTree {
+ return new OTree(['{'], renderer.convertAll(node.statements), {
+ indent: 1,
+ suffix: renderer.mirrorNewlineBefore(node.statements[0], '}'),
+ });
+ }
+
+ public expressionStatement(node: ts.ExpressionStatement, renderer: GoRenderer): OTree {
+ const inner = renderer.convert(node.expression);
+ if (inner.isEmpty) {
+ return inner;
+ }
+ return new OTree([inner], [], { canBreakLine: true });
+ }
+
+ public functionDeclaration(node: ts.FunctionDeclaration, renderer: GoRenderer): OTree {
+ const funcName = renderer.updateContext({ isExported: isExported(node) }).convert(node.name);
+ const returnType = determineReturnType(renderer.typeChecker, node);
+ const goType = this.renderType(node.type ?? node, returnType?.symbol, returnType, true, '', renderer);
+
+ const body = node.body?.statements ? renderer.convertAll(node.body.statements) : [];
+ return new OTree(
+ [
+ 'func ',
+ funcName,
+ '(',
+ new OTree([], renderer.updateContext({ isPtr: true }).convertAll(node.parameters), {
+ separator: ', ',
+ }),
+ ')',
+ goType ? ' ' : '',
+ goType,
+ ],
+ [
+ new OTree(
+ [' {'],
+ [this.defaultArgValues(node.parameters, renderer.updateContext({ wrapPtr: true })), ...body],
+ {
+ indent: 1,
+ suffix: '\n}',
+ },
+ ),
+ ],
+ {
+ canBreakLine: true,
+ },
+ );
+ }
+
+ public identifier(node: ts.Identifier | ts.StringLiteral | ts.NoSubstitutionTemplateLiteral, renderer: GoRenderer) {
+ const symbol = renderer.typeChecker.getSymbolAtLocation(node);
+ return new OTree([this.goName(node.text, renderer, symbol)]);
+ }
+
+ public newExpression(node: ts.NewExpression, renderer: GoRenderer): OTree {
+ const { classNamespace, className } = determineClassName.call(this, node.expression);
+ return new OTree(
+ [
+ ...(classNamespace ? [classNamespace, '.'] : []),
+ 'New', // Should this be "new" if the class is unexported?
+ className,
+ '(',
+ ],
+ renderer.updateContext({ wrapPtr: true }).convertAll(node.arguments ?? []),
+ { canBreakLine: true, separator: ', ', suffix: ')' },
+ );
+
+ function determineClassName(this: GoVisitor, expr: ts.Expression): { classNamespace?: OTree; className: string } {
+ if (ts.isIdentifier(expr)) {
+ return { className: ucFirst(expr.text) };
+ }
+ if (ts.isPropertyAccessExpression(expr)) {
+ if (ts.isIdentifier(expr.expression)) {
+ return {
+ className: ucFirst(expr.name.text),
+ classNamespace: renderer.updateContext({ isExported: false }).convert(expr.expression),
+ };
+ }
+ renderer.reportUnsupported(expr.expression, TargetLanguage.GO);
+ return {
+ className: ucFirst(expr.name.text),
+ classNamespace: new OTree(['#error#']),
+ };
+ }
+ renderer.reportUnsupported(expr, TargetLanguage.GO);
+ return { className: expr.getText(expr.getSourceFile()) };
+ }
+ }
+
+ public arrayLiteralExpression(node: ts.ArrayLiteralExpression, renderer: AstRenderer): OTree {
+ const arrayType =
+ inferredTypeOfExpression(renderer.typeChecker, node) ?? renderer.typeChecker.getTypeAtLocation(node);
+ const [elementType] = renderer.typeChecker.getTypeArguments(arrayType as ts.TypeReference);
+ const typeName = elementType
+ ? this.renderType(node, elementType.symbol, elementType, true, 'interface{}', renderer)
+ : 'interface{}';
+
+ return new OTree(['[]', typeName, '{'], renderer.convertAll(node.elements), {
+ separator: ',',
+ trailingSeparator: true,
+ suffix: '}',
+ indent: 1,
+ });
+ }
+
+ public objectLiteralExpression(node: ts.ObjectLiteralExpression, renderer: GoRenderer): OTree {
+ const lit = analyzeObjectLiteral(renderer.typeChecker, node);
+
+ switch (lit.kind) {
+ case 'unknown':
+ return this.unknownTypeObjectLiteralExpression(node, renderer);
+ case 'struct':
+ case 'local-struct':
+ return this.knownStructObjectLiteralExpression(node, lit, renderer);
+ case 'map':
+ return this.keyValueObjectLiteralExpression(node, renderer);
+ }
+ }
+
+ public propertyAssignment(node: ts.PropertyAssignment, renderer: GoRenderer): OTree {
+ const key =
+ ts.isStringLiteralLike(node.name) || ts.isIdentifier(node.name)
+ ? renderer.currentContext.inMapLiteral
+ ? JSON.stringify(node.name.text)
+ : this.goName(node.name.text, renderer, renderer.typeChecker.getSymbolAtLocation(node.name))
+ : renderer.convert(node.name);
+ // Struct member values are always pointers...
+ return new OTree(
+ [
+ key,
+ ': ',
+ renderer
+ .updateContext({
+ wrapPtr: renderer.currentContext.isStruct || renderer.currentContext.inMapLiteral,
+ isPtr: renderer.currentContext.isStruct,
+ })
+ .convert(node.initializer),
+ ],
+ [],
+ {
+ canBreakLine: true,
+ },
+ );
+ }
+
+ public shorthandPropertyAssignment(
+ node: ts.ShorthandPropertyAssignment,
+ renderer: AstRenderer,
+ ): OTree {
+ const key =
+ ts.isStringLiteralLike(node.name) || ts.isIdentifier(node.name)
+ ? renderer.currentContext.inMapLiteral
+ ? JSON.stringify(node.name.text)
+ : this.goName(node.name.text, renderer, renderer.typeChecker.getSymbolAtLocation(node.name))
+ : renderer.convert(node.name);
+
+ const rawValue = renderer.updateContext({ wrapPtr: true, isStruct: false }).convert(node.name);
+ const value = isPointerValue(renderer.typeChecker, node.name)
+ ? rawValue
+ : wrapPtrExpression(renderer.typeChecker, node.name, rawValue);
+
+ return new OTree([key, ': ', value], [], { canBreakLine: true });
+ }
+
+ public templateExpression(node: ts.TemplateExpression, renderer: AstRenderer): OTree {
+ let template = '';
+ const parameters = new Array();
+
+ if (node.head.rawText) {
+ template += node.head.rawText;
+ }
+
+ for (const span of node.templateSpans) {
+ template += '%v';
+ parameters.push(renderer.convert(span.expression));
+ if (span.literal.rawText) {
+ template += span.literal.rawText;
+ }
+ }
+
+ if (parameters.length === 0) {
+ return new OTree([JSON.stringify(template)]);
+ }
+
+ return new OTree(
+ ['fmt.Sprintf('],
+ [
+ JSON.stringify(template),
+ ...parameters.reduce((list, element) => list.concat(', ', element), new Array()),
+ ],
+ {
+ canBreakLine: true,
+ suffix: ')',
+ },
+ );
+ }
+
+ public token(node: ts.Token, renderer: GoRenderer): OTree {
+ switch (node.kind) {
+ case ts.SyntaxKind.FalseKeyword:
+ case ts.SyntaxKind.TrueKeyword:
+ if (renderer.currentContext.wrapPtr) {
+ return new OTree(['jsii.Boolean(', node.getText(), ')']);
+ }
+ return new OTree([node.getText()]);
+
+ case ts.SyntaxKind.NullKeyword:
+ case ts.SyntaxKind.UndefinedKeyword:
+ return new OTree(['nil']);
+ default:
+ return super.token(node, renderer);
+ }
+ }
+
+ public unknownTypeObjectLiteralExpression(node: ts.ObjectLiteralExpression, renderer: GoRenderer): OTree {
+ return this.keyValueObjectLiteralExpression(node, renderer);
+ }
+
+ public keyValueObjectLiteralExpression(node: ts.ObjectLiteralExpression, renderer: GoRenderer): OTree {
+ const valueType = inferMapElementType(node.properties, renderer.typeChecker);
+
+ return new OTree(
+ [`map[string]`, this.renderType(node, valueType?.symbol, valueType, true, `interface{}`, renderer), `{`],
+ renderer.updateContext({ inMapLiteral: true, wrapPtr: true }).convertAll(node.properties),
+ {
+ suffix: '}',
+ separator: ',',
+ trailingSeparator: true,
+ indent: 1,
+ },
+ );
+ }
+
+ public knownStructObjectLiteralExpression(
+ node: ts.ObjectLiteralExpression,
+ structType: ObjectLiteralStruct,
+ renderer: GoRenderer,
+ ): OTree {
+ return new OTree(
+ [
+ '&',
+ this.goName(structType.type.symbol.name, renderer.updateContext({ isPtr: false }), structType.type.symbol),
+ '{',
+ ],
+ renderer.updateContext({ isStruct: true }).convertAll(node.properties),
+ {
+ suffix: '}',
+ separator: ',',
+ trailingSeparator: true,
+ indent: 1,
+ },
+ );
+ }
+
+ public asExpression(node: ts.AsExpression, renderer: AstRenderer): OTree {
+ const jsiiType = determineJsiiType(renderer.typeChecker, renderer.typeChecker.getTypeFromTypeNode(node.type));
+ switch (jsiiType.kind) {
+ case 'builtIn':
+ switch (jsiiType.builtIn) {
+ case 'boolean':
+ return new OTree(['bool(', renderer.convert(node.expression), ')'], [], { canBreakLine: true });
+ case 'number':
+ return new OTree(['f64(', renderer.convert(node.expression), ')'], [], { canBreakLine: true });
+ case 'string':
+ return new OTree(['string(', renderer.convert(node.expression), ')'], [], { canBreakLine: true });
+ case 'any':
+ case 'void':
+ // Just return the value as-is... Everything is compatible with `interface{}`.
+ return renderer.convert(node.expression);
+ }
+ // To make linter understand there is no fall-through here...
+ throw new AssertionError({ message: 'unreachable' });
+ default:
+ return new OTree(
+ [renderer.convert(node.expression), '.(', this.renderTypeNode(node.type, false, renderer), ')'],
+ [],
+ { canBreakLine: true },
+ );
+ }
+ }
+
+ public parameterDeclaration(node: ts.ParameterDeclaration, renderer: GoRenderer): OTree {
+ const nodeName = renderer.updateContext({ isParameterName: true, isPtr: false }).convert(node.name);
+ const nodeType = node.dotDotDotToken ? (node.type as ts.ArrayTypeNode | undefined)?.elementType : node.type;
+ const typeNode = this.renderTypeNode(nodeType, true, renderer);
+ return new OTree([...(node.dotDotDotToken ? ['...'] : []), nodeName, ' ', typeNode]);
+ }
+
+ public printStatement(args: ts.NodeArray, renderer: GoRenderer): OTree {
+ const renderedArgs = this.argumentList(args, renderer);
+ return new OTree(['fmt.Println(', renderedArgs, ')']);
+ }
+
+ public propertyAccessExpression(node: ts.PropertyAccessExpression, renderer: GoRenderer): OTree {
+ const expressionType = typeOfExpression(renderer.typeChecker, node.expression);
+ const valueSymbol = renderer.typeChecker.getSymbolAtLocation(node.name);
+
+ const isClassStaticMember =
+ expressionType?.symbol?.valueDeclaration != null &&
+ ts.isClassDeclaration(expressionType.symbol.valueDeclaration) &&
+ valueSymbol?.valueDeclaration != null &&
+ ts.isPropertyDeclaration(valueSymbol.valueDeclaration) &&
+ isStatic(valueSymbol.valueDeclaration);
+
+ // When the expression has an unknown type (unresolved symbol), and has an upper-case first
+ // letter, we assume it's a type name... In such cases, what comes after can be considered a
+ // static member access. Note that the expression might be further qualified, so we check using
+ // a regex that checks for the last "."-delimited segment if there's dots in there...
+ const expressionLooksLikeTypeReference =
+ expressionType.symbol == null &&
+ /(?:\.|^)[A-Z][^.]*$/.exec(node.expression.getText(node.expression.getSourceFile())) != null;
+
+ const isEnum =
+ expressionType?.symbol?.valueDeclaration != null && ts.isEnumDeclaration(expressionType.symbol.valueDeclaration);
+
+ const delimiter = isEnum || isClassStaticMember || expressionLooksLikeTypeReference ? '_' : '.';
+
+ return new OTree([
+ renderer.convert(node.expression),
+ delimiter,
+ renderer
+ .updateContext({ isExported: isClassStaticMember || expressionLooksLikeTypeReference || isEnum })
+ .convert(node.name),
+ ...(isClassStaticMember
+ ? ['()']
+ : // If the parent's not a call-like expression, and it's an inferred static property access, we need to put call
+ // parentheses at the end, as static properties are accessed via synthetic readers.
+ expressionLooksLikeTypeReference && findUp(node, ts.isCallLikeExpression) == null
+ ? ['()']
+ : []),
+ ]);
+ }
+
+ public methodSignature(node: ts.MethodSignature, renderer: AstRenderer): OTree {
+ const type = this.renderTypeNode(node.type, true, renderer);
+ return new OTree(
+ [
+ renderer.updateContext({ isExported: renderer.currentContext.isExported && isPublic(node) }).convert(node.name),
+ '(',
+ ],
+ renderer.convertAll(node.parameters),
+ { suffix: `) ${type}`, canBreakLine: true },
+ );
+ }
+
+ public propertyDeclaration(node: ts.PropertyDeclaration, renderer: AstRenderer): OTree {
+ return new OTree(
+ [
+ renderer
+ .updateContext({ isExported: (renderer.currentContext.isExported && isPublic(node)) || isStatic(node) })
+ .convert(node.name),
+ ' ',
+ this.renderTypeNode(node.type, true, renderer),
+ ],
+ [],
+ { canBreakLine: true },
+ );
+ }
+
+ public propertySignature(node: ts.PropertySignature, renderer: GoRenderer): OTree {
+ if (renderer.currentContext.isInterface) {
+ const type = this.renderTypeNode(node.type, true, renderer);
+ const getter = new OTree([
+ renderer.updateContext({ isExported: renderer.currentContext.isExported && isPublic(node) }).convert(node.name),
+ '() ',
+ type,
+ ]);
+ if (isReadOnly(node)) {
+ return getter;
+ }
+ const setter = new OTree([
+ '\n',
+ renderer.currentContext.isExported && isPublic(node) ? 'Set' : 'set',
+ renderer.updateContext({ isExported: true }).convert(node.name),
+ '(value ',
+ type,
+ ')',
+ ]);
+ return new OTree([getter, setter]);
+ }
+
+ return new OTree([
+ '\n',
+ renderer.updateContext({ isExported: renderer.currentContext.isExported && isPublic(node) }).convert(node.name),
+ ' ',
+ this.renderTypeNode(node.type, renderer.currentContext.isPtr, renderer),
+ ]);
+ }
+
+ public regularCallExpression(node: ts.CallExpression, renderer: GoRenderer): OTree {
+ return new OTree([
+ renderer.convert(node.expression),
+ '(',
+ this.argumentList(node.arguments, renderer.updateContext({ wrapPtr: true })),
+ ')',
+ ]);
+ }
+
+ public returnStatement(node: ts.ReturnStatement, renderer: AstRenderer): OTree {
+ return new OTree(['return ', renderer.updateContext({ wrapPtr: true }).convert(node.expression)], [], {
+ canBreakLine: true,
+ });
+ }
+
+ public binaryExpression(node: ts.BinaryExpression, renderer: AstRenderer): OTree {
+ if (node.operatorToken.kind === ts.SyntaxKind.EqualsToken) {
+ const symbol = symbolFor(renderer.typeChecker, node.left);
+ return new OTree([
+ renderer.convert(node.left),
+ ' = ',
+ renderer
+ .updateContext({
+ isPtrAssignmentRValue:
+ symbol?.valueDeclaration &&
+ (ts.isParameter(symbol.valueDeclaration) || ts.isPropertyDeclaration(symbol.valueDeclaration)),
+ })
+ .convert(node.right),
+ ]);
+ }
+
+ const output = super.binaryExpression(node, renderer.updateContext({ wrapPtr: false, isPtr: false }));
+ if (!renderer.currentContext.wrapPtr) {
+ return output;
+ }
+ return wrapPtrExpression(renderer.typeChecker, node, output);
+ }
+
+ public stringLiteral(node: ts.StringLiteral, renderer: GoRenderer): OTree {
+ const text = JSON.stringify(node.text);
+
+ return new OTree([`${renderer.currentContext.wrapPtr ? jsiiStr(text) : text}`]);
+ }
+
+ public numericLiteral(node: ts.NumericLiteral, renderer: GoRenderer): OTree {
+ const text = `${node.text}`;
+
+ return new OTree([`${renderer.currentContext.wrapPtr ? jsiiNum(text) : text}`]);
+ }
+
+ public classDeclaration(node: ts.ClassDeclaration, renderer: AstRenderer): OTree {
+ const className = node.name
+ ? renderer.updateContext({ isExported: isExported(node) }).convert(node.name)
+ : 'anonymous';
+
+ const extendsClause = node.heritageClauses?.find((clause) => clause.token === ts.SyntaxKind.ExtendsKeyword);
+ const base = extendsClause && this.renderTypeNode(extendsClause.types[0], false, renderer);
+
+ const properties = node.members
+ .filter(ts.isPropertyDeclaration)
+ .map((prop) => renderer.updateContext({ isStruct: true, isPtr: true }).convert(prop));
+
+ const struct = new OTree(['type ', className, ' struct {'], [...(base ? ['\n', base] : []), ...properties], {
+ canBreakLine: true,
+ suffix: properties.length > 0 ? renderer.mirrorNewlineBefore(node.members[0], '}') : '\n}',
+ indent: 1,
+ });
+
+ const methods = [
+ node.members.length > 0
+ ? // Ensure there is a blank line between thre struct and the first member, but don't put two if there's already
+ // one as part of the first member's leading trivia.
+ new OTree(['\n\n'], [], { renderOnce: `ws-${node.members[0].getFullStart()}` })
+ : '',
+ ...renderer.convertAll(
+ node.members.filter((member) => !ts.isPropertyDeclaration(member) || (isExported(node) && !isPrivate(member))),
+ ),
+ ];
+
+ return new OTree([struct], methods, { canBreakLine: true });
+ }
+
+ public structInterfaceDeclaration(node: ts.InterfaceDeclaration, renderer: GoRenderer): OTree {
+ const bases =
+ node.heritageClauses?.flatMap((hc) => hc.types).map((t) => this.renderTypeNode(t, false, renderer)) ?? [];
+ return new OTree(
+ ['type ', renderer.updateContext({ isStruct: true }).convert(node.name), ' struct {'],
+ [...bases, ...renderer.updateContext({ isStruct: true, isPtr: true }).convertAll(node.members)],
+ { indent: 1, canBreakLine: true, separator: '\n', trailingSeparator: true, suffix: '}' },
+ );
+ }
+
+ public regularInterfaceDeclaration(node: ts.InterfaceDeclaration, renderer: AstRenderer): OTree {
+ if (node.members.length === 0) {
+ // Erase empty interfaces as they have no bearing in Go
+ return new OTree([]);
+ }
+
+ const symbol = renderer.typeChecker.getSymbolAtLocation(node.name);
+ const name = this.goName(node.name.text, renderer.updateContext({ isExported: isExported(node) }), symbol);
+ return new OTree(
+ [`type ${name} interface {`],
+ renderer.updateContext({ isInterface: true, isExported: isExported(node) }).convertAll(node.members),
+ { indent: 1, canBreakLine: true, separator: '\n', trailingSeparator: true, suffix: '}' },
+ );
+ }
+
+ public constructorDeclaration(node: ts.ConstructorDeclaration, renderer: AstRenderer): OTree {
+ const className = node.parent.name
+ ? this.goName(
+ node.parent.name.text,
+ renderer.updateContext({ isExported: isExported(node.parent) }),
+ renderer.typeChecker.getSymbolAtLocation(node.parent.name),
+ )
+ : 'anonymous';
+
+ const defaultArgValues = this.defaultArgValues(node.parameters, renderer);
+
+ return new OTree(
+ [
+ 'func ',
+ isExported(node.parent) ? 'New' : 'new',
+ ucFirst(className),
+ '(',
+ new OTree([], renderer.convertAll(node.parameters), { separator: ', ' }),
+ ') *',
+ className,
+ ' {',
+ new OTree([], [defaultArgValues, '\nthis := &', className, '{}'], {
+ indent: 1,
+ }),
+ ],
+ node.body ? renderer.convertAll(node.body.statements) : [],
+ { canBreakLine: true, suffix: '\n\treturn this\n}', indent: 1 },
+ );
+ }
+
+ public superCallExpression(node: ts.CallExpression, renderer: AstRenderer): OTree {
+ // We're on a `super` call, so we must be extending a base class.
+ const base = findUp(node, ts.isConstructorDeclaration)!.parent.heritageClauses!.find(
+ (clause) => clause.token === ts.SyntaxKind.ExtendsKeyword,
+ )!.types[0].expression;
+ const baseConstructor = ts.isPropertyAccessExpression(base)
+ ? new OTree([
+ renderer.convert(base.expression),
+ '.New',
+ ucFirst(this.goName(base.name.text, renderer, renderer.typeChecker.getSymbolAtLocation(base.name))),
+ ])
+ : ts.isIdentifier(base)
+ ? `new${ucFirst(this.goName(base.text, renderer, renderer.typeChecker.getSymbolAtLocation(base)))}`
+ : (function () {
+ renderer.reportUnsupported(node, TargetLanguage.GO);
+ return renderer.convert(base);
+ })();
+
+ return new OTree(
+ [
+ baseConstructor,
+ '_Override(this, ',
+ this.argumentList(node.arguments, renderer.updateContext({ wrapPtr: true, isPtr: true })),
+ ')',
+ ],
+ [],
+ {
+ canBreakLine: true,
+ },
+ );
+ }
+
+ public methodDeclaration(node: ts.MethodDeclaration, renderer: AstRenderer): OTree {
+ if (ts.isObjectLiteralExpression(node.parent)) {
+ return super.methodDeclaration(node, renderer);
+ }
+
+ const className = node.parent.name
+ ? this.goName(
+ node.parent.name.text,
+ renderer.updateContext({ isExported: isExported(node.parent) }),
+ renderer.typeChecker.getSymbolAtLocation(node.parent.name),
+ )
+ : 'anonymous';
+
+ const returnType = determineReturnType(renderer.typeChecker, node);
+ const goReturnType =
+ returnType && this.renderType(node.type ?? node, returnType.symbol, returnType, true, 'interface{}', renderer);
+
+ return new OTree(
+ [
+ 'func (this *',
+ className,
+ ') ',
+ renderer.updateContext({ isExported: renderer.currentContext.isExported && isPublic(node) }).convert(node.name),
+ '(',
+ new OTree([], renderer.convertAll(node.parameters), { separator: ', ' }),
+ ') ',
+ goReturnType,
+ goReturnType ? ' ' : '',
+ '{',
+ ],
+ [
+ this.defaultArgValues(node.parameters, renderer),
+ ...(node.body ? renderer.convertAll(node.body.statements) : []),
+ ],
+ { canBreakLine: true, suffix: node.body && node.body.statements.length > 0 ? '\n}' : '}', indent: 1 },
+ );
+ }
+
+ public ifStatement(node: ts.IfStatement, renderer: AstRenderer): OTree {
+ const [ifPrefix, ifSuffix, ifIndent] = ts.isBlock(node.thenStatement) ? [' '] : [' {\n', '\n}', 1];
+ const ifStmt = new OTree(
+ ['if ', renderer.convert(node.expression)],
+ [ifPrefix, renderer.convert(node.thenStatement)],
+ {
+ canBreakLine: true,
+ suffix: ifSuffix,
+ indent: ifIndent,
+ },
+ );
+ if (!node.elseStatement) {
+ return ifStmt;
+ }
+
+ const [elsePrefix, elseSuffix, elseIndent] = ts.isBlock(node.elseStatement) ? [' '] : [' {\n', '\n}', 1];
+ const elseStmt = new OTree(['else'], [elsePrefix, renderer.convert(node.elseStatement)], {
+ canBreakLine: true,
+ suffix: elseSuffix,
+ indent: elseIndent,
+ });
+
+ return new OTree([], [ifStmt, elseStmt], {
+ separator: ' ',
+ canBreakLine: true,
+ });
+ }
+
+ public forOfStatement(node: ts.ForOfStatement, renderer: AstRenderer): OTree {
+ const [prefix, suffix, indent] = ts.isBlock(node.statement) ? [' '] : [' {\n', '\n}', 1];
+ return new OTree(
+ ['for _, ', nameOf(node.initializer), ' := range ', renderer.convert(node.expression)],
+ [prefix, renderer.convert(node.statement)],
+ { canBreakLine: true, suffix, indent },
+ );
+
+ function nameOf(decl: ts.ForInitializer | ts.Declaration): string | OTree {
+ if (ts.isVariableDeclarationList(decl)) {
+ if (decl.declarations.length !== 1) {
+ renderer.reportUnsupported(decl.declarations[1], TargetLanguage.GO);
+ }
+ return nameOf(decl.declarations[0]);
+ }
+ if (ts.isVariableDeclaration(decl)) {
+ return decl.name.getText(decl.name.getSourceFile());
+ }
+ renderer.reportUnsupported(decl, TargetLanguage.GO);
+ return renderer.convert(decl);
+ }
+ }
+
+ public importStatement(node: ImportStatement, renderer: AstRenderer): OTree {
+ const packageName =
+ node.moduleSymbol?.sourceAssembly?.packageJson.jsii?.targets?.go?.packageName ??
+ this.goName(node.packageName, renderer, undefined);
+ const moduleName = node.moduleSymbol?.sourceAssembly?.packageJson.jsii?.targets?.go?.moduleName
+ ? `${node.moduleSymbol.sourceAssembly.packageJson.jsii.targets.go.moduleName}/${packageName}`
+ : `github.com/aws-samples/dummy/${packageName}`;
+
+ if (node.imports.import === 'full') {
+ return new OTree(['import ', this.goName(node.imports.alias, renderer, undefined), ' "', moduleName, '"']);
+ }
+
+ // We'll just create local type aliases for all imported types. This is not very go-idiomatic, but simplifies things elsewhere...
+ const elements = node.imports.elements
+ .filter((element) => element.importedSymbol?.symbolType === 'type')
+ .map(
+ (element) =>
+ new OTree(['type ', element.alias ?? element.sourceName, ' ', packageName, '.', element.sourceName]),
+ );
+
+ const submodules = node.imports.elements
+ .filter((element) => element.importedSymbol?.symbolType === 'module')
+ .map(
+ (element) =>
+ new OTree(['import ', element.alias ?? element.sourceName, ' "', moduleName, '/', element.sourceName, '"']),
+ );
+
+ if (elements.length === 0 && submodules.length === 0) {
+ // This is a blank import (for side-effects only)
+ return new OTree(['import _ "', moduleName, '"']);
+ }
+
+ const mainImport = new OTree(['import ', packageName, ' "', moduleName, '"'], elements, {
+ canBreakLine: true,
+ separator: '\n',
+ });
+ return new OTree([mainImport, ...submodules]);
+ }
+
+ public variableDeclaration(node: ts.VariableDeclaration, renderer: AstRenderer): OTree {
+ if (!node.initializer) {
+ return new OTree([
+ 'var ',
+ renderer.updateContext({ isExported: isExported(node) }).convert(node.name),
+ ' ',
+ this.renderTypeNode(node.type, false, renderer) || 'interface{}',
+ ]);
+ }
+
+ return new OTree([
+ renderer.updateContext({ isExported: false }).convert(node.name),
+ ' := ',
+ renderer.convert(node.initializer),
+ ]);
+ }
+
+ private defaultArgValues(params: ts.NodeArray, renderer: GoRenderer) {
+ return new OTree(
+ params.reduce((accum: OTree[], param) => {
+ if (!param.initializer) {
+ return accum;
+ }
+
+ const name = renderer.updateContext({ isPtr: true }).convert(param.name);
+ return [
+ ...accum,
+ new OTree(
+ ['\n', 'if ', name, ' == nil {'],
+ ['\n', name, ' = ', renderer.updateContext({ wrapPtr: true }).convert(param.initializer)],
+ {
+ indent: 1,
+ suffix: '\n}',
+ },
+ ),
+ ];
+ }, []),
+ );
+ }
+
+ public mergeContext(old: GoLanguageContext, update: Partial): GoLanguageContext {
+ return Object.assign({}, old, update);
+ }
+
+ private renderTypeNode(typeNode: ts.TypeNode | undefined, isPtr: boolean, renderer: GoRenderer): string {
+ if (!typeNode) {
+ return '';
+ }
+ return this.renderType(
+ typeNode,
+ renderer.typeChecker.getTypeFromTypeNode(typeNode).symbol,
+ renderer.typeOfType(typeNode),
+ isPtr,
+ renderer.textOf(typeNode),
+ renderer,
+ );
+ }
+
+ private renderType(
+ typeNode: ts.Node,
+ typeSymbol: ts.Symbol | undefined,
+ type: ts.Type | undefined,
+ isPtr: boolean,
+ fallback: string,
+ renderer: GoRenderer,
+ ): string {
+ if (type === undefined) {
+ return fallback;
+ }
+
+ const jsiiType = determineJsiiType(renderer.typeChecker, type);
+
+ const doRender = (jsiiType: JsiiType, isPtr: boolean, typeSymbol: ts.Symbol | undefined): string => {
+ const prefix = isPtr ? '*' : '';
+ switch (jsiiType.kind) {
+ case 'unknown':
+ return fallback;
+ case 'error':
+ renderer.report(typeNode, jsiiType.message);
+ return fallback;
+ case 'map':
+ return `map[string]${doRender(jsiiType.elementType, true, jsiiType.elementTypeSymbol)}`;
+ case 'list':
+ return `[]${doRender(jsiiType.elementType, true, jsiiType.elementTypeSymbol)}`;
+ case 'namedType':
+ return this.goName(jsiiType.name, renderer, typeSymbol);
+ case 'builtIn':
+ switch (jsiiType.builtIn) {
+ case 'boolean':
+ return `${prefix}bool`;
+ case 'number':
+ return `${prefix}f64`;
+ case 'string':
+ return `${prefix}string`;
+ case 'any':
+ return 'interface{}';
+ case 'void':
+ return '';
+ }
+ }
+ };
+
+ return doRender(jsiiType, isPtr, typeSymbol);
+ }
+
+ /**
+ * Guess an item's go name based on it's TS name and context
+ */
+ private goName(input: string, renderer: GoRenderer, symbol: ts.Symbol | undefined) {
+ let text = input.replace(/[^a-z0-9_]/gi, '');
+ const prev = this.idMap.get(symbol ?? input) ?? this.idMap.get(input);
+
+ if (prev) {
+ // If an identifier has been renamed go get it
+ text = prev.formatted;
+ } else if (renderer.currentContext.isExported && !renderer.currentContext.inMapLiteral) {
+ // Uppercase exported and public symbols/members
+ text = ucFirst(text);
+ } else if (!renderer.currentContext.inMapLiteral) {
+ // Lowercase unexported items that are capitalized in TS like structs/interfaces/classes
+ text = lcFirst(text);
+ }
+
+ text = prefixReserved(text);
+
+ if (text !== input && prev == null) {
+ this.idMap.set(symbol ?? input, { formatted: text, type: getDeclarationType(renderer.currentContext) });
+ }
+
+ if (
+ // Non-pointer references to parameters need to be de-referenced
+ (!renderer.currentContext.isPtr &&
+ !renderer.currentContext.isParameterName &&
+ symbol?.valueDeclaration?.kind === ts.SyntaxKind.Parameter &&
+ !renderer.currentContext.isPtrAssignmentRValue) ||
+ // Pointer reference to non-interfaces are prefixed with *
+ (renderer.currentContext.isPtr && prev && prev?.type !== DeclarationType.INTERFACE)
+ ) {
+ return `*${text}`;
+ }
+ return text;
+ }
+}
+
+/**
+ * Uppercase the first letter
+ */
+function ucFirst(x: string) {
+ return x.substring(0, 1).toUpperCase() + x.substring(1);
+}
+
+/**
+ * Lowercase the first letter
+ */
+function lcFirst(x: string) {
+ return x.substring(0, 1).toLowerCase() + x.substring(1);
+}
+
+function wrapPtrExpression(typeChecker: ts.TypeChecker, node: ts.Expression, unwrapped: OTree): OTree {
+ const type = typeOfExpression(typeChecker, node);
+ const jsiiType = determineJsiiType(typeChecker, type);
+ if (jsiiType.kind !== 'builtIn') {
+ return unwrapped;
+ }
+ switch (jsiiType.builtIn) {
+ case 'boolean':
+ return new OTree(['jsii.Boolean(', unwrapped, ')']);
+ case 'number':
+ return new OTree(['jsii.Number(', unwrapped, ')']);
+ case 'string':
+ return new OTree(['jsii.String(', unwrapped, ')']);
+ case 'any':
+ case 'void':
+ return unwrapped;
+ }
+}
+
+/**
+ * Wrap a string literal in the jsii.String helper
+ */
+function jsiiStr(x: string) {
+ return `jsii.String(${x})`;
+}
+
+/**
+ * Wrap a string literal in the jsii.String helper
+ */
+function jsiiNum(x: string) {
+ return `jsii.Number(${x})`;
+}
+
+/**
+ * Prefix reserved word identifiers with _
+ */
+function prefixReserved(x: string) {
+ if (['struct'].includes(x)) {
+ return `${x}_`;
+ }
+ return x;
+}
+
+function getDeclarationType(ctx: GoLanguageContext) {
+ if (ctx.isStruct) {
+ return DeclarationType.STRUCT;
+ }
+
+ return DeclarationType.UNKNOWN;
+}
+
+function findUp(node: ts.Node, predicate: (node: ts.Node) => node is T): T | undefined {
+ if (predicate(node)) {
+ return node;
+ }
+ if (node.parent == null) {
+ return undefined;
+ }
+ return findUp(node.parent, predicate);
+}
+
+function symbolFor(typeChecker: ts.TypeChecker, node: ts.Node): ts.Symbol | undefined {
+ if (ts.isIdentifier(node)) {
+ return typeChecker.getSymbolAtLocation(node);
+ }
+ if (ts.isPropertyAccessExpression(node)) {
+ return typeChecker.getSymbolAtLocation(node.name);
+ }
+ // I don't know 🤷🏻♂️
+ return undefined;
+}
+
+/**
+ * Checks whether the provided node corresponds to a pointer-value.
+ *
+ * NOTE: This currently only checkes for parameter declarations. This is
+ * presently used only to determine whether a variable reference needs to be
+ * wrapped or not (i.e: "jsii.String(varStr)"), and parameter references are the
+ * only "always pointer" values possible in that particular context.
+ *
+ * @param typeChecker a TypeChecker to use to resolve the node's symbol.
+ * @param node the node to be checked.
+ *
+ * @returns true if the node corresponds to a pointer-value.
+ */
+function isPointerValue(typeChecker: ts.TypeChecker, node: ts.Node): boolean {
+ const symbol = typeChecker.getSymbolAtLocation(node);
+ if (symbol == null) {
+ // Can't find symbol, assuming it's a pointer...
+ return true;
+ }
+
+ const declaration = symbol.valueDeclaration;
+ if (declaration == null) {
+ // Doesn't have declaration, assuming it's a pointer...
+ return true;
+ }
+
+ // Now check if this is known pointer kind or not....
+ return ts.isParameter(node);
+}
diff --git a/packages/jsii-rosetta/lib/languages/index.ts b/packages/jsii-rosetta/lib/languages/index.ts
index 28bcf72141..e993412745 100644
--- a/packages/jsii-rosetta/lib/languages/index.ts
+++ b/packages/jsii-rosetta/lib/languages/index.ts
@@ -1,5 +1,6 @@
import { AstHandler } from '../renderer';
import { CSharpVisitor } from './csharp';
+import { GoVisitor } from './go';
import { JavaVisitor } from './java';
import { PythonVisitor } from './python';
import { TargetLanguage } from './target-language';
@@ -24,4 +25,8 @@ export const TARGET_LANGUAGES: { [key in TargetLanguage]: VisitorFactory } = {
version: JavaVisitor.VERSION,
createVisitor: () => new JavaVisitor(),
},
+ go: {
+ version: GoVisitor.VERSION,
+ createVisitor: () => new GoVisitor(),
+ },
};
diff --git a/packages/jsii-rosetta/lib/languages/target-language.ts b/packages/jsii-rosetta/lib/languages/target-language.ts
index 29c30e963d..b4a977150e 100644
--- a/packages/jsii-rosetta/lib/languages/target-language.ts
+++ b/packages/jsii-rosetta/lib/languages/target-language.ts
@@ -2,4 +2,5 @@ export enum TargetLanguage {
PYTHON = 'python',
CSHARP = 'csharp',
JAVA = 'java',
+ GO = 'go',
}
diff --git a/packages/jsii-rosetta/lib/languages/visualize.ts b/packages/jsii-rosetta/lib/languages/visualize.ts
index a58e345dc4..6bf4c2ac4c 100644
--- a/packages/jsii-rosetta/lib/languages/visualize.ts
+++ b/packages/jsii-rosetta/lib/languages/visualize.ts
@@ -38,6 +38,10 @@ export class VisualizeAstVisitor implements AstHandler {
return this.defaultNode('stringLiteral', node, children);
}
+ public numericLiteral(node: ts.NumericLiteral, children: AstRenderer): OTree {
+ return this.defaultNode('numericLiteral', node, children);
+ }
+
public identifier(node: ts.Identifier, children: AstRenderer): OTree {
return this.defaultNode('identifier', node, children);
}
diff --git a/packages/jsii-rosetta/lib/o-tree.ts b/packages/jsii-rosetta/lib/o-tree.ts
index 8f82e0f54a..681928e8ac 100644
--- a/packages/jsii-rosetta/lib/o-tree.ts
+++ b/packages/jsii-rosetta/lib/o-tree.ts
@@ -17,6 +17,14 @@ export interface OTreeOptions {
*/
separator?: string;
+ /**
+ * Whether trailing separators should be output. This imples children will be
+ * writen each on a new line.
+ *
+ * @default false
+ */
+ trailingSeparator?: boolean;
+
/**
* Suffix the token after outdenting
*
@@ -92,17 +100,30 @@ export class OTree implements OTree {
const popIndent = sink.requestIndentChange(meVisible ? this.options.indent ?? 0 : 0);
let mark = sink.mark();
+
for (const child of this.children ?? []) {
- if (this.options.separator && mark.wroteNonWhitespaceSinceMark) {
- sink.write(this.options.separator);
+ if (this.options.separator) {
+ if (this.options.trailingSeparator) {
+ sink.ensureNewLine();
+ } else if (mark.wroteNonWhitespaceSinceMark) {
+ sink.write(this.options.separator);
+ }
}
mark = sink.mark();
sink.write(child);
+
+ if (this.options.separator && this.options.trailingSeparator) {
+ sink.write(this.options.separator.trimEnd());
+ }
}
+
popIndent();
if (this.options.suffix) {
+ if (this.options.separator && this.options.trailingSeparator) {
+ sink.ensureNewLine();
+ }
sink.renderingForSpan(this.span);
sink.write(this.options.suffix);
}
@@ -126,9 +147,19 @@ export interface SinkMark {
}
export interface OTreeSinkOptions {
+ /**
+ * @default ' '
+ */
+ indentChar?: ' ' | '\t';
visibleSpans?: Spans;
}
+interface ConditionalNewLine {
+ readonly conditionalNewLine: {
+ readonly indent: number;
+ };
+}
+
/**
* Output sink for OTree objects
*
@@ -139,13 +170,16 @@ export interface OTreeSinkOptions {
* tree :).
*/
export class OTreeSink {
+ private readonly indentChar: ' ' | '\t';
private readonly indentLevels: number[] = [0];
- private readonly fragments = new Array();
+ private readonly fragments = new Array();
private readonly singletonsRendered = new Set();
private pendingIndentChange = 0;
private rendering = true;
- public constructor(private readonly options: OTreeSinkOptions = {}) {}
+ public constructor(private readonly options: OTreeSinkOptions = {}) {
+ this.indentChar = options.indentChar ?? ' ';
+ }
public tagOnce(key: string | undefined): boolean {
if (key === undefined) {
@@ -170,7 +204,7 @@ export class OTreeSink {
return {
get wroteNonWhitespaceSinceMark(): boolean {
- return self.fragments.slice(markIndex).some((s) => /[^\s]/.exec(s) != null);
+ return self.fragments.slice(markIndex).some((s) => typeof s !== 'object' && /[^\s]/.exec(s) != null);
},
};
}
@@ -186,10 +220,20 @@ export class OTreeSink {
if (containsNewline(text)) {
this.applyPendingIndentChange();
}
- this.append(text.replace(/\n/g, `\n${' '.repeat(this.currentIndent)}`));
+ this.append(text.replace(/\n/g, `\n${this.indentChar.repeat(this.currentIndent)}`));
}
}
+ /**
+ * Ensures the following tokens will be output on a new line (emits a new line
+ * and indent unless immediately preceded or followed by a newline, ignoring
+ * surrounding white space).
+ */
+ public ensureNewLine(): void {
+ this.applyPendingIndentChange();
+ this.fragments.push({ conditionalNewLine: { indent: this.currentIndent } });
+ }
+
public renderingForSpan(span?: Span): boolean {
if (span && this.options.visibleSpans) {
this.rendering = this.options.visibleSpans.fullyContainsSpan(span);
@@ -216,6 +260,48 @@ export class OTreeSink {
public toString() {
// Strip trailing whitespace from every line, and empty lines from the start and end
return this.fragments
+ .map((item, index, fragments) => {
+ if (typeof item !== 'object') {
+ return item;
+ }
+ const ignore = '';
+
+ const leading = fragments.slice(0, index).reverse();
+ for (const fragment of leading) {
+ if (typeof fragment === 'object') {
+ // We don't emit if there was already a conditional newline just before
+ return ignore;
+ }
+ // If there's a trailing newline, then we don't emit this one
+ if (/\n\s*$/m.exec(fragment)) {
+ return ignore;
+ }
+ // If it contained non-whitespace characters, we need to check trailing data...
+ if (/[^\s]/.exec(fragment)) {
+ break;
+ }
+ }
+
+ const newlineAndIndent = `\n${this.indentChar.repeat(item.conditionalNewLine.indent)}`;
+
+ const trailing = fragments.slice(index + 1);
+ for (const fragment of trailing) {
+ if (typeof fragment === 'object') {
+ // We're the first of a sequence, so we must emit (unless we returned earlier, of course)
+ return newlineAndIndent;
+ }
+ // If there's a leading newline, then we don't emit this one
+ if (/^\s*\n/m.exec(fragment)) {
+ return ignore;
+ }
+ // If it contained non-whitespace characters, we emit this one
+ if (/[^\s]/.exec(fragment)) {
+ return newlineAndIndent;
+ }
+ }
+
+ return ignore;
+ })
.join('')
.replace(/[ \t]+$/gm, '')
.replace(/^\n+/, '')
diff --git a/packages/jsii-rosetta/lib/renderer.ts b/packages/jsii-rosetta/lib/renderer.ts
index cdca8ee037..84fdb08759 100644
--- a/packages/jsii-rosetta/lib/renderer.ts
+++ b/packages/jsii-rosetta/lib/renderer.ts
@@ -257,6 +257,9 @@ export class AstRenderer {
if (ts.isStringLiteral(tree) || ts.isNoSubstitutionTemplateLiteral(tree)) {
return visitor.stringLiteral(tree, this);
}
+ if (ts.isNumericLiteral(tree)) {
+ return visitor.numericLiteral(tree, this);
+ }
if (ts.isFunctionDeclaration(tree)) {
return visitor.functionDeclaration(tree, this);
}
@@ -452,12 +455,14 @@ export class AstRenderer {
*/
export interface AstHandler {
readonly defaultContext: C;
+ readonly indentChar?: ' ' | '\t';
mergeContext(old: C, update: Partial): C;
sourceFile(node: ts.SourceFile, context: AstRenderer): OTree;
commentRange(node: CommentSyntax, context: AstRenderer): OTree;
importStatement(node: ImportStatement, context: AstRenderer): OTree;
stringLiteral(node: ts.StringLiteral | ts.NoSubstitutionTemplateLiteral, children: AstRenderer): OTree;
+ numericLiteral(node: ts.NumericLiteral, children: AstRenderer): OTree;
functionDeclaration(node: ts.FunctionDeclaration, children: AstRenderer): OTree;
identifier(node: ts.Identifier, children: AstRenderer): OTree;
block(node: ts.Block, children: AstRenderer): OTree;
diff --git a/packages/jsii-rosetta/lib/translate.ts b/packages/jsii-rosetta/lib/translate.ts
index d1f0456811..ee79c4fcbf 100644
--- a/packages/jsii-rosetta/lib/translate.ts
+++ b/packages/jsii-rosetta/lib/translate.ts
@@ -228,7 +228,7 @@ export class SnippetTranslator {
);
const converted = converter.convert(this.compilation.rootFile);
this.translateDiagnostics.push(...filterVisibleDiagnostics(converter.diagnostics, this.visibleSpans));
- return renderTree(converted, { visibleSpans: this.visibleSpans });
+ return renderTree(converted, { indentChar: visitor.indentChar, visibleSpans: this.visibleSpans });
}
public syntaxKindCounter(): Record {
diff --git a/packages/jsii-rosetta/lib/typescript/ast-utils.ts b/packages/jsii-rosetta/lib/typescript/ast-utils.ts
index ee10955943..ed58563f93 100644
--- a/packages/jsii-rosetta/lib/typescript/ast-utils.ts
+++ b/packages/jsii-rosetta/lib/typescript/ast-utils.ts
@@ -396,10 +396,24 @@ export function visibility(x: ts.PropertyLikeDeclaration | ts.FunctionLikeDeclar
return 'public';
}
-export function isReadOnly(x: ts.PropertyLikeDeclaration | ts.FunctionLikeDeclarationBase) {
- const flags = ts.getCombinedModifierFlags(x);
- return (flags & ts.ModifierFlags.Readonly) !== 0;
+function hasFlag(flag: ts.ModifierFlags) {
+ return (x: T) => {
+ const flags = ts.getCombinedModifierFlags(x);
+ return (flags & flag) !== 0;
+ };
+}
+
+export const isReadOnly = hasFlag(
+ ts.ModifierFlags.Readonly,
+);
+export const isExported = hasFlag(ts.ModifierFlags.Export);
+export const isPrivate = hasFlag(ts.ModifierFlags.Private);
+export const isProtected = hasFlag(ts.ModifierFlags.Private);
+export function isPublic(x: ts.Declaration) {
+ // In TypeScript, anything not explicitly marked private or protected is public.
+ return !isPrivate(x) && !isProtected(x);
}
+export const isStatic = hasFlag(ts.ModifierFlags.Static);
/**
* Return the super() call from a method body if found
diff --git a/packages/jsii-rosetta/lib/typescript/types.ts b/packages/jsii-rosetta/lib/typescript/types.ts
index 78932b4cc1..b5af10102a 100644
--- a/packages/jsii-rosetta/lib/typescript/types.ts
+++ b/packages/jsii-rosetta/lib/typescript/types.ts
@@ -16,7 +16,7 @@ export function firstTypeInUnion(typeChecker: ts.TypeChecker, type: ts.Type): ts
return type.types[0];
}
-export type BuiltInType = 'any' | 'boolean' | 'number' | 'string';
+export type BuiltInType = 'any' | 'boolean' | 'number' | 'string' | 'void';
export function builtInTypeName(type: ts.Type): BuiltInType | undefined {
if (hasAnyFlag(type.flags, ts.TypeFlags.Any | ts.TypeFlags.Unknown)) {
return 'any';
diff --git a/packages/jsii-rosetta/package.json b/packages/jsii-rosetta/package.json
index 2457e0b0b7..909201a992 100644
--- a/packages/jsii-rosetta/package.json
+++ b/packages/jsii-rosetta/package.json
@@ -18,12 +18,12 @@
"devDependencies": {
"@types/commonmark": "^0.27.5",
"@types/fs-extra": "^9.0.13",
- "@types/jest": "^27.4.0",
+ "@types/jest": "^27.4.1",
"@types/mock-fs": "^4.13.1",
- "@types/node": "^12.20.43",
+ "@types/node": "^12.20.46",
"@types/workerpool": "^6.1.0",
"@types/semver": "^7.3.9",
- "eslint": "^8.8.0",
+ "eslint": "^8.10.0",
"jest": "^27.5.1",
"jsii-build-tools": "0.0.0",
"memory-streams": "^0.1.3",
@@ -36,8 +36,8 @@
"commonmark": "^0.30.0",
"fs-extra": "^9.1.0",
"typescript": "~3.9.10",
- "sort-json": "^2.0.0",
- "@xmldom/xmldom": "^0.8.0",
+ "sort-json": "^2.0.1",
+ "@xmldom/xmldom": "^0.8.1",
"workerpool": "^6.2.0",
"yargs": "^16.2.0",
"semver": "^7.3.5",
diff --git a/packages/jsii-rosetta/test/rosetta.test.ts b/packages/jsii-rosetta/test/rosetta.test.ts
index 7d68c2eccd..f0d86d2ed9 100644
--- a/packages/jsii-rosetta/test/rosetta.test.ts
+++ b/packages/jsii-rosetta/test/rosetta.test.ts
@@ -59,6 +59,7 @@ test('Can use preloaded tablet', () => {
python: 'Not Really Translated',
csharp: 'Not Really Translated C#',
java: 'Not Really Translated Java',
+ go: 'Not Really Translated Go',
}),
);
rosetta.addTablet(tablet);
@@ -230,6 +231,7 @@ describe('with mocked filesystem', () => {
python: 'My Stored Translation',
csharp: 'My Stored Translation C#',
java: 'My Stored Translation Java',
+ go: 'My Stored Translation Go',
}),
);
diff --git a/packages/jsii-rosetta/test/translations.test.ts b/packages/jsii-rosetta/test/translations.test.ts
index 86b45e5aca..e5f82bfacf 100644
--- a/packages/jsii-rosetta/test/translations.test.ts
+++ b/packages/jsii-rosetta/test/translations.test.ts
@@ -18,6 +18,7 @@ import { testSnippetLocation } from './testutil';
// yarn test test/translations.test -t 'Translating .* to Python'
// yarn test test/translations.test -t 'Translating .* to Java'
// yarn test test/translations.test -t 'Translating .* to C#'
+// yarn test test/translations.test -t 'Translating .* to Go'
//
// To narrow it down even more you can of course replace the '.*' regex with
// whatever file indication you desire.
@@ -46,6 +47,11 @@ export const SUPPORTED_LANGUAGES = new Array(
extension: '.cs',
visitorFactory: TARGET_LANGUAGES[TargetLanguage.CSHARP],
},
+ {
+ name: 'Go',
+ extension: '.go',
+ visitorFactory: TARGET_LANGUAGES[TargetLanguage.GO],
+ },
);
const translationsRoot = path.join(__dirname, 'translations');
@@ -87,7 +93,7 @@ for (const typeScriptTest of typeScriptTests) {
const expected = fs.readFileSync(languageFile, { encoding: 'utf-8' });
try {
const translation = translator.renderUsing(visitorFactory.createVisitor());
- expect(stripEmptyLines(translation)).toEqual(stripEmptyLines(stripCommonWhitespace(expected)));
+ expect(stripEmptyLines(translation)).toBe(stripEmptyLines(stripCommonWhitespace(expected)));
} catch (e) {
anyFailed = true;
throw e;
diff --git a/packages/jsii-rosetta/test/translations/calls/declaring_default_arguments.go b/packages/jsii-rosetta/test/translations/calls/declaring_default_arguments.go
new file mode 100644
index 0000000000..d1809a37b1
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/declaring_default_arguments.go
@@ -0,0 +1,6 @@
+func foo(x *string, y *string, z *string) {
+ if y == nil {
+ y = jsii.String("hello")
+ }
+ fmt.Println(*x, *y, *z)
+}
diff --git a/packages/jsii-rosetta/test/translations/calls/declaring_default_arguments.ts b/packages/jsii-rosetta/test/translations/calls/declaring_default_arguments.ts
index 9dfcf68d23..c32a89e1d3 100644
--- a/packages/jsii-rosetta/test/translations/calls/declaring_default_arguments.ts
+++ b/packages/jsii-rosetta/test/translations/calls/declaring_default_arguments.ts
@@ -1,3 +1,3 @@
function foo(x: string | undefined, y: string = 'hello', z?: string) {
console.log(x, y, z);
-}
\ No newline at end of file
+}
diff --git a/packages/jsii-rosetta/test/translations/calls/default_struct_fields.go b/packages/jsii-rosetta/test/translations/calls/default_struct_fields.go
new file mode 100644
index 0000000000..ef34fa95b5
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/default_struct_fields.go
@@ -0,0 +1,7 @@
+type struct_ struct {
+ x *string
+ y *string
+}
+func foo(s *struct_) {
+ fmt.Println(*s.x, *s.y)
+}
diff --git a/packages/jsii-rosetta/test/translations/calls/function_call.go b/packages/jsii-rosetta/test/translations/calls/function_call.go
new file mode 100644
index 0000000000..f80bcd5d72
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/function_call.go
@@ -0,0 +1 @@
+callSomeFunction(jsii.Number(1), jsii.Number(2), jsii.Number(3))
diff --git a/packages/jsii-rosetta/test/translations/calls/list_of_anonymous_structs.go b/packages/jsii-rosetta/test/translations/calls/list_of_anonymous_structs.go
new file mode 100644
index 0000000000..ce64e3d82d
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/list_of_anonymous_structs.go
@@ -0,0 +1,12 @@
+foo(map[string][]map[string]*f64{
+ "list": []map[string]*f64{
+ map[string]*f64{
+ "a": jsii.Number(1),
+ "b": jsii.Number(2),
+ },
+ map[string]*f64{
+ "a": jsii.Number(3),
+ "b": jsii.Number(4),
+ },
+ },
+})
diff --git a/packages/jsii-rosetta/test/translations/calls/literal_map_argument.go b/packages/jsii-rosetta/test/translations/calls/literal_map_argument.go
new file mode 100644
index 0000000000..6ed0e7fc97
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/literal_map_argument.go
@@ -0,0 +1,7 @@
+func foo(xs map[string]*string) {
+}
+
+foo(map[string]*string{
+ "foo": jsii.String("bar"),
+ "schmoo": jsii.String("schmar"),
+})
diff --git a/packages/jsii-rosetta/test/translations/calls/method_call.go b/packages/jsii-rosetta/test/translations/calls/method_call.go
new file mode 100644
index 0000000000..b7018981c5
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/method_call.go
@@ -0,0 +1 @@
+someObject.callSomeFunction(jsii.Number(1), jsii.Number(2), jsii.Number(3))
diff --git a/packages/jsii-rosetta/test/translations/calls/self_method_call.go b/packages/jsii-rosetta/test/translations/calls/self_method_call.go
new file mode 100644
index 0000000000..790425e500
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/self_method_call.go
@@ -0,0 +1 @@
+this.callSomeFunction(jsii.Number(25))
diff --git a/packages/jsii-rosetta/test/translations/calls/shorthand_property.go b/packages/jsii-rosetta/test/translations/calls/shorthand_property.go
new file mode 100644
index 0000000000..6653707006
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/shorthand_property.go
@@ -0,0 +1,4 @@
+foo := "hello"
+callFunction(map[string]*string{
+ "foo": jsii.String(foo),
+})
diff --git a/packages/jsii-rosetta/test/translations/calls/static_function_call.go b/packages/jsii-rosetta/test/translations/calls/static_function_call.go
new file mode 100644
index 0000000000..2fa74b7518
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/static_function_call.go
@@ -0,0 +1 @@
+someObject_CallSomeFunction(jsii.Number(1), jsii.Number(2), jsii.Number(3))
diff --git a/packages/jsii-rosetta/test/translations/calls/this_argument.go b/packages/jsii-rosetta/test/translations/calls/this_argument.go
new file mode 100644
index 0000000000..d146e6ab11
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/this_argument.go
@@ -0,0 +1 @@
+callSomeFunction(this, jsii.Number(25))
diff --git a/packages/jsii-rosetta/test/translations/calls/translate_object_literals_in_function_call.go b/packages/jsii-rosetta/test/translations/calls/translate_object_literals_in_function_call.go
new file mode 100644
index 0000000000..9b4dfc4783
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/translate_object_literals_in_function_call.go
@@ -0,0 +1,4 @@
+foo(jsii.Number(25), map[string]interface{}{
+ "foo": jsii.Number(3),
+ "banana": jsii.String("hello"),
+})
diff --git a/packages/jsii-rosetta/test/translations/calls/translate_object_literals_only_one_level_deep.go b/packages/jsii-rosetta/test/translations/calls/translate_object_literals_only_one_level_deep.go
new file mode 100644
index 0000000000..92f38b3b5d
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/translate_object_literals_only_one_level_deep.go
@@ -0,0 +1,7 @@
+foo(jsii.Number(25), map[string]interface{}{
+ "foo": jsii.Number(3),
+ "deeper": map[string]*f64{
+ "a": jsii.Number(1),
+ "b": jsii.Number(2),
+ },
+})
diff --git a/packages/jsii-rosetta/test/translations/calls/translate_object_literals_second_level_with_newlines.go b/packages/jsii-rosetta/test/translations/calls/translate_object_literals_second_level_with_newlines.go
new file mode 100644
index 0000000000..92f38b3b5d
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/translate_object_literals_second_level_with_newlines.go
@@ -0,0 +1,7 @@
+foo(jsii.Number(25), map[string]interface{}{
+ "foo": jsii.Number(3),
+ "deeper": map[string]*f64{
+ "a": jsii.Number(1),
+ "b": jsii.Number(2),
+ },
+})
diff --git a/packages/jsii-rosetta/test/translations/calls/translate_object_literals_with_multiple_newlines.go b/packages/jsii-rosetta/test/translations/calls/translate_object_literals_with_multiple_newlines.go
new file mode 100644
index 0000000000..7d84cb9b32
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/translate_object_literals_with_multiple_newlines.go
@@ -0,0 +1,5 @@
+foo(jsii.Number(25), map[string]interface{}{
+ "foo": jsii.Number(3),
+
+ "banana": jsii.String("hello"),
+})
diff --git a/packages/jsii-rosetta/test/translations/calls/translate_object_literals_with_newlines.go b/packages/jsii-rosetta/test/translations/calls/translate_object_literals_with_newlines.go
new file mode 100644
index 0000000000..9b4dfc4783
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/translate_object_literals_with_newlines.go
@@ -0,0 +1,4 @@
+foo(jsii.Number(25), map[string]interface{}{
+ "foo": jsii.Number(3),
+ "banana": jsii.String("hello"),
+})
diff --git a/packages/jsii-rosetta/test/translations/calls/will_type_deep_structs_directly_if_type_info_is_available.go b/packages/jsii-rosetta/test/translations/calls/will_type_deep_structs_directly_if_type_info_is_available.go
new file mode 100644
index 0000000000..db753ca420
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/calls/will_type_deep_structs_directly_if_type_info_is_available.go
@@ -0,0 +1,24 @@
+type baseDeeperStruct struct {
+ a *f64
+}
+
+type deeperStruct struct {
+ baseDeeperStruct
+ b *f64
+}
+
+type outerStruct struct {
+ foo *f64
+ deeper *deeperStruct
+}
+
+func foo(x *f64, outer *outerStruct) {
+}
+
+foo(jsii.Number(25), &outerStruct{
+ foo: jsii.Number(3),
+ deeper: &deeperStruct{
+ a: jsii.Number(1),
+ b: jsii.Number(2),
+ },
+})
diff --git a/packages/jsii-rosetta/test/translations/classes/class_declaration_with_private_fields_and_constructor.go b/packages/jsii-rosetta/test/translations/classes/class_declaration_with_private_fields_and_constructor.go
new file mode 100644
index 0000000000..a09e602d9b
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/classes/class_declaration_with_private_fields_and_constructor.go
@@ -0,0 +1,9 @@
+type myClass struct {
+ x *string
+}
+
+func newMyClass(y *string) *myClass {
+ this := &myClass{}
+ this.x = y
+ return this
+}
diff --git a/packages/jsii-rosetta/test/translations/classes/class_declaration_with_public_fields_and_constructor.go b/packages/jsii-rosetta/test/translations/classes/class_declaration_with_public_fields_and_constructor.go
new file mode 100644
index 0000000000..a09e602d9b
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/classes/class_declaration_with_public_fields_and_constructor.go
@@ -0,0 +1,9 @@
+type myClass struct {
+ x *string
+}
+
+func newMyClass(y *string) *myClass {
+ this := &myClass{}
+ this.x = y
+ return this
+}
diff --git a/packages/jsii-rosetta/test/translations/classes/class_implementing_jsii_interface.go b/packages/jsii-rosetta/test/translations/classes/class_implementing_jsii_interface.go
new file mode 100644
index 0000000000..c0b409f3a7
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/classes/class_implementing_jsii_interface.go
@@ -0,0 +1,6 @@
+type myClass struct {
+}
+
+func (this *myClass) resolve() interface{} {
+ return jsii.Number(42)
+}
diff --git a/packages/jsii-rosetta/test/translations/classes/class_with_different_name.go b/packages/jsii-rosetta/test/translations/classes/class_with_different_name.go
new file mode 100644
index 0000000000..a076a6b5c4
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/classes/class_with_different_name.go
@@ -0,0 +1,7 @@
+type otherName struct {
+}
+
+func newOtherName() *otherName {
+ this := &otherName{}
+ return this
+}
diff --git a/packages/jsii-rosetta/test/translations/classes/class_with_extends_and_implements.go b/packages/jsii-rosetta/test/translations/classes/class_with_extends_and_implements.go
new file mode 100644
index 0000000000..33f1217700
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/classes/class_with_extends_and_implements.go
@@ -0,0 +1,3 @@
+type myClass struct {
+ SomeOtherClass
+}
diff --git a/packages/jsii-rosetta/test/translations/classes/class_with_inheritance.go b/packages/jsii-rosetta/test/translations/classes/class_with_inheritance.go
new file mode 100644
index 0000000000..0a25bf8f16
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/classes/class_with_inheritance.go
@@ -0,0 +1,3 @@
+type myClass struct {
+ cdk.SomeOtherClass
+}
diff --git a/packages/jsii-rosetta/test/translations/classes/class_with_inheritance_and_super_class.go b/packages/jsii-rosetta/test/translations/classes/class_with_inheritance_and_super_class.go
new file mode 100644
index 0000000000..b588825926
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/classes/class_with_inheritance_and_super_class.go
@@ -0,0 +1,9 @@
+type myClass struct {
+ cdk.SomeOtherClass
+}
+
+func newMyClass(x *string, y *string) *myClass {
+ this := &myClass{}
+ cdk.NewSomeOtherClass_Override(this, x)
+ return this
+}
diff --git a/packages/jsii-rosetta/test/translations/classes/class_with_method.go b/packages/jsii-rosetta/test/translations/classes/class_with_method.go
new file mode 100644
index 0000000000..05248af6a7
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/classes/class_with_method.go
@@ -0,0 +1,7 @@
+type myClass struct {
+ cdk.SomeOtherClass
+}
+
+func (this *myClass) someMethod(x *string) {
+ fmt.Println(*x)
+}
diff --git a/packages/jsii-rosetta/test/translations/classes/class_with_props_argument.go b/packages/jsii-rosetta/test/translations/classes/class_with_props_argument.go
new file mode 100644
index 0000000000..7c6ba4fa2a
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/classes/class_with_props_argument.go
@@ -0,0 +1,16 @@
+type myClassProps struct {
+ prop1 *string
+ prop2 *f64
+}
+
+type myClass struct {
+ cdk.SomeOtherClass
+}
+
+func newMyClass(scope cdk.Construct, id *string, props myClassProps) *myClass {
+ this := &myClass{}
+ cdk.NewSomeOtherClass_Override(this, scope, id, props)
+
+ fmt.Println(*props.prop1)
+ return this
+}
diff --git a/packages/jsii-rosetta/test/translations/classes/class_with_props_argument.ts b/packages/jsii-rosetta/test/translations/classes/class_with_props_argument.ts
index adb8eee60c..46776b04ad 100644
--- a/packages/jsii-rosetta/test/translations/classes/class_with_props_argument.ts
+++ b/packages/jsii-rosetta/test/translations/classes/class_with_props_argument.ts
@@ -9,4 +9,4 @@ class MyClass extends cdk.SomeOtherClass {
console.log(props.prop1);
}
-}
\ No newline at end of file
+}
diff --git a/packages/jsii-rosetta/test/translations/classes/constructor_with_optional_params.go b/packages/jsii-rosetta/test/translations/classes/constructor_with_optional_params.go
new file mode 100644
index 0000000000..c8b12ce731
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/classes/constructor_with_optional_params.go
@@ -0,0 +1,10 @@
+type A struct {
+}
+
+func NewA(a *string, b *f64) *A {
+ if b == nil {
+ b = jsii.Number(3)
+ }
+ this := &A{}
+ return this
+}
diff --git a/packages/jsii-rosetta/test/translations/classes/empty_class.go b/packages/jsii-rosetta/test/translations/classes/empty_class.go
new file mode 100644
index 0000000000..72ba494869
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/classes/empty_class.go
@@ -0,0 +1,2 @@
+type empty_class struct {
+}
diff --git a/packages/jsii-rosetta/test/translations/classes/invisible_interfaces_do_not_affect_whitespace.go b/packages/jsii-rosetta/test/translations/classes/invisible_interfaces_do_not_affect_whitespace.go
new file mode 100644
index 0000000000..9c8db230be
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/classes/invisible_interfaces_do_not_affect_whitespace.go
@@ -0,0 +1,8 @@
+type myClass1 struct {
+}
+
+type thisWillNotBeRendered struct {
+}
+
+type myClass2 struct {
+}
diff --git a/packages/jsii-rosetta/test/translations/classes/whitespace_between_multiple_empty_members.go b/packages/jsii-rosetta/test/translations/classes/whitespace_between_multiple_empty_members.go
new file mode 100644
index 0000000000..a77b8fee99
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/classes/whitespace_between_multiple_empty_members.go
@@ -0,0 +1,12 @@
+type myClass struct {
+}
+
+func newMyClass(y *string) *myClass {
+ this := &myClass{}
+ this.x = *y
+ return this
+}
+
+func (this *myClass) hello() {}
+
+func (this *myClass) bye() {}
diff --git a/packages/jsii-rosetta/test/translations/classes/whitespace_between_multiple_members.go b/packages/jsii-rosetta/test/translations/classes/whitespace_between_multiple_members.go
new file mode 100644
index 0000000000..0e5d076954
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/classes/whitespace_between_multiple_members.go
@@ -0,0 +1,16 @@
+type myClass struct {
+}
+
+func newMyClass(y *string) *myClass {
+ this := &myClass{}
+ this.x = *y
+ return this
+}
+
+func (this *myClass) hello() {
+ fmt.Println(this.x)
+}
+
+func (this *myClass) bye() {
+ fmt.Println("bye")
+}
diff --git a/packages/jsii-rosetta/test/translations/comments/empty_lines_in_comments.go b/packages/jsii-rosetta/test/translations/comments/empty_lines_in_comments.go
new file mode 100644
index 0000000000..74b488b590
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/comments/empty_lines_in_comments.go
@@ -0,0 +1,4 @@
+// Here's a comment
+//
+// Second line
+someCall()
diff --git a/packages/jsii-rosetta/test/translations/comments/interleave_multiline_comments_with_function_call.go b/packages/jsii-rosetta/test/translations/comments/interleave_multiline_comments_with_function_call.go
new file mode 100644
index 0000000000..94e95c4b01
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/comments/interleave_multiline_comments_with_function_call.go
@@ -0,0 +1,7 @@
+someFunction(arg1, map[string]*string{
+ /* A comment before arg2 */
+ "arg2": jsii.String("string"),
+
+ /* A comment before arg3 */
+ "arg3": jsii.String("boo"),
+})
diff --git a/packages/jsii-rosetta/test/translations/comments/interleave_single_line_comments_with_function_call.go b/packages/jsii-rosetta/test/translations/comments/interleave_single_line_comments_with_function_call.go
new file mode 100644
index 0000000000..13801f3f3b
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/comments/interleave_single_line_comments_with_function_call.go
@@ -0,0 +1,7 @@
+someFunction(arg1, map[string]*string{
+ // A comment before arg2
+ "arg2": jsii.String("string"),
+
+ // A comment before arg3
+ "arg3": jsii.String("boo"),
+})
diff --git a/packages/jsii-rosetta/test/translations/comments/no_duplication_of_comments.go b/packages/jsii-rosetta/test/translations/comments/no_duplication_of_comments.go
new file mode 100644
index 0000000000..b8e366c5e3
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/comments/no_duplication_of_comments.go
@@ -0,0 +1,2 @@
+// Here's a comment
+object.member.functionCall(NewClass(), jsii.String("argument"))
diff --git a/packages/jsii-rosetta/test/translations/expressions/array_index.go b/packages/jsii-rosetta/test/translations/expressions/array_index.go
new file mode 100644
index 0000000000..15f9c58171
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/expressions/array_index.go
@@ -0,0 +1,3 @@
+var array []*string
+
+fmt.Println(array[3])
diff --git a/packages/jsii-rosetta/test/translations/expressions/as_expression.go b/packages/jsii-rosetta/test/translations/expressions/as_expression.go
new file mode 100644
index 0000000000..e91991ed2b
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/expressions/as_expression.go
@@ -0,0 +1 @@
+fmt.Println(f64(3))
diff --git a/packages/jsii-rosetta/test/translations/expressions/backtick_string_w_o_substitutions.go b/packages/jsii-rosetta/test/translations/expressions/backtick_string_w_o_substitutions.go
new file mode 100644
index 0000000000..178b109254
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/expressions/backtick_string_w_o_substitutions.go
@@ -0,0 +1 @@
+x := "some string"
diff --git a/packages/jsii-rosetta/test/translations/expressions/computed_key.go b/packages/jsii-rosetta/test/translations/expressions/computed_key.go
new file mode 100644
index 0000000000..e4daa4a249
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/expressions/computed_key.go
@@ -0,0 +1,8 @@
+y := "WHY?"
+
+x := map[string]*string{
+ fmt.Sprintf("key-%v", y): jsii.String("value"),
+}
+z := map[string]*bool{
+ y: jsii.Boolean(true),
+}
diff --git a/packages/jsii-rosetta/test/translations/expressions/double_quoted_dict_keys.go b/packages/jsii-rosetta/test/translations/expressions/double_quoted_dict_keys.go
new file mode 100644
index 0000000000..0d90bda32a
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/expressions/double_quoted_dict_keys.go
@@ -0,0 +1,3 @@
+x := map[string]*string{
+ "key": jsii.String("value"),
+}
diff --git a/packages/jsii-rosetta/test/translations/expressions/ellipsis_at_a_random_place.go b/packages/jsii-rosetta/test/translations/expressions/ellipsis_at_a_random_place.go
new file mode 100644
index 0000000000..4b7e236c8b
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/expressions/ellipsis_at_a_random_place.go
@@ -0,0 +1 @@
+callThisFunction(foo, ...)
diff --git a/packages/jsii-rosetta/test/translations/expressions/enum_access.go b/packages/jsii-rosetta/test/translations/expressions/enum_access.go
new file mode 100644
index 0000000000..916795d58b
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/expressions/enum_access.go
@@ -0,0 +1 @@
+fmt.Println(enumType_ENUM_VALUE_A)
diff --git a/packages/jsii-rosetta/test/translations/expressions/enum_like_access.go b/packages/jsii-rosetta/test/translations/expressions/enum_like_access.go
new file mode 100644
index 0000000000..8d71dd657d
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/expressions/enum_like_access.go
@@ -0,0 +1 @@
+fmt.Println(enumType_ENUM_VALUE_A())
diff --git a/packages/jsii-rosetta/test/translations/expressions/non_null_expression.go b/packages/jsii-rosetta/test/translations/expressions/non_null_expression.go
new file mode 100644
index 0000000000..29cbc07c3c
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/expressions/non_null_expression.go
@@ -0,0 +1 @@
+x := someObject.someAttribute
diff --git a/packages/jsii-rosetta/test/translations/expressions/string_interpolation.go b/packages/jsii-rosetta/test/translations/expressions/string_interpolation.go
new file mode 100644
index 0000000000..6a043f864e
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/expressions/string_interpolation.go
@@ -0,0 +1,6 @@
+x := "world"
+y := "well"
+fmt.Println(fmt.Sprintf("Hello, %v, it works %v!", x, y))
+
+// And now a multi-line expression
+fmt.Println(fmt.Sprintf("\nHello, %v.\n\nIt works %v!\n", x, y))
diff --git a/packages/jsii-rosetta/test/translations/expressions/string_literal.go b/packages/jsii-rosetta/test/translations/expressions/string_literal.go
new file mode 100644
index 0000000000..4ff71f0a21
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/expressions/string_literal.go
@@ -0,0 +1 @@
+literal := "\nThis si a multiline string literal.\n\n\"It's cool!\".\n\nYEAH BABY!!\n\nLitteral \\n right here (not a newline!)\n"
diff --git a/packages/jsii-rosetta/test/translations/expressions/struct_assignment.go b/packages/jsii-rosetta/test/translations/expressions/struct_assignment.go
new file mode 100644
index 0000000000..4d33c88c93
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/expressions/struct_assignment.go
@@ -0,0 +1,7 @@
+type test struct {
+ key *string
+}
+
+x := &test{
+ key: jsii.String("value"),
+}
diff --git a/packages/jsii-rosetta/test/translations/expressions/unary_and_binary_operators.go b/packages/jsii-rosetta/test/translations/expressions/unary_and_binary_operators.go
new file mode 100644
index 0000000000..c253f46f6e
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/expressions/unary_and_binary_operators.go
@@ -0,0 +1,3 @@
+fmt.Println(-3)
+fmt.Println(!false)
+fmt.Println(a == b)
diff --git a/packages/jsii-rosetta/test/translations/hiding/hide_block_level_statements_using_void_directive.go b/packages/jsii-rosetta/test/translations/hiding/hide_block_level_statements_using_void_directive.go
new file mode 100644
index 0000000000..938976459b
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/hiding/hide_block_level_statements_using_void_directive.go
@@ -0,0 +1,5 @@
+if true {
+ fmt.Println("everything is well")
+}
+
+onlyToEndOfBlock()
diff --git a/packages/jsii-rosetta/test/translations/hiding/hide_expression_with_explicit_ellipsis.go b/packages/jsii-rosetta/test/translations/hiding/hide_expression_with_explicit_ellipsis.go
new file mode 100644
index 0000000000..3669c7f18a
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/hiding/hide_expression_with_explicit_ellipsis.go
@@ -0,0 +1 @@
+foo(jsii.Number(3), ...)
diff --git a/packages/jsii-rosetta/test/translations/hiding/hide_halfway_into_class_using_comments.go b/packages/jsii-rosetta/test/translations/hiding/hide_halfway_into_class_using_comments.go
new file mode 100644
index 0000000000..47badc62f0
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/hiding/hide_halfway_into_class_using_comments.go
@@ -0,0 +1,3 @@
+prepare()
+
+fmt.Println(this, "it seems to work")
diff --git a/packages/jsii-rosetta/test/translations/hiding/hide_parameter_sequence.go b/packages/jsii-rosetta/test/translations/hiding/hide_parameter_sequence.go
new file mode 100644
index 0000000000..39e87f0f68
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/hiding/hide_parameter_sequence.go
@@ -0,0 +1 @@
+foo(jsii.Number(3), jsii.Number(8))
diff --git a/packages/jsii-rosetta/test/translations/hiding/hide_statements_with_explicit_ellipsis.go b/packages/jsii-rosetta/test/translations/hiding/hide_statements_with_explicit_ellipsis.go
new file mode 100644
index 0000000000..573506acb4
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/hiding/hide_statements_with_explicit_ellipsis.go
@@ -0,0 +1,3 @@
+before()
+// ...
+after()
diff --git a/packages/jsii-rosetta/test/translations/hiding/hide_top_level_statements_using_void_directive.go b/packages/jsii-rosetta/test/translations/hiding/hide_top_level_statements_using_void_directive.go
new file mode 100644
index 0000000000..0235f9c22b
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/hiding/hide_top_level_statements_using_void_directive.go
@@ -0,0 +1 @@
+foo(jsii.Number(3))
diff --git a/packages/jsii-rosetta/test/translations/identifiers/keyword.go b/packages/jsii-rosetta/test/translations/identifiers/keyword.go
new file mode 100644
index 0000000000..ae93a6b066
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/identifiers/keyword.go
@@ -0,0 +1,4 @@
+import lambda "github.com/aws-samples/dummy/scopeawslambda"
+lambda.NewClassFromLambda(map[string]*string{
+ "key": jsii.String("lambda.amazonaws.com"),
+})
diff --git a/packages/jsii-rosetta/test/translations/imports/import_require.go b/packages/jsii-rosetta/test/translations/imports/import_require.go
new file mode 100644
index 0000000000..bd49c61d0f
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/imports/import_require.go
@@ -0,0 +1,2 @@
+import mod "github.com/aws-samples/dummy/scopesomemodule"
+mod.NewClassFromModule()
diff --git a/packages/jsii-rosetta/test/translations/imports/import_star_as.go b/packages/jsii-rosetta/test/translations/imports/import_star_as.go
new file mode 100644
index 0000000000..bd49c61d0f
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/imports/import_star_as.go
@@ -0,0 +1,2 @@
+import mod "github.com/aws-samples/dummy/scopesomemodule"
+mod.NewClassFromModule()
diff --git a/packages/jsii-rosetta/test/translations/interfaces/interface_with_method.go b/packages/jsii-rosetta/test/translations/interfaces/interface_with_method.go
new file mode 100644
index 0000000000..ee948fc654
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/interfaces/interface_with_method.go
@@ -0,0 +1,3 @@
+type iThing interface {
+ doAThing()
+}
diff --git a/packages/jsii-rosetta/test/translations/interfaces/interface_with_props.go b/packages/jsii-rosetta/test/translations/interfaces/interface_with_props.go
new file mode 100644
index 0000000000..7c3dce8ddb
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/interfaces/interface_with_props.go
@@ -0,0 +1,3 @@
+type iThing interface {
+ thingArn() *string
+}
diff --git a/packages/jsii-rosetta/test/translations/misc/booleans_render_to_right_primitives.go b/packages/jsii-rosetta/test/translations/misc/booleans_render_to_right_primitives.go
new file mode 100644
index 0000000000..7ab966d826
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/misc/booleans_render_to_right_primitives.go
@@ -0,0 +1 @@
+callFunction(jsii.Boolean(true), jsii.Boolean(false))
diff --git a/packages/jsii-rosetta/test/translations/statements/block_without_braces.go b/packages/jsii-rosetta/test/translations/statements/block_without_braces.go
new file mode 100644
index 0000000000..3f5cb9e094
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/statements/block_without_braces.go
@@ -0,0 +1,3 @@
+if x == 3 {
+ fmt.Println("hello")
+}
diff --git a/packages/jsii-rosetta/test/translations/statements/declare_var.go b/packages/jsii-rosetta/test/translations/statements/declare_var.go
new file mode 100644
index 0000000000..b23e0a55c0
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/statements/declare_var.go
@@ -0,0 +1 @@
+var variable Type
diff --git a/packages/jsii-rosetta/test/translations/statements/empty_control_block.go b/packages/jsii-rosetta/test/translations/statements/empty_control_block.go
new file mode 100644
index 0000000000..3ae67d5215
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/statements/empty_control_block.go
@@ -0,0 +1 @@
+if x == 3 {}
diff --git a/packages/jsii-rosetta/test/translations/statements/for_of_loop.go b/packages/jsii-rosetta/test/translations/statements/for_of_loop.go
new file mode 100644
index 0000000000..8db0d3f2bd
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/statements/for_of_loop.go
@@ -0,0 +1,3 @@
+for _, x := range xs {
+ fmt.Println(x)
+}
diff --git a/packages/jsii-rosetta/test/translations/statements/if.go b/packages/jsii-rosetta/test/translations/statements/if.go
new file mode 100644
index 0000000000..f9d5d292e7
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/statements/if.go
@@ -0,0 +1,3 @@
+if x == 3 {
+ fmt.Println("bye")
+}
diff --git a/packages/jsii-rosetta/test/translations/statements/if_then_else.go b/packages/jsii-rosetta/test/translations/statements/if_then_else.go
new file mode 100644
index 0000000000..688c0e50c1
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/statements/if_then_else.go
@@ -0,0 +1,5 @@
+if x == 3 {
+ fmt.Println("bye")
+} else {
+ fmt.Println("toodels")
+}
diff --git a/packages/jsii-rosetta/test/translations/statements/initialize_object_literal.go b/packages/jsii-rosetta/test/translations/statements/initialize_object_literal.go
new file mode 100644
index 0000000000..6bb1a286d8
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/statements/initialize_object_literal.go
@@ -0,0 +1,8 @@
+expected := map[string]interface{}{
+ "Foo": jsii.String("Bar"),
+ "Baz": jsii.Number(5),
+ "Qux": []*string{
+ jsii.String("Waldo"),
+ jsii.String("Fred"),
+ },
+}
diff --git a/packages/jsii-rosetta/test/translations/statements/multiline_if_then_else.go b/packages/jsii-rosetta/test/translations/statements/multiline_if_then_else.go
new file mode 100644
index 0000000000..24bd5d7a14
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/statements/multiline_if_then_else.go
@@ -0,0 +1,6 @@
+if x == 3 {
+ x += 1
+ fmt.Println("bye")
+} else {
+ fmt.Println("toodels")
+}
diff --git a/packages/jsii-rosetta/test/translations/statements/statements_and_newlines.go b/packages/jsii-rosetta/test/translations/statements/statements_and_newlines.go
new file mode 100644
index 0000000000..149cbc2fb1
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/statements/statements_and_newlines.go
@@ -0,0 +1,21 @@
+func doThing() *f64 {
+ x := 1 // x seems to be equal to 1
+ return jsii.Number(x + 1)
+}
+
+func doThing2(x *f64) *bool {
+ if *x == 1 {
+ return jsii.Boolean(true)
+ }
+ return jsii.Boolean(false)
+}
+
+func doThing3() *f64 {
+ x := 1
+ return jsii.Number(x + 1)
+}
+
+func doThing4() {
+ x := 1
+ x = 85
+}
diff --git a/packages/jsii-rosetta/test/translations/statements/vararg_any_call.go b/packages/jsii-rosetta/test/translations/statements/vararg_any_call.go
new file mode 100644
index 0000000000..82e686a321
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/statements/vararg_any_call.go
@@ -0,0 +1,13 @@
+func test(..._args interface{}) {
+}
+
+test(map[string]interface{}{
+ "Key": jsii.String("Value"),
+ "also": jsii.Number(1337),
+})
+
+test(map[string]*string{
+ "Key": jsii.String("Value"),
+}, map[string]*f64{
+ "also": jsii.Number(1337),
+})
diff --git a/packages/jsii-rosetta/test/translations/statements/whitespace_between_statements.go b/packages/jsii-rosetta/test/translations/statements/whitespace_between_statements.go
new file mode 100644
index 0000000000..c852abe45e
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/statements/whitespace_between_statements.go
@@ -0,0 +1,3 @@
+statementOne()
+
+statementTwo()
diff --git a/packages/jsii-rosetta/test/translations/statements/whitespace_between_statements_in_a_block.go b/packages/jsii-rosetta/test/translations/statements/whitespace_between_statements_in_a_block.go
new file mode 100644
index 0000000000..07f1ce9d66
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/statements/whitespace_between_statements_in_a_block.go
@@ -0,0 +1,5 @@
+if condition {
+ statementOne()
+
+ statementTwo()
+}
diff --git a/packages/jsii-rosetta/test/translations/structs/any_type_never_a_struct.go b/packages/jsii-rosetta/test/translations/structs/any_type_never_a_struct.go
new file mode 100644
index 0000000000..be53502f49
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/structs/any_type_never_a_struct.go
@@ -0,0 +1,3 @@
+functionThatTakesAnAny(map[string]*f64{
+ "argument": jsii.Number(5),
+})
diff --git a/packages/jsii-rosetta/test/translations/structs/infer_struct_from_union.go b/packages/jsii-rosetta/test/translations/structs/infer_struct_from_union.go
new file mode 100644
index 0000000000..890a35ba1c
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/structs/infer_struct_from_union.go
@@ -0,0 +1,8 @@
+takes(&myProps{
+ struct_: &someStruct{
+ enabled: jsii.Boolean(false),
+ option: jsii.String("option"),
+ },
+})
+
+
diff --git a/packages/jsii-rosetta/test/translations/structs/optional_known_struct.go b/packages/jsii-rosetta/test/translations/structs/optional_known_struct.go
new file mode 100644
index 0000000000..d2260cdfa3
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/structs/optional_known_struct.go
@@ -0,0 +1,3 @@
+NewVpc(this, jsii.String("Something"), &vpcProps{
+ argument: jsii.Number(5),
+})
diff --git a/packages/jsii-rosetta/test/translations/structs/struct_starting_with_i.go b/packages/jsii-rosetta/test/translations/structs/struct_starting_with_i.go
new file mode 100644
index 0000000000..9a74d11250
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/structs/struct_starting_with_i.go
@@ -0,0 +1,3 @@
+NewIntegration(this, jsii.String("Something"), &integrationOptions{
+ argument: jsii.Number(5),
+})
diff --git a/packages/jsii-rosetta/test/translations/structs/var_new_class_known_struct.go b/packages/jsii-rosetta/test/translations/structs/var_new_class_known_struct.go
new file mode 100644
index 0000000000..b1fa2fbdf2
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/structs/var_new_class_known_struct.go
@@ -0,0 +1,3 @@
+vpc := NewVpc(this, jsii.String("Something"), &vpcProps{
+ argument: jsii.Number(5),
+})
diff --git a/packages/jsii-rosetta/test/translations/structs/var_new_class_unknown_struct.go b/packages/jsii-rosetta/test/translations/structs/var_new_class_unknown_struct.go
new file mode 100644
index 0000000000..3f0a85cd52
--- /dev/null
+++ b/packages/jsii-rosetta/test/translations/structs/var_new_class_unknown_struct.go
@@ -0,0 +1,3 @@
+vpc := NewVpc(this, jsii.String("Something"), map[string]*f64{
+ "argument": jsii.Number(5),
+})
diff --git a/packages/jsii/lib/compiler.ts b/packages/jsii/lib/compiler.ts
index 9259ec16c6..9b2447312b 100644
--- a/packages/jsii/lib/compiler.ts
+++ b/packages/jsii/lib/compiler.ts
@@ -156,6 +156,10 @@ export class Compiler implements Emitter {
);
}
const orig = host.afterProgramCreate;
+ // This is a callback cascade, so it's "okay" to return an unhandled promise there. This may
+ // cause an unhandled promise rejection warning, but that's not a big deal.
+ //
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
host.afterProgramCreate = async (builderProgram) => {
const emitResult = await this._consumeProgram(
builderProgram.getProgram(),
diff --git a/packages/jsii/package.json b/packages/jsii/package.json
index a56f637b1e..acbcdee706 100644
--- a/packages/jsii/package.json
+++ b/packages/jsii/package.json
@@ -44,7 +44,7 @@
"log4js": "^6.4.1",
"semver": "^7.3.5",
"semver-intersect": "^1.4.0",
- "sort-json": "^2.0.0",
+ "sort-json": "^2.0.1",
"spdx-license-list": "^6.4.0",
"typescript": "~3.9.10",
"yargs": "^16.2.0"
@@ -53,11 +53,11 @@
"@types/clone": "^2.1.1",
"@types/deep-equal": "^1.0.1",
"@types/fs-extra": "^9.0.13",
- "@types/jest": "^27.4.0",
- "@types/node": "^12.20.43",
+ "@types/jest": "^27.4.1",
+ "@types/node": "^12.20.46",
"@types/semver": "^7.3.9",
"clone": "^2.1.2",
- "eslint": "^8.8.0",
+ "eslint": "^8.10.0",
"jest": "^27.5.1",
"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 061ea6f228..450f4c0ab9 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": "^27.4.0",
- "@types/node": "^12.20.43",
- "eslint": "^8.8.0",
+ "@types/jest": "^27.4.1",
+ "@types/node": "^12.20.46",
+ "eslint": "^8.10.0",
"jest": "^27.5.1",
"jsii-build-tools": "^0.0.0",
"prettier": "^2.5.1",
diff --git a/superchain/Dockerfile b/superchain/Dockerfile
index f087b55d4f..99e261a7c7 100644
--- a/superchain/Dockerfile
+++ b/superchain/Dockerfile
@@ -206,6 +206,10 @@ RUN apt-key add /tmp/nodesource.asc && rm /tmp/nodesource.asc
&& apt-get -y install nodejs yarn \
&& rm -rf /var/lib/apt/lists/*
+# Install SAM CLI
+RUN pip install aws-sam-cli \
+ && sam --version
+
# Install some configuration
COPY superchain/ssh_config /root/.ssh/config
RUN chmod 600 /root/.ssh/config
diff --git a/superchain/README.md b/superchain/README.md
index e254208469..93e386bb08 100644
--- a/superchain/README.md
+++ b/superchain/README.md
@@ -81,6 +81,7 @@ Tool / Utility | Version
`yarn` | `>= 1.21.1`
`zip` & `unzip`| `>= 6.0-19`
`gh` | `>= 1.9.2`
+`sam` | `>= 1.37.0`
## License
diff --git a/tools/jsii-compliance/package.json b/tools/jsii-compliance/package.json
index 23e502e681..a5354eb8b6 100644
--- a/tools/jsii-compliance/package.json
+++ b/tools/jsii-compliance/package.json
@@ -16,10 +16,10 @@
"tablemark": "^2.0.0"
},
"devDependencies": {
- "@types/node": "^12.20.43",
- "eslint": "^8.8.0",
+ "@types/node": "^12.20.46",
+ "eslint": "^8.10.0",
"prettier": "^2.5.1",
- "ts-node": "^10.5.0",
+ "ts-node": "^10.6.0",
"typescript": "~3.9.10"
}
}
diff --git a/tools/jsii-compliance/suite.ts b/tools/jsii-compliance/suite.ts
index d32d9b849a..7616aa1206 100644
--- a/tools/jsii-compliance/suite.ts
+++ b/tools/jsii-compliance/suite.ts
@@ -509,11 +509,12 @@ export const suite: schema.Suite = {
},
{
name: 'classCanBeUsedWhenNotExpressedlyLoaded',
- description: 'Validates that types not explicitly loaded by the user can safely be returned by JS code',
+ description:
+ 'Validates that types not explicitly loaded by the user can safely be returned by JS code',
},
{
name: 'downcasting',
description: 'Ensures unsafe-cast features work as expected',
- }
+ },
],
};
diff --git a/yarn.lock b/yarn.lock
index 142bb01aa4..af3405d008 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,10 +2,10 @@
# yarn lockfile v1
-"@ampproject/remapping@^2.0.0":
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.1.0.tgz#72becdf17ee44b2d1ac5651fb12f1952c336fe23"
- integrity sha512-d5RysTlJ7hmw5Tw4UxgxcY3lkMe92n8sXCcuLPAyIAHK6j8DefDwtGnVVDgOnv+RnEosulDJ9NPKQL27bDId0g==
+"@ampproject/remapping@^2.1.0":
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.1.2.tgz#4edca94973ded9630d20101cd8559cedb8d8bd34"
+ integrity sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg==
dependencies:
"@jridgewell/trace-mapping" "^0.3.0"
@@ -22,19 +22,19 @@
integrity sha512-392byTlpGWXMv4FbyWw3sAZ/FrW/DrwqLGXpy0mbyNe9Taqv1mg9yON5/o0cnr8XYCkFTZbC1eV+c+LAROgrng==
"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0":
- version "7.17.2"
- resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.2.tgz#2c77fc430e95139d816d39b113b31bf40fb22337"
- integrity sha512-R3VH5G42VSDolRHyUO4V2cfag8WHcZyxdq5Z/m8Xyb92lW/Erm/6kM+XtRFGf3Mulre3mveni2NHfEUws8wSvw==
+ version "7.17.5"
+ resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.5.tgz#6cd2e836058c28f06a4ca8ee7ed955bbf37c8225"
+ integrity sha512-/BBMw4EvjmyquN5O+t5eh0+YqB3XXJkYD2cjKpYtWOfFy4lQ4UozNSmxAcWT8r2XtZs0ewG+zrfsqeR15i1ajA==
dependencies:
- "@ampproject/remapping" "^2.0.0"
+ "@ampproject/remapping" "^2.1.0"
"@babel/code-frame" "^7.16.7"
- "@babel/generator" "^7.17.0"
+ "@babel/generator" "^7.17.3"
"@babel/helper-compilation-targets" "^7.16.7"
"@babel/helper-module-transforms" "^7.16.7"
"@babel/helpers" "^7.17.2"
- "@babel/parser" "^7.17.0"
+ "@babel/parser" "^7.17.3"
"@babel/template" "^7.16.7"
- "@babel/traverse" "^7.17.0"
+ "@babel/traverse" "^7.17.3"
"@babel/types" "^7.17.0"
convert-source-map "^1.7.0"
debug "^4.1.0"
@@ -42,10 +42,10 @@
json5 "^2.1.2"
semver "^6.3.0"
-"@babel/generator@^7.17.0", "@babel/generator@^7.7.2":
- version "7.17.0"
- resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.0.tgz#7bd890ba706cd86d3e2f727322346ffdbf98f65e"
- integrity sha512-I3Omiv6FGOC29dtlZhkfXO6pgkmukJSlT26QjVvS1DGZe/NzSVCPG41X0tS21oZkJYlovfj9qDWgKP+Cn4bXxw==
+"@babel/generator@^7.17.3", "@babel/generator@^7.7.2":
+ version "7.17.3"
+ resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.3.tgz#a2c30b0c4f89858cb87050c3ffdfd36bdf443200"
+ integrity sha512-+R6Dctil/MgUsZsZAkYgK+ADNSZzJRRy0TvY65T71z/CR854xHQ1EweBYXdfT+HNeN7w0cSJJEzgxZMv40pxsg==
dependencies:
"@babel/types" "^7.17.0"
jsesc "^2.5.1"
@@ -99,9 +99,9 @@
"@babel/types" "^7.16.7"
"@babel/helper-module-transforms@^7.16.7":
- version "7.16.7"
- resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz#7665faeb721a01ca5327ddc6bba15a5cb34b6a41"
- integrity sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==
+ version "7.17.6"
+ resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.17.6.tgz#3c3b03cc6617e33d68ef5a27a67419ac5199ccd0"
+ integrity sha512-2ULmRdqoOMpdvkbT8jONrZML/XALfzxlb052bldftkicAUy8AxSCkD5trDPQcwHNmolcl7wP6ehNqMlyUw6AaA==
dependencies:
"@babel/helper-environment-visitor" "^7.16.7"
"@babel/helper-module-imports" "^7.16.7"
@@ -109,8 +109,8 @@
"@babel/helper-split-export-declaration" "^7.16.7"
"@babel/helper-validator-identifier" "^7.16.7"
"@babel/template" "^7.16.7"
- "@babel/traverse" "^7.16.7"
- "@babel/types" "^7.16.7"
+ "@babel/traverse" "^7.17.3"
+ "@babel/types" "^7.17.0"
"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.8.0":
version "7.16.7"
@@ -159,10 +159,10 @@
chalk "^2.0.0"
js-tokens "^4.0.0"
-"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.0":
- version "7.17.0"
- resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.0.tgz#f0ac33eddbe214e4105363bb17c3341c5ffcc43c"
- integrity sha512-VKXSCQx5D8S04ej+Dqsr1CzYvvWgf20jIw2D+YhQCrIlr2UZGaDds23Y0xg75/skOxpLCRpUZvk/1EAVkGoDOw==
+"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3":
+ version "7.17.3"
+ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.3.tgz#b07702b982990bf6fdc1da5049a23fece4c5c3d0"
+ integrity sha512-7yJPvPV+ESz2IUTPbOL+YkIGyCqOyNIzdguKQuJGnH7bg1WTIifuM21YqokFt/THWh1AkCRn9IgoykTRCBVpzA==
"@babel/plugin-syntax-async-generators@^7.8.4":
version "7.8.4"
@@ -271,18 +271,18 @@
"@babel/parser" "^7.16.7"
"@babel/types" "^7.16.7"
-"@babel/traverse@^7.16.7", "@babel/traverse@^7.17.0", "@babel/traverse@^7.7.2":
- version "7.17.0"
- resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.0.tgz#3143e5066796408ccc880a33ecd3184f3e75cd30"
- integrity sha512-fpFIXvqD6kC7c7PUNnZ0Z8cQXlarCLtCUpt2S1Dx7PjoRtCFffvOkHHSom+m5HIxMZn5bIBVb71lhabcmjEsqg==
+"@babel/traverse@^7.17.0", "@babel/traverse@^7.17.3", "@babel/traverse@^7.7.2":
+ version "7.17.3"
+ resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.3.tgz#0ae0f15b27d9a92ba1f2263358ea7c4e7db47b57"
+ integrity sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==
dependencies:
"@babel/code-frame" "^7.16.7"
- "@babel/generator" "^7.17.0"
+ "@babel/generator" "^7.17.3"
"@babel/helper-environment-visitor" "^7.16.7"
"@babel/helper-function-name" "^7.16.7"
"@babel/helper-hoist-variables" "^7.16.7"
"@babel/helper-split-export-declaration" "^7.16.7"
- "@babel/parser" "^7.17.0"
+ "@babel/parser" "^7.17.3"
"@babel/types" "^7.17.0"
debug "^4.1.0"
globals "^11.1.0"
@@ -317,14 +317,14 @@
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz#d5e0706cf8c6acd8c6032f8d54070af261bbbb2f"
integrity sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA==
-"@eslint/eslintrc@^1.0.5":
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318"
- integrity sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==
+"@eslint/eslintrc@^1.2.0":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.0.tgz#7ce1547a5c46dfe56e1e45c3c9ed18038c721c6a"
+ integrity sha512-igm9SjJHNEJRiUnecP/1R5T3wKLEJ7pL6e2P+GUSfCd0dGjPYYZve08uzw8L2J8foVHFz+NGu12JxRcU2gGo6w==
dependencies:
ajv "^6.12.4"
debug "^4.3.2"
- espree "^9.2.0"
+ espree "^9.3.1"
globals "^13.9.0"
ignore "^4.0.6"
import-fresh "^3.2.1"
@@ -336,14 +336,14 @@
version "0.19.0"
"@gar/promisify@^1.0.1":
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.2.tgz#30aa825f11d438671d585bd44e7fd564535fc210"
- integrity sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw==
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6"
+ integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==
"@humanwhocodes/config-array@^0.9.2":
- version "0.9.3"
- resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.3.tgz#f2564c744b387775b436418491f15fce6601f63e"
- integrity sha512-3xSMlXHh03hCcCmFc0rbKp3Ivt2PFEJnQUJDDMTJQ2wkECZWdq4GePs2ctc5H8zV+cHPaq8k2vU8mrQjA6iHdQ==
+ version "0.9.5"
+ resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7"
+ integrity sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==
dependencies:
"@humanwhocodes/object-schema" "^1.2.1"
debug "^4.1.1"
@@ -545,14 +545,14 @@
chalk "^4.0.0"
"@jridgewell/resolve-uri@^3.0.3":
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.4.tgz#b876e3feefb9c8d3aa84014da28b5e52a0640d72"
- integrity sha512-cz8HFjOFfUBtvN+NXYSFMHYRdxZMaEl0XypVrhzxBgadKIXhIkRd8aMeHhmF56Sl7SuS8OnUpQ73/k9LE4VnLg==
+ version "3.0.5"
+ resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz#68eb521368db76d040a6315cdb24bf2483037b9c"
+ integrity sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==
"@jridgewell/sourcemap-codec@^1.4.10":
- version "1.4.10"
- resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.10.tgz#baf57b4e2a690d4f38560171f91783656b7f8186"
- integrity sha512-Ht8wIW5v165atIX1p+JvKR5ONzUyF4Ac8DZIQ5kZs9zrb6M8SJNXpx1zn04rn65VjBMygRoMXcyYwNK0fT7bEg==
+ version "1.4.11"
+ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz#771a1d8d744eeb71b6adb35808e1a6c7b9b8c8ec"
+ integrity sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==
"@jridgewell/trace-mapping@^0.3.0":
version "0.3.4"
@@ -1260,9 +1260,9 @@
integrity sha512-3BGrt6FLjqM6br5AhWRKTr3u5GIVkjRYeAFrMp3HjnfICrg4xOrVRwFavKT6tsp++bq5dluL5t8ME/Nha/6c1Q==
"@npmcli/fs@^1.0.0":
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-1.1.0.tgz#bec1d1b89c170d40e1b73ad6c943b0b75e7d2951"
- integrity sha512-VhP1qZLXcrXRIaPoqb4YA55JQxLNF3jNR4T55IdOJa3+IFJKNYHtPvtXx8slmeMavj37vCzCfrqQM1vWLsYKLA==
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-1.1.1.tgz#72f719fe935e687c56a4faecf3c03d06ba593257"
+ integrity sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==
dependencies:
"@gar/promisify" "^1.0.1"
semver "^7.3.5"
@@ -1526,7 +1526,7 @@
dependencies:
dotenv "*"
-"@types/eslint-scope@^3.7.0":
+"@types/eslint-scope@^3.7.3":
version "3.7.3"
resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.3.tgz#125b88504b61e3c8bc6f870882003253005c3224"
integrity sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==
@@ -1542,16 +1542,11 @@
"@types/estree" "*"
"@types/json-schema" "*"
-"@types/estree@*":
+"@types/estree@*", "@types/estree@^0.0.51":
version "0.0.51"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40"
integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==
-"@types/estree@^0.0.50":
- version "0.0.50"
- resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83"
- integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==
-
"@types/fs-extra@^9.0.13":
version "9.0.13"
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-9.0.13.tgz#7594fbae04fe7f1918ce8b3d213f74ff44ac1f45"
@@ -1593,12 +1588,12 @@
dependencies:
"@types/istanbul-lib-report" "*"
-"@types/jest@^27.4.0":
- version "27.4.0"
- resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.4.0.tgz#037ab8b872067cae842a320841693080f9cb84ed"
- integrity sha512-gHl8XuC1RZ8H2j5sHv/JqsaxXkDDM9iDOgu0Wp8sjs4u/snb2PVehyWXJPr+ORA0RPpgw231mnutWI1+0hgjIQ==
+"@types/jest@^27.4.1":
+ version "27.4.1"
+ resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.4.1.tgz#185cbe2926eaaf9662d340cc02e548ce9e11ab6d"
+ integrity sha512-23iPJADSmicDVrWk+HT58LMJtzLAnB2AgIzplQuq/bSrGaxCrlvRFjGbXmamnnk/mAmCdLStiGqggu28ocUyiw==
dependencies:
- jest-diff "^27.0.0"
+ jest-matcher-utils "^27.0.0"
pretty-format "^27.0.0"
"@types/json-schema@*", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9":
@@ -1636,19 +1631,19 @@
"@types/node" "*"
"@types/node@*":
- version "17.0.16"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.16.tgz#e3733f46797b9df9e853ca9f719c8a6f7b84cd26"
- integrity sha512-ydLaGVfQOQ6hI1xK2A5nVh8bl0OGoIfYMxPWHqqYe9bTkWCfqiVvZoh2I/QF2sNSkZzZyROBoTefIEI+PB6iIA==
+ version "17.0.21"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.21.tgz#864b987c0c68d07b4345845c3e63b75edd143644"
+ integrity sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==
-"@types/node@^12.20.43":
- version "12.20.43"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.43.tgz#6cf47894da4a4748c62fccf720ba269e1b1ff5a4"
- integrity sha512-HCfJdaYqJX3BCzeihgZrD7b85Cu05OC/GVJ4kEYIflwUs4jbnUlLLWoq7hw1LBcdvUyehO+gr6P5JQ895/2ZfA==
+"@types/node@^12.20.46":
+ version "12.20.46"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.46.tgz#7e49dee4c54fd19584e6a9e0da5f3dc2e9136bc7"
+ integrity sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==
"@types/node@^16.9.2":
- version "16.11.22"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.22.tgz#e704150225bfc4195f8ce68a7ac8da02b753549a"
- integrity sha512-DYNtJWauMQ9RNpesl4aVothr97/tIJM8HbyOXJ0AYT1Z2bEjLHyfjOBPAQQVMLf8h3kSShYfNk8Wnto8B2zHUA==
+ version "16.11.26"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.26.tgz#63d204d136c9916fb4dcd1b50f9740fe86884e47"
+ integrity sha512-GZ7bu5A6+4DtG7q9GsoHXy3ALcgeIHP4NnL0Vv2wu0uUB/yQex26v0tf6/na1mm0+bS9Uw+0DFex7aaKr2qawQ==
"@types/normalize-package-data@^2.4.0":
version "2.4.1"
@@ -1713,9 +1708,9 @@
"@types/node" "*"
"@types/yargs-parser@*":
- version "20.2.1"
- resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129"
- integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==
+ version "21.0.0"
+ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b"
+ integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==
"@types/yargs@^16.0.0":
version "16.0.4"
@@ -1725,20 +1720,20 @@
"@types/yargs-parser" "*"
"@types/yargs@^17.0.8":
- version "17.0.8"
- resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.8.tgz#d23a3476fd3da8a0ea44b5494ca7fa677b9dad4c"
- integrity sha512-wDeUwiUmem9FzsyysEwRukaEdDNcwbROvQ9QGRKaLI6t+IltNzbn4/i4asmB10auvZGQCzSQ6t0GSczEThlUXw==
+ version "17.0.9"
+ resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.9.tgz#f1f931a4e5ae2c0134dea10f501088636a50b46a"
+ integrity sha512-Ci8+4/DOtkHRylcisKmVMtmVO5g7weUVCKcsu1sJvF1bn0wExTmbHmhFKj7AnEm0de800iovGhdSKzYnzbaHpg==
dependencies:
"@types/yargs-parser" "*"
-"@typescript-eslint/eslint-plugin@^5.11.0":
- version "5.11.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.11.0.tgz#3b866371d8d75c70f9b81535e7f7d3aa26527c7a"
- integrity sha512-HJh33bgzXe6jGRocOj4FmefD7hRY4itgjzOrSs3JPrTNXsX7j5+nQPciAUj/1nZtwo2kAc3C75jZO+T23gzSGw==
+"@typescript-eslint/eslint-plugin@^5.13.0":
+ version "5.13.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.13.0.tgz#2809052b85911ced9c54a60dac10e515e9114497"
+ integrity sha512-vLktb2Uec81fxm/cfz2Hd6QaWOs8qdmVAZXLdOBX6JFJDhf6oDZpMzZ4/LZ6SFM/5DgDcxIMIvy3F+O9yZBuiQ==
dependencies:
- "@typescript-eslint/scope-manager" "5.11.0"
- "@typescript-eslint/type-utils" "5.11.0"
- "@typescript-eslint/utils" "5.11.0"
+ "@typescript-eslint/scope-manager" "5.13.0"
+ "@typescript-eslint/type-utils" "5.13.0"
+ "@typescript-eslint/utils" "5.13.0"
debug "^4.3.2"
functional-red-black-tree "^1.0.1"
ignore "^5.1.8"
@@ -1746,69 +1741,69 @@
semver "^7.3.5"
tsutils "^3.21.0"
-"@typescript-eslint/parser@^5.11.0":
- version "5.11.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.11.0.tgz#b4fcaf65513f9b34bdcbffdda055724a5efb7e04"
- integrity sha512-x0DCjetHZYBRovJdr3U0zG9OOdNXUaFLJ82ehr1AlkArljJuwEsgnud+Q7umlGDFLFrs8tU8ybQDFocp/eX8mQ==
+"@typescript-eslint/parser@^5.13.0":
+ version "5.13.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.13.0.tgz#0394ed8f2f849273c0bf4b811994d177112ced5c"
+ integrity sha512-GdrU4GvBE29tm2RqWOM0P5QfCtgCyN4hXICj/X9ibKED16136l9ZpoJvCL5pSKtmJzA+NRDzQ312wWMejCVVfg==
dependencies:
- "@typescript-eslint/scope-manager" "5.11.0"
- "@typescript-eslint/types" "5.11.0"
- "@typescript-eslint/typescript-estree" "5.11.0"
+ "@typescript-eslint/scope-manager" "5.13.0"
+ "@typescript-eslint/types" "5.13.0"
+ "@typescript-eslint/typescript-estree" "5.13.0"
debug "^4.3.2"
-"@typescript-eslint/scope-manager@5.11.0":
- version "5.11.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.11.0.tgz#f5aef83ff253f457ecbee5f46f762298f0101e4b"
- integrity sha512-z+K4LlahDFVMww20t/0zcA7gq/NgOawaLuxgqGRVKS0PiZlCTIUtX0EJbC0BK1JtR4CelmkPK67zuCgpdlF4EA==
+"@typescript-eslint/scope-manager@5.13.0":
+ version "5.13.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.13.0.tgz#cf6aff61ca497cb19f0397eea8444a58f46156b6"
+ integrity sha512-T4N8UvKYDSfVYdmJq7g2IPJYCRzwtp74KyDZytkR4OL3NRupvswvmJQJ4CX5tDSurW2cvCc1Ia1qM7d0jpa7IA==
dependencies:
- "@typescript-eslint/types" "5.11.0"
- "@typescript-eslint/visitor-keys" "5.11.0"
+ "@typescript-eslint/types" "5.13.0"
+ "@typescript-eslint/visitor-keys" "5.13.0"
-"@typescript-eslint/type-utils@5.11.0":
- version "5.11.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.11.0.tgz#58be0ba73d1f6ef8983d79f7f0bc2209b253fefe"
- integrity sha512-wDqdsYO6ofLaD4DsGZ0jGwxp4HrzD2YKulpEZXmgN3xo4BHJwf7kq49JTRpV0Gx6bxkSUmc9s0EIK1xPbFFpIA==
+"@typescript-eslint/type-utils@5.13.0":
+ version "5.13.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.13.0.tgz#b0efd45c85b7bab1125c97b752cab3a86c7b615d"
+ integrity sha512-/nz7qFizaBM1SuqAKb7GLkcNn2buRdDgZraXlkhz+vUGiN1NZ9LzkA595tHHeduAiS2MsHqMNhE2zNzGdw43Yg==
dependencies:
- "@typescript-eslint/utils" "5.11.0"
+ "@typescript-eslint/utils" "5.13.0"
debug "^4.3.2"
tsutils "^3.21.0"
-"@typescript-eslint/types@5.11.0":
- version "5.11.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.11.0.tgz#ba345818a2540fdf2755c804dc2158517ab61188"
- integrity sha512-cxgBFGSRCoBEhvSVLkKw39+kMzUKHlJGVwwMbPcTZX3qEhuXhrjwaZXWMxVfxDgyMm+b5Q5b29Llo2yow8Y7xQ==
+"@typescript-eslint/types@5.13.0":
+ version "5.13.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.13.0.tgz#da1de4ae905b1b9ff682cab0bed6b2e3be9c04e5"
+ integrity sha512-LmE/KO6DUy0nFY/OoQU0XelnmDt+V8lPQhh8MOVa7Y5k2gGRd6U9Kp3wAjhB4OHg57tUO0nOnwYQhRRyEAyOyg==
-"@typescript-eslint/typescript-estree@5.11.0":
- version "5.11.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.11.0.tgz#53f9e09b88368191e52020af77c312a4777ffa43"
- integrity sha512-yVH9hKIv3ZN3lw8m/Jy5I4oXO4ZBMqijcXCdA4mY8ull6TPTAoQnKKrcZ0HDXg7Bsl0Unwwx7jcXMuNZc0m4lg==
+"@typescript-eslint/typescript-estree@5.13.0":
+ version "5.13.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.13.0.tgz#b37c07b748ff030a3e93d87c842714e020b78141"
+ integrity sha512-Q9cQow0DeLjnp5DuEDjLZ6JIkwGx3oYZe+BfcNuw/POhtpcxMTy18Icl6BJqTSd+3ftsrfuVb7mNHRZf7xiaNA==
dependencies:
- "@typescript-eslint/types" "5.11.0"
- "@typescript-eslint/visitor-keys" "5.11.0"
+ "@typescript-eslint/types" "5.13.0"
+ "@typescript-eslint/visitor-keys" "5.13.0"
debug "^4.3.2"
globby "^11.0.4"
is-glob "^4.0.3"
semver "^7.3.5"
tsutils "^3.21.0"
-"@typescript-eslint/utils@5.11.0":
- version "5.11.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.11.0.tgz#d91548ef180d74c95d417950336d9260fdbe1dc5"
- integrity sha512-g2I480tFE1iYRDyMhxPAtLQ9HAn0jjBtipgTCZmd9I9s11OV8CTsG+YfFciuNDcHqm4csbAgC2aVZCHzLxMSUw==
+"@typescript-eslint/utils@5.13.0":
+ version "5.13.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.13.0.tgz#2328feca700eb02837298339a2e49c46b41bd0af"
+ integrity sha512-+9oHlPWYNl6AwwoEt5TQryEHwiKRVjz7Vk6kaBeD3/kwHE5YqTGHtm/JZY8Bo9ITOeKutFaXnBlMgSATMJALUQ==
dependencies:
"@types/json-schema" "^7.0.9"
- "@typescript-eslint/scope-manager" "5.11.0"
- "@typescript-eslint/types" "5.11.0"
- "@typescript-eslint/typescript-estree" "5.11.0"
+ "@typescript-eslint/scope-manager" "5.13.0"
+ "@typescript-eslint/types" "5.13.0"
+ "@typescript-eslint/typescript-estree" "5.13.0"
eslint-scope "^5.1.1"
eslint-utils "^3.0.0"
-"@typescript-eslint/visitor-keys@5.11.0":
- version "5.11.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.11.0.tgz#888542381f1a2ac745b06d110c83c0b261487ebb"
- integrity sha512-E8w/vJReMGuloGxJDkpPlGwhxocxOpSVgSvjiLO5IxZPmxZF30weOeJYyPSEACwM+X4NziYS9q+WkN/2DHYQwA==
+"@typescript-eslint/visitor-keys@5.13.0":
+ version "5.13.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.13.0.tgz#f45ff55bcce16403b221ac9240fbeeae4764f0fd"
+ integrity sha512-HLKEAS/qA1V7d9EzcpLFykTePmOQqOFim8oCvhY3pZgQ8Hi38hYpHd9e5GN6nQBFQNecNhws5wkS9Y5XIO0s/g==
dependencies:
- "@typescript-eslint/types" "5.11.0"
+ "@typescript-eslint/types" "5.13.0"
eslint-visitor-keys "^3.0.0"
"@webassemblyjs/ast@1.11.1":
@@ -1949,10 +1944,10 @@
resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.6.1.tgz#0de2875ac31b46b6c5bb1ae0a7d7f0ba5678dffe"
integrity sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw==
-"@xmldom/xmldom@^0.8.0":
- version "0.8.0"
- resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.8.0.tgz#9f83fd9b3506c9603baad67e44eb6e6ee8eee0ce"
- integrity sha512-7wVnF+rKrVDEo1xjzkkidTG0grclaVnX0vKa0z9JSXcEdtftUJjvU33jLGg6SHyvs3eeqEsI7jZ6NxYfRypEEg==
+"@xmldom/xmldom@^0.8.1":
+ version "0.8.1"
+ resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.8.1.tgz#70c239275fc6d6a84e41b9a8d623a93c0d59b6b4"
+ integrity sha512-4wOae+5N2RZ+CZXd9ZKwkaDi55IxrSTOjHpxTvQQ4fomtOJmqVxbmICA9jE1jvnqNhpfgz8cnfFagG86wV/xLQ==
"@xtuc/ieee754@^1.2.0":
version "1.2.0"
@@ -2015,7 +2010,7 @@ acorn@^7.1.1:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa"
integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==
-acorn@^8.2.4, acorn@^8.4.1, acorn@^8.7.0:
+acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.0:
version "8.7.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf"
integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==
@@ -2033,9 +2028,9 @@ agent-base@6, agent-base@^6.0.2:
debug "4"
agentkeepalive@^4.1.3:
- version "4.2.0"
- resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.2.0.tgz#616ce94ccb41d1a39a45d203d8076fe98713062d"
- integrity sha512-0PhAp58jZNw13UJv7NVdTGb0ZcghHUb3DrZ046JiiJY/BOaTTpbwdHq2VObPCBV8M2GPh7sgrJ3AQ8Ey468LJw==
+ version "4.2.1"
+ resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.2.1.tgz#a7975cbb9f83b367f06c90cc51ff28fe7d499717"
+ integrity sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==
dependencies:
debug "^4.1.0"
depd "^1.1.2"
@@ -2350,14 +2345,14 @@ browser-process-hrtime@^1.0.0:
integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==
browserslist@^4.14.5, browserslist@^4.17.5:
- version "4.19.1"
- resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.19.1.tgz#4ac0435b35ab655896c31d53018b6dd5e9e4c9a3"
- integrity sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==
+ version "4.20.0"
+ resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.0.tgz#35951e3541078c125d36df76056e94738a52ebe9"
+ integrity sha512-bnpOoa+DownbciXj0jVGENf8VYQnE2LNWomhYuCsMmmx9Jd9lwq0WXODuwpSsp8AVdKM2/HorrzxAfbKvWTByQ==
dependencies:
- caniuse-lite "^1.0.30001286"
- electron-to-chromium "^1.4.17"
+ caniuse-lite "^1.0.30001313"
+ electron-to-chromium "^1.4.76"
escalade "^3.1.1"
- node-releases "^2.0.1"
+ node-releases "^2.0.2"
picocolors "^1.0.0"
bs-logger@0.x:
@@ -2450,10 +2445,10 @@ camelcase@^6.2.0, camelcase@^6.3.0:
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
-caniuse-lite@^1.0.30001286:
- version "1.0.30001310"
- resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001310.tgz#da02cd07432c9eece6992689d1b84ca18139eea8"
- integrity sha512-cb9xTV8k9HTIUA3GnPUJCk0meUnrHL5gy5QePfDjxHyNBcnzPzrHFv5GqfP7ue5b1ZyzZL0RJboD6hQlPXjhjg==
+caniuse-lite@^1.0.30001313:
+ version "1.0.30001313"
+ resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001313.tgz#a380b079db91621e1b7120895874e2fd62ed2e2f"
+ integrity sha512-rI1UN0koZUiKINjysQDuRi2VeSCce3bYJNmDcj3PIKREiAmjakugBul1QSkg/fPrlULYl6oWfGg3PbgOSY9X4Q==
case@^1.6.3:
version "1.6.3"
@@ -2955,10 +2950,10 @@ data-urls@^2.0.0:
whatwg-mimetype "^2.3.0"
whatwg-url "^8.0.0"
-date-format@^4.0.3:
- version "4.0.3"
- resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.3.tgz#f63de5dc08dc02efd8ef32bf2a6918e486f35873"
- integrity sha512-7P3FyqDcfeznLZp2b+OMitV9Sz2lUnsT87WaTat9nVwqsBkTzPG3lPLNwW3en6F4pHUiWzr6vb8CLhjdK9bcxQ==
+date-format@^4.0.4:
+ version "4.0.4"
+ resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.4.tgz#b58036e29e74121fca3e1b3e0dc4a62c65faa233"
+ integrity sha512-/jyf4rhB17ge328HJuJjAcmRtCsGd+NDeAtahRBTaK6vSPR6MO5HlrAit3Nn7dVjaa6sowW0WXt8yQtLyZQFRg==
dateformat@^3.0.0:
version "3.0.3"
@@ -3210,10 +3205,10 @@ ecc-jsbn@~0.1.1:
jsbn "~0.1.0"
safer-buffer "^2.1.0"
-electron-to-chromium@^1.4.17:
- version "1.4.67"
- resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.67.tgz#699e59d6959d05f87865e12b3055bbcf492bbbee"
- integrity sha512-A6a2jEPLueEDfb7kvh7/E94RKKnIb01qL+4I7RFxtajmo+G9F5Ei7HgY5PRbQ4RDrh6DGDW66P0hD5XI2nRAcg==
+electron-to-chromium@^1.4.76:
+ version "1.4.76"
+ resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.76.tgz#a0494baedaf51094b1c172999919becd9975a934"
+ integrity sha512-3Vftv7cenJtQb+k00McEBZ2vVmZ/x+HEF7pcZONZIkOsESqAqVuACmBxMv0JhzX7u0YltU0vSqRqgBSTAhFUjA==
emittery@^0.8.1:
version "0.8.1"
@@ -3232,10 +3227,10 @@ encoding@^0.1.12:
dependencies:
iconv-lite "^0.6.2"
-enhanced-resolve@^5.8.3:
- version "5.9.0"
- resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.9.0.tgz#49ac24953ac8452ed8fed2ef1340fc8e043667ee"
- integrity sha512-weDYmzbBygL7HzGGS26M3hGQx68vehdEg6VUmqSOaFzXExFqlnKuSvsEJCVGQHScS8CQMbrAqftT+AzzHNt/YA==
+enhanced-resolve@^5.9.2:
+ version "5.9.2"
+ resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.9.2.tgz#0224dcd6a43389ebfb2d55efee517e5466772dd9"
+ integrity sha512-GIm3fQfwLJ8YZx2smuHpBKkXC1yOk+OBEmKckVyL0i/ea8mqDEykK3ld5dgH1QYPNyT/lIllxV2LULnxCHaHkA==
dependencies:
graceful-fs "^4.2.4"
tapable "^2.2.0"
@@ -3353,10 +3348,10 @@ escodegen@^2.0.0:
optionalDependencies:
source-map "~0.6.1"
-eslint-config-prettier@^8.3.0:
- version "8.3.0"
- resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a"
- integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==
+eslint-config-prettier@^8.5.0:
+ version "8.5.0"
+ resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1"
+ integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==
eslint-import-resolver-node@^0.3.6:
version "0.3.6"
@@ -3419,10 +3414,10 @@ eslint-scope@5.1.1, eslint-scope@^5.1.1:
esrecurse "^4.3.0"
estraverse "^4.1.1"
-eslint-scope@^7.1.0:
- version "7.1.0"
- resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153"
- integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==
+eslint-scope@^7.1.1:
+ version "7.1.1"
+ resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642"
+ integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==
dependencies:
esrecurse "^4.3.0"
estraverse "^5.2.0"
@@ -3439,17 +3434,17 @@ eslint-visitor-keys@^2.0.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==
-eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0, eslint-visitor-keys@^3.2.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz#6fbb166a6798ee5991358bc2daa1ba76cc1254a1"
- integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==
+eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826"
+ integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==
-eslint@^8.8.0:
- version "8.8.0"
- resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.8.0.tgz#9762b49abad0cb4952539ffdb0a046392e571a2d"
- integrity sha512-H3KXAzQGBH1plhYS3okDix2ZthuYJlQQEGE5k0IKuEqUSiyu4AmxxlJ2MtTYeJ3xB4jDhcYCwGOg2TXYdnDXlQ==
+eslint@^8.10.0:
+ version "8.10.0"
+ resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.10.0.tgz#931be395eb60f900c01658b278e05b6dae47199d"
+ integrity sha512-tcI1D9lfVec+R4LE1mNDnzoJ/f71Kl/9Cv4nG47jOueCMBrCCKYXr4AUVS7go6mWYGFD4+EoN6+eXSrEbRzXVw==
dependencies:
- "@eslint/eslintrc" "^1.0.5"
+ "@eslint/eslintrc" "^1.2.0"
"@humanwhocodes/config-array" "^0.9.2"
ajv "^6.10.0"
chalk "^4.0.0"
@@ -3457,10 +3452,10 @@ eslint@^8.8.0:
debug "^4.3.2"
doctrine "^3.0.0"
escape-string-regexp "^4.0.0"
- eslint-scope "^7.1.0"
+ eslint-scope "^7.1.1"
eslint-utils "^3.0.0"
- eslint-visitor-keys "^3.2.0"
- espree "^9.3.0"
+ eslint-visitor-keys "^3.3.0"
+ espree "^9.3.1"
esquery "^1.4.0"
esutils "^2.0.2"
fast-deep-equal "^3.1.3"
@@ -3485,14 +3480,14 @@ eslint@^8.8.0:
text-table "^0.2.0"
v8-compile-cache "^2.0.3"
-espree@^9.2.0, espree@^9.3.0:
- version "9.3.0"
- resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.0.tgz#c1240d79183b72aaee6ccfa5a90bc9111df085a8"
- integrity sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==
+espree@^9.3.1:
+ version "9.3.1"
+ resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.1.tgz#8793b4bc27ea4c778c19908e0719e7b8f4115bcd"
+ integrity sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==
dependencies:
acorn "^8.7.0"
acorn-jsx "^5.3.1"
- eslint-visitor-keys "^3.1.0"
+ eslint-visitor-keys "^3.3.0"
esprima@^4.0.0, esprima@^4.0.1:
version "4.0.1"
@@ -3706,7 +3701,7 @@ flat-cache@^3.0.4:
flatted "^3.1.0"
rimraf "^3.0.2"
-flatted@^3.1.0, flatted@^3.2.4:
+flatted@^3.1.0, flatted@^3.2.5:
version "3.2.5"
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3"
integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==
@@ -3746,10 +3741,10 @@ fs-access@^1.0.1:
dependencies:
null-check "^1.0.0"
-fs-extra@^10.0.0:
- version "10.0.0"
- resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1"
- integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==
+fs-extra@^10.0.1:
+ version "10.0.1"
+ resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.1.tgz#27de43b4320e833f6867cc044bfce29fdf0ef3b8"
+ integrity sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
@@ -4032,9 +4027,9 @@ has-flag@^4.0.0:
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
has-symbols@^1.0.1, has-symbols@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423"
- integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8"
+ integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==
has-tostringtag@^1.0.0:
version "1.0.0"
@@ -4636,7 +4631,7 @@ jest-config@^27.5.1:
slash "^3.0.0"
strip-json-comments "^3.1.1"
-jest-diff@^27.0.0, jest-diff@^27.5.1:
+jest-diff@^27.5.1:
version "27.5.1"
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def"
integrity sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==
@@ -4750,7 +4745,7 @@ jest-leak-detector@^27.5.1:
jest-get-type "^27.5.1"
pretty-format "^27.5.1"
-jest-matcher-utils@^27.5.1:
+jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.5.1:
version "27.5.1"
resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab"
integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw==
@@ -5286,15 +5281,15 @@ lodash@^4.11.2, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.7.0:
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
log4js@^6.4.1:
- version "6.4.1"
- resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.4.1.tgz#9d3a8bf2c31c1e213fe3fc398a6053f7a2bc53e8"
- integrity sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg==
+ version "6.4.2"
+ resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.4.2.tgz#45ec783835acc525b397f52cf086e26994fe3b70"
+ integrity sha512-k80cggS2sZQLBwllpT1p06GtfvzMmSdUCkW96f0Hj83rKGJDAu2vZjt9B9ag2vx8Zz1IXzxoLgqvRJCdMKybGg==
dependencies:
- date-format "^4.0.3"
+ date-format "^4.0.4"
debug "^4.3.3"
- flatted "^3.2.4"
+ flatted "^3.2.5"
rfdc "^1.3.0"
- streamroller "^3.0.2"
+ streamroller "^3.0.4"
lower-case@^1.1.1:
version "1.1.4"
@@ -5458,9 +5453,9 @@ min-indent@^1.0.0:
integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==
minimatch@^3.0.4:
- version "3.0.5"
- resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.5.tgz#4da8f1290ee0f0f8e83d60ca69f8f134068604a3"
- integrity sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==
+ version "3.1.2"
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
+ integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
dependencies:
brace-expansion "^1.1.7"
@@ -5684,7 +5679,7 @@ node-int64@^0.4.0:
resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=
-node-releases@^2.0.1:
+node-releases@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.2.tgz#7139fe71e2f4f11b47d4d2986aaf8c48699e0c01"
integrity sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==
@@ -6665,9 +6660,9 @@ rxjs@^6.6.0:
tslib "^1.9.0"
rxjs@^7.2.0:
- version "7.5.3"
- resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.3.tgz#1359f8a4704797bee74357d65a125dbc7d8f4a91"
- integrity sha512-6162iC/N7L7K8q3UvdOMWix1ju+esADGrDaPrTu5XJmCv69YNdYoUaop/iatN8GHK+YHOdszPP+qygA0yi04zQ==
+ version "7.5.4"
+ resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.4.tgz#3d6bd407e6b7ce9a123e76b1e770dc5761aa368d"
+ integrity sha512-h5M3Hk78r6wAheJF0a5YahB1yRQKCsZ4MsGdZ5O9ETbVtjPcScGfrMmoOq7EBsCRzd4BDkvDJ7ogP8Sz5tTFiQ==
dependencies:
tslib "^2.1.0"
@@ -6830,10 +6825,10 @@ socks@^2.3.3, socks@^2.6.1:
ip "^1.1.5"
smart-buffer "^4.2.0"
-sort-json@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/sort-json/-/sort-json-2.0.0.tgz#a7030d8875adbd4a5ea39a000567ed94c1aa3c50"
- integrity sha512-OgXPErPJM/rBK5OhzIJ+etib/BmLQ1JY55Nb/ElhoWUec62pXNF/X6DrecHq3NW5OAGX0KxYD7m0HtgB9dvGeA==
+sort-json@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/sort-json/-/sort-json-2.0.1.tgz#7338783bef807185dc37d5b02e3afd905d537cfb"
+ integrity sha512-s8cs2bcsQCzo/P2T/uoU6Js4dS/jnX8+4xunziNoq9qmSpZNCrRIAIvp4avsz0ST18HycV4z/7myJ7jsHWB2XQ==
dependencies:
detect-indent "^5.0.0"
detect-newline "^2.1.0"
@@ -7003,14 +6998,14 @@ standard-version@^9.3.2:
stringify-package "^1.0.1"
yargs "^16.0.0"
-streamroller@^3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-3.0.2.tgz#30418d0eee3d6c93ec897f892ed098e3a81e68b7"
- integrity sha512-ur6y5S5dopOaRXBuRIZ1u6GC5bcEXHRZKgfBjfCglMhmIf+roVCECjvkEYzNQOXIN2/JPnkMPW/8B3CZoKaEPA==
+streamroller@^3.0.4:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-3.0.4.tgz#27ad87339d829483f89c5f33fd60ea6731e4183c"
+ integrity sha512-GI9NzeD+D88UFuIlJkKNDH/IsuR+qIN7Qh8EsmhoRZr9bQoehTraRgwtLUkZbpcAw+hLPfHOypmppz8YyGK68w==
dependencies:
- date-format "^4.0.3"
- debug "^4.1.1"
- fs-extra "^10.0.0"
+ date-format "^4.0.4"
+ debug "^4.3.3"
+ fs-extra "^10.0.1"
strict-uri-encode@^2.0.0:
version "2.0.0"
@@ -7251,10 +7246,11 @@ terser-webpack-plugin@^5.1.3:
terser "^5.7.2"
terser@^5.7.2:
- version "5.10.0"
- resolved "https://registry.yarnpkg.com/terser/-/terser-5.10.0.tgz#b86390809c0389105eb0a0b62397563096ddafcc"
- integrity sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==
+ version "5.12.0"
+ resolved "https://registry.yarnpkg.com/terser/-/terser-5.12.0.tgz#728c6bff05f7d1dcb687d8eace0644802a9dae8a"
+ integrity sha512-R3AUhNBGWiFc77HXag+1fXpAxTAFRQTJemlJKjAgD9r8xXTpjNKqIXwHM/o7Rh+O0kUJtS3WQVdBeMKFk5sw9A==
dependencies:
+ acorn "^8.5.0"
commander "^2.20.0"
source-map "~0.7.2"
source-map-support "~0.5.20"
@@ -7375,10 +7371,10 @@ ts-jest@^27.1.3:
semver "7.x"
yargs-parser "20.x"
-ts-node@^10.2.1, ts-node@^10.5.0:
- version "10.5.0"
- resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.5.0.tgz#618bef5854c1fbbedf5e31465cbb224a1d524ef9"
- integrity sha512-6kEJKwVxAJ35W4akuiysfKwKmjkbYxwQMTBaAxo9KKAx/Yd26mPUyhGz3ji+EsJoAgrLqVsYHNuuYwQe22lbtw==
+ts-node@^10.2.1, ts-node@^10.6.0, ts-node@^10.7.0:
+ version "10.7.0"
+ resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.7.0.tgz#35d503d0fab3e2baa672a0e94f4b40653c2463f5"
+ integrity sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==
dependencies:
"@cspotcode/source-map-support" "0.7.0"
"@tsconfig/node10" "^1.0.7"
@@ -7395,9 +7391,9 @@ ts-node@^10.2.1, ts-node@^10.5.0:
yn "3.1.1"
tsconfig-paths@^3.12.0, tsconfig-paths@^3.9.0:
- version "3.12.0"
- resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b"
- integrity sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==
+ version "3.13.0"
+ resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.13.0.tgz#f3e9b8f6876698581d94470c03c95b3a48c0e3d7"
+ integrity sha512-nWuffZppoaYK0vQ1SQmkSsQzJoHA4s6uzdb2waRpD806x9yfq153AdVsWz4je2qZcW+pENrMQXbGQ3sMCkXuhw==
dependencies:
"@types/json5" "^0.0.29"
json5 "^1.0.1"
@@ -7518,9 +7514,9 @@ typescript@~4.5.0:
integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==
uglify-js@^3.1.4:
- version "3.15.1"
- resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.15.1.tgz#9403dc6fa5695a6172a91bc983ea39f0f7c9086d"
- integrity sha512-FAGKF12fWdkpvNJZENacOH0e/83eG6JyVQyanIJaBXCN1J11TUQv1T1/z8S+Z0CG0ZPk1nPcreF/c7lrTd0TEQ==
+ version "3.15.2"
+ resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.15.2.tgz#1ed2c976f448063b1f87adb68c741be79959f951"
+ integrity sha512-peeoTk3hSwYdoc9nrdiEJk+gx1ALCtTjdYuKSXMTDqq7n1W7dHPqWDdSi+BPL0ni2YMeHD7hKUSdbj3TZauY2A==
uid-number@0.0.6:
version "0.0.6"
@@ -7737,13 +7733,13 @@ webpack-sources@^3.2.3:
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
-webpack@^5.68.0:
- version "5.68.0"
- resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.68.0.tgz#a653a58ed44280062e47257f260117e4be90d560"
- integrity sha512-zUcqaUO0772UuuW2bzaES2Zjlm/y3kRBQDVFVCge+s2Y8mwuUTdperGaAv65/NtRL/1zanpSJOq/MD8u61vo6g==
+webpack@^5.69.1:
+ version "5.70.0"
+ resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.70.0.tgz#3461e6287a72b5e6e2f4872700bc8de0d7500e6d"
+ integrity sha512-ZMWWy8CeuTTjCxbeaQI21xSswseF2oNOwc70QSKNePvmxE7XW36i7vpBMYZFAUHPwQiEbNGCEYIOOlyRbdGmxw==
dependencies:
- "@types/eslint-scope" "^3.7.0"
- "@types/estree" "^0.0.50"
+ "@types/eslint-scope" "^3.7.3"
+ "@types/estree" "^0.0.51"
"@webassemblyjs/ast" "1.11.1"
"@webassemblyjs/wasm-edit" "1.11.1"
"@webassemblyjs/wasm-parser" "1.11.1"
@@ -7751,7 +7747,7 @@ webpack@^5.68.0:
acorn-import-assertions "^1.7.6"
browserslist "^4.14.5"
chrome-trace-event "^1.0.2"
- enhanced-resolve "^5.8.3"
+ enhanced-resolve "^5.9.2"
es-module-lexer "^0.9.0"
eslint-scope "5.1.1"
events "^3.2.0"
@@ -8019,9 +8015,9 @@ yargs-parser@^18.1.2:
decamelize "^1.2.0"
yargs-parser@^21.0.0:
- version "21.0.0"
- resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.0.tgz#a485d3966be4317426dd56bdb6a30131b281dc55"
- integrity sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA==
+ version "21.0.1"
+ resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35"
+ integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==
yargs@^15.0.1:
version "15.4.1"