├── .all-contributorsrc ├── .devcontainer.json ├── .dockerignore ├── .eslintrc.yaml ├── .flake8 ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.yml │ ├── config.yml │ ├── documentation.yml │ └── feature-request.yml ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── auto-approve.yml │ ├── close-stale-issues.yml │ ├── closed-issue-message.yml │ ├── gh-pages.yml │ ├── handle-stale-discussions.yml │ ├── issue-regression-labeler.yml │ ├── main.yml │ ├── pull-request-lint.yml │ └── yarn-upgrade.yml ├── .gitignore ├── .mergify └── config.yml ├── .npmrc ├── .prettierrc.yaml ├── .versionrc.json ├── .yarnrc ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE ├── README.md ├── buildspec.yaml ├── eslint-config.yaml ├── gh-pages ├── .gitignore ├── content │ ├── .pages.yml │ ├── assets │ │ ├── images │ │ │ ├── favicon.png │ │ │ └── logo.png │ │ ├── stylesheets │ │ │ ├── amazon-ember-display.css │ │ │ └── extra.css │ │ └── typefaces │ │ │ ├── AmazonEmberDisplay_Bd.eot │ │ │ ├── AmazonEmberDisplay_Bd.ttf │ │ │ ├── AmazonEmberDisplay_Bd.woff │ │ │ ├── AmazonEmberDisplay_Bd.woff2 │ │ │ ├── AmazonEmberDisplay_Lt.eot │ │ │ ├── AmazonEmberDisplay_Lt.ttf │ │ │ ├── AmazonEmberDisplay_Lt.woff │ │ │ ├── AmazonEmberDisplay_Lt.woff2 │ │ │ ├── AmazonEmberDisplay_Md.eot │ │ │ ├── AmazonEmberDisplay_Md.ttf │ │ │ ├── AmazonEmberDisplay_Md.woff │ │ │ ├── AmazonEmberDisplay_Md.woff2 │ │ │ ├── AmazonEmberDisplay_Rg.eot │ │ │ ├── AmazonEmberDisplay_Rg.ttf │ │ │ ├── AmazonEmberDisplay_Rg.woff │ │ │ └── AmazonEmberDisplay_Rg.woff2 │ ├── compiler-and-rosetta-maintenance.md │ ├── decisions │ │ ├── .pages.yml │ │ ├── _README.md │ │ └── introduction.md │ ├── index.md │ ├── overview │ │ ├── features.md │ │ ├── runtime-architecture.md │ │ ├── runtime-architecture.monopic │ │ └── toolchain.md │ ├── specification │ │ ├── .pages.yml │ │ ├── 1-introduction.md │ │ ├── 2-type-system.md │ │ ├── 3-kernel-api.md │ │ ├── 4-standard-compliance-suite.md │ │ ├── 5-new-language-intake.md │ │ └── 6-compliance-report.md │ └── user-guides │ │ ├── .pages.yml │ │ ├── index.md │ │ ├── language-support │ │ ├── .pages.yml │ │ ├── assembly.md │ │ ├── callbacks.md │ │ ├── callbacks.monopic │ │ └── index.md │ │ ├── lib-author │ │ ├── .pages.yml │ │ ├── configuration │ │ │ ├── index.md │ │ │ └── targets │ │ │ │ ├── .pages.yml │ │ │ │ ├── dotnet.md │ │ │ │ ├── go.md │ │ │ │ ├── java.md │ │ │ │ └── python.md │ │ ├── hints.md │ │ ├── index.md │ │ ├── quick-start │ │ │ ├── set-up.md │ │ │ └── write-code.md │ │ ├── toolchain │ │ │ ├── .pages.yml │ │ │ └── jsii.md │ │ └── typescript-restrictions.md │ │ └── lib-user │ │ ├── .pages.yml │ │ ├── index.md │ │ └── language-specific │ │ ├── .pages.yml │ │ ├── go.md │ │ └── python.md ├── mkdocs.yml ├── partials │ ├── node-support-table.md │ └── tsconfig-rulesets.md ├── requirements-dev.txt └── start.sh ├── jest.config.mjs ├── lerna.json ├── logo ├── png │ ├── 1024-white.png │ ├── 1024.png │ ├── 1024x1024.png │ ├── 128-white.png │ ├── 128.png │ ├── 128x128.png │ ├── 256-white.png │ ├── 256.png │ ├── 256x256.png │ ├── 512-white.png │ ├── 512.png │ ├── 512x512.png │ ├── 64-white.png │ ├── 64.png │ └── 64x64.png ├── social-preview.png └── svg │ └── master.svg ├── package.json ├── packages ├── @fixtures │ └── jsii-calc-bundled │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── index.js │ │ └── package.json ├── @jsii │ ├── Directory.Build.targets │ ├── check-node │ │ ├── .eslintrc.yaml │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── jest.config.mjs │ │ ├── package.json │ │ ├── run.js │ │ ├── src │ │ │ ├── constants.test.ts │ │ │ ├── constants.ts │ │ │ ├── index.test.ts │ │ │ ├── index.ts │ │ │ └── run.ts │ │ └── tsconfig.json │ ├── dotnet-runtime-test │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── Directory.Build.props.t.js │ │ ├── LICENSE │ │ ├── build.sh │ │ ├── generate.sh │ │ ├── lib │ │ │ └── index.ts │ │ ├── package.json │ │ ├── test.sh │ │ ├── test │ │ │ ├── Amazon.JSII.Runtime.IntegrationTests.FSharp │ │ │ │ ├── Amazon.JSII.Runtime.IntegrationTests.FSharp.fsproj │ │ │ │ └── Tests.fs │ │ │ ├── Amazon.JSII.Runtime.IntegrationTests.sln │ │ │ ├── Amazon.JSII.Runtime.IntegrationTests.sln.DotSettings.user │ │ │ ├── Amazon.JSII.Runtime.IntegrationTests │ │ │ │ ├── Amazon.JSII.Runtime.IntegrationTests.csproj │ │ │ │ ├── ComplianceTests.cs │ │ │ │ ├── ServiceContainerFixture.cs │ │ │ │ ├── TypeCheckingTests.cs │ │ │ │ └── XUnitLogger.cs │ │ │ └── NuGet.Config │ │ └── tsconfig.json │ ├── dotnet-runtime │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── Directory.Build.props.t.js │ │ ├── JsiiRuntimeProvider.t.js │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── NuGet.Metadata.props.t.js │ │ ├── generate.sh │ │ ├── lib │ │ │ └── index.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── Amazon.JSII.Analyzers.UnitTests │ │ │ │ ├── Amazon.JSII.Analyzers.UnitTests.csproj │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ ├── Helpers │ │ │ │ │ └── DiagnosticResult.cs │ │ │ │ ├── JsiiOptionalAnalyzerTests.cs │ │ │ │ └── Verifiers │ │ │ │ │ ├── DiagnosticVerifier.Helper.cs │ │ │ │ │ └── DiagnosticVerifier.cs │ │ │ ├── Amazon.JSII.Analyzers │ │ │ │ ├── Amazon.JSII.Analyzers.csproj │ │ │ │ ├── AnalyzerReleases.Shipped.md │ │ │ │ ├── AnalyzerReleases.Unshipped.md │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ ├── JsiiOptionalAnalyzer.cs │ │ │ │ └── tools │ │ │ │ │ ├── install.ps1 │ │ │ │ │ └── uninstall.ps1 │ │ │ ├── Amazon.JSII.JsonModel │ │ │ │ ├── Amazon.JSII.JsonModel.csproj │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── Amazon.JSII.Runtime.UnitTests │ │ │ │ ├── Amazon.JSII.Runtime.UnitTests.csproj │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ ├── Client │ │ │ │ │ ├── ClientTests.cs │ │ │ │ │ └── RuntimeTests.cs │ │ │ │ ├── Deputy │ │ │ │ │ ├── Converters │ │ │ │ │ │ ├── FrameworkToJsiiConverterTests.cs │ │ │ │ │ │ ├── JsiiToFrameworkConverterTests.cs │ │ │ │ │ │ └── TestDeputies.cs │ │ │ │ │ └── DeputyBaseTests.cs │ │ │ │ └── JsonModel │ │ │ │ │ ├── AssemblyTests.cs │ │ │ │ │ ├── ClassTypeTests.cs │ │ │ │ │ ├── CollectionKindTests.cs │ │ │ │ │ ├── CollectionTypeReferenceTests.cs │ │ │ │ │ ├── DocsTests.cs │ │ │ │ │ ├── EnumMemberTests.cs │ │ │ │ │ └── TestUtils.cs │ │ │ ├── Amazon.JSII.Runtime.sln │ │ │ ├── Amazon.JSII.Runtime │ │ │ │ ├── Amazon.JSII.Runtime.csproj │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ ├── CallbackExtensions.cs │ │ │ │ ├── Configuration.cs │ │ │ │ ├── Deputy │ │ │ │ │ ├── AnonymousObject.cs │ │ │ │ │ ├── ByRefValue.cs │ │ │ │ │ ├── DateValue.cs │ │ │ │ │ ├── DeputyBase.cs │ │ │ │ │ ├── EnumValue.cs │ │ │ │ │ ├── JsiiAssemblyAttribute.cs │ │ │ │ │ ├── JsiiByValueAttribute.cs │ │ │ │ │ ├── JsiiClassAttribute.cs │ │ │ │ │ ├── JsiiEnumAttribute.cs │ │ │ │ │ ├── JsiiEnumMemberAttribute.cs │ │ │ │ │ ├── JsiiInterfaceAttribute.cs │ │ │ │ │ ├── JsiiMethodAttribute.cs │ │ │ │ │ ├── JsiiOptionalAttribute.cs │ │ │ │ │ ├── JsiiPropertyAttribute.cs │ │ │ │ │ ├── JsiiTypeAttributeBase.cs │ │ │ │ │ └── JsiiTypeProxyAttribute.cs │ │ │ │ ├── JsiiException.cs │ │ │ │ ├── JsonModel │ │ │ │ │ ├── Api │ │ │ │ │ │ ├── Callback.cs │ │ │ │ │ │ ├── NamedError.cs │ │ │ │ │ │ ├── ObjectReference.cs │ │ │ │ │ │ ├── Override.cs │ │ │ │ │ │ ├── Request │ │ │ │ │ │ │ ├── BeginRequest.cs │ │ │ │ │ │ │ ├── CallbacksRequest.cs │ │ │ │ │ │ │ ├── CompleteRequest.cs │ │ │ │ │ │ │ ├── CreateRequest.cs │ │ │ │ │ │ │ ├── DeleteRequest.cs │ │ │ │ │ │ │ ├── EndRequest.cs │ │ │ │ │ │ │ ├── GetRequest.cs │ │ │ │ │ │ │ ├── IKernelRequest.cs │ │ │ │ │ │ │ ├── InvokeRequest.cs │ │ │ │ │ │ │ ├── LoadRequest.cs │ │ │ │ │ │ │ ├── NamingRequest.cs │ │ │ │ │ │ │ ├── SetRequest.cs │ │ │ │ │ │ │ ├── StaticGetRequest.cs │ │ │ │ │ │ │ ├── StaticInvokeRequest.cs │ │ │ │ │ │ │ ├── StaticSetRequest.cs │ │ │ │ │ │ │ └── StatsRequest.cs │ │ │ │ │ │ └── Response │ │ │ │ │ │ │ ├── BeginResponse.cs │ │ │ │ │ │ │ ├── CallbackResponse.cs │ │ │ │ │ │ │ ├── CallbacksResponse.cs │ │ │ │ │ │ │ ├── CompleteResponse.cs │ │ │ │ │ │ │ ├── CreateResponse.cs │ │ │ │ │ │ │ ├── DeleteResponse.cs │ │ │ │ │ │ │ ├── EndResponse.cs │ │ │ │ │ │ │ ├── ErrorResponse.cs │ │ │ │ │ │ │ ├── GetResponse.cs │ │ │ │ │ │ │ ├── HelloResponse.cs │ │ │ │ │ │ │ ├── IKernelResponse.cs │ │ │ │ │ │ │ ├── InvokeResponse.cs │ │ │ │ │ │ │ ├── LoadResponse.cs │ │ │ │ │ │ │ ├── NamingResponse.cs │ │ │ │ │ │ │ ├── OkResponse.cs │ │ │ │ │ │ │ ├── SetResponse.cs │ │ │ │ │ │ │ └── StatsResponse.cs │ │ │ │ │ ├── Converters │ │ │ │ │ │ ├── TypeConverter.cs │ │ │ │ │ │ ├── TypeDictionaryConverter.cs │ │ │ │ │ │ └── Util.cs │ │ │ │ │ ├── FileSystem │ │ │ │ │ │ ├── FileSystem.cs │ │ │ │ │ │ └── IFileSystem.cs │ │ │ │ │ ├── JsonDictionaryBase.cs │ │ │ │ │ └── Spec │ │ │ │ │ │ ├── Assembly.cs │ │ │ │ │ │ ├── AssemblyTargets.cs │ │ │ │ │ │ ├── Callable.cs │ │ │ │ │ │ ├── ClassType.cs │ │ │ │ │ │ ├── CollectionKind.cs │ │ │ │ │ │ ├── CollectionTypeReference.cs │ │ │ │ │ │ ├── Constants.cs │ │ │ │ │ │ ├── DependencyRoot.cs │ │ │ │ │ │ ├── Docs.cs │ │ │ │ │ │ ├── EnumMember.cs │ │ │ │ │ │ ├── EnumType.cs │ │ │ │ │ │ ├── IDocumentable.cs │ │ │ │ │ │ ├── IOverridable.cs │ │ │ │ │ │ ├── Initializer.cs │ │ │ │ │ │ ├── InterfaceType.cs │ │ │ │ │ │ ├── Method.cs │ │ │ │ │ │ ├── OptionalValue.cs │ │ │ │ │ │ ├── PackageVersion.cs │ │ │ │ │ │ ├── Parameter.cs │ │ │ │ │ │ ├── Person.cs │ │ │ │ │ │ ├── PrimitiveType.cs │ │ │ │ │ │ ├── Property.cs │ │ │ │ │ │ ├── Readme.cs │ │ │ │ │ │ ├── Stability.cs │ │ │ │ │ │ ├── Type.cs │ │ │ │ │ │ ├── TypeKind.cs │ │ │ │ │ │ ├── TypeReference.cs │ │ │ │ │ │ ├── UnionTypeReference.cs │ │ │ │ │ │ └── UserTypeReference.cs │ │ │ │ ├── ReflectionUtils.cs │ │ │ │ └── Services │ │ │ │ │ ├── Client.cs │ │ │ │ │ ├── Converters │ │ │ │ │ ├── FrameworkToJsiiConverter.cs │ │ │ │ │ ├── IFrameworkToJsiiConverter.cs │ │ │ │ │ ├── IJsiiToFrameworkConverter.cs │ │ │ │ │ ├── JsiiToFrameworkConverter.cs │ │ │ │ │ └── ValueConverter.cs │ │ │ │ │ ├── IClient.cs │ │ │ │ │ ├── IJsiiRuntimeProvider.cs │ │ │ │ │ ├── ILoadedPackageSet.cs │ │ │ │ │ ├── INodeProcess.cs │ │ │ │ │ ├── IReferenceMap.cs │ │ │ │ │ ├── IResourceExtractor.cs │ │ │ │ │ ├── IRuntime.cs │ │ │ │ │ ├── ITypeCache.cs │ │ │ │ │ ├── LoadedPackageSet.cs │ │ │ │ │ ├── NodeProcess.cs │ │ │ │ │ ├── ReferenceMap.cs │ │ │ │ │ ├── ResourceExtractor.cs │ │ │ │ │ ├── Runtime.cs │ │ │ │ │ ├── ServiceContainer.cs │ │ │ │ │ └── TypeCache.cs │ │ │ └── NuGet.Config │ │ └── tsconfig.json │ ├── go-runtime-test │ │ ├── .eslintrc.yaml │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── build-tools │ │ │ └── gen-calc.ts │ │ ├── package.json │ │ ├── project │ │ │ ├── callbacks_test.go │ │ │ ├── compliance.go │ │ │ ├── compliance_test.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── internal │ │ │ │ ├── addTen │ │ │ │ │ └── addTen.go │ │ │ │ ├── bellRinger │ │ │ │ │ └── bellRinger.go │ │ │ │ ├── cdk16625 │ │ │ │ │ └── cdk16625.go │ │ │ │ ├── doNotOverridePrivates │ │ │ │ │ └── doNotOverridePrivates.go │ │ │ │ ├── friendlyRandom │ │ │ │ │ └── friendlyRandom.go │ │ │ │ ├── overrideAsyncMethods │ │ │ │ │ └── overrideAsyncMethods.go │ │ │ │ ├── syncOverrides │ │ │ │ │ └── syncOverrides.go │ │ │ │ ├── twoOverrides │ │ │ │ │ └── twoOverrides.go │ │ │ │ └── wallClock │ │ │ │ │ └── wallClock.go │ │ │ ├── main_test.go │ │ │ ├── nativeobjectwithinterdfaces.go │ │ │ ├── runtime_type_checking_test.go │ │ │ └── tools.go │ │ └── tsconfig.json │ ├── go-runtime │ │ ├── .eslintrc.yaml │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── build-tools │ │ │ ├── _constants.ts │ │ │ ├── gen.ts │ │ │ └── package.sh │ │ ├── jsii-runtime-go │ │ │ ├── .gitattributes │ │ │ ├── CODE_OF_CONDUCT.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── cast.go │ │ │ ├── cast_test.go │ │ │ ├── deprecated.go │ │ │ ├── deprecationwarning.go │ │ │ ├── doc.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── helpers.go │ │ │ ├── helpers_test.go │ │ │ ├── internal │ │ │ │ ├── api │ │ │ │ │ ├── api.go │ │ │ │ │ └── doc.go │ │ │ │ ├── compiler │ │ │ │ │ ├── go1.16.go │ │ │ │ │ └── go1.17.go │ │ │ │ ├── embedded │ │ │ │ │ ├── .gitattributes │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── embedded.go │ │ │ │ │ └── embedded_test.go │ │ │ │ ├── kernel │ │ │ │ │ ├── begin.go │ │ │ │ │ ├── callbacks.go │ │ │ │ │ ├── client.go │ │ │ │ │ ├── client_test.go │ │ │ │ │ ├── complete.go │ │ │ │ │ ├── conversions.go │ │ │ │ │ ├── create.go │ │ │ │ │ ├── del.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── end.go │ │ │ │ │ ├── get.go │ │ │ │ │ ├── invoke.go │ │ │ │ │ ├── json.go │ │ │ │ │ ├── load.go │ │ │ │ │ ├── manage-object.go │ │ │ │ │ ├── naming.go │ │ │ │ │ ├── process │ │ │ │ │ │ ├── consume-stderr.go │ │ │ │ │ │ ├── handshake.go │ │ │ │ │ │ ├── jsii-mock-runtime.js │ │ │ │ │ │ ├── process.go │ │ │ │ │ │ └── process_test.go │ │ │ │ │ ├── request-response-markers.go │ │ │ │ │ ├── set.go │ │ │ │ │ └── stats.go │ │ │ │ ├── objectstore │ │ │ │ │ ├── doc.go │ │ │ │ │ └── objectstore.go │ │ │ │ └── typeregistry │ │ │ │ │ ├── discover-implemented.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── overrides.go │ │ │ │ │ ├── registration.go │ │ │ │ │ ├── typeregistry.go │ │ │ │ │ └── validate-struct.go │ │ │ ├── jsii.go │ │ │ ├── runtime │ │ │ │ ├── doc.go │ │ │ │ ├── overrides_reflect_test.go │ │ │ │ ├── runtime.go │ │ │ │ └── type_checking.go │ │ │ └── tools.go │ │ ├── lib │ │ │ ├── index.ts │ │ │ └── local-runtime-modules.ts │ │ ├── package.json │ │ └── tsconfig.json │ ├── java-runtime-test │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── generate.sh │ │ ├── package.json │ │ ├── pom.xml.t.js │ │ ├── project │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ └── maven.config │ │ │ └── src │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── software │ │ │ │ └── amazon │ │ │ │ └── jsii │ │ │ │ ├── ComplianceSuiteHarness.java │ │ │ │ ├── JsiiVersionTest.java │ │ │ │ ├── ReloadingClassLoader.java │ │ │ │ └── testing │ │ │ │ ├── ComplianceTest.java │ │ │ │ ├── JsiiClientTest.java │ │ │ │ └── TypeCheckingTest.java │ │ └── user.xml.t.js │ ├── java-runtime │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── BundledRuntime.t.js │ │ ├── JsiiVersion.t.js │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── conf │ │ │ └── user.xml │ │ ├── generate.sh │ │ ├── lib │ │ │ └── index.ts │ │ ├── package.json │ │ ├── pom.xml.t.js │ │ ├── project │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ └── maven.config │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── software │ │ │ │ │ └── amazon │ │ │ │ │ └── jsii │ │ │ │ │ ├── Builder.java │ │ │ │ │ ├── Configuration.java │ │ │ │ │ ├── Internal.java │ │ │ │ │ ├── Jsii.java │ │ │ │ │ ├── JsiiCallbackHandler.java │ │ │ │ │ ├── JsiiClient.java │ │ │ │ │ ├── JsiiEngine.java │ │ │ │ │ ├── JsiiError.java │ │ │ │ │ ├── JsiiException.java │ │ │ │ │ ├── JsiiModule.java │ │ │ │ │ ├── JsiiObject.java │ │ │ │ │ ├── JsiiObjectMapper.java │ │ │ │ │ ├── JsiiObjectRef.java │ │ │ │ │ ├── JsiiPromise.java │ │ │ │ │ ├── JsiiRuntime.java │ │ │ │ │ ├── JsiiSerializable.java │ │ │ │ │ ├── Kernel.java │ │ │ │ │ ├── MessageInspector.java │ │ │ │ │ ├── NativeType.java │ │ │ │ │ ├── Optional.java │ │ │ │ │ ├── Stability.java │ │ │ │ │ ├── UnsafeCast.java │ │ │ │ │ ├── Util.java │ │ │ │ │ ├── api │ │ │ │ │ ├── Callback.java │ │ │ │ │ ├── CreateRequest.java │ │ │ │ │ ├── GetRequest.java │ │ │ │ │ ├── InvokeRequest.java │ │ │ │ │ ├── JsiiOverride.java │ │ │ │ │ ├── SetRequest.java │ │ │ │ │ └── package-info.java │ │ │ │ │ └── package-info.java │ │ │ │ └── test │ │ │ │ ├── java │ │ │ │ └── software │ │ │ │ │ └── amazon │ │ │ │ │ └── jsii │ │ │ │ │ ├── JsiiObjectMapperTest.java │ │ │ │ │ ├── JsiiObjectTest.java │ │ │ │ │ ├── JsiiRuntimeTest.java │ │ │ │ │ └── UnsafeCastTest.java │ │ │ │ └── resources │ │ │ │ ├── mockito-extensions │ │ │ │ └── org.mockito.plugins.MockMaker │ │ │ │ └── software │ │ │ │ └── amazon │ │ │ │ └── jsii │ │ │ │ └── complex-callback.json │ │ ├── tsconfig.json │ │ └── user.xml.t.js │ ├── kernel │ │ ├── .eslintrc.yaml │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── jest.config.mjs │ │ ├── package.json │ │ ├── src │ │ │ ├── api.ts │ │ │ ├── disk-cache │ │ │ │ ├── digest-file.ts │ │ │ │ ├── disk-cache.ts │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ ├── kernel.test.ts │ │ │ ├── kernel.ts │ │ │ ├── link.ts │ │ │ ├── objects.test.ts │ │ │ ├── objects.ts │ │ │ ├── on-exit.ts │ │ │ ├── recording.ts │ │ │ ├── serialization.test.ts │ │ │ ├── serialization.ts │ │ │ ├── serialization.ux.test.ts │ │ │ └── tar-cache │ │ │ │ ├── default-cache-root.ts │ │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── python-runtime │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── MANIFEST.in │ │ ├── NOTICE │ │ ├── build-tools │ │ │ ├── _constants.ts │ │ │ ├── deps.ts │ │ │ ├── gen-calc.ts │ │ │ ├── gen.ts │ │ │ └── venv.ts │ │ ├── mypy.ini │ │ ├── package.json │ │ ├── pyproject.toml │ │ ├── pytest.ini │ │ ├── requirements.txt │ │ ├── setup.py │ │ ├── src │ │ │ └── jsii │ │ │ │ ├── __init__.py │ │ │ │ ├── __meta__.py │ │ │ │ ├── _compat.py │ │ │ │ ├── _embedded │ │ │ │ ├── __init__.py │ │ │ │ └── jsii │ │ │ │ │ └── .gitkeep │ │ │ │ ├── _kernel │ │ │ │ ├── __init__.py │ │ │ │ ├── providers │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ └── process.py │ │ │ │ └── types.py │ │ │ │ ├── _reference_map.py │ │ │ │ ├── _runtime.py │ │ │ │ ├── _utils.py │ │ │ │ ├── compat.py │ │ │ │ ├── errors.py │ │ │ │ ├── py.typed │ │ │ │ └── python.py │ │ └── tests │ │ │ ├── README.md │ │ │ ├── __init__.py │ │ │ ├── test_compliance.py │ │ │ ├── test_invoke_bin.py │ │ │ ├── test_python.py │ │ │ └── test_runtime_type_checking.py │ ├── runtime │ │ ├── .eslintrc.yaml │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── bin │ │ │ ├── jsii-runtime │ │ │ └── jsii-runtime.ts │ │ ├── jest.config.mjs │ │ ├── lib │ │ │ ├── host.ts │ │ │ ├── in-out.ts │ │ │ ├── index.ts │ │ │ ├── program.ts │ │ │ └── sync-stdio.ts │ │ ├── package.json │ │ ├── test │ │ │ ├── __snapshots__ │ │ │ │ └── kernel-host.test.js.snap │ │ │ ├── kernel-host.test.ts │ │ │ ├── playback.test.ts │ │ │ └── stress.test.ts │ │ ├── tsconfig.json │ │ └── webpack.config.js │ └── spec │ │ ├── .eslintrc.yaml │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── build-tools │ │ └── generate-json-schema.sh │ │ ├── jest.config.mjs │ │ ├── package.json │ │ ├── src │ │ ├── assembly-utils.test.ts │ │ ├── assembly-utils.ts │ │ ├── assembly.ts │ │ ├── configuration.ts │ │ ├── index.ts │ │ ├── name-tree.test.ts │ │ ├── name-tree.ts │ │ ├── redirect.ts │ │ ├── validate-assembly.test.ts │ │ └── validate-assembly.ts │ │ ├── test-data │ │ └── previous-assemblies │ │ │ └── 0.21.2.jsii.json │ │ └── tsconfig.json ├── @scope │ ├── jsii-calc-base-of-base │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── lib │ │ │ └── index.ts │ │ ├── package.json │ │ └── test │ │ │ └── assembly.jsii │ ├── jsii-calc-base │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── lib │ │ │ └── index.ts │ │ ├── package.json │ │ └── test │ │ │ └── assembly.jsii │ └── jsii-calc-lib │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── deprecated-to-strip.txt │ │ ├── lib │ │ ├── deprecation-removal.ts │ │ ├── duplicate-inherited-prop.ts │ │ ├── index.ts │ │ └── submodule │ │ │ ├── .jsiirc.json │ │ │ ├── README.md │ │ │ └── index.ts │ │ ├── package.json │ │ └── test │ │ └── assembly.jsii ├── codemaker │ ├── .eslintrc.yaml │ ├── .gitignore │ ├── .npmignore │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── jest.config.mjs │ ├── package.json │ ├── src │ │ ├── case-utils.test.ts │ │ ├── case-utils.ts │ │ ├── codemaker.test.ts │ │ ├── codemaker.ts │ │ ├── filebuff.test.ts │ │ ├── filebuff.ts │ │ └── index.ts │ └── tsconfig.json ├── jsii-calc │ ├── .eslintrc.yaml │ ├── .gitignore │ ├── .npmignore │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── bin │ │ ├── run │ │ ├── run.cmd │ │ └── run.ts │ ├── lib │ │ ├── anonymous │ │ │ └── index.ts │ │ ├── calculator.ts │ │ ├── cdk16625 │ │ │ ├── donotimport │ │ │ │ └── index.ts │ │ │ └── index.ts │ │ ├── cdk22369 │ │ │ └── index.ts │ │ ├── compliance.ts │ │ ├── container-types.ts │ │ ├── date.ts │ │ ├── documented.ts │ │ ├── duplicate-inherited-prop.ts │ │ ├── erasures.ts │ │ ├── homonymous │ │ │ ├── README.md │ │ │ ├── bar.ts │ │ │ ├── foo.ts │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── indirect-implementation.ts │ │ ├── jsii3656 │ │ │ └── index.ts │ │ ├── module2530 │ │ │ └── index.ts │ │ ├── module2617 │ │ │ └── index.ts │ │ ├── module2647 │ │ │ └── index.ts │ │ ├── module2689 │ │ │ ├── index.ts │ │ │ ├── methods │ │ │ │ └── index.ts │ │ │ ├── props │ │ │ │ └── index.ts │ │ │ ├── retval │ │ │ │ └── index.ts │ │ │ └── structs │ │ │ │ └── index.ts │ │ ├── module2692 │ │ │ ├── index.ts │ │ │ ├── submodule1 │ │ │ │ └── index.ts │ │ │ └── submodule2 │ │ │ │ └── index.ts │ │ ├── module2700 │ │ │ └── index.ts │ │ ├── module2702 │ │ │ └── index.ts │ │ ├── nested-class.ts │ │ ├── no-direct-types │ │ │ ├── index.ts │ │ │ ├── sub1 │ │ │ │ └── index.ts │ │ │ └── sub2 │ │ │ │ └── index.ts │ │ ├── only-static │ │ │ └── index.ts │ │ ├── resource.txt │ │ ├── stability.ts │ │ ├── submodule │ │ │ ├── README.md │ │ │ ├── child │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ ├── isolated.README.md │ │ │ ├── isolated.ts │ │ │ ├── issue2637.ts │ │ │ ├── my-class.ts │ │ │ ├── nested_submodule.ts │ │ │ ├── param │ │ │ │ └── index.ts │ │ │ ├── refers-to-parent │ │ │ │ └── index.ts │ │ │ └── returns-param │ │ │ │ └── index.ts │ │ ├── submodules.ts │ │ └── union.ts │ ├── package.json │ ├── rosetta │ │ ├── default.ts-fixture │ │ └── with-calculator.ts-fixture │ ├── test │ │ ├── assembly.jsii │ │ ├── test.calc.ts │ │ └── test.transitive.ts │ └── update-all.sh ├── jsii-config │ ├── .eslintrc.yaml │ ├── .gitignore │ ├── .npmignore │ ├── LICENSE │ ├── README.md │ ├── bin │ │ ├── jsii-config │ │ └── jsii-config.ts │ ├── demo.gif │ ├── jest.config.mjs │ ├── lib │ │ ├── index.ts │ │ ├── prompt.ts │ │ ├── questions.ts │ │ ├── schema.ts │ │ ├── util.ts │ │ └── validate.ts │ ├── package.json │ ├── test │ │ ├── index.test.ts │ │ └── util.ts │ └── tsconfig.json ├── jsii-diff │ ├── .eslintrc.yaml │ ├── .gitignore │ ├── .npmignore │ ├── BREAKING_CHANGES.md │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── bin │ │ ├── jsii-diff │ │ └── jsii-diff.ts │ ├── generate.sh │ ├── jest.config.mjs │ ├── lib │ │ ├── diagnostics.ts │ │ ├── index.ts │ │ ├── stability.ts │ │ ├── type-analysis.ts │ │ ├── type-comparison.ts │ │ ├── types.ts │ │ ├── util.ts │ │ └── validations.ts │ ├── package.json │ ├── test │ │ ├── classes.test.ts │ │ ├── diagnostics.test.ts │ │ ├── enums.test.ts │ │ ├── structs.test.ts │ │ ├── type-unions.test.ts │ │ └── util.ts │ └── tsconfig.json ├── jsii-pacmak │ ├── .eslintrc.yaml │ ├── .gitignore │ ├── .npmignore │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── bin │ │ ├── jsii-pacmak │ │ └── jsii-pacmak.ts │ ├── generate.sh │ ├── jest.config.mjs │ ├── lib │ │ ├── builder.ts │ │ ├── dependency-graph.ts │ │ ├── generator.ts │ │ ├── index.ts │ │ ├── logging.ts │ │ ├── markdown.ts │ │ ├── naming-util.ts │ │ ├── npm-modules.ts │ │ ├── packaging.ts │ │ ├── target.ts │ │ ├── targets │ │ │ ├── _utils.ts │ │ │ ├── dotnet.ts │ │ │ ├── dotnet │ │ │ │ ├── dotnetdocgenerator.ts │ │ │ │ ├── dotnetgenerator.ts │ │ │ │ ├── dotnetruntimegenerator.ts │ │ │ │ ├── dotnettyperesolver.ts │ │ │ │ ├── filegenerator.ts │ │ │ │ ├── nameutils.ts │ │ │ │ └── runtime-type-checking.ts │ │ │ ├── go.ts │ │ │ ├── go │ │ │ │ ├── comparators.ts │ │ │ │ ├── dependencies.ts │ │ │ │ ├── documentation.ts │ │ │ │ ├── emit-context.ts │ │ │ │ ├── package.ts │ │ │ │ ├── readme-file.ts │ │ │ │ ├── runtime │ │ │ │ │ ├── class-constructor.ts │ │ │ │ │ ├── constants.ts │ │ │ │ │ ├── emit-arguments.ts │ │ │ │ │ ├── function-call.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── method-call.ts │ │ │ │ │ ├── property-access.ts │ │ │ │ │ ├── runtime-type-checking.ts │ │ │ │ │ └── util.ts │ │ │ │ ├── types │ │ │ │ │ ├── class.ts │ │ │ │ │ ├── enum.ts │ │ │ │ │ ├── go-type-reference.ts │ │ │ │ │ ├── go-type.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ ├── struct.ts │ │ │ │ │ └── type-member.ts │ │ │ │ ├── util.ts │ │ │ │ └── version-file.ts │ │ │ ├── index.ts │ │ │ ├── java.ts │ │ │ ├── js.ts │ │ │ ├── python.ts │ │ │ ├── python │ │ │ │ ├── requirements-dev.txt │ │ │ │ ├── type-name.ts │ │ │ │ └── util.ts │ │ │ └── version-utils.ts │ │ ├── timer.ts │ │ ├── toposort.ts │ │ └── util.ts │ ├── package.json │ ├── test │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── build-test.sh │ │ ├── dependency-graph.test.ts │ │ ├── generated-code │ │ │ ├── __snapshots__ │ │ │ │ ├── examples.test.js.snap │ │ │ │ ├── prerelease-identifiers.test.js.snap │ │ │ │ ├── target-dotnet.test.js.snap │ │ │ │ ├── target-go.test.js.snap │ │ │ │ ├── target-java.test.js.snap │ │ │ │ └── target-python.test.js.snap │ │ │ ├── all-targets-tested.test.ts │ │ │ ├── examples.test.ts │ │ │ ├── examples │ │ │ │ ├── diamond-struct-parameter.ts │ │ │ │ └── nested-types.ts │ │ │ ├── harness.ts │ │ │ ├── prerelease-identifiers.test.ts │ │ │ ├── python-pyright.test.ts │ │ │ ├── requirements-dev.txt │ │ │ ├── target-dotnet.test.ts │ │ │ ├── target-go.test.ts │ │ │ ├── target-java.test.ts │ │ │ └── target-python.test.ts │ │ ├── npm-modules.test.ts │ │ ├── python.test.ts │ │ ├── targets │ │ │ ├── fixtures │ │ │ │ ├── base.jsii.json │ │ │ │ └── dependent.jsii.json │ │ │ ├── go.test.ts │ │ │ ├── python │ │ │ │ └── type-name.test.ts │ │ │ └── version-utils.test.ts │ │ └── util.test.ts │ └── tsconfig.json ├── jsii-reflect │ ├── .eslintrc.yaml │ ├── .gitignore │ ├── .npmignore │ ├── LICENSE │ ├── README.md │ ├── bin │ │ ├── jsii-tree │ │ └── jsii-tree.ts │ ├── jest.config.mjs │ ├── lib │ │ ├── _memoized.ts │ │ ├── assembly.ts │ │ ├── callable.ts │ │ ├── class.ts │ │ ├── dependency.ts │ │ ├── docs.ts │ │ ├── enum.ts │ │ ├── index.ts │ │ ├── initializer.ts │ │ ├── interface.ts │ │ ├── method.ts │ │ ├── module-like.ts │ │ ├── optional-value.ts │ │ ├── overridable.ts │ │ ├── parameter.ts │ │ ├── property.ts │ │ ├── reference-type.ts │ │ ├── source.ts │ │ ├── submodule.ts │ │ ├── tree.ts │ │ ├── type-member.ts │ │ ├── type-ref.ts │ │ ├── type-system.ts │ │ ├── type.ts │ │ └── util.ts │ ├── package.json │ ├── test │ │ ├── __snapshots__ │ │ │ ├── jsii-tree.test.js.snap │ │ │ ├── tree.test.js.snap │ │ │ └── type-system.test.js.snap │ │ ├── _memoized.test.ts │ │ ├── independent.test.ts │ │ ├── jsii-tree.test.ts │ │ ├── tree.test.ts │ │ ├── type-system.test.ts │ │ └── util.ts │ └── tsconfig.json └── oo-ascii-tree │ ├── .eslintrc.yaml │ ├── .gitignore │ ├── .npmignore │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── jest.config.mjs │ ├── package.json │ ├── src │ ├── ascii-tree.ts │ ├── index.ts │ └── tree.test.ts │ ├── test-data │ ├── basic.expected.txt │ ├── big.expected.txt │ ├── extend.expected.txt │ └── multiline.expected.txt │ └── tsconfig.json ├── scripts ├── align-version.js ├── align-version.sh ├── build-js.sh ├── bump.sh ├── foreach.sh ├── get-version-marker.js ├── get-version.js ├── link-all.sh ├── list-reserved-words.ts ├── package.sh ├── path-prefix ├── sync-peer-deps.js └── upgrade-jsii.sh ├── tools ├── jsii-build-tools │ ├── .gitignore │ ├── LICENSE │ ├── NOTICE │ ├── bin │ │ ├── diff-test │ │ ├── package-dotnet │ │ ├── package-java │ │ ├── package-js │ │ ├── package-private │ │ ├── package-python │ │ └── package-ruby │ └── package.json └── jsii-compliance │ ├── .eslintrc.yaml │ ├── README.md │ ├── package.json │ ├── report.ts │ ├── schema.ts │ ├── suite.ts │ └── tsconfig.json ├── tsconfig-base.json ├── tsconfig.json └── yarn.lock /.devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dev Container - aws/jsii", 3 | "image": "public.ecr.aws/jsii/superchain:1-bookworm-slim", 4 | "containerUser": "superchain", 5 | "remoteUser": "superchain", 6 | "postCreateCommand": "yarn install", 7 | "customizations": { 8 | "vscode": { 9 | "extensions": ["dbaeumer.vscode-eslint", "Orta.vscode-jest"] 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | maven-repo 4 | -------------------------------------------------------------------------------- /.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: ./eslint-config.yaml 3 | root: true 4 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 88 3 | exclude = *.egg,*/interfaces.py,node_modules,.state 4 | ignore = W503,E203 5 | select = E,W,F,N 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Currently, this repository has LF dependecnies in building and testing, with json, sh, and no extensions. 5 | # Until this is fixed, it is best to just set the whole repository to be LF. 6 | * eol=lf 7 | 8 | *.gif binary 9 | *.zip binary 10 | *.png binary 11 | *.jpg binary 12 | *.tgz binary 13 | *.tar.gz binary 14 | 15 | # Github Linguist configuration (https://github.com/github/linguist) 16 | yarn.lock linguist-generated 17 | *.snap linguist-generated 18 | packages/@jsii/benchmarks/fixtures/** linguist-vendored 19 | docs/** linguist-documentation 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | blank_issues_enabled: false 3 | contact_links: 4 | - name: 💬 General Question 5 | url: https://github.com/aws/jsii/discussions/categories/q-a 6 | about: Please ask and answer questions as a discussion thread -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "📕 Documentation Issue" 3 | description: Report an issue in the API Reference documentation or Developer Guide 4 | title: "(short issue description)" 5 | labels: [documentation, needs-triage] 6 | assignees: [] 7 | body: 8 | - type: textarea 9 | id: description 10 | attributes: 11 | label: Describe the issue 12 | description: A clear and concise description of the issue. 13 | validations: 14 | required: true 15 | 16 | - type: textarea 17 | id: links 18 | attributes: 19 | label: Links 20 | description: | 21 | Include links to affected documentation page(s). 22 | validations: 23 | required: true 24 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | --- 4 | 5 | By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. 6 | 7 | [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0 8 | -------------------------------------------------------------------------------- /.github/workflows/closed-issue-message.yml: -------------------------------------------------------------------------------- 1 | name: Closed Issue Message 2 | on: 3 | issues: 4 | types: [closed] 5 | jobs: 6 | auto_comment: 7 | permissions: 8 | issues: write 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: aws-actions/closed-issue-message@v2 12 | with: 13 | # These inputs are both required 14 | repo-token: "${{ secrets.GITHUB_TOKEN }}" 15 | message: | 16 | This issue is now closed. Comments on closed issues are hard for our team to see. 17 | If you need more assistance, please open a new issue that references this one. 18 | -------------------------------------------------------------------------------- /.github/workflows/handle-stale-discussions.yml: -------------------------------------------------------------------------------- 1 | name: HandleStaleDiscussions 2 | on: 3 | schedule: 4 | - cron: '0 */4 * * *' 5 | discussion_comment: 6 | types: [created] 7 | 8 | jobs: 9 | handle-stale-discussions: 10 | name: Handle stale discussions 11 | runs-on: ubuntu-latest 12 | permissions: 13 | discussions: write 14 | steps: 15 | - name: Stale discussions action 16 | uses: aws-github-ops/handle-stale-discussions@v1 17 | env: 18 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} -------------------------------------------------------------------------------- /.github/workflows/pull-request-lint.yml: -------------------------------------------------------------------------------- 1 | name: pull-request-lint 2 | on: 3 | merge_group: {} 4 | pull_request_target: 5 | types: 6 | - labeled 7 | - opened 8 | - synchronize 9 | - reopened 10 | - ready_for_review 11 | - edited 12 | jobs: 13 | validate: 14 | name: Validate PR Title 15 | runs-on: ubuntu-latest 16 | permissions: 17 | pull-requests: write 18 | steps: 19 | - uses: amannn/action-semantic-pull-request@v5 20 | env: 21 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 22 | with: 23 | types: |- 24 | feat 25 | fix 26 | chore 27 | docs 28 | style 29 | refactor 30 | perf 31 | test 32 | build 33 | ci 34 | revert 35 | requireScope: false 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | lerna-debug.log 3 | pip-wheel-metadata/ 4 | tsconfig.tsbuildinfo 5 | .DS_Store 6 | .idea 7 | .vs 8 | dist/ 9 | .vscode 10 | *.map 11 | *.tsbuildinfo 12 | *.tabl.json 13 | *.swp 14 | *.snk 15 | build/ 16 | coverage/ 17 | jsii-outdir/ 18 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | # Helps with using npm package-locally, while in a yarn workflow (avoids coupling scripts to yarn). 2 | # This is needed because yarn goes out of it's way to ensure it controls what `node` binary is used (for good!) 3 | scripts-prepend-node-path=auto 4 | -------------------------------------------------------------------------------- /.prettierrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | bracketSpacing: true 3 | semi: true 4 | singleQuote: true 5 | tabWidth: 2 6 | trailingComma: all 7 | 8 | overrides: 9 | - files: "*.md" 10 | options: 11 | printWidth: 120 12 | proseWrap: always 13 | semi: true 14 | singleQuote: true 15 | quoteProps: as-needed 16 | trailingComma: all 17 | - files: "packages/jsii-rosetta/**" 18 | options: 19 | printWidth: 120 -------------------------------------------------------------------------------- /.versionrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "bumpFiles": [ 3 | { 4 | "filename": "lerna.json", 5 | "type": "json" 6 | } 7 | ], 8 | "packageFiles": [ 9 | { 10 | "filename": "lerna.json", 11 | "type": "json" 12 | } 13 | ], 14 | "skip": { 15 | "tag": true 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | --install.check-files true # install will verify file tree of packages for consistency 2 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /buildspec.yaml: -------------------------------------------------------------------------------- 1 | version: 0.2 2 | 3 | phases: 4 | install: 5 | commands: 6 | # Temporarily - install yarn if it's not there already 7 | - yarn --version || npm install --global yarn 8 | - yarn install --frozen-lockfile 9 | build: 10 | commands: 11 | - yarn build && yarn test 12 | - yarn dist-clean 13 | - /bin/bash ./scripts/align-version.sh 14 | - yarn build 15 | post_build: 16 | commands: 17 | - '[ ${CODEBUILD_BUILD_SUCCEEDING} = 1 ] && yarn package' 18 | artifacts: 19 | files: 20 | - "**/*" 21 | base-directory: dist 22 | -------------------------------------------------------------------------------- /gh-pages/.gitignore: -------------------------------------------------------------------------------- 1 | .venv/ 2 | -------------------------------------------------------------------------------- /gh-pages/content/.pages.yml: -------------------------------------------------------------------------------- 1 | --- 2 | nav: 3 | - ... 4 | - user-guides 5 | - specification 6 | - decisions 7 | -------------------------------------------------------------------------------- /gh-pages/content/assets/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/images/favicon.png -------------------------------------------------------------------------------- /gh-pages/content/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/images/logo.png -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.eot -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.ttf -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.woff -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Bd.woff2 -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.eot -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.ttf -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.woff -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Lt.woff2 -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.eot -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.ttf -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.woff -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Md.woff2 -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.eot -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.ttf -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.woff -------------------------------------------------------------------------------- /gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/assets/typefaces/AmazonEmberDisplay_Rg.woff2 -------------------------------------------------------------------------------- /gh-pages/content/decisions/.pages.yml: -------------------------------------------------------------------------------- 1 | --- 2 | title: Architecture Decisions 3 | order: desc 4 | nav: 5 | - introduction.md 6 | - ... | regex=\d{4}-\d{2}-\d{2}-.+.md 7 | -------------------------------------------------------------------------------- /gh-pages/content/decisions/_README.md: -------------------------------------------------------------------------------- 1 | # Format 2 | 3 | So you want to add a new Architecture Decision Record to this section. This 4 | document highlights how to proceed in order to achieve a consistent look and 5 | feel, and that we capture sufficient information. 6 | 7 | ## Create a new document 8 | 9 | Each ADR document should be named using the following format: 10 | `YYYY-MM-DD-short-name.md`. This allows ensuring the documents are rendered in 11 | the correct order on the website. If is recommended to prefix the file name 12 | with the date at which the decision has been made, in ISO-8601 format. 13 | 14 | ## Template 15 | 16 | The following template is to be used: 17 | https://github.com/joelparkerhenderson/architecture_decision_record/blob/master/adr_template_madr.md 18 | -------------------------------------------------------------------------------- /gh-pages/content/decisions/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | This section of the *jsii reference* is a log of all *Architectural Decisions* 4 | taken during the development of the *jsii* project. The *Records* are presented 5 | in reverse-chronological order (most recent decisions are listed first). 6 | -------------------------------------------------------------------------------- /gh-pages/content/overview/runtime-architecture.monopic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/overview/runtime-architecture.monopic -------------------------------------------------------------------------------- /gh-pages/content/specification/.pages.yml: -------------------------------------------------------------------------------- 1 | --- 2 | title: Specification 3 | nav: 4 | - 1-introduction.md 5 | - The jsii type system: 2-type-system.md 6 | - The jsii kernel API: 3-kernel-api.md 7 | - 4-standard-compliance-suite.md 8 | - 5-new-language-intake.md 9 | - Compliance Report: 6-compliance-report.md 10 | -------------------------------------------------------------------------------- /gh-pages/content/user-guides/.pages.yml: -------------------------------------------------------------------------------- 1 | --- 2 | nav: 3 | - index.md 4 | - lib-author 5 | - lib-user 6 | - language-support 7 | -------------------------------------------------------------------------------- /gh-pages/content/user-guides/language-support/.pages.yml: -------------------------------------------------------------------------------- 1 | --- 2 | title: Language Implementation 3 | nav: 4 | - index.md 5 | - .jsii Assemblies: assembly.md 6 | - callbacks.md 7 | -------------------------------------------------------------------------------- /gh-pages/content/user-guides/language-support/callbacks.monopic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/gh-pages/content/user-guides/language-support/callbacks.monopic -------------------------------------------------------------------------------- /gh-pages/content/user-guides/lib-author/.pages.yml: -------------------------------------------------------------------------------- 1 | --- 2 | title: Library Author Guide 3 | nav: 4 | - index.md 5 | - quick-start 6 | - typescript-restrictions.md 7 | - hints.md 8 | - configuration 9 | - toolchain 10 | -------------------------------------------------------------------------------- /gh-pages/content/user-guides/lib-author/configuration/targets/.pages.yml: -------------------------------------------------------------------------------- 1 | --- 2 | title: Configuration Reference 3 | nav: 4 | - .NET: dotnet.md 5 | - Go: go.md 6 | - Java: java.md 7 | - Python: python.md 8 | -------------------------------------------------------------------------------- /gh-pages/content/user-guides/lib-author/toolchain/.pages.yml: -------------------------------------------------------------------------------- 1 | --- 2 | title: Toolchain 3 | -------------------------------------------------------------------------------- /gh-pages/content/user-guides/lib-user/.pages.yml: -------------------------------------------------------------------------------- 1 | --- 2 | title: Library Consumer Guide 3 | nav: 4 | - index.md 5 | - language-specific 6 | -------------------------------------------------------------------------------- /gh-pages/content/user-guides/lib-user/index.md: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | 3 | ## :fontawesome-brands-node-js: Common Runtime 4 | 5 | Regardless of which language or platform your application is developed in, using *jsii modules* requires a compatible 6 | `node` runtime to be available in `$PATH`(see [Runtime Architecture]). Current `node` runtime versions support status is 7 | as follows: 8 | 9 | --8<-- "partials/node-support-table.md" 10 | 11 | [runtime architecture]: ../../overview/runtime-architecture.md 12 | -------------------------------------------------------------------------------- /gh-pages/content/user-guides/lib-user/language-specific/.pages.yml: -------------------------------------------------------------------------------- 1 | --- 2 | title: Language Specific 3 | nav: 4 | - Go: go.md 5 | - Python: python.md 6 | -------------------------------------------------------------------------------- /gh-pages/requirements-dev.txt: -------------------------------------------------------------------------------- 1 | mkdocs~=1.6.1 2 | mkdocs-awesome-pages-plugin~=2.10.1 3 | mkdocs-material~=9.6.14 4 | mkdocs-git-revision-date-plugin~=0.3.2 5 | -------------------------------------------------------------------------------- /gh-pages/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### 4 | # Starts a local server for the documentation website, for easy iteration. 5 | ## 6 | 7 | if [ ! -d .venv ]; then 8 | python3 -m venv --system-site-packages .venv 9 | fi 10 | source .venv/bin/activate 11 | 12 | python3 -m pip install -r requirements-dev.txt --upgrade 13 | 14 | python3 -m mkdocs serve 15 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmClient": "yarn", 3 | "rejectCycles": true, 4 | "packages": [ 5 | "packages/*", 6 | "packages/@jsii/*", 7 | "packages/@scope/*", 8 | "tools/*" 9 | ], 10 | "command": { 11 | "bootstrap": { 12 | "rejectCycles": true 13 | } 14 | }, 15 | "version": "1.112.0", 16 | "$schema": "node_modules/lerna/schemas/lerna-schema.json" 17 | } 18 | -------------------------------------------------------------------------------- /logo/png/1024-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/1024-white.png -------------------------------------------------------------------------------- /logo/png/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/1024.png -------------------------------------------------------------------------------- /logo/png/1024x1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/1024x1024.png -------------------------------------------------------------------------------- /logo/png/128-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/128-white.png -------------------------------------------------------------------------------- /logo/png/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/128.png -------------------------------------------------------------------------------- /logo/png/128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/128x128.png -------------------------------------------------------------------------------- /logo/png/256-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/256-white.png -------------------------------------------------------------------------------- /logo/png/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/256.png -------------------------------------------------------------------------------- /logo/png/256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/256x256.png -------------------------------------------------------------------------------- /logo/png/512-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/512-white.png -------------------------------------------------------------------------------- /logo/png/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/512.png -------------------------------------------------------------------------------- /logo/png/512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/512x512.png -------------------------------------------------------------------------------- /logo/png/64-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/64-white.png -------------------------------------------------------------------------------- /logo/png/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/64.png -------------------------------------------------------------------------------- /logo/png/64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/png/64x64.png -------------------------------------------------------------------------------- /logo/social-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/logo/social-preview.png -------------------------------------------------------------------------------- /packages/@fixtures/jsii-calc-bundled/.gitignore: -------------------------------------------------------------------------------- 1 | tsconfig.json 2 | dist 3 | .jsii 4 | *.tgz 5 | 6 | *.js 7 | *.d.ts 8 | *.tsbuildinfo 9 | node_modules/ 10 | .nyc_output/ 11 | coverage/ 12 | 13 | !index.js 14 | *.d.ts.map 15 | -------------------------------------------------------------------------------- /packages/@fixtures/jsii-calc-bundled/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@fixtures/jsii-calc-bundled/index.js: -------------------------------------------------------------------------------- 1 | module.export = 42; 2 | -------------------------------------------------------------------------------- /packages/@fixtures/jsii-calc-bundled/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@fixtures/jsii-calc-bundled", 3 | "version": "0.19.0", 4 | "private": true, 5 | "license": "Apache-2.0", 6 | "author": { 7 | "name": "Amazon Web Services", 8 | "url": "https://aws.amazon.com" 9 | }, 10 | "homepage": "https://github.com/aws/jsii", 11 | "bugs": { 12 | "url": "https://github.com/aws/jsii/issues" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/aws/jsii.git", 17 | "directory": "packages/@fixtures/jsii-calc-bundled" 18 | }, 19 | "engines": { 20 | "node": ">= 14.17.0" 21 | }, 22 | "main": "index.js" 23 | } 24 | -------------------------------------------------------------------------------- /packages/@jsii/check-node/.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: ../../../eslint-config.yaml 3 | -------------------------------------------------------------------------------- /packages/@jsii/check-node/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.d.ts 3 | dist 4 | 5 | node_modules/ 6 | .nyc_output/ 7 | coverage/ 8 | *.d.ts.map 9 | -------------------------------------------------------------------------------- /packages/@jsii/check-node/.npmignore: -------------------------------------------------------------------------------- 1 | # Don't include original .ts files when doing `npm pack` 2 | *.ts 3 | !*.d.ts 4 | *.sh 5 | dist 6 | 7 | # Don't pack unit tests 8 | *.test.js 9 | *.test.d.ts 10 | 11 | # Don't include various configuration & state information 12 | coverage 13 | .eslintrc.* 14 | tsconfig.json 15 | *.tsbuildinfo 16 | jest.config.ts 17 | -------------------------------------------------------------------------------- /packages/@jsii/check-node/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@jsii/check-node/jest.config.mjs: -------------------------------------------------------------------------------- 1 | import { overriddenConfig } from '../../../jest.config.mjs'; 2 | 3 | export default overriddenConfig({ 4 | coveragePathIgnorePatterns: [ 5 | // This cannot be tested in a way that enables collection of coverage 6 | '/lib/sync-stdio.ts', 7 | ], 8 | coverageThreshold: { 9 | global: { 10 | branches: 48, 11 | }, 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /packages/@jsii/check-node/run.js: -------------------------------------------------------------------------------- 1 | // For compatibility with node < 12.7.0, where "exports" from package.json is 2 | // not honored. This can be dropped once we drop support for node < 12.7.0. 3 | require('./lib/run'); 4 | -------------------------------------------------------------------------------- /packages/@jsii/check-node/src/run.ts: -------------------------------------------------------------------------------- 1 | import { checkNode } from './index'; 2 | 3 | checkNode(); 4 | 5 | // So this is a valid ESM module, too. 6 | export = {}; 7 | -------------------------------------------------------------------------------- /packages/@jsii/check-node/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base", 3 | "compilerOptions": { 4 | "target": "es2018", // Needs to target older releases of node or else it'll crash on start when using those 5 | "outDir": "./lib", 6 | "rootDir": "./src", 7 | }, 8 | "include": [ 9 | "src/**/*.ts" 10 | ], 11 | "exclude": [ 12 | "jest.config.ts" 13 | ], 14 | } 15 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime-test/.gitignore: -------------------------------------------------------------------------------- 1 | # generated by generate.sh 2 | test/generated 3 | test/Directory.Build.props 4 | *.js.map 5 | *.wasm 6 | 7 | # consumed by generate.sh 8 | !*.t.js 9 | 10 | # Result of tests (xUnit format) 11 | TestResults.xml 12 | 13 | *.nupkg 14 | bin/ 15 | cli/ 16 | obj/ 17 | 18 | 19 | *.js 20 | *.d.ts 21 | node_modules/ 22 | .nyc_output/ 23 | coverage/ 24 | .nuget/ 25 | *.d.ts.map 26 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime-test/.npmignore: -------------------------------------------------------------------------------- 1 | # by default, exclude everything 2 | * 3 | 4 | # bundle only... 5 | !*.nupkg 6 | !package.json 7 | !index.js 8 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime-test/Directory.Build.props.t.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const version = require('./package.json').version.replace(/\+.+$/, ''); // omit "+build" postfix; 3 | process.stdout.write(` 4 | 5 | Amazon Web Services LLC 6 | Amazon Web Services LLC 7 | ${version} 8 | 9 | 10 | `); 11 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime-test/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | dotnet build --force -c Release ./test/Amazon.JSII.Runtime.IntegrationTests 5 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime-test/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | test="./test" 4 | genRoot="${test}/generated" 5 | 6 | # Clean up before we start working 7 | rm -rf ${genRoot} 8 | 9 | # Generate .NET projects for jsii-calc and its dependencies. 10 | jsii-pacmak -t dotnet --code-only --recurse -o ${genRoot} ../../jsii-calc 11 | 12 | # Hack around project references to de-duplicate Amazon.JSII.Runtime in generated code. 13 | for csproj in ${genRoot}/dotnet/*/*.csproj 14 | do 15 | dotnet remove ${csproj} package Amazon.JSII.Runtime 16 | dotnet add ${csproj} reference ../dotnet-runtime/src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj 17 | done 18 | 19 | # Generate Directory.Build.props 20 | /usr/bin/env node ./Directory.Build.props.t.js > ${test}/Directory.Build.props 21 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime-test/lib/index.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | 3 | export const repository = path.resolve(__dirname, path.join('..', 'bin', 'Release', 'NuGet')); 4 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime-test/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # Run integration tests 5 | echo "Running integration tests" 6 | dotnet test -c Release ./test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj 7 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests.FSharp/Tests.fs: -------------------------------------------------------------------------------- 1 | namespace Amazon.JSII.Runtime.IntegrationTests.FSharp 2 | #nowarn "44" // Usage of Obsolete entity 3 | 4 | open Amazon.JSII.Tests.CalculatorNamespace 5 | open Amazon.JSII.Tests.CalculatorNamespace.LibNamespace 6 | open System 7 | open Xunit 8 | 9 | type [] Tests () = 10 | 11 | [] 12 | member this.FSharpDictCanBePassedDown () = 13 | let allTypes = new AllTypes() 14 | let number = new Number(1337.0) 15 | allTypes.MapProperty = dict[("number", number)] 16 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests.sln.DotSettings.user: -------------------------------------------------------------------------------- 1 |  2 | <SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from &lt;Amazon.JSII.Runtime.IntegrationTests&gt;" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> 3 | <Solution /> 4 | </SessionState> -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime-test/test/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime-test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base", 3 | "include": ["**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/.gitignore: -------------------------------------------------------------------------------- 1 | # generated by test.sh 2 | test/Amazon.JSII.Tests.Calculator* 3 | 4 | # copied by prepare.sh 5 | src/Amazon.JSII.Runtime/jsii-runtime 6 | 7 | # generated by generate.sh 8 | src/Amazon.JSII.Runtime/Services/JsiiRuntimeProvider.cs 9 | src/Directory.Build.props 10 | src/NuGet.Metadata.props 11 | 12 | *.js 13 | *.d.ts 14 | node_modules/ 15 | .nyc_output/ 16 | coverage/ 17 | 18 | *.nupkg 19 | *.snupkg 20 | bin/ 21 | cli/ 22 | obj/ 23 | *.DotSettings.user 24 | .nuget/ 25 | 26 | # consumed by generate.sh 27 | !*.t.js 28 | *.d.ts.map 29 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/.npmignore: -------------------------------------------------------------------------------- 1 | # by default, exclude everything 2 | * 3 | # include built dotnet package binaries 4 | !bin/**/* 5 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/Directory.Build.props.t.js: -------------------------------------------------------------------------------- 1 | const semver = require('semver'); 2 | const version = require('./package.json').version.replace(/\+.+$/, ''); // omit "+build" suffix 3 | 4 | const nextMajor = function () { 5 | const parsed = semver.parse(version); 6 | return parsed.inc(semver.major === 0 ? 'minor' : 'major').version; 7 | }() 8 | 9 | process.stdout.write(` 10 | 11 | ${version} 12 | [${version},${nextMajor}) 13 | 14 | 15 | `); 16 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | src="./src" 4 | 5 | # Generate metadata files based on package.json. 6 | /usr/bin/env node ./Directory.Build.props.t.js > ${src}/Directory.Build.props 7 | /usr/bin/env node ./NuGet.Metadata.props.t.js > ${src}/NuGet.Metadata.props 8 | 9 | # Embed @jsii/runtime as a resource 10 | bundle_dir="src/Amazon.JSII.Runtime/jsii-runtime" 11 | mkdir -p ${bundle_dir} 12 | rsync -av $(node -p 'require("path").dirname(require.resolve("@jsii/runtime/package.json"))')/webpack/ ${bundle_dir} 13 | 14 | 15 | # Generate Source 16 | /usr/bin/env node ./JsiiRuntimeProvider.t.js > ${src}/Amazon.JSII.Runtime/Services/JsiiRuntimeProvider.cs 17 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/lib/index.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | 3 | export const repository = path.resolve(__dirname, path.join('..', 'bin', 'Release', 'NuGet')); 4 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [assembly:CLSCompliant(false)] -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers/AnalyzerReleases.Shipped.md: -------------------------------------------------------------------------------- 1 | ## Release 0.15.0 2 | 3 | ### New Rules 4 | Rule ID | Category | Severity | Notes 5 | --------|----------|----------|------------------------------------------------------------------ 6 | JSII001 | Usage | Error | Checks whether required properties were provided to jsii structs. -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers/AnalyzerReleases.Unshipped.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers/AnalyzerReleases.Unshipped.md -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [assembly:CLSCompliant(true)] -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.JsonModel/Amazon.JSII.JsonModel.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | net6.0 6 | Amazon.JSII.JsonModel 7 | [DEPRECATED] .NET JsonModel for JSII 8 | icon.png 9 | 10 | true 11 | AllEnabledByDefault 12 | 13 | enable 14 | true 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | using Castle.Core.Internal; 4 | using Xunit; 5 | 6 | [assembly:CLSCompliant(false)] 7 | 8 | // Each test in this assembly overrides the the global service provider, so they can't be run in parallel. 9 | [assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)] 10 | 11 | [assembly:InternalsVisibleTo(InternalsVisible.ToDynamicProxyGenAssembly2)] -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/TestDeputies.cs: -------------------------------------------------------------------------------- 1 | using Amazon.JSII.Runtime.Deputy; 2 | 3 | namespace Amazon.JSII.Runtime.UnitTests.Deputy.Converters 4 | { 5 | [JsiiClass(typeof(TestClass), "myClassFqn", "[]")] 6 | public sealed class TestClass : DeputyBase 7 | { 8 | public TestClass(ByRefValue reference) : base(reference) 9 | { 10 | } 11 | } 12 | 13 | [JsiiEnum(typeof(TestClass), "myEnumFqn")] 14 | public enum TestEnum 15 | { 16 | [JsiiEnumMember("MyMember1")] 17 | MyMember1, 18 | 19 | [JsiiEnumMember("MyMember2")] 20 | MyMember2, 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/TestUtils.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Amazon.JSII.Runtime.UnitTests.JsonModel 4 | { 5 | public class TestUtils 6 | { 7 | private static readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings 8 | { 9 | DefaultValueHandling = DefaultValueHandling.Ignore 10 | }; 11 | 12 | protected static string ToJson(object obj) 13 | { 14 | return JsonConvert.SerializeObject(obj, Formatting.Indented, SerializerSettings); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | 4 | [assembly:CLSCompliant(false)] // among other things, array parameters are passed to attributes 5 | 6 | [assembly:InternalsVisibleTo("Amazon.JSII.Runtime.IntegrationTests")] 7 | [assembly:InternalsVisibleTo("Amazon.JSII.Runtime.UnitTests")] 8 | [assembly:InternalsVisibleTo("DynamicProxyGenAssembly2")] 9 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Amazon.JSII.Runtime 4 | { 5 | public static class Configuration 6 | { 7 | /// 8 | /// Enables or disables runtime type checking of parameters when the original model expects a type union, which 9 | /// is represented as object in .NET code. 10 | /// 11 | /// 12 | /// This feature is enabled by default. 13 | /// 14 | /// This feature may be disabled as a work-around if a bug prevents your application from working correctly, or 15 | /// in order to stop paying the performance cost of the runtime type checking. 16 | /// 17 | /// 18 | public static bool RuntimeTypeChecking { get; set; } = true; 19 | } 20 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/AnonymousObject.cs: -------------------------------------------------------------------------------- 1 | namespace Amazon.JSII.Runtime.Deputy 2 | { 3 | public sealed class AnonymousObject : DeputyBase 4 | { 5 | internal AnonymousObject(ByRefValue byRefValue) : base(byRefValue) 6 | { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/DateValue.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.Runtime.Deputy 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | internal sealed class DateValue 8 | { 9 | public DateValue(DateTime dateTime) 10 | { 11 | DateTime = dateTime; 12 | } 13 | 14 | // Json.NET serializes as ISON-8601 by default. 15 | [JsonProperty("$jsii.date")] 16 | public DateTime DateTime { get; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiAssemblyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Amazon.JSII.Runtime.Deputy 4 | { 5 | [AttributeUsage(AttributeTargets.Assembly)] 6 | public sealed class JsiiAssemblyAttribute : Attribute 7 | { 8 | public JsiiAssemblyAttribute(string name, string version, string tarball) 9 | { 10 | Name = name ?? throw new ArgumentNullException(nameof(name)); 11 | Version = version ?? throw new ArgumentNullException(nameof(version)); 12 | Tarball = tarball ?? throw new ArgumentNullException(nameof(tarball)); 13 | } 14 | 15 | public string Name { get; } 16 | 17 | public string Version { get; } 18 | 19 | public string Tarball { get; } 20 | } 21 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiByValueAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Amazon.JSII.Runtime.Deputy 4 | { 5 | [AttributeUsage(AttributeTargets.Class)] 6 | public sealed class JsiiByValueAttribute : Attribute 7 | { 8 | public JsiiByValueAttribute(string fqn) 9 | { 10 | FullyQualifiedName = fqn ?? throw new ArgumentNullException(nameof(fqn)); 11 | } 12 | 13 | public string FullyQualifiedName { get; } 14 | } 15 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiClassAttribute.cs: -------------------------------------------------------------------------------- 1 | using Amazon.JSII.JsonModel.Spec; 2 | using Newtonsoft.Json; 3 | using System; 4 | 5 | namespace Amazon.JSII.Runtime.Deputy 6 | { 7 | [AttributeUsage(AttributeTargets.Class, Inherited = false)] 8 | public sealed class JsiiClassAttribute : JsiiTypeAttributeBase 9 | { 10 | public JsiiClassAttribute(System.Type nativeType, string fullyQualifiedName, string? parametersJson = null) 11 | : base(nativeType, fullyQualifiedName) 12 | { 13 | Parameters = parametersJson == null 14 | ? Array.Empty() 15 | : JsonConvert.DeserializeObject(parametersJson) 16 | ?? throw new ArgumentException("Invalid JSON descriptor", nameof(parametersJson)); 17 | } 18 | 19 | public Parameter[] Parameters { get; } 20 | } 21 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiEnumAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Amazon.JSII.Runtime.Deputy 4 | { 5 | [AttributeUsage(AttributeTargets.Enum)] 6 | public sealed class JsiiEnumAttribute : JsiiTypeAttributeBase 7 | { 8 | public JsiiEnumAttribute(Type nativeType, string fullyQualifiedName) 9 | : base(nativeType, fullyQualifiedName) 10 | { 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiEnumMemberAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Amazon.JSII.Runtime.Deputy 4 | { 5 | [AttributeUsage(AttributeTargets.Field)] 6 | public sealed class JsiiEnumMemberAttribute : Attribute 7 | { 8 | public JsiiEnumMemberAttribute(string name) 9 | { 10 | Name = name ?? throw new ArgumentNullException(nameof(name)); 11 | } 12 | 13 | public string Name 14 | { 15 | get; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiInterfaceAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Amazon.JSII.Runtime.Deputy 4 | { 5 | [AttributeUsage(AttributeTargets.Interface)] 6 | public sealed class JsiiInterfaceAttribute : JsiiTypeAttributeBase 7 | { 8 | public JsiiInterfaceAttribute(Type nativeType, string fullyQualifiedName) 9 | : base(nativeType, fullyQualifiedName) 10 | { 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiOptionalAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Amazon.JSII.Runtime.Deputy 4 | { 5 | /// 6 | /// Flags a property as optional. 7 | /// 8 | /// This is used by the Amazon.Jsii.Analyzers Roslyn analyzer to emit errors on required properties that are missing. 9 | /// 10 | /// 11 | /// Annotated properties have a setter with a default implementation that throws 12 | /// System.NotSupportedException when invoked. In a similar way that they have to in TypeScript, 13 | /// implementors need to actively opt into supporting the functionality by providing a custom implementation 14 | /// for the member. 15 | /// 16 | [AttributeUsage(AttributeTargets.Property)] 17 | public sealed class JsiiOptionalAttribute : Attribute 18 | { 19 | } 20 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiTypeProxyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Amazon.JSII.Runtime.Deputy 4 | { 5 | [AttributeUsage(AttributeTargets.Class, Inherited = false)] 6 | public sealed class JsiiTypeProxyAttribute : JsiiTypeAttributeBase 7 | { 8 | public JsiiTypeProxyAttribute(Type nativeType, string fullyQualifiedName) 9 | : base(nativeType, fullyQualifiedName) 10 | { 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/ObjectReference.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Amazon.JSII.JsonModel.Api 4 | { 5 | [JsonDictionary] 6 | public class ObjectReference : JsonDictionaryBase 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Request/CallbacksRequest.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Amazon.JSII.JsonModel.Api.Request 4 | { 5 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 6 | public sealed class CallbacksRequest : IKernelRequest 7 | { 8 | [JsonProperty("api")] 9 | public string Api { get; } = "callbacks"; 10 | } 11 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Request/DeleteRequest.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Api.Request 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class DeleteRequest : IKernelRequest 8 | { 9 | public DeleteRequest(ObjectReference objectReference) 10 | { 11 | ObjectReference = objectReference ?? throw new ArgumentNullException(nameof(objectReference)); 12 | } 13 | 14 | [JsonProperty("api")] 15 | public string Api { get; } = "delete"; 16 | 17 | [JsonProperty("objref")] 18 | public ObjectReference ObjectReference { get; } 19 | } 20 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Request/EndRequest.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Api.Request 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class EndRequest : IKernelRequest 8 | { 9 | public EndRequest(string promiseId) 10 | { 11 | PromiseId = promiseId ?? throw new ArgumentNullException(nameof(promiseId)); 12 | } 13 | 14 | [JsonProperty("api")] 15 | public string Api { get; } = "end"; 16 | 17 | [JsonProperty("promiseid")] 18 | public string PromiseId { get; } 19 | } 20 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Request/GetRequest.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Api.Request 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class GetRequest : IKernelRequest 8 | { 9 | public GetRequest(ObjectReference objectReference, string property) 10 | { 11 | ObjectReference = objectReference ?? throw new ArgumentNullException(nameof(objectReference)); 12 | Property = property ?? throw new ArgumentNullException(nameof(property)); 13 | } 14 | 15 | [JsonProperty("api")] 16 | public string Api { get; } = "get"; 17 | 18 | [JsonProperty("objref")] 19 | public ObjectReference ObjectReference { get; } 20 | 21 | [JsonProperty("property")] 22 | public string Property { get; } 23 | } 24 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Request/IKernelRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Amazon.JSII.JsonModel.Api.Request 2 | { 3 | /// 4 | /// Marker interface. 5 | /// 6 | public interface IKernelRequest 7 | { 8 | string Api { get; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Request/NamingRequest.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Api.Request 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class NamingRequest : IKernelRequest 8 | { 9 | public NamingRequest(string assembly) 10 | { 11 | Assembly = assembly ?? throw new ArgumentNullException(nameof(assembly)); 12 | } 13 | 14 | [JsonProperty("api")] 15 | public string Api { get; } = "naming"; 16 | 17 | [JsonProperty("assembly")] 18 | public string Assembly { get; } 19 | } 20 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Request/StaticGetRequest.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Api.Request 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class StaticGetRequest : IKernelRequest 8 | { 9 | public StaticGetRequest(string fullyQualifiedName, string property) 10 | { 11 | FullyQualifiedName = fullyQualifiedName ?? throw new ArgumentNullException(nameof(fullyQualifiedName)); 12 | Property = property ?? throw new ArgumentNullException(nameof(property)); 13 | } 14 | 15 | [JsonProperty("api")] 16 | public string Api { get; } = "sget"; 17 | 18 | [JsonProperty("fqn")] 19 | public string FullyQualifiedName { get; } 20 | 21 | [JsonProperty("property")] 22 | public string Property { get; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Request/StatsRequest.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Amazon.JSII.JsonModel.Api.Request 4 | { 5 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 6 | public sealed class StatsRequest : IKernelRequest 7 | { 8 | [JsonProperty("api")] 9 | public string Api { get; } = "stats"; 10 | } 11 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/BeginResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Api.Response 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class BeginResponse : IKernelResponse 8 | { 9 | public BeginResponse(string promiseId) 10 | { 11 | PromiseId = promiseId ?? throw new ArgumentNullException(nameof(promiseId)); 12 | } 13 | 14 | [JsonProperty("promiseid")] 15 | public string PromiseId { get; } 16 | } 17 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/CallbackResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Api.Response 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class CallbackResponse 8 | { 9 | public CallbackResponse(Callback callback) 10 | { 11 | Callback = callback ?? throw new ArgumentNullException(nameof(callback)); 12 | } 13 | 14 | [JsonProperty("callback")] 15 | public Callback Callback { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/CallbacksResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Api.Response 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class CallbacksResponse : IKernelResponse 8 | { 9 | public CallbacksResponse(Callback[] callbacks) 10 | { 11 | Callbacks = callbacks ?? throw new ArgumentNullException(nameof(callbacks)); 12 | } 13 | 14 | [JsonProperty("callbacks")] 15 | public Callback[] Callbacks { get; } 16 | } 17 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/CompleteResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Api.Response 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class CompleteResponse : IKernelResponse 8 | { 9 | public CompleteResponse(string callbackId) 10 | { 11 | CallbackId = callbackId ?? throw new ArgumentNullException(nameof(callbackId)); 12 | } 13 | 14 | [JsonProperty("cbid")] 15 | public string CallbackId { get; } 16 | } 17 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/CreateResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Amazon.JSII.JsonModel.Api.Response 2 | { 3 | public sealed class CreateResponse : ObjectReference, IKernelResponse 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/DeleteResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Amazon.JSII.JsonModel.Api.Response 4 | { 5 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 6 | public sealed class DeleteResponse : IKernelResponse 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/EndResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Api.Response 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class EndResponse : IKernelResponse 8 | { 9 | public EndResponse(object result) 10 | { 11 | Result = result ?? throw new ArgumentNullException(nameof(result)); 12 | } 13 | 14 | [JsonProperty("result")] 15 | public object Result { get; } 16 | } 17 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/ErrorResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Api.Response 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class ErrorResponse 8 | { 9 | public ErrorResponse(string error, string? stack = null, ErrorName? name = null) 10 | { 11 | Error = error ?? throw new ArgumentNullException(nameof(error)); 12 | Stack = stack; 13 | Name = name; 14 | } 15 | 16 | [JsonProperty("error")] 17 | public string Error { get; } 18 | 19 | [JsonProperty("stack", NullValueHandling = NullValueHandling.Ignore)] 20 | public string? Stack { get; } 21 | 22 | [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] 23 | public ErrorName? Name { get; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/GetResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Amazon.JSII.JsonModel.Api.Response 4 | { 5 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 6 | public sealed class GetResponse : IKernelResponse 7 | { 8 | public GetResponse(object? value) 9 | { 10 | Value = value; 11 | } 12 | 13 | [JsonProperty("value")] 14 | public object? Value { get; } 15 | } 16 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/HelloResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Api.Response 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class HelloResponse : IKernelResponse 8 | { 9 | public HelloResponse(string hello) 10 | { 11 | Hello = hello ?? throw new ArgumentNullException(nameof(hello)); 12 | } 13 | 14 | [JsonProperty("hello")] 15 | public string Hello { get; } 16 | } 17 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/IKernelResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Amazon.JSII.JsonModel.Api.Response 2 | { 3 | /// 4 | /// Marker interface. 5 | /// 6 | public interface IKernelResponse 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/InvokeResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Amazon.JSII.JsonModel.Api.Response 4 | { 5 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 6 | public sealed class InvokeResponse : IKernelResponse 7 | { 8 | public InvokeResponse(object? result = null) 9 | { 10 | Result = result; 11 | } 12 | 13 | [JsonProperty("result", NullValueHandling = NullValueHandling.Ignore)] 14 | public object? Result { get; } 15 | } 16 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/LoadResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Api.Response 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class LoadResponse : IKernelResponse 8 | { 9 | public LoadResponse(string assembly, int typeCount) 10 | { 11 | Assembly = assembly ?? throw new ArgumentNullException(nameof(assembly)); 12 | TypeCount = typeCount; 13 | } 14 | 15 | [JsonProperty("assembly")] 16 | public string Assembly { get; } 17 | 18 | [JsonProperty("types")] 19 | public int TypeCount { get; } 20 | } 21 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/OkResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Api.Response 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class OkResponse 8 | where TResult : class, IKernelResponse 9 | { 10 | public OkResponse(TResult ok) 11 | { 12 | Ok = ok ?? throw new ArgumentNullException(nameof(ok)); 13 | } 14 | 15 | [JsonProperty("ok")] 16 | public TResult Ok { get; } 17 | } 18 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/SetResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Amazon.JSII.JsonModel.Api.Response 4 | { 5 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 6 | public sealed class SetResponse : IKernelResponse 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/StatsResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Amazon.JSII.JsonModel.Api.Response 4 | { 5 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 6 | public sealed class StatsResponse : IKernelResponse 7 | { 8 | public StatsResponse(int objectCount) 9 | { 10 | ObjectCount = objectCount; 11 | } 12 | 13 | [JsonProperty("objectCount")] 14 | public int ObjectCount { get; } 15 | } 16 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/CollectionKind.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace Amazon.JSII.JsonModel.Spec 5 | { 6 | [JsonConverter(typeof(StringEnumConverter), /* camelCaseText */ true)] 7 | public enum CollectionKind 8 | { 9 | Array, 10 | Map 11 | } 12 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/CollectionTypeReference.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Spec 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class CollectionTypeReference 8 | { 9 | public CollectionTypeReference(CollectionKind kind, TypeReference elementType) 10 | { 11 | Kind = kind; 12 | ElementType = elementType ?? throw new ArgumentNullException(nameof(elementType)); 13 | } 14 | 15 | [JsonProperty("kind", DefaultValueHandling = DefaultValueHandling.Include)] 16 | public CollectionKind Kind { get; } 17 | 18 | [JsonProperty("elementtype")] 19 | public TypeReference ElementType { get; } 20 | } 21 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace Amazon.JSII.JsonModel.Spec 2 | { 3 | public static class Constants 4 | { 5 | public const string SpecVersion = "jsii/0.9.0"; // minor version = no breaking change 6 | public const string SpecFileName = ".jsii"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/DependencyRoot.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System.Collections.Generic; 3 | 4 | namespace Amazon.JSII.JsonModel.Spec 5 | { 6 | public abstract class DependencyRoot 7 | { 8 | protected DependencyRoot 9 | ( 10 | AssemblyTargets? targets = null, 11 | IDictionary? dependencies = null 12 | ) 13 | { 14 | Targets = targets; 15 | Dependencies = dependencies; 16 | } 17 | 18 | [JsonProperty("dependencies", NullValueHandling = NullValueHandling.Ignore)] 19 | public IDictionary? Dependencies { get; } 20 | 21 | [JsonProperty("targets")] 22 | public AssemblyTargets? Targets { get; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/EnumMember.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Spec 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class EnumMember : IDocumentable 8 | { 9 | public EnumMember(string name, Docs? docs = null) 10 | { 11 | Name = name ?? throw new ArgumentNullException(nameof(name)); 12 | Docs = docs; 13 | } 14 | 15 | [JsonProperty("name")] 16 | public string Name { get; } 17 | 18 | [JsonProperty("docs", NullValueHandling = NullValueHandling.Ignore)] 19 | public Docs? Docs { get; } 20 | } 21 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/IDocumentable.cs: -------------------------------------------------------------------------------- 1 | namespace Amazon.JSII.JsonModel.Spec 2 | { 3 | public interface IDocumentable 4 | { 5 | Docs? Docs { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/IOverridable.cs: -------------------------------------------------------------------------------- 1 | namespace Amazon.JSII.JsonModel.Spec 2 | { 3 | public interface IOverridable 4 | { 5 | string? Overrides { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/Initializer.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Amazon.JSII.JsonModel.Spec 4 | { 5 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 6 | public sealed class Initializer : Callable 7 | { 8 | public Initializer 9 | ( 10 | Parameter[]? parameters = null, 11 | bool isProtected = false, 12 | bool isVariadic = false, 13 | string? overrides = null, 14 | Docs? docs = null 15 | ): base( 16 | parameters: parameters, 17 | isProtected: isProtected, 18 | isVariadic: isVariadic, 19 | overrides: overrides, 20 | docs: docs 21 | ) 22 | {} 23 | } 24 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/PackageVersion.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace Amazon.JSII.JsonModel.Spec 6 | { 7 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 8 | public sealed class PackageVersion: DependencyRoot 9 | { 10 | public PackageVersion 11 | ( 12 | string version, 13 | AssemblyTargets? targets = null, 14 | IDictionary? dependencies = null 15 | ): base(targets, dependencies) 16 | { 17 | Version = version ?? throw new ArgumentNullException(nameof(version)); 18 | } 19 | 20 | [JsonProperty("version")] 21 | public string Version { get; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/PrimitiveType.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace Amazon.JSII.JsonModel.Spec 5 | { 6 | [JsonConverter(typeof(StringEnumConverter), /* camelCaseText */ true)] 7 | public enum PrimitiveType 8 | { 9 | Date, 10 | String, 11 | Number, 12 | Boolean, 13 | Json, 14 | Any 15 | } 16 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/Readme.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Spec 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class Readme 8 | { 9 | public Readme(string markdown) 10 | { 11 | Markdown = markdown ?? throw new ArgumentNullException(nameof(markdown)); 12 | } 13 | 14 | [JsonProperty("markdown", NullValueHandling = NullValueHandling.Ignore)] 15 | public string Markdown { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/Stability.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace Amazon.JSII.JsonModel.Spec 5 | { 6 | [JsonConverter(typeof(StringEnumConverter), /* camelCaseText */ true)] 7 | public enum Stability 8 | { 9 | Stable, 10 | Experimental, 11 | Deprecated, 12 | External 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/TypeKind.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace Amazon.JSII.JsonModel.Spec 5 | { 6 | [JsonConverter(typeof(StringEnumConverter), /* camelCaseText */ true)] 7 | public enum TypeKind 8 | { 9 | Class, 10 | Enum, 11 | Interface 12 | } 13 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/UnionTypeReference.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Spec 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class UnionTypeReference 8 | { 9 | public UnionTypeReference(TypeReference[] types) 10 | { 11 | Types = types ?? throw new ArgumentNullException(nameof(types)); 12 | } 13 | 14 | [JsonProperty("types")] 15 | public TypeReference[] Types { get; } 16 | } 17 | } -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/UserTypeReference.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace Amazon.JSII.JsonModel.Spec 5 | { 6 | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] 7 | public sealed class UserTypeReference 8 | { 9 | public UserTypeReference(string fullyQualifiedName) 10 | { 11 | FullyQualifiedName = fullyQualifiedName ?? throw new ArgumentNullException(nameof(fullyQualifiedName)); 12 | } 13 | 14 | [JsonProperty("fqn")] 15 | public string FullyQualifiedName { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/IFrameworkToJsiiConverter.cs: -------------------------------------------------------------------------------- 1 | using Amazon.JSII.JsonModel.Spec; 2 | 3 | namespace Amazon.JSII.Runtime.Services.Converters 4 | { 5 | internal interface IFrameworkToJsiiConverter 6 | { 7 | bool TryConvert(IOptionalValue? optionalValue, IReferenceMap referenceMap, object? value, out object? result); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/IJsiiToFrameworkConverter.cs: -------------------------------------------------------------------------------- 1 | using Amazon.JSII.JsonModel.Spec; 2 | 3 | namespace Amazon.JSII.Runtime.Services.Converters 4 | { 5 | internal interface IJsiiToFrameworkConverter 6 | { 7 | bool TryConvert(IOptionalValue? optionalValue, System.Type type, IReferenceMap referenceMap, object? value, out object? result); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/IJsiiRuntimeProvider.cs: -------------------------------------------------------------------------------- 1 | namespace Amazon.JSII.Runtime.Services 2 | { 3 | internal interface IJsiiRuntimeProvider 4 | { 5 | string? JsiiRuntimePath { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/ILoadedPackageSet.cs: -------------------------------------------------------------------------------- 1 | namespace Amazon.JSII.Runtime.Services 2 | { 3 | internal interface ILoadedPackageSet 4 | { 5 | bool Contains(string package); 6 | 7 | void Add(string package); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/INodeProcess.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace Amazon.JSII.Runtime.Services 5 | { 6 | internal interface INodeProcess : IDisposable 7 | { 8 | TextWriter StandardInput { get; } 9 | 10 | TextReader StandardOutput { get; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/IReferenceMap.cs: -------------------------------------------------------------------------------- 1 | using Amazon.JSII.JsonModel.Api; 2 | using Amazon.JSII.Runtime.Deputy; 3 | 4 | namespace Amazon.JSII.Runtime.Services 5 | { 6 | internal interface IReferenceMap 7 | { 8 | void AddNativeReference(ByRefValue reference, DeputyBase nativeReference, bool force = false); 9 | 10 | DeputyBase GetOrCreateNativeReference(ObjectReference reference); 11 | 12 | DeputyBase GetOrCreateNativeReference(ByRefValue reference); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/IResourceExtractor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | 4 | namespace Amazon.JSII.Runtime.Services 5 | { 6 | internal interface IResourceExtractor : IDisposable 7 | { 8 | string ExtractResource(Assembly assembly, string resourceName, string bag = "default", string? fileName = null); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/IRuntime.cs: -------------------------------------------------------------------------------- 1 | namespace Amazon.JSII.Runtime.Services 2 | { 3 | internal interface IRuntime 4 | { 5 | string ReadResponse(); 6 | 7 | void WriteRequest(string request); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/LoadedPackageSet.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Amazon.JSII.Runtime.Services 4 | { 5 | internal sealed class LoadedPackageSet : ILoadedPackageSet 6 | { 7 | readonly ISet _packages = new HashSet(); 8 | 9 | public void Add(string package) 10 | { 11 | _packages.Add(package); 12 | } 13 | 14 | public bool Contains(string package) 15 | { 16 | return _packages.Contains(package); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/src/NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /packages/@jsii/dotnet-runtime/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base", 3 | "include": ["**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime-test/.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: ../../../eslint-config.yaml 3 | rules: 4 | 'import/no-extraneous-dependencies': 5 | - error 6 | - devDependencies: ['**/build-tools/**'] # Only allow importing devDependencies from tests 7 | optionalDependencies: false # Disallow importing optional dependencies (those shouldn't be used here) 8 | peerDependencies: false # Disallow importing peer dependencies (those shouldn't be used here) 9 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime-test/.gitignore: -------------------------------------------------------------------------------- 1 | /jsii-calc/ 2 | 3 | *.js 4 | *.d.ts 5 | 6 | # Ignore our test files 7 | project/compliance-report.json 8 | *.d.ts.map 9 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime-test/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime-test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jsii/go-runtime-test", 3 | "version": "0.0.0", 4 | "private": true, 5 | "description": "", 6 | "scripts": { 7 | "build": "tsc --build && yarn gen:calc", 8 | "fmt": "cd project && go run golang.org/x/tools/cmd/goimports -w .", 9 | "lint": "cd project && go vet ./... && go run golang.org/x/lint/golint ./...", 10 | "test": "cd project && go test ./...", 11 | "lint:fix": "yarn lint && yarn fmt", 12 | "gen:calc": "node build-tools/gen-calc.js" 13 | }, 14 | "keywords": [], 15 | "author": "", 16 | "license": "Apache-2.0", 17 | "devDependencies": { 18 | "jsii-pacmak": "^0.0.0" 19 | }, 20 | "dependencies": { 21 | "fs-extra": "^10.1.0", 22 | "@jsii/go-runtime": "^0.0.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime-test/project/internal/addTen/addTen.go: -------------------------------------------------------------------------------- 1 | package addTen 2 | 3 | import ( 4 | "github.com/aws/jsii-runtime-go" 5 | calc "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" 6 | "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" 7 | ) 8 | 9 | func New(val *float64) calc.Add { 10 | return calc.NewAdd(scopejsiicalclib.NewNumber(val), scopejsiicalclib.NewNumber(jsii.Number(10))) 11 | } 12 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime-test/project/internal/bellRinger/bellRinger.go: -------------------------------------------------------------------------------- 1 | package bellRinger 2 | 3 | import "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" 4 | 5 | func New() jsiicalc.IBellRinger { 6 | return &ringer{} 7 | } 8 | 9 | type ringer struct{} 10 | 11 | func (r *ringer) YourTurn(bell jsiicalc.IBell) { 12 | bell.Ring() 13 | } 14 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime-test/project/internal/cdk16625/cdk16625.go: -------------------------------------------------------------------------------- 1 | package cdk16625 2 | 3 | import ( 4 | "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" 5 | abc "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/cdk16625" 6 | ) 7 | 8 | func New() abc.Cdk16625 { 9 | c := &cdk16625{} 10 | abc.NewCdk16625_Override(c) 11 | return c 12 | } 13 | 14 | type cdk16625 struct { 15 | abc.Cdk16625 16 | } 17 | 18 | func (c *cdk16625) Unwrap(rng jsiicalc.IRandomNumberGenerator) *float64 { 19 | return rng.Next() 20 | } 21 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime-test/project/internal/doNotOverridePrivates/doNotOverridePrivates.go: -------------------------------------------------------------------------------- 1 | package doNotOverridePrivates 2 | 3 | import calc "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" 4 | 5 | type DoNotOverridePrivates struct { 6 | calc.DoNotOverridePrivates 7 | } 8 | 9 | func New() *DoNotOverridePrivates { 10 | d := &DoNotOverridePrivates{} 11 | calc.NewDoNotOverridePrivates_Override(d) 12 | return d 13 | } 14 | 15 | func (d *DoNotOverridePrivates) PrivateMethod() string { 16 | panic("This should not have been called!") 17 | } 18 | 19 | func (d *DoNotOverridePrivates) PrivateProperty() string { 20 | panic("This should not have been called!") 21 | } 22 | 23 | func (d *DoNotOverridePrivates) SetPrivateProperty(_ string) { 24 | panic("This should not have been called!") 25 | } 26 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime-test/project/internal/twoOverrides/twoOverrides.go: -------------------------------------------------------------------------------- 1 | package twoOverrides 2 | 3 | import ( 4 | "github.com/aws/jsii-runtime-go" 5 | "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" 6 | ) 7 | 8 | type TwoOverrides struct { 9 | jsiicalc.AsyncVirtualMethods 10 | } 11 | 12 | func New() *TwoOverrides { 13 | t := &TwoOverrides{} 14 | jsiicalc.NewAsyncVirtualMethods_Override(t) 15 | return t 16 | } 17 | 18 | func (t *TwoOverrides) OverrideMe(*float64) *float64 { 19 | return jsii.Number(666) 20 | } 21 | 22 | func (t *TwoOverrides) OverrideMeToo() *float64 { 23 | return jsii.Number(10) 24 | } 25 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime-test/project/internal/wallClock/wallClock.go: -------------------------------------------------------------------------------- 1 | package wallClock 2 | 3 | import ( 4 | "github.com/aws/jsii-runtime-go" 5 | "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" 6 | ) 7 | 8 | type WallClock struct { 9 | nowAsISO string 10 | } 11 | 12 | func NewWallClock(nowAsISO string) *WallClock { 13 | return &WallClock{nowAsISO} 14 | } 15 | 16 | func (w *WallClock) Iso8601Now() *string { 17 | return jsii.String(w.nowAsISO) 18 | } 19 | 20 | type Entropy struct { 21 | jsiicalc.Entropy 22 | } 23 | 24 | func NewEntropy(clock jsiicalc.IWallClock) *Entropy { 25 | e := &Entropy{} 26 | jsiicalc.NewEntropy_Override(e, clock) 27 | return e 28 | } 29 | 30 | func (e *Entropy) Repeat(word *string) *string { 31 | return word 32 | } 33 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime-test/project/tools.go: -------------------------------------------------------------------------------- 1 | //go:build tools 2 | // +build tools 3 | 4 | // Package tools contains the necessary statements to ensure tool dependencies 5 | // are not "cleaned up" by "go mod tidy" despite being used... The "// +" 6 | // comment above makes sure the file is never included in an actual compiled 7 | // unit (unless someone manually specifies the "build tools" tag at compile 8 | // time). 9 | package tools 10 | 11 | import ( 12 | _ "golang.org/x/lint/golint" 13 | _ "golang.org/x/tools/cmd/goimports" 14 | ) 15 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime-test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base", 3 | "include": ["**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: ../../../eslint-config.yaml 3 | rules: 4 | 'import/no-extraneous-dependencies': 5 | - error 6 | - devDependencies: ['**/build-tools/**'] # Only allow importing devDependencies from tests 7 | optionalDependencies: false # Disallow importing optional dependencies (those shouldn't be used here) 8 | peerDependencies: false # Disallow importing peer dependencies (those shouldn't be used here) 9 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/.gitignore: -------------------------------------------------------------------------------- 1 | /jsii-calc/ 2 | /jsii-runtime-go/internal/embedded/resources/ 3 | 4 | *.generated.* 5 | 6 | *.js 7 | *.d.ts 8 | 9 | !jsii-runtime-go/internal/kernel/process/jsii-mock-runtime.js 10 | *.d.ts.map 11 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/.npmignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /build-tools 3 | /dist 4 | 5 | *.ts 6 | !*.d.ts 7 | *.tsbuildinfo 8 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/build-tools/_constants.ts: -------------------------------------------------------------------------------- 1 | import { spawnSync, SpawnOptions } from 'child_process'; 2 | 3 | export function runCommand( 4 | command: string, 5 | args: readonly string[], 6 | opts: SpawnOptions = {}, 7 | ): void { 8 | const result = spawnSync(command, args, { 9 | ...opts, 10 | shell: process.platform === 'win32', 11 | }); 12 | if (result.error) { 13 | throw result.error; 14 | } 15 | if (result.status !== 0) { 16 | throw new Error( 17 | `Command failed with ${ 18 | result.signal != null 19 | ? `signal ${result.signal}` 20 | : `code ${result.status}` 21 | }: ${command} ${args.join(' ')}`, 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/build-tools/package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | scriptdir=$(cd $(dirname $0) && pwd) 4 | cd ${scriptdir}/.. 5 | 6 | rm -fr dist 7 | mkdir -p dist/go 8 | rsync -av jsii-runtime-go/* dist/go/ 9 | 10 | # create a "version" file which is needed by publib 11 | version=$(node -p "require('./package.json').version") 12 | echo ${version} > dist/go/version 13 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/.gitattributes: -------------------------------------------------------------------------------- 1 | *.generated.go linguist-generated 2 | *.generated_test.go linguist-generated 3 | *.tgz linguist-generated 4 | 5 | doc.go linguist-documentation 6 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | The jsii runtime library for go's source code is managed in the 2 | [main jsii repository][jsii]. See the [contributing] guide for details on filing 3 | issues and PRs. 4 | 5 | [jsii]: https://github.com/aws/jsii 6 | [contributing]: https://github.com/aws/jsii/blob/main/CONTRIBUTING.md 7 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/README.md: -------------------------------------------------------------------------------- 1 | # ![jsii](https://github.com/aws/jsii/raw/main/logo/png/128.png) 2 | 3 | ## The jsii runtime library for Go 4 | 5 | This is the [jsii] runtime for go. This repository is used only for publishing 6 | the go module. The source code is managed in [the main JSII repository][jsii]. 7 | Refer to the [go-runtime readme there][readme] for details on building and 8 | testing the module. 9 | 10 | [jsii]: https://github.com/aws/jsii 11 | [readme]: https://github.com/aws/jsii/blob/main/packages/%40jsii/go-runtime/README.md 12 | 13 | ## :balance_scale: License 14 | 15 | **jsii** is distributed under the [Apache License, Version 2.0][apache-2.0]. 16 | 17 | See [LICENSE](./LICENSE) and [NOTICE](./NOTICE) for more information. 18 | 19 | [apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 20 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/doc.go: -------------------------------------------------------------------------------- 1 | // Package jsii provides utilities that user code can leverage to facilitate 2 | // working with libraries generated by the `jsii-pacmak` tool. This includes 3 | // type conversion helpers as well as utilities to manage the runtime process' 4 | // lifecycle. 5 | package jsii 6 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/aws/jsii-runtime-go 2 | 3 | go 1.18 4 | 5 | require ( 6 | github.com/Masterminds/semver/v3 v3.3.1 7 | github.com/fatih/color v1.18.0 8 | github.com/mattn/go-isatty v0.0.20 9 | github.com/stretchr/testify v1.10.0 10 | golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 11 | golang.org/x/tools v0.33.0 12 | ) 13 | 14 | require ( 15 | github.com/davecgh/go-spew v1.1.1 // indirect 16 | github.com/mattn/go-colorable v0.1.13 // indirect 17 | github.com/pmezard/go-difflib v1.0.0 // indirect 18 | github.com/yuin/goldmark v1.4.13 // indirect 19 | golang.org/x/mod v0.24.0 // indirect 20 | golang.org/x/sync v0.14.0 // indirect 21 | golang.org/x/sys v0.33.0 // indirect 22 | gopkg.in/yaml.v3 v3.0.1 // indirect 23 | ) 24 | 25 | retract v1.27.0 26 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/api/doc.go: -------------------------------------------------------------------------------- 1 | // Package api contains shared type definisions used by several modules part of 2 | // the jsii runtime for go. It helps avoid creating circular dependencies 3 | // between the other modules. 4 | package api 5 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/compiler/go1.16.go: -------------------------------------------------------------------------------- 1 | //go:build go1.16 && !go1.17 2 | // +build go1.16,!go1.17 3 | 4 | package compiler 5 | 6 | // Version denotes the version of the go compiler that was used for building 7 | // this binary. It is intended for use only in the compiler deprecation warning 8 | // message. 9 | const Version = "go1.16" 10 | 11 | // EndOfLifeDate is the date at which this compiler version reached end-of-life. 12 | const EndOfLifeDate = "2022-03-15" 13 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/compiler/go1.17.go: -------------------------------------------------------------------------------- 1 | //go:build go1.17 && !go1.18 2 | // +build go1.17,!go1.18 3 | 4 | package compiler 5 | 6 | // Version denotes the version of the go compiler that was used for building 7 | // this binary. It is intended for use only in the compiler deprecation warning 8 | // message. 9 | const Version = "go1.17" 10 | 11 | // EndOfLifeDate is the date at which this compiler version reached end-of-life. 12 | const EndOfLifeDate = "2022-08-02" 13 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/embedded/.gitattributes: -------------------------------------------------------------------------------- 1 | resources/ linguist-vendored 2 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/embedded/doc.go: -------------------------------------------------------------------------------- 1 | // Package embedded contains the embedded @jsii/kernel code, which is used 2 | // unless the JSII_RUNTIME environment variable is set to a different program. 3 | package embedded 4 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/embedded/embedded_test.go: -------------------------------------------------------------------------------- 1 | package embedded 2 | 3 | import ( 4 | "path" 5 | "testing" 6 | ) 7 | 8 | func TestEntryPointExists(t *testing.T) { 9 | if bytes, err := embeddedFS.ReadFile(path.Join(embeddedRootDir, entrypointName)); err != nil { 10 | t.Errorf("unable to read entry point data: %v", err) 11 | } else if len(bytes) == 0 { 12 | t.Error("entry point file is empty") 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/begin.go: -------------------------------------------------------------------------------- 1 | package kernel 2 | 3 | import ( 4 | "github.com/aws/jsii-runtime-go/internal/api" 5 | ) 6 | 7 | type BeginProps struct { 8 | Method *string `json:"method"` 9 | Arguments []interface{} `json:"args"` 10 | ObjRef api.ObjectRef `json:"objref"` 11 | } 12 | 13 | type BeginResponse struct { 14 | kernelResponse 15 | PromiseID *string `json:"promise_id"` 16 | } 17 | 18 | func (c *Client) Begin(props BeginProps) (response BeginResponse, err error) { 19 | type request struct { 20 | kernelRequest 21 | BeginProps 22 | } 23 | err = c.request(request{kernelRequest{"begin"}, props}, &response) 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/complete.go: -------------------------------------------------------------------------------- 1 | package kernel 2 | 3 | type CompleteProps struct { 4 | CallbackID *string `json:"cbid"` 5 | Error *string `json:"err"` 6 | Result interface{} `json:"result"` 7 | } 8 | 9 | type CompleteResponse struct { 10 | kernelResponse 11 | CallbackID *string `json:"cbid"` 12 | } 13 | 14 | func (c *Client) Complete(props CompleteProps) (response CompleteResponse, err error) { 15 | type request struct { 16 | kernelRequest 17 | CompleteProps 18 | } 19 | err = c.request(request{kernelRequest{"complete"}, props}, &response) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/del.go: -------------------------------------------------------------------------------- 1 | package kernel 2 | 3 | import "github.com/aws/jsii-runtime-go/internal/api" 4 | 5 | type DelProps struct { 6 | ObjRef api.ObjectRef `json:"objref"` 7 | } 8 | 9 | type DelResponse struct { 10 | kernelResponse 11 | } 12 | 13 | func (c *Client) Del(props DelProps) (response DelResponse, err error) { 14 | type request struct { 15 | kernelRequest 16 | DelProps 17 | } 18 | err = c.request(request{kernelRequest{"del"}, props}, &response) 19 | return 20 | } 21 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/doc.go: -------------------------------------------------------------------------------- 1 | // Package kernel defines the interface for go programs to interact with the 2 | // @jsii/kernel node process. This module completely abstracts managament of the 3 | // child process. 4 | package kernel 5 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/end.go: -------------------------------------------------------------------------------- 1 | package kernel 2 | 3 | type EndProps struct { 4 | PromiseID *string `json:"promise_id"` 5 | } 6 | 7 | type EndResponse struct { 8 | kernelResponse 9 | Result interface{} `json:"result"` 10 | } 11 | 12 | func (c *Client) End(props EndProps) (response EndResponse, err error) { 13 | type request struct { 14 | kernelRequest 15 | EndProps 16 | } 17 | err = c.request(request{kernelRequest{"end"}, props}, &response) 18 | return 19 | } 20 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/naming.go: -------------------------------------------------------------------------------- 1 | package kernel 2 | 3 | type NamingProps struct { 4 | Assembly string `json:"assembly"` 5 | } 6 | 7 | type NamingResponse struct { 8 | kernelResponse 9 | // readonly naming: { 10 | // readonly [language: string]: { readonly [key: string]: any } | undefined; 11 | // }; 12 | } 13 | 14 | func (c *Client) Naming(props NamingProps) (response NamingResponse, err error) { 15 | type request struct { 16 | kernelRequest 17 | NamingProps 18 | } 19 | err = c.request(request{kernelRequest{"naming"}, props}, &response) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/handshake.go: -------------------------------------------------------------------------------- 1 | package process 2 | 3 | import ( 4 | "fmt" 5 | "regexp" 6 | 7 | "github.com/Masterminds/semver/v3" 8 | ) 9 | 10 | type handshakeResponse struct { 11 | Hello string `json:"hello"` 12 | } 13 | 14 | func (h *handshakeResponse) runtimeVersion() (*semver.Version, error) { 15 | re := regexp.MustCompile("@") 16 | parts := re.Split(h.Hello, 3) 17 | switch len(parts) { 18 | case 2: 19 | return semver.NewVersion(parts[1]) 20 | case 3: 21 | return semver.NewVersion(parts[2]) 22 | default: 23 | return nil, fmt.Errorf("invalid handshake payload: %v", h.Hello) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/stats.go: -------------------------------------------------------------------------------- 1 | package kernel 2 | 3 | type StatsResponse struct { 4 | kernelResponse 5 | ObjectCount float64 `json:"object_count"` 6 | } 7 | 8 | func (c *Client) Stats() (response StatsResponse, err error) { 9 | err = c.request(kernelRequest{"stats"}, &response) 10 | return 11 | } 12 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/doc.go: -------------------------------------------------------------------------------- 1 | // Package objectstore implements support for tracking a mapping of object 2 | // references to and from their instance ID. It tracks objects by proxy of their 3 | // memory address (i.e: pointer value), in order to avoid the pitfalls of go's 4 | // standard object equality mechanism (which is also reflect.Value's equality 5 | // mechanism) causing distinct instances appearing to be equal (including when 6 | // used as keys to a map). 7 | package objectstore 8 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/doc.go: -------------------------------------------------------------------------------- 1 | // Package typeregistry offers features useful to manage the registration and 2 | // operation of types in the context of the jsii runtime. These are used to 3 | // support type conversion for values exchanged between the child node process 4 | // and the go application. 5 | package typeregistry 6 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/overrides.go: -------------------------------------------------------------------------------- 1 | package typeregistry 2 | 3 | import ( 4 | "github.com/aws/jsii-runtime-go/internal/api" 5 | ) 6 | 7 | func (t *TypeRegistry) GetOverride(fqn api.FQN, n string) (api.Override, bool) { 8 | if members, ok := t.typeMembers[fqn]; ok { 9 | for _, member := range members { 10 | if member.GoName() == n { 11 | return member, true 12 | } 13 | } 14 | } 15 | 16 | return nil, false 17 | } 18 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/validate-struct.go: -------------------------------------------------------------------------------- 1 | package typeregistry 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | ) 7 | 8 | // ValidateStruct runs validations on the supplied struct to determine whether 9 | // it is valid. In particular, it checks union-typed properties to ensure the 10 | // provided value is of one of the allowed types. 11 | // 12 | // May panic if v is not a pointer to a struct value. 13 | func (t *TypeRegistry) ValidateStruct(v interface{}, d func() string) error { 14 | rt := reflect.TypeOf(v).Elem() 15 | 16 | info, ok := t.structInfo[rt] 17 | if !ok { 18 | return fmt.Errorf("%v: %v is not a know struct type", d(), rt) 19 | } 20 | 21 | // There may not be a validator (type is simple enough, etc...). 22 | if info.Validator != nil { 23 | return info.Validator(v, d) 24 | } 25 | 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/jsii.go: -------------------------------------------------------------------------------- 1 | package jsii 2 | 3 | import "github.com/aws/jsii-runtime-go/internal/kernel" 4 | 5 | // Close finalizes the runtime process, signalling the end of the execution to 6 | // the jsii kernel process, and waiting for graceful termination. The best 7 | // practice is to defer call this at the beginning of the "main" function. 8 | func Close() { 9 | kernel.CloseClient() 10 | } 11 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/runtime/doc.go: -------------------------------------------------------------------------------- 1 | // Package runtime provides the APIs used by code generated by the `jsii-pacmak` 2 | // tool to interact with the `@jsii/kernel` process. It is not intended for 3 | // users to directly interact with, and doing so could result in incorrect 4 | // behavior. 5 | package runtime 6 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/runtime/type_checking.go: -------------------------------------------------------------------------------- 1 | package runtime 2 | 3 | import "github.com/aws/jsii-runtime-go/internal/kernel" 4 | 5 | // ValidateStruct runs validations on the supplied struct to determine whether 6 | // it is valid. In particular, it checks union-typed properties to ensure the 7 | // provided value is of one of the allowed types. 8 | func ValidateStruct(v interface{}, d func() string) error { 9 | client := kernel.GetClient() 10 | return client.Types().ValidateStruct(v, d) 11 | } 12 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/jsii-runtime-go/tools.go: -------------------------------------------------------------------------------- 1 | //go:build tools 2 | // +build tools 3 | 4 | // Package tools contains the necessary statements to ensure tool dependencies 5 | // are not "cleaned up" by "go mod tidy" despite being used... The "// +" 6 | // comment above makes sure the file is never included in an actual compiled 7 | // unit (unless someone manually specifies the "build tools" tag at compile 8 | // time). 9 | package tools 10 | 11 | import ( 12 | _ "golang.org/x/lint/golint" 13 | _ "golang.org/x/tools/cmd/godoc" 14 | _ "golang.org/x/tools/cmd/goimports" 15 | ) 16 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/lib/index.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | 3 | import { localRuntimeModules } from './local-runtime-modules'; 4 | 5 | /** 6 | * The root directory under which all go modules locally available from this 7 | * package are hosted. 8 | */ 9 | export const runtimePath = path.resolve(__dirname, '..', 'jsii-runtime-go'); 10 | 11 | /** 12 | * A map representing all go modules locally available from this package. This 13 | * includes one entry per submodule of the jsii runtime for go. Entries are 14 | * presented in no particular order. 15 | */ 16 | export const runtimeModules = localRuntimeModules(runtimePath); 17 | -------------------------------------------------------------------------------- /packages/@jsii/go-runtime/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base", 3 | "include": ["**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime-test/.gitignore: -------------------------------------------------------------------------------- 1 | .m2 2 | .vscode 3 | !*.js 4 | maven-repo 5 | test-maven-repo 6 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime-test/.npmignore: -------------------------------------------------------------------------------- 1 | *.sh 2 | *.t.js 3 | project 4 | test-project 5 | test-maven-repo 6 | 7 | tsconfig.json 8 | *.tsbuildinfo 9 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime-test/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime-test/README.md: -------------------------------------------------------------------------------- 1 | Dive into a single failing test: 2 | 3 | JSII_DEBUG=1 mvn test -Dtest=software.amazon.jsii.testing.ComplianceTest#unionTypes 4 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime-test/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # consumed by user.xml.t.js 5 | staging="maven-repo" 6 | rm -fr ${staging} && mkdir -p ${staging} 7 | 8 | # Remove local artifacts from local maven repository 9 | rm -fr project/.m2/software/amazon/jsii 10 | 11 | # generate user.xml & pom.xml 12 | node ./user.xml.t.js > ./project/user.xml 13 | node ./pom.xml.t.js > ./project/pom.xml 14 | 15 | # build jsii-calc and all dep and output to MAVEN_REPO 16 | jsii-pacmak ../../jsii-calc --outdir ${staging} -t java --recurse --verbose $@ 17 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime-test/project/.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | 3 | !index.js 4 | .idea 5 | pom.xml 6 | user.xml 7 | 8 | .classpath 9 | .project 10 | .settings 11 | 12 | # IntelliJ 13 | *.iml 14 | 15 | # Created by https://www.gitignore.io/api/maven 16 | 17 | ### Maven ### 18 | target 19 | 20 | pom.xml.tag 21 | pom.xml.releaseBackup 22 | pom.xml.versionsBackup 23 | pom.xml.next 24 | release.properties 25 | dependency-reduced-pom.xml 26 | buildNumber.properties 27 | .mvn/timing.properties 28 | 29 | # Ignore our test files 30 | compliance-report.json 31 | 32 | # Avoid ignoring Maven wrapper jar file (.jar files are usually ignored) 33 | !/.mvn/wrapper/maven-wrapper.jar 34 | 35 | 36 | # End of https://www.gitignore.io/api/maven 37 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime-test/project/.mvn/maven.config: -------------------------------------------------------------------------------- 1 | --settings=user.xml -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/.gitignore: -------------------------------------------------------------------------------- 1 | .m2 2 | .vscode 3 | *.js 4 | *.d.ts 5 | !*.t.js 6 | maven-repo 7 | *.d.ts.map 8 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/.npmignore: -------------------------------------------------------------------------------- 1 | *.sh 2 | *.t.js 3 | project 4 | test-project 5 | test-maven-repo 6 | conf 7 | 8 | tsconfig.json 9 | *.tsbuildinfo 10 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/JsiiVersion.t.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const version = require('@jsii/runtime/package.json').version.replace(/\+.+$/, ''); // omit "+build" postfix; 3 | process.stdout.write(`package software.amazon.jsii; 4 | 5 | @javax.annotation.Generated(value = "${path.basename(__filename)}", date = "${new Date().toISOString()}") 6 | final class JsiiVersion { 7 | /** The version of the @jsii/runtime this client was tested with **/ 8 | static final String JSII_RUNTIME_VERSION = "@jsii/runtime@${version}"; 9 | } 10 | `); 11 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/conf/user.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/packages/@jsii/java-runtime/conf/user.xml -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | project="./project" 4 | 5 | mkdir -p conf 6 | 7 | # generate pom.xml and JsiiVersion.java with version from package.json 8 | /usr/bin/env node ./pom.xml.t.js > ${project}/pom.xml 9 | /usr/bin/env node ./user.xml.t.js > ${project}/user.xml 10 | /usr/bin/env node ./JsiiVersion.t.js > ${project}/src/main/java/software/amazon/jsii/JsiiVersion.java 11 | 12 | # embed @jsii/runtime as a resource 13 | mkdir -p ${project}/src/main/resources/software/amazon/jsii 14 | rsync -av $(node -p 'require("path").dirname(require.resolve("@jsii/runtime/package.json"))')/webpack/ ${project}/src/main/resources/software/amazon/jsii 15 | 16 | /usr/bin/env node ./BundledRuntime.t.js > ${project}/src/main/java/software/amazon/jsii/BundledRuntime.java 17 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/lib/index.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | 3 | const version = require('../package.json').version; 4 | 5 | export const maven = { 6 | groupId: 'software.amazon.jsii', 7 | artifactId: 'jsii-runtime', 8 | version: version === '0.0.0' ? '0.0.0-SNAPSHOT' : version.replace(/\+.+$/, ''), 9 | }; 10 | 11 | export const repository = path.resolve(__dirname, '../maven-repo'); 12 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/project/.mvn/maven.config: -------------------------------------------------------------------------------- 1 | --settings=user.xml -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/Builder.java: -------------------------------------------------------------------------------- 1 | package software.amazon.jsii; 2 | 3 | /** 4 | * A superinterface common to instance builders. 5 | */ 6 | @FunctionalInterface 7 | public interface Builder { 8 | /** 9 | * Builds the instance given the current builder configuration. 10 | * 11 | * @return the built instance. 12 | */ 13 | T build(); 14 | } 15 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/JsiiCallbackHandler.java: -------------------------------------------------------------------------------- 1 | package software.amazon.jsii; 2 | 3 | import software.amazon.jsii.api.Callback; 4 | import com.fasterxml.jackson.databind.JsonNode; 5 | 6 | /** 7 | * Invoked to handle native synchronous callbacks. 8 | */ 9 | public interface JsiiCallbackHandler { 10 | /** 11 | * Invoked to handle a request from jsii to process a native (java) callback. 12 | * @param callback The callback info. 13 | * @return The return value of the callback. 14 | */ 15 | JsonNode handleCallback(Callback callback); 16 | } 17 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/JsiiError.java: -------------------------------------------------------------------------------- 1 | package software.amazon.jsii; 2 | 3 | /** 4 | * A nonrecoverable error from the jsii runtime, 5 | * usually the kernel. 6 | */ 7 | public final class JsiiError extends JsiiException { 8 | public static final long serialVersionUID = 1L; 9 | 10 | /** 11 | * Creates an exception. 12 | * @param message The error message 13 | */ 14 | JsiiError(final String message) { 15 | super(message); 16 | } 17 | 18 | /** 19 | * Creates an exception. 20 | * @param e The error that caused this exception 21 | */ 22 | JsiiError(final Throwable e) { 23 | super(e); 24 | } 25 | 26 | /** 27 | * Creates an exception. 28 | * @param message The error message 29 | * @param e The error that caused this exception 30 | */ 31 | JsiiError(final String message, final Throwable e) { 32 | super(message, e); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/JsiiPromise.java: -------------------------------------------------------------------------------- 1 | package software.amazon.jsii; 2 | 3 | /** 4 | * Represents a promise to a result of an async method execution. 5 | */ 6 | public final class JsiiPromise { 7 | /** 8 | * The ID of the promise. 9 | */ 10 | private String promiseId; 11 | 12 | /** 13 | * Creates a promise. 14 | * @param promiseId The ID of the promise. 15 | */ 16 | public JsiiPromise(final String promiseId) { 17 | this.promiseId = promiseId; 18 | } 19 | 20 | /** 21 | * @return The ID of the promise. 22 | */ 23 | public String getPromiseId() { 24 | return promiseId; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/MessageInspector.java: -------------------------------------------------------------------------------- 1 | package software.amazon.jsii; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | 5 | interface MessageInspector { 6 | void inspect(final JsonNode message, final MessageType type); 7 | 8 | enum MessageType { 9 | Request, 10 | Response; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/Optional.java: -------------------------------------------------------------------------------- 1 | package software.amazon.jsii; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * Denotes an optional member from the TypeScript model for the API. 7 | * 8 | * Annotated methods have a default implementation that throws {@link UnsupportedOperationException} when invoked. 9 | * In a similar way that they have to in TypeScript, implementors need to actively opt into supporting the 10 | * functionality by providing a custom implementation for the member. 11 | */ 12 | @Documented 13 | @Target({ElementType.METHOD}) 14 | @Retention(RetentionPolicy.SOURCE) 15 | public @interface Optional {} 16 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/api/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jsii-runtime API. 3 | */ 4 | package software.amazon.jsii.api; 5 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/project/src/main/java/software/amazon/jsii/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jsii Runtime for Java. 3 | */ 4 | package software.amazon.jsii; 5 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/project/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline 2 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/project/src/test/resources/software/amazon/jsii/complex-callback.json: -------------------------------------------------------------------------------- 1 | { 2 | "cbid": "CallbackID", 3 | "invoke": { 4 | "method": "methodName", 5 | "args": [ 6 | 1337, 7 | { "$jsii.byref": "module.Type@1" }, 8 | { "$jsii.date": "2019-03-26T18:27:43.569Z" }, 9 | { "$jsii.enum": "module.Enum#value" } 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base", 3 | "include": ["**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/@jsii/java-runtime/user.xml.t.js: -------------------------------------------------------------------------------- 1 | const jsiiJavaRuntime = require('@jsii/java-runtime'); 2 | const path = require('path'); 3 | 4 | process.stdout.write(` 5 | 8 | 9 | 10 | 11 | ${path.resolve(__dirname, 'project', '.m2', 'repository')} 12 | 13 | `); 14 | -------------------------------------------------------------------------------- /packages/@jsii/kernel/.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: ../../../eslint-config.yaml 3 | -------------------------------------------------------------------------------- /packages/@jsii/kernel/.gitignore: -------------------------------------------------------------------------------- 1 | /coverage/ 2 | /lib/ 3 | /node_modules/ 4 | -------------------------------------------------------------------------------- /packages/@jsii/kernel/.npmignore: -------------------------------------------------------------------------------- 1 | # Don't include the original source files 2 | /src/ 3 | 4 | # Don't include test files 5 | /coverage/ 6 | /lib/**/*.test.* 7 | 8 | # No build tools & configuration 9 | /.eslintrc.yaml 10 | /jest.config.ts 11 | tsconfig.json 12 | *.map 13 | *.tsbuildinfo 14 | -------------------------------------------------------------------------------- /packages/@jsii/kernel/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@jsii/kernel/README.md: -------------------------------------------------------------------------------- 1 | # @jsii/kernel 2 | 3 | Implements interaction API between jsii proxy classes and jsii modules, part of 4 | the [jsii] project. 5 | 6 | The __@jsii/kernel__ is a library, normally hosted within a [@jsii/runtime] 7 | process. It provides the basic interaction API that allows language-specific 8 | proxy object to interact with javascript objects they represent. 9 | 10 | [jsii]: https://github.com/aws/jsii 11 | [@jsii/runtime]: https://github.com/aws/jsii/tree/main/packages/@jsii/runtime 12 | 13 | See [`api.ts`](./lib/api.ts) for request/response API. 14 | 15 | ## License 16 | 17 | __jsii__ is distributed under the 18 | [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). 19 | 20 | See [LICENSE](./LICENSE) and [NOTICE](./NOTICE) for more information. 21 | -------------------------------------------------------------------------------- /packages/@jsii/kernel/jest.config.mjs: -------------------------------------------------------------------------------- 1 | import config from '../../../jest.config.mjs'; 2 | 3 | export default config; 4 | -------------------------------------------------------------------------------- /packages/@jsii/kernel/src/disk-cache/digest-file.ts: -------------------------------------------------------------------------------- 1 | import { createHash } from 'crypto'; 2 | import { openSync, readSync, closeSync } from 'fs'; 3 | 4 | const ALGORITHM = 'sha256'; 5 | 6 | export function digestFile( 7 | path: string, 8 | ...comments: readonly string[] 9 | ): Buffer { 10 | const hash = createHash(ALGORITHM); 11 | 12 | const buffer = Buffer.alloc(16_384); 13 | const fd = openSync(path, 'r'); 14 | try { 15 | let bytesRead = 0; 16 | while ((bytesRead = readSync(fd, buffer)) > 0) { 17 | hash.update(buffer.slice(0, bytesRead)); 18 | } 19 | for (const comment of comments) { 20 | hash.update('\0'); 21 | hash.update(comment); 22 | } 23 | return hash.digest(); 24 | } finally { 25 | closeSync(fd); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/@jsii/kernel/src/disk-cache/index.ts: -------------------------------------------------------------------------------- 1 | export * from './disk-cache'; 2 | -------------------------------------------------------------------------------- /packages/@jsii/kernel/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './kernel'; 2 | 3 | import * as api from './api'; 4 | export { api }; 5 | -------------------------------------------------------------------------------- /packages/@jsii/kernel/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base", 3 | "compilerOptions": { 4 | "target": "ES2019", // Keep code-compatible with Node 12+ 5 | "rootDir": "src", 6 | "outDir": "lib", 7 | }, 8 | "include": [ 9 | "src/**/*.ts" 10 | ], 11 | "references": [ 12 | { 13 | "path": "../spec" 14 | }, 15 | ], 16 | } 17 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/.gitignore: -------------------------------------------------------------------------------- 1 | src/jsii/_embedded 2 | src/jsii/_metadata.json 3 | 4 | *.egg-info 5 | dist/ 6 | .env 7 | 8 | *.whl 9 | *.tar.gz 10 | 11 | __pycache__ 12 | .mypy_cache 13 | .pytest_cache 14 | 15 | # Occasionally left behind by pip, transient (safe to delete) 16 | build/ 17 | 18 | README.md 19 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include pyproject.toml 2 | include LICENSE NOTICE README.md 3 | include src/jsii/_metadata.json 4 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/build-tools/venv.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env npx ts-node 2 | 3 | import { join } from 'path'; 4 | import { venv, runCommand } from './_constants'; 5 | 6 | const [, , command, ...args] = process.argv; 7 | 8 | const argv0 = join(venv.bin, command); 9 | 10 | console.log(`Running: ${argv0} ${args.join(' ')}`); 11 | runCommand(argv0, args); 12 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | ignore_missing_imports = True 3 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools~=80.3", "wheel~=0.45"] 3 | build-backend = 'setuptools.build_meta' 4 | 5 | [tool.black] 6 | target-version = ['py39', 'py310', 'py311'] 7 | include = '\.pyi?$' 8 | exclude = '\.(git|mypy_cache|env)' 9 | 10 | [tool.mypy] 11 | ignore_missing_imports = true 12 | 13 | [tool.pyright] 14 | pythonVersion = "3.9" 15 | venv = ".env" 16 | venvPath = "." 17 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | norecursedirs = node_modules 3 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/requirements.txt: -------------------------------------------------------------------------------- 1 | black~=25.1 2 | mypy==1.15.0 3 | pip~=25.1 4 | pytest~=8.3 5 | pytest-mypy~=1.0 6 | setuptools~=80.3 7 | types-python-dateutil~=2.9 8 | wheel~=0.45 9 | 10 | -e . 11 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/src/jsii/__meta__.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from ._compat import importlib_resources 4 | 5 | # Load our version number and other metadata. 6 | _meta = json.loads( 7 | importlib_resources.files("jsii").joinpath("_metadata.json").read_text() 8 | ) 9 | 10 | __version__ = _meta["version"] 11 | __jsii_runtime_version__ = _meta["jsii-runtime"]["version"] 12 | 13 | 14 | __all__ = ["__version__", "__jsii_runtime_version__"] 15 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/src/jsii/_compat.py: -------------------------------------------------------------------------------- 1 | # Internal Compatability Shims 2 | import sys 3 | 4 | 5 | import importlib_resources 6 | 7 | 8 | __all__ = ["importlib_resources"] 9 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/src/jsii/_embedded/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/packages/@jsii/python-runtime/src/jsii/_embedded/__init__.py -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/src/jsii/_embedded/jsii/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/packages/@jsii/python-runtime/src/jsii/_embedded/jsii/.gitkeep -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/src/jsii/_kernel/providers/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import BaseProvider 2 | from .process import ProcessProvider 3 | 4 | 5 | __all__ = ["BaseProvider", "ProcessProvider"] 6 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/src/jsii/_utils.py: -------------------------------------------------------------------------------- 1 | import functools 2 | 3 | from typing import Any, MutableMapping, Type 4 | 5 | 6 | class Singleton(type): 7 | _instances: MutableMapping[Type[Any], Any] = {} 8 | 9 | def __call__(cls, *args, **kwargs): 10 | if cls not in cls._instances: 11 | cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) 12 | 13 | return cls._instances[cls] 14 | 15 | 16 | def memoized_property(fgetter): 17 | stored = [] 18 | 19 | @functools.wraps(fgetter) 20 | def wrapped(self): 21 | nonlocal stored 22 | if not stored: 23 | stored.append(fgetter(self)) 24 | return stored[0] 25 | 26 | return property(wrapped) 27 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/src/jsii/compat.py: -------------------------------------------------------------------------------- 1 | # External Compatability Shims 2 | 3 | from typing_extensions import Protocol 4 | 5 | 6 | __all__ = ["Protocol"] 7 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/src/jsii/errors.py: -------------------------------------------------------------------------------- 1 | import textwrap 2 | from enum import Enum 3 | 4 | 5 | class JSIIError(Exception): 6 | pass 7 | 8 | 9 | class JavaScriptError(Exception): 10 | def __init__(self, stack): 11 | self.stack = stack 12 | 13 | def __str__(self): 14 | return "\n" + textwrap.indent(self.stack, " ", lambda line: bool(line)) 15 | 16 | 17 | class ErrorType(Enum): 18 | JSII_FAULT = "@jsii/kernel.Fault" 19 | RUNTIME_ERROR = "@jsii/kernel.RuntimeError" 20 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/src/jsii/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/packages/@jsii/python-runtime/src/jsii/py.typed -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/tests/README.md: -------------------------------------------------------------------------------- 1 | # Python jsii runtime tests 2 | ## Development Iteration 3 | 4 | When iterating on the jsii runtime for Python, the developer must run 5 | `yarn build` before making a subsequent attempt at running `pytest` (e.g: via 6 | `yarn test`). This is because the tests run on the code installed in `.env` and 7 | this is updated only by `yarn build`. 8 | 9 | Note also that stack traces from test failures will point to the `.env` tree, 10 | so be careful when using IDE linkage to navigate to points of that trace. 11 | -------------------------------------------------------------------------------- /packages/@jsii/python-runtime/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/packages/@jsii/python-runtime/tests/__init__.py -------------------------------------------------------------------------------- /packages/@jsii/runtime/.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: ../../../eslint-config.yaml 3 | -------------------------------------------------------------------------------- /packages/@jsii/runtime/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.d.ts 3 | dist 4 | webpack 5 | !webpack.config.js 6 | 7 | node_modules/ 8 | .nyc_output/ 9 | coverage/ 10 | 11 | test/_tarballs/ 12 | *.d.ts.map 13 | -------------------------------------------------------------------------------- /packages/@jsii/runtime/.npmignore: -------------------------------------------------------------------------------- 1 | # Don't include original .ts files when doing `npm pack` 2 | *.ts 3 | !*.d.ts 4 | *.sh 5 | dist 6 | 7 | # Don't include various configuration & state information 8 | coverage 9 | .eslintrc.* 10 | tsconfig.json 11 | *.tsbuildinfo 12 | 13 | test/_tarballs/ 14 | -------------------------------------------------------------------------------- /packages/@jsii/runtime/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@jsii/runtime/bin/jsii-runtime: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('./jsii-runtime.js'); 3 | -------------------------------------------------------------------------------- /packages/@jsii/runtime/jest.config.mjs: -------------------------------------------------------------------------------- 1 | import { overriddenConfig } from '../../../jest.config.mjs'; 2 | 3 | export default overriddenConfig({ 4 | coveragePathIgnorePatterns: [ 5 | // This cannot be tested in a way that enables collection of coverage 6 | '/lib/sync-stdio.ts', 7 | ], 8 | coverageThreshold: { 9 | global: { 10 | branches: 48, 11 | }, 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /packages/@jsii/runtime/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from './host'; 2 | export * from './in-out'; 3 | -------------------------------------------------------------------------------- /packages/@jsii/runtime/test/stress.test.ts: -------------------------------------------------------------------------------- 1 | import { KernelHost } from '../lib/host'; 2 | import { IInputOutput, Input, Output } from '../lib/in-out'; 3 | 4 | const requestCount = 250_000; 5 | 6 | class FakeInputOutput implements IInputOutput { 7 | private count = 0; 8 | 9 | public write(_: Output) { 10 | /* noop */ 11 | } 12 | 13 | public read(): Input | undefined { 14 | if (this.count === requestCount) { 15 | return undefined; 16 | } 17 | 18 | ++this.count; 19 | return { api: 'stats' }; 20 | } 21 | } 22 | 23 | test(`runtime host is able to action ${requestCount} requests`, () => { 24 | const inout = new FakeInputOutput(); 25 | const host = new KernelHost(inout, { debug: false, noStack: false }); 26 | 27 | expect(() => host.run()).not.toThrow(); 28 | }); 29 | -------------------------------------------------------------------------------- /packages/@jsii/runtime/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base", 3 | "compilerOptions": { 4 | "target": "ES2019", // Keep source-compatible with Node 12+ 5 | }, 6 | "include": [ 7 | "**/*.ts", 8 | "package.json" 9 | ], 10 | "exclude": [ 11 | "package.d.ts", 12 | "jest.config.ts", 13 | ], 14 | "references": [ 15 | { 16 | "path": "../kernel" 17 | }, 18 | { 19 | "path": "../check-node" 20 | }, 21 | { 22 | "path": "../spec" 23 | }, 24 | ], 25 | } 26 | -------------------------------------------------------------------------------- /packages/@jsii/spec/.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: ../../../eslint-config.yaml 3 | -------------------------------------------------------------------------------- /packages/@jsii/spec/.gitignore: -------------------------------------------------------------------------------- 1 | /coverage/ 2 | /lib/ 3 | /node_modules/ 4 | /schema/ 5 | -------------------------------------------------------------------------------- /packages/@jsii/spec/.npmignore: -------------------------------------------------------------------------------- 1 | # Don't include the original source files 2 | /src/ 3 | 4 | # Don't include test files 5 | /coverage/ 6 | /lib/**/*.test.* 7 | /test-data/ 8 | 9 | # No build tools & configuration 10 | /build-tools/ 11 | /.eslintrc.yaml 12 | /jest.config.ts 13 | tsconfig.json 14 | *.map 15 | *.tsbuildinfo 16 | -------------------------------------------------------------------------------- /packages/@jsii/spec/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@jsii/spec/README.md: -------------------------------------------------------------------------------- 1 | # @jsii/spec 2 | 3 | Defines the [JSON specification](./lib/spec.ts) for .jsii metadata files, part of the [jsii] project. 4 | 5 | [jsii]: https://github.com/aws/jsii 6 | 7 | ## License 8 | 9 | __jsii__ is distributed under the 10 | [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). 11 | 12 | See [LICENSE](./LICENSE) and [NOTICE](./NOTICE) for more information. 13 | 14 | -------------------------------------------------------------------------------- /packages/@jsii/spec/jest.config.mjs: -------------------------------------------------------------------------------- 1 | import { overriddenConfig } from '../../../jest.config.mjs'; 2 | 3 | export default overriddenConfig({ 4 | coverageThreshold: { 5 | global: { 6 | branches: 28, 7 | }, 8 | }, 9 | }); 10 | -------------------------------------------------------------------------------- /packages/@jsii/spec/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './assembly'; 2 | export * from './assembly-utils'; 3 | export * from './configuration'; 4 | export * from './name-tree'; 5 | export * from './redirect'; 6 | export * from './validate-assembly'; 7 | -------------------------------------------------------------------------------- /packages/@jsii/spec/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base", 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib", 6 | }, 7 | "include": [ 8 | "src/**/*.ts" 9 | ], 10 | } 11 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-base-of-base/.gitignore: -------------------------------------------------------------------------------- 1 | tsconfig.json 2 | dist 3 | .jsii 4 | *.tgz 5 | 6 | *.js 7 | *.d.ts 8 | *.tsbuildinfo 9 | node_modules/ 10 | .nyc_output/ 11 | coverage/ 12 | *.d.ts.map 13 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-base-of-base/.npmignore: -------------------------------------------------------------------------------- 1 | # Don't include original .ts files when doing `npm pack` 2 | *.ts 3 | !*.d.ts 4 | *.tgz 5 | 6 | 7 | # Include .jsii and .jsii.gz 8 | !.jsii 9 | !.jsii.gz 10 | 11 | 12 | # Exclude jsii outdir 13 | dist 14 | 15 | tsconfig.json 16 | *.tsbuildinfo 17 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-base-of-base/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-base-of-base/lib/index.ts: -------------------------------------------------------------------------------- 1 | export interface IVeryBaseInterface { 2 | foo(): void; 3 | } 4 | 5 | export interface VeryBaseProps { 6 | readonly foo: Very; 7 | } 8 | 9 | /** 10 | * Something here 11 | * @experimental 12 | */ 13 | export class Very { 14 | public hey() { 15 | return 42; 16 | } 17 | } 18 | 19 | export class StaticConsumer { 20 | private constructor() {} 21 | 22 | public static consume(..._args: any[]): void { 23 | return; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-base/.gitignore: -------------------------------------------------------------------------------- 1 | tsconfig.json 2 | dist 3 | .jsii 4 | *.tgz 5 | 6 | tsconfig.json 7 | dist 8 | .jsii 9 | 10 | *.js 11 | *.d.ts 12 | *.tsbuildinfo 13 | node_modules/ 14 | .nyc_output/ 15 | coverage/ 16 | *.d.ts.map 17 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-base/.npmignore: -------------------------------------------------------------------------------- 1 | # Don't include original .ts files when doing `npm pack` 2 | *.ts 3 | !*.d.ts 4 | *.tgz 5 | 6 | 7 | # Include .jsii and .jsii.gz 8 | !.jsii 9 | !.jsii.gz 10 | 11 | 12 | # Exclude jsii outdir 13 | dist 14 | 15 | tsconfig.json 16 | *.tsbuildinfo 17 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-base/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-base/lib/index.ts: -------------------------------------------------------------------------------- 1 | import { 2 | IVeryBaseInterface, 3 | VeryBaseProps, 4 | StaticConsumer as StaticConsumerBase, 5 | } from '@scope/jsii-calc-base-of-base'; 6 | 7 | /** 8 | * A base class. 9 | */ 10 | export abstract class Base { 11 | /** 12 | * @returns the name of the class (to verify native type names are created for derived classes). 13 | */ 14 | public typeName() { 15 | return (this.constructor as any).name; 16 | } 17 | } 18 | 19 | export interface BaseProps extends VeryBaseProps { 20 | readonly bar: string; 21 | } 22 | 23 | export interface IBaseInterface extends IVeryBaseInterface { 24 | bar(): void; 25 | } 26 | 27 | /** 28 | * Hides the transitive dependency of base-of-base 29 | */ 30 | export class StaticConsumer { 31 | public static consume(...args: any[]) { 32 | return StaticConsumerBase.consume(...args); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-lib/.gitignore: -------------------------------------------------------------------------------- 1 | tsconfig.json 2 | build/ 3 | dist/ 4 | .jsii 5 | *.tgz 6 | 7 | *.js 8 | *.d.ts 9 | *.tsbuildinfo 10 | node_modules/ 11 | .nyc_output/ 12 | coverage/ 13 | *.d.ts.map 14 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-lib/.npmignore: -------------------------------------------------------------------------------- 1 | # Don't include original .ts files when doing `npm pack` 2 | *.ts 3 | !*.d.ts 4 | *.tgz 5 | 6 | 7 | # Include .jsii and .jsii.gz 8 | !.jsii 9 | !.jsii.gz 10 | 11 | 12 | # Exclude jsii outdir 13 | dist 14 | 15 | tsconfig.json 16 | *.tsbuildinfo 17 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-lib/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-lib/deprecated-to-strip.txt: -------------------------------------------------------------------------------- 1 | @scope/jsii-calc-lib.deprecationRemoval.DeprecatedImplementation 2 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-lib/lib/deprecation-removal.ts: -------------------------------------------------------------------------------- 1 | export class VisibleBaseClass { 2 | public readonly propertyPresent: boolean; 3 | 4 | public constructor() { 5 | this.propertyPresent = true; 6 | } 7 | } 8 | 9 | export interface IInterface { 10 | method(): void; 11 | } 12 | 13 | /** @deprecated do not use me! */ 14 | export class DeprecatedImplementation 15 | extends VisibleBaseClass 16 | implements IInterface 17 | { 18 | public method(): void { 19 | /** NOOP */ 20 | } 21 | } 22 | 23 | export class InterfaceFactory { 24 | public static create(): IInterface { 25 | return new DeprecatedImplementation(); 26 | } 27 | 28 | private constructor() {} 29 | } 30 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-lib/lib/duplicate-inherited-prop.ts: -------------------------------------------------------------------------------- 1 | // This is half of the contraption, the rest is in jsii-calc 2 | // 3 | // @see https://github.com/aws/jsii/issues/2256 4 | 5 | /** 6 | * This struct is intentionally private. Any type that implements it will get 7 | * a copy of it's properties hoisted in by jsii. 8 | */ 9 | interface InternalDiamondTip { 10 | readonly hoistedTop?: string; 11 | } 12 | 13 | export interface DiamondLeft extends InternalDiamondTip { 14 | readonly left?: number; 15 | } 16 | 17 | export interface DiamondRight extends InternalDiamondTip { 18 | readonly right?: boolean; 19 | } 20 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-lib/lib/submodule/.jsiirc.json: -------------------------------------------------------------------------------- 1 | { 2 | "targets": { 3 | "dotnet": { 4 | "namespace": "Amazon.JSII.Tests.CustomSubmoduleName" 5 | }, 6 | "java": { 7 | "package": "software.amazon.jsii.tests.calculator.custom_submodule_name" 8 | }, 9 | "python": { 10 | "module": "scope.jsii_calc_lib.custom_submodule_name" 11 | }, 12 | "go" :{ 13 | "packageName": "customsubmodulename" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/@scope/jsii-calc-lib/lib/submodule/README.md: -------------------------------------------------------------------------------- 1 | # Submodule Readme 2 | 3 | This is a submodule readme. 4 | -------------------------------------------------------------------------------- /packages/codemaker/.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: ../../eslint-config.yaml 3 | -------------------------------------------------------------------------------- /packages/codemaker/.gitignore: -------------------------------------------------------------------------------- 1 | /coverage/ 2 | /lib/ 3 | /node_modules/ 4 | -------------------------------------------------------------------------------- /packages/codemaker/.npmignore: -------------------------------------------------------------------------------- 1 | # Don't include the original source files 2 | /src/ 3 | 4 | # Don't include test files 5 | /coverage/ 6 | /lib/**/*.test.* 7 | 8 | # No build tools & configuration 9 | /.eslintrc.yaml 10 | /jest.config.ts 11 | tsconfig.json 12 | *.map 13 | *.tsbuildinfo 14 | -------------------------------------------------------------------------------- /packages/codemaker/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/codemaker/jest.config.mjs: -------------------------------------------------------------------------------- 1 | import config from '../../jest.config.mjs'; 2 | 3 | export default config; 4 | -------------------------------------------------------------------------------- /packages/codemaker/src/filebuff.test.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'fs-extra'; 2 | import * as os from 'os'; 3 | import * as path from 'path'; 4 | 5 | import FileBuffer from './filebuff'; 6 | 7 | test('file buffer', async () => { 8 | const fb = new FileBuffer('hello.source'); 9 | fb.write('hello'); 10 | fb.write('\n'); 11 | fb.write('world'); 12 | 13 | // save the file 14 | const tempdir = await fs.mkdtemp(path.join(os.tmpdir(), 'test-file-buffer')); 15 | await fb.save(tempdir); 16 | 17 | // verify the contents was as expected 18 | const data = (await fs.readFile(path.join(tempdir, fb.filePath))).toString(); 19 | expect(data).toBe('hello\nworld'); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/codemaker/src/filebuff.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | 3 | /** 4 | * Buffers the text of a file for later saving. 5 | */ 6 | export default class FileBuffer { 7 | public readonly filePath: string; 8 | private buffer = ''; 9 | 10 | public constructor(filePath: string) { 11 | this.filePath = filePath; 12 | } 13 | 14 | public write(s: string) { 15 | this.buffer += s; 16 | } 17 | 18 | public async save(rootDir: string) { 19 | // just-in-time require so that this file can be loaded in browsers as well. 20 | // eslint-disable-next-line @typescript-eslint/no-require-imports,@typescript-eslint/no-var-requires 21 | const fs = require('fs-extra'); 22 | 23 | const fullPath = path.join(rootDir, this.filePath); 24 | await fs.mkdirs(path.dirname(fullPath)); 25 | await fs.writeFile(fullPath, this.buffer); 26 | return fullPath; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/codemaker/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './codemaker'; 2 | export * from './case-utils'; 3 | -------------------------------------------------------------------------------- /packages/codemaker/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig-base", 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib", 6 | }, 7 | "include": [ 8 | "src/**/*.ts" 9 | ], 10 | } 11 | -------------------------------------------------------------------------------- /packages/jsii-calc/.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: ../../eslint-config.yaml 3 | -------------------------------------------------------------------------------- /packages/jsii-calc/.gitignore: -------------------------------------------------------------------------------- 1 | tsconfig.json 2 | dist 3 | .jsii 4 | *.tgz 5 | 6 | *.js 7 | *.d.ts 8 | *.tsbuildinfo 9 | node_modules/ 10 | .nyc_output/ 11 | coverage/ 12 | *.d.ts.map 13 | -------------------------------------------------------------------------------- /packages/jsii-calc/.npmignore: -------------------------------------------------------------------------------- 1 | # Don't include original .ts files when doing `npm pack` 2 | *.ts 3 | !*.d.ts 4 | *.tgz 5 | 6 | # Include .jsii and .jsii.gz 7 | !.jsii 8 | !.jsii.gz 9 | 10 | 11 | # Exclude jsii outdir 12 | dist 13 | 14 | tsconfig.json 15 | *.tsbuildinfo 16 | -------------------------------------------------------------------------------- /packages/jsii-calc/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/jsii-calc/README.md: -------------------------------------------------------------------------------- 1 | # jsii Calculator 2 | 3 | This library is used to demonstrate and test the features of JSII 4 | 5 | ## How to use running sum API: 6 | 7 | First, create a calculator: 8 | 9 | ```ts 10 | const calculator = new calc.Calculator(); 11 | ``` 12 | 13 | Then call some operations: 14 | 15 | 16 | ```ts fixture=with-calculator 17 | calculator.add(10); 18 | ``` 19 | 20 | ## Code Samples 21 | 22 | ```ts 23 | /* This is totes a magic comment in here, just you wait! */ 24 | const foo = 'bar'; 25 | ``` 26 | -------------------------------------------------------------------------------- /packages/jsii-calc/bin/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('./run.js'); 3 | -------------------------------------------------------------------------------- /packages/jsii-calc/bin/run.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | node "%~dp0\run" %* 3 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/cdk16625/donotimport/index.ts: -------------------------------------------------------------------------------- 1 | import type { IRandomNumberGenerator } from '../../calculator'; 2 | 3 | /** 4 | * This type demonstrates the ability to receive a callback argument that has a 5 | * type from a submodule not explicitly imported in the user's code. This checks 6 | * that all types available in the assembly can be resolved by the runtime 7 | * library, regardless of whether they were explicitly referenced or not. 8 | * 9 | * @see https://github.com/aws/aws-cdk/issues/16625 10 | */ 11 | export class UnimportedSubmoduleType implements IRandomNumberGenerator { 12 | public constructor(private readonly value: number) {} 13 | 14 | /** 15 | * Not quite random, but it'll do. 16 | * 17 | * @returns 1337 18 | */ 19 | public next(): number { 20 | return this.value; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/cdk16625/index.ts: -------------------------------------------------------------------------------- 1 | import * as assert from 'assert'; 2 | 3 | import { IRandomNumberGenerator } from '../calculator'; 4 | import { UnimportedSubmoduleType } from './donotimport'; 5 | 6 | export * as donotimport from './donotimport'; 7 | 8 | export abstract class Cdk16625 { 9 | /** 10 | * Implement this functin to return `gen.next()`. It is extremely important 11 | * that the `donotimport` submodule is NEVER explicitly loaded in the testing 12 | * application (otherwise this test is void). 13 | * 14 | * @param gen a VERY pseudo random number generator. 15 | */ 16 | protected abstract unwrap(gen: IRandomNumberGenerator): number; 17 | 18 | /** 19 | * Run this function to verify that everything is working as it should. 20 | */ 21 | public test(): void { 22 | const value = 1337; 23 | const rng = new UnimportedSubmoduleType(value); 24 | assert(this.unwrap(rng) === value); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/cdk22369/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Test case for failing dotnet error serialization that occurs when 3 | * and error is thrown during struct instantiation 4 | * 5 | * See https://github.com/aws/aws-cdk/issues/22369 6 | */ 7 | import * as fs from 'fs'; 8 | import * as path from 'path'; 9 | 10 | export interface AcceptsPathProps { 11 | /** 12 | * A path that doesn't exist 13 | */ 14 | readonly sourcePath: string; 15 | } 16 | 17 | export class AcceptsPath { 18 | private readonly sourcePath: string; 19 | public constructor(props: AcceptsPathProps) { 20 | this.sourcePath = path.resolve(props.sourcePath); 21 | if (!fs.existsSync(this.sourcePath)) { 22 | throw new Error(`Cannot find asset`); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/container-types.ts: -------------------------------------------------------------------------------- 1 | export class ClassWithContainerTypes { 2 | public constructor( 3 | public readonly array: DummyObj[], 4 | public readonly record: Record, 5 | public readonly obj: { [key: string]: DummyObj }, 6 | public readonly props?: ContainerProps, 7 | ) {} 8 | } 9 | 10 | export interface ContainerProps { 11 | readonly arrayProp: DummyObj[]; 12 | readonly recordProp: Record; 13 | readonly objProp: { [key: string]: DummyObj }; 14 | } 15 | 16 | export interface DummyObj { 17 | readonly example: string; 18 | } 19 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/duplicate-inherited-prop.ts: -------------------------------------------------------------------------------- 1 | import { DiamondLeft, DiamondRight } from '@scope/jsii-calc-lib'; 2 | 3 | // This is half of the contraption, the rest is in @scope/jsii-calc-lib. 4 | // 5 | // @see https://github.com/aws/jsii/issues/2256 6 | 7 | export interface DiamondBottom extends DiamondLeft, DiamondRight { 8 | readonly bottom?: Date; 9 | } 10 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/homonymous/README.md: -------------------------------------------------------------------------------- 1 | Verifies homonymous forward references don't trip the Python type checker 2 | 3 | This has been an issue when stub functions were introduced to create a reliable source for type checking 4 | information, which was reported in https://github.com/aws/jsii/issues/3818. 5 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/homonymous/bar.ts: -------------------------------------------------------------------------------- 1 | export interface Homonymous { 2 | readonly numericProperty: number; 3 | } 4 | 5 | export interface ConsumerProps { 6 | readonly homonymous: Homonymous; 7 | } 8 | 9 | export class Consumer { 10 | public static consume(props: ConsumerProps) { 11 | return props.homonymous; 12 | } 13 | 14 | private constructor() {} 15 | } 16 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/homonymous/foo.ts: -------------------------------------------------------------------------------- 1 | export interface Homonymous { 2 | readonly stringProperty: string; 3 | } 4 | 5 | export interface ConsumerProps { 6 | readonly homonymous: Homonymous; 7 | } 8 | 9 | export class Consumer { 10 | public static consume(props: ConsumerProps) { 11 | return props.homonymous; 12 | } 13 | 14 | private constructor() {} 15 | } 16 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/homonymous/index.ts: -------------------------------------------------------------------------------- 1 | export * as bar from './bar'; 2 | export * as foo from './foo'; 3 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/indirect-implementation.ts: -------------------------------------------------------------------------------- 1 | export interface IIndirectlyImplemented { 2 | readonly property: string; 3 | method(): number; 4 | } 5 | 6 | export abstract class BaseClass { 7 | public readonly property = 'YES'; 8 | 9 | protected constructor() {} 10 | 11 | public method(): number { 12 | return 1337; 13 | } 14 | } 15 | 16 | export class FullCombo extends BaseClass implements IIndirectlyImplemented { 17 | private constructor() { 18 | super(); 19 | } 20 | 21 | // Obtains implementation of IIndirectlyImplemented from BaseClass 22 | } 23 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/jsii3656/index.ts: -------------------------------------------------------------------------------- 1 | export abstract class OverrideMe { 2 | public static callAbstract(receiver: OverrideMe): boolean { 3 | return receiver.implementMe({ 4 | name: 'John Doe', 5 | // Decided not to pass count here... 6 | }); 7 | } 8 | 9 | public abstract implementMe(opts: ImplementMeOpts): boolean; 10 | } 11 | 12 | export interface ImplementMeOpts { 13 | readonly name: string; 14 | readonly count?: number; 15 | } 16 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/module2530/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Verifies a method with parameters "_" can be generated. 3 | * @see https://github.com/aws/jsii/issues/2530 4 | */ 5 | export class MyClass { 6 | public static bar(_: boolean) { 7 | return; 8 | } 9 | 10 | public constructor(_: number) { 11 | return; 12 | } 13 | 14 | public foo(_: string) { 15 | return; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/module2617/index.ts: -------------------------------------------------------------------------------- 1 | // @see https://github.com/aws/jsii/issues/2617 2 | 3 | export class OnlyStatics { 4 | public static foo() { 5 | return; 6 | } 7 | public static bar() { 8 | return; 9 | } 10 | private constructor() {} 11 | } 12 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/module2647/index.ts: -------------------------------------------------------------------------------- 1 | import { IFriendly, BaseFor2647 } from '@scope/jsii-calc-lib'; 2 | 3 | /** 4 | * This class falls into the category of "multiple bases" from a different 5 | * module from a go code gen perspective. 6 | * 7 | * @see https://github.com/aws/jsii/issues/2647 8 | */ 9 | export class ExtendAndImplement extends BaseFor2647 implements IFriendly { 10 | public localMethod() { 11 | return 'hi'; 12 | } 13 | 14 | public hello() { 15 | return 'extends and implements'; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/module2689/index.ts: -------------------------------------------------------------------------------- 1 | // 2 | // Verifies that the correct imports are generated for Go code when forien types 3 | // are referenced in complex fields (array and map). 4 | // 5 | // @see https://github.com/aws/jsii/issues/2689 6 | 7 | export * as structs from './structs'; 8 | export * as methods from './methods'; 9 | export * as props from './props'; 10 | export * as retval from './retval'; 11 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/module2689/methods/index.ts: -------------------------------------------------------------------------------- 1 | import { BaseProps } from '@scope/jsii-calc-base'; 2 | import { Number as NumberClass } from '@scope/jsii-calc-lib'; 3 | 4 | export class MyClass { 5 | public foo(_values: NumberClass[]) { 6 | return; 7 | } 8 | 9 | public bar(_bar: { [k: string]: BaseProps }) { 10 | return; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/module2689/props/index.ts: -------------------------------------------------------------------------------- 1 | import { BaseProps } from '@scope/jsii-calc-base'; 2 | import { Number as NumberClass } from '@scope/jsii-calc-lib'; 3 | 4 | export class MyClass { 5 | public readonly foo: NumberClass[] = []; 6 | public readonly bar: { [key: string]: BaseProps } = {}; 7 | } 8 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/module2689/retval/index.ts: -------------------------------------------------------------------------------- 1 | import { BaseProps } from '@scope/jsii-calc-base'; 2 | import { Number as NumberClass } from '@scope/jsii-calc-lib'; 3 | 4 | export class MyClass { 5 | public foo(): NumberClass[] { 6 | return []; 7 | } 8 | 9 | public bar(): { [k: string]: BaseProps } { 10 | return {}; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/module2689/structs/index.ts: -------------------------------------------------------------------------------- 1 | import { BaseProps } from '@scope/jsii-calc-base'; 2 | import { Number as NumberClass } from '@scope/jsii-calc-lib'; 3 | 4 | export interface MyStruct { 5 | readonly numbers: NumberClass[]; 6 | readonly baseMap: { [key: string]: BaseProps }; 7 | } 8 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/module2692/index.ts: -------------------------------------------------------------------------------- 1 | export * as submodule1 from './submodule1'; 2 | export * as submodule2 from './submodule2'; 3 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/module2692/submodule1/index.ts: -------------------------------------------------------------------------------- 1 | export interface Bar { 2 | readonly bar1: string; 3 | } 4 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/module2692/submodule2/index.ts: -------------------------------------------------------------------------------- 1 | import { Bar as Bar1 } from '../submodule1'; 2 | 3 | export interface Bar { 4 | readonly bar2: string; 5 | } 6 | 7 | export interface Foo extends Bar, Bar1 { 8 | readonly foo2: string; 9 | } 10 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/module2700/index.ts: -------------------------------------------------------------------------------- 1 | export interface IFoo { 2 | bar(): string; 3 | readonly baz: number; 4 | } 5 | 6 | export class Base implements IFoo { 7 | public readonly baz = 120; 8 | public bar() { 9 | return 'bar'; 10 | } 11 | } 12 | 13 | export class Derived extends Base implements IFoo { 14 | public zoo() { 15 | return 'zoo'; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/nested-class.ts: -------------------------------------------------------------------------------- 1 | import { submodule } from '@scope/jsii-calc-lib'; 2 | 3 | export class NestedClassInstance { 4 | public static makeInstance(): submodule.NestingClass.NestedClass { 5 | return new submodule.NestingClass.NestedClass(); 6 | } 7 | 8 | private constructor() {} 9 | } 10 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/no-direct-types/index.ts: -------------------------------------------------------------------------------- 1 | // THIS MODULE ONLY EXPORTS SUBMODULES: it tests the case in which a module does not export direct 2 | // types but rather only exports submodules (see https://github.com/aws/jsii/issues/2619) 3 | export * as sub1 from './sub1'; 4 | export * as sub2 from './sub2'; 5 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/no-direct-types/sub1/index.ts: -------------------------------------------------------------------------------- 1 | export class TypeFromSub1 { 2 | public sub1() { 3 | return 'foo'; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/no-direct-types/sub2/index.ts: -------------------------------------------------------------------------------- 1 | export class TypeFromSub2 { 2 | public sub2() { 3 | return 'foo'; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/only-static/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Test for https://github.com/aws/jsii/issues/2617 3 | */ 4 | export class OnlyStaticMethods { 5 | public static staticMethod() { 6 | return 'hello'; 7 | } 8 | 9 | private constructor() {} 10 | } 11 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/resource.txt: -------------------------------------------------------------------------------- 1 | Hello, resource! -------------------------------------------------------------------------------- /packages/jsii-calc/lib/submodule/README.md: -------------------------------------------------------------------------------- 1 | Read you, read me 2 | ================= 3 | 4 | This is the readme of the `jsii-calc.submodule` module. 5 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/submodule/index.ts: -------------------------------------------------------------------------------- 1 | export * as child from './child'; 2 | export * as isolated from './isolated'; 3 | export * as param from './param'; 4 | export * as returnsparam from './returns-param'; 5 | export * from './my-class'; 6 | export * from './nested_submodule'; 7 | export * as back_references from './refers-to-parent'; 8 | export * from './issue2637'; 9 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/submodule/isolated.README.md: -------------------------------------------------------------------------------- 1 | Read you, read me 2 | ================= 3 | 4 | This is the readme of the `jsii-calc.submodule.isolated` module. 5 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/submodule/isolated.ts: -------------------------------------------------------------------------------- 1 | import { KwargsProps } from './child'; 2 | 3 | /** 4 | * Ensures imports are correctly registered for kwargs lifted properties from 5 | * super-structs. 6 | */ 7 | export class Kwargs { 8 | public static method(props?: KwargsProps): boolean { 9 | return !!props; 10 | } 11 | 12 | private constructor() {} 13 | } 14 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/submodule/issue2637.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A struct named "Default" 3 | * 4 | * @see https://github.com/aws/jsii/issues/2637 5 | */ 6 | export interface Default { 7 | readonly foo: number; 8 | } 9 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/submodule/my-class.ts: -------------------------------------------------------------------------------- 1 | import { AllTypes } from '..'; 2 | import { Awesomeness, Goodness, SomeStruct } from './child'; 3 | import { nested_submodule } from './nested_submodule'; 4 | import { SpecialParameter } from './param'; 5 | 6 | export class MyClass implements nested_submodule.deeplyNested.INamespaced { 7 | public readonly definedAt = __filename; 8 | public readonly goodness = Goodness.AMAZINGLY_GOOD; 9 | public readonly awesomeness = Awesomeness.AWESOME; 10 | public allTypes?: AllTypes; 11 | 12 | public constructor(public readonly props: SomeStruct) {} 13 | 14 | public methodWithSpecialParam(param: SpecialParameter) { 15 | return param.value; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/submodule/nested_submodule.ts: -------------------------------------------------------------------------------- 1 | import { Goodness } from './child'; 2 | 3 | // eslint-disable-next-line @typescript-eslint/no-namespace 4 | export namespace nested_submodule { 5 | // eslint-disable-next-line @typescript-eslint/no-namespace 6 | export namespace deeplyNested { 7 | export interface INamespaced { 8 | readonly definedAt: string; 9 | } 10 | } 11 | 12 | export abstract class Namespaced implements deeplyNested.INamespaced { 13 | public readonly definedAt = __filename; 14 | public abstract readonly goodness: Goodness; 15 | 16 | private constructor() {} 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/submodule/param/index.ts: -------------------------------------------------------------------------------- 1 | export interface SpecialParameter { 2 | readonly value: string; 3 | } 4 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/submodule/refers-to-parent/index.ts: -------------------------------------------------------------------------------- 1 | import { MyClass } from '..'; 2 | 3 | export interface MyClassReference { 4 | readonly reference: MyClass; 5 | } 6 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/submodule/returns-param/index.ts: -------------------------------------------------------------------------------- 1 | import { SpecialParameter } from '../param'; 2 | 3 | export class ReturnsSpecialParameter { 4 | public returnsSpecialParam(): SpecialParameter { 5 | const ret = { value: 'foo' }; 6 | return ret; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/submodules.ts: -------------------------------------------------------------------------------- 1 | import { submodule } from '@scope/jsii-calc-lib'; 2 | 3 | /** 4 | * Ensures submodule-imported types from dependencies can be used correctly. 5 | */ 6 | export class UpcasingReflectable implements submodule.IReflectable { 7 | public static readonly reflector = new submodule.Reflector(); 8 | 9 | public constructor(private readonly delegate: Record) {} 10 | 11 | public get entries(): submodule.ReflectableEntry[] { 12 | return Object.entries(this.delegate).map(([key, value]) => ({ 13 | key: key.toLocaleUpperCase(), 14 | value, 15 | })); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/jsii-calc/lib/union.ts: -------------------------------------------------------------------------------- 1 | import { IFriendly } from '@scope/jsii-calc-lib'; 2 | 3 | export interface IResolvable { 4 | resolve(): any; 5 | } 6 | 7 | export class Resolvable implements IResolvable { 8 | private constructor() {} 9 | 10 | public resolve(): any { 11 | return false; 12 | } 13 | } 14 | 15 | export class ConsumesUnion { 16 | public static unionType(param: IResolvable | Resolvable | IFriendly) { 17 | void param; 18 | } 19 | 20 | private constructor() {} 21 | } 22 | -------------------------------------------------------------------------------- /packages/jsii-calc/rosetta/default.ts-fixture: -------------------------------------------------------------------------------- 1 | import * as calc from 'jsii-calc'; 2 | 3 | /// here 4 | -------------------------------------------------------------------------------- /packages/jsii-calc/rosetta/with-calculator.ts-fixture: -------------------------------------------------------------------------------- 1 | import * as calc from 'jsii-calc'; 2 | const calculator = new calc.Calculator(); 3 | 4 | /// here 5 | -------------------------------------------------------------------------------- /packages/jsii-calc/update-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -euo pipefail 3 | scriptdir=$(cd $(dirname $0) && pwd) 4 | cd ${scriptdir} 5 | 6 | modules="\ 7 | ../@scope/jsii-calc-base-of-base \ 8 | ../@scope/jsii-calc-base \ 9 | ../@scope/jsii-calc-lib \ 10 | ./" 11 | 12 | for mod in $modules; do 13 | node -p "require('./package.json').name" 14 | ( 15 | cd $mod 16 | yarn build 17 | yarn test:update 18 | ) 19 | done 20 | 21 | -------------------------------------------------------------------------------- /packages/jsii-config/.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: ../../eslint-config.yaml 3 | -------------------------------------------------------------------------------- /packages/jsii-config/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.d.ts 3 | node_modules/ 4 | coverage/ 5 | *.d.ts.map 6 | -------------------------------------------------------------------------------- /packages/jsii-config/.npmignore: -------------------------------------------------------------------------------- 1 | * 2 | 3 | !**/*.js 4 | !**/*.d.ts 5 | !bin/jsii-config 6 | 7 | coverage 8 | 9 | # Don't include various configuration & state information 10 | coverage 11 | .eslintrc.* 12 | tsconfig.json 13 | *.tsbuildinfo 14 | -------------------------------------------------------------------------------- /packages/jsii-config/bin/jsii-config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('./jsii-config.js'); 3 | -------------------------------------------------------------------------------- /packages/jsii-config/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws/jsii/b5870596365878a9eb13ecd60ac368bfd7a02faa/packages/jsii-config/demo.gif -------------------------------------------------------------------------------- /packages/jsii-config/jest.config.mjs: -------------------------------------------------------------------------------- 1 | import config from '../../jest.config.mjs'; 2 | 3 | export default config; 4 | -------------------------------------------------------------------------------- /packages/jsii-config/lib/index.ts: -------------------------------------------------------------------------------- 1 | import prompt from './prompt'; 2 | import { readFilePromise } from './util'; 3 | import validatePackageJson from './validate'; 4 | 5 | export default async function jsiiConfig(packageJsonLocation: string) { 6 | const manifest = await readFilePromise(packageJsonLocation); 7 | const packageJson = validatePackageJson(JSON.parse(manifest.toString())); 8 | 9 | const answers = await prompt(packageJson); 10 | return { 11 | ...packageJson, 12 | ...answers, 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /packages/jsii-config/lib/validate.ts: -------------------------------------------------------------------------------- 1 | import { BasePackageJson } from './schema'; 2 | 3 | /* 4 | * Top level keys required for jsii that aren't controlled by jsii-config 5 | */ 6 | const requiredNpmKeys: Array = [ 7 | 'name', 8 | 'version', 9 | 'repository', 10 | 'main', 11 | 'author', 12 | ]; 13 | 14 | export default function validatePackageJson(packageJson: any): BasePackageJson { 15 | const missingKeys = requiredNpmKeys.filter((key) => !packageJson[key]); 16 | 17 | if (missingKeys.length > 0) { 18 | throw new Error( 19 | // Not the prettiest way to control indentation on multiline strings 20 | `package.json is missing required fields:${'\n'}${missingKeys 21 | .map((k) => `- ${k}\n`) 22 | .join( 23 | '', 24 | )}${''}run "npm init" or configure manually and retry jsii-config`, 25 | ); 26 | } 27 | 28 | return packageJson as BasePackageJson; 29 | } 30 | -------------------------------------------------------------------------------- /packages/jsii-config/test/util.ts: -------------------------------------------------------------------------------- 1 | import { BasePackageJson } from '../lib/schema'; 2 | 3 | export const packageJsonObject: BasePackageJson = { 4 | name: 'jsii-config-test', 5 | version: '0.0.1', 6 | repository: { 7 | url: 'https://github.com/aws/jsii', 8 | type: 'git', 9 | directory: '/packages/jsii-config', 10 | }, 11 | main: 'bin/jsii-config', 12 | author: { 13 | name: 'Amazon Web Services', 14 | url: 'https://aws.amazon.com', 15 | organization: true, 16 | }, 17 | }; 18 | 19 | export const findQuestion = (key: string, questions: any[]) => 20 | questions.find((question: any) => question.name === key); 21 | 22 | export const findQuestions = (keys: string[], question: any[]) => 23 | keys.map((key) => findQuestion(key, question)); 24 | -------------------------------------------------------------------------------- /packages/jsii-config/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig-base", 3 | "include": [ 4 | "**/*.ts" 5 | ], 6 | "exclude": ["jest.config.ts"], 7 | "references": [ 8 | { "path": "../@jsii/check-node" }, 9 | { "path": "../@jsii/spec" }, 10 | ], 11 | } 12 | -------------------------------------------------------------------------------- /packages/jsii-diff/.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: ../../eslint-config.yaml 3 | -------------------------------------------------------------------------------- /packages/jsii-diff/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.d.ts 3 | node_modules/ 4 | .nyc_output/ 5 | coverage/ 6 | 7 | lib/version.ts 8 | *.d.ts.map 9 | -------------------------------------------------------------------------------- /packages/jsii-diff/.npmignore: -------------------------------------------------------------------------------- 1 | # Don't include original .ts files when doing `npm pack` 2 | *.ts 3 | !*.d.ts 4 | coverage 5 | .nyc_output 6 | *.tgz 7 | generate.sh 8 | 9 | dist 10 | .LAST_PACKAGE 11 | .LAST_BUILD 12 | !*.js 13 | 14 | # Include .jsii 15 | !.jsii 16 | 17 | *.snk 18 | 19 | # Don't include various configuration & state information 20 | coverage 21 | .eslintrc.* 22 | tsconfig.json 23 | *.tsbuildinfo 24 | -------------------------------------------------------------------------------- /packages/jsii-diff/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/jsii-diff/bin/jsii-diff: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('./jsii-diff.js'); -------------------------------------------------------------------------------- /packages/jsii-diff/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | commit=${CODEBUILD_RESOLVED_SOURCE_VERSION:-} 5 | # CODEBUILD_RESOLVED_SOURCE_VERSION is not defined (i.e. local build or CodePipeline build), 6 | # use the HEAD commit hash 7 | if [ -z "${commit}" ]; then 8 | commit="$(git rev-parse --verify HEAD)" 9 | fi 10 | 11 | VERSION=$(node -p "require('./package.json').version.replace(/\\+[0-9a-f]+\$/, '')") 12 | 13 | cat > lib/version.ts </test'], 5 | watchPathIgnorePatterns: ['.*\\.tsx?$'], 6 | }); 7 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/lib/naming-util.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Converts a jsii method/property names to pascal-case. 3 | * 4 | * This is different from `toPascalCase()` since it only capitalizes the first 5 | * letter. This handles avoids duplicates of things like `toIsoString()` and `toISOString()`. 6 | * The assumption is that the jsii name is camelCased. 7 | * 8 | * @param camelCase The original jsii method name 9 | * @returns A pascal-cased method name. 10 | */ 11 | export function jsiiToPascalCase(camelCase: string) { 12 | return camelCase.charAt(0).toUpperCase() + camelCase.slice(1); 13 | } 14 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/lib/targets/_utils.ts: -------------------------------------------------------------------------------- 1 | import * as spec from '@jsii/spec'; 2 | 3 | export function stabilityPrefixFor(element: spec.Documentable): string { 4 | if (element.docs?.stability === spec.Stability.Experimental) { 5 | return '(experimental) '; 6 | } 7 | if (element.docs?.stability === spec.Stability.Deprecated) { 8 | return '(deprecated) '; 9 | } 10 | return ''; 11 | } 12 | 13 | export function renderSummary(docs?: spec.Docs): string { 14 | return docs?.summary ? stabilityPrefixFor({ docs }) + docs.summary : ''; 15 | } 16 | 17 | export interface PropertyDefinition { 18 | readonly prop: spec.Property; 19 | readonly definingType: spec.Type; 20 | } 21 | 22 | export interface MethodDefinition { 23 | readonly method: spec.Method; 24 | readonly definingType: spec.Type; 25 | } 26 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/lib/targets/go/comparators.ts: -------------------------------------------------------------------------------- 1 | type Named = { readonly name: string }; 2 | export function byName(l: Named, r: Named): number { 3 | return l.name.localeCompare(r.name); 4 | } 5 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/lib/targets/go/emit-context.ts: -------------------------------------------------------------------------------- 1 | import { CodeMaker } from 'codemaker'; 2 | 3 | import { Documentation } from './documentation'; 4 | 5 | /** 6 | * The context in which Golang code is emitted. 7 | */ 8 | export interface EmitContext { 9 | /** A CodeMaker to write out source code. */ 10 | readonly code: CodeMaker; 11 | 12 | /** A Documentation generator. Includes Rosetta stone to translate code examples. */ 13 | readonly documenter: Documentation; 14 | 15 | /** Whether runtime type checking code should be emitted */ 16 | readonly runtimeTypeChecking: boolean; 17 | } 18 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/lib/targets/go/readme-file.ts: -------------------------------------------------------------------------------- 1 | import { EmitContext } from './emit-context'; 2 | 3 | export class ReadmeFile { 4 | public constructor( 5 | private readonly packageName: string, 6 | private readonly document: string, 7 | private readonly directory: string, 8 | ) {} 9 | 10 | public emit({ documenter }: EmitContext) { 11 | if (!this.document) { 12 | return; 13 | } 14 | documenter.emitReadme(this.packageName, this.document, this.directory); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/lib/targets/go/runtime/function-call.ts: -------------------------------------------------------------------------------- 1 | import { GoTypeMember } from '../types'; 2 | 3 | export abstract class FunctionCall { 4 | public constructor(public readonly parent: GoTypeMember) {} 5 | 6 | protected get returnsVal(): boolean { 7 | return !this.parent.reference?.void; 8 | } 9 | 10 | protected get returnType(): string { 11 | return this.parent.returnType || 'interface{}'; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/lib/targets/go/runtime/index.ts: -------------------------------------------------------------------------------- 1 | export * from './constants'; 2 | export * from './class-constructor'; 3 | export * from './method-call'; 4 | export * from './property-access'; 5 | export * from './util'; 6 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/lib/targets/go/runtime/util.ts: -------------------------------------------------------------------------------- 1 | import { CodeMaker } from 'codemaker'; 2 | 3 | import { JSII_INIT_ALIAS, JSII_INIT_FUNC } from './constants'; 4 | 5 | // Emits call to initialize runtime client if not already 6 | export function emitInitialization(code: CodeMaker) { 7 | code.line(`${JSII_INIT_ALIAS}.${JSII_INIT_FUNC}()`); 8 | } 9 | 10 | /** 11 | * Slugify a name by appending '_' at the end until the resulting name is not 12 | * present in the list of reserved names. 13 | * 14 | * @param name the name to be slugified 15 | * @param reserved the list of names that are already sued in-scope 16 | * 17 | * @returns the slugified name 18 | */ 19 | export function slugify(name: string, reserved: Iterable): string { 20 | const used = new Set(reserved); 21 | while (used.has(name)) { 22 | name += '_'; 23 | } 24 | return name; 25 | } 26 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/lib/targets/go/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from './class'; 2 | export * from './enum'; 3 | export * from './go-type'; 4 | export * from './go-type-reference'; 5 | export * from './interface'; 6 | export * from './struct'; 7 | export * from './type-member'; 8 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/lib/targets/go/version-file.ts: -------------------------------------------------------------------------------- 1 | import { CodeMaker } from 'codemaker'; 2 | 3 | /** 4 | * Represents the version of the go module. This is needed because the version is not 5 | * available in standard go module files. 6 | */ 7 | export class VersionFile { 8 | private static readonly NAME = 'version'; 9 | 10 | public constructor(private readonly version: string) {} 11 | 12 | public emit(code: CodeMaker) { 13 | code.openFile(VersionFile.NAME); 14 | code.line(this.version); 15 | code.closeFile(VersionFile.NAME); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/lib/targets/python/requirements-dev.txt: -------------------------------------------------------------------------------- 1 | # All entries with "# build-system" at the end of the line will be hoisted as 2 | # part of the build-system declaration of generated packages. Others will only 3 | # be installed in the virtual environment used for building the distribution 4 | # package (wheel, sdist), but not declared as build-system dependencies. 5 | 6 | setuptools~=75.3.2 # build-system 7 | wheel~=0.42 # build-system 8 | 9 | twine~=6.1.0 10 | 11 | # The dependency on packaging is necessary to work around an incompatibility between 12 | # what setuptools generates and what twine expects. 13 | packaging >= 24.2 -------------------------------------------------------------------------------- /packages/jsii-pacmak/lib/targets/python/util.ts: -------------------------------------------------------------------------------- 1 | const PYTHON_KEYWORDS = new Set([ 2 | 'False', 3 | 'None', 4 | 'True', 5 | 'and', 6 | 'as', 7 | 'assert', 8 | 'async', 9 | 'await', 10 | 'break', 11 | 'class', 12 | 'continue', 13 | 'def', 14 | 'del', 15 | 'elif', 16 | 'else', 17 | 'except', 18 | 'finally', 19 | 'for', 20 | 'from', 21 | 'global', 22 | 'if', 23 | 'import', 24 | 'in', 25 | 'is', 26 | 'lambda', 27 | 'nonlocal', 28 | 'not', 29 | 'or', 30 | 'pass', 31 | 'raise', 32 | 'return', 33 | 'try', 34 | 'while', 35 | 'with', 36 | 'yield', 37 | ]); 38 | 39 | export function die(message: string): never { 40 | throw new Error(message); 41 | } 42 | 43 | export function toPythonIdentifier(name: string): string { 44 | if (PYTHON_KEYWORDS.has(name)) { 45 | return `${name}_`; 46 | } 47 | return name; 48 | } 49 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/test/.gitattributes: -------------------------------------------------------------------------------- 1 | # Generated C# code will have CRLF line endings, making git pretty awkward 2 | .cs eol=crlf 3 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/test/.gitignore: -------------------------------------------------------------------------------- 1 | **/java/bin/ 2 | 3 | !*.tgz 4 | 5 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/test/generated-code/examples/diamond-struct-parameter.ts: -------------------------------------------------------------------------------- 1 | // See: https://github.com/aws/jsii/issues/2653 2 | 3 | export interface Foo { 4 | readonly foo: number; 5 | } 6 | 7 | export interface FooBar { 8 | readonly foo: number; 9 | readonly bar?: string; 10 | } 11 | 12 | export interface Baz extends Foo, FooBar { 13 | readonly baz: boolean; 14 | } 15 | 16 | export class Consumer { 17 | public static consumeBaz(baz: Baz): void { 18 | new Consumer(baz); 19 | } 20 | 21 | private constructor(_: any) {} 22 | } 23 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/test/generated-code/examples/nested-types.ts: -------------------------------------------------------------------------------- 1 | // See: https://github.com/aws/jsii/issues/2649 2 | 3 | export class Namespace1 { 4 | public foo() { 5 | return; 6 | } 7 | } 8 | 9 | export class Namespace2 { 10 | public foo() { 11 | return; 12 | } 13 | } 14 | 15 | export namespace Namespace1 { 16 | // Effectively Namespace1.Foo 17 | export interface Foo { 18 | readonly bar: string; 19 | } 20 | 21 | // Effectively Namespace1.IBar 22 | export interface IBar { 23 | readonly bar: string; 24 | method(): void; 25 | } 26 | } 27 | 28 | export namespace Namespace2 { 29 | // Effectively Namespace2.Foo 30 | export enum Foo { 31 | BAR, 32 | BAZ, 33 | } 34 | 35 | export namespace Foo { 36 | // Effectively Namespace2.Foo.Final 37 | export class Final { 38 | public readonly done = true; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/test/generated-code/requirements-dev.txt: -------------------------------------------------------------------------------- 1 | mypy==1.16.0 2 | pip==25.1.1 # required to use --config-settings 3 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/test/generated-code/target-dotnet.test.ts: -------------------------------------------------------------------------------- 1 | import { verifyGeneratedCodeFor } from './harness'; 2 | import { TargetName } from '../../lib/targets'; 3 | 4 | verifyGeneratedCodeFor(TargetName.DOTNET); 5 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/test/generated-code/target-go.test.ts: -------------------------------------------------------------------------------- 1 | import { verifyGeneratedCodeFor } from './harness'; 2 | import { TargetName } from '../../lib/targets'; 3 | 4 | verifyGeneratedCodeFor(TargetName.GO); 5 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/test/generated-code/target-java.test.ts: -------------------------------------------------------------------------------- 1 | import { verifyGeneratedCodeFor } from './harness'; 2 | import { TargetName } from '../../lib/targets'; 3 | 4 | verifyGeneratedCodeFor(TargetName.JAVA); 5 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/test/generated-code/target-python.test.ts: -------------------------------------------------------------------------------- 1 | import { verifyGeneratedCodeFor } from './harness'; 2 | import { TargetName } from '../../lib/targets'; 3 | 4 | verifyGeneratedCodeFor(TargetName.PYTHON, 300_000); 5 | -------------------------------------------------------------------------------- /packages/jsii-pacmak/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig-base", 3 | "include": ["**/*.ts"], 4 | "exclude": ["jest.config.ts", "test/generated-code/examples/*"], 5 | "references": [ 6 | { "path": "../@jsii/check-node" }, 7 | { "path": "../@jsii/spec" }, 8 | { "path": "../codemaker" }, 9 | { "path": "../jsii-reflect" } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /packages/jsii-reflect/.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: ../../eslint-config.yaml 3 | -------------------------------------------------------------------------------- /packages/jsii-reflect/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | 3 | *.js 4 | *.d.ts 5 | *.js.map 6 | *.tsbuildinfo 7 | dist 8 | coverage 9 | .nyc_output 10 | .jsii 11 | 12 | .LAST_BUILD 13 | .nycrc 14 | .LAST_PACKAGE 15 | *.snk 16 | 17 | node_modules 18 | 19 | !jest.config.js 20 | *.d.ts.map 21 | -------------------------------------------------------------------------------- /packages/jsii-reflect/.npmignore: -------------------------------------------------------------------------------- 1 | # Don't include original .ts files when doing `npm pack` 2 | *.ts 3 | !*.d.ts 4 | .nyc_output 5 | *.tgz 6 | 7 | dist 8 | .LAST_PACKAGE 9 | .LAST_BUILD 10 | !*.js 11 | 12 | # Include .jsii 13 | !.jsii 14 | 15 | *.snk 16 | 17 | # Don't include various configuration & state information 18 | coverage 19 | .eslintrc.* 20 | tsconfig.json 21 | *.tsbuildinfo 22 | -------------------------------------------------------------------------------- /packages/jsii-reflect/bin/jsii-tree: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('./jsii-tree.js'); 3 | -------------------------------------------------------------------------------- /packages/jsii-reflect/jest.config.mjs: -------------------------------------------------------------------------------- 1 | import { overriddenConfig } from '../../jest.config.mjs'; 2 | 3 | export default overriddenConfig({ 4 | coverageThreshold: { 5 | global: { 6 | branches: 39, 7 | statements: 54, 8 | }, 9 | }, 10 | }); 11 | -------------------------------------------------------------------------------- /packages/jsii-reflect/lib/dependency.ts: -------------------------------------------------------------------------------- 1 | import { TypeSystem } from './type-system'; 2 | 3 | export class Dependency { 4 | public constructor( 5 | public readonly system: TypeSystem, 6 | private readonly name: string, 7 | public readonly version: string, 8 | ) {} 9 | 10 | public get assembly() { 11 | return this.system.findAssembly(this.name); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/jsii-reflect/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from './assembly'; 2 | export * from './class'; 3 | export * from './callable'; 4 | export * from './dependency'; 5 | export * from './docs'; 6 | export * from './enum'; 7 | export * from './initializer'; 8 | export * from './interface'; 9 | export * from './method'; 10 | export * from './module-like'; 11 | export * from './optional-value'; 12 | export * from './overridable'; 13 | export * from './parameter'; 14 | export * from './property'; 15 | export * from './submodule'; 16 | export * from './tree'; 17 | export * from './type'; 18 | export * from './type-member'; 19 | export * from './type-ref'; 20 | export * from './type-system'; 21 | export * from './reference-type'; 22 | export * from './source'; 23 | -------------------------------------------------------------------------------- /packages/jsii-reflect/lib/initializer.ts: -------------------------------------------------------------------------------- 1 | import { Callable } from './callable'; 2 | import { Documentable } from './docs'; 3 | import { Overridable } from './overridable'; 4 | import { SourceLocatable } from './source'; 5 | import { MemberKind, TypeMember } from './type-member'; 6 | 7 | export class Initializer 8 | extends Callable 9 | implements Documentable, Overridable, TypeMember, SourceLocatable 10 | { 11 | public static isInitializer(x: Callable): x is Initializer { 12 | return x instanceof Initializer; 13 | } 14 | 15 | public readonly kind = MemberKind.Initializer; 16 | public readonly name = ''; 17 | public readonly abstract = false; 18 | } 19 | -------------------------------------------------------------------------------- /packages/jsii-reflect/lib/overridable.ts: -------------------------------------------------------------------------------- 1 | import { Type } from './type'; 2 | 3 | export interface Overridable { 4 | /** 5 | * The name of the parent type (class or interface) that this entity overrides or implements. If undefined, then 6 | * this entity is the first in it's hierarchy to declare this entity. 7 | * 8 | * @default undefined 9 | */ 10 | overrides?: Type; 11 | } 12 | -------------------------------------------------------------------------------- /packages/jsii-reflect/lib/type-member.ts: -------------------------------------------------------------------------------- 1 | import { Documentable } from './docs'; 2 | import { Initializer } from './initializer'; 3 | import { Method } from './method'; 4 | import { Property } from './property'; 5 | import { SourceLocatable } from './source'; 6 | 7 | export interface TypeMember extends Documentable, SourceLocatable { 8 | name: string; 9 | abstract: boolean; 10 | 11 | kind: MemberKind; 12 | protected?: boolean; 13 | } 14 | 15 | export enum MemberKind { 16 | Initializer = 'initializer', 17 | Method = 'method', 18 | Property = 'property', 19 | } 20 | 21 | export function isInitializer(x: TypeMember): x is Initializer { 22 | return x.kind === MemberKind.Initializer; 23 | } 24 | 25 | export function isMethod(x: TypeMember): x is Method { 26 | return x.kind === MemberKind.Method; 27 | } 28 | 29 | export function isProperty(x: TypeMember): x is Property { 30 | return x.kind === MemberKind.Property; 31 | } 32 | -------------------------------------------------------------------------------- /packages/jsii-reflect/test/util.ts: -------------------------------------------------------------------------------- 1 | import { sourceToAssemblyHelper, MultipleSourceFiles, PackageInfo } from 'jsii'; 2 | 3 | import { Assembly, TypeSystem } from '../lib'; 4 | 5 | export function typeSystemFromSource( 6 | source: string | MultipleSourceFiles, 7 | cb?: (obj: PackageInfo) => void, 8 | ) { 9 | const asm = assemblyFromSource(source, cb); 10 | return asm.system; 11 | } 12 | 13 | export function assemblyFromSource( 14 | source: string | MultipleSourceFiles, 15 | cb?: (obj: PackageInfo) => void, 16 | ): Assembly { 17 | const ass = sourceToAssemblyHelper(source, cb); 18 | const ts = new TypeSystem(); 19 | return ts.addAssembly(new Assembly(ts, ass)); 20 | } 21 | -------------------------------------------------------------------------------- /packages/jsii-reflect/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig-base", 3 | "compilerOptions": { 4 | "experimentalDecorators": true 5 | }, 6 | "include": ["**/*.ts"], 7 | "exclude": ["jest.config.ts"], 8 | "references": [ 9 | { "path": "../@jsii/check-node" }, 10 | { "path": "../@jsii/spec" }, 11 | { "path": "../oo-ascii-tree" } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /packages/oo-ascii-tree/.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: ../../eslint-config.yaml 3 | -------------------------------------------------------------------------------- /packages/oo-ascii-tree/.gitignore: -------------------------------------------------------------------------------- 1 | /coverage/ 2 | /lib/ 3 | /node_modules/ 4 | -------------------------------------------------------------------------------- /packages/oo-ascii-tree/.npmignore: -------------------------------------------------------------------------------- 1 | # Don't include the original source files 2 | /src/ 3 | 4 | # Don't include test files 5 | /coverage/ 6 | /lib/**/*.test.* 7 | /test-data/ 8 | 9 | # No build tools & configuration 10 | /build-tools/ 11 | /.eslintrc.yaml 12 | /jest.config.ts 13 | tsconfig.json 14 | *.map 15 | *.tsbuildinfo 16 | -------------------------------------------------------------------------------- /packages/oo-ascii-tree/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /packages/oo-ascii-tree/jest.config.mjs: -------------------------------------------------------------------------------- 1 | import config from '../../jest.config.mjs'; 2 | 3 | export default config; 4 | -------------------------------------------------------------------------------- /packages/oo-ascii-tree/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ascii-tree'; 2 | -------------------------------------------------------------------------------- /packages/oo-ascii-tree/test-data/basic.expected.txt: -------------------------------------------------------------------------------- 1 | root 2 | ├── child1 3 | ├─┬ child2 4 | │ ├── grandchild1 5 | │ └── grandchild2 6 | └── child3 7 | -------------------------------------------------------------------------------- /packages/oo-ascii-tree/test-data/big.expected.txt: -------------------------------------------------------------------------------- 1 | root 2 | ├─┬ child1 3 | │ ├── child1.1 4 | │ ├── child1.2 5 | │ ├── child1.3 6 | │ ├─┬ child1.4 7 | │ │ ├── child1.4.1 8 | │ │ ├── child1.4.2 9 | │ │ └── child1.4.3 10 | │ ├── child1.6 11 | │ ├── child1.7 12 | │ └── child1.8 13 | ├─┬ child2 14 | │ └─┬ child2.1 15 | │ ├─┬ child2.1.1 16 | │ │ ├── child.2.1.1.1 17 | │ │ ├── child.2.1.1.2 18 | │ │ ├─┬ child.2.1.1.3 19 | │ │ │ ├── child.2.1.1.3.1 20 | │ │ │ └── child.2.1.1.3.2 21 | │ │ ├── child.2.1.1.4 22 | │ │ ├── child.2.1.1.5 23 | │ │ └── child.2.1.1.5 24 | │ └── child2.1.2 25 | └── child3 26 | -------------------------------------------------------------------------------- /packages/oo-ascii-tree/test-data/extend.expected.txt: -------------------------------------------------------------------------------- 1 | PROPS 2 | ===== 3 | ├── shape: circle 4 | ├── color: red 5 | └── background: blue 6 | DIMENSIONS 7 | ========== 8 | ├── width: 30px 9 | └── height: 40px 10 | -------------------------------------------------------------------------------- /packages/oo-ascii-tree/test-data/multiline.expected.txt: -------------------------------------------------------------------------------- 1 | root 2 | ├─┬ hello 3 | │ ├─┬ hello-child-A [#0] 4 | │ │ │ hello-child-A [#1] 5 | │ │ │ hello-child-A [#2] 6 | │ │ ├─┬ child of multi 7 | │ │ │ └── boom [#0] 8 | │ │ │ boom [#1] 9 | │ │ │ boom [#2] 10 | │ │ └── multi 11 | │ │ line 12 | │ │ child-of-multi 13 | │ ├── hello-child-B [#0] 14 | │ │ hello-child-B [#1] 15 | │ │ hello-child-B [#2] 16 | │ │ hello-child-B [#3] 17 | │ │ hello-child-B [#4] 18 | │ │ hello-child-B [#5] 19 | │ │ hello-child-B [#6] 20 | │ │ hello-child-B [#7] 21 | │ │ hello-child-B [#8] 22 | │ │ hello-child-B [#9] 23 | │ └── just-a-node 24 | ├── world 25 | └─┬ boom 26 | └─┬ trach 27 | └── multi [#0] 28 | multi [#1] 29 | multi [#2] 30 | multi [#3] 31 | -------------------------------------------------------------------------------- /packages/oo-ascii-tree/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig-base", 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib", 6 | }, 7 | "include": [ 8 | "src/**/*.ts" 9 | ], 10 | } 11 | -------------------------------------------------------------------------------- /scripts/align-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #------------------------------------------------------------------------ 3 | # updates all package.json files to the version defined in lerna.json 4 | # this is called when building inside our ci/cd system 5 | #------------------------------------------------------------------------ 6 | set -euo pipefail 7 | scriptdir=$(cd $(dirname $0) && pwd) 8 | 9 | # go to repo root 10 | cd ${scriptdir}/.. 11 | 12 | files="$(find . -name package.json | grep -v node_modules | xargs)" 13 | ${scriptdir}/align-version.js ${files} 14 | 15 | # validation 16 | marker=$(node -p "require('./scripts/get-version-marker')") 17 | if find . -name package.json | grep -v node_modules | xargs grep "[^0-9]${marker}"; then 18 | echo "ERROR: unexpected version marker ${marker} in a package.json file" 19 | exit 1 20 | fi 21 | -------------------------------------------------------------------------------- /scripts/build-js.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Build only the JavaScript packages 3 | set -euo pipefail 4 | scope="" 5 | for package in $(node_modules/.bin/lerna ls); do 6 | scope="$scope --scope $package" 7 | done 8 | node_modules/.bin/lerna $scope run build 9 | node_modules/.bin/lerna $scope run test 10 | -------------------------------------------------------------------------------- /scripts/get-version-marker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the version marker used to indicate this is a local dependency. 3 | * 4 | * Usage: 5 | * 6 | * const version = require('./get-version-marker'); 7 | * 8 | * Or from the command line: 9 | * 10 | * node -p require('./get-version-marker') 11 | * 12 | */ 13 | module.exports = '0.0.0'; 14 | -------------------------------------------------------------------------------- /scripts/get-version.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the current repo version. 3 | * 4 | * Usage: 5 | * 6 | * const version = require('./get-version'); 7 | * 8 | * Or from the command line: 9 | * 10 | * node -p require('./get-version') 11 | * 12 | */ 13 | const versionFile = require('../.versionrc.json').packageFiles[0].filename; 14 | if (!versionFile) { 15 | throw new Error(`unable to determine version filename from .versionrc.json at the root of the repo`); 16 | } 17 | 18 | module.exports = require(`../${versionFile}`).version; 19 | -------------------------------------------------------------------------------- /scripts/sync-peer-deps.js: -------------------------------------------------------------------------------- 1 | // 2 | // align versions of "peerDependencies" and "dependencies" for a given set of package.json files 3 | // usage: node sync-peer-deps.js package.json pacakge.json ... 4 | // 5 | const fs = require('fs'); 6 | 7 | for (const file of process.argv.splice(2)) { 8 | const pkg = JSON.parse(fs.readFileSync(file).toString()); 9 | const deps = pkg.dependencies || { }; 10 | let updated = false; 11 | if (pkg.peerDependencies) { 12 | for (const dep of Object.keys(pkg.peerDependencies)) { 13 | const version = deps[dep]; 14 | const peerVersion = pkg.peerDependencies[dep]; 15 | if (version && version !== peerVersion) { 16 | pkg.peerDependencies[dep] = version; 17 | updated = true; 18 | } 19 | } 20 | } 21 | if (updated) { 22 | console.log('updated:', file); 23 | fs.writeFileSync(file, JSON.stringify(pkg, undefined, 2)); 24 | } 25 | } -------------------------------------------------------------------------------- /tools/jsii-build-tools/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.d.ts 3 | node_modules/ 4 | .nyc_output/ 5 | coverage/ 6 | *.d.ts.map 7 | -------------------------------------------------------------------------------- /tools/jsii-build-tools/NOTICE: -------------------------------------------------------------------------------- 1 | jsii 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /tools/jsii-build-tools/bin/package-dotnet: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | mkdir -p dist/dotnet 5 | 6 | dotnet build --force -c Release $1 7 | dotnet pack --include-symbols --include-source --property:PackageOutputPath=${PWD}/dist/dotnet -c Release $1 8 | -------------------------------------------------------------------------------- /tools/jsii-build-tools/bin/package-java: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | mkdir -p dist/java 5 | 6 | rsync -av maven-repo/ dist/java/ 7 | 8 | -------------------------------------------------------------------------------- /tools/jsii-build-tools/bin/package-js: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | rm -fr dist/js 5 | 6 | package_name=$(node -p "require('./package.json').name") 7 | target_file="dist/js/${package_name/\//-}.tgz" 8 | 9 | mkdir -p $(dirname ${target_file}) 10 | 11 | mv $(npm pack) ${target_file} 12 | -------------------------------------------------------------------------------- /tools/jsii-build-tools/bin/package-private: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | rm -fr dist/private 5 | 6 | package_name=$(node -p "require('./package.json').name") 7 | target_file="dist/private/${package_name/\//-}.tgz" 8 | 9 | mkdir -p $(dirname ${target_file}) 10 | 11 | mv $(npm pack) ${target_file} 12 | -------------------------------------------------------------------------------- /tools/jsii-build-tools/bin/package-python: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | mkdir -p dist/python 5 | 6 | .env/bin/python setup.py sdist -d dist/python bdist_wheel -d dist/python 7 | -------------------------------------------------------------------------------- /tools/jsii-build-tools/bin/package-ruby: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | mkdir -p dist/ruby 5 | 6 | gem build project/*.gemspec 7 | mv *.gem dist/ruby 8 | -------------------------------------------------------------------------------- /tools/jsii-compliance/.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: ../../eslint-config.yaml 3 | -------------------------------------------------------------------------------- /tools/jsii-compliance/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsii-compliance", 3 | "version": "0.0.0", 4 | "private": true, 5 | "description": "", 6 | "scripts": { 7 | "build": "echo 'build not needed for the jsii-compliance package'", 8 | "report": "ts-node report.ts", 9 | "lint": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .js,.ts", 10 | "lint:fix": "yarn lint --fix" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "Apache-2.0", 15 | "dependencies": { 16 | "tablemark": "^2.0.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tools/jsii-compliance/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig-base.json", 3 | "include": ["**/*.ts"] 4 | } 5 | --------------------------------------------------------------------------------