diff --git a/package-lock.json b/package-lock.json index 551ca858d4..1c314f3969 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", "dev": true, "requires": { - "@babel/highlight": "7.0.0" + "@babel/highlight": "^7.0.0" } }, "@babel/generator": { @@ -17,11 +17,11 @@ "integrity": "sha512-/v5I+a1jhGSKLgZDcmAUZ4K/VePi43eRkUs3yePW1HB1iANOD5tqJXwGSG4BZhSksP8J9ejSlwGeTiiOFZOrXQ==", "dev": true, "requires": { - "@babel/types": "7.4.0", - "jsesc": "2.5.2", - "lodash": "4.17.11", - "source-map": "0.5.7", - "trim-right": "1.0.1" + "@babel/types": "^7.4.0", + "jsesc": "^2.5.1", + "lodash": "^4.17.11", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" } }, "@babel/helper-function-name": { @@ -30,9 +30,9 @@ "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "7.0.0", - "@babel/template": "7.4.0", - "@babel/types": "7.4.0" + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" } }, "@babel/helper-get-function-arity": { @@ -41,7 +41,7 @@ "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", "dev": true, "requires": { - "@babel/types": "7.4.0" + "@babel/types": "^7.0.0" } }, "@babel/helper-split-export-declaration": { @@ -50,7 +50,7 @@ "integrity": "sha512-7Cuc6JZiYShaZnybDmfwhY4UYHzI6rlqhWjaIqbsJGsIqPimEYy5uh3akSRLMg65LSdSEnJ8a8/bWQN6u2oMGw==", "dev": true, "requires": { - "@babel/types": "7.4.0" + "@babel/types": "^7.4.0" } }, "@babel/highlight": { @@ -59,9 +59,9 @@ "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", "dev": true, "requires": { - "chalk": "2.4.2", - "esutils": "2.0.2", - "js-tokens": "4.0.0" + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" } }, "@babel/parser": { @@ -76,9 +76,9 @@ "integrity": "sha512-SOWwxxClTTh5NdbbYZ0BmaBVzxzTh2tO/TeLTbF6MO6EzVhHTnff8CdBXx3mEtazFBoysmEM6GU/wF+SuSx4Fw==", "dev": true, "requires": { - "@babel/code-frame": "7.0.0", - "@babel/parser": "7.4.2", - "@babel/types": "7.4.0" + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.4.0", + "@babel/types": "^7.4.0" } }, "@babel/traverse": { @@ -87,15 +87,15 @@ "integrity": "sha512-/DtIHKfyg2bBKnIN+BItaIlEg5pjAnzHOIQe5w+rHAw/rg9g0V7T4rqPX8BJPfW11kt3koyjAnTNwCzb28Y1PA==", "dev": true, "requires": { - "@babel/code-frame": "7.0.0", - "@babel/generator": "7.4.0", - "@babel/helper-function-name": "7.1.0", - "@babel/helper-split-export-declaration": "7.4.0", - "@babel/parser": "7.4.2", - "@babel/types": "7.4.0", - "debug": "4.1.1", - "globals": "11.11.0", - "lodash": "4.17.11" + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.4.0", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.0", + "@babel/parser": "^7.4.0", + "@babel/types": "^7.4.0", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.11" }, "dependencies": { "debug": { @@ -104,7 +104,7 @@ "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { - "ms": "2.1.1" + "ms": "^2.1.1" } }, "ms": { @@ -121,9 +121,9 @@ "integrity": "sha512-aPvkXyU2SPOnztlgo8n9cEiXW755mgyvueUPcpStqdzoSPm0fjO0vQBjLkt3JKJW7ufikfcnMTTPsN1xaTsBPA==", "dev": true, "requires": { - "esutils": "2.0.2", - "lodash": "4.17.11", - "to-fast-properties": "2.0.0" + "esutils": "^2.0.2", + "lodash": "^4.17.11", + "to-fast-properties": "^2.0.0" } }, "@lerna/add": { @@ -137,11 +137,11 @@ "@lerna/filter-options": "3.13.0", "@lerna/npm-conf": "3.13.0", "@lerna/validation-error": "3.13.0", - "dedent": "0.7.0", - "npm-package-arg": "6.1.0", - "p-map": "1.2.0", - "pacote": "9.5.0", - "semver": "5.7.0" + "dedent": "^0.7.0", + "npm-package-arg": "^6.1.0", + "p-map": "^1.2.0", + "pacote": "^9.5.0", + "semver": "^5.5.0" } }, "@lerna/batch-packages": { @@ -152,7 +152,7 @@ "requires": { "@lerna/package-graph": "3.13.0", "@lerna/validation-error": "3.13.0", - "npmlog": "4.1.2" + "npmlog": "^4.1.2" } }, "@lerna/bootstrap": { @@ -174,17 +174,17 @@ "@lerna/symlink-binary": "3.13.0", "@lerna/symlink-dependencies": "3.13.0", "@lerna/validation-error": "3.13.0", - "dedent": "0.7.0", - "get-port": "3.2.0", - "multimatch": "2.1.0", - "npm-package-arg": "6.1.0", - "npmlog": "4.1.2", - "p-finally": "1.0.0", - "p-map": "1.2.0", - "p-map-series": "1.0.0", - "p-waterfall": "1.0.0", - "read-package-tree": "5.2.2", - "semver": "5.7.0" + "dedent": "^0.7.0", + "get-port": "^3.2.0", + "multimatch": "^2.1.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "p-finally": "^1.0.0", + "p-map": "^1.2.0", + "p-map-series": "^1.0.0", + "p-waterfall": "^1.0.0", + "read-package-tree": "^5.1.6", + "semver": "^5.5.0" } }, "@lerna/changed": { @@ -216,9 +216,9 @@ "integrity": "sha512-0iDS8y2jiEucD4fJHEzKoc8aQJgm7s+hG+0RmDNtfT0MM3n17pZnf5JOMtS1FJp+SEXOjMKQndyyaDIPFsnp6A==", "dev": true, "requires": { - "chalk": "2.4.2", - "execa": "1.0.0", - "strong-log-transformer": "2.1.0" + "chalk": "^2.3.1", + "execa": "^1.0.0", + "strong-log-transformer": "^2.0.0" } }, "@lerna/clean": { @@ -232,9 +232,9 @@ "@lerna/prompt": "3.13.0", "@lerna/pulse-till-done": "3.13.0", "@lerna/rimraf-dir": "3.13.0", - "p-map": "1.2.0", - "p-map-series": "1.0.0", - "p-waterfall": "1.0.0" + "p-map": "^1.2.0", + "p-map-series": "^1.0.0", + "p-waterfall": "^1.0.0" } }, "@lerna/cli": { @@ -244,9 +244,9 @@ "dev": true, "requires": { "@lerna/global-options": "3.13.0", - "dedent": "0.7.0", - "npmlog": "4.1.2", - "yargs": "12.0.5" + "dedent": "^0.7.0", + "npmlog": "^4.1.2", + "yargs": "^12.0.1" } }, "@lerna/collect-updates": { @@ -257,9 +257,9 @@ "requires": { "@lerna/child-process": "3.13.0", "@lerna/describe-ref": "3.13.0", - "minimatch": "3.0.4", - "npmlog": "4.1.2", - "slash": "1.0.0" + "minimatch": "^3.0.4", + "npmlog": "^4.1.2", + "slash": "^1.0.0" } }, "@lerna/command": { @@ -273,11 +273,11 @@ "@lerna/project": "3.13.1", "@lerna/validation-error": "3.13.0", "@lerna/write-log-file": "3.13.0", - "dedent": "0.7.0", - "execa": "1.0.0", - "is-ci": "1.2.1", - "lodash": "4.17.11", - "npmlog": "4.1.2" + "dedent": "^0.7.0", + "execa": "^1.0.0", + "is-ci": "^1.0.10", + "lodash": "^4.17.5", + "npmlog": "^4.1.2" } }, "@lerna/conventional-commits": { @@ -287,15 +287,15 @@ "dev": true, "requires": { "@lerna/validation-error": "3.13.0", - "conventional-changelog-angular": "5.0.3", - "conventional-changelog-core": "3.1.6", - "conventional-recommended-bump": "4.0.4", - "fs-extra": "7.0.1", - "get-stream": "4.1.0", - "npm-package-arg": "6.1.0", - "npmlog": "4.1.2", - "pify": "3.0.0", - "semver": "5.7.0" + "conventional-changelog-angular": "^5.0.3", + "conventional-changelog-core": "^3.1.6", + "conventional-recommended-bump": "^4.0.4", + "fs-extra": "^7.0.0", + "get-stream": "^4.0.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "pify": "^3.0.0", + "semver": "^5.5.0" } }, "@lerna/create": { @@ -308,20 +308,20 @@ "@lerna/command": "3.13.1", "@lerna/npm-conf": "3.13.0", "@lerna/validation-error": "3.13.0", - "camelcase": "5.2.0", - "dedent": "0.7.0", - "fs-extra": "7.0.1", - "globby": "8.0.2", - "init-package-json": "1.10.3", - "npm-package-arg": "6.1.0", - "p-reduce": "1.0.0", - "pacote": "9.5.0", - "pify": "3.0.0", - "semver": "5.7.0", - "slash": "1.0.0", - "validate-npm-package-license": "3.0.4", - "validate-npm-package-name": "3.0.0", - "whatwg-url": "7.0.0" + "camelcase": "^5.0.0", + "dedent": "^0.7.0", + "fs-extra": "^7.0.0", + "globby": "^8.0.1", + "init-package-json": "^1.10.3", + "npm-package-arg": "^6.1.0", + "p-reduce": "^1.0.0", + "pacote": "^9.5.0", + "pify": "^3.0.0", + "semver": "^5.5.0", + "slash": "^1.0.0", + "validate-npm-package-license": "^3.0.3", + "validate-npm-package-name": "^3.0.0", + "whatwg-url": "^7.0.0" }, "dependencies": { "camelcase": { @@ -338,9 +338,9 @@ "integrity": "sha512-PTvg3jAAJSAtLFoZDsuTMv1wTOC3XYIdtg54k7uxIHsP8Ztpt+vlilY/Cni0THAqEMHvfiToel76Xdta4TU21Q==", "dev": true, "requires": { - "cmd-shim": "2.0.2", - "fs-extra": "7.0.1", - "npmlog": "4.1.2" + "cmd-shim": "^2.0.2", + "fs-extra": "^7.0.0", + "npmlog": "^4.1.2" } }, "@lerna/describe-ref": { @@ -350,7 +350,7 @@ "dev": true, "requires": { "@lerna/child-process": "3.13.0", - "npmlog": "4.1.2" + "npmlog": "^4.1.2" } }, "@lerna/diff": { @@ -362,7 +362,7 @@ "@lerna/child-process": "3.13.0", "@lerna/command": "3.13.1", "@lerna/validation-error": "3.13.0", - "npmlog": "4.1.2" + "npmlog": "^4.1.2" } }, "@lerna/exec": { @@ -387,7 +387,7 @@ "requires": { "@lerna/collect-updates": "3.13.0", "@lerna/filter-packages": "3.13.0", - "dedent": "0.7.0" + "dedent": "^0.7.0" } }, "@lerna/filter-packages": { @@ -397,8 +397,8 @@ "dev": true, "requires": { "@lerna/validation-error": "3.13.0", - "multimatch": "2.1.0", - "npmlog": "4.1.2" + "multimatch": "^2.1.0", + "npmlog": "^4.1.2" } }, "@lerna/get-npm-exec-opts": { @@ -407,7 +407,7 @@ "integrity": "sha512-Y0xWL0rg3boVyJk6An/vurKzubyJKtrxYv2sj4bB8Mc5zZ3tqtv0ccbOkmkXKqbzvNNF7VeUt1OJ3DRgtC/QZw==", "dev": true, "requires": { - "npmlog": "4.1.2" + "npmlog": "^4.1.2" } }, "@lerna/get-packed": { @@ -416,9 +416,9 @@ "integrity": "sha512-EgSim24sjIjqQDC57bgXD9l22/HCS93uQBbGpkzEOzxAVzEgpZVm7Fm1t8BVlRcT2P2zwGnRadIvxTbpQuDPTg==", "dev": true, "requires": { - "fs-extra": "7.0.1", - "ssri": "6.0.1", - "tar": "4.4.8" + "fs-extra": "^7.0.0", + "ssri": "^6.0.1", + "tar": "^4.4.8" }, "dependencies": { "tar": { @@ -427,13 +427,13 @@ "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "dev": true, "requires": { - "chownr": "1.1.1", - "fs-minipass": "1.2.5", - "minipass": "2.3.5", - "minizlib": "1.2.1", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.2", - "yallist": "3.0.3" + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" } } } @@ -445,10 +445,10 @@ "dev": true, "requires": { "@lerna/child-process": "3.13.0", - "@octokit/plugin-enterprise-rest": "2.2.2", - "@octokit/rest": "16.21.0", - "git-url-parse": "11.1.2", - "npmlog": "4.1.2" + "@octokit/plugin-enterprise-rest": "^2.1.1", + "@octokit/rest": "^16.16.0", + "git-url-parse": "^11.1.2", + "npmlog": "^4.1.2" } }, "@lerna/global-options": { @@ -464,7 +464,7 @@ "dev": true, "requires": { "@lerna/child-process": "3.13.0", - "semver": "5.7.0" + "semver": "^5.5.0" } }, "@lerna/import": { @@ -478,9 +478,9 @@ "@lerna/prompt": "3.13.0", "@lerna/pulse-till-done": "3.13.0", "@lerna/validation-error": "3.13.0", - "dedent": "0.7.0", - "fs-extra": "7.0.1", - "p-map-series": "1.0.0" + "dedent": "^0.7.0", + "fs-extra": "^7.0.0", + "p-map-series": "^1.0.0" } }, "@lerna/init": { @@ -491,9 +491,9 @@ "requires": { "@lerna/child-process": "3.13.0", "@lerna/command": "3.13.1", - "fs-extra": "7.0.1", - "p-map": "1.2.0", - "write-json-file": "2.3.0" + "fs-extra": "^7.0.0", + "p-map": "^1.2.0", + "write-json-file": "^2.3.0" } }, "@lerna/link": { @@ -505,8 +505,8 @@ "@lerna/command": "3.13.1", "@lerna/package-graph": "3.13.0", "@lerna/symlink-dependencies": "3.13.0", - "p-map": "1.2.0", - "slash": "1.0.0" + "p-map": "^1.2.0", + "slash": "^1.0.0" } }, "@lerna/list": { @@ -528,8 +528,8 @@ "dev": true, "requires": { "@lerna/batch-packages": "3.13.0", - "chalk": "2.4.2", - "columnify": "1.5.4" + "chalk": "^2.3.1", + "columnify": "^1.5.4" } }, "@lerna/log-packed": { @@ -538,10 +538,10 @@ "integrity": "sha512-Rmjrcz+6aM6AEcEVWmurbo8+AnHOvYtDpoeMMJh9IZ9SmZr2ClXzmD7wSvjTQc8BwOaiWjjC/ukcT0UYA2m7wg==", "dev": true, "requires": { - "byte-size": "4.0.4", - "columnify": "1.5.4", - "has-unicode": "2.0.1", - "npmlog": "4.1.2" + "byte-size": "^4.0.3", + "columnify": "^1.5.4", + "has-unicode": "^2.0.1", + "npmlog": "^4.1.2" } }, "@lerna/npm-conf": { @@ -550,8 +550,8 @@ "integrity": "sha512-Jg2kANsGnhg+fbPEzE0X9nX5oviEAvWj0nYyOkcE+cgWuT7W0zpnPXC4hA4C5IPQGhwhhh0IxhWNNHtjTuw53g==", "dev": true, "requires": { - "config-chain": "1.1.12", - "pify": "3.0.0" + "config-chain": "^1.1.11", + "pify": "^3.0.0" } }, "@lerna/npm-dist-tag": { @@ -560,10 +560,10 @@ "integrity": "sha512-mcuhw34JhSRFrbPn0vedbvgBTvveG52bR2lVE3M3tfE8gmR/cKS/EJFO4AUhfRKGCTFn9rjaSEzlFGYV87pemQ==", "dev": true, "requires": { - "figgy-pudding": "3.5.1", - "npm-package-arg": "6.1.0", - "npm-registry-fetch": "3.9.0", - "npmlog": "4.1.2" + "figgy-pudding": "^3.5.1", + "npm-package-arg": "^6.1.0", + "npm-registry-fetch": "^3.9.0", + "npmlog": "^4.1.2" } }, "@lerna/npm-install": { @@ -574,11 +574,11 @@ "requires": { "@lerna/child-process": "3.13.0", "@lerna/get-npm-exec-opts": "3.13.0", - "fs-extra": "7.0.1", - "npm-package-arg": "6.1.0", - "npmlog": "4.1.2", - "signal-exit": "3.0.2", - "write-pkg": "3.2.0" + "fs-extra": "^7.0.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "signal-exit": "^3.0.2", + "write-pkg": "^3.1.0" } }, "@lerna/npm-publish": { @@ -588,12 +588,12 @@ "dev": true, "requires": { "@lerna/run-lifecycle": "3.13.0", - "figgy-pudding": "3.5.1", - "fs-extra": "7.0.1", - "libnpmpublish": "1.1.1", - "npmlog": "4.1.2", - "pify": "3.0.0", - "read-package-json": "2.0.13" + "figgy-pudding": "^3.5.1", + "fs-extra": "^7.0.0", + "libnpmpublish": "^1.1.1", + "npmlog": "^4.1.2", + "pify": "^3.0.0", + "read-package-json": "^2.0.13" } }, "@lerna/npm-run-script": { @@ -604,7 +604,7 @@ "requires": { "@lerna/child-process": "3.13.0", "@lerna/get-npm-exec-opts": "3.13.0", - "npmlog": "4.1.2" + "npmlog": "^4.1.2" } }, "@lerna/output": { @@ -613,7 +613,7 @@ "integrity": "sha512-7ZnQ9nvUDu/WD+bNsypmPG5MwZBwu86iRoiW6C1WBuXXDxM5cnIAC1m2WxHeFnjyMrYlRXM9PzOQ9VDD+C15Rg==", "dev": true, "requires": { - "npmlog": "4.1.2" + "npmlog": "^4.1.2" } }, "@lerna/pack-directory": { @@ -625,11 +625,11 @@ "@lerna/get-packed": "3.13.0", "@lerna/package": "3.13.0", "@lerna/run-lifecycle": "3.13.0", - "figgy-pudding": "3.5.1", - "npm-packlist": "1.4.1", - "npmlog": "4.1.2", - "tar": "4.4.8", - "temp-write": "3.4.0" + "figgy-pudding": "^3.5.1", + "npm-packlist": "^1.4.1", + "npmlog": "^4.1.2", + "tar": "^4.4.8", + "temp-write": "^3.4.0" }, "dependencies": { "tar": { @@ -638,13 +638,13 @@ "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "dev": true, "requires": { - "chownr": "1.1.1", - "fs-minipass": "1.2.5", - "minipass": "2.3.5", - "minizlib": "1.2.1", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.2", - "yallist": "3.0.3" + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" } } } @@ -655,9 +655,9 @@ "integrity": "sha512-kSKO0RJQy093BufCQnkhf1jB4kZnBvL7kK5Ewolhk5gwejN+Jofjd8DGRVUDUJfQ0CkW1o6GbUeZvs8w8VIZDg==", "dev": true, "requires": { - "load-json-file": "4.0.0", - "npm-package-arg": "6.1.0", - "write-pkg": "3.2.0" + "load-json-file": "^4.0.0", + "npm-package-arg": "^6.1.0", + "write-pkg": "^3.1.0" } }, "@lerna/package-graph": { @@ -667,8 +667,8 @@ "dev": true, "requires": { "@lerna/validation-error": "3.13.0", - "npm-package-arg": "6.1.0", - "semver": "5.7.0" + "npm-package-arg": "^6.1.0", + "semver": "^5.5.0" } }, "@lerna/project": { @@ -679,16 +679,16 @@ "requires": { "@lerna/package": "3.13.0", "@lerna/validation-error": "3.13.0", - "cosmiconfig": "5.2.0", - "dedent": "0.7.0", - "dot-prop": "4.2.0", - "glob-parent": "3.1.0", - "globby": "8.0.2", - "load-json-file": "4.0.0", - "npmlog": "4.1.2", - "p-map": "1.2.0", - "resolve-from": "4.0.0", - "write-json-file": "2.3.0" + "cosmiconfig": "^5.1.0", + "dedent": "^0.7.0", + "dot-prop": "^4.2.0", + "glob-parent": "^3.1.0", + "globby": "^8.0.1", + "load-json-file": "^4.0.0", + "npmlog": "^4.1.2", + "p-map": "^1.2.0", + "resolve-from": "^4.0.0", + "write-json-file": "^2.3.0" } }, "@lerna/prompt": { @@ -697,8 +697,8 @@ "integrity": "sha512-P+lWSFokdyvYpkwC3it9cE0IF2U5yy2mOUbGvvE4iDb9K7TyXGE+7lwtx2thtPvBAfIb7O13POMkv7df03HJeA==", "dev": true, "requires": { - "inquirer": "6.2.2", - "npmlog": "4.1.2" + "inquirer": "^6.2.0", + "npmlog": "^4.1.2" } }, "@lerna/publish": { @@ -725,18 +725,18 @@ "@lerna/run-parallel-batches": "3.13.0", "@lerna/validation-error": "3.13.0", "@lerna/version": "3.13.1", - "figgy-pudding": "3.5.1", - "fs-extra": "7.0.1", - "libnpmaccess": "3.0.1", - "npm-package-arg": "6.1.0", - "npm-registry-fetch": "3.9.0", - "npmlog": "4.1.2", - "p-finally": "1.0.0", - "p-map": "1.2.0", - "p-pipe": "1.2.0", - "p-reduce": "1.0.0", - "pacote": "9.5.0", - "semver": "5.7.0" + "figgy-pudding": "^3.5.1", + "fs-extra": "^7.0.0", + "libnpmaccess": "^3.0.1", + "npm-package-arg": "^6.1.0", + "npm-registry-fetch": "^3.9.0", + "npmlog": "^4.1.2", + "p-finally": "^1.0.0", + "p-map": "^1.2.0", + "p-pipe": "^1.2.0", + "p-reduce": "^1.0.0", + "pacote": "^9.5.0", + "semver": "^5.5.0" } }, "@lerna/pulse-till-done": { @@ -745,7 +745,7 @@ "integrity": "sha512-1SOHpy7ZNTPulzIbargrgaJX387csN7cF1cLOGZiJQA6VqnS5eWs2CIrG8i8wmaUavj2QlQ5oEbRMVVXSsGrzA==", "dev": true, "requires": { - "npmlog": "4.1.2" + "npmlog": "^4.1.2" } }, "@lerna/resolve-symlink": { @@ -754,9 +754,9 @@ "integrity": "sha512-Lc0USSFxwDxUs5JvIisS8JegjA6SHSAWJCMvi2osZx6wVRkEDlWG2B1JAfXUzCMNfHoZX0/XX9iYZ+4JIpjAtg==", "dev": true, "requires": { - "fs-extra": "7.0.1", - "npmlog": "4.1.2", - "read-cmd-shim": "1.0.1" + "fs-extra": "^7.0.0", + "npmlog": "^4.1.2", + "read-cmd-shim": "^1.0.1" } }, "@lerna/rimraf-dir": { @@ -766,9 +766,9 @@ "dev": true, "requires": { "@lerna/child-process": "3.13.0", - "npmlog": "4.1.2", - "path-exists": "3.0.0", - "rimraf": "2.6.3" + "npmlog": "^4.1.2", + "path-exists": "^3.0.0", + "rimraf": "^2.6.2" } }, "@lerna/run": { @@ -785,7 +785,7 @@ "@lerna/run-parallel-batches": "3.13.0", "@lerna/timer": "3.13.0", "@lerna/validation-error": "3.13.0", - "p-map": "1.2.0" + "p-map": "^1.2.0" } }, "@lerna/run-lifecycle": { @@ -795,9 +795,9 @@ "dev": true, "requires": { "@lerna/npm-conf": "3.13.0", - "figgy-pudding": "3.5.1", - "npm-lifecycle": "2.1.0", - "npmlog": "4.1.2" + "figgy-pudding": "^3.5.1", + "npm-lifecycle": "^2.1.0", + "npmlog": "^4.1.2" } }, "@lerna/run-parallel-batches": { @@ -806,8 +806,8 @@ "integrity": "sha512-bICFBR+cYVF1FFW+Tlm0EhWDioTUTM6dOiVziDEGE1UZha1dFkMYqzqdSf4bQzfLS31UW/KBd/2z8jy2OIjEjg==", "dev": true, "requires": { - "p-map": "1.2.0", - "p-map-series": "1.0.0" + "p-map": "^1.2.0", + "p-map-series": "^1.0.0" } }, "@lerna/symlink-binary": { @@ -818,8 +818,8 @@ "requires": { "@lerna/create-symlink": "3.13.0", "@lerna/package": "3.13.0", - "fs-extra": "7.0.1", - "p-map": "1.2.0" + "fs-extra": "^7.0.0", + "p-map": "^1.2.0" } }, "@lerna/symlink-dependencies": { @@ -831,10 +831,10 @@ "@lerna/create-symlink": "3.13.0", "@lerna/resolve-symlink": "3.13.0", "@lerna/symlink-binary": "3.13.0", - "fs-extra": "7.0.1", - "p-finally": "1.0.0", - "p-map": "1.2.0", - "p-map-series": "1.0.0" + "fs-extra": "^7.0.0", + "p-finally": "^1.0.0", + "p-map": "^1.2.0", + "p-map-series": "^1.0.0" } }, "@lerna/timer": { @@ -849,7 +849,7 @@ "integrity": "sha512-SiJP75nwB8GhgwLKQfdkSnDufAaCbkZWJqEDlKOUPUvVOplRGnfL+BPQZH5nvq2BYSRXsksXWZ4UHVnQZI/HYA==", "dev": true, "requires": { - "npmlog": "4.1.2" + "npmlog": "^4.1.2" } }, "@lerna/version": { @@ -869,17 +869,17 @@ "@lerna/prompt": "3.13.0", "@lerna/run-lifecycle": "3.13.0", "@lerna/validation-error": "3.13.0", - "chalk": "2.4.2", - "dedent": "0.7.0", - "minimatch": "3.0.4", - "npmlog": "4.1.2", - "p-map": "1.2.0", - "p-pipe": "1.2.0", - "p-reduce": "1.0.0", - "p-waterfall": "1.0.0", - "semver": "5.7.0", - "slash": "1.0.0", - "temp-write": "3.4.0" + "chalk": "^2.3.1", + "dedent": "^0.7.0", + "minimatch": "^3.0.4", + "npmlog": "^4.1.2", + "p-map": "^1.2.0", + "p-pipe": "^1.2.0", + "p-reduce": "^1.0.0", + "p-waterfall": "^1.0.0", + "semver": "^5.5.0", + "slash": "^1.0.0", + "temp-write": "^3.4.0" } }, "@lerna/write-log-file": { @@ -888,8 +888,8 @@ "integrity": "sha512-RibeMnDPvlL8bFYW5C8cs4mbI3AHfQef73tnJCQ/SgrXZHehmHnsyWUiE7qDQCAo+B1RfTapvSyFF69iPj326A==", "dev": true, "requires": { - "npmlog": "4.1.2", - "write-file-atomic": "2.4.2" + "npmlog": "^4.1.2", + "write-file-atomic": "^2.3.0" } }, "@mrmlnc/readdir-enhanced": { @@ -898,8 +898,8 @@ "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", "dev": true, "requires": { - "call-me-maybe": "1.0.1", - "glob-to-regexp": "0.3.0" + "call-me-maybe": "^1.0.1", + "glob-to-regexp": "^0.3.0" } }, "@nodelib/fs.stat": { @@ -915,9 +915,9 @@ "dev": true, "requires": { "deepmerge": "3.2.0", - "is-plain-object": "2.0.4", - "universal-user-agent": "2.0.3", - "url-template": "2.0.8" + "is-plain-object": "^2.0.4", + "universal-user-agent": "^2.0.1", + "url-template": "^2.0.8" } }, "@octokit/plugin-enterprise-rest": { @@ -932,12 +932,12 @@ "integrity": "sha512-lxVlYYvwGbKSHXfbPk5vxEA8w4zHOH1wobado4a9EfsyD3Cbhuhus1w0Ye9Ro0eMubGO8kNy5d+xNFisM3Tvaw==", "dev": true, "requires": { - "@octokit/endpoint": "3.2.3", - "deprecation": "1.0.1", - "is-plain-object": "2.0.4", - "node-fetch": "2.3.0", - "once": "1.4.0", - "universal-user-agent": "2.0.3" + "@octokit/endpoint": "^3.2.0", + "deprecation": "^1.0.1", + "is-plain-object": "^2.0.4", + "node-fetch": "^2.3.0", + "once": "^1.4.0", + "universal-user-agent": "^2.0.1" } }, "@octokit/rest": { @@ -947,16 +947,16 @@ "dev": true, "requires": { "@octokit/request": "2.4.2", - "before-after-hook": "1.4.0", - "btoa-lite": "1.0.0", - "deprecation": "1.0.1", - "lodash.get": "4.4.2", - "lodash.set": "4.3.2", - "lodash.uniq": "4.5.0", - "octokit-pagination-methods": "1.1.0", - "once": "1.4.0", - "universal-user-agent": "2.0.3", - "url-template": "2.0.8" + "before-after-hook": "^1.4.0", + "btoa-lite": "^1.0.0", + "deprecation": "^1.0.1", + "lodash.get": "^4.4.2", + "lodash.set": "^4.3.2", + "lodash.uniq": "^4.5.0", + "octokit-pagination-methods": "^1.1.0", + "once": "^1.4.0", + "universal-user-agent": "^2.0.0", + "url-template": "^2.0.8" } }, "JSONStream": { @@ -965,8 +965,8 @@ "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "dev": true, "requires": { - "jsonparse": "1.3.1", - "through": "2.3.8" + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" } }, "abbrev": { @@ -981,7 +981,7 @@ "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", "dev": true, "requires": { - "es6-promisify": "5.0.0" + "es6-promisify": "^5.0.0" } }, "agentkeepalive": { @@ -990,7 +990,7 @@ "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", "dev": true, "requires": { - "humanize-ms": "1.2.1" + "humanize-ms": "^1.2.1" } }, "ajv": { @@ -999,10 +999,10 @@ "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", "dev": true, "requires": { - "fast-deep-equal": "2.0.1", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.4.1", - "uri-js": "4.2.2" + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, "ansi-escapes": { @@ -1023,7 +1023,7 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.3" + "color-convert": "^1.9.0" } }, "aproba": { @@ -1038,8 +1038,8 @@ "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" } }, "arg": { @@ -1054,7 +1054,7 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "arr-diff": { @@ -1099,7 +1099,7 @@ "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "dev": true, "requires": { - "array-uniq": "1.0.3" + "array-uniq": "^1.0.1" } }, "array-uniq": { @@ -1132,7 +1132,7 @@ "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", "dev": true, "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": "~2.1.0" } }, "assert-plus": { @@ -1177,9 +1177,9 @@ "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" }, "dependencies": { "ansi-styles": { @@ -1194,11 +1194,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "js-tokens": { @@ -1227,13 +1227,13 @@ "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, "requires": { - "cache-base": "1.0.1", - "class-utils": "0.3.6", - "component-emitter": "1.2.1", - "define-property": "1.0.0", - "isobject": "3.0.1", - "mixin-deep": "1.3.1", - "pascalcase": "0.1.1" + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" }, "dependencies": { "define-property": { @@ -1242,7 +1242,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "is-accessor-descriptor": { @@ -1251,7 +1251,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -1260,7 +1260,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -1269,9 +1269,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } } } @@ -1282,7 +1282,7 @@ "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "dev": true, "requires": { - "tweetnacl": "0.14.5" + "tweetnacl": "^0.14.3" } }, "before-after-hook": { @@ -1303,7 +1303,7 @@ "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", "dev": true, "requires": { - "inherits": "2.0.3" + "inherits": "~2.0.0" } }, "bluebird": { @@ -1318,7 +1318,7 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -1328,16 +1328,16 @@ "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.3", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -1346,7 +1346,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -1399,20 +1399,20 @@ "integrity": "sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg==", "dev": true, "requires": { - "bluebird": "3.5.3", - "chownr": "1.1.1", - "figgy-pudding": "3.5.1", - "glob": "7.1.3", - "graceful-fs": "4.1.15", - "lru-cache": "5.1.1", - "mississippi": "3.0.0", - "mkdirp": "0.5.1", - "move-concurrently": "1.0.1", - "promise-inflight": "1.0.1", - "rimraf": "2.6.3", - "ssri": "6.0.1", - "unique-filename": "1.1.1", - "y18n": "4.0.0" + "bluebird": "^3.5.3", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.3", + "graceful-fs": "^4.1.15", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.2", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" } }, "cache-base": { @@ -1421,15 +1421,15 @@ "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "dev": true, "requires": { - "collection-visit": "1.0.0", - "component-emitter": "1.2.1", - "get-value": "2.0.6", - "has-value": "1.0.0", - "isobject": "3.0.1", - "set-value": "2.0.0", - "to-object-path": "0.3.0", - "union-value": "1.0.0", - "unset-value": "1.0.0" + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" } }, "call-me-maybe": { @@ -1444,7 +1444,7 @@ "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", "dev": true, "requires": { - "callsites": "2.0.0" + "callsites": "^2.0.0" } }, "caller-path": { @@ -1453,7 +1453,7 @@ "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", "dev": true, "requires": { - "caller-callsite": "2.0.0" + "caller-callsite": "^2.0.0" } }, "callsites": { @@ -1474,9 +1474,9 @@ "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", "dev": true, "requires": { - "camelcase": "4.1.0", - "map-obj": "2.0.0", - "quick-lru": "1.1.0" + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" } }, "capture-stack-trace": { @@ -1497,9 +1497,9 @@ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.5.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, "chardet": { @@ -1526,10 +1526,10 @@ "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, "requires": { - "arr-union": "3.1.0", - "define-property": "0.2.5", - "isobject": "3.0.1", - "static-extend": "0.1.2" + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" }, "dependencies": { "define-property": { @@ -1538,7 +1538,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } } } @@ -1555,7 +1555,7 @@ "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "dev": true, "requires": { - "restore-cursor": "2.0.0" + "restore-cursor": "^2.0.0" } }, "cli-width": { @@ -1570,9 +1570,9 @@ "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" }, "dependencies": { "ansi-regex": { @@ -1593,8 +1593,8 @@ "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -1603,7 +1603,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } } } @@ -1620,8 +1620,8 @@ "integrity": "sha1-b8vamUg6j9FdfTChlspp1oii79s=", "dev": true, "requires": { - "graceful-fs": "4.1.15", - "mkdirp": "0.5.1" + "graceful-fs": "^4.1.2", + "mkdirp": "~0.5.0" } }, "code-point-at": { @@ -1636,8 +1636,8 @@ "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "dev": true, "requires": { - "map-visit": "1.0.0", - "object-visit": "1.0.1" + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" } }, "color-convert": { @@ -1667,8 +1667,8 @@ "integrity": "sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs=", "dev": true, "requires": { - "strip-ansi": "3.0.1", - "wcwidth": "1.0.1" + "strip-ansi": "^3.0.0", + "wcwidth": "^1.0.0" } }, "combined-stream": { @@ -1677,7 +1677,7 @@ "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", "dev": true, "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "commander": { @@ -1692,8 +1692,8 @@ "integrity": "sha1-md0LpFfh+bxyKxLAjsM+6rMfpkg=", "dev": true, "requires": { - "array-ify": "1.0.0", - "dot-prop": "3.0.0" + "array-ify": "^1.0.0", + "dot-prop": "^3.0.0" }, "dependencies": { "dot-prop": { @@ -1702,7 +1702,7 @@ "integrity": "sha1-G3CK8JSknJoOfbyteQq6U52sEXc=", "dev": true, "requires": { - "is-obj": "1.0.1" + "is-obj": "^1.0.0" } } } @@ -1725,10 +1725,10 @@ "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "requires": { - "buffer-from": "1.1.1", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "typedarray": "0.0.6" + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" } }, "config-chain": { @@ -1737,8 +1737,8 @@ "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", "dev": true, "requires": { - "ini": "1.3.5", - "proto-list": "1.2.4" + "ini": "^1.3.4", + "proto-list": "~1.2.1" } }, "console-control-strings": { @@ -1753,8 +1753,8 @@ "integrity": "sha512-YD1xzH7r9yXQte/HF9JBuEDfvjxxwDGGwZU1+ndanbY0oFgA+Po1T9JDSpPLdP0pZT6MhCAsdvFKC4TJ4MTJTA==", "dev": true, "requires": { - "compare-func": "1.3.2", - "q": "1.5.1" + "compare-func": "^1.3.1", + "q": "^1.5.1" } }, "conventional-changelog-core": { @@ -1763,19 +1763,19 @@ "integrity": "sha512-5teTAZOtJ4HLR6384h50nPAaKdDr+IaU0rnD2Gg2C3MS7hKsEPH8pZxrDNqam9eOSPQg9tET6uZY79zzgSz+ig==", "dev": true, "requires": { - "conventional-changelog-writer": "4.0.3", - "conventional-commits-parser": "3.0.1", - "dateformat": "3.0.3", - "get-pkg-repo": "1.4.0", + "conventional-changelog-writer": "^4.0.3", + "conventional-commits-parser": "^3.0.1", + "dateformat": "^3.0.0", + "get-pkg-repo": "^1.0.0", "git-raw-commits": "2.0.0", - "git-remote-origin-url": "2.0.0", - "git-semver-tags": "2.0.2", - "lodash": "4.17.11", - "normalize-package-data": "2.5.0", - "q": "1.5.1", - "read-pkg": "3.0.0", - "read-pkg-up": "3.0.0", - "through2": "2.0.5" + "git-remote-origin-url": "^2.0.0", + "git-semver-tags": "^2.0.2", + "lodash": "^4.2.1", + "normalize-package-data": "^2.3.5", + "q": "^1.5.1", + "read-pkg": "^3.0.0", + "read-pkg-up": "^3.0.0", + "through2": "^2.0.0" } }, "conventional-changelog-preset-loader": { @@ -1790,16 +1790,16 @@ "integrity": "sha512-bIlpSiQtQZ1+nDVHEEh798Erj2jhN/wEjyw9sfxY9es6h7pREE5BNJjfv0hXGH/FTrAsEpHUq4xzK99eePpwuA==", "dev": true, "requires": { - "compare-func": "1.3.2", - "conventional-commits-filter": "2.0.1", - "dateformat": "3.0.3", - "handlebars": "4.1.1", - "json-stringify-safe": "5.0.1", - "lodash": "4.17.11", - "meow": "4.0.1", - "semver": "5.7.0", - "split": "1.0.1", - "through2": "2.0.5" + "compare-func": "^1.3.1", + "conventional-commits-filter": "^2.0.1", + "dateformat": "^3.0.0", + "handlebars": "^4.1.0", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.2.1", + "meow": "^4.0.0", + "semver": "^5.5.0", + "split": "^1.0.0", + "through2": "^2.0.0" } }, "conventional-commits-filter": { @@ -1808,8 +1808,8 @@ "integrity": "sha512-92OU8pz/977udhBjgPEbg3sbYzIxMDFTlQT97w7KdhR9igNqdJvy8smmedAAgn4tPiqseFloKkrVfbXCVd+E7A==", "dev": true, "requires": { - "is-subset": "0.1.1", - "modify-values": "1.0.1" + "is-subset": "^0.1.1", + "modify-values": "^1.0.0" } }, "conventional-commits-parser": { @@ -1818,13 +1818,13 @@ "integrity": "sha512-P6U5UOvDeidUJ8ebHVDIoXzI7gMlQ1OF/id6oUvp8cnZvOXMt1n8nYl74Ey9YMn0uVQtxmCtjPQawpsssBWtGg==", "dev": true, "requires": { - "JSONStream": "1.3.5", - "is-text-path": "1.0.1", - "lodash": "4.17.11", - "meow": "4.0.1", - "split2": "2.2.0", - "through2": "2.0.5", - "trim-off-newlines": "1.0.1" + "JSONStream": "^1.0.4", + "is-text-path": "^1.0.0", + "lodash": "^4.2.1", + "meow": "^4.0.0", + "split2": "^2.0.0", + "through2": "^2.0.0", + "trim-off-newlines": "^1.0.0" } }, "conventional-recommended-bump": { @@ -1833,14 +1833,14 @@ "integrity": "sha512-9mY5Yoblq+ZMqJpBzgS+RpSq+SUfP2miOR3H/NR9drGf08WCrY9B6HAGJZEm6+ThsVP917VHAahSOjM6k1vhPg==", "dev": true, "requires": { - "concat-stream": "1.6.2", - "conventional-changelog-preset-loader": "2.0.2", - "conventional-commits-filter": "2.0.1", - "conventional-commits-parser": "3.0.1", + "concat-stream": "^1.6.0", + "conventional-changelog-preset-loader": "^2.0.2", + "conventional-commits-filter": "^2.0.1", + "conventional-commits-parser": "^3.0.1", "git-raw-commits": "2.0.0", - "git-semver-tags": "2.0.2", - "meow": "4.0.1", - "q": "1.5.1" + "git-semver-tags": "^2.0.2", + "meow": "^4.0.0", + "q": "^1.5.1" } }, "copy-concurrently": { @@ -1849,12 +1849,12 @@ "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", "dev": true, "requires": { - "aproba": "1.2.0", - "fs-write-stream-atomic": "1.0.10", - "iferr": "0.1.5", - "mkdirp": "0.5.1", - "rimraf": "2.6.3", - "run-queue": "1.0.3" + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" } }, "copy-descriptor": { @@ -1875,10 +1875,10 @@ "integrity": "sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g==", "dev": true, "requires": { - "import-fresh": "2.0.0", - "is-directory": "0.3.1", - "js-yaml": "3.13.0", - "parse-json": "4.0.0" + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.0", + "parse-json": "^4.0.0" } }, "coveralls": { @@ -1887,12 +1887,12 @@ "integrity": "sha512-viNfeGlda2zJr8Gj1zqXpDMRjw9uM54p7wzZdvLRyOgnAfCe974Dq4veZkjJdxQXbmdppu6flEajFYseHYaUhg==", "dev": true, "requires": { - "growl": "1.10.5", - "js-yaml": "3.13.0", - "lcov-parse": "0.0.10", - "log-driver": "1.2.7", - "minimist": "1.2.0", - "request": "2.88.0" + "growl": "~> 1.10.0", + "js-yaml": "^3.11.0", + "lcov-parse": "^0.0.10", + "log-driver": "^1.2.7", + "minimist": "^1.2.0", + "request": "^2.86.0" } }, "cross-spawn": { @@ -1901,11 +1901,11 @@ "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { - "nice-try": "1.0.5", - "path-key": "2.0.1", - "semver": "5.7.0", - "shebang-command": "1.2.0", - "which": "1.3.1" + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } }, "currently-unhandled": { @@ -1914,7 +1914,7 @@ "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", "dev": true, "requires": { - "array-find-index": "1.0.2" + "array-find-index": "^1.0.1" } }, "cyclist": { @@ -1929,7 +1929,7 @@ "integrity": "sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=", "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "dashdash": { @@ -1938,7 +1938,7 @@ "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "dev": true, "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "dateformat": { @@ -1974,8 +1974,8 @@ "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", "dev": true, "requires": { - "decamelize": "1.2.0", - "map-obj": "1.0.1" + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" }, "dependencies": { "map-obj": { @@ -2010,7 +2010,7 @@ "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", "dev": true, "requires": { - "clone": "1.0.4" + "clone": "^1.0.2" } }, "define-property": { @@ -2019,8 +2019,8 @@ "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "dev": true, "requires": { - "is-descriptor": "1.0.2", - "isobject": "3.0.1" + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" }, "dependencies": { "is-accessor-descriptor": { @@ -2029,7 +2029,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -2038,7 +2038,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -2047,9 +2047,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } } } @@ -2084,8 +2084,8 @@ "integrity": "sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=", "dev": true, "requires": { - "asap": "2.0.6", - "wrappy": "1.0.2" + "asap": "^2.0.0", + "wrappy": "1" } }, "diff": { @@ -2100,8 +2100,8 @@ "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", "dev": true, "requires": { - "arrify": "1.0.1", - "path-type": "3.0.0" + "arrify": "^1.0.1", + "path-type": "^3.0.0" } }, "domain-browser": { @@ -2116,7 +2116,7 @@ "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", "dev": true, "requires": { - "is-obj": "1.0.1" + "is-obj": "^1.0.0" } }, "duplexer": { @@ -2131,10 +2131,10 @@ "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", "dev": true, "requires": { - "end-of-stream": "1.4.1", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "stream-shift": "1.0.0" + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" } }, "ecc-jsbn": { @@ -2143,8 +2143,8 @@ "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "dev": true, "requires": { - "jsbn": "0.1.1", - "safer-buffer": "2.1.2" + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" } }, "ejs": { @@ -2159,7 +2159,7 @@ "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", "dev": true, "requires": { - "iconv-lite": "0.4.24" + "iconv-lite": "~0.4.13" } }, "end-of-stream": { @@ -2168,7 +2168,7 @@ "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "dev": true, "requires": { - "once": "1.4.0" + "once": "^1.4.0" } }, "err-code": { @@ -2183,7 +2183,7 @@ "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "^0.2.1" } }, "es6-promise": { @@ -2198,7 +2198,7 @@ "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "dev": true, "requires": { - "es6-promise": "4.2.6" + "es6-promise": "^4.0.3" } }, "escape-string-regexp": { @@ -2237,13 +2237,13 @@ "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "dev": true, "requires": { - "cross-spawn": "6.0.5", - "get-stream": "4.1.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" } }, "expand-brackets": { @@ -2252,13 +2252,13 @@ "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -2267,7 +2267,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -2276,7 +2276,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -2293,8 +2293,8 @@ "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "dev": true, "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -2303,7 +2303,7 @@ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -2314,9 +2314,9 @@ "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", "dev": true, "requires": { - "chardet": "0.7.0", - "iconv-lite": "0.4.24", - "tmp": "0.0.33" + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" } }, "extglob": { @@ -2325,14 +2325,14 @@ "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -2341,7 +2341,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "extend-shallow": { @@ -2350,7 +2350,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "is-accessor-descriptor": { @@ -2359,7 +2359,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -2368,7 +2368,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -2377,9 +2377,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } } } @@ -2402,12 +2402,12 @@ "integrity": "sha512-0BvMaZc1k9F+MeWWMe8pL6YltFzZYcJsYU7D4JyDA6PAczaXvxqQQ/z+mDF7/4Mw01DeUc+i3CTKajnkANkV4w==", "dev": true, "requires": { - "@mrmlnc/readdir-enhanced": "2.2.1", - "@nodelib/fs.stat": "1.1.3", - "glob-parent": "3.1.0", - "is-glob": "4.0.0", - "merge2": "1.2.3", - "micromatch": "3.1.10" + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.1.2", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.3", + "micromatch": "^3.1.10" }, "dependencies": { "is-glob": { @@ -2416,7 +2416,7 @@ "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", "dev": true, "requires": { - "is-extglob": "2.1.1" + "is-extglob": "^2.1.1" } } } @@ -2439,7 +2439,7 @@ "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "dev": true, "requires": { - "escape-string-regexp": "1.0.5" + "escape-string-regexp": "^1.0.5" } }, "fill-range": { @@ -2448,10 +2448,10 @@ "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" }, "dependencies": { "extend-shallow": { @@ -2460,7 +2460,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -2471,7 +2471,7 @@ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } }, "flush-write-stream": { @@ -2480,8 +2480,8 @@ "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", "dev": true, "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.6" + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" } }, "for-in": { @@ -2496,8 +2496,8 @@ "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", "dev": true, "requires": { - "cross-spawn": "4.0.2", - "signal-exit": "3.0.2" + "cross-spawn": "^4", + "signal-exit": "^3.0.0" }, "dependencies": { "cross-spawn": { @@ -2506,8 +2506,8 @@ "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", "dev": true, "requires": { - "lru-cache": "4.1.5", - "which": "1.3.1" + "lru-cache": "^4.0.1", + "which": "^1.2.9" } }, "lru-cache": { @@ -2516,8 +2516,8 @@ "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "dev": true, "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "yallist": { @@ -2540,9 +2540,9 @@ "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.7", - "mime-types": "2.1.22" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" } }, "fragment-cache": { @@ -2551,7 +2551,7 @@ "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, "requires": { - "map-cache": "0.2.2" + "map-cache": "^0.2.2" } }, "from2": { @@ -2560,8 +2560,8 @@ "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", "dev": true, "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.6" + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" } }, "fs-exists-cached": { @@ -2576,9 +2576,9 @@ "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", "dev": true, "requires": { - "graceful-fs": "4.1.15", - "jsonfile": "4.0.0", - "universalify": "0.1.2" + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" } }, "fs-minipass": { @@ -2587,7 +2587,7 @@ "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "requires": { - "minipass": "2.3.5" + "minipass": "^2.2.1" } }, "fs-write-stream-atomic": { @@ -2596,10 +2596,10 @@ "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", "dev": true, "requires": { - "graceful-fs": "4.1.15", - "iferr": "0.1.5", - "imurmurhash": "0.1.4", - "readable-stream": "2.3.6" + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" } }, "fs.realpath": { @@ -2614,10 +2614,10 @@ "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", "dev": true, "requires": { - "graceful-fs": "4.1.15", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.3" + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" } }, "function-loop": { @@ -2632,14 +2632,14 @@ "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.3" + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" } }, "genfun": { @@ -2660,11 +2660,11 @@ "integrity": "sha1-xztInAbYDMVTbCyFP54FIyBWly0=", "dev": true, "requires": { - "hosted-git-info": "2.7.1", - "meow": "3.7.0", - "normalize-package-data": "2.5.0", - "parse-github-repo-url": "1.4.1", - "through2": "2.0.5" + "hosted-git-info": "^2.1.4", + "meow": "^3.3.0", + "normalize-package-data": "^2.3.0", + "parse-github-repo-url": "^1.3.0", + "through2": "^2.0.0" }, "dependencies": { "camelcase": { @@ -2679,8 +2679,8 @@ "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "dev": true, "requires": { - "camelcase": "2.1.1", - "map-obj": "1.0.1" + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" } }, "find-up": { @@ -2689,8 +2689,8 @@ "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "indent-string": { @@ -2699,7 +2699,7 @@ "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", "dev": true, "requires": { - "repeating": "2.0.1" + "repeating": "^2.0.0" } }, "load-json-file": { @@ -2708,11 +2708,11 @@ "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { - "graceful-fs": "4.1.15", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" } }, "map-obj": { @@ -2727,16 +2727,16 @@ "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "dev": true, "requires": { - "camelcase-keys": "2.1.0", - "decamelize": "1.2.0", - "loud-rejection": "1.6.0", - "map-obj": "1.0.1", - "minimist": "1.2.0", - "normalize-package-data": "2.5.0", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "redent": "1.0.0", - "trim-newlines": "1.0.0" + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" } }, "parse-json": { @@ -2745,7 +2745,7 @@ "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { - "error-ex": "1.3.2" + "error-ex": "^1.2.0" } }, "path-exists": { @@ -2754,7 +2754,7 @@ "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { - "pinkie-promise": "2.0.1" + "pinkie-promise": "^2.0.0" } }, "path-type": { @@ -2763,9 +2763,9 @@ "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "dev": true, "requires": { - "graceful-fs": "4.1.15", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "pify": { @@ -2780,9 +2780,9 @@ "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "dev": true, "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.5.0", - "path-type": "1.1.0" + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" } }, "read-pkg-up": { @@ -2791,8 +2791,8 @@ "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" } }, "redent": { @@ -2801,8 +2801,8 @@ "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", "dev": true, "requires": { - "indent-string": "2.1.0", - "strip-indent": "1.0.1" + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" } }, "strip-bom": { @@ -2811,7 +2811,7 @@ "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "dev": true, "requires": { - "is-utf8": "0.2.1" + "is-utf8": "^0.2.0" } }, "strip-indent": { @@ -2820,7 +2820,7 @@ "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", "dev": true, "requires": { - "get-stdin": "4.0.1" + "get-stdin": "^4.0.1" } }, "trim-newlines": { @@ -2849,7 +2849,7 @@ "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "dev": true, "requires": { - "pump": "3.0.0" + "pump": "^3.0.0" } }, "get-value": { @@ -2864,7 +2864,7 @@ "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "dev": true, "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "git-raw-commits": { @@ -2873,11 +2873,11 @@ "integrity": "sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg==", "dev": true, "requires": { - "dargs": "4.1.0", - "lodash.template": "4.4.0", - "meow": "4.0.1", - "split2": "2.2.0", - "through2": "2.0.5" + "dargs": "^4.0.1", + "lodash.template": "^4.0.2", + "meow": "^4.0.0", + "split2": "^2.0.0", + "through2": "^2.0.0" } }, "git-remote-origin-url": { @@ -2886,8 +2886,8 @@ "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=", "dev": true, "requires": { - "gitconfiglocal": "1.0.0", - "pify": "2.3.0" + "gitconfiglocal": "^1.0.0", + "pify": "^2.3.0" }, "dependencies": { "pify": { @@ -2904,8 +2904,8 @@ "integrity": "sha512-34lMF7Yo1xEmsK2EkbArdoU79umpvm0MfzaDkSNYSJqtM5QLAVTPWgpiXSVI5o/O9EvZPSrP4Zvnec/CqhSd5w==", "dev": true, "requires": { - "meow": "4.0.1", - "semver": "5.7.0" + "meow": "^4.0.0", + "semver": "^5.5.0" } }, "git-up": { @@ -2914,8 +2914,8 @@ "integrity": "sha512-LFTZZrBlrCrGCG07/dm1aCjjpL1z9L3+5aEeI9SBhAqSc+kiA9Or1bgZhQFNppJX6h/f5McrvJt1mQXTFm6Qrw==", "dev": true, "requires": { - "is-ssh": "1.3.1", - "parse-url": "5.0.1" + "is-ssh": "^1.3.0", + "parse-url": "^5.0.0" } }, "git-url-parse": { @@ -2924,7 +2924,7 @@ "integrity": "sha512-gZeLVGY8QVKMIkckncX+iCq2/L8PlwncvDFKiWkBn9EtCfYDbliRTTp6qzyQ1VMdITUfq7293zDzfpjdiGASSQ==", "dev": true, "requires": { - "git-up": "4.0.1" + "git-up": "^4.0.0" } }, "gitconfiglocal": { @@ -2933,7 +2933,7 @@ "integrity": "sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=", "dev": true, "requires": { - "ini": "1.3.5" + "ini": "^1.3.2" } }, "glob": { @@ -2942,12 +2942,12 @@ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "glob-parent": { @@ -2956,8 +2956,8 @@ "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" } }, "glob-to-regexp": { @@ -2978,13 +2978,13 @@ "integrity": "sha512-yTzMmKygLp8RUpG1Ymu2VXPSJQZjNAZPD4ywgYEaG7e4tBJeUQBO8OpXrf1RCNcEs5alsoJYPAMiIHP0cmeC7w==", "dev": true, "requires": { - "array-union": "1.0.2", + "array-union": "^1.0.1", "dir-glob": "2.0.0", - "fast-glob": "2.2.6", - "glob": "7.1.3", - "ignore": "3.3.10", - "pify": "3.0.0", - "slash": "1.0.0" + "fast-glob": "^2.0.2", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" } }, "graceful-fs": { @@ -3005,10 +3005,10 @@ "integrity": "sha512-3Zhi6C0euYZL5sM0Zcy7lInLXKQ+YLcF/olbN010mzGQ4XVm50JeyBnMqofHh696GrciGruC7kCcApPDJvVgwA==", "dev": true, "requires": { - "neo-async": "2.6.0", - "optimist": "0.6.1", - "source-map": "0.6.1", - "uglify-js": "3.5.2" + "neo-async": "^2.6.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" }, "dependencies": { "source-map": { @@ -3031,8 +3031,8 @@ "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "dev": true, "requires": { - "ajv": "6.10.0", - "har-schema": "2.0.0" + "ajv": "^6.5.5", + "har-schema": "^2.0.0" } }, "has-ansi": { @@ -3041,7 +3041,7 @@ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "has-flag": { @@ -3062,9 +3062,9 @@ "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "dev": true, "requires": { - "get-value": "2.0.6", - "has-values": "1.0.0", - "isobject": "3.0.1" + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" } }, "has-values": { @@ -3073,8 +3073,8 @@ "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", "dev": true, "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" + "is-number": "^3.0.0", + "kind-of": "^4.0.0" }, "dependencies": { "kind-of": { @@ -3083,7 +3083,7 @@ "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -3106,7 +3106,7 @@ "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", "dev": true, "requires": { - "agent-base": "4.2.1", + "agent-base": "4", "debug": "3.1.0" }, "dependencies": { @@ -3127,9 +3127,9 @@ "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "dev": true, "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.16.1" + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "https-proxy-agent": { @@ -3138,8 +3138,8 @@ "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", "dev": true, "requires": { - "agent-base": "4.2.1", - "debug": "3.2.6" + "agent-base": "^4.1.0", + "debug": "^3.1.0" }, "dependencies": { "debug": { @@ -3148,7 +3148,7 @@ "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { - "ms": "2.1.1" + "ms": "^2.1.1" } }, "ms": { @@ -3165,7 +3165,7 @@ "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.0.0" } }, "iconv-lite": { @@ -3174,7 +3174,7 @@ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": ">= 2.1.2 < 3" } }, "iferr": { @@ -3195,7 +3195,7 @@ "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "requires": { - "minimatch": "3.0.4" + "minimatch": "^3.0.4" } }, "import-fresh": { @@ -3204,8 +3204,8 @@ "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", "dev": true, "requires": { - "caller-path": "2.0.0", - "resolve-from": "3.0.0" + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" }, "dependencies": { "resolve-from": { @@ -3222,8 +3222,8 @@ "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", "dev": true, "requires": { - "pkg-dir": "2.0.0", - "resolve-cwd": "2.0.0" + "pkg-dir": "^2.0.0", + "resolve-cwd": "^2.0.0" } }, "imurmurhash": { @@ -3244,8 +3244,8 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -3266,14 +3266,14 @@ "integrity": "sha512-zKSiXKhQveNteyhcj1CoOP8tqp1QuxPIPBl8Bid99DGLFqA1p87M6lNgfjJHSBoWJJlidGOv5rWjyYKEB3g2Jw==", "dev": true, "requires": { - "glob": "7.1.3", - "npm-package-arg": "6.1.0", - "promzard": "0.3.0", - "read": "1.0.7", - "read-package-json": "2.0.13", - "semver": "5.7.0", - "validate-npm-package-license": "3.0.4", - "validate-npm-package-name": "3.0.0" + "glob": "^7.1.1", + "npm-package-arg": "^4.0.0 || ^5.0.0 || ^6.0.0", + "promzard": "^0.3.0", + "read": "~1.0.1", + "read-package-json": "1 || 2", + "semver": "2.x || 3.x || 4 || 5", + "validate-npm-package-license": "^3.0.1", + "validate-npm-package-name": "^3.0.0" } }, "inquirer": { @@ -3282,19 +3282,19 @@ "integrity": "sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA==", "dev": true, "requires": { - "ansi-escapes": "3.2.0", - "chalk": "2.4.2", - "cli-cursor": "2.1.0", - "cli-width": "2.2.0", - "external-editor": "3.0.3", - "figures": "2.0.0", - "lodash": "4.17.11", + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.11", "mute-stream": "0.0.7", - "run-async": "2.3.0", - "rxjs": "6.4.0", - "string-width": "2.1.1", - "strip-ansi": "5.2.0", - "through": "2.3.8" + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.0.0", + "through": "^2.3.6" }, "dependencies": { "ansi-regex": { @@ -3315,8 +3315,8 @@ "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" }, "dependencies": { "strip-ansi": { @@ -3325,7 +3325,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } } } @@ -3336,7 +3336,7 @@ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "4.1.0" + "ansi-regex": "^4.1.0" }, "dependencies": { "ansi-regex": { @@ -3367,7 +3367,7 @@ "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -3376,7 +3376,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -3399,7 +3399,7 @@ "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", "dev": true, "requires": { - "ci-info": "1.6.0" + "ci-info": "^1.5.0" } }, "is-data-descriptor": { @@ -3408,7 +3408,7 @@ "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -3417,7 +3417,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -3428,9 +3428,9 @@ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" }, "dependencies": { "kind-of": { @@ -3465,7 +3465,7 @@ "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-fullwidth-code-point": { @@ -3474,7 +3474,7 @@ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-glob": { @@ -3483,7 +3483,7 @@ "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, "requires": { - "is-extglob": "2.1.1" + "is-extglob": "^2.1.0" } }, "is-number": { @@ -3492,7 +3492,7 @@ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -3501,7 +3501,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -3524,7 +3524,7 @@ "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.1" } }, "is-promise": { @@ -3539,7 +3539,7 @@ "integrity": "sha512-0eRIASHZt1E68/ixClI8bp2YK2wmBPVWEismTs6M+M099jKgrzl/3E976zIbImSIob48N2/XGe9y7ZiYdImSlg==", "dev": true, "requires": { - "protocols": "1.4.7" + "protocols": "^1.1.0" } }, "is-stream": { @@ -3560,7 +3560,7 @@ "integrity": "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=", "dev": true, "requires": { - "text-extensions": "1.9.0" + "text-extensions": "^1.0.0" } }, "is-typedarray": { @@ -3617,13 +3617,13 @@ "integrity": "sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA==", "dev": true, "requires": { - "@babel/generator": "7.4.0", - "@babel/parser": "7.4.2", - "@babel/template": "7.4.0", - "@babel/traverse": "7.4.0", - "@babel/types": "7.4.0", - "istanbul-lib-coverage": "2.0.3", - "semver": "5.7.0" + "@babel/generator": "^7.0.0", + "@babel/parser": "^7.0.0", + "@babel/template": "^7.0.0", + "@babel/traverse": "^7.0.0", + "@babel/types": "^7.0.0", + "istanbul-lib-coverage": "^2.0.3", + "semver": "^5.5.0" } }, "js-tokens": { @@ -3638,8 +3638,8 @@ "integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==", "dev": true, "requires": { - "argparse": "1.0.10", - "esprima": "4.0.1" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, "jsbn": { @@ -3684,7 +3684,7 @@ "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", "dev": true, "requires": { - "graceful-fs": "4.1.15" + "graceful-fs": "^4.1.6" } }, "jsonparse": { @@ -3717,7 +3717,7 @@ "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "dev": true, "requires": { - "invert-kv": "2.0.0" + "invert-kv": "^2.0.0" } }, "lcov-parse": { @@ -3747,8 +3747,8 @@ "@lerna/publish": "3.13.1", "@lerna/run": "3.13.1", "@lerna/version": "3.13.1", - "import-local": "1.0.0", - "npmlog": "4.1.2" + "import-local": "^1.0.0", + "npmlog": "^4.1.2" } }, "libnpmaccess": { @@ -3757,10 +3757,10 @@ "integrity": "sha512-RlZ7PNarCBt+XbnP7R6PoVgOq9t+kou5rvhaInoNibhPO7eMlRfS0B8yjatgn2yaHIwWNyoJDolC/6Lc5L/IQA==", "dev": true, "requires": { - "aproba": "2.0.0", - "get-stream": "4.1.0", - "npm-package-arg": "6.1.0", - "npm-registry-fetch": "3.9.0" + "aproba": "^2.0.0", + "get-stream": "^4.0.0", + "npm-package-arg": "^6.1.0", + "npm-registry-fetch": "^3.8.0" }, "dependencies": { "aproba": { @@ -3777,15 +3777,15 @@ "integrity": "sha512-nefbvJd/wY38zdt+b9SHL6171vqBrMtZ56Gsgfd0duEKb/pB8rDT4/ObUQLrHz1tOfht1flt2zM+UGaemzAG5g==", "dev": true, "requires": { - "aproba": "2.0.0", - "figgy-pudding": "3.5.1", - "get-stream": "4.1.0", - "lodash.clonedeep": "4.5.0", - "normalize-package-data": "2.5.0", - "npm-package-arg": "6.1.0", - "npm-registry-fetch": "3.9.0", - "semver": "5.7.0", - "ssri": "6.0.1" + "aproba": "^2.0.0", + "figgy-pudding": "^3.5.1", + "get-stream": "^4.0.0", + "lodash.clonedeep": "^4.5.0", + "normalize-package-data": "^2.4.0", + "npm-package-arg": "^6.1.0", + "npm-registry-fetch": "^3.8.0", + "semver": "^5.5.1", + "ssri": "^6.0.1" }, "dependencies": { "aproba": { @@ -3802,10 +3802,10 @@ "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "dev": true, "requires": { - "graceful-fs": "4.1.15", - "parse-json": "4.0.0", - "pify": "3.0.0", - "strip-bom": "3.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" } }, "locate-path": { @@ -3814,8 +3814,8 @@ "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { - "p-locate": "2.0.0", - "path-exists": "3.0.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" } }, "lodash": { @@ -3860,8 +3860,8 @@ "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", "dev": true, "requires": { - "lodash._reinterpolate": "3.0.0", - "lodash.templatesettings": "4.1.0" + "lodash._reinterpolate": "~3.0.0", + "lodash.templatesettings": "^4.0.0" } }, "lodash.templatesettings": { @@ -3870,7 +3870,7 @@ "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", "dev": true, "requires": { - "lodash._reinterpolate": "3.0.0" + "lodash._reinterpolate": "~3.0.0" } }, "lodash.uniq": { @@ -3891,8 +3891,8 @@ "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", "dev": true, "requires": { - "currently-unhandled": "0.4.1", - "signal-exit": "3.0.2" + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" } }, "lru-cache": { @@ -3901,7 +3901,7 @@ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "requires": { - "yallist": "3.0.3" + "yallist": "^3.0.2" } }, "macos-release": { @@ -3916,7 +3916,7 @@ "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, "requires": { - "pify": "3.0.0" + "pify": "^3.0.0" } }, "make-error": { @@ -3931,17 +3931,17 @@ "integrity": "sha512-7R5ivfy9ilRJ1EMKIOziwrns9fGeAD4bAha8EB7BIiBBLHm2KeTUGCrICFt2rbHfzheTLynv50GnNTK1zDTrcQ==", "dev": true, "requires": { - "agentkeepalive": "3.5.2", - "cacache": "11.3.2", - "http-cache-semantics": "3.8.1", - "http-proxy-agent": "2.1.0", - "https-proxy-agent": "2.2.1", - "lru-cache": "4.1.5", - "mississippi": "3.0.0", - "node-fetch-npm": "2.0.2", - "promise-retry": "1.1.1", - "socks-proxy-agent": "4.0.2", - "ssri": "6.0.1" + "agentkeepalive": "^3.4.1", + "cacache": "^11.0.1", + "http-cache-semantics": "^3.8.1", + "http-proxy-agent": "^2.1.0", + "https-proxy-agent": "^2.2.1", + "lru-cache": "^4.1.2", + "mississippi": "^3.0.0", + "node-fetch-npm": "^2.0.2", + "promise-retry": "^1.1.1", + "socks-proxy-agent": "^4.0.0", + "ssri": "^6.0.0" }, "dependencies": { "lru-cache": { @@ -3950,8 +3950,8 @@ "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "dev": true, "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "yallist": { @@ -3968,7 +3968,7 @@ "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", "dev": true, "requires": { - "p-defer": "1.0.0" + "p-defer": "^1.0.0" } }, "map-cache": { @@ -3989,7 +3989,7 @@ "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "dev": true, "requires": { - "object-visit": "1.0.1" + "object-visit": "^1.0.0" } }, "mem": { @@ -3998,9 +3998,9 @@ "integrity": "sha512-5fJxa68urlY0Ir8ijatKa3eRz5lwXnRCTvo9+TbTGAuTFJOwpGcY0X05moBd0nW45965Njt4CDI2GFQoG8DvqA==", "dev": true, "requires": { - "map-age-cleaner": "0.1.3", - "mimic-fn": "2.0.0", - "p-is-promise": "2.0.0" + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" }, "dependencies": { "mimic-fn": { @@ -4017,15 +4017,15 @@ "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", "dev": true, "requires": { - "camelcase-keys": "4.2.0", - "decamelize-keys": "1.1.0", - "loud-rejection": "1.6.0", - "minimist": "1.2.0", - "minimist-options": "3.0.2", - "normalize-package-data": "2.5.0", - "read-pkg-up": "3.0.0", - "redent": "2.0.0", - "trim-newlines": "2.0.0" + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist": "^1.1.3", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0" } }, "merge2": { @@ -4040,19 +4040,19 @@ "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.13", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" } }, "mime-db": { @@ -4067,7 +4067,7 @@ "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", "dev": true, "requires": { - "mime-db": "1.38.0" + "mime-db": "~1.38.0" } }, "mimic-fn": { @@ -4082,7 +4082,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -4097,8 +4097,8 @@ "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", "dev": true, "requires": { - "arrify": "1.0.1", - "is-plain-obj": "1.1.0" + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" } }, "minipass": { @@ -4107,8 +4107,8 @@ "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "dev": true, "requires": { - "safe-buffer": "5.1.2", - "yallist": "3.0.3" + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" } }, "minizlib": { @@ -4117,7 +4117,7 @@ "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "dev": true, "requires": { - "minipass": "2.3.5" + "minipass": "^2.2.1" } }, "mississippi": { @@ -4126,16 +4126,16 @@ "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", "dev": true, "requires": { - "concat-stream": "1.6.2", - "duplexify": "3.7.1", - "end-of-stream": "1.4.1", - "flush-write-stream": "1.1.1", - "from2": "2.3.0", - "parallel-transform": "1.1.0", - "pump": "3.0.0", - "pumpify": "1.5.1", - "stream-each": "1.2.3", - "through2": "2.0.5" + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" } }, "mixin-deep": { @@ -4144,8 +4144,8 @@ "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "dev": true, "requires": { - "for-in": "1.0.2", - "is-extendable": "1.0.1" + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -4154,7 +4154,7 @@ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -4188,12 +4188,12 @@ "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", "dev": true, "requires": { - "aproba": "1.2.0", - "copy-concurrently": "1.0.5", - "fs-write-stream-atomic": "1.0.10", - "mkdirp": "0.5.1", - "rimraf": "2.6.3", - "run-queue": "1.0.3" + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" } }, "ms": { @@ -4208,10 +4208,10 @@ "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", "dev": true, "requires": { - "array-differ": "1.0.0", - "array-union": "1.0.2", - "arrify": "1.0.1", - "minimatch": "3.0.4" + "array-differ": "^1.0.0", + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "minimatch": "^3.0.0" } }, "mute-stream": { @@ -4226,17 +4226,17 @@ "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", "dev": true, "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "fragment-cache": "0.2.1", - "is-windows": "1.0.2", - "kind-of": "6.0.2", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" } }, "neo-async": { @@ -4263,9 +4263,9 @@ "integrity": "sha512-nJIxm1QmAj4v3nfCvEeCrYSoVwXyxLnaPBK5W1W5DGEJwjlKuC2VEUycGw5oxk+4zZahRrB84PUJJgEmhFTDFw==", "dev": true, "requires": { - "encoding": "0.1.12", - "json-parse-better-errors": "1.0.2", - "safe-buffer": "5.1.2" + "encoding": "^0.1.11", + "json-parse-better-errors": "^1.0.0", + "safe-buffer": "^5.1.1" } }, "node-gyp": { @@ -4274,18 +4274,18 @@ "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", "dev": true, "requires": { - "fstream": "1.0.11", - "glob": "7.1.3", - "graceful-fs": "4.1.15", - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "npmlog": "4.1.2", - "osenv": "0.1.5", - "request": "2.88.0", - "rimraf": "2.6.3", - "semver": "5.3.0", - "tar": "2.2.1", - "which": "1.3.1" + "fstream": "^1.0.0", + "glob": "^7.0.3", + "graceful-fs": "^4.1.2", + "mkdirp": "^0.5.0", + "nopt": "2 || 3", + "npmlog": "0 || 1 || 2 || 3 || 4", + "osenv": "0", + "request": "^2.87.0", + "rimraf": "2", + "semver": "~5.3.0", + "tar": "^2.0.0", + "which": "1" }, "dependencies": { "semver": { @@ -4302,8 +4302,8 @@ "integrity": "sha512-gDNxrDWpx07BxYNO/jn1UrGI1vNhDQZrIFphbHMcTCDc5mrrqQBWfQMXPHJ5WSgbFwD1D6bv4HOsqtTrPG03AA==", "dev": true, "requires": { - "ejs": "2.6.1", - "tap": "12.6.1" + "ejs": "^2.5.2", + "tap": "^12.0.1" } }, "nopt": { @@ -4312,7 +4312,7 @@ "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "dev": true, "requires": { - "abbrev": "1.1.1" + "abbrev": "1" } }, "normalize-package-data": { @@ -4321,10 +4321,10 @@ "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "requires": { - "hosted-git-info": "2.7.1", - "resolve": "1.10.0", - "semver": "5.7.0", - "validate-npm-package-license": "3.0.4" + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, "normalize-url": { @@ -4345,14 +4345,14 @@ "integrity": "sha512-QbBfLlGBKsktwBZLj6AviHC6Q9Y3R/AY4a2PYSIRhSKSS0/CxRyD/PfxEX6tPeOCXQgMSNdwGeECacstgptc+g==", "dev": true, "requires": { - "byline": "5.0.0", - "graceful-fs": "4.1.15", - "node-gyp": "3.8.0", - "resolve-from": "4.0.0", - "slide": "1.1.6", + "byline": "^5.0.0", + "graceful-fs": "^4.1.11", + "node-gyp": "^3.8.0", + "resolve-from": "^4.0.0", + "slide": "^1.1.6", "uid-number": "0.0.6", - "umask": "1.1.0", - "which": "1.3.1" + "umask": "^1.1.0", + "which": "^1.3.1" } }, "npm-package-arg": { @@ -4361,10 +4361,10 @@ "integrity": "sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA==", "dev": true, "requires": { - "hosted-git-info": "2.7.1", - "osenv": "0.1.5", - "semver": "5.7.0", - "validate-npm-package-name": "3.0.0" + "hosted-git-info": "^2.6.0", + "osenv": "^0.1.5", + "semver": "^5.5.0", + "validate-npm-package-name": "^3.0.0" } }, "npm-packlist": { @@ -4373,8 +4373,8 @@ "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", "dev": true, "requires": { - "ignore-walk": "3.0.1", - "npm-bundled": "1.0.6" + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" } }, "npm-pick-manifest": { @@ -4383,9 +4383,9 @@ "integrity": "sha512-+IluBC5K201+gRU85vFlUwX3PFShZAbAgDNp2ewJdWMVSppdo/Zih0ul2Ecky/X7b51J7LrrUAP+XOmOCvYZqA==", "dev": true, "requires": { - "figgy-pudding": "3.5.1", - "npm-package-arg": "6.1.0", - "semver": "5.7.0" + "figgy-pudding": "^3.5.1", + "npm-package-arg": "^6.0.0", + "semver": "^5.4.1" } }, "npm-registry-fetch": { @@ -4394,12 +4394,12 @@ "integrity": "sha512-srwmt8YhNajAoSAaDWndmZgx89lJwIZ1GWxOuckH4Coek4uHv5S+o/l9FLQe/awA+JwTnj4FJHldxhlXdZEBmw==", "dev": true, "requires": { - "JSONStream": "1.3.5", - "bluebird": "3.5.3", - "figgy-pudding": "3.5.1", - "lru-cache": "4.1.5", - "make-fetch-happen": "4.0.1", - "npm-package-arg": "6.1.0" + "JSONStream": "^1.3.4", + "bluebird": "^3.5.1", + "figgy-pudding": "^3.4.1", + "lru-cache": "^4.1.3", + "make-fetch-happen": "^4.0.1", + "npm-package-arg": "^6.1.0" }, "dependencies": { "lru-cache": { @@ -4408,8 +4408,8 @@ "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "dev": true, "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "yallist": { @@ -4426,7 +4426,7 @@ "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { - "path-key": "2.0.1" + "path-key": "^2.0.0" } }, "npmlog": { @@ -4435,10 +4435,10 @@ "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "requires": { - "are-we-there-yet": "1.1.5", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" } }, "number-is-nan": { @@ -4453,30 +4453,30 @@ "integrity": "sha512-P+FwIuro2aFG6B0Esd9ZDWUd51uZrAEoGutqZxzrVmYl3qSfkLgcQpBPBjtDFsUQLFY1dvTQJPOyeqr8S9GF8w==", "dev": true, "requires": { - "archy": "1.0.0", - "arrify": "1.0.1", - "caching-transform": "3.0.1", - "convert-source-map": "1.6.0", - "find-cache-dir": "2.0.0", - "find-up": "3.0.0", - "foreground-child": "1.5.6", - "glob": "7.1.3", - "istanbul-lib-coverage": "2.0.3", - "istanbul-lib-hook": "2.0.3", - "istanbul-lib-instrument": "3.1.0", - "istanbul-lib-report": "2.0.4", - "istanbul-lib-source-maps": "3.0.2", - "istanbul-reports": "2.1.1", - "make-dir": "1.3.0", - "merge-source-map": "1.1.0", - "resolve-from": "4.0.0", - "rimraf": "2.6.3", - "signal-exit": "3.0.2", - "spawn-wrap": "1.4.2", - "test-exclude": "5.1.0", - "uuid": "3.3.2", - "yargs": "12.0.5", - "yargs-parser": "11.1.1" + "archy": "^1.0.0", + "arrify": "^1.0.1", + "caching-transform": "^3.0.1", + "convert-source-map": "^1.6.0", + "find-cache-dir": "^2.0.0", + "find-up": "^3.0.0", + "foreground-child": "^1.5.6", + "glob": "^7.1.3", + "istanbul-lib-coverage": "^2.0.3", + "istanbul-lib-hook": "^2.0.3", + "istanbul-lib-instrument": "^3.1.0", + "istanbul-lib-report": "^2.0.4", + "istanbul-lib-source-maps": "^3.0.2", + "istanbul-reports": "^2.1.1", + "make-dir": "^1.3.0", + "merge-source-map": "^1.1.0", + "resolve-from": "^4.0.0", + "rimraf": "^2.6.3", + "signal-exit": "^3.0.2", + "spawn-wrap": "^1.4.2", + "test-exclude": "^5.1.0", + "uuid": "^3.3.2", + "yargs": "^12.0.5", + "yargs-parser": "^11.1.1" }, "dependencies": { "ansi-regex": { @@ -4489,7 +4489,7 @@ "bundled": true, "dev": true, "requires": { - "default-require-extensions": "2.0.0" + "default-require-extensions": "^2.0.0" } }, "archy": { @@ -4507,7 +4507,7 @@ "bundled": true, "dev": true, "requires": { - "lodash": "4.17.11" + "lodash": "^4.17.11" } }, "balanced-match": { @@ -4520,7 +4520,7 @@ "bundled": true, "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -4529,10 +4529,10 @@ "bundled": true, "dev": true, "requires": { - "hasha": "3.0.0", - "make-dir": "1.3.0", - "package-hash": "3.0.0", - "write-file-atomic": "2.4.2" + "hasha": "^3.0.0", + "make-dir": "^1.3.0", + "package-hash": "^3.0.0", + "write-file-atomic": "^2.3.0" } }, "camelcase": { @@ -4545,9 +4545,9 @@ "bundled": true, "dev": true, "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" } }, "code-point-at": { @@ -4576,7 +4576,7 @@ "bundled": true, "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "~5.1.1" } }, "cross-spawn": { @@ -4584,8 +4584,8 @@ "bundled": true, "dev": true, "requires": { - "lru-cache": "4.1.5", - "which": "1.3.1" + "lru-cache": "^4.0.1", + "which": "^1.2.9" } }, "debug": { @@ -4593,7 +4593,7 @@ "bundled": true, "dev": true, "requires": { - "ms": "2.1.1" + "ms": "^2.1.1" } }, "decamelize": { @@ -4606,7 +4606,7 @@ "bundled": true, "dev": true, "requires": { - "strip-bom": "3.0.0" + "strip-bom": "^3.0.0" } }, "end-of-stream": { @@ -4614,7 +4614,7 @@ "bundled": true, "dev": true, "requires": { - "once": "1.4.0" + "once": "^1.4.0" } }, "error-ex": { @@ -4622,7 +4622,7 @@ "bundled": true, "dev": true, "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "^0.2.1" } }, "es6-error": { @@ -4635,13 +4635,13 @@ "bundled": true, "dev": true, "requires": { - "cross-spawn": "6.0.5", - "get-stream": "4.1.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" }, "dependencies": { "cross-spawn": { @@ -4649,11 +4649,11 @@ "bundled": true, "dev": true, "requires": { - "nice-try": "1.0.5", - "path-key": "2.0.1", - "semver": "5.6.0", - "shebang-command": "1.2.0", - "which": "1.3.1" + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } } } @@ -4663,9 +4663,9 @@ "bundled": true, "dev": true, "requires": { - "commondir": "1.0.1", - "make-dir": "1.3.0", - "pkg-dir": "3.0.0" + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^3.0.0" } }, "find-up": { @@ -4673,7 +4673,7 @@ "bundled": true, "dev": true, "requires": { - "locate-path": "3.0.0" + "locate-path": "^3.0.0" } }, "foreground-child": { @@ -4681,8 +4681,8 @@ "bundled": true, "dev": true, "requires": { - "cross-spawn": "4.0.2", - "signal-exit": "3.0.2" + "cross-spawn": "^4", + "signal-exit": "^3.0.0" } }, "fs.realpath": { @@ -4700,7 +4700,7 @@ "bundled": true, "dev": true, "requires": { - "pump": "3.0.0" + "pump": "^3.0.0" } }, "glob": { @@ -4708,12 +4708,12 @@ "bundled": true, "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "graceful-fs": { @@ -4726,10 +4726,10 @@ "bundled": true, "dev": true, "requires": { - "async": "2.6.2", - "optimist": "0.6.1", - "source-map": "0.6.1", - "uglify-js": "3.4.9" + "async": "^2.5.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" }, "dependencies": { "source-map": { @@ -4749,7 +4749,7 @@ "bundled": true, "dev": true, "requires": { - "is-stream": "1.1.0" + "is-stream": "^1.0.1" } }, "hosted-git-info": { @@ -4767,8 +4767,8 @@ "bundled": true, "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -4811,7 +4811,7 @@ "bundled": true, "dev": true, "requires": { - "append-transform": "1.0.0" + "append-transform": "^1.0.0" } }, "istanbul-lib-report": { @@ -4819,9 +4819,9 @@ "bundled": true, "dev": true, "requires": { - "istanbul-lib-coverage": "2.0.3", - "make-dir": "1.3.0", - "supports-color": "6.1.0" + "istanbul-lib-coverage": "^2.0.3", + "make-dir": "^1.3.0", + "supports-color": "^6.0.0" }, "dependencies": { "supports-color": { @@ -4829,7 +4829,7 @@ "bundled": true, "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } } } @@ -4839,11 +4839,11 @@ "bundled": true, "dev": true, "requires": { - "debug": "4.1.1", - "istanbul-lib-coverage": "2.0.3", - "make-dir": "1.3.0", - "rimraf": "2.6.3", - "source-map": "0.6.1" + "debug": "^4.1.1", + "istanbul-lib-coverage": "^2.0.3", + "make-dir": "^1.3.0", + "rimraf": "^2.6.2", + "source-map": "^0.6.1" }, "dependencies": { "source-map": { @@ -4858,7 +4858,7 @@ "bundled": true, "dev": true, "requires": { - "handlebars": "4.1.0" + "handlebars": "^4.1.0" } }, "json-parse-better-errors": { @@ -4871,7 +4871,7 @@ "bundled": true, "dev": true, "requires": { - "invert-kv": "2.0.0" + "invert-kv": "^2.0.0" } }, "load-json-file": { @@ -4879,10 +4879,10 @@ "bundled": true, "dev": true, "requires": { - "graceful-fs": "4.1.15", - "parse-json": "4.0.0", - "pify": "3.0.0", - "strip-bom": "3.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" } }, "locate-path": { @@ -4890,8 +4890,8 @@ "bundled": true, "dev": true, "requires": { - "p-locate": "3.0.0", - "path-exists": "3.0.0" + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" } }, "lodash": { @@ -4909,8 +4909,8 @@ "bundled": true, "dev": true, "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "make-dir": { @@ -4918,7 +4918,7 @@ "bundled": true, "dev": true, "requires": { - "pify": "3.0.0" + "pify": "^3.0.0" } }, "map-age-cleaner": { @@ -4926,7 +4926,7 @@ "bundled": true, "dev": true, "requires": { - "p-defer": "1.0.0" + "p-defer": "^1.0.0" } }, "mem": { @@ -4934,9 +4934,9 @@ "bundled": true, "dev": true, "requires": { - "map-age-cleaner": "0.1.3", - "mimic-fn": "1.2.0", - "p-is-promise": "2.0.0" + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^1.0.0", + "p-is-promise": "^2.0.0" } }, "merge-source-map": { @@ -4944,7 +4944,7 @@ "bundled": true, "dev": true, "requires": { - "source-map": "0.6.1" + "source-map": "^0.6.1" }, "dependencies": { "source-map": { @@ -4964,7 +4964,7 @@ "bundled": true, "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -5002,10 +5002,10 @@ "bundled": true, "dev": true, "requires": { - "hosted-git-info": "2.7.1", - "resolve": "1.10.0", - "semver": "5.6.0", - "validate-npm-package-license": "3.0.4" + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, "npm-run-path": { @@ -5013,7 +5013,7 @@ "bundled": true, "dev": true, "requires": { - "path-key": "2.0.1" + "path-key": "^2.0.0" } }, "number-is-nan": { @@ -5026,7 +5026,7 @@ "bundled": true, "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "optimist": { @@ -5034,8 +5034,8 @@ "bundled": true, "dev": true, "requires": { - "minimist": "0.0.10", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" } }, "os-homedir": { @@ -5048,9 +5048,9 @@ "bundled": true, "dev": true, "requires": { - "execa": "1.0.0", - "lcid": "2.0.0", - "mem": "4.1.0" + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" } }, "p-defer": { @@ -5073,7 +5073,7 @@ "bundled": true, "dev": true, "requires": { - "p-try": "2.0.0" + "p-try": "^2.0.0" } }, "p-locate": { @@ -5081,7 +5081,7 @@ "bundled": true, "dev": true, "requires": { - "p-limit": "2.1.0" + "p-limit": "^2.0.0" } }, "p-try": { @@ -5094,10 +5094,10 @@ "bundled": true, "dev": true, "requires": { - "graceful-fs": "4.1.15", - "hasha": "3.0.0", - "lodash.flattendeep": "4.4.0", - "release-zalgo": "1.0.0" + "graceful-fs": "^4.1.15", + "hasha": "^3.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" } }, "parse-json": { @@ -5105,8 +5105,8 @@ "bundled": true, "dev": true, "requires": { - "error-ex": "1.3.2", - "json-parse-better-errors": "1.0.2" + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" } }, "path-exists": { @@ -5134,7 +5134,7 @@ "bundled": true, "dev": true, "requires": { - "pify": "3.0.0" + "pify": "^3.0.0" } }, "pify": { @@ -5147,7 +5147,7 @@ "bundled": true, "dev": true, "requires": { - "find-up": "3.0.0" + "find-up": "^3.0.0" } }, "pseudomap": { @@ -5160,8 +5160,8 @@ "bundled": true, "dev": true, "requires": { - "end-of-stream": "1.4.1", - "once": "1.4.0" + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } }, "read-pkg": { @@ -5169,9 +5169,9 @@ "bundled": true, "dev": true, "requires": { - "load-json-file": "4.0.0", - "normalize-package-data": "2.5.0", - "path-type": "3.0.0" + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" } }, "read-pkg-up": { @@ -5179,8 +5179,8 @@ "bundled": true, "dev": true, "requires": { - "find-up": "3.0.0", - "read-pkg": "3.0.0" + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" } }, "release-zalgo": { @@ -5188,7 +5188,7 @@ "bundled": true, "dev": true, "requires": { - "es6-error": "4.1.1" + "es6-error": "^4.0.1" } }, "require-directory": { @@ -5206,7 +5206,7 @@ "bundled": true, "dev": true, "requires": { - "path-parse": "1.0.6" + "path-parse": "^1.0.6" } }, "resolve-from": { @@ -5219,7 +5219,7 @@ "bundled": true, "dev": true, "requires": { - "glob": "7.1.3" + "glob": "^7.1.3" } }, "safe-buffer": { @@ -5242,7 +5242,7 @@ "bundled": true, "dev": true, "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -5260,12 +5260,12 @@ "bundled": true, "dev": true, "requires": { - "foreground-child": "1.5.6", - "mkdirp": "0.5.1", - "os-homedir": "1.0.2", - "rimraf": "2.6.3", - "signal-exit": "3.0.2", - "which": "1.3.1" + "foreground-child": "^1.5.6", + "mkdirp": "^0.5.0", + "os-homedir": "^1.0.1", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.2", + "which": "^1.3.0" } }, "spdx-correct": { @@ -5273,8 +5273,8 @@ "bundled": true, "dev": true, "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.3" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { @@ -5287,8 +5287,8 @@ "bundled": true, "dev": true, "requires": { - "spdx-exceptions": "2.2.0", - "spdx-license-ids": "3.0.3" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { @@ -5301,8 +5301,8 @@ "bundled": true, "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -5310,7 +5310,7 @@ "bundled": true, "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } }, "strip-bom": { @@ -5328,10 +5328,10 @@ "bundled": true, "dev": true, "requires": { - "arrify": "1.0.1", - "minimatch": "3.0.4", - "read-pkg-up": "4.0.0", - "require-main-filename": "1.0.1" + "arrify": "^1.0.1", + "minimatch": "^3.0.4", + "read-pkg-up": "^4.0.0", + "require-main-filename": "^1.0.1" } }, "uglify-js": { @@ -5340,8 +5340,8 @@ "dev": true, "optional": true, "requires": { - "commander": "2.17.1", - "source-map": "0.6.1" + "commander": "~2.17.1", + "source-map": "~0.6.1" }, "dependencies": { "source-map": { @@ -5362,8 +5362,8 @@ "bundled": true, "dev": true, "requires": { - "spdx-correct": "3.1.0", - "spdx-expression-parse": "3.0.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, "which": { @@ -5371,7 +5371,7 @@ "bundled": true, "dev": true, "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "which-module": { @@ -5389,8 +5389,8 @@ "bundled": true, "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" }, "dependencies": { "ansi-regex": { @@ -5403,7 +5403,7 @@ "bundled": true, "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "string-width": { @@ -5411,9 +5411,9 @@ "bundled": true, "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "strip-ansi": { @@ -5421,7 +5421,7 @@ "bundled": true, "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } } } @@ -5436,9 +5436,9 @@ "bundled": true, "dev": true, "requires": { - "graceful-fs": "4.1.15", - "imurmurhash": "0.1.4", - "signal-exit": "3.0.2" + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" } }, "y18n": { @@ -5456,18 +5456,18 @@ "bundled": true, "dev": true, "requires": { - "cliui": "4.1.0", - "decamelize": "1.2.0", - "find-up": "3.0.0", - "get-caller-file": "1.0.3", - "os-locale": "3.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "4.0.0", - "yargs-parser": "11.1.1" + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" } }, "yargs-parser": { @@ -5475,8 +5475,8 @@ "bundled": true, "dev": true, "requires": { - "camelcase": "5.0.0", - "decamelize": "1.2.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } @@ -5499,9 +5499,9 @@ "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "dev": true, "requires": { - "copy-descriptor": "0.1.1", - "define-property": "0.2.5", - "kind-of": "3.2.2" + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" }, "dependencies": { "define-property": { @@ -5510,7 +5510,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "kind-of": { @@ -5519,7 +5519,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -5530,7 +5530,7 @@ "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.0" } }, "object.pick": { @@ -5539,7 +5539,7 @@ "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.1" } }, "octokit-pagination-methods": { @@ -5554,7 +5554,7 @@ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "onetime": { @@ -5563,7 +5563,7 @@ "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "dev": true, "requires": { - "mimic-fn": "1.2.0" + "mimic-fn": "^1.0.0" } }, "opener": { @@ -5578,8 +5578,8 @@ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "minimist": "0.0.10", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" }, "dependencies": { "minimist": { @@ -5602,9 +5602,9 @@ "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "dev": true, "requires": { - "execa": "1.0.0", - "lcid": "2.0.0", - "mem": "4.2.0" + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" } }, "os-name": { @@ -5613,8 +5613,8 @@ "integrity": "sha512-7c74tib2FsdFbQ3W+qj8Tyd1R3Z6tuVRNNxXjJcZ4NgjIEQU9N/prVMqcW29XZPXGACqaXN3jq58/6hoaoXH6g==", "dev": true, "requires": { - "macos-release": "2.1.0", - "windows-release": "3.1.0" + "macos-release": "^2.0.0", + "windows-release": "^3.1.0" } }, "os-tmpdir": { @@ -5629,8 +5629,8 @@ "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" } }, "own-or": { @@ -5645,7 +5645,7 @@ "integrity": "sha512-y8qULRbRAlL6x2+M0vIe7jJbJx/kmUTzYonRAa2ayesR2qWLswninkVyeJe4x3IEXhdgoNodzjQRKAoEs6Fmrw==", "dev": true, "requires": { - "own-or": "1.0.0" + "own-or": "^1.0.0" } }, "p-defer": { @@ -5672,7 +5672,7 @@ "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { - "p-try": "1.0.0" + "p-try": "^1.0.0" } }, "p-locate": { @@ -5681,7 +5681,7 @@ "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { - "p-limit": "1.3.0" + "p-limit": "^1.1.0" } }, "p-map": { @@ -5696,7 +5696,7 @@ "integrity": "sha1-v5j+V1cFZYqeE1G++4WuTB8Hvco=", "dev": true, "requires": { - "p-reduce": "1.0.0" + "p-reduce": "^1.0.0" } }, "p-pipe": { @@ -5723,7 +5723,7 @@ "integrity": "sha1-ftlLPOszMngjU69qrhGqn8I1uwA=", "dev": true, "requires": { - "p-reduce": "1.0.0" + "p-reduce": "^1.0.0" } }, "pacote": { @@ -5732,33 +5732,33 @@ "integrity": "sha512-aUplXozRbzhaJO48FaaeClmN+2Mwt741MC6M3bevIGZwdCaP7frXzbUOfOWa91FPHoLITzG0hYaKY363lxO3bg==", "dev": true, "requires": { - "bluebird": "3.5.3", - "cacache": "11.3.2", - "figgy-pudding": "3.5.1", - "get-stream": "4.1.0", - "glob": "7.1.3", - "lru-cache": "5.1.1", - "make-fetch-happen": "4.0.1", - "minimatch": "3.0.4", - "minipass": "2.3.5", - "mississippi": "3.0.0", - "mkdirp": "0.5.1", - "normalize-package-data": "2.5.0", - "npm-package-arg": "6.1.0", - "npm-packlist": "1.4.1", - "npm-pick-manifest": "2.2.3", - "npm-registry-fetch": "3.9.0", - "osenv": "0.1.5", - "promise-inflight": "1.0.1", - "promise-retry": "1.1.1", - "protoduck": "5.0.1", - "rimraf": "2.6.3", - "safe-buffer": "5.1.2", - "semver": "5.7.0", - "ssri": "6.0.1", - "tar": "4.4.8", - "unique-filename": "1.1.1", - "which": "1.3.1" + "bluebird": "^3.5.3", + "cacache": "^11.3.2", + "figgy-pudding": "^3.5.1", + "get-stream": "^4.1.0", + "glob": "^7.1.3", + "lru-cache": "^5.1.1", + "make-fetch-happen": "^4.0.1", + "minimatch": "^3.0.4", + "minipass": "^2.3.5", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "normalize-package-data": "^2.4.0", + "npm-package-arg": "^6.1.0", + "npm-packlist": "^1.1.12", + "npm-pick-manifest": "^2.2.3", + "npm-registry-fetch": "^3.8.0", + "osenv": "^0.1.5", + "promise-inflight": "^1.0.1", + "promise-retry": "^1.1.1", + "protoduck": "^5.0.1", + "rimraf": "^2.6.2", + "safe-buffer": "^5.1.2", + "semver": "^5.6.0", + "ssri": "^6.0.1", + "tar": "^4.4.8", + "unique-filename": "^1.1.1", + "which": "^1.3.1" }, "dependencies": { "tar": { @@ -5767,13 +5767,13 @@ "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "dev": true, "requires": { - "chownr": "1.1.1", - "fs-minipass": "1.2.5", - "minipass": "2.3.5", - "minizlib": "1.2.1", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.2", - "yallist": "3.0.3" + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" } } } @@ -5784,9 +5784,9 @@ "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", "dev": true, "requires": { - "cyclist": "0.2.2", - "inherits": "2.0.3", - "readable-stream": "2.3.6" + "cyclist": "~0.2.2", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" } }, "parse-github-repo-url": { @@ -5801,8 +5801,8 @@ "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "dev": true, "requires": { - "error-ex": "1.3.2", - "json-parse-better-errors": "1.0.2" + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" } }, "parse-path": { @@ -5811,8 +5811,8 @@ "integrity": "sha512-d7yhga0Oc+PwNXDvQ0Jv1BuWkLVPXcAoQ/WREgd6vNNoKYaW52KI+RdOFjI63wjkmps9yUE8VS4veP+AgpQ/hA==", "dev": true, "requires": { - "is-ssh": "1.3.1", - "protocols": "1.4.7" + "is-ssh": "^1.3.0", + "protocols": "^1.4.0" } }, "parse-url": { @@ -5821,10 +5821,10 @@ "integrity": "sha512-flNUPP27r3vJpROi0/R3/2efgKkyXqnXwyP1KQ2U0SfFRgdizOdWfvrrvJg1LuOoxs7GQhmxJlq23IpQ/BkByg==", "dev": true, "requires": { - "is-ssh": "1.3.1", - "normalize-url": "3.3.0", - "parse-path": "4.0.1", - "protocols": "1.4.7" + "is-ssh": "^1.3.0", + "normalize-url": "^3.3.0", + "parse-path": "^4.0.0", + "protocols": "^1.4.0" } }, "pascalcase": { @@ -5869,7 +5869,7 @@ "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", "dev": true, "requires": { - "pify": "3.0.0" + "pify": "^3.0.0" } }, "performance-now": { @@ -5896,7 +5896,7 @@ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "pkg-dir": { @@ -5905,7 +5905,7 @@ "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", "dev": true, "requires": { - "find-up": "2.1.0" + "find-up": "^2.1.0" } }, "posix-character-classes": { @@ -5932,8 +5932,8 @@ "integrity": "sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0=", "dev": true, "requires": { - "err-code": "1.1.2", - "retry": "0.10.1" + "err-code": "^1.0.0", + "retry": "^0.10.0" } }, "promzard": { @@ -5942,7 +5942,7 @@ "integrity": "sha1-JqXW7ox97kyxIggwWs+5O6OCqe4=", "dev": true, "requires": { - "read": "1.0.7" + "read": "1" } }, "proto-list": { @@ -5963,7 +5963,7 @@ "integrity": "sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==", "dev": true, "requires": { - "genfun": "5.0.0" + "genfun": "^5.0.0" } }, "pseudomap": { @@ -5984,8 +5984,8 @@ "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "requires": { - "end-of-stream": "1.4.1", - "once": "1.4.0" + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } }, "pumpify": { @@ -5994,9 +5994,9 @@ "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", "dev": true, "requires": { - "duplexify": "3.7.1", - "inherits": "2.0.3", - "pump": "2.0.1" + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" }, "dependencies": { "pump": { @@ -6005,8 +6005,8 @@ "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", "dev": true, "requires": { - "end-of-stream": "1.4.1", - "once": "1.4.0" + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } } } @@ -6041,7 +6041,7 @@ "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", "dev": true, "requires": { - "mute-stream": "0.0.7" + "mute-stream": "~0.0.4" } }, "read-cmd-shim": { @@ -6050,7 +6050,7 @@ "integrity": "sha1-LV0Vd4ajfAVdIgd8MsU/gynpHHs=", "dev": true, "requires": { - "graceful-fs": "4.1.15" + "graceful-fs": "^4.1.2" } }, "read-package-json": { @@ -6059,11 +6059,11 @@ "integrity": "sha512-/1dZ7TRZvGrYqE0UAfN6qQb5GYBsNcqS1C0tNK601CFOJmtHI7NIGXwetEPU/OtoFHZL3hDxm4rolFFVE9Bnmg==", "dev": true, "requires": { - "glob": "7.1.3", - "graceful-fs": "4.1.15", - "json-parse-better-errors": "1.0.2", - "normalize-package-data": "2.5.0", - "slash": "1.0.0" + "glob": "^7.1.1", + "graceful-fs": "^4.1.2", + "json-parse-better-errors": "^1.0.1", + "normalize-package-data": "^2.0.0", + "slash": "^1.0.0" } }, "read-package-tree": { @@ -6072,11 +6072,11 @@ "integrity": "sha512-rW3XWUUkhdKmN2JKB4FL563YAgtINifso5KShykufR03nJ5loGFlkUMe1g/yxmqX073SoYYTsgXu7XdDinKZuA==", "dev": true, "requires": { - "debuglog": "1.0.1", - "dezalgo": "1.0.3", - "once": "1.4.0", - "read-package-json": "2.0.13", - "readdir-scoped-modules": "1.0.2" + "debuglog": "^1.0.1", + "dezalgo": "^1.0.0", + "once": "^1.3.0", + "read-package-json": "^2.0.0", + "readdir-scoped-modules": "^1.0.0" } }, "read-pkg": { @@ -6085,9 +6085,9 @@ "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", "dev": true, "requires": { - "load-json-file": "4.0.0", - "normalize-package-data": "2.5.0", - "path-type": "3.0.0" + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" } }, "read-pkg-up": { @@ -6096,8 +6096,8 @@ "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", "dev": true, "requires": { - "find-up": "2.1.0", - "read-pkg": "3.0.0" + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" } }, "readable-stream": { @@ -6106,13 +6106,13 @@ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, "readdir-scoped-modules": { @@ -6121,10 +6121,10 @@ "integrity": "sha1-n6+jfShr5dksuuve4DDcm19AZ0c=", "dev": true, "requires": { - "debuglog": "1.0.1", - "dezalgo": "1.0.3", - "graceful-fs": "4.1.15", - "once": "1.4.0" + "debuglog": "^1.0.1", + "dezalgo": "^1.0.0", + "graceful-fs": "^4.1.2", + "once": "^1.3.0" } }, "redent": { @@ -6133,8 +6133,8 @@ "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", "dev": true, "requires": { - "indent-string": "3.2.0", - "strip-indent": "2.0.0" + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" } }, "regex-not": { @@ -6143,8 +6143,8 @@ "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "dev": true, "requires": { - "extend-shallow": "3.0.2", - "safe-regex": "1.1.0" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" } }, "repeat-element": { @@ -6165,7 +6165,7 @@ "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", "dev": true, "requires": { - "is-finite": "1.0.2" + "is-finite": "^1.0.0" } }, "request": { @@ -6174,26 +6174,26 @@ "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", "dev": true, "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.8.0", - "caseless": "0.12.0", - "combined-stream": "1.0.7", - "extend": "3.0.2", - "forever-agent": "0.6.1", - "form-data": "2.3.3", - "har-validator": "5.1.3", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.22", - "oauth-sign": "0.9.0", - "performance-now": "2.1.0", - "qs": "6.5.2", - "safe-buffer": "5.1.2", - "tough-cookie": "2.4.3", - "tunnel-agent": "0.6.0", - "uuid": "3.3.2" + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" } }, "require-directory": { @@ -6214,7 +6214,7 @@ "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", "dev": true, "requires": { - "path-parse": "1.0.6" + "path-parse": "^1.0.6" } }, "resolve-cwd": { @@ -6223,7 +6223,7 @@ "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", "dev": true, "requires": { - "resolve-from": "3.0.0" + "resolve-from": "^3.0.0" }, "dependencies": { "resolve-from": { @@ -6252,8 +6252,8 @@ "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "dev": true, "requires": { - "onetime": "2.0.1", - "signal-exit": "3.0.2" + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" } }, "ret": { @@ -6274,7 +6274,7 @@ "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { - "glob": "7.1.3" + "glob": "^7.1.3" } }, "run-async": { @@ -6283,7 +6283,7 @@ "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", "dev": true, "requires": { - "is-promise": "2.1.0" + "is-promise": "^2.1.0" } }, "run-queue": { @@ -6292,7 +6292,7 @@ "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", "dev": true, "requires": { - "aproba": "1.2.0" + "aproba": "^1.1.1" } }, "rxjs": { @@ -6301,7 +6301,7 @@ "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==", "dev": true, "requires": { - "tslib": "1.9.3" + "tslib": "^1.9.0" } }, "safe-buffer": { @@ -6316,7 +6316,7 @@ "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { - "ret": "0.1.15" + "ret": "~0.1.10" } }, "safer-buffer": { @@ -6343,10 +6343,10 @@ "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "split-string": "3.1.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -6355,7 +6355,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -6366,7 +6366,7 @@ "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -6405,14 +6405,14 @@ "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", "dev": true, "requires": { - "base": "0.11.2", - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "map-cache": "0.2.2", - "source-map": "0.5.7", - "source-map-resolve": "0.5.2", - "use": "3.1.1" + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" }, "dependencies": { "define-property": { @@ -6421,7 +6421,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -6430,7 +6430,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -6441,9 +6441,9 @@ "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "dev": true, "requires": { - "define-property": "1.0.0", - "isobject": "3.0.1", - "snapdragon-util": "3.0.1" + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" }, "dependencies": { "define-property": { @@ -6452,7 +6452,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "is-accessor-descriptor": { @@ -6461,7 +6461,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -6470,7 +6470,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -6479,9 +6479,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } } } @@ -6492,7 +6492,7 @@ "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.2.0" }, "dependencies": { "kind-of": { @@ -6501,7 +6501,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -6512,7 +6512,7 @@ "integrity": "sha512-pCpjxQgOByDHLlNqlnh/mNSAxIUkyBBuwwhTcV+enZGbDaClPvHdvm6uvOwZfFJkam7cGhBNbb4JxiP8UZkRvQ==", "dev": true, "requires": { - "ip": "1.1.5", + "ip": "^1.1.5", "smart-buffer": "4.0.2" } }, @@ -6522,8 +6522,8 @@ "integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==", "dev": true, "requires": { - "agent-base": "4.2.1", - "socks": "2.3.2" + "agent-base": "~4.2.1", + "socks": "~2.3.2" } }, "sort-keys": { @@ -6532,7 +6532,7 @@ "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", "dev": true, "requires": { - "is-plain-obj": "1.1.0" + "is-plain-obj": "^1.0.0" } }, "source-map": { @@ -6547,11 +6547,11 @@ "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", "dev": true, "requires": { - "atob": "2.1.2", - "decode-uri-component": "0.2.0", - "resolve-url": "0.2.1", - "source-map-url": "0.4.0", - "urix": "0.1.0" + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" } }, "source-map-support": { @@ -6560,8 +6560,8 @@ "integrity": "sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ==", "dev": true, "requires": { - "buffer-from": "1.1.1", - "source-map": "0.6.1" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" }, "dependencies": { "source-map": { @@ -6584,8 +6584,8 @@ "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", "dev": true, "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.3" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { @@ -6600,8 +6600,8 @@ "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "dev": true, "requires": { - "spdx-exceptions": "2.2.0", - "spdx-license-ids": "3.0.3" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { @@ -6616,7 +6616,7 @@ "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", "dev": true, "requires": { - "through": "2.3.8" + "through": "2" } }, "split-string": { @@ -6625,7 +6625,7 @@ "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, "requires": { - "extend-shallow": "3.0.2" + "extend-shallow": "^3.0.0" } }, "split2": { @@ -6634,7 +6634,7 @@ "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", "dev": true, "requires": { - "through2": "2.0.5" + "through2": "^2.0.2" } }, "sprintf-js": { @@ -6649,15 +6649,15 @@ "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "dev": true, "requires": { - "asn1": "0.2.4", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.2", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.2", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "safer-buffer": "2.1.2", - "tweetnacl": "0.14.5" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" } }, "ssri": { @@ -6666,7 +6666,7 @@ "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", "dev": true, "requires": { - "figgy-pudding": "3.5.1" + "figgy-pudding": "^3.5.1" } }, "stack-utils": { @@ -6681,8 +6681,8 @@ "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "dev": true, "requires": { - "define-property": "0.2.5", - "object-copy": "0.1.0" + "define-property": "^0.2.5", + "object-copy": "^0.1.0" }, "dependencies": { "define-property": { @@ -6691,7 +6691,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } } } @@ -6702,8 +6702,8 @@ "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", "dev": true, "requires": { - "end-of-stream": "1.4.1", - "stream-shift": "1.0.0" + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" } }, "stream-shift": { @@ -6718,9 +6718,9 @@ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "string_decoder": { @@ -6729,7 +6729,7 @@ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "~5.1.0" } }, "strip-ansi": { @@ -6738,7 +6738,7 @@ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-bom": { @@ -6765,9 +6765,9 @@ "integrity": "sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA==", "dev": true, "requires": { - "duplexer": "0.1.1", - "minimist": "1.2.0", - "through": "2.3.8" + "duplexer": "^0.1.1", + "minimist": "^1.2.0", + "through": "^2.3.4" } }, "supports-color": { @@ -6776,7 +6776,7 @@ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } }, "tap": { @@ -6785,40 +6785,48 @@ "integrity": "sha512-av4rQscF4IspCJ16BM+/G6LKcKwkB6HBtixf0x0PTZQCW3KlicBy9F4SwkazbMSGMrecVWvFQFeabiy5YPhAhw==", "dev": true, "requires": { - "bind-obj-methods": "2.0.0", - "browser-process-hrtime": "1.0.0", - "capture-stack-trace": "1.0.1", - "clean-yaml-object": "0.1.0", - "color-support": "1.1.3", - "coveralls": "3.0.3", - "domain-browser": "1.2.0", - "esm": "3.2.20", - "foreground-child": "1.5.6", - "fs-exists-cached": "1.0.0", - "function-loop": "1.0.1", - "glob": "7.1.3", - "isexe": "2.0.0", - "js-yaml": "3.13.0", - "minipass": "2.3.5", - "mkdirp": "0.5.1", - "nyc": "13.3.0", - "opener": "1.5.1", - "os-homedir": "1.0.2", - "own-or": "1.0.0", - "own-or-env": "1.0.1", - "rimraf": "2.6.3", - "signal-exit": "3.0.2", - "source-map-support": "0.5.11", - "stack-utils": "1.0.2", - "tap-mocha-reporter": "3.0.9", - "tap-parser": "7.0.0", - "tmatch": "4.0.0", - "trivial-deferred": "1.0.1", - "ts-node": "8.0.3", - "tsame": "2.0.1", - "typescript": "3.3.4000", - "write-file-atomic": "2.4.2", - "yapool": "1.0.0" + "bind-obj-methods": "^2.0.0", + "browser-process-hrtime": "^1.0.0", + "capture-stack-trace": "^1.0.0", + "clean-yaml-object": "^0.1.0", + "color-support": "^1.1.0", + "coveralls": "^3.0.2", + "domain-browser": "^1.2.0", + "esm": "^3.2.5", + "foreground-child": "^1.3.3", + "fs-exists-cached": "^1.0.0", + "function-loop": "^1.0.1", + "glob": "^7.1.3", + "isexe": "^2.0.0", + "js-yaml": "^3.13.0", + "minipass": "^2.3.5", + "mkdirp": "^0.5.1", + "nyc": "^13.3.0", + "opener": "^1.5.1", + "os-homedir": "^1.0.2", + "own-or": "^1.0.0", + "own-or-env": "^1.0.1", + "rimraf": "^2.6.3", + "signal-exit": "^3.0.0", + "source-map-support": "^0.5.10", + "stack-utils": "^1.0.2", + "tap-mocha-reporter": "^3.0.9", + "tap-parser": "^7.0.0", + "tmatch": "^4.0.0", + "trivial-deferred": "^1.0.1", + "ts-node": "^8.0.2", + "tsame": "^2.0.1", + "typescript": "^3.3.3", + "write-file-atomic": "^2.4.2", + "yapool": "^1.0.0" + }, + "dependencies": { + "typescript": { + "version": "3.3.4000", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", + "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "dev": true + } } }, "tap-mocha-reporter": { @@ -6827,15 +6835,15 @@ "integrity": "sha512-VO07vhC9EG27EZdOe7bWBj1ldbK+DL9TnRadOgdQmiQOVZjFpUEQuuqO7+rNSO2kfmkq5hWeluYXDWNG/ytXTQ==", "dev": true, "requires": { - "color-support": "1.1.3", - "debug": "2.6.9", - "diff": "1.4.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.3", - "js-yaml": "3.13.0", - "readable-stream": "2.3.6", - "tap-parser": "5.4.0", - "unicode-length": "1.0.3" + "color-support": "^1.1.0", + "debug": "^2.1.3", + "diff": "^1.3.2", + "escape-string-regexp": "^1.0.3", + "glob": "^7.0.5", + "js-yaml": "^3.3.1", + "readable-stream": "^2.1.5", + "tap-parser": "^5.1.0", + "unicode-length": "^1.0.0" }, "dependencies": { "tap-parser": { @@ -6857,9 +6865,9 @@ "integrity": "sha512-05G8/LrzqOOFvZhhAk32wsGiPZ1lfUrl+iV7+OkKgfofZxiceZWMHkKmow71YsyVQ8IvGBP2EjcIjE5gL4l5lA==", "dev": true, "requires": { - "events-to-array": "1.1.2", - "js-yaml": "3.13.0", - "minipass": "2.3.5" + "events-to-array": "^1.0.1", + "js-yaml": "^3.2.7", + "minipass": "^2.2.0" } }, "tar": { @@ -6868,9 +6876,9 @@ "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "dev": true, "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" + "block-stream": "*", + "fstream": "^1.0.2", + "inherits": "2" } }, "temp-dir": { @@ -6885,12 +6893,12 @@ "integrity": "sha1-jP9jD7fp2gXwR8dM5M5NaFRX1JI=", "dev": true, "requires": { - "graceful-fs": "4.1.15", - "is-stream": "1.1.0", - "make-dir": "1.3.0", - "pify": "3.0.0", - "temp-dir": "1.0.0", - "uuid": "3.3.2" + "graceful-fs": "^4.1.2", + "is-stream": "^1.1.0", + "make-dir": "^1.0.0", + "pify": "^3.0.0", + "temp-dir": "^1.0.0", + "uuid": "^3.0.1" } }, "text-extensions": { @@ -6911,8 +6919,8 @@ "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "requires": { - "readable-stream": "2.3.6", - "xtend": "4.0.1" + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" } }, "tmatch": { @@ -6927,7 +6935,7 @@ "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { - "os-tmpdir": "1.0.2" + "os-tmpdir": "~1.0.2" } }, "to-fast-properties": { @@ -6942,7 +6950,7 @@ "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -6951,7 +6959,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -6962,10 +6970,10 @@ "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", "dev": true, "requires": { - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "regex-not": "1.0.2", - "safe-regex": "1.1.0" + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" } }, "to-regex-range": { @@ -6974,8 +6982,8 @@ "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "dev": true, "requires": { - "is-number": "3.0.0", - "repeat-string": "1.6.1" + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" } }, "tough-cookie": { @@ -6984,8 +6992,8 @@ "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "dev": true, "requires": { - "psl": "1.1.31", - "punycode": "1.4.1" + "psl": "^1.1.24", + "punycode": "^1.4.1" }, "dependencies": { "punycode": { @@ -7002,7 +7010,7 @@ "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", "dev": true, "requires": { - "punycode": "2.1.1" + "punycode": "^2.1.0" } }, "trim-newlines": { @@ -7035,11 +7043,11 @@ "integrity": "sha512-2qayBA4vdtVRuDo11DEFSsD/SFsBXQBRZZhbRGSIkmYmVkWjULn/GGMdG10KVqkaGndljfaTD8dKjWgcejO8YA==", "dev": true, "requires": { - "arg": "4.1.0", - "diff": "3.5.0", - "make-error": "1.3.5", - "source-map-support": "0.5.11", - "yn": "3.0.0" + "arg": "^4.1.0", + "diff": "^3.1.0", + "make-error": "^1.1.1", + "source-map-support": "^0.5.6", + "yn": "^3.0.0" }, "dependencies": { "diff": { @@ -7063,24 +7071,24 @@ "dev": true }, "tslint": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.14.0.tgz", - "integrity": "sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==", - "dev": true, - "requires": { - "babel-code-frame": "6.26.0", - "builtin-modules": "1.1.1", - "chalk": "2.4.2", - "commander": "2.19.0", - "diff": "3.5.0", - "glob": "7.1.3", - "js-yaml": "3.13.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "resolve": "1.10.0", - "semver": "5.7.0", - "tslib": "1.9.3", - "tsutils": "2.29.0" + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.15.0.tgz", + "integrity": "sha512-6bIEujKR21/3nyeoX2uBnE8s+tMXCQXhqMmaIPJpHmXJoBJPTLcI7/VHRtUwMhnLVdwLqqY3zmd8Dxqa5CVdJA==", + "dev": true, + "requires": { + "babel-code-frame": "^6.22.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.13.0", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.29.0" }, "dependencies": { "diff": { @@ -7097,7 +7105,7 @@ "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", "dev": true, "requires": { - "tslib": "1.9.3" + "tslib": "^1.8.1" } }, "tunnel-agent": { @@ -7106,7 +7114,7 @@ "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "^5.0.1" } }, "tweetnacl": { @@ -7122,9 +7130,9 @@ "dev": true }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", "dev": true }, "uglify-js": { @@ -7134,8 +7142,8 @@ "dev": true, "optional": true, "requires": { - "commander": "2.19.0", - "source-map": "0.6.1" + "commander": "~2.19.0", + "source-map": "~0.6.1" }, "dependencies": { "source-map": { @@ -7165,8 +7173,8 @@ "integrity": "sha1-Wtp6f+1RhBpBijKM8UlHisg1irs=", "dev": true, "requires": { - "punycode": "1.4.1", - "strip-ansi": "3.0.1" + "punycode": "^1.3.2", + "strip-ansi": "^3.0.1" }, "dependencies": { "punycode": { @@ -7183,10 +7191,10 @@ "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", "dev": true, "requires": { - "arr-union": "3.1.0", - "get-value": "2.0.6", - "is-extendable": "0.1.1", - "set-value": "0.4.3" + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" }, "dependencies": { "extend-shallow": { @@ -7195,7 +7203,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "set-value": { @@ -7204,10 +7212,10 @@ "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "to-object-path": "0.3.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" } } } @@ -7218,7 +7226,7 @@ "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", "dev": true, "requires": { - "unique-slug": "2.0.1" + "unique-slug": "^2.0.0" } }, "unique-slug": { @@ -7227,7 +7235,7 @@ "integrity": "sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg==", "dev": true, "requires": { - "imurmurhash": "0.1.4" + "imurmurhash": "^0.1.4" } }, "universal-user-agent": { @@ -7236,7 +7244,7 @@ "integrity": "sha512-eRHEHhChCBHrZsA4WEhdgiOKgdvgrMIHwnwnqD0r5C6AO8kwKcG7qSku3iXdhvHL3YvsS9ZkSGN8h/hIpoFC8g==", "dev": true, "requires": { - "os-name": "3.0.0" + "os-name": "^3.0.0" } }, "universalify": { @@ -7251,8 +7259,8 @@ "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "dev": true, "requires": { - "has-value": "0.3.1", - "isobject": "3.0.1" + "has-value": "^0.3.1", + "isobject": "^3.0.0" }, "dependencies": { "has-value": { @@ -7261,9 +7269,9 @@ "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "dev": true, "requires": { - "get-value": "2.0.6", - "has-values": "0.1.4", - "isobject": "2.1.0" + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" }, "dependencies": { "isobject": { @@ -7291,7 +7299,7 @@ "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "dev": true, "requires": { - "punycode": "2.1.1" + "punycode": "^2.1.0" } }, "urix": { @@ -7330,8 +7338,8 @@ "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { - "spdx-correct": "3.1.0", - "spdx-expression-parse": "3.0.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, "validate-npm-package-name": { @@ -7340,7 +7348,7 @@ "integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=", "dev": true, "requires": { - "builtins": "1.0.3" + "builtins": "^1.0.3" } }, "verror": { @@ -7349,9 +7357,9 @@ "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "dev": true, "requires": { - "assert-plus": "1.0.0", + "assert-plus": "^1.0.0", "core-util-is": "1.0.2", - "extsprintf": "1.3.0" + "extsprintf": "^1.2.0" } }, "wcwidth": { @@ -7360,7 +7368,7 @@ "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", "dev": true, "requires": { - "defaults": "1.0.3" + "defaults": "^1.0.3" } }, "webidl-conversions": { @@ -7375,9 +7383,9 @@ "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", "dev": true, "requires": { - "lodash.sortby": "4.7.0", - "tr46": "1.0.1", - "webidl-conversions": "4.0.2" + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" } }, "which": { @@ -7386,7 +7394,7 @@ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "which-module": { @@ -7401,7 +7409,7 @@ "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "requires": { - "string-width": "1.0.2" + "string-width": "^1.0.2 || 2" } }, "windows-release": { @@ -7410,7 +7418,7 @@ "integrity": "sha512-hBb7m7acFgQPQc222uEQTmdcGLeBmQLNLFIh0rDk3CwFOBrfjefLzEfEfmpMq8Af/n/GnFf3eYf203FY1PmudA==", "dev": true, "requires": { - "execa": "0.10.0" + "execa": "^0.10.0" }, "dependencies": { "execa": { @@ -7419,13 +7427,13 @@ "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", "dev": true, "requires": { - "cross-spawn": "6.0.5", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "cross-spawn": "^6.0.0", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" } }, "get-stream": { @@ -7448,8 +7456,8 @@ "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" } }, "wrappy": { @@ -7464,9 +7472,9 @@ "integrity": "sha512-s0b6vB3xIVRLWywa6X9TOMA7k9zio0TMOsl9ZnDkliA/cfJlpHXAscj0gbHVJiTdIuAYpIyqS5GW91fqm6gG5g==", "dev": true, "requires": { - "graceful-fs": "4.1.15", - "imurmurhash": "0.1.4", - "signal-exit": "3.0.2" + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" } }, "write-json-file": { @@ -7475,12 +7483,12 @@ "integrity": "sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8=", "dev": true, "requires": { - "detect-indent": "5.0.0", - "graceful-fs": "4.1.15", - "make-dir": "1.3.0", - "pify": "3.0.0", - "sort-keys": "2.0.0", - "write-file-atomic": "2.4.2" + "detect-indent": "^5.0.0", + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "pify": "^3.0.0", + "sort-keys": "^2.0.0", + "write-file-atomic": "^2.0.0" } }, "write-pkg": { @@ -7489,8 +7497,8 @@ "integrity": "sha512-tX2ifZ0YqEFOF1wjRW2Pk93NLsj02+n1UP5RvO6rCs0K6R2g1padvf006cY74PQJKMGS2r42NK7FD0dG6Y6paw==", "dev": true, "requires": { - "sort-keys": "2.0.0", - "write-json-file": "2.3.0" + "sort-keys": "^2.0.0", + "write-json-file": "^2.2.0" } }, "xtend": { @@ -7523,18 +7531,18 @@ "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", "dev": true, "requires": { - "cliui": "4.1.0", - "decamelize": "1.2.0", - "find-up": "3.0.0", - "get-caller-file": "1.0.3", - "os-locale": "3.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "4.0.0", - "yargs-parser": "11.1.1" + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" }, "dependencies": { "ansi-regex": { @@ -7549,7 +7557,7 @@ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { - "locate-path": "3.0.0" + "locate-path": "^3.0.0" } }, "is-fullwidth-code-point": { @@ -7564,8 +7572,8 @@ "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { - "p-locate": "3.0.0", - "path-exists": "3.0.0" + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" } }, "p-limit": { @@ -7574,7 +7582,7 @@ "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { - "p-try": "2.1.0" + "p-try": "^2.0.0" } }, "p-locate": { @@ -7583,7 +7591,7 @@ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { - "p-limit": "2.2.0" + "p-limit": "^2.0.0" } }, "p-try": { @@ -7598,8 +7606,8 @@ "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -7608,7 +7616,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } } } @@ -7619,8 +7627,8 @@ "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", "dev": true, "requires": { - "camelcase": "5.2.0", - "decamelize": "1.2.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" }, "dependencies": { "camelcase": { diff --git a/package.json b/package.json index 7db153d56d..e53f10afa4 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "lerna": "^3.13.1", "nodeunit": "^0.11.3", "nyc": "^13.3.0", - "tslint": "^5.13.0", - "typescript": "^3.3.3333" + "tslint": "^5.15.0", + "typescript": "^3.4.2" } } diff --git a/packages/codemaker/package-lock.json b/packages/codemaker/package-lock.json index 466a30a248..cdb05e22dc 100644 --- a/packages/codemaker/package-lock.json +++ b/packages/codemaker/package-lock.json @@ -1,6 +1,6 @@ { "name": "codemaker", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -257,9 +257,9 @@ "dev": true }, "camelcase": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", - "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==" + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, "capture-stack-trace": { "version": "1.0.1", @@ -2304,9 +2304,9 @@ "dev": true }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", "dev": true }, "unicode-length": { diff --git a/packages/codemaker/package.json b/packages/codemaker/package.json index d844a286b3..46635a4913 100644 --- a/packages/codemaker/package.json +++ b/packages/codemaker/package.json @@ -16,10 +16,10 @@ "@types/node": "^8.10.43", "@types/nodeunit": "^0.0.30", "nodeunit": "^0.11.3", - "typescript": "^3.3.3333" + "typescript": "^3.4.2" }, "dependencies": { - "camelcase": "^5.2.0", + "camelcase": "^5.3.1", "decamelize": "^1.2.0", "fs-extra": "^7.0.1" }, diff --git a/packages/jsii-calc-base-of-base/test/assembly.jsii b/packages/jsii-calc-base-of-base/test/assembly.jsii index 36c32dfcd0..c5d0c563c3 100644 --- a/packages/jsii-calc-base-of-base/test/assembly.jsii +++ b/packages/jsii-calc-base-of-base/test/assembly.jsii @@ -16,7 +16,7 @@ "type": "git", "url": "https://github.com/awslabs/jsii.git" }, - "schema": "jsii/1.0", + "schema": "jsii/0.10.0", "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", @@ -35,15 +35,14 @@ "python": { "distName": "scope.jsii-calc-base-of-base", "module": "scope.jsii_calc_base_of_base" - } + }, + "sphinx": {} }, "types": { "@scope/jsii-calc-base-of-base.Very": { "assembly": "@scope/jsii-calc-base-of-base", "fqn": "@scope/jsii-calc-base-of-base.Very", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/index.ts", @@ -57,7 +56,9 @@ }, "name": "hey", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -90,5 +91,5 @@ } }, "version": "0.9.0", - "fingerprint": "tvV+QeaiensaQM3kSC1xTy0VR+VsxkqujFF65n0AnCA=" + "fingerprint": "1O+di7RZanglLmeCs57JLdO5m98kRnkL4uLPnDbm/z4=" } diff --git a/packages/jsii-calc-base/test/assembly.jsii b/packages/jsii-calc-base/test/assembly.jsii index bf8ca01439..13a139704e 100644 --- a/packages/jsii-calc-base/test/assembly.jsii +++ b/packages/jsii-calc-base/test/assembly.jsii @@ -9,7 +9,6 @@ }, "dependencies": { "@scope/jsii-calc-base-of-base": { - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", @@ -28,7 +27,8 @@ "python": { "distName": "scope.jsii-calc-base-of-base", "module": "scope.jsii_calc_base_of_base" - } + }, + "sphinx": {} }, "version": "0.9.0" } @@ -42,7 +42,7 @@ "type": "git", "url": "https://github.com/awslabs/jsii.git" }, - "schema": "jsii/1.0", + "schema": "jsii/0.10.0", "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", @@ -61,7 +61,8 @@ "python": { "distName": "scope.jsii-calc-base", "module": "scope.jsii_calc_base" - } + }, + "sphinx": {} }, "types": { "@scope/jsii-calc-base.Base": { @@ -71,9 +72,7 @@ "summary": "A base class." }, "fqn": "@scope/jsii-calc-base.Base", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/index.ts", @@ -90,7 +89,9 @@ }, "name": "typeName", "returns": { - "primitive": "any" + "type": { + "primitive": "any" + } } } ], @@ -101,9 +102,7 @@ "datatype": true, "fqn": "@scope/jsii-calc-base.BaseProps", "interfaces": [ - { - "fqn": "@scope/jsii-calc-base-of-base.VeryBaseProps" - } + "@scope/jsii-calc-base-of-base.VeryBaseProps" ], "kind": "interface", "locationInModule": { @@ -128,5 +127,5 @@ } }, "version": "0.9.0", - "fingerprint": "kY67AXY3VfrjDTcaGA947JNHQsShp1+YEr9p0JkgKW4=" + "fingerprint": "iWT7GmFaVPERM/zg8WXtKv7ydudD28ixjJDVfms7DJ4=" } diff --git a/packages/jsii-calc-bundled/package.json b/packages/jsii-calc-bundled/package.json index e1117540e4..78b5c16dc7 100644 --- a/packages/jsii-calc-bundled/package.json +++ b/packages/jsii-calc-bundled/package.json @@ -7,9 +7,6 @@ "name": "Amazon Web Services", "url": "https://aws.amazon.com" }, - "scripts": { - "build": "true" - }, "license": "Apache-2.0", "repository": { "type": "git", diff --git a/packages/jsii-calc-lib/test/assembly.jsii b/packages/jsii-calc-lib/test/assembly.jsii index ac108a701f..471b302e03 100644 --- a/packages/jsii-calc-lib/test/assembly.jsii +++ b/packages/jsii-calc-lib/test/assembly.jsii @@ -11,7 +11,6 @@ "@scope/jsii-calc-base": { "dependencies": { "@scope/jsii-calc-base-of-base": { - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", @@ -30,12 +29,12 @@ "python": { "distName": "scope.jsii-calc-base-of-base", "module": "scope.jsii_calc_base_of_base" - } + }, + "sphinx": {} }, "version": "0.9.0" } }, - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", @@ -54,7 +53,8 @@ "python": { "distName": "scope.jsii-calc-base", "module": "scope.jsii_calc_base" - } + }, + "sphinx": {} }, "version": "0.9.0" } @@ -68,7 +68,7 @@ "type": "git", "url": "https://github.com/awslabs/jsii.git" }, - "schema": "jsii/1.0", + "schema": "jsii/0.10.0", "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace", @@ -87,7 +87,8 @@ "python": { "distName": "scope.jsii-calc-lib", "module": "scope.jsii_calc_lib" - } + }, + "sphinx": {} }, "types": { "@scope/jsii-calc-lib.EnumFromScopedModule": { @@ -162,7 +163,9 @@ }, "name": "hello", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -220,23 +223,21 @@ "line": 78 }, "name": "firstOptional", + "optional": true, "type": { "collection": { "elementtype": { "primitive": "string" }, "kind": "array" - }, - "optional": true + } } } ] }, "@scope/jsii-calc-lib.Number": { "assembly": "@scope/jsii-calc-lib", - "base": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "base": "@scope/jsii-calc-lib.Value", "docs": { "summary": "Represents a concrete number." }, @@ -245,7 +246,6 @@ "docs": { "summary": "Creates a Number object." }, - "initializer": true, "parameters": [ { "docs": { @@ -259,9 +259,7 @@ ] }, "interfaces": [ - { - "fqn": "@scope/jsii-calc-lib.IDoublable" - } + "@scope/jsii-calc-lib.IDoublable" ], "kind": "class", "locationInModule": { @@ -280,9 +278,7 @@ "line": 42 }, "name": "doubleValue", - "overrides": { - "fqn": "@scope/jsii-calc-lib.IDoublable" - }, + "overrides": "@scope/jsii-calc-lib.IDoublable", "type": { "primitive": "number" } @@ -297,9 +293,7 @@ "line": 35 }, "name": "value", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "overrides": "@scope/jsii-calc-lib.Value", "type": { "primitive": "number" } @@ -309,16 +303,12 @@ "@scope/jsii-calc-lib.Operation": { "abstract": true, "assembly": "@scope/jsii-calc-lib", - "base": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "base": "@scope/jsii-calc-lib.Value", "docs": { "summary": "Represents an operation on values." }, "fqn": "@scope/jsii-calc-lib.Operation", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/index.ts", @@ -335,11 +325,11 @@ "line": 51 }, "name": "toString", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "overrides": "@scope/jsii-calc-lib.Value", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -370,8 +360,8 @@ "line": 88 }, "name": "optional1", + "optional": true, "type": { - "optional": true, "primitive": "string" } }, @@ -383,8 +373,8 @@ "line": 89 }, "name": "optional2", + "optional": true, "type": { - "optional": true, "primitive": "number" } }, @@ -396,8 +386,8 @@ "line": 90 }, "name": "optional3", + "optional": true, "type": { - "optional": true, "primitive": "boolean" } } @@ -406,16 +396,12 @@ "@scope/jsii-calc-lib.Value": { "abstract": true, "assembly": "@scope/jsii-calc-lib", - "base": { - "fqn": "@scope/jsii-calc-base.Base" - }, + "base": "@scope/jsii-calc-base.Base", "docs": { "summary": "Abstract class which represents a numeric value." }, "fqn": "@scope/jsii-calc-lib.Value", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/index.ts", @@ -432,7 +418,9 @@ }, "name": "toString", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -457,5 +445,5 @@ } }, "version": "0.9.0", - "fingerprint": "LOjIAgmz/zd3aDBrJaHLXGI+I49sXkgLvihvuzZDPAY=" + "fingerprint": "/aA8aq2OBJL26oZOAhZj4Gi1QaKDqfEKQj3ONPxmbBM=" } diff --git a/packages/jsii-calc/test/assembly.jsii b/packages/jsii-calc/test/assembly.jsii index 2f0512c021..65fedf4d0d 100644 --- a/packages/jsii-calc/test/assembly.jsii +++ b/packages/jsii-calc/test/assembly.jsii @@ -37,7 +37,6 @@ "@scope/jsii-calc-base": { "dependencies": { "@scope/jsii-calc-base-of-base": { - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", @@ -56,12 +55,12 @@ "python": { "distName": "scope.jsii-calc-base-of-base", "module": "scope.jsii_calc_base_of_base" - } + }, + "sphinx": {} }, "version": "0.9.0" } }, - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", @@ -80,12 +79,12 @@ "python": { "distName": "scope.jsii-calc-base", "module": "scope.jsii_calc_base" - } + }, + "sphinx": {} }, "version": "0.9.0" }, "@scope/jsii-calc-base-of-base": { - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", @@ -104,7 +103,8 @@ "python": { "distName": "scope.jsii-calc-base-of-base", "module": "scope.jsii_calc_base_of_base" - } + }, + "sphinx": {} }, "version": "0.9.0" }, @@ -113,7 +113,6 @@ "@scope/jsii-calc-base": { "dependencies": { "@scope/jsii-calc-base-of-base": { - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", @@ -132,12 +131,12 @@ "python": { "distName": "scope.jsii-calc-base-of-base", "module": "scope.jsii_calc_base_of_base" - } + }, + "sphinx": {} }, "version": "0.9.0" } }, - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", @@ -156,12 +155,12 @@ "python": { "distName": "scope.jsii-calc-base", "module": "scope.jsii_calc_base" - } + }, + "sphinx": {} }, "version": "0.9.0" } }, - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace", @@ -180,7 +179,8 @@ "python": { "distName": "scope.jsii-calc-lib", "module": "scope.jsii_calc_lib" - } + }, + "sphinx": {} }, "version": "0.9.0" } @@ -197,7 +197,7 @@ "type": "git", "url": "https://github.com/awslabs/jsii.git" }, - "schema": "jsii/1.0", + "schema": "jsii/0.10.0", "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace", @@ -216,23 +216,18 @@ "python": { "distName": "jsii-calc", "module": "jsii_calc" - } + }, + "sphinx": {} }, "types": { "jsii-calc.AbstractClass": { "abstract": true, "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.AbstractClassBase" - }, + "base": "jsii-calc.AbstractClassBase", "fqn": "jsii-calc.AbstractClass", - "initializer": { - "initializer": true - }, + "initializer": {}, "interfaces": [ - { - "fqn": "jsii-calc.IInterfaceImplementedByAbstractClass" - } + "jsii-calc.IInterfaceImplementedByAbstractClass" ], "kind": "class", "locationInModule": { @@ -256,7 +251,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -266,7 +263,9 @@ }, "name": "nonAbstractMethod", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -279,9 +278,7 @@ "line": 1074 }, "name": "propFromInterface", - "overrides": { - "fqn": "jsii-calc.IInterfaceImplementedByAbstractClass" - }, + "overrides": "jsii-calc.IInterfaceImplementedByAbstractClass", "type": { "primitive": "string" } @@ -292,9 +289,7 @@ "abstract": true, "assembly": "jsii-calc", "fqn": "jsii-calc.AbstractClassBase", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -319,9 +314,7 @@ "jsii-calc.AbstractClassReturner": { "assembly": "jsii-calc", "fqn": "jsii-calc.AbstractClassReturner", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -335,7 +328,9 @@ }, "name": "giveMeAbstract", "returns": { - "fqn": "jsii-calc.AbstractClass" + "type": { + "fqn": "jsii-calc.AbstractClass" + } } }, { @@ -345,7 +340,9 @@ }, "name": "giveMeInterface", "returns": { - "fqn": "jsii-calc.IInterfaceImplementedByAbstractClass" + "type": { + "fqn": "jsii-calc.IInterfaceImplementedByAbstractClass" + } } } ], @@ -366,9 +363,7 @@ }, "jsii-calc.Add": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.BinaryOperation" - }, + "base": "jsii-calc.BinaryOperation", "docs": { "summary": "The \"+\" binary operation." }, @@ -377,7 +372,6 @@ "docs": { "summary": "Creates a BinaryOperation." }, - "initializer": true, "parameters": [ { "docs": { @@ -414,11 +408,11 @@ "line": 61 }, "name": "toString", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Operation" - }, + "overrides": "@scope/jsii-calc-lib.Operation", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -434,9 +428,7 @@ "line": 57 }, "name": "value", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "overrides": "@scope/jsii-calc-lib.Value", "type": { "primitive": "number" } @@ -450,9 +442,7 @@ "summary": "This class includes property for all types supported by jsii." }, "fqn": "jsii-calc.AllTypes", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -481,7 +471,9 @@ }, "name": "anyOut", "returns": { - "primitive": "any" + "type": { + "primitive": "any" + } } }, { @@ -499,7 +491,9 @@ } ], "returns": { - "fqn": "jsii-calc.StringEnum" + "type": { + "fqn": "jsii-calc.StringEnum" + } } } ], @@ -768,9 +762,9 @@ "line": 171 }, "name": "optionalEnumValue", + "optional": true, "type": { - "fqn": "jsii-calc.StringEnum", - "optional": true + "fqn": "jsii-calc.StringEnum" } } ] @@ -799,9 +793,7 @@ "jsii-calc.AllowedMethodNames": { "assembly": "jsii-calc", "fqn": "jsii-calc.AllowedMethodNames", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -847,7 +839,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -907,9 +901,7 @@ "jsii-calc.AsyncVirtualMethods": { "assembly": "jsii-calc", "fqn": "jsii-calc.AsyncVirtualMethods", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -917,17 +909,20 @@ }, "methods": [ { + "async": true, "locationInModule": { "filename": "lib/compliance.ts", "line": 309 }, "name": "callMe", "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { + "async": true, "docs": { "summary": "Just calls \"overrideMeToo\"." }, @@ -937,11 +932,13 @@ }, "name": "callMe2", "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { + "async": true, "docs": { "remarks": "This is a \"double promise\" situation, which\nmeans that callbacks are not going to be available immediate, but only\nafter an \"immediates\" cycle.", "summary": "This method calls the \"callMe\" async method indirectly, which will then invoke a virtual method." @@ -952,8 +949,9 @@ }, "name": "callMeDoublePromise", "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { @@ -963,10 +961,13 @@ }, "name": "dontOverrideMe", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { + "async": true, "locationInModule": { "filename": "lib/compliance.ts", "line": 313 @@ -981,19 +982,22 @@ } ], "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { + "async": true, "locationInModule": { "filename": "lib/compliance.ts", "line": 317 }, "name": "overrideMeToo", "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } } ], @@ -1002,9 +1006,7 @@ "jsii-calc.AugmentableClass": { "assembly": "jsii-calc", "fqn": "jsii-calc.AugmentableClass", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -1031,9 +1033,7 @@ "jsii-calc.BinaryOperation": { "abstract": true, "assembly": "jsii-calc", - "base": { - "fqn": "@scope/jsii-calc-lib.Operation" - }, + "base": "@scope/jsii-calc-lib.Operation", "docs": { "summary": "Represents an operation with two operands." }, @@ -1042,7 +1042,6 @@ "docs": { "summary": "Creates a BinaryOperation." }, - "initializer": true, "parameters": [ { "docs": { @@ -1065,9 +1064,7 @@ ] }, "interfaces": [ - { - "fqn": "@scope/jsii-calc-lib.IFriendly" - } + "@scope/jsii-calc-lib.IFriendly" ], "kind": "class", "locationInModule": { @@ -1084,11 +1081,11 @@ "line": 48 }, "name": "hello", - "overrides": { - "fqn": "@scope/jsii-calc-lib.IFriendly" - }, + "overrides": "@scope/jsii-calc-lib.IFriendly", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -1126,9 +1123,7 @@ }, "jsii-calc.Calculator": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.composition.CompositeOperation" - }, + "base": "jsii-calc.composition.CompositeOperation", "docs": { "summary": "A calculator which maintains a current value and allows adding operations." }, @@ -1137,16 +1132,15 @@ "docs": { "summary": "Creates a Calculator object." }, - "initializer": true, "parameters": [ { "docs": { "summary": "Initialization properties." }, "name": "props", + "optional": true, "type": { - "fqn": "jsii-calc.CalculatorProps", - "optional": true + "fqn": "jsii-calc.CalculatorProps" } } ] @@ -1231,7 +1225,9 @@ }, "name": "readUnionValue", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -1247,9 +1243,7 @@ "line": 310 }, "name": "expression", - "overrides": { - "fqn": "jsii-calc.composition.CompositeOperation" - }, + "overrides": "jsii-calc.composition.CompositeOperation", "type": { "fqn": "@scope/jsii-calc-lib.Value" } @@ -1319,8 +1313,8 @@ "line": 277 }, "name": "maxValue", + "optional": true, "type": { - "optional": true, "primitive": "number" } }, @@ -1333,8 +1327,8 @@ "line": 317 }, "name": "unionProperty", + "optional": true, "type": { - "optional": true, "union": { "types": [ { @@ -1374,8 +1368,8 @@ "line": 236 }, "name": "initialValue", + "optional": true, "type": { - "optional": true, "primitive": "number" } }, @@ -1387,8 +1381,8 @@ "line": 237 }, "name": "maximumValue", + "optional": true, "type": { - "optional": true, "primitive": "number" } } @@ -1397,13 +1391,9 @@ "jsii-calc.ClassThatImplementsTheInternalInterface": { "assembly": "jsii-calc", "fqn": "jsii-calc.ClassThatImplementsTheInternalInterface", - "initializer": { - "initializer": true - }, + "initializer": {}, "interfaces": [ - { - "fqn": "jsii-calc.INonInternalInterface" - } + "jsii-calc.INonInternalInterface" ], "kind": "class", "locationInModule": { @@ -1418,9 +1408,7 @@ "line": 1564 }, "name": "a", - "overrides": { - "fqn": "jsii-calc.IAnotherPublicInterface" - }, + "overrides": "jsii-calc.IAnotherPublicInterface", "type": { "primitive": "string" } @@ -1431,9 +1419,7 @@ "line": 1565 }, "name": "b", - "overrides": { - "fqn": "jsii-calc.INonInternalInterface" - }, + "overrides": "jsii-calc.INonInternalInterface", "type": { "primitive": "string" } @@ -1444,9 +1430,7 @@ "line": 1566 }, "name": "c", - "overrides": { - "fqn": "jsii-calc.INonInternalInterface" - }, + "overrides": "jsii-calc.INonInternalInterface", "type": { "primitive": "string" } @@ -1466,13 +1450,9 @@ "jsii-calc.ClassThatImplementsThePrivateInterface": { "assembly": "jsii-calc", "fqn": "jsii-calc.ClassThatImplementsThePrivateInterface", - "initializer": { - "initializer": true - }, + "initializer": {}, "interfaces": [ - { - "fqn": "jsii-calc.INonInternalInterface" - } + "jsii-calc.INonInternalInterface" ], "kind": "class", "locationInModule": { @@ -1487,9 +1467,7 @@ "line": 1571 }, "name": "a", - "overrides": { - "fqn": "jsii-calc.IAnotherPublicInterface" - }, + "overrides": "jsii-calc.IAnotherPublicInterface", "type": { "primitive": "string" } @@ -1500,9 +1478,7 @@ "line": 1572 }, "name": "b", - "overrides": { - "fqn": "jsii-calc.INonInternalInterface" - }, + "overrides": "jsii-calc.INonInternalInterface", "type": { "primitive": "string" } @@ -1513,9 +1489,7 @@ "line": 1573 }, "name": "c", - "overrides": { - "fqn": "jsii-calc.INonInternalInterface" - }, + "overrides": "jsii-calc.INonInternalInterface", "type": { "primitive": "string" } @@ -1535,9 +1509,7 @@ "jsii-calc.ClassWithMutableObjectLiteralProperty": { "assembly": "jsii-calc", "fqn": "jsii-calc.ClassWithMutableObjectLiteralProperty", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -1564,9 +1536,7 @@ }, "fqn": "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties", "interfaces": [ - { - "fqn": "jsii-calc.IInterfaceWithProperties" - } + "jsii-calc.IInterfaceWithProperties" ], "kind": "class", "locationInModule": { @@ -1595,7 +1565,9 @@ } ], "returns": { - "fqn": "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties" + "type": { + "fqn": "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties" + } }, "static": true } @@ -1609,9 +1581,7 @@ "line": 1141 }, "name": "readOnlyString", - "overrides": { - "fqn": "jsii-calc.IInterfaceWithProperties" - }, + "overrides": "jsii-calc.IInterfaceWithProperties", "type": { "primitive": "string" } @@ -1622,9 +1592,7 @@ "line": 1141 }, "name": "readWriteString", - "overrides": { - "fqn": "jsii-calc.IInterfaceWithProperties" - }, + "overrides": "jsii-calc.IInterfaceWithProperties", "type": { "primitive": "string" } @@ -1635,7 +1603,6 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.ConstructorPassesThisOut", "initializer": { - "initializer": true, "parameters": [ { "name": "consumer", @@ -1655,9 +1622,7 @@ "jsii-calc.Constructors": { "assembly": "jsii-calc", "fqn": "jsii-calc.Constructors", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -1671,7 +1636,9 @@ }, "name": "hiddenInterface", "returns": { - "fqn": "jsii-calc.IPublicInterface" + "type": { + "fqn": "jsii-calc.IPublicInterface" + } }, "static": true }, @@ -1682,11 +1649,13 @@ }, "name": "hiddenInterfaces", "returns": { - "collection": { - "elementtype": { - "fqn": "jsii-calc.IPublicInterface" - }, - "kind": "array" + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.IPublicInterface" + }, + "kind": "array" + } } }, "static": true @@ -1698,11 +1667,13 @@ }, "name": "hiddenSubInterfaces", "returns": { - "collection": { - "elementtype": { - "fqn": "jsii-calc.IPublicInterface" - }, - "kind": "array" + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.IPublicInterface" + }, + "kind": "array" + } } }, "static": true @@ -1714,7 +1685,9 @@ }, "name": "makeClass", "returns": { - "fqn": "jsii-calc.PublicClass" + "type": { + "fqn": "jsii-calc.PublicClass" + } }, "static": true }, @@ -1725,7 +1698,9 @@ }, "name": "makeInterface", "returns": { - "fqn": "jsii-calc.IPublicInterface" + "type": { + "fqn": "jsii-calc.IPublicInterface" + } }, "static": true }, @@ -1736,7 +1711,9 @@ }, "name": "makeInterface2", "returns": { - "fqn": "jsii-calc.IPublicInterface2" + "type": { + "fqn": "jsii-calc.IPublicInterface2" + } }, "static": true }, @@ -1747,11 +1724,13 @@ }, "name": "makeInterfaces", "returns": { - "collection": { - "elementtype": { - "fqn": "jsii-calc.IPublicInterface" - }, - "kind": "array" + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.IPublicInterface" + }, + "kind": "array" + } } }, "static": true @@ -1762,9 +1741,7 @@ "jsii-calc.ConsumersOfThisCrazyTypeSystem": { "assembly": "jsii-calc", "fqn": "jsii-calc.ConsumersOfThisCrazyTypeSystem", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -1786,7 +1763,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -1804,7 +1783,9 @@ } ], "returns": { - "primitive": "any" + "type": { + "primitive": "any" + } } } ], @@ -1814,26 +1795,25 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.DefaultedConstructorArgument", "initializer": { - "initializer": true, "parameters": [ { "name": "arg1", + "optional": true, "type": { - "optional": true, "primitive": "number" } }, { "name": "arg2", + "optional": true, "type": { - "optional": true, "primitive": "string" } }, { "name": "arg3", + "optional": true, "type": { - "optional": true, "primitive": "date" } } @@ -1875,8 +1855,8 @@ "line": 291 }, "name": "arg2", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -1885,9 +1865,7 @@ "jsii-calc.DerivedClassHasNoProperties.Base": { "assembly": "jsii-calc", "fqn": "jsii-calc.DerivedClassHasNoProperties.Base", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -1910,13 +1888,9 @@ }, "jsii-calc.DerivedClassHasNoProperties.Derived": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.DerivedClassHasNoProperties.Base" - }, + "base": "jsii-calc.DerivedClassHasNoProperties.Base", "fqn": "jsii-calc.DerivedClassHasNoProperties.Derived", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -1933,9 +1907,7 @@ }, "fqn": "jsii-calc.DerivedStruct", "interfaces": [ - { - "fqn": "@scope/jsii-calc-lib.MyFirstStruct" - } + "@scope/jsii-calc-lib.MyFirstStruct" ], "kind": "interface", "locationInModule": { @@ -1994,14 +1966,14 @@ "line": 532 }, "name": "anotherOptional", + "optional": true, "type": { "collection": { "elementtype": { "fqn": "@scope/jsii-calc-lib.Value" }, "kind": "map" - }, - "optional": true + } } }, { @@ -2012,8 +1984,8 @@ "line": 528 }, "name": "optionalAny", + "optional": true, "type": { - "optional": true, "primitive": "any" } }, @@ -2025,14 +1997,14 @@ "line": 527 }, "name": "optionalArray", + "optional": true, "type": { "collection": { "elementtype": { "primitive": "string" }, "kind": "array" - }, - "optional": true + } } } ] @@ -2040,9 +2012,7 @@ "jsii-calc.DoNotOverridePrivates": { "assembly": "jsii-calc", "fqn": "jsii-calc.DoNotOverridePrivates", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -2071,7 +2041,9 @@ }, "name": "privateMethodValue", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -2081,7 +2053,9 @@ }, "name": "privatePropertyValue", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -2093,9 +2067,7 @@ "summary": "jsii#284: do not recognize \"any\" as an optional argument." }, "fqn": "jsii-calc.DoNotRecognizeAnyAsOptional", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -2117,15 +2089,15 @@ }, { "name": "_optionalAny", + "optional": true, "type": { - "optional": true, "primitive": "any" } }, { "name": "_optionalString", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -2142,9 +2114,7 @@ "summary": "Here's the first line of the TSDoc comment." }, "fqn": "jsii-calc.DocumentedClass", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/documented.ts", @@ -2168,14 +2138,16 @@ "summary": "The person to be greeted." }, "name": "greetee", + "optional": true, "type": { - "fqn": "jsii-calc.Greetee", - "optional": true + "fqn": "jsii-calc.Greetee" } } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { @@ -2195,9 +2167,7 @@ "jsii-calc.DontComplainAboutVariadicAfterOptional": { "assembly": "jsii-calc", "fqn": "jsii-calc.DontComplainAboutVariadicAfterOptional", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -2213,8 +2183,8 @@ "parameters": [ { "name": "optional", + "optional": true, "type": { - "optional": true, "primitive": "string" } }, @@ -2227,7 +2197,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } }, "variadic": true } @@ -2237,13 +2209,9 @@ "jsii-calc.DoubleTrouble": { "assembly": "jsii-calc", "fqn": "jsii-calc.DoubleTrouble", - "initializer": { - "initializer": true - }, + "initializer": {}, "interfaces": [ - { - "fqn": "jsii-calc.IFriendlyRandomGenerator" - } + "jsii-calc.IFriendlyRandomGenerator" ], "kind": "class", "locationInModule": { @@ -2260,11 +2228,11 @@ "line": 465 }, "name": "hello", - "overrides": { - "fqn": "@scope/jsii-calc-lib.IFriendly" - }, + "overrides": "@scope/jsii-calc-lib.IFriendly", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -2276,11 +2244,11 @@ "line": 461 }, "name": "next", - "overrides": { - "fqn": "jsii-calc.IRandomNumberGenerator" - }, + "overrides": "jsii-calc.IRandomNumberGenerator", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -2289,9 +2257,7 @@ "jsii-calc.EraseUndefinedHashValues": { "assembly": "jsii-calc", "fqn": "jsii-calc.EraseUndefinedHashValues", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -2323,7 +2289,9 @@ } ], "returns": { - "primitive": "boolean" + "type": { + "primitive": "boolean" + } }, "static": true }, @@ -2337,7 +2305,9 @@ }, "name": "prop1IsNull", "returns": { - "primitive": "any" + "type": { + "primitive": "any" + } }, "static": true }, @@ -2351,7 +2321,9 @@ }, "name": "prop2IsUndefined", "returns": { - "primitive": "any" + "type": { + "primitive": "any" + } }, "static": true } @@ -2377,8 +2349,8 @@ "line": 1412 }, "name": "option1", + "optional": true, "type": { - "optional": true, "primitive": "string" } }, @@ -2390,8 +2362,8 @@ "line": 1413 }, "name": "option2", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -2401,7 +2373,6 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.ExportedBaseClass", "initializer": { - "initializer": true, "parameters": [ { "name": "success", @@ -2471,9 +2442,7 @@ "jsii-calc.GiveMeStructs": { "assembly": "jsii-calc", "fqn": "jsii-calc.GiveMeStructs", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -2498,7 +2467,9 @@ } ], "returns": { - "fqn": "@scope/jsii-calc-lib.MyFirstStruct" + "type": { + "fqn": "@scope/jsii-calc-lib.MyFirstStruct" + } } }, { @@ -2519,7 +2490,9 @@ } ], "returns": { - "fqn": "jsii-calc.DoubleTrouble" + "type": { + "fqn": "jsii-calc.DoubleTrouble" + } } }, { @@ -2540,7 +2513,9 @@ } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -2585,8 +2560,8 @@ "line": 46 }, "name": "name", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -2595,9 +2570,7 @@ "jsii-calc.GreetingAugmenter": { "assembly": "jsii-calc", "fqn": "jsii-calc.GreetingAugmenter", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -2619,7 +2592,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -2695,9 +2670,7 @@ }, "fqn": "jsii-calc.IFriendlier", "interfaces": [ - { - "fqn": "@scope/jsii-calc-lib.IFriendly" - } + "@scope/jsii-calc-lib.IFriendly" ], "kind": "interface", "locationInModule": { @@ -2716,7 +2689,9 @@ }, "name": "farewell", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -2731,7 +2706,9 @@ }, "name": "goodbye", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -2741,12 +2718,8 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.IFriendlyRandomGenerator", "interfaces": [ - { - "fqn": "jsii-calc.IRandomNumberGenerator" - }, - { - "fqn": "@scope/jsii-calc-lib.IFriendly" - } + "jsii-calc.IRandomNumberGenerator", + "@scope/jsii-calc-lib.IFriendly" ], "kind": "interface", "locationInModule": { @@ -2789,9 +2762,7 @@ }, "fqn": "jsii-calc.IInterfaceThatShouldNotBeADataType", "interfaces": [ - { - "fqn": "jsii-calc.IInterfaceWithMethods" - } + "jsii-calc.IInterfaceWithMethods" ], "kind": "interface", "locationInModule": { @@ -2896,8 +2867,8 @@ }, { "name": "arg2", + "optional": true, "type": { - "optional": true, "primitive": "number" } } @@ -2945,9 +2916,7 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.IInterfaceWithPropertiesExtension", "interfaces": [ - { - "fqn": "jsii-calc.IInterfaceWithProperties" - } + "jsii-calc.IInterfaceWithProperties" ], "kind": "interface", "locationInModule": { @@ -2973,9 +2942,7 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.IJSII417Derived", "interfaces": [ - { - "fqn": "jsii-calc.IJSII417PublicBaseOfBase" - } + "jsii-calc.IJSII417PublicBaseOfBase" ], "kind": "interface", "locationInModule": { @@ -3077,9 +3044,7 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.INonInternalInterface", "interfaces": [ - { - "fqn": "jsii-calc.IAnotherPublicInterface" - } + "jsii-calc.IAnotherPublicInterface" ], "kind": "interface", "locationInModule": { @@ -3153,7 +3118,9 @@ }, "name": "bye", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -3176,7 +3143,9 @@ }, "name": "ciao", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -3206,7 +3175,9 @@ }, "name": "next", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -3229,7 +3200,9 @@ }, "name": "obtainNumber", "returns": { - "fqn": "@scope/jsii-calc-lib.IDoublable" + "type": { + "fqn": "@scope/jsii-calc-lib.IDoublable" + } } } ], @@ -3252,9 +3225,7 @@ "jsii-calc.ImplementInternalInterface": { "assembly": "jsii-calc", "fqn": "jsii-calc.ImplementInternalInterface", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -3277,13 +3248,9 @@ "jsii-calc.ImplementsInterfaceWithInternal": { "assembly": "jsii-calc", "fqn": "jsii-calc.ImplementsInterfaceWithInternal", - "initializer": { - "initializer": true - }, + "initializer": {}, "interfaces": [ - { - "fqn": "jsii-calc.IInterfaceWithInternal" - } + "jsii-calc.IInterfaceWithInternal" ], "kind": "class", "locationInModule": { @@ -3297,22 +3264,16 @@ "line": 1487 }, "name": "visible", - "overrides": { - "fqn": "jsii-calc.IInterfaceWithInternal" - } + "overrides": "jsii-calc.IInterfaceWithInternal" } ], "name": "ImplementsInterfaceWithInternal" }, "jsii-calc.ImplementsInterfaceWithInternalSubclass": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.ImplementsInterfaceWithInternal" - }, + "base": "jsii-calc.ImplementsInterfaceWithInternal", "fqn": "jsii-calc.ImplementsInterfaceWithInternalSubclass", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -3323,9 +3284,7 @@ "jsii-calc.ImplementsPrivateInterface": { "assembly": "jsii-calc", "fqn": "jsii-calc.ImplementsPrivateInterface", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -3350,9 +3309,7 @@ "datatype": true, "fqn": "jsii-calc.ImplictBaseOfBase", "interfaces": [ - { - "fqn": "@scope/jsii-calc-base.BaseProps" - } + "@scope/jsii-calc-base.BaseProps" ], "kind": "interface", "locationInModule": { @@ -3377,17 +3334,11 @@ }, "jsii-calc.InbetweenClass": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.PublicClass" - }, + "base": "jsii-calc.PublicClass", "fqn": "jsii-calc.InbetweenClass", - "initializer": { - "initializer": true - }, + "initializer": {}, "interfaces": [ - { - "fqn": "jsii-calc.IPublicInterface2" - } + "jsii-calc.IPublicInterface2" ], "kind": "class", "locationInModule": { @@ -3401,11 +3352,11 @@ "line": 1346 }, "name": "ciao", - "overrides": { - "fqn": "jsii-calc.IPublicInterface2" - }, + "overrides": "jsii-calc.IPublicInterface2", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -3414,9 +3365,7 @@ "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo": { "assembly": "jsii-calc", "fqn": "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -3431,8 +3380,8 @@ "line": 1038 }, "name": "bar", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -3492,12 +3441,9 @@ }, "jsii-calc.JSII417Derived": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.JSII417PublicBaseOfBase" - }, + "base": "jsii-calc.JSII417PublicBaseOfBase", "fqn": "jsii-calc.JSII417Derived", "initializer": { - "initializer": true, "parameters": [ { "name": "property", @@ -3547,9 +3493,7 @@ "jsii-calc.JSII417PublicBaseOfBase": { "assembly": "jsii-calc", "fqn": "jsii-calc.JSII417PublicBaseOfBase", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/erasures.ts", @@ -3563,7 +3507,9 @@ }, "name": "makeInstance", "returns": { - "fqn": "jsii-calc.JSII417PublicBaseOfBase" + "type": { + "fqn": "jsii-calc.JSII417PublicBaseOfBase" + } }, "static": true }, @@ -3593,9 +3539,7 @@ "jsii-calc.JSObjectLiteralForInterface": { "assembly": "jsii-calc", "fqn": "jsii-calc.JSObjectLiteralForInterface", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -3609,7 +3553,9 @@ }, "name": "giveMeFriendly", "returns": { - "fqn": "@scope/jsii-calc-lib.IFriendly" + "type": { + "fqn": "@scope/jsii-calc-lib.IFriendly" + } } }, { @@ -3619,7 +3565,9 @@ }, "name": "giveMeFriendlyGenerator", "returns": { - "fqn": "jsii-calc.IFriendlyRandomGenerator" + "type": { + "fqn": "jsii-calc.IFriendlyRandomGenerator" + } } } ], @@ -3628,9 +3576,7 @@ "jsii-calc.JSObjectLiteralToNative": { "assembly": "jsii-calc", "fqn": "jsii-calc.JSObjectLiteralToNative", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -3644,7 +3590,9 @@ }, "name": "returnLiteral", "returns": { - "fqn": "jsii-calc.JSObjectLiteralToNativeClass" + "type": { + "fqn": "jsii-calc.JSObjectLiteralToNativeClass" + } } } ], @@ -3653,9 +3601,7 @@ "jsii-calc.JSObjectLiteralToNativeClass": { "assembly": "jsii-calc", "fqn": "jsii-calc.JSObjectLiteralToNativeClass", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -3688,9 +3634,7 @@ "jsii-calc.JavaReservedWords": { "assembly": "jsii-calc", "fqn": "jsii-calc.JavaReservedWords", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -4082,9 +4026,7 @@ "summary": "Host runtime version should be set via JSII_AGENT." }, "fqn": "jsii-calc.JsiiAgent", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -4102,9 +4044,9 @@ "line": 1314 }, "name": "jsiiAgent", + "optional": true, "static": true, "type": { - "optional": true, "primitive": "string" } } @@ -4137,8 +4079,8 @@ "line": 1265 }, "name": "containerPort", + "optional": true, "type": { - "optional": true, "primitive": "number" } }, @@ -4155,8 +4097,8 @@ "line": 1236 }, "name": "cpu", + "optional": true, "type": { - "optional": true, "primitive": "string" } }, @@ -4173,8 +4115,8 @@ "line": 1258 }, "name": "memoryMiB", + "optional": true, "type": { - "optional": true, "primitive": "string" } }, @@ -4190,8 +4132,8 @@ "line": 1272 }, "name": "publicLoadBalancer", + "optional": true, "type": { - "optional": true, "primitive": "boolean" } }, @@ -4207,8 +4149,8 @@ "line": 1279 }, "name": "publicTasks", + "optional": true, "type": { - "optional": true, "primitive": "boolean" } } @@ -4216,9 +4158,7 @@ }, "jsii-calc.Multiply": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.BinaryOperation" - }, + "base": "jsii-calc.BinaryOperation", "docs": { "summary": "The \"*\" binary operation." }, @@ -4227,7 +4167,6 @@ "docs": { "summary": "Creates a BinaryOperation." }, - "initializer": true, "parameters": [ { "docs": { @@ -4250,12 +4189,8 @@ ] }, "interfaces": [ - { - "fqn": "jsii-calc.IFriendlier" - }, - { - "fqn": "jsii-calc.IRandomNumberGenerator" - } + "jsii-calc.IFriendlier", + "jsii-calc.IRandomNumberGenerator" ], "kind": "class", "locationInModule": { @@ -4272,11 +4207,11 @@ "line": 82 }, "name": "farewell", - "overrides": { - "fqn": "jsii-calc.IFriendlier" - }, + "overrides": "jsii-calc.IFriendlier", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -4288,11 +4223,11 @@ "line": 78 }, "name": "goodbye", - "overrides": { - "fqn": "jsii-calc.IFriendlier" - }, + "overrides": "jsii-calc.IFriendlier", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -4304,11 +4239,11 @@ "line": 86 }, "name": "next", - "overrides": { - "fqn": "jsii-calc.IRandomNumberGenerator" - }, + "overrides": "jsii-calc.IRandomNumberGenerator", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { @@ -4320,11 +4255,11 @@ "line": 74 }, "name": "toString", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Operation" - }, + "overrides": "@scope/jsii-calc-lib.Operation", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -4340,9 +4275,7 @@ "line": 70 }, "name": "value", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "overrides": "@scope/jsii-calc-lib.Value", "type": { "primitive": "number" } @@ -4351,15 +4284,12 @@ }, "jsii-calc.Negate": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.UnaryOperation" - }, + "base": "jsii-calc.UnaryOperation", "docs": { "summary": "The negation operation (\"-value\")." }, "fqn": "jsii-calc.Negate", "initializer": { - "initializer": true, "parameters": [ { "name": "operand", @@ -4370,9 +4300,7 @@ ] }, "interfaces": [ - { - "fqn": "jsii-calc.IFriendlier" - } + "jsii-calc.IFriendlier" ], "kind": "class", "locationInModule": { @@ -4389,11 +4317,11 @@ "line": 120 }, "name": "farewell", - "overrides": { - "fqn": "jsii-calc.IFriendlier" - }, + "overrides": "jsii-calc.IFriendlier", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -4405,11 +4333,11 @@ "line": 116 }, "name": "goodbye", - "overrides": { - "fqn": "jsii-calc.IFriendlier" - }, + "overrides": "jsii-calc.IFriendlier", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -4421,11 +4349,11 @@ "line": 112 }, "name": "hello", - "overrides": { - "fqn": "@scope/jsii-calc-lib.IFriendly" - }, + "overrides": "@scope/jsii-calc-lib.IFriendly", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -4437,11 +4365,11 @@ "line": 108 }, "name": "toString", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Operation" - }, + "overrides": "@scope/jsii-calc-lib.Operation", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -4457,9 +4385,7 @@ "line": 104 }, "name": "value", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "overrides": "@scope/jsii-calc-lib.Value", "type": { "primitive": "number" } @@ -4472,9 +4398,7 @@ "summary": "Test fixture to verify that jsii modules can use the node standard library." }, "fqn": "jsii-calc.NodeStandardLibrary", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -4492,10 +4416,13 @@ }, "name": "cryptoSha256", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { + "async": true, "docs": { "returns": "\"Hello, resource!\"", "summary": "Reads a local resource file (resource.txt) asynchronously." @@ -4506,8 +4433,9 @@ }, "name": "fsReadFile", "returns": { - "primitive": "string", - "promise": true + "type": { + "primitive": "string" + } } }, { @@ -4521,7 +4449,9 @@ }, "name": "fsReadFileSync", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -4550,7 +4480,6 @@ }, "fqn": "jsii-calc.NullShouldBeTreatedAsUndefined", "initializer": { - "initializer": true, "parameters": [ { "name": "_param1", @@ -4560,8 +4489,8 @@ }, { "name": "optional", + "optional": true, "type": { - "optional": true, "primitive": "any" } } @@ -4582,8 +4511,8 @@ "parameters": [ { "name": "value", + "optional": true, "type": { - "optional": true, "primitive": "any" } } @@ -4620,8 +4549,8 @@ "line": 1172 }, "name": "changeMeToUndefined", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -4663,8 +4592,8 @@ "line": 1209 }, "name": "thisShouldBeUndefined", + "optional": true, "type": { - "optional": true, "primitive": "any" } } @@ -4677,7 +4606,6 @@ }, "fqn": "jsii-calc.NumberGenerator", "initializer": { - "initializer": true, "parameters": [ { "name": "generator", @@ -4708,7 +4636,9 @@ } ], "returns": { - "primitive": "boolean" + "type": { + "primitive": "boolean" + } } }, { @@ -4718,7 +4648,9 @@ }, "name": "nextTimes100", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -4742,9 +4674,7 @@ "summary": "Verify that object references can be passed inside collections." }, "fqn": "jsii-calc.ObjectRefsInCollections", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -4774,7 +4704,9 @@ } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { @@ -4800,7 +4732,9 @@ } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -4813,9 +4747,7 @@ "summary": "Old class." }, "fqn": "jsii-calc.Old", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/documented.ts", @@ -4839,7 +4771,6 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.OptionalConstructorArgument", "initializer": { - "initializer": true, "parameters": [ { "name": "arg1", @@ -4855,8 +4786,8 @@ }, { "name": "arg3", + "optional": true, "type": { - "optional": true, "primitive": "date" } } @@ -4898,8 +4829,8 @@ "line": 285 }, "name": "arg3", + "optional": true, "type": { - "optional": true, "primitive": "date" } } @@ -4924,8 +4855,8 @@ "line": 1618 }, "name": "field", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -4935,13 +4866,12 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.OptionalStructConsumer", "initializer": { - "initializer": true, "parameters": [ { "name": "optionalStruct", + "optional": true, "type": { - "fqn": "jsii-calc.OptionalStruct", - "optional": true + "fqn": "jsii-calc.OptionalStruct" } } ] @@ -4971,8 +4901,8 @@ "line": 1610 }, "name": "fieldValue", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -4981,9 +4911,7 @@ "jsii-calc.OverrideReturnsObject": { "assembly": "jsii-calc", "fqn": "jsii-calc.OverrideReturnsObject", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5005,7 +4933,9 @@ } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -5015,9 +4945,7 @@ "abstract": true, "assembly": "jsii-calc", "fqn": "jsii-calc.PartiallyInitializedThisConsumer", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5052,7 +4980,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -5061,9 +4991,7 @@ "jsii-calc.Polymorphism": { "assembly": "jsii-calc", "fqn": "jsii-calc.Polymorphism", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5085,7 +5013,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -5093,9 +5023,7 @@ }, "jsii-calc.Power": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.composition.CompositeOperation" - }, + "base": "jsii-calc.composition.CompositeOperation", "docs": { "summary": "The power operation." }, @@ -5104,7 +5032,6 @@ "docs": { "summary": "Creates a Power operation." }, - "initializer": true, "parameters": [ { "docs": { @@ -5157,9 +5084,7 @@ "line": 223 }, "name": "expression", - "overrides": { - "fqn": "jsii-calc.composition.CompositeOperation" - }, + "overrides": "jsii-calc.composition.CompositeOperation", "type": { "fqn": "@scope/jsii-calc-lib.Value" } @@ -5183,9 +5108,7 @@ "jsii-calc.PublicClass": { "assembly": "jsii-calc", "fqn": "jsii-calc.PublicClass", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5205,9 +5128,7 @@ "jsii-calc.PythonReservedWords": { "assembly": "jsii-calc", "fqn": "jsii-calc.PythonReservedWords", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5447,9 +5368,7 @@ "summary": "See awslabs/jsii#138." }, "fqn": "jsii-calc.ReferenceEnumFromScopedPackage", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5463,8 +5382,10 @@ }, "name": "loadFoo", "returns": { - "fqn": "@scope/jsii-calc-lib.EnumFromScopedModule", - "optional": true + "optional": true, + "type": { + "fqn": "@scope/jsii-calc-lib.EnumFromScopedModule" + } } }, { @@ -5491,9 +5412,9 @@ "line": 1011 }, "name": "foo", + "optional": true, "type": { - "fqn": "@scope/jsii-calc-lib.EnumFromScopedModule", - "optional": true + "fqn": "@scope/jsii-calc-lib.EnumFromScopedModule" } } ] @@ -5506,9 +5427,7 @@ "summary": "Helps ensure the JSII kernel & runtime cooperate correctly when an un-exported instance of a class is returned with a declared type that is an exported interface, and the instance inherits from an exported class." }, "fqn": "jsii-calc.ReturnsPrivateImplementationOfInterface", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5532,9 +5451,7 @@ "jsii-calc.RuntimeTypeChecking": { "assembly": "jsii-calc", "fqn": "jsii-calc.RuntimeTypeChecking", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5550,22 +5467,22 @@ "parameters": [ { "name": "arg1", + "optional": true, "type": { - "optional": true, "primitive": "number" } }, { "name": "arg2", + "optional": true, "type": { - "optional": true, "primitive": "string" } }, { "name": "arg3", + "optional": true, "type": { - "optional": true, "primitive": "date" } } @@ -5580,8 +5497,8 @@ "parameters": [ { "name": "arg", + "optional": true, "type": { - "optional": true, "primitive": "any" } } @@ -5611,8 +5528,8 @@ }, { "name": "arg3", + "optional": true, "type": { - "optional": true, "primitive": "date" } } @@ -5628,9 +5545,7 @@ "summary": "Test that a single instance can be returned under two different FQNs." }, "fqn": "jsii-calc.SingleInstanceTwoTypes", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5644,7 +5559,9 @@ }, "name": "interface1", "returns": { - "fqn": "jsii-calc.InbetweenClass" + "type": { + "fqn": "jsii-calc.InbetweenClass" + } } }, { @@ -5654,7 +5571,9 @@ }, "name": "interface2", "returns": { - "fqn": "jsii-calc.IPublicInterface" + "type": { + "fqn": "jsii-calc.IPublicInterface" + } } } ], @@ -5664,7 +5583,6 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.Statics", "initializer": { - "initializer": true, "parameters": [ { "name": "value", @@ -5701,7 +5619,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } }, "static": true }, @@ -5712,7 +5632,9 @@ }, "name": "justMethod", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -5846,9 +5768,7 @@ "jsii-calc.StripInternal": { "assembly": "jsii-calc", "fqn": "jsii-calc.StripInternal", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5870,16 +5790,12 @@ }, "jsii-calc.Sum": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.composition.CompositeOperation" - }, + "base": "jsii-calc.composition.CompositeOperation", "docs": { "summary": "An operation that sums multiple values." }, "fqn": "jsii-calc.Sum", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/calculator.ts", @@ -5897,9 +5813,7 @@ "line": 200 }, "name": "expression", - "overrides": { - "fqn": "jsii-calc.composition.CompositeOperation" - }, + "overrides": "jsii-calc.composition.CompositeOperation", "type": { "fqn": "@scope/jsii-calc-lib.Value" } @@ -5927,9 +5841,7 @@ "jsii-calc.SyncVirtualMethods": { "assembly": "jsii-calc", "fqn": "jsii-calc.SyncVirtualMethods", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5937,14 +5849,16 @@ }, "methods": [ { + "async": true, "locationInModule": { "filename": "lib/compliance.ts", "line": 360 }, "name": "callerIsAsync", "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { @@ -5954,7 +5868,9 @@ }, "name": "callerIsMethod", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { @@ -5994,7 +5910,9 @@ }, "name": "readA", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { @@ -6004,7 +5922,9 @@ }, "name": "retrieveOtherProperty", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -6014,7 +5934,9 @@ }, "name": "retrieveReadOnlyProperty", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -6024,7 +5946,9 @@ }, "name": "retrieveValueOfTheProperty", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -6042,7 +5966,9 @@ } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { @@ -6129,9 +6055,7 @@ "jsii-calc.Thrower": { "assembly": "jsii-calc", "fqn": "jsii-calc.Thrower", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -6151,15 +6075,12 @@ "jsii-calc.UnaryOperation": { "abstract": true, "assembly": "jsii-calc", - "base": { - "fqn": "@scope/jsii-calc-lib.Operation" - }, + "base": "@scope/jsii-calc-lib.Operation", "docs": { "summary": "An operation on a single operand." }, "fqn": "jsii-calc.UnaryOperation", "initializer": { - "initializer": true, "parameters": [ { "name": "operand", @@ -6232,8 +6153,8 @@ "line": 942 }, "name": "foo", + "optional": true, "type": { - "optional": true, "union": { "types": [ { @@ -6251,9 +6172,7 @@ "jsii-calc.UseBundledDependency": { "assembly": "jsii-calc", "fqn": "jsii-calc.UseBundledDependency", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -6267,7 +6186,9 @@ }, "name": "value", "returns": { - "primitive": "any" + "type": { + "primitive": "any" + } } } ], @@ -6279,9 +6200,7 @@ "summary": "Depend on a type from jsii-calc-base as a test for awslabs/jsii#128." }, "fqn": "jsii-calc.UseCalcBase", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -6295,7 +6214,9 @@ }, "name": "hello", "returns": { - "fqn": "@scope/jsii-calc-base.Base" + "type": { + "fqn": "@scope/jsii-calc-base.Base" + } } } ], @@ -6305,7 +6226,6 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.UsesInterfaceWithProperties", "initializer": { - "initializer": true, "parameters": [ { "name": "obj", @@ -6328,7 +6248,9 @@ }, "name": "justRead", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -6346,7 +6268,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -6364,7 +6288,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -6387,7 +6313,6 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.VariadicMethod", "initializer": { - "initializer": true, "parameters": [ { "docs": { @@ -6436,11 +6361,13 @@ } ], "returns": { - "collection": { - "elementtype": { - "primitive": "number" - }, - "kind": "array" + "type": { + "collection": { + "elementtype": { + "primitive": "number" + }, + "kind": "array" + } } }, "variadic": true @@ -6451,9 +6378,7 @@ "jsii-calc.VirtualMethodPlayground": { "assembly": "jsii-calc", "fqn": "jsii-calc.VirtualMethodPlayground", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -6461,6 +6386,7 @@ }, "methods": [ { + "async": true, "locationInModule": { "filename": "lib/compliance.ts", "line": 451 @@ -6475,8 +6401,9 @@ } ], "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { @@ -6494,10 +6421,13 @@ } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { + "async": true, "locationInModule": { "filename": "lib/compliance.ts", "line": 433 @@ -6512,11 +6442,13 @@ } ], "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { + "async": true, "locationInModule": { "filename": "lib/compliance.ts", "line": 424 @@ -6531,8 +6463,9 @@ } ], "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { @@ -6550,7 +6483,9 @@ } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -6559,16 +6494,12 @@ "jsii-calc.composition.CompositeOperation": { "abstract": true, "assembly": "jsii-calc", - "base": { - "fqn": "@scope/jsii-calc-lib.Operation" - }, + "base": "@scope/jsii-calc-lib.Operation", "docs": { "summary": "Abstract operation composed from an expression of other operations." }, "fqn": "jsii-calc.composition.CompositeOperation", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/calculator.ts", @@ -6584,11 +6515,11 @@ "line": 158 }, "name": "toString", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Operation" - }, + "overrides": "@scope/jsii-calc-lib.Operation", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -6620,9 +6551,7 @@ "line": 148 }, "name": "value", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "overrides": "@scope/jsii-calc-lib.Value", "type": { "primitive": "number" } @@ -6708,5 +6637,5 @@ } }, "version": "0.9.0", - "fingerprint": "0BBn1Fo4aK6xtF8MiEQ138I208hMwwwg49bGtKZEvT8=" + "fingerprint": "Lg8wDjQSsRLa2sk8EriArt/u5aibYilCuYFRZHh02Eg=" } diff --git a/packages/jsii-diff/lib/classes-ifaces.ts b/packages/jsii-diff/lib/classes-ifaces.ts index 9523933ce8..f2f0ace0fc 100644 --- a/packages/jsii-diff/lib/classes-ifaces.ts +++ b/packages/jsii-diff/lib/classes-ifaces.ts @@ -68,57 +68,72 @@ function noNewAbstractMembers(original: T, upda } } -function describeTypeMatchingFailure(origType: reflect.TypeReference, updatedType: reflect.TypeReference, analysis: FailedAnalysis) { - if (origType.toString() !== updatedType.toString()) { - return `${updatedType} (formerly ${origType}): ${analysis.reasons.join(', ')}`; +function describeOptionalValueMatchingFailure(origType: reflect.OptionalValue, updatedType: reflect.OptionalValue, analysis: FailedAnalysis) { + const origDescr = reflect.OptionalValue.describe(origType); + const updaDescr = reflect.OptionalValue.describe(updatedType); + if (origDescr !== updaDescr) { + return `${updaDescr} (formerly ${origDescr}): ${analysis.reasons.join(', ')}`; } else { - return `${updatedType}: ${analysis.reasons.join(', ')}`; + return `${updaDescr}: ${analysis.reasons.join(', ')}`; } } -function compareMethod(origClass: reflect.Type, original: reflect.Method, updated: reflect.Method, context: ComparisonContext) { - if (original.static !== updated.static) { - // tslint:disable-next-line:max-line-length - context.mismatches.report(origClass, `method ${original.name} was ${original.static ? 'static' : 'not static'}, is now ${updated.static ? 'static' : 'not static'}.`); +function compareMethod( + origClass: reflect.Type, + original: T, + updated: T, + context: ComparisonContext) { + // Type guards on original are duplicated on updated to help tsc... They are required to be the same type by the declaration. + if (reflect.isMethod(original) && reflect.isMethod(updated)) { + if (original.static !== updated.static) { + const origQual = original.static ? 'static' : 'not static'; + const updQual = updated.static ? 'static' : 'not static'; + context.mismatches.report(origClass, `${original.kind} ${original.name} was ${origQual}, is now ${updQual}.`); + } + + if (original.async !== updated.async) { + const origQual = original.async ? 'asynchronous' : 'synchronous'; + const updQual = updated.async ? 'asynchronous' : 'synchronous'; + context.mismatches.report(origClass, `${original.kind} ${original.name} was ${origQual}, is now ${updQual}`); + } } if (original.variadic && !updated.variadic) { // Once variadic, can never be made non-variadic anymore (because I could always have been passing N+1 arguments) - context.mismatches.report(origClass, `method ${original.name} used to be variadic, not variadic anymore.`); + context.mismatches.report(origClass, `${original.kind} ${original.name} used to be variadic, not variadic anymore.`); } - const retAna = isCompatibleReturnType(original.returns, updated.returns); - if (!retAna.success) { - // tslint:disable-next-line:max-line-length - context.mismatches.report(origClass, `method ${original.name}, returns ${describeTypeMatchingFailure(original.returns, updated.returns, retAna)}`); + if (reflect.isMethod(original) && reflect.isMethod(updated)) { + const retAna = isCompatibleReturnType(original.returns, updated.returns); + if (!retAna.success) { + // tslint:disable-next-line:max-line-length + context.mismatches.report(origClass, `${original.kind} ${original.name}, returns ${describeOptionalValueMatchingFailure(original.returns, updated.returns, retAna)}`); + } } // Check that every original parameter can still be mapped to a parameter in the updated method original.parameters.forEach((param, i) => { const updatedParam = findParam(updated.parameters, i); if (updatedParam === undefined) { - context.mismatches.report(origClass, `method ${original.name} argument ${param.name}, not accepted anymore.`); + context.mismatches.report(origClass, `${original.kind} ${original.name} argument ${param.name}, not accepted anymore.`); return; } const argAna = isCompatibleArgumentType(param.type, updatedParam.type); if (!argAna.success) { // tslint:disable-next-line:max-line-length - context.mismatches.report(origClass, `method ${original.name} argument ${param.name}, takes ${describeTypeMatchingFailure(param.type, updatedParam.type, argAna)}`); + context.mismatches.report(origClass, `${original.kind} ${original.name} argument ${param.name}, takes ${describeOptionalValueMatchingFailure(param, updatedParam, argAna)}`); return; } }); - // Check that no new required fields got added - // Until we implement https://github.com/awslabs/jsii/issues/296 and make the - // distinction, for now a required field means a field with a non-nullable - // type. + // Check that no new required parameters got added. updated.parameters.forEach((param, i) => { - if (param.type.optional) { return; } + if (param.optional) { return; } const origParam = findParam(original.parameters, i); - if (!origParam || origParam.type.optional) { - context.mismatches.report(origClass, `method ${original.name} argument ${param.name}, newly required argument.`); + if (!origParam || origParam.optional) { + context.mismatches.report(origClass, `${original.kind} ${original.name} argument ${param.name}, newly required argument.`); } }); } @@ -148,9 +163,9 @@ function compareProperty(origClass: reflect.Type, original: reflect.Property, up context.mismatches.report(origClass, `property ${original.name}, used to be ${original.static ? 'static' : 'not static'}, is now ${updated.static ? 'static' : 'not static'}`); } - const ana = isCompatibleReturnType(original.type, updated.type); + const ana = isCompatibleReturnType(original, updated); if (!ana.success) { - context.mismatches.report(origClass, `property ${original.name}, type ${describeTypeMatchingFailure(original.type, updated.type, ana)}`); + context.mismatches.report(origClass, `property ${original.name}, type ${describeOptionalValueMatchingFailure(original, updated, ana)}`); } if (updated.immutable && !original.immutable) { @@ -186,10 +201,13 @@ function* memberPairs \(formerly string\): output type is now optional/, ` export class Henk { public henk: string = 'henk'; diff --git a/packages/jsii-diff/tsconfig.json b/packages/jsii-diff/tsconfig.json index 5bde5dff77..f17390cdc0 100644 --- a/packages/jsii-diff/tsconfig.json +++ b/packages/jsii-diff/tsconfig.json @@ -16,9 +16,13 @@ "noFallthroughCasesInSwitch": true, "inlineSourceMap": true, "inlineSources": true, - "experimentalDecorators": true + "experimentalDecorators": true, + "composite": true }, - "exclude": [ - "test/negatives/*" + "include": [ + "**/*.ts" + ], + "references": [ + { "path": "../jsii-reflect" } ] } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs index 4b96d299a5..3f54745c24 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs @@ -609,7 +609,7 @@ public void CreatesBasicTypeFile() namespace Aws.Cdk.CxApiNamespace { - [JsiiClass(typeof(MissingContext), ""jsii$aws_cdk_cx_api$.MissingContext"", ""[]"")] + [JsiiClass(nativeType: typeof(MissingContext), fullyQualifiedName: ""jsii$aws_cdk_cx_api$.MissingContext"")] public class MissingContext : DeputyBase { public MissingContext(): base(new DeputyProps(new object[]{})) diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/AbstractClassProxyGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/AbstractClassProxyGeneratorTests.cs index bedc10ab15..1b0255d3c7 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/AbstractClassProxyGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/AbstractClassProxyGeneratorTests.cs @@ -29,14 +29,14 @@ public void IncludesAttribute() "myPackage", "myClass", true, - initializer: new Method(true, false, false) + initializer: new Initializer() ); var actual = Render(classType); var expected = @"namespace MyNamespace { - [JsiiTypeProxy(typeof(MyClass), ""myFqn"")] + [JsiiTypeProxy(nativeType: typeof(MyClass), fullyQualifiedName: ""myFqn"")] internal sealed class MyClassProxy : MyClass { private MyClassProxy(ByRefValue reference): base(reference) @@ -57,7 +57,7 @@ public void IncludesDocs() assembly: "myPackage", name: "myClass", isAbstract: true, - initializer: new Method(true, false, false), + initializer: new Initializer(), docs: new Docs {{"foo", "bar"}} ); @@ -66,7 +66,7 @@ public void IncludesDocs() @"namespace MyNamespace { /// foo: bar - [JsiiTypeProxy(typeof(MyClass), ""myFqn"")] + [JsiiTypeProxy(nativeType: typeof(MyClass), fullyQualifiedName: ""myFqn"")] internal sealed class MyClassProxy : MyClass { private MyClassProxy(ByRefValue reference): base(reference) @@ -86,7 +86,7 @@ public void IncludesProperties() assembly: "myPackage", name: "myClass", isAbstract: true, - initializer: new Method(true, false, false), + initializer: new Initializer(), properties: new[] { new Property @@ -115,14 +115,14 @@ public void IncludesProperties() string expected = @"namespace MyNamespace { - [JsiiTypeProxy(typeof(MyClass), ""myFqn"")] + [JsiiTypeProxy(nativeType: typeof(MyClass), fullyQualifiedName: ""myFqn"")] internal sealed class MyClassProxy : MyClass { private MyClassProxy(ByRefValue reference): base(reference) { } - [JsiiProperty(""myProp"", ""{\""fqn\"":\""myPropTypeFqn\""}"")] + [JsiiProperty(name: ""myProp"", typeJson: ""{\""fqn\"":\""myPropTypeFqn\""}"")] public override MyPropType MyProp { get => GetInstanceProperty(); @@ -142,21 +142,16 @@ public void IncludesMethods() assembly: "myPackage", name: "myClass", isAbstract: true, - initializer: new Method(true, false, false), + initializer: new Initializer(), methods: new[] { new Method ( - false, - false, - true, + isAbstract: true, name: "myMethod" ), new Method ( - false, - false, - false, name: "notMyMethod" ) } @@ -168,14 +163,14 @@ public void IncludesMethods() string expected = @"namespace MyNamespace { - [JsiiTypeProxy(typeof(MyClass), ""myFqn"")] + [JsiiTypeProxy(nativeType: typeof(MyClass), fullyQualifiedName: ""myFqn"")] internal sealed class MyClassProxy : MyClass { private MyClassProxy(ByRefValue reference): base(reference) { } - [JsiiMethod(""myMethod"", null, ""[]"")] + [JsiiMethod(name: ""myMethod"")] public override void MyMethod() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassGeneratorTests.cs index 5c44436163..642cb1847c 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassGeneratorTests.cs @@ -31,14 +31,14 @@ public void IncludesAttribute() assembly: "myPackage", name: "myClass", isAbstract: false, - initializer: new Method(true, false, false) + initializer: new Initializer() ); string actual = Render(classType); string expected = @"namespace MyNamespace { - [JsiiClass(typeof(MyClass), ""myFqn"", ""[]"")] + [JsiiClass(nativeType: typeof(MyClass), fullyQualifiedName: ""myFqn"")] public class MyClass : DeputyBase { public MyClass(): base(new DeputyProps(new object[]{})) @@ -72,7 +72,7 @@ public void AllowsPrivateConstructor() string expected = @"namespace MyNamespace { - [JsiiClass(typeof(MyClass), ""myFqn"", ""[]"")] + [JsiiClass(nativeType: typeof(MyClass), fullyQualifiedName: ""myFqn"")] public class MyClass : DeputyBase { protected MyClass(ByRefValue reference): base(reference) @@ -96,14 +96,14 @@ public void IncludesAbstractKeyword() assembly: "myPackage", name: "myClass", isAbstract: true, - initializer: new Method(true, false, false) + initializer: new Initializer() ); string actual = Render(classType); string expected = @"namespace MyNamespace { - [JsiiClass(typeof(MyClass), ""myFqn"", ""[]"")] + [JsiiClass(nativeType: typeof(MyClass), fullyQualifiedName: ""myFqn"")] public abstract class MyClass : DeputyBase { protected MyClass(): base(new DeputyProps(new object[]{})) @@ -132,7 +132,7 @@ public void IncludesDocs() assembly: "myPackage", name: "myClass", isAbstract: false, - initializer: new Method(true, false, false), + initializer: new Initializer(), docs: new Docs {{"foo", "bar"}} ); @@ -141,7 +141,7 @@ public void IncludesDocs() @"namespace MyNamespace { /// foo: bar - [JsiiClass(typeof(MyClass), ""myFqn"", ""[]"")] + [JsiiClass(nativeType: typeof(MyClass), fullyQualifiedName: ""myFqn"")] public class MyClass : DeputyBase { public MyClass(): base(new DeputyProps(new object[]{})) @@ -169,7 +169,7 @@ public void IncludesProperties() assembly: "myPackage", name: "myClass", isAbstract: false, - initializer: new Method(true, false, false), + initializer: new Initializer(), properties: new[] { new Property @@ -190,7 +190,7 @@ public void IncludesProperties() string expected = @"namespace MyNamespace { - [JsiiClass(typeof(MyClass), ""myFqn"", ""[]"")] + [JsiiClass(nativeType: typeof(MyClass), fullyQualifiedName: ""myFqn"")] public class MyClass : DeputyBase { public MyClass(): base(new DeputyProps(new object[]{})) @@ -205,7 +205,7 @@ protected MyClass(DeputyProps props): base(props) { } - [JsiiProperty(""myProp"", ""{\""fqn\"":\""myPropTypeFqn\""}"")] + [JsiiProperty(name: ""myProp"", typeJson: ""{\""fqn\"":\""myPropTypeFqn\""}"")] public virtual MyPropType MyProp { get => GetInstanceProperty(); @@ -225,14 +225,11 @@ public void IncludesMethods() assembly: "myPackage", name: "myClass", isAbstract: false, - initializer: new Method(true, false, false), + initializer: new Initializer(), methods: new[] { new Method ( - false, - false, - false, name: "myMethod" ) } @@ -244,7 +241,7 @@ public void IncludesMethods() string expected = @"namespace MyNamespace { - [JsiiClass(typeof(MyClass), ""myFqn"", ""[]"")] + [JsiiClass(nativeType: typeof(MyClass), fullyQualifiedName: ""myFqn"")] public class MyClass : DeputyBase { public MyClass(): base(new DeputyProps(new object[]{})) @@ -259,7 +256,7 @@ protected MyClass(DeputyProps props): base(props) { } - [JsiiMethod(""myMethod"", null, ""[]"")] + [JsiiMethod(name: ""myMethod"")] public virtual void MyMethod() { InvokeInstanceVoidMethod(new object[]{}); @@ -278,8 +275,8 @@ public void IncludesBase() assembly: "myPackage", name: "myClass", isAbstract: false, - initializer: new Method(true, false, false), - @base: new TypeReference("myBaseTypeFqn") + initializer: new Initializer(), + @base: "myBaseTypeFqn" ); Symbols.MapTypeName("myBaseTypeFqn", "MyBaseType", TypeKind.Class); @@ -288,7 +285,7 @@ public void IncludesBase() string expected = @"namespace MyNamespace { - [JsiiClass(typeof(MyClass), ""myFqn"", ""[]"")] + [JsiiClass(nativeType: typeof(MyClass), fullyQualifiedName: ""myFqn"")] public class MyClass : MyBaseType { public MyClass(): base(new DeputyProps(new object[]{})) @@ -316,11 +313,11 @@ public void IncludesInterfaces() assembly: "myPackage", name: "myClass", isAbstract: false, - initializer: new Method(true, false, false), + initializer: new Initializer(), interfaces: new[] { - new TypeReference("myInterfaceFqn1"), - new TypeReference("myInterfaceFqn2"), + "myInterfaceFqn1", + "myInterfaceFqn2", } ); @@ -331,7 +328,7 @@ public void IncludesInterfaces() string expected = @"namespace MyNamespace { - [JsiiClass(typeof(MyClass), ""myFqn"", ""[]"")] + [JsiiClass(nativeType: typeof(MyClass), fullyQualifiedName: ""myFqn"")] public class MyClass : DeputyBase, IMyInterface1, IMyInterface2 { public MyClass(): base(new DeputyProps(new object[]{})) diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassMethodGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassMethodGeneratorTests.cs index 974e820bc5..e8dd66c21c 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassMethodGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassMethodGeneratorTests.cs @@ -18,7 +18,7 @@ string Render(Method method) assembly: "myModule", name: "myClass", isAbstract: true, - initializer: new Method(true, false, false), + initializer: new Initializer(), methods: new[] { method } ); @@ -35,13 +35,13 @@ string Render(Method method) [Fact(DisplayName = Prefix + nameof(IncludesProtectedKeyword))] public void IncludesAttribute() { - Method method = new Method(false, false, false, name: "myMethod"); + Method method = new Method(name: "myMethod"); Symbols.MapMethodName("myClassFqn", "myMethod", "MyMethod"); string actual = Render(method); string expected = -@"[JsiiMethod(""myMethod"", null, ""[]"")] +@"[JsiiMethod(name: ""myMethod"")] public virtual void MyMethod() { InvokeInstanceVoidMethod(new object[]{}); @@ -52,13 +52,13 @@ public virtual void MyMethod() [Fact(DisplayName = Prefix + nameof(IncludesProtectedKeyword))] public void IncludesProtectedKeyword() { - Method method = new Method(false, true, false, name: "myMethod"); + Method method = new Method(isProtected: true, name: "myMethod"); Symbols.MapMethodName("myClassFqn", "myMethod", "MyMethod"); string actual = Render(method); string expected = -@"[JsiiMethod(""myMethod"", null, ""[]"")] +@"[JsiiMethod(name: ""myMethod"")] protected virtual void MyMethod() { InvokeInstanceVoidMethod(new object[]{}); @@ -69,13 +69,13 @@ protected virtual void MyMethod() [Fact(DisplayName = Prefix + nameof(IncludesAbstractKeyword))] public void IncludesAbstractKeyword() { - Method method = new Method(false, false, true, name: "myMethod"); + Method method = new Method(isAbstract: true, name: "myMethod"); Symbols.MapMethodName("myClassFqn", "myMethod", "MyMethod"); string actual = Render(method); string expected = -@"[JsiiMethod(""myMethod"", null, ""[]"")] +@"[JsiiMethod(name: ""myMethod"")] public abstract void MyMethod();"; Assert.Equal(expected, actual, ignoreLineEndingDifferences: true); } @@ -85,11 +85,11 @@ public void IncluesParameters() { Method method = new Method ( - false, false, false, name: "myMethod", + name: "myMethod", parameters: new[] { - new Parameter("myParam", new TypeReference("myParamTypeFqn")), - new Parameter("event", new TypeReference(primitive: PrimitiveType.String)) + new Parameter(name: "myParam", type: new TypeReference("myParamTypeFqn")), + new Parameter(name: "event", type: new TypeReference(primitive: PrimitiveType.String)) } ); @@ -100,7 +100,7 @@ public void IncluesParameters() string actual = Render(method); string expected = -@"[JsiiMethod(""myMethod"", null, ""[{\""name\"":\""myParam\"",\""type\"":{\""fqn\"":\""myParamTypeFqn\""}},{\""name\"":\""event\"",\""type\"":{\""primitive\"":\""string\""}}]"")] +@"[JsiiMethod(name: ""myMethod"", parametersJson: ""[{\""name\"":\""myParam\"",\""type\"":{\""fqn\"":\""myParamTypeFqn\""}},{\""name\"":\""event\"",\""type\"":{\""primitive\"":\""string\""}}]"")] public virtual void MyMethod(MyParamType myParam, string @event) { InvokeInstanceVoidMethod(new object[]{myParam, @event}); @@ -113,7 +113,7 @@ public void DoesNotIncludeDocs() { Method method = new Method ( - false, false, false, name: "myMethod", + name: "myMethod", docs: new Docs { { "foo", "bar" } } ); @@ -121,7 +121,7 @@ public void DoesNotIncludeDocs() string actual = Render(method); string expected = -@"[JsiiMethod(""myMethod"", null, ""[]"")] +@"[JsiiMethod(name: ""myMethod"")] public virtual void MyMethod() { InvokeInstanceVoidMethod(new object[]{}); @@ -134,11 +134,10 @@ public void IncludesReturnTypeForNonVoid() { Method method = new Method ( - isInitializer: false, isProtected: false, isAbstract: false, name: "myMethod", - returns: new TypeReference("myReturnTypeFqn") + returns: new OptionalValue(type: new TypeReference("myReturnTypeFqn")) ); Symbols.MapMethodName("myClassFqn", "myMethod", "MyMethod"); @@ -146,7 +145,7 @@ public void IncludesReturnTypeForNonVoid() string actual = Render(method); string expected = -@"[JsiiMethod(""myMethod"", ""{\""fqn\"":\""myReturnTypeFqn\""}"", ""[]"")] +@"[JsiiMethod(name: ""myMethod"", returnsJson: ""{\""type\"":{\""fqn\"":\""myReturnTypeFqn\""}}"")] public virtual MyReturnType MyMethod() { return InvokeInstanceMethod(new object[]{}); @@ -159,11 +158,10 @@ public void SupportsStaticMethods() { Method method = new Method ( - isInitializer: false, isProtected: false, isAbstract: false, name: "myMethod", - returns: new TypeReference("myReturnTypeFqn"), + returns: new OptionalValue(type: new TypeReference("myReturnTypeFqn")), isStatic: true ); @@ -172,7 +170,7 @@ public void SupportsStaticMethods() string actual = Render(method); string expected = -@"[JsiiMethod(""myMethod"", ""{\""fqn\"":\""myReturnTypeFqn\""}"", ""[]"")] +@"[JsiiMethod(name: ""myMethod"", returnsJson: ""{\""type\"":{\""fqn\"":\""myReturnTypeFqn\""}}"")] public static MyReturnType MyMethod() { return InvokeStaticMethod(typeof(MyClass), new object[]{}); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassPropertyGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassPropertyGeneratorTests.cs index 2e8da48ef1..31e8299177 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassPropertyGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassPropertyGeneratorTests.cs @@ -19,7 +19,7 @@ string Render(Property property) name: "myClass", @namespace: "myNamespace", isAbstract: true, - initializer: new Method(true, false, false), + initializer: new Initializer(), properties: new[] { property } ); @@ -50,7 +50,7 @@ public void IncludesAttribute() string actual = Render(property); string expected = -@"[JsiiProperty(""myProperty"", ""{\""fqn\"":\""myPropTypeFqn\""}"")] +@"[JsiiProperty(name: ""myProperty"", typeJson: ""{\""fqn\"":\""myPropTypeFqn\""}"")] public virtual MyPropType MyProperty { get => GetInstanceProperty(); @@ -75,7 +75,7 @@ public void IncludesGetter() string actual = Render(property); string expected = -@"[JsiiProperty(""myProperty"", ""{\""fqn\"":\""myPropTypeFqn\""}"")] +@"[JsiiProperty(name: ""myProperty"", typeJson: ""{\""fqn\"":\""myPropTypeFqn\""}"")] public virtual MyPropType MyProperty { get => GetInstanceProperty(); @@ -100,7 +100,7 @@ public void IncludesSetter() string actual = Render(property); string expected = -@"[JsiiProperty(""myProperty"", ""{\""fqn\"":\""myPropTypeFqn\""}"")] +@"[JsiiProperty(name: ""myProperty"", typeJson: ""{\""fqn\"":\""myPropTypeFqn\""}"")] public virtual MyPropType MyProperty { get => GetInstanceProperty(); @@ -126,7 +126,7 @@ public void IncludesProtectedKeyword() string actual = Render(property); string expected = -@"[JsiiProperty(""myProperty"", ""{\""fqn\"":\""myPropTypeFqn\""}"")] +@"[JsiiProperty(name: ""myProperty"", typeJson: ""{\""fqn\"":\""myPropTypeFqn\""}"")] protected virtual MyPropType MyProperty { get => GetInstanceProperty(); @@ -152,7 +152,7 @@ public void SupportsStaticProperties() string actual = Render(property); string expected = -@"[JsiiProperty(""myProperty"", ""{\""fqn\"":\""myPropTypeFqn\""}"")] +@"[JsiiProperty(name: ""myProperty"", typeJson: ""{\""fqn\"":\""myPropTypeFqn\""}"")] public static MyPropType MyProperty { get => GetStaticProperty(typeof(MyClass)); @@ -178,7 +178,7 @@ public void OptimizesConstantProperties() string actual = Render(property); string expected = -@"[JsiiProperty(""myProperty"", ""{\""fqn\"":\""myPropTypeFqn\""}"")] +@"[JsiiProperty(name: ""myProperty"", typeJson: ""{\""fqn\"":\""myPropTypeFqn\""}"")] public static MyPropType MyProperty { get; @@ -206,7 +206,7 @@ public void DoesNotIncludeDocs() string actual = Render(property); string expected = -@"[JsiiProperty(""myProperty"", ""{\""fqn\"":\""myPropTypeFqn\""}"")] +@"[JsiiProperty(name: ""myProperty"", typeJson: ""{\""fqn\"":\""myPropTypeFqn\""}"")] public virtual MyPropType MyProperty { get => GetInstanceProperty(); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/MethodDocCommentGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/MethodDocCommentGeneratorTests.cs index eedd96cbd2..2bb44e73f1 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/MethodDocCommentGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/MethodDocCommentGeneratorTests.cs @@ -13,11 +13,8 @@ public class MethodDocCommentGeneratorTests : GeneratorTestBase string Render(Docs docs, params Parameter[] parameters) { Method method = new Method( - false, - false, - false, - parameters, - docs, + parameters: parameters, + docs: docs, name: "method" ); @@ -158,9 +155,9 @@ public void IncludesReturns() public void IgnoresParameterParam() { Parameter parameter = new Parameter( - "myParam", - new TypeReference(primitive: PrimitiveType.String), - new Docs + name: "myParam", + type: new TypeReference(primitive: PrimitiveType.String), + docs: new Docs { { "param", "my comment" } } @@ -178,9 +175,9 @@ public void IgnoresParameterParam() public void TrimsParameterSummary() { Parameter parameter = new Parameter( - "myParam", - new TypeReference(primitive: PrimitiveType.String), - new Docs + name: "myParam", + type: new TypeReference(primitive: PrimitiveType.String), + docs: new Docs { { "summary", "my comment" } } @@ -200,9 +197,9 @@ public void TrimsParameterSummary() public void IncludesParameterRemarks() { Parameter parameter = new Parameter( - "myParam", - new TypeReference(primitive: PrimitiveType.String), - new Docs + name: "myParam", + type: new TypeReference(primitive: PrimitiveType.String), + docs: new Docs { { "myKey1", "my comment" }, { "myKey2", "my comment" } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/PropertyDocCommentGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/PropertyDocCommentGeneratorTests.cs index 5c80272a03..a87cfd74c6 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/PropertyDocCommentGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/PropertyDocCommentGeneratorTests.cs @@ -13,12 +13,12 @@ public class PropertyDocCommentGeneratorTests : GeneratorTestBase string Render(Docs docs) { Property property = new Property( - "myProp", - new TypeReference(primitive: PrimitiveType.String), - false, - false, - false, - docs + name: "myProp", + type: new TypeReference(primitive: PrimitiveType.String), + isImmutable: false, + isAbstract: false, + isStatic: false, + docs: docs ); PropertyDocCommentGenerator generator = new PropertyDocCommentGenerator(property); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Enum/EnumGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Enum/EnumGeneratorTests.cs index d50ef90005..45fca21661 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Enum/EnumGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Enum/EnumGeneratorTests.cs @@ -37,7 +37,7 @@ public void IncludesAttribute() string expected = @"namespace MyNamespace { - [JsiiEnum(typeof(MyEnum), ""myEnumFqn"")] + [JsiiEnum(nativeType: typeof(MyEnum), fullyQualifiedName: ""myEnumFqn"")] public enum MyEnum { } @@ -67,12 +67,12 @@ public void IncludesMembers() string expected = @"namespace MyNamespace { - [JsiiEnum(typeof(MyEnum), ""myEnumFqn"")] + [JsiiEnum(nativeType: typeof(MyEnum), fullyQualifiedName: ""myEnumFqn"")] public enum MyEnum { - [JsiiEnumMember(""member1"")] + [JsiiEnumMember(name: ""member1"")] Member1, - [JsiiEnumMember(""member2"")] + [JsiiEnumMember(name: ""member2"")] Member2 } }"; @@ -99,7 +99,7 @@ public void IncludesDocs() @"namespace MyNamespace { /// foo: bar - [JsiiEnum(typeof(MyEnum), ""myEnumFqn"")] + [JsiiEnum(nativeType: typeof(MyEnum), fullyQualifiedName: ""myEnumFqn"")] public enum MyEnum { } @@ -129,14 +129,14 @@ public void IncludesMemberDocs() string expected = @"namespace MyNamespace { - [JsiiEnum(typeof(MyEnum), ""myEnumFqn"")] + [JsiiEnum(nativeType: typeof(MyEnum), fullyQualifiedName: ""myEnumFqn"")] public enum MyEnum { /// foo: bar - [JsiiEnumMember(""member1"")] + [JsiiEnumMember(name: ""member1"")] Member1, /// foo: bar - [JsiiEnumMember(""member2"")] + [JsiiEnumMember(name: ""member2"")] Member2 } }"; diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/GeneratorTestBase.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/GeneratorTestBase.cs index a0f17af855..419e7e6358 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/GeneratorTestBase.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/GeneratorTestBase.cs @@ -13,7 +13,7 @@ public GeneratorTestBase() Namespaces = Substitute.For(); Symbols - .GetTypeSyntax(Arg.Is(t => t.Primitive == PrimitiveType.String && t.IsOptional != true)) + .GetTypeSyntax(Arg.Is(t => t.Primitive == PrimitiveType.String), false) .Returns(SF.ParseTypeName("string")); } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceGeneratorTests.cs index faee92a986..4a4eac350f 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceGeneratorTests.cs @@ -35,7 +35,7 @@ public void IncludesAttribute() string expected = @"namespace MyNamespace { - [JsiiInterface(typeof(IMyInterface), ""myInterfaceFqn"")] + [JsiiInterface(nativeType: typeof(IMyInterface), fullyQualifiedName: ""myInterfaceFqn"")] public interface IMyInterface { } @@ -53,8 +53,8 @@ public void IncludesBaseInterfaces() name: "MyInterface", interfaces: new[] { - new TypeReference(fullyQualifiedName: "myBaseFqn1"), - new TypeReference(fullyQualifiedName: "myBaseFqn2"), + "myBaseFqn1", + "myBaseFqn2", } ); @@ -65,7 +65,7 @@ public void IncludesBaseInterfaces() string expected = @"namespace MyNamespace { - [JsiiInterface(typeof(IMyInterface), ""myInterfaceFqn"")] + [JsiiInterface(nativeType: typeof(IMyInterface), fullyQualifiedName: ""myInterfaceFqn"")] public interface IMyInterface : IMyBaseInterface1, IMyBaseInterface2 { } @@ -81,7 +81,7 @@ public void IncludesMethods() fullyQualifiedName: "myInterfaceFqn", assembly: "", name: "MyInterface", - methods: new Method[] { new Method(false, false, true, name: "myMethod") } + methods: new Method[] { new Method(name: "myMethod", isAbstract: true) } ); Symbols.MapMethodName("myInterfaceFqn", "myMethod", "MyMethod"); @@ -90,10 +90,10 @@ public void IncludesMethods() string expected = @"namespace MyNamespace { - [JsiiInterface(typeof(IMyInterface), ""myInterfaceFqn"")] + [JsiiInterface(nativeType: typeof(IMyInterface), fullyQualifiedName: ""myInterfaceFqn"")] public interface IMyInterface { - [JsiiMethod(""myMethod"", null, ""[]"")] + [JsiiMethod(name: ""myMethod"")] void MyMethod(); } }"; diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceMethodGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceMethodGeneratorTests.cs index bd230d0363..535156c6cb 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceMethodGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceMethodGeneratorTests.cs @@ -37,11 +37,10 @@ public void RecordsReferencedReturnType() { Method method = new Method ( - false, - false, - true, + isProtected: false, + isAbstract: true, name: "myMethod", - returns: new TypeReference(fullyQualifiedName: "myReturnTypeFqn") + returns: new OptionalValue(type: new TypeReference(fullyQualifiedName: "myReturnTypeFqn")) ); Render(method); @@ -53,16 +52,15 @@ public void RecordsReferencedParameterType() { Method method = new Method ( - false, - false, - true, + isProtected: false, + isAbstract: true, name: "myMethod", parameters: new[] { new Parameter ( - "myParameter", - new TypeReference(fullyQualifiedName: "myParameterTypeFqn") + name: "myParameter", + type: new TypeReference(fullyQualifiedName: "myParameterTypeFqn") ) } ); @@ -79,15 +77,14 @@ public void GeneratesVoidMethodWithNoParameters() { Method method = new Method ( - false, - false, - true, + isProtected: false, + isAbstract: true, name: "myMethod" ); string actual = Render(method); string expected = -@"[JsiiMethod(""myMethod"", null, ""[]"")] +@"[JsiiMethod(name: ""myMethod"")] void MyMethod();"; Assert.Equal(expected, actual, ignoreLineEndingDifferences: true); @@ -98,21 +95,20 @@ public void GeneratesPrimitiveParameters() { Method method = new Method ( - false, - false, - true, + isProtected: false, + isAbstract: true, name: "myMethod", parameters: new[] { new Parameter ( - "myParameter1", - new TypeReference(primitive: PrimitiveType.String) + name: "myParameter1", + type: new TypeReference(primitive: PrimitiveType.String) ), new Parameter ( - "event", - new TypeReference(primitive: PrimitiveType.String) + name: "event", + type: new TypeReference(primitive: PrimitiveType.String) ), } ); @@ -122,7 +118,7 @@ public void GeneratesPrimitiveParameters() string actual = Render(method); string expected = -@"[JsiiMethod(""myMethod"", null, ""[{\""name\"":\""myParameter1\"",\""type\"":{\""primitive\"":\""string\""}},{\""name\"":\""event\"",\""type\"":{\""primitive\"":\""string\""}}]"")] +@"[JsiiMethod(name: ""myMethod"", parametersJson: ""[{\""name\"":\""myParameter1\"",\""type\"":{\""primitive\"":\""string\""}},{\""name\"":\""event\"",\""type\"":{\""primitive\"":\""string\""}}]"")] void MyMethod(string myParameter1, string @event);"; Assert.Equal(expected, actual, ignoreLineEndingDifferences: true); @@ -133,16 +129,15 @@ public void GeneratesPrimitiveReturnType() { Method method = new Method ( - false, - false, - true, + isProtected: false, + isAbstract: true, name: "myMethod", - returns: new TypeReference(primitive: PrimitiveType.String) + returns: new OptionalValue(type: new TypeReference(primitive: PrimitiveType.String)) ); string actual = Render(method); string expected = -@"[JsiiMethod(""myMethod"", ""{\""primitive\"":\""string\""}"", ""[]"")] +@"[JsiiMethod(name: ""myMethod"", returnsJson: ""{\""type\"":{\""primitive\"":\""string\""}}"")] string MyMethod();"; Assert.Equal(expected, actual, ignoreLineEndingDifferences: true); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyGeneratorTests.cs index f7a4db2d32..2e66a460a2 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyGeneratorTests.cs @@ -41,7 +41,7 @@ public void IncludesAttribute() string expected = @"namespace MyNamespace { - [JsiiTypeProxy(typeof(IMyInterface), ""myInterfaceFqn"")] + [JsiiTypeProxy(nativeType: typeof(IMyInterface), fullyQualifiedName: ""myInterfaceFqn"")] internal sealed class MyInterfaceProxy : DeputyBase, IMyInterface { private MyInterfaceProxy(ByRefValue reference): base(reference) @@ -61,7 +61,7 @@ public void IncludesMethods() "myPackage", "myInterface", "myNamespace", - methods: new Method[] {new Method(false, false, true, name: "myMethod")} + methods: new Method[] {new Method(isAbstract: true, name: "myMethod")} ); Symbols.MapMethodName("myInterfaceFqn", "myMethod", "MyMethod"); @@ -70,14 +70,14 @@ public void IncludesMethods() string expected = @"namespace MyNamespace { - [JsiiTypeProxy(typeof(IMyInterface), ""myInterfaceFqn"")] + [JsiiTypeProxy(nativeType: typeof(IMyInterface), fullyQualifiedName: ""myInterfaceFqn"")] internal sealed class MyInterfaceProxy : DeputyBase, IMyInterface { private MyInterfaceProxy(ByRefValue reference): base(reference) { } - [JsiiMethod(""myMethod"", null, ""[]"")] + [JsiiMethod(name: ""myMethod"")] public void MyMethod() { InvokeInstanceVoidMethod(new object[]{}); @@ -96,7 +96,7 @@ public void IncludesAncestorInterfaceMethods() "myPackage", "myAncestorInterface", "myNamespace", - methods: new[] {new Method(false, false, true, name: "myAncestorMethod")} + methods: new[] {new Method(isAbstract: true, name: "myAncestorMethod")} ); InterfaceType baseInterface = new InterfaceType ( @@ -104,8 +104,8 @@ public void IncludesAncestorInterfaceMethods() "myPackage", "myBaseInterface", "myNamespace", - methods: new[] {new Method(false, false, true, name: "myBaseMethod")}, - interfaces: new[] {new TypeReference("myAncestorInterfaceFqn")} + methods: new[] {new Method(isAbstract: true, name: "myBaseMethod")}, + interfaces: new[] {"myAncestorInterfaceFqn"} ); InterfaceType interfaceType = new InterfaceType ( @@ -113,7 +113,7 @@ public void IncludesAncestorInterfaceMethods() "myPackage", "myInterface", "myNamespace", - interfaces: new[] {new TypeReference("myBaseInterfaceFqn")} + interfaces: new[] {"myBaseInterfaceFqn"} ); Symbols.MapTypeName("myAncestorInterfaceFqn", "MyAncestorInterface", TypeKind.Interface); @@ -128,20 +128,20 @@ public void IncludesAncestorInterfaceMethods() string expected = @"namespace MyNamespace { - [JsiiTypeProxy(typeof(IMyInterface), ""myInterfaceFqn"")] + [JsiiTypeProxy(nativeType: typeof(IMyInterface), fullyQualifiedName: ""myInterfaceFqn"")] internal sealed class MyInterfaceProxy : DeputyBase, IMyInterface { private MyInterfaceProxy(ByRefValue reference): base(reference) { } - [JsiiMethod(""myBaseMethod"", null, ""[]"")] + [JsiiMethod(name: ""myBaseMethod"")] public void MyBaseMethod() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod(""myAncestorMethod"", null, ""[]"")] + [JsiiMethod(name: ""myAncestorMethod"")] public void MyAncestorMethod() { InvokeInstanceVoidMethod(new object[]{}); @@ -168,7 +168,7 @@ public void IncludesDocs() @"namespace MyNamespace { /// foo: bar - [JsiiTypeProxy(typeof(IMyInterface), ""myInterfaceFqn"")] + [JsiiTypeProxy(nativeType: typeof(IMyInterface), fullyQualifiedName: ""myInterfaceFqn"")] internal sealed class MyInterfaceProxy : DeputyBase, IMyInterface { private MyInterfaceProxy(ByRefValue reference): base(reference) @@ -204,7 +204,7 @@ public void EnvironmentRegression() ""summary"": ""The 12-digit AWS account ID for the account this environment deploys into "" }, ""abstract"": true, - ""name"": ""account"", + ""name"": ""account"", ""type"": { ""primitive"": ""string"" } @@ -239,7 +239,7 @@ public void EnvironmentRegression() @"namespace Aws.Cdk.CxApi { /// Models an AWS execution environment, for use within the CDK toolkit. - [JsiiTypeProxy(typeof(IEnvironment), ""jsii$aws_cdk_cx_api$.Environment"")] + [JsiiTypeProxy(nativeType: typeof(IEnvironment), fullyQualifiedName: ""jsii$aws_cdk_cx_api$.Environment"")] internal sealed class EnvironmentProxy : DeputyBase, IEnvironment { private EnvironmentProxy(ByRefValue reference): base(reference) @@ -247,7 +247,7 @@ private EnvironmentProxy(ByRefValue reference): base(reference) } /// The arbitrary name of this environment (user-set, or at least user-meaningful) - [JsiiProperty(""name"", ""{\""primitive\"":\""string\""}"")] + [JsiiProperty(name: ""name"", typeJson: ""{\""primitive\"":\""string\""}"")] public string Name { get => GetInstanceProperty(); @@ -255,7 +255,7 @@ public string Name } /// The 12-digit AWS account ID for the account this environment deploys into - [JsiiProperty(""account"", ""{\""primitive\"":\""string\""}"")] + [JsiiProperty(name: ""account"", typeJson: ""{\""primitive\"":\""string\""}"")] public string Account { get => GetInstanceProperty(); @@ -263,7 +263,7 @@ public string Account } /// The AWS region name where this environment deploys into - [JsiiProperty(""region"", ""{\""primitive\"":\""string\""}"")] + [JsiiProperty(name: ""region"", typeJson: ""{\""primitive\"":\""string\""}"")] public string Region { get => GetInstanceProperty(); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyMethodGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyMethodGeneratorTests.cs index 76851dd603..666f2b2f37 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyMethodGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyMethodGeneratorTests.cs @@ -35,13 +35,13 @@ string Render(Method method) [Fact(DisplayName = Prefix + nameof(IncludesAttribute))] public void IncludesAttribute() { - Method method = new Method(false, false, true, name: "myMethod"); + Method method = new Method(isAbstract: true, name: "myMethod"); Symbols.MapMethodName("myInterfaceFqn", "myMethod", "MyMethod"); string actual = Render(method); string expected = -@"[JsiiMethod(""myMethod"", null, ""[]"")] +@"[JsiiMethod(name: ""myMethod"")] public void MyMethod() { InvokeInstanceVoidMethod(new object[]{}); @@ -54,11 +54,11 @@ public void IncluesParameters() { Method method = new Method ( - false, false, true, name: "myMethod", + isAbstract: true, name: "myMethod", parameters: new[] { - new Parameter("myParam", new TypeReference("myParamTypeFqn")), - new Parameter("event", new TypeReference(primitive: PrimitiveType.String)) + new Parameter(name: "myParam", type: new TypeReference("myParamTypeFqn")), + new Parameter(name: "event", type: new TypeReference(primitive: PrimitiveType.String)) } ); @@ -69,7 +69,7 @@ public void IncluesParameters() string actual = Render(method); string expected = -@"[JsiiMethod(""myMethod"", null, ""[{\""name\"":\""myParam\"",\""type\"":{\""fqn\"":\""myParamTypeFqn\""}},{\""name\"":\""event\"",\""type\"":{\""primitive\"":\""string\""}}]"")] +@"[JsiiMethod(name: ""myMethod"", parametersJson: ""[{\""name\"":\""myParam\"",\""type\"":{\""fqn\"":\""myParamTypeFqn\""}},{\""name\"":\""event\"",\""type\"":{\""primitive\"":\""string\""}}]"")] public void MyMethod(MyParamType myParam, string @event) { InvokeInstanceVoidMethod(new object[]{myParam, @event}); @@ -82,7 +82,7 @@ public void DoesNotIncludeDocs() { Method method = new Method ( - false, false, true, name: "myMethod", + isAbstract: true, name: "myMethod", docs: new Docs { { "foo", "bar" } } ); @@ -90,7 +90,7 @@ public void DoesNotIncludeDocs() string actual = Render(method); string expected = -@"[JsiiMethod(""myMethod"", null, ""[]"")] +@"[JsiiMethod(name: ""myMethod"")] public void MyMethod() { InvokeInstanceVoidMethod(new object[]{}); @@ -103,8 +103,8 @@ public void IncludesReturnTypeForNonVoid() { Method method = new Method ( - false, false, true, name: "myMethod", - returns: new TypeReference("myReturnTypeFqn") + isAbstract: true, name: "myMethod", + returns: new OptionalValue(type: new TypeReference("myReturnTypeFqn")) ); Symbols.MapMethodName("myInterfaceFqn", "myMethod", "MyMethod"); @@ -112,7 +112,7 @@ public void IncludesReturnTypeForNonVoid() string actual = Render(method); string expected = -@"[JsiiMethod(""myMethod"", ""{\""fqn\"":\""myReturnTypeFqn\""}"", ""[]"")] +@"[JsiiMethod(name: ""myMethod"", returnsJson: ""{\""type\"":{\""fqn\"":\""myReturnTypeFqn\""}}"")] public MyReturnType MyMethod() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/MethodExtensionsTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/MethodExtensionsTests.cs index 00b859c02f..cbc9ef975d 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/MethodExtensionsTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/MethodExtensionsTests.cs @@ -8,25 +8,22 @@ namespace Amazon.JSII.Generator.UnitTests { public class MethodExtensionsTests { - const string Prefix = nameof(Generator) + "." + nameof(MethodExtensions) + "."; + const string Prefix = nameof(Generator) + "." + nameof(CallableExtensions) + "."; public class GetParameterListSyntax : GeneratorTestBase { - const string _Prefix = Prefix + nameof(MethodExtensions.GetParameterListSyntax) + "."; + const string _Prefix = Prefix + nameof(CallableExtensions.GetParameterListSyntax) + "."; [Fact(DisplayName = _Prefix + nameof(IncludesAllParameters))] public void IncludesAllParameters() { Method method = new Method ( - false, - false, - false, name: "myMethod", parameters: new[] { - new Parameter("myParam1", new TypeReference("myParamTypeFqn1")), - new Parameter("myParam2", new TypeReference("myParamTypeFqn2")), + new Parameter(name: "myParam1", type: new TypeReference("myParamTypeFqn1")), + new Parameter(name: "myParam2", type: new TypeReference("myParamTypeFqn2")), } ); @@ -48,9 +45,6 @@ public void DoesNotThrowOnMissingParameterList() { Method method = new Method ( - false, - false, - false, name: "myMethod" ); @@ -81,14 +75,11 @@ public void AddsNamespacesToSet() ); Method method = new Method ( - false, - false, - false, name: "myMethod", parameters: new[] { - new Parameter("myParam1", new TypeReference("myParamTypeFqn1")), - new Parameter("myParam2", new TypeReference("myParamTypeFqn2")), + new Parameter(name: "myParam1", type: new TypeReference("myParamTypeFqn1")), + new Parameter(name: "myParam2", type: new TypeReference("myParamTypeFqn2")), } ); @@ -110,30 +101,29 @@ public void AddsNamespacesToSet() public class GetParametersJsonSyntaxToken : GeneratorTestBase { - const string _Prefix = Prefix + nameof(MethodExtensions.GetParametersJsonSyntaxToken) + "."; + const string _Prefix = Prefix + nameof(CallableExtensions.GetParametersJsonSyntaxToken) + "."; [Fact(DisplayName = _Prefix + nameof(StripsDocs))] public void StripsDocs() { Method method = new Method ( - false, - false, - false, + isProtected: false, + isAbstract: false, name: "myMethod", parameters: new[] { new Parameter ( - "myParam1", - new TypeReference("myParamTypeFqn1"), - new Docs { { "foo", "bar" } } + name: "myParam1", + type: new TypeReference("myParamTypeFqn1"), + docs: new Docs { { "foo", "bar" } } ), new Parameter ( - "myParam2", - new TypeReference("myParamTypeFqn2"), - new Docs { { "foo", "bar" } } + name: "myParam2", + type: new TypeReference("myParamTypeFqn2"), + docs: new Docs { { "foo", "bar" } } ) } ); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/NamespaceSetTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/NamespaceSetTests.cs index 98387c40f9..7c972e5fde 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/NamespaceSetTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/NamespaceSetTests.cs @@ -119,8 +119,8 @@ public void CreatesUsingStatementForMapReference() { NamespaceSet namespaces = new NamespaceSet(Symbols, SF.ParseName("MyCurrentNamespace")); namespaces.Add(new TypeReference(collection: new CollectionTypeReference( - CollectionKind.Map, - new TypeReference(primitive: PrimitiveType.String) + kind: CollectionKind.Map, + elementType: new TypeReference(primitive: PrimitiveType.String) ))); SyntaxList usings = namespaces.GetUsings(); @@ -139,10 +139,10 @@ public void RecursivelyCreatesUsingStatementForMapElementReference() namespaces.Add(new TypeReference(collection: new CollectionTypeReference( CollectionKind.Map, new TypeReference(collection: new CollectionTypeReference( - CollectionKind.Map, - new TypeReference(primitive: PrimitiveType.Json) - )) - ))); + kind: CollectionKind.Map, + elementType: new TypeReference(primitive: PrimitiveType.Json) + ) + )))); SyntaxList usings = namespaces.GetUsings(); AssertUsings @@ -159,8 +159,8 @@ public void DoesNotCreateUsingStatementForArrayReference() { NamespaceSet namespaces = new NamespaceSet(Symbols, SF.ParseName("MyCurrentNamespace")); namespaces.Add(new TypeReference(collection: new CollectionTypeReference( - CollectionKind.Array, - new TypeReference(primitive: PrimitiveType.String) + kind: CollectionKind.Array, + elementType: new TypeReference(primitive: PrimitiveType.String) ))); SyntaxList usings = namespaces.GetUsings(); @@ -176,12 +176,12 @@ public void RecursivelyCreatesUsingStatementForArrayElementReference() { NamespaceSet namespaces = new NamespaceSet(Symbols, SF.ParseName("MyCurrentNamespace")); namespaces.Add(new TypeReference(collection: new CollectionTypeReference( - CollectionKind.Array, - new TypeReference(collection: new CollectionTypeReference( - CollectionKind.Array, - new TypeReference(primitive: PrimitiveType.Json) - )) - ))); + kind: CollectionKind.Array, + elementType: new TypeReference(collection: new CollectionTypeReference( + kind: CollectionKind.Array, + elementType: new TypeReference(primitive: PrimitiveType.Json) + ) + )))); SyntaxList usings = namespaces.GetUsings(); AssertUsings @@ -196,15 +196,15 @@ public void RecursivelyCreatesUsingStatementForArrayElementReference() public void RecursivelyCreatesUsingStatementForEachTypeInUnionReference() { NamespaceSet namespaces = new NamespaceSet(Symbols, SF.ParseName("MyCurrentNamespace")); - namespaces.Add(new TypeReference(union: new UnionTypeReference(new TypeReference[] { + namespaces.Add(new TypeReference(union: new UnionTypeReference(new[] { new TypeReference(collection: new CollectionTypeReference( - CollectionKind.Array, - new TypeReference(collection: new CollectionTypeReference( - CollectionKind.Array, - new TypeReference(primitive: PrimitiveType.Json) - )) - )), - new TypeReference(primitive: PrimitiveType.Date), + kind: CollectionKind.Array, + elementType: new TypeReference(collection: new CollectionTypeReference( + kind: CollectionKind.Array, + elementType: new TypeReference(primitive: PrimitiveType.Json) + ) + ))), + new TypeReference(primitive: PrimitiveType.Date) }))); SyntaxList usings = namespaces.GetUsings(); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapExtensions.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapExtensions.cs index ed6093e7fa..86623ba9a7 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapExtensions.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapExtensions.cs @@ -63,40 +63,38 @@ public static void MapParameterName(this ISymbolMap symbols, string jsiiName, s public static void MapTypeName(this ISymbolMap symbols, string fullyQualifiedName, string frameworkName, TypeKind kind) { - if (kind == TypeKind.Interface) + var proxyName = $"{frameworkName}Proxy"; + switch (kind) { - string proxyName = $"{frameworkName}Proxy"; - string defaultName = frameworkName; - - symbols - .GetInterfaceProxyName(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any()) - .Returns(proxyName); - symbols - .GetInterfaceDefaultName(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any()) - .Returns(defaultName); - symbols - .GetInterfaceProxyNameSyntaxToken(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any()) - .Returns(SF.ParseToken(proxyName)); - symbols - .GetInterfaceDefaultNameSyntaxToken(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any()) - .Returns(SF.ParseToken(defaultName)); - symbols - .GetInterfaceProxyNameSyntax(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any()) - .Returns(SF.ParseName(proxyName)); - symbols - .GetInterfaceDefaultNameSyntax(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any()) - .Returns(SF.ParseName(defaultName)); - - frameworkName = $"I{frameworkName}"; - } - - if (kind == TypeKind.Class) - { - string proxyName = $"{frameworkName}Proxy"; - + case TypeKind.Interface: + var defaultName = frameworkName; + + symbols + .GetInterfaceProxyName(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any()) + .Returns(proxyName); + symbols + .GetInterfaceDefaultName(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any()) + .Returns(defaultName); + symbols + .GetInterfaceProxyNameSyntaxToken(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any()) + .Returns(SF.ParseToken(proxyName)); + symbols + .GetInterfaceDefaultNameSyntaxToken(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any()) + .Returns(SF.ParseToken(defaultName)); + symbols + .GetInterfaceProxyNameSyntax(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any()) + .Returns(SF.ParseName(proxyName)); + symbols + .GetInterfaceDefaultNameSyntax(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any()) + .Returns(SF.ParseName(defaultName)); + + frameworkName = $"I{frameworkName}"; + break; + case TypeKind.Class: symbols .GetAbstractClassProxyName(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any()) .Returns(proxyName); + break; } symbols @@ -118,7 +116,7 @@ public static void MapTypeName(this ISymbolMap symbols, string fullyQualifiedNam .GetNameSyntax(Arg.Is(fqn => fqn == fullyQualifiedName), disambiguate: Arg.Any()) .Returns(SF.ParseName(frameworkName)); symbols - .GetTypeSyntax(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName)) + .GetTypeSyntax(Arg.Is(t => t.FullyQualifiedName == fullyQualifiedName), false) .Returns(SF.ParseTypeName(frameworkName)); } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapTests.cs index 7f3fa275d5..ca5e2e9315 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapTests.cs @@ -110,7 +110,13 @@ public void RenamesTypeOnMemberConflict() isAbstract: false, properties: new[] { - new Property("myType", new TypeReference("myFqn"), false, false, false) + new Property( + name: "myType", + type: new TypeReference("myFqn"), + isImmutable: false, + isProtected: false, + isStatic: false + ) } ); @@ -414,7 +420,6 @@ public void GetsFrameworkNameFromMethod() { Method method = new Method ( - isInitializer: false, isProtected: false, isAbstract: false, name: "myMethod" @@ -481,10 +486,9 @@ public void GetsFrameworkNameFromEnumMember() [Fact(DisplayName = Prefix + nameof(GetsFrameworkNameFromParameter))] public void GetsFrameworkNameFromParameter() { - Parameter parameter = new Parameter("myParam", new TypeReference("myFqn")); + Parameter parameter = new Parameter(name: "myParam", type: new TypeReference("myFqn")); Method method = new Method ( - isInitializer: false, isProtected: false, isAbstract: false, parameters: new[] { parameter }, @@ -778,7 +782,6 @@ public void GetsFrameworkNameFromMethod() { Method method = new Method ( - isInitializer: false, isProtected: false, isAbstract: false, name: "myMethod" @@ -845,10 +848,9 @@ public void GetsFrameworkNameFromEnumMember() [Fact(DisplayName = Prefix + nameof(GetsFrameworkNameFromParameter))] public void GetsFrameworkNameFromParameter() { - Parameter parameter = new Parameter("myParam", new TypeReference("myFqn")); + Parameter parameter = new Parameter(name: "myParam", type: new TypeReference("myFqn")); Method method = new Method ( - isInitializer: false, isProtected: false, isAbstract: false, parameters: new[] { parameter }, @@ -1142,7 +1144,6 @@ public void GetsFrameworkNameFromMethod() { Method method = new Method ( - isInitializer: false, isProtected: false, isAbstract: false, name: "myMethod" @@ -1209,10 +1210,9 @@ public void GetsFrameworkNameFromEnumMember() [Fact(DisplayName = Prefix + nameof(GetsFrameworkNameFromParameter))] public void GetsFrameworkNameFromParameter() { - Parameter parameter = new Parameter("myParam", new TypeReference("myFqn")); + Parameter parameter = new Parameter(name: "myParam", type: new TypeReference("myFqn")); Method method = new Method ( - isInitializer: false, isProtected: false, isAbstract: false, parameters: new[] { parameter }, @@ -1489,9 +1489,9 @@ public void GetsPrimitiveFrameworkType(PrimitiveType type, bool isOptional, stri { ISymbolMap symbolMap = new SymbolMap(); - TypeReference reference = new TypeReference(primitive: type, isOptional: isOptional); + var reference = new TypeReference(primitive: type); - string actual = symbolMap.GetTypeSyntax(reference).ToString(); + var actual = symbolMap.GetTypeSyntax(reference, isOptional).ToString(); Assert.Equal(expected, actual, ignoreLineEndingDifferences: true); } @@ -1504,17 +1504,18 @@ public void GetsRecursiveCollectionFrameworkType(CollectionKind kind, bool isOpt { ISymbolMap symbolMap = new SymbolMap(); - TypeReference reference = new TypeReference - ( - collection: new CollectionTypeReference + var reference = new TypeReference ( - kind: kind, - elementType: new TypeReference(collection: new CollectionTypeReference(kind, new TypeReference(primitive: PrimitiveType.Number))) - ), - isOptional: isOptional - ); + collection: new CollectionTypeReference + ( + kind: kind, + elementType: new TypeReference( + collection: new CollectionTypeReference(kind, new TypeReference(primitive: PrimitiveType.Number)) + ) + ) + ); - string actual = symbolMap.GetTypeSyntax(reference).ToString(); + string actual = symbolMap.GetTypeSyntax(reference, isOptional).ToString(); Assert.Equal(expected, actual, ignoreLineEndingDifferences: true); } @@ -1525,15 +1526,14 @@ public void GetsUnionFrameworkType(bool isOptional, string expected) { ISymbolMap symbolMap = new SymbolMap(); - TypeReference reference = new TypeReference - ( - union: new UnionTypeReference(new[] { - new TypeReference(primitive: PrimitiveType.Number) - }), - isOptional: isOptional - ); + var reference = new TypeReference + ( + union: new UnionTypeReference(new[] { + new TypeReference(primitive: PrimitiveType.Number) + }) + ); - string actual = symbolMap.GetTypeSyntax(reference).ToString(); + string actual = symbolMap.GetTypeSyntax(reference, isOptional).ToString(); Assert.Equal(expected, actual, ignoreLineEndingDifferences: true); } @@ -1551,7 +1551,7 @@ public void GetsObjectFrameworkType() ISymbolMap symbolMap = GetSymbolMap(type); TypeReference reference = new TypeReference("myFqn"); - string actual = symbolMap.GetTypeSyntax(reference).ToString(); + string actual = symbolMap.GetTypeSyntax(reference, false).ToString(); Assert.Equal("MyName", actual, ignoreLineEndingDifferences: true); } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/TypeExtensionsTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/TypeExtensionsTests.cs index 4997c00210..8f19a32c7a 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/TypeExtensionsTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/TypeExtensionsTests.cs @@ -39,7 +39,7 @@ ClassType CreateType(bool includeParent, bool includeGrandparent) assembly: "myPackage", name: "myParentType", isAbstract: false, - @base: includeGrandparent ? new TypeReference("myGrandParentTypeFqn") : null + @base: includeGrandparent ? "myGrandParentTypeFqn" : null ); Symbols.MapFullyQualifiedNameToType("myParentTypeFqn", parentType); } @@ -50,7 +50,7 @@ ClassType CreateType(bool includeParent, bool includeGrandparent) assembly: "myPackage", name: "myClass", isAbstract: false, - @base: includeParent ? new TypeReference("myParentTypeFqn") : null + @base: includeParent ? "myParentTypeFqn" : null ); Symbols.MapFullyQualifiedNameToType("myClassFqn", classType); @@ -119,7 +119,7 @@ public void DoesNotAttemptToMatchInterfaces() assembly: "myPackage", name: "myClass", isAbstract: false, - interfaces: new[] { new TypeReference("myInterfaceFqn") } + interfaces: new[] { "myInterfaceFqn" } ); Symbols.MapFullyQualifiedNameToType("myClassFqn", classType); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/TypeMetadataTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/TypeMetadataTests.cs index 4c9437302b..895ef7aff5 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/TypeMetadataTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/TypeMetadataTests.cs @@ -142,11 +142,10 @@ public void DisambiguatesMethodConflicts() isAbstract: false, methods: new[] { new Method( - isInitializer: false, isProtected: false, isAbstract: false, name: "myName", - returns: new TypeReference(primitive: PrimitiveType.String) + returns: new OptionalValue(type: new TypeReference(primitive: PrimitiveType.String)) ) } ); @@ -445,11 +444,10 @@ public void DisambiguatesMethodConflicts() @namespace: "myNamespace", methods: new[] { new Method( - isInitializer: false, isProtected: false, isAbstract: false, name: "iMyName", - returns: new TypeReference(primitive: PrimitiveType.String) + returns: new OptionalValue(type: new TypeReference(primitive: PrimitiveType.String)) ) } ); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Amazon.JSII.Generator.csproj b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Amazon.JSII.Generator.csproj index 2bddf718c7..12dc48d768 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Amazon.JSII.Generator.csproj +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Amazon.JSII.Generator.csproj @@ -1,4 +1,4 @@ - + diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs index 49cf83af1f..ab780a6ca6 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs @@ -74,7 +74,7 @@ public static IEnumerable GetMsBuildProperties(this Assembly assembly) yield return new XElement("Title", assembly.Targets.DotNet.Title); } - if (assembly.Targets.DotNet.SignAssembly != null) + if (assembly.Targets.DotNet.SignAssembly) { yield return new XElement("SignAssembly", new XAttribute("Condition", @"Exists('$(AssemblyOriginatorKeyFile)')"), diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyGenerator.cs index 6e087b8d45..1038ea7d58 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyGenerator.cs @@ -309,7 +309,7 @@ void SaveType(Type type) SaveTypeFile($"{symbols.GetInterfaceProxyName(interfaceType)}.cs", new InterfaceProxyGenerator(assembly.Name, interfaceType, symbols).CreateSyntaxTree()); - if (interfaceType.IsDataType == true) + if (interfaceType.IsDataType) { SaveTypeFile($"{symbols.GetInterfaceDefaultName(interfaceType)}.cs", new InterfaceDefaultGenerator(assembly.Name, interfaceType, symbols) diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/MethodExtensions.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/CallableExtensions.cs similarity index 64% rename from packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/MethodExtensions.cs rename to packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/CallableExtensions.cs index db411d9bc0..7c5d013dca 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/MethodExtensions.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/CallableExtensions.cs @@ -3,17 +3,18 @@ using System.Linq; using Amazon.JSII.JsonModel.Spec; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Newtonsoft.Json; using SF = Microsoft.CodeAnalysis.CSharp.SyntaxFactory; namespace Amazon.JSII.Generator { - public static class MethodExtensions + public static class CallableExtensions { - public static ParameterListSyntax GetParameterListSyntax(this Method method, INamespaceSet namespaces, ISymbolMap symbols) + public static ParameterListSyntax GetParameterListSyntax(this Callable callable, INamespaceSet namespaces, ISymbolMap symbols) { - method = method ?? throw new ArgumentNullException(nameof(method)); + callable = callable ?? throw new ArgumentNullException(nameof(callable)); namespaces = namespaces ?? throw new ArgumentNullException(nameof(namespaces)); symbols = symbols ?? throw new ArgumentNullException(nameof(symbols)); @@ -21,19 +22,19 @@ public static ParameterListSyntax GetParameterListSyntax(this Method method, INa IEnumerable GetParameters() { - if (method.Parameters == null) + if (callable.Parameters == null) { yield break; } - foreach (Parameter parameter in method.Parameters) + foreach (Parameter parameter in callable.Parameters) { namespaces.Add(parameter.Type); yield return SF.Parameter( SF.List(), SF.TokenList(), - symbols.GetTypeSyntax(parameter.Type), + symbols.GetTypeSyntax(parameter.Type, parameter.IsOptional), symbols.GetNameSyntaxToken(parameter), null ); @@ -41,14 +42,19 @@ IEnumerable GetParameters() } } - public static SyntaxToken GetParametersJsonSyntaxToken(this Method method) + private static readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + DefaultValueHandling = DefaultValueHandling.Ignore + }; + + public static SyntaxToken GetParametersJsonSyntaxToken(this Callable callable) { // Strip docs before serializing. - Parameter[] parameters = (method?.Parameters ?? Enumerable.Empty()) + Parameter[] parameters = (callable?.Parameters ?? Enumerable.Empty()) .Select(p => new Parameter(p.Name, p.Type)) .ToArray(); - return SF.Literal(JsonConvert.SerializeObject(parameters)); + return SF.Literal(JsonConvert.SerializeObject(parameters, SerializerSettings)); } } } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/AbstractClassProxyGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/AbstractClassProxyGenerator.cs index 3e12ed352f..9215d6bce9 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/AbstractClassProxyGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/AbstractClassProxyGenerator.cs @@ -57,7 +57,7 @@ IEnumerable GetAllMethodsRecurse(Type currentType, IEnumerable m if (interfaceType.Interfaces != null) { var superinterfaceMethods = interfaceType.Interfaces.Select(r => - Symbols.GetTypeFromFullyQualifiedName(r.FullyQualifiedName) as + Symbols.GetTypeFromFullyQualifiedName(r) as InterfaceType) .SelectMany(i => GetAllMethodsRecurse(i, methods)) .ToList(); @@ -74,7 +74,7 @@ IEnumerable GetAllMethodsRecurse(Type currentType, IEnumerable m { // Run through all the interfaces. var superinterfaceMethods = classType.Interfaces.Select(r => - Symbols.GetTypeFromFullyQualifiedName(r.FullyQualifiedName) as + Symbols.GetTypeFromFullyQualifiedName(r) as InterfaceType) .SelectMany(i => GetAllMethodsRecurse(i, methods)) .ToList(); @@ -86,7 +86,7 @@ IEnumerable GetAllMethodsRecurse(Type currentType, IEnumerable m if (classType.Base != null) { methods = methods.Concat(GetAllMethodsRecurse( - Symbols.GetTypeFromFullyQualifiedName(classType.Base.FullyQualifiedName) as ClassType, + Symbols.GetTypeFromFullyQualifiedName(classType.Base) as ClassType, methods)); } } @@ -105,7 +105,7 @@ is unimplemented. string.Join("", m.Parameters?.Select(p => p.Name + p.Type.FullyQualifiedName) ?? Enumerable.Empty()))) .Select(g => g.First()) - .Where(m => m.IsAbstract ?? false); + .Where(m => m.IsAbstract); } private IEnumerable GetAllProperties(Type type) @@ -121,7 +121,7 @@ IEnumerable GetAllPropertiesRecurse(Type currentType, IEnumerable - Symbols.GetTypeFromFullyQualifiedName(r.FullyQualifiedName) as + Symbols.GetTypeFromFullyQualifiedName(r) as InterfaceType) .SelectMany(i => GetAllPropertiesRecurse(i, properties)) .ToList(); @@ -139,7 +139,7 @@ IEnumerable GetAllPropertiesRecurse(Type currentType, IEnumerable - Symbols.GetTypeFromFullyQualifiedName(r.FullyQualifiedName) as + Symbols.GetTypeFromFullyQualifiedName(r) as InterfaceType) .SelectMany(i => GetAllPropertiesRecurse(i, properties)) .ToList(); @@ -151,7 +151,7 @@ IEnumerable GetAllPropertiesRecurse(Type currentType, IEnumerable()) .GroupBy(p => p.Name) .Select(g => g.First()) - .Where(p => p.IsAbstract ?? false); + .Where(p => p.IsAbstract); } } } \ No newline at end of file diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/AbstractClassProxyPropertyGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/AbstractClassProxyPropertyGenerator.cs index d3c8e97f0d..14bce9a677 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/AbstractClassProxyPropertyGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/AbstractClassProxyPropertyGenerator.cs @@ -14,7 +14,7 @@ public AbstractClassProxyPropertyGenerator(ClassType type, Property property, IS protected override IEnumerable GetModifierKeywords() { - yield return Property.IsProtected == true ? SyntaxKind.ProtectedKeyword : SyntaxKind.PublicKeyword; + yield return Property.IsProtected ? SyntaxKind.ProtectedKeyword : SyntaxKind.PublicKeyword; // Type is the abstract class, so we need to check it as well as ancestors. if (IsDefinedOnAncestor || Type.Properties.Any(p => p.Name == Property.Name)) diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/ClassGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/ClassGenerator.cs index 266bb71aa1..2385bab2fd 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/ClassGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/ClassGenerator.cs @@ -32,13 +32,19 @@ SyntaxList CreateAttributes() { TypeOfExpressionSyntax typeOfExpression = SF.TypeOfExpression(Symbols.GetNameSyntax(Type)); SyntaxToken fullyQualifiedNameLiteral = SF.Literal(Type.FullyQualifiedName); - SyntaxToken parametersJsonLiteral = Type.Initializer.GetParametersJsonSyntaxToken(); + var argumentList = $"nativeType: {typeOfExpression}, fullyQualifiedName: {fullyQualifiedNameLiteral}"; + if ((Type.Initializer?.Parameters?.Length ?? 0) > 0) + { + SyntaxToken parametersJsonLiteral = Type.Initializer.GetParametersJsonSyntaxToken(); + argumentList += $", parametersJson: {parametersJsonLiteral}"; + } + return SF.List(new[] { SF.AttributeList(SF.SeparatedList(new[] { SF.Attribute( SF.ParseName("JsiiClass"), - SF.ParseAttributeArgumentList($"({typeOfExpression}, {fullyQualifiedNameLiteral}, {parametersJsonLiteral})") + SF.ParseAttributeArgumentList($"({argumentList})") ) })) }); @@ -68,8 +74,8 @@ IEnumerable GetBaseTypes() } else { - Namespaces.Add(Type.Base); - yield return SF.SimpleBaseType(Symbols.GetNameSyntax(Type.Base.FullyQualifiedName, disambiguate: true)); + Namespaces.Add(Symbols.GetTypeFromFullyQualifiedName(Type.Base)); + yield return SF.SimpleBaseType(Symbols.GetNameSyntax(Type.Base, disambiguate: true)); } if (Type.Interfaces == null) @@ -77,10 +83,10 @@ IEnumerable GetBaseTypes() yield break; } - foreach (TypeReference interfaceReference in Type.Interfaces) + foreach (var interfaceReference in Type.Interfaces) { - Namespaces.Add(interfaceReference); - yield return SF.SimpleBaseType(Symbols.GetNameSyntax(interfaceReference.FullyQualifiedName, disambiguate: true)); + Namespaces.Add(Symbols.GetTypeFromFullyQualifiedName(interfaceReference)); + yield return SF.SimpleBaseType(Symbols.GetNameSyntax(interfaceReference, disambiguate: true)); } } } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/ClassMethodGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/ClassMethodGenerator.cs index 8e8e80edf0..6d58e6a339 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/ClassMethodGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/ClassMethodGenerator.cs @@ -30,7 +30,7 @@ protected bool IsDefinedOnAncestor return true; } - return Type.AnyAncestor(Symbols, t => t.Methods?.Any(m => m.Name == Method.Name) == true); + return Type.AnyAncestor(Symbols, t => t.Methods?.Any(m => m.Name == Method.Name) ?? false); } } @@ -38,13 +38,13 @@ protected override IEnumerable GetModifierKeywords() { yield return Method.IsProtected ? SyntaxKind.ProtectedKeyword : SyntaxKind.PublicKeyword; - if (Method.IsStatic == true) + if (Method.IsStatic) { yield return SyntaxKind.StaticKeyword; yield break; } - if (Method.IsAbstract == true) + if (Method.IsAbstract) { if (IsDefinedOnAncestor) { @@ -62,7 +62,7 @@ protected override IEnumerable GetModifierKeywords() protected override BlockSyntax GetBody() { - if (Method.IsAbstract == true) + if (Method.IsAbstract) { return null; } @@ -75,6 +75,6 @@ protected override BlockSyntax GetBody() return SF.Block(SF.ReturnStatement(CreateInvocationExpression())); } - protected override bool HasSemicolon => Method.IsAbstract == true; + protected override bool HasSemicolon => Method.IsAbstract; } } \ No newline at end of file diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/ClassPropertyGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/ClassPropertyGenerator.cs index 76bb7e79bc..e19c7eee78 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/ClassPropertyGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Class/ClassPropertyGenerator.cs @@ -15,11 +15,11 @@ public ClassPropertyGenerator(ClassType type, Property property, ISymbolMap symb { } - protected bool IsDefinedOnAncestor => Type.AnyAncestor(Symbols, t => t.Properties?.Any(p => p.Name == Property.Name) == true); + protected bool IsDefinedOnAncestor => Type.AnyAncestor(Symbols, t => t.Properties?.Any(p => p.Name == Property.Name) ?? false); protected override IEnumerable GetModifierKeywords() { - yield return Property.IsProtected == true ? SyntaxKind.ProtectedKeyword : SyntaxKind.PublicKeyword; + yield return Property.IsProtected ? SyntaxKind.ProtectedKeyword : SyntaxKind.PublicKeyword; if (Property.IsStatic()) { @@ -37,7 +37,7 @@ protected override SyntaxToken GetIdentifier() protected override IEnumerable GetAccessors() { - if (Property.IsConstant == true) + if (Property.IsConstant) { yield return SF.AccessorDeclaration( SyntaxKind.GetAccessorDeclaration, diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DocComment/DocCommentGeneratorBase.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DocComment/DocCommentGeneratorBase.cs index 918fde6903..8bbd506b14 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DocComment/DocCommentGeneratorBase.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DocComment/DocCommentGeneratorBase.cs @@ -39,7 +39,7 @@ public SyntaxTrivia CreateDocComment() protected IEnumerable GetSummaryNodes() { - if (Documentable.Docs?.ContainsKey("summary") == true) + if (Documentable.Docs?.ContainsKey("summary") ?? false) { yield return SF.XmlText(" ").WithLeadingTrivia(SF.DocumentationCommentExterior(" ")); yield return SF.XmlSummaryElement(GetXmlNodes(Documentable.Docs["summary"]).ToArray()); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Enum/EnumGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Enum/EnumGenerator.cs index a74e618797..0b1dc457f0 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Enum/EnumGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Enum/EnumGenerator.cs @@ -36,7 +36,7 @@ SyntaxList CreateAttributes() SF.AttributeList(SF.SeparatedList(new[] { SF.Attribute( SF.ParseName("JsiiEnum"), - SF.ParseAttributeArgumentList($"({typeOfExpression}, {fullyQualifiedNameLiteral})") + SF.ParseAttributeArgumentList($"(nativeType: {typeOfExpression}, fullyQualifiedName: {fullyQualifiedNameLiteral})") ) })) }); @@ -54,7 +54,7 @@ EnumMemberDeclarationSyntax GetMemberDeclaration(EnumMember member) SF.AttributeList(SF.SeparatedList(new[] { SF.Attribute( SF.ParseName("JsiiEnumMember"), - SF.ParseAttributeArgumentList($"(\"{member.Name}\")") + SF.ParseAttributeArgumentList($"(name: \"{member.Name}\")") ) })) }), diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/ISymbolMap.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/ISymbolMap.cs index 030170385a..b5726cd11a 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/ISymbolMap.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/ISymbolMap.cs @@ -90,7 +90,7 @@ public interface ISymbolMap NameSyntax GetPackageSyntax(string fullyQualifiedName); - TypeSyntax GetTypeSyntax(TypeReference typeReference); + TypeSyntax GetTypeSyntax(TypeReference typeReference, bool isOptional); Type GetTypeFromFullyQualifiedName(string fullyQualifiedName); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceDefaultPropertyGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceDefaultPropertyGenerator.cs index b21c78faa1..3015012fbb 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceDefaultPropertyGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceDefaultPropertyGenerator.cs @@ -13,12 +13,12 @@ public class InterfaceDefaultPropertyGenerator : PropertyGeneratorBase GetModifierKeywords() { - yield return Property.IsProtected == true ? SyntaxKind.ProtectedKeyword : SyntaxKind.PublicKeyword; + yield return Property.IsProtected? SyntaxKind.ProtectedKeyword : SyntaxKind.PublicKeyword; } protected override SyntaxToken GetIdentifier() diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceGenerator.cs index 2736b27f98..1cd3fecb29 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceGenerator.cs @@ -38,7 +38,7 @@ SyntaxList CreateAttributes() SF.AttributeList(SF.SeparatedList(new[] { SF.Attribute( SF.ParseName("JsiiInterface"), - SF.ParseAttributeArgumentList($"({typeOfExpression}, {fullyQualifiedNameLiteral})") + SF.ParseAttributeArgumentList($"(nativeType: {typeOfExpression}, fullyQualifiedName: {fullyQualifiedNameLiteral})") ) })) }); @@ -48,14 +48,14 @@ BaseListSyntax CreateBaseList() { IEnumerable baseTypes = GetBaseTypes(); - return baseTypes?.Any() == true ? SF.BaseList(SF.SeparatedList(baseTypes)) : null; + return baseTypes?.Any() ?? false ? SF.BaseList(SF.SeparatedList(baseTypes)) : null; IEnumerable GetBaseTypes() { - foreach (TypeReference interfaceReference in Type.Interfaces ?? Enumerable.Empty()) + foreach (string interfaceReference in Type.Interfaces ?? Enumerable.Empty()) { - Namespaces.Add(interfaceReference); - yield return SF.SimpleBaseType(Symbols.GetTypeSyntax(interfaceReference)); + Namespaces.Add(Symbols.GetTypeFromFullyQualifiedName(interfaceReference)); + yield return SF.SimpleBaseType(Symbols.GetNameSyntax(interfaceReference, disambiguate: true)); } } } @@ -75,7 +75,7 @@ IEnumerable CreateMethods() foreach (Method method in Type.Methods) { - if (method.Returns?.IsPromise == true) + if (method.IsAsync) { throw new NotImplementedException(); } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceMethodGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceMethodGenerator.cs index 626fc8e1aa..06e469e427 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceMethodGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceMethodGenerator.cs @@ -11,7 +11,7 @@ public class InterfaceMethodGenerator : MethodGeneratorBase public InterfaceMethodGenerator(InterfaceType type, Method method, ISymbolMap symbols, INamespaceSet namespaces) : base(type, method, symbols, namespaces) { - if (method.IsAbstract != true) + if (!method.IsAbstract) { throw new ArgumentException("Interface methods must be abstract", nameof(method)); } @@ -21,7 +21,7 @@ public InterfaceMethodGenerator(InterfaceType type, Method method, ISymbolMap sy throw new ArgumentException("Protected methods are not allowed on interfaces", nameof(method)); } - if (method.IsStatic == true) + if (method.IsStatic) { throw new ArgumentException( $"Method {type.Name}.{method.Name} is marked as static, but interfaces must not contain static members.", diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfacePropertyGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfacePropertyGenerator.cs index c387aacbc4..cbe91ff7a3 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfacePropertyGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfacePropertyGenerator.cs @@ -14,12 +14,12 @@ public class InterfacePropertyGenerator : PropertyGeneratorBase public InterfacePropertyGenerator(InterfaceType type, Property property, ISymbolMap symbols, INamespaceSet namespaces) : base(type, property, symbols, namespaces) { - if (property.IsAbstract != true) + if (!property.IsAbstract) { throw new ArgumentException("Interface properties must be abstract", nameof(property)); } - if (property.IsProtected == true) + if (property.IsProtected) { throw new ArgumentException("Protected properties are not allowed on interfaces", nameof(property)); } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceProxyMethodGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceProxyMethodGenerator.cs index 68c63f1768..db1368fb23 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceProxyMethodGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceProxyMethodGenerator.cs @@ -12,7 +12,7 @@ public class InterfaceProxyMethodGenerator : MethodGeneratorBase public InterfaceProxyMethodGenerator(InterfaceType type, Method method, ISymbolMap symbols, INamespaceSet namespaces) : base(type, method, symbols, namespaces) { - if (method.IsAbstract != true) + if (!method.IsAbstract) { throw new ArgumentException("Interface methods must be abstract", nameof(method)); } @@ -22,7 +22,7 @@ public InterfaceProxyMethodGenerator(InterfaceType type, Method method, ISymbolM throw new ArgumentException("Protected methods are not allowed on interfaces", nameof(method)); } - if (method.IsStatic == true) + if (method.IsStatic) { throw new ArgumentException( $"Method {type.Name}.{method.Name} is marked as static, but interfaces must not contain static members.", diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceProxyPropertyGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceProxyPropertyGenerator.cs index bde2cdb839..5af04d2e94 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceProxyPropertyGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/Interface/InterfaceProxyPropertyGenerator.cs @@ -13,12 +13,12 @@ public class InterfaceProxyPropertyGenerator : PropertyGeneratorBase GetAllCore(this InterfaceType @interface, ISymbolMap sy if (@interface.Interfaces != null) { var baseMembers = @interface.Interfaces - .Select(r => symbols.GetTypeFromFullyQualifiedName(r.FullyQualifiedName) as InterfaceType) + .Select(r => symbols.GetTypeFromFullyQualifiedName(r) as InterfaceType) .SelectMany(i => GetAllCore(i, symbols, selector)); foreach (T member in baseMembers) diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/MethodGeneratorBase.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/MethodGeneratorBase.cs index 66d9cb1e38..11542d27a4 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/MethodGeneratorBase.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/MethodGeneratorBase.cs @@ -62,8 +62,6 @@ public MethodDeclarationSyntax CreateMethod() protected abstract bool HasSemicolon { get; } - protected virtual bool IsOverride => false; - protected SyntaxToken GetIdentifier() { return Symbols.GetNameSyntaxToken(Type, Method); @@ -107,7 +105,7 @@ TypeArgumentListSyntax CreateTypeArgumentList() string GetInvokeMethodName() { StringBuilder builder = new StringBuilder("Invoke"); - builder.Append(Method.IsStatic == true ? "Static" : "Instance"); + builder.Append(Method.IsStatic ? "Static" : "Instance"); if (Method.Returns == null) { builder.Append("Void"); @@ -126,7 +124,7 @@ ArgumentListSyntax GetArgumentListSyntax() IEnumerable GetArgumentExpressions() { - if (Method.IsStatic == true) + if (Method.IsStatic) { yield return SF.TypeOfExpression(Symbols.GetNameSyntax(Type)); } @@ -161,6 +159,11 @@ IEnumerable GetArguments() } } } + + private static readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + DefaultValueHandling = DefaultValueHandling.Ignore + }; SyntaxList GetAttributeLists() { @@ -169,19 +172,34 @@ SyntaxList GetAttributeLists() IEnumerable GetAttributes() { SyntaxToken nameLiteral = SF.Literal(Method.Name); - SyntaxToken returnsJsonLiteral = Method.Returns == null ? - SF.Token(SyntaxKind.NullKeyword) : - SF.Literal(JsonConvert.SerializeObject(Method.Returns)); - SyntaxToken parametersJsonLiteral = Method.GetParametersJsonSyntaxToken(); SyntaxToken trueLiteral = SF.Token(SyntaxKind.TrueKeyword); - string argumentList = IsOverride ? - $"({nameLiteral}, {returnsJsonLiteral}, {parametersJsonLiteral}, {trueLiteral})" : - $"({nameLiteral}, {returnsJsonLiteral}, {parametersJsonLiteral})"; + string argumentList = $"name: {nameLiteral}"; + if (Method.Returns != null) + { + SyntaxToken returnsJsonLiteral = Method.Returns == null ? + SF.Token(SyntaxKind.NullKeyword) : + SF.Literal(JsonConvert.SerializeObject(Method.Returns, SerializerSettings)); + argumentList += $", returnsJson: {returnsJsonLiteral}"; + } + + if (Method.Parameters != null && Method.Parameters.Length > 0) + { + SyntaxToken parametersJsonLiteral = Method.GetParametersJsonSyntaxToken(); + argumentList += $", parametersJson: {parametersJsonLiteral}"; + } + if (Method.IsAsync) + { + argumentList += $", isAsync: {trueLiteral}"; + } + if (Method.Overrides != null) + { + argumentList += $", isOverride: {trueLiteral}"; + } yield return SF.Attribute( SF.ParseName("JsiiMethod"), - SF.ParseAttributeArgumentList(argumentList) + SF.ParseAttributeArgumentList($"({argumentList})") ); } } @@ -203,8 +221,8 @@ TypeSyntax GetReturnType() return SF.ParseTypeName("void"); } - Namespaces.Add(Method.Returns); - return Symbols.GetTypeSyntax(Method.Returns); + Namespaces.Add(Method.Returns.Type); + return Symbols.GetTypeSyntax(Method.Returns.Type, Method.Returns.IsOptional); } TypeParameterListSyntax GetTypeParameterList() diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/NamespaceSet.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/NamespaceSet.cs index fe202f71ba..b1264dc860 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/NamespaceSet.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/NamespaceSet.cs @@ -77,7 +77,7 @@ public void Add(TypeReference typeReference) if (typeReference.Union != null) { - foreach (TypeReference partialTypeReference in typeReference.Union.Types) + foreach (var partialTypeReference in typeReference.Union.Types) { Add(partialTypeReference); } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/PropertyExtensions.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/PropertyExtensions.cs index e7bc685f63..c0981e019a 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/PropertyExtensions.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/PropertyExtensions.cs @@ -9,12 +9,12 @@ internal static class PropertyExtensions { public static bool IsStatic(this Property property) { - return property.IsStatic == true || property.IsConstant == true; + return property.IsStatic || property.IsConstant; } public static bool IsImmutable(this Property property) { - return property.IsImmutable == true || property.IsConstant == true; + return property.IsImmutable || property.IsConstant; } } } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/PropertyGeneratorBase.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/PropertyGeneratorBase.cs index 18bbefe19e..3ca2e33ab1 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/PropertyGeneratorBase.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/PropertyGeneratorBase.cs @@ -32,7 +32,7 @@ protected PropertyGeneratorBase(T type, Property property, ISymbolMap symbols, I public PropertyDeclarationSyntax CreateProperty() { - PropertyDeclarationSyntax declaration = Property.IsConstant == true ? + PropertyDeclarationSyntax declaration = Property.IsConstant ? SF.PropertyDeclaration ( GetAttributeLists(), @@ -150,6 +150,11 @@ SyntaxTokenList GetModifierList() return SF.TokenList(GetModifierKeywords().Select(k => SF.Token(k))); } + private static readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + DefaultValueHandling = DefaultValueHandling.Ignore + }; + SyntaxList GetAttributeLists() { return SF.List(new[] { SF.AttributeList(SF.SeparatedList(GetAttributes())) }); @@ -157,16 +162,22 @@ SyntaxList GetAttributeLists() IEnumerable GetAttributes() { SyntaxToken nameLiteral = SF.Literal(Property.Name); - SyntaxToken typeJsonLiteral = SF.Literal(JsonConvert.SerializeObject(Property.Type)); + SyntaxToken typeJsonLiteral = SF.Literal(JsonConvert.SerializeObject(Property.Type, SerializerSettings)); SyntaxToken trueLiteral = SF.Token(SyntaxKind.TrueKeyword); - string argumentList = IsOverride ? - $"({nameLiteral}, {typeJsonLiteral}, {trueLiteral})" : - $"({nameLiteral}, {typeJsonLiteral})"; + string argumentList = $"name: {nameLiteral}, typeJson: {typeJsonLiteral}"; + if (Property.IsOptional) + { + argumentList += $", isOptional: {trueLiteral}"; + } + if (IsOverride) + { + argumentList += $", isOverride: {trueLiteral}"; + } yield return SF.Attribute( SF.ParseName("JsiiProperty"), - SF.ParseAttributeArgumentList(argumentList) + SF.ParseAttributeArgumentList($"({argumentList})") ); } } @@ -174,7 +185,7 @@ IEnumerable GetAttributes() TypeSyntax GetReturnType() { Namespaces.Add(Property.Type); - return Symbols.GetTypeSyntax(Property.Type); + return Symbols.GetTypeSyntax(Property.Type, Property.IsOptional); } ExplicitInterfaceSpecifierSyntax GetExplicitInterfaceSpecifier() diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/SymbolMap.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/SymbolMap.cs index a174727ee2..6d2b5be98f 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/SymbolMap.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/SymbolMap.cs @@ -363,11 +363,11 @@ public NameSyntax GetPackageSyntax(string fullyQualifiedName) } #endregion - - public TypeSyntax GetTypeSyntax(TypeReference typeReference) + + public TypeSyntax GetTypeSyntax(TypeReference typeReference, bool isOptional) { - bool isOptional = (typeReference ?? throw new ArgumentNullException(nameof(typeReference))).IsOptional == true; - + typeReference = typeReference ?? throw new ArgumentNullException(nameof(typeReference)); + if (typeReference.Primitive != null) { switch (typeReference.Primitive.Value) @@ -375,13 +375,13 @@ public TypeSyntax GetTypeSyntax(TypeReference typeReference) case PrimitiveType.Any: return SF.ParseTypeName("object"); case PrimitiveType.Boolean: - return SF.ParseTypeName(isOptional ? "bool?" : "bool"); + return NullableIfOptional(SF.ParseTypeName("bool")); case PrimitiveType.Date: - return SF.ParseTypeName(isOptional ? "DateTime?" : "DateTime"); + return NullableIfOptional(SF.ParseTypeName("DateTime")); case PrimitiveType.Json: return SF.ParseTypeName("JObject"); case PrimitiveType.Number: - return SF.ParseTypeName(isOptional ? "double?" : "double"); + return NullableIfOptional(SF.ParseTypeName("double")); case PrimitiveType.String: return SF.ParseTypeName("string"); default: @@ -391,7 +391,7 @@ public TypeSyntax GetTypeSyntax(TypeReference typeReference) if (typeReference.Collection != null) { - TypeSyntax elementType = GetTypeSyntax(typeReference.Collection.ElementType); + TypeSyntax elementType = GetTypeSyntax(typeReference.Collection.ElementType, false); switch (typeReference.Collection.Kind) { @@ -414,12 +414,17 @@ public TypeSyntax GetTypeSyntax(TypeReference typeReference) if (typeReference.FullyQualifiedName != null) { - Type type = GetTypeFromFullyQualifiedName(typeReference.FullyQualifiedName); - - return SF.ParseTypeName(GetName(type, true)); + var type = GetTypeFromFullyQualifiedName(typeReference.FullyQualifiedName); + var typeSyntax = SF.ParseTypeName(GetName(type, true)); + return type.Kind == TypeKind.Enum ? NullableIfOptional(typeSyntax) : typeSyntax; } throw new ArgumentException("Invalid type reference", nameof(typeReference)); + + TypeSyntax NullableIfOptional(TypeSyntax type) + { + return isOptional ? SF.NullableType(type) : type; + } } public Type GetTypeFromFullyQualifiedName(string fullyQualifiedName) diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/TypeExtensions.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/TypeExtensions.cs index d30dd10ab9..0d16a3395e 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/TypeExtensions.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/TypeExtensions.cs @@ -7,11 +7,11 @@ public static class TypeExtensions { public static bool AnyAncestor(this ClassType classType, ISymbolMap symbols, Func predicate) { - TypeReference current = classType.Base; + var current = classType.Base; while (current != null) { - ClassType currentType = (ClassType)symbols.GetTypeFromFullyQualifiedName(current.FullyQualifiedName); + ClassType currentType = (ClassType)symbols.GetTypeFromFullyQualifiedName(current); if (predicate(currentType)) { diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/TypeProxyGeneratorBase.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/TypeProxyGeneratorBase.cs index 62a3a1b658..e184e1a369 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/TypeProxyGeneratorBase.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/TypeProxyGeneratorBase.cs @@ -41,7 +41,7 @@ SyntaxList CreateAttributes() { SF.Attribute( SF.ParseName("JsiiTypeProxy"), - SF.ParseAttributeArgumentList($"({typeOfExpression}, {fullyQualifiedNameLiteral})") + SF.ParseAttributeArgumentList($"(nativeType: {typeOfExpression}, fullyQualifiedName: {fullyQualifiedNameLiteral})") ) })) }); diff --git a/packages/jsii-dotnet-jsonmodel/package-lock.json b/packages/jsii-dotnet-jsonmodel/package-lock.json index 02a437edd5..12263048b7 100644 --- a/packages/jsii-dotnet-jsonmodel/package-lock.json +++ b/packages/jsii-dotnet-jsonmodel/package-lock.json @@ -1,6 +1,6 @@ { "name": "jsii-dotnet-jsonmodel", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -11,9 +11,9 @@ "dev": true }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", "dev": true } } diff --git a/packages/jsii-dotnet-jsonmodel/package.json b/packages/jsii-dotnet-jsonmodel/package.json index bbd8a7deb0..114ffc2285 100644 --- a/packages/jsii-dotnet-jsonmodel/package.json +++ b/packages/jsii-dotnet-jsonmodel/package.json @@ -14,7 +14,7 @@ "devDependencies": { "@types/node": "^8.10.43", "jsii-build-tools": "^0.9.0", - "typescript": "^3.3.3333" + "typescript": "^3.4.2" }, "author": { "name": "Amazon Web Services", diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Amazon.JSII.JsonModel.UnitTests.csproj b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Amazon.JSII.JsonModel.UnitTests.csproj index ae4a19acd3..8b9d8a6d4b 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Amazon.JSII.JsonModel.UnitTests.csproj +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Amazon.JSII.JsonModel.UnitTests.csproj @@ -1,4 +1,4 @@ - + netcoreapp2.0 diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs index ffca2bb7fd..5e365cdceb 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs @@ -11,7 +11,7 @@ public class AssemblyTests { const string RootPrefix = nameof(Spec) + "." + nameof(Assembly) + "."; - public class Serialization + public class Serialization : TestUtils { const string Prefix = RootPrefix + "Serialization."; @@ -54,9 +54,9 @@ public void ShouldSerializeAllMembers() readme: new Readme("myReadme") ); - string actual = JsonConvert.SerializeObject(assembly, Formatting.Indented); + string actual = ToJson(assembly); const string expected = @"{ - ""schema"": ""jsii/1.0"", + ""schema"": ""jsii/0.9.0"", ""name"": ""myName"", ""description"": ""My description"", ""homepage"": ""http://www.example.com/"", @@ -182,9 +182,9 @@ public void ShouldNotSerializeMissingDependencies() docs: new Docs() ); - string actual = JsonConvert.SerializeObject(assembly, Formatting.Indented); + string actual = ToJson(assembly); const string expected = @"{ - ""schema"": ""jsii/1.0"", + ""schema"": ""jsii/0.9.0"", ""name"": ""myName"", ""description"": """", ""homepage"": """", @@ -242,9 +242,9 @@ public void ShouldNotSerializeMissingBundled() docs: new Docs() ); - string actual = JsonConvert.SerializeObject(assembly, Formatting.Indented); + string actual = ToJson(assembly); const string expected = @"{ - ""schema"": ""jsii/1.0"", + ""schema"": ""jsii/0.9.0"", ""name"": ""myName"", ""description"": """", ""homepage"": """", @@ -302,9 +302,9 @@ public void ShouldNotSerializeMissingDocs() docs: null ); - string actual = JsonConvert.SerializeObject(assembly, Formatting.Indented); + string actual = ToJson(assembly); const string expected = @"{ - ""schema"": ""jsii/1.0"", + ""schema"": ""jsii/0.9.0"", ""name"": ""myName"", ""description"": """", ""homepage"": """", @@ -345,7 +345,7 @@ public class Deserialization public void ShouldDeserializeAllMembers() { const string json = @"{ - ""schema"": ""jsii/1.0"", + ""schema"": ""jsii/0.9.0"", ""name"": ""myName"", ""description"": """", ""homepage"": """", @@ -368,7 +368,7 @@ public void ShouldDeserializeAllMembers() Assembly actual = JsonConvert.DeserializeObject(json); - Assert.Equal("jsii/1.0", actual.Schema, ignoreLineEndingDifferences: true); + Assert.Equal("jsii/0.9.0", actual.Schema, ignoreLineEndingDifferences: true); Assert.Equal("myName", actual.Name, ignoreLineEndingDifferences: true); Assert.Null(actual.Targets); Assert.Equal("myVersion", actual.Version, ignoreLineEndingDifferences: true); @@ -382,7 +382,7 @@ public void ShouldDeserializeAllMembers() public void ShouldDeserializeAllMembersWithNoTypes() { const string json = @"{ - ""schema"": ""jsii/1.0"", + ""schema"": ""jsii/0.9.0"", ""name"": ""myName"", ""description"": """", ""homepage"": """", @@ -404,7 +404,7 @@ public void ShouldDeserializeAllMembersWithNoTypes() Assembly actual = JsonConvert.DeserializeObject(json); - Assert.Equal("jsii/1.0", actual.Schema, ignoreLineEndingDifferences: true); + Assert.Equal("jsii/0.9.0", actual.Schema, ignoreLineEndingDifferences: true); Assert.Equal("myName", actual.Name, ignoreLineEndingDifferences: true); Assert.Null(actual.Targets); Assert.Equal("myVersion", actual.Version, ignoreLineEndingDifferences: true); @@ -419,7 +419,7 @@ public void ShouldDeserializeAllMembersWithNoTypes() public void ShouldDeserializeAllMembersWithDotNetTarget() { const string json = @"{ - ""schema"": ""jsii/1.0"", + ""schema"": ""jsii/0.9.0"", ""name"": ""myName"", ""targets"": { ""dotnet"": { @@ -452,7 +452,7 @@ public void ShouldDeserializeAllMembersWithDotNetTarget() Assembly actual = JsonConvert.DeserializeObject(json); - Assert.Equal("jsii/1.0", actual.Schema, ignoreLineEndingDifferences: true); + Assert.Equal("jsii/0.9.0", actual.Schema, ignoreLineEndingDifferences: true); Assert.Equal("myName", actual.Name, ignoreLineEndingDifferences: true); AssemblyTargets.DotNetTarget dotNetTarget = actual.Targets.DotNet; @@ -474,7 +474,7 @@ public void ShouldDeserializeAllMembersWithDotNetTarget() public void ShouldThrowOnMissingName() { const string json = @"{ - ""schema"": ""jsii/1.0"", + ""schema"": ""jsii/0.9.0"", ""targets"": { ""dotnet"": { ""namespace"": ""AWS.Cdk.Test"", @@ -507,7 +507,7 @@ public void ShouldThrowOnMissingName() public void ShouldThrowOnMissingDotNetTarget() { const string json = @"{ - ""schema"": ""jsii/1.0"", + ""schema"": ""jsii/0.9.0"", ""name"": ""myName"", ""description"": """", ""homepage"": """", @@ -536,7 +536,7 @@ public void ShouldThrowOnMissingDotNetTarget() public void ShouldThrowOnMissingVersion() { const string json = @"{ - ""schema"": ""jsii/1.0"", + ""schema"": ""jsii/0.9.0"", ""name"": ""myName"", ""targets"": { ""dotnet"": { @@ -569,7 +569,7 @@ public void ShouldThrowOnMissingVersion() public void ShouldNotDeserializeMissingDependencies() { const string json = @"{ - ""schema"": ""jsii/1.0"", + ""schema"": ""jsii/0.9.0"", ""name"": ""myName"", ""targets"": { ""dotnet"": { @@ -603,7 +603,7 @@ public void ShouldNotDeserializeMissingDependencies() public void ShouldNotDeserializeMissingBundled() { const string json = @"{ - ""schema"": ""jsii/1.0"", + ""schema"": ""jsii/0.9.0"", ""name"": ""myName"", ""targets"": { ""dotnet"": { @@ -637,7 +637,7 @@ public void ShouldNotDeserializeMissingBundled() public void ShouldNotDeserializeMissingDocs() { const string json = @"{ - ""schema"": ""jsii/1.0"", + ""schema"": ""jsii/0.9.0"", ""name"": ""myName"", ""targets"": { ""dotnet"": { diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/ClassTypeTests.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/ClassTypeTests.cs index 8eb31921f6..84c75c4c55 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/ClassTypeTests.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/ClassTypeTests.cs @@ -1,6 +1,7 @@ using Amazon.JSII.JsonModel.Spec; using Newtonsoft.Json; using System; +using System.Linq; using Xunit; namespace Amazon.JSII.JsonModel.UnitTests.Spec @@ -9,7 +10,7 @@ public class ClassTypeTests { const string RootPrefix = nameof(Spec) + "." + nameof(ClassType) + "."; - public class Serialization + public class Serialization : TestUtils { const string Prefix = RootPrefix + "Serialization."; @@ -26,22 +27,16 @@ public void ShouldSerializeAllMembers() docs: new Docs(), properties: new Property[] { }, methods: new Method[] { }, - @base: new TypeReference("myBaseFqn"), - initializer: new Method(true, false, false), - interfaces: new TypeReference[] { } + @base: "myBaseFqn", + initializer: new Initializer(), + interfaces: new string[] { } ); - string actual = JsonConvert.SerializeObject(classType, Formatting.Indented); + string actual = ToJson(classType); const string expected = @"{ ""abstract"": true, - ""base"": { - ""fqn"": ""myBaseFqn"" - }, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""base"": ""myBaseFqn"", + ""initializer"": {}, ""properties"": [], ""methods"": [], ""interfaces"": [], @@ -69,9 +64,9 @@ public void ShouldThrowOnMissingFullyQualifiedName() docs: new Docs(), properties: new Property[] { }, methods: new Method[] { }, - @base: new TypeReference("myBaseFqn"), - initializer: new Method(true, false, false), - interfaces: new TypeReference[] { } + @base: "myBaseFqn", + initializer: new Initializer(), + interfaces: new string[] { } )); } @@ -88,9 +83,9 @@ public void ShouldThrowOnMissingAssembly() docs: new Docs(), properties: new Property[] { }, methods: new Method[] { }, - @base: new TypeReference("myBaseFqn"), - initializer: new Method(true, false, false), - interfaces: new TypeReference[] { } + @base: "myBaseFqn", + initializer: new Initializer(), + interfaces: new string[] { } )); } @@ -107,9 +102,9 @@ public void ShouldThrowOnMissingName() docs: new Docs(), properties: new Property[] { }, methods: new Method[] { }, - @base: new TypeReference("myBaseFqn"), - initializer: new Method(true, false, false), - interfaces: new TypeReference[] { } + @base: "myBaseFqn", + initializer: new Initializer(), + interfaces: new string[] { } )); } @@ -126,21 +121,15 @@ public void ShouldNotSerializeMissingNamespace() docs: new Docs(), properties: new Property[] { }, methods: new Method[] { }, - @base: new TypeReference("myBaseFqn"), - initializer: new Method(true, false, false), - interfaces: new TypeReference[] { } + @base: "myBaseFqn", + initializer: new Initializer(), + interfaces: new string[] { } ); - string actual = JsonConvert.SerializeObject(classType, Formatting.Indented); + string actual = ToJson(classType); const string expected = @"{ ""abstract"": true, - ""base"": { - ""fqn"": ""myBaseFqn"" - }, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""base"": ""myBaseFqn"", + ""initializer"": {}, ""properties"": [], ""methods"": [], ""interfaces"": [], @@ -165,22 +154,16 @@ public void ShouldNotSerializeMissingDocs() isAbstract: true, properties: new Property[] { }, methods: new Method[] { }, - @base: new TypeReference("myBaseFqn"), - initializer: new Method(true, false, false), - interfaces: new TypeReference[] { } + @base: "myBaseFqn", + initializer: new Initializer(), + interfaces: new string[] { } ); - string actual = JsonConvert.SerializeObject(classType, Formatting.Indented); + string actual = ToJson(classType); const string expected = @"{ ""abstract"": true, - ""base"": { - ""fqn"": ""myBaseFqn"" - }, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""base"": ""myBaseFqn"", + ""initializer"": {}, ""properties"": [], ""methods"": [], ""interfaces"": [], @@ -206,22 +189,16 @@ public void ShouldNotSerializeMissingProperties() isAbstract: true, docs: new Docs(), methods: new Method[] { }, - @base: new TypeReference("myBaseFqn"), - initializer: new Method(true, false, false), - interfaces: new TypeReference[] { } + @base: "myBaseFqn", + initializer: new Initializer(), + interfaces: new string[] { } ); - string actual = JsonConvert.SerializeObject(classType, Formatting.Indented); + string actual = ToJson(classType); const string expected = @"{ ""abstract"": true, - ""base"": { - ""fqn"": ""myBaseFqn"" - }, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""base"": ""myBaseFqn"", + ""initializer"": {}, ""methods"": [], ""interfaces"": [], ""fqn"": ""myFqn"", @@ -247,22 +224,16 @@ public void ShouldNotSerializeMissingMethods() isAbstract: true, docs: new Docs(), properties: new Property[] { }, - @base: new TypeReference("myBaseFqn"), - initializer: new Method(true, false, false), - interfaces: new TypeReference[] { } + @base: "myBaseFqn", + initializer: new Initializer(), + interfaces: new string[] { } ); - string actual = JsonConvert.SerializeObject(classType, Formatting.Indented); + string actual = ToJson(classType); const string expected = @"{ ""abstract"": true, - ""base"": { - ""fqn"": ""myBaseFqn"" - }, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""base"": ""myBaseFqn"", + ""initializer"": {}, ""properties"": [], ""interfaces"": [], ""fqn"": ""myFqn"", @@ -289,18 +260,14 @@ public void ShouldNotSerializeMissingBase() docs: new Docs(), properties: new Property[] { }, methods: new Method[] { }, - initializer: new Method(true, false, false), - interfaces: new TypeReference[] { } + initializer: new Initializer(), + interfaces: new string[] { } ); - string actual = JsonConvert.SerializeObject(classType, Formatting.Indented); + string actual = ToJson(classType); const string expected = @"{ ""abstract"": true, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""initializer"": {}, ""properties"": [], ""methods"": [], ""interfaces"": [], @@ -328,16 +295,14 @@ public void ShouldNotSerializeMissingInitializer() docs: new Docs(), properties: new Property[] { }, methods: new Method[] { }, - @base: new TypeReference("myBaseFqn"), - interfaces: new TypeReference[] { } + @base: "myBaseFqn", + interfaces: new string[] { } ); - string actual = JsonConvert.SerializeObject(classType, Formatting.Indented); + string actual = ToJson(classType); const string expected = @"{ ""abstract"": true, - ""base"": { - ""fqn"": ""myBaseFqn"" - }, + ""base"": ""myBaseFqn"", ""properties"": [], ""methods"": [], ""interfaces"": [], @@ -365,21 +330,15 @@ public void ShouldNotSerializeMissingInterfaces() docs: new Docs(), properties: new Property[] { }, methods: new Method[] { }, - @base: new TypeReference("myBaseFqn"), - initializer: new Method(true, false, false) + @base: "myBaseFqn", + initializer: new Initializer() ); - string actual = JsonConvert.SerializeObject(classType, Formatting.Indented); + string actual = ToJson(classType); const string expected = @"{ ""abstract"": true, - ""base"": { - ""fqn"": ""myBaseFqn"" - }, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""base"": ""myBaseFqn"", + ""initializer"": {}, ""properties"": [], ""methods"": [], ""fqn"": ""myFqn"", @@ -403,14 +362,8 @@ public void ShouldDeserializeAllMembers() { const string json = @"{ ""abstract"": true, - ""base"": { - ""fqn"": ""myBaseFqn"" - }, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""base"": ""myBaseFqn"", + ""initializer"": {}, ""properties"": [], ""methods"": [], ""interfaces"": [], @@ -443,16 +396,10 @@ public void ShouldThrowOnMissingFullyQualifiedName() { const string json = @"{ ""abstract"": true, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""initializer"": {}, ""properties"": [], ""methods"": [], - ""base"": { - ""fqn"": ""myBaseFqn"" - }, + ""base"": ""myBaseFqn"", ""interfaces"": [], ""assembly"": ""myModule"", ""name"": ""myName"", @@ -469,16 +416,10 @@ public void ShouldThrowOnMissingAssembly() { const string json = @"{ ""abstract"": true, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""initializer"": {}, ""properties"": [], ""methods"": [], - ""base"": { - ""fqn"": ""myBaseFqn"" - }, + ""base"": ""myBaseFqn"", ""interfaces"": [], ""fqn"": ""myFqn"", ""name"": ""myName"", @@ -495,16 +436,10 @@ public void ShouldThrowOnMissingName() { const string json = @"{ ""abstract"": true, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""initializer"": {}, ""properties"": [], ""methods"": [], - ""base"": { - ""fqn"": ""myBaseFqn"" - }, + ""base"": ""myBaseFqn"", ""interfaces"": [], ""fqn"": ""myFqn"", ""assembly"": ""myModule"", @@ -521,16 +456,10 @@ public void ShouldNotDeserializeMissingNamespace() { const string json = @"{ ""abstract"": true, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""initializer"": {}, ""properties"": [], ""methods"": [], - ""base"": { - ""fqn"": ""myBaseFqn"" - }, + ""base"": ""myBaseFqn"", ""interfaces"": [], ""fqn"": ""myFqn"", ""assembly"": ""myModule"", @@ -548,16 +477,10 @@ public void ShouldNotDeserializeMissingDocs() { const string json = @"{ ""abstract"": true, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""initializer"": {}, ""properties"": [], ""methods"": [], - ""base"": { - ""fqn"": ""myBaseFqn"" - }, + ""base"": ""myBaseFqn"", ""interfaces"": [], ""fqn"": ""myFqn"", ""assembly"": ""myModule"", @@ -576,15 +499,9 @@ public void ShouldNotDeserializeMissingProperties() { const string json = @"{ ""abstract"": true, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""initializer"": {}, ""methods"": [], - ""base"": { - ""fqn"": ""myBaseFqn"" - }, + ""base"": ""myBaseFqn"", ""interfaces"": [], ""fqn"": ""myFqn"", ""assembly"": ""myModule"", @@ -604,15 +521,9 @@ public void ShouldNotDeserializeMissingMethods() { const string json = @"{ ""abstract"": true, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""initializer"": {}, ""properties"": [], - ""base"": { - ""fqn"": ""myBaseFqn"" - }, + ""base"": ""myBaseFqn"", ""interfaces"": [], ""fqn"": ""myFqn"", ""assembly"": ""myModule"", @@ -632,11 +543,7 @@ public void ShouldNotDeserializeMissingBase() { const string json = @"{ ""abstract"": true, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""initializer"": {}, ""properties"": [], ""methods"": [], ""interfaces"": [], @@ -660,9 +567,7 @@ public void ShouldNotDeserializeMissingInitializer() ""abstract"": true, ""properties"": [], ""methods"": [], - ""base"": { - ""fqn"": ""myBaseFqn"" - }, + ""base"": ""myBaseFqn"", ""interfaces"": [], ""fqn"": ""myFqn"", ""assembly"": ""myModule"", @@ -682,16 +587,10 @@ public void ShouldNotDeserializeMissingInterfaces() { const string json = @"{ ""abstract"": true, - ""initializer"": { - ""initializer"": true, - ""protected"": false, - ""abstract"": false - }, + ""initializer"": {}, ""properties"": [], ""methods"": [], - ""base"": { - ""fqn"": ""myBaseFqn"" - }, + ""base"": ""myBaseFqn"", ""fqn"": ""myFqn"", ""assembly"": ""myModule"", ""name"": ""myName"", @@ -704,6 +603,29 @@ public void ShouldNotDeserializeMissingInterfaces() Assert.Null(actual.Interfaces); } + + [Fact(DisplayName = Prefix + nameof(DeserializesAsyncMethod))] + public void DeserializesAsyncMethod() + { + const string json = @"{ + ""abstract"": true, + ""initializer"": {}, + ""properties"": [], + ""methods"": [{ ""async"": true, ""name"": ""testMethod"" }], + ""base"": ""myBaseFqn"", + ""fqn"": ""myFqn"", + ""assembly"": ""myModule"", + ""name"": ""myName"", + ""namespace"": ""myNamespace"", + ""kind"": ""class"", + ""docs"": {} +}"; + + ClassType actual = JsonConvert.DeserializeObject(json); + + Assert.True(actual.Methods.Length == 1); + Assert.True(actual.Methods[0]?.IsAsync); + } } } } diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/CollectionTypeReferenceTests.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/CollectionTypeReferenceTests.cs index 85a31559d9..2800b66e7f 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/CollectionTypeReferenceTests.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/CollectionTypeReferenceTests.cs @@ -50,7 +50,9 @@ public void ShouldDeserializeAllMembers() const string json = @"{ ""kind"": ""array"", ""elementtype"": { - ""fqn"": ""myElementFqn"" + ""type"": { + ""fqn"": ""myElementFqn"" + } } }"; diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/TestUtils.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/TestUtils.cs new file mode 100644 index 0000000000..bd40ea4831 --- /dev/null +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/TestUtils.cs @@ -0,0 +1,17 @@ +using Newtonsoft.Json; + +namespace Amazon.JSII.JsonModel.UnitTests.Spec +{ + public class TestUtils + { + private static readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + DefaultValueHandling = DefaultValueHandling.Ignore + }; + + protected string ToJson(object obj) + { + return JsonConvert.SerializeObject(obj, Formatting.Indented, SerializerSettings); + } + } +} \ No newline at end of file diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Amazon.JSII.JsonModel.csproj b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Amazon.JSII.JsonModel.csproj index 92f430ac28..433a032d8a 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Amazon.JSII.JsonModel.csproj +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Amazon.JSII.JsonModel.csproj @@ -1,4 +1,4 @@ - + diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Converters/TypeConverter.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Converters/TypeConverter.cs index a58f1521c2..622483f7d1 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Converters/TypeConverter.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Converters/TypeConverter.cs @@ -11,6 +11,11 @@ public class TypeConverter : JsonConverter public override bool CanWrite => true; + private static readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + DefaultValueHandling = DefaultValueHandling.Ignore + }; + public override bool CanConvert(System.Type objectType) { return objectType.IsAssignableFrom(typeof(EnumType)) || objectType.IsAssignableFrom(typeof(ClassType)); @@ -30,21 +35,21 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s case TypeKind.Enum: { EnumType derivedType = value as EnumType ?? throw new ArgumentException($"Value has type kind '{type.Kind}', but is not an instance of {nameof(EnumType)}", nameof(value)); - string json = JsonConvert.SerializeObject(derivedType); + string json = JsonConvert.SerializeObject(derivedType, SerializerSettings); writer.WriteRawValue(json); break; } case TypeKind.Class: { ClassType derivedType = value as ClassType ?? throw new ArgumentException($"Value has type kind '{type.Kind}', but is not an instance of {nameof(ClassType)}", nameof(value)); - string json = JsonConvert.SerializeObject(derivedType); + string json = JsonConvert.SerializeObject(derivedType, SerializerSettings); writer.WriteRawValue(json); break; } case TypeKind.Interface: { InterfaceType derivedType = value as InterfaceType ?? throw new ArgumentException($"Value has type kind '{type.Kind}', but is not an instance of {nameof(InterfaceType)}", nameof(value)); - string json = JsonConvert.SerializeObject(derivedType); + string json = JsonConvert.SerializeObject(derivedType, SerializerSettings); writer.WriteRawValue(json); break; } diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/AssemblyTargets.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/AssemblyTargets.cs index 31b13eb42f..77ff8467b0 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/AssemblyTargets.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/AssemblyTargets.cs @@ -23,7 +23,7 @@ public DotNetTarget string @namespace, string packageId, string title = null, - bool? signAssembly = null, + bool signAssembly = false, string assemblyOriginatorKeyFile = null, string iconUrl = null ) @@ -47,7 +47,7 @@ public DotNetTarget public string Title { get; } [JsonProperty("signAssembly", NullValueHandling = NullValueHandling.Ignore)] - public bool? SignAssembly { get; } + public bool SignAssembly { get; } [JsonProperty("assemblyOriginatorKeyFile", NullValueHandling = NullValueHandling.Ignore)] public string AssemblyOriginatorKeyFile { get; } diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Callable.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Callable.cs new file mode 100644 index 0000000000..be517a161c --- /dev/null +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Callable.cs @@ -0,0 +1,39 @@ +using Newtonsoft.Json; + +namespace Amazon.JSII.JsonModel.Spec +{ + [JsonObject(MemberSerialization = MemberSerialization.OptIn)] + public abstract class Callable : IDocumentable, IOverridable + { + protected Callable + ( + Parameter[] parameters = null, + bool isProtected = false, + bool isVariadic = false, + string overrides = null, + Docs docs = null + ) + { + Parameters = parameters; + IsProtected = isProtected; + IsVariadic = isVariadic; + Overrides = overrides; + Docs = docs; + } + + [JsonProperty("parameters", NullValueHandling = NullValueHandling.Ignore)] + public Parameter[] Parameters { get; } + + [JsonProperty("protected", NullValueHandling = NullValueHandling.Ignore)] + public bool IsProtected { get; } + + [JsonProperty("variadic", NullValueHandling = NullValueHandling.Ignore)] + public bool IsVariadic { get; } + + [JsonProperty("docs", NullValueHandling = NullValueHandling.Ignore)] + public Docs Docs { get; } + + [JsonProperty("overrides", NullValueHandling = NullValueHandling.Ignore)] + public string Overrides { get; } + } +} \ No newline at end of file diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/ClassType.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/ClassType.cs index 8ec4171d47..cd41db716d 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/ClassType.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/ClassType.cs @@ -14,18 +14,18 @@ public ClassType string name, // ClassType properties - bool isAbstract, + bool isAbstract = false, string @namespace = null, // Type properties Docs docs = null, // ClassType properties - TypeReference @base = null, - Method initializer = null, + string @base = null, + Initializer initializer = null, Property[] properties = null, Method[] methods = null, - TypeReference[] interfaces = null + string[] interfaces = null ) : base ( @@ -46,14 +46,14 @@ public ClassType Interfaces = interfaces; } - [JsonProperty("abstract")] + [JsonProperty("abstract", NullValueHandling = NullValueHandling.Ignore)] public bool IsAbstract { get; } [JsonProperty("base", NullValueHandling = NullValueHandling.Ignore)] - public TypeReference Base { get; } + public string Base { get; } [JsonProperty("initializer", NullValueHandling = NullValueHandling.Ignore)] - public Method Initializer { get; } + public Initializer Initializer { get; } [JsonProperty("properties", NullValueHandling = NullValueHandling.Ignore)] public Property[] Properties { get; } @@ -62,6 +62,6 @@ public ClassType public Method[] Methods { get; } [JsonProperty("interfaces", NullValueHandling = NullValueHandling.Ignore)] - public TypeReference[] Interfaces { get; } + public string[] Interfaces { get; } } } diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/CollectionTypeReference.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/CollectionTypeReference.cs index d1450ec8df..b1f6076909 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/CollectionTypeReference.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/CollectionTypeReference.cs @@ -12,7 +12,7 @@ public CollectionTypeReference(CollectionKind kind, TypeReference elementType) ElementType = elementType ?? throw new ArgumentNullException(nameof(elementType)); } - [JsonProperty("kind")] + [JsonProperty("kind", DefaultValueHandling = DefaultValueHandling.Include)] public CollectionKind Kind { get; } [JsonProperty("elementtype")] diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Constants.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Constants.cs index 69de268579..bbe1612783 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Constants.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Constants.cs @@ -2,7 +2,7 @@ { public static class Constants { - public static readonly string SPEC_VERSION = "jsii/1.0"; // minor version = no breaking change + public static readonly string SPEC_VERSION = "jsii/0.9.0"; // minor version = no breaking change public static readonly string SPEC_FILE_NAME = ".jsii"; } } diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/IOverridable.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/IOverridable.cs index d377498ca5..448104d875 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/IOverridable.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/IOverridable.cs @@ -1,8 +1,7 @@ -using System; -namespace Amazon.JSII.JsonModel.Spec +namespace Amazon.JSII.JsonModel.Spec { public interface IOverridable { - UserTypeReference Overrides { get; } + string Overrides { get; } } } diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Initializer.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Initializer.cs new file mode 100644 index 0000000000..f537f631de --- /dev/null +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Initializer.cs @@ -0,0 +1,24 @@ +using Newtonsoft.Json; + +namespace Amazon.JSII.JsonModel.Spec +{ + [JsonObject(MemberSerialization = MemberSerialization.OptIn)] + public class Initializer : Callable + { + public Initializer + ( + Parameter[] parameters = null, + bool isProtected = false, + bool isVariadic = false, + string overrides = null, + Docs docs = null + ): base( + parameters: parameters, + isProtected: isProtected, + isVariadic: isVariadic, + overrides: overrides, + docs: docs + ) + {} + } +} \ No newline at end of file diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/InterfaceType.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/InterfaceType.cs index 770bce3899..757f461ffb 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/InterfaceType.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/InterfaceType.cs @@ -18,10 +18,10 @@ public InterfaceType Docs docs = null, // InterfaceType properties - TypeReference[] interfaces = null, + string[] interfaces = null, Method[] methods = null, Property[] properties = null, - bool? isDataType = null + bool isDataType = false ) : base ( fullyQualifiedName, @@ -39,7 +39,7 @@ public InterfaceType } [JsonProperty("interfaces", NullValueHandling = NullValueHandling.Ignore)] - public TypeReference[] Interfaces { get; } + public string[] Interfaces { get; } [JsonProperty("methods", NullValueHandling = NullValueHandling.Ignore)] public Method[] Methods { get; } @@ -48,6 +48,6 @@ public InterfaceType public Property[] Properties { get; } [JsonProperty("datatype", NullValueHandling = NullValueHandling.Ignore)] - public bool? IsDataType { get; } + public bool IsDataType { get; } } } diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Method.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Method.cs index de0384c35f..dd29c2f2c5 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Method.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Method.cs @@ -4,63 +4,49 @@ namespace Amazon.JSII.JsonModel.Spec { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class Method : IDocumentable, IOverridable + public class Method : Callable { public Method ( - bool isInitializer, - bool isProtected, - bool? isAbstract = null, + string name, + OptionalValue returns = null, Parameter[] parameters = null, - Docs docs = null, - string name = null, - TypeReference returns = null, - bool? isVariadic = null, - bool? isStatic = null, - UserTypeReference overrides = null + bool isAbstract = false, + bool isAsync = false, + bool isProtected = false, + bool isVariadic = false, + bool isStatic = false, + string overrides = null, + Docs docs = null + ): base + ( + parameters: parameters, + isProtected: isProtected, + isVariadic: isVariadic, + overrides: overrides, + docs: docs ) { - IsInitializer = isInitializer; - IsProtected = isProtected; - IsAbstract = isAbstract; - Parameters = parameters; - Docs = docs; Name = name; Returns = returns; - IsVariadic = isVariadic; + IsAbstract = isAbstract; + IsAsync = isAsync; IsStatic = isStatic; - Overrides = overrides; } - - [JsonProperty("initializer")] - public bool IsInitializer { get; } - - [JsonProperty("protected")] - public bool IsProtected { get; } - - [JsonProperty("abstract", NullValueHandling = NullValueHandling.Ignore)] - public bool? IsAbstract { get; } - - [JsonProperty("parameters", NullValueHandling = NullValueHandling.Ignore)] - public Parameter[] Parameters { get; } - - [JsonProperty("docs", NullValueHandling = NullValueHandling.Ignore)] - public Docs Docs { get; } - - [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("name")] public string Name { get; } [JsonProperty("returns", NullValueHandling = NullValueHandling.Ignore)] - public TypeReference Returns { get; } + public OptionalValue Returns { get; } - [JsonProperty("variadic", NullValueHandling = NullValueHandling.Ignore)] - public bool? IsVariadic { get; } + [JsonProperty("abstract", NullValueHandling = NullValueHandling.Ignore)] + public bool IsAbstract { get; } + [JsonProperty("async", NullValueHandling = NullValueHandling.Ignore)] + public bool IsAsync { get; } + [JsonProperty("static", NullValueHandling = NullValueHandling.Ignore)] - public bool? IsStatic { get; } - - [JsonProperty("overrides", NullValueHandling = NullValueHandling.Ignore)] - public UserTypeReference Overrides { get; } + public bool IsStatic { get; } } } \ No newline at end of file diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/OptionalValue.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/OptionalValue.cs new file mode 100644 index 0000000000..53e8040104 --- /dev/null +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/OptionalValue.cs @@ -0,0 +1,32 @@ +using System; +using Newtonsoft.Json; + +namespace Amazon.JSII.JsonModel.Spec +{ + public interface IOptionalValue + { + TypeReference Type { get; } + + bool IsOptional { get; } + } + + [JsonObject(MemberSerialization = MemberSerialization.OptIn)] + public class OptionalValue : IOptionalValue + { + public OptionalValue + ( + TypeReference type, + bool isOptional = false + ) + { + Type = type ?? throw new ArgumentNullException(nameof(type)); + IsOptional = isOptional; + } + + [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)] + public TypeReference Type { get; } + + [JsonProperty("optional", NullValueHandling = NullValueHandling.Ignore)] + public bool IsOptional { get; } + } +} \ No newline at end of file diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Parameter.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Parameter.cs index fda386d881..132dd5e925 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Parameter.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Parameter.cs @@ -4,32 +4,29 @@ namespace Amazon.JSII.JsonModel.Spec { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class Parameter : IDocumentable + public class Parameter : OptionalValue, IDocumentable { public Parameter ( string name, TypeReference type, - Docs docs = null, - bool? isVariadic = null - ) + bool isOptional = false, + bool isVariadic = false, + Docs docs = null + ): base(type: type, isOptional: isOptional) { Name = name ?? throw new ArgumentNullException(nameof(name)); - Type = type ?? throw new ArgumentNullException(nameof(type)); Docs = docs; IsVariadic = isVariadic; } [JsonProperty("name")] public string Name { get; } - - [JsonProperty("type")] - public TypeReference Type { get; } - + + [JsonProperty("variadic", NullValueHandling = NullValueHandling.Ignore)] + public bool IsVariadic { get; } + [JsonProperty("docs", NullValueHandling = NullValueHandling.Ignore)] public Docs Docs { get; } - - [JsonProperty("variadic", NullValueHandling = NullValueHandling.Ignore)] - public bool? IsVariadic { get; } } } \ No newline at end of file diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Person.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Person.cs index cba11d02c1..d4dbaea00e 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Person.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Person.cs @@ -12,14 +12,14 @@ public Person string[] roles, string email = null, string url = null, - bool? organization = null + bool isOrganization = false ) { Name = name ?? throw new ArgumentNullException(nameof(name)); Roles = roles ?? throw new ArgumentNullException(nameof(roles)); Email = email; Url = url; - Organization = organization; + IsOrganization = isOrganization; } [JsonProperty("name")] @@ -35,6 +35,6 @@ public Person public string Url { get; } [JsonProperty("organization", NullValueHandling = NullValueHandling.Ignore)] - public bool? Organization { get; } + public bool IsOrganization { get; } } } diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Property.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Property.cs index 3fa7a2b0ca..0bd08fc087 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Property.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Property.cs @@ -4,23 +4,23 @@ namespace Amazon.JSII.JsonModel.Spec { [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class Property : IDocumentable, IOverridable + public class Property : OptionalValue, IDocumentable, IOverridable { public Property ( string name, TypeReference type, - bool? isImmutable = null, - bool? isProtected = null, - bool? isAbstract = null, - Docs docs = null, - bool? isStatic = null, - bool? isConstant = null, - UserTypeReference overrides = null - ) + bool isImmutable = false, + bool isOptional = false, + bool isProtected = false, + bool isAbstract = false, + bool isStatic = false, + bool isConstant = false, + string overrides = null, + Docs docs = null + ): base(type: type, isOptional: isOptional) { Name = name ?? throw new ArgumentNullException(nameof(name)); - Type = type ?? throw new ArgumentNullException(nameof(type)); IsImmutable = isImmutable; IsProtected = isProtected; IsAbstract = isAbstract; @@ -33,28 +33,25 @@ public Property [JsonProperty("name")] public string Name { get; } - [JsonProperty("type")] - public TypeReference Type { get; } + [JsonProperty("abstract", NullValueHandling = NullValueHandling.Ignore)] + public bool IsAbstract{ get; } + [JsonProperty("const", NullValueHandling = NullValueHandling.Ignore)] + public bool IsConstant { get; } + [JsonProperty("immutable", NullValueHandling = NullValueHandling.Ignore)] - public bool? IsImmutable { get; } + public bool IsImmutable { get; } [JsonProperty("protected", NullValueHandling = NullValueHandling.Ignore)] - public bool? IsProtected { get; } - - [JsonProperty("abstract", NullValueHandling = NullValueHandling.Ignore)] - public bool? IsAbstract{ get; } - - [JsonProperty("docs", NullValueHandling = NullValueHandling.Ignore)] - public Docs Docs { get; } + public bool IsProtected { get; } [JsonProperty("static", NullValueHandling = NullValueHandling.Ignore)] - public bool? IsStatic { get; } - - [JsonProperty("const", NullValueHandling = NullValueHandling.Ignore)] - public bool? IsConstant { get; } + public bool IsStatic { get; } [JsonProperty("overrides", NullValueHandling = NullValueHandling.Ignore)] - public UserTypeReference Overrides { get; } + public string Overrides { get; } + + [JsonProperty("docs", NullValueHandling = NullValueHandling.Ignore)] + public Docs Docs { get; } } } \ No newline at end of file diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Type.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Type.cs index 1ade2d985c..e4fcd2797f 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Type.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Type.cs @@ -6,7 +6,7 @@ namespace Amazon.JSII.JsonModel.Spec [JsonObject(MemberSerialization = MemberSerialization.OptIn)] public abstract class Type : IDocumentable { - public Type + protected Type ( string fullyQualifiedName, string assembly, @@ -36,7 +36,7 @@ public Type [JsonProperty("namespace", NullValueHandling = NullValueHandling.Ignore)] public string Namespace { get; } - [JsonProperty("kind")] + [JsonProperty("kind", DefaultValueHandling = DefaultValueHandling.Include)] public TypeKind Kind { get; } [JsonProperty("docs", NullValueHandling = NullValueHandling.Ignore)] diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/TypeReference.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/TypeReference.cs index faffdb04c3..1e27ec877c 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/TypeReference.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/TypeReference.cs @@ -10,17 +10,13 @@ public TypeReference string fullyQualifiedName = null, PrimitiveType? primitive = null, CollectionTypeReference collection = null, - UnionTypeReference union = null, - bool? isOptional = null, - bool? isPromise = null + UnionTypeReference union = null ) { FullyQualifiedName = fullyQualifiedName; Primitive = primitive; Collection = collection; Union = union; - IsOptional = isOptional; - IsPromise = isPromise; } [JsonProperty("fqn", NullValueHandling = NullValueHandling.Ignore)] @@ -34,11 +30,5 @@ public TypeReference [JsonProperty("union", NullValueHandling = NullValueHandling.Ignore)] public UnionTypeReference Union { get; } - - [JsonProperty("optional", NullValueHandling = NullValueHandling.Ignore)] - public bool? IsOptional { get; } - - [JsonProperty("promise", NullValueHandling = NullValueHandling.Ignore)] - public bool? IsPromise { get; } } } \ No newline at end of file diff --git a/packages/jsii-dotnet-runtime-test/package-lock.json b/packages/jsii-dotnet-runtime-test/package-lock.json index 74e8a4916a..76c758dd3c 100644 --- a/packages/jsii-dotnet-runtime-test/package-lock.json +++ b/packages/jsii-dotnet-runtime-test/package-lock.json @@ -1,6 +1,6 @@ { "name": "jsii-dotnet-runtime-test", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -11,9 +11,9 @@ "dev": true }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", "dev": true } } diff --git a/packages/jsii-dotnet-runtime-test/package.json b/packages/jsii-dotnet-runtime-test/package.json index 2ae6053f72..abd4ac42a5 100644 --- a/packages/jsii-dotnet-runtime-test/package.json +++ b/packages/jsii-dotnet-runtime-test/package.json @@ -15,7 +15,7 @@ "jsii-calc": "^0.9.0", "jsii-dotnet-runtime": "^0.9.0", "jsii-pacmak": "^0.9.0", - "typescript": "^3.2.4" + "typescript": "^3.4.2" }, "author": { "name": "Amazon Web Services", diff --git a/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests.sln b/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests.sln new file mode 100644 index 0000000000..775f7320b7 --- /dev/null +++ b/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests.sln @@ -0,0 +1,29 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Amazon.JSII.Runtime.IntegrationTests", "Amazon.JSII.Runtime.IntegrationTests\Amazon.JSII.Runtime.IntegrationTests.csproj", "{CE3CAFBD-25F8-422D-925A-8F9CCEA1F548}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Amazon.JSII.Runtime", "..\..\jsii-dotnet-runtime\src\Amazon.JSII.Runtime\Amazon.JSII.Runtime.csproj", "{CA2CBE1C-5435-416B-B4E6-22D1FABA8AFF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Amazon.JSII.JsonModel", "..\..\jsii-dotnet-jsonmodel\src\Amazon.JSII.JsonModel\Amazon.JSII.JsonModel.csproj", "{1E0BFD79-D221-425D-ADFF-1DF939BCFC58}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CE3CAFBD-25F8-422D-925A-8F9CCEA1F548}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE3CAFBD-25F8-422D-925A-8F9CCEA1F548}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE3CAFBD-25F8-422D-925A-8F9CCEA1F548}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE3CAFBD-25F8-422D-925A-8F9CCEA1F548}.Release|Any CPU.Build.0 = Release|Any CPU + {CA2CBE1C-5435-416B-B4E6-22D1FABA8AFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CA2CBE1C-5435-416B-B4E6-22D1FABA8AFF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CA2CBE1C-5435-416B-B4E6-22D1FABA8AFF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CA2CBE1C-5435-416B-B4E6-22D1FABA8AFF}.Release|Any CPU.Build.0 = Release|Any CPU + {1E0BFD79-D221-425D-ADFF-1DF939BCFC58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1E0BFD79-D221-425D-ADFF-1DF939BCFC58}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1E0BFD79-D221-425D-ADFF-1DF939BCFC58}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1E0BFD79-D221-425D-ADFF-1DF939BCFC58}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj b/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj index 59dea45c8f..5e0320da4c 100644 --- a/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj +++ b/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj @@ -1,4 +1,4 @@ - + netcoreapp2.0 @@ -19,8 +19,4 @@ - - - - diff --git a/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ComplianceTests.cs b/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ComplianceTests.cs index 7c3e510f5f..347a194db7 100644 --- a/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ComplianceTests.cs +++ b/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ComplianceTests.cs @@ -498,10 +498,10 @@ class InterfaceWithProperties : DeputyBase, IIInterfaceWithProperties { string _x; - [JsiiProperty("readOnlyString", "{\"primitive\":\"string\"}", true)] + [JsiiProperty(name: "readOnlyString", typeJson: "{\"primitive\":\"string\"}", isOverride: true)] public string ReadOnlyString => "READ_ONLY_STRING"; - [JsiiProperty("readWriteString", "{\"primitive\":\"string\"}", true)] + [JsiiProperty(name: "readWriteString", typeJson: "{\"primitive\":\"string\"}", isOverride: true)] public string ReadWriteString { get => $"{_x}?"; @@ -924,10 +924,10 @@ public NumberReturner(double number) NumberProp = new Number(number); } - [JsiiProperty("numberProp", "{\"fqn\":\"@scope/jsii-calc-lib.Number\"}", true)] + [JsiiProperty(name: "numberProp", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.Number\"}", isOverride: true)] public Number NumberProp { get; } - [JsiiMethod("obtainNumber", "{\"fqn\":\"@scope/jsii-calc-lib.IDoublable\"}", "[]", true)] + [JsiiMethod(name: "obtainNumber", returnsJson: "{\"type\":{\"fqn\":\"@scope/jsii-calc-lib.IDoublable\"}}", isOverride: true)] public IIDoublable ObtainNumber() { return new Doublable(this.NumberProp); @@ -940,7 +940,7 @@ public Doublable(Number number) this.DoubleValue = number.DoubleValue; } - [JsiiProperty("doubleValue", "{\"primitive\":\"number\"}", true)] + [JsiiProperty(name: "doubleValue", typeJson: "{\"primitive\":\"number\"}", isOverride: true)] public Double DoubleValue { get; } } } @@ -1041,7 +1041,7 @@ class PureNativeFriendlyRandom : DeputyBase, IIFriendlyRandomGenerator { int _nextNumber = 1000; - [JsiiMethod("next", "{\"primitive\":\"number\"}", "[]", true)] + [JsiiMethod(name: "next", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", isOverride: true)] public double Next() { int n = _nextNumber; @@ -1049,7 +1049,7 @@ public double Next() return n; } - [JsiiMethod("hello", "{\"primitive\":\"string\"}", "[]", true)] + [JsiiMethod(name: "hello", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public string Hello() { return "I am a native!"; @@ -1066,13 +1066,13 @@ public SubclassNativeFriendlyRandom() _nextNumber = 100; } - [JsiiMethod("hello", "{\"primitive\":\"string\"}", "[]", true)] + [JsiiMethod(name: "hello", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public string Hello() { return "SubclassNativeFriendlyRandom"; } - [JsiiMethod("next", "{\"primitive\":\"number\"}", "[]", true)] + [JsiiMethod(name: "next", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", isOverride: true)] public double Next() { int next = _nextNumber; diff --git a/packages/jsii-dotnet-runtime/package-lock.json b/packages/jsii-dotnet-runtime/package-lock.json index a0ec0b99c8..3d130606b6 100644 --- a/packages/jsii-dotnet-runtime/package-lock.json +++ b/packages/jsii-dotnet-runtime/package-lock.json @@ -1,6 +1,6 @@ { "name": "jsii-dotnet-runtime", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -11,9 +11,9 @@ "dev": true }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", "dev": true } } diff --git a/packages/jsii-dotnet-runtime/package.json b/packages/jsii-dotnet-runtime/package.json index 3d847e5044..c9ade237a7 100644 --- a/packages/jsii-dotnet-runtime/package.json +++ b/packages/jsii-dotnet-runtime/package.json @@ -15,7 +15,7 @@ "@types/node": "^8.10.43", "jsii-build-tools": "^0.9.0", "jsii-runtime": "^0.9.0", - "typescript": "^3.2.4" + "typescript": "^3.4.2" }, "dependencies": { "jsii-dotnet-jsonmodel": "^0.9.0" diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Amazon.JSII.Runtime.UnitTests.csproj b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Amazon.JSII.Runtime.UnitTests.csproj index f910b9187a..af8270421c 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Amazon.JSII.Runtime.UnitTests.csproj +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Amazon.JSII.Runtime.UnitTests.csproj @@ -13,6 +13,7 @@ + diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/FrameworkToJsiiConverterTests.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/FrameworkToJsiiConverterTests.cs index 34e81eb2ed..dfa74c5fa5 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/FrameworkToJsiiConverterTests.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/FrameworkToJsiiConverterTests.cs @@ -100,13 +100,9 @@ public class Primitive : TestBase [InlineData(PrimitiveType.String, null, null, true)] public void ConvertsPrimitiveValues(PrimitiveType primitive, object value, object expected, bool isOptional) { - TypeReference reference = new TypeReference - ( - primitive: primitive, - isOptional: isOptional - ); + var instance = new OptionalValue(new TypeReference(primitive: primitive), isOptional: isOptional); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.Equal(expected, actual); @@ -115,10 +111,10 @@ public void ConvertsPrimitiveValues(PrimitiveType primitive, object value, objec [Fact(DisplayName = _Prefix + nameof(ConvertsDateValues))] public void ConvertsDateValues() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Date); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Date)); DateTime now = DateTime.Now; - bool success = _converter.TryConvert(reference, _referenceMap, now, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, now, out object actual); Assert.True(success); Assert.IsType(actual); @@ -130,7 +126,7 @@ public void ConvertsDateValues() Assert.Equal(expected, actual); - success = _converter.TryConvert(reference, _referenceMap, null, out actual); + success = _converter.TryConvert(instance, _referenceMap, null, out actual); Assert.False(success); Assert.Null(actual); @@ -139,14 +135,10 @@ public void ConvertsDateValues() [Fact(DisplayName = _Prefix + nameof(ConvertsOptionalDateValues))] public void ConvertsOptionalDateValues() { - TypeReference reference = new TypeReference - ( - primitive: PrimitiveType.Date, - isOptional: true - ); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Date), isOptional: true); DateTime now = DateTime.Now; - bool success = _converter.TryConvert(reference, _referenceMap, now, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, now, out object actual); Assert.True(success); Assert.IsType(actual); var expected = new JObject @@ -155,7 +147,7 @@ public void ConvertsOptionalDateValues() }; Assert.Equal(expected, actual); - success = _converter.TryConvert(reference, _referenceMap, null, out actual); + success = _converter.TryConvert(instance, _referenceMap, null, out actual); Assert.True(success); Assert.Null(actual); } @@ -163,7 +155,7 @@ public void ConvertsOptionalDateValues() [Fact(DisplayName = _Prefix + nameof(ConvertsJsonValues))] public void ConvertsJsonValues() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Json); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Json)); JObject jObject = new JObject( new JProperty("myArray", new JArray( @@ -179,7 +171,7 @@ public void ConvertsJsonValues() )) ); - bool success = _converter.TryConvert(reference, _referenceMap, jObject, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, jObject, out object actual); Assert.True(success); Assert.Same(jObject, actual); @@ -188,9 +180,9 @@ public void ConvertsJsonValues() [Fact(DisplayName = _Prefix + nameof(FailsOnNullBoolean))] public void FailsOnNullBoolean() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Boolean); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Boolean)); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.False(success); } @@ -198,9 +190,9 @@ public void FailsOnNullBoolean() [Fact(DisplayName = _Prefix + nameof(FailsOnNullNumber))] public void FailsOnNullNumber() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Number); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Number)); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.False(success); } @@ -208,9 +200,9 @@ public void FailsOnNullNumber() [Fact(DisplayName = _Prefix + nameof(ConvertsNullJson))] public void ConvertsNullJson() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Json); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Json)); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.True(success); Assert.Null(actual); @@ -224,12 +216,12 @@ public class FullyQualifiedName : TestBase [Fact(DisplayName = _Prefix + nameof(ConvertsClassReference))] public void ConvertsClassReference() { - TypeReference reference = new TypeReference("myClassFqn"); + var instance = new OptionalValue(new TypeReference("myClassFqn")); ByRefValue byRef = new ByRefValue("myClassFqn", "0001"); TestClass myClass = new TestClass(byRef); - bool success = _converter.TryConvert(reference, _referenceMap, myClass, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, myClass, out object actual); Assert.True(success); Assert.Equal(JObject.FromObject(byRef), actual); @@ -239,11 +231,11 @@ public void ConvertsClassReference() [Fact(DisplayName = _Prefix + nameof(ConvertsEnumValue))] public void ConvertsEnumValue() { - TypeReference reference = new TypeReference("myEnumFqn"); + var instance = new OptionalValue(new TypeReference("myEnumFqn")); TestEnum myEnum = TestEnum.MyMember2; - bool success = _converter.TryConvert(reference, _referenceMap, myEnum, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, myEnum, out object actual); Assert.True(success); Assert.IsType(actual); @@ -257,9 +249,9 @@ public void ConvertsEnumValue() [Fact(DisplayName = _Prefix + nameof(ConvertsNullClassReference))] public void ConvertsNullClassReference() { - TypeReference reference = new TypeReference("myClassFqn"); + var instance = new OptionalValue(new TypeReference("myClassFqn")); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.True(success); Assert.Null(actual); @@ -268,9 +260,9 @@ public void ConvertsNullClassReference() [Fact(DisplayName = _Prefix + nameof(DoesNotConvertNullNonOptionalEnumValue))] public void DoesNotConvertNullNonOptionalEnumValue() { - TypeReference reference = new TypeReference("myEnumFqn"); + var instance = new OptionalValue(new TypeReference("myEnumFqn")); - bool success =_converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success =_converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.False(success); Assert.Null(actual); @@ -279,9 +271,9 @@ public void DoesNotConvertNullNonOptionalEnumValue() [Fact(DisplayName = _Prefix + nameof(ConvertsNullOptionalEnumValue))] public void ConvertsNullOptionalEnumValue() { - TypeReference reference = new TypeReference("myEnumFqn", isOptional: true); + var instance = new OptionalValue(new TypeReference("myEnumFqn"), isOptional: true); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.True(success); Assert.Null(actual); @@ -295,11 +287,11 @@ public class Collection : TestBase [Fact(DisplayName = _Prefix + nameof(ConvertsMap))] public void ConvertsMap() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( collection: new CollectionTypeReference(CollectionKind.Map, new TypeReference(primitive: PrimitiveType.String) ) - ); + )); IDictionary frameworkMap = new Dictionary { @@ -307,7 +299,7 @@ public void ConvertsMap() { "myKey2", "myValue2" } }; - bool success = _converter.TryConvert(reference, _referenceMap, frameworkMap, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, frameworkMap, out object actual); Assert.True(success); Assert.IsType(actual); @@ -330,7 +322,7 @@ public void ConvertsMap() [Fact(DisplayName = _Prefix + nameof(RecursivelyConvertsMapElements))] public void RecursivelyConvertsMapElements() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( collection: new CollectionTypeReference(CollectionKind.Map, new TypeReference( collection: new CollectionTypeReference(CollectionKind.Map, @@ -338,7 +330,7 @@ public void RecursivelyConvertsMapElements() ) ) ) - ); + )); var frameworkMap = new Dictionary> { @@ -346,7 +338,7 @@ public void RecursivelyConvertsMapElements() { "myKey2", new Dictionary { { "mySubKey2", "myValue2" } } }, }; - bool success = _converter.TryConvert(reference, _referenceMap, frameworkMap, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, frameworkMap, out object actual); Assert.True(success); Assert.IsType(actual); @@ -387,12 +379,12 @@ public void RecursivelyConvertsMapElements() [Fact(DisplayName = _Prefix + nameof(ConvertsArray))] public void ConvertsArray() { - TypeReference reference = new TypeReference + var instance = new OptionalValue(new TypeReference ( collection: new CollectionTypeReference(CollectionKind.Array, new TypeReference(primitive: PrimitiveType.String) ) - ); + )); string[] frameworkArray = new string[] { @@ -400,7 +392,7 @@ public void ConvertsArray() "myValue2", }; - bool success = _converter.TryConvert(reference, _referenceMap, frameworkArray, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, frameworkArray, out object actual); Assert.True(success); Assert.IsType(actual); @@ -415,7 +407,7 @@ public void ConvertsArray() [Fact(DisplayName = _Prefix + nameof(RecursivelyConvertsArrayElements))] public void RecursivelyConvertsArrayElements() { - TypeReference reference = new TypeReference + var instance = new OptionalValue(new TypeReference ( collection: new CollectionTypeReference(CollectionKind.Array, new TypeReference @@ -425,7 +417,7 @@ public void RecursivelyConvertsArrayElements() ) ) ) - ); + )); var frameworkArray = new string[][] { @@ -433,7 +425,7 @@ public void RecursivelyConvertsArrayElements() new [] { "myValue2" }, }; - bool success = _converter.TryConvert(reference, _referenceMap, frameworkArray, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, frameworkArray, out object actual); Assert.True(success); Assert.IsType(actual); @@ -462,14 +454,14 @@ public void RecursivelyConvertsArrayElements() [Fact(DisplayName = _Prefix + nameof(ConvertsNullMap))] public void ConvertsNullMap() { - TypeReference reference = new TypeReference + var instance = new OptionalValue(new TypeReference ( collection: new CollectionTypeReference(CollectionKind.Map, new TypeReference(primitive: PrimitiveType.String) ) - ); + )); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.True(success); Assert.Null(actual); @@ -478,14 +470,14 @@ public void ConvertsNullMap() [Fact(DisplayName = _Prefix + nameof(ConvertsNullArray))] public void ConvertsNullArray() { - TypeReference reference = new TypeReference + var instance = new OptionalValue(new TypeReference ( collection: new CollectionTypeReference(CollectionKind.Array, new TypeReference(primitive: PrimitiveType.String) ) - ); + )); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.True(success); Assert.Null(actual); @@ -499,14 +491,14 @@ public class Union : TestBase [Fact(DisplayName = _Prefix + nameof(FailsIfNoTypeMatches))] public void FailsIfNoTypeMatches() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( union: new UnionTypeReference(new[] { new TypeReference(primitive: PrimitiveType.String), new TypeReference(primitive: PrimitiveType.Number) }) - ); + )); - bool success = _converter.TryConvert(reference, _referenceMap, true, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, true, out object actual); Assert.False(success); Assert.Null(actual); @@ -515,13 +507,13 @@ public void FailsIfNoTypeMatches() [Fact(DisplayName = _Prefix + nameof(ConvertsSimpleUnion))] public void ConvertsSimpleUnion() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( union: new UnionTypeReference(new[] { new TypeReference(primitive: PrimitiveType.String) }) - ); + )); - bool success = _converter.TryConvert(reference, _referenceMap, "abc", out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, "abc", out object actual); Assert.True(success); Assert.IsType(actual); @@ -531,14 +523,14 @@ public void ConvertsSimpleUnion() [Fact(DisplayName = _Prefix + nameof(ConvertsAsFirstMatchingType))] public void ConvertsAsFirstMatchingType() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( union: new UnionTypeReference(new[] { new TypeReference(primitive: PrimitiveType.String), new TypeReference(primitive: PrimitiveType.Number) }) - ); + )); - bool success = _converter.TryConvert(reference, _referenceMap, (ushort)7, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, (ushort)7, out object actual); Assert.True(success); Assert.IsType(actual); @@ -548,13 +540,13 @@ public void ConvertsAsFirstMatchingType() [Fact(DisplayName = _Prefix + nameof(ConvertsNull))] public void ConvertsNull() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( union: new UnionTypeReference(new[] { new TypeReference(primitive: PrimitiveType.String) }) - ); + )); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.True(success); Assert.Null(actual); @@ -568,9 +560,9 @@ public class Any : TestBase [Fact(DisplayName = _Prefix + nameof(ConvertsNull))] public void ConvertsNull() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Any); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Any)); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.True(success); Assert.Null(actual); @@ -582,9 +574,9 @@ public void ConvertsNull() [InlineData(true, true)] public void ConvertsPrimitive(object value, object expected) { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Any); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Any)); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.Equal(expected, actual); @@ -593,10 +585,10 @@ public void ConvertsPrimitive(object value, object expected) [Fact(DisplayName = _Prefix + nameof(ConvertsDate))] public void ConvertsDate() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Any); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Any)); DateTime now = DateTime.Now; - bool success = _converter.TryConvert(reference, _referenceMap, now, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, now, out object actual); Assert.True(success); Assert.IsType(actual); @@ -611,10 +603,10 @@ public void ConvertsDate() [Fact(DisplayName = _Prefix + nameof(ConvertsJson))] public void ConvertsJson() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Any); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Any)); JObject value = new JObject(new JProperty("myKey", "myValue")); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.Same(value, actual); @@ -623,13 +615,13 @@ public void ConvertsJson() [Fact(DisplayName = _Prefix + nameof(ConvertsMap))] public void ConvertsMap() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Any); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Any)); IDictionary value = new Dictionary { { "myKey", "myValue" } }; - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.IsType(actual); @@ -646,10 +638,10 @@ public void ConvertsMap() [Fact(DisplayName = _Prefix + nameof(ConvertsArray))] public void ConvertsArray() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Any); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Any)); string[] value = new[] { "myValue" }; - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.IsType(actual); diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/JsiiToFrameworkConverterTests.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/JsiiToFrameworkConverterTests.cs index fb63169865..485775a49a 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/JsiiToFrameworkConverterTests.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/JsiiToFrameworkConverterTests.cs @@ -35,8 +35,10 @@ public TestBase() IServiceProvider serviceProvider = serviceCollection.BuildServiceProvider(); ServiceContainer.ServiceProviderOverride = serviceProvider; - _typeCache.GetFrameworkType(Arg.Is(r => r.Primitive == PrimitiveType.Any)).Returns(typeof(object)); - _typeCache.GetFrameworkType(Arg.Is(r => r.Primitive == PrimitiveType.String)).Returns(typeof(string)); + _typeCache.GetFrameworkType(Arg.Is(r => r.Primitive == PrimitiveType.Any), Arg.Any()) + .Returns(typeof(object)); + _typeCache.GetFrameworkType(Arg.Is(r => r.Primitive == PrimitiveType.String), false) + .Returns(typeof(string)); } } @@ -97,14 +99,14 @@ public class Primitive : TestBase [InlineData(PrimitiveType.String, null, null, true)] public void ConvertsPrimitiveValues(PrimitiveType primitive, object value, object expected, bool isOptional) { - TypeReference reference = new TypeReference(primitive: primitive, isOptional: isOptional); + var instance = new OptionalValue(new TypeReference(primitive: primitive), isOptional: isOptional); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.Equal(expected, actual); - success = _converter.TryConvert(reference, _referenceMap, new JValue(value), out actual); + success = _converter.TryConvert(instance, _referenceMap, new JValue(value), out actual); Assert.True(success); Assert.Equal(expected, actual); @@ -113,16 +115,16 @@ public void ConvertsPrimitiveValues(PrimitiveType primitive, object value, objec [Fact(DisplayName = _Prefix + nameof(ConvertsDateValues))] public void ConvertsDateValues() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Date); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Date)); DateTime now = DateTime.Now; JObject value = new JObject(new JProperty("$jsii.date", now)); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.Equal(now, actual); - success = _converter.TryConvert(reference, _referenceMap, null, out actual); + success = _converter.TryConvert(instance, _referenceMap, null, out actual); Assert.False(success); Assert.Null(actual); } @@ -130,20 +132,16 @@ public void ConvertsDateValues() [Fact(DisplayName = _Prefix + nameof(ConvertsOptionalDateValues))] public void ConvertsOptionalDateValues() { - TypeReference reference = new TypeReference - ( - primitive: PrimitiveType.Date, - isOptional: true - ); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Date), isOptional: true); DateTime now = DateTime.Now; JObject value = new JObject(new JProperty("$jsii.date", now)); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.Equal(now, actual); - success = _converter.TryConvert(reference, _referenceMap, null, out actual); + success = _converter.TryConvert(instance, _referenceMap, null, out actual); Assert.True(success); Assert.Null(actual); } @@ -151,7 +149,7 @@ public void ConvertsOptionalDateValues() [Fact(DisplayName = _Prefix + nameof(ConvertsJsonValues))] public void ConvertsJsonValues() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Json); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Json)); JObject jObject = new JObject( new JProperty("myArray", new JArray( @@ -167,7 +165,7 @@ public void ConvertsJsonValues() )) ); - bool success = _converter.TryConvert(reference, _referenceMap, jObject, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, jObject, out object actual); Assert.True(success); Assert.Same(jObject, actual); @@ -176,9 +174,9 @@ public void ConvertsJsonValues() [Fact(DisplayName = _Prefix + nameof(FailsOnNullBoolean))] public void FailsOnNullBoolean() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Boolean); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Boolean)); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.False(success); } @@ -186,9 +184,9 @@ public void FailsOnNullBoolean() [Fact(DisplayName = _Prefix + nameof(FailsOnNullNumber))] public void FailsOnNullNumber() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Number); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Number)); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.False(success); } @@ -196,9 +194,9 @@ public void FailsOnNullNumber() [Fact(DisplayName = _Prefix + nameof(ConvertsNullJson))] public void ConvertsNullJson() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Json); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Json)); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.True(success); Assert.Null(actual); @@ -218,7 +216,7 @@ public FullyQualifiedName() [Fact(DisplayName = _Prefix + nameof(ConvertsClassReference))] public void ConvertsClassReference() { - TypeReference reference = new TypeReference("myClassFqn"); + var instance = new OptionalValue(new TypeReference("myClassFqn")); JObject byRef = new JObject(new JProperty("$jsii.byref", "myClassFqn@0001")); TestClass testClass = new TestClass(new ByRefValue("myClassFqn", "0001")); @@ -226,7 +224,7 @@ public void ConvertsClassReference() .GetOrCreateNativeReference(Arg.Is(v => v.Value == "myClassFqn@0001")) .Returns(testClass); - bool success = _converter.TryConvert(reference, _referenceMap, byRef, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, byRef, out object actual); Assert.True(success); Assert.Same(actual, testClass); @@ -237,10 +235,10 @@ public void ConvertsClassReference() [Fact(DisplayName = _Prefix + nameof(ConvertsEnumValue))] public void ConvertsEnumValue() { - TypeReference reference = new TypeReference("myEnumFqn"); + var instance = new OptionalValue(new TypeReference("myEnumFqn")); JObject enumValue = new JObject(new JProperty("$jsii.enum", "myEnumFqn/MyMember1")); - bool success = _converter.TryConvert(reference, _referenceMap, enumValue, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, enumValue, out object actual); Assert.True(success); Assert.Equal(TestEnum.MyMember1, actual); @@ -249,9 +247,9 @@ public void ConvertsEnumValue() [Fact(DisplayName = _Prefix + nameof(ConvertsNullClassReference))] public void ConvertsNullClassReference() { - TypeReference reference = new TypeReference("myClassFqn"); + var instance = new OptionalValue(new TypeReference("myClassFqn")); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.True(success); Assert.Null(actual); @@ -260,9 +258,9 @@ public void ConvertsNullClassReference() [Fact(DisplayName = _Prefix + nameof(DoesNotConvertNullNonOptionalEnumValue))] public void DoesNotConvertNullNonOptionalEnumValue() { - TypeReference reference = new TypeReference("myEnumFqn"); + var instance = new OptionalValue(new TypeReference("myEnumFqn")); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.False(success); Assert.Null(actual); @@ -271,9 +269,9 @@ public void DoesNotConvertNullNonOptionalEnumValue() [Fact(DisplayName = _Prefix + nameof(ConvertsNullOptionalEnumValue))] public void ConvertsNullOptionalEnumValue() { - TypeReference reference = new TypeReference("myEnumFqn", isOptional: true); + var instance = new OptionalValue(new TypeReference("myEnumFqn"), isOptional: true); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.True(success); Assert.Null(actual); @@ -290,32 +288,32 @@ public Collection() r.Collection != null && r.Collection.Kind == CollectionKind.Array && r.Collection.ElementType.Primitive == PrimitiveType.String - )) + ), false) .Returns(typeof(string[])); _typeCache.GetFrameworkType(Arg.Is(r => r.Collection != null && r.Collection.Kind == CollectionKind.Map && r.Collection.ElementType.Primitive == PrimitiveType.String - )) + ), false) .Returns(typeof(IDictionary)); } [Fact(DisplayName = _Prefix + nameof(ConvertsMap))] public void ConvertsMap() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( collection: new CollectionTypeReference(CollectionKind.Map, new TypeReference(primitive: PrimitiveType.String) ) - ); + )); JObject value = new JObject( new JProperty("myKey1", "myValue1"), new JProperty("myKey2", "myValue2") ); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.IsAssignableFrom>(actual); @@ -336,7 +334,7 @@ public void ConvertsMap() [Fact(DisplayName = _Prefix + nameof(RecursivelyConvertsMapElements))] public void RecursivelyConvertsMapElements() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( collection: new CollectionTypeReference(CollectionKind.Map, new TypeReference( collection: new CollectionTypeReference(CollectionKind.Map, @@ -344,7 +342,7 @@ public void RecursivelyConvertsMapElements() ) ) ) - ); + )); JObject value = new JObject( new JProperty("myKey1", new JObject( @@ -355,7 +353,7 @@ public void RecursivelyConvertsMapElements() )) ); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.IsAssignableFrom>>(actual); @@ -388,18 +386,18 @@ public void RecursivelyConvertsMapElements() [Fact(DisplayName = _Prefix + nameof(ConvertsArray))] public void ConvertsArray() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( collection: new CollectionTypeReference(CollectionKind.Array, new TypeReference(primitive: PrimitiveType.String) ) - ); + )); JArray value = new JArray( new JValue("myValue1"), new JValue("myValue2") ); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.IsType(actual); @@ -412,7 +410,7 @@ public void ConvertsArray() [Fact(DisplayName = _Prefix + nameof(RecursivelyConvertsArrayElements))] public void RecursivelyConvertsArrayElements() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( collection: new CollectionTypeReference(CollectionKind.Array, new TypeReference( collection: new CollectionTypeReference(CollectionKind.Array, @@ -420,14 +418,14 @@ public void RecursivelyConvertsArrayElements() ) ) ) - ); + )); JArray value = new JArray( new JArray(new JValue("myValue1")), new JArray(new JValue("myValue2")) ); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.IsType(actual); @@ -444,13 +442,13 @@ public void RecursivelyConvertsArrayElements() [Fact(DisplayName = _Prefix + nameof(ConvertsNullMap))] public void ConvertsNullMap() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( collection: new CollectionTypeReference(CollectionKind.Map, new TypeReference(primitive: PrimitiveType.String) ) - ); + )); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.True(success); Assert.Null(actual); @@ -459,13 +457,13 @@ public void ConvertsNullMap() [Fact(DisplayName = _Prefix + nameof(ConvertsNullArray))] public void ConvertsNullArray() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( collection: new CollectionTypeReference(CollectionKind.Array, new TypeReference(primitive: PrimitiveType.String) ) - ); + )); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.True(success); Assert.Null(actual); @@ -479,15 +477,15 @@ public class Union : TestBase [Fact(DisplayName = _Prefix + nameof(FailsIfNoTypeMatches))] public void FailsIfNoTypeMatches() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( union: new UnionTypeReference(new[] { new TypeReference(primitive: PrimitiveType.String), new TypeReference(primitive: PrimitiveType.Number) }) - ); + )); JValue value = new JValue(true); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.False(success); Assert.Null(actual); @@ -496,14 +494,14 @@ public void FailsIfNoTypeMatches() [Fact(DisplayName = _Prefix + nameof(ConvertsSimpleUnion))] public void ConvertsSimpleUnion() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( union: new UnionTypeReference(new[] { new TypeReference(primitive: PrimitiveType.String) }) - ); + )); JValue value = new JValue("abc"); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.Equal("abc", actual); @@ -512,15 +510,15 @@ public void ConvertsSimpleUnion() [Fact(DisplayName = _Prefix + nameof(ConvertsAsFirstMatchingType))] public void ConvertsAsFirstMatchingType() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( union: new UnionTypeReference(new[] { new TypeReference(primitive: PrimitiveType.String), new TypeReference(primitive: PrimitiveType.Number) }) - ); + )); JValue value = new JValue((ushort)7); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.IsType(actual); @@ -530,13 +528,13 @@ public void ConvertsAsFirstMatchingType() [Fact(DisplayName = _Prefix + nameof(ConvertsNull))] public void ConvertsNull() { - TypeReference reference = new TypeReference( + var instance = new OptionalValue(new TypeReference( union: new UnionTypeReference(new[] { new TypeReference(primitive: PrimitiveType.String) }) - ); + )); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.True(success); Assert.Null(actual); @@ -550,9 +548,9 @@ public class Any : TestBase [Fact(DisplayName = _Prefix + nameof(ConvertsNull))] public void ConvertsNull() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Any); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Any)); - bool success = _converter.TryConvert(reference, _referenceMap, null, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, null, out object actual); Assert.True(success); Assert.Null(actual); @@ -564,9 +562,9 @@ public void ConvertsNull() [InlineData(true, true)] public void ConvertsPrimitive(object value, object expected) { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Any); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Any)); - bool success = _converter.TryConvert(reference, _referenceMap, new JValue(value), out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, new JValue(value), out object actual); Assert.True(success); Assert.Equal(expected, actual); @@ -575,14 +573,14 @@ public void ConvertsPrimitive(object value, object expected) [Fact(DisplayName = _Prefix + nameof(ConvertsDate))] public void ConvertsDate() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Any); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Any)); DateTime now = DateTime.Now; JObject value = new JObject( new JProperty("$jsii.date", now) ); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.Equal(now, actual); @@ -593,10 +591,10 @@ public void ConvertsJson() { // We can't distinguish between generic JSON and JSII maps, so we treat // all unrecognized JObjects as maps. - TypeReference reference = new TypeReference(primitive: PrimitiveType.Any); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Any)); JObject value = new JObject(new JProperty("myKey", "myValue")); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.IsAssignableFrom>(actual); @@ -614,10 +612,10 @@ public void ConvertsMap() { // We can't distinguish between generic JSON and JSII maps, so we treat // all unrecognized JObjects as maps. - TypeReference reference = new TypeReference(primitive: PrimitiveType.Any); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Any)); JObject value = new JObject(new JProperty("myKey", "myValue")); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.IsAssignableFrom>(actual); @@ -633,10 +631,10 @@ public void ConvertsMap() [Fact(DisplayName = _Prefix + nameof(ConvertsArray))] public void ConvertsArray() { - TypeReference reference = new TypeReference(primitive: PrimitiveType.Any); + var instance = new OptionalValue(new TypeReference(primitive: PrimitiveType.Any)); JArray value = new JArray(new JValue("myValue")); - bool success = _converter.TryConvert(reference, _referenceMap, value, out object actual); + bool success = _converter.TryConvert(instance, _referenceMap, value, out object actual); Assert.True(success); Assert.IsAssignableFrom(actual); diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj index 992e8b7aee..2e397c0559 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj @@ -19,4 +19,5 @@ + diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/CallbackExtensions.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/CallbackExtensions.cs index fef3002435..ec9d22f44d 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/CallbackExtensions.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/CallbackExtensions.cs @@ -20,7 +20,7 @@ public static object InvokeCallback(this Callback callback, IReferenceMap refere CallbackResult frameworkResult = callback.InvokeCallbackCore(referenceMap); converter.TryConvert( - frameworkResult?.Type ?? new TypeReference(primitive: PrimitiveType.Any), + frameworkResult, referenceMap, frameworkResult?.Value, out object result @@ -77,7 +77,10 @@ static CallbackResult InvokeMethod(InvokeRequest request, IReferenceMap referenc } JsiiMethodAttribute attribute = methodInfo.GetCustomAttribute(); - return new CallbackResult(attribute?.Returns, methodInfo.Invoke(deputy, request.Arguments.Select(arg => FromKernel(arg, referenceMap)).ToArray())); + return new CallbackResult( + attribute?.Returns, + methodInfo.Invoke(deputy, request.Arguments.Select(arg => FromKernel(arg, referenceMap)).ToArray()) + ); } static CallbackResult InvokeGetter(GetRequest request, IReferenceMap referenceMap) @@ -99,7 +102,7 @@ static CallbackResult InvokeGetter(GetRequest request, IReferenceMap referenceMa throw new InvalidOperationException($"Received callback for {deputy.GetType().Name}.{request.Property} getter, but this property does not have a getter"); } - return new CallbackResult(attribute?.Type, methodInfo.Invoke(deputy, new object[] { })); + return new CallbackResult(attribute, methodInfo.Invoke(deputy, new object[] { })); } static void InvokeSetter(SetRequest request, IReferenceMap referenceMap) @@ -140,15 +143,16 @@ private static object FromKernel(object obj, IReferenceMap referenceMap) } } - internal class CallbackResult + internal class CallbackResult : OptionalValue { - public CallbackResult(TypeReference type, object value) + public CallbackResult(IOptionalValue optionalValue, object value) + : this(optionalValue?.Type, optionalValue?.IsOptional ?? false, value) {} + + private CallbackResult(TypeReference type, bool isOptional, object value): base(type, isOptional) { - Type = type; Value = value; } - public TypeReference Type { get; } public object Value { get; } } } diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/DeputyBase.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/DeputyBase.cs index bf04054421..b50d56d347 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/DeputyBase.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/DeputyBase.cs @@ -138,7 +138,7 @@ static T GetPropertyCore(JsiiPropertyAttribute propertyAttribute, Func(); IReferenceMap referenceMap = serviceProvider.GetRequiredService(); - if (!converter.TryConvert(propertyAttribute.Type, referenceMap, response.Value, out object frameworkValue)) + if (!converter.TryConvert(propertyAttribute, referenceMap, response.Value, out object frameworkValue)) { throw new ArgumentException($"Could not convert value '{response.Value}' for property '{propertyAttribute.Name}'", nameof(getFunc)); } @@ -183,7 +183,7 @@ static void SetPropertyCore(T value, JsiiPropertyAttribute propertyAttribute, IServiceProvider serviceProvider = ServiceContainer.ServiceProvider; IFrameworkToJsiiConverter converter = serviceProvider.GetRequiredService(); IReferenceMap referenceMap = serviceProvider.GetRequiredService(); - if (!converter.TryConvert(propertyAttribute.Type, referenceMap, value, out object jsiiValue)) + if (!converter.TryConvert(propertyAttribute, referenceMap, value, out object jsiiValue)) { throw new ArgumentException($"Could not set property '{propertyAttribute.Name}' to '{value}'", nameof(value)); } @@ -267,7 +267,7 @@ object GetResult() { object[] args = ConvertArguments(methodAttribute.Parameters, arguments); - if (methodAttribute.Returns?.IsPromise == true) + if (methodAttribute.IsAsync) { BeginResponse beginResponse = beginFunc(client, args); @@ -326,7 +326,7 @@ static object[] ConvertArguments(Parameter[] parameters, params object[] argumen return parameters.Zip(arguments, (parameter, frameworkArgument) => { - if (!converter.TryConvert(parameter.Type, referenceMap, frameworkArgument, out object jsiiArgument)) + if (!converter.TryConvert(parameter, referenceMap, frameworkArgument, out object jsiiArgument)) { throw new ArgumentException($"Could not convert argument '{frameworkArgument}' to Jsii", nameof(arguments)); } diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiClassAttribute.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiClassAttribute.cs index 64fd32b7f6..7d340514e1 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiClassAttribute.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiClassAttribute.cs @@ -7,11 +7,12 @@ namespace Amazon.JSII.Runtime.Deputy [AttributeUsage(AttributeTargets.Class, Inherited = false)] public class JsiiClassAttribute : JsiiTypeAttributeBase { - public JsiiClassAttribute(System.Type nativeType, string fullyQualifiedName, string parametersJson) + public JsiiClassAttribute(System.Type nativeType, string fullyQualifiedName, string parametersJson = null) : base(nativeType, fullyQualifiedName) { - parametersJson = parametersJson ?? throw new ArgumentNullException(nameof(parametersJson)); - Parameters = JsonConvert.DeserializeObject(parametersJson); + Parameters = parametersJson == null + ? new Parameter[]{} + : JsonConvert.DeserializeObject(parametersJson); } public Parameter[] Parameters diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiEnumAttribute.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiEnumAttribute.cs index a2f2c3fd44..538015b921 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiEnumAttribute.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiEnumAttribute.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Runtime.Deputy { - [AttributeUsage(AttributeTargets.Enum, Inherited = false)] + [AttributeUsage(AttributeTargets.Enum)] public class JsiiEnumAttribute : JsiiTypeAttributeBase { public JsiiEnumAttribute(Type nativeType, string fullyQualifiedName) diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiInterfaceAttribute.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiInterfaceAttribute.cs index 508874ea7b..9f478297e2 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiInterfaceAttribute.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiInterfaceAttribute.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Runtime.Deputy { - [AttributeUsage(AttributeTargets.Interface, Inherited = false)] + [AttributeUsage(AttributeTargets.Interface)] public class JsiiInterfaceAttribute : JsiiTypeAttributeBase { public JsiiInterfaceAttribute(Type nativeType, string fullyQualifiedName) diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiMethodAttribute.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiMethodAttribute.cs index fb820e4f91..70df8b9e5f 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiMethodAttribute.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiMethodAttribute.cs @@ -7,22 +7,33 @@ namespace Amazon.JSII.Runtime.Deputy [AttributeUsage(AttributeTargets.Method)] public class JsiiMethodAttribute : Attribute { - public JsiiMethodAttribute(string name, string returnsJson, string parametersJson, bool isOverride = false) + public JsiiMethodAttribute( + string name, + string returnsJson = null, + string parametersJson = null, + bool isAsync = false, + bool isOverride = false) { Name = name ?? throw new ArgumentNullException(nameof(name)); - Returns = returnsJson == null ? - null : - JsonConvert.DeserializeObject(returnsJson); - Parameters = JsonConvert.DeserializeObject(parametersJson ?? throw new ArgumentNullException(nameof(parametersJson))); + Returns = returnsJson == null + ? null + : JsonConvert.DeserializeObject(returnsJson); + Parameters = parametersJson == null + ? new Parameter[] {} + : JsonConvert.DeserializeObject(parametersJson); + IsAsync = isAsync; IsOverride = isOverride; } public string Name { get; } - public TypeReference Returns { get; } + public OptionalValue Returns { get; } public Parameter[] Parameters { get; } + + public bool IsAsync { get; } + public bool IsOverride { get; } } } diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiPropertyAttribute.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiPropertyAttribute.cs index 4bff9c767e..534fe40e3a 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiPropertyAttribute.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiPropertyAttribute.cs @@ -5,12 +5,13 @@ namespace Amazon.JSII.Runtime.Deputy { [AttributeUsage(AttributeTargets.Property)] - public class JsiiPropertyAttribute : Attribute + public class JsiiPropertyAttribute : Attribute, IOptionalValue { - public JsiiPropertyAttribute(string name, string typeJson, bool isOverride = false) + public JsiiPropertyAttribute(string name, string typeJson, bool isOptional = false, bool isOverride = false) { Name = name ?? throw new ArgumentNullException(nameof(name)); Type = JsonConvert.DeserializeObject(typeJson ?? throw new ArgumentNullException(nameof(typeJson))); + IsOptional = isOptional; IsOverride = isOverride; } @@ -18,6 +19,8 @@ public JsiiPropertyAttribute(string name, string typeJson, bool isOverride = fal public TypeReference Type { get; } + public bool IsOptional { get; } + public bool IsOverride { get; } } } diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/FrameworkToJsiiConverter.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/FrameworkToJsiiConverter.cs index 5eed9a1641..8d5f2e1e50 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/FrameworkToJsiiConverter.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/FrameworkToJsiiConverter.cs @@ -59,7 +59,7 @@ protected override bool TryConvertClass(IReferenceMap referenceMap, object value continue; } - if (!TryConvert(jsiiProperty.Type, referenceMap, propValue, out var convertedPropValue) || convertedPropValue == null) + if (!TryConvert(jsiiProperty, referenceMap, propValue, out var convertedPropValue) || convertedPropValue == null) { continue; } @@ -330,8 +330,8 @@ TypeReference InferType(IReferenceMap referenceMap, Type type) ( collection: new CollectionTypeReference ( - CollectionKind.Array, - InferType(referenceMap, type.GetElementType()) + kind: CollectionKind.Array, + elementType: InferType(referenceMap, type.GetElementType()) ) ); } @@ -350,8 +350,8 @@ TypeReference InferType(IReferenceMap referenceMap, Type type) ( collection: new CollectionTypeReference ( - CollectionKind.Map, - InferType(referenceMap, elementType) + kind: CollectionKind.Map, + elementType: InferType(referenceMap, elementType) ) ); } diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/IFrameworkToJsiiConverter.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/IFrameworkToJsiiConverter.cs index 16085340df..d0d6161c5d 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/IFrameworkToJsiiConverter.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/IFrameworkToJsiiConverter.cs @@ -5,6 +5,6 @@ namespace Amazon.JSII.Runtime.Services.Converters { public interface IFrameworkToJsiiConverter { - bool TryConvert(TypeReference typeReference, IReferenceMap referenceMap, object value, out object result); + bool TryConvert(IOptionalValue optionalValue, IReferenceMap referenceMap, object value, out object result); } } diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/IJsiiToFrameworkConverter.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/IJsiiToFrameworkConverter.cs index a139652503..bf129d6b0d 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/IJsiiToFrameworkConverter.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/IJsiiToFrameworkConverter.cs @@ -4,6 +4,6 @@ namespace Amazon.JSII.Runtime.Services.Converters { public interface IJsiiToFrameworkConverter { - bool TryConvert(TypeReference typeReference, IReferenceMap referenceMap, object value, out object result); + bool TryConvert(IOptionalValue optionalValue, IReferenceMap referenceMap, object value, out object result); } } diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/JsiiToFrameworkConverter.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/JsiiToFrameworkConverter.cs index c5827e1b66..d25235e4a6 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/JsiiToFrameworkConverter.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/JsiiToFrameworkConverter.cs @@ -183,7 +183,7 @@ protected override bool TryConvertString(object value, out object result) return false; } - protected override bool TryConvertArray(IReferenceMap referenceMap, TypeReference elementTypeReference, object value, out object result) + protected override bool TryConvertArray(IReferenceMap referenceMap, TypeReference elementTypeInstance, object value, out object result) { if (value == null || (value as JToken)?.Type == JTokenType.Null) { @@ -193,12 +193,12 @@ protected override bool TryConvertArray(IReferenceMap referenceMap, TypeReferenc if (value is JArray array) { - System.Type elementType = _types.GetFrameworkType(elementTypeReference); + System.Type elementType = _types.GetFrameworkType(elementTypeInstance, false); Array resultArray = Array.CreateInstance(elementType, array.Count); for (int i = 0; i < array.Count; i++) { - if (!TryConvert(elementTypeReference, referenceMap, array[i], out object convertedElement)) + if (!TryConvert(elementTypeInstance, referenceMap, array[i], out object convertedElement)) { throw new ArgumentException("Could not convert all elements of array", nameof(value)); } @@ -214,7 +214,7 @@ protected override bool TryConvertArray(IReferenceMap referenceMap, TypeReferenc return false; } - protected override bool TryConvertMap(IReferenceMap referenceMap, TypeReference elementTypeReference, object value, out object result) + protected override bool TryConvertMap(IReferenceMap referenceMap, TypeReference elementTypeInstance, object value, out object result) { if (value == null || (value as JToken)?.Type == JTokenType.Null) { @@ -224,7 +224,7 @@ protected override bool TryConvertMap(IReferenceMap referenceMap, TypeReference if (value is JObject jsonObject) { - System.Type elementType = _types.GetFrameworkType(elementTypeReference); + System.Type elementType = _types.GetFrameworkType(elementTypeInstance, false); System.Type dictionaryType = typeof(Dictionary<,>).MakeGenericType(typeof(string), elementType); ConstructorInfo dictionaryConstructor = dictionaryType.GetConstructor(new System.Type[] { }); @@ -233,7 +233,7 @@ protected override bool TryConvertMap(IReferenceMap referenceMap, TypeReference foreach (JProperty property in jsonObject.Properties()) { - if (!TryConvert(elementTypeReference, referenceMap, property.Value, out object convertedElement)) + if (!TryConvert(elementTypeInstance, referenceMap, property.Value, out object convertedElement)) { throw new ArgumentException("Could not convert all elements of map", nameof(value)); } @@ -286,8 +286,8 @@ protected override TypeReference InferType(IReferenceMap referenceMap, object va ( collection: new CollectionTypeReference ( - CollectionKind.Array, - new TypeReference(primitive: PrimitiveType.Any) + kind: CollectionKind.Array, + elementType: new TypeReference(primitive: PrimitiveType.Any) ) ); diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/ValueConverter.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/ValueConverter.cs index 48706a0b18..7fcbd92c39 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/ValueConverter.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/ValueConverter.cs @@ -13,36 +13,39 @@ protected ValueConverter(ITypeCache types) _types = types ?? throw new ArgumentNullException(nameof(types)); } - public bool TryConvert(TypeReference typeReference, IReferenceMap referenceMap, object value, out object result) + protected bool TryConvert(TypeReference typeReference, IReferenceMap referenceMap, object value, out object result) { - if (typeReference == null) + return TryConvert(new OptionalValue(typeReference), referenceMap, value, out result); + } + + public bool TryConvert(IOptionalValue optionalValue, IReferenceMap referenceMap, object value, out object result) + { + if (optionalValue == null) { return TryConvertVoid(value, out result); } - bool isOptional = typeReference.IsOptional == true; - - if (typeReference.FullyQualifiedName != null) + if (optionalValue.Type.FullyQualifiedName != null) { - return TryConvertCustomType(referenceMap, value, isOptional, typeReference.FullyQualifiedName, out result); + return TryConvertCustomType(referenceMap, value, optionalValue.IsOptional, optionalValue.Type.FullyQualifiedName, out result); } - if (typeReference.Primitive != null) + if (optionalValue.Type.Primitive != null) { - return TryConvertPrimitive(referenceMap, value, isOptional, typeReference.Primitive.Value, out result); + return TryConvertPrimitive(referenceMap, value, optionalValue.IsOptional, optionalValue.Type.Primitive.Value, out result); } - if (typeReference.Collection != null) + if (optionalValue.Type.Collection != null) { - return TryConvertCollection(referenceMap, value, isOptional, typeReference.Collection, out result); + return TryConvertCollection(referenceMap, value, optionalValue.IsOptional, optionalValue.Type.Collection, out result); } - if (typeReference.Union != null) + if (optionalValue.Type.Union != null) { - return TryConvertUnion(referenceMap, value, isOptional, typeReference.Union, out result); + return TryConvertUnion(referenceMap, value, optionalValue.IsOptional, optionalValue.Type.Union, out result); } - throw new ArgumentException("Invalid type reference", nameof(typeReference)); + throw new ArgumentException("Invalid type reference", nameof(optionalValue)); } protected bool IsNumeric(System.Type type) diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/ITypeCache.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/ITypeCache.cs index b5c86bb9b1..d6acd137d2 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/ITypeCache.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/ITypeCache.cs @@ -1,4 +1,5 @@ -using System; +using Amazon.JSII.JsonModel.Spec; +using Type = System.Type; namespace Amazon.JSII.Runtime.Services { @@ -12,6 +13,6 @@ public interface ITypeCache Type GetProxyType(string fullyQualifiedName); - Type GetFrameworkType(JsonModel.Spec.TypeReference reference); + Type GetFrameworkType(TypeReference reference, bool isOptional); } } diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/TypeCache.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/TypeCache.cs index 932df17336..813cdd7cee 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/TypeCache.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/TypeCache.cs @@ -49,30 +49,33 @@ public Type GetProxyType(string fullyQualifiedName) return GetType(fullyQualifiedName + ProxySuffix); } - public Type GetFrameworkType(TypeReference reference) + public Type GetFrameworkType(IOptionalValue instance) { - bool isOptional = reference.IsOptional == true; - - if (reference.FullyQualifiedName != null) + return GetFrameworkType(instance?.Type, instance?.IsOptional ?? false); + } + + public Type GetFrameworkType(TypeReference typeReference, bool isOptional) + { + if (typeReference.FullyQualifiedName != null) { - Type classType = GetClassType(reference.FullyQualifiedName); + Type classType = GetClassType(typeReference.FullyQualifiedName); if (classType != null) { return classType; } - Type enumType = GetEnumType(reference.FullyQualifiedName); + Type enumType = GetEnumType(typeReference.FullyQualifiedName); if (enumType != null) { return MakeNullableIfOptional(enumType); } - throw new ArgumentException("Type reference has a fully qualified name, but is neither a class nor an enum", nameof(reference)); + throw new ArgumentException("Type reference has a fully qualified name, but is neither a class nor an enum", nameof(typeReference)); } - if (reference.Primitive != null) + if (typeReference.Primitive != null) { - switch (reference.Primitive) + switch (typeReference.Primitive) { case PrimitiveType.Any: return typeof(object); @@ -87,31 +90,31 @@ public Type GetFrameworkType(TypeReference reference) case PrimitiveType.String: return typeof(string); default: - throw new ArgumentException($"Unknown primitive type {reference.Primitive}", nameof(reference)); + throw new ArgumentException($"Unknown primitive type {typeReference.Primitive}", nameof(typeReference)); } } - if (reference.Collection != null) + if (typeReference.Collection != null) { - Type elementType = GetFrameworkType(reference.Collection.ElementType); - switch (reference.Collection.Kind) + Type elementType = GetFrameworkType(typeReference.Collection.ElementType, false); + switch (typeReference.Collection.Kind) { case CollectionKind.Array: return elementType.MakeArrayType(); case CollectionKind.Map: return typeof(IDictionary<,>).MakeGenericType(typeof(string), elementType); default: - throw new ArgumentException($"Unknown collection kind {reference.Collection.Kind}", nameof(reference)); + throw new ArgumentException($"Unknown collection kind {typeReference.Collection.Kind}", nameof(typeReference)); } } - if (reference.Union != null) + if (typeReference.Union != null) { return typeof(object); } - throw new ArgumentException("Invalid type reference", nameof(reference)); + throw new ArgumentException("Invalid type reference", nameof(typeReference)); Type MakeNullableIfOptional(Type type) { diff --git a/packages/jsii-java-runtime/package-lock.json b/packages/jsii-java-runtime/package-lock.json index c3f5ff4224..630c03b667 100644 --- a/packages/jsii-java-runtime/package-lock.json +++ b/packages/jsii-java-runtime/package-lock.json @@ -1,6 +1,6 @@ { "name": "jsii-java-runtime", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -11,9 +11,9 @@ "dev": true }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", "dev": true } } diff --git a/packages/jsii-java-runtime/package.json b/packages/jsii-java-runtime/package.json index d00bc82376..2f97189bf5 100644 --- a/packages/jsii-java-runtime/package.json +++ b/packages/jsii-java-runtime/package.json @@ -15,7 +15,7 @@ "@types/node": "^8.10.43", "jsii-build-tools": "^0.9.0", "jsii-runtime": "^0.9.0", - "typescript": "^3.2.4" + "typescript": "^3.4.2" }, "author": { "name": "Amazon Web Services", diff --git a/packages/jsii-kernel/lib/kernel.ts b/packages/jsii-kernel/lib/kernel.ts index c262a00532..5a1d54589b 100644 --- a/packages/jsii-kernel/lib/kernel.ts +++ b/packages/jsii-kernel/lib/kernel.ts @@ -8,7 +8,7 @@ import * as vm from 'vm'; import * as api from './api'; import { TOKEN_REF } from './api'; import { ObjectTable, tagJsiiConstructor } from './objects'; -import { CompleteTypeReference, EMPTY_OBJECT_FQN, serializationType, SerializerHost, SERIALIZERS } from './serialization'; +import wire = require('./serialization'); export class Kernel { /** @@ -160,7 +160,7 @@ export class Kernel { this._wrapSandboxCode(() => prototype[property])); this._debug('value:', value); - const ret = this._fromSandbox(value, ti.type); + const ret = this._fromSandbox(value, ti); this._debug('ret', ret); return { value: ret }; } @@ -182,7 +182,7 @@ export class Kernel { const prototype = this._findSymbol(fqn); this._ensureSync(`property ${property}`, () => - this._wrapSandboxCode(() => prototype[property] = this._toSandbox(value, ti.type))); + this._wrapSandboxCode(() => prototype[property] = this._toSandbox(value, ti))); return {}; } @@ -205,7 +205,7 @@ export class Kernel { const value = this._ensureSync(`property '${objref[TOKEN_REF]}.${propertyToGet}'`, () => this._wrapSandboxCode(() => instance[propertyToGet])); this._debug('value:', value); - const ret = this._fromSandbox(value, ti.type); + const ret = this._fromSandbox(value, ti); this._debug('ret:', ret); return { value: ret }; } @@ -224,7 +224,7 @@ export class Kernel { const propertyToSet = this._findPropertyTarget(instance, property); this._ensureSync(`property '${objref[TOKEN_REF]}.${propertyToSet}'`, - () => this._wrapSandboxCode(() => instance[propertyToSet] = this._toSandbox(value, propInfo.type))); + () => this._wrapSandboxCode(() => instance[propertyToSet] = this._toSandbox(value, propInfo))); return { }; } @@ -237,7 +237,7 @@ export class Kernel { const { ti, obj, fn } = this._findInvokeTarget(objref, method, args); // verify this is not an async method - if (ti.returns && ti.returns.promise) { + if (ti.async) { throw new Error(`${method} is an async method, use "begin" instead`); } @@ -264,7 +264,7 @@ export class Kernel { } // verify this is not an async method - if (ti.returns && ti.returns.promise) { + if (ti.async) { throw new Error(`${method} is an async method, use "begin" instead`); } @@ -293,7 +293,7 @@ export class Kernel { const { ti, obj, fn } = this._findInvokeTarget(objref, method, args); // verify this is indeed an async method - if (!ti.returns || !ti.returns.promise) { + if (!ti.async) { throw new Error(`Method ${method} is expected to be an async method`); } @@ -425,7 +425,7 @@ export class Kernel { // find the javascript constructor function for a jsii FQN. private _findCtor(fqn: string, args: any[]): { ctor: any, parameters?: spec.Parameter[] } { - if (fqn === EMPTY_OBJECT_FQN) { + if (fqn === wire.EMPTY_OBJECT_FQN) { return { ctor: Object }; } @@ -496,7 +496,7 @@ export class Kernel { private _applyPropertyOverride(obj: any, objref: api.ObjRef, typeFqn: string, override: api.PropertyOverride) { let propInfo; - if (typeFqn !== EMPTY_OBJECT_FQN) { + if (typeFqn !== wire.EMPTY_OBJECT_FQN) { // error if we can find a method with this name if (this._tryTypeInfoForMethod(typeFqn, override.property)) { throw new Error(`Trying to override method '${override.property}' as a property`); @@ -520,7 +520,7 @@ export class Kernel { // would tell us the intended interface type. propInfo = { name: override.property, - type: ANY_TYPE, + type: spec.CANONICAL_ANY, }; } @@ -560,14 +560,14 @@ export class Kernel { get: { objref, property: propertyName } }); this._debug('callback returned', result); - return this._toSandbox(result, propInfo.type); + return this._toSandbox(result, propInfo); }, set: (value: any) => { self._debug('virtual set', objref, propertyName, { cookie: override.cookie }); self.callbackHandler({ cookie: override.cookie, cbid: self._makecbid(), - set: { objref, property: propertyName, value: self._fromSandbox(value, propInfo.type) } + set: { objref, property: propertyName, value: self._fromSandbox(value, propInfo) } }); } }); @@ -575,7 +575,7 @@ export class Kernel { private _applyMethodOverride(obj: any, objref: api.ObjRef, typeFqn: string, override: api.MethodOverride) { let methodInfo; - if (typeFqn !== EMPTY_OBJECT_FQN) { + if (typeFqn !== wire.EMPTY_OBJECT_FQN) { // error if we can find a property with this name if (this._tryTypeInfoForProperty(typeFqn, override.method)) { throw new Error(`Trying to override property '${override.method}' as a method`); @@ -600,8 +600,12 @@ export class Kernel { // would tell us the intended interface type. methodInfo = { name: override.method, - returns: ANY_TYPE, - parameters: [{ name: 'args', variadic: true, type: ANY_TYPE}], + returns: { type: spec.CANONICAL_ANY }, + parameters: [{ + name: 'args', + type: spec.CANONICAL_ANY, + variadic: true + }], variadic: true }; } @@ -613,7 +617,7 @@ export class Kernel { const self = this; const methodName = override.method; - if (methodInfo.returns && methodInfo.returns.promise) { + if (methodInfo.async) { // async method override Object.defineProperty(obj, methodName, { enumerable: false, @@ -685,27 +689,7 @@ export class Kernel { return { ti, obj: instance, fn }; } - private _formatTypeRef(typeRef: spec.TypeReference): string { - if (spec.isCollectionTypeReference(typeRef)) { - return `${typeRef.collection.kind}<${this._formatTypeRef(typeRef.collection.elementtype)}>`; - } - - if (spec.isNamedTypeReference(typeRef)) { - return typeRef.fqn; - } - - if (spec.isPrimitiveTypeReference(typeRef)) { - return typeRef.primitive; - } - - if (spec.isUnionTypeReference(typeRef)) { - return typeRef.union.types.map(t => this._formatTypeRef(t)).join(' | '); - } - - throw new Error(`Invalid type reference: ${JSON.stringify(typeRef)}`); - } - - private _validateMethodArguments(method: spec.Method | undefined, args: any[]) { + private _validateMethodArguments(method: spec.Callable | undefined, args: any[]) { const params: spec.Parameter[] = (method && method.parameters) || []; // error if args > params @@ -720,14 +704,14 @@ export class Kernel { if (param.variadic) { if (params.length <= i) { return; } // No vararg was provided for (let j = i ; j < params.length ; j++) { - if (params[j] === undefined) { + if (!param.optional && params[j] === undefined) { // tslint:disable-next-line:max-line-length - throw new Error(`Unexpected 'undefined' value at index ${j - i} of variadic argument '${param.name}' of type '${this._formatTypeRef(param.type)}'`); + throw new Error(`Unexpected 'undefined' value at index ${j - i} of variadic argument '${param.name}' of type '${spec.describeTypeReference(param.type)}'`); } } - } else if (!param.type.optional && arg === undefined) { + } else if (!param.optional && arg === undefined) { // tslint:disable-next-line:max-line-length - throw new Error(`Not enough arguments. Missing argument for the required parameter '${param.name}' of type '${this._formatTypeRef(param.type)}'`); + throw new Error(`Not enough arguments. Missing argument for the required parameter '${param.name}' of type '${spec.describeTypeReference(param.type)}'`); } } } @@ -803,7 +787,7 @@ export class Kernel { for (const base of bases) { if (!base) { continue; } - const found = this._tryTypeInfoForMethod(base.fqn!, methodName); + const found = this._tryTypeInfoForMethod(base, methodName); if (found) { return found; } @@ -824,11 +808,11 @@ export class Kernel { if (spec.isClassType(typeInfo)) { const classTypeInfo = typeInfo as spec.ClassType; properties = classTypeInfo.properties; - bases = classTypeInfo.base ? [ classTypeInfo.base.fqn ] : []; + bases = classTypeInfo.base ? [ classTypeInfo.base ] : []; } else if (spec.isInterfaceType(typeInfo)) { const interfaceTypeInfo = typeInfo as spec.InterfaceType; properties = interfaceTypeInfo.properties; - bases = (interfaceTypeInfo.interfaces || []).map(x => x.fqn); + bases = interfaceTypeInfo.interfaces || []; } else { throw new Error(`Type of kind ${typeInfo.kind} does not have properties`); } @@ -858,11 +842,11 @@ export class Kernel { return typeInfo; } - private _toSandbox(v: any, expectedType: CompleteTypeReference): any { - const serTypes = serializationType(expectedType, this._typeInfoForFqn.bind(this)); + private _toSandbox(v: any, expectedType: wire.OptionalValueOrVoid): any { + const serTypes = wire.serializationType(expectedType, this._typeInfoForFqn.bind(this)); this._debug('toSandbox', v, JSON.stringify(serTypes)); - const host: SerializerHost = { + const host: wire.SerializerHost = { objects: this.objects, debug: this._debug.bind(this), findSymbol: this._findSymbol.bind(this), @@ -873,7 +857,7 @@ export class Kernel { const errors = new Array(); for (const { serializationClass, typeRef } of serTypes) { try { - return SERIALIZERS[serializationClass].deserialize(v, typeRef, host); + return wire.SERIALIZERS[serializationClass].deserialize(v, typeRef, host); } catch (e) { // If no union (99% case), rethrow immediately to preserve stack trace if (serTypes.length === 1) { throw e; } @@ -884,11 +868,11 @@ export class Kernel { throw new Error(`Value did not match any type in union: ${errors}`); } - private _fromSandbox(v: any, targetType: CompleteTypeReference): any { - const serTypes = serializationType(targetType, this._typeInfoForFqn.bind(this)); + private _fromSandbox(v: any, targetType: wire.OptionalValueOrVoid): any { + const serTypes = wire.serializationType(targetType, this._typeInfoForFqn.bind(this)); this._debug('fromSandbox', v, JSON.stringify(serTypes)); - const host: SerializerHost = { + const host: wire.SerializerHost = { objects: this.objects, debug: this._debug.bind(this), findSymbol: this._findSymbol.bind(this), @@ -899,7 +883,7 @@ export class Kernel { const errors = new Array(); for (const { serializationClass, typeRef } of serTypes) { try { - return SERIALIZERS[serializationClass].serialize(v, typeRef, host); + return wire.SERIALIZERS[serializationClass].serialize(v, typeRef, host); } catch (e) { // If no union (99% case), rethrow immediately to preserve stack trace if (serTypes.length === 1) { throw e; } @@ -918,17 +902,17 @@ export class Kernel { return this._boxUnboxParameters(xs, parameters, this._fromSandbox.bind(this)); } - private _boxUnboxParameters(xs: any[], parameters: spec.Parameter[] | undefined, boxUnbox: (x: any, t: CompleteTypeReference) => any) { - parameters = parameters || []; - const types = parameters.map(p => p.type); + private _boxUnboxParameters(xs: any[], parameters: spec.Parameter[] | undefined, boxUnbox: (x: any, t: wire.OptionalValueOrVoid) => any) { + parameters = [...(parameters || [])]; + const variadic = parameters.length > 0 && !!parameters[parameters.length - 1].variadic; // Repeat the last (variadic) type to match the number of actual arguments - while (types.length < xs.length && parameters.length > 0 && parameters[parameters.length - 1].variadic) { - types.push(types[types.length - 1]); + while (variadic && parameters.length < xs.length) { + parameters.push(parameters[parameters.length - 1]); } - if (xs.length > types.length) { - throw new Error(`Argument list (${JSON.stringify(xs)}) not same size as expected argument list (length ${types.length})`); + if (xs.length > parameters.length) { + throw new Error(`Argument list (${JSON.stringify(xs)}) not same size as expected argument list (length ${parameters.length})`); } - return xs.map((x, i) => boxUnbox(x, types[i])); + return xs.map((x, i) => boxUnbox(x, parameters![i])); } private _debug(...args: any[]) { @@ -1009,7 +993,7 @@ interface Callback { objref: api.ObjRef; override: api.MethodOverride; args: any[]; - expectedReturnType: CompleteTypeReference; + expectedReturnType: wire.OptionalValueOrVoid; // completion callbacks succeed: (...args: any[]) => any; @@ -1073,5 +1057,3 @@ function mapSource(err: Error, sourceMaps: { [assm: string]: SourceMapConsumer } return frame; } } - -const ANY_TYPE: spec.PrimitiveTypeReference = { primitive: spec.PrimitiveType.Any }; diff --git a/packages/jsii-kernel/lib/serialization.ts b/packages/jsii-kernel/lib/serialization.ts index f441c6e8d4..914a12cfd5 100644 --- a/packages/jsii-kernel/lib/serialization.ts +++ b/packages/jsii-kernel/lib/serialization.ts @@ -48,9 +48,9 @@ import { hiddenMap, jsiiTypeFqn, objectReference, ObjectTable } from './objects' export type Void = 'void'; /** - * A type reference that includes the special type reference Void + * A type instance, or Void */ -export type CompleteTypeReference = spec.TypeReference | Void; +export type OptionalValueOrVoid = spec.OptionalValue | Void; /** * A special FQN that can be used to create empty javascript objects. @@ -73,20 +73,20 @@ export const enum SerializationClass { Any = 'Any', } -type TypeLookup = (fqn: string) => spec.Type; -type SymbolLookup = (fqn: string) => any; +type TypeLookup = (fqn: spec.FQN) => spec.Type; +type SymbolLookup = (fqn: spec.FQN) => any; export interface SerializerHost { readonly objects: ObjectTable; debug(...args: any[]): void; lookupType(fqn: string): spec.Type; - recurse(x: any, type: CompleteTypeReference): any; - findSymbol(fqn: string): any; + recurse(x: any, type: OptionalValueOrVoid): any; + findSymbol(fqn: spec.FQN): any; } interface Serializer { - serialize(value: unknown, type: CompleteTypeReference, host: SerializerHost): any; - deserialize(value: unknown, type: CompleteTypeReference, host: SerializerHost): any; + serialize(value: unknown, type: OptionalValueOrVoid, host: SerializerHost): any; + deserialize(value: unknown, type: OptionalValueOrVoid, host: SerializerHost): any; } export const SERIALIZERS: {[k: string]: Serializer} = { @@ -109,8 +109,9 @@ export const SERIALIZERS: {[k: string]: Serializer} = { // ---------------------------------------------------------------------- [SerializationClass.Date]: { - serialize(value, type): WireDate | undefined { - if (nullAndOk(value, type)) { return undefined; } + serialize(value, optionalValue): WireDate | undefined { + if (nullAndOk(value, optionalValue)) { return undefined; } + if (optionalValue === 'void') { throw new Error('Encountered unexpected `void` type'); } if (!isDate(value)) { throw new Error(`Expected Date, got ${JSON.stringify(value)}`); @@ -118,8 +119,8 @@ export const SERIALIZERS: {[k: string]: Serializer} = { return serializeDate(value); }, - deserialize(value, type) { - if (nullAndOk(value, type)) { return undefined; } + deserialize(value, optionalValue) { + if (nullAndOk(value, optionalValue)) { return undefined; } if (!isWireDate(value)) { throw new Error(`Expected Date, got ${JSON.stringify(value)}`); @@ -130,10 +131,11 @@ export const SERIALIZERS: {[k: string]: Serializer} = { // ---------------------------------------------------------------------- [SerializationClass.Scalar]: { - serialize(value, type) { - if (nullAndOk(value, type)) { return undefined; } + serialize(value, optionalValue) { + if (nullAndOk(value, optionalValue)) { return undefined; } + if (optionalValue === 'void') { throw new Error('Encountered unexpected `void` type'); } - const primitiveType = type as spec.PrimitiveTypeReference; + const primitiveType = optionalValue.type as spec.PrimitiveTypeReference; if (!isScalar(value)) { throw new Error(`Expected Scalar, got ${JSON.stringify(value)}`); @@ -144,10 +146,11 @@ export const SERIALIZERS: {[k: string]: Serializer} = { return value; }, - deserialize(value, type) { - if (nullAndOk(value, type)) { return undefined; } + deserialize(value, optionalValue) { + if (nullAndOk(value, optionalValue)) { return undefined; } + if (optionalValue === 'void') { throw new Error('Encountered unexpected `void` type'); } - const primitiveType = type as spec.PrimitiveTypeReference; + const primitiveType = optionalValue.type as spec.PrimitiveTypeReference; if (!isScalar(value)) { throw new Error(`Expected Scalar, got ${JSON.stringify(value)}`); @@ -173,8 +176,9 @@ export const SERIALIZERS: {[k: string]: Serializer} = { // ---------------------------------------------------------------------- [SerializationClass.Enum]: { - serialize(value, type, host): WireEnum | undefined { - if (nullAndOk(value, type)) { return undefined; } + serialize(value, optionalValue, host): WireEnum | undefined { + if (nullAndOk(value, optionalValue)) { return undefined; } + if (optionalValue === 'void') { throw new Error('Encountered unexpected `void` type'); } if (typeof value !== 'string' && typeof value !== 'number') { throw new Error(`Expected enum value, got ${JSON.stringify(value)}`); @@ -182,11 +186,11 @@ export const SERIALIZERS: {[k: string]: Serializer} = { host.debug('Serializing enum'); - const enumType = type as spec.EnumType; + const enumType = optionalValue.type as spec.NamedTypeReference; return { [TOKEN_ENUM]: `${enumType.fqn}/${host.findSymbol(enumType.fqn)[value]}` }; }, - deserialize(value, type, host) { - if (nullAndOk(value, type)) { return undefined; } + deserialize(value, optionalValue, host) { + if (nullAndOk(value, optionalValue)) { return undefined; } if (!isWireEnum(value)) { throw new Error(`Expected enum value, got ${JSON.stringify(value)}`); @@ -198,50 +202,55 @@ export const SERIALIZERS: {[k: string]: Serializer} = { // ---------------------------------------------------------------------- [SerializationClass.Array]: { - serialize(value, type, host) { - if (nullAndOk(value, type)) { return undefined; } + serialize(value, optionalValue, host) { + if (nullAndOk(value, optionalValue)) { return undefined; } + if (optionalValue === 'void') { throw new Error('Encountered unexpected `void` type'); } if (!Array.isArray(value)) { throw new Error(`Expected array type, got ${JSON.stringify(value)}`); } - const arrayType = type as spec.CollectionTypeReference; + const arrayType = optionalValue.type as spec.CollectionTypeReference; - return value.map(x => host.recurse(x, arrayType.collection.elementtype)); + return value.map(x => host.recurse(x, { type: arrayType.collection.elementtype })); }, - deserialize(value, type, host) { - if (nullAndOk(value, type)) { return undefined; } + deserialize(value, optionalValue, host) { + if (nullAndOk(value, optionalValue)) { return undefined; } + if (optionalValue === 'void') { throw new Error('Encountered unexpected `void` type'); } if (!Array.isArray(value)) { throw new Error(`Expected array type, got ${JSON.stringify(value)}`); } - const arrayType = type as spec.CollectionTypeReference; + const arrayType = optionalValue.type as spec.CollectionTypeReference; - return value.map(x => host.recurse(x, arrayType.collection.elementtype)); + return value.map(x => host.recurse(x, { type: arrayType.collection.elementtype })); }, }, // ---------------------------------------------------------------------- [SerializationClass.Map]: { - serialize(value, type, host) { - if (nullAndOk(value, type)) { return undefined; } + serialize(value, optionalValue, host) { + if (nullAndOk(value, optionalValue)) { return undefined; } + if (optionalValue === 'void') { throw new Error('Encountered unexpected `void` type'); } - const mapType = type as spec.CollectionTypeReference; - return mapValues(value, v => host.recurse(v, mapType.collection.elementtype)); + const mapType = optionalValue.type as spec.CollectionTypeReference; + return mapValues(value, v => host.recurse(v, { type: mapType.collection.elementtype })); }, - deserialize(value, type, host) { - if (nullAndOk(value, type)) { return undefined; } + deserialize(value, optionalValue, host) { + if (nullAndOk(value, optionalValue)) { return undefined; } + if (optionalValue === 'void') { throw new Error('Encountered unexpected `void` type'); } - const mapType = type as spec.CollectionTypeReference; - return mapValues(value, v => host.recurse(v, mapType.collection.elementtype)); + const mapType = optionalValue.type as spec.CollectionTypeReference; + return mapValues(value, v => host.recurse(v, { type: mapType.collection.elementtype })); }, }, // ---------------------------------------------------------------------- [SerializationClass.Struct]: { - serialize(value, type, host) { - if (nullAndOk(value, type)) { return undefined; } + serialize(value, optionalValue, host) { + if (nullAndOk(value, optionalValue)) { return undefined; } + if (optionalValue === 'void') { throw new Error('Encountered unexpected `void` type'); } if (typeof value !== 'object' || value == null) { throw new Error(`Expected object, got ${JSON.stringify(value)}`); @@ -270,15 +279,16 @@ export const SERIALIZERS: {[k: string]: Serializer} = { */ host.debug('Returning value type as reference type for now (awslabs/jsii#400)'); - const wireFqn = selectWireType(value, type as spec.NamedTypeReference, host.lookupType); + const wireFqn = selectWireType(value, optionalValue.type as spec.NamedTypeReference, host.lookupType); return host.objects.registerObject(value, wireFqn); }, - deserialize(value, type, host) { + deserialize(value, optionalValue, host) { if (typeof value === 'object' && Object.keys(value || {}).length === 0) { // Treat empty structs as `undefined` (see https://github.com/awslabs/jsii/issues/411) value = undefined; } - if (nullAndOk(value, type)) { return undefined; } + if (nullAndOk(value, optionalValue)) { return undefined; } + if (optionalValue === 'void') { throw new Error('Encountered unexpected `void` type'); } if (typeof value !== 'object' || value == null) { throw new Error(`Expected object reference, got ${JSON.stringify(value)}`); @@ -292,20 +302,21 @@ export const SERIALIZERS: {[k: string]: Serializer} = { return prevRef; } - const namedType = host.lookupType((type as spec.NamedTypeReference).fqn); + const namedType = host.lookupType((optionalValue.type as spec.NamedTypeReference).fqn); const props = propertiesOf(namedType, host.lookupType); return mapValues(value, (v, key) => { if (!props[key]) { return undefined; } // Don't map if unknown property - return host.recurse(v, props[key].type); + return host.recurse(v, props[key]); }); }, }, // ---------------------------------------------------------------------- [SerializationClass.ReferenceType]: { - serialize(value, type, host): ObjRef | undefined { - if (nullAndOk(value, type)) { return undefined; } + serialize(value, optionalValue, host): ObjRef | undefined { + if (nullAndOk(value, optionalValue)) { return undefined; } + if (optionalValue === 'void') { throw new Error('Encountered unexpected `void` type'); } if (typeof value !== 'object' || value == null) { throw new Error(`Expected object reference, got ${JSON.stringify(value)}`); @@ -314,11 +325,12 @@ export const SERIALIZERS: {[k: string]: Serializer} = { const prevRef = objectReference(value); if (prevRef) { return prevRef; } - const wireFqn = selectWireType(value, type as spec.NamedTypeReference, host.lookupType); + const wireFqn = selectWireType(value, optionalValue.type as spec.NamedTypeReference, host.lookupType); return host.objects.registerObject(value, wireFqn); }, - deserialize(value, type, host) { - if (nullAndOk(value, type)) { return undefined; } + deserialize(value, optionalValue, host) { + if (nullAndOk(value, optionalValue)) { return undefined; } + if (optionalValue === 'void') { throw new Error('Encountered unexpected `void` type'); } // The only way to pass a by-ref object is to have created it // previously inside JSII kernel, so it must have an objref already. @@ -329,7 +341,7 @@ export const SERIALIZERS: {[k: string]: Serializer} = { const { instance, fqn } = host.objects.findObject(value); - const namedTypeRef = type as spec.NamedTypeReference; + const namedTypeRef = optionalValue.type as spec.NamedTypeReference; if (namedTypeRef.fqn !== EMPTY_OBJECT_FQN) { const namedType = host.lookupType(namedTypeRef.fqn); @@ -337,8 +349,9 @@ export const SERIALIZERS: {[k: string]: Serializer} = { // We only do this for classes, not interfaces, since Java might pass us objects that // privately implement some interface and we can't prove they don't. // https://github.com/awslabs/jsii/issues/399 - if (spec.isClassType(namedType) && !isAssignable(fqn, type as spec.NamedTypeReference, host.lookupType)) { - throw new Error(`Object of type ${fqn} is not convertible to ${(type as spec.NamedTypeReference).fqn}`); + const declaredType = optionalValue.type as spec.NamedTypeReference; + if (spec.isClassType(namedType) && !isAssignable(fqn, declaredType, host.lookupType)) { + throw new Error(`Object of type ${fqn} is not convertible to ${declaredType.fqn}`); } } @@ -354,7 +367,7 @@ export const SERIALIZERS: {[k: string]: Serializer} = { if (isDate(value)) { return serializeDate(value); } if (isScalar(value)) { return value; } if (Array.isArray(value)) { - return value.map(e => host.recurse(e, { primitive: spec.PrimitiveType.Any })); + return value.map(e => host.recurse(e, { type: spec.CANONICAL_ANY })); } // Note: no case for "ENUM" here, without type declaration we can't tell the difference @@ -386,7 +399,7 @@ export const SERIALIZERS: {[k: string]: Serializer} = { // We will serialize by-value, but recurse for serialization so that if // the object contains reference objects, they will be serialized appropriately. // (Basically, serialize anything else as a map of 'any'). - return mapValues(value, (v) => host.recurse(v, { primitive: spec.PrimitiveType.Any })); + return mapValues(value, (v) => host.recurse(v, { type: spec.CANONICAL_ANY })); }, deserialize(value, _type, host) { @@ -402,7 +415,7 @@ export const SERIALIZERS: {[k: string]: Serializer} = { } if (Array.isArray(value)) { host.debug('ANY is an Array'); - return value.map(e => host.recurse(e, { primitive: spec.PrimitiveType.Any })); + return value.map(e => host.recurse(e, { type: spec.CANONICAL_ANY })); } if (isWireEnum(value)) { @@ -416,7 +429,7 @@ export const SERIALIZERS: {[k: string]: Serializer} = { // At this point again, deserialize by-value. host.debug('ANY is a Map'); - return mapValues(value, (v) => host.recurse(v, { primitive: spec.PrimitiveType.Any })); + return mapValues(value, (v) => host.recurse(v, { type: spec.CANONICAL_ANY })); }, }, }; @@ -448,7 +461,7 @@ function deserializeEnum(value: WireEnum, lookup: SymbolLookup) { export interface TypeSerialization { serializationClass: SerializationClass; - typeRef: CompleteTypeReference; + typeRef: OptionalValueOrVoid; } /** @@ -456,11 +469,11 @@ export interface TypeSerialization { * * There can be multiple, because the type can be a type union. */ -export function serializationType(typeRef: CompleteTypeReference, lookup: TypeLookup): TypeSerialization[] { +export function serializationType(typeRef: OptionalValueOrVoid, lookup: TypeLookup): TypeSerialization[] { if (typeRef == null) { throw new Error(`Kernel error: expected type information, got 'undefined'`); } if (typeRef === 'void') { return [{ serializationClass: SerializationClass.Void, typeRef }]; } - if (spec.isPrimitiveTypeReference(typeRef)) { - switch (typeRef.primitive) { + if (spec.isPrimitiveTypeReference(typeRef.type)) { + switch (typeRef.type.primitive) { case spec.PrimitiveType.Any: return [{ serializationClass: SerializationClass.Any, typeRef }]; case spec.PrimitiveType.Date: return [{ serializationClass: SerializationClass.Date, typeRef }]; case spec.PrimitiveType.Json: return [{ serializationClass: SerializationClass.Json, typeRef }]; @@ -472,14 +485,14 @@ export function serializationType(typeRef: CompleteTypeReference, lookup: TypeLo throw new Error('Unknown primitive type'); } - if (spec.isCollectionTypeReference(typeRef)) { + if (spec.isCollectionTypeReference(typeRef.type)) { return [{ - serializationClass: typeRef.collection.kind === spec.CollectionKind.Array ? SerializationClass.Array : SerializationClass.Map, + serializationClass: typeRef.type.collection.kind === spec.CollectionKind.Array ? SerializationClass.Array : SerializationClass.Map, typeRef }]; } - if (spec.isUnionTypeReference(typeRef)) { - const compoundTypes = flatMap(typeRef.union.types, t => serializationType(t, lookup)); + if (spec.isUnionTypeReference(typeRef.type)) { + const compoundTypes = flatMap(typeRef.type.union.types, t => serializationType({ type: t }, lookup)); // Propagate the top-level 'optional' field to each individual subtype for (const t of compoundTypes) { if (t.typeRef !== 'void') { @@ -490,7 +503,7 @@ export function serializationType(typeRef: CompleteTypeReference, lookup: TypeLo } // The next part of the conversion is lookup-dependent - const type = lookup(typeRef.fqn); + const type = lookup(typeRef.type.fqn); if (spec.isEnumType(type)) { return [{ serializationClass: SerializationClass.Enum, typeRef }]; @@ -503,11 +516,11 @@ export function serializationType(typeRef: CompleteTypeReference, lookup: TypeLo return [{ serializationClass: SerializationClass.ReferenceType, typeRef }]; } -function nullAndOk(x: unknown, type: CompleteTypeReference): boolean { +function nullAndOk(x: unknown, type: OptionalValueOrVoid): boolean { if (x != null) { return false; } if (type !== 'void' && !type.optional) { - throw new Error(`Got 'undefined' for non-nullable type ${JSON.stringify(type)}`); + throw new Error(`Got 'undefined' for non-optional instance of ${JSON.stringify(type)}`); } return true; @@ -551,11 +564,11 @@ function propertiesOf(t: spec.Type, lookup: TypeLookup): {[name: string]: spec.P if (t.interfaces) { for (const iface of t.interfaces) { - ret = { ...ret, ...propertiesOf(lookup(iface.fqn), lookup) }; + ret = { ...ret, ...propertiesOf(lookup(iface), lookup) }; } } if (spec.isClassType(t) && t.base) { - ret = { ...ret, ...propertiesOf(lookup(t.base.fqn), lookup) }; + ret = { ...ret, ...propertiesOf(lookup(t.base), lookup) }; } for (const prop of t.properties || []) { @@ -625,12 +638,12 @@ function isAssignable(actualTypeFqn: string, requiredType: spec.NamedTypeReferen } const actualType = lookup(actualTypeFqn); if (spec.isClassType(actualType)) { - if (actualType.base && isAssignable(actualType.base.fqn, requiredType, lookup)) { + if (actualType.base && isAssignable(actualType.base, requiredType, lookup)) { return true; } } if (spec.isClassOrInterfaceType(actualType) && actualType.interfaces) { - return actualType.interfaces.find(iface => isAssignable(iface.fqn, requiredType, lookup)) != null; + return actualType.interfaces.find(iface => isAssignable(iface, requiredType, lookup)) != null; } return false; } diff --git a/packages/jsii-kernel/package-lock.json b/packages/jsii-kernel/package-lock.json index 2c645d2fd4..67fd5621d0 100644 --- a/packages/jsii-kernel/package-lock.json +++ b/packages/jsii-kernel/package-lock.json @@ -1,6 +1,6 @@ { "name": "jsii-kernel", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2462,9 +2462,9 @@ "dev": true }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", "dev": true }, "unicode-length": { diff --git a/packages/jsii-kernel/package.json b/packages/jsii-kernel/package.json index 689252eb55..5966752be4 100644 --- a/packages/jsii-kernel/package.json +++ b/packages/jsii-kernel/package.json @@ -23,7 +23,7 @@ "jsii-calc": "^0.9.0", "nodeunit": "^0.11.3", "tslint": "^5.13.0", - "typescript": "^3.3.3333" + "typescript": "^3.4.2" }, "dependencies": { "jsii-spec": "^0.9.0", diff --git a/packages/jsii-kernel/test/test.kernel.ts b/packages/jsii-kernel/test/test.kernel.ts index 74e5298eb8..37d67c9927 100644 --- a/packages/jsii-kernel/test/test.kernel.ts +++ b/packages/jsii-kernel/test/test.kernel.ts @@ -233,28 +233,30 @@ defineTest('objects created inside the sandbox are returned with type info and n defineTest('naming allows returns the module name for different languages', async (test, sandbox) => { test.deepEqual(sandbox.naming({ assembly: 'jsii-calc' }).naming, { - java: { - package: 'software.amazon.jsii.tests.calculator', - maven: { groupId: 'software.amazon.jsii.tests', artifactId: 'calculator' } - }, dotnet: { namespace: 'Amazon.JSII.Tests.CalculatorNamespace', packageId: 'Amazon.JSII.Tests.CalculatorPackageId', }, + java: { + package: 'software.amazon.jsii.tests.calculator', + maven: { groupId: 'software.amazon.jsii.tests', artifactId: 'calculator' } + }, js: { npm: 'jsii-calc' }, python: { distName: 'jsii-calc', module: 'jsii_calc' }, + sphinx: {}, }); test.deepEqual(sandbox.naming({ assembly: '@scope/jsii-calc-lib' }).naming, { - java: { - package: 'software.amazon.jsii.tests.calculator.lib', - maven: { groupId: 'software.amazon.jsii.tests', artifactId: 'calculator-lib' } - }, dotnet: { namespace: 'Amazon.JSII.Tests.CalculatorNamespace.LibNamespace', packageId: 'Amazon.JSII.Tests.CalculatorPackageId.LibPackageId' }, + java: { + package: 'software.amazon.jsii.tests.calculator.lib', + maven: { groupId: 'software.amazon.jsii.tests', artifactId: 'calculator-lib' } + }, js: { npm: '@scope/jsii-calc-lib' }, python: { distName: 'scope.jsii-calc-lib', module: 'scope.jsii_calc_lib' }, + sphinx: {}, }); }); diff --git a/packages/jsii-pacmak/lib/generator.ts b/packages/jsii-pacmak/lib/generator.ts index c5a8ef8df9..a08e791a5e 100644 --- a/packages/jsii-pacmak/lib/generator.ts +++ b/packages/jsii-pacmak/lib/generator.ts @@ -73,8 +73,8 @@ export abstract class Generator implements IGenerator { public async load(packageDir: string) { this.assembly = await util.loadAssembly(packageDir); - if (this.assembly.schema !== spec.SchemaVersion.V1_0) { - throw new Error(`Invalid schema version "${this.assembly.schema}". Expecting "${spec.SchemaVersion.V1_0}"`); + if (this.assembly.schema !== spec.SchemaVersion.LATEST) { + throw new Error(`Invalid schema version "${this.assembly.schema}". Expecting "${spec.SchemaVersion.LATEST}"`); } // Including the version of jsii-pacmak in the fingerprint, as a new version may imply different code generation. @@ -176,8 +176,8 @@ export abstract class Generator implements IGenerator { // // Initializers (constructos) - protected onInitializer(cls: spec.ClassType, method: spec.Method) { cls; method; } - protected onInitializerOverload(cls: spec.ClassType, overload: spec.Method, originalInitializer: spec.Method) { cls; overload; originalInitializer; } + protected onInitializer(_cls: spec.ClassType, _initializer: spec.Initializer) { } + protected onInitializerOverload(_cls: spec.ClassType, _overload: spec.Initializer, _originalInitializer: spec.Initializer) { } // // Properties @@ -311,12 +311,12 @@ export abstract class Generator implements IGenerator { * * Notice that the method that contains all the arguments will not be returned. */ - protected createOverloadsForOptionals(method: spec.Method) { - const methods = new Array(); + protected createOverloadsForOptionals(method: T) { + const overloads = new Array(); // if option disabled, just return the empty array. if (!this.options.generateOverloadsForMethodWithOptionals || !method.parameters) { - return methods; + return overloads; } // @@ -329,17 +329,18 @@ export abstract class Generator implements IGenerator { let next: spec.Parameter | undefined next = remaining.pop(); - while (next && next.type.optional) { - // clone the method but set the parameter list based on the remaining set of parameters - let cloned: spec.Method = clone(method); + // Parameter is optional if it's type is optional, and all subsequent parameters are optional/variadic + while (next && next.optional) { + // clone the method but set the parameter list based on the remaining set of parameters + let cloned: T = clone(method); cloned.parameters = clone(remaining); - methods.push(cloned); + overloads.push(cloned); // pop the next parameter next = remaining.pop(); } - return methods; + return overloads; } private visitInterface(ifc: spec.InterfaceType) { @@ -419,16 +420,16 @@ export abstract class Generator implements IGenerator { // if require, we also "expand" the union for languages that don't support unions. if (this.options.expandUnionProperties) { - prop.type.union.types.forEach((type, index) => { + for (const [index, type] of prop.type.union.types.entries()) { // create a clone of this property let propClone = clone(prop) as spec.Property; - let primary = this.isPrimaryExpandedUnionProperty(prop.type as spec.UnionTypeReference, index); + let primary = this.isPrimaryExpandedUnionProperty(prop.type, index); let propertyName = primary ? prop.name : `${prop.name}As${this.displayNameForType(type)}`; propClone.type = type; - propClone.type.optional = prop.type.optional; + propClone.optional = prop.optional; propClone.name = propertyName; this.onExpandedUnionProperty(cls, propClone, prop.name); - }); + } } } }); diff --git a/packages/jsii-pacmak/lib/targets/java.ts b/packages/jsii-pacmak/lib/targets/java.ts index 24252db091..97eac91fa8 100644 --- a/packages/jsii-pacmak/lib/targets/java.ts +++ b/packages/jsii-pacmak/lib/targets/java.ts @@ -180,7 +180,7 @@ class JavaGenerator extends Generator { let implementsExpr = ''; if (cls.interfaces && cls.interfaces.length > 0) { - implementsExpr = ' implements ' + cls.interfaces.map(x => this.toNativeFqn(x.fqn!)); + implementsExpr = ' implements ' + cls.interfaces.map(x => this.toNativeFqn(x)); } const nested = this.isNested(cls); @@ -292,7 +292,7 @@ class JavaGenerator extends Generator { // all interfaces always extend JsiiInterface so we can identify that it is a jsii interface. const interfaces = ifc.interfaces || []; - const bases = [ 'software.amazon.jsii.JsiiSerializable', ...interfaces.map(x => this.toNativeFqn(x.fqn!)) ].join(', '); + const bases = [ 'software.amazon.jsii.JsiiSerializable', ...interfaces.map(x => this.toNativeFqn(x)) ].join(', '); const nested = this.isNested(ifc); const inner = nested ? ' static' : ''; @@ -313,7 +313,7 @@ class JavaGenerator extends Generator { } protected onInterfaceMethod(_ifc: spec.InterfaceType, method: spec.Method) { - const returnType = method.returns ? this.toJavaType(method.returns) : 'void'; + const returnType = method.returns ? this.toJavaType(method.returns.type) : 'void'; this.addJavaDocs(method); this.code.line(`${returnType} ${method.name}(${this.renderMethodParameters(method)});`); } @@ -553,7 +553,7 @@ class JavaGenerator extends Generator { this.code.line(); this.addJavaDocs(prop); if (overrides) { this.code.line('@Override'); } - if (prop.type.optional) { this.code.line(JSR305_NULLABLE); } + if (isNullable(prop)) { this.code.line(JSR305_NULLABLE); } this.code.openBlock(`${access} ${statc}${getterType} get${propName}()`); let statement = 'return '; @@ -574,7 +574,7 @@ class JavaGenerator extends Generator { this.code.line(); this.addJavaDocs(prop); if (overrides) { this.code.line('@Override'); } - const nullable = prop.type.optional ? `${JSR305_NULLABLE} ` : ''; + const nullable = isNullable(prop) ? `${JSR305_NULLABLE} ` : ''; this.code.openBlock(`${access} ${statc}void set${propName}(${nullable}final ${type} value)`); let statement = ''; @@ -583,7 +583,7 @@ class JavaGenerator extends Generator { } else { statement += 'this.jsiiSet('; } - const value = prop.type.optional ? 'value' : `java.util.Objects.requireNonNull(value, "${prop.name} is required")`; + const value = prop.optional ? 'value' : `java.util.Objects.requireNonNull(value, "${prop.name} is required")`; statement += `"${prop.name}\", ${value});`; this.code.line(statement); this.code.closeBlock(); @@ -592,16 +592,16 @@ class JavaGenerator extends Generator { } private emitMethod(cls: spec.Type, method: spec.Method, overrides: boolean = !!method.overrides) { - const returnType = method.returns ? this.toJavaType(method.returns) : 'void'; + const returnType = method.returns ? this.toJavaType(method.returns.type) : 'void'; const statc = method.static ? 'static ' : ''; const access = this.renderAccessLevel(method); - const async = !!(method.returns && method.returns.promise); + const async = !!method.async; const methodName = slugify(method.name); const signature = `${returnType} ${methodName}(${this.renderMethodParameters(method)})`; this.code.line(); this.addJavaDocs(method); if (overrides) { this.code.line('@Override'); } - if (method.returns && method.returns.optional) { this.code.line(JSR305_NULLABLE); } + if (isNullable(method.returns)) { this.code.line(JSR305_NULLABLE); } if (method.abstract) { this.code.line(`${access} abstract ${signature};`); } else { @@ -649,9 +649,9 @@ class JavaGenerator extends Generator { } const bases = new Array(); - bases.push(...currentType.interfaces || []); + bases.push(...(currentType.interfaces || []).map(iface => this.findType(iface))); if (currentType.kind === spec.TypeKind.Class && currentType.base) { - bases.push(currentType.base); + bases.push(this.findType(currentType.base)); } for (const base of bases) { const type = this.findType(base.fqn!); @@ -704,7 +704,7 @@ class JavaGenerator extends Generator { fieldName: string fieldJavaType: string javaTypes: string[] - optional?: boolean + nullable: boolean inherited: boolean immutable: boolean } @@ -717,12 +717,12 @@ class JavaGenerator extends Generator { function collectProps(currentIfc: spec.InterfaceType, isBaseClass = false) { for (const property of currentIfc.properties || []) { const propName = self.code.toPascalCase(property.name); - const optional = property.type.optional; const prop: Prop = { docs: property.docs, spec: property, - propName, optional, + propName, + nullable: !!property.optional, fieldName: self.code.toCamelCase(property.name), fieldJavaType: self.toJavaType(property.type), javaTypes: self.toJavaTypes(property.type), @@ -735,7 +735,7 @@ class JavaGenerator extends Generator { // add props of base struct for (const base of currentIfc.interfaces || []) { - collectProps(self.findType(base.fqn) as spec.InterfaceType, true); + collectProps(self.findType(base) as spec.InterfaceType, true); } } @@ -748,7 +748,7 @@ class JavaGenerator extends Generator { this.code.openBlock(`final class ${builderName}`); for (const prop of props) { - if (prop.optional) { + if (prop.nullable) { this.code.line(JSR305_NULLABLE); } this.code.line(`private ${prop.fieldJavaType} _${prop.fieldName};`); @@ -765,7 +765,7 @@ class JavaGenerator extends Generator { } this.code.line(` * @return {@code this}`); this.code.line(' */'); - this.code.openBlock(`public ${builderName} with${prop.propName}(${prop.optional ? `${JSR305_NULLABLE} ` : ''}final ${type} value)`); + this.code.openBlock(`public ${builderName} with${prop.propName}(${prop.nullable ? `${JSR305_NULLABLE} ` : ''}final ${type} value)`); this.code.line(`this._${prop.fieldName} = ${_validateIfNonOptional('value', prop)};`); this.code.line('return this;'); this.code.closeBlock(); @@ -780,7 +780,7 @@ class JavaGenerator extends Generator { this.code.openBlock(`public ${interfaceName} build()`); this.code.openBlock(`return new ${interfaceName}()`); for (const prop of props) { - if (prop.optional) { this.code.line(JSR305_NULLABLE); } + if (prop.nullable) { this.code.line(JSR305_NULLABLE); } // tslint:disable-next-line:max-line-length this.code.line(`private${prop.immutable ? ' final' : ''} ${prop.fieldJavaType} $${prop.fieldName} = ${_validateIfNonOptional(`_${prop.fieldName}`, prop)};`); } @@ -794,7 +794,7 @@ class JavaGenerator extends Generator { for (const type of prop.javaTypes) { this.code.line(); this.code.line('@Override'); - this.code.openBlock(`public void set${prop.propName}(${prop.optional ? `${JSR305_NULLABLE} ` : ''}final ${type} value)`); + this.code.openBlock(`public void set${prop.propName}(${prop.nullable ? `${JSR305_NULLABLE} ` : ''}final ${type} value)`); this.code.line(`this.$${prop.fieldName} = ${_validateIfNonOptional('value', prop)};`); this.code.closeBlock(); } @@ -824,7 +824,7 @@ class JavaGenerator extends Generator { this.code.closeBlock(/* final class Builder */); function _validateIfNonOptional(variable: string, prop: Prop): string { - if (prop.optional) { return variable; } + if (prop.nullable) { return variable; } return `java.util.Objects.requireNonNull(${variable}, "${prop.fieldName} is required")`; } } @@ -859,7 +859,7 @@ class JavaGenerator extends Generator { private addJavaDocs(doc: spec.Documentable, defaultText?: string) { if (!defaultText && Object.keys(doc.docs || {}).length === 0 - && !((doc as spec.Method).parameters || []).find(p => Object.keys(p.docs || {}).length !== 0)) { + && !((doc as spec.Method).parameters || []).some(p => Object.keys(p.docs || {}).length !== 0)) { return; } @@ -930,11 +930,11 @@ class JavaGenerator extends Generator { return 'software.amazon.jsii.JsiiObject'; } - return this.toJavaType(cls.base); + return this.toJavaType({ fqn: cls.base }); } - private toJavaType(typeref: spec.TypeReference, forMarshalling = false): string { - const types = this.toJavaTypes(typeref, forMarshalling); + private toJavaType(type: spec.TypeReference, forMarshalling = false): string { + const types = this.toJavaTypes(type, forMarshalling); if (types.length > 1) { return 'java.lang.Object'; } else { @@ -989,7 +989,7 @@ class JavaGenerator extends Generator { if (!method.parameters || method.parameters.length === 0) { return ''; } let paramStream: string = ''; for (const param of method.parameters) { - const paramValue = param.type.optional ? param.name : `java.util.Objects.requireNonNull(${param.name}, "${param.name} is required")`; + const paramValue = isNullable(param) ? param.name : `java.util.Objects.requireNonNull(${param.name}, "${param.name} is required")`; const thisParam = `${param.variadic ? 'java.util.Arrays.stream' : 'java.util.stream.Stream.of'}(${paramValue})`; if (paramStream === '') { paramStream = thisParam; @@ -1021,7 +1021,7 @@ class JavaGenerator extends Generator { statement += `"${method.name}"`; if (method.returns) { - statement += `, ${this.toJavaType(method.returns, true)}.class`; + statement += `, ${this.toJavaType(method.returns.type, true)}.class`; } else { statement += ', Void.class'; } @@ -1035,7 +1035,7 @@ class JavaGenerator extends Generator { const params = []; if (method.parameters) { for (const p of method.parameters) { - const nullable = p.type.optional ? `${JSR305_NULLABLE} ` : ''; + const nullable = isNullable(p) ? `${JSR305_NULLABLE} ` : ''; params.push(`${nullable}final ${this.toJavaType(p.type)}${p.variadic ? '...' : ''} ${p.name}`); } } @@ -1219,4 +1219,13 @@ function* interleave(sep: T, xs: Iterable) { first = false; yield x; } -} \ No newline at end of file +} + +function isNullable(optionalValue: spec.OptionalValue | undefined): boolean { + if (!optionalValue) { + return false; + } + return optionalValue.optional + || (spec.isPrimitiveTypeReference(optionalValue.type) + && optionalValue.type.primitive === spec.PrimitiveType.Any); +} diff --git a/packages/jsii-pacmak/lib/targets/python.ts b/packages/jsii-pacmak/lib/targets/python.ts index d74c28eaf0..ecfdd90e4c 100644 --- a/packages/jsii-pacmak/lib/targets/python.ts +++ b/packages/jsii-pacmak/lib/targets/python.ts @@ -266,8 +266,6 @@ interface BaseMethodEmitOpts { } abstract class BaseMethod implements PythonBase { - - public readonly name: string; public readonly abstract: boolean; protected readonly abstract implicitParameter: string; @@ -277,24 +275,15 @@ abstract class BaseMethod implements PythonBase { protected readonly returnFromJSIIMethod: boolean = true; protected readonly shouldEmitBody: boolean = true; - private readonly jsName?: string; - private readonly parameters: spec.Parameter[]; - private readonly returns?: spec.TypeReference; private readonly liftedProp?: spec.InterfaceType; private readonly parent?: spec.NamedTypeReference; - constructor(name: string, - jsName: string | undefined, - parameters: spec.Parameter[], - returns?: spec.TypeReference, + constructor(public readonly name: string, + private readonly jsName: string | undefined, + private readonly parameters: spec.Parameter[], + private readonly returns?: spec.OptionalValue, opts: BaseMethodOpts = {}) { - const { abstract = false } = opts; - - this.name = name; - this.abstract = abstract; - this.jsName = jsName; - this.parameters = parameters; - this.returns = returns; + this.abstract = !!opts.abstract; this.liftedProp = opts.liftedProp; this.parent = opts.parent; } @@ -309,20 +298,6 @@ abstract class BaseMethod implements PythonBase { returnType = "None"; } - // We cannot (currently?) trust the JSII to accurately tell us whether a - // parameter is truly optional or not. Because of that, we have to selectively - // choose when we're going to respect the optional flag and emit a default value - // to only be at the tail end of the method signature. - // See: https://github.com/awslabs/jsii/issues/284 - let optionalStartsAt: number | undefined; - for (const [idx, param] of this.parameters.entries()) { - if (param.type.optional && optionalStartsAt === undefined) { - optionalStartsAt = idx; - } else if (!param.type.optional) { - optionalStartsAt = undefined; - } - } - // We cannot (currently?) blindly use the names given to us by the JSII for // initializers, because our keyword lifting will allow two names to clash. // This can hopefully be removed once we get https://github.com/awslabs/jsii/issues/288 @@ -341,7 +316,7 @@ abstract class BaseMethod implements PythonBase { // gradual typing, so we'll have to iterate over the list of parameters, and // build the list, converting as we go. const pythonParams: string[] = [this.implicitParameter]; - for (const [idx, param] of this.parameters.entries()) { + for (const param of this.parameters) { // We cannot (currently?) blindly use the names given to us by the JSII for // initializers, because our keyword lifting will allow two names to clash. // This can hopefully be removed once we get https://github.com/awslabs/jsii/issues/288 @@ -351,8 +326,8 @@ abstract class BaseMethod implements PythonBase { paramName = `${paramName}_`; } - const paramType = resolver.resolve(param.type, { forwardReferences: false}); - const paramDefault = optionalStartsAt !== undefined && idx >= optionalStartsAt ? "=None" : ""; + const paramType = resolver.resolve(param, { forwardReferences: false}); + const paramDefault = param.optional ? "=None" : ""; pythonParams.push(`${paramName}: ${paramType}${paramDefault}`); } @@ -373,13 +348,13 @@ abstract class BaseMethod implements PythonBase { // Iterate over all of our props, and reflect them into our params. for (const prop of liftedProperties) { const paramName = toPythonParameterName(prop.name); - const paramType = resolver.resolve(prop.type, { forwardReferences: false }); - const paramDefault = prop.type.optional ? "=None" : ""; + const paramType = resolver.resolve(prop, { forwardReferences: false }); + const paramDefault = prop.optional ? "=None" : ""; pythonParams.push(`${paramName}: ${paramType}${paramDefault}`); } } - } else if (this.parameters.length >= 1 && this.parameters.slice(-1)[0].variadic) { + } else if (this.parameters.length >= 1 && this.parameters[this.parameters.length - 1].variadic) { // Another situation we could be in, is that instead of having a plain parameter // we have a variadic parameter where we need to expand the last parameter as a // *args. @@ -388,7 +363,7 @@ abstract class BaseMethod implements PythonBase { const lastParameter = this.parameters.slice(-1)[0]; const paramName = toPythonParameterName(lastParameter.name); const paramType = resolver.resolve( - lastParameter.type, + lastParameter, { forwardReferences: false, ignoreOptional: true }, ); @@ -427,13 +402,13 @@ abstract class BaseMethod implements PythonBase { private emitAutoProps(code: CodeMaker, resolver: TypeResolver) { const lastParameter = this.parameters.slice(-1)[0]; const argName = toPythonParameterName(lastParameter.name); - const typeName = resolver.resolve(lastParameter.type, {ignoreOptional: true }); + const typeName = resolver.resolve(lastParameter, {ignoreOptional: true }); // We need to build up a list of properties, which are mandatory, these are the // ones we will specifiy to start with in our dictionary literal. const mandatoryPropMembers: string[] = []; for (const prop of this.getLiftedProperties(resolver)) { - if (prop.type.optional) { + if (prop.optional) { continue; } @@ -445,7 +420,7 @@ abstract class BaseMethod implements PythonBase { // Now we'll go through our optional properties, and if they haven't been set // we'll add them to our dictionary. for (const prop of this.getLiftedProperties(resolver)) { - if (!prop.type.optional) { + if (!prop.optional) { continue; } @@ -463,7 +438,7 @@ abstract class BaseMethod implements PythonBase { if (this.parent === undefined) { throw new Error("Parent not known."); } - jsiiMethodParams.push(resolver.resolve(this.parent)); + jsiiMethodParams.push(resolver.resolve({ type: this.parent })); } jsiiMethodParams.push(this.implicitParameter); if (this.jsName !== undefined) { @@ -513,8 +488,6 @@ interface BasePropertyEmitOpts { } abstract class BaseProperty implements PythonBase { - - public readonly name: string; public readonly abstract: boolean; protected readonly abstract decorator: string; @@ -523,20 +496,18 @@ abstract class BaseProperty implements PythonBase { protected readonly jsiiSetMethod: string; protected readonly shouldEmitBody: boolean = true; - private readonly jsName: string; - private readonly type: spec.TypeReference; private readonly immutable: boolean; - constructor(name: string, jsName: string, type: spec.TypeReference, opts: BasePropertyOpts = {}) { + constructor(public readonly name: string, + private readonly jsName: string, + private readonly type: spec.OptionalValue, + opts: BasePropertyOpts = {}) { const { abstract = false, immutable = false, } = opts; - this.name = name; this.abstract = abstract; - this.jsName = jsName; - this.type = type; this.immutable = immutable; } @@ -583,7 +554,7 @@ class Interface extends BasePythonClassType { // Then, we have to emit a Proxy class which implements our proxy interface. resolver = this.fqn ? resolver.bind(this.fqn) : resolver; - const proxyBases: string[] = this.bases.map(b => `jsii.proxy_for(${resolver.resolve(b)})`); + const proxyBases: string[] = this.bases.map(b => `jsii.proxy_for(${resolver.resolve({ type: b })})`); code.openBlock(`class ${this.getProxyClassName()}(${proxyBases.join(", ")})`); code.line(`__jsii_type__ = "${this.fqn}"`); @@ -599,7 +570,7 @@ class Interface extends BasePythonClassType { } protected getClassParams(resolver: TypeResolver): string[] { - const params: string[] = this.bases.map(b => resolver.resolve(b)); + const params: string[] = this.bases.map(b => resolver.resolve({ type: b })); params.push("jsii.compat.Protocol"); @@ -698,7 +669,7 @@ class TypedDict extends BasePythonClassType { } protected getClassParams(resolver: TypeResolver): string[] { - const params: string[] = this.bases.map(b => resolver.resolve(b)); + const params: string[] = this.bases.map(b => resolver.resolve({ type: b })); params.push("jsii.compat.TypedDict"); @@ -709,17 +680,11 @@ class TypedDict extends BasePythonClassType { class TypedDictProperty implements PythonBase { - public readonly name: string; - - private readonly type: spec.TypeReference; - - constructor(name: string, type: spec.TypeReference) { - this.name = name; - this.type = type; - } + constructor(public readonly name: string, + private readonly type: spec.OptionalValue) {} - get optional(): boolean { - return this.type.optional !== undefined ? this.type.optional : false; + public get optional(): boolean { + return !!this.type.optional; } public emit(code: CodeMaker, resolver: TypeResolver) { @@ -787,7 +752,7 @@ class Class extends BasePythonClassType { public emit(code: CodeMaker, resolver: TypeResolver) { // First we emit our implments decorator if (this.interfaces.length > 0) { - const interfaces: string[] = this.interfaces.map(b => resolver.resolve(b)); + const interfaces: string[] = this.interfaces.map(b => resolver.resolve({ type: b })); code.line(`@jsii.implements(${interfaces.join(", ")})`); } @@ -802,7 +767,7 @@ class Class extends BasePythonClassType { const proxyBases: string[] = [this.name]; for (const base of this.abstractBases) { - proxyBases.push(`jsii.proxy_for(${resolver.resolve(base)})`); + proxyBases.push(`jsii.proxy_for(${resolver.resolve({ type: base })})`); } code.openBlock(`class ${this.getProxyClassName()}(${proxyBases.join(', ')})`); @@ -834,7 +799,7 @@ class Class extends BasePythonClassType { } protected getClassParams(resolver: TypeResolver): string[] { - const params: string[] = this.bases.map(b => resolver.resolve(b)); + const params: string[] = this.bases.map(b => resolver.resolve({ type: b })); const metaclass: string = this.abstract ? "JSIIAbstractClass" : "JSIIMeta"; params.push(`metaclass=jsii.${metaclass}`); @@ -1087,20 +1052,18 @@ class Package { const expectedDeps = this.metadata.dependencies || {}; for (const depName of Object.keys(expectedDeps)) { const depInfo = expectedDeps[depName]; - if (depInfo.peer) { - // We need to figure out what our version range is. - // Basically, if it starts with Zero we want to restrict things to - // ~=X.Y.Z. If it does not start with zero, then we want to do ~=X.Y,>=X.Y.Z. - const versionParts = depInfo.version.split("."); - let versionSpecifier: string; - if (versionParts[0] === "0") { - versionSpecifier = `~=${versionParts.slice(0, 3).join(".")}`; - } else { - versionSpecifier = `~=${versionParts.slice(0, 2).join(".")},>=${versionParts.slice(0, 3).join(".")}`; - } - - dependencies.push(`${depInfo.targets!.python!.distName}${versionSpecifier}`); + // We need to figure out what our version range is. + // Basically, if it starts with Zero we want to restrict things to + // ~=X.Y.Z. If it does not start with zero, then we want to do ~=X.Y,>=X.Y.Z. + const versionParts = depInfo.version.split("."); + let versionSpecifier: string; + if (versionParts[0] === "0") { + versionSpecifier = `~=${versionParts.slice(0, 3).join(".")}`; + } else { + versionSpecifier = `~=${versionParts.slice(0, 2).join(".")},>=${versionParts.slice(0, 3).join(".")}`; } + + dependencies.push(`${depInfo.targets!.python!.distName}${versionSpecifier}`); } code.openFile("README.md"); @@ -1243,19 +1206,23 @@ class TypeResolver { return type; } - public dereference(typeRef: spec.NamedTypeReference): spec.Type { - return this.findType(typeRef.fqn); + public dereference(typeRef: string | spec.NamedTypeReference): spec.Type { + if (typeof typeRef !== 'string') { + typeRef = typeRef.fqn; + } + return this.findType(typeRef); } public resolve( - typeRef: spec.TypeReference, + typeInstance: spec.OptionalValue, opts: TypeResolverOpts = { forwardReferences: true, ignoreOptional: false }): string { const { forwardReferences = true, } = opts; + const optional = opts.ignoreOptional ? false : !!typeInstance.optional; // First, we need to resolve our given type reference into the Python type. - let pythonType = this.toPythonType(typeRef, opts.ignoreOptional); + let pythonType = this.toPythonType(typeInstance.type, { optional }); // If we split our types by any of the "special" characters that can't appear in // identifiers (like "[],") then we will get a list of all of the identifiers, @@ -1312,7 +1279,7 @@ class TypeResolver { return pythonType; } - private toPythonType(typeRef: spec.TypeReference, ignoreOptional?: boolean): string { + private toPythonType(typeRef: spec.TypeReference, opts: { optional: boolean }): string { let pythonType: string; // Get the underlying python type. @@ -1325,7 +1292,7 @@ class TypeResolver { } else if (typeRef.union) { const types = new Array(); for (const subtype of typeRef.union.types) { - types.push(this.toPythonType(subtype)); + types.push(this.toPythonType(subtype, opts)); } pythonType = `typing.Union[${types.join(", ")}]`; } else { @@ -1337,7 +1304,7 @@ class TypeResolver { // We explicitly don't emit this when our type is typing.Any, because typing.Any // already implied that None is an accepted type. // See: https://github.com/awslabs/jsii/issues/284 - if (!ignoreOptional && typeRef.optional && pythonType !== "typing.Any") { + if (opts.optional && pythonType !== "typing.Any") { pythonType = `typing.Optional[${pythonType}]`; } @@ -1358,7 +1325,7 @@ class TypeResolver { } private toPythonCollection(ref: spec.CollectionTypeReference): string { - const elementPythonType = this.toPythonType(ref.collection.elementtype); + const elementPythonType = this.toPythonType(ref.collection.elementtype, { optional: false }); switch (ref.collection.kind) { case spec.CollectionKind.Array: return `typing.List[${elementPythonType}]`; case spec.CollectionKind.Map: return `typing.Mapping[str,${elementPythonType}]`; @@ -1462,8 +1429,12 @@ class PythonGenerator extends Generator { const klass = new Class( toPythonIdentifier(cls.name), cls.fqn, - { abstract, bases: cls.base !== undefined ? [cls.base] : [], interfaces: cls.interfaces, - abstractBases: abstract ? this.getAbstractBases(cls) : [] } + { + abstract, + bases: (cls.base && [this.findType(cls.base)]) || [], + interfaces: cls.interfaces && cls.interfaces.map(base => this.findType(base)), + abstractBases: abstract ? this.getAbstractBases(cls) : [] + } ); if (cls.initializer !== undefined) { @@ -1474,7 +1445,7 @@ class PythonGenerator extends Generator { "__init__", undefined, parameters, - cls.initializer.returns, + undefined, { liftedProp: this.getliftedProp(cls.initializer), parent: cls }, ) ); @@ -1502,7 +1473,7 @@ class PythonGenerator extends Generator { new StaticProperty( toPythonPropertyName(prop.name, prop.const), prop.name, - prop.type, + prop, { abstract: prop.abstract, immutable: prop.immutable }, ) ); @@ -1511,7 +1482,7 @@ class PythonGenerator extends Generator { protected onMethod(cls: spec.ClassType, method: spec.Method) { const { parameters = [] } = method; - if (this.isAsyncMethod(method)) { + if (method.async) { this.getPythonType(cls.fqn).addMember( new AsyncMethod( toPythonMethodName(method.name!, method.protected), @@ -1539,7 +1510,7 @@ class PythonGenerator extends Generator { new Property( toPythonPropertyName(prop.name, prop.const, prop.protected), prop.name, - prop.type, + prop, { abstract: prop.abstract, immutable: prop.immutable }, ) ); @@ -1556,13 +1527,13 @@ class PythonGenerator extends Generator { iface = new TypedDict( toPythonIdentifier(ifc.name), ifc.fqn, - { bases: ifc.interfaces }, + { bases: ifc.interfaces && ifc.interfaces.map(base => this.findType(base)) }, ); } else { iface = new Interface( toPythonIdentifier(ifc.name), ifc.fqn, - { bases: ifc.interfaces }, + { bases: ifc.interfaces && ifc.interfaces.map(base => this.findType(base)) }, ); } @@ -1591,13 +1562,13 @@ class PythonGenerator extends Generator { if (ifc.datatype) { ifaceProperty = new TypedDictProperty( toPythonIdentifier(prop.name), - prop.type, + prop, ); } else { ifaceProperty = new InterfaceProperty( toPythonPropertyName(prop.name, prop.const, prop.protected), prop.name, - prop.type, + prop, { immutable: prop.immutable }, ); } @@ -1667,7 +1638,7 @@ class PythonGenerator extends Generator { this.types.set(type.fqn, type); } - private getliftedProp(method: spec.Method): spec.InterfaceType | undefined { + private getliftedProp(method: spec.Method | spec.Initializer): spec.InterfaceType | undefined { // If there are parameters to this method, and if the last parameter's type is // a datatype interface, then we want to lift the members of that last paramter // as keyword arguments to this function. @@ -1688,7 +1659,7 @@ class PythonGenerator extends Generator { const abstractBases: spec.ClassType[] = []; if (cls.base !== undefined) { - const base = this.findType(cls.base.fqn); + const base = this.findType(cls.base); if (!spec.isClassType(base)) { throw new Error("Class inheritence that isn't a class?"); @@ -1701,8 +1672,4 @@ class PythonGenerator extends Generator { return abstractBases; } - - private isAsyncMethod(method: spec.Method): boolean { - return method.returns !== undefined && method.returns.promise !== undefined && method.returns.promise; - } } diff --git a/packages/jsii-pacmak/lib/targets/sphinx.ts b/packages/jsii-pacmak/lib/targets/sphinx.ts index c797c2fe35..8b9d827fa1 100644 --- a/packages/jsii-pacmak/lib/targets/sphinx.ts +++ b/packages/jsii-pacmak/lib/targets/sphinx.ts @@ -215,11 +215,11 @@ class SphinxDocsGenerator extends Generator { this.code.line(); if (cls.base) { - this.code.line(`:extends: ${this.renderTypeRef(cls.base).ref}`); + this.code.line(`:extends: ${this.renderTypeRef(this.findType(cls.base)).ref}`); } for (const ifc of cls.interfaces || []) { - this.code.line(`:implements: ${this.renderTypeRef(ifc).ref}`); + this.code.line(`:implements: ${this.renderTypeRef(this.findType(ifc)).ref}`); } if (abstract) { @@ -230,7 +230,7 @@ class SphinxDocsGenerator extends Generator { this.renderMethodParameters(cls.initializer); } - this.namespaceStack.push({ name: className, underClass: true }); + this.namespaceStack.push({ name: className, underClass: true }); } protected onEndClass(cls: spec.ClassType) { @@ -337,7 +337,7 @@ class SphinxDocsGenerator extends Generator { this.code.line(); for (const base of ifc.interfaces || []) { - this.code.line(`:extends: ${this.renderTypeRef(base).ref}`); + this.code.line(`:extends: ${this.renderTypeRef(this.findType(base)).ref}`); } this.code.line(); @@ -361,7 +361,7 @@ class SphinxDocsGenerator extends Generator { this.renderProperty(ifc, property); } - private renderInheritedMembers(entity: spec.ClassType | spec.InterfaceType) { + private renderInheritedMembers(entity: spec.ClassType | spec.InterfaceType) { const inherited = this.getInheritedMembers(entity); if (Object.keys(inherited).length === 0) { return; } for (const source of Object.keys(inherited).sort()) { @@ -379,39 +379,39 @@ class SphinxDocsGenerator extends Generator { } private getInheritedMembers(entity: spec.ClassType | spec.InterfaceType): InheritedMembers { - const parents = parentTypes(entity); + const parents = parentTypes.call(this, entity); const knownMembers = new Set([ - ...(entity.methods || []).map(m => m.name!), - ...(entity.properties || []).map(p => p.name) + ...(entity.methods || []).map(m => m.name!), + ...(entity.properties || []).map(p => p.name) ]); const result: InheritedMembers = {}; for (const parent of parents) { - const parentType = this.findType(parent.fqn) as spec.ClassType | spec.InterfaceType; + const parentType = this.findType(parent.fqn) as spec.ClassType | spec.InterfaceType; for (const method of parentType.methods || []) { if (method.static || knownMembers.has(method.name!)) { continue; } - result[parentType.fqn] = result[parentType.fqn] || { methods: [], properties: [] }; + result[parentType.fqn] = result[parentType.fqn] || { methods: [], properties: [] }; result[parentType.fqn].methods.push(method); knownMembers.add(method.name!); } for (const property of parentType.properties || []) { if (property.static || knownMembers.has(property.name!)) { continue; } - result[parentType.fqn] = result[parentType.fqn] || { methods: [], properties: [] }; + result[parentType.fqn] = result[parentType.fqn] || { methods: [], properties: [] }; result[parentType.fqn].properties.push(property); knownMembers.add(property.name); } - for (const superType of parentTypes(parentType)) { + for (const superType of parentTypes.call(this, parentType)) { parents.push(superType); } } return result; - function parentTypes(type: spec.ClassType | spec.InterfaceType) { + function parentTypes(this: SphinxDocsGenerator, type: spec.ClassType | spec.InterfaceType) { const types = new Array(); if (spec.isClassType(type) && type.base) { - types.push(type.base); + types.push(this.findType(type.base)); } if (type.interfaces) { - types.push(...type.interfaces); + types.push(...type.interfaces.map(fqn => this.findType(fqn))); } return types; } @@ -450,7 +450,7 @@ class SphinxDocsGenerator extends Generator { this.tocPath.pop(); } - private renderMethodSignature(method: spec.Method) { + private renderMethodSignature(method: spec.Method | spec.Initializer) { const params = method.parameters || []; let signature = '('; let signaturePosfix = ''; @@ -460,7 +460,8 @@ class SphinxDocsGenerator extends Generator { signature += ', '; } - if (p.type.optional && !params.slice(idx + 1).find(e => !e.type.optional)) { + // Mark parameter as "optional" if it's type is optional, and all subsequent parameters are optional/variadic + if (p.optional) { signature += '['; signaturePosfix += ']'; } @@ -474,9 +475,8 @@ class SphinxDocsGenerator extends Generator { signature += signaturePosfix; signature += ')'; - let retType; - if (method.returns) { - retType = this.renderTypeRef(method.returns!); + if (spec.isMethod(method) && method.returns) { + const retType = this.renderOptionalValue(method.returns); const retSignature = method.returns ? ` -> ${retType.display}` : ''; signature += retSignature; } @@ -484,7 +484,7 @@ class SphinxDocsGenerator extends Generator { return signature; } - private renderMethodParameters(method: spec.Method) { + private renderMethodParameters(method: spec.Method | spec.Initializer) { const params = method.parameters || []; for (const p of params) { @@ -508,11 +508,11 @@ class SphinxDocsGenerator extends Generator { this.code.line(`*Inherited from* :py:meth:\`${inheritedFrom} <${inheritedFrom}.${method.name}>\``); } else if (method.overrides) { this.code.line(); - const superType = this.findType(method.overrides.fqn) as spec.ClassType | spec.InterfaceType; - if (spec.isInterfaceType(superType) || superType.methods!.find(m => m.name === method.name && !!m.abstract)) { - this.code.line(`*Implements* :py:meth:\`${method.overrides.fqn}.${method.name}\``); + const superType = this.findType(method.overrides) as spec.ClassType | spec.InterfaceType; + if (spec.isInterfaceType(superType) || superType.methods!.some(m => m.name === method.name && !!m.abstract)) { + this.code.line(`*Implements* :py:meth:\`${method.overrides}.${method.name}\``); } else { - this.code.line(`*Overrides* :py:meth:\`${method.overrides.fqn}.${method.name}\``); + this.code.line(`*Overrides* :py:meth:\`${method.overrides}.${method.name}\``); } } this.renderDocsLine(method); @@ -532,7 +532,7 @@ class SphinxDocsGenerator extends Generator { } if (method.returns) { - this.code.line(`:rtype: ${this.renderTypeRef(method.returns!).ref}`); + this.code.line(`:rtype: ${this.renderOptionalValue(method.returns).ref}`); } if (method.abstract) { @@ -579,6 +579,19 @@ class SphinxDocsGenerator extends Generator { } } + private renderOptionalValue(optionalValue: spec.OptionalValue): { display: string, ref: string } { + const result = this.renderTypeRef(optionalValue.type); + if (optionalValue.optional && !isAny(optionalValue.type)) { + result.ref = `${result.ref} *(optional)*`; + } + return result; + + function isAny(type: spec.TypeReference): boolean { + return spec.isPrimitiveTypeReference(type) + && type.primitive === spec.PrimitiveType.Any; + } + } + private renderTypeRef(type: spec.TypeReference): { display: string, ref: string } { let result: { display: string, ref: string }; if (spec.isNamedTypeReference(type)) { @@ -622,7 +635,6 @@ class SphinxDocsGenerator extends Generator { } else { throw new Error('Unexpected type ref'); } - if (type.optional) { result.ref = `${result.ref} *(optional)*`; } return result; // Wrap a string between parenthesis if it contains " or " @@ -634,18 +646,18 @@ class SphinxDocsGenerator extends Generator { private renderProperty(parent: spec.TypeBase, prop: spec.Property, inheritedFrom?: string) { this.code.line(); - const type = this.renderTypeRef(prop.type); + const type = this.renderOptionalValue(prop); this.code.openBlock(`.. py:attribute:: ${prop.name}`); if (inheritedFrom) { this.code.line(); this.code.line(`*Inherited from* :py:attr:\`${inheritedFrom} <${inheritedFrom}.${prop.name}>\``); } else if (prop.overrides) { this.code.line(); - const superType = this.findType(prop.overrides.fqn) as spec.ClassType | spec.InterfaceType; - if (spec.isInterfaceType(superType) || superType.properties!.find(p => p.name === prop.name && !!p.abstract)) { - this.code.line(`*Implements* :py:meth:\`${prop.overrides.fqn}.${prop.name}\``); + const superType = this.findType(prop.overrides) as spec.ClassType | spec.InterfaceType; + if (spec.isInterfaceType(superType) || superType.properties!.some(p => p.name === prop.name && !!p.abstract)) { + this.code.line(`*Implements* :py:meth:\`${prop.overrides}.${prop.name}\``); } else { - this.code.line(`*Overrides* :py:attr:\`${prop.overrides.fqn}.${prop.name}\``); + this.code.line(`*Overrides* :py:attr:\`${prop.overrides}.${prop.name}\``); } } this.renderDocsLine(prop); @@ -767,4 +779,4 @@ function formatLanguage(language: string): string { } } -type InheritedMembers = { [typeFqn: string]: { methods: spec.Method[], properties: spec.Property[] } }; +type InheritedMembers = { [typeFqn: string]: { methods: spec.Method[], properties: spec.Property[] } }; diff --git a/packages/jsii-pacmak/package-lock.json b/packages/jsii-pacmak/package-lock.json index 6fcbfc40f3..99462e8b47 100644 --- a/packages/jsii-pacmak/package-lock.json +++ b/packages/jsii-pacmak/package-lock.json @@ -1,6 +1,6 @@ { "name": "jsii-pacmak", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2756,9 +2756,9 @@ "dev": true }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", "dev": true }, "unicode-length": { diff --git a/packages/jsii-pacmak/package.json b/packages/jsii-pacmak/package.json index 87b09cc831..4f35d0ac29 100644 --- a/packages/jsii-pacmak/package.json +++ b/packages/jsii-pacmak/package.json @@ -46,7 +46,7 @@ "jsii-java-runtime": "^0.9.0", "nodeunit": "^0.11.3", "tslint": "^5.13.1", - "typescript": "^3.3.3333" + "typescript": "^3.4.2" }, "author": { "name": "Amazon Web Services", diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii index bf8ca01439..13a139704e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii @@ -9,7 +9,6 @@ }, "dependencies": { "@scope/jsii-calc-base-of-base": { - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", @@ -28,7 +27,8 @@ "python": { "distName": "scope.jsii-calc-base-of-base", "module": "scope.jsii_calc_base_of_base" - } + }, + "sphinx": {} }, "version": "0.9.0" } @@ -42,7 +42,7 @@ "type": "git", "url": "https://github.com/awslabs/jsii.git" }, - "schema": "jsii/1.0", + "schema": "jsii/0.10.0", "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", @@ -61,7 +61,8 @@ "python": { "distName": "scope.jsii-calc-base", "module": "scope.jsii_calc_base" - } + }, + "sphinx": {} }, "types": { "@scope/jsii-calc-base.Base": { @@ -71,9 +72,7 @@ "summary": "A base class." }, "fqn": "@scope/jsii-calc-base.Base", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/index.ts", @@ -90,7 +89,9 @@ }, "name": "typeName", "returns": { - "primitive": "any" + "type": { + "primitive": "any" + } } } ], @@ -101,9 +102,7 @@ "datatype": true, "fqn": "@scope/jsii-calc-base.BaseProps", "interfaces": [ - { - "fqn": "@scope/jsii-calc-base-of-base.VeryBaseProps" - } + "@scope/jsii-calc-base-of-base.VeryBaseProps" ], "kind": "interface", "locationInModule": { @@ -128,5 +127,5 @@ } }, "version": "0.9.0", - "fingerprint": "kY67AXY3VfrjDTcaGA947JNHQsShp1+YEr9p0JkgKW4=" + "fingerprint": "iWT7GmFaVPERM/zg8WXtKv7ydudD28ixjJDVfms7DJ4=" } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/Base.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/Base.cs index c38472e6b3..5e59669e18 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/Base.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/Base.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace { /// A base class. - [JsiiClass(typeof(Base), "@scope/jsii-calc-base.Base", "[]")] + [JsiiClass(nativeType: typeof(Base), fullyQualifiedName: "@scope/jsii-calc-base.Base")] public abstract class Base : DeputyBase { protected Base(): base(new DeputyProps(new object[]{})) @@ -19,7 +19,7 @@ protected Base(DeputyProps props): base(props) } /// the name of the class (to verify native type names are created for derived classes). - [JsiiMethod("typeName", "{\"primitive\":\"any\"}", "[]")] + [JsiiMethod(name: "typeName", returnsJson: "{\"type\":{\"primitive\":\"any\"}}")] public virtual object TypeName() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BaseProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BaseProps.cs index 09db349e44..8375179bce 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BaseProps.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BaseProps.cs @@ -6,14 +6,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace [JsiiByValue] public class BaseProps : IBaseProps { - [JsiiProperty("bar", "{\"primitive\":\"string\"}", true)] + [JsiiProperty(name: "bar", typeJson: "{\"primitive\":\"string\"}", isOverride: true)] public string Bar { get; set; } - [JsiiProperty("foo", "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}", true)] + [JsiiProperty(name: "foo", typeJson: "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}", isOverride: true)] public Very Foo { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BasePropsProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BasePropsProxy.cs index 136c2c212b..b7506a38c9 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BasePropsProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BasePropsProxy.cs @@ -3,20 +3,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace { - [JsiiTypeProxy(typeof(IBaseProps), "@scope/jsii-calc-base.BaseProps")] + [JsiiTypeProxy(nativeType: typeof(IBaseProps), fullyQualifiedName: "@scope/jsii-calc-base.BaseProps")] internal sealed class BasePropsProxy : DeputyBase, IBaseProps { private BasePropsProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("bar", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "bar", typeJson: "{\"primitive\":\"string\"}")] public string Bar { get => GetInstanceProperty(); } - [JsiiProperty("foo", "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}")] + [JsiiProperty(name: "foo", typeJson: "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}")] public Very Foo { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BaseProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BaseProxy.cs index 032ef8a878..dfc0192cb2 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BaseProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BaseProxy.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace { /// A base class. - [JsiiTypeProxy(typeof(Base), "@scope/jsii-calc-base.Base")] + [JsiiTypeProxy(nativeType: typeof(Base), fullyQualifiedName: "@scope/jsii-calc-base.Base")] internal sealed class BaseProxy : Base { private BaseProxy(ByRefValue reference): base(reference) diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/IBaseProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/IBaseProps.cs index 29118a294e..4031b03010 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/IBaseProps.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/IBaseProps.cs @@ -3,10 +3,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace { - [JsiiInterface(typeof(IBaseProps), "@scope/jsii-calc-base.BaseProps")] + [JsiiInterface(nativeType: typeof(IBaseProps), fullyQualifiedName: "@scope/jsii-calc-base.BaseProps")] public interface IBaseProps : IVeryBaseProps { - [JsiiProperty("bar", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "bar", typeJson: "{\"primitive\":\"string\"}")] string Bar { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/java/src/main/java/software/amazon/jsii/tests/calculator/base/Base.java b/packages/jsii-pacmak/test/expected.jsii-calc-base/java/src/main/java/software/amazon/jsii/tests/calculator/base/Base.java index aa712c99bf..d1bc742519 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/java/src/main/java/software/amazon/jsii/tests/calculator/base/Base.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/java/src/main/java/software/amazon/jsii/tests/calculator/base/Base.java @@ -17,6 +17,7 @@ public Base() { /** * @return the name of the class (to verify native type names are created for derived classes). */ + @javax.annotation.Nullable public java.lang.Object typeName() { return this.jsiiCall("typeName", java.lang.Object.class); } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii index ac108a701f..471b302e03 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii @@ -11,7 +11,6 @@ "@scope/jsii-calc-base": { "dependencies": { "@scope/jsii-calc-base-of-base": { - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", @@ -30,12 +29,12 @@ "python": { "distName": "scope.jsii-calc-base-of-base", "module": "scope.jsii_calc_base_of_base" - } + }, + "sphinx": {} }, "version": "0.9.0" } }, - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", @@ -54,7 +53,8 @@ "python": { "distName": "scope.jsii-calc-base", "module": "scope.jsii_calc_base" - } + }, + "sphinx": {} }, "version": "0.9.0" } @@ -68,7 +68,7 @@ "type": "git", "url": "https://github.com/awslabs/jsii.git" }, - "schema": "jsii/1.0", + "schema": "jsii/0.10.0", "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace", @@ -87,7 +87,8 @@ "python": { "distName": "scope.jsii-calc-lib", "module": "scope.jsii_calc_lib" - } + }, + "sphinx": {} }, "types": { "@scope/jsii-calc-lib.EnumFromScopedModule": { @@ -162,7 +163,9 @@ }, "name": "hello", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -220,23 +223,21 @@ "line": 78 }, "name": "firstOptional", + "optional": true, "type": { "collection": { "elementtype": { "primitive": "string" }, "kind": "array" - }, - "optional": true + } } } ] }, "@scope/jsii-calc-lib.Number": { "assembly": "@scope/jsii-calc-lib", - "base": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "base": "@scope/jsii-calc-lib.Value", "docs": { "summary": "Represents a concrete number." }, @@ -245,7 +246,6 @@ "docs": { "summary": "Creates a Number object." }, - "initializer": true, "parameters": [ { "docs": { @@ -259,9 +259,7 @@ ] }, "interfaces": [ - { - "fqn": "@scope/jsii-calc-lib.IDoublable" - } + "@scope/jsii-calc-lib.IDoublable" ], "kind": "class", "locationInModule": { @@ -280,9 +278,7 @@ "line": 42 }, "name": "doubleValue", - "overrides": { - "fqn": "@scope/jsii-calc-lib.IDoublable" - }, + "overrides": "@scope/jsii-calc-lib.IDoublable", "type": { "primitive": "number" } @@ -297,9 +293,7 @@ "line": 35 }, "name": "value", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "overrides": "@scope/jsii-calc-lib.Value", "type": { "primitive": "number" } @@ -309,16 +303,12 @@ "@scope/jsii-calc-lib.Operation": { "abstract": true, "assembly": "@scope/jsii-calc-lib", - "base": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "base": "@scope/jsii-calc-lib.Value", "docs": { "summary": "Represents an operation on values." }, "fqn": "@scope/jsii-calc-lib.Operation", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/index.ts", @@ -335,11 +325,11 @@ "line": 51 }, "name": "toString", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "overrides": "@scope/jsii-calc-lib.Value", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -370,8 +360,8 @@ "line": 88 }, "name": "optional1", + "optional": true, "type": { - "optional": true, "primitive": "string" } }, @@ -383,8 +373,8 @@ "line": 89 }, "name": "optional2", + "optional": true, "type": { - "optional": true, "primitive": "number" } }, @@ -396,8 +386,8 @@ "line": 90 }, "name": "optional3", + "optional": true, "type": { - "optional": true, "primitive": "boolean" } } @@ -406,16 +396,12 @@ "@scope/jsii-calc-lib.Value": { "abstract": true, "assembly": "@scope/jsii-calc-lib", - "base": { - "fqn": "@scope/jsii-calc-base.Base" - }, + "base": "@scope/jsii-calc-base.Base", "docs": { "summary": "Abstract class which represents a numeric value." }, "fqn": "@scope/jsii-calc-lib.Value", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/index.ts", @@ -432,7 +418,9 @@ }, "name": "toString", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -457,5 +445,5 @@ } }, "version": "0.9.0", - "fingerprint": "LOjIAgmz/zd3aDBrJaHLXGI+I49sXkgLvihvuzZDPAY=" + "fingerprint": "/aA8aq2OBJL26oZOAhZj4Gi1QaKDqfEKQj3ONPxmbBM=" } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/EnumFromScopedModule.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/EnumFromScopedModule.cs index 9f4816c86d..15aaf5cdd5 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/EnumFromScopedModule.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/EnumFromScopedModule.cs @@ -3,12 +3,12 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// Check that enums from \@scoped packages can be references. See awslabs/jsii#138. - [JsiiEnum(typeof(EnumFromScopedModule), "@scope/jsii-calc-lib.EnumFromScopedModule")] + [JsiiEnum(nativeType: typeof(EnumFromScopedModule), fullyQualifiedName: "@scope/jsii-calc-lib.EnumFromScopedModule")] public enum EnumFromScopedModule { - [JsiiEnumMember("Value1")] + [JsiiEnumMember(name: "Value1")] Value1, - [JsiiEnumMember("Value2")] + [JsiiEnumMember(name: "Value2")] Value2 } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IDoublableProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IDoublableProxy.cs index 2d5c772875..1507eac532 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IDoublableProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IDoublableProxy.cs @@ -3,14 +3,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// The general contract for a concrete number. - [JsiiTypeProxy(typeof(IIDoublable), "@scope/jsii-calc-lib.IDoublable")] + [JsiiTypeProxy(nativeType: typeof(IIDoublable), fullyQualifiedName: "@scope/jsii-calc-lib.IDoublable")] internal sealed class IDoublableProxy : DeputyBase, IIDoublable { private IDoublableProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("doubleValue", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "doubleValue", typeJson: "{\"primitive\":\"number\"}")] public double DoubleValue { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IFriendlyProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IFriendlyProxy.cs index f7c40ae621..c1378f9ed1 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IFriendlyProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IFriendlyProxy.cs @@ -7,7 +7,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace /// These classes can be greeted with /// a "hello" or "goodbye" blessing and they will respond back in a fun and friendly manner. /// - [JsiiTypeProxy(typeof(IIFriendly), "@scope/jsii-calc-lib.IFriendly")] + [JsiiTypeProxy(nativeType: typeof(IIFriendly), fullyQualifiedName: "@scope/jsii-calc-lib.IFriendly")] internal sealed class IFriendlyProxy : DeputyBase, IIFriendly { private IFriendlyProxy(ByRefValue reference): base(reference) @@ -15,7 +15,7 @@ private IFriendlyProxy(ByRefValue reference): base(reference) } /// Say hello! - [JsiiMethod("hello", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "hello", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public string Hello() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IIDoublable.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IIDoublable.cs index d7260984a8..2951e338b2 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IIDoublable.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IIDoublable.cs @@ -3,10 +3,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// The general contract for a concrete number. - [JsiiInterface(typeof(IIDoublable), "@scope/jsii-calc-lib.IDoublable")] + [JsiiInterface(nativeType: typeof(IIDoublable), fullyQualifiedName: "@scope/jsii-calc-lib.IDoublable")] public interface IIDoublable { - [JsiiProperty("doubleValue", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "doubleValue", typeJson: "{\"primitive\":\"number\"}")] double DoubleValue { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IIFriendly.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IIFriendly.cs index ee2e3ba7a3..e3de88a74c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IIFriendly.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IIFriendly.cs @@ -7,11 +7,11 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace /// These classes can be greeted with /// a "hello" or "goodbye" blessing and they will respond back in a fun and friendly manner. /// - [JsiiInterface(typeof(IIFriendly), "@scope/jsii-calc-lib.IFriendly")] + [JsiiInterface(nativeType: typeof(IIFriendly), fullyQualifiedName: "@scope/jsii-calc-lib.IFriendly")] public interface IIFriendly { /// Say hello! - [JsiiMethod("hello", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "hello", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] string Hello(); } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IMyFirstStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IMyFirstStruct.cs index 9b5f76eb51..25ae8e4aa9 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IMyFirstStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IMyFirstStruct.cs @@ -3,24 +3,24 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// This is the first struct we have created in jsii. - [JsiiInterface(typeof(IMyFirstStruct), "@scope/jsii-calc-lib.MyFirstStruct")] + [JsiiInterface(nativeType: typeof(IMyFirstStruct), fullyQualifiedName: "@scope/jsii-calc-lib.MyFirstStruct")] public interface IMyFirstStruct { /// An awesome number value. - [JsiiProperty("anumber", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "anumber", typeJson: "{\"primitive\":\"number\"}")] double Anumber { get; } /// A string value. - [JsiiProperty("astring", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "astring", typeJson: "{\"primitive\":\"string\"}")] string Astring { get; } - [JsiiProperty("firstOptional", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}},\"optional\":true}")] + [JsiiProperty(name: "firstOptional", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}", isOptional: true)] string[] FirstOptional { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IStructWithOnlyOptionals.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IStructWithOnlyOptionals.cs index 263b45f915..54eb0ea4ff 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IStructWithOnlyOptionals.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IStructWithOnlyOptionals.cs @@ -3,23 +3,23 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// This is a struct with only optional properties. - [JsiiInterface(typeof(IStructWithOnlyOptionals), "@scope/jsii-calc-lib.StructWithOnlyOptionals")] + [JsiiInterface(nativeType: typeof(IStructWithOnlyOptionals), fullyQualifiedName: "@scope/jsii-calc-lib.StructWithOnlyOptionals")] public interface IStructWithOnlyOptionals { /// The first optional! - [JsiiProperty("optional1", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "optional1", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Optional1 { get; } - [JsiiProperty("optional2", "{\"primitive\":\"number\",\"optional\":true}")] + [JsiiProperty(name: "optional2", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] double? Optional2 { get; } - [JsiiProperty("optional3", "{\"primitive\":\"boolean\",\"optional\":true}")] + [JsiiProperty(name: "optional3", typeJson: "{\"primitive\":\"boolean\"}", isOptional: true)] bool? Optional3 { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStruct.cs index 842d620cab..1f788ad924 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStruct.cs @@ -7,7 +7,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace public class MyFirstStruct : IMyFirstStruct { /// An awesome number value. - [JsiiProperty("anumber", "{\"primitive\":\"number\"}", true)] + [JsiiProperty(name: "anumber", typeJson: "{\"primitive\":\"number\"}", isOverride: true)] public double Anumber { get; @@ -15,14 +15,14 @@ public double Anumber } /// A string value. - [JsiiProperty("astring", "{\"primitive\":\"string\"}", true)] + [JsiiProperty(name: "astring", typeJson: "{\"primitive\":\"string\"}", isOverride: true)] public string Astring { get; set; } - [JsiiProperty("firstOptional", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}},\"optional\":true}", true)] + [JsiiProperty(name: "firstOptional", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}", isOptional: true, isOverride: true)] public string[] FirstOptional { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStructProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStructProxy.cs index 7ec0448ead..f7405549b1 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStructProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStructProxy.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// This is the first struct we have created in jsii. - [JsiiTypeProxy(typeof(IMyFirstStruct), "@scope/jsii-calc-lib.MyFirstStruct")] + [JsiiTypeProxy(nativeType: typeof(IMyFirstStruct), fullyQualifiedName: "@scope/jsii-calc-lib.MyFirstStruct")] internal sealed class MyFirstStructProxy : DeputyBase, IMyFirstStruct { private MyFirstStructProxy(ByRefValue reference): base(reference) @@ -11,20 +11,20 @@ private MyFirstStructProxy(ByRefValue reference): base(reference) } /// An awesome number value. - [JsiiProperty("anumber", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "anumber", typeJson: "{\"primitive\":\"number\"}")] public double Anumber { get => GetInstanceProperty(); } /// A string value. - [JsiiProperty("astring", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "astring", typeJson: "{\"primitive\":\"string\"}")] public string Astring { get => GetInstanceProperty(); } - [JsiiProperty("firstOptional", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}},\"optional\":true}")] + [JsiiProperty(name: "firstOptional", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}", isOptional: true)] public string[] FirstOptional { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Number.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Number.cs index e19ce0ad51..bc1268d445 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Number.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Number.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// Represents a concrete number. - [JsiiClass(typeof(Number), "@scope/jsii-calc-lib.Number", "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiClass(nativeType: typeof(Number), fullyQualifiedName: "@scope/jsii-calc-lib.Number", parametersJson: "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] public class Number : Value_, IIDoublable { public Number(double value): base(new DeputyProps(new object[]{value})) @@ -19,14 +19,14 @@ protected Number(DeputyProps props): base(props) } /// The number multiplied by 2. - [JsiiProperty("doubleValue", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "doubleValue", typeJson: "{\"primitive\":\"number\"}")] public virtual double DoubleValue { get => GetInstanceProperty(); } /// The number. - [JsiiProperty("value", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"number\"}")] public override double Value { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Operation.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Operation.cs index f1127303fe..0078061388 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Operation.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Operation.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// Represents an operation on values. - [JsiiClass(typeof(Operation), "@scope/jsii-calc-lib.Operation", "[]")] + [JsiiClass(nativeType: typeof(Operation), fullyQualifiedName: "@scope/jsii-calc-lib.Operation")] public abstract class Operation : Value_ { protected Operation(): base(new DeputyProps(new object[]{})) @@ -19,7 +19,7 @@ protected Operation(DeputyProps props): base(props) } /// String representation of the value. - [JsiiMethod("toString", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "toString", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public override abstract string ToString(); } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/OperationProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/OperationProxy.cs index d12a386669..e42cb8cd54 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/OperationProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/OperationProxy.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// Represents an operation on values. - [JsiiTypeProxy(typeof(Operation), "@scope/jsii-calc-lib.Operation")] + [JsiiTypeProxy(nativeType: typeof(Operation), fullyQualifiedName: "@scope/jsii-calc-lib.Operation")] internal sealed class OperationProxy : Operation { private OperationProxy(ByRefValue reference): base(reference) @@ -11,14 +11,14 @@ private OperationProxy(ByRefValue reference): base(reference) } /// The value. - [JsiiProperty("value", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"number\"}")] public override double Value { get => GetInstanceProperty(); } /// String representation of the value. - [JsiiMethod("toString", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "toString", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public override string ToString() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionals.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionals.cs index e84c4935d4..c0aaa71cc0 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionals.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionals.cs @@ -7,21 +7,21 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace public class StructWithOnlyOptionals : IStructWithOnlyOptionals { /// The first optional! - [JsiiProperty("optional1", "{\"primitive\":\"string\",\"optional\":true}", true)] + [JsiiProperty(name: "optional1", typeJson: "{\"primitive\":\"string\"}", isOptional: true, isOverride: true)] public string Optional1 { get; set; } - [JsiiProperty("optional2", "{\"primitive\":\"number\",\"optional\":true}", true)] + [JsiiProperty(name: "optional2", typeJson: "{\"primitive\":\"number\"}", isOptional: true, isOverride: true)] public double? Optional2 { get; set; } - [JsiiProperty("optional3", "{\"primitive\":\"boolean\",\"optional\":true}", true)] + [JsiiProperty(name: "optional3", typeJson: "{\"primitive\":\"boolean\"}", isOptional: true, isOverride: true)] public bool? Optional3 { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionalsProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionalsProxy.cs index a0968c6c06..a000ad81f0 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionalsProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionalsProxy.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// This is a struct with only optional properties. - [JsiiTypeProxy(typeof(IStructWithOnlyOptionals), "@scope/jsii-calc-lib.StructWithOnlyOptionals")] + [JsiiTypeProxy(nativeType: typeof(IStructWithOnlyOptionals), fullyQualifiedName: "@scope/jsii-calc-lib.StructWithOnlyOptionals")] internal sealed class StructWithOnlyOptionalsProxy : DeputyBase, IStructWithOnlyOptionals { private StructWithOnlyOptionalsProxy(ByRefValue reference): base(reference) @@ -11,19 +11,19 @@ private StructWithOnlyOptionalsProxy(ByRefValue reference): base(reference) } /// The first optional! - [JsiiProperty("optional1", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "optional1", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] public string Optional1 { get => GetInstanceProperty(); } - [JsiiProperty("optional2", "{\"primitive\":\"number\",\"optional\":true}")] + [JsiiProperty(name: "optional2", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] public double? Optional2 { get => GetInstanceProperty(); } - [JsiiProperty("optional3", "{\"primitive\":\"boolean\",\"optional\":true}")] + [JsiiProperty(name: "optional3", typeJson: "{\"primitive\":\"boolean\"}", isOptional: true)] public bool? Optional3 { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/ValueProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/ValueProxy.cs index 8dbda90606..af5e5f8d42 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/ValueProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/ValueProxy.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// Abstract class which represents a numeric value. - [JsiiTypeProxy(typeof(Value_), "@scope/jsii-calc-lib.Value")] + [JsiiTypeProxy(nativeType: typeof(Value_), fullyQualifiedName: "@scope/jsii-calc-lib.Value")] internal sealed class ValueProxy : Value_ { private ValueProxy(ByRefValue reference): base(reference) @@ -11,7 +11,7 @@ private ValueProxy(ByRefValue reference): base(reference) } /// The value. - [JsiiProperty("value", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"number\"}")] public override double Value { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Value_.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Value_.cs index b6d5a90866..1e41259a4e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Value_.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Value_.cs @@ -4,7 +4,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// Abstract class which represents a numeric value. - [JsiiClass(typeof(Value_), "@scope/jsii-calc-lib.Value", "[]")] + [JsiiClass(nativeType: typeof(Value_), fullyQualifiedName: "@scope/jsii-calc-lib.Value")] public abstract class Value_ : Base { protected Value_(): base(new DeputyProps(new object[]{})) @@ -20,14 +20,14 @@ protected Value_(DeputyProps props): base(props) } /// The value. - [JsiiProperty("value", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"number\"}")] public virtual double Value { get => GetInstanceProperty(); } /// String representation of the value. - [JsiiMethod("toString", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "toString", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public override string ToString() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii index 2f0512c021..65fedf4d0d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii @@ -37,7 +37,6 @@ "@scope/jsii-calc-base": { "dependencies": { "@scope/jsii-calc-base-of-base": { - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", @@ -56,12 +55,12 @@ "python": { "distName": "scope.jsii-calc-base-of-base", "module": "scope.jsii_calc_base_of_base" - } + }, + "sphinx": {} }, "version": "0.9.0" } }, - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", @@ -80,12 +79,12 @@ "python": { "distName": "scope.jsii-calc-base", "module": "scope.jsii_calc_base" - } + }, + "sphinx": {} }, "version": "0.9.0" }, "@scope/jsii-calc-base-of-base": { - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", @@ -104,7 +103,8 @@ "python": { "distName": "scope.jsii-calc-base-of-base", "module": "scope.jsii_calc_base_of_base" - } + }, + "sphinx": {} }, "version": "0.9.0" }, @@ -113,7 +113,6 @@ "@scope/jsii-calc-base": { "dependencies": { "@scope/jsii-calc-base-of-base": { - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", @@ -132,12 +131,12 @@ "python": { "distName": "scope.jsii-calc-base-of-base", "module": "scope.jsii_calc_base_of_base" - } + }, + "sphinx": {} }, "version": "0.9.0" } }, - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", @@ -156,12 +155,12 @@ "python": { "distName": "scope.jsii-calc-base", "module": "scope.jsii_calc_base" - } + }, + "sphinx": {} }, "version": "0.9.0" } }, - "peer": true, "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace", @@ -180,7 +179,8 @@ "python": { "distName": "scope.jsii-calc-lib", "module": "scope.jsii_calc_lib" - } + }, + "sphinx": {} }, "version": "0.9.0" } @@ -197,7 +197,7 @@ "type": "git", "url": "https://github.com/awslabs/jsii.git" }, - "schema": "jsii/1.0", + "schema": "jsii/0.10.0", "targets": { "dotnet": { "namespace": "Amazon.JSII.Tests.CalculatorNamespace", @@ -216,23 +216,18 @@ "python": { "distName": "jsii-calc", "module": "jsii_calc" - } + }, + "sphinx": {} }, "types": { "jsii-calc.AbstractClass": { "abstract": true, "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.AbstractClassBase" - }, + "base": "jsii-calc.AbstractClassBase", "fqn": "jsii-calc.AbstractClass", - "initializer": { - "initializer": true - }, + "initializer": {}, "interfaces": [ - { - "fqn": "jsii-calc.IInterfaceImplementedByAbstractClass" - } + "jsii-calc.IInterfaceImplementedByAbstractClass" ], "kind": "class", "locationInModule": { @@ -256,7 +251,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -266,7 +263,9 @@ }, "name": "nonAbstractMethod", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -279,9 +278,7 @@ "line": 1074 }, "name": "propFromInterface", - "overrides": { - "fqn": "jsii-calc.IInterfaceImplementedByAbstractClass" - }, + "overrides": "jsii-calc.IInterfaceImplementedByAbstractClass", "type": { "primitive": "string" } @@ -292,9 +289,7 @@ "abstract": true, "assembly": "jsii-calc", "fqn": "jsii-calc.AbstractClassBase", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -319,9 +314,7 @@ "jsii-calc.AbstractClassReturner": { "assembly": "jsii-calc", "fqn": "jsii-calc.AbstractClassReturner", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -335,7 +328,9 @@ }, "name": "giveMeAbstract", "returns": { - "fqn": "jsii-calc.AbstractClass" + "type": { + "fqn": "jsii-calc.AbstractClass" + } } }, { @@ -345,7 +340,9 @@ }, "name": "giveMeInterface", "returns": { - "fqn": "jsii-calc.IInterfaceImplementedByAbstractClass" + "type": { + "fqn": "jsii-calc.IInterfaceImplementedByAbstractClass" + } } } ], @@ -366,9 +363,7 @@ }, "jsii-calc.Add": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.BinaryOperation" - }, + "base": "jsii-calc.BinaryOperation", "docs": { "summary": "The \"+\" binary operation." }, @@ -377,7 +372,6 @@ "docs": { "summary": "Creates a BinaryOperation." }, - "initializer": true, "parameters": [ { "docs": { @@ -414,11 +408,11 @@ "line": 61 }, "name": "toString", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Operation" - }, + "overrides": "@scope/jsii-calc-lib.Operation", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -434,9 +428,7 @@ "line": 57 }, "name": "value", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "overrides": "@scope/jsii-calc-lib.Value", "type": { "primitive": "number" } @@ -450,9 +442,7 @@ "summary": "This class includes property for all types supported by jsii." }, "fqn": "jsii-calc.AllTypes", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -481,7 +471,9 @@ }, "name": "anyOut", "returns": { - "primitive": "any" + "type": { + "primitive": "any" + } } }, { @@ -499,7 +491,9 @@ } ], "returns": { - "fqn": "jsii-calc.StringEnum" + "type": { + "fqn": "jsii-calc.StringEnum" + } } } ], @@ -768,9 +762,9 @@ "line": 171 }, "name": "optionalEnumValue", + "optional": true, "type": { - "fqn": "jsii-calc.StringEnum", - "optional": true + "fqn": "jsii-calc.StringEnum" } } ] @@ -799,9 +793,7 @@ "jsii-calc.AllowedMethodNames": { "assembly": "jsii-calc", "fqn": "jsii-calc.AllowedMethodNames", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -847,7 +839,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -907,9 +901,7 @@ "jsii-calc.AsyncVirtualMethods": { "assembly": "jsii-calc", "fqn": "jsii-calc.AsyncVirtualMethods", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -917,17 +909,20 @@ }, "methods": [ { + "async": true, "locationInModule": { "filename": "lib/compliance.ts", "line": 309 }, "name": "callMe", "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { + "async": true, "docs": { "summary": "Just calls \"overrideMeToo\"." }, @@ -937,11 +932,13 @@ }, "name": "callMe2", "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { + "async": true, "docs": { "remarks": "This is a \"double promise\" situation, which\nmeans that callbacks are not going to be available immediate, but only\nafter an \"immediates\" cycle.", "summary": "This method calls the \"callMe\" async method indirectly, which will then invoke a virtual method." @@ -952,8 +949,9 @@ }, "name": "callMeDoublePromise", "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { @@ -963,10 +961,13 @@ }, "name": "dontOverrideMe", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { + "async": true, "locationInModule": { "filename": "lib/compliance.ts", "line": 313 @@ -981,19 +982,22 @@ } ], "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { + "async": true, "locationInModule": { "filename": "lib/compliance.ts", "line": 317 }, "name": "overrideMeToo", "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } } ], @@ -1002,9 +1006,7 @@ "jsii-calc.AugmentableClass": { "assembly": "jsii-calc", "fqn": "jsii-calc.AugmentableClass", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -1031,9 +1033,7 @@ "jsii-calc.BinaryOperation": { "abstract": true, "assembly": "jsii-calc", - "base": { - "fqn": "@scope/jsii-calc-lib.Operation" - }, + "base": "@scope/jsii-calc-lib.Operation", "docs": { "summary": "Represents an operation with two operands." }, @@ -1042,7 +1042,6 @@ "docs": { "summary": "Creates a BinaryOperation." }, - "initializer": true, "parameters": [ { "docs": { @@ -1065,9 +1064,7 @@ ] }, "interfaces": [ - { - "fqn": "@scope/jsii-calc-lib.IFriendly" - } + "@scope/jsii-calc-lib.IFriendly" ], "kind": "class", "locationInModule": { @@ -1084,11 +1081,11 @@ "line": 48 }, "name": "hello", - "overrides": { - "fqn": "@scope/jsii-calc-lib.IFriendly" - }, + "overrides": "@scope/jsii-calc-lib.IFriendly", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -1126,9 +1123,7 @@ }, "jsii-calc.Calculator": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.composition.CompositeOperation" - }, + "base": "jsii-calc.composition.CompositeOperation", "docs": { "summary": "A calculator which maintains a current value and allows adding operations." }, @@ -1137,16 +1132,15 @@ "docs": { "summary": "Creates a Calculator object." }, - "initializer": true, "parameters": [ { "docs": { "summary": "Initialization properties." }, "name": "props", + "optional": true, "type": { - "fqn": "jsii-calc.CalculatorProps", - "optional": true + "fqn": "jsii-calc.CalculatorProps" } } ] @@ -1231,7 +1225,9 @@ }, "name": "readUnionValue", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -1247,9 +1243,7 @@ "line": 310 }, "name": "expression", - "overrides": { - "fqn": "jsii-calc.composition.CompositeOperation" - }, + "overrides": "jsii-calc.composition.CompositeOperation", "type": { "fqn": "@scope/jsii-calc-lib.Value" } @@ -1319,8 +1313,8 @@ "line": 277 }, "name": "maxValue", + "optional": true, "type": { - "optional": true, "primitive": "number" } }, @@ -1333,8 +1327,8 @@ "line": 317 }, "name": "unionProperty", + "optional": true, "type": { - "optional": true, "union": { "types": [ { @@ -1374,8 +1368,8 @@ "line": 236 }, "name": "initialValue", + "optional": true, "type": { - "optional": true, "primitive": "number" } }, @@ -1387,8 +1381,8 @@ "line": 237 }, "name": "maximumValue", + "optional": true, "type": { - "optional": true, "primitive": "number" } } @@ -1397,13 +1391,9 @@ "jsii-calc.ClassThatImplementsTheInternalInterface": { "assembly": "jsii-calc", "fqn": "jsii-calc.ClassThatImplementsTheInternalInterface", - "initializer": { - "initializer": true - }, + "initializer": {}, "interfaces": [ - { - "fqn": "jsii-calc.INonInternalInterface" - } + "jsii-calc.INonInternalInterface" ], "kind": "class", "locationInModule": { @@ -1418,9 +1408,7 @@ "line": 1564 }, "name": "a", - "overrides": { - "fqn": "jsii-calc.IAnotherPublicInterface" - }, + "overrides": "jsii-calc.IAnotherPublicInterface", "type": { "primitive": "string" } @@ -1431,9 +1419,7 @@ "line": 1565 }, "name": "b", - "overrides": { - "fqn": "jsii-calc.INonInternalInterface" - }, + "overrides": "jsii-calc.INonInternalInterface", "type": { "primitive": "string" } @@ -1444,9 +1430,7 @@ "line": 1566 }, "name": "c", - "overrides": { - "fqn": "jsii-calc.INonInternalInterface" - }, + "overrides": "jsii-calc.INonInternalInterface", "type": { "primitive": "string" } @@ -1466,13 +1450,9 @@ "jsii-calc.ClassThatImplementsThePrivateInterface": { "assembly": "jsii-calc", "fqn": "jsii-calc.ClassThatImplementsThePrivateInterface", - "initializer": { - "initializer": true - }, + "initializer": {}, "interfaces": [ - { - "fqn": "jsii-calc.INonInternalInterface" - } + "jsii-calc.INonInternalInterface" ], "kind": "class", "locationInModule": { @@ -1487,9 +1467,7 @@ "line": 1571 }, "name": "a", - "overrides": { - "fqn": "jsii-calc.IAnotherPublicInterface" - }, + "overrides": "jsii-calc.IAnotherPublicInterface", "type": { "primitive": "string" } @@ -1500,9 +1478,7 @@ "line": 1572 }, "name": "b", - "overrides": { - "fqn": "jsii-calc.INonInternalInterface" - }, + "overrides": "jsii-calc.INonInternalInterface", "type": { "primitive": "string" } @@ -1513,9 +1489,7 @@ "line": 1573 }, "name": "c", - "overrides": { - "fqn": "jsii-calc.INonInternalInterface" - }, + "overrides": "jsii-calc.INonInternalInterface", "type": { "primitive": "string" } @@ -1535,9 +1509,7 @@ "jsii-calc.ClassWithMutableObjectLiteralProperty": { "assembly": "jsii-calc", "fqn": "jsii-calc.ClassWithMutableObjectLiteralProperty", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -1564,9 +1536,7 @@ }, "fqn": "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties", "interfaces": [ - { - "fqn": "jsii-calc.IInterfaceWithProperties" - } + "jsii-calc.IInterfaceWithProperties" ], "kind": "class", "locationInModule": { @@ -1595,7 +1565,9 @@ } ], "returns": { - "fqn": "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties" + "type": { + "fqn": "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties" + } }, "static": true } @@ -1609,9 +1581,7 @@ "line": 1141 }, "name": "readOnlyString", - "overrides": { - "fqn": "jsii-calc.IInterfaceWithProperties" - }, + "overrides": "jsii-calc.IInterfaceWithProperties", "type": { "primitive": "string" } @@ -1622,9 +1592,7 @@ "line": 1141 }, "name": "readWriteString", - "overrides": { - "fqn": "jsii-calc.IInterfaceWithProperties" - }, + "overrides": "jsii-calc.IInterfaceWithProperties", "type": { "primitive": "string" } @@ -1635,7 +1603,6 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.ConstructorPassesThisOut", "initializer": { - "initializer": true, "parameters": [ { "name": "consumer", @@ -1655,9 +1622,7 @@ "jsii-calc.Constructors": { "assembly": "jsii-calc", "fqn": "jsii-calc.Constructors", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -1671,7 +1636,9 @@ }, "name": "hiddenInterface", "returns": { - "fqn": "jsii-calc.IPublicInterface" + "type": { + "fqn": "jsii-calc.IPublicInterface" + } }, "static": true }, @@ -1682,11 +1649,13 @@ }, "name": "hiddenInterfaces", "returns": { - "collection": { - "elementtype": { - "fqn": "jsii-calc.IPublicInterface" - }, - "kind": "array" + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.IPublicInterface" + }, + "kind": "array" + } } }, "static": true @@ -1698,11 +1667,13 @@ }, "name": "hiddenSubInterfaces", "returns": { - "collection": { - "elementtype": { - "fqn": "jsii-calc.IPublicInterface" - }, - "kind": "array" + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.IPublicInterface" + }, + "kind": "array" + } } }, "static": true @@ -1714,7 +1685,9 @@ }, "name": "makeClass", "returns": { - "fqn": "jsii-calc.PublicClass" + "type": { + "fqn": "jsii-calc.PublicClass" + } }, "static": true }, @@ -1725,7 +1698,9 @@ }, "name": "makeInterface", "returns": { - "fqn": "jsii-calc.IPublicInterface" + "type": { + "fqn": "jsii-calc.IPublicInterface" + } }, "static": true }, @@ -1736,7 +1711,9 @@ }, "name": "makeInterface2", "returns": { - "fqn": "jsii-calc.IPublicInterface2" + "type": { + "fqn": "jsii-calc.IPublicInterface2" + } }, "static": true }, @@ -1747,11 +1724,13 @@ }, "name": "makeInterfaces", "returns": { - "collection": { - "elementtype": { - "fqn": "jsii-calc.IPublicInterface" - }, - "kind": "array" + "type": { + "collection": { + "elementtype": { + "fqn": "jsii-calc.IPublicInterface" + }, + "kind": "array" + } } }, "static": true @@ -1762,9 +1741,7 @@ "jsii-calc.ConsumersOfThisCrazyTypeSystem": { "assembly": "jsii-calc", "fqn": "jsii-calc.ConsumersOfThisCrazyTypeSystem", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -1786,7 +1763,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -1804,7 +1783,9 @@ } ], "returns": { - "primitive": "any" + "type": { + "primitive": "any" + } } } ], @@ -1814,26 +1795,25 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.DefaultedConstructorArgument", "initializer": { - "initializer": true, "parameters": [ { "name": "arg1", + "optional": true, "type": { - "optional": true, "primitive": "number" } }, { "name": "arg2", + "optional": true, "type": { - "optional": true, "primitive": "string" } }, { "name": "arg3", + "optional": true, "type": { - "optional": true, "primitive": "date" } } @@ -1875,8 +1855,8 @@ "line": 291 }, "name": "arg2", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -1885,9 +1865,7 @@ "jsii-calc.DerivedClassHasNoProperties.Base": { "assembly": "jsii-calc", "fqn": "jsii-calc.DerivedClassHasNoProperties.Base", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -1910,13 +1888,9 @@ }, "jsii-calc.DerivedClassHasNoProperties.Derived": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.DerivedClassHasNoProperties.Base" - }, + "base": "jsii-calc.DerivedClassHasNoProperties.Base", "fqn": "jsii-calc.DerivedClassHasNoProperties.Derived", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -1933,9 +1907,7 @@ }, "fqn": "jsii-calc.DerivedStruct", "interfaces": [ - { - "fqn": "@scope/jsii-calc-lib.MyFirstStruct" - } + "@scope/jsii-calc-lib.MyFirstStruct" ], "kind": "interface", "locationInModule": { @@ -1994,14 +1966,14 @@ "line": 532 }, "name": "anotherOptional", + "optional": true, "type": { "collection": { "elementtype": { "fqn": "@scope/jsii-calc-lib.Value" }, "kind": "map" - }, - "optional": true + } } }, { @@ -2012,8 +1984,8 @@ "line": 528 }, "name": "optionalAny", + "optional": true, "type": { - "optional": true, "primitive": "any" } }, @@ -2025,14 +1997,14 @@ "line": 527 }, "name": "optionalArray", + "optional": true, "type": { "collection": { "elementtype": { "primitive": "string" }, "kind": "array" - }, - "optional": true + } } } ] @@ -2040,9 +2012,7 @@ "jsii-calc.DoNotOverridePrivates": { "assembly": "jsii-calc", "fqn": "jsii-calc.DoNotOverridePrivates", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -2071,7 +2041,9 @@ }, "name": "privateMethodValue", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -2081,7 +2053,9 @@ }, "name": "privatePropertyValue", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -2093,9 +2067,7 @@ "summary": "jsii#284: do not recognize \"any\" as an optional argument." }, "fqn": "jsii-calc.DoNotRecognizeAnyAsOptional", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -2117,15 +2089,15 @@ }, { "name": "_optionalAny", + "optional": true, "type": { - "optional": true, "primitive": "any" } }, { "name": "_optionalString", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -2142,9 +2114,7 @@ "summary": "Here's the first line of the TSDoc comment." }, "fqn": "jsii-calc.DocumentedClass", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/documented.ts", @@ -2168,14 +2138,16 @@ "summary": "The person to be greeted." }, "name": "greetee", + "optional": true, "type": { - "fqn": "jsii-calc.Greetee", - "optional": true + "fqn": "jsii-calc.Greetee" } } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { @@ -2195,9 +2167,7 @@ "jsii-calc.DontComplainAboutVariadicAfterOptional": { "assembly": "jsii-calc", "fqn": "jsii-calc.DontComplainAboutVariadicAfterOptional", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -2213,8 +2183,8 @@ "parameters": [ { "name": "optional", + "optional": true, "type": { - "optional": true, "primitive": "string" } }, @@ -2227,7 +2197,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } }, "variadic": true } @@ -2237,13 +2209,9 @@ "jsii-calc.DoubleTrouble": { "assembly": "jsii-calc", "fqn": "jsii-calc.DoubleTrouble", - "initializer": { - "initializer": true - }, + "initializer": {}, "interfaces": [ - { - "fqn": "jsii-calc.IFriendlyRandomGenerator" - } + "jsii-calc.IFriendlyRandomGenerator" ], "kind": "class", "locationInModule": { @@ -2260,11 +2228,11 @@ "line": 465 }, "name": "hello", - "overrides": { - "fqn": "@scope/jsii-calc-lib.IFriendly" - }, + "overrides": "@scope/jsii-calc-lib.IFriendly", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -2276,11 +2244,11 @@ "line": 461 }, "name": "next", - "overrides": { - "fqn": "jsii-calc.IRandomNumberGenerator" - }, + "overrides": "jsii-calc.IRandomNumberGenerator", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -2289,9 +2257,7 @@ "jsii-calc.EraseUndefinedHashValues": { "assembly": "jsii-calc", "fqn": "jsii-calc.EraseUndefinedHashValues", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -2323,7 +2289,9 @@ } ], "returns": { - "primitive": "boolean" + "type": { + "primitive": "boolean" + } }, "static": true }, @@ -2337,7 +2305,9 @@ }, "name": "prop1IsNull", "returns": { - "primitive": "any" + "type": { + "primitive": "any" + } }, "static": true }, @@ -2351,7 +2321,9 @@ }, "name": "prop2IsUndefined", "returns": { - "primitive": "any" + "type": { + "primitive": "any" + } }, "static": true } @@ -2377,8 +2349,8 @@ "line": 1412 }, "name": "option1", + "optional": true, "type": { - "optional": true, "primitive": "string" } }, @@ -2390,8 +2362,8 @@ "line": 1413 }, "name": "option2", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -2401,7 +2373,6 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.ExportedBaseClass", "initializer": { - "initializer": true, "parameters": [ { "name": "success", @@ -2471,9 +2442,7 @@ "jsii-calc.GiveMeStructs": { "assembly": "jsii-calc", "fqn": "jsii-calc.GiveMeStructs", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -2498,7 +2467,9 @@ } ], "returns": { - "fqn": "@scope/jsii-calc-lib.MyFirstStruct" + "type": { + "fqn": "@scope/jsii-calc-lib.MyFirstStruct" + } } }, { @@ -2519,7 +2490,9 @@ } ], "returns": { - "fqn": "jsii-calc.DoubleTrouble" + "type": { + "fqn": "jsii-calc.DoubleTrouble" + } } }, { @@ -2540,7 +2513,9 @@ } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -2585,8 +2560,8 @@ "line": 46 }, "name": "name", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -2595,9 +2570,7 @@ "jsii-calc.GreetingAugmenter": { "assembly": "jsii-calc", "fqn": "jsii-calc.GreetingAugmenter", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -2619,7 +2592,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -2695,9 +2670,7 @@ }, "fqn": "jsii-calc.IFriendlier", "interfaces": [ - { - "fqn": "@scope/jsii-calc-lib.IFriendly" - } + "@scope/jsii-calc-lib.IFriendly" ], "kind": "interface", "locationInModule": { @@ -2716,7 +2689,9 @@ }, "name": "farewell", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -2731,7 +2706,9 @@ }, "name": "goodbye", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -2741,12 +2718,8 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.IFriendlyRandomGenerator", "interfaces": [ - { - "fqn": "jsii-calc.IRandomNumberGenerator" - }, - { - "fqn": "@scope/jsii-calc-lib.IFriendly" - } + "jsii-calc.IRandomNumberGenerator", + "@scope/jsii-calc-lib.IFriendly" ], "kind": "interface", "locationInModule": { @@ -2789,9 +2762,7 @@ }, "fqn": "jsii-calc.IInterfaceThatShouldNotBeADataType", "interfaces": [ - { - "fqn": "jsii-calc.IInterfaceWithMethods" - } + "jsii-calc.IInterfaceWithMethods" ], "kind": "interface", "locationInModule": { @@ -2896,8 +2867,8 @@ }, { "name": "arg2", + "optional": true, "type": { - "optional": true, "primitive": "number" } } @@ -2945,9 +2916,7 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.IInterfaceWithPropertiesExtension", "interfaces": [ - { - "fqn": "jsii-calc.IInterfaceWithProperties" - } + "jsii-calc.IInterfaceWithProperties" ], "kind": "interface", "locationInModule": { @@ -2973,9 +2942,7 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.IJSII417Derived", "interfaces": [ - { - "fqn": "jsii-calc.IJSII417PublicBaseOfBase" - } + "jsii-calc.IJSII417PublicBaseOfBase" ], "kind": "interface", "locationInModule": { @@ -3077,9 +3044,7 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.INonInternalInterface", "interfaces": [ - { - "fqn": "jsii-calc.IAnotherPublicInterface" - } + "jsii-calc.IAnotherPublicInterface" ], "kind": "interface", "locationInModule": { @@ -3153,7 +3118,9 @@ }, "name": "bye", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -3176,7 +3143,9 @@ }, "name": "ciao", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -3206,7 +3175,9 @@ }, "name": "next", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -3229,7 +3200,9 @@ }, "name": "obtainNumber", "returns": { - "fqn": "@scope/jsii-calc-lib.IDoublable" + "type": { + "fqn": "@scope/jsii-calc-lib.IDoublable" + } } } ], @@ -3252,9 +3225,7 @@ "jsii-calc.ImplementInternalInterface": { "assembly": "jsii-calc", "fqn": "jsii-calc.ImplementInternalInterface", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -3277,13 +3248,9 @@ "jsii-calc.ImplementsInterfaceWithInternal": { "assembly": "jsii-calc", "fqn": "jsii-calc.ImplementsInterfaceWithInternal", - "initializer": { - "initializer": true - }, + "initializer": {}, "interfaces": [ - { - "fqn": "jsii-calc.IInterfaceWithInternal" - } + "jsii-calc.IInterfaceWithInternal" ], "kind": "class", "locationInModule": { @@ -3297,22 +3264,16 @@ "line": 1487 }, "name": "visible", - "overrides": { - "fqn": "jsii-calc.IInterfaceWithInternal" - } + "overrides": "jsii-calc.IInterfaceWithInternal" } ], "name": "ImplementsInterfaceWithInternal" }, "jsii-calc.ImplementsInterfaceWithInternalSubclass": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.ImplementsInterfaceWithInternal" - }, + "base": "jsii-calc.ImplementsInterfaceWithInternal", "fqn": "jsii-calc.ImplementsInterfaceWithInternalSubclass", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -3323,9 +3284,7 @@ "jsii-calc.ImplementsPrivateInterface": { "assembly": "jsii-calc", "fqn": "jsii-calc.ImplementsPrivateInterface", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -3350,9 +3309,7 @@ "datatype": true, "fqn": "jsii-calc.ImplictBaseOfBase", "interfaces": [ - { - "fqn": "@scope/jsii-calc-base.BaseProps" - } + "@scope/jsii-calc-base.BaseProps" ], "kind": "interface", "locationInModule": { @@ -3377,17 +3334,11 @@ }, "jsii-calc.InbetweenClass": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.PublicClass" - }, + "base": "jsii-calc.PublicClass", "fqn": "jsii-calc.InbetweenClass", - "initializer": { - "initializer": true - }, + "initializer": {}, "interfaces": [ - { - "fqn": "jsii-calc.IPublicInterface2" - } + "jsii-calc.IPublicInterface2" ], "kind": "class", "locationInModule": { @@ -3401,11 +3352,11 @@ "line": 1346 }, "name": "ciao", - "overrides": { - "fqn": "jsii-calc.IPublicInterface2" - }, + "overrides": "jsii-calc.IPublicInterface2", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -3414,9 +3365,7 @@ "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo": { "assembly": "jsii-calc", "fqn": "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -3431,8 +3380,8 @@ "line": 1038 }, "name": "bar", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -3492,12 +3441,9 @@ }, "jsii-calc.JSII417Derived": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.JSII417PublicBaseOfBase" - }, + "base": "jsii-calc.JSII417PublicBaseOfBase", "fqn": "jsii-calc.JSII417Derived", "initializer": { - "initializer": true, "parameters": [ { "name": "property", @@ -3547,9 +3493,7 @@ "jsii-calc.JSII417PublicBaseOfBase": { "assembly": "jsii-calc", "fqn": "jsii-calc.JSII417PublicBaseOfBase", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/erasures.ts", @@ -3563,7 +3507,9 @@ }, "name": "makeInstance", "returns": { - "fqn": "jsii-calc.JSII417PublicBaseOfBase" + "type": { + "fqn": "jsii-calc.JSII417PublicBaseOfBase" + } }, "static": true }, @@ -3593,9 +3539,7 @@ "jsii-calc.JSObjectLiteralForInterface": { "assembly": "jsii-calc", "fqn": "jsii-calc.JSObjectLiteralForInterface", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -3609,7 +3553,9 @@ }, "name": "giveMeFriendly", "returns": { - "fqn": "@scope/jsii-calc-lib.IFriendly" + "type": { + "fqn": "@scope/jsii-calc-lib.IFriendly" + } } }, { @@ -3619,7 +3565,9 @@ }, "name": "giveMeFriendlyGenerator", "returns": { - "fqn": "jsii-calc.IFriendlyRandomGenerator" + "type": { + "fqn": "jsii-calc.IFriendlyRandomGenerator" + } } } ], @@ -3628,9 +3576,7 @@ "jsii-calc.JSObjectLiteralToNative": { "assembly": "jsii-calc", "fqn": "jsii-calc.JSObjectLiteralToNative", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -3644,7 +3590,9 @@ }, "name": "returnLiteral", "returns": { - "fqn": "jsii-calc.JSObjectLiteralToNativeClass" + "type": { + "fqn": "jsii-calc.JSObjectLiteralToNativeClass" + } } } ], @@ -3653,9 +3601,7 @@ "jsii-calc.JSObjectLiteralToNativeClass": { "assembly": "jsii-calc", "fqn": "jsii-calc.JSObjectLiteralToNativeClass", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -3688,9 +3634,7 @@ "jsii-calc.JavaReservedWords": { "assembly": "jsii-calc", "fqn": "jsii-calc.JavaReservedWords", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -4082,9 +4026,7 @@ "summary": "Host runtime version should be set via JSII_AGENT." }, "fqn": "jsii-calc.JsiiAgent", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -4102,9 +4044,9 @@ "line": 1314 }, "name": "jsiiAgent", + "optional": true, "static": true, "type": { - "optional": true, "primitive": "string" } } @@ -4137,8 +4079,8 @@ "line": 1265 }, "name": "containerPort", + "optional": true, "type": { - "optional": true, "primitive": "number" } }, @@ -4155,8 +4097,8 @@ "line": 1236 }, "name": "cpu", + "optional": true, "type": { - "optional": true, "primitive": "string" } }, @@ -4173,8 +4115,8 @@ "line": 1258 }, "name": "memoryMiB", + "optional": true, "type": { - "optional": true, "primitive": "string" } }, @@ -4190,8 +4132,8 @@ "line": 1272 }, "name": "publicLoadBalancer", + "optional": true, "type": { - "optional": true, "primitive": "boolean" } }, @@ -4207,8 +4149,8 @@ "line": 1279 }, "name": "publicTasks", + "optional": true, "type": { - "optional": true, "primitive": "boolean" } } @@ -4216,9 +4158,7 @@ }, "jsii-calc.Multiply": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.BinaryOperation" - }, + "base": "jsii-calc.BinaryOperation", "docs": { "summary": "The \"*\" binary operation." }, @@ -4227,7 +4167,6 @@ "docs": { "summary": "Creates a BinaryOperation." }, - "initializer": true, "parameters": [ { "docs": { @@ -4250,12 +4189,8 @@ ] }, "interfaces": [ - { - "fqn": "jsii-calc.IFriendlier" - }, - { - "fqn": "jsii-calc.IRandomNumberGenerator" - } + "jsii-calc.IFriendlier", + "jsii-calc.IRandomNumberGenerator" ], "kind": "class", "locationInModule": { @@ -4272,11 +4207,11 @@ "line": 82 }, "name": "farewell", - "overrides": { - "fqn": "jsii-calc.IFriendlier" - }, + "overrides": "jsii-calc.IFriendlier", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -4288,11 +4223,11 @@ "line": 78 }, "name": "goodbye", - "overrides": { - "fqn": "jsii-calc.IFriendlier" - }, + "overrides": "jsii-calc.IFriendlier", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -4304,11 +4239,11 @@ "line": 86 }, "name": "next", - "overrides": { - "fqn": "jsii-calc.IRandomNumberGenerator" - }, + "overrides": "jsii-calc.IRandomNumberGenerator", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { @@ -4320,11 +4255,11 @@ "line": 74 }, "name": "toString", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Operation" - }, + "overrides": "@scope/jsii-calc-lib.Operation", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -4340,9 +4275,7 @@ "line": 70 }, "name": "value", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "overrides": "@scope/jsii-calc-lib.Value", "type": { "primitive": "number" } @@ -4351,15 +4284,12 @@ }, "jsii-calc.Negate": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.UnaryOperation" - }, + "base": "jsii-calc.UnaryOperation", "docs": { "summary": "The negation operation (\"-value\")." }, "fqn": "jsii-calc.Negate", "initializer": { - "initializer": true, "parameters": [ { "name": "operand", @@ -4370,9 +4300,7 @@ ] }, "interfaces": [ - { - "fqn": "jsii-calc.IFriendlier" - } + "jsii-calc.IFriendlier" ], "kind": "class", "locationInModule": { @@ -4389,11 +4317,11 @@ "line": 120 }, "name": "farewell", - "overrides": { - "fqn": "jsii-calc.IFriendlier" - }, + "overrides": "jsii-calc.IFriendlier", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -4405,11 +4333,11 @@ "line": 116 }, "name": "goodbye", - "overrides": { - "fqn": "jsii-calc.IFriendlier" - }, + "overrides": "jsii-calc.IFriendlier", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -4421,11 +4349,11 @@ "line": 112 }, "name": "hello", - "overrides": { - "fqn": "@scope/jsii-calc-lib.IFriendly" - }, + "overrides": "@scope/jsii-calc-lib.IFriendly", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -4437,11 +4365,11 @@ "line": 108 }, "name": "toString", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Operation" - }, + "overrides": "@scope/jsii-calc-lib.Operation", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -4457,9 +4385,7 @@ "line": 104 }, "name": "value", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "overrides": "@scope/jsii-calc-lib.Value", "type": { "primitive": "number" } @@ -4472,9 +4398,7 @@ "summary": "Test fixture to verify that jsii modules can use the node standard library." }, "fqn": "jsii-calc.NodeStandardLibrary", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -4492,10 +4416,13 @@ }, "name": "cryptoSha256", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { + "async": true, "docs": { "returns": "\"Hello, resource!\"", "summary": "Reads a local resource file (resource.txt) asynchronously." @@ -4506,8 +4433,9 @@ }, "name": "fsReadFile", "returns": { - "primitive": "string", - "promise": true + "type": { + "primitive": "string" + } } }, { @@ -4521,7 +4449,9 @@ }, "name": "fsReadFileSync", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -4550,7 +4480,6 @@ }, "fqn": "jsii-calc.NullShouldBeTreatedAsUndefined", "initializer": { - "initializer": true, "parameters": [ { "name": "_param1", @@ -4560,8 +4489,8 @@ }, { "name": "optional", + "optional": true, "type": { - "optional": true, "primitive": "any" } } @@ -4582,8 +4511,8 @@ "parameters": [ { "name": "value", + "optional": true, "type": { - "optional": true, "primitive": "any" } } @@ -4620,8 +4549,8 @@ "line": 1172 }, "name": "changeMeToUndefined", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -4663,8 +4592,8 @@ "line": 1209 }, "name": "thisShouldBeUndefined", + "optional": true, "type": { - "optional": true, "primitive": "any" } } @@ -4677,7 +4606,6 @@ }, "fqn": "jsii-calc.NumberGenerator", "initializer": { - "initializer": true, "parameters": [ { "name": "generator", @@ -4708,7 +4636,9 @@ } ], "returns": { - "primitive": "boolean" + "type": { + "primitive": "boolean" + } } }, { @@ -4718,7 +4648,9 @@ }, "name": "nextTimes100", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -4742,9 +4674,7 @@ "summary": "Verify that object references can be passed inside collections." }, "fqn": "jsii-calc.ObjectRefsInCollections", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -4774,7 +4704,9 @@ } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { @@ -4800,7 +4732,9 @@ } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -4813,9 +4747,7 @@ "summary": "Old class." }, "fqn": "jsii-calc.Old", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/documented.ts", @@ -4839,7 +4771,6 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.OptionalConstructorArgument", "initializer": { - "initializer": true, "parameters": [ { "name": "arg1", @@ -4855,8 +4786,8 @@ }, { "name": "arg3", + "optional": true, "type": { - "optional": true, "primitive": "date" } } @@ -4898,8 +4829,8 @@ "line": 285 }, "name": "arg3", + "optional": true, "type": { - "optional": true, "primitive": "date" } } @@ -4924,8 +4855,8 @@ "line": 1618 }, "name": "field", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -4935,13 +4866,12 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.OptionalStructConsumer", "initializer": { - "initializer": true, "parameters": [ { "name": "optionalStruct", + "optional": true, "type": { - "fqn": "jsii-calc.OptionalStruct", - "optional": true + "fqn": "jsii-calc.OptionalStruct" } } ] @@ -4971,8 +4901,8 @@ "line": 1610 }, "name": "fieldValue", + "optional": true, "type": { - "optional": true, "primitive": "string" } } @@ -4981,9 +4911,7 @@ "jsii-calc.OverrideReturnsObject": { "assembly": "jsii-calc", "fqn": "jsii-calc.OverrideReturnsObject", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5005,7 +4933,9 @@ } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -5015,9 +4945,7 @@ "abstract": true, "assembly": "jsii-calc", "fqn": "jsii-calc.PartiallyInitializedThisConsumer", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5052,7 +4980,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -5061,9 +4991,7 @@ "jsii-calc.Polymorphism": { "assembly": "jsii-calc", "fqn": "jsii-calc.Polymorphism", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5085,7 +5013,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -5093,9 +5023,7 @@ }, "jsii-calc.Power": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.composition.CompositeOperation" - }, + "base": "jsii-calc.composition.CompositeOperation", "docs": { "summary": "The power operation." }, @@ -5104,7 +5032,6 @@ "docs": { "summary": "Creates a Power operation." }, - "initializer": true, "parameters": [ { "docs": { @@ -5157,9 +5084,7 @@ "line": 223 }, "name": "expression", - "overrides": { - "fqn": "jsii-calc.composition.CompositeOperation" - }, + "overrides": "jsii-calc.composition.CompositeOperation", "type": { "fqn": "@scope/jsii-calc-lib.Value" } @@ -5183,9 +5108,7 @@ "jsii-calc.PublicClass": { "assembly": "jsii-calc", "fqn": "jsii-calc.PublicClass", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5205,9 +5128,7 @@ "jsii-calc.PythonReservedWords": { "assembly": "jsii-calc", "fqn": "jsii-calc.PythonReservedWords", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5447,9 +5368,7 @@ "summary": "See awslabs/jsii#138." }, "fqn": "jsii-calc.ReferenceEnumFromScopedPackage", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5463,8 +5382,10 @@ }, "name": "loadFoo", "returns": { - "fqn": "@scope/jsii-calc-lib.EnumFromScopedModule", - "optional": true + "optional": true, + "type": { + "fqn": "@scope/jsii-calc-lib.EnumFromScopedModule" + } } }, { @@ -5491,9 +5412,9 @@ "line": 1011 }, "name": "foo", + "optional": true, "type": { - "fqn": "@scope/jsii-calc-lib.EnumFromScopedModule", - "optional": true + "fqn": "@scope/jsii-calc-lib.EnumFromScopedModule" } } ] @@ -5506,9 +5427,7 @@ "summary": "Helps ensure the JSII kernel & runtime cooperate correctly when an un-exported instance of a class is returned with a declared type that is an exported interface, and the instance inherits from an exported class." }, "fqn": "jsii-calc.ReturnsPrivateImplementationOfInterface", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5532,9 +5451,7 @@ "jsii-calc.RuntimeTypeChecking": { "assembly": "jsii-calc", "fqn": "jsii-calc.RuntimeTypeChecking", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5550,22 +5467,22 @@ "parameters": [ { "name": "arg1", + "optional": true, "type": { - "optional": true, "primitive": "number" } }, { "name": "arg2", + "optional": true, "type": { - "optional": true, "primitive": "string" } }, { "name": "arg3", + "optional": true, "type": { - "optional": true, "primitive": "date" } } @@ -5580,8 +5497,8 @@ "parameters": [ { "name": "arg", + "optional": true, "type": { - "optional": true, "primitive": "any" } } @@ -5611,8 +5528,8 @@ }, { "name": "arg3", + "optional": true, "type": { - "optional": true, "primitive": "date" } } @@ -5628,9 +5545,7 @@ "summary": "Test that a single instance can be returned under two different FQNs." }, "fqn": "jsii-calc.SingleInstanceTwoTypes", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5644,7 +5559,9 @@ }, "name": "interface1", "returns": { - "fqn": "jsii-calc.InbetweenClass" + "type": { + "fqn": "jsii-calc.InbetweenClass" + } } }, { @@ -5654,7 +5571,9 @@ }, "name": "interface2", "returns": { - "fqn": "jsii-calc.IPublicInterface" + "type": { + "fqn": "jsii-calc.IPublicInterface" + } } } ], @@ -5664,7 +5583,6 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.Statics", "initializer": { - "initializer": true, "parameters": [ { "name": "value", @@ -5701,7 +5619,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } }, "static": true }, @@ -5712,7 +5632,9 @@ }, "name": "justMethod", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -5846,9 +5768,7 @@ "jsii-calc.StripInternal": { "assembly": "jsii-calc", "fqn": "jsii-calc.StripInternal", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5870,16 +5790,12 @@ }, "jsii-calc.Sum": { "assembly": "jsii-calc", - "base": { - "fqn": "jsii-calc.composition.CompositeOperation" - }, + "base": "jsii-calc.composition.CompositeOperation", "docs": { "summary": "An operation that sums multiple values." }, "fqn": "jsii-calc.Sum", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/calculator.ts", @@ -5897,9 +5813,7 @@ "line": 200 }, "name": "expression", - "overrides": { - "fqn": "jsii-calc.composition.CompositeOperation" - }, + "overrides": "jsii-calc.composition.CompositeOperation", "type": { "fqn": "@scope/jsii-calc-lib.Value" } @@ -5927,9 +5841,7 @@ "jsii-calc.SyncVirtualMethods": { "assembly": "jsii-calc", "fqn": "jsii-calc.SyncVirtualMethods", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -5937,14 +5849,16 @@ }, "methods": [ { + "async": true, "locationInModule": { "filename": "lib/compliance.ts", "line": 360 }, "name": "callerIsAsync", "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { @@ -5954,7 +5868,9 @@ }, "name": "callerIsMethod", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { @@ -5994,7 +5910,9 @@ }, "name": "readA", "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { @@ -6004,7 +5922,9 @@ }, "name": "retrieveOtherProperty", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -6014,7 +5934,9 @@ }, "name": "retrieveReadOnlyProperty", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -6024,7 +5946,9 @@ }, "name": "retrieveValueOfTheProperty", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -6042,7 +5966,9 @@ } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { @@ -6129,9 +6055,7 @@ "jsii-calc.Thrower": { "assembly": "jsii-calc", "fqn": "jsii-calc.Thrower", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -6151,15 +6075,12 @@ "jsii-calc.UnaryOperation": { "abstract": true, "assembly": "jsii-calc", - "base": { - "fqn": "@scope/jsii-calc-lib.Operation" - }, + "base": "@scope/jsii-calc-lib.Operation", "docs": { "summary": "An operation on a single operand." }, "fqn": "jsii-calc.UnaryOperation", "initializer": { - "initializer": true, "parameters": [ { "name": "operand", @@ -6232,8 +6153,8 @@ "line": 942 }, "name": "foo", + "optional": true, "type": { - "optional": true, "union": { "types": [ { @@ -6251,9 +6172,7 @@ "jsii-calc.UseBundledDependency": { "assembly": "jsii-calc", "fqn": "jsii-calc.UseBundledDependency", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -6267,7 +6186,9 @@ }, "name": "value", "returns": { - "primitive": "any" + "type": { + "primitive": "any" + } } } ], @@ -6279,9 +6200,7 @@ "summary": "Depend on a type from jsii-calc-base as a test for awslabs/jsii#128." }, "fqn": "jsii-calc.UseCalcBase", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -6295,7 +6214,9 @@ }, "name": "hello", "returns": { - "fqn": "@scope/jsii-calc-base.Base" + "type": { + "fqn": "@scope/jsii-calc-base.Base" + } } } ], @@ -6305,7 +6226,6 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.UsesInterfaceWithProperties", "initializer": { - "initializer": true, "parameters": [ { "name": "obj", @@ -6328,7 +6248,9 @@ }, "name": "justRead", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -6346,7 +6268,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } }, { @@ -6364,7 +6288,9 @@ } ], "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -6387,7 +6313,6 @@ "assembly": "jsii-calc", "fqn": "jsii-calc.VariadicMethod", "initializer": { - "initializer": true, "parameters": [ { "docs": { @@ -6436,11 +6361,13 @@ } ], "returns": { - "collection": { - "elementtype": { - "primitive": "number" - }, - "kind": "array" + "type": { + "collection": { + "elementtype": { + "primitive": "number" + }, + "kind": "array" + } } }, "variadic": true @@ -6451,9 +6378,7 @@ "jsii-calc.VirtualMethodPlayground": { "assembly": "jsii-calc", "fqn": "jsii-calc.VirtualMethodPlayground", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/compliance.ts", @@ -6461,6 +6386,7 @@ }, "methods": [ { + "async": true, "locationInModule": { "filename": "lib/compliance.ts", "line": 451 @@ -6475,8 +6401,9 @@ } ], "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { @@ -6494,10 +6421,13 @@ } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } }, { + "async": true, "locationInModule": { "filename": "lib/compliance.ts", "line": 433 @@ -6512,11 +6442,13 @@ } ], "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { + "async": true, "locationInModule": { "filename": "lib/compliance.ts", "line": 424 @@ -6531,8 +6463,9 @@ } ], "returns": { - "primitive": "number", - "promise": true + "type": { + "primitive": "number" + } } }, { @@ -6550,7 +6483,9 @@ } ], "returns": { - "primitive": "number" + "type": { + "primitive": "number" + } } } ], @@ -6559,16 +6494,12 @@ "jsii-calc.composition.CompositeOperation": { "abstract": true, "assembly": "jsii-calc", - "base": { - "fqn": "@scope/jsii-calc-lib.Operation" - }, + "base": "@scope/jsii-calc-lib.Operation", "docs": { "summary": "Abstract operation composed from an expression of other operations." }, "fqn": "jsii-calc.composition.CompositeOperation", - "initializer": { - "initializer": true - }, + "initializer": {}, "kind": "class", "locationInModule": { "filename": "lib/calculator.ts", @@ -6584,11 +6515,11 @@ "line": 158 }, "name": "toString", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Operation" - }, + "overrides": "@scope/jsii-calc-lib.Operation", "returns": { - "primitive": "string" + "type": { + "primitive": "string" + } } } ], @@ -6620,9 +6551,7 @@ "line": 148 }, "name": "value", - "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" - }, + "overrides": "@scope/jsii-calc-lib.Value", "type": { "primitive": "number" } @@ -6708,5 +6637,5 @@ } }, "version": "0.9.0", - "fingerprint": "0BBn1Fo4aK6xtF8MiEQ138I208hMwwwg49bGtKZEvT8=" + "fingerprint": "Lg8wDjQSsRLa2sk8EriArt/u5aibYilCuYFRZHh02Eg=" } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClass.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClass.cs index e33b22af8e..6c52002a5a 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClass.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClass.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(AbstractClass), "jsii-calc.AbstractClass", "[]")] + [JsiiClass(nativeType: typeof(AbstractClass), fullyQualifiedName: "jsii-calc.AbstractClass")] public abstract class AbstractClass : AbstractClassBase, IIInterfaceImplementedByAbstractClass { protected AbstractClass(): base(new DeputyProps(new object[]{})) @@ -17,15 +17,15 @@ protected AbstractClass(DeputyProps props): base(props) { } - [JsiiProperty("propFromInterface", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "propFromInterface", typeJson: "{\"primitive\":\"string\"}")] public virtual string PropFromInterface { get => GetInstanceProperty(); } - [JsiiMethod("abstractMethod", "{\"primitive\":\"string\"}", "[{\"name\":\"name\",\"type\":{\"primitive\":\"string\"}}]")] + [JsiiMethod(name: "abstractMethod", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", parametersJson: "[{\"name\":\"name\",\"type\":{\"primitive\":\"string\"}}]")] public abstract string AbstractMethod(string name); - [JsiiMethod("nonAbstractMethod", "{\"primitive\":\"number\"}", "[]")] + [JsiiMethod(name: "nonAbstractMethod", returnsJson: "{\"type\":{\"primitive\":\"number\"}}")] public virtual double NonAbstractMethod() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassBase.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassBase.cs index 9751e220fa..cb6c18d362 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassBase.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassBase.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(AbstractClassBase), "jsii-calc.AbstractClassBase", "[]")] + [JsiiClass(nativeType: typeof(AbstractClassBase), fullyQualifiedName: "jsii-calc.AbstractClassBase")] public abstract class AbstractClassBase : DeputyBase { protected AbstractClassBase(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected AbstractClassBase(DeputyProps props): base(props) { } - [JsiiProperty("abstractProperty", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "abstractProperty", typeJson: "{\"primitive\":\"string\"}")] public virtual string AbstractProperty { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassBaseProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassBaseProxy.cs index d12f04de48..2a0e7b51be 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassBaseProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassBaseProxy.cs @@ -2,14 +2,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(AbstractClassBase), "jsii-calc.AbstractClassBase")] + [JsiiTypeProxy(nativeType: typeof(AbstractClassBase), fullyQualifiedName: "jsii-calc.AbstractClassBase")] internal sealed class AbstractClassBaseProxy : AbstractClassBase { private AbstractClassBaseProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("abstractProperty", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "abstractProperty", typeJson: "{\"primitive\":\"string\"}")] public override string AbstractProperty { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassProxy.cs index 97918b1966..2689d9f566 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassProxy.cs @@ -2,20 +2,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(AbstractClass), "jsii-calc.AbstractClass")] + [JsiiTypeProxy(nativeType: typeof(AbstractClass), fullyQualifiedName: "jsii-calc.AbstractClass")] internal sealed class AbstractClassProxy : AbstractClass { private AbstractClassProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("abstractProperty", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "abstractProperty", typeJson: "{\"primitive\":\"string\"}")] public override string AbstractProperty { get => GetInstanceProperty(); } - [JsiiMethod("abstractMethod", "{\"primitive\":\"string\"}", "[{\"name\":\"name\",\"type\":{\"primitive\":\"string\"}}]")] + [JsiiMethod(name: "abstractMethod", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", parametersJson: "[{\"name\":\"name\",\"type\":{\"primitive\":\"string\"}}]")] public override string AbstractMethod(string name) { return InvokeInstanceMethod(new object[]{name}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassReturner.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassReturner.cs index 1297118eb2..0a89f1fae0 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassReturner.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AbstractClassReturner.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(AbstractClassReturner), "jsii-calc.AbstractClassReturner", "[]")] + [JsiiClass(nativeType: typeof(AbstractClassReturner), fullyQualifiedName: "jsii-calc.AbstractClassReturner")] public class AbstractClassReturner : DeputyBase { public AbstractClassReturner(): base(new DeputyProps(new object[]{})) @@ -17,19 +17,19 @@ protected AbstractClassReturner(DeputyProps props): base(props) { } - [JsiiProperty("returnAbstractFromProperty", "{\"fqn\":\"jsii-calc.AbstractClassBase\"}")] + [JsiiProperty(name: "returnAbstractFromProperty", typeJson: "{\"fqn\":\"jsii-calc.AbstractClassBase\"}")] public virtual AbstractClassBase ReturnAbstractFromProperty { get => GetInstanceProperty(); } - [JsiiMethod("giveMeAbstract", "{\"fqn\":\"jsii-calc.AbstractClass\"}", "[]")] + [JsiiMethod(name: "giveMeAbstract", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.AbstractClass\"}}")] public virtual AbstractClass GiveMeAbstract() { return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("giveMeInterface", "{\"fqn\":\"jsii-calc.IInterfaceImplementedByAbstractClass\"}", "[]")] + [JsiiMethod(name: "giveMeInterface", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.IInterfaceImplementedByAbstractClass\"}}")] public virtual IIInterfaceImplementedByAbstractClass GiveMeInterface() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Add.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Add.cs index d148a7781c..6384f12c27 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Add.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Add.cs @@ -4,7 +4,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// The "+" binary operation. - [JsiiClass(typeof(Add), "jsii-calc.Add", "[{\"name\":\"lhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"rhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] + [JsiiClass(nativeType: typeof(Add), fullyQualifiedName: "jsii-calc.Add", parametersJson: "[{\"name\":\"lhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"rhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] public class Add : BinaryOperation { public Add(Value_ lhs, Value_ rhs): base(new DeputyProps(new object[]{lhs, rhs})) @@ -20,14 +20,14 @@ protected Add(DeputyProps props): base(props) } /// The value. - [JsiiProperty("value", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"number\"}")] public override double Value { get => GetInstanceProperty(); } /// String representation of the value. - [JsiiMethod("toString", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "toString", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public override string ToString() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs index 4aa3c7e5e2..d726c54508 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs @@ -11,7 +11,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// The setters will validate /// that the value set is of the expected type and throw otherwise. /// - [JsiiClass(typeof(AllTypes), "jsii-calc.AllTypes", "[]")] + [JsiiClass(nativeType: typeof(AllTypes), fullyQualifiedName: "jsii-calc.AllTypes")] public class AllTypes : DeputyBase { public AllTypes(): base(new DeputyProps(new object[]{})) @@ -26,151 +26,151 @@ protected AllTypes(DeputyProps props): base(props) { } - [JsiiProperty("enumPropertyValue", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "enumPropertyValue", typeJson: "{\"primitive\":\"number\"}")] public virtual double EnumPropertyValue { get => GetInstanceProperty(); } - [JsiiProperty("anyArrayProperty", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"any\"}}}")] + [JsiiProperty(name: "anyArrayProperty", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"any\"}}}")] public virtual object[] AnyArrayProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("anyMapProperty", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"primitive\":\"any\"}}}")] + [JsiiProperty(name: "anyMapProperty", typeJson: "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"primitive\":\"any\"}}}")] public virtual IDictionary AnyMapProperty { get => GetInstanceProperty>(); set => SetInstanceProperty(value); } - [JsiiProperty("anyProperty", "{\"primitive\":\"any\"}")] + [JsiiProperty(name: "anyProperty", typeJson: "{\"primitive\":\"any\"}")] public virtual object AnyProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("arrayProperty", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}")] + [JsiiProperty(name: "arrayProperty", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}")] public virtual string[] ArrayProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("booleanProperty", "{\"primitive\":\"boolean\"}")] + [JsiiProperty(name: "booleanProperty", typeJson: "{\"primitive\":\"boolean\"}")] public virtual bool BooleanProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("dateProperty", "{\"primitive\":\"date\"}")] + [JsiiProperty(name: "dateProperty", typeJson: "{\"primitive\":\"date\"}")] public virtual DateTime DateProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("enumProperty", "{\"fqn\":\"jsii-calc.AllTypesEnum\"}")] + [JsiiProperty(name: "enumProperty", typeJson: "{\"fqn\":\"jsii-calc.AllTypesEnum\"}")] public virtual AllTypesEnum EnumProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("jsonProperty", "{\"primitive\":\"json\"}")] + [JsiiProperty(name: "jsonProperty", typeJson: "{\"primitive\":\"json\"}")] public virtual JObject JsonProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("mapProperty", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Number\"}}}")] + [JsiiProperty(name: "mapProperty", typeJson: "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Number\"}}}")] public virtual IDictionary MapProperty { get => GetInstanceProperty>(); set => SetInstanceProperty(value); } - [JsiiProperty("numberProperty", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "numberProperty", typeJson: "{\"primitive\":\"number\"}")] public virtual double NumberProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("stringProperty", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "stringProperty", typeJson: "{\"primitive\":\"string\"}")] public virtual string StringProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("unionArrayProperty", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"union\":{\"types\":[{\"primitive\":\"number\"},{\"fqn\":\"@scope/jsii-calc-lib.Value\"}]}}}}")] + [JsiiProperty(name: "unionArrayProperty", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"union\":{\"types\":[{\"primitive\":\"number\"},{\"fqn\":\"@scope/jsii-calc-lib.Value\"}]}}}}")] public virtual object[] UnionArrayProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("unionMapProperty", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"@scope/jsii-calc-lib.Number\"}]}}}}")] + [JsiiProperty(name: "unionMapProperty", typeJson: "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"@scope/jsii-calc-lib.Number\"}]}}}}")] public virtual IDictionary UnionMapProperty { get => GetInstanceProperty>(); set => SetInstanceProperty(value); } - [JsiiProperty("unionProperty", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.Multiply\"},{\"fqn\":\"@scope/jsii-calc-lib.Number\"}]}}")] + [JsiiProperty(name: "unionProperty", typeJson: "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.Multiply\"},{\"fqn\":\"@scope/jsii-calc-lib.Number\"}]}}")] public virtual object UnionProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("unknownArrayProperty", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"any\"}}}")] + [JsiiProperty(name: "unknownArrayProperty", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"any\"}}}")] public virtual object[] UnknownArrayProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("unknownMapProperty", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"primitive\":\"any\"}}}")] + [JsiiProperty(name: "unknownMapProperty", typeJson: "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"primitive\":\"any\"}}}")] public virtual IDictionary UnknownMapProperty { get => GetInstanceProperty>(); set => SetInstanceProperty(value); } - [JsiiProperty("unknownProperty", "{\"primitive\":\"any\"}")] + [JsiiProperty(name: "unknownProperty", typeJson: "{\"primitive\":\"any\"}")] public virtual object UnknownProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("optionalEnumValue", "{\"fqn\":\"jsii-calc.StringEnum\",\"optional\":true}")] - public virtual StringEnum OptionalEnumValue + [JsiiProperty(name: "optionalEnumValue", typeJson: "{\"fqn\":\"jsii-calc.StringEnum\"}", isOptional: true)] + public virtual StringEnum? OptionalEnumValue { - get => GetInstanceProperty(); + get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiMethod("anyIn", null, "[{\"name\":\"inp\",\"type\":{\"primitive\":\"any\"}}]")] + [JsiiMethod(name: "anyIn", parametersJson: "[{\"name\":\"inp\",\"type\":{\"primitive\":\"any\"}}]")] public virtual void AnyIn(object inp) { InvokeInstanceVoidMethod(new object[]{inp}); } - [JsiiMethod("anyOut", "{\"primitive\":\"any\"}", "[]")] + [JsiiMethod(name: "anyOut", returnsJson: "{\"type\":{\"primitive\":\"any\"}}")] public virtual object AnyOut() { return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("enumMethod", "{\"fqn\":\"jsii-calc.StringEnum\"}", "[{\"name\":\"value\",\"type\":{\"fqn\":\"jsii-calc.StringEnum\"}}]")] + [JsiiMethod(name: "enumMethod", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.StringEnum\"}}", parametersJson: "[{\"name\":\"value\",\"type\":{\"fqn\":\"jsii-calc.StringEnum\"}}]")] public virtual StringEnum EnumMethod(StringEnum value) { return InvokeInstanceMethod(new object[]{value}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs index 6fef8651d6..a77d447a2a 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs @@ -2,14 +2,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiEnum(typeof(AllTypesEnum), "jsii-calc.AllTypesEnum")] + [JsiiEnum(nativeType: typeof(AllTypesEnum), fullyQualifiedName: "jsii-calc.AllTypesEnum")] public enum AllTypesEnum { - [JsiiEnumMember("MyEnumValue")] + [JsiiEnumMember(name: "MyEnumValue")] MyEnumValue, - [JsiiEnumMember("YourEnumValue")] + [JsiiEnumMember(name: "YourEnumValue")] YourEnumValue, - [JsiiEnumMember("ThisIsGreat")] + [JsiiEnumMember(name: "ThisIsGreat")] ThisIsGreat } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllowedMethodNames.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllowedMethodNames.cs index 793eda8c44..49b4da01a3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllowedMethodNames.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllowedMethodNames.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(AllowedMethodNames), "jsii-calc.AllowedMethodNames", "[]")] + [JsiiClass(nativeType: typeof(AllowedMethodNames), fullyQualifiedName: "jsii-calc.AllowedMethodNames")] public class AllowedMethodNames : DeputyBase { public AllowedMethodNames(): base(new DeputyProps(new object[]{})) @@ -17,27 +17,27 @@ protected AllowedMethodNames(DeputyProps props): base(props) { } - [JsiiMethod("getBar", null, "[{\"name\":\"_p1\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"_p2\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiMethod(name: "getBar", parametersJson: "[{\"name\":\"_p1\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"_p2\",\"type\":{\"primitive\":\"number\"}}]")] public virtual void GetBar(string _p1, double _p2) { InvokeInstanceVoidMethod(new object[]{_p1, _p2}); } /// getXxx() is not allowed (see negatives), but getXxx(a, ...) is okay. - [JsiiMethod("getFoo", "{\"primitive\":\"string\"}", "[{\"name\":\"withParam\",\"type\":{\"primitive\":\"string\"}}]")] + [JsiiMethod(name: "getFoo", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", parametersJson: "[{\"name\":\"withParam\",\"type\":{\"primitive\":\"string\"}}]")] public virtual string GetFoo(string withParam) { return InvokeInstanceMethod(new object[]{withParam}); } - [JsiiMethod("setBar", null, "[{\"name\":\"_x\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"_y\",\"type\":{\"primitive\":\"number\"}},{\"name\":\"_z\",\"type\":{\"primitive\":\"boolean\"}}]")] + [JsiiMethod(name: "setBar", parametersJson: "[{\"name\":\"_x\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"_y\",\"type\":{\"primitive\":\"number\"}},{\"name\":\"_z\",\"type\":{\"primitive\":\"boolean\"}}]")] public virtual void SetBar(string _x, double _y, bool _z) { InvokeInstanceVoidMethod(new object[]{_x, _y, _z}); } /// setFoo(x) is not allowed (see negatives), but setXxx(a, b, ...) is okay. - [JsiiMethod("setFoo", null, "[{\"name\":\"_x\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"_y\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiMethod(name: "setFoo", parametersJson: "[{\"name\":\"_x\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"_y\",\"type\":{\"primitive\":\"number\"}}]")] public virtual void SetFoo(string _x, double _y) { InvokeInstanceVoidMethod(new object[]{_x, _y}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AsyncVirtualMethods.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AsyncVirtualMethods.cs index f50d76c2e0..b900d1f5e5 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AsyncVirtualMethods.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AsyncVirtualMethods.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(AsyncVirtualMethods), "jsii-calc.AsyncVirtualMethods", "[]")] + [JsiiClass(nativeType: typeof(AsyncVirtualMethods), fullyQualifiedName: "jsii-calc.AsyncVirtualMethods")] public class AsyncVirtualMethods : DeputyBase { public AsyncVirtualMethods(): base(new DeputyProps(new object[]{})) @@ -17,14 +17,14 @@ protected AsyncVirtualMethods(DeputyProps props): base(props) { } - [JsiiMethod("callMe", "{\"primitive\":\"number\",\"promise\":true}", "[]")] + [JsiiMethod(name: "callMe", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", isAsync: true)] public virtual double CallMe() { return InvokeInstanceMethod(new object[]{}); } /// Just calls "overrideMeToo". - [JsiiMethod("callMe2", "{\"primitive\":\"number\",\"promise\":true}", "[]")] + [JsiiMethod(name: "callMe2", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", isAsync: true)] public virtual double CallMe2() { return InvokeInstanceMethod(new object[]{}); @@ -36,25 +36,25 @@ public virtual double CallMe2() /// means that callbacks are not going to be available immediate, but only /// after an "immediates" cycle. /// - [JsiiMethod("callMeDoublePromise", "{\"primitive\":\"number\",\"promise\":true}", "[]")] + [JsiiMethod(name: "callMeDoublePromise", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", isAsync: true)] public virtual double CallMeDoublePromise() { return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("dontOverrideMe", "{\"primitive\":\"number\"}", "[]")] + [JsiiMethod(name: "dontOverrideMe", returnsJson: "{\"type\":{\"primitive\":\"number\"}}")] public virtual double DontOverrideMe() { return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("overrideMe", "{\"primitive\":\"number\",\"promise\":true}", "[{\"name\":\"mult\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiMethod(name: "overrideMe", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", parametersJson: "[{\"name\":\"mult\",\"type\":{\"primitive\":\"number\"}}]", isAsync: true)] public virtual double OverrideMe(double mult) { return InvokeInstanceMethod(new object[]{mult}); } - [JsiiMethod("overrideMeToo", "{\"primitive\":\"number\",\"promise\":true}", "[]")] + [JsiiMethod(name: "overrideMeToo", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", isAsync: true)] public virtual double OverrideMeToo() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AugmentableClass.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AugmentableClass.cs index af9bf446f0..516b8daa78 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AugmentableClass.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AugmentableClass.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(AugmentableClass), "jsii-calc.AugmentableClass", "[]")] + [JsiiClass(nativeType: typeof(AugmentableClass), fullyQualifiedName: "jsii-calc.AugmentableClass")] public class AugmentableClass : DeputyBase { public AugmentableClass(): base(new DeputyProps(new object[]{})) @@ -17,13 +17,13 @@ protected AugmentableClass(DeputyProps props): base(props) { } - [JsiiMethod("methodOne", null, "[]")] + [JsiiMethod(name: "methodOne")] public virtual void MethodOne() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("methodTwo", null, "[]")] + [JsiiMethod(name: "methodTwo")] public virtual void MethodTwo() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperation.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperation.cs index 780261168c..8cba22822f 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperation.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperation.cs @@ -4,7 +4,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Represents an operation with two operands. - [JsiiClass(typeof(BinaryOperation), "jsii-calc.BinaryOperation", "[{\"name\":\"lhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"rhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] + [JsiiClass(nativeType: typeof(BinaryOperation), fullyQualifiedName: "jsii-calc.BinaryOperation", parametersJson: "[{\"name\":\"lhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"rhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] public abstract class BinaryOperation : Operation, IIFriendly { protected BinaryOperation(Value_ lhs, Value_ rhs): base(new DeputyProps(new object[]{lhs, rhs})) @@ -20,21 +20,21 @@ protected BinaryOperation(DeputyProps props): base(props) } /// Left-hand side operand. - [JsiiProperty("lhs", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + [JsiiProperty(name: "lhs", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] public virtual Value_ Lhs { get => GetInstanceProperty(); } /// Right-hand side operand. - [JsiiProperty("rhs", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + [JsiiProperty(name: "rhs", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] public virtual Value_ Rhs { get => GetInstanceProperty(); } /// Say hello! - [JsiiMethod("hello", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "hello", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public virtual string Hello() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperationProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperationProxy.cs index 46799d122d..88a0452628 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperationProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperationProxy.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Represents an operation with two operands. - [JsiiTypeProxy(typeof(BinaryOperation), "jsii-calc.BinaryOperation")] + [JsiiTypeProxy(nativeType: typeof(BinaryOperation), fullyQualifiedName: "jsii-calc.BinaryOperation")] internal sealed class BinaryOperationProxy : BinaryOperation { private BinaryOperationProxy(ByRefValue reference): base(reference) @@ -11,14 +11,14 @@ private BinaryOperationProxy(ByRefValue reference): base(reference) } /// The value. - [JsiiProperty("value", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"number\"}")] public override double Value { get => GetInstanceProperty(); } /// String representation of the value. - [JsiiMethod("toString", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "toString", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public override string ToString() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs index 1169383381..be7f166dd4 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs @@ -6,7 +6,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// A calculator which maintains a current value and allows adding operations. - [JsiiClass(typeof(Calculator), "jsii-calc.Calculator", "[{\"name\":\"props\",\"type\":{\"fqn\":\"jsii-calc.CalculatorProps\",\"optional\":true}}]")] + [JsiiClass(nativeType: typeof(Calculator), fullyQualifiedName: "jsii-calc.Calculator", parametersJson: "[{\"name\":\"props\",\"type\":{\"fqn\":\"jsii-calc.CalculatorProps\"}}]")] public class Calculator : CompositeOperation_ { public Calculator(ICalculatorProps props): base(new DeputyProps(new object[]{props})) @@ -22,28 +22,28 @@ protected Calculator(DeputyProps props): base(props) } /// Returns the expression. - [JsiiProperty("expression", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + [JsiiProperty(name: "expression", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] public override Value_ Expression { get => GetInstanceProperty(); } /// A log of all operations. - [JsiiProperty("operationsLog", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}")] + [JsiiProperty(name: "operationsLog", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}")] public virtual Value_[] OperationsLog { get => GetInstanceProperty(); } /// A map of per operation name of all operations performed. - [JsiiProperty("operationsMap", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}}}")] + [JsiiProperty(name: "operationsMap", typeJson: "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}}}")] public virtual IDictionary OperationsMap { get => GetInstanceProperty>(); } /// The current value. - [JsiiProperty("curr", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + [JsiiProperty(name: "curr", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] public virtual Value_ Curr { get => GetInstanceProperty(); @@ -51,7 +51,7 @@ public virtual Value_ Curr } /// The maximum value allows in this calculator. - [JsiiProperty("maxValue", "{\"primitive\":\"number\",\"optional\":true}")] + [JsiiProperty(name: "maxValue", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] public virtual double? MaxValue { get => GetInstanceProperty(); @@ -59,7 +59,7 @@ public virtual double? MaxValue } /// Example of a property that accepts a union of types. - [JsiiProperty("unionProperty", "{\"union\":{\"types\":[{\"fqn\":\"jsii-calc.Add\"},{\"fqn\":\"jsii-calc.Multiply\"},{\"fqn\":\"jsii-calc.Power\"}]},\"optional\":true}")] + [JsiiProperty(name: "unionProperty", typeJson: "{\"union\":{\"types\":[{\"fqn\":\"jsii-calc.Add\"},{\"fqn\":\"jsii-calc.Multiply\"},{\"fqn\":\"jsii-calc.Power\"}]}}", isOptional: true)] public virtual object UnionProperty { get => GetInstanceProperty(); @@ -67,35 +67,35 @@ public virtual object UnionProperty } /// Adds a number to the current value. - [JsiiMethod("add", null, "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiMethod(name: "add", parametersJson: "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] public virtual void Add(double value) { InvokeInstanceVoidMethod(new object[]{value}); } /// Multiplies the current value by a number. - [JsiiMethod("mul", null, "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiMethod(name: "mul", parametersJson: "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] public virtual void Mul(double value) { InvokeInstanceVoidMethod(new object[]{value}); } /// Negates the current value. - [JsiiMethod("neg", null, "[]")] + [JsiiMethod(name: "neg")] public virtual void Neg() { InvokeInstanceVoidMethod(new object[]{}); } /// Raises the current value by a power. - [JsiiMethod("pow", null, "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiMethod(name: "pow", parametersJson: "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] public virtual void Pow(double value) { InvokeInstanceVoidMethod(new object[]{value}); } /// Returns teh value of the union property (if defined). - [JsiiMethod("readUnionValue", "{\"primitive\":\"number\"}", "[]")] + [JsiiMethod(name: "readUnionValue", returnsJson: "{\"type\":{\"primitive\":\"number\"}}")] public virtual double ReadUnionValue() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorProps.cs index 642a66ec8e..72bf8b1cf4 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorProps.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorProps.cs @@ -6,14 +6,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue] public class CalculatorProps : ICalculatorProps { - [JsiiProperty("initialValue", "{\"primitive\":\"number\",\"optional\":true}", true)] + [JsiiProperty(name: "initialValue", typeJson: "{\"primitive\":\"number\"}", isOptional: true, isOverride: true)] public double? InitialValue { get; set; } - [JsiiProperty("maximumValue", "{\"primitive\":\"number\",\"optional\":true}", true)] + [JsiiProperty(name: "maximumValue", typeJson: "{\"primitive\":\"number\"}", isOptional: true, isOverride: true)] public double? MaximumValue { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorPropsProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorPropsProxy.cs index ec3ff89772..ab018430b5 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorPropsProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorPropsProxy.cs @@ -3,20 +3,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Properties for Calculator. - [JsiiTypeProxy(typeof(ICalculatorProps), "jsii-calc.CalculatorProps")] + [JsiiTypeProxy(nativeType: typeof(ICalculatorProps), fullyQualifiedName: "jsii-calc.CalculatorProps")] internal sealed class CalculatorPropsProxy : DeputyBase, ICalculatorProps { private CalculatorPropsProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("initialValue", "{\"primitive\":\"number\",\"optional\":true}")] + [JsiiProperty(name: "initialValue", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] public double? InitialValue { get => GetInstanceProperty(); } - [JsiiProperty("maximumValue", "{\"primitive\":\"number\",\"optional\":true}")] + [JsiiProperty(name: "maximumValue", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] public double? MaximumValue { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassThatImplementsTheInternalInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassThatImplementsTheInternalInterface.cs index c8816590e1..9ca24c229a 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassThatImplementsTheInternalInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassThatImplementsTheInternalInterface.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(ClassThatImplementsTheInternalInterface), "jsii-calc.ClassThatImplementsTheInternalInterface", "[]")] + [JsiiClass(nativeType: typeof(ClassThatImplementsTheInternalInterface), fullyQualifiedName: "jsii-calc.ClassThatImplementsTheInternalInterface")] public class ClassThatImplementsTheInternalInterface : DeputyBase, IINonInternalInterface { public ClassThatImplementsTheInternalInterface(): base(new DeputyProps(new object[]{})) @@ -17,28 +17,28 @@ protected ClassThatImplementsTheInternalInterface(DeputyProps props): base(props { } - [JsiiProperty("a", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "a", typeJson: "{\"primitive\":\"string\"}")] public virtual string A { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("b", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "b", typeJson: "{\"primitive\":\"string\"}")] public virtual string B { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("c", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "c", typeJson: "{\"primitive\":\"string\"}")] public virtual string C { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("d", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "d", typeJson: "{\"primitive\":\"string\"}")] public virtual string D { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassThatImplementsThePrivateInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassThatImplementsThePrivateInterface.cs index 7e73bfd4a0..b39188f074 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassThatImplementsThePrivateInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassThatImplementsThePrivateInterface.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(ClassThatImplementsThePrivateInterface), "jsii-calc.ClassThatImplementsThePrivateInterface", "[]")] + [JsiiClass(nativeType: typeof(ClassThatImplementsThePrivateInterface), fullyQualifiedName: "jsii-calc.ClassThatImplementsThePrivateInterface")] public class ClassThatImplementsThePrivateInterface : DeputyBase, IINonInternalInterface { public ClassThatImplementsThePrivateInterface(): base(new DeputyProps(new object[]{})) @@ -17,28 +17,28 @@ protected ClassThatImplementsThePrivateInterface(DeputyProps props): base(props) { } - [JsiiProperty("a", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "a", typeJson: "{\"primitive\":\"string\"}")] public virtual string A { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("b", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "b", typeJson: "{\"primitive\":\"string\"}")] public virtual string B { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("c", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "c", typeJson: "{\"primitive\":\"string\"}")] public virtual string C { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("e", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "e", typeJson: "{\"primitive\":\"string\"}")] public virtual string E { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithMutableObjectLiteralProperty.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithMutableObjectLiteralProperty.cs index 79eeec2e89..3d1d088a60 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithMutableObjectLiteralProperty.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithMutableObjectLiteralProperty.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(ClassWithMutableObjectLiteralProperty), "jsii-calc.ClassWithMutableObjectLiteralProperty", "[]")] + [JsiiClass(nativeType: typeof(ClassWithMutableObjectLiteralProperty), fullyQualifiedName: "jsii-calc.ClassWithMutableObjectLiteralProperty")] public class ClassWithMutableObjectLiteralProperty : DeputyBase { public ClassWithMutableObjectLiteralProperty(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected ClassWithMutableObjectLiteralProperty(DeputyProps props): base(props) { } - [JsiiProperty("mutableObject", "{\"fqn\":\"jsii-calc.IMutableObjectLiteral\"}")] + [JsiiProperty(name: "mutableObject", typeJson: "{\"fqn\":\"jsii-calc.IMutableObjectLiteral\"}")] public virtual IIMutableObjectLiteral MutableObject { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithPrivateConstructorAndAutomaticProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithPrivateConstructorAndAutomaticProperties.cs index deaf92f9d5..1e18460c7b 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithPrivateConstructorAndAutomaticProperties.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithPrivateConstructorAndAutomaticProperties.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Class that implements interface properties automatically, but using a private constructor. - [JsiiClass(typeof(ClassWithPrivateConstructorAndAutomaticProperties), "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties", "[]")] + [JsiiClass(nativeType: typeof(ClassWithPrivateConstructorAndAutomaticProperties), fullyQualifiedName: "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties")] public class ClassWithPrivateConstructorAndAutomaticProperties : DeputyBase, IIInterfaceWithProperties { protected ClassWithPrivateConstructorAndAutomaticProperties(ByRefValue reference): base(reference) @@ -14,20 +14,20 @@ protected ClassWithPrivateConstructorAndAutomaticProperties(DeputyProps props): { } - [JsiiProperty("readOnlyString", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "readOnlyString", typeJson: "{\"primitive\":\"string\"}")] public virtual string ReadOnlyString { get => GetInstanceProperty(); } - [JsiiProperty("readWriteString", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "readWriteString", typeJson: "{\"primitive\":\"string\"}")] public virtual string ReadWriteString { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiMethod("create", "{\"fqn\":\"jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties\"}", "[{\"name\":\"readOnlyString\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"readWriteString\",\"type\":{\"primitive\":\"string\"}}]")] + [JsiiMethod(name: "create", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties\"}}", parametersJson: "[{\"name\":\"readOnlyString\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"readWriteString\",\"type\":{\"primitive\":\"string\"}}]")] public static ClassWithPrivateConstructorAndAutomaticProperties Create(string readOnlyString, string readWriteString) { return InvokeStaticMethod(typeof(ClassWithPrivateConstructorAndAutomaticProperties), new object[]{readOnlyString, readWriteString}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConstructorPassesThisOut.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConstructorPassesThisOut.cs index e31c3513f0..d4f67b4338 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConstructorPassesThisOut.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConstructorPassesThisOut.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(ConstructorPassesThisOut), "jsii-calc.ConstructorPassesThisOut", "[{\"name\":\"consumer\",\"type\":{\"fqn\":\"jsii-calc.PartiallyInitializedThisConsumer\"}}]")] + [JsiiClass(nativeType: typeof(ConstructorPassesThisOut), fullyQualifiedName: "jsii-calc.ConstructorPassesThisOut", parametersJson: "[{\"name\":\"consumer\",\"type\":{\"fqn\":\"jsii-calc.PartiallyInitializedThisConsumer\"}}]")] public class ConstructorPassesThisOut : DeputyBase { public ConstructorPassesThisOut(PartiallyInitializedThisConsumer consumer): base(new DeputyProps(new object[]{consumer})) diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Constructors.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Constructors.cs index b747def337..5c4b9c15ed 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Constructors.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Constructors.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(Constructors), "jsii-calc.Constructors", "[]")] + [JsiiClass(nativeType: typeof(Constructors), fullyQualifiedName: "jsii-calc.Constructors")] public class Constructors : DeputyBase { public Constructors(): base(new DeputyProps(new object[]{})) @@ -17,43 +17,43 @@ protected Constructors(DeputyProps props): base(props) { } - [JsiiMethod("hiddenInterface", "{\"fqn\":\"jsii-calc.IPublicInterface\"}", "[]")] + [JsiiMethod(name: "hiddenInterface", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.IPublicInterface\"}}")] public static IIPublicInterface HiddenInterface() { return InvokeStaticMethod(typeof(Constructors), new object[]{}); } - [JsiiMethod("hiddenInterfaces", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"jsii-calc.IPublicInterface\"}}}", "[]")] + [JsiiMethod(name: "hiddenInterfaces", returnsJson: "{\"type\":{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"jsii-calc.IPublicInterface\"}}}}")] public static IIPublicInterface[] HiddenInterfaces() { return InvokeStaticMethod(typeof(Constructors), new object[]{}); } - [JsiiMethod("hiddenSubInterfaces", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"jsii-calc.IPublicInterface\"}}}", "[]")] + [JsiiMethod(name: "hiddenSubInterfaces", returnsJson: "{\"type\":{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"jsii-calc.IPublicInterface\"}}}}")] public static IIPublicInterface[] HiddenSubInterfaces() { return InvokeStaticMethod(typeof(Constructors), new object[]{}); } - [JsiiMethod("makeClass", "{\"fqn\":\"jsii-calc.PublicClass\"}", "[]")] + [JsiiMethod(name: "makeClass", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.PublicClass\"}}")] public static PublicClass MakeClass() { return InvokeStaticMethod(typeof(Constructors), new object[]{}); } - [JsiiMethod("makeInterface", "{\"fqn\":\"jsii-calc.IPublicInterface\"}", "[]")] + [JsiiMethod(name: "makeInterface", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.IPublicInterface\"}}")] public static IIPublicInterface MakeInterface() { return InvokeStaticMethod(typeof(Constructors), new object[]{}); } - [JsiiMethod("makeInterface2", "{\"fqn\":\"jsii-calc.IPublicInterface2\"}", "[]")] + [JsiiMethod(name: "makeInterface2", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.IPublicInterface2\"}}")] public static IIPublicInterface2 MakeInterface2() { return InvokeStaticMethod(typeof(Constructors), new object[]{}); } - [JsiiMethod("makeInterfaces", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"jsii-calc.IPublicInterface\"}}}", "[]")] + [JsiiMethod(name: "makeInterfaces", returnsJson: "{\"type\":{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"jsii-calc.IPublicInterface\"}}}}")] public static IIPublicInterface[] MakeInterfaces() { return InvokeStaticMethod(typeof(Constructors), new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConsumersOfThisCrazyTypeSystem.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConsumersOfThisCrazyTypeSystem.cs index 734511733e..33883d8eca 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConsumersOfThisCrazyTypeSystem.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConsumersOfThisCrazyTypeSystem.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(ConsumersOfThisCrazyTypeSystem), "jsii-calc.ConsumersOfThisCrazyTypeSystem", "[]")] + [JsiiClass(nativeType: typeof(ConsumersOfThisCrazyTypeSystem), fullyQualifiedName: "jsii-calc.ConsumersOfThisCrazyTypeSystem")] public class ConsumersOfThisCrazyTypeSystem : DeputyBase { public ConsumersOfThisCrazyTypeSystem(): base(new DeputyProps(new object[]{})) @@ -17,13 +17,13 @@ protected ConsumersOfThisCrazyTypeSystem(DeputyProps props): base(props) { } - [JsiiMethod("consumeAnotherPublicInterface", "{\"primitive\":\"string\"}", "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.IAnotherPublicInterface\"}}]")] + [JsiiMethod(name: "consumeAnotherPublicInterface", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", parametersJson: "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.IAnotherPublicInterface\"}}]")] public virtual string ConsumeAnotherPublicInterface(IIAnotherPublicInterface obj) { return InvokeInstanceMethod(new object[]{obj}); } - [JsiiMethod("consumeNonInternalInterface", "{\"primitive\":\"any\"}", "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.INonInternalInterface\"}}]")] + [JsiiMethod(name: "consumeNonInternalInterface", returnsJson: "{\"type\":{\"primitive\":\"any\"}}", parametersJson: "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.INonInternalInterface\"}}]")] public virtual object ConsumeNonInternalInterface(IINonInternalInterface obj) { return InvokeInstanceMethod(new object[]{obj}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DefaultedConstructorArgument.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DefaultedConstructorArgument.cs index 85deaa402a..08874c3b0d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DefaultedConstructorArgument.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DefaultedConstructorArgument.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(DefaultedConstructorArgument), "jsii-calc.DefaultedConstructorArgument", "[{\"name\":\"arg1\",\"type\":{\"primitive\":\"number\",\"optional\":true}},{\"name\":\"arg2\",\"type\":{\"primitive\":\"string\",\"optional\":true}},{\"name\":\"arg3\",\"type\":{\"primitive\":\"date\",\"optional\":true}}]")] + [JsiiClass(nativeType: typeof(DefaultedConstructorArgument), fullyQualifiedName: "jsii-calc.DefaultedConstructorArgument", parametersJson: "[{\"name\":\"arg1\",\"type\":{\"primitive\":\"number\"}},{\"name\":\"arg2\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"arg3\",\"type\":{\"primitive\":\"date\"}}]")] public class DefaultedConstructorArgument : DeputyBase { public DefaultedConstructorArgument(double? arg1, string arg2, DateTime? arg3): base(new DeputyProps(new object[]{arg1, arg2, arg3})) @@ -18,19 +18,19 @@ protected DefaultedConstructorArgument(DeputyProps props): base(props) { } - [JsiiProperty("arg1", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "arg1", typeJson: "{\"primitive\":\"number\"}")] public virtual double Arg1 { get => GetInstanceProperty(); } - [JsiiProperty("arg3", "{\"primitive\":\"date\"}")] + [JsiiProperty(name: "arg3", typeJson: "{\"primitive\":\"date\"}")] public virtual DateTime Arg3 { get => GetInstanceProperty(); } - [JsiiProperty("arg2", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "arg2", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] public virtual string Arg2 { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Base.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Base.cs index 5036342fc2..07cd002185 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Base.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Base.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.DerivedClassHasNoProperties { - [JsiiClass(typeof(Base), "jsii-calc.DerivedClassHasNoProperties.Base", "[]")] + [JsiiClass(nativeType: typeof(Base), fullyQualifiedName: "jsii-calc.DerivedClassHasNoProperties.Base")] public class Base : DeputyBase { public Base(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected Base(DeputyProps props): base(props) { } - [JsiiProperty("prop", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "prop", typeJson: "{\"primitive\":\"string\"}")] public virtual string Prop { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Derived.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Derived.cs index fa68e32efa..36b5f493cb 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Derived.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Derived.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.DerivedClassHasNoProperties { - [JsiiClass(typeof(Derived), "jsii-calc.DerivedClassHasNoProperties.Derived", "[]")] + [JsiiClass(nativeType: typeof(Derived), fullyQualifiedName: "jsii-calc.DerivedClassHasNoProperties.Derived")] public class Derived : Amazon.JSII.Tests.CalculatorNamespace.DerivedClassHasNoProperties.Base { public Derived(): base(new DeputyProps(new object[]{})) diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStruct.cs index 02483da8d7..bd6ec18351 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStruct.cs @@ -9,14 +9,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue] public class DerivedStruct : IDerivedStruct { - [JsiiProperty("anotherRequired", "{\"primitive\":\"date\"}", true)] + [JsiiProperty(name: "anotherRequired", typeJson: "{\"primitive\":\"date\"}", isOverride: true)] public DateTime AnotherRequired { get; set; } - [JsiiProperty("bool", "{\"primitive\":\"boolean\"}", true)] + [JsiiProperty(name: "bool", typeJson: "{\"primitive\":\"boolean\"}", isOverride: true)] public bool Bool { get; @@ -24,7 +24,7 @@ public bool Bool } /// An example of a non primitive property. - [JsiiProperty("nonPrimitive", "{\"fqn\":\"jsii-calc.DoubleTrouble\"}", true)] + [JsiiProperty(name: "nonPrimitive", typeJson: "{\"fqn\":\"jsii-calc.DoubleTrouble\"}", isOverride: true)] public DoubleTrouble NonPrimitive { get; @@ -32,21 +32,21 @@ public DoubleTrouble NonPrimitive } /// This is optional. - [JsiiProperty("anotherOptional", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},\"optional\":true}", true)] + [JsiiProperty(name: "anotherOptional", typeJson: "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}", isOptional: true, isOverride: true)] public IDictionary AnotherOptional { get; set; } - [JsiiProperty("optionalAny", "{\"primitive\":\"any\",\"optional\":true}", true)] + [JsiiProperty(name: "optionalAny", typeJson: "{\"primitive\":\"any\"}", isOptional: true, isOverride: true)] public object OptionalAny { get; set; } - [JsiiProperty("optionalArray", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}},\"optional\":true}", true)] + [JsiiProperty(name: "optionalArray", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}", isOptional: true, isOverride: true)] public string[] OptionalArray { get; @@ -54,7 +54,7 @@ public string[] OptionalArray } /// An awesome number value. - [JsiiProperty("anumber", "{\"primitive\":\"number\"}", true)] + [JsiiProperty(name: "anumber", typeJson: "{\"primitive\":\"number\"}", isOverride: true)] public double Anumber { get; @@ -62,14 +62,14 @@ public double Anumber } /// A string value. - [JsiiProperty("astring", "{\"primitive\":\"string\"}", true)] + [JsiiProperty(name: "astring", typeJson: "{\"primitive\":\"string\"}", isOverride: true)] public string Astring { get; set; } - [JsiiProperty("firstOptional", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}},\"optional\":true}", true)] + [JsiiProperty(name: "firstOptional", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}", isOptional: true, isOverride: true)] public string[] FirstOptional { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStructProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStructProxy.cs index 6860f37354..74939a2783 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStructProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStructProxy.cs @@ -6,66 +6,66 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// A struct which derives from another struct. - [JsiiTypeProxy(typeof(IDerivedStruct), "jsii-calc.DerivedStruct")] + [JsiiTypeProxy(nativeType: typeof(IDerivedStruct), fullyQualifiedName: "jsii-calc.DerivedStruct")] internal sealed class DerivedStructProxy : DeputyBase, IDerivedStruct { private DerivedStructProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("anotherRequired", "{\"primitive\":\"date\"}")] + [JsiiProperty(name: "anotherRequired", typeJson: "{\"primitive\":\"date\"}")] public DateTime AnotherRequired { get => GetInstanceProperty(); } - [JsiiProperty("bool", "{\"primitive\":\"boolean\"}")] + [JsiiProperty(name: "bool", typeJson: "{\"primitive\":\"boolean\"}")] public bool Bool { get => GetInstanceProperty(); } /// An example of a non primitive property. - [JsiiProperty("nonPrimitive", "{\"fqn\":\"jsii-calc.DoubleTrouble\"}")] + [JsiiProperty(name: "nonPrimitive", typeJson: "{\"fqn\":\"jsii-calc.DoubleTrouble\"}")] public DoubleTrouble NonPrimitive { get => GetInstanceProperty(); } /// This is optional. - [JsiiProperty("anotherOptional", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},\"optional\":true}")] + [JsiiProperty(name: "anotherOptional", typeJson: "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}", isOptional: true)] public IDictionary AnotherOptional { get => GetInstanceProperty>(); } - [JsiiProperty("optionalAny", "{\"primitive\":\"any\",\"optional\":true}")] + [JsiiProperty(name: "optionalAny", typeJson: "{\"primitive\":\"any\"}", isOptional: true)] public object OptionalAny { get => GetInstanceProperty(); } - [JsiiProperty("optionalArray", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}},\"optional\":true}")] + [JsiiProperty(name: "optionalArray", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}", isOptional: true)] public string[] OptionalArray { get => GetInstanceProperty(); } /// An awesome number value. - [JsiiProperty("anumber", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "anumber", typeJson: "{\"primitive\":\"number\"}")] public double Anumber { get => GetInstanceProperty(); } /// A string value. - [JsiiProperty("astring", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "astring", typeJson: "{\"primitive\":\"string\"}")] public string Astring { get => GetInstanceProperty(); } - [JsiiProperty("firstOptional", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}},\"optional\":true}")] + [JsiiProperty(name: "firstOptional", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}", isOptional: true)] public string[] FirstOptional { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoNotOverridePrivates.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoNotOverridePrivates.cs index 47256a259b..8a73273317 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoNotOverridePrivates.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoNotOverridePrivates.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(DoNotOverridePrivates), "jsii-calc.DoNotOverridePrivates", "[]")] + [JsiiClass(nativeType: typeof(DoNotOverridePrivates), fullyQualifiedName: "jsii-calc.DoNotOverridePrivates")] public class DoNotOverridePrivates : DeputyBase { public DoNotOverridePrivates(): base(new DeputyProps(new object[]{})) @@ -17,19 +17,19 @@ protected DoNotOverridePrivates(DeputyProps props): base(props) { } - [JsiiMethod("changePrivatePropertyValue", null, "[{\"name\":\"newValue\",\"type\":{\"primitive\":\"string\"}}]")] + [JsiiMethod(name: "changePrivatePropertyValue", parametersJson: "[{\"name\":\"newValue\",\"type\":{\"primitive\":\"string\"}}]")] public virtual void ChangePrivatePropertyValue(string newValue) { InvokeInstanceVoidMethod(new object[]{newValue}); } - [JsiiMethod("privateMethodValue", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "privateMethodValue", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public virtual string PrivateMethodValue() { return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("privatePropertyValue", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "privatePropertyValue", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public virtual string PrivatePropertyValue() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoNotRecognizeAnyAsOptional.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoNotRecognizeAnyAsOptional.cs index 1bde521c04..0e8c2b0012 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoNotRecognizeAnyAsOptional.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoNotRecognizeAnyAsOptional.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// jsii#284: do not recognize "any" as an optional argument. - [JsiiClass(typeof(DoNotRecognizeAnyAsOptional), "jsii-calc.DoNotRecognizeAnyAsOptional", "[]")] + [JsiiClass(nativeType: typeof(DoNotRecognizeAnyAsOptional), fullyQualifiedName: "jsii-calc.DoNotRecognizeAnyAsOptional")] public class DoNotRecognizeAnyAsOptional : DeputyBase { public DoNotRecognizeAnyAsOptional(): base(new DeputyProps(new object[]{})) @@ -18,7 +18,7 @@ protected DoNotRecognizeAnyAsOptional(DeputyProps props): base(props) { } - [JsiiMethod("method", null, "[{\"name\":\"_requiredAny\",\"type\":{\"primitive\":\"any\"}},{\"name\":\"_optionalAny\",\"type\":{\"primitive\":\"any\",\"optional\":true}},{\"name\":\"_optionalString\",\"type\":{\"primitive\":\"string\",\"optional\":true}}]")] + [JsiiMethod(name: "method", parametersJson: "[{\"name\":\"_requiredAny\",\"type\":{\"primitive\":\"any\"}},{\"name\":\"_optionalAny\",\"type\":{\"primitive\":\"any\"}},{\"name\":\"_optionalString\",\"type\":{\"primitive\":\"string\"}}]")] public virtual void Method(object _requiredAny, object _optionalAny, string _optionalString) { InvokeInstanceVoidMethod(new object[]{_requiredAny, _optionalAny, _optionalString}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DocumentedClass.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DocumentedClass.cs index 9219305e51..27a8fb1742 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DocumentedClass.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DocumentedClass.cs @@ -10,7 +10,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Multiple paragraphs are separated by an empty line. /// stability: stable /// - [JsiiClass(typeof(DocumentedClass), "jsii-calc.DocumentedClass", "[]")] + [JsiiClass(nativeType: typeof(DocumentedClass), fullyQualifiedName: "jsii-calc.DocumentedClass")] public class DocumentedClass : DeputyBase { public DocumentedClass(): base(new DeputyProps(new object[]{})) @@ -32,7 +32,7 @@ protected DocumentedClass(DeputyProps props): base(props) /// This will print out a friendly greeting intended for /// the indicated person. /// - [JsiiMethod("greet", "{\"primitive\":\"number\"}", "[{\"name\":\"greetee\",\"type\":{\"fqn\":\"jsii-calc.Greetee\",\"optional\":true}}]")] + [JsiiMethod(name: "greet", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", parametersJson: "[{\"name\":\"greetee\",\"type\":{\"fqn\":\"jsii-calc.Greetee\"}}]")] public virtual double Greet(IGreetee greetee) { return InvokeInstanceMethod(new object[]{greetee}); @@ -40,7 +40,7 @@ public virtual double Greet(IGreetee greetee) /// Say ¡Hola! /// stability: experimental - [JsiiMethod("hola", null, "[]")] + [JsiiMethod(name: "hola")] public virtual void Hola() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DontComplainAboutVariadicAfterOptional.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DontComplainAboutVariadicAfterOptional.cs index f9c4e2f9eb..6a79257436 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DontComplainAboutVariadicAfterOptional.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DontComplainAboutVariadicAfterOptional.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(DontComplainAboutVariadicAfterOptional), "jsii-calc.DontComplainAboutVariadicAfterOptional", "[]")] + [JsiiClass(nativeType: typeof(DontComplainAboutVariadicAfterOptional), fullyQualifiedName: "jsii-calc.DontComplainAboutVariadicAfterOptional")] public class DontComplainAboutVariadicAfterOptional : DeputyBase { public DontComplainAboutVariadicAfterOptional(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected DontComplainAboutVariadicAfterOptional(DeputyProps props): base(props) { } - [JsiiMethod("optionalAndVariadic", "{\"primitive\":\"string\"}", "[{\"name\":\"optional\",\"type\":{\"primitive\":\"string\",\"optional\":true}},{\"name\":\"things\",\"type\":{\"primitive\":\"string\"}}]")] + [JsiiMethod(name: "optionalAndVariadic", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", parametersJson: "[{\"name\":\"optional\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"things\",\"type\":{\"primitive\":\"string\"}}]")] public virtual string OptionalAndVariadic(string optional, string things) { return InvokeInstanceMethod(new object[]{optional, things}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoubleTrouble.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoubleTrouble.cs index b1215d2026..78eeaa6c83 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoubleTrouble.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoubleTrouble.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(DoubleTrouble), "jsii-calc.DoubleTrouble", "[]")] + [JsiiClass(nativeType: typeof(DoubleTrouble), fullyQualifiedName: "jsii-calc.DoubleTrouble")] public class DoubleTrouble : DeputyBase, IIFriendlyRandomGenerator { public DoubleTrouble(): base(new DeputyProps(new object[]{})) @@ -18,14 +18,14 @@ protected DoubleTrouble(DeputyProps props): base(props) } /// Say hello! - [JsiiMethod("hello", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "hello", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public virtual string Hello() { return InvokeInstanceMethod(new object[]{}); } /// Returns another random number. - [JsiiMethod("next", "{\"primitive\":\"number\"}", "[]")] + [JsiiMethod(name: "next", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", isOverride: true)] public virtual double Next() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/EraseUndefinedHashValues.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/EraseUndefinedHashValues.cs index a96bcb3d81..7d44323136 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/EraseUndefinedHashValues.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/EraseUndefinedHashValues.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(EraseUndefinedHashValues), "jsii-calc.EraseUndefinedHashValues", "[]")] + [JsiiClass(nativeType: typeof(EraseUndefinedHashValues), fullyQualifiedName: "jsii-calc.EraseUndefinedHashValues")] public class EraseUndefinedHashValues : DeputyBase { public EraseUndefinedHashValues(): base(new DeputyProps(new object[]{})) @@ -22,21 +22,21 @@ protected EraseUndefinedHashValues(DeputyProps props): base(props) /// Used to check that undefined/null hash values /// are being erased when sending values from native code to JS. /// - [JsiiMethod("doesKeyExist", "{\"primitive\":\"boolean\"}", "[{\"name\":\"opts\",\"type\":{\"fqn\":\"jsii-calc.EraseUndefinedHashValuesOptions\"}},{\"name\":\"key\",\"type\":{\"primitive\":\"string\"}}]")] + [JsiiMethod(name: "doesKeyExist", returnsJson: "{\"type\":{\"primitive\":\"boolean\"}}", parametersJson: "[{\"name\":\"opts\",\"type\":{\"fqn\":\"jsii-calc.EraseUndefinedHashValuesOptions\"}},{\"name\":\"key\",\"type\":{\"primitive\":\"string\"}}]")] public static bool DoesKeyExist(IEraseUndefinedHashValuesOptions opts, string key) { return InvokeStaticMethod(typeof(EraseUndefinedHashValues), new object[]{opts, key}); } /// We expect "prop1" to be erased. - [JsiiMethod("prop1IsNull", "{\"primitive\":\"any\"}", "[]")] + [JsiiMethod(name: "prop1IsNull", returnsJson: "{\"type\":{\"primitive\":\"any\"}}")] public static object Prop1IsNull() { return InvokeStaticMethod(typeof(EraseUndefinedHashValues), new object[]{}); } /// We expect "prop2" to be erased. - [JsiiMethod("prop2IsUndefined", "{\"primitive\":\"any\"}", "[]")] + [JsiiMethod(name: "prop2IsUndefined", returnsJson: "{\"type\":{\"primitive\":\"any\"}}")] public static object Prop2IsUndefined() { return InvokeStaticMethod(typeof(EraseUndefinedHashValues), new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/EraseUndefinedHashValuesOptions.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/EraseUndefinedHashValuesOptions.cs index 4b5d02e532..b42780e9c5 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/EraseUndefinedHashValuesOptions.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/EraseUndefinedHashValuesOptions.cs @@ -5,14 +5,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue] public class EraseUndefinedHashValuesOptions : IEraseUndefinedHashValuesOptions { - [JsiiProperty("option1", "{\"primitive\":\"string\",\"optional\":true}", true)] + [JsiiProperty(name: "option1", typeJson: "{\"primitive\":\"string\"}", isOptional: true, isOverride: true)] public string Option1 { get; set; } - [JsiiProperty("option2", "{\"primitive\":\"string\",\"optional\":true}", true)] + [JsiiProperty(name: "option2", typeJson: "{\"primitive\":\"string\"}", isOptional: true, isOverride: true)] public string Option2 { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/EraseUndefinedHashValuesOptionsProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/EraseUndefinedHashValuesOptionsProxy.cs index 82ab20d7ce..5e25ae14c7 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/EraseUndefinedHashValuesOptionsProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/EraseUndefinedHashValuesOptionsProxy.cs @@ -2,20 +2,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IEraseUndefinedHashValuesOptions), "jsii-calc.EraseUndefinedHashValuesOptions")] + [JsiiTypeProxy(nativeType: typeof(IEraseUndefinedHashValuesOptions), fullyQualifiedName: "jsii-calc.EraseUndefinedHashValuesOptions")] internal sealed class EraseUndefinedHashValuesOptionsProxy : DeputyBase, IEraseUndefinedHashValuesOptions { private EraseUndefinedHashValuesOptionsProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("option1", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "option1", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] public string Option1 { get => GetInstanceProperty(); } - [JsiiProperty("option2", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "option2", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] public string Option2 { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExportedBaseClass.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExportedBaseClass.cs index 9e237990ac..76cbc66a2c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExportedBaseClass.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExportedBaseClass.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(ExportedBaseClass), "jsii-calc.ExportedBaseClass", "[{\"name\":\"success\",\"type\":{\"primitive\":\"boolean\"}}]")] + [JsiiClass(nativeType: typeof(ExportedBaseClass), fullyQualifiedName: "jsii-calc.ExportedBaseClass", parametersJson: "[{\"name\":\"success\",\"type\":{\"primitive\":\"boolean\"}}]")] public class ExportedBaseClass : DeputyBase { public ExportedBaseClass(bool success): base(new DeputyProps(new object[]{success})) @@ -17,7 +17,7 @@ protected ExportedBaseClass(DeputyProps props): base(props) { } - [JsiiProperty("success", "{\"primitive\":\"boolean\"}")] + [JsiiProperty(name: "success", typeJson: "{\"primitive\":\"boolean\"}")] public virtual bool Success { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExtendsInternalInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExtendsInternalInterface.cs index d1efd44009..f8491f4e92 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExtendsInternalInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExtendsInternalInterface.cs @@ -5,14 +5,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue] public class ExtendsInternalInterface : IExtendsInternalInterface { - [JsiiProperty("boom", "{\"primitive\":\"boolean\"}", true)] + [JsiiProperty(name: "boom", typeJson: "{\"primitive\":\"boolean\"}", isOverride: true)] public bool Boom { get; set; } - [JsiiProperty("prop", "{\"primitive\":\"string\"}", true)] + [JsiiProperty(name: "prop", typeJson: "{\"primitive\":\"string\"}", isOverride: true)] public string Prop { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExtendsInternalInterfaceProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExtendsInternalInterfaceProxy.cs index f214aa05c2..5a8c6e5086 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExtendsInternalInterfaceProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExtendsInternalInterfaceProxy.cs @@ -2,20 +2,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IExtendsInternalInterface), "jsii-calc.ExtendsInternalInterface")] + [JsiiTypeProxy(nativeType: typeof(IExtendsInternalInterface), fullyQualifiedName: "jsii-calc.ExtendsInternalInterface")] internal sealed class ExtendsInternalInterfaceProxy : DeputyBase, IExtendsInternalInterface { private ExtendsInternalInterfaceProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("boom", "{\"primitive\":\"boolean\"}")] + [JsiiProperty(name: "boom", typeJson: "{\"primitive\":\"boolean\"}")] public bool Boom { get => GetInstanceProperty(); } - [JsiiProperty("prop", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "prop", typeJson: "{\"primitive\":\"string\"}")] public string Prop { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GiveMeStructs.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GiveMeStructs.cs index 0a5c95cf5a..3825ba80b5 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GiveMeStructs.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GiveMeStructs.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(GiveMeStructs), "jsii-calc.GiveMeStructs", "[]")] + [JsiiClass(nativeType: typeof(GiveMeStructs), fullyQualifiedName: "jsii-calc.GiveMeStructs")] public class GiveMeStructs : DeputyBase { public GiveMeStructs(): base(new DeputyProps(new object[]{})) @@ -18,28 +18,28 @@ protected GiveMeStructs(DeputyProps props): base(props) { } - [JsiiProperty("structLiteral", "{\"fqn\":\"@scope/jsii-calc-lib.StructWithOnlyOptionals\"}")] + [JsiiProperty(name: "structLiteral", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.StructWithOnlyOptionals\"}")] public virtual IStructWithOnlyOptionals StructLiteral { get => GetInstanceProperty(); } /// Accepts a struct of type DerivedStruct and returns a struct of type FirstStruct. - [JsiiMethod("derivedToFirst", "{\"fqn\":\"@scope/jsii-calc-lib.MyFirstStruct\"}", "[{\"name\":\"derived\",\"type\":{\"fqn\":\"jsii-calc.DerivedStruct\"}}]")] + [JsiiMethod(name: "derivedToFirst", returnsJson: "{\"type\":{\"fqn\":\"@scope/jsii-calc-lib.MyFirstStruct\"}}", parametersJson: "[{\"name\":\"derived\",\"type\":{\"fqn\":\"jsii-calc.DerivedStruct\"}}]")] public virtual IMyFirstStruct DerivedToFirst(IDerivedStruct derived) { return InvokeInstanceMethod(new object[]{derived}); } /// Returns the boolean from a DerivedStruct struct. - [JsiiMethod("readDerivedNonPrimitive", "{\"fqn\":\"jsii-calc.DoubleTrouble\"}", "[{\"name\":\"derived\",\"type\":{\"fqn\":\"jsii-calc.DerivedStruct\"}}]")] + [JsiiMethod(name: "readDerivedNonPrimitive", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.DoubleTrouble\"}}", parametersJson: "[{\"name\":\"derived\",\"type\":{\"fqn\":\"jsii-calc.DerivedStruct\"}}]")] public virtual DoubleTrouble ReadDerivedNonPrimitive(IDerivedStruct derived) { return InvokeInstanceMethod(new object[]{derived}); } /// Returns the "anumber" from a MyFirstStruct struct; - [JsiiMethod("readFirstNumber", "{\"primitive\":\"number\"}", "[{\"name\":\"first\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.MyFirstStruct\"}}]")] + [JsiiMethod(name: "readFirstNumber", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", parametersJson: "[{\"name\":\"first\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.MyFirstStruct\"}}]")] public virtual double ReadFirstNumber(IMyFirstStruct first) { return InvokeInstanceMethod(new object[]{first}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Greetee.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Greetee.cs index 493ffca984..0452baac37 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Greetee.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Greetee.cs @@ -8,7 +8,7 @@ public class Greetee : IGreetee { /// The name of the greetee. /// default: world - [JsiiProperty("name", "{\"primitive\":\"string\",\"optional\":true}", true)] + [JsiiProperty(name: "name", typeJson: "{\"primitive\":\"string\"}", isOptional: true, isOverride: true)] public string Name { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GreeteeProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GreeteeProxy.cs index e0ac14ea41..0740747fa3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GreeteeProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GreeteeProxy.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// These are some arguments you can pass to a method. - [JsiiTypeProxy(typeof(IGreetee), "jsii-calc.Greetee")] + [JsiiTypeProxy(nativeType: typeof(IGreetee), fullyQualifiedName: "jsii-calc.Greetee")] internal sealed class GreeteeProxy : DeputyBase, IGreetee { private GreeteeProxy(ByRefValue reference): base(reference) @@ -12,7 +12,7 @@ private GreeteeProxy(ByRefValue reference): base(reference) /// The name of the greetee. /// default: world - [JsiiProperty("name", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "name", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] public string Name { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GreetingAugmenter.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GreetingAugmenter.cs index 24e4938515..1c9da1609d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GreetingAugmenter.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GreetingAugmenter.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(GreetingAugmenter), "jsii-calc.GreetingAugmenter", "[]")] + [JsiiClass(nativeType: typeof(GreetingAugmenter), fullyQualifiedName: "jsii-calc.GreetingAugmenter")] public class GreetingAugmenter : DeputyBase { public GreetingAugmenter(): base(new DeputyProps(new object[]{})) @@ -18,7 +18,7 @@ protected GreetingAugmenter(DeputyProps props): base(props) { } - [JsiiMethod("betterGreeting", "{\"primitive\":\"string\"}", "[{\"name\":\"friendly\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.IFriendly\"}}]")] + [JsiiMethod(name: "betterGreeting", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", parametersJson: "[{\"name\":\"friendly\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.IFriendly\"}}]")] public virtual string BetterGreeting(IIFriendly friendly) { return InvokeInstanceMethod(new object[]{friendly}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IAnotherPublicInterfaceProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IAnotherPublicInterfaceProxy.cs index 264c2357c4..db5dbd1245 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IAnotherPublicInterfaceProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IAnotherPublicInterfaceProxy.cs @@ -2,14 +2,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IIAnotherPublicInterface), "jsii-calc.IAnotherPublicInterface")] + [JsiiTypeProxy(nativeType: typeof(IIAnotherPublicInterface), fullyQualifiedName: "jsii-calc.IAnotherPublicInterface")] internal sealed class IAnotherPublicInterfaceProxy : DeputyBase, IIAnotherPublicInterface { private IAnotherPublicInterfaceProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("a", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "a", typeJson: "{\"primitive\":\"string\"}")] public string A { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs index c16e6af6a2..10856b8b74 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs @@ -3,16 +3,16 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Properties for Calculator. - [JsiiInterface(typeof(ICalculatorProps), "jsii-calc.CalculatorProps")] + [JsiiInterface(nativeType: typeof(ICalculatorProps), fullyQualifiedName: "jsii-calc.CalculatorProps")] public interface ICalculatorProps { - [JsiiProperty("initialValue", "{\"primitive\":\"number\",\"optional\":true}")] + [JsiiProperty(name: "initialValue", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] double? InitialValue { get; } - [JsiiProperty("maximumValue", "{\"primitive\":\"number\",\"optional\":true}")] + [JsiiProperty(name: "maximumValue", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] double? MaximumValue { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs index 7aa801be30..77c986dd78 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs @@ -6,42 +6,42 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// A struct which derives from another struct. - [JsiiInterface(typeof(IDerivedStruct), "jsii-calc.DerivedStruct")] + [JsiiInterface(nativeType: typeof(IDerivedStruct), fullyQualifiedName: "jsii-calc.DerivedStruct")] public interface IDerivedStruct : IMyFirstStruct { - [JsiiProperty("anotherRequired", "{\"primitive\":\"date\"}")] + [JsiiProperty(name: "anotherRequired", typeJson: "{\"primitive\":\"date\"}")] DateTime AnotherRequired { get; } - [JsiiProperty("bool", "{\"primitive\":\"boolean\"}")] + [JsiiProperty(name: "bool", typeJson: "{\"primitive\":\"boolean\"}")] bool Bool { get; } /// An example of a non primitive property. - [JsiiProperty("nonPrimitive", "{\"fqn\":\"jsii-calc.DoubleTrouble\"}")] + [JsiiProperty(name: "nonPrimitive", typeJson: "{\"fqn\":\"jsii-calc.DoubleTrouble\"}")] DoubleTrouble NonPrimitive { get; } /// This is optional. - [JsiiProperty("anotherOptional", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},\"optional\":true}")] + [JsiiProperty(name: "anotherOptional", typeJson: "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}", isOptional: true)] IDictionary AnotherOptional { get; } - [JsiiProperty("optionalAny", "{\"primitive\":\"any\",\"optional\":true}")] + [JsiiProperty(name: "optionalAny", typeJson: "{\"primitive\":\"any\"}", isOptional: true)] object OptionalAny { get; } - [JsiiProperty("optionalArray", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}},\"optional\":true}")] + [JsiiProperty(name: "optionalArray", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}", isOptional: true)] string[] OptionalArray { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IEraseUndefinedHashValuesOptions.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IEraseUndefinedHashValuesOptions.cs index 7ef9e38891..31245395a7 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IEraseUndefinedHashValuesOptions.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IEraseUndefinedHashValuesOptions.cs @@ -2,16 +2,16 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IEraseUndefinedHashValuesOptions), "jsii-calc.EraseUndefinedHashValuesOptions")] + [JsiiInterface(nativeType: typeof(IEraseUndefinedHashValuesOptions), fullyQualifiedName: "jsii-calc.EraseUndefinedHashValuesOptions")] public interface IEraseUndefinedHashValuesOptions { - [JsiiProperty("option1", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "option1", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Option1 { get; } - [JsiiProperty("option2", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "option2", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Option2 { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExtendsInternalInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExtendsInternalInterface.cs index ef49e96699..e1c06e6182 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExtendsInternalInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExtendsInternalInterface.cs @@ -2,16 +2,16 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IExtendsInternalInterface), "jsii-calc.ExtendsInternalInterface")] + [JsiiInterface(nativeType: typeof(IExtendsInternalInterface), fullyQualifiedName: "jsii-calc.ExtendsInternalInterface")] public interface IExtendsInternalInterface { - [JsiiProperty("boom", "{\"primitive\":\"boolean\"}")] + [JsiiProperty(name: "boom", typeJson: "{\"primitive\":\"boolean\"}")] bool Boom { get; } - [JsiiProperty("prop", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "prop", typeJson: "{\"primitive\":\"string\"}")] string Prop { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExtendsPrivateInterfaceProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExtendsPrivateInterfaceProxy.cs index 9a276d3811..d7709d706e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExtendsPrivateInterfaceProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExtendsPrivateInterfaceProxy.cs @@ -2,20 +2,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IIExtendsPrivateInterface), "jsii-calc.IExtendsPrivateInterface")] + [JsiiTypeProxy(nativeType: typeof(IIExtendsPrivateInterface), fullyQualifiedName: "jsii-calc.IExtendsPrivateInterface")] internal sealed class IExtendsPrivateInterfaceProxy : DeputyBase, IIExtendsPrivateInterface { private IExtendsPrivateInterfaceProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("moreThings", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}")] + [JsiiProperty(name: "moreThings", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}")] public string[] MoreThings { get => GetInstanceProperty(); } - [JsiiProperty("private", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "private", typeJson: "{\"primitive\":\"string\"}")] public string Private { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlierProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlierProxy.cs index 220edef048..05c4375d7e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlierProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlierProxy.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Even friendlier classes can implement this interface. - [JsiiTypeProxy(typeof(IIFriendlier), "jsii-calc.IFriendlier")] + [JsiiTypeProxy(nativeType: typeof(IIFriendlier), fullyQualifiedName: "jsii-calc.IFriendlier")] internal sealed class IFriendlierProxy : DeputyBase, IIFriendlier { private IFriendlierProxy(ByRefValue reference): base(reference) @@ -11,7 +11,7 @@ private IFriendlierProxy(ByRefValue reference): base(reference) } /// Say farewell. - [JsiiMethod("farewell", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "farewell", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public string Farewell() { return InvokeInstanceMethod(new object[]{}); @@ -19,14 +19,14 @@ public string Farewell() /// Say goodbye. /// A goodbye blessing. - [JsiiMethod("goodbye", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "goodbye", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public string Goodbye() { return InvokeInstanceMethod(new object[]{}); } /// Say hello! - [JsiiMethod("hello", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "hello", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public string Hello() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlyRandomGeneratorProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlyRandomGeneratorProxy.cs index f179d26ab6..5a6a3a49cc 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlyRandomGeneratorProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlyRandomGeneratorProxy.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IIFriendlyRandomGenerator), "jsii-calc.IFriendlyRandomGenerator")] + [JsiiTypeProxy(nativeType: typeof(IIFriendlyRandomGenerator), fullyQualifiedName: "jsii-calc.IFriendlyRandomGenerator")] internal sealed class IFriendlyRandomGeneratorProxy : DeputyBase, IIFriendlyRandomGenerator { private IFriendlyRandomGeneratorProxy(ByRefValue reference): base(reference) @@ -11,14 +11,14 @@ private IFriendlyRandomGeneratorProxy(ByRefValue reference): base(reference) /// Returns another random number. /// A random number. - [JsiiMethod("next", "{\"primitive\":\"number\"}", "[]")] + [JsiiMethod(name: "next", returnsJson: "{\"type\":{\"primitive\":\"number\"}}")] public double Next() { return InvokeInstanceMethod(new object[]{}); } /// Say hello! - [JsiiMethod("hello", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "hello", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public string Hello() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IGreetee.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IGreetee.cs index 7f03b8c67e..c1d28f1024 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IGreetee.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IGreetee.cs @@ -3,12 +3,12 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// These are some arguments you can pass to a method. - [JsiiInterface(typeof(IGreetee), "jsii-calc.Greetee")] + [JsiiInterface(nativeType: typeof(IGreetee), fullyQualifiedName: "jsii-calc.Greetee")] public interface IGreetee { /// The name of the greetee. /// default: world - [JsiiProperty("name", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "name", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Name { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIAnotherPublicInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIAnotherPublicInterface.cs index ac551e881f..3688bc685e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIAnotherPublicInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIAnotherPublicInterface.cs @@ -2,10 +2,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IIAnotherPublicInterface), "jsii-calc.IAnotherPublicInterface")] + [JsiiInterface(nativeType: typeof(IIAnotherPublicInterface), fullyQualifiedName: "jsii-calc.IAnotherPublicInterface")] public interface IIAnotherPublicInterface { - [JsiiProperty("a", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "a", typeJson: "{\"primitive\":\"string\"}")] string A { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIExtendsPrivateInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIExtendsPrivateInterface.cs index c9fe06ae42..2e386d003e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIExtendsPrivateInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIExtendsPrivateInterface.cs @@ -2,16 +2,16 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IIExtendsPrivateInterface), "jsii-calc.IExtendsPrivateInterface")] + [JsiiInterface(nativeType: typeof(IIExtendsPrivateInterface), fullyQualifiedName: "jsii-calc.IExtendsPrivateInterface")] public interface IIExtendsPrivateInterface { - [JsiiProperty("moreThings", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}")] + [JsiiProperty(name: "moreThings", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}")] string[] MoreThings { get; } - [JsiiProperty("private", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "private", typeJson: "{\"primitive\":\"string\"}")] string Private { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlier.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlier.cs index c44fe3d253..d31cd6d3a7 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlier.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlier.cs @@ -4,15 +4,15 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Even friendlier classes can implement this interface. - [JsiiInterface(typeof(IIFriendlier), "jsii-calc.IFriendlier")] + [JsiiInterface(nativeType: typeof(IIFriendlier), fullyQualifiedName: "jsii-calc.IFriendlier")] public interface IIFriendlier : IIFriendly { /// Say farewell. - [JsiiMethod("farewell", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "farewell", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] string Farewell(); /// Say goodbye. /// A goodbye blessing. - [JsiiMethod("goodbye", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "goodbye", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] string Goodbye(); } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlyRandomGenerator.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlyRandomGenerator.cs index 389968b74d..9424d428f6 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlyRandomGenerator.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlyRandomGenerator.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IIFriendlyRandomGenerator), "jsii-calc.IFriendlyRandomGenerator")] + [JsiiInterface(nativeType: typeof(IIFriendlyRandomGenerator), fullyQualifiedName: "jsii-calc.IFriendlyRandomGenerator")] public interface IIFriendlyRandomGenerator : IIRandomNumberGenerator, IIFriendly { } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceImplementedByAbstractClass.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceImplementedByAbstractClass.cs index 38daaeeb17..81205223b7 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceImplementedByAbstractClass.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceImplementedByAbstractClass.cs @@ -3,10 +3,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// awslabs/jsii#220 Abstract return type. - [JsiiInterface(typeof(IIInterfaceImplementedByAbstractClass), "jsii-calc.IInterfaceImplementedByAbstractClass")] + [JsiiInterface(nativeType: typeof(IIInterfaceImplementedByAbstractClass), fullyQualifiedName: "jsii-calc.IInterfaceImplementedByAbstractClass")] public interface IIInterfaceImplementedByAbstractClass { - [JsiiProperty("propFromInterface", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "propFromInterface", typeJson: "{\"primitive\":\"string\"}")] string PropFromInterface { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceThatShouldNotBeADataType.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceThatShouldNotBeADataType.cs index 79f4931746..737bb5f2d1 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceThatShouldNotBeADataType.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceThatShouldNotBeADataType.cs @@ -3,10 +3,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Even though this interface has only properties, it is disqualified from being a datatype because it inherits from an interface that is not a datatype. - [JsiiInterface(typeof(IIInterfaceThatShouldNotBeADataType), "jsii-calc.IInterfaceThatShouldNotBeADataType")] + [JsiiInterface(nativeType: typeof(IIInterfaceThatShouldNotBeADataType), fullyQualifiedName: "jsii-calc.IInterfaceThatShouldNotBeADataType")] public interface IIInterfaceThatShouldNotBeADataType : IIInterfaceWithMethods { - [JsiiProperty("otherValue", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "otherValue", typeJson: "{\"primitive\":\"string\"}")] string OtherValue { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithInternal.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithInternal.cs index 88502b3fa0..fb97630f11 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithInternal.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithInternal.cs @@ -2,10 +2,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IIInterfaceWithInternal), "jsii-calc.IInterfaceWithInternal")] + [JsiiInterface(nativeType: typeof(IIInterfaceWithInternal), fullyQualifiedName: "jsii-calc.IInterfaceWithInternal")] public interface IIInterfaceWithInternal { - [JsiiMethod("visible", null, "[]")] + [JsiiMethod(name: "visible")] void Visible(); } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithMethods.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithMethods.cs index ccd793c1da..ba4a1e8788 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithMethods.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithMethods.cs @@ -2,16 +2,16 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IIInterfaceWithMethods), "jsii-calc.IInterfaceWithMethods")] + [JsiiInterface(nativeType: typeof(IIInterfaceWithMethods), fullyQualifiedName: "jsii-calc.IInterfaceWithMethods")] public interface IIInterfaceWithMethods { - [JsiiProperty("value", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"string\"}")] string Value { get; } - [JsiiMethod("doThings", null, "[]")] + [JsiiMethod(name: "doThings")] void DoThings(); } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithOptionalMethodArguments.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithOptionalMethodArguments.cs index f83ac38083..0654eb191d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithOptionalMethodArguments.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithOptionalMethodArguments.cs @@ -3,10 +3,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// awslabs/jsii#175 Interface proxies (and builders) do not respect optional arguments in methods. - [JsiiInterface(typeof(IIInterfaceWithOptionalMethodArguments), "jsii-calc.IInterfaceWithOptionalMethodArguments")] + [JsiiInterface(nativeType: typeof(IIInterfaceWithOptionalMethodArguments), fullyQualifiedName: "jsii-calc.IInterfaceWithOptionalMethodArguments")] public interface IIInterfaceWithOptionalMethodArguments { - [JsiiMethod("hello", null, "[{\"name\":\"arg1\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"arg2\",\"type\":{\"primitive\":\"number\",\"optional\":true}}]")] + [JsiiMethod(name: "hello", parametersJson: "[{\"name\":\"arg1\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"arg2\",\"type\":{\"primitive\":\"number\"}}]")] void Hello(string arg1, double? arg2); } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithProperties.cs index cfdc3b488f..14d6103abd 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithProperties.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithProperties.cs @@ -2,16 +2,16 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IIInterfaceWithProperties), "jsii-calc.IInterfaceWithProperties")] + [JsiiInterface(nativeType: typeof(IIInterfaceWithProperties), fullyQualifiedName: "jsii-calc.IInterfaceWithProperties")] public interface IIInterfaceWithProperties { - [JsiiProperty("readOnlyString", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "readOnlyString", typeJson: "{\"primitive\":\"string\"}")] string ReadOnlyString { get; } - [JsiiProperty("readWriteString", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "readWriteString", typeJson: "{\"primitive\":\"string\"}")] string ReadWriteString { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithPropertiesExtension.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithPropertiesExtension.cs index 26840a4247..64a6d9f4e7 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithPropertiesExtension.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithPropertiesExtension.cs @@ -2,10 +2,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IIInterfaceWithPropertiesExtension), "jsii-calc.IInterfaceWithPropertiesExtension")] + [JsiiInterface(nativeType: typeof(IIInterfaceWithPropertiesExtension), fullyQualifiedName: "jsii-calc.IInterfaceWithPropertiesExtension")] public interface IIInterfaceWithPropertiesExtension : IIInterfaceWithProperties { - [JsiiProperty("foo", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "foo", typeJson: "{\"primitive\":\"number\"}")] double Foo { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIJSII417Derived.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIJSII417Derived.cs index 22b7b37324..c87a366b72 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIJSII417Derived.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIJSII417Derived.cs @@ -2,18 +2,18 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IIJSII417Derived), "jsii-calc.IJSII417Derived")] + [JsiiInterface(nativeType: typeof(IIJSII417Derived), fullyQualifiedName: "jsii-calc.IJSII417Derived")] public interface IIJSII417Derived : IIJSII417PublicBaseOfBase { - [JsiiProperty("property", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "property", typeJson: "{\"primitive\":\"string\"}")] string Property { get; } - [JsiiMethod("bar", null, "[]")] + [JsiiMethod(name: "bar")] void Bar(); - [JsiiMethod("baz", null, "[]")] + [JsiiMethod(name: "baz")] void Baz(); } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIJSII417PublicBaseOfBase.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIJSII417PublicBaseOfBase.cs index 921528a252..498236f75b 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIJSII417PublicBaseOfBase.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIJSII417PublicBaseOfBase.cs @@ -2,16 +2,16 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IIJSII417PublicBaseOfBase), "jsii-calc.IJSII417PublicBaseOfBase")] + [JsiiInterface(nativeType: typeof(IIJSII417PublicBaseOfBase), fullyQualifiedName: "jsii-calc.IJSII417PublicBaseOfBase")] public interface IIJSII417PublicBaseOfBase { - [JsiiProperty("hasRoot", "{\"primitive\":\"boolean\"}")] + [JsiiProperty(name: "hasRoot", typeJson: "{\"primitive\":\"boolean\"}")] bool HasRoot { get; } - [JsiiMethod("foo", null, "[]")] + [JsiiMethod(name: "foo")] void Foo(); } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIMutableObjectLiteral.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIMutableObjectLiteral.cs index 82d154ae9c..43eefecd92 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIMutableObjectLiteral.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIMutableObjectLiteral.cs @@ -2,10 +2,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IIMutableObjectLiteral), "jsii-calc.IMutableObjectLiteral")] + [JsiiInterface(nativeType: typeof(IIMutableObjectLiteral), fullyQualifiedName: "jsii-calc.IMutableObjectLiteral")] public interface IIMutableObjectLiteral { - [JsiiProperty("value", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"string\"}")] string Value { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IINonInternalInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IINonInternalInterface.cs index 57f7fe3be2..7452d75a51 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IINonInternalInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IINonInternalInterface.cs @@ -2,17 +2,17 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IINonInternalInterface), "jsii-calc.INonInternalInterface")] + [JsiiInterface(nativeType: typeof(IINonInternalInterface), fullyQualifiedName: "jsii-calc.INonInternalInterface")] public interface IINonInternalInterface : IIAnotherPublicInterface { - [JsiiProperty("b", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "b", typeJson: "{\"primitive\":\"string\"}")] string B { get; set; } - [JsiiProperty("c", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "c", typeJson: "{\"primitive\":\"string\"}")] string C { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIPrivatelyImplemented.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIPrivatelyImplemented.cs index 4c74db5675..511190ceed 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIPrivatelyImplemented.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIPrivatelyImplemented.cs @@ -2,10 +2,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IIPrivatelyImplemented), "jsii-calc.IPrivatelyImplemented")] + [JsiiInterface(nativeType: typeof(IIPrivatelyImplemented), fullyQualifiedName: "jsii-calc.IPrivatelyImplemented")] public interface IIPrivatelyImplemented { - [JsiiProperty("success", "{\"primitive\":\"boolean\"}")] + [JsiiProperty(name: "success", typeJson: "{\"primitive\":\"boolean\"}")] bool Success { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIPublicInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIPublicInterface.cs index 32345c04cb..331c6d3fb2 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIPublicInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIPublicInterface.cs @@ -2,10 +2,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IIPublicInterface), "jsii-calc.IPublicInterface")] + [JsiiInterface(nativeType: typeof(IIPublicInterface), fullyQualifiedName: "jsii-calc.IPublicInterface")] public interface IIPublicInterface { - [JsiiMethod("bye", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "bye", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] string Bye(); } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIPublicInterface2.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIPublicInterface2.cs index ba10fc43b8..b9b112908a 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIPublicInterface2.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIPublicInterface2.cs @@ -2,10 +2,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IIPublicInterface2), "jsii-calc.IPublicInterface2")] + [JsiiInterface(nativeType: typeof(IIPublicInterface2), fullyQualifiedName: "jsii-calc.IPublicInterface2")] public interface IIPublicInterface2 { - [JsiiMethod("ciao", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "ciao", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] string Ciao(); } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIRandomNumberGenerator.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIRandomNumberGenerator.cs index 3a0553c4f3..49216de2c3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIRandomNumberGenerator.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIRandomNumberGenerator.cs @@ -3,12 +3,12 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Generates random numbers. - [JsiiInterface(typeof(IIRandomNumberGenerator), "jsii-calc.IRandomNumberGenerator")] + [JsiiInterface(nativeType: typeof(IIRandomNumberGenerator), fullyQualifiedName: "jsii-calc.IRandomNumberGenerator")] public interface IIRandomNumberGenerator { /// Returns another random number. /// A random number. - [JsiiMethod("next", "{\"primitive\":\"number\"}", "[]")] + [JsiiMethod(name: "next", returnsJson: "{\"type\":{\"primitive\":\"number\"}}")] double Next(); } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIReturnsNumber.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIReturnsNumber.cs index e62565eb16..3f0f0c8756 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIReturnsNumber.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIReturnsNumber.cs @@ -3,16 +3,16 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IIReturnsNumber), "jsii-calc.IReturnsNumber")] + [JsiiInterface(nativeType: typeof(IIReturnsNumber), fullyQualifiedName: "jsii-calc.IReturnsNumber")] public interface IIReturnsNumber { - [JsiiProperty("numberProp", "{\"fqn\":\"@scope/jsii-calc-lib.Number\"}")] + [JsiiProperty(name: "numberProp", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.Number\"}")] Number NumberProp { get; } - [JsiiMethod("obtainNumber", "{\"fqn\":\"@scope/jsii-calc-lib.IDoublable\"}", "[]")] + [JsiiMethod(name: "obtainNumber", returnsJson: "{\"type\":{\"fqn\":\"@scope/jsii-calc-lib.IDoublable\"}}")] IIDoublable ObtainNumber(); } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IImplictBaseOfBase.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IImplictBaseOfBase.cs index b53b4f3cfa..a0b4facbf1 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IImplictBaseOfBase.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IImplictBaseOfBase.cs @@ -4,10 +4,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IImplictBaseOfBase), "jsii-calc.ImplictBaseOfBase")] + [JsiiInterface(nativeType: typeof(IImplictBaseOfBase), fullyQualifiedName: "jsii-calc.ImplictBaseOfBase")] public interface IImplictBaseOfBase : IBaseProps { - [JsiiProperty("goo", "{\"primitive\":\"date\"}")] + [JsiiProperty(name: "goo", typeJson: "{\"primitive\":\"date\"}")] DateTime Goo { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceImplementedByAbstractClassProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceImplementedByAbstractClassProxy.cs index 823eaee5c1..4a0d3e31f3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceImplementedByAbstractClassProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceImplementedByAbstractClassProxy.cs @@ -3,14 +3,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// awslabs/jsii#220 Abstract return type. - [JsiiTypeProxy(typeof(IIInterfaceImplementedByAbstractClass), "jsii-calc.IInterfaceImplementedByAbstractClass")] + [JsiiTypeProxy(nativeType: typeof(IIInterfaceImplementedByAbstractClass), fullyQualifiedName: "jsii-calc.IInterfaceImplementedByAbstractClass")] internal sealed class IInterfaceImplementedByAbstractClassProxy : DeputyBase, IIInterfaceImplementedByAbstractClass { private IInterfaceImplementedByAbstractClassProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("propFromInterface", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "propFromInterface", typeJson: "{\"primitive\":\"string\"}")] public string PropFromInterface { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceThatShouldNotBeADataTypeProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceThatShouldNotBeADataTypeProxy.cs index 5e069c3429..e9cbb14d9a 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceThatShouldNotBeADataTypeProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceThatShouldNotBeADataTypeProxy.cs @@ -3,26 +3,26 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Even though this interface has only properties, it is disqualified from being a datatype because it inherits from an interface that is not a datatype. - [JsiiTypeProxy(typeof(IIInterfaceThatShouldNotBeADataType), "jsii-calc.IInterfaceThatShouldNotBeADataType")] + [JsiiTypeProxy(nativeType: typeof(IIInterfaceThatShouldNotBeADataType), fullyQualifiedName: "jsii-calc.IInterfaceThatShouldNotBeADataType")] internal sealed class IInterfaceThatShouldNotBeADataTypeProxy : DeputyBase, IIInterfaceThatShouldNotBeADataType { private IInterfaceThatShouldNotBeADataTypeProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("otherValue", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "otherValue", typeJson: "{\"primitive\":\"string\"}")] public string OtherValue { get => GetInstanceProperty(); } - [JsiiProperty("value", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"string\"}")] public string Value { get => GetInstanceProperty(); } - [JsiiMethod("doThings", null, "[]")] + [JsiiMethod(name: "doThings")] public void DoThings() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithInternalProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithInternalProxy.cs index 4284951359..081adee756 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithInternalProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithInternalProxy.cs @@ -2,14 +2,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IIInterfaceWithInternal), "jsii-calc.IInterfaceWithInternal")] + [JsiiTypeProxy(nativeType: typeof(IIInterfaceWithInternal), fullyQualifiedName: "jsii-calc.IInterfaceWithInternal")] internal sealed class IInterfaceWithInternalProxy : DeputyBase, IIInterfaceWithInternal { private IInterfaceWithInternalProxy(ByRefValue reference): base(reference) { } - [JsiiMethod("visible", null, "[]")] + [JsiiMethod(name: "visible")] public void Visible() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithMethodsProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithMethodsProxy.cs index 1c4c8947e2..a9b11c94a3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithMethodsProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithMethodsProxy.cs @@ -2,20 +2,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IIInterfaceWithMethods), "jsii-calc.IInterfaceWithMethods")] + [JsiiTypeProxy(nativeType: typeof(IIInterfaceWithMethods), fullyQualifiedName: "jsii-calc.IInterfaceWithMethods")] internal sealed class IInterfaceWithMethodsProxy : DeputyBase, IIInterfaceWithMethods { private IInterfaceWithMethodsProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("value", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"string\"}")] public string Value { get => GetInstanceProperty(); } - [JsiiMethod("doThings", null, "[]")] + [JsiiMethod(name: "doThings")] public void DoThings() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithOptionalMethodArgumentsProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithOptionalMethodArgumentsProxy.cs index 81764c4911..96cb738037 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithOptionalMethodArgumentsProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithOptionalMethodArgumentsProxy.cs @@ -3,14 +3,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// awslabs/jsii#175 Interface proxies (and builders) do not respect optional arguments in methods. - [JsiiTypeProxy(typeof(IIInterfaceWithOptionalMethodArguments), "jsii-calc.IInterfaceWithOptionalMethodArguments")] + [JsiiTypeProxy(nativeType: typeof(IIInterfaceWithOptionalMethodArguments), fullyQualifiedName: "jsii-calc.IInterfaceWithOptionalMethodArguments")] internal sealed class IInterfaceWithOptionalMethodArgumentsProxy : DeputyBase, IIInterfaceWithOptionalMethodArguments { private IInterfaceWithOptionalMethodArgumentsProxy(ByRefValue reference): base(reference) { } - [JsiiMethod("hello", null, "[{\"name\":\"arg1\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"arg2\",\"type\":{\"primitive\":\"number\",\"optional\":true}}]")] + [JsiiMethod(name: "hello", parametersJson: "[{\"name\":\"arg1\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"arg2\",\"type\":{\"primitive\":\"number\"}}]")] public void Hello(string arg1, double? arg2) { InvokeInstanceVoidMethod(new object[]{arg1, arg2}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtensionProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtensionProxy.cs index 805ef19457..57b8909cd5 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtensionProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtensionProxy.cs @@ -2,27 +2,27 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IIInterfaceWithPropertiesExtension), "jsii-calc.IInterfaceWithPropertiesExtension")] + [JsiiTypeProxy(nativeType: typeof(IIInterfaceWithPropertiesExtension), fullyQualifiedName: "jsii-calc.IInterfaceWithPropertiesExtension")] internal sealed class IInterfaceWithPropertiesExtensionProxy : DeputyBase, IIInterfaceWithPropertiesExtension { private IInterfaceWithPropertiesExtensionProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("foo", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "foo", typeJson: "{\"primitive\":\"number\"}")] public double Foo { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("readOnlyString", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "readOnlyString", typeJson: "{\"primitive\":\"string\"}")] public string ReadOnlyString { get => GetInstanceProperty(); } - [JsiiProperty("readWriteString", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "readWriteString", typeJson: "{\"primitive\":\"string\"}")] public string ReadWriteString { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesProxy.cs index c2afae727e..cb917cdfd1 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesProxy.cs @@ -2,20 +2,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IIInterfaceWithProperties), "jsii-calc.IInterfaceWithProperties")] + [JsiiTypeProxy(nativeType: typeof(IIInterfaceWithProperties), fullyQualifiedName: "jsii-calc.IInterfaceWithProperties")] internal sealed class IInterfaceWithPropertiesProxy : DeputyBase, IIInterfaceWithProperties { private IInterfaceWithPropertiesProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("readOnlyString", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "readOnlyString", typeJson: "{\"primitive\":\"string\"}")] public string ReadOnlyString { get => GetInstanceProperty(); } - [JsiiProperty("readWriteString", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "readWriteString", typeJson: "{\"primitive\":\"string\"}")] public string ReadWriteString { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IJSII417DerivedProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IJSII417DerivedProxy.cs index 367f83af2a..26cd0677f0 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IJSII417DerivedProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IJSII417DerivedProxy.cs @@ -2,38 +2,38 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IIJSII417Derived), "jsii-calc.IJSII417Derived")] + [JsiiTypeProxy(nativeType: typeof(IIJSII417Derived), fullyQualifiedName: "jsii-calc.IJSII417Derived")] internal sealed class IJSII417DerivedProxy : DeputyBase, IIJSII417Derived { private IJSII417DerivedProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("property", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "property", typeJson: "{\"primitive\":\"string\"}")] public string Property { get => GetInstanceProperty(); } - [JsiiProperty("hasRoot", "{\"primitive\":\"boolean\"}")] + [JsiiProperty(name: "hasRoot", typeJson: "{\"primitive\":\"boolean\"}")] public bool HasRoot { get => GetInstanceProperty(); } - [JsiiMethod("bar", null, "[]")] + [JsiiMethod(name: "bar")] public void Bar() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("baz", null, "[]")] + [JsiiMethod(name: "baz")] public void Baz() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("foo", null, "[]")] + [JsiiMethod(name: "foo")] public void Foo() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IJSII417PublicBaseOfBaseProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IJSII417PublicBaseOfBaseProxy.cs index bff3c8bdab..3db200d531 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IJSII417PublicBaseOfBaseProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IJSII417PublicBaseOfBaseProxy.cs @@ -2,20 +2,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IIJSII417PublicBaseOfBase), "jsii-calc.IJSII417PublicBaseOfBase")] + [JsiiTypeProxy(nativeType: typeof(IIJSII417PublicBaseOfBase), fullyQualifiedName: "jsii-calc.IJSII417PublicBaseOfBase")] internal sealed class IJSII417PublicBaseOfBaseProxy : DeputyBase, IIJSII417PublicBaseOfBase { private IJSII417PublicBaseOfBaseProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("hasRoot", "{\"primitive\":\"boolean\"}")] + [JsiiProperty(name: "hasRoot", typeJson: "{\"primitive\":\"boolean\"}")] public bool HasRoot { get => GetInstanceProperty(); } - [JsiiMethod("foo", null, "[]")] + [JsiiMethod(name: "foo")] public void Foo() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ILoadBalancedFargateServiceProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ILoadBalancedFargateServiceProps.cs index 641ae575b2..08cd8aa2f6 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ILoadBalancedFargateServiceProps.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ILoadBalancedFargateServiceProps.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// jsii#298: show default values in sphinx documentation, and respect newlines. - [JsiiInterface(typeof(ILoadBalancedFargateServiceProps), "jsii-calc.LoadBalancedFargateServiceProps")] + [JsiiInterface(nativeType: typeof(ILoadBalancedFargateServiceProps), fullyQualifiedName: "jsii-calc.LoadBalancedFargateServiceProps")] public interface ILoadBalancedFargateServiceProps { /// The container port of the application load balancer attached to your Fargate service. @@ -11,7 +11,7 @@ public interface ILoadBalancedFargateServiceProps /// default: 80 /// Corresponds to container port mapping. /// - [JsiiProperty("containerPort", "{\"primitive\":\"number\",\"optional\":true}")] + [JsiiProperty(name: "containerPort", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] double? ContainerPort { get; @@ -22,7 +22,7 @@ public interface ILoadBalancedFargateServiceProps /// default: 256 /// This default is set in the underlying FargateTaskDefinition construct. /// - [JsiiProperty("cpu", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "cpu", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Cpu { get; @@ -46,7 +46,7 @@ string Cpu /// /// This default is set in the underlying FargateTaskDefinition construct. /// - [JsiiProperty("memoryMiB", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "memoryMiB", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string MemoryMiB { get; @@ -54,7 +54,7 @@ string MemoryMiB /// Determines whether the Application Load Balancer will be internet-facing. /// default: true - [JsiiProperty("publicLoadBalancer", "{\"primitive\":\"boolean\",\"optional\":true}")] + [JsiiProperty(name: "publicLoadBalancer", typeJson: "{\"primitive\":\"boolean\"}", isOptional: true)] bool? PublicLoadBalancer { get; @@ -62,7 +62,7 @@ string MemoryMiB /// Determines whether your Fargate Service will be assigned a public IP address. /// default: false - [JsiiProperty("publicTasks", "{\"primitive\":\"boolean\",\"optional\":true}")] + [JsiiProperty(name: "publicTasks", typeJson: "{\"primitive\":\"boolean\"}", isOptional: true)] bool? PublicTasks { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IMutableObjectLiteralProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IMutableObjectLiteralProxy.cs index 5e86790e8e..0ab5947f52 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IMutableObjectLiteralProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IMutableObjectLiteralProxy.cs @@ -2,14 +2,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IIMutableObjectLiteral), "jsii-calc.IMutableObjectLiteral")] + [JsiiTypeProxy(nativeType: typeof(IIMutableObjectLiteral), fullyQualifiedName: "jsii-calc.IMutableObjectLiteral")] internal sealed class IMutableObjectLiteralProxy : DeputyBase, IIMutableObjectLiteral { private IMutableObjectLiteralProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("value", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"string\"}")] public string Value { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/INonInternalInterfaceProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/INonInternalInterfaceProxy.cs index ac5a375478..20ce1f2f2c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/INonInternalInterfaceProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/INonInternalInterfaceProxy.cs @@ -2,28 +2,28 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IINonInternalInterface), "jsii-calc.INonInternalInterface")] + [JsiiTypeProxy(nativeType: typeof(IINonInternalInterface), fullyQualifiedName: "jsii-calc.INonInternalInterface")] internal sealed class INonInternalInterfaceProxy : DeputyBase, IINonInternalInterface { private INonInternalInterfaceProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("b", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "b", typeJson: "{\"primitive\":\"string\"}")] public string B { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("c", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "c", typeJson: "{\"primitive\":\"string\"}")] public string C { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("a", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "a", typeJson: "{\"primitive\":\"string\"}")] public string A { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/INullShouldBeTreatedAsUndefinedData.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/INullShouldBeTreatedAsUndefinedData.cs index 6ccc02d547..f76eaa23a5 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/INullShouldBeTreatedAsUndefinedData.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/INullShouldBeTreatedAsUndefinedData.cs @@ -2,16 +2,16 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(INullShouldBeTreatedAsUndefinedData), "jsii-calc.NullShouldBeTreatedAsUndefinedData")] + [JsiiInterface(nativeType: typeof(INullShouldBeTreatedAsUndefinedData), fullyQualifiedName: "jsii-calc.NullShouldBeTreatedAsUndefinedData")] public interface INullShouldBeTreatedAsUndefinedData { - [JsiiProperty("arrayWithThreeElementsAndUndefinedAsSecondArgument", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"any\"}}}")] + [JsiiProperty(name: "arrayWithThreeElementsAndUndefinedAsSecondArgument", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"any\"}}}")] object[] ArrayWithThreeElementsAndUndefinedAsSecondArgument { get; } - [JsiiProperty("thisShouldBeUndefined", "{\"primitive\":\"any\",\"optional\":true}")] + [JsiiProperty(name: "thisShouldBeUndefined", typeJson: "{\"primitive\":\"any\"}", isOptional: true)] object ThisShouldBeUndefined { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IOptionalStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IOptionalStruct.cs index 41f746568e..3acfa392b4 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IOptionalStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IOptionalStruct.cs @@ -2,10 +2,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IOptionalStruct), "jsii-calc.OptionalStruct")] + [JsiiInterface(nativeType: typeof(IOptionalStruct), fullyQualifiedName: "jsii-calc.OptionalStruct")] public interface IOptionalStruct { - [JsiiProperty("field", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "field", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Field { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPrivatelyImplementedProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPrivatelyImplementedProxy.cs index 7c904b0328..0694ec3c65 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPrivatelyImplementedProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPrivatelyImplementedProxy.cs @@ -2,14 +2,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IIPrivatelyImplemented), "jsii-calc.IPrivatelyImplemented")] + [JsiiTypeProxy(nativeType: typeof(IIPrivatelyImplemented), fullyQualifiedName: "jsii-calc.IPrivatelyImplemented")] internal sealed class IPrivatelyImplementedProxy : DeputyBase, IIPrivatelyImplemented { private IPrivatelyImplementedProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("success", "{\"primitive\":\"boolean\"}")] + [JsiiProperty(name: "success", typeJson: "{\"primitive\":\"boolean\"}")] public bool Success { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPublicInterface2Proxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPublicInterface2Proxy.cs index 50a68d9a3c..b6fa271006 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPublicInterface2Proxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPublicInterface2Proxy.cs @@ -2,14 +2,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IIPublicInterface2), "jsii-calc.IPublicInterface2")] + [JsiiTypeProxy(nativeType: typeof(IIPublicInterface2), fullyQualifiedName: "jsii-calc.IPublicInterface2")] internal sealed class IPublicInterface2Proxy : DeputyBase, IIPublicInterface2 { private IPublicInterface2Proxy(ByRefValue reference): base(reference) { } - [JsiiMethod("ciao", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "ciao", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public string Ciao() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPublicInterfaceProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPublicInterfaceProxy.cs index 90bdf4b6d7..0b720517a9 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPublicInterfaceProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IPublicInterfaceProxy.cs @@ -2,14 +2,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IIPublicInterface), "jsii-calc.IPublicInterface")] + [JsiiTypeProxy(nativeType: typeof(IIPublicInterface), fullyQualifiedName: "jsii-calc.IPublicInterface")] internal sealed class IPublicInterfaceProxy : DeputyBase, IIPublicInterface { private IPublicInterfaceProxy(ByRefValue reference): base(reference) { } - [JsiiMethod("bye", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "bye", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public string Bye() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IRandomNumberGeneratorProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IRandomNumberGeneratorProxy.cs index b5618dda28..c3d24e4fcb 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IRandomNumberGeneratorProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IRandomNumberGeneratorProxy.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Generates random numbers. - [JsiiTypeProxy(typeof(IIRandomNumberGenerator), "jsii-calc.IRandomNumberGenerator")] + [JsiiTypeProxy(nativeType: typeof(IIRandomNumberGenerator), fullyQualifiedName: "jsii-calc.IRandomNumberGenerator")] internal sealed class IRandomNumberGeneratorProxy : DeputyBase, IIRandomNumberGenerator { private IRandomNumberGeneratorProxy(ByRefValue reference): base(reference) @@ -12,7 +12,7 @@ private IRandomNumberGeneratorProxy(ByRefValue reference): base(reference) /// Returns another random number. /// A random number. - [JsiiMethod("next", "{\"primitive\":\"number\"}", "[]")] + [JsiiMethod(name: "next", returnsJson: "{\"type\":{\"primitive\":\"number\"}}")] public double Next() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnsNumberProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnsNumberProxy.cs index bc689a1bc8..7240bb0dce 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnsNumberProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnsNumberProxy.cs @@ -3,20 +3,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IIReturnsNumber), "jsii-calc.IReturnsNumber")] + [JsiiTypeProxy(nativeType: typeof(IIReturnsNumber), fullyQualifiedName: "jsii-calc.IReturnsNumber")] internal sealed class IReturnsNumberProxy : DeputyBase, IIReturnsNumber { private IReturnsNumberProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("numberProp", "{\"fqn\":\"@scope/jsii-calc-lib.Number\"}")] + [JsiiProperty(name: "numberProp", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.Number\"}")] public Number NumberProp { get => GetInstanceProperty(); } - [JsiiMethod("obtainNumber", "{\"fqn\":\"@scope/jsii-calc-lib.IDoublable\"}", "[]")] + [JsiiMethod(name: "obtainNumber", returnsJson: "{\"type\":{\"fqn\":\"@scope/jsii-calc-lib.IDoublable\"}}")] public IIDoublable ObtainNumber() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs index 93134fbf41..9ea572e627 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs @@ -2,16 +2,16 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiInterface(typeof(IUnionProperties), "jsii-calc.UnionProperties")] + [JsiiInterface(nativeType: typeof(IUnionProperties), fullyQualifiedName: "jsii-calc.UnionProperties")] public interface IUnionProperties { - [JsiiProperty("bar", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.AllTypes\"}]}}")] + [JsiiProperty(name: "bar", typeJson: "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.AllTypes\"}]}}")] object Bar { get; } - [JsiiProperty("foo", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"}]},\"optional\":true}")] + [JsiiProperty(name: "foo", typeJson: "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"}]}}", isOptional: true)] object Foo { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementInternalInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementInternalInterface.cs index 342e6c4f9a..91254bcc87 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementInternalInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementInternalInterface.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(ImplementInternalInterface), "jsii-calc.ImplementInternalInterface", "[]")] + [JsiiClass(nativeType: typeof(ImplementInternalInterface), fullyQualifiedName: "jsii-calc.ImplementInternalInterface")] public class ImplementInternalInterface : DeputyBase { public ImplementInternalInterface(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected ImplementInternalInterface(DeputyProps props): base(props) { } - [JsiiProperty("prop", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "prop", typeJson: "{\"primitive\":\"string\"}")] public virtual string Prop { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementsInterfaceWithInternal.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementsInterfaceWithInternal.cs index 1b783a8748..c8c9cf387c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementsInterfaceWithInternal.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementsInterfaceWithInternal.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(ImplementsInterfaceWithInternal), "jsii-calc.ImplementsInterfaceWithInternal", "[]")] + [JsiiClass(nativeType: typeof(ImplementsInterfaceWithInternal), fullyQualifiedName: "jsii-calc.ImplementsInterfaceWithInternal")] public class ImplementsInterfaceWithInternal : DeputyBase, IIInterfaceWithInternal { public ImplementsInterfaceWithInternal(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected ImplementsInterfaceWithInternal(DeputyProps props): base(props) { } - [JsiiMethod("visible", null, "[]")] + [JsiiMethod(name: "visible", isOverride: true)] public virtual void Visible() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementsInterfaceWithInternalSubclass.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementsInterfaceWithInternalSubclass.cs index 9a86613908..508ce6b50b 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementsInterfaceWithInternalSubclass.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementsInterfaceWithInternalSubclass.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(ImplementsInterfaceWithInternalSubclass), "jsii-calc.ImplementsInterfaceWithInternalSubclass", "[]")] + [JsiiClass(nativeType: typeof(ImplementsInterfaceWithInternalSubclass), fullyQualifiedName: "jsii-calc.ImplementsInterfaceWithInternalSubclass")] public class ImplementsInterfaceWithInternalSubclass : ImplementsInterfaceWithInternal { public ImplementsInterfaceWithInternalSubclass(): base(new DeputyProps(new object[]{})) diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementsPrivateInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementsPrivateInterface.cs index 892ffa7339..d840aae393 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementsPrivateInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplementsPrivateInterface.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(ImplementsPrivateInterface), "jsii-calc.ImplementsPrivateInterface", "[]")] + [JsiiClass(nativeType: typeof(ImplementsPrivateInterface), fullyQualifiedName: "jsii-calc.ImplementsPrivateInterface")] public class ImplementsPrivateInterface : DeputyBase { public ImplementsPrivateInterface(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected ImplementsPrivateInterface(DeputyProps props): base(props) { } - [JsiiProperty("private", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "private", typeJson: "{\"primitive\":\"string\"}")] public virtual string Private { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBase.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBase.cs index 4f51f2e482..856341bbc6 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBase.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBase.cs @@ -7,21 +7,21 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue] public class ImplictBaseOfBase : IImplictBaseOfBase { - [JsiiProperty("goo", "{\"primitive\":\"date\"}", true)] + [JsiiProperty(name: "goo", typeJson: "{\"primitive\":\"date\"}", isOverride: true)] public DateTime Goo { get; set; } - [JsiiProperty("bar", "{\"primitive\":\"string\"}", true)] + [JsiiProperty(name: "bar", typeJson: "{\"primitive\":\"string\"}", isOverride: true)] public string Bar { get; set; } - [JsiiProperty("foo", "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}", true)] + [JsiiProperty(name: "foo", typeJson: "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}", isOverride: true)] public Very Foo { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBaseProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBaseProxy.cs index 9105345508..b49daebada 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBaseProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBaseProxy.cs @@ -4,26 +4,26 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IImplictBaseOfBase), "jsii-calc.ImplictBaseOfBase")] + [JsiiTypeProxy(nativeType: typeof(IImplictBaseOfBase), fullyQualifiedName: "jsii-calc.ImplictBaseOfBase")] internal sealed class ImplictBaseOfBaseProxy : DeputyBase, IImplictBaseOfBase { private ImplictBaseOfBaseProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("goo", "{\"primitive\":\"date\"}")] + [JsiiProperty(name: "goo", typeJson: "{\"primitive\":\"date\"}")] public DateTime Goo { get => GetInstanceProperty(); } - [JsiiProperty("bar", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "bar", typeJson: "{\"primitive\":\"string\"}")] public string Bar { get => GetInstanceProperty(); } - [JsiiProperty("foo", "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}")] + [JsiiProperty(name: "foo", typeJson: "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}")] public Very Foo { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InbetweenClass.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InbetweenClass.cs index dfd8f93294..70a9195c5e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InbetweenClass.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InbetweenClass.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(InbetweenClass), "jsii-calc.InbetweenClass", "[]")] + [JsiiClass(nativeType: typeof(InbetweenClass), fullyQualifiedName: "jsii-calc.InbetweenClass")] public class InbetweenClass : PublicClass, IIPublicInterface2 { public InbetweenClass(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected InbetweenClass(DeputyProps props): base(props) { } - [JsiiMethod("ciao", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "ciao", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public virtual string Ciao() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/Foo.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/Foo.cs index f6f6278df2..87c3ca7810 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/Foo.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/Foo.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceIncludesClasses { - [JsiiClass(typeof(Foo), "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo", "[]")] + [JsiiClass(nativeType: typeof(Foo), fullyQualifiedName: "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo")] public class Foo : DeputyBase { public Foo(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected Foo(DeputyProps props): base(props) { } - [JsiiProperty("bar", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "bar", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] public virtual string Bar { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/Hello.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/Hello.cs index e8f2fa1d4b..61fdbf6664 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/Hello.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/Hello.cs @@ -5,7 +5,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceIncludesClas [JsiiByValue] public class Hello : Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceIncludesClasses.IHello { - [JsiiProperty("foo", "{\"primitive\":\"number\"}", true)] + [JsiiProperty(name: "foo", typeJson: "{\"primitive\":\"number\"}", isOverride: true)] public double Foo { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/HelloProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/HelloProxy.cs index 81acf28861..f9131d9c74 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/HelloProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/HelloProxy.cs @@ -2,14 +2,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceIncludesClasses { - [JsiiTypeProxy(typeof(IHello), "jsii-calc.InterfaceInNamespaceIncludesClasses.Hello")] + [JsiiTypeProxy(nativeType: typeof(IHello), fullyQualifiedName: "jsii-calc.InterfaceInNamespaceIncludesClasses.Hello")] internal sealed class HelloProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceIncludesClasses.IHello { private HelloProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("foo", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "foo", typeJson: "{\"primitive\":\"number\"}")] public double Foo { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/IHello.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/IHello.cs index 6f276bc124..447186b6c6 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/IHello.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceIncludesClasses/IHello.cs @@ -2,10 +2,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceIncludesClasses { - [JsiiInterface(typeof(IHello), "jsii-calc.InterfaceInNamespaceIncludesClasses.Hello")] + [JsiiInterface(nativeType: typeof(IHello), fullyQualifiedName: "jsii-calc.InterfaceInNamespaceIncludesClasses.Hello")] public interface IHello { - [JsiiProperty("foo", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "foo", typeJson: "{\"primitive\":\"number\"}")] double Foo { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceOnlyInterface/Hello.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceOnlyInterface/Hello.cs index 64d49857f6..4eaed584ea 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceOnlyInterface/Hello.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceOnlyInterface/Hello.cs @@ -5,7 +5,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceOnlyInterfac [JsiiByValue] public class Hello : Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceOnlyInterface.IHello { - [JsiiProperty("foo", "{\"primitive\":\"number\"}", true)] + [JsiiProperty(name: "foo", typeJson: "{\"primitive\":\"number\"}", isOverride: true)] public double Foo { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceOnlyInterface/HelloProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceOnlyInterface/HelloProxy.cs index cb9371b5dd..9fe272057f 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceOnlyInterface/HelloProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceOnlyInterface/HelloProxy.cs @@ -2,14 +2,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceOnlyInterface { - [JsiiTypeProxy(typeof(IHello), "jsii-calc.InterfaceInNamespaceOnlyInterface.Hello")] + [JsiiTypeProxy(nativeType: typeof(IHello), fullyQualifiedName: "jsii-calc.InterfaceInNamespaceOnlyInterface.Hello")] internal sealed class HelloProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceOnlyInterface.IHello { private HelloProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("foo", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "foo", typeJson: "{\"primitive\":\"number\"}")] public double Foo { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceOnlyInterface/IHello.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceOnlyInterface/IHello.cs index 3bed3a725f..8175a7a4eb 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceOnlyInterface/IHello.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/InterfaceInNamespaceOnlyInterface/IHello.cs @@ -2,10 +2,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceOnlyInterface { - [JsiiInterface(typeof(IHello), "jsii-calc.InterfaceInNamespaceOnlyInterface.Hello")] + [JsiiInterface(nativeType: typeof(IHello), fullyQualifiedName: "jsii-calc.InterfaceInNamespaceOnlyInterface.Hello")] public interface IHello { - [JsiiProperty("foo", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "foo", typeJson: "{\"primitive\":\"number\"}")] double Foo { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSII417Derived.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSII417Derived.cs index f17487efe6..0865aa4374 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSII417Derived.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSII417Derived.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(JSII417Derived), "jsii-calc.JSII417Derived", "[{\"name\":\"property\",\"type\":{\"primitive\":\"string\"}}]")] + [JsiiClass(nativeType: typeof(JSII417Derived), fullyQualifiedName: "jsii-calc.JSII417Derived", parametersJson: "[{\"name\":\"property\",\"type\":{\"primitive\":\"string\"}}]")] public class JSII417Derived : JSII417PublicBaseOfBase { public JSII417Derived(string property): base(new DeputyProps(new object[]{property})) @@ -17,19 +17,19 @@ protected JSII417Derived(DeputyProps props): base(props) { } - [JsiiProperty("property", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "property", typeJson: "{\"primitive\":\"string\"}")] protected virtual string Property { get => GetInstanceProperty(); } - [JsiiMethod("bar", null, "[]")] + [JsiiMethod(name: "bar")] public virtual void Bar() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("baz", null, "[]")] + [JsiiMethod(name: "baz")] public virtual void Baz() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSII417PublicBaseOfBase.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSII417PublicBaseOfBase.cs index 258b186702..be1f7d1249 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSII417PublicBaseOfBase.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSII417PublicBaseOfBase.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(JSII417PublicBaseOfBase), "jsii-calc.JSII417PublicBaseOfBase", "[]")] + [JsiiClass(nativeType: typeof(JSII417PublicBaseOfBase), fullyQualifiedName: "jsii-calc.JSII417PublicBaseOfBase")] public class JSII417PublicBaseOfBase : DeputyBase { public JSII417PublicBaseOfBase(): base(new DeputyProps(new object[]{})) @@ -17,19 +17,19 @@ protected JSII417PublicBaseOfBase(DeputyProps props): base(props) { } - [JsiiProperty("hasRoot", "{\"primitive\":\"boolean\"}")] + [JsiiProperty(name: "hasRoot", typeJson: "{\"primitive\":\"boolean\"}")] public virtual bool HasRoot { get => GetInstanceProperty(); } - [JsiiMethod("makeInstance", "{\"fqn\":\"jsii-calc.JSII417PublicBaseOfBase\"}", "[]")] + [JsiiMethod(name: "makeInstance", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.JSII417PublicBaseOfBase\"}}")] public static JSII417PublicBaseOfBase MakeInstance() { return InvokeStaticMethod(typeof(JSII417PublicBaseOfBase), new object[]{}); } - [JsiiMethod("foo", null, "[]")] + [JsiiMethod(name: "foo")] public virtual void Foo() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralForInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralForInterface.cs index 19fa50e867..b9275ab865 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralForInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralForInterface.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(JSObjectLiteralForInterface), "jsii-calc.JSObjectLiteralForInterface", "[]")] + [JsiiClass(nativeType: typeof(JSObjectLiteralForInterface), fullyQualifiedName: "jsii-calc.JSObjectLiteralForInterface")] public class JSObjectLiteralForInterface : DeputyBase { public JSObjectLiteralForInterface(): base(new DeputyProps(new object[]{})) @@ -18,13 +18,13 @@ protected JSObjectLiteralForInterface(DeputyProps props): base(props) { } - [JsiiMethod("giveMeFriendly", "{\"fqn\":\"@scope/jsii-calc-lib.IFriendly\"}", "[]")] + [JsiiMethod(name: "giveMeFriendly", returnsJson: "{\"type\":{\"fqn\":\"@scope/jsii-calc-lib.IFriendly\"}}")] public virtual IIFriendly GiveMeFriendly() { return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("giveMeFriendlyGenerator", "{\"fqn\":\"jsii-calc.IFriendlyRandomGenerator\"}", "[]")] + [JsiiMethod(name: "giveMeFriendlyGenerator", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.IFriendlyRandomGenerator\"}}")] public virtual IIFriendlyRandomGenerator GiveMeFriendlyGenerator() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNative.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNative.cs index 0177e98a97..6bfdd29446 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNative.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNative.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(JSObjectLiteralToNative), "jsii-calc.JSObjectLiteralToNative", "[]")] + [JsiiClass(nativeType: typeof(JSObjectLiteralToNative), fullyQualifiedName: "jsii-calc.JSObjectLiteralToNative")] public class JSObjectLiteralToNative : DeputyBase { public JSObjectLiteralToNative(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected JSObjectLiteralToNative(DeputyProps props): base(props) { } - [JsiiMethod("returnLiteral", "{\"fqn\":\"jsii-calc.JSObjectLiteralToNativeClass\"}", "[]")] + [JsiiMethod(name: "returnLiteral", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.JSObjectLiteralToNativeClass\"}}")] public virtual JSObjectLiteralToNativeClass ReturnLiteral() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNativeClass.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNativeClass.cs index c13d989370..dc03a25a3a 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNativeClass.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNativeClass.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(JSObjectLiteralToNativeClass), "jsii-calc.JSObjectLiteralToNativeClass", "[]")] + [JsiiClass(nativeType: typeof(JSObjectLiteralToNativeClass), fullyQualifiedName: "jsii-calc.JSObjectLiteralToNativeClass")] public class JSObjectLiteralToNativeClass : DeputyBase { public JSObjectLiteralToNativeClass(): base(new DeputyProps(new object[]{})) @@ -17,14 +17,14 @@ protected JSObjectLiteralToNativeClass(DeputyProps props): base(props) { } - [JsiiProperty("propA", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "propA", typeJson: "{\"primitive\":\"string\"}")] public virtual string PropA { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("propB", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "propB", typeJson: "{\"primitive\":\"number\"}")] public virtual double PropB { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JavaReservedWords.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JavaReservedWords.cs index 329b1be7e9..d497358b7f 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JavaReservedWords.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JavaReservedWords.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(JavaReservedWords), "jsii-calc.JavaReservedWords", "[]")] + [JsiiClass(nativeType: typeof(JavaReservedWords), fullyQualifiedName: "jsii-calc.JavaReservedWords")] public class JavaReservedWords : DeputyBase { public JavaReservedWords(): base(new DeputyProps(new object[]{})) @@ -17,320 +17,320 @@ protected JavaReservedWords(DeputyProps props): base(props) { } - [JsiiProperty("while", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "while", typeJson: "{\"primitive\":\"string\"}")] public virtual string While { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiMethod("abstract", null, "[]")] + [JsiiMethod(name: "abstract")] public virtual void Abstract() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("assert", null, "[]")] + [JsiiMethod(name: "assert")] public virtual void Assert() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("boolean", null, "[]")] + [JsiiMethod(name: "boolean")] public virtual void Boolean() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("break", null, "[]")] + [JsiiMethod(name: "break")] public virtual void Break() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("byte", null, "[]")] + [JsiiMethod(name: "byte")] public virtual void Byte() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("case", null, "[]")] + [JsiiMethod(name: "case")] public virtual void Case() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("catch", null, "[]")] + [JsiiMethod(name: "catch")] public virtual void Catch() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("char", null, "[]")] + [JsiiMethod(name: "char")] public virtual void Char() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("class", null, "[]")] + [JsiiMethod(name: "class")] public virtual void Class() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("const", null, "[]")] + [JsiiMethod(name: "const")] public virtual void Const() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("continue", null, "[]")] + [JsiiMethod(name: "continue")] public virtual void Continue() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("default", null, "[]")] + [JsiiMethod(name: "default")] public virtual void Default() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("do", null, "[]")] + [JsiiMethod(name: "do")] public virtual void Do() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("double", null, "[]")] + [JsiiMethod(name: "double")] public virtual void Double() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("else", null, "[]")] + [JsiiMethod(name: "else")] public virtual void Else() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("enum", null, "[]")] + [JsiiMethod(name: "enum")] public virtual void Enum() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("extends", null, "[]")] + [JsiiMethod(name: "extends")] public virtual void Extends() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("false", null, "[]")] + [JsiiMethod(name: "false")] public virtual void False() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("final", null, "[]")] + [JsiiMethod(name: "final")] public virtual void Final() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("finally", null, "[]")] + [JsiiMethod(name: "finally")] public virtual void Finally() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("float", null, "[]")] + [JsiiMethod(name: "float")] public virtual void Float() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("for", null, "[]")] + [JsiiMethod(name: "for")] public virtual void For() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("goto", null, "[]")] + [JsiiMethod(name: "goto")] public virtual void Goto() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("if", null, "[]")] + [JsiiMethod(name: "if")] public virtual void If() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("implements", null, "[]")] + [JsiiMethod(name: "implements")] public virtual void Implements() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("import", null, "[]")] + [JsiiMethod(name: "import")] public virtual void Import() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("instanceof", null, "[]")] + [JsiiMethod(name: "instanceof")] public virtual void Instanceof() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("int", null, "[]")] + [JsiiMethod(name: "int")] public virtual void Int() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("interface", null, "[]")] + [JsiiMethod(name: "interface")] public virtual void Interface() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("long", null, "[]")] + [JsiiMethod(name: "long")] public virtual void Long() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("native", null, "[]")] + [JsiiMethod(name: "native")] public virtual void Native() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("new", null, "[]")] + [JsiiMethod(name: "new")] public virtual void New() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("null", null, "[]")] + [JsiiMethod(name: "null")] public virtual void Null() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("package", null, "[]")] + [JsiiMethod(name: "package")] public virtual void Package() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("private", null, "[]")] + [JsiiMethod(name: "private")] public virtual void Private() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("protected", null, "[]")] + [JsiiMethod(name: "protected")] public virtual void Protected() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("public", null, "[]")] + [JsiiMethod(name: "public")] public virtual void Public() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("return", null, "[]")] + [JsiiMethod(name: "return")] public virtual void Return() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("short", null, "[]")] + [JsiiMethod(name: "short")] public virtual void Short() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("static", null, "[]")] + [JsiiMethod(name: "static")] public virtual void Static() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("strictfp", null, "[]")] + [JsiiMethod(name: "strictfp")] public virtual void Strictfp() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("super", null, "[]")] + [JsiiMethod(name: "super")] public virtual void Super() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("switch", null, "[]")] + [JsiiMethod(name: "switch")] public virtual void Switch() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("synchronized", null, "[]")] + [JsiiMethod(name: "synchronized")] public virtual void Synchronized() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("this", null, "[]")] + [JsiiMethod(name: "this")] public virtual void This() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("throw", null, "[]")] + [JsiiMethod(name: "throw")] public virtual void Throw() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("throws", null, "[]")] + [JsiiMethod(name: "throws")] public virtual void Throws() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("transient", null, "[]")] + [JsiiMethod(name: "transient")] public virtual void Transient() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("true", null, "[]")] + [JsiiMethod(name: "true")] public virtual void True() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("try", null, "[]")] + [JsiiMethod(name: "try")] public virtual void Try() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("void", null, "[]")] + [JsiiMethod(name: "void")] public virtual void Void() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("volatile", null, "[]")] + [JsiiMethod(name: "volatile")] public virtual void Volatile() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JsiiAgent_.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JsiiAgent_.cs index 012cc4fc4e..7246d211fa 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JsiiAgent_.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JsiiAgent_.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Host runtime version should be set via JSII_AGENT. - [JsiiClass(typeof(JsiiAgent_), "jsii-calc.JsiiAgent", "[]")] + [JsiiClass(nativeType: typeof(JsiiAgent_), fullyQualifiedName: "jsii-calc.JsiiAgent")] public class JsiiAgent_ : DeputyBase { public JsiiAgent_(): base(new DeputyProps(new object[]{})) @@ -19,7 +19,7 @@ protected JsiiAgent_(DeputyProps props): base(props) } /// Returns the value of the JSII_AGENT environment variable. - [JsiiProperty("jsiiAgent", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "jsiiAgent", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] public static string JsiiAgent { get => GetStaticProperty(typeof(JsiiAgent_)); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServiceProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServiceProps.cs index b1610b423a..f6dd438d10 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServiceProps.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServiceProps.cs @@ -11,7 +11,7 @@ public class LoadBalancedFargateServiceProps : ILoadBalancedFargateServiceProps /// default: 80 /// Corresponds to container port mapping. /// - [JsiiProperty("containerPort", "{\"primitive\":\"number\",\"optional\":true}", true)] + [JsiiProperty(name: "containerPort", typeJson: "{\"primitive\":\"number\"}", isOptional: true, isOverride: true)] public double? ContainerPort { get; @@ -23,7 +23,7 @@ public double? ContainerPort /// default: 256 /// This default is set in the underlying FargateTaskDefinition construct. /// - [JsiiProperty("cpu", "{\"primitive\":\"string\",\"optional\":true}", true)] + [JsiiProperty(name: "cpu", typeJson: "{\"primitive\":\"string\"}", isOptional: true, isOverride: true)] public string Cpu { get; @@ -48,7 +48,7 @@ public string Cpu /// /// This default is set in the underlying FargateTaskDefinition construct. /// - [JsiiProperty("memoryMiB", "{\"primitive\":\"string\",\"optional\":true}", true)] + [JsiiProperty(name: "memoryMiB", typeJson: "{\"primitive\":\"string\"}", isOptional: true, isOverride: true)] public string MemoryMiB { get; @@ -57,7 +57,7 @@ public string MemoryMiB /// Determines whether the Application Load Balancer will be internet-facing. /// default: true - [JsiiProperty("publicLoadBalancer", "{\"primitive\":\"boolean\",\"optional\":true}", true)] + [JsiiProperty(name: "publicLoadBalancer", typeJson: "{\"primitive\":\"boolean\"}", isOptional: true, isOverride: true)] public bool? PublicLoadBalancer { get; @@ -66,7 +66,7 @@ public bool? PublicLoadBalancer /// Determines whether your Fargate Service will be assigned a public IP address. /// default: false - [JsiiProperty("publicTasks", "{\"primitive\":\"boolean\",\"optional\":true}", true)] + [JsiiProperty(name: "publicTasks", typeJson: "{\"primitive\":\"boolean\"}", isOptional: true, isOverride: true)] public bool? PublicTasks { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServicePropsProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServicePropsProxy.cs index 42f6d1eb47..ab2a528b2e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServicePropsProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServicePropsProxy.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// jsii#298: show default values in sphinx documentation, and respect newlines. - [JsiiTypeProxy(typeof(ILoadBalancedFargateServiceProps), "jsii-calc.LoadBalancedFargateServiceProps")] + [JsiiTypeProxy(nativeType: typeof(ILoadBalancedFargateServiceProps), fullyQualifiedName: "jsii-calc.LoadBalancedFargateServiceProps")] internal sealed class LoadBalancedFargateServicePropsProxy : DeputyBase, ILoadBalancedFargateServiceProps { private LoadBalancedFargateServicePropsProxy(ByRefValue reference): base(reference) @@ -15,7 +15,7 @@ private LoadBalancedFargateServicePropsProxy(ByRefValue reference): base(referen /// default: 80 /// Corresponds to container port mapping. /// - [JsiiProperty("containerPort", "{\"primitive\":\"number\",\"optional\":true}")] + [JsiiProperty(name: "containerPort", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] public double? ContainerPort { get => GetInstanceProperty(); @@ -26,7 +26,7 @@ public double? ContainerPort /// default: 256 /// This default is set in the underlying FargateTaskDefinition construct. /// - [JsiiProperty("cpu", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "cpu", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] public string Cpu { get => GetInstanceProperty(); @@ -50,7 +50,7 @@ public string Cpu /// /// This default is set in the underlying FargateTaskDefinition construct. /// - [JsiiProperty("memoryMiB", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "memoryMiB", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] public string MemoryMiB { get => GetInstanceProperty(); @@ -58,7 +58,7 @@ public string MemoryMiB /// Determines whether the Application Load Balancer will be internet-facing. /// default: true - [JsiiProperty("publicLoadBalancer", "{\"primitive\":\"boolean\",\"optional\":true}")] + [JsiiProperty(name: "publicLoadBalancer", typeJson: "{\"primitive\":\"boolean\"}", isOptional: true)] public bool? PublicLoadBalancer { get => GetInstanceProperty(); @@ -66,7 +66,7 @@ public bool? PublicLoadBalancer /// Determines whether your Fargate Service will be assigned a public IP address. /// default: false - [JsiiProperty("publicTasks", "{\"primitive\":\"boolean\",\"optional\":true}")] + [JsiiProperty(name: "publicTasks", typeJson: "{\"primitive\":\"boolean\"}", isOptional: true)] public bool? PublicTasks { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Multiply.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Multiply.cs index 316dfe4586..1d8db3676c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Multiply.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Multiply.cs @@ -4,7 +4,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// The "*" binary operation. - [JsiiClass(typeof(Multiply), "jsii-calc.Multiply", "[{\"name\":\"lhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"rhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] + [JsiiClass(nativeType: typeof(Multiply), fullyQualifiedName: "jsii-calc.Multiply", parametersJson: "[{\"name\":\"lhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"rhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] public class Multiply : BinaryOperation, IIFriendlier, IIRandomNumberGenerator { public Multiply(Value_ lhs, Value_ rhs): base(new DeputyProps(new object[]{lhs, rhs})) @@ -20,35 +20,35 @@ protected Multiply(DeputyProps props): base(props) } /// The value. - [JsiiProperty("value", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"number\"}")] public override double Value { get => GetInstanceProperty(); } /// Say farewell. - [JsiiMethod("farewell", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "farewell", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public virtual string Farewell() { return InvokeInstanceMethod(new object[]{}); } /// Say goodbye. - [JsiiMethod("goodbye", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "goodbye", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public virtual string Goodbye() { return InvokeInstanceMethod(new object[]{}); } /// Returns another random number. - [JsiiMethod("next", "{\"primitive\":\"number\"}", "[]")] + [JsiiMethod(name: "next", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", isOverride: true)] public virtual double Next() { return InvokeInstanceMethod(new object[]{}); } /// String representation of the value. - [JsiiMethod("toString", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "toString", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public override string ToString() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Negate.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Negate.cs index 97fc7c0cb9..0b268e8802 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Negate.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Negate.cs @@ -4,7 +4,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// The negation operation ("-value"). - [JsiiClass(typeof(Negate), "jsii-calc.Negate", "[{\"name\":\"operand\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] + [JsiiClass(nativeType: typeof(Negate), fullyQualifiedName: "jsii-calc.Negate", parametersJson: "[{\"name\":\"operand\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] public class Negate : UnaryOperation, IIFriendlier { public Negate(Value_ operand): base(new DeputyProps(new object[]{operand})) @@ -20,35 +20,35 @@ protected Negate(DeputyProps props): base(props) } /// The value. - [JsiiProperty("value", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"number\"}")] public override double Value { get => GetInstanceProperty(); } /// Say farewell. - [JsiiMethod("farewell", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "farewell", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public virtual string Farewell() { return InvokeInstanceMethod(new object[]{}); } /// Say goodbye. - [JsiiMethod("goodbye", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "goodbye", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public virtual string Goodbye() { return InvokeInstanceMethod(new object[]{}); } /// Say hello! - [JsiiMethod("hello", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "hello", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public virtual string Hello() { return InvokeInstanceMethod(new object[]{}); } /// String representation of the value. - [JsiiMethod("toString", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "toString", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public override string ToString() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NodeStandardLibrary.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NodeStandardLibrary.cs index bcbc57d591..feef1a8fc7 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NodeStandardLibrary.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NodeStandardLibrary.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Test fixture to verify that jsii modules can use the node standard library. - [JsiiClass(typeof(NodeStandardLibrary), "jsii-calc.NodeStandardLibrary", "[]")] + [JsiiClass(nativeType: typeof(NodeStandardLibrary), fullyQualifiedName: "jsii-calc.NodeStandardLibrary")] public class NodeStandardLibrary : DeputyBase { public NodeStandardLibrary(): base(new DeputyProps(new object[]{})) @@ -19,7 +19,7 @@ protected NodeStandardLibrary(DeputyProps props): base(props) } /// Returns the current os.platform() from the "os" node module. - [JsiiProperty("osPlatform", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "osPlatform", typeJson: "{\"primitive\":\"string\"}")] public virtual string OsPlatform { get => GetInstanceProperty(); @@ -27,7 +27,7 @@ public virtual string OsPlatform /// Uses node.js "crypto" module to calculate sha256 of a string. /// "6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50" - [JsiiMethod("cryptoSha256", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "cryptoSha256", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public virtual string CryptoSha256() { return InvokeInstanceMethod(new object[]{}); @@ -35,7 +35,7 @@ public virtual string CryptoSha256() /// Reads a local resource file (resource.txt) asynchronously. /// "Hello, resource!" - [JsiiMethod("fsReadFile", "{\"primitive\":\"string\",\"promise\":true}", "[]")] + [JsiiMethod(name: "fsReadFile", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isAsync: true)] public virtual string FsReadFile() { return InvokeInstanceMethod(new object[]{}); @@ -43,7 +43,7 @@ public virtual string FsReadFile() /// Sync version of fsReadFile. /// "Hello, resource! SYNC!" - [JsiiMethod("fsReadFileSync", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "fsReadFileSync", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public virtual string FsReadFileSync() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NullShouldBeTreatedAsUndefined.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NullShouldBeTreatedAsUndefined.cs index 1621275f36..b563485362 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NullShouldBeTreatedAsUndefined.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NullShouldBeTreatedAsUndefined.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// jsii#282, aws-cdk#157: null should be treated as "undefined". - [JsiiClass(typeof(NullShouldBeTreatedAsUndefined), "jsii-calc.NullShouldBeTreatedAsUndefined", "[{\"name\":\"_param1\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"optional\",\"type\":{\"primitive\":\"any\",\"optional\":true}}]")] + [JsiiClass(nativeType: typeof(NullShouldBeTreatedAsUndefined), fullyQualifiedName: "jsii-calc.NullShouldBeTreatedAsUndefined", parametersJson: "[{\"name\":\"_param1\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"optional\",\"type\":{\"primitive\":\"any\"}}]")] public class NullShouldBeTreatedAsUndefined : DeputyBase { public NullShouldBeTreatedAsUndefined(string _param1, object optional): base(new DeputyProps(new object[]{_param1, optional})) @@ -18,26 +18,26 @@ protected NullShouldBeTreatedAsUndefined(DeputyProps props): base(props) { } - [JsiiProperty("changeMeToUndefined", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "changeMeToUndefined", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] public virtual string ChangeMeToUndefined { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiMethod("giveMeUndefined", null, "[{\"name\":\"value\",\"type\":{\"primitive\":\"any\",\"optional\":true}}]")] + [JsiiMethod(name: "giveMeUndefined", parametersJson: "[{\"name\":\"value\",\"type\":{\"primitive\":\"any\"}}]")] public virtual void GiveMeUndefined(object value) { InvokeInstanceVoidMethod(new object[]{value}); } - [JsiiMethod("giveMeUndefinedInsideAnObject", null, "[{\"name\":\"input\",\"type\":{\"fqn\":\"jsii-calc.NullShouldBeTreatedAsUndefinedData\"}}]")] + [JsiiMethod(name: "giveMeUndefinedInsideAnObject", parametersJson: "[{\"name\":\"input\",\"type\":{\"fqn\":\"jsii-calc.NullShouldBeTreatedAsUndefinedData\"}}]")] public virtual void GiveMeUndefinedInsideAnObject(INullShouldBeTreatedAsUndefinedData input) { InvokeInstanceVoidMethod(new object[]{input}); } - [JsiiMethod("verifyPropertyIsUndefined", null, "[]")] + [JsiiMethod(name: "verifyPropertyIsUndefined")] public virtual void VerifyPropertyIsUndefined() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NullShouldBeTreatedAsUndefinedData.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NullShouldBeTreatedAsUndefinedData.cs index 92042e3ca8..da994906c1 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NullShouldBeTreatedAsUndefinedData.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NullShouldBeTreatedAsUndefinedData.cs @@ -5,14 +5,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue] public class NullShouldBeTreatedAsUndefinedData : INullShouldBeTreatedAsUndefinedData { - [JsiiProperty("arrayWithThreeElementsAndUndefinedAsSecondArgument", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"any\"}}}", true)] + [JsiiProperty(name: "arrayWithThreeElementsAndUndefinedAsSecondArgument", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"any\"}}}", isOverride: true)] public object[] ArrayWithThreeElementsAndUndefinedAsSecondArgument { get; set; } - [JsiiProperty("thisShouldBeUndefined", "{\"primitive\":\"any\",\"optional\":true}", true)] + [JsiiProperty(name: "thisShouldBeUndefined", typeJson: "{\"primitive\":\"any\"}", isOptional: true, isOverride: true)] public object ThisShouldBeUndefined { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NullShouldBeTreatedAsUndefinedDataProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NullShouldBeTreatedAsUndefinedDataProxy.cs index 613f76f509..48c3fcc410 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NullShouldBeTreatedAsUndefinedDataProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NullShouldBeTreatedAsUndefinedDataProxy.cs @@ -2,20 +2,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(INullShouldBeTreatedAsUndefinedData), "jsii-calc.NullShouldBeTreatedAsUndefinedData")] + [JsiiTypeProxy(nativeType: typeof(INullShouldBeTreatedAsUndefinedData), fullyQualifiedName: "jsii-calc.NullShouldBeTreatedAsUndefinedData")] internal sealed class NullShouldBeTreatedAsUndefinedDataProxy : DeputyBase, INullShouldBeTreatedAsUndefinedData { private NullShouldBeTreatedAsUndefinedDataProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("arrayWithThreeElementsAndUndefinedAsSecondArgument", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"any\"}}}")] + [JsiiProperty(name: "arrayWithThreeElementsAndUndefinedAsSecondArgument", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"any\"}}}")] public object[] ArrayWithThreeElementsAndUndefinedAsSecondArgument { get => GetInstanceProperty(); } - [JsiiProperty("thisShouldBeUndefined", "{\"primitive\":\"any\",\"optional\":true}")] + [JsiiProperty(name: "thisShouldBeUndefined", typeJson: "{\"primitive\":\"any\"}", isOptional: true)] public object ThisShouldBeUndefined { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NumberGenerator.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NumberGenerator.cs index f009d6f2e6..29b6d21f8d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NumberGenerator.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NumberGenerator.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// This allows us to test that a reference can be stored for objects that implement interfaces. - [JsiiClass(typeof(NumberGenerator), "jsii-calc.NumberGenerator", "[{\"name\":\"generator\",\"type\":{\"fqn\":\"jsii-calc.IRandomNumberGenerator\"}}]")] + [JsiiClass(nativeType: typeof(NumberGenerator), fullyQualifiedName: "jsii-calc.NumberGenerator", parametersJson: "[{\"name\":\"generator\",\"type\":{\"fqn\":\"jsii-calc.IRandomNumberGenerator\"}}]")] public class NumberGenerator : DeputyBase { public NumberGenerator(IIRandomNumberGenerator generator): base(new DeputyProps(new object[]{generator})) @@ -18,20 +18,20 @@ protected NumberGenerator(DeputyProps props): base(props) { } - [JsiiProperty("generator", "{\"fqn\":\"jsii-calc.IRandomNumberGenerator\"}")] + [JsiiProperty(name: "generator", typeJson: "{\"fqn\":\"jsii-calc.IRandomNumberGenerator\"}")] public virtual IIRandomNumberGenerator Generator { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiMethod("isSameGenerator", "{\"primitive\":\"boolean\"}", "[{\"name\":\"gen\",\"type\":{\"fqn\":\"jsii-calc.IRandomNumberGenerator\"}}]")] + [JsiiMethod(name: "isSameGenerator", returnsJson: "{\"type\":{\"primitive\":\"boolean\"}}", parametersJson: "[{\"name\":\"gen\",\"type\":{\"fqn\":\"jsii-calc.IRandomNumberGenerator\"}}]")] public virtual bool IsSameGenerator(IIRandomNumberGenerator gen) { return InvokeInstanceMethod(new object[]{gen}); } - [JsiiMethod("nextTimes100", "{\"primitive\":\"number\"}", "[]")] + [JsiiMethod(name: "nextTimes100", returnsJson: "{\"type\":{\"primitive\":\"number\"}}")] public virtual double NextTimes100() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ObjectRefsInCollections.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ObjectRefsInCollections.cs index 498bcc34b3..eb6116d1f7 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ObjectRefsInCollections.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ObjectRefsInCollections.cs @@ -5,7 +5,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Verify that object references can be passed inside collections. - [JsiiClass(typeof(ObjectRefsInCollections), "jsii-calc.ObjectRefsInCollections", "[]")] + [JsiiClass(nativeType: typeof(ObjectRefsInCollections), fullyQualifiedName: "jsii-calc.ObjectRefsInCollections")] public class ObjectRefsInCollections : DeputyBase { public ObjectRefsInCollections(): base(new DeputyProps(new object[]{})) @@ -21,14 +21,14 @@ protected ObjectRefsInCollections(DeputyProps props): base(props) } /// Returns the sum of all values. - [JsiiMethod("sumFromArray", "{\"primitive\":\"number\"}", "[{\"name\":\"values\",\"type\":{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}}]")] + [JsiiMethod(name: "sumFromArray", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", parametersJson: "[{\"name\":\"values\",\"type\":{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}}]")] public virtual double SumFromArray(Value_[] values) { return InvokeInstanceMethod(new object[]{values}); } /// Returns the sum of all values in a map. - [JsiiMethod("sumFromMap", "{\"primitive\":\"number\"}", "[{\"name\":\"values\",\"type\":{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}}]")] + [JsiiMethod(name: "sumFromMap", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", parametersJson: "[{\"name\":\"values\",\"type\":{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}}]")] public virtual double SumFromMap(IDictionary values) { return InvokeInstanceMethod(new object[]{values}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Old.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Old.cs index 564a86b016..3391b74a7f 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Old.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Old.cs @@ -4,7 +4,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Old class. /// deprecated: Use the new class - [JsiiClass(typeof(Old), "jsii-calc.Old", "[]")] + [JsiiClass(nativeType: typeof(Old), fullyQualifiedName: "jsii-calc.Old")] public class Old : DeputyBase { public Old(): base(new DeputyProps(new object[]{})) @@ -20,7 +20,7 @@ protected Old(DeputyProps props): base(props) } /// Doo wop that thing. - [JsiiMethod("doAThing", null, "[]")] + [JsiiMethod(name: "doAThing")] public virtual void DoAThing() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalConstructorArgument.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalConstructorArgument.cs index 8ff423ebd2..0149af9852 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalConstructorArgument.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalConstructorArgument.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(OptionalConstructorArgument), "jsii-calc.OptionalConstructorArgument", "[{\"name\":\"arg1\",\"type\":{\"primitive\":\"number\"}},{\"name\":\"arg2\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"arg3\",\"type\":{\"primitive\":\"date\",\"optional\":true}}]")] + [JsiiClass(nativeType: typeof(OptionalConstructorArgument), fullyQualifiedName: "jsii-calc.OptionalConstructorArgument", parametersJson: "[{\"name\":\"arg1\",\"type\":{\"primitive\":\"number\"}},{\"name\":\"arg2\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"arg3\",\"type\":{\"primitive\":\"date\"}}]")] public class OptionalConstructorArgument : DeputyBase { public OptionalConstructorArgument(double arg1, string arg2, DateTime? arg3): base(new DeputyProps(new object[]{arg1, arg2, arg3})) @@ -18,19 +18,19 @@ protected OptionalConstructorArgument(DeputyProps props): base(props) { } - [JsiiProperty("arg1", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "arg1", typeJson: "{\"primitive\":\"number\"}")] public virtual double Arg1 { get => GetInstanceProperty(); } - [JsiiProperty("arg2", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "arg2", typeJson: "{\"primitive\":\"string\"}")] public virtual string Arg2 { get => GetInstanceProperty(); } - [JsiiProperty("arg3", "{\"primitive\":\"date\",\"optional\":true}")] + [JsiiProperty(name: "arg3", typeJson: "{\"primitive\":\"date\"}", isOptional: true)] public virtual DateTime? Arg3 { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalStruct.cs index 19cddb8725..7594b4ac9d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalStruct.cs @@ -5,7 +5,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue] public class OptionalStruct : IOptionalStruct { - [JsiiProperty("field", "{\"primitive\":\"string\",\"optional\":true}", true)] + [JsiiProperty(name: "field", typeJson: "{\"primitive\":\"string\"}", isOptional: true, isOverride: true)] public string Field { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalStructConsumer.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalStructConsumer.cs index 695843be35..13697c4d04 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalStructConsumer.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalStructConsumer.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(OptionalStructConsumer), "jsii-calc.OptionalStructConsumer", "[{\"name\":\"optionalStruct\",\"type\":{\"fqn\":\"jsii-calc.OptionalStruct\",\"optional\":true}}]")] + [JsiiClass(nativeType: typeof(OptionalStructConsumer), fullyQualifiedName: "jsii-calc.OptionalStructConsumer", parametersJson: "[{\"name\":\"optionalStruct\",\"type\":{\"fqn\":\"jsii-calc.OptionalStruct\"}}]")] public class OptionalStructConsumer : DeputyBase { public OptionalStructConsumer(IOptionalStruct optionalStruct): base(new DeputyProps(new object[]{optionalStruct})) @@ -17,13 +17,13 @@ protected OptionalStructConsumer(DeputyProps props): base(props) { } - [JsiiProperty("parameterWasUndefined", "{\"primitive\":\"boolean\"}")] + [JsiiProperty(name: "parameterWasUndefined", typeJson: "{\"primitive\":\"boolean\"}")] public virtual bool ParameterWasUndefined { get => GetInstanceProperty(); } - [JsiiProperty("fieldValue", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "fieldValue", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] public virtual string FieldValue { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalStructProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalStructProxy.cs index 3139fcae6f..3bbff1670b 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalStructProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OptionalStructProxy.cs @@ -2,14 +2,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IOptionalStruct), "jsii-calc.OptionalStruct")] + [JsiiTypeProxy(nativeType: typeof(IOptionalStruct), fullyQualifiedName: "jsii-calc.OptionalStruct")] internal sealed class OptionalStructProxy : DeputyBase, IOptionalStruct { private OptionalStructProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("field", "{\"primitive\":\"string\",\"optional\":true}")] + [JsiiProperty(name: "field", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] public string Field { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OverrideReturnsObject.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OverrideReturnsObject.cs index ca6d3127ad..07be3c5bc2 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OverrideReturnsObject.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OverrideReturnsObject.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(OverrideReturnsObject), "jsii-calc.OverrideReturnsObject", "[]")] + [JsiiClass(nativeType: typeof(OverrideReturnsObject), fullyQualifiedName: "jsii-calc.OverrideReturnsObject")] public class OverrideReturnsObject : DeputyBase { public OverrideReturnsObject(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected OverrideReturnsObject(DeputyProps props): base(props) { } - [JsiiMethod("test", "{\"primitive\":\"number\"}", "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.IReturnsNumber\"}}]")] + [JsiiMethod(name: "test", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", parametersJson: "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.IReturnsNumber\"}}]")] public virtual double Test(IIReturnsNumber obj) { return InvokeInstanceMethod(new object[]{obj}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PartiallyInitializedThisConsumer.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PartiallyInitializedThisConsumer.cs index f578f5321f..48de2c9c9c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PartiallyInitializedThisConsumer.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PartiallyInitializedThisConsumer.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(PartiallyInitializedThisConsumer), "jsii-calc.PartiallyInitializedThisConsumer", "[]")] + [JsiiClass(nativeType: typeof(PartiallyInitializedThisConsumer), fullyQualifiedName: "jsii-calc.PartiallyInitializedThisConsumer")] public abstract class PartiallyInitializedThisConsumer : DeputyBase { protected PartiallyInitializedThisConsumer(): base(new DeputyProps(new object[]{})) @@ -18,7 +18,7 @@ protected PartiallyInitializedThisConsumer(DeputyProps props): base(props) { } - [JsiiMethod("consumePartiallyInitializedThis", "{\"primitive\":\"string\"}", "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.ConstructorPassesThisOut\"}},{\"name\":\"dt\",\"type\":{\"primitive\":\"date\"}},{\"name\":\"ev\",\"type\":{\"fqn\":\"jsii-calc.AllTypesEnum\"}}]")] + [JsiiMethod(name: "consumePartiallyInitializedThis", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", parametersJson: "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.ConstructorPassesThisOut\"}},{\"name\":\"dt\",\"type\":{\"primitive\":\"date\"}},{\"name\":\"ev\",\"type\":{\"fqn\":\"jsii-calc.AllTypesEnum\"}}]")] public abstract string ConsumePartiallyInitializedThis(ConstructorPassesThisOut obj, DateTime dt, AllTypesEnum ev); } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PartiallyInitializedThisConsumerProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PartiallyInitializedThisConsumerProxy.cs index 2ebb268de0..30df734324 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PartiallyInitializedThisConsumerProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PartiallyInitializedThisConsumerProxy.cs @@ -3,14 +3,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(PartiallyInitializedThisConsumer), "jsii-calc.PartiallyInitializedThisConsumer")] + [JsiiTypeProxy(nativeType: typeof(PartiallyInitializedThisConsumer), fullyQualifiedName: "jsii-calc.PartiallyInitializedThisConsumer")] internal sealed class PartiallyInitializedThisConsumerProxy : PartiallyInitializedThisConsumer { private PartiallyInitializedThisConsumerProxy(ByRefValue reference): base(reference) { } - [JsiiMethod("consumePartiallyInitializedThis", "{\"primitive\":\"string\"}", "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.ConstructorPassesThisOut\"}},{\"name\":\"dt\",\"type\":{\"primitive\":\"date\"}},{\"name\":\"ev\",\"type\":{\"fqn\":\"jsii-calc.AllTypesEnum\"}}]")] + [JsiiMethod(name: "consumePartiallyInitializedThis", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", parametersJson: "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.ConstructorPassesThisOut\"}},{\"name\":\"dt\",\"type\":{\"primitive\":\"date\"}},{\"name\":\"ev\",\"type\":{\"fqn\":\"jsii-calc.AllTypesEnum\"}}]")] public override string ConsumePartiallyInitializedThis(ConstructorPassesThisOut obj, DateTime dt, AllTypesEnum ev) { return InvokeInstanceMethod(new object[]{obj, dt, ev}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Polymorphism.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Polymorphism.cs index 565b785432..8901959b6c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Polymorphism.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Polymorphism.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(Polymorphism), "jsii-calc.Polymorphism", "[]")] + [JsiiClass(nativeType: typeof(Polymorphism), fullyQualifiedName: "jsii-calc.Polymorphism")] public class Polymorphism : DeputyBase { public Polymorphism(): base(new DeputyProps(new object[]{})) @@ -18,7 +18,7 @@ protected Polymorphism(DeputyProps props): base(props) { } - [JsiiMethod("sayHello", "{\"primitive\":\"string\"}", "[{\"name\":\"friendly\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.IFriendly\"}}]")] + [JsiiMethod(name: "sayHello", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", parametersJson: "[{\"name\":\"friendly\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.IFriendly\"}}]")] public virtual string SayHello(IIFriendly friendly) { return InvokeInstanceMethod(new object[]{friendly}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Power.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Power.cs index da07015f96..70182dc48b 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Power.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Power.cs @@ -5,7 +5,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// The power operation. - [JsiiClass(typeof(Power), "jsii-calc.Power", "[{\"name\":\"base\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"pow\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] + [JsiiClass(nativeType: typeof(Power), fullyQualifiedName: "jsii-calc.Power", parametersJson: "[{\"name\":\"base\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"pow\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] public class Power : CompositeOperation_ { public Power(Value_ @base, Value_ pow): base(new DeputyProps(new object[]{@base, pow})) @@ -21,21 +21,21 @@ protected Power(DeputyProps props): base(props) } /// The base of the power. - [JsiiProperty("base", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + [JsiiProperty(name: "base", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] public virtual Value_ Base { get => GetInstanceProperty(); } /// The expression that this operation consists of. Must be implemented by derived classes. - [JsiiProperty("expression", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + [JsiiProperty(name: "expression", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] public override Value_ Expression { get => GetInstanceProperty(); } /// The number of times to multiply. - [JsiiProperty("pow", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + [JsiiProperty(name: "pow", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] public virtual Value_ Pow { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PublicClass.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PublicClass.cs index d91fa137bf..a123ffff2c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PublicClass.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PublicClass.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(PublicClass), "jsii-calc.PublicClass", "[]")] + [JsiiClass(nativeType: typeof(PublicClass), fullyQualifiedName: "jsii-calc.PublicClass")] public class PublicClass : DeputyBase { public PublicClass(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected PublicClass(DeputyProps props): base(props) { } - [JsiiMethod("hello", null, "[]")] + [JsiiMethod(name: "hello")] public virtual void Hello() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PythonReservedWords.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PythonReservedWords.cs index d1b8b845d6..503118950c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PythonReservedWords.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/PythonReservedWords.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(PythonReservedWords), "jsii-calc.PythonReservedWords", "[]")] + [JsiiClass(nativeType: typeof(PythonReservedWords), fullyQualifiedName: "jsii-calc.PythonReservedWords")] public class PythonReservedWords : DeputyBase { public PythonReservedWords(): base(new DeputyProps(new object[]{})) @@ -17,193 +17,193 @@ protected PythonReservedWords(DeputyProps props): base(props) { } - [JsiiMethod("and", null, "[]")] + [JsiiMethod(name: "and")] public virtual void And() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("as", null, "[]")] + [JsiiMethod(name: "as")] public virtual void As() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("assert", null, "[]")] + [JsiiMethod(name: "assert")] public virtual void Assert() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("async", null, "[]")] + [JsiiMethod(name: "async")] public virtual void Async() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("await", null, "[]")] + [JsiiMethod(name: "await")] public virtual void Await() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("break", null, "[]")] + [JsiiMethod(name: "break")] public virtual void Break() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("class", null, "[]")] + [JsiiMethod(name: "class")] public virtual void Class() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("continue", null, "[]")] + [JsiiMethod(name: "continue")] public virtual void Continue() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("def", null, "[]")] + [JsiiMethod(name: "def")] public virtual void Def() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("del", null, "[]")] + [JsiiMethod(name: "del")] public virtual void Del() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("elif", null, "[]")] + [JsiiMethod(name: "elif")] public virtual void Elif() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("else", null, "[]")] + [JsiiMethod(name: "else")] public virtual void Else() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("except", null, "[]")] + [JsiiMethod(name: "except")] public virtual void Except() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("finally", null, "[]")] + [JsiiMethod(name: "finally")] public virtual void Finally() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("for", null, "[]")] + [JsiiMethod(name: "for")] public virtual void For() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("from", null, "[]")] + [JsiiMethod(name: "from")] public virtual void From() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("global", null, "[]")] + [JsiiMethod(name: "global")] public virtual void Global() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("if", null, "[]")] + [JsiiMethod(name: "if")] public virtual void If() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("import", null, "[]")] + [JsiiMethod(name: "import")] public virtual void Import() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("in", null, "[]")] + [JsiiMethod(name: "in")] public virtual void In() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("is", null, "[]")] + [JsiiMethod(name: "is")] public virtual void Is() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("lambda", null, "[]")] + [JsiiMethod(name: "lambda")] public virtual void Lambda() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("nonlocal", null, "[]")] + [JsiiMethod(name: "nonlocal")] public virtual void Nonlocal() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("not", null, "[]")] + [JsiiMethod(name: "not")] public virtual void Not() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("or", null, "[]")] + [JsiiMethod(name: "or")] public virtual void Or() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("pass", null, "[]")] + [JsiiMethod(name: "pass")] public virtual void Pass() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("raise", null, "[]")] + [JsiiMethod(name: "raise")] public virtual void Raise() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("return", null, "[]")] + [JsiiMethod(name: "return")] public virtual void Return() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("try", null, "[]")] + [JsiiMethod(name: "try")] public virtual void Try() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("while", null, "[]")] + [JsiiMethod(name: "while")] public virtual void While() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("with", null, "[]")] + [JsiiMethod(name: "with")] public virtual void With() { InvokeInstanceVoidMethod(new object[]{}); } - [JsiiMethod("yield", null, "[]")] + [JsiiMethod(name: "yield")] public virtual void Yield() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReferenceEnumFromScopedPackage.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReferenceEnumFromScopedPackage.cs index 50b7e9ad87..32befca1cf 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReferenceEnumFromScopedPackage.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReferenceEnumFromScopedPackage.cs @@ -4,7 +4,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// See awslabs/jsii#138. - [JsiiClass(typeof(ReferenceEnumFromScopedPackage), "jsii-calc.ReferenceEnumFromScopedPackage", "[]")] + [JsiiClass(nativeType: typeof(ReferenceEnumFromScopedPackage), fullyQualifiedName: "jsii-calc.ReferenceEnumFromScopedPackage")] public class ReferenceEnumFromScopedPackage : DeputyBase { public ReferenceEnumFromScopedPackage(): base(new DeputyProps(new object[]{})) @@ -19,20 +19,20 @@ protected ReferenceEnumFromScopedPackage(DeputyProps props): base(props) { } - [JsiiProperty("foo", "{\"fqn\":\"@scope/jsii-calc-lib.EnumFromScopedModule\",\"optional\":true}")] - public virtual EnumFromScopedModule Foo + [JsiiProperty(name: "foo", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.EnumFromScopedModule\"}", isOptional: true)] + public virtual EnumFromScopedModule? Foo { - get => GetInstanceProperty(); + get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiMethod("loadFoo", "{\"fqn\":\"@scope/jsii-calc-lib.EnumFromScopedModule\",\"optional\":true}", "[]")] - public virtual EnumFromScopedModule LoadFoo() + [JsiiMethod(name: "loadFoo", returnsJson: "{\"type\":{\"fqn\":\"@scope/jsii-calc-lib.EnumFromScopedModule\"},\"optional\":true}")] + public virtual EnumFromScopedModule? LoadFoo() { - return InvokeInstanceMethod(new object[]{}); + return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("saveFoo", null, "[{\"name\":\"value\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.EnumFromScopedModule\"}}]")] + [JsiiMethod(name: "saveFoo", parametersJson: "[{\"name\":\"value\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.EnumFromScopedModule\"}}]")] public virtual void SaveFoo(EnumFromScopedModule value) { InvokeInstanceVoidMethod(new object[]{value}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsPrivateImplementationOfInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsPrivateImplementationOfInterface.cs index 9e47d18199..e9bcf3863c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsPrivateImplementationOfInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsPrivateImplementationOfInterface.cs @@ -4,7 +4,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Helps ensure the JSII kernel & runtime cooperate correctly when an un-exported instance of a class is returned with a declared type that is an exported interface, and the instance inherits from an exported class. /// see: https://github.com/awslabs/jsii/issues/320 - [JsiiClass(typeof(ReturnsPrivateImplementationOfInterface), "jsii-calc.ReturnsPrivateImplementationOfInterface", "[]")] + [JsiiClass(nativeType: typeof(ReturnsPrivateImplementationOfInterface), fullyQualifiedName: "jsii-calc.ReturnsPrivateImplementationOfInterface")] public class ReturnsPrivateImplementationOfInterface : DeputyBase { public ReturnsPrivateImplementationOfInterface(): base(new DeputyProps(new object[]{})) @@ -19,7 +19,7 @@ protected ReturnsPrivateImplementationOfInterface(DeputyProps props): base(props { } - [JsiiProperty("privateImplementation", "{\"fqn\":\"jsii-calc.IPrivatelyImplemented\"}")] + [JsiiProperty(name: "privateImplementation", typeJson: "{\"fqn\":\"jsii-calc.IPrivatelyImplemented\"}")] public virtual IIPrivatelyImplemented PrivateImplementation { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/RuntimeTypeChecking.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/RuntimeTypeChecking.cs index 73596032c5..657eb4de71 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/RuntimeTypeChecking.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/RuntimeTypeChecking.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(RuntimeTypeChecking), "jsii-calc.RuntimeTypeChecking", "[]")] + [JsiiClass(nativeType: typeof(RuntimeTypeChecking), fullyQualifiedName: "jsii-calc.RuntimeTypeChecking")] public class RuntimeTypeChecking : DeputyBase { public RuntimeTypeChecking(): base(new DeputyProps(new object[]{})) @@ -18,20 +18,20 @@ protected RuntimeTypeChecking(DeputyProps props): base(props) { } - [JsiiMethod("methodWithDefaultedArguments", null, "[{\"name\":\"arg1\",\"type\":{\"primitive\":\"number\",\"optional\":true}},{\"name\":\"arg2\",\"type\":{\"primitive\":\"string\",\"optional\":true}},{\"name\":\"arg3\",\"type\":{\"primitive\":\"date\",\"optional\":true}}]")] + [JsiiMethod(name: "methodWithDefaultedArguments", parametersJson: "[{\"name\":\"arg1\",\"type\":{\"primitive\":\"number\"}},{\"name\":\"arg2\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"arg3\",\"type\":{\"primitive\":\"date\"}}]")] public virtual void MethodWithDefaultedArguments(double? arg1, string arg2, DateTime? arg3) { InvokeInstanceVoidMethod(new object[]{arg1, arg2, arg3}); } - [JsiiMethod("methodWithOptionalAnyArgument", null, "[{\"name\":\"arg\",\"type\":{\"primitive\":\"any\",\"optional\":true}}]")] + [JsiiMethod(name: "methodWithOptionalAnyArgument", parametersJson: "[{\"name\":\"arg\",\"type\":{\"primitive\":\"any\"}}]")] public virtual void MethodWithOptionalAnyArgument(object arg) { InvokeInstanceVoidMethod(new object[]{arg}); } /// Used to verify verification of number of method arguments. - [JsiiMethod("methodWithOptionalArguments", null, "[{\"name\":\"arg1\",\"type\":{\"primitive\":\"number\"}},{\"name\":\"arg2\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"arg3\",\"type\":{\"primitive\":\"date\",\"optional\":true}}]")] + [JsiiMethod(name: "methodWithOptionalArguments", parametersJson: "[{\"name\":\"arg1\",\"type\":{\"primitive\":\"number\"}},{\"name\":\"arg2\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"arg3\",\"type\":{\"primitive\":\"date\"}}]")] public virtual void MethodWithOptionalArguments(double arg1, string arg2, DateTime? arg3) { InvokeInstanceVoidMethod(new object[]{arg1, arg2, arg3}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SingleInstanceTwoTypes.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SingleInstanceTwoTypes.cs index aff432de00..fe73a197ed 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SingleInstanceTwoTypes.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SingleInstanceTwoTypes.cs @@ -8,7 +8,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// object. Unfortunately, this will break object equality, but if we didn't do /// this it would break runtime type checks in the JVM or CLR. /// - [JsiiClass(typeof(SingleInstanceTwoTypes), "jsii-calc.SingleInstanceTwoTypes", "[]")] + [JsiiClass(nativeType: typeof(SingleInstanceTwoTypes), fullyQualifiedName: "jsii-calc.SingleInstanceTwoTypes")] public class SingleInstanceTwoTypes : DeputyBase { public SingleInstanceTwoTypes(): base(new DeputyProps(new object[]{})) @@ -23,13 +23,13 @@ protected SingleInstanceTwoTypes(DeputyProps props): base(props) { } - [JsiiMethod("interface1", "{\"fqn\":\"jsii-calc.InbetweenClass\"}", "[]")] + [JsiiMethod(name: "interface1", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.InbetweenClass\"}}")] public virtual InbetweenClass Interface1() { return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("interface2", "{\"fqn\":\"jsii-calc.IPublicInterface\"}", "[]")] + [JsiiMethod(name: "interface2", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.IPublicInterface\"}}")] public virtual IIPublicInterface Interface2() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Statics.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Statics.cs index 470520e98d..8a17ea8916 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Statics.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Statics.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(Statics), "jsii-calc.Statics", "[{\"name\":\"value\",\"type\":{\"primitive\":\"string\"}}]")] + [JsiiClass(nativeType: typeof(Statics), fullyQualifiedName: "jsii-calc.Statics", parametersJson: "[{\"name\":\"value\",\"type\":{\"primitive\":\"string\"}}]")] public class Statics : DeputyBase { public Statics(string value): base(new DeputyProps(new object[]{value})) @@ -19,14 +19,14 @@ protected Statics(DeputyProps props): base(props) } /// Constants may also use all-caps. - [JsiiProperty("BAR", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "BAR", typeJson: "{\"primitive\":\"number\"}")] public static double BAR { get; } = GetStaticProperty(typeof(Statics)); - [JsiiProperty("ConstObj", "{\"fqn\":\"jsii-calc.DoubleTrouble\"}")] + [JsiiProperty(name: "ConstObj", typeJson: "{\"fqn\":\"jsii-calc.DoubleTrouble\"}")] public static DoubleTrouble ConstObj { get; @@ -34,7 +34,7 @@ public static DoubleTrouble ConstObj = GetStaticProperty(typeof(Statics)); /// Jsdocs for static property. - [JsiiProperty("Foo", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "Foo", typeJson: "{\"primitive\":\"string\"}")] public static string Foo { get; @@ -42,7 +42,7 @@ public static string Foo = GetStaticProperty(typeof(Statics)); /// Constants can also use camelCase. - [JsiiProperty("zooBar", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"primitive\":\"string\"}}}")] + [JsiiProperty(name: "zooBar", typeJson: "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"primitive\":\"string\"}}}")] public static IDictionary ZooBar { get; @@ -50,21 +50,21 @@ public static IDictionary ZooBar = GetStaticProperty>(typeof(Statics)); /// Jsdocs for static getter. Jsdocs for static setter. - [JsiiProperty("instance", "{\"fqn\":\"jsii-calc.Statics\"}")] + [JsiiProperty(name: "instance", typeJson: "{\"fqn\":\"jsii-calc.Statics\"}")] public static Statics Instance { get => GetStaticProperty(typeof(Statics)); set => SetStaticProperty(typeof(Statics), value); } - [JsiiProperty("nonConstStatic", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "nonConstStatic", typeJson: "{\"primitive\":\"number\"}")] public static double NonConstStatic { get => GetStaticProperty(typeof(Statics)); set => SetStaticProperty(typeof(Statics), value); } - [JsiiProperty("value", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"string\"}")] public virtual string Value { get => GetInstanceProperty(); @@ -72,13 +72,13 @@ public virtual string Value /// Jsdocs for static method. /// The name of the person to say hello to. - [JsiiMethod("staticMethod", "{\"primitive\":\"string\"}", "[{\"name\":\"name\",\"type\":{\"primitive\":\"string\"}}]")] + [JsiiMethod(name: "staticMethod", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", parametersJson: "[{\"name\":\"name\",\"type\":{\"primitive\":\"string\"}}]")] public static string StaticMethod(string name) { return InvokeStaticMethod(typeof(Statics), new object[]{name}); } - [JsiiMethod("justMethod", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "justMethod", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public virtual string JustMethod() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StringEnum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StringEnum.cs index 00184f5025..1424f3386e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StringEnum.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StringEnum.cs @@ -2,14 +2,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiEnum(typeof(StringEnum), "jsii-calc.StringEnum")] + [JsiiEnum(nativeType: typeof(StringEnum), fullyQualifiedName: "jsii-calc.StringEnum")] public enum StringEnum { - [JsiiEnumMember("A")] + [JsiiEnumMember(name: "A")] A, - [JsiiEnumMember("B")] + [JsiiEnumMember(name: "B")] B, - [JsiiEnumMember("C")] + [JsiiEnumMember(name: "C")] C } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StripInternal.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StripInternal.cs index 3344d1dbb4..45e4de239d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StripInternal.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StripInternal.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(StripInternal), "jsii-calc.StripInternal", "[]")] + [JsiiClass(nativeType: typeof(StripInternal), fullyQualifiedName: "jsii-calc.StripInternal")] public class StripInternal : DeputyBase { public StripInternal(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected StripInternal(DeputyProps props): base(props) { } - [JsiiProperty("youSeeMe", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "youSeeMe", typeJson: "{\"primitive\":\"string\"}")] public virtual string YouSeeMe { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Sum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Sum.cs index b733546a11..3ad8282dc4 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Sum.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Sum.cs @@ -5,7 +5,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// An operation that sums multiple values. - [JsiiClass(typeof(Sum), "jsii-calc.Sum", "[]")] + [JsiiClass(nativeType: typeof(Sum), fullyQualifiedName: "jsii-calc.Sum")] public class Sum : CompositeOperation_ { public Sum(): base(new DeputyProps(new object[]{})) @@ -21,14 +21,14 @@ protected Sum(DeputyProps props): base(props) } /// The expression that this operation consists of. Must be implemented by derived classes. - [JsiiProperty("expression", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + [JsiiProperty(name: "expression", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] public override Value_ Expression { get => GetInstanceProperty(); } /// The parts to sum. - [JsiiProperty("parts", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}")] + [JsiiProperty(name: "parts", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}")] public virtual Value_[] Parts { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SyncVirtualMethods.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SyncVirtualMethods.cs index fb39b30885..943b99bd3b 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SyncVirtualMethods.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SyncVirtualMethods.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(SyncVirtualMethods), "jsii-calc.SyncVirtualMethods", "[]")] + [JsiiClass(nativeType: typeof(SyncVirtualMethods), fullyQualifiedName: "jsii-calc.SyncVirtualMethods")] public class SyncVirtualMethods : DeputyBase { public SyncVirtualMethods(): base(new DeputyProps(new object[]{})) @@ -17,102 +17,102 @@ protected SyncVirtualMethods(DeputyProps props): base(props) { } - [JsiiProperty("readonlyProperty", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "readonlyProperty", typeJson: "{\"primitive\":\"string\"}")] public virtual string ReadonlyProperty { get => GetInstanceProperty(); } - [JsiiProperty("a", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "a", typeJson: "{\"primitive\":\"number\"}")] public virtual double A { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("callerIsProperty", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "callerIsProperty", typeJson: "{\"primitive\":\"number\"}")] public virtual double CallerIsProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("otherProperty", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "otherProperty", typeJson: "{\"primitive\":\"string\"}")] public virtual string OtherProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("theProperty", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "theProperty", typeJson: "{\"primitive\":\"string\"}")] public virtual string TheProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiProperty("valueOfOtherProperty", "{\"primitive\":\"string\"}")] + [JsiiProperty(name: "valueOfOtherProperty", typeJson: "{\"primitive\":\"string\"}")] public virtual string ValueOfOtherProperty { get => GetInstanceProperty(); set => SetInstanceProperty(value); } - [JsiiMethod("callerIsAsync", "{\"primitive\":\"number\",\"promise\":true}", "[]")] + [JsiiMethod(name: "callerIsAsync", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", isAsync: true)] public virtual double CallerIsAsync() { return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("callerIsMethod", "{\"primitive\":\"number\"}", "[]")] + [JsiiMethod(name: "callerIsMethod", returnsJson: "{\"type\":{\"primitive\":\"number\"}}")] public virtual double CallerIsMethod() { return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("modifyOtherProperty", null, "[{\"name\":\"value\",\"type\":{\"primitive\":\"string\"}}]")] + [JsiiMethod(name: "modifyOtherProperty", parametersJson: "[{\"name\":\"value\",\"type\":{\"primitive\":\"string\"}}]")] public virtual void ModifyOtherProperty(string value) { InvokeInstanceVoidMethod(new object[]{value}); } - [JsiiMethod("modifyValueOfTheProperty", null, "[{\"name\":\"value\",\"type\":{\"primitive\":\"string\"}}]")] + [JsiiMethod(name: "modifyValueOfTheProperty", parametersJson: "[{\"name\":\"value\",\"type\":{\"primitive\":\"string\"}}]")] public virtual void ModifyValueOfTheProperty(string value) { InvokeInstanceVoidMethod(new object[]{value}); } - [JsiiMethod("readA", "{\"primitive\":\"number\"}", "[]")] + [JsiiMethod(name: "readA", returnsJson: "{\"type\":{\"primitive\":\"number\"}}")] public virtual double ReadA() { return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("retrieveOtherProperty", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "retrieveOtherProperty", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public virtual string RetrieveOtherProperty() { return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("retrieveReadOnlyProperty", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "retrieveReadOnlyProperty", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public virtual string RetrieveReadOnlyProperty() { return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("retrieveValueOfTheProperty", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "retrieveValueOfTheProperty", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public virtual string RetrieveValueOfTheProperty() { return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("virtualMethod", "{\"primitive\":\"number\"}", "[{\"name\":\"n\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiMethod(name: "virtualMethod", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", parametersJson: "[{\"name\":\"n\",\"type\":{\"primitive\":\"number\"}}]")] public virtual double VirtualMethod(double n) { return InvokeInstanceMethod(new object[]{n}); } - [JsiiMethod("writeA", null, "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiMethod(name: "writeA", parametersJson: "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] public virtual void WriteA(double value) { InvokeInstanceVoidMethod(new object[]{value}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Thrower.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Thrower.cs index 7f5961d7ac..76a68eb02e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Thrower.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Thrower.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(Thrower), "jsii-calc.Thrower", "[]")] + [JsiiClass(nativeType: typeof(Thrower), fullyQualifiedName: "jsii-calc.Thrower")] public class Thrower : DeputyBase { public Thrower(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected Thrower(DeputyProps props): base(props) { } - [JsiiMethod("throwError", null, "[]")] + [JsiiMethod(name: "throwError")] public virtual void ThrowError() { InvokeInstanceVoidMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperation.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperation.cs index 61200c8938..f54e63e9e5 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperation.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperation.cs @@ -4,7 +4,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// An operation on a single operand. - [JsiiClass(typeof(UnaryOperation), "jsii-calc.UnaryOperation", "[{\"name\":\"operand\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] + [JsiiClass(nativeType: typeof(UnaryOperation), fullyQualifiedName: "jsii-calc.UnaryOperation", parametersJson: "[{\"name\":\"operand\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] public abstract class UnaryOperation : Operation { protected UnaryOperation(Value_ operand): base(new DeputyProps(new object[]{operand})) @@ -19,7 +19,7 @@ protected UnaryOperation(DeputyProps props): base(props) { } - [JsiiProperty("operand", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + [JsiiProperty(name: "operand", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] public virtual Value_ Operand { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperationProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperationProxy.cs index 83928a7ef3..caebd52c34 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperationProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperationProxy.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// An operation on a single operand. - [JsiiTypeProxy(typeof(UnaryOperation), "jsii-calc.UnaryOperation")] + [JsiiTypeProxy(nativeType: typeof(UnaryOperation), fullyQualifiedName: "jsii-calc.UnaryOperation")] internal sealed class UnaryOperationProxy : UnaryOperation { private UnaryOperationProxy(ByRefValue reference): base(reference) @@ -11,14 +11,14 @@ private UnaryOperationProxy(ByRefValue reference): base(reference) } /// The value. - [JsiiProperty("value", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"number\"}")] public override double Value { get => GetInstanceProperty(); } /// String representation of the value. - [JsiiMethod("toString", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "toString", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public override string ToString() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs index 2397f4e3e9..9d24c7b400 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs @@ -5,14 +5,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue] public class UnionProperties : IUnionProperties { - [JsiiProperty("bar", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.AllTypes\"}]}}", true)] + [JsiiProperty(name: "bar", typeJson: "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.AllTypes\"}]}}", isOverride: true)] public object Bar { get; set; } - [JsiiProperty("foo", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"}]},\"optional\":true}", true)] + [JsiiProperty(name: "foo", typeJson: "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"}]}}", isOptional: true, isOverride: true)] public object Foo { get; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionPropertiesProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionPropertiesProxy.cs index bc022d08c2..ba5525b382 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionPropertiesProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionPropertiesProxy.cs @@ -2,20 +2,20 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiTypeProxy(typeof(IUnionProperties), "jsii-calc.UnionProperties")] + [JsiiTypeProxy(nativeType: typeof(IUnionProperties), fullyQualifiedName: "jsii-calc.UnionProperties")] internal sealed class UnionPropertiesProxy : DeputyBase, IUnionProperties { private UnionPropertiesProxy(ByRefValue reference): base(reference) { } - [JsiiProperty("bar", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.AllTypes\"}]}}")] + [JsiiProperty(name: "bar", typeJson: "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.AllTypes\"}]}}")] public object Bar { get => GetInstanceProperty(); } - [JsiiProperty("foo", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"}]},\"optional\":true}")] + [JsiiProperty(name: "foo", typeJson: "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"}]}}", isOptional: true)] public object Foo { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseBundledDependency.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseBundledDependency.cs index 7470df65fe..3b9ab6cd8c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseBundledDependency.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseBundledDependency.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(UseBundledDependency), "jsii-calc.UseBundledDependency", "[]")] + [JsiiClass(nativeType: typeof(UseBundledDependency), fullyQualifiedName: "jsii-calc.UseBundledDependency")] public class UseBundledDependency : DeputyBase { public UseBundledDependency(): base(new DeputyProps(new object[]{})) @@ -17,7 +17,7 @@ protected UseBundledDependency(DeputyProps props): base(props) { } - [JsiiMethod("value", "{\"primitive\":\"any\"}", "[]")] + [JsiiMethod(name: "value", returnsJson: "{\"type\":{\"primitive\":\"any\"}}")] public virtual object Value() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseCalcBase.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseCalcBase.cs index f830e7b238..4513120efd 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseCalcBase.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseCalcBase.cs @@ -4,7 +4,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Depend on a type from jsii-calc-base as a test for awslabs/jsii#128. - [JsiiClass(typeof(UseCalcBase), "jsii-calc.UseCalcBase", "[]")] + [JsiiClass(nativeType: typeof(UseCalcBase), fullyQualifiedName: "jsii-calc.UseCalcBase")] public class UseCalcBase : DeputyBase { public UseCalcBase(): base(new DeputyProps(new object[]{})) @@ -19,7 +19,7 @@ protected UseCalcBase(DeputyProps props): base(props) { } - [JsiiMethod("hello", "{\"fqn\":\"@scope/jsii-calc-base.Base\"}", "[]")] + [JsiiMethod(name: "hello", returnsJson: "{\"type\":{\"fqn\":\"@scope/jsii-calc-base.Base\"}}")] public virtual Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace.Base Hello() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UsesInterfaceWithProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UsesInterfaceWithProperties.cs index 36b537a76c..d36f87aa9a 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UsesInterfaceWithProperties.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UsesInterfaceWithProperties.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(UsesInterfaceWithProperties), "jsii-calc.UsesInterfaceWithProperties", "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.IInterfaceWithProperties\"}}]")] + [JsiiClass(nativeType: typeof(UsesInterfaceWithProperties), fullyQualifiedName: "jsii-calc.UsesInterfaceWithProperties", parametersJson: "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.IInterfaceWithProperties\"}}]")] public class UsesInterfaceWithProperties : DeputyBase { public UsesInterfaceWithProperties(IIInterfaceWithProperties obj): base(new DeputyProps(new object[]{obj})) @@ -17,25 +17,25 @@ protected UsesInterfaceWithProperties(DeputyProps props): base(props) { } - [JsiiProperty("obj", "{\"fqn\":\"jsii-calc.IInterfaceWithProperties\"}")] + [JsiiProperty(name: "obj", typeJson: "{\"fqn\":\"jsii-calc.IInterfaceWithProperties\"}")] public virtual IIInterfaceWithProperties Obj { get => GetInstanceProperty(); } - [JsiiMethod("justRead", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "justRead", returnsJson: "{\"type\":{\"primitive\":\"string\"}}")] public virtual string JustRead() { return InvokeInstanceMethod(new object[]{}); } - [JsiiMethod("readStringAndNumber", "{\"primitive\":\"string\"}", "[{\"name\":\"ext\",\"type\":{\"fqn\":\"jsii-calc.IInterfaceWithPropertiesExtension\"}}]")] + [JsiiMethod(name: "readStringAndNumber", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", parametersJson: "[{\"name\":\"ext\",\"type\":{\"fqn\":\"jsii-calc.IInterfaceWithPropertiesExtension\"}}]")] public virtual string ReadStringAndNumber(IIInterfaceWithPropertiesExtension ext) { return InvokeInstanceMethod(new object[]{ext}); } - [JsiiMethod("writeAndRead", "{\"primitive\":\"string\"}", "[{\"name\":\"value\",\"type\":{\"primitive\":\"string\"}}]")] + [JsiiMethod(name: "writeAndRead", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", parametersJson: "[{\"name\":\"value\",\"type\":{\"primitive\":\"string\"}}]")] public virtual string WriteAndRead(string value) { return InvokeInstanceMethod(new object[]{value}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VariadicMethod.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VariadicMethod.cs index 71f3bd12b9..3e373213c3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VariadicMethod.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VariadicMethod.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(VariadicMethod), "jsii-calc.VariadicMethod", "[{\"name\":\"prefix\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiClass(nativeType: typeof(VariadicMethod), fullyQualifiedName: "jsii-calc.VariadicMethod", parametersJson: "[{\"name\":\"prefix\",\"type\":{\"primitive\":\"number\"}}]")] public class VariadicMethod : DeputyBase { public VariadicMethod(double prefix): base(new DeputyProps(new object[]{prefix})) @@ -19,7 +19,7 @@ protected VariadicMethod(DeputyProps props): base(props) /// the first element of the array to be returned (after the `prefix` provided at construction time). /// other elements to be included in the array. - [JsiiMethod("asArray", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"number\"}}}", "[{\"name\":\"first\",\"type\":{\"primitive\":\"number\"}},{\"name\":\"others\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiMethod(name: "asArray", returnsJson: "{\"type\":{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"number\"}}}}", parametersJson: "[{\"name\":\"first\",\"type\":{\"primitive\":\"number\"}},{\"name\":\"others\",\"type\":{\"primitive\":\"number\"}}]")] public virtual double[] AsArray(double first, double others) { return InvokeInstanceMethod(new object[]{first, others}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VirtualMethodPlayground.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VirtualMethodPlayground.cs index 82a3001c27..0a8c0e7963 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VirtualMethodPlayground.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VirtualMethodPlayground.cs @@ -2,7 +2,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { - [JsiiClass(typeof(VirtualMethodPlayground), "jsii-calc.VirtualMethodPlayground", "[]")] + [JsiiClass(nativeType: typeof(VirtualMethodPlayground), fullyQualifiedName: "jsii-calc.VirtualMethodPlayground")] public class VirtualMethodPlayground : DeputyBase { public VirtualMethodPlayground(): base(new DeputyProps(new object[]{})) @@ -17,31 +17,31 @@ protected VirtualMethodPlayground(DeputyProps props): base(props) { } - [JsiiMethod("overrideMeAsync", "{\"primitive\":\"number\",\"promise\":true}", "[{\"name\":\"index\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiMethod(name: "overrideMeAsync", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", parametersJson: "[{\"name\":\"index\",\"type\":{\"primitive\":\"number\"}}]", isAsync: true)] public virtual double OverrideMeAsync(double index) { return InvokeInstanceMethod(new object[]{index}); } - [JsiiMethod("overrideMeSync", "{\"primitive\":\"number\"}", "[{\"name\":\"index\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiMethod(name: "overrideMeSync", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", parametersJson: "[{\"name\":\"index\",\"type\":{\"primitive\":\"number\"}}]")] public virtual double OverrideMeSync(double index) { return InvokeInstanceMethod(new object[]{index}); } - [JsiiMethod("parallelSumAsync", "{\"primitive\":\"number\",\"promise\":true}", "[{\"name\":\"count\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiMethod(name: "parallelSumAsync", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", parametersJson: "[{\"name\":\"count\",\"type\":{\"primitive\":\"number\"}}]", isAsync: true)] public virtual double ParallelSumAsync(double count) { return InvokeInstanceMethod(new object[]{count}); } - [JsiiMethod("serialSumAsync", "{\"primitive\":\"number\",\"promise\":true}", "[{\"name\":\"count\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiMethod(name: "serialSumAsync", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", parametersJson: "[{\"name\":\"count\",\"type\":{\"primitive\":\"number\"}}]", isAsync: true)] public virtual double SerialSumAsync(double count) { return InvokeInstanceMethod(new object[]{count}); } - [JsiiMethod("sumSync", "{\"primitive\":\"number\"}", "[{\"name\":\"count\",\"type\":{\"primitive\":\"number\"}}]")] + [JsiiMethod(name: "sumSync", returnsJson: "{\"type\":{\"primitive\":\"number\"}}", parametersJson: "[{\"name\":\"count\",\"type\":{\"primitive\":\"number\"}}]")] public virtual double SumSync(double count) { return InvokeInstanceMethod(new object[]{count}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation/CompositionStringStyle.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation/CompositionStringStyle.cs index 260b90629e..fde0565bd2 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation/CompositionStringStyle.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation/CompositionStringStyle.cs @@ -3,14 +3,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.composition.CompositeOperation { /// Style of .toString() output for CompositeOperation. - [JsiiEnum(typeof(CompositionStringStyle), "jsii-calc.composition.CompositeOperation.CompositionStringStyle")] + [JsiiEnum(nativeType: typeof(CompositionStringStyle), fullyQualifiedName: "jsii-calc.composition.CompositeOperation.CompositionStringStyle")] public enum CompositionStringStyle { /// Normal string expression. - [JsiiEnumMember("Normal")] + [JsiiEnumMember(name: "Normal")] Normal, /// Decorated string expression. - [JsiiEnumMember("Decorated")] + [JsiiEnumMember(name: "Decorated")] Decorated } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperationProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperationProxy.cs index a49840e5fd..fdeecd69d0 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperationProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperationProxy.cs @@ -4,7 +4,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.composition { /// Abstract operation composed from an expression of other operations. - [JsiiTypeProxy(typeof(CompositeOperation_), "jsii-calc.composition.CompositeOperation")] + [JsiiTypeProxy(nativeType: typeof(CompositeOperation_), fullyQualifiedName: "jsii-calc.composition.CompositeOperation")] internal sealed class CompositeOperationProxy : CompositeOperation_ { private CompositeOperationProxy(ByRefValue reference): base(reference) @@ -12,7 +12,7 @@ private CompositeOperationProxy(ByRefValue reference): base(reference) } /// The expression that this operation consists of. Must be implemented by derived classes. - [JsiiProperty("expression", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + [JsiiProperty(name: "expression", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] public override Value_ Expression { get => GetInstanceProperty(); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation_.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation_.cs index 3b236145f5..b828d2dc2e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation_.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation_.cs @@ -5,7 +5,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.composition { /// Abstract operation composed from an expression of other operations. - [JsiiClass(typeof(CompositeOperation_), "jsii-calc.composition.CompositeOperation", "[]")] + [JsiiClass(nativeType: typeof(CompositeOperation_), fullyQualifiedName: "jsii-calc.composition.CompositeOperation")] public abstract class CompositeOperation_ : Operation { protected CompositeOperation_(): base(new DeputyProps(new object[]{})) @@ -21,21 +21,21 @@ protected CompositeOperation_(DeputyProps props): base(props) } /// The expression that this operation consists of. Must be implemented by derived classes. - [JsiiProperty("expression", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + [JsiiProperty(name: "expression", typeJson: "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] public virtual Value_ Expression { get => GetInstanceProperty(); } /// The value. - [JsiiProperty("value", "{\"primitive\":\"number\"}")] + [JsiiProperty(name: "value", typeJson: "{\"primitive\":\"number\"}")] public override double Value { get => GetInstanceProperty(); } /// A set of postfixes to include in a decorated .toString(). - [JsiiProperty("decorationPostfixes", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}")] + [JsiiProperty(name: "decorationPostfixes", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}")] public virtual string[] DecorationPostfixes { get => GetInstanceProperty(); @@ -43,7 +43,7 @@ public virtual string[] DecorationPostfixes } /// A set of prefixes to include in a decorated .toString(). - [JsiiProperty("decorationPrefixes", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}")] + [JsiiProperty(name: "decorationPrefixes", typeJson: "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}")] public virtual string[] DecorationPrefixes { get => GetInstanceProperty(); @@ -51,7 +51,7 @@ public virtual string[] DecorationPrefixes } /// The .toString() style. - [JsiiProperty("stringStyle", "{\"fqn\":\"jsii-calc.composition.CompositeOperation.CompositionStringStyle\"}")] + [JsiiProperty(name: "stringStyle", typeJson: "{\"fqn\":\"jsii-calc.composition.CompositeOperation.CompositionStringStyle\"}")] public virtual CompositionStringStyle StringStyle { get => GetInstanceProperty(); @@ -59,7 +59,7 @@ public virtual CompositionStringStyle StringStyle } /// String representation of the value. - [JsiiMethod("toString", "{\"primitive\":\"string\"}", "[]")] + [JsiiMethod(name: "toString", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", isOverride: true)] public override string ToString() { return InvokeInstanceMethod(new object[]{}); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/AllTypes.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/AllTypes.java index 2508e83527..5793c72fdd 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/AllTypes.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/AllTypes.java @@ -17,10 +17,11 @@ public AllTypes() { software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this); } - public void anyIn(final java.lang.Object inp) { - this.jsiiCall("anyIn", Void.class, java.util.stream.Stream.of(java.util.Objects.requireNonNull(inp, "inp is required")).toArray()); + public void anyIn(@javax.annotation.Nullable final java.lang.Object inp) { + this.jsiiCall("anyIn", Void.class, java.util.stream.Stream.of(inp).toArray()); } + @javax.annotation.Nullable public java.lang.Object anyOut() { return this.jsiiCall("anyOut", java.lang.Object.class); } @@ -49,11 +50,12 @@ public void setAnyMapProperty(final java.util.Map None: jsii.create(DontComplainAboutVariadicAfterOptional, self, []) @jsii.member(jsii_name="optionalAndVariadic") - def optional_and_variadic(self, optional: typing.Optional[str], *things: str) -> str: + def optional_and_variadic(self, optional: typing.Optional[str]=None, *things: str) -> str: return jsii.invoke(self, "optionalAndVariadic", [optional, things]) @@ -2561,11 +2561,11 @@ def max_value(self, value: typing.Optional[jsii.Number]): @property @jsii.member(jsii_name="unionProperty") - def union_property(self) -> typing.Optional[typing.Union["Add", "Multiply", "Power"]]: + def union_property(self) -> typing.Optional[typing.Union[typing.Optional["Add"], typing.Optional["Multiply"], typing.Optional["Power"]]]: return jsii.get(self, "unionProperty") @union_property.setter - def union_property(self, value: typing.Optional[typing.Union["Add", "Multiply", "Power"]]): + def union_property(self, value: typing.Optional[typing.Union[typing.Optional["Add"], typing.Optional["Multiply"], typing.Optional["Power"]]]): return jsii.set(self, "unionProperty", value) diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst b/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst index 5cd9c7a205..83f8ba616b 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst +++ b/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst @@ -858,7 +858,7 @@ Calculator :extends: :py:class:`~jsii-calc.composition.CompositeOperation`\ :param props: Initialization properties. - :type props: :py:class:`~jsii-calc.CalculatorProps`\ *(optional)* + :type props: :py:class:`~jsii-calc.CalculatorProps`\ .. py:method:: add(value) @@ -1431,11 +1431,11 @@ DefaultedConstructorArgument :param arg1: - :type arg1: number *(optional)* + :type arg1: number :param arg2: - :type arg2: string *(optional)* + :type arg2: string :param arg3: - :type arg3: date *(optional)* + :type arg3: date .. py:attribute:: arg1 @@ -1593,7 +1593,7 @@ DerivedStruct (interface) .. py:attribute:: optionalAny - :type: any *(optional)* *(readonly)* + :type: any *(readonly)* .. py:attribute:: optionalArray @@ -1711,9 +1711,9 @@ DoNotRecognizeAnyAsOptional :param _requiredAny: :type _requiredAny: any :param _optionalAny: - :type _optionalAny: any *(optional)* + :type _optionalAny: any :param _optionalString: - :type _optionalString: string *(optional)* + :type _optionalString: string DocumentedClass @@ -1771,7 +1771,7 @@ DocumentedClass :param greetee: The person to be greeted. - :type greetee: :py:class:`~jsii-calc.Greetee`\ *(optional)* + :type greetee: :py:class:`~jsii-calc.Greetee`\ :return: A number that everyone knows very well :rtype: number @@ -1812,10 +1812,10 @@ DontComplainAboutVariadicAfterOptional - .. py:method:: optionalAndVariadic(optional, *things) -> string + .. py:method:: optionalAndVariadic([optional, *things]) -> string :param optional: - :type optional: string *(optional)* + :type optional: string :param \*things: :type \*things: string :rtype: string @@ -2592,7 +2592,7 @@ IInterfaceWithOptionalMethodArguments (interface) :param arg1: :type arg1: string :param arg2: - :type arg2: number *(optional)* + :type arg2: number :abstract: Yes @@ -4355,12 +4355,12 @@ NullShouldBeTreatedAsUndefined :param _param1: :type _param1: string :param optional: - :type optional: any *(optional)* + :type optional: any .. py:method:: giveMeUndefined([value]) :param value: - :type value: any *(optional)* + :type value: any .. py:method:: giveMeUndefinedInsideAnObject(input) @@ -4414,7 +4414,7 @@ NullShouldBeTreatedAsUndefinedData (interface) .. py:attribute:: thisShouldBeUndefined - :type: any *(optional)* *(readonly)* + :type: any *(readonly)* NumberGenerator @@ -4594,7 +4594,7 @@ OptionalConstructorArgument :param arg2: :type arg2: string :param arg3: - :type arg3: date *(optional)* + :type arg3: date .. py:attribute:: arg1 @@ -4673,7 +4673,7 @@ OptionalStructConsumer :param optionalStruct: - :type optionalStruct: :py:class:`~jsii-calc.OptionalStruct`\ *(optional)* + :type optionalStruct: :py:class:`~jsii-calc.OptionalStruct`\ .. py:attribute:: parameterWasUndefined @@ -5230,17 +5230,17 @@ RuntimeTypeChecking .. py:method:: methodWithDefaultedArguments([arg1, [arg2, [arg3]]]) :param arg1: - :type arg1: number *(optional)* + :type arg1: number :param arg2: - :type arg2: string *(optional)* + :type arg2: string :param arg3: - :type arg3: date *(optional)* + :type arg3: date .. py:method:: methodWithOptionalAnyArgument([arg]) :param arg: - :type arg: any *(optional)* + :type arg: any .. py:method:: methodWithOptionalArguments(arg1, arg2, [arg3]) @@ -5254,7 +5254,7 @@ RuntimeTypeChecking :param arg2: :type arg2: string :param arg3: - :type arg3: date *(optional)* + :type arg3: date SingleInstanceTwoTypes diff --git a/packages/jsii-reflect/lib/assembly.ts b/packages/jsii-reflect/lib/assembly.ts index 1d1a709b60..861b31c08c 100644 --- a/packages/jsii-reflect/lib/assembly.ts +++ b/packages/jsii-reflect/lib/assembly.ts @@ -47,7 +47,7 @@ export class Assembly { * The module repository, maps to "repository" from package.json * This is required since some package managers (like Maven) require it. */ - public get repository(): { type: string, url: string } { + public get repository(): { type: string, url: string, directory?: string } { return this.spec.repository; } @@ -142,10 +142,6 @@ export class Assembly { return this.types.filter(t => t instanceof EnumType).map(t => t as EnumType); } - public get locationInRepository(): string | undefined { - return this.spec.locationInRepository; - } - public findType(fqn: string) { const type = this._types[fqn]; if (!type) { diff --git a/packages/jsii-reflect/lib/callable.ts b/packages/jsii-reflect/lib/callable.ts new file mode 100644 index 0000000000..a9f5f62c49 --- /dev/null +++ b/packages/jsii-reflect/lib/callable.ts @@ -0,0 +1,74 @@ +import jsii = require('jsii-spec'); +import { Assembly } from './assembly'; +import { Docs, Documentable } from './docs'; +import { Overridable } from './overridable'; +import { Parameter } from './parameter'; +import { SourceLocatable } from './source'; +import { locationInRepository, SourceLocation } from './source'; +import { Type } from './type'; +import { MemberKind, TypeMember } from './type-member'; +import { TypeSystem } from './type-system'; + +export abstract class Callable implements Documentable, Overridable, TypeMember, SourceLocatable { + public abstract readonly kind: MemberKind; + public abstract get name(): string; + public abstract get abstract(): boolean; + + constructor( + public readonly system: TypeSystem, + public readonly assembly: Assembly, + public readonly parentType: Type, + private readonly spec: jsii.Callable) {} + + public toString() { + return `${this.kind}:${this.parentType.fqn}.${this.name}`; + } + + /** + * The parameters of the method/initializer + */ + public get parameters(): Parameter[] { + return (this.spec.parameters || []).map(p => new Parameter(this.system, this.parentType, this, p)); + } + + /** + * Indicates if this method is protected (otherwise it is public) + */ + public get protected(): boolean { + return !!this.spec.protected; + } + + /** + * Indicates whether this method is variadic or not. When ``true``, the last + * element of ``#parameters`` will also be flagged ``#variadic``. + */ + public get variadic(): boolean { + return !!this.spec.variadic; + } + + public get overrides(): Type | undefined { + if (!this.spec.overrides) { + return undefined; + } + + return this.system.findFqn(this.spec.overrides); + } + + public get docs(): Docs { + return new Docs(this.system, this, this.spec.docs || {}, this.parentType.docs); + } + + /** + * Return the location in the module + */ + public get locationInModule(): SourceLocation | undefined { + return this.spec.locationInModule; + } + + /** + * Return the location in the repository + */ + public get locationInRepository(): SourceLocation | undefined { + return locationInRepository(this); + } +} diff --git a/packages/jsii-reflect/lib/class.ts b/packages/jsii-reflect/lib/class.ts index 6b80ace3ce..2d37a22e40 100644 --- a/packages/jsii-reflect/lib/class.ts +++ b/packages/jsii-reflect/lib/class.ts @@ -1,5 +1,6 @@ import jsii = require('jsii-spec'); import { Assembly } from './assembly'; +import { Initializer } from './initializer'; import { InterfaceType } from './interface'; import { Method } from './method'; import { Property } from './property'; @@ -23,9 +24,9 @@ export class ClassType extends ReferenceType { return undefined; } - const type = this.system.findFqn(this.classSpec.base.fqn); + const type = this.system.findFqn(this.classSpec.base); if (!(type instanceof ClassType)) { - throw new Error(`FQN for base class points to a non-class type: ${this.classSpec.base.fqn}`); + throw new Error(`FQN for base class points to a non-class type: ${this.classSpec.base}`); } return type; @@ -34,12 +35,12 @@ export class ClassType extends ReferenceType { /** * Initializer (constructor) method. */ - public get initializer(): Method | undefined { + public get initializer(): Initializer | undefined { if (!this.classSpec.initializer) { return undefined; } - return new Method(this.system, this.assembly, this, this.classSpec.initializer); + return new Initializer(this.system, this.assembly, this, this.classSpec.initializer); } /** @@ -93,7 +94,7 @@ export class ClassType extends ReferenceType { out.push(...this.base.getInterfaces(inherited)); } if (this.classSpec.interfaces) { - out.push(...this.classSpec.interfaces.map(i => this.system.findInterface(i.fqn))); + out.push(...this.classSpec.interfaces.map(iface => this.system.findInterface(iface))); } return out; } diff --git a/packages/jsii-reflect/lib/dependency.ts b/packages/jsii-reflect/lib/dependency.ts index ea64362a76..26b5572a36 100644 --- a/packages/jsii-reflect/lib/dependency.ts +++ b/packages/jsii-reflect/lib/dependency.ts @@ -18,22 +18,4 @@ export class Dependency { public get version() { return this.spec.version; } - - /** - * Indicates if this dependency is a peer dependency or a normal dependency. - * - * Peer dependencies are expected to be explicitly defined by the user of - * this library instead of brought in as transitive dependencies. - * - * jsii enforces that if this module exports a type from a dependency, this - * dependency must be defined as a peer and not as a normal dependency. - * Otherwise, it would be impossible to safely use two versions of this - * dependency in a closure. - * - * @see https://github.com/awslabs/aws-cdk/issues/979 - * @see https://nodejs.org/en/blog/npm/peer-dependencies/ - */ - public get peer(): boolean { - return !!this.spec.peer; - } -} \ No newline at end of file +} diff --git a/packages/jsii-reflect/lib/index.ts b/packages/jsii-reflect/lib/index.ts index 69deab66c8..362d998800 100644 --- a/packages/jsii-reflect/lib/index.ts +++ b/packages/jsii-reflect/lib/index.ts @@ -3,15 +3,17 @@ export * from './class'; export * from './dependency'; export * from './docs'; export * from './enum'; +export * from './initializer'; export * from './interface'; export * from './method'; +export * from './optional-value'; export * from './overridable'; export * from './parameter'; export * from './property'; export * from './tree'; +export * from './type'; +export * from './type-member'; export * from './type-ref'; export * from './type-system'; -export * from './type'; export * from './reference-type'; -export * from './type-member'; export * from './source'; diff --git a/packages/jsii-reflect/lib/initializer.ts b/packages/jsii-reflect/lib/initializer.ts new file mode 100644 index 0000000000..4a64026285 --- /dev/null +++ b/packages/jsii-reflect/lib/initializer.ts @@ -0,0 +1,11 @@ +import { Callable } from './callable'; +import { Documentable } from './docs'; +import { Overridable } from './overridable'; +import { SourceLocatable } from './source'; +import { MemberKind, TypeMember } from './type-member'; + +export class Initializer extends Callable implements Documentable, Overridable, TypeMember, SourceLocatable { + public readonly kind = MemberKind.Initializer; + public readonly name = ''; + public readonly abstract = false; +} diff --git a/packages/jsii-reflect/lib/interface.ts b/packages/jsii-reflect/lib/interface.ts index 7eab1d4d02..5417c18a66 100644 --- a/packages/jsii-reflect/lib/interface.ts +++ b/packages/jsii-reflect/lib/interface.ts @@ -36,7 +36,7 @@ export class InterfaceType extends ReferenceType { const result = new Set(); for (const iface of this.interfaceSpec.interfaces) { - const ifaceType = this.system.findInterface(iface.fqn); + const ifaceType = this.system.findInterface(iface); if (!result.has(ifaceType) && inherited) { ifaceType.getInterfaces(inherited).forEach(i => result.add(i)); } diff --git a/packages/jsii-reflect/lib/method.ts b/packages/jsii-reflect/lib/method.ts index 735e98bf28..843eac7507 100644 --- a/packages/jsii-reflect/lib/method.ts +++ b/packages/jsii-reflect/lib/method.ts @@ -1,14 +1,12 @@ import jsii = require('jsii-spec'); import { Assembly } from './assembly'; -import { Docs, Documentable } from './docs'; +import { Callable } from './callable'; +import { Documentable } from './docs'; +import { OptionalValue } from './optional-value'; import { Overridable } from './overridable'; -import { Parameter } from './parameter'; -import { Property } from './property'; import { SourceLocatable } from './source'; -import { locationInRepository, SourceLocation } from './source'; import { Type } from './type'; import { MemberKind, TypeMember } from './type-member'; -import { TypeReference } from './type-ref'; import { TypeSystem } from './type-system'; /** @@ -16,113 +14,49 @@ import { TypeSystem } from './type-system'; */ export const INITIALIZER_NAME = ''; -export class Method implements Documentable, Overridable, TypeMember, SourceLocatable { +export class Method extends Callable implements Documentable, Overridable, TypeMember, SourceLocatable { public readonly kind = MemberKind.Method; constructor( - public readonly system: TypeSystem, - public readonly assembly: Assembly, - public readonly parentType: Type, - private readonly spec: jsii.Method) { } - - public toString() { - return `method:${this.parentType.fqn}.${this.name}`; + system: TypeSystem, + assembly: Assembly, + parentType: Type, + private readonly methodSpec: jsii.Method) { + super(system, assembly, parentType, methodSpec); } /** * The name of the method. - * - * If this method is an initializer (`method.initializer` is `true`), the name - * will be "". */ public get name(): string { - if (this.initializer) { - return INITIALIZER_NAME; - } - - if (!this.spec.name) { - throw new Error(`Method does not have a name and is not an initializer`); - } - - return this.spec.name; + return this.methodSpec.name; } /** * The return type of the method (undefined if void or initializer) */ - public get returns(): TypeReference { - return new TypeReference(this.system, this.spec.returns); - } - - /** - * The parameters of the method/initializer - */ - public get parameters(): Parameter[] { - return (this.spec.parameters || []).map(p => new Parameter(this.system, this.parentType, this, p)); - } - - /** - * True if this method is an initializer, in which case it won't have a return type - */ - public get initializer(): boolean { - return !!this.spec.initializer; - } - - /** - * Indicates if this method is protected (otherwise it is public) - */ - public get protected(): boolean { - return !!this.spec.protected; + public get returns(): OptionalValue { + return new OptionalValue(this.system, this.methodSpec.returns); } /** * Is this method an abstract method (this means the class will also be an abstract class) */ public get abstract(): boolean { - return !!this.spec.abstract; + return !!this.methodSpec.abstract; } /** - * Indicates whether this method is variadic or not. When ``true``, the last - * element of ``#parameters`` will also be flagged ``#variadic``. + * Is this method asyncrhonous (this means the return value is a promise) */ - public get variadic(): boolean { - return !!this.spec.variadic; + public get async(): boolean { + return !!this.methodSpec.async; } /** * Indicates if this is a static method. */ public get static(): boolean { - return !!this.spec.static; - } - - public get overrides(): Type | undefined { - if (!this.spec.overrides) { - return undefined; - } - - return this.system.findFqn(this.spec.overrides.fqn); - } - - public get docs(): Docs { - return new Docs(this.system, this, this.spec.docs || {}, this.parentType.docs); - } - - public isMethod(): this is Method { return true; } - public isProperty(): this is Property { return false; } - - /** - * Return the location in the module - */ - public get locationInModule(): SourceLocation | undefined { - return this.spec.locationInModule; - } - - /** - * Return the location in the repository - */ - public get locationInRepository(): SourceLocation | undefined { - return locationInRepository(this); + return !!this.methodSpec.static; } } diff --git a/packages/jsii-reflect/lib/optional-value.ts b/packages/jsii-reflect/lib/optional-value.ts new file mode 100644 index 0000000000..f495df58cb --- /dev/null +++ b/packages/jsii-reflect/lib/optional-value.ts @@ -0,0 +1,29 @@ +import jsii = require('jsii-spec'); +import { TypeReference } from './type-ref'; +import { TypeSystem } from './type-system'; + +export class OptionalValue { + public static describe(optionalValue: OptionalValue): string { + let description = optionalValue.type.toString(); + + if (optionalValue.optional && !optionalValue.type.isAny) { + description = `Optional<${description}>`; + } + + return description; + } + + constructor(public readonly system: TypeSystem, private readonly spec?: jsii.OptionalValue) { } + + public toString(): string { + return OptionalValue.describe(this); + } + + public get type(): TypeReference { + return new TypeReference(this.system, this.spec && this.spec.type); + } + + public get optional(): boolean { + return this.spec != null && !!this.spec.optional; + } +} diff --git a/packages/jsii-reflect/lib/parameter.ts b/packages/jsii-reflect/lib/parameter.ts index a45292c2a5..f2db08af11 100644 --- a/packages/jsii-reflect/lib/parameter.ts +++ b/packages/jsii-reflect/lib/parameter.ts @@ -1,40 +1,35 @@ import jsii = require('jsii-spec'); +import { Callable } from './callable'; import { Docs, Documentable } from './docs'; -import { Method } from './method'; +import { OptionalValue } from './optional-value'; import { Type } from './type'; -import { TypeReference } from './type-ref'; import { TypeSystem } from './type-system'; -export class Parameter implements Documentable { +export class Parameter extends OptionalValue implements Documentable { constructor( - public readonly system: TypeSystem, + system: TypeSystem, public readonly parentType: Type, - public readonly method: Method, - private readonly spec: jsii.Parameter) { } + public readonly method: Callable, + private readonly paramSpec: jsii.Parameter) { + super(system, paramSpec); + } /** * The name of the parameter. */ public get name(): string { - return this.spec.name; - } - - /** - * The type of the parameter. - */ - public get type(): TypeReference { - return new TypeReference(this.system, this.spec.type); + return this.paramSpec.name; } /** - * Whather this argument is the "rest" of a variadic signature. + * Whether this argument is the "rest" of a variadic signature. * The ``#type`` is that of every individual argument of the variadic list. */ public get variadic(): boolean { - return !!this.spec.variadic; + return !!this.paramSpec.variadic; } public get docs(): Docs { - return new Docs(this.system, this, this.spec.docs || {}); + return new Docs(this.system, this, this.paramSpec.docs || {}); } } diff --git a/packages/jsii-reflect/lib/property.ts b/packages/jsii-reflect/lib/property.ts index d8b22b4774..bdbdf5b9ca 100644 --- a/packages/jsii-reflect/lib/property.ts +++ b/packages/jsii-reflect/lib/property.ts @@ -1,21 +1,23 @@ import jsii = require('jsii-spec'); import { Assembly } from './assembly'; import { Docs, Documentable } from './docs'; +import { OptionalValue } from './optional-value'; import { Overridable } from './overridable'; import { locationInRepository, SourceLocatable, SourceLocation } from './source'; import { Type } from './type'; import { MemberKind, TypeMember } from './type-member'; -import { TypeReference } from './type-ref'; import { TypeSystem } from './type-system'; -export class Property implements Documentable, Overridable, TypeMember, SourceLocatable { +export class Property extends OptionalValue implements Documentable, Overridable, TypeMember, SourceLocatable { public readonly kind = MemberKind.Property; constructor( - public readonly system: TypeSystem, + system: TypeSystem, public readonly assembly: Assembly, public readonly parentType: Type, - private readonly spec: jsii.Property) { } + private readonly propSpec: jsii.Property) { + super(system, propSpec); + } public toString() { return `property:${this.parentType.fqn}.${this.name}`; @@ -25,42 +27,35 @@ export class Property implements Documentable, Overridable, TypeMember, SourceLo * The name of the property. */ public get name(): string { - return this.spec.name; - } - - /** - * The type of the property. - */ - public get type(): TypeReference { - return new TypeReference(this.system, this.spec.type); + return this.propSpec.name; } /** * Indicates if this property only has a getter (immutable). */ public get immutable(): boolean { - return !!this.spec.immutable; + return !!this.propSpec.immutable; } /** * Indicates if this property is protected (otherwise it is public) */ public get protected(): boolean { - return !!this.spec.protected; + return !!this.propSpec.protected; } /** * Indicates if this property is abstract */ public get abstract(): boolean { - return !!this.spec.abstract; + return !!this.propSpec.abstract; } /** * Indicates if this is a static property. */ public get static(): boolean { - return !!this.spec.static; + return !!this.propSpec.static; } /** @@ -69,26 +64,26 @@ export class Property implements Documentable, Overridable, TypeMember, SourceLo * Implies `static` and `immutable`. */ public get const(): boolean { - return !!this.spec.const; + return !!this.propSpec.const; } public get overrides(): Type | undefined { - if (!this.spec.overrides) { + if (!this.propSpec.overrides) { return undefined; } - return this.system.findFqn(this.spec.overrides.fqn); + return this.system.findFqn(this.propSpec.overrides); } public get docs(): Docs { - return new Docs(this.system, this, this.spec.docs || {}, this.parentType.docs); + return new Docs(this.system, this, this.propSpec.docs || {}, this.parentType.docs); } /** * Return the location in the module */ public get locationInModule(): SourceLocation | undefined { - return this.spec.locationInModule; + return this.propSpec.locationInModule; } /** @@ -97,4 +92,4 @@ export class Property implements Documentable, Overridable, TypeMember, SourceLo public get locationInRepository(): SourceLocation | undefined { return locationInRepository(this); } -} \ No newline at end of file +} diff --git a/packages/jsii-reflect/lib/source.ts b/packages/jsii-reflect/lib/source.ts index 689ce427c2..9cd86272cd 100644 --- a/packages/jsii-reflect/lib/source.ts +++ b/packages/jsii-reflect/lib/source.ts @@ -34,19 +34,18 @@ export interface SourceLocatable { * Return the repository location for the given API item */ export function locationInRepository(item: SourceLocatable): SourceLocation | undefined { - const assemblyLoc = item.assembly.locationInRepository; const moduleLoc = item.locationInModule; - - if (assemblyLoc && moduleLoc) { - if (assemblyLoc === '.') { return moduleLoc; } - - return { - filename: `${assemblyLoc}/${moduleLoc.filename}`, - line: moduleLoc.line, - }; + if (!moduleLoc) { + return undefined; } - return undefined; + const moduleDir = item.assembly.repository.directory; + if (!moduleDir) { return moduleLoc; } + + return { + filename: `${moduleDir}/${moduleLoc.filename}`, + line: moduleLoc.line, + }; } /** @@ -66,4 +65,4 @@ export function repositoryUrl(item: SourceLocatable, ref: string = 'master'): st const prefix = repo.url.substr(0, repo.url.length - 4); return `${prefix}/blob/${ref}/${loc.filename}#L${loc.line}`; -} \ No newline at end of file +} diff --git a/packages/jsii-reflect/lib/tree.ts b/packages/jsii-reflect/lib/tree.ts index 21424437cc..79134c98b3 100644 --- a/packages/jsii-reflect/lib/tree.ts +++ b/packages/jsii-reflect/lib/tree.ts @@ -4,11 +4,12 @@ import { Assembly } from './assembly'; import { ClassType } from './class'; import { Dependency } from './dependency'; import { EnumType } from './enum'; +import { Initializer } from './initializer'; import { InterfaceType } from './interface'; import { Method } from './method'; +import { OptionalValue } from './optional-value'; import { Parameter } from './parameter'; import { Property } from './property'; -import { TypeReference } from './type-ref'; import { TypeSystem } from './type-system'; export interface TypeSystemTreeOptions { @@ -81,7 +82,7 @@ export class TypeSystemTree extends AsciiTree { } } -export class AssemblyNode extends AsciiTree { +class AssemblyNode extends AsciiTree { constructor(assembly: Assembly, options: TypeSystemTreeOptions) { super(colors.green(assembly.name)); @@ -101,7 +102,7 @@ export class AssemblyNode extends AsciiTree { } } -export class MethodNode extends AsciiTree { +class MethodNode extends AsciiTree { constructor(method: Method, options: TypeSystemTreeOptions) { const args = method.parameters.map(p => p.name).join(','); super(`${method.name}(${args}) ${colors.gray('method')}`); @@ -129,23 +130,46 @@ export class MethodNode extends AsciiTree { params.add(...method.parameters.map(p => new ParameterNode(p, options))); } - this.add(new TypeReferenceNode('returns', method.returns)); + this.add(new OptionalValueNode('returns', method.returns, { asPromise: method.async })); } } } -export class ParameterNode extends AsciiTree { +class InitializerNode extends AsciiTree { + constructor(initializer: Initializer, options: TypeSystemTreeOptions) { + const args = initializer.parameters.map(p => p.name).join(','); + super(`${initializer.name}(${args}) ${colors.gray('initializer')}`); + + if (options.signatures) { + if (initializer.protected) { + this.add(new FlagNode('protected')); + } + + if (initializer.variadic) { + this.add(new FlagNode('variadic')); + } + + if (initializer.parameters.length > 0) { + const params = new TitleNode('parameters'); + this.add(params); + params.add(...initializer.parameters.map(p => new ParameterNode(p, options))); + } + } + } +} + +class ParameterNode extends AsciiTree { constructor(param: Parameter, _options: TypeSystemTreeOptions) { super(param.name); - this.add(new TypeReferenceNode('type', param.type)); + this.add(new OptionalValueNode('type', param)); if (param.variadic) { this.add(new FlagNode('variadic')); } } } -export class PropertyNode extends AsciiTree { +class PropertyNode extends AsciiTree { constructor(property: Property, options: TypeSystemTreeOptions) { super(`${property.name} ${colors.gray('property')}`); @@ -170,18 +194,22 @@ export class PropertyNode extends AsciiTree { this.add(new FlagNode('static')); } - this.add(new TypeReferenceNode('type', property.type)); + this.add(new OptionalValueNode('type', property)); } } } -export class TypeReferenceNode extends AsciiTree { - constructor(name: string, typeref: TypeReference) { - super(`${colors.underline(name)}: ${typeref}`); +class OptionalValueNode extends AsciiTree { + constructor(name: string, optionalValue: OptionalValue, { asPromise } = { asPromise: false }) { + let type = OptionalValue.describe(optionalValue); + if (asPromise) { + type = `Promise<${type}>`; + } + super(`${colors.underline(name)}: ${type}`); } } -export class ClassNode extends AsciiTree { +class ClassNode extends AsciiTree { constructor(type: ClassType, options: TypeSystemTreeOptions) { super(`${colors.gray('class')} ${colors.cyan(type.name)}`); @@ -197,7 +225,7 @@ export class ClassNode extends AsciiTree { const members = new TitleNode('members'); this.add(members); if (type.initializer) { - members.add(new MethodNode(type.initializer, options)); + members.add(new InitializerNode(type.initializer, options)); } members.add(...type.ownMethods.map(m => new MethodNode(m, options))); members.add(...type.ownProperties.map(p => new PropertyNode(p, options))); @@ -205,7 +233,7 @@ export class ClassNode extends AsciiTree { } } -export class InterfaceNode extends AsciiTree { +class InterfaceNode extends AsciiTree { constructor(type: InterfaceType, options: TypeSystemTreeOptions) { super(`${colors.gray('interface')} ${colors.cyan(type.name)}`); @@ -224,7 +252,7 @@ export class InterfaceNode extends AsciiTree { } } -export class EnumNode extends AsciiTree { +class EnumNode extends AsciiTree { constructor(enumType: EnumType, options: TypeSystemTreeOptions) { super(`${colors.gray('enum')} ${colors.cyan(enumType.name)}`); @@ -236,7 +264,7 @@ export class EnumNode extends AsciiTree { } } -export class DependencyNode extends AsciiTree { +class DependencyNode extends AsciiTree { constructor(dep: Dependency, _options: TypeSystemTreeOptions) { super(dep.assembly.name); } diff --git a/packages/jsii-reflect/lib/type-member.ts b/packages/jsii-reflect/lib/type-member.ts index 45c825defb..88fa084723 100644 --- a/packages/jsii-reflect/lib/type-member.ts +++ b/packages/jsii-reflect/lib/type-member.ts @@ -1,6 +1,7 @@ -import { Documentable } from "./docs"; -import { Method } from "./method"; -import { Property } from "./property"; +import { Documentable } from './docs'; +import { Initializer } from './initializer'; +import { Method } from './method'; +import { Property } from './property'; export interface TypeMember extends Documentable { name: string; @@ -11,8 +12,13 @@ export interface TypeMember extends Documentable { } export enum MemberKind { + Initializer = 'initializer', Method = 'method', - Property = 'property' + Property = 'property', +} + +export function isInitializer(x: TypeMember): x is Initializer { + return x.kind === MemberKind.Initializer; } export function isMethod(x: TypeMember): x is Method { @@ -21,4 +27,4 @@ export function isMethod(x: TypeMember): x is Method { export function isProperty(x: TypeMember): x is Property { return x.kind === MemberKind.Property; -} \ No newline at end of file +} diff --git a/packages/jsii-reflect/lib/type-ref.ts b/packages/jsii-reflect/lib/type-ref.ts index b8e9596de6..ae2a51872d 100644 --- a/packages/jsii-reflect/lib/type-ref.ts +++ b/packages/jsii-reflect/lib/type-ref.ts @@ -8,22 +8,14 @@ export class TypeReference { private readonly spec?: jsii.TypeReference) { } public toString(): string { - const self = this; + if (this.void) { return 'void'; } + if (this.primitive) { return this.primitive; } + if (this.fqn) { return this.fqn; } - function r(ret: string) { - if (self.optional) { ret += '?'; } - if (self.promise) { ret = `Promise<${ret}>`; } - return ret; - } - - if (this.void) { return r('void'); } - if (this.primitive) { return r(this.primitive); } - if (this.fqn) { return r(this.fqn); } - - if (this.arrayOfType) { return r(`Array<${this.arrayOfType}>`); } - if (this.mapOfType) { return r(`Map ${this.mapOfType}>`); } + if (this.arrayOfType) { return `Array<${this.arrayOfType}>`; } + if (this.mapOfType) { return `Map ${this.mapOfType}>`; } if (this.unionOfTypes) { - return r(this.unionOfTypes.map(x => x.toString()).join(' | ')); + return this.unionOfTypes.map(x => x.toString()).join(' | '); } throw new Error(`Invalid type reference`); @@ -88,20 +80,4 @@ export class TypeReference { return this.spec.union.types.map(t => new TypeReference(this.system, t)); } - - /** - * Indicates if this value is optional. - */ - public get optional(): boolean { - if (!this.spec) { return false; } - return !!this.spec.optional; - } - - /** - * Indicates if this type refers to a promise. - */ - public get promise(): boolean { - if (!this.spec) { return false; } - return !!this.spec.promise; - } -} \ No newline at end of file +} diff --git a/packages/jsii-reflect/package-lock.json b/packages/jsii-reflect/package-lock.json index c0f41b61ee..ef4515501b 100644 --- a/packages/jsii-reflect/package-lock.json +++ b/packages/jsii-reflect/package-lock.json @@ -1,6 +1,6 @@ { "name": "jsii-reflect", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -4260,9 +4260,9 @@ "dev": true }, "ts-jest": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.0.0.tgz", - "integrity": "sha512-o8BO3TkMREpAATaFTrXkovMsCpBl2z4NDBoLJuWZcJJj1ijI49UnvDMfVpj+iogn/Jl8Pbhuei5nc/Ti+frEHw==", + "version": "24.0.1", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.0.1.tgz", + "integrity": "sha512-mgNZmYPuGBNgYpUzchI7vdSr6zATQI0TrSyzREnXHuPCvlW8T1DQ/fdscgx4ivS5vAMUGUaoxGdWIVHC5I8imw==", "dev": true, "requires": { "bs-logger": "0.x", @@ -4318,9 +4318,9 @@ } }, "typescript": { - "version": "3.3.3333", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3333.tgz", - "integrity": "sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", "dev": true }, "uglify-js": { diff --git a/packages/jsii-reflect/package.json b/packages/jsii-reflect/package.json index 3dd098fbf7..51d2c22a34 100644 --- a/packages/jsii-reflect/package.json +++ b/packages/jsii-reflect/package.json @@ -29,8 +29,8 @@ "jsii": "^0.9.0", "jsii-build-tools": "^0.9.0", "jsii-calc": "^0.9.0", - "ts-jest": "^24.0.0", - "typescript": "^3.3.3333" + "ts-jest": "^24.0.1", + "typescript": "^3.4.2" }, "jest": { "preset": "ts-jest", diff --git a/packages/jsii-reflect/test/independent.test.ts b/packages/jsii-reflect/test/independent.test.ts index 6f78d6ef86..38ca1ad4df 100644 --- a/packages/jsii-reflect/test/independent.test.ts +++ b/packages/jsii-reflect/test/independent.test.ts @@ -1,4 +1,4 @@ -import { sourceToAssemblyHelper } from 'jsii'; +import { PackageInfo, sourceToAssemblyHelper } from 'jsii'; import reflect = require('../lib'); test('get full github source location for a class or method', async () => { @@ -9,9 +9,9 @@ test('get full github source location for a class or method', async () => { // Nothing to do } } - `.trim(), { - locationInRepository: 'some/sub/dir', - }); + `.trim(), + (obj) => obj.repository.directory = 'some/sub/dir' + ); // THEN const klass = assembly.findType('testpkg.Foo'); @@ -20,8 +20,8 @@ test('get full github source location for a class or method', async () => { expect(reflect.repositoryUrl(klass)).toBe('https://github.com/awslabs/jsii/blob/master/some/sub/dir/index.ts#L1'); }); -async function loadSource(source: string, jsiiConfig = {}): Promise { - const ass = await sourceToAssemblyHelper(source, jsiiConfig); +async function loadSource(source: string, cb: (obj: PackageInfo) => void): Promise { + const ass = await sourceToAssemblyHelper(source, cb); const ts = new reflect.TypeSystem(); return ts.addAssembly(new reflect.Assembly(ts, ass)); -} \ No newline at end of file +} diff --git a/packages/jsii-reflect/test/jsii-tree.test.all.expected.txt b/packages/jsii-reflect/test/jsii-tree.test.all.expected.txt index dea9290bcb..8cedbe8046 100644 --- a/packages/jsii-reflect/test/jsii-tree.test.all.expected.txt +++ b/packages/jsii-reflect/test/jsii-tree.test.all.expected.txt @@ -9,8 +9,7 @@ assemblies │ │ ├── base: AbstractClassBase │ │ ├── interfaces: IInterfaceImplementedByAbstractClass │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ abstractMethod(name) method │ │ │ ├── abstract │ │ │ ├─┬ parameters @@ -24,16 +23,14 @@ assemblies │ │ └── type: string │ ├─┬ class AbstractClassBase │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ abstractProperty property │ │ ├── abstract │ │ ├── immutable │ │ └── type: string │ ├─┬ class AbstractClassReturner │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ giveMeAbstract() method │ │ │ └── returns: jsii-calc.AbstractClass │ │ ├─┬ giveMeInterface() method @@ -44,13 +41,12 @@ assemblies │ ├─┬ class Add │ │ ├── base: BinaryOperation │ │ └─┬ members - │ │ ├─┬ (lhs,rhs) method - │ │ │ ├─┬ parameters - │ │ │ │ ├─┬ lhs - │ │ │ │ │ └── type: @scope/jsii-calc-lib.Value - │ │ │ │ └─┬ rhs - │ │ │ │ └── type: @scope/jsii-calc-lib.Value - │ │ │ └── returns: void + │ │ ├─┬ (lhs,rhs) initializer + │ │ │ └─┬ parameters + │ │ │ ├─┬ lhs + │ │ │ │ └── type: @scope/jsii-calc-lib.Value + │ │ │ └─┬ rhs + │ │ │ └── type: @scope/jsii-calc-lib.Value │ │ ├─┬ toString() method │ │ │ └── returns: string │ │ └─┬ value property @@ -58,8 +54,7 @@ assemblies │ │ └── type: number │ ├─┬ class AllTypes │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ anyIn(inp) method │ │ │ ├─┬ parameters │ │ │ │ └─┬ inp @@ -110,11 +105,10 @@ assemblies │ │ ├─┬ unknownProperty property │ │ │ └── type: any │ │ └─┬ optionalEnumValue property - │ │ └── type: jsii-calc.StringEnum? + │ │ └── type: Optional │ ├─┬ class AllowedMethodNames │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ getBar(_p1,_p2) method │ │ │ ├─┬ parameters │ │ │ │ ├─┬ _p1 @@ -145,8 +139,7 @@ assemblies │ │ └── returns: void │ ├─┬ class AsyncVirtualMethods │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ callMe() method │ │ │ └── returns: Promise │ │ ├─┬ callMe2() method @@ -164,8 +157,7 @@ assemblies │ │ └── returns: Promise │ ├─┬ class AugmentableClass │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ methodOne() method │ │ │ └── returns: void │ │ └─┬ methodTwo() method @@ -174,13 +166,12 @@ assemblies │ │ ├── base: Operation │ │ ├── interfaces: IFriendly │ │ └─┬ members - │ │ ├─┬ (lhs,rhs) method - │ │ │ ├─┬ parameters - │ │ │ │ ├─┬ lhs - │ │ │ │ │ └── type: @scope/jsii-calc-lib.Value - │ │ │ │ └─┬ rhs - │ │ │ │ └── type: @scope/jsii-calc-lib.Value - │ │ │ └── returns: void + │ │ ├─┬ (lhs,rhs) initializer + │ │ │ └─┬ parameters + │ │ │ ├─┬ lhs + │ │ │ │ └── type: @scope/jsii-calc-lib.Value + │ │ │ └─┬ rhs + │ │ │ └── type: @scope/jsii-calc-lib.Value │ │ ├─┬ hello() method │ │ │ └── returns: string │ │ ├─┬ lhs property @@ -192,11 +183,10 @@ assemblies │ ├─┬ class Calculator │ │ ├── base: CompositeOperation │ │ └─┬ members - │ │ ├─┬ (props) method - │ │ │ ├─┬ parameters - │ │ │ │ └─┬ props - │ │ │ │ └── type: jsii-calc.CalculatorProps? - │ │ │ └── returns: void + │ │ ├─┬ (props) initializer + │ │ │ └─┬ parameters + │ │ │ └─┬ props + │ │ │ └── type: Optional │ │ ├─┬ add(value) method │ │ │ ├─┬ parameters │ │ │ │ └─┬ value @@ -228,14 +218,13 @@ assemblies │ │ ├─┬ curr property │ │ │ └── type: @scope/jsii-calc-lib.Value │ │ ├─┬ maxValue property - │ │ │ └── type: number? + │ │ │ └── type: Optional │ │ └─┬ unionProperty property - │ │ └── type: jsii-calc.Add | jsii-calc.Multiply | jsii-calc.Power? + │ │ └── type: Optional │ ├─┬ class ClassThatImplementsTheInternalInterface │ │ ├── interfaces: INonInternalInterface │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ a property │ │ │ └── type: string │ │ ├─┬ b property @@ -247,8 +236,7 @@ assemblies │ ├─┬ class ClassThatImplementsThePrivateInterface │ │ ├── interfaces: INonInternalInterface │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ a property │ │ │ └── type: string │ │ ├─┬ b property @@ -259,8 +247,7 @@ assemblies │ │ └── type: string │ ├─┬ class ClassWithMutableObjectLiteralProperty │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ mutableObject property │ │ └── type: jsii-calc.IMutableObjectLiteral │ ├─┬ class ClassWithPrivateConstructorAndAutomaticProperties @@ -281,15 +268,13 @@ assemblies │ │ └── type: string │ ├─┬ class ConstructorPassesThisOut │ │ └─┬ members - │ │ └─┬ (consumer) method - │ │ ├─┬ parameters - │ │ │ └─┬ consumer - │ │ │ └── type: jsii-calc.PartiallyInitializedThisConsumer - │ │ └── returns: void + │ │ └─┬ (consumer) initializer + │ │ └─┬ parameters + │ │ └─┬ consumer + │ │ └── type: jsii-calc.PartiallyInitializedThisConsumer │ ├─┬ class Constructors │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ hiddenInterface() method │ │ │ ├── static │ │ │ └── returns: jsii-calc.IPublicInterface @@ -313,8 +298,7 @@ assemblies │ │ └── returns: Array │ ├─┬ class ConsumersOfThisCrazyTypeSystem │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ consumeAnotherPublicInterface(obj) method │ │ │ ├─┬ parameters │ │ │ │ └─┬ obj @@ -327,15 +311,14 @@ assemblies │ │ └── returns: any │ ├─┬ class DefaultedConstructorArgument │ │ └─┬ members - │ │ ├─┬ (arg1,arg2,arg3) method - │ │ │ ├─┬ parameters - │ │ │ │ ├─┬ arg1 - │ │ │ │ │ └── type: number? - │ │ │ │ ├─┬ arg2 - │ │ │ │ │ └── type: string? - │ │ │ │ └─┬ arg3 - │ │ │ │ └── type: date? - │ │ │ └── returns: void + │ │ ├─┬ (arg1,arg2,arg3) initializer + │ │ │ └─┬ parameters + │ │ │ ├─┬ arg1 + │ │ │ │ └── type: Optional + │ │ │ ├─┬ arg2 + │ │ │ │ └── type: Optional + │ │ │ └─┬ arg3 + │ │ │ └── type: Optional │ │ ├─┬ arg1 property │ │ │ ├── immutable │ │ │ └── type: number @@ -344,22 +327,19 @@ assemblies │ │ │ └── type: date │ │ └─┬ arg2 property │ │ ├── immutable - │ │ └── type: string? + │ │ └── type: Optional │ ├─┬ class Base │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ prop property │ │ └── type: string │ ├─┬ class Derived │ │ ├── base: Base │ │ └─┬ members - │ │ └─┬ () method - │ │ └── returns: void + │ │ └── () initializer │ ├─┬ class DoNotOverridePrivates │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ changePrivatePropertyValue(newValue) method │ │ │ ├─┬ parameters │ │ │ │ └─┬ newValue @@ -371,37 +351,34 @@ assemblies │ │ └── returns: string │ ├─┬ class DoNotRecognizeAnyAsOptional │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ method(_requiredAny,_optionalAny,_optionalString) method │ │ ├─┬ parameters │ │ │ ├─┬ _requiredAny │ │ │ │ └── type: any │ │ │ ├─┬ _optionalAny - │ │ │ │ └── type: any? + │ │ │ │ └── type: any │ │ │ └─┬ _optionalString - │ │ │ └── type: string? + │ │ │ └── type: Optional │ │ └── returns: void │ ├─┬ class DocumentedClass │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ greet(greetee) method │ │ │ ├─┬ parameters │ │ │ │ └─┬ greetee - │ │ │ │ └── type: jsii-calc.Greetee? + │ │ │ │ └── type: Optional │ │ │ └── returns: number │ │ └─┬ hola() method │ │ └── returns: void │ ├─┬ class DontComplainAboutVariadicAfterOptional │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ optionalAndVariadic(optional,things) method │ │ ├── variadic │ │ ├─┬ parameters │ │ │ ├─┬ optional - │ │ │ │ └── type: string? + │ │ │ │ └── type: Optional │ │ │ └─┬ things │ │ │ ├── type: string │ │ │ └── variadic @@ -409,16 +386,14 @@ assemblies │ ├─┬ class DoubleTrouble │ │ ├── interfaces: IFriendlyRandomGenerator │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ hello() method │ │ │ └── returns: string │ │ └─┬ next() method │ │ └── returns: number │ ├─┬ class EraseUndefinedHashValues │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ doesKeyExist(opts,key) method │ │ │ ├── static │ │ │ ├─┬ parameters @@ -435,18 +410,16 @@ assemblies │ │ └── returns: any │ ├─┬ class ExportedBaseClass │ │ └─┬ members - │ │ ├─┬ (success) method - │ │ │ ├─┬ parameters - │ │ │ │ └─┬ success - │ │ │ │ └── type: boolean - │ │ │ └── returns: void + │ │ ├─┬ (success) initializer + │ │ │ └─┬ parameters + │ │ │ └─┬ success + │ │ │ └── type: boolean │ │ └─┬ success property │ │ ├── immutable │ │ └── type: boolean │ ├─┬ class GiveMeStructs │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ derivedToFirst(derived) method │ │ │ ├─┬ parameters │ │ │ │ └─┬ derived @@ -467,8 +440,7 @@ assemblies │ │ └── type: @scope/jsii-calc-lib.StructWithOnlyOptionals │ ├─┬ class GreetingAugmenter │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ betterGreeting(friendly) method │ │ ├─┬ parameters │ │ │ └─┬ friendly @@ -476,50 +448,43 @@ assemblies │ │ └── returns: string │ ├─┬ class ImplementInternalInterface │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ prop property │ │ └── type: string │ ├─┬ class ImplementsInterfaceWithInternal │ │ ├── interfaces: IInterfaceWithInternal │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ visible() method │ │ └── returns: void │ ├─┬ class ImplementsInterfaceWithInternalSubclass │ │ ├── base: ImplementsInterfaceWithInternal │ │ └─┬ members - │ │ └─┬ () method - │ │ └── returns: void + │ │ └── () initializer │ ├─┬ class ImplementsPrivateInterface │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ private property │ │ └── type: string │ ├─┬ class InbetweenClass │ │ ├── base: PublicClass │ │ ├── interfaces: IPublicInterface2 │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ ciao() method │ │ └── returns: string │ ├─┬ class Foo │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ bar property - │ │ └── type: string? + │ │ └── type: Optional │ ├─┬ class JSII417Derived │ │ ├── base: JSII417PublicBaseOfBase │ │ └─┬ members - │ │ ├─┬ (property) method - │ │ │ ├─┬ parameters - │ │ │ │ └─┬ property - │ │ │ │ └── type: string - │ │ │ └── returns: void + │ │ ├─┬ (property) initializer + │ │ │ └─┬ parameters + │ │ │ └─┬ property + │ │ │ └── type: string │ │ ├─┬ bar() method │ │ │ └── returns: void │ │ ├─┬ baz() method @@ -530,8 +495,7 @@ assemblies │ │ └── type: string │ ├─┬ class JSII417PublicBaseOfBase │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ makeInstance() method │ │ │ ├── static │ │ │ └── returns: jsii-calc.JSII417PublicBaseOfBase @@ -542,30 +506,26 @@ assemblies │ │ └── type: boolean │ ├─┬ class JSObjectLiteralForInterface │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ giveMeFriendly() method │ │ │ └── returns: @scope/jsii-calc-lib.IFriendly │ │ └─┬ giveMeFriendlyGenerator() method │ │ └── returns: jsii-calc.IFriendlyRandomGenerator │ ├─┬ class JSObjectLiteralToNative │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ returnLiteral() method │ │ └── returns: jsii-calc.JSObjectLiteralToNativeClass │ ├─┬ class JSObjectLiteralToNativeClass │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ propA property │ │ │ └── type: string │ │ └─┬ propB property │ │ └── type: number │ ├─┬ class JavaReservedWords │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ abstract() method │ │ │ └── returns: void │ │ ├─┬ assert() method @@ -674,23 +634,21 @@ assemblies │ │ └── type: string │ ├─┬ class JsiiAgent │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ jsiiAgent property │ │ ├── immutable │ │ ├── static - │ │ └── type: string? + │ │ └── type: Optional │ ├─┬ class Multiply │ │ ├── base: BinaryOperation │ │ ├── interfaces: IFriendlier,IRandomNumberGenerator │ │ └─┬ members - │ │ ├─┬ (lhs,rhs) method - │ │ │ ├─┬ parameters - │ │ │ │ ├─┬ lhs - │ │ │ │ │ └── type: @scope/jsii-calc-lib.Value - │ │ │ │ └─┬ rhs - │ │ │ │ └── type: @scope/jsii-calc-lib.Value - │ │ │ └── returns: void + │ │ ├─┬ (lhs,rhs) initializer + │ │ │ └─┬ parameters + │ │ │ ├─┬ lhs + │ │ │ │ └── type: @scope/jsii-calc-lib.Value + │ │ │ └─┬ rhs + │ │ │ └── type: @scope/jsii-calc-lib.Value │ │ ├─┬ farewell() method │ │ │ └── returns: string │ │ ├─┬ goodbye() method @@ -706,11 +664,10 @@ assemblies │ │ ├── base: UnaryOperation │ │ ├── interfaces: IFriendlier │ │ └─┬ members - │ │ ├─┬ (operand) method - │ │ │ ├─┬ parameters - │ │ │ │ └─┬ operand - │ │ │ │ └── type: @scope/jsii-calc-lib.Value - │ │ │ └── returns: void + │ │ ├─┬ (operand) initializer + │ │ │ └─┬ parameters + │ │ │ └─┬ operand + │ │ │ └── type: @scope/jsii-calc-lib.Value │ │ ├─┬ farewell() method │ │ │ └── returns: string │ │ ├─┬ goodbye() method @@ -724,8 +681,7 @@ assemblies │ │ └── type: number │ ├─┬ class NodeStandardLibrary │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ cryptoSha256() method │ │ │ └── returns: string │ │ ├─┬ fsReadFile() method @@ -737,17 +693,16 @@ assemblies │ │ └── type: string │ ├─┬ class NullShouldBeTreatedAsUndefined │ │ └─┬ members - │ │ ├─┬ (_param1,optional) method - │ │ │ ├─┬ parameters - │ │ │ │ ├─┬ _param1 - │ │ │ │ │ └── type: string - │ │ │ │ └─┬ optional - │ │ │ │ └── type: any? - │ │ │ └── returns: void + │ │ ├─┬ (_param1,optional) initializer + │ │ │ └─┬ parameters + │ │ │ ├─┬ _param1 + │ │ │ │ └── type: string + │ │ │ └─┬ optional + │ │ │ └── type: any │ │ ├─┬ giveMeUndefined(value) method │ │ │ ├─┬ parameters │ │ │ │ └─┬ value - │ │ │ │ └── type: any? + │ │ │ │ └── type: any │ │ │ └── returns: void │ │ ├─┬ giveMeUndefinedInsideAnObject(input) method │ │ │ ├─┬ parameters @@ -757,14 +712,13 @@ assemblies │ │ ├─┬ verifyPropertyIsUndefined() method │ │ │ └── returns: void │ │ └─┬ changeMeToUndefined property - │ │ └── type: string? + │ │ └── type: Optional │ ├─┬ class NumberGenerator │ │ └─┬ members - │ │ ├─┬ (generator) method - │ │ │ ├─┬ parameters - │ │ │ │ └─┬ generator - │ │ │ │ └── type: jsii-calc.IRandomNumberGenerator - │ │ │ └── returns: void + │ │ ├─┬ (generator) initializer + │ │ │ └─┬ parameters + │ │ │ └─┬ generator + │ │ │ └── type: jsii-calc.IRandomNumberGenerator │ │ ├─┬ isSameGenerator(gen) method │ │ │ ├─┬ parameters │ │ │ │ └─┬ gen @@ -776,8 +730,7 @@ assemblies │ │ └── type: jsii-calc.IRandomNumberGenerator │ ├─┬ class ObjectRefsInCollections │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ sumFromArray(values) method │ │ │ ├─┬ parameters │ │ │ │ └─┬ values @@ -790,21 +743,19 @@ assemblies │ │ └── returns: number │ ├─┬ class Old │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ doAThing() method │ │ └── returns: void │ ├─┬ class OptionalConstructorArgument │ │ └─┬ members - │ │ ├─┬ (arg1,arg2,arg3) method - │ │ │ ├─┬ parameters - │ │ │ │ ├─┬ arg1 - │ │ │ │ │ └── type: number - │ │ │ │ ├─┬ arg2 - │ │ │ │ │ └── type: string - │ │ │ │ └─┬ arg3 - │ │ │ │ └── type: date? - │ │ │ └── returns: void + │ │ ├─┬ (arg1,arg2,arg3) initializer + │ │ │ └─┬ parameters + │ │ │ ├─┬ arg1 + │ │ │ │ └── type: number + │ │ │ ├─┬ arg2 + │ │ │ │ └── type: string + │ │ │ └─┬ arg3 + │ │ │ └── type: Optional │ │ ├─┬ arg1 property │ │ │ ├── immutable │ │ │ └── type: number @@ -813,24 +764,22 @@ assemblies │ │ │ └── type: string │ │ └─┬ arg3 property │ │ ├── immutable - │ │ └── type: date? + │ │ └── type: Optional │ ├─┬ class OptionalStructConsumer │ │ └─┬ members - │ │ ├─┬ (optionalStruct) method - │ │ │ ├─┬ parameters - │ │ │ │ └─┬ optionalStruct - │ │ │ │ └── type: jsii-calc.OptionalStruct? - │ │ │ └── returns: void + │ │ ├─┬ (optionalStruct) initializer + │ │ │ └─┬ parameters + │ │ │ └─┬ optionalStruct + │ │ │ └── type: Optional │ │ ├─┬ parameterWasUndefined property │ │ │ ├── immutable │ │ │ └── type: boolean │ │ └─┬ fieldValue property │ │ ├── immutable - │ │ └── type: string? + │ │ └── type: Optional │ ├─┬ class OverrideReturnsObject │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ test(obj) method │ │ ├─┬ parameters │ │ │ └─┬ obj @@ -838,8 +787,7 @@ assemblies │ │ └── returns: number │ ├─┬ class PartiallyInitializedThisConsumer │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ consumePartiallyInitializedThis(obj,dt,ev) method │ │ ├── abstract │ │ ├─┬ parameters @@ -852,8 +800,7 @@ assemblies │ │ └── returns: string │ ├─┬ class Polymorphism │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ sayHello(friendly) method │ │ ├─┬ parameters │ │ │ └─┬ friendly @@ -862,13 +809,12 @@ assemblies │ ├─┬ class Power │ │ ├── base: CompositeOperation │ │ └─┬ members - │ │ ├─┬ (base,pow) method - │ │ │ ├─┬ parameters - │ │ │ │ ├─┬ base - │ │ │ │ │ └── type: @scope/jsii-calc-lib.Value - │ │ │ │ └─┬ pow - │ │ │ │ └── type: @scope/jsii-calc-lib.Value - │ │ │ └── returns: void + │ │ ├─┬ (base,pow) initializer + │ │ │ └─┬ parameters + │ │ │ ├─┬ base + │ │ │ │ └── type: @scope/jsii-calc-lib.Value + │ │ │ └─┬ pow + │ │ │ └── type: @scope/jsii-calc-lib.Value │ │ ├─┬ base property │ │ │ ├── immutable │ │ │ └── type: @scope/jsii-calc-lib.Value @@ -880,14 +826,12 @@ assemblies │ │ └── type: @scope/jsii-calc-lib.Value │ ├─┬ class PublicClass │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ hello() method │ │ └── returns: void │ ├─┬ class PythonReservedWords │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ and() method │ │ │ └── returns: void │ │ ├─┬ as() method @@ -954,41 +898,38 @@ assemblies │ │ └── returns: void │ ├─┬ class ReferenceEnumFromScopedPackage │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ loadFoo() method - │ │ │ └── returns: @scope/jsii-calc-lib.EnumFromScopedModule? + │ │ │ └── returns: Optional<@scope/jsii-calc-lib.EnumFromScopedModule> │ │ ├─┬ saveFoo(value) method │ │ │ ├─┬ parameters │ │ │ │ └─┬ value │ │ │ │ └── type: @scope/jsii-calc-lib.EnumFromScopedModule │ │ │ └── returns: void │ │ └─┬ foo property - │ │ └── type: @scope/jsii-calc-lib.EnumFromScopedModule? + │ │ └── type: Optional<@scope/jsii-calc-lib.EnumFromScopedModule> │ ├─┬ class ReturnsPrivateImplementationOfInterface │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ privateImplementation property │ │ ├── immutable │ │ └── type: jsii-calc.IPrivatelyImplemented │ ├─┬ class RuntimeTypeChecking │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ methodWithDefaultedArguments(arg1,arg2,arg3) method │ │ │ ├─┬ parameters │ │ │ │ ├─┬ arg1 - │ │ │ │ │ └── type: number? + │ │ │ │ │ └── type: Optional │ │ │ │ ├─┬ arg2 - │ │ │ │ │ └── type: string? + │ │ │ │ │ └── type: Optional │ │ │ │ └─┬ arg3 - │ │ │ │ └── type: date? + │ │ │ │ └── type: Optional │ │ │ └── returns: void │ │ ├─┬ methodWithOptionalAnyArgument(arg) method │ │ │ ├─┬ parameters │ │ │ │ └─┬ arg - │ │ │ │ └── type: any? + │ │ │ │ └── type: any │ │ │ └── returns: void │ │ └─┬ methodWithOptionalArguments(arg1,arg2,arg3) method │ │ ├─┬ parameters @@ -997,23 +938,21 @@ assemblies │ │ │ ├─┬ arg2 │ │ │ │ └── type: string │ │ │ └─┬ arg3 - │ │ │ └── type: date? + │ │ │ └── type: Optional │ │ └── returns: void │ ├─┬ class SingleInstanceTwoTypes │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ interface1() method │ │ │ └── returns: jsii-calc.InbetweenClass │ │ └─┬ interface2() method │ │ └── returns: jsii-calc.IPublicInterface │ ├─┬ class Statics │ │ └─┬ members - │ │ ├─┬ (value) method - │ │ │ ├─┬ parameters - │ │ │ │ └─┬ value - │ │ │ │ └── type: string - │ │ │ └── returns: void + │ │ ├─┬ (value) initializer + │ │ │ └─┬ parameters + │ │ │ └─┬ value + │ │ │ └── type: string │ │ ├─┬ staticMethod(name) method │ │ │ ├── static │ │ │ ├─┬ parameters @@ -1053,15 +992,13 @@ assemblies │ │ └── type: string │ ├─┬ class StripInternal │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ youSeeMe property │ │ └── type: string │ ├─┬ class Sum │ │ ├── base: CompositeOperation │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ expression property │ │ │ ├── immutable │ │ │ └── type: @scope/jsii-calc-lib.Value @@ -1069,8 +1006,7 @@ assemblies │ │ └── type: Array<@scope/jsii-calc-lib.Value> │ ├─┬ class SyncVirtualMethods │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ callerIsAsync() method │ │ │ └── returns: Promise │ │ ├─┬ callerIsMethod() method @@ -1118,40 +1054,35 @@ assemblies │ │ └── type: string │ ├─┬ class Thrower │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ throwError() method │ │ └── returns: void │ ├─┬ class UnaryOperation │ │ ├── base: Operation │ │ └─┬ members - │ │ ├─┬ (operand) method - │ │ │ ├─┬ parameters - │ │ │ │ └─┬ operand - │ │ │ │ └── type: @scope/jsii-calc-lib.Value - │ │ │ └── returns: void + │ │ ├─┬ (operand) initializer + │ │ │ └─┬ parameters + │ │ │ └─┬ operand + │ │ │ └── type: @scope/jsii-calc-lib.Value │ │ └─┬ operand property │ │ ├── immutable │ │ └── type: @scope/jsii-calc-lib.Value │ ├─┬ class UseBundledDependency │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ value() method │ │ └── returns: any │ ├─┬ class UseCalcBase │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ hello() method │ │ └── returns: @scope/jsii-calc-base.Base │ ├─┬ class UsesInterfaceWithProperties │ │ └─┬ members - │ │ ├─┬ (obj) method - │ │ │ ├─┬ parameters - │ │ │ │ └─┬ obj - │ │ │ │ └── type: jsii-calc.IInterfaceWithProperties - │ │ │ └── returns: void + │ │ ├─┬ (obj) initializer + │ │ │ └─┬ parameters + │ │ │ └─┬ obj + │ │ │ └── type: jsii-calc.IInterfaceWithProperties │ │ ├─┬ justRead() method │ │ │ └── returns: string │ │ ├─┬ readStringAndNumber(ext) method @@ -1169,13 +1100,12 @@ assemblies │ │ └── type: jsii-calc.IInterfaceWithProperties │ ├─┬ class VariadicMethod │ │ └─┬ members - │ │ ├─┬ (prefix) method + │ │ ├─┬ (prefix) initializer │ │ │ ├── variadic - │ │ │ ├─┬ parameters - │ │ │ │ └─┬ prefix - │ │ │ │ ├── type: number - │ │ │ │ └── variadic - │ │ │ └── returns: void + │ │ │ └─┬ parameters + │ │ │ └─┬ prefix + │ │ │ ├── type: number + │ │ │ └── variadic │ │ └─┬ asArray(first,others) method │ │ ├── variadic │ │ ├─┬ parameters @@ -1187,8 +1117,7 @@ assemblies │ │ └── returns: Array │ ├─┬ class VirtualMethodPlayground │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ overrideMeAsync(index) method │ │ │ ├─┬ parameters │ │ │ │ └─┬ index @@ -1217,8 +1146,7 @@ assemblies │ ├─┬ class CompositeOperation │ │ ├── base: Operation │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ ├─┬ toString() method │ │ │ └── returns: string │ │ ├─┬ expression property @@ -1239,11 +1167,11 @@ assemblies │ │ ├─┬ initialValue property │ │ │ ├── abstract │ │ │ ├── immutable - │ │ │ └── type: number? + │ │ │ └── type: Optional │ │ └─┬ maximumValue property │ │ ├── abstract │ │ ├── immutable - │ │ └── type: number? + │ │ └── type: Optional │ ├─┬ interface DerivedStruct │ │ ├─┬ interfaces │ │ │ └── MyFirstStruct @@ -1263,25 +1191,25 @@ assemblies │ │ ├─┬ anotherOptional property │ │ │ ├── abstract │ │ │ ├── immutable - │ │ │ └── type: Map @scope/jsii-calc-lib.Value>? + │ │ │ └── type: Optional @scope/jsii-calc-lib.Value>> │ │ ├─┬ optionalAny property │ │ │ ├── abstract │ │ │ ├── immutable - │ │ │ └── type: any? + │ │ │ └── type: any │ │ └─┬ optionalArray property │ │ ├── abstract │ │ ├── immutable - │ │ └── type: Array? + │ │ └── type: Optional> │ ├─┬ interface EraseUndefinedHashValuesOptions │ │ └─┬ members │ │ ├─┬ option1 property │ │ │ ├── abstract │ │ │ ├── immutable - │ │ │ └── type: string? + │ │ │ └── type: Optional │ │ └─┬ option2 property │ │ ├── abstract │ │ ├── immutable - │ │ └── type: string? + │ │ └── type: Optional │ ├─┬ interface ExtendsInternalInterface │ │ └─┬ members │ │ ├─┬ boom property @@ -1297,7 +1225,7 @@ assemblies │ │ └─┬ name property │ │ ├── abstract │ │ ├── immutable - │ │ └── type: string? + │ │ └── type: Optional │ ├─┬ interface IAnotherPublicInterface │ │ └─┬ members │ │ └─┬ a property @@ -1363,7 +1291,7 @@ assemblies │ │ │ ├─┬ arg1 │ │ │ │ └── type: string │ │ │ └─┬ arg2 - │ │ │ └── type: number? + │ │ │ └── type: Optional │ │ └── returns: void │ ├─┬ interface IInterfaceWithProperties │ │ └─┬ members @@ -1474,23 +1402,23 @@ assemblies │ │ ├─┬ containerPort property │ │ │ ├── abstract │ │ │ ├── immutable - │ │ │ └── type: number? + │ │ │ └── type: Optional │ │ ├─┬ cpu property │ │ │ ├── abstract │ │ │ ├── immutable - │ │ │ └── type: string? + │ │ │ └── type: Optional │ │ ├─┬ memoryMiB property │ │ │ ├── abstract │ │ │ ├── immutable - │ │ │ └── type: string? + │ │ │ └── type: Optional │ │ ├─┬ publicLoadBalancer property │ │ │ ├── abstract │ │ │ ├── immutable - │ │ │ └── type: boolean? + │ │ │ └── type: Optional │ │ └─┬ publicTasks property │ │ ├── abstract │ │ ├── immutable - │ │ └── type: boolean? + │ │ └── type: Optional │ ├─┬ interface NullShouldBeTreatedAsUndefinedData │ │ └─┬ members │ │ ├─┬ arrayWithThreeElementsAndUndefinedAsSecondArgument property @@ -1500,13 +1428,13 @@ assemblies │ │ └─┬ thisShouldBeUndefined property │ │ ├── abstract │ │ ├── immutable - │ │ └── type: any? + │ │ └── type: any │ ├─┬ interface OptionalStruct │ │ └─┬ members │ │ └─┬ field property │ │ ├── abstract │ │ ├── immutable - │ │ └── type: string? + │ │ └── type: Optional │ ├─┬ interface UnionProperties │ │ └─┬ members │ │ ├─┬ bar property @@ -1516,7 +1444,7 @@ assemblies │ │ └─┬ foo property │ │ ├── abstract │ │ ├── immutable - │ │ └── type: string | number? + │ │ └── type: Optional │ ├─┬ enum AllTypesEnum │ │ ├── MyEnumValue │ │ ├── YourEnumValue @@ -1534,8 +1462,7 @@ assemblies │ └─┬ types │ ├─┬ class Base │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ typeName() method │ │ └── returns: any │ └─┬ interface BaseProps @@ -1550,8 +1477,7 @@ assemblies │ └─┬ types │ ├─┬ class Very │ │ └─┬ members - │ │ ├─┬ () method - │ │ │ └── returns: void + │ │ ├── () initializer │ │ └─┬ hey() method │ │ └── returns: number │ └─┬ interface VeryBaseProps @@ -1568,11 +1494,10 @@ assemblies │ ├── base: Value │ ├── interfaces: IDoublable │ └─┬ members - │ ├─┬ (value) method - │ │ ├─┬ parameters - │ │ │ └─┬ value - │ │ │ └── type: number - │ │ └── returns: void + │ ├─┬ (value) initializer + │ │ └─┬ parameters + │ │ └─┬ value + │ │ └── type: number │ ├─┬ doubleValue property │ │ ├── immutable │ │ └── type: number @@ -1582,16 +1507,14 @@ assemblies ├─┬ class Operation │ ├── base: Value │ └─┬ members - │ ├─┬ () method - │ │ └── returns: void + │ ├── () initializer │ └─┬ toString() method │ ├── abstract │ └── returns: string ├─┬ class Value │ ├── base: Base │ └─┬ members - │ ├─┬ () method - │ │ └── returns: void + │ ├── () initializer │ ├─┬ toString() method │ │ └── returns: string │ └─┬ value property @@ -1622,21 +1545,21 @@ assemblies │ └─┬ firstOptional property │ ├── abstract │ ├── immutable - │ └── type: Array? + │ └── type: Optional> ├─┬ interface StructWithOnlyOptionals │ └─┬ members │ ├─┬ optional1 property │ │ ├── abstract │ │ ├── immutable - │ │ └── type: string? + │ │ └── type: Optional │ ├─┬ optional2 property │ │ ├── abstract │ │ ├── immutable - │ │ └── type: number? + │ │ └── type: Optional │ └─┬ optional3 property │ ├── abstract │ ├── immutable - │ └── type: boolean? + │ └── type: Optional └─┬ enum EnumFromScopedModule ├── Value1 └── Value2 diff --git a/packages/jsii-reflect/test/jsii-tree.test.members.expected.txt b/packages/jsii-reflect/test/jsii-tree.test.members.expected.txt index 230b56b875..38662401b8 100644 --- a/packages/jsii-reflect/test/jsii-tree.test.members.expected.txt +++ b/packages/jsii-reflect/test/jsii-tree.test.members.expected.txt @@ -3,28 +3,28 @@ assemblies │ └─┬ types │ ├─┬ class AbstractClass │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── abstractMethod(name) method │ │ ├── nonAbstractMethod() method │ │ └── propFromInterface property │ ├─┬ class AbstractClassBase │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── abstractProperty property │ ├─┬ class AbstractClassReturner │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── giveMeAbstract() method │ │ ├── giveMeInterface() method │ │ └── returnAbstractFromProperty property │ ├─┬ class Add │ │ └─┬ members - │ │ ├── (lhs,rhs) method + │ │ ├── (lhs,rhs) initializer │ │ ├── toString() method │ │ └── value property │ ├─┬ class AllTypes │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── anyIn(inp) method │ │ ├── anyOut() method │ │ ├── enumMethod(value) method @@ -49,14 +49,14 @@ assemblies │ │ └── optionalEnumValue property │ ├─┬ class AllowedMethodNames │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── getBar(_p1,_p2) method │ │ ├── getFoo(withParam) method │ │ ├── setBar(_x,_y,_z) method │ │ └── setFoo(_x,_y) method │ ├─┬ class AsyncVirtualMethods │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── callMe() method │ │ ├── callMe2() method │ │ ├── callMeDoublePromise() method @@ -65,18 +65,18 @@ assemblies │ │ └── overrideMeToo() method │ ├─┬ class AugmentableClass │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── methodOne() method │ │ └── methodTwo() method │ ├─┬ class BinaryOperation │ │ └─┬ members - │ │ ├── (lhs,rhs) method + │ │ ├── (lhs,rhs) initializer │ │ ├── hello() method │ │ ├── lhs property │ │ └── rhs property │ ├─┬ class Calculator │ │ └─┬ members - │ │ ├── (props) method + │ │ ├── (props) initializer │ │ ├── add(value) method │ │ ├── mul(value) method │ │ ├── neg() method @@ -90,21 +90,21 @@ assemblies │ │ └── unionProperty property │ ├─┬ class ClassThatImplementsTheInternalInterface │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── a property │ │ ├── b property │ │ ├── c property │ │ └── d property │ ├─┬ class ClassThatImplementsThePrivateInterface │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── a property │ │ ├── b property │ │ ├── c property │ │ └── e property │ ├─┬ class ClassWithMutableObjectLiteralProperty │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── mutableObject property │ ├─┬ class ClassWithPrivateConstructorAndAutomaticProperties │ │ └─┬ members @@ -113,10 +113,10 @@ assemblies │ │ └── readWriteString property │ ├─┬ class ConstructorPassesThisOut │ │ └─┬ members - │ │ └── (consumer) method + │ │ └── (consumer) initializer │ ├─┬ class Constructors │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── hiddenInterface() method │ │ ├── hiddenInterfaces() method │ │ ├── hiddenSubInterfaces() method @@ -126,119 +126,119 @@ assemblies │ │ └── makeInterfaces() method │ ├─┬ class ConsumersOfThisCrazyTypeSystem │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── consumeAnotherPublicInterface(obj) method │ │ └── consumeNonInternalInterface(obj) method │ ├─┬ class DefaultedConstructorArgument │ │ └─┬ members - │ │ ├── (arg1,arg2,arg3) method + │ │ ├── (arg1,arg2,arg3) initializer │ │ ├── arg1 property │ │ ├── arg3 property │ │ └── arg2 property │ ├─┬ class Base │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── prop property │ ├─┬ class Derived │ │ └─┬ members - │ │ └── () method + │ │ └── () initializer │ ├─┬ class DoNotOverridePrivates │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── changePrivatePropertyValue(newValue) method │ │ ├── privateMethodValue() method │ │ └── privatePropertyValue() method │ ├─┬ class DoNotRecognizeAnyAsOptional │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── method(_requiredAny,_optionalAny,_optionalString) method │ ├─┬ class DocumentedClass │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── greet(greetee) method │ │ └── hola() method │ ├─┬ class DontComplainAboutVariadicAfterOptional │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── optionalAndVariadic(optional,things) method │ ├─┬ class DoubleTrouble │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── hello() method │ │ └── next() method │ ├─┬ class EraseUndefinedHashValues │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── doesKeyExist(opts,key) method │ │ ├── prop1IsNull() method │ │ └── prop2IsUndefined() method │ ├─┬ class ExportedBaseClass │ │ └─┬ members - │ │ ├── (success) method + │ │ ├── (success) initializer │ │ └── success property │ ├─┬ class GiveMeStructs │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── derivedToFirst(derived) method │ │ ├── readDerivedNonPrimitive(derived) method │ │ ├── readFirstNumber(first) method │ │ └── structLiteral property │ ├─┬ class GreetingAugmenter │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── betterGreeting(friendly) method │ ├─┬ class ImplementInternalInterface │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── prop property │ ├─┬ class ImplementsInterfaceWithInternal │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── visible() method │ ├─┬ class ImplementsInterfaceWithInternalSubclass │ │ └─┬ members - │ │ └── () method + │ │ └── () initializer │ ├─┬ class ImplementsPrivateInterface │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── private property │ ├─┬ class InbetweenClass │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── ciao() method │ ├─┬ class Foo │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── bar property │ ├─┬ class JSII417Derived │ │ └─┬ members - │ │ ├── (property) method + │ │ ├── (property) initializer │ │ ├── bar() method │ │ ├── baz() method │ │ └── property property │ ├─┬ class JSII417PublicBaseOfBase │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── makeInstance() method │ │ ├── foo() method │ │ └── hasRoot property │ ├─┬ class JSObjectLiteralForInterface │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── giveMeFriendly() method │ │ └── giveMeFriendlyGenerator() method │ ├─┬ class JSObjectLiteralToNative │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── returnLiteral() method │ ├─┬ class JSObjectLiteralToNativeClass │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── propA property │ │ └── propB property │ ├─┬ class JavaReservedWords │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── abstract() method │ │ ├── assert() method │ │ ├── boolean() method @@ -294,11 +294,11 @@ assemblies │ │ └── while property │ ├─┬ class JsiiAgent │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── jsiiAgent property │ ├─┬ class Multiply │ │ └─┬ members - │ │ ├── (lhs,rhs) method + │ │ ├── (lhs,rhs) initializer │ │ ├── farewell() method │ │ ├── goodbye() method │ │ ├── next() method @@ -306,7 +306,7 @@ assemblies │ │ └── value property │ ├─┬ class Negate │ │ └─┬ members - │ │ ├── (operand) method + │ │ ├── (operand) initializer │ │ ├── farewell() method │ │ ├── goodbye() method │ │ ├── hello() method @@ -314,69 +314,69 @@ assemblies │ │ └── value property │ ├─┬ class NodeStandardLibrary │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── cryptoSha256() method │ │ ├── fsReadFile() method │ │ ├── fsReadFileSync() method │ │ └── osPlatform property │ ├─┬ class NullShouldBeTreatedAsUndefined │ │ └─┬ members - │ │ ├── (_param1,optional) method + │ │ ├── (_param1,optional) initializer │ │ ├── giveMeUndefined(value) method │ │ ├── giveMeUndefinedInsideAnObject(input) method │ │ ├── verifyPropertyIsUndefined() method │ │ └── changeMeToUndefined property │ ├─┬ class NumberGenerator │ │ └─┬ members - │ │ ├── (generator) method + │ │ ├── (generator) initializer │ │ ├── isSameGenerator(gen) method │ │ ├── nextTimes100() method │ │ └── generator property │ ├─┬ class ObjectRefsInCollections │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── sumFromArray(values) method │ │ └── sumFromMap(values) method │ ├─┬ class Old │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── doAThing() method │ ├─┬ class OptionalConstructorArgument │ │ └─┬ members - │ │ ├── (arg1,arg2,arg3) method + │ │ ├── (arg1,arg2,arg3) initializer │ │ ├── arg1 property │ │ ├── arg2 property │ │ └── arg3 property │ ├─┬ class OptionalStructConsumer │ │ └─┬ members - │ │ ├── (optionalStruct) method + │ │ ├── (optionalStruct) initializer │ │ ├── parameterWasUndefined property │ │ └── fieldValue property │ ├─┬ class OverrideReturnsObject │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── test(obj) method │ ├─┬ class PartiallyInitializedThisConsumer │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── consumePartiallyInitializedThis(obj,dt,ev) method │ ├─┬ class Polymorphism │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── sayHello(friendly) method │ ├─┬ class Power │ │ └─┬ members - │ │ ├── (base,pow) method + │ │ ├── (base,pow) initializer │ │ ├── base property │ │ ├── expression property │ │ └── pow property │ ├─┬ class PublicClass │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── hello() method │ ├─┬ class PythonReservedWords │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── and() method │ │ ├── as() method │ │ ├── assert() method @@ -411,28 +411,28 @@ assemblies │ │ └── yield() method │ ├─┬ class ReferenceEnumFromScopedPackage │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── loadFoo() method │ │ ├── saveFoo(value) method │ │ └── foo property │ ├─┬ class ReturnsPrivateImplementationOfInterface │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── privateImplementation property │ ├─┬ class RuntimeTypeChecking │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── methodWithDefaultedArguments(arg1,arg2,arg3) method │ │ ├── methodWithOptionalAnyArgument(arg) method │ │ └── methodWithOptionalArguments(arg1,arg2,arg3) method │ ├─┬ class SingleInstanceTwoTypes │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── interface1() method │ │ └── interface2() method │ ├─┬ class Statics │ │ └─┬ members - │ │ ├── (value) method + │ │ ├── (value) initializer │ │ ├── staticMethod(name) method │ │ ├── justMethod() method │ │ ├── BAR property @@ -444,16 +444,16 @@ assemblies │ │ └── value property │ ├─┬ class StripInternal │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── youSeeMe property │ ├─┬ class Sum │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── expression property │ │ └── parts property │ ├─┬ class SyncVirtualMethods │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── callerIsAsync() method │ │ ├── callerIsMethod() method │ │ ├── modifyOtherProperty(value) method @@ -472,34 +472,34 @@ assemblies │ │ └── valueOfOtherProperty property │ ├─┬ class Thrower │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── throwError() method │ ├─┬ class UnaryOperation │ │ └─┬ members - │ │ ├── (operand) method + │ │ ├── (operand) initializer │ │ └── operand property │ ├─┬ class UseBundledDependency │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── value() method │ ├─┬ class UseCalcBase │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── hello() method │ ├─┬ class UsesInterfaceWithProperties │ │ └─┬ members - │ │ ├── (obj) method + │ │ ├── (obj) initializer │ │ ├── justRead() method │ │ ├── readStringAndNumber(ext) method │ │ ├── writeAndRead(value) method │ │ └── obj property │ ├─┬ class VariadicMethod │ │ └─┬ members - │ │ ├── (prefix) method + │ │ ├── (prefix) initializer │ │ └── asArray(first,others) method │ ├─┬ class VirtualMethodPlayground │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── overrideMeAsync(index) method │ │ ├── overrideMeSync(index) method │ │ ├── parallelSumAsync(count) method @@ -507,7 +507,7 @@ assemblies │ │ └── sumSync(count) method │ ├─┬ class CompositeOperation │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ ├── toString() method │ │ ├── expression property │ │ ├── value property @@ -647,7 +647,7 @@ assemblies │ └─┬ types │ ├─┬ class Base │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── typeName() method │ └─┬ interface BaseProps │ └─┬ members @@ -656,7 +656,7 @@ assemblies │ └─┬ types │ ├─┬ class Very │ │ └─┬ members - │ │ ├── () method + │ │ ├── () initializer │ │ └── hey() method │ └─┬ interface VeryBaseProps │ └─┬ members @@ -665,16 +665,16 @@ assemblies └─┬ types ├─┬ class Number │ └─┬ members - │ ├── (value) method + │ ├── (value) initializer │ ├── doubleValue property │ └── value property ├─┬ class Operation │ └─┬ members - │ ├── () method + │ ├── () initializer │ └── toString() method ├─┬ class Value │ └─┬ members - │ ├── () method + │ ├── () initializer │ ├── toString() method │ └── value property ├─┬ interface IDoublable diff --git a/packages/jsii-reflect/test/jsii-tree.test.ts b/packages/jsii-reflect/test/jsii-tree.test.ts index 7b43f00836..072c781177 100644 --- a/packages/jsii-reflect/test/jsii-tree.test.ts +++ b/packages/jsii-reflect/test/jsii-tree.test.ts @@ -18,7 +18,7 @@ test('jsii-tree', async () => { `); }); -test(`jsii-tree -all`, async () => { +test(`jsii-tree --all`, async () => { await jsiiTreeTest('jsii-tree.test.all.expected.txt', '--all'); }); diff --git a/packages/jsii-reflect/tsconfig.json b/packages/jsii-reflect/tsconfig.json index abb6788fba..93aa672ae0 100644 --- a/packages/jsii-reflect/tsconfig.json +++ b/packages/jsii-reflect/tsconfig.json @@ -22,6 +22,13 @@ "resolveJsonModule": true, "strict": true, "strictNullChecks": true, - "target": "ES2018" - } + "target": "ES2018", + "composite": true + }, + "include": ["**/*.ts"], + "references": [ + { "path": "../jsii" }, + { "path": "../jsii-spec" }, + { "path": "../oo-ascii-tree" } + ] } diff --git a/packages/jsii-ruby-runtime/package-lock.json b/packages/jsii-ruby-runtime/package-lock.json index a60de87925..59419f1217 100644 --- a/packages/jsii-ruby-runtime/package-lock.json +++ b/packages/jsii-ruby-runtime/package-lock.json @@ -1,6 +1,6 @@ { "name": "jsii-ruby-runtime", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -11,9 +11,9 @@ "dev": true }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", "dev": true } } diff --git a/packages/jsii-ruby-runtime/package.json b/packages/jsii-ruby-runtime/package.json index 46ad5980d9..7e92a8d19a 100644 --- a/packages/jsii-ruby-runtime/package.json +++ b/packages/jsii-ruby-runtime/package.json @@ -19,7 +19,7 @@ "jsii-calc": "^0.9.0", "jsii-pacmak": "^0.9.0", "jsii-runtime": "^0.9.0", - "typescript": "^3.2.4" + "typescript": "^3.4.2" }, "author": { "name": "Amazon Web Services", diff --git a/packages/jsii-runtime/lib/host.ts b/packages/jsii-runtime/lib/host.ts index 77a0b8a526..0f64ec06ae 100644 --- a/packages/jsii-runtime/lib/host.ts +++ b/packages/jsii-runtime/lib/host.ts @@ -1,5 +1,5 @@ -import { Kernel, api } from 'jsii-kernel' -import { InputOutput, Input } from './in-out'; +import { api, Kernel } from 'jsii-kernel'; +import { Input, InputOutput } from './in-out'; export class KernelHost { private kernel = new Kernel(cb => this.callbackHandler(cb)); @@ -8,6 +8,15 @@ export class KernelHost { this.kernel.traceEnabled = opts.debug ? true : false; } + public run() { + const req = this.inout.read(); + if (!req) { + return; // done + } + + this.processRequest(req, () => this.run()); + } + private callbackHandler(callback: api.Callback) { // write a "callback" response, which is a special response that tells @@ -38,28 +47,19 @@ export class KernelHost { // otherwise, process the request normally, but continue to wait for // our callback to be completed. sync=true to enforce that `completeCallback` - // will be called synchronously and return value will be chained back so we can + // will be called synchronously and return value will be chained back so we can // return it to the callback handler. return self.processRequest(req, completeCallback, /* sync */ true); } } - run() { - const req = this.inout.read(); - if (!req) { - return; // done - } - - this.processRequest(req, () => this.run()); - } - /** * Processes the input request `req` and writes the output response to * stdout. This method invokes `next` when the request was fully processed. * This either happens synchronously or asynchronously depending on the api * (e.g. the "end" api will wait for an async promise to be fulfilled before * it writes the response) - * + * * @param req The input request * @param next A callback to invoke to continue * @param sync If this is 'true', "next" must be called synchronously. This means @@ -67,7 +67,7 @@ export class KernelHost { * doesn't allow any async operations during a sync callback, so this shouldn't * happen, so we assert in this case to find bugs. */ - private processRequest(req: Input, next: Function, sync = false) { + private processRequest(req: Input, next: () => void, sync = false) { if ('callback' in req) { throw new Error('Unexpected `callback` result. This request should have been processed by a callback handler'); } @@ -109,11 +109,11 @@ export class KernelHost { this.debug('waiting for promise to be fulfilled'); - const promise = ret as Promise; + const promise = ret; promise - .then(ret => { - this.debug('promise succeeded:', ret); - this.writeOkay(ret); + .then(val => { + this.debug('promise succeeded:', val); + this.writeOkay(val); next(); }) .catch(e => { @@ -126,8 +126,7 @@ export class KernelHost { } this.writeOkay(ret); - } - catch (e) { + } catch (e) { this.writeError(e); } @@ -163,23 +162,26 @@ export class KernelHost { /** * Returns true if the value is a promise. */ - private isPromise(v: any) { + private isPromise(v: any): v is Promise { return v && v.then && typeof(v.then) === 'function'; } /** * Given a kernel api name, returns the function to invoke. */ - private findApi(api: string): Function { - const fn = (this.kernel as any)[api]; + private findApi(apiName: string): (this: Kernel, arg: Input) => any { + const fn = (this.kernel as any)[apiName]; if (typeof fn !== 'function') { - throw new Error('Invalid kernel api call: ' + api); + throw new Error('Invalid kernel api call: ' + apiName); } return fn; } private debug(...args: any[]) { - if (!this.opts.debug) return; + if (!this.opts.debug) { + return; + } + // tslint:disable-next-line: no-console console.error(...args); } } diff --git a/packages/jsii-runtime/lib/program.ts b/packages/jsii-runtime/lib/program.ts index e3220973be..3412754bba 100644 --- a/packages/jsii-runtime/lib/program.ts +++ b/packages/jsii-runtime/lib/program.ts @@ -1,8 +1,9 @@ -import { KernelHost } from './host' -import { InputOutput } from './in-out' +import packageInfo = require('../package.json'); +import { KernelHost } from './host'; +import { InputOutput } from './in-out'; -const name = require('../package.json').name; -const version = require('../package.json').version; +const name = packageInfo.name; +const version = packageInfo.version; const noStack = !!process.env.JSII_NOSTACK; const debug = !!process.env.JSII_DEBUG; diff --git a/packages/jsii-runtime/package-lock.json b/packages/jsii-runtime/package-lock.json index 7e1ccf31da..46e2ed87cc 100644 --- a/packages/jsii-runtime/package-lock.json +++ b/packages/jsii-runtime/package-lock.json @@ -1,6 +1,6 @@ { "name": "jsii-runtime", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -5772,9 +5772,9 @@ "dev": true }, "typescript": { - "version": "3.3.3333", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3333.tgz", - "integrity": "sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", "dev": true }, "unicode-length": { diff --git a/packages/jsii-runtime/package.json b/packages/jsii-runtime/package.json index e8048e81ee..a8dab98468 100644 --- a/packages/jsii-runtime/package.json +++ b/packages/jsii-runtime/package.json @@ -21,7 +21,7 @@ "jsii-calc": "^0.9.0", "nodeunit": "^0.11.3", "source-map-loader": "^0.2.4", - "typescript": "^3.3.3333", + "typescript": "^3.4.2", "wasm-loader": "^1.3.0", "webpack": "^4.29.5", "webpack-cli": "^3.2.3" diff --git a/packages/jsii-runtime/tsconfig.json b/packages/jsii-runtime/tsconfig.json index 6f8f29cf64..95241d374b 100644 --- a/packages/jsii-runtime/tsconfig.json +++ b/packages/jsii-runtime/tsconfig.json @@ -4,6 +4,7 @@ "target": "ES2018", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ "lib": ["es2016", "es2017.object", "es2017.string"], /* Specify library files to be included in the compilation: */ + "resolveJsonModule": true, /* Include modules imported with .json extension. */ // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ @@ -44,8 +45,8 @@ /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": false, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": false, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ /* Experimental Options */ "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */ diff --git a/packages/jsii-spec/lib/spec.ts b/packages/jsii-spec/lib/spec.ts index 5245d82657..ca1744acc8 100644 --- a/packages/jsii-spec/lib/spec.ts +++ b/packages/jsii-spec/lib/spec.ts @@ -7,10 +7,11 @@ export interface Assembly extends Documentable { /** * The version of the spec schema */ - schema: SchemaVersion.V1_0; + schema: SchemaVersion.LATEST; /** * The name of the assembly + * * @minLength 1 */ name: string; @@ -40,6 +41,14 @@ export interface Assembly extends Documentable { * The URL of the repository. */ url: string; + + /** + * If the package is not in the root directory (for example, when part + * of a monorepo), you should specify the directory in which it lives. + * + * @default the root of the repository + */ + directory?: string; }; /** @@ -49,11 +58,15 @@ export interface Assembly extends Documentable { /** * Additional contributors to this package. + * + * @default none */ contributors?: Person[]; /** - * A fingerprint that can be used to determine if the specification has changed. + * A fingerprint that can be used to determine if the specification has + * changed. + * * @minLength 1 */ fingerprint: string; @@ -76,48 +89,56 @@ export interface Assembly extends Documentable { license: string; /** - * A map of target name to configuration, which is used when generating packages for - * various languages. + * A map of target name to configuration, which is used when generating + * packages for various languages. + * + * @default none */ targets?: AssemblyTargets; /** - * Dependencies on other assemblies (with semver), the key is the JSII assembly name. + * Dependencies on other assemblies (with semver), the key is the JSII + * assembly name. + * + * @default none */ dependencies?: { [assembly: string]: PackageVersion }; /** - * List if bundled dependencies (these are not expected to be jsii assemblies). + * List if bundled dependencies (these are not expected to be jsii + * assemblies). + * + * @default none */ bundled?: { [module: string]: string }; /** * All types in the assembly, keyed by their fully-qualified-name + * + * @default none */ types?: { [fqn: string]: Type }; /** * The top-level readme document for this assembly (if any). - */ - readme?: { markdown: string }; - - /** - * Source directory of the module root, relative to the repository root. * - * If undefined or the empty string, no source location information is - * available. If the module root is equal to the root of the repository, - * the value is '.'. + * @default none */ - locationInRepository?: string; + readme?: { markdown: string }; } /** * Versions of the JSII Assembly Specification. */ export enum SchemaVersion { - V1_0 = 'jsii/1.0' + LATEST = 'jsii/0.10.0' } +/** + * Fully Qualified Name + */ +export type FQN = string; + /** * Metadata about people or organizations associated with the project that * resulted in the Assembly. Some of this metadata is required in order to @@ -126,7 +147,9 @@ export enum SchemaVersion { * project maintainer. */ export interface Person { - /** The name of the person */ + /** + * The name of the person + */ name: string; /** @@ -135,13 +158,25 @@ export interface Person { */ roles: string[]; - /** The email of the person */ + /** + * The email of the person + * + * @default none + */ email?: string; - /** The URL for the person */ + /** + * The URL for the person + * + * @default none + */ url?: string; - /** If true, this person is, in fact, an organization */ + /** + * If true, this person is, in fact, an organization + * + * @default false + */ organization?: boolean; } @@ -149,7 +184,9 @@ export interface Person { * Configurable targets for an asembly. */ export interface AssemblyTargets { - /** Information about a particular language's targets */ + /** + * Information about a particular language's targets + */ [language: string]: { [key: string]: any } | undefined; } @@ -159,32 +196,24 @@ export interface AssemblyTargets { export interface PackageVersion { /** * Version of the package. + * * @minLength 1 */ version: string; - /** Targets for a given assembly. */ + /** + * Targets for a given assembly. + * + * @default none + */ targets?: AssemblyTargets; - /** Dependencies of this dependency */ - dependencies?: { [assembly: string]: PackageVersion }; - /** - * Indicates if this dependency is a direct (peer) dependency or a - * transitive dependency. - * - * Peer dependencies are expected to be explicitly defined by the user of - * this library instead of brought in as transitive dependencies. - * - * jsii enforces that any direct dependency on another jsii module is also - * defined as a peerDependency. Otherwise, it would be impossible to safely - * use two versions of this dependency in a closure. + * Dependencies of this dependency * - * @see https://github.com/awslabs/aws-cdk/issues/979 - * @see https://github.com/awslabs/jsii/issues/361 - * @see https://nodejs.org/en/blog/npm/peer-dependencies/ + * @default none */ - peer?: boolean; + dependencies?: { [assembly: string]: PackageVersion }; } /** @@ -210,29 +239,39 @@ export interface Docs { /** * Summary documentation for an API item. * - * The first part of the documentation before hitting a `@remarks` tags, or the first - * line of the doc comment block if there is no `@remarks` tag. + * The first part of the documentation before hitting a `@remarks` tags, or + * the first line of the doc comment block if there is no `@remarks` tag. + * + * @default none */ summary?: string; /** * Detailed information about an API item. * - * Either the explicitly tagged `@remarks` section, otherwise everything past the - * first paragraph if there is no `@remarks` tag. + * Either the explicitly tagged `@remarks` section, otherwise everything + * past the first paragraph if there is no `@remarks` tag. + * + * @default none */ remarks?: string; /** - * If present, this block indicates that an API item is no longer supported and may be - * removed in a future release. The `@deprecated` tag must be followed by a sentence - * describing the recommended alternative. Deprecation recursively applies to members - * of a container. For example, if a class is deprecated, then so are all of its members. + * If present, this block indicates that an API item is no longer supported + * and may be removed in a future release. The `@deprecated` tag must be + * followed by a sentence describing the recommended alternative. + * Deprecation recursively applies to members of a container. For example, + * if a class is deprecated, then so are all of its members. + * + * @default none */ deprecated?: string; /** - * The `@returns` block for this doc comment, or undefined if there is not one. + * The `@returns` block for this doc comment, or undefined if there is not + * one. + * + * @default none */ returns?: string; @@ -246,19 +285,25 @@ export interface Docs { * * Starts off in running text mode, may switch to code using fenced code * blocks. + * + * @default none */ example?: string; /** * A `@see` link with more information + * + * @default none */ see?: string; /** - * Whether this class or interface was intended to be subclassed/implemented by library users. + * Whether this class or interface was intended to be subclassed/implemented + * by library users. * - * Classes intended for subclassing, and interfaces intended to be implemented - * by consumers, are held to stricter standards of API compatibility. + * Classes intended for subclassing, and interfaces intended to be + * implemented by consumers, are held to stricter standards of API + * compatibility. * * @default false */ @@ -266,17 +311,30 @@ export interface Docs { /** * Description of the default + * + * @default none */ default?: string; /** * Custom tags that are not any of the default ones + * + * @default none */ custom?: {[tag: string]: string}; } +/** + * API Stability levels. + */ export enum Stability { + /** + * Experimental APIs may change in breaking ways in a minor version update. + */ Experimental = 'experimental', + /** + * Stable APIs may not change in breaking ways without a major version bump. + */ Stable = 'stable', } @@ -284,6 +342,11 @@ export enum Stability { * Indicates that an entity is documentable. */ export interface Documentable { + /** + * Documentation for this entity. + * + * @default none + */ docs?: Docs; } @@ -297,6 +360,8 @@ export interface SourceLocatable { * Why is this not `locationInAssembly`? Because the assembly is the JSII * file combining compiled code and its manifest, whereas this is referring * to the location of the source in the module the assembly was built from. + * + * @default none */ locationInModule?: SourceLocation; } @@ -305,7 +370,13 @@ export interface SourceLocatable { * Kinds of collections. */ export enum CollectionKind { + /** + * An array, or a list of some element type. + */ Array = 'array', + /** + * A map of a string to some element type. + */ Map = 'map', } @@ -313,9 +384,24 @@ export enum CollectionKind { * Kinds of primitive types. */ export enum PrimitiveType { + /** + * A JSON date (represented as it's ISO-8601 string form). + */ Date = 'date', + + /** + * A plain string. + */ String = 'string', + + /** + * A number (integer or float). + */ Number = 'number', + + /** + * A boolean value. + */ Boolean = 'boolean', /** @@ -324,40 +410,49 @@ export enum PrimitiveType { Json = 'json', /** - * Value with "any" or "unknown" type (aka Object) + * Value with "any" or "unknown" type (aka Object). Values typed `any` may + * be `null` or `undefined`. */ Any = 'any' } /** - * A reference to a type (primitive, collection or fqn). - */ -export type TypeReference = TypeReferenceBase & (NamedTypeReference | PrimitiveTypeReference | CollectionTypeReference | UnionTypeReference); - -/** - * Common attributes of a TypeReference. + * A value that can possibly be optional. */ -export interface TypeReferenceBase { +export interface OptionalValue { /** - * Indicates if this value is optional. + * Determines whether the value is, indeed, optional. + * + * @default false */ optional?: boolean; /** - * Indicates if this type refers to a promise. + * The declared type of the value, when it's present. */ - promise?: boolean; + type: TypeReference; } /** - * Reference to a named type, defined by this assembly or one of it's dependencies. + * A reference to a type (primitive, collection or fqn). + */ +export type TypeReference = NamedTypeReference | PrimitiveTypeReference | CollectionTypeReference | UnionTypeReference; + +/** + * The standard representation of the `any` type (includes optionality marker). */ -export interface NamedTypeReference extends TypeReferenceBase { +export const CANONICAL_ANY: Readonly = { primitive: PrimitiveType.Any }; + +/** + * Reference to a named type, defined by this assembly or one of its + * dependencies. + */ +export interface NamedTypeReference { /** * The fully-qualified-name of the type (can be located in the * ``spec.types[fqn]``` of the assembly that defines the type). */ - fqn: string; + fqn: FQN; } export function isNamedTypeReference(ref: TypeReference | undefined): ref is NamedTypeReference { return ref != null && !!(ref as NamedTypeReference).fqn; @@ -366,7 +461,7 @@ export function isNamedTypeReference(ref: TypeReference | undefined): ref is Nam /** * Reference to a primitive type. */ -export interface PrimitiveTypeReference extends TypeReferenceBase { +export interface PrimitiveTypeReference { /** * If this is a reference to a primitive type, this will include the * primitive type kind. @@ -380,7 +475,7 @@ export function isPrimitiveTypeReference(ref: TypeReference | undefined): ref is /** * Reference to a collection type. */ -export interface CollectionTypeReference extends TypeReferenceBase { +export interface CollectionTypeReference { collection: { /** * The kind of collection. @@ -400,13 +495,15 @@ export function isCollectionTypeReference(ref: TypeReference | undefined): ref i /** * Reference to a union type. */ -export interface UnionTypeReference extends TypeReferenceBase { +export interface UnionTypeReference { /** - * Indicates that this is a union type, which means it can be one of a set of types. + * Indicates that this is a union type, which means it can be one of a set + * of types. */ union: { /** * All the possible types (including the primary type). + * * @minItems 2 */ types: TypeReference[]; @@ -417,57 +514,65 @@ export function isUnionTypeReference(ref: TypeReference | undefined): ref is Uni } /** - * Methods and properties can be overridden from parent classes or implemented from interfaces. + * Methods and properties can be overridden from parent classes or implemented + * from interfaces. */ export interface Overridable { /** - * The name of the parent type (class or interface) that this entity overrides or implements. If undefined, then - * this entity is the first in it's hierarchy to declare this entity. + * The FQN of the parent type (class or interface) that this entity + * overrides or implements. If undefined, then this entity is the first in + * it's hierarchy to declare this entity. * - * @default undefined + * @default this member is not overriding anything */ - overrides?: NamedTypeReference; + overrides?: FQN; } /** * A class property. */ -export interface Property extends Documentable, Overridable, SourceLocatable { +export interface Property extends Documentable, OptionalValue, Overridable, SourceLocatable { /** * The name of the property. + * * @minLength 1 */ name: string; - /** - * The type of the property. - */ - type: TypeReference; - /** * Indicates if this property only has a getter (immutable). + * + * @default false */ immutable?: boolean; /** * Indicates if this property is protected (otherwise it is public) + * + * @default false */ protected?: boolean; /** * Indicates if this property is abstract + * + * @default false */ abstract?: boolean; /** * Indicates if this is a static property. + * + * @default false */ static?: boolean; /** * A hint that indicates that this static, immutable property is initialized - * during startup. This allows emitting "const" idioms in different target languages. - * Implies `static` and `immutable`. + * during startup. This allows emitting "const" idioms in different target + * languages. Implies `static` and `immutable`. + * + * @default false */ const?: boolean; } @@ -475,77 +580,110 @@ export interface Property extends Documentable, Overridable, SourceLocatable { /** * Represents a method parameter. */ -export interface Parameter extends Documentable { +export interface Parameter extends Documentable, OptionalValue { /** * The name of the parameter. + * * @minLength 1 */ name: string; /** - * The type of the parameter. - */ - type: TypeReference; - - /** - * Whather this argument is the "rest" of a variadic signature. - * The ``#type`` is that of every individual argument of the variadic list. + * Whether this is the last parameter of a variadic method. In such cases, + * the `#type` attribute is the type of each individual item of the variadic + * arguments list (as opposed to some array type, as for example TypeScript + * would model it). + * + * @default false */ variadic?: boolean; } /** - * Represents a method. + * An Initializer or a Method. */ -export interface Method extends Documentable, Overridable, SourceLocatable { - +export interface Callable extends Documentable, Overridable, SourceLocatable { /** - * The name of the method. Undefined if this method is a initializer. + * The parameters of the Initializer or Method. + * + * @default none */ - name?: string; + parameters?: Parameter[]; /** - * The return type of the method (undefined if void or initializer) + * Indicates if this Initializer or Method is protected (otherwise it is + * public, since private members are not modeled). + * + * @default false */ - returns?: TypeReference; + protected?: boolean; /** - * The parameters of the method/initializer + * Indicates whether this Initializer or Method is variadic or not. When + * ``true``, the last element of ``#parameters`` will also be flagged + * ``#variadic``. + * + * @default false */ - parameters?: Parameter[]; + variadic?: boolean; +} + +/** + * An initializer. + */ +export type Initializer = Callable; +/** + * A method with a name (i.e: not an initializer). + */ +export interface Method extends Callable { /** - * True if this method is an initializer, in which case it won't have a return type + * The name of the method. Undefined if this method is a initializer. */ - initializer?: boolean; + name: string; /** - * Indicates if this method is protected (otherwise it is public) + * The return type of the method (`undefined` if `void`) + * + * @default void */ - protected?: boolean; + returns?: OptionalValue; /** * Is this method an abstract method (this means the class will also be an abstract class) + * + * @default false */ abstract?: boolean; /** - * Indicates whether this method is variadic or not. When ``true``, the last - * element of ``#parameters`` will also be flagged ``#variadic``. + * Indicates if this is an asynchronous method (it will return a promise). + * + * @default false */ - variadic?: boolean; + async?: boolean; /** * Indicates if this is a static method. + * + * @default false */ static?: boolean; } +/** + * Determines whether a Callable is a Method or not. + * + * @param callable the callable to be checked. + */ +export function isMethod(callable: Callable): callable is Method { + return !!(callable as Method).name; +} /** * Represents a type definition (not a type reference). */ -export type Type = TypeBase & (ClassType | EnumType | InterfaceType); +export type Type = TypeBase & (ClassType | EnumType | InterfaceType); /** * Common attributes of a type definition. @@ -553,12 +691,14 @@ export type Type = TypeBase & (ClassType | EnumType | InterfaceType); export interface TypeBase extends Documentable, SourceLocatable { /** * The fully qualified name of the type (``..``) + * * @minLength 3 */ - fqn: string; + fqn: FQN; /** * The name of the assembly the type belongs to. + * * @minLength 1 */ assembly: string; @@ -567,11 +707,14 @@ export interface TypeBase extends Documentable, SourceLocatable { * The namespace of the type (``foo.bar.baz``). When undefined, the type is located at the root of the assembly * (it's ``fqn`` would be like ``.``). If the `namespace` corresponds to an existing type's * namespace-qualified (e.g: ``.``), then the current type is a nested type. + * + * @default none */ namespace?: string; /** * The simple name of the type (MyClass). + * * @minLength 1 */ name: string; @@ -598,34 +741,47 @@ export interface ClassType extends TypeBase { kind: TypeKind.Class; /** - * Base class (optional). + * The FQN of the base class of this class, if it has one. + * + * @default no base class */ - base?: NamedTypeReference; + base?: FQN; /** * Initializer (constructor) method. + * + * @default no initializer */ - initializer?: Method; + initializer?: Initializer; /** * List of properties. + * + * @default none */ properties?: Property[]; /** * List of methods. + * + * @default none */ methods?: Method[]; /** * Indicates if this class is an abstract class. + * + * @default false */ abstract?: boolean; /** - * The set of interfaces implemented by this class. + * The FQNs of the interfaces this class implements, if any. + * + * @default none + * @uniqueItems true */ - interfaces?: NamedTypeReference[]; + interfaces?: FQN[]; } export function isClassType(type: Type | undefined): type is ClassType { @@ -636,17 +792,24 @@ export interface InterfaceType extends TypeBase { kind: TypeKind.Interface; /** - * All the base interfaces that this interface extends. + * The FQNs of the interfaces this interface extends, if any. + * + * @default none + * @uniqueItems true */ - interfaces?: NamedTypeReference[]; + interfaces?: FQN[]; /** * List of methods. + * + * @default none */ methods?: Method[]; /** * List of properties. + * + * @default none */ properties?: Property[]; @@ -656,6 +819,8 @@ export interface InterfaceType extends TypeBase { * For example, in Java, the generator will produce a PoJo and a builder * which will allow users to create a concrete object with data which * adheres to this interface. + * + * @default false */ datatype?: boolean; } @@ -698,31 +863,26 @@ export function isClassOrInterfaceType(type: Type | undefined): type is (Interfa } /** - * Return a string representation of the given type reference + * Return a string representation of the given type reference. */ -export function describeTypeReference(a?: TypeReference): string { - if (a === undefined) { return '(none)'; } +export function describeTypeReference(type?: TypeReference): string { + if (type === undefined) { return 'void'; } - const optionalMarker = a.optional ? '?' : ''; - - if (isNamedTypeReference(a)) { - return `${a.fqn}${optionalMarker}`; + if (isNamedTypeReference(type)) { + return type.fqn; } - if (isPrimitiveTypeReference(a)) { - return `${a.primitive}${optionalMarker}`; + if (isPrimitiveTypeReference(type)) { + return type.primitive; } - if (isCollectionTypeReference(a)) { - return `${a.collection.kind}<${describeTypeReference(a.collection.elementtype)}>${optionalMarker}`; + if (isCollectionTypeReference(type)) { + return `${type.collection.kind}<${describeTypeReference(type.collection.elementtype)}>`; } - if (isUnionTypeReference(a)) { - const unionType = a.union.types.map(describeTypeReference).join(' | '); - if (a.optional) { - return `(${unionType})${optionalMarker}`; - } else { - return unionType; - } + + if (isUnionTypeReference(type)) { + const unionType = type.union.types.map(describeTypeReference).join(' | '); + return unionType; } throw new Error('Unrecognized type reference'); diff --git a/packages/jsii-spec/package-lock.json b/packages/jsii-spec/package-lock.json index e06dbbbbb3..0702e83e4c 100644 --- a/packages/jsii-spec/package-lock.json +++ b/packages/jsii-spec/package-lock.json @@ -1,6 +1,6 @@ { "name": "jsii-spec", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2616,9 +2616,9 @@ "dev": true }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", "dev": true }, "typescript-json-schema": { diff --git a/packages/jsii-spec/package.json b/packages/jsii-spec/package.json index 24dcf0a779..4c35fd0465 100644 --- a/packages/jsii-spec/package.json +++ b/packages/jsii-spec/package.json @@ -15,7 +15,7 @@ "@types/nodeunit": "^0.0.30", "jsii-build-tools": "^0.9.0", "nodeunit": "^0.11.3", - "typescript": "^3.3.3333", + "typescript": "^3.4.2", "typescript-json-schema": "^0.34.0" }, "dependencies": { diff --git a/packages/jsii-spec/test/test.name-tree.ts b/packages/jsii-spec/test/test.name-tree.ts index 4e15e5045b..24348bae65 100644 --- a/packages/jsii-spec/test/test.name-tree.ts +++ b/packages/jsii-spec/test/test.name-tree.ts @@ -11,7 +11,7 @@ export = testCase({ 'correctly represents sample assembly'(test: Test) { // GIVEN const assm: spec.Assembly = { - schema: spec.SchemaVersion.V1_0, + schema: spec.SchemaVersion.LATEST, name: assemblyName, description: 'bla', homepage: 'https://github.com/bla/bla', diff --git a/packages/jsii/lib/assembler.ts b/packages/jsii/lib/assembler.ts index 027205b9ca..76dfb19c53 100644 --- a/packages/jsii/lib/assembler.ts +++ b/packages/jsii/lib/assembler.ts @@ -11,7 +11,6 @@ import { getReferencedDocParams, parseSymbolDocumentation } from './docs'; import { Diagnostic, Emitter, EmitResult } from './emitter'; import literate = require('./literate'); import { ProjectInfo } from './project-info'; -import utils = require('./utils'); import { Validator } from './validator'; import { SHORT_VERSION, VERSION } from './version'; @@ -100,7 +99,7 @@ export class Assembler implements Emitter { const jsiiVersion = this.projectInfo.jsiiVersionFormat === 'short' ? SHORT_VERSION : VERSION; const assembly = { - schema: spec.SchemaVersion.V1_0, + schema: spec.SchemaVersion.LATEST, name: this.projectInfo.name, version: this.projectInfo.version, description: this.projectInfo.description || this.projectInfo.name, @@ -109,14 +108,13 @@ export class Assembler implements Emitter { author: this.projectInfo.author, contributors: this.projectInfo.contributors && [...this.projectInfo.contributors], repository: this.projectInfo.repository, - dependencies: _toDependencies(this.projectInfo.dependencies, this.projectInfo.peerDependencies), + dependencies: _toDependencies(this.projectInfo.dependencies), bundled: this.projectInfo.bundleDependencies, types: this._types, targets: this.projectInfo.targets, readme, jsiiVersion, fingerprint: '', - locationInRepository: this.projectInfo.locationInRepository }; const validator = new Validator(this.projectInfo, assembly); @@ -124,7 +122,7 @@ export class Assembler implements Emitter { if (!validationResult.hasErrors) { const assemblyPath = path.join(this.projectInfo.projectRoot, '.jsii'); LOG.trace(`Emitting assembly: ${colors.blue(assemblyPath)}`); - await fs.writeJson(assemblyPath, _fingerprint(assembly), { replacer: utils.filterEmpty, spaces: 2 }); + await fs.writeJson(assemblyPath, _fingerprint(assembly), { encoding: 'utf8', spaces: 2 }); } try { @@ -166,15 +164,16 @@ export class Assembler implements Emitter { * @param cb Callback to be invoked with the Types corresponding to the TypeReferences in baseTypes */ // tslint:disable-next-line:max-line-length - private _deferUntilTypesAvailable(fqn: string, baseTypes: spec.NamedTypeReference[], referencingNode: ts.Node, cb: (...xs: spec.Type[]) => void) { + private _deferUntilTypesAvailable(fqn: string, baseTypes: Array, referencingNode: ts.Node, cb: (...xs: spec.Type[]) => void) { // We can do this one eagerly if (baseTypes.length === 0) { cb(); return; } + const baseFqns = baseTypes.map(bt => typeof bt === 'string' ? bt : bt.fqn); - this._defer(fqn, baseTypes.map(x => x.fqn), () => { - const resolved = baseTypes.map(x => this._dereference(x, referencingNode)).filter(x => x !== undefined); + this._defer(fqn, baseFqns, () => { + const resolved = baseFqns.map(x => this._dereference(x, referencingNode)).filter(x => x !== undefined); if (resolved.length > 0) { return cb(...resolved as spec.Type[]); } @@ -204,14 +203,18 @@ export class Assembler implements Emitter { * * @returns the de-referenced type, if it was found, otherwise ``undefined``. */ - private _dereference(ref: spec.NamedTypeReference, referencingNode: ts.Node | null): spec.Type | undefined { - const [assm, ] = ref.fqn.split('.'); + private _dereference(ref: string | spec.NamedTypeReference, referencingNode: ts.Node | null): spec.Type | undefined { + if (typeof ref !== 'string') { + ref = ref.fqn; + } + + const [assm, ] = ref.split('.'); let type; if (assm === this.projectInfo.name) { - type = this._types[ref.fqn]; + type = this._types[ref]; } else { const assembly = this.projectInfo.transitiveDependencies.find(dep => dep.name === assm); - type = assembly && assembly.types && assembly.types[ref.fqn]; + type = assembly && assembly.types && assembly.types[ref]; // since we are exposing a type of this assembly in this module's public API, // we expect it to appear as a peer dependency instead of a normal dependency. @@ -219,7 +222,7 @@ export class Assembler implements Emitter { const asPeerDependency = this.projectInfo.peerDependencies.find(d => d.name === assembly.name); if (!asPeerDependency) { this._diagnostic(referencingNode, ts.DiagnosticCategory.Warning, - `The type '${ref.fqn}' is exposed in the public API of this module. ` + + `The type '${ref}' is exposed in the public API of this module. ` + `Therefore, the module '${assembly.name}' must also be defined under "peerDependencies". ` + `You can use the "jsii-fix-peers" utility to fix.`); } @@ -228,8 +231,7 @@ export class Assembler implements Emitter { if (!type) { this._diagnostic(referencingNode, ts.DiagnosticCategory.Error, - `Unable to resolve referenced type '${ref.fqn}'. ` + - `Type may be @internal or unexported`); + `Unable to resolve referenced type '${ref}'. Type may be @internal or unexported`); } return type; @@ -431,7 +433,7 @@ export class Assembler implements Emitter { fqn, kind: spec.TypeKind.Class, name: type.symbol.name, - namespace: namespace.join('.'), + namespace: namespace.length > 0 ? namespace.join('.') : undefined, docs: this._visitDocumentation(type.symbol), }; @@ -476,7 +478,7 @@ export class Assembler implements Emitter { `Base type of ${jsiiType.fqn} is not a class (${spec.describeTypeReference(ref)})`); } }); - jsiiType.base = ref; + jsiiType.base = ref.fqn; } for (const clause of (type.symbol.valueDeclaration as ts.ClassDeclaration).heritageClauses || []) { if (clause.token === ts.SyntaxKind.ExtendsKeyword) { @@ -488,9 +490,9 @@ export class Assembler implements Emitter { } const { interfaces } = await this._processBaseInterfaces(fqn, clause.types.map(t => this._typeChecker.getTypeFromTypeNode(t))); - jsiiType.interfaces = interfaces; - if (jsiiType.interfaces) { - this._deferUntilTypesAvailable(jsiiType.fqn, jsiiType.interfaces, type.symbol.valueDeclaration, (...ifaces) => { + jsiiType.interfaces = apply(interfaces, arr => arr.map(i => i.fqn)); + if (interfaces) { + this._deferUntilTypesAvailable(jsiiType.fqn, interfaces, type.symbol.valueDeclaration, (...ifaces) => { for (const iface of ifaces) { if (spec.isInterfaceType(iface) && iface.datatype) { this._diagnostic(type.symbol.valueDeclaration, @@ -555,17 +557,18 @@ export class Assembler implements Emitter { // tslint:disable-next-line:no-bitwise if ((ts.getCombinedModifierFlags(ctorDeclaration) & ts.ModifierFlags.Private) === 0) { - jsiiType.initializer = { initializer: true }; + jsiiType.initializer = {}; if (signature) { for (const param of signature.getParameters()) { jsiiType.initializer.parameters = jsiiType.initializer.parameters || []; jsiiType.initializer.parameters.push(await this._toParameter(param)); - jsiiType.initializer.variadic = jsiiType.initializer.parameters - && jsiiType.initializer.parameters.find(p => !!p.variadic) != null; + jsiiType.initializer.variadic = + (jsiiType.initializer.parameters && jsiiType.initializer.parameters.some(p => !!p.variadic)) + || undefined; } } + this._verifyConsecutiveOptionals(ctorDeclaration, jsiiType.initializer.parameters); jsiiType.initializer.docs = this._visitDocumentation(constructor); - this._verifyConsecutiveOptionals(type.symbol.valueDeclaration, jsiiType.initializer.parameters); } // Process constructor-based property declarations even if constructor is private @@ -583,11 +586,11 @@ export class Assembler implements Emitter { } else { this._diagnostic(type.symbol.valueDeclaration, ts.DiagnosticCategory.Error, - `Base type of ${jsiiType.fqn} (${jsiiType.base!.fqn}) is not a class`); + `Base type of ${jsiiType.fqn} (${jsiiType.base}) is not a class`); } }); } else { - jsiiType.initializer = { initializer: true }; + jsiiType.initializer = {}; } this._verifyNoStaticMixing(jsiiType, type.symbol.valueDeclaration); @@ -709,7 +712,7 @@ export class Assembler implements Emitter { docs: this._visitDocumentation(m.symbol), })), name: type.symbol.name, - namespace: namespace.join('.'), + namespace: namespace.length > 0 ? namespace.join('.') : undefined, docs }; @@ -763,12 +766,12 @@ export class Assembler implements Emitter { fqn, kind: spec.TypeKind.Interface, name: type.symbol.name, - namespace: namespace.join('.'), + namespace: namespace.length > 0 ? namespace.join('.') : undefined, docs: this._visitDocumentation(type.symbol), }; const { interfaces, erasedBases } = await this._processBaseInterfaces(fqn, type.getBaseTypes()); - jsiiType.interfaces = interfaces; + jsiiType.interfaces = apply(interfaces, arr => arr.map(i => i.fqn)); for (const declaringType of [type, ...erasedBases]) { for (const member of declaringType.getProperties()) { @@ -888,15 +891,16 @@ export class Assembler implements Emitter { const returnType = signature.getReturnType(); const method: spec.Method = { - abstract: _isAbstract(symbol, type), + abstract: _isAbstract(symbol, type) || undefined, name: symbol.name, - parameters, - protected: _isProtected(symbol), - returns: _isVoid(returnType) ? undefined : await this._typeReference(returnType, declaration), - static: _isStatic(symbol), + parameters: parameters.length > 0 ? parameters : undefined, + protected: _isProtected(symbol) || undefined, + returns: _isVoid(returnType) ? undefined : await this._optionalValue(returnType, declaration), + async: _isPromise(returnType) || undefined, + static: _isStatic(symbol) || undefined, locationInModule: this.declarationLocation(declaration), }; - method.variadic = method.parameters && method.parameters.find(p => !!p.variadic) != null; + method.variadic = (method.parameters && method.parameters.some(p => !!p.variadic)) || undefined; this._verifyConsecutiveOptionals(declaration, method.parameters); @@ -954,24 +958,24 @@ export class Assembler implements Emitter { | ts.AccessorDeclaration | ts.ParameterPropertyDeclaration); const property: spec.Property = { - abstract: _isAbstract(symbol, type), + ...await this._optionalValue(this._typeChecker.getTypeOfSymbolAtLocation(symbol, signature), signature), + abstract: _isAbstract(symbol, type) || undefined, name: symbol.name, - protected: _isProtected(symbol), - static: _isStatic(symbol), - type: await this._typeReference(this._typeChecker.getTypeOfSymbolAtLocation(symbol, signature), signature), + protected: _isProtected(symbol) || undefined, + static: _isStatic(symbol) || undefined, locationInModule: this.declarationLocation(signature), }; if (ts.isGetAccessor(signature)) { const decls = symbol.getDeclarations() || []; - property.immutable = decls.find(decl => ts.isSetAccessor(decl)) == null; + property.immutable = !decls.some(decl => ts.isSetAccessor(decl)) || undefined; } else { // tslint:disable-next-line:no-bitwise - property.immutable = (ts.getCombinedModifierFlags(signature) & ts.ModifierFlags.Readonly) !== 0; + property.immutable = ((ts.getCombinedModifierFlags(signature) & ts.ModifierFlags.Readonly) !== 0) || undefined; } if (signature.questionToken) { - property.type.optional = true; + property.optional = true; } if (property.static && property.immutable && ts.isPropertyDeclaration(signature) && signature.initializer) { @@ -993,16 +997,19 @@ export class Assembler implements Emitter { LOG.trace(`Processing parameter: ${colors.cyan(paramSymbol.name)}`); } const paramDeclaration = paramSymbol.valueDeclaration as ts.ParameterDeclaration; + const parameter: spec.Parameter = { + ...await this._optionalValue(this._typeChecker.getTypeAtLocation(paramSymbol.valueDeclaration), paramSymbol.valueDeclaration), name: paramSymbol.name, - type: await this._typeReference(this._typeChecker.getTypeAtLocation(paramSymbol.valueDeclaration), paramSymbol.valueDeclaration), - variadic: !!paramDeclaration.dotDotDotToken + variadic: paramDeclaration.dotDotDotToken && true, }; - if (parameter.variadic) { - parameter.type = (parameter.type as spec.CollectionTypeReference).collection.elementtype; - } - if (paramDeclaration.initializer || paramDeclaration.questionToken) { - parameter.type.optional = true; + + if (parameter.variadic && spec.isCollectionTypeReference(parameter.type)) { + // TypeScript types variadic parameters as an array, but JSII uses the item-type instead. + parameter.type = parameter.type.collection.elementtype; + } else if (paramDeclaration.initializer || paramDeclaration.questionToken) { + // Optional parameters have an inherently null-able type. + parameter.optional = true; } parameter.docs = this._visitDocumentation(paramSymbol); // No inheritance on purpose @@ -1011,6 +1018,16 @@ export class Assembler implements Emitter { } private async _typeReference(type: ts.Type, declaration: ts.Declaration): Promise { + const optionalValue = await this._optionalValue(type, declaration); + if (optionalValue.optional) { + this._diagnostic(declaration, + ts.DiagnosticCategory.Error, + `Encountered optional value in location where a plan type reference is expected`); + } + return optionalValue.type; + } + + private async _optionalValue(type: ts.Type, declaration: ts.Declaration): Promise { if (type.isLiteral() && _isEnumLike(type)) { type = this._typeChecker.getBaseTypeOfLiteralType(type); } else { @@ -1018,7 +1035,7 @@ export class Assembler implements Emitter { } const primitiveType = _tryMakePrimitiveType.call(this); - if (primitiveType) { return primitiveType; } + if (primitiveType) { return { type: primitiveType }; } if (type.isUnion() && !_isEnumLike(type)) { return _unionType.call(this); @@ -1026,15 +1043,15 @@ export class Assembler implements Emitter { if (!type.symbol) { this._diagnostic(declaration, ts.DiagnosticCategory.Error, `Non-primitive types must have a symbol`); - return { primitive: spec.PrimitiveType.Any, optional: true }; + return { type: spec.CANONICAL_ANY }; } if (type.symbol.name === 'Array') { - return await _arrayType.call(this); + return { type: await _arrayType.call(this) }; } if (type.symbol.name === '__type' && type.symbol.members) { - return await _mapType.call(this); + return { type: await _mapType.call(this) }; } if (type.symbol.escapedName === 'Promise') { @@ -1043,16 +1060,13 @@ export class Assembler implements Emitter { this._diagnostic(declaration, ts.DiagnosticCategory.Error, `Un-specified promise type (need to specify as Promise)`); - return { primitive: spec.PrimitiveType.Any, optional: true, promise: true }; + return { type: spec.CANONICAL_ANY }; } else { - return { - ...await this._typeReference(typeRef.typeArguments[0], declaration), - promise: true - }; + return { type: await this._typeReference(typeRef.typeArguments[0], declaration) }; } } - return { fqn: await this._getFQN(type) }; + return { type: { fqn: await this._getFQN(type) } }; async function _arrayType(this: Assembler): Promise { const typeRef = type as ts.TypeReference; @@ -1065,7 +1079,7 @@ export class Assembler implements Emitter { this._diagnostic(declaration, ts.DiagnosticCategory.Error, `Array references must have exactly one type argument (found ${count})`); - elementtype = { primitive: spec.PrimitiveType.Any, optional: true }; + elementtype = spec.CANONICAL_ANY; } return { @@ -1085,7 +1099,7 @@ export class Assembler implements Emitter { this._diagnostic(declaration, ts.DiagnosticCategory.Error, `Only string index maps are supported`); - elementtype = { primitive: spec.PrimitiveType.Any }; + elementtype = spec.CANONICAL_ANY; } return { collection: { @@ -1103,7 +1117,7 @@ export class Assembler implements Emitter { } // tslint:disable-next-line:no-bitwise if (type.flags & (ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { - return { primitive: spec.PrimitiveType.Any }; + return spec.CANONICAL_ANY; } } else if (type.symbol.valueDeclaration && isUnder(type.symbol.valueDeclaration.getSourceFile().fileName, this.stdlib)) { switch (type.symbol.name) { @@ -1126,9 +1140,9 @@ export class Assembler implements Emitter { } } - async function _unionType(this: Assembler): Promise { + async function _unionType(this: Assembler): Promise { const types = new Array(); - let optional: boolean = false; + let optional: boolean | undefined; for (const subType of (type as ts.UnionType).types) { // tslint:disable-next-line:no-bitwise @@ -1144,8 +1158,8 @@ export class Assembler implements Emitter { } return types.length === 1 - ? { ...types[0], optional } - : { union: { types }, optional }; + ? { optional, type: types[0] } + : { optional, type: { union: { types } } }; } } @@ -1209,24 +1223,19 @@ export class Assembler implements Emitter { } } - /** - * Verifies that if a method has an optional parameter, all consecutive - * parameters are optionals as well. - */ private _verifyConsecutiveOptionals(node: ts.Node, parameters?: spec.Parameter[]) { - if (!parameters) { - return; - } - - let optional = false; - for (const p of parameters) { - if (optional && !p.type.optional && !p.variadic) { - this._diagnostic(node, ts.DiagnosticCategory.Error, - `Parameter ${p.name} must be optional since it comes after an optional parameter`); - } - - if (p.type.optional) { - optional = true; + if (!parameters) { return; } + + const remaining = [...parameters].reverse(); + while (remaining.length > 0) { + const current = remaining.pop()!; + if (current.optional) { + const offender = remaining.find(p => !p.optional && !p.variadic); + if (offender == null) { continue; } + this._diagnostic(node, + ts.DiagnosticCategory.Error, + `Parameter ${current.name} cannot be optional, as it precedes non-optional parameter ${offender.name}`); + delete current.optional; } } } @@ -1236,7 +1245,7 @@ function _fingerprint(assembly: spec.Assembly): spec.Assembly { delete assembly.fingerprint; assembly = sortJson(assembly); const fingerprint = crypto.createHash('sha256') - .update(JSON.stringify(assembly, utils.filterEmpty)) + .update(JSON.stringify(assembly)) .digest('base64'); return { ...assembly, fingerprint }; } @@ -1314,6 +1323,10 @@ function _isVoid(type: ts.Type): boolean { return ((type.flags & ts.TypeFlags.Void) !== 0); } +function _isPromise(type: ts.Type): boolean { + return type.symbol && type.symbol.escapedName === 'Promise'; +} + function _sortMembers(type: spec.ClassType): spec.ClassType; function _sortMembers(type: spec.InterfaceType): spec.InterfaceType; function _sortMembers(type: spec.ClassType | spec.InterfaceType): spec.ClassType | spec.InterfaceType { @@ -1343,7 +1356,7 @@ function _sortMembers(type: spec.ClassType | spec.InterfaceType): spec.ClassType return [ val.static ? '0' : '1', val.immutable ? '0' : '1', - !(val.type && val.type.optional) ? '0' : '1', + !(val.optional) ? '0' : '1', val.name ].join('|'); } @@ -1353,11 +1366,15 @@ function _sortMembers(type: spec.ClassType | spec.InterfaceType): spec.ClassType name?: string; // Methods & Properties static?: boolean; // Methods & Properties immutable?: boolean; // Properties - type?: { optional?: boolean; }; // Properties + optional?: boolean; // Properties }; } -function _toDependencies(assemblies: ReadonlyArray, peers: ReadonlyArray): { [name: string]: spec.PackageVersion } { +function _toDependencies(assemblies: ReadonlyArray): { [name: string]: spec.PackageVersion } | undefined { + if (assemblies.length === 0) { + return undefined; + } + const result: { [name: string]: spec.PackageVersion } = {}; for (const assembly of assemblies) { @@ -1368,14 +1385,6 @@ function _toDependencies(assemblies: ReadonlyArray, peers: Readon }; } - for (const peer of peers) { - result[peer.name] = { - version: peer.version, - targets: peer.targets, - dependencies: peer.dependencies, - peer: true - }; - } return result; } @@ -1473,4 +1482,4 @@ function* intersect(xs: Set, ys: Set) { yield x; } } -} \ No newline at end of file +} diff --git a/packages/jsii/lib/compiler.ts b/packages/jsii/lib/compiler.ts index 57553bc3a0..e808dec9d9 100644 --- a/packages/jsii/lib/compiler.ts +++ b/packages/jsii/lib/compiler.ts @@ -212,7 +212,7 @@ export class Compiler implements Emitter { } } LOG.debug(`Creating or updating ${colors.blue(this.configPath)}`); - await fs.writeJson(this.configPath, this.typescriptConfig, { replacer: utils.filterEmpty, spaces: 4 }); + await fs.writeJson(this.configPath, this.typescriptConfig, { encoding: 'utf8', spaces: 2 }); } /** diff --git a/packages/jsii/lib/docs.ts b/packages/jsii/lib/docs.ts index 38af86df46..b775bf2422 100644 --- a/packages/jsii/lib/docs.ts +++ b/packages/jsii/lib/docs.ts @@ -129,8 +129,8 @@ export interface DocsParsingResult { export function splitSummary(docBlock: string | undefined): [string | undefined, string | undefined] { if (!docBlock) { return [undefined, undefined]; } const summary = summaryLine(docBlock); - const remarks = docBlock.substr(summary.length); - return [endWithPeriod(noNewlines(summary.trim())), remarks.trim()]; + const remarks = uberTrim(docBlock.substr(summary.length)); + return [endWithPeriod(noNewlines(summary.trim())), remarks]; } /** @@ -144,6 +144,15 @@ function endWithPeriod(s: string) { return ENDS_WITH_PUNCTUATION_REGEX.test(s) ? s : s + '.'; } +/** + * Trims a string and turns it into `undefined` if the result would have been an + * empty string. + */ +function uberTrim(str: string): string | undefined { + str = str.trim(); + return str === '' ? undefined : str; +} + const SUMMARY_MAX_WORDS = 20; /** @@ -165,4 +174,4 @@ function summaryLine(str: string) { const PUNCTUATION = ['!', '?', '.', ';'].map(s => '\\' + s).join(''); const ENDS_WITH_PUNCTUATION_REGEX = new RegExp(`[${PUNCTUATION}]$`); -const FIRST_SENTENCE_REGEX = new RegExp(`^([^${PUNCTUATION}]+[${PUNCTUATION}] )`); // literal space at the end \ No newline at end of file +const FIRST_SENTENCE_REGEX = new RegExp(`^([^${PUNCTUATION}]+[${PUNCTUATION}] )`); // literal space at the end diff --git a/packages/jsii/lib/helpers.ts b/packages/jsii/lib/helpers.ts index bae7571074..8ffed3fe4a 100644 --- a/packages/jsii/lib/helpers.ts +++ b/packages/jsii/lib/helpers.ts @@ -19,13 +19,13 @@ import { loadProjectInfo, ProjectInfo } from './project-info'; * * Only usable for trivial cases and tests. */ -export async function sourceToAssemblyHelper(source: string, jsiiConfig = {}): Promise { +export async function sourceToAssemblyHelper(source: string, cb?: (obj: PackageInfo) => void): Promise { // Easiest way to get the source into the compiler is to write it to disk somewhere. // I guess we could make an in-memory compiler host but that seems like work... return await inTempDir(async () => { const fileName = 'index.ts'; await fs.writeFile(fileName, source, { encoding: 'utf-8' }); - const compiler = new Compiler({ projectInfo: await makeProjectInfo(fileName, jsiiConfig), watch: false }); + const compiler = new Compiler({ projectInfo: await makeProjectInfo(fileName, cb), watch: false }); const emitResult = await compiler.emit(); const errors = emitResult.diagnostics.filter(d => d.category === DiagnosticCategory.Error); @@ -58,8 +58,8 @@ async function inTempDir(block: () => Promise): Promise { * Most consistent behavior seems to be to write a package.json to disk and * then calling the same functions as the CLI would. */ -async function makeProjectInfo(types: string, jsiiConfig = {}): Promise { - await fs.writeJson('package.json', { +async function makeProjectInfo(types: string, cb?: (obj: PackageInfo) => void): Promise { + const packageInfo: PackageInfo = { types, main: types.replace(/(?:\.d)?\.ts(x?)/, '.js$1'), name: 'testpkg', // That's what package.json would tell if we look up... @@ -67,8 +67,35 @@ async function makeProjectInfo(types: string, jsiiConfig = {}): Promise v, spaces: 2 }); return await loadProjectInfo(path.resolve(process.cwd(), '.'), { fixPeerDependencies: true }); } + +export type PackageInfo = { + name: string; + version: string; + license: string; + types: string; + author: { + name: string; + roles: string[]; + [key: string]: any; + }; + repository: { + type?: string; + url: string; + directory?: string; + [key: string]: any; + }; + jsii: { + [key: string]: any; + }; + [key: string]: any; +}; diff --git a/packages/jsii/lib/project-info.ts b/packages/jsii/lib/project-info.ts index 085375921b..3e73a535a8 100644 --- a/packages/jsii/lib/project-info.ts +++ b/packages/jsii/lib/project-info.ts @@ -12,7 +12,6 @@ const LOG = log4js.getLogger('jsii/package-info'); export interface ProjectInfo { readonly projectRoot: string; - readonly locationInRepository?: string; readonly packageJson: any; readonly name: string; @@ -22,6 +21,7 @@ export interface ProjectInfo { readonly repository: { readonly type: string; readonly url: string; + readonly directory?: string; }; readonly main: string; @@ -30,7 +30,7 @@ export interface ProjectInfo { readonly dependencies: ReadonlyArray; readonly peerDependencies: ReadonlyArray; readonly transitiveDependencies: ReadonlyArray; - readonly bundleDependencies: { readonly [name: string]: string }; + readonly bundleDependencies?: { readonly [name: string]: string }; readonly targets: spec.AssemblyTargets; readonly jsiiVersionFormat: 'short' | 'full'; readonly description?: string; @@ -44,8 +44,8 @@ export async function loadProjectInfo(projectRoot: string, { fixPeerDependencies const packageJsonPath = path.join(projectRoot, 'package.json'); const pkg = require(packageJsonPath); - const bundleDependencies: { [name: string]: string } = {}; - (pkg.bundleDependencies || pkg.bundledDependencies || []).forEach((name: string) => { + let bundleDependencies: { [name: string]: string } | undefined; + for (const name of (pkg.bundleDependencies || pkg.bundledDependencies || [])) { const version = pkg.dependencies && pkg.dependencies[name]; if (!version) { throw new Error(`The "package.json" file has "${name}" in "bundleDependencies", but it is not declared in "dependencies"`); @@ -55,12 +55,13 @@ export async function loadProjectInfo(projectRoot: string, { fixPeerDependencies throw new Error(`The "package.json" file has "${name}" in "bundleDependencies", and also in "peerDependencies"`); } + bundleDependencies = bundleDependencies || {}; bundleDependencies[name] = version; - }); + } let addedPeerDependency = false; Object.entries(pkg.dependencies || {}).forEach(([name, version]) => { - if (name in bundleDependencies) { + if (name in (bundleDependencies || {})) { return; } pkg.peerDependencies = pkg.peerDependencies || {}; @@ -91,7 +92,7 @@ export async function loadProjectInfo(projectRoot: string, { fixPeerDependencies const transitiveAssemblies: { [name: string]: spec.Assembly } = {}; const dependencies = - await _loadDependencies(pkg.dependencies, projectRoot, transitiveAssemblies, new Set(Object.keys(bundleDependencies))); + await _loadDependencies(pkg.dependencies, projectRoot, transitiveAssemblies, new Set(Object.keys(bundleDependencies || {}))); const peerDependencies = await _loadDependencies(pkg.peerDependencies, projectRoot, transitiveAssemblies); @@ -106,7 +107,8 @@ export async function loadProjectInfo(projectRoot: string, { fixPeerDependencies author: _toPerson(_required(pkg.author, 'The "package.json" file must specify the "author" attribute'), 'author'), repository: { url: _required(pkg.repository.url, 'The "package.json" file must specify the "repository.url" attribute'), - type: pkg.repository.type || _guessRepositoryType(pkg.repository.url) + type: pkg.repository.type || _guessRepositoryType(pkg.repository.url), + directory: pkg.repository.directory, }, license: _validateLicense(pkg.license), @@ -130,7 +132,6 @@ export async function loadProjectInfo(projectRoot: string, { fixPeerDependencies excludeTypescript: (pkg.jsii && pkg.jsii.excludeTypescript) || [], projectReferences: pkg.jsii && pkg.jsii.projectReferences, - locationInRepository: pkg.jsii && pkg.jsii.locationInRepository }; } diff --git a/packages/jsii/lib/utils.ts b/packages/jsii/lib/utils.ts index 5370d84525..6ec57e7a82 100644 --- a/packages/jsii/lib/utils.ts +++ b/packages/jsii/lib/utils.ts @@ -41,27 +41,3 @@ export function logDiagnostic(diagnostic: ts.Diagnostic, projectRoot: string) { if (!logFunc) { return; } logFunc(message.trim()); } - -/** - * A filter function for ``JSON.stringify`` that removes: - * - ``false``-y values (``false``, empty strings, 0) - * - empty arrays - * - empty objects - * - * @param _key the key of the key-value pair being filtered (not used). - * @param value the value of the key-value pair being filtered. - * - * @returns ``value`` or ``undefined`` - */ -export function filterEmpty(_key: string, value: any): any { - if (!value) { - return undefined; - } - if (Array.isArray(value) && value.length === 0) { - return undefined; - } - if (typeof value === 'object' && Object.keys(value).length === 0) { - return undefined; - } - return value; -} diff --git a/packages/jsii/lib/validator.ts b/packages/jsii/lib/validator.ts index 9c277d39dd..2ff4c5895a 100644 --- a/packages/jsii/lib/validator.ts +++ b/packages/jsii/lib/validator.ts @@ -161,7 +161,7 @@ function _defaultValidations(): ValidationFunction[] { return _validateMethodOverride(method, baseType); } _assertSignaturesMatch(overridden, method, `${type.fqn}#${method.name}`, `overriding ${baseType.fqn}`); - method.overrides = { fqn: baseType.fqn }; + method.overrides = baseType.fqn; return true; } @@ -174,7 +174,7 @@ function _defaultValidations(): ValidationFunction[] { return _validatePropertyOverride(property, baseType); } _assertPropertiesMatch(overridden, property, `${type.fqn}#${property.name}`, `overriding ${baseType.fqn}`); - property.overrides = { fqn: baseType.fqn }; + property.overrides = baseType.fqn; return true; } @@ -191,7 +191,7 @@ function _defaultValidations(): ValidationFunction[] { const implemented = (ifaceType.methods || []).find(m => m.name === method.name); if (implemented) { _assertSignaturesMatch(implemented, method, `${type.fqn}#${method.name}`, `implementing ${ifaceType.fqn}`); - method.overrides = { fqn: iface.fqn }; + method.overrides = iface; return true; } if (_validateMethodImplementation(method, ifaceType)) { @@ -214,7 +214,7 @@ function _defaultValidations(): ValidationFunction[] { const implemented = (ifaceType.properties || []).find(p => p.name === property.name); if (implemented) { _assertPropertiesMatch(implemented, property, `${type.fqn}#${property.name}`, `implementing ${ifaceType.fqn}`); - property.overrides = { fqn: iface.fqn }; + property.overrides = ifaceType.fqn; return true; } if (_validatePropertyImplementation(property, ifaceType)) { @@ -226,8 +226,8 @@ function _defaultValidations(): ValidationFunction[] { function _assertSignaturesMatch(expected: spec.Method, actual: spec.Method, label: string, action: string) { if (!deepEqual(actual.returns, expected.returns)) { - const expType = spec.describeTypeReference(expected.returns); - const actType = spec.describeTypeReference(actual.returns); + const expType = spec.describeTypeReference(expected.returns && expected.returns.type); + const actType = spec.describeTypeReference(actual.returns && actual.returns.type); diagnostic(ts.DiagnosticCategory.Error, `${label} changes the return type when ${action} (expected ${expType}, found ${actType})`); } @@ -248,10 +248,10 @@ function _defaultValidations(): ValidationFunction[] { `${label} changes type of argument ${actParam.name} when ${action} (expected ${expType}, found ${actType}`); } // Not-ing those to force the values to a strictly boolean context (they're optional, undefined means false) - if (!expParam.variadic !== !actParam.variadic) { + if (expParam.variadic !== actParam.variadic) { diagnostic(ts.DiagnosticCategory.Error, // tslint:disable-next-line:max-line-length - `${label} changes the variadicity of argument ${actParam.name} when ${action} (expected ${expParam.variadic}, found ${actParam.variadic})`); + `${label} changes the variadicity of parameter ${actParam.name} when ${action} (expected ${expParam.variadic}, found ${actParam.variadic})`); } } } @@ -304,10 +304,10 @@ function _allTypeReferences(assm: spec.Assembly): spec.NamedTypeReference[] { for (const type of _allTypes(assm)) { if (!spec.isClassOrInterfaceType(type)) { continue; } if (spec.isClassType(type) && type.base) { - typeReferences.push(type.base); + typeReferences.push({ fqn: type.base }); } if (type.interfaces) { - type.interfaces.forEach(iface => typeReferences.push(iface)); + type.interfaces.forEach(iface => typeReferences.push({ fqn: iface })); } } for (const prop of _allProperties(assm)) { @@ -315,7 +315,7 @@ function _allTypeReferences(assm: spec.Assembly): spec.NamedTypeReference[] { } for (const meth of _allMethods(assm)) { if (meth.returns) { - _collectTypeReferences(meth.returns); + _collectTypeReferences(meth.returns.type); } for (const param of meth.parameters || []) { _collectTypeReferences(param.type); @@ -329,18 +329,21 @@ function _allTypeReferences(assm: spec.Assembly): spec.NamedTypeReference[] { } else if (spec.isCollectionTypeReference(type)) { _collectTypeReferences(type.collection.elementtype); } else if (spec.isUnionTypeReference(type)) { - type.union.types.forEach(t => _collectTypeReferences(t)); + type.union.types.forEach(_collectTypeReferences); } } } -function _dereference(typeRef: spec.NamedTypeReference, assembly: spec.Assembly, validator: Validator): spec.Type | undefined { - const [assm, ] = typeRef.fqn.split('.'); +function _dereference(typeRef: string | spec.NamedTypeReference, assembly: spec.Assembly, validator: Validator): spec.Type | undefined { + if (typeof typeRef !== 'string') { + typeRef = typeRef.fqn; + } + const [assm, ] = typeRef.split('.'); if (assembly.name === assm) { - return assembly.types && assembly.types[typeRef.fqn]; + return assembly.types && assembly.types[typeRef]; } const foreignAssm = validator.projectInfo.transitiveDependencies.find(dep => dep.name === assm); - return foreignAssm && foreignAssm.types && foreignAssm.types[typeRef.fqn]; + return foreignAssm && foreignAssm.types && foreignAssm.types[typeRef]; } function _isEmpty(array: undefined | any[]): array is undefined { diff --git a/packages/jsii/package-lock.json b/packages/jsii/package-lock.json index 52f5dd0c2b..c837ca0163 100644 --- a/packages/jsii/package-lock.json +++ b/packages/jsii/package-lock.json @@ -1,6 +1,6 @@ { "name": "jsii", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -111,11 +111,6 @@ "to-fast-properties": "^2.0.0" } }, - "@microsoft/tsdoc": { - "version": "0.12.8", - "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.12.8.tgz", - "integrity": "sha512-0smzAmVIUCsssAqDSPn9AfOPKUobq2WXMygbzC5JNswAJOs4uJK6DTZgfnHC8QLE2q374sPNwWU5D5LuoAJQSA==" - }, "@types/clone": { "version": "0.1.30", "resolved": "https://registry.npmjs.org/@types/clone/-/clone-0.1.30.tgz", @@ -2722,9 +2717,9 @@ "dev": true }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==" + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==" }, "unicode-length": { "version": "1.0.3", diff --git a/packages/jsii/package.json b/packages/jsii/package.json index 3eed8a8050..995618b456 100644 --- a/packages/jsii/package.json +++ b/packages/jsii/package.json @@ -44,7 +44,7 @@ "semver": "^5.6.0", "sort-json": "^2.0.0", "spdx-license-list": "^5.0.0", - "typescript": "^3.3.3333", + "typescript": "^3.4.2", "yargs": "^13.2.2" }, "nyc": { diff --git a/packages/jsii/test/negatives/neg.non-optional-after-optional-ctor.ts b/packages/jsii/test/negatives/neg.non-optional-after-optional-ctor.ts index 060921acdc..bb320ef620 100644 --- a/packages/jsii/test/negatives/neg.non-optional-after-optional-ctor.ts +++ b/packages/jsii/test/negatives/neg.non-optional-after-optional-ctor.ts @@ -1,4 +1,4 @@ -///!MATCH_ERROR: Parameter _arg3 must be optional since it comes after an optional parameter +///!MATCH_ERROR: Parameter _arg2 cannot be optional, as it precedes non-optional parameter _arg3 export class NonOptionalAfterOptional { constructor(_arg1: string, _arg2 = 'hello', _arg3: string) { diff --git a/packages/jsii/test/negatives/neg.non-optional-after-optional-method.ts b/packages/jsii/test/negatives/neg.non-optional-after-optional-method.ts index 83ac8f3b76..25e8f0bb7d 100644 --- a/packages/jsii/test/negatives/neg.non-optional-after-optional-method.ts +++ b/packages/jsii/test/negatives/neg.non-optional-after-optional-method.ts @@ -1,4 +1,4 @@ -///!MATCH_ERROR: Parameter _argX must be optional since it comes after an optional parameter +///!MATCH_ERROR: Parameter _arg2 cannot be optional, as it precedes non-optional parameter _argX export class NonOptionalAfterOptional { public foo(_arg1: string, _arg2 = 'hello', _argX: string, _arg4?: boolean) { diff --git a/packages/jsii/test/test.project-info.ts b/packages/jsii/test/test.project-info.ts index 4d4a7207a4..b8b78dac30 100644 --- a/packages/jsii/test/test.project-info.ts +++ b/packages/jsii/test/test.project-info.ts @@ -224,7 +224,7 @@ export = nodeunit.testCase({ }); const TEST_DEP_ASSEMBLY: spec.Assembly = { - schema: spec.SchemaVersion.V1_0, + schema: spec.SchemaVersion.LATEST, name: 'jsii-test-dep', version: '1.2.4', license: 'Apache-2.0', @@ -236,14 +236,13 @@ const TEST_DEP_ASSEMBLY: spec.Assembly = { dependencies: { 'jsii-test-dep-dep': { version: '3.2.1', - peer: true, } }, jsiiVersion: VERSION, }; const TEST_DEP_DEP_ASSEMBLY: spec.Assembly = { - schema: spec.SchemaVersion.V1_0, + schema: spec.SchemaVersion.LATEST, name: 'jsii-test-dep-dep', version: '3.2.1', license: 'Apache-2.0', diff --git a/packages/oo-ascii-tree/package-lock.json b/packages/oo-ascii-tree/package-lock.json index 56bcc16ebc..9cf1888698 100644 --- a/packages/oo-ascii-tree/package-lock.json +++ b/packages/oo-ascii-tree/package-lock.json @@ -1,6 +1,6 @@ { "name": "oo-ascii-tree", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -4144,9 +4144,9 @@ "dev": true }, "ts-jest": { - "version": "23.10.5", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-23.10.5.tgz", - "integrity": "sha512-MRCs9qnGoyKgFc8adDEntAOP64fWK1vZKnOYU1o2HxaqjdJvGqmkLCPCnVq1/If4zkUmEjKPnCiUisTrlX2p2A==", + "version": "24.0.1", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.0.1.tgz", + "integrity": "sha512-mgNZmYPuGBNgYpUzchI7vdSr6zATQI0TrSyzREnXHuPCvlW8T1DQ/fdscgx4ivS5vAMUGUaoxGdWIVHC5I8imw==", "dev": true, "requires": { "bs-logger": "0.x", @@ -4202,9 +4202,9 @@ } }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", "dev": true }, "uglify-js": { diff --git a/packages/oo-ascii-tree/package.json b/packages/oo-ascii-tree/package.json index f0ed99a6b0..f16fde3cb1 100644 --- a/packages/oo-ascii-tree/package.json +++ b/packages/oo-ascii-tree/package.json @@ -15,8 +15,8 @@ "@types/node": "^8.10.43", "jest": "^24.1.0", "jsii-build-tools": "^0.9.0", - "ts-jest": "^23.10.5", - "typescript": "^3.3.3333" + "ts-jest": "^24.0.1", + "typescript": "^3.4.2" }, "author": { "name": "Amazon Web Services", diff --git a/packages/oo-ascii-tree/tsconfig.json b/packages/oo-ascii-tree/tsconfig.json index abb6788fba..b7272dae85 100644 --- a/packages/oo-ascii-tree/tsconfig.json +++ b/packages/oo-ascii-tree/tsconfig.json @@ -22,6 +22,8 @@ "resolveJsonModule": true, "strict": true, "strictNullChecks": true, - "target": "ES2018" - } + "target": "ES2018", + "composite": true + }, + "include": ["**/*.ts"] }