diff --git a/gh-pages/content/overview/toolchain.md b/gh-pages/content/overview/toolchain.md index 62b2b17d78..aa4ca6cdef 100644 --- a/gh-pages/content/overview/toolchain.md +++ b/gh-pages/content/overview/toolchain.md @@ -5,19 +5,19 @@ !!! info We are considering creating an "umbrella entrypoint" to make it easier to consume. -| Name | Release | Stability | Description | -| --------------- | ------- | -------------- | --------------------------------------------------------------------- | -| [jsii1] | `1.x` | [Maintenance] | Compiles TypeScript to jsii module (TypeScript 3.9 Syntax) | -| [jsii] | `5.0.x` | GA | Compiles TypeScript to jsii module (TypeScript 5.0 Syntax) | -| [jsii-pacmak] | `1.x` | GA | Creates ready-to-publish language-specific packages from jsii modules | -| [jsii-reflect] | `1.x` | GA | Strong-typed reflection library for jsii type systems | -| [jsii-diff] | `1.x` | GA | API backwards compatibility checker | -| [jsii-rosetta1] | `1.x` | [Maintenance] | Transpile code snippets (in docs) from TypeScript to jsii languages | -| [jsii-rosetta] | `5.0.x` | Experimental | Transpile code snippets (in docs) from TypeScript to jsii languages | -| [jsii-config] | `1.x` | Experimental | Interactive tool for generating jsii configuration | -| [jsii-release] | `1.x` | Community | Publishes jsii modules to all supported package managers | -| [jsii-srcmak] | `1.x` | Community | Generates relocatable source code in jsii languages from typescript | -| [jsii-docgen] | `1.x` | Community | Generates markdown API documentation for jsii modules | +| Name | Release | Stability | Description | +| --------------- | ------- | ------------- | --------------------------------------------------------------------- | +| [jsii1] | `1.x` | [Maintenance] | Compiles TypeScript to jsii module (TypeScript 3.9 Syntax) | +| [jsii] | `5.x` | GA | Compiles TypeScript to jsii module (TypeScript 5.x Syntax) | +| [jsii-pacmak] | `1.x` | GA | Creates ready-to-publish language-specific packages from jsii modules | +| [jsii-reflect] | `1.x` | GA | Strong-typed reflection library for jsii type systems | +| [jsii-diff] | `1.x` | GA | API backwards compatibility checker | +| [jsii-rosetta1] | `1.x` | [Maintenance] | Transpile code snippets (in docs) from TypeScript to jsii languages | +| [jsii-rosetta] | `5.x` | GA | Transpile code snippets (in docs) from TypeScript to jsii languages | +| [jsii-config] | `1.x` | Experimental | Interactive tool for generating jsii configuration | +| [jsii-release] | `1.x` | Community | Publishes jsii modules to all supported package managers | +| [jsii-srcmak] | `1.x` | Community | Generates relocatable source code in jsii languages from typescript | +| [jsii-docgen] | *any* | Community | Generates markdown API documentation for jsii modules | ??? question "Stability Definitions" - **GA**: Projects that are deemed *Generally Available* and for which customers can expect full support, including @@ -32,7 +32,6 @@ [semver]: https://semver.org/spec/v2.0.0.html - [Maintenance]: ../compiler-and-rosetta-maintenance.md [jsii1]: https://github.com/aws/jsii/tree/main/packages/jsii [jsii]: https://github.com/aws/jsii-compiler#readme diff --git a/gh-pages/content/user-guides/language-support/index.md b/gh-pages/content/user-guides/language-support/index.md index ed2788985b..eace4649a9 100644 --- a/gh-pages/content/user-guides/language-support/index.md +++ b/gh-pages/content/user-guides/language-support/index.md @@ -163,7 +163,7 @@ declared _Generally Available_. At this point, breaking changes are no longer po [`jsii-calc`]: ../../packages/jsii-calc [`jsii-config`]: ../../packages/jsii-config [`jsii-pacmak`]: ../../packages/jsii-pacmak -[`jsii-rosetta`]: ../../packages/jsii-rosetta +[`jsii-rosetta`]: https://github.com/aws/jsii-rosetta [standard compliance suite]: ../../specification/4-standard-compliance-suite.md [`public.ecr.aws/jsii/superchain`]: ../../superchain [`aws-delivlib`]: https://github.com/awslabs/aws-delivlib diff --git a/packages/jsii-pacmak/lib/builder.ts b/packages/jsii-pacmak/lib/builder.ts index 3544bf3573..5ed65e40b6 100644 --- a/packages/jsii-pacmak/lib/builder.ts +++ b/packages/jsii-pacmak/lib/builder.ts @@ -1,4 +1,4 @@ -import { Rosetta } from 'jsii-rosetta'; +import { RosettaTabletReader } from 'jsii-rosetta'; import * as path from 'path'; import * as logging from './logging'; @@ -44,7 +44,7 @@ export interface BuildOptions { /** * The Rosetta instance to load examples from */ - readonly rosetta: Rosetta; + readonly rosetta: RosettaTabletReader; /** * Whether to generate runtime type checking code in places where compile-time diff --git a/packages/jsii-pacmak/lib/index.ts b/packages/jsii-pacmak/lib/index.ts index cadbe05af7..0b384f1c15 100644 --- a/packages/jsii-pacmak/lib/index.ts +++ b/packages/jsii-pacmak/lib/index.ts @@ -1,7 +1,7 @@ import './suppress-jsii-upgrade-prompts'; import { TypeSystem } from 'jsii-reflect'; -import { Rosetta, UnknownSnippetMode } from 'jsii-rosetta'; +import { RosettaTabletReader, UnknownSnippetMode } from 'jsii-rosetta'; import { resolve } from 'path'; import { cwd } from 'process'; @@ -41,7 +41,7 @@ export async function pacmak({ updateNpmIgnoreFiles = false, validateAssemblies = false, }: PacmakOptions): Promise { - const rosetta = new Rosetta({ + const rosetta = new RosettaTabletReader({ unknownSnippets: rosettaUnknownSnippets, prefixDisclaimer: true, }); @@ -315,7 +315,7 @@ async function buildTargetsForLanguage( fingerprint: boolean; force: boolean; perLanguageDirectory: boolean; - rosetta: Rosetta; + rosetta: RosettaTabletReader; runtimeTypeChecking: boolean; }, ): Promise { diff --git a/packages/jsii-pacmak/lib/suppress-jsii-upgrade-prompts.ts b/packages/jsii-pacmak/lib/suppress-jsii-upgrade-prompts.ts deleted file mode 100644 index 6e6f6bc3f2..0000000000 --- a/packages/jsii-pacmak/lib/suppress-jsii-upgrade-prompts.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Suppress the upgrade prompt from jsii and jsii-rosetta -process.env.JSII_SUPPRESS_UPGRADE_PROMPT = '1'; diff --git a/packages/jsii-pacmak/lib/target.ts b/packages/jsii-pacmak/lib/target.ts index 4949f29690..cbb55cc521 100644 --- a/packages/jsii-pacmak/lib/target.ts +++ b/packages/jsii-pacmak/lib/target.ts @@ -1,7 +1,7 @@ import * as spec from '@jsii/spec'; import * as fs from 'fs-extra'; import * as reflect from 'jsii-reflect'; -import { Rosetta } from 'jsii-rosetta'; +import { RosettaTabletReader } from 'jsii-rosetta'; import * as path from 'path'; import * as spdx from 'spdx-license-list/full'; @@ -16,7 +16,7 @@ export abstract class Target { protected readonly arguments: { [name: string]: any }; protected readonly targetName: string; protected readonly assembly: reflect.Assembly; - protected readonly rosetta: Rosetta; + protected readonly rosetta: RosettaTabletReader; protected readonly runtimeTypeChecking: boolean; protected abstract readonly generator: IGenerator; @@ -211,7 +211,7 @@ export interface TargetOptions { assembly: reflect.Assembly; /** The Rosetta instance */ - rosetta: Rosetta; + rosetta: RosettaTabletReader; /** Whether to generate runtime type-checking code */ runtimeTypeChecking: boolean; diff --git a/packages/jsii-pacmak/lib/targets/dotnet/dotnetdocgenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/dotnetdocgenerator.ts index d1cb2ea2f6..e2c250a862 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/dotnetdocgenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/dotnetdocgenerator.ts @@ -1,7 +1,7 @@ import * as spec from '@jsii/spec'; import { CodeMaker } from 'codemaker'; import { - Rosetta, + RosettaTabletReader, TargetLanguage, enforcesStrictMode, markDownToXmlDoc, @@ -23,7 +23,7 @@ export class DotNetDocGenerator { public constructor( code: CodeMaker, - private readonly rosetta: Rosetta, + private readonly rosetta: RosettaTabletReader, private readonly assembly: spec.Assembly, ) { this.code = code; diff --git a/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts index cd65a88b36..e0d1a5339d 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts @@ -4,7 +4,7 @@ import * as fs from 'fs-extra'; import * as http from 'http'; import * as https from 'https'; import * as reflect from 'jsii-reflect'; -import { Rosetta } from 'jsii-rosetta'; +import { RosettaTabletReader } from 'jsii-rosetta'; import * as path from 'path'; import { Generator, Legalese } from '../../generator'; @@ -23,7 +23,7 @@ import { ParameterValidator } from './runtime-type-checking'; export class DotNetGenerator extends Generator { private readonly nameutils: DotNetNameUtils = new DotNetNameUtils(); - private readonly rosetta: Rosetta; + private readonly rosetta: RosettaTabletReader; // Flags that tracks if we have already wrote the first member of the class private firstMemberWritten = false; @@ -37,7 +37,7 @@ export class DotNetGenerator extends Generator { public constructor( private readonly assembliesCurrentlyBeingCompiled: string[], options: { - readonly rosetta: Rosetta; + readonly rosetta: RosettaTabletReader; readonly runtimeTypeChecking: boolean; }, ) { diff --git a/packages/jsii-pacmak/lib/targets/go.ts b/packages/jsii-pacmak/lib/targets/go.ts index 3373341811..66b7e53964 100644 --- a/packages/jsii-pacmak/lib/targets/go.ts +++ b/packages/jsii-pacmak/lib/targets/go.ts @@ -1,7 +1,7 @@ import { CodeMaker } from 'codemaker'; import * as fs from 'fs-extra'; import { Assembly } from 'jsii-reflect'; -import { Rosetta } from 'jsii-rosetta'; +import { RosettaTabletReader } from 'jsii-rosetta'; import * as path from 'path'; import { IGenerator, Legalese } from '../generator'; @@ -150,11 +150,11 @@ class GoGenerator implements IGenerator { }); private readonly documenter: Documentation; - private readonly rosetta: Rosetta; + private readonly rosetta: RosettaTabletReader; private readonly runtimeTypeChecking: boolean; public constructor(options: { - readonly rosetta: Rosetta; + readonly rosetta: RosettaTabletReader; readonly runtimeTypeChecking: boolean; }) { this.rosetta = options.rosetta; diff --git a/packages/jsii-pacmak/lib/targets/go/documentation.ts b/packages/jsii-pacmak/lib/targets/go/documentation.ts index 2ce22dc4a0..56a1766734 100644 --- a/packages/jsii-pacmak/lib/targets/go/documentation.ts +++ b/packages/jsii-pacmak/lib/targets/go/documentation.ts @@ -1,12 +1,12 @@ import { Stability } from '@jsii/spec'; import { CodeMaker } from 'codemaker'; import { Docs } from 'jsii-reflect'; -import { ApiLocation, Rosetta, TargetLanguage } from 'jsii-rosetta'; +import { ApiLocation, RosettaTabletReader, TargetLanguage } from 'jsii-rosetta'; export class Documentation { public constructor( private readonly code: CodeMaker, - private readonly rosetta: Rosetta, + private readonly rosetta: RosettaTabletReader, ) {} /** diff --git a/packages/jsii-pacmak/lib/targets/java.ts b/packages/jsii-pacmak/lib/targets/java.ts index f1a6df7e18..cbcff38688 100644 --- a/packages/jsii-pacmak/lib/targets/java.ts +++ b/packages/jsii-pacmak/lib/targets/java.ts @@ -6,7 +6,7 @@ import { createHash } from 'crypto'; import * as fs from 'fs-extra'; import * as reflect from 'jsii-reflect'; import { - Rosetta, + RosettaTabletReader, TargetLanguage, enforcesStrictMode, markDownToJavaDoc, @@ -633,10 +633,10 @@ class JavaGenerator extends Generator { [name: string]: spec.AssemblyConfiguration; } = {}; - private readonly rosetta: Rosetta; + private readonly rosetta: RosettaTabletReader; public constructor(options: { - readonly rosetta: Rosetta; + readonly rosetta: RosettaTabletReader; readonly runtimeTypeChecking: boolean; }) { super({ ...options, generateOverloadsForMethodWithOptionals: true }); diff --git a/packages/jsii-pacmak/lib/targets/python.ts b/packages/jsii-pacmak/lib/targets/python.ts index 2e0e02a6a6..3ebd6c05fe 100644 --- a/packages/jsii-pacmak/lib/targets/python.ts +++ b/packages/jsii-pacmak/lib/targets/python.ts @@ -7,7 +7,7 @@ import * as fs from 'fs-extra'; import * as reflect from 'jsii-reflect'; import { TargetLanguage, - Rosetta, + RosettaTabletReader, enforcesStrictMode, ApiLocation, } from 'jsii-rosetta'; @@ -2406,7 +2406,7 @@ class PythonGenerator extends Generator { private readonly types: Map; public constructor( - private readonly rosetta: Rosetta, + private readonly rosetta: RosettaTabletReader, options: GeneratorOptions, ) { super(options); diff --git a/packages/jsii-pacmak/package.json b/packages/jsii-pacmak/package.json index 171a9f6960..62195eef51 100644 --- a/packages/jsii-pacmak/package.json +++ b/packages/jsii-pacmak/package.json @@ -45,7 +45,7 @@ "escape-string-regexp": "^4.0.0", "fs-extra": "^10.1.0", "jsii-reflect": "^0.0.0", - "jsii-rosetta": "^0.0.0", + "jsii-rosetta": "^1.85.0 || ~5.0.14 || ~5.1.2 || ~5.2.0 || ~5.3.0 || ~5.4.0", "semver": "^7.5.4", "spdx-license-list": "^6.8.0", "xmlbuilder": "^15.1.1", diff --git a/packages/jsii-pacmak/test/targets/go.test.ts b/packages/jsii-pacmak/test/targets/go.test.ts index a259b6dc7f..f33eb1f270 100644 --- a/packages/jsii-pacmak/test/targets/go.test.ts +++ b/packages/jsii-pacmak/test/targets/go.test.ts @@ -1,6 +1,6 @@ import { promises as fs } from 'fs'; import { TypeSystem } from 'jsii-reflect'; -import { Rosetta } from 'jsii-rosetta'; +import { RosettaTabletReader } from 'jsii-rosetta'; import { tmpdir } from 'os'; import { join } from 'path'; @@ -18,7 +18,7 @@ test('does not generate imports for unused types', async () => { require.resolve('./fixtures/dependent.jsii.json'), ); - const rosetta = new Rosetta(); + const rosetta = new RosettaTabletReader(); const subject = new Golang({ arguments: {}, assembly, diff --git a/packages/jsii-reflect/lib/class.ts b/packages/jsii-reflect/lib/class.ts index 866ae8ab83..672de97503 100644 --- a/packages/jsii-reflect/lib/class.ts +++ b/packages/jsii-reflect/lib/class.ts @@ -122,7 +122,7 @@ export class ClassType extends ReferenceType { return out; } - public isClassType() { + public isClassType(): this is ClassType { return true; }