From 9b23dcd60f13da33672eec2f57875afb94f23a26 Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Tue, 20 Jul 2021 10:35:00 +0300 Subject: [PATCH 01/17] chore(merge-back): 1.31.0 (#2904) * chore(release): 1.31.0 * chore: mixup in CHANGELOG Co-authored-by: AWS CDK Team Co-authored-by: Romain Marcadier --- CHANGELOG.md | 15 +++++++++++++++ lerna.json | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41bb6d91eb..c3aa8a3138 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,21 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.31.0](https://github.com/aws/jsii/compare/v1.30.0...v1.31.0) (2021-07-09) + + +### Features + +* **jsii-rosetta transliterate:** transliterate a jsii assembly ([#2869](https://github.com/aws/jsii/issues/2869)) ([d9028c8](https://github.com/aws/jsii/commit/d9028c8cf91297a44cd4b1f128f769716bf0e74e)) +* **rosetta:** transliterate loose mode ([#2892](https://github.com/aws/jsii/issues/2892)) ([43e6dfd](https://github.com/aws/jsii/commit/43e6dfd0591b0f38a8c636edd3896400c96676e3)) + + +### Bug Fixes + +* **pacmak/go:** missing go.sum entry ([#2893](https://github.com/aws/jsii/issues/2893)) ([6e6ad69](https://github.com/aws/jsii/commit/6e6ad693230e18f36990e8feaf3734da7c01dbd5)) +* **rosetta:** extract does not respect strict metadata entry ([#2863](https://github.com/aws/jsii/issues/2863)) ([5d2392b](https://github.com/aws/jsii/commit/5d2392b7713cb6dfea6092c4ac3ee45360a5d28a)), closes [#2861](https://github.com/aws/jsii/issues/2861) +* **rosetta:** hangs on 'markdown' command when a file is provided ([#2871](https://github.com/aws/jsii/issues/2871)) ([e538b36](https://github.com/aws/jsii/commit/e538b36c6ccf53ace908ff4c342dc9a4435ce353)) + ## [1.30.0](https://github.com/aws/jsii/compare/v1.29.0...v1.30.0) (2021-05-27) diff --git a/lerna.json b/lerna.json index 36021b8eac..3fbac4bcab 100644 --- a/lerna.json +++ b/lerna.json @@ -10,5 +10,5 @@ "rejectCycles": true } }, - "version": "1.30.0" + "version": "1.31.0" } From 9d554edc2542577ba1c1109f07b0e074306cfb93 Mon Sep 17 00:00:00 2001 From: Romain Marcadier Date: Tue, 20 Jul 2021 17:52:53 +0200 Subject: [PATCH 02/17] chore: test against .NET 6 (prerelease) (#2914) --- .github/workflows/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 16992c0f94..554cc7cd75 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -239,6 +239,13 @@ jobs: node: '10' os: ubuntu-latest python: '3.6' + - java: '8' + dotnet: '6.0.x' + dotnet-prerelease: true + go: '1.16' + node: '10' + os: ubuntu-latest + python: '3.6' # Test alternate Javas - java: '11' dotnet: '3.1.x' @@ -274,6 +281,7 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: ${{ matrix.dotnet }} + include-prerelease: ${{ matrix.dotnet-prerelease }} - name: Set up Go ${{ matrix.go }} uses: actions/setup-go@v2 with: From f6078ef08a144ea86623f331c60ac15ca5f91219 Mon Sep 17 00:00:00 2001 From: Romain Marcadier Date: Wed, 21 Jul 2021 17:26:36 +0200 Subject: [PATCH 03/17] fix(rosetta): fails on "Debug Failure" (#2917) In cases where a literate source file was missing, the substitution value was not valid TypeScript, which could cause the comipler to fail on an opaque error (`Debug Failure`). This falls back to the visible code for the snippet instead of inserting a placeholder, and also makes sure to rescue the `Debug Failure` where it is emitted from, that is in the call to `program.getDeclarationDiagnostics`. Both of this changes result in greater chances of transliteration success. Related to cdklabs/jsii-docgen#369 --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0 --- .../lib/commands/transliterate.ts | 15 +- packages/jsii-rosetta/lib/fixtures.ts | 23 +-- packages/jsii-rosetta/lib/translate.ts | 33 +++- .../test/commands/transliterate.test.ts | 186 ++++++++++++++---- packages/jsii-rosetta/test/translate.test.ts | 40 ++++ 5 files changed, 239 insertions(+), 58 deletions(-) create mode 100644 packages/jsii-rosetta/test/translate.test.ts diff --git a/packages/jsii-rosetta/lib/commands/transliterate.ts b/packages/jsii-rosetta/lib/commands/transliterate.ts index 2a50f1007f..d53c69eb93 100644 --- a/packages/jsii-rosetta/lib/commands/transliterate.ts +++ b/packages/jsii-rosetta/lib/commands/transliterate.ts @@ -137,10 +137,17 @@ type Mutable = { -readonly [K in keyof T]: Mutable }; type AssemblyLoader = () => Promise>; function prefixDisclaimer(translation: Translation): string { - const message = translation.didCompile - ? 'Example automatically generated. See https://github.com/aws/jsii/issues/826' - : 'Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826'; - return `${commentToken()} ${message}\n${translation.source}`; + const comment = commentToken(); + const disclaimer = translation.didCompile + ? 'This example was automatically transliterated.' + : 'This example was automatically transliterated with incomplete type information. It may not work as-is.'; + + return [ + `${comment} ${disclaimer}`, + `${comment} See https://github.com/aws/jsii/issues/826 for more information.`, + '', + translation.source, + ].join('\n'); function commentToken() { // This is future-proofed a bit, but don't read too much in this... diff --git a/packages/jsii-rosetta/lib/fixtures.ts b/packages/jsii-rosetta/lib/fixtures.ts index 09fc28ad07..91276ca1ed 100644 --- a/packages/jsii-rosetta/lib/fixtures.ts +++ b/packages/jsii-rosetta/lib/fixtures.ts @@ -28,7 +28,14 @@ export function fixturize( if (literateSource) { // Compatibility with the "old school" example inclusion mechanism. // Completely load this file and attach a parameter with its directory. - source = loadLiterateSource(directory, literateSource, loose); + try { + source = loadLiterateSource(directory, literateSource); + } catch (ex) { + // In loose mode, we ignore this failure and stick to the visible source. + if (!loose) { + throw ex; + } + } parameters[SnippetParameters.$COMPILATION_DIRECTORY] = path.join( directory, path.dirname(literateSource), @@ -48,22 +55,10 @@ export function fixturize( }; } -function loadLiterateSource( - directory: string, - literateFileName: string, - loose = false, -) { +function loadLiterateSource(directory: string, literateFileName: string) { const fullPath = path.join(directory, literateFileName); const exists = fs.existsSync(fullPath); if (!exists) { - if (loose) { - // In loose mode, we'll fall back to the `.js` file if it exists... - const jsFile = fullPath.replace(/\.ts(x?)$/, '.js$1'); - if (fs.existsSync(jsFile)) { - return fs.readFileSync(jsFile, { encoding: 'utf-8' }); - } - return `Missing literate source file ${literateFileName}`; - } // This couldn't really happen in practice, but do the check anyway throw new Error( `Sample uses literate source ${literateFileName}, but not found: ${fullPath}`, diff --git a/packages/jsii-rosetta/lib/translate.ts b/packages/jsii-rosetta/lib/translate.ts index 9d917f6823..65d5cc643c 100644 --- a/packages/jsii-rosetta/lib/translate.ts +++ b/packages/jsii-rosetta/lib/translate.ts @@ -149,10 +149,16 @@ export class SnippetTranslator { if (options.includeCompilerDiagnostics || snippet.strict) { const program = this.compilation.program; const diagnostics = [ - ...program.getGlobalDiagnostics(), - ...program.getSyntacticDiagnostics(this.compilation.rootFile), - ...program.getDeclarationDiagnostics(this.compilation.rootFile), - ...program.getSemanticDiagnostics(this.compilation.rootFile), + ...neverThrowing(program.getGlobalDiagnostics)(), + ...neverThrowing(program.getSyntacticDiagnostics)( + this.compilation.rootFile, + ), + ...neverThrowing(program.getDeclarationDiagnostics)( + this.compilation.rootFile, + ), + ...neverThrowing(program.getSemanticDiagnostics)( + this.compilation.rootFile, + ), ]; if (snippet.strict) { // In a strict assembly, so we'll need to brand all diagnostics here... @@ -160,6 +166,25 @@ export class SnippetTranslator { } this.compileDiagnostics.push(...diagnostics); } + + /** + * Intercepts all exceptions thrown by the wrapped call, and logs them to + * console.error instead of re-throwing, then returns an empty array. This + * is here to avoid compiler crashes due to broken code examples that cause + * the TypeScript compiler to hit a "Debug Failure". + */ + function neverThrowing( + call: (...args: A) => readonly R[], + ): (...args: A) => readonly R[] { + return (...args: A) => { + try { + return call(...args); + } catch (err) { + console.error(`Failed to execute ${call.name}: ${err}`); + return []; + } + }; + } } public renderUsing(visitor: AstHandler) { diff --git a/packages/jsii-rosetta/test/commands/transliterate.test.ts b/packages/jsii-rosetta/test/commands/transliterate.test.ts index 6f11824fbb..c436098e06 100644 --- a/packages/jsii-rosetta/test/commands/transliterate.test.ts +++ b/packages/jsii-rosetta/test/commands/transliterate.test.ts @@ -145,7 +145,9 @@ export class ClassName implements IInterface { "markdown": "# README \`\`\`csharp - // Example automatically generated. See https://github.com/aws/jsii/issues/826 + // This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + IInterface object = new ClassName(\\"this\\", 1337, new ClassNameProps { Foo = \\"bar\\" }); object.Property = EnumType.OPTION_A; object.MethodCall(); @@ -169,7 +171,9 @@ export class ClassName implements IInterface { "fqn": "testpkg.ClassName", "initializer": Object { "docs": Object { - "example": "// Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + new ClassName(\\"this\\", 1337, new ClassNameProps { Property = EnumType.OPTION_B });", "summary": "Create a new instance of ClassName.", }, @@ -209,7 +213,9 @@ export class ClassName implements IInterface { "methods": Array [ Object { "docs": Object { - "example": "// Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + ClassName.StaticMethod();", "remarks": "It can be invoked easily.", "summary": "A static method.", @@ -302,7 +308,9 @@ export class ClassName implements IInterface { "testpkg.EnumType": Object { "assembly": "testpkg", "docs": Object { - "example": "// Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + new ClassName(\\"this\\", 1337, new ClassNameProps { Property = EnumType.OPTION_B });", }, "fqn": "testpkg.EnumType", @@ -314,14 +322,18 @@ export class ClassName implements IInterface { "members": Array [ Object { "docs": Object { - "example": "// Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + new ClassName(\\"this\\", 1337, new ClassNameProps { Property = EnumType.OPTION_A });", }, "name": "OPTION_A", }, Object { "docs": Object { - "example": "// Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + new ClassName(\\"this\\", 1337, new ClassNameProps { Property = EnumType.OPTION_B });", }, "name": "OPTION_B", @@ -341,7 +353,9 @@ export class ClassName implements IInterface { Object { "abstract": true, "docs": Object { - "example": "// Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + iface.MethodCall();", "summary": "An instance method call.", }, @@ -357,7 +371,9 @@ export class ClassName implements IInterface { Object { "abstract": true, "docs": Object { - "example": "// Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + iface.Property = EnumType.OPTION_B;", "summary": "A property value.", }, @@ -409,7 +425,9 @@ export class ClassName implements IInterface { "markdown": "# README \`\`\`java - // Example automatically generated. See https://github.com/aws/jsii/issues/826 + // This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + IInterface object = new ClassName(\\"this\\", 1337, new ClassNameProps().foo(\\"bar\\")); object.getProperty() = EnumType.getOPTION_A(); object.methodCall(); @@ -433,7 +451,9 @@ export class ClassName implements IInterface { "fqn": "testpkg.ClassName", "initializer": Object { "docs": Object { - "example": "// Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + new ClassName(\\"this\\", 1337, new ClassNameProps().property(EnumType.getOPTION_B()));", "summary": "Create a new instance of ClassName.", }, @@ -473,7 +493,9 @@ export class ClassName implements IInterface { "methods": Array [ Object { "docs": Object { - "example": "// Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + ClassName.staticMethod();", "remarks": "It can be invoked easily.", "summary": "A static method.", @@ -566,7 +588,9 @@ export class ClassName implements IInterface { "testpkg.EnumType": Object { "assembly": "testpkg", "docs": Object { - "example": "// Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + new ClassName(\\"this\\", 1337, new ClassNameProps().property(EnumType.getOPTION_B()));", }, "fqn": "testpkg.EnumType", @@ -578,14 +602,18 @@ export class ClassName implements IInterface { "members": Array [ Object { "docs": Object { - "example": "// Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + new ClassName(\\"this\\", 1337, new ClassNameProps().property(EnumType.getOPTION_A()));", }, "name": "OPTION_A", }, Object { "docs": Object { - "example": "// Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + new ClassName(\\"this\\", 1337, new ClassNameProps().property(EnumType.getOPTION_B()));", }, "name": "OPTION_B", @@ -605,7 +633,9 @@ export class ClassName implements IInterface { Object { "abstract": true, "docs": Object { - "example": "// Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + iface.methodCall();", "summary": "An instance method call.", }, @@ -621,7 +651,9 @@ export class ClassName implements IInterface { Object { "abstract": true, "docs": Object { - "example": "// Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated. + // See https://github.com/aws/jsii/issues/826 for more information. + iface.getProperty() = EnumType.getOPTION_B();", "summary": "A property value.", }, @@ -673,7 +705,9 @@ export class ClassName implements IInterface { "markdown": "# README \`\`\`python - # Example automatically generated. See https://github.com/aws/jsii/issues/826 + # This example was automatically transliterated. + # See https://github.com/aws/jsii/issues/826 for more information. + object = ClassName(\\"this\\", 1337, foo=\\"bar\\") object.property = EnumType.OPTION_A object.method_call() @@ -697,7 +731,9 @@ export class ClassName implements IInterface { "fqn": "testpkg.ClassName", "initializer": Object { "docs": Object { - "example": "# Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "# This example was automatically transliterated. + # See https://github.com/aws/jsii/issues/826 for more information. + ClassName(\\"this\\", 1337, property=EnumType.OPTION_B)", "summary": "Create a new instance of ClassName.", }, @@ -737,7 +773,9 @@ export class ClassName implements IInterface { "methods": Array [ Object { "docs": Object { - "example": "# Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "# This example was automatically transliterated. + # See https://github.com/aws/jsii/issues/826 for more information. + ClassName.static_method()", "remarks": "It can be invoked easily.", "summary": "A static method.", @@ -830,7 +868,9 @@ export class ClassName implements IInterface { "testpkg.EnumType": Object { "assembly": "testpkg", "docs": Object { - "example": "# Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "# This example was automatically transliterated. + # See https://github.com/aws/jsii/issues/826 for more information. + ClassName(\\"this\\", 1337, property=EnumType.OPTION_B)", }, "fqn": "testpkg.EnumType", @@ -842,14 +882,18 @@ export class ClassName implements IInterface { "members": Array [ Object { "docs": Object { - "example": "# Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "# This example was automatically transliterated. + # See https://github.com/aws/jsii/issues/826 for more information. + ClassName(\\"this\\", 1337, property=EnumType.OPTION_A)", }, "name": "OPTION_A", }, Object { "docs": Object { - "example": "# Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "# This example was automatically transliterated. + # See https://github.com/aws/jsii/issues/826 for more information. + ClassName(\\"this\\", 1337, property=EnumType.OPTION_B)", }, "name": "OPTION_B", @@ -869,7 +913,9 @@ export class ClassName implements IInterface { Object { "abstract": true, "docs": Object { - "example": "# Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "# This example was automatically transliterated. + # See https://github.com/aws/jsii/issues/826 for more information. + iface.method_call()", "summary": "An instance method call.", }, @@ -885,7 +931,9 @@ export class ClassName implements IInterface { Object { "abstract": true, "docs": Object { - "example": "# Example automatically generated. See https://github.com/aws/jsii/issues/826 + "example": "# This example was automatically transliterated. + # See https://github.com/aws/jsii/issues/826 for more information. + iface.property = EnumType.OPTION_B", "summary": "A property value.", }, @@ -914,7 +962,11 @@ test('single assembly, loose mode', () => 'README.md': ` # Missing literate source -[example is not found](missing-example.lit.ts) +[ts source is not found](missing-example.lit.ts) + +# Missing literate source and fallback + +[example is not found](omit-example.lit.ts) # Missing fixture @@ -940,6 +992,14 @@ import { SampleClass } from './index'; /// ## This is a heading within the literate file! new SampleClass('literate'); `, + // The `lit.ts` source file and `lit.js` output will not be there in packaged form... + 'omit-example.lit.ts': ` +import { SampleClass } from './index'; + +/// !show +/// ## This is a heading within the omitted literate file! +new SampleClass('omitted-literate'); + `, }); fs.writeJsonSync( path.join(tmpDir, SPEC_FILE_NAME), @@ -949,6 +1009,9 @@ new SampleClass('literate'); }, ); for (const [file, content] of Object.entries(compilationResult.files)) { + if (file.startsWith('omit-')) { + continue; + } fs.writeFileSync(path.resolve(tmpDir, file), content, 'utf-8'); } @@ -994,14 +1057,29 @@ new SampleClass('literate'); ## This is a heading within the literate file! \`\`\`csharp - // Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 - new index_1.SampleClass(\\"literate\\"); + // This example was automatically transliterated with incomplete type information. It may not work as-is. + // See https://github.com/aws/jsii/issues/826 for more information. + + new SampleClass(\\"literate\\"); + \`\`\` + + # Missing literate source and fallback + + ## This is a heading within the omitted literate file! + + \`\`\`csharp + // This example was automatically transliterated with incomplete type information. It may not work as-is. + // See https://github.com/aws/jsii/issues/826 for more information. + + new SampleClass(\\"omitted-literate\\"); \`\`\` # Missing fixture \`\`\`csharp - // Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 + // This example was automatically transliterated with incomplete type information. It may not work as-is. + // See https://github.com/aws/jsii/issues/826 for more information. + new SampleClass(\\"README.md\\"); \`\`\`", }, @@ -1019,7 +1097,9 @@ new SampleClass('literate'); "testpkg.SampleClass": Object { "assembly": "testpkg", "docs": Object { - "example": "// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated with incomplete type information. It may not work as-is. + // See https://github.com/aws/jsii/issues/826 for more information. + new DoesNotCompile(this, \\"That\\", new Struct { Foo = 1337 });", }, "fqn": "testpkg.SampleClass", @@ -1084,14 +1164,29 @@ new SampleClass('literate'); ## This is a heading within the literate file! \`\`\`java - // Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 + // This example was automatically transliterated with incomplete type information. It may not work as-is. + // See https://github.com/aws/jsii/issues/826 for more information. + new SampleClass(\\"literate\\"); \`\`\` + # Missing literate source and fallback + + ## This is a heading within the omitted literate file! + + \`\`\`java + // This example was automatically transliterated with incomplete type information. It may not work as-is. + // See https://github.com/aws/jsii/issues/826 for more information. + + new SampleClass(\\"omitted-literate\\"); + \`\`\` + # Missing fixture \`\`\`java - // Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 + // This example was automatically transliterated with incomplete type information. It may not work as-is. + // See https://github.com/aws/jsii/issues/826 for more information. + new SampleClass(\\"README.md\\"); \`\`\`", }, @@ -1109,7 +1204,9 @@ new SampleClass('literate'); "testpkg.SampleClass": Object { "assembly": "testpkg", "docs": Object { - "example": "// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 + "example": "// This example was automatically transliterated with incomplete type information. It may not work as-is. + // See https://github.com/aws/jsii/issues/826 for more information. + DoesNotCompile.Builder.create(this, \\"That\\").foo(1337).build();", }, "fqn": "testpkg.SampleClass", @@ -1174,14 +1271,29 @@ new SampleClass('literate'); ## This is a heading within the literate file! \`\`\`python - # Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 - index_1.SampleClass(\\"literate\\") + # This example was automatically transliterated with incomplete type information. It may not work as-is. + # See https://github.com/aws/jsii/issues/826 for more information. + + SampleClass(\\"literate\\") + \`\`\` + + # Missing literate source and fallback + + ## This is a heading within the omitted literate file! + + \`\`\`python + # This example was automatically transliterated with incomplete type information. It may not work as-is. + # See https://github.com/aws/jsii/issues/826 for more information. + + SampleClass(\\"omitted-literate\\") \`\`\` # Missing fixture \`\`\`python - # Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 + # This example was automatically transliterated with incomplete type information. It may not work as-is. + # See https://github.com/aws/jsii/issues/826 for more information. + SampleClass(\\"README.md\\") \`\`\`", }, @@ -1199,7 +1311,9 @@ new SampleClass('literate'); "testpkg.SampleClass": Object { "assembly": "testpkg", "docs": Object { - "example": "# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 + "example": "# This example was automatically transliterated with incomplete type information. It may not work as-is. + # See https://github.com/aws/jsii/issues/826 for more information. + DoesNotCompile(self, \\"That\\", foo=1337)", }, "fqn": "testpkg.SampleClass", diff --git a/packages/jsii-rosetta/test/translate.test.ts b/packages/jsii-rosetta/test/translate.test.ts new file mode 100644 index 0000000000..3ddbe50456 --- /dev/null +++ b/packages/jsii-rosetta/test/translate.test.ts @@ -0,0 +1,40 @@ +import { SnippetTranslator, TypeScriptSnippet } from '../lib'; +import { VisualizeAstVisitor } from '../lib/languages/visualize'; + +test('does not fail on "Debug Failure"', () => { + // GIVEN + const snippet: TypeScriptSnippet = { + completeSource: + 'Missing literate source file test/integ.restapi-import.lit.ts', + where: '@aws-cdk.aws-apigateway-README-snippet4', + visibleSource: + "import { App, CfnOutput, NestedStack, NestedStackProps, Stack } from '@aws-cdk/core';\nimport { Construct } from 'constructs';\nimport { Deployment, Method, MockIntegration, PassthroughBehavior, RestApi, Stage } from '../lib';\n\n/**\n * This file showcases how to split up a RestApi's Resources and Methods across nested stacks.\n *\n * The root stack 'RootStack' first defines a RestApi.\n * Two nested stacks BooksStack and PetsStack, create corresponding Resources '/books' and '/pets'.\n * They are then…;\n\n readonly methods?: Method[];\n}\n\nclass DeployStack extends NestedStack {\n constructor(scope: Construct, props: DeployStackProps) {\n super(scope, 'integ-restapi-import-DeployStack', props);\n\n const deployment = new Deployment(this, 'Deployment', {\n api: RestApi.fromRestApiId(this, 'RestApi', props.restApiId),\n });\n (props.methods ?? []).forEach((method) => deployment.node.addDependency(method));\n new Stage(this, 'Stage', { deployment });\n }\n}\n\nnew RootStack(new App());", + parameters: { lit: 'test/integ.restapi-import.lit.ts' }, + strict: false, + }; + + // WHEN + const subject = new SnippetTranslator(snippet, { + includeCompilerDiagnostics: true, + }); + + // THEN + expect(subject.renderUsing(new VisualizeAstVisitor())).toMatchInlineSnapshot(` + "(ExpressionStatement Missing + (Identifier Missing))(ExpressionStatement literate + (Identifier literate))(ExpressionStatement source + (Identifier source))(ExpressionStatement file + (Identifier file))(ExpressionStatement test/integ.restapi-import.lit.ts + (BinaryExpression test/integ.restapi-import.lit.ts + (BinaryExpression test/integ.restapi + (Identifier test) + (SlashToken /) + (PropertyAccessExpression integ.restapi + (Identifier integ) + (Identifier restapi))) + (MinusToken -) + (PropertyAccessExpression import.lit.ts + import.lit + (Identifier ts))))" + `); +}); From 7b2ec05b2ec247de83901e8504f7ba711d6027bb Mon Sep 17 00:00:00 2001 From: Ben Chaimberg Date: Wed, 21 Jul 2021 09:01:26 -0700 Subject: [PATCH 04/17] feat(rosetta): hoist declare statements to top-level of document (#2897) `declare` statements allow snippet writers to create a mock variable of a certain type that can be used within a snippet without having to provide a concrete value of that type. This is useful when referencing a type from another module without needing to create an instance of that type, which may be complex. Example: ``` declare const lambdaFunction: lambda.Function; const myResource = ... myResource.grantRead(lambdaFunction); ``` `declare` statements can only exist at the top level of a document, meaning snippets with fixtures may not be able to define a `declare` statement, since the snippet may be embedded into the fixture within a class, function, etc. This feature "hoists" `declare` statements to the top level of the document, similarly to how `import` statements are hoisted currently. --- packages/jsii-rosetta/lib/fixtures.ts | 17 +++++----- packages/jsii-rosetta/test/fixtures.test.ts | 31 +++++++++++++++++++ .../test/rosetta/default.ts-fixture | 1 + 3 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 packages/jsii-rosetta/test/rosetta/default.ts-fixture diff --git a/packages/jsii-rosetta/lib/fixtures.ts b/packages/jsii-rosetta/lib/fixtures.ts index 91276ca1ed..e87272c2ad 100644 --- a/packages/jsii-rosetta/lib/fixtures.ts +++ b/packages/jsii-rosetta/lib/fixtures.ts @@ -147,13 +147,16 @@ function sidelineImports(source: string): { ScriptKind.TS, ); for (const statement of sourceFile.statements) { - switch (statement.kind) { - case SyntaxKind.ImportDeclaration: - case SyntaxKind.ImportEqualsDeclaration: - imports += statement.getFullText(sourceFile); - break; - default: - statements += statement.getFullText(sourceFile); + if ( + statement.kind === SyntaxKind.ImportDeclaration || + statement.kind === SyntaxKind.ImportEqualsDeclaration || + (statement.kind === SyntaxKind.VariableStatement && + statement.getChildAt(0).getChildAt(0).kind === + SyntaxKind.DeclareKeyword) + ) { + imports += statement.getFullText(sourceFile); + } else { + statements += statement.getFullText(sourceFile); } } diff --git a/packages/jsii-rosetta/test/fixtures.test.ts b/packages/jsii-rosetta/test/fixtures.test.ts index 92e9f9ff7c..d315e86b17 100644 --- a/packages/jsii-rosetta/test/fixtures.test.ts +++ b/packages/jsii-rosetta/test/fixtures.test.ts @@ -16,4 +16,35 @@ describe('fixturize', () => { expect(fixturize(snippet)).toEqual(expect.objectContaining(snippet)); }); + + test('separates imports and declarations', () => { + const source = `import * as ns from 'mod'; +declare const mock: Tpe; +const val = new Cls();`; + const snippet = { + visibleSource: source, + where: 'where', + parameters: { + [SnippetParameters.$PROJECT_DIRECTORY]: 'test', + }, + strict: true, + }; + + const fixturizedSnippet = fixturize(snippet); + + expect(fixturizedSnippet.completeSource) + .toBe(`// Hoisted imports begin after !show marker below +/// !show +import * as ns from 'mod'; +declare const mock: Tpe; +/// !hide +// Hoisted imports ended before !hide marker above +// Code snippet begins after !show marker below +/// !show + +const val = new Cls(); +/// !hide +// Code snippet ended before !hide marker above +`); + }); }); diff --git a/packages/jsii-rosetta/test/rosetta/default.ts-fixture b/packages/jsii-rosetta/test/rosetta/default.ts-fixture new file mode 100644 index 0000000000..acd85cb41b --- /dev/null +++ b/packages/jsii-rosetta/test/rosetta/default.ts-fixture @@ -0,0 +1 @@ +/// here From 7548ad1b9b9b9510a99bcf268637cc80e22a1e70 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 18:02:36 +0200 Subject: [PATCH 05/17] docs: add johannes-weber as a contributor for doc (#2919) Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 19 ++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index db18c17191..14e3236bd5 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1168,6 +1168,15 @@ "contributions": [ "maintenance" ] + }, + { + "login": "johannes-weber", + "name": "Johannes Weber", + "avatar_url": "https://avatars.githubusercontent.com/u/569011?v=4", + "profile": "https://twitter.com/jowe", + "contributions": [ + "doc" + ] } ], "repoType": "github", diff --git a/README.md b/README.md index c9a1b077c9..8d2048e705 100644 --- a/README.md +++ b/README.md @@ -123,82 +123,83 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Jason Fulghum

πŸ€” πŸ“† πŸ‘€
Jerry Kindall

πŸ“– πŸ€”
Jimmy Gaussen

πŸ€” +
Johannes Weber

πŸ“–
Jon Steinich

πŸ› πŸ€” πŸ’» -
Joseph Lawson

πŸ‘€ +
Joseph Lawson

πŸ‘€
Joseph Martin

πŸ›
Junix

πŸ›
Justin Taylor

πŸ›
Kyle Thomson

πŸ’» πŸ‘€
Leandro Padua

πŸ›
Liang Zhou

πŸ› πŸ’» -
Maja S Bratseth

πŸ› +
Maja S Bratseth

πŸ›
Marcos Diez

πŸ›
Mark Nielsen

πŸ’»
Matthew Bonig

πŸ› πŸ“
Matthew Pirocchi

πŸ’» πŸ€” πŸ‘€
Mike Lane

πŸ›
Mitch Garnaat

πŸ› πŸ’» πŸ€” πŸ‘€ -
Mitchell Valine

πŸ› πŸ’» πŸ€” 🚧 πŸ‘€ +
Mitchell Valine

πŸ› πŸ’» πŸ€” 🚧 πŸ‘€
Mohamad Soufan

πŸ“–
Neta Nir

πŸ’» πŸ€” 🚧 πŸ‘€
Nick Lynch

πŸ› πŸ’» 🚧 πŸ‘€
Niranjan Jayakar

πŸ› πŸ’» πŸ€” 🚧 πŸ‘€
Noah Litov

πŸ’» 🚧 πŸ‘€
PIDZ - Bart

πŸ€” -
Petr Kacer

πŸ› +
Petr Kacer

πŸ›
Petra Barus

πŸ’»
Philip Cali

πŸ€”
Quentin Loos

πŸ€”
Raphael

πŸ›
Richard H Boyd

πŸ›
Rico Huijbers

πŸ› πŸ’» πŸ€” 🚧 πŸ‘€ -
Romain Marcadier

πŸ› πŸ’» 🎨 πŸ€” 🚧 πŸ‘€ πŸ“ +
Romain Marcadier

πŸ› πŸ’» 🎨 πŸ€” 🚧 πŸ‘€ πŸ“
SADIK KUZU

πŸ‘€
SK

πŸ€”
Sam Fink

πŸ’» πŸ‘€
Sam Goodwin

πŸ‘€
Sebastian Korfmann

πŸ› πŸ’» πŸ€”
Shane Witbeck

πŸ€” -
Shiv Lakshminarayan

πŸ’» 🚧 πŸ‘€ +
Shiv Lakshminarayan

πŸ’» 🚧 πŸ‘€
Somaya

πŸ’» πŸ€” 🚧 πŸ‘€
The Gitter Badger

πŸ’» 🚧
Thomas Poignant

πŸ›
Thomas Steinbach

πŸ›
Thorsten Hoeger

πŸ’»
Tim Wagner

πŸ› πŸ€” -
Tobias Lidskog

πŸ’» +
Tobias Lidskog

πŸ’»
Ty Coghlan

πŸ›
Tyler van Hensbergen

πŸ€”
Vlad Hrybok

πŸ›
Vladimir Shchur

πŸ›
Yan Zhulanow

πŸ’»
Yigong Liu

πŸ› πŸ€” -
ajnarang

πŸ€” +
ajnarang

πŸ€”
aniljava

πŸ’»
deccy-mcc

πŸ›
dependabot-preview[bot]

πŸ› 🚧
dependabot[bot]

🚧
dheffx

πŸ›
gregswdl

πŸ› -
guyroberts21

πŸ“– +
guyroberts21

πŸ“–
mattBrzezinski

πŸ“–
mergify[bot]

🚧
seiyashima42

πŸ› πŸ’» πŸ“– From e54b10b381aed2827c59a1fd5c5807968e237ec8 Mon Sep 17 00:00:00 2001 From: Johannes Weber Date: Wed, 21 Jul 2021 18:02:51 +0200 Subject: [PATCH 06/17] docs: Fix broken link to Contribution Guide (#2906) The previous link pointed to a 404 page. I updated it to point to the repository's `CONTRIBUTING.md`. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- gh-pages/content/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gh-pages/content/index.md b/gh-pages/content/index.md index 065dd6abc7..fddae9b4f7 100644 --- a/gh-pages/content/index.md +++ b/gh-pages/content/index.md @@ -100,7 +100,7 @@ header bar: ## How to contribute The [*jsii project*](https://github.com/aws/jsii) welcomes all kind of contributions. You can refer to the -[Contribution Guide](https://github.com/aws/jsii/trees/main/CONTRIBUTING.md) on GitHub to get more information about how +[Contribution Guide](https://github.com/aws/jsii/blob/main/CONTRIBUTING.md) on GitHub to get more information about how to contribute to the project in general. !!! tip From 4b423ab2f50791d30ba098a732ee69c7bd9a5bdc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Jul 2021 09:56:24 +0200 Subject: [PATCH 07/17] chore(deps): bump golang.org/x/tools in /packages/@jsii/go-runtime (#2908) Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.1.4 to 0.1.5. - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.1.4...v0.1.5) --- updated-dependencies: - dependency-name: golang.org/x/tools dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/@jsii/go-runtime/go.mod | 2 +- packages/@jsii/go-runtime/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@jsii/go-runtime/go.mod b/packages/@jsii/go-runtime/go.mod index 4f2974d796..c744efa661 100644 --- a/packages/@jsii/go-runtime/go.mod +++ b/packages/@jsii/go-runtime/go.mod @@ -4,5 +4,5 @@ go 1.15 require ( golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 - golang.org/x/tools v0.1.4 + golang.org/x/tools v0.1.5 ) diff --git a/packages/@jsii/go-runtime/go.sum b/packages/@jsii/go-runtime/go.sum index 9e86be1b81..6b15e6d75b 100644 --- a/packages/@jsii/go-runtime/go.sum +++ b/packages/@jsii/go-runtime/go.sum @@ -25,8 +25,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= From 2d2a6a184f718f15f4632de8ef42cc5661218bbc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Jul 2021 09:56:32 +0200 Subject: [PATCH 08/17] chore(deps): bump Microsoft.Extensions.DependencyInjection (#2909) Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/dotnet/runtime) from 5.0.1 to 5.0.2. - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/compare/v5.0.1...v5.0.2) --- updated-dependencies: - dependency-name: Microsoft.Extensions.DependencyInjection dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/@jsii/Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@jsii/Directory.Build.targets b/packages/@jsii/Directory.Build.targets index a17f284712..a05107aab1 100644 --- a/packages/@jsii/Directory.Build.targets +++ b/packages/@jsii/Directory.Build.targets @@ -2,7 +2,7 @@ - + From 382cf2b5b8facefa08d762588045df5fa12f4dcf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Jul 2021 09:56:41 +0200 Subject: [PATCH 09/17] chore(deps): update black requirement in /packages/@jsii/python-runtime (#2910) Updates the requirements on [black](https://github.com/psf/black) to permit the latest version. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/commits) --- updated-dependencies: - dependency-name: black dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/@jsii/python-runtime/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@jsii/python-runtime/requirements.txt b/packages/@jsii/python-runtime/requirements.txt index a999873ac3..7d6ed989d4 100644 --- a/packages/@jsii/python-runtime/requirements.txt +++ b/packages/@jsii/python-runtime/requirements.txt @@ -1,4 +1,4 @@ -black~=21.6b0 +black~=21.7b0 mypy==0.812 pip~=21.1 pytest~=6.2 From 03dc00c2dd66612a9233bc85e4c575cb0ccc6109 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Jul 2021 09:56:54 +0200 Subject: [PATCH 10/17] chore(deps): update setuptools requirement (#2911) Updates the requirements on [setuptools](https://github.com/pypa/setuptools) to permit the latest version. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/CHANGES.rst) - [Commits](https://github.com/pypa/setuptools/compare/v57.0.0...v57.4.0) --- updated-dependencies: - dependency-name: setuptools dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Elad Ben-Israel --- packages/@jsii/python-runtime/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@jsii/python-runtime/requirements.txt b/packages/@jsii/python-runtime/requirements.txt index 7d6ed989d4..afbd54d9e5 100644 --- a/packages/@jsii/python-runtime/requirements.txt +++ b/packages/@jsii/python-runtime/requirements.txt @@ -3,7 +3,7 @@ mypy==0.812 pip~=21.1 pytest~=6.2 pytest-mypy~=0.8 -setuptools~=57.0 +setuptools~=57.4 wheel~=0.36 -e . From bafc19d099f10ee6f68ad6e5a9369f04aab26235 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Jul 2021 09:57:03 +0200 Subject: [PATCH 11/17] chore(deps-dev): update mkdocs requirement in /gh-pages (#2913) Updates the requirements on [mkdocs](https://github.com/mkdocs/mkdocs) to permit the latest version. - [Release notes](https://github.com/mkdocs/mkdocs/releases) - [Commits](https://github.com/mkdocs/mkdocs/compare/1.2.1...1.2.2) --- updated-dependencies: - dependency-name: mkdocs dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gh-pages/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gh-pages/requirements-dev.txt b/gh-pages/requirements-dev.txt index 68cf2c61b5..ee1499a830 100644 --- a/gh-pages/requirements-dev.txt +++ b/gh-pages/requirements-dev.txt @@ -1,4 +1,4 @@ -mkdocs~=1.2.1 +mkdocs~=1.2.2 mkdocs-awesome-pages-plugin~=2.5.0 mkdocs-material~=7.1.9 mkdocs-git-revision-date-plugin~=0.3.1 From d2de258a14d58af64becfdae6fa483e6de2c034f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Jul 2021 09:57:13 +0200 Subject: [PATCH 12/17] chore(deps): bump actions/setup-node from 2.1.5 to 2.3.0 (#2915) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2.1.5 to 2.3.0. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v2.1.5...v2.3.0) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/main.yml | 6 +++--- .github/workflows/yarn-upgrade.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 554cc7cd75..03ad5a64f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ jobs: java-version: '8' distribution: 'zulu' - name: Set up Node 12 - uses: actions/setup-node@v2.1.5 + uses: actions/setup-node@v2.3.0 with: node-version: '12' - name: Set up Python 3.6 @@ -132,7 +132,7 @@ jobs: java-version: '8' distribution: 'zulu' - name: Set up Node 12 - uses: actions/setup-node@v2.1.5 + uses: actions/setup-node@v2.3.0 with: node-version: '12' - name: Set up Python 3.6 @@ -292,7 +292,7 @@ jobs: java-version: ${{ matrix.java }} distribution: 'zulu' - name: Set up Node ${{ matrix.node }} - uses: actions/setup-node@v2.1.5 + uses: actions/setup-node@v2.3.0 with: node-version: ${{ matrix.node }} - name: Set up Python ${{ matrix.python }} diff --git a/.github/workflows/yarn-upgrade.yml b/.github/workflows/yarn-upgrade.yml index ca27b7add3..a6f65b95db 100644 --- a/.github/workflows/yarn-upgrade.yml +++ b/.github/workflows/yarn-upgrade.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v2.3.4 - name: Set up Node - uses: actions/setup-node@v2.1.5 + uses: actions/setup-node@v2.3.0 with: node-version: 10 From 1e12c2b1822bf5dbcaf528ad3d39969e6f4571e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Jul 2021 09:57:20 +0200 Subject: [PATCH 13/17] chore(deps-dev): update twine requirement (#2916) Updates the requirements on [twine](https://github.com/pypa/twine) to permit the latest version. - [Release notes](https://github.com/pypa/twine/releases) - [Changelog](https://github.com/pypa/twine/blob/main/docs/changelog.rst) - [Commits](https://github.com/pypa/twine/compare/3.4.1...3.4.2) --- updated-dependencies: - dependency-name: twine dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/jsii-pacmak/lib/targets/python/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt b/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt index 044b0fdf35..8aa81a35ea 100644 --- a/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt +++ b/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt @@ -6,4 +6,4 @@ setuptools~=56.0.0 # build-system wheel~=0.36.2 # build-system -twine~=3.4.1 +twine~=3.4.2 From eb8f1027ed84ee570ba61d16112a31d43d6aa4f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Jul 2021 09:57:49 +0200 Subject: [PATCH 14/17] chore(deps): update cattrs requirement from ~=1.5.0 to ~=1.6.0 in /packages/@jsii/python-runtime (#2817) * chore(deps): update cattrs requirement in /packages/@jsii/python-runtime Updates the requirements on [cattrs](https://github.com/Tinche/cattrs) to permit the latest version. - [Release notes](https://github.com/Tinche/cattrs/releases) - [Changelog](https://github.com/Tinche/cattrs/blob/master/HISTORY.rst) - [Commits](https://github.com/Tinche/cattrs/compare/v1.5.0...v1.6.0) Signed-off-by: dependabot[bot] * Update setup.py Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Romain Marcadier --- packages/@jsii/python-runtime/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@jsii/python-runtime/setup.py b/packages/@jsii/python-runtime/setup.py index a8f3023c07..744c98de2a 100644 --- a/packages/@jsii/python-runtime/setup.py +++ b/packages/@jsii/python-runtime/setup.py @@ -32,7 +32,7 @@ install_requires=[ "attrs~=20.1", "cattrs~=1.0.0 ; python_version < '3.7'", - "cattrs~=1.5.0 ; python_version >= '3.7'", + "cattrs~=1.6.0 ; python_version >= '3.7'", "importlib_resources ; python_version < '3.7'", "python-dateutil", "typing_extensions~=3.7", From c5fe7d2019c97b154ea318eb432262ce0891deb9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Jul 2021 09:58:13 +0200 Subject: [PATCH 15/17] chore(deps-dev): update setuptools requirement from ~=56.0.0 to ~=56.1.0 in /packages/jsii-pacmak/lib/targets/python (#2820) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps-dev): update setuptools requirement Updates the requirements on [setuptools](https://github.com/pypa/setuptools) to permit the latest version. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/CHANGES.rst) - [Commits](https://github.com/pypa/setuptools/compare/v56.0.0...v56.1.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: πŸ‘¨πŸ»β€πŸ’» Romain Marcadier --- .../jsii-pacmak/lib/targets/python/requirements-dev.txt | 2 +- .../generated-code/__snapshots__/examples.test.ts.snap | 4 ++-- .../__snapshots__/prerelease-identifiers.test.ts.snap | 8 ++++---- .../__snapshots__/target-python.test.ts.snap | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt b/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt index 8aa81a35ea..0cfbefb450 100644 --- a/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt +++ b/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt @@ -3,7 +3,7 @@ # be installed in the virtual environment used for building the distribution # package (wheel, sdist), but not declared as build-system dependencies. -setuptools~=56.0.0 # build-system +setuptools~=56.1.0 # build-system wheel~=0.36.2 # build-system twine~=3.4.2 diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.ts.snap index 4665c9ebae..1d3dfe5925 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.ts.snap @@ -1147,7 +1147,7 @@ testpkg.FooBar=example.test.demo.FooBar exports[`diamond-struct-parameter.ts: /python/pyproject.toml 1`] = ` [build-system] -requires = ["setuptools~=56.0.0", "wheel~=0.36.2"] +requires = ["setuptools~=56.1.0", "wheel~=0.36.2"] build-backend = "setuptools.build_meta" `; @@ -2447,7 +2447,7 @@ testpkg.Namespace2.Foo.Final=example.test.demo.Namespace2$Foo.Final exports[`nested-types.ts: /python/pyproject.toml 1`] = ` [build-system] -requires = ["setuptools~=56.0.0", "wheel~=0.36.2"] +requires = ["setuptools~=56.1.0", "wheel~=0.36.2"] build-backend = "setuptools.build_meta" `; diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.ts.snap index d70a563e8c..df8f373030 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.ts.snap @@ -416,7 +416,7 @@ foo exports[`foo@1.2.3 depends on bar@^2.0.0-rc.42: /python/pyproject.toml 1`] = ` [build-system] -requires = ["setuptools~=56.0.0", "wheel~=0.36.2"] +requires = ["setuptools~=56.1.0", "wheel~=0.36.2"] build-backend = "setuptools.build_meta" `; @@ -925,7 +925,7 @@ foo exports[`foo@1.2.3 depends on bar@^4.5.6-pre.1337: /python/pyproject.toml 1`] = ` [build-system] -requires = ["setuptools~=56.0.0", "wheel~=0.36.2"] +requires = ["setuptools~=56.1.0", "wheel~=0.36.2"] build-backend = "setuptools.build_meta" `; @@ -1414,7 +1414,7 @@ foo exports[`foo@2.0.0-rc.42: /python/pyproject.toml 1`] = ` [build-system] -requires = ["setuptools~=56.0.0", "wheel~=0.36.2"] +requires = ["setuptools~=56.1.0", "wheel~=0.36.2"] build-backend = "setuptools.build_meta" `; @@ -1900,7 +1900,7 @@ foo exports[`foo@4.5.6-pre.1337: /python/pyproject.toml 1`] = ` [build-system] -requires = ["setuptools~=56.0.0", "wheel~=0.36.2"] +requires = ["setuptools~=56.1.0", "wheel~=0.36.2"] build-backend = "setuptools.build_meta" `; diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap index f02e641b92..66ef7ab05e 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap @@ -243,7 +243,7 @@ scope.jsii-calc-base exports[`Generated code for "@scope/jsii-calc-base": /python/pyproject.toml 1`] = ` [build-system] -requires = ["setuptools~=56.0.0", "wheel~=0.36.2"] +requires = ["setuptools~=56.1.0", "wheel~=0.36.2"] build-backend = "setuptools.build_meta" `; @@ -723,7 +723,7 @@ scope.jsii-calc-base-of-base exports[`Generated code for "@scope/jsii-calc-base-of-base": /python/pyproject.toml 1`] = ` [build-system] -requires = ["setuptools~=56.0.0", "wheel~=0.36.2"] +requires = ["setuptools~=56.1.0", "wheel~=0.36.2"] build-backend = "setuptools.build_meta" `; @@ -1176,7 +1176,7 @@ scope.jsii-calc-lib exports[`Generated code for "@scope/jsii-calc-lib": /python/pyproject.toml 1`] = ` [build-system] -requires = ["setuptools~=56.0.0", "wheel~=0.36.2"] +requires = ["setuptools~=56.1.0", "wheel~=0.36.2"] build-backend = "setuptools.build_meta" `; @@ -2399,7 +2399,7 @@ foo = "bar" exports[`Generated code for "jsii-calc": /python/pyproject.toml 1`] = ` [build-system] -requires = ["setuptools~=56.0.0", "wheel~=0.36.2"] +requires = ["setuptools~=56.1.0", "wheel~=0.36.2"] build-backend = "setuptools.build_meta" `; From fc0257677f457e3561691f3b8d672fea5258fad2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Jul 2021 10:01:46 +0200 Subject: [PATCH 16/17] chore(deps-dev): update mkdocs-material requirement in /gh-pages (#2918) Updates the requirements on [mkdocs-material](https://github.com/squidfunk/mkdocs-material) to permit the latest version. - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/docs/changelog.md) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/7.1.9...7.2.0) --- updated-dependencies: - dependency-name: mkdocs-material dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gh-pages/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gh-pages/requirements-dev.txt b/gh-pages/requirements-dev.txt index ee1499a830..4dbeeb3864 100644 --- a/gh-pages/requirements-dev.txt +++ b/gh-pages/requirements-dev.txt @@ -1,4 +1,4 @@ mkdocs~=1.2.2 mkdocs-awesome-pages-plugin~=2.5.0 -mkdocs-material~=7.1.9 +mkdocs-material~=7.2.0 mkdocs-git-revision-date-plugin~=0.3.1 From 767a1b2fd937bcd6dbe2162e8615424ed02a2bda Mon Sep 17 00:00:00 2001 From: AWS CDK Team Date: Thu, 22 Jul 2021 08:30:07 +0000 Subject: [PATCH 17/17] chore(release): 1.32.0 --- CHANGELOG.md | 19 +++++++++++++++++++ lerna.json | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3aa8a3138..6c8d08671e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.32.0](https://github.com/aws/jsii/compare/v1.30.0...v1.32.0) (2021-07-22) + + +### Features + +* **jsii-rosetta transliterate:** transliterate a jsii assembly ([#2869](https://github.com/aws/jsii/issues/2869)) ([d9028c8](https://github.com/aws/jsii/commit/d9028c8cf91297a44cd4b1f128f769716bf0e74e)) +* **rosetta:** hoist declare statements to top-level of document ([#2897](https://github.com/aws/jsii/issues/2897)) ([7b2ec05](https://github.com/aws/jsii/commit/7b2ec05b2ec247de83901e8504f7ba711d6027bb)) +* **rosetta:** transliterate loose mode ([#2892](https://github.com/aws/jsii/issues/2892)) ([43e6dfd](https://github.com/aws/jsii/commit/43e6dfd0591b0f38a8c636edd3896400c96676e3)) + + +### Bug Fixes + +* crash when assembly originator key file is missing ([#2899](https://github.com/aws/jsii/issues/2899)) ([e05ce62](https://github.com/aws/jsii/commit/e05ce625ba4760fa8196a5944cc9089a1aaefcfb)) +* **dotnet:** strong-name sign assemblies ([#2894](https://github.com/aws/jsii/issues/2894)) ([7b90f27](https://github.com/aws/jsii/commit/7b90f27c7819209f6485c28eabefb328a0304ab5)) +* **pacmak/go:** missing go.sum entry ([#2893](https://github.com/aws/jsii/issues/2893)) ([6e6ad69](https://github.com/aws/jsii/commit/6e6ad693230e18f36990e8feaf3734da7c01dbd5)) +* **rosetta:** extract does not respect strict metadata entry ([#2863](https://github.com/aws/jsii/issues/2863)) ([5d2392b](https://github.com/aws/jsii/commit/5d2392b7713cb6dfea6092c4ac3ee45360a5d28a)), closes [#2861](https://github.com/aws/jsii/issues/2861) +* **rosetta:** fails on "Debug Failure" ([#2917](https://github.com/aws/jsii/issues/2917)) ([f6078ef](https://github.com/aws/jsii/commit/f6078ef08a144ea86623f331c60ac15ca5f91219)), closes [cdklabs/jsii-docgen#369](https://github.com/cdklabs/jsii-docgen/issues/369) +* **rosetta:** hangs on 'markdown' command when a file is provided ([#2871](https://github.com/aws/jsii/issues/2871)) ([e538b36](https://github.com/aws/jsii/commit/e538b36c6ccf53ace908ff4c342dc9a4435ce353)) + ## [1.31.0](https://github.com/aws/jsii/compare/v1.30.0...v1.31.0) (2021-07-09) diff --git a/lerna.json b/lerna.json index 3fbac4bcab..b359dd726c 100644 --- a/lerna.json +++ b/lerna.json @@ -10,5 +10,5 @@ "rejectCycles": true } }, - "version": "1.31.0" + "version": "1.32.0" }