diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index 8889085150..2407668c7b 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -24,7 +24,7 @@ jobs: debian: - 'bullseye' # 11 - 'bookworm' # 12 - node: ['18', '20'] + node: ['18', '20', '22'] exclude: # We publish bullseye only with Node >= 20 - debian: 'bullseye' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3dd7100c73..d3a3f0f1b0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -231,6 +231,13 @@ jobs: node: '20' # EOL 2026-04-30 os: ubuntu-latest python: '3.8' + - title: 'Node 22' + java: '8' + dotnet: '6.0.x' + go: '1.18' + node: '22' # EOL 2027-04-30 + os: ubuntu-latest + python: '3.8' # Test alternate .NETs - title: '.NET 7.0' java: '8' @@ -420,9 +427,17 @@ jobs: auto-push: true pacmak-integration-test: - name: Integration test (jsii-pacmak) runs-on: ubuntu-latest needs: create-release-package + strategy: + fail-fast: false + matrix: + rosetta: + # this will be the 1.x-dev version build in this repo + - ./jsii-rosetta.tgz + - 5.2.x + - 5.3.x + - 5.4.x steps: # Check out the code - name: Download Artifact @@ -456,19 +471,42 @@ jobs: run: sudo apt install -y python3-venv # Show time! - name: Prepare Work Tree + # 1) Move the locally build version of jsii-rosetta somewhere else + # 2) Remove @jsii/integ-test because it messed up version dependencies and is not needed + # 3) Install aws-cdk-lib, and all locally build packages minus jsii-rosetta & @jsii/integ-test, + # and the specific version of jsii-rosetta + # This ensures we are running jsii-pacmak with the correct peer-dependency + # 4) Print the jsii-rosetta version for confirmation run: |- - npm install --no-save aws-cdk-lib@2 constructs@10 \ - ${{ runner.temp }}/release-package/js/*.tgz \ - ${{ runner.temp }}/release-package/private/*.tgz + mv ${{ runner.temp }}/release-package/js/jsii-rosetta.tgz ./jsii-rosetta.tgz + rm ${{ runner.temp }}/release-package/private/@jsii-integ-test.tgz + npm install --no-save --omit=dev \ + aws-cdk-lib@2 \ + constructs@10 \ + ${{ runner.temp }}/release-package/js/*.tgz \ + ${{ runner.temp }}/release-package/private/*.tgz \ + jsii-rosetta@${{ matrix.rosetta }} + - name: Display jsii-rosetta version + run: npx jsii-rosetta --version - name: Run jsii-pacmak on aws-cdk-lib env: NODE_OPTIONS: --max-old-space-size=6144 # We run with --no-parallel to avoid running out of memory... run: |- ./node_modules/.bin/jsii-pacmak --no-parallel ./node_modules/aws-cdk-lib - # Upload artifact (we'll tar it up to save time) + # Upload artifact only on main and for latest rosetta - name: 'Upload Artifact: integtest_aws-cdk-lib' - uses: actions/upload-artifact@v3 + if: github.ref == 'ref/head/main' && matrix.rosetta == '5.4.x' + uses: actions/upload-artifact@v4 with: name: integtest_aws-cdk-lib path: ./node_modules/aws-cdk-lib/dist/ + + pacmak-integration-test-ok: + name: Integration test (jsii-pacmak) + runs-on: ubuntu-latest + needs: pacmak-integration-test + steps: + - name: OK + # This is just a join target to simplify branch protection setup + run: echo OK diff --git a/CHANGELOG.md b/CHANGELOG.md index dd33b5f469..b8675fd053 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ 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.98.0](https://github.com/aws/jsii/compare/v1.97.0...v1.98.0) (2024-04-30) + + +### ⚠ BREAKING CHANGES + +* **pacmak:** jsii-pacmak now has a peer dependency on jsii-rosetta. Please ensure a version of jsii-rosetta matching your version of jsii is available. Most package managers install peer dependencies automatically and no change is required. However users of yarn v1 or npm v3 to v6 must install jsii-rosetta manually. + +### Features + +* node22 support ([#4489](https://github.com/aws/jsii/issues/4489)) ([699366d](https://github.com/aws/jsii/commit/699366db4df0179aaf1aec151d28e0cea6c2edba)) + + +### Bug Fixes + +* **pacmak:** jsii-pacmak uses incompatible version of jsii-rosetta ([#4487](https://github.com/aws/jsii/issues/4487)) ([cdb47e4](https://github.com/aws/jsii/commit/cdb47e4e148522ca17a28187b514673046a3f1a3)), closes [#4098](https://github.com/aws/jsii/issues/4098) +* **reflect:** additional type predicates for `isXyzType` methods ([#4491](https://github.com/aws/jsii/issues/4491)) ([459481f](https://github.com/aws/jsii/commit/459481f360e911ad6d8b5b5afbcce3b596299d85)) + ## [1.97.0](https://github.com/aws/jsii/compare/v1.96.0...v1.97.0) (2024-04-08) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 21b3a0eab6..3f55bb9d6c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -39,7 +39,7 @@ The following tools need to be installed to develop on JSII locally. We recommen using the docker image from the above section, but if you wish to, you can install in your development environment. -- [Node `14.6.0`] or later +- [Node `18.0.0`] or later - [Yarn `1.19.1`] or later - An OpenJDK-8 distribution (e.g: [Oracle's OpenJDK8], [Amazon Corretto 8]) + [`maven >= 3.0.5`](https://maven.apache.org) @@ -52,7 +52,7 @@ in your development environment. + *Recommended:* [`twine`](https://pypi.org/project/twine/) - [Go] `1.18` or newer -[Node `14.6.0`]: https://nodejs.org/download/release/v14.6.0/ +[Node `18.0.0`]: https://nodejs.org/download/release/latest-v18.x/ [Yarn `1.19.1`]: https://yarnpkg.com/en/docs/install [Oracle's OpenJDK8]: http://openjdk.java.net/install/ [Amazon Corretto 8]: https://aws.amazon.com/corretto/ 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/gh-pages/partials/node-support-table.md b/gh-pages/partials/node-support-table.md index 6a34ef6184..e5174279a3 100644 --- a/gh-pages/partials/node-support-table.md +++ b/gh-pages/partials/node-support-table.md @@ -2,9 +2,9 @@ | Release | Status | End-of-Life | | --------- | ---------------------------- | ------------ | - | `^14.6.0` | :white_check_mark: Supported | `2023-04-30` | - | `^16.3.0` | :white_check_mark: Supported | `2024-09-11` | | `^18.0.0` | :white_check_mark: Supported | `2025-04-30` | + | `^20.0.0` | :white_check_mark: Supported | `2026-04-30` | + | `^22.0.0` | :white_check_mark: Supported | `2027-04-30` | ??? question "Status Definitions" - **:white_check_mark: Supported**: Long Term Support (LTS) releases (those with an even major version) are diff --git a/gh-pages/requirements-dev.txt b/gh-pages/requirements-dev.txt index ca4d421ba3..f51699eff2 100644 --- a/gh-pages/requirements-dev.txt +++ b/gh-pages/requirements-dev.txt @@ -1,4 +1,4 @@ -mkdocs~=1.5.3 +mkdocs~=1.6.0 mkdocs-awesome-pages-plugin~=2.9.2 -mkdocs-material~=9.5.17 +mkdocs-material~=9.5.20 mkdocs-git-revision-date-plugin~=0.3.2 diff --git a/lerna.json b/lerna.json index 2ad0493913..f3f091a5c1 100644 --- a/lerna.json +++ b/lerna.json @@ -12,6 +12,6 @@ "rejectCycles": true } }, - "version": "1.97.0", + "version": "1.98.0", "$schema": "node_modules/lerna/schemas/lerna-schema.json" } diff --git a/packages/@jsii/Directory.Build.targets b/packages/@jsii/Directory.Build.targets index c9453bc8de..f8a691db65 100644 --- a/packages/@jsii/Directory.Build.targets +++ b/packages/@jsii/Directory.Build.targets @@ -12,8 +12,8 @@ - - + + diff --git a/packages/@jsii/check-node/src/constants.ts b/packages/@jsii/check-node/src/constants.ts index 2ead106ac9..d569bdf2bb 100644 --- a/packages/@jsii/check-node/src/constants.ts +++ b/packages/@jsii/check-node/src/constants.ts @@ -50,6 +50,7 @@ export class NodeRelease { new NodeRelease(18, { endOfLife: new Date('2025-04-30') }), new NodeRelease(20, { endOfLife: new Date('2026-04-30') }), new NodeRelease(21, { endOfLife: new Date('2024-06-01'), untested: true }), + new NodeRelease(22, { endOfLife: new Date('2027-04-30') }), // Future (planned releases) ]; diff --git a/packages/@jsii/python-runtime/requirements.txt b/packages/@jsii/python-runtime/requirements.txt index b4bb4d076e..36649159f3 100644 --- a/packages/@jsii/python-runtime/requirements.txt +++ b/packages/@jsii/python-runtime/requirements.txt @@ -1,9 +1,9 @@ -black~=24.3 -mypy==1.9.0 +black~=24.4 +mypy==1.10.0 pip~=24.0 -pytest~=8.1 +pytest~=8.2 pytest-mypy~=0.10 -setuptools~=69.2.0 +setuptools~=69.5.1 types-python-dateutil~=2.9 wheel~=0.43 diff --git a/packages/jsii-pacmak/.eslintrc.yaml b/packages/jsii-pacmak/.eslintrc.yaml index 0cef14cbfe..dece27600d 100644 --- a/packages/jsii-pacmak/.eslintrc.yaml +++ b/packages/jsii-pacmak/.eslintrc.yaml @@ -3,3 +3,12 @@ extends: ../../eslint-config.yaml ignorePatterns: - test/generated-code/examples/** + +rules: + 'import/no-extraneous-dependencies': + - error + - devDependencies: # Only allow importing devDependencies from tests + - '**/test/**' + - '**/*.test.ts' + optionalDependencies: false # Disallow importing optional dependencies (those shouldn't be used here) + peerDependencies: true # jsii-pacmak has a peer dependency on jsii-rosetta diff --git a/packages/jsii-pacmak/bin/jsii-pacmak.ts b/packages/jsii-pacmak/bin/jsii-pacmak.ts index 9beb86fac9..4d4b76d954 100644 --- a/packages/jsii-pacmak/bin/jsii-pacmak.ts +++ b/packages/jsii-pacmak/bin/jsii-pacmak.ts @@ -1,6 +1,5 @@ #!/usr/bin/env node import '@jsii/check-node/run'; -import '../lib/suppress-jsii-upgrade-prompts'; import { UnknownSnippetMode } from 'jsii-rosetta'; import * as yargs from 'yargs'; 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..e29fceea4f 100644 --- a/packages/jsii-pacmak/lib/index.ts +++ b/packages/jsii-pacmak/lib/index.ts @@ -1,7 +1,5 @@ -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 +39,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 +313,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..1d7b88817e 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; @@ -106,7 +106,7 @@ export class DotNetDocGenerator { } /** - * Returns the lines that should go into the section + * Returns the lines that should go into the section {@link http://www.google.com|Google} */ private renderRemarks(docs: spec.Docs, apiLocation: ApiLocation): string[] { const ret: string[] = []; 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..8fc03b2c3a 100644 --- a/packages/jsii-pacmak/package.json +++ b/packages/jsii-pacmak/package.json @@ -45,7 +45,6 @@ "escape-string-regexp": "^4.0.0", "fs-extra": "^10.1.0", "jsii-reflect": "^0.0.0", - "jsii-rosetta": "^0.0.0", "semver": "^7.5.4", "spdx-license-list": "^6.8.0", "xmlbuilder": "^15.1.1", @@ -65,8 +64,12 @@ "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", + "jsii-rosetta": "^0.0.0", "pyright": "^1.1.332" }, + "peerDependencies": { + "jsii-rosetta": "^0.0.0 || ~5.2.0 || ~5.3.0 || ~5.4.0" + }, "keywords": [ "jsii", "aws" diff --git a/packages/jsii-pacmak/test/generated-code/requirements-dev.txt b/packages/jsii-pacmak/test/generated-code/requirements-dev.txt index 7acf1f915e..cb450ef45c 100644 --- a/packages/jsii-pacmak/test/generated-code/requirements-dev.txt +++ b/packages/jsii-pacmak/test/generated-code/requirements-dev.txt @@ -1,2 +1,2 @@ -mypy==1.9.0 +mypy==1.10.0 pip==24.0 # required to use --config-settings 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; } diff --git a/packages/jsii-reflect/lib/enum.ts b/packages/jsii-reflect/lib/enum.ts index ac9c6bbd64..6e4db8eaa0 100644 --- a/packages/jsii-reflect/lib/enum.ts +++ b/packages/jsii-reflect/lib/enum.ts @@ -18,7 +18,7 @@ export class EnumType extends Type { return this.spec.members.map((m) => new EnumMember(this, m)); } - public isEnumType() { + public isEnumType(): this is EnumType { return true; } } diff --git a/packages/jsii-reflect/lib/interface.ts b/packages/jsii-reflect/lib/interface.ts index d02ec2933b..05567cce07 100644 --- a/packages/jsii-reflect/lib/interface.ts +++ b/packages/jsii-reflect/lib/interface.ts @@ -72,11 +72,11 @@ export class InterfaceType extends ReferenceType { return Object.fromEntries(this._getMethods(inherited, this)); } - public isDataType() { + public isDataType(): this is InterfaceType { return !!this.spec.datatype; } - public isInterfaceType() { + public isInterfaceType(): this is InterfaceType { return true; } diff --git a/scripts/align-version.js b/scripts/align-version.js index 225aad57d6..9f3db9c818 100755 --- a/scripts/align-version.js +++ b/scripts/align-version.js @@ -38,8 +38,13 @@ for (const file of process.argv.splice(2)) { } function processSection(section, file) { - for (const [ name, version ] of Object.entries(section)) { - if (version === marker || version === '^' + marker) { + for (const [name, version] of Object.entries(section)) { + if ( + version === marker || + version === '^' + marker || + // dependencies on jsii-rosetta can include many compatible versions + (name == 'jsii-rosetta' && version.includes('^' + marker)) + ) { section[name] = version.replace(marker, repoVersion); } } diff --git a/superchain/Dockerfile b/superchain/Dockerfile index 281e498606..e18324db64 100644 --- a/superchain/Dockerfile +++ b/superchain/Dockerfile @@ -239,12 +239,12 @@ ARG NODE_MAJOR_VERSION="18" COPY superchain/gpg/nodesource.asc /tmp/nodesource.asc COPY superchain/gpg/yarn.asc /tmp/yarn.asc RUN apt-key add /tmp/nodesource.asc && rm /tmp/nodesource.asc \ - && echo "deb https://deb.nodesource.com/node_${NODE_MAJOR_VERSION}.x ${DEBIAN_VERSION} main" \ - > /etc/apt/sources.list.d/nodesource.list \ - # Reduce priority of the "standard" nodejs package, so that the one from nodesource is always preferred... + && echo "deb https://deb.nodesource.com/node_${NODE_MAJOR_VERSION}.x nodistro main" \ + > /etc/apt/sources.list.d/nodesource.list \ + # Increase priority of the nodesource package && echo "Package: nodejs" > /etc/apt/preferences.d/nodejs \ - && echo 'Pin: origin "deb.debian.org"' >> /etc/apt/preferences.d/nodejs \ - && echo "Pin-Priority: 50" >> /etc/apt/preferences.d/nodejs \ + && echo 'Pin: origin deb.nodesource.com"' >> /etc/apt/preferences.d/nodejs \ + && echo "Pin-Priority: 600" >> /etc/apt/preferences.d/nodejs \ && apt-key add /tmp/yarn.asc && rm /tmp/yarn.asc \ && echo "deb https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarnpkg.list \ && apt-get update \ diff --git a/superchain/README.md b/superchain/README.md index 2a1e7db58f..f21153e9dc 100644 --- a/superchain/README.md +++ b/superchain/README.md @@ -17,15 +17,15 @@ public.ecr.aws/jsii/superchain:1-bullseye-slim ## Included Language SDKs -| SDK | Version | -| ------------ | ---------------------------------------- | -| `OpenJDK 20` | Amazon Corretto `>= 20.0.2` | -| `.NET SDK` | `>= 6.0.14` | -| `mono` | `>= 6.12.0.200` | -| `Javascript` | see [NodeJS and NPM](#nodejs-and-npm) | -| `PowerShell` | `pwsh >= 7.2.16` | -| `Python 3` | see [Python'](#python) | -| `Go` | `go >= 1.18` | +| SDK | Version | +| ------------ | ------------------------------------- | +| `OpenJDK 20` | Amazon Corretto `>= 20.0.2` | +| `.NET SDK` | `>= 6.0.14` | +| `mono` | `>= 6.12.0.200` | +| `Javascript` | see [NodeJS and NPM](#nodejs-and-npm) | +| `PowerShell` | `pwsh >= 7.2.16` | +| `Python 3` | see [Python'](#python) | +| `Go` | `go >= 1.18` | ## Image tags @@ -39,9 +39,10 @@ public.ecr.aws/jsii/superchain:-(-node)(-nightly) - `` is the base image tag, currently supported base images are - `bookworm-slim` - `bullseye-slim` -- `` is the major version of node contained in the image - - `18` corresponds to node 18.x, this is the default - - `20` corresponds to node 20.x +- `` is the major version of Node.js contained in the image + - `18` corresponds to Node.js 18.x, this is the default + - `20` corresponds to Node.js 20.x + - `22` corresponds to Node.js 22.x - `-nightly` images are released from the `HEAD` of the [`aws/jsii`][jsii] repository and should typically not be used for production workloads @@ -82,11 +83,11 @@ public.ecr.aws/jsii/superchain:1-bullseye-slim-node20 We will stop publishing images for Node versions that are EOL. -| Debian | Node versions | -| ----------------------------| -----------------| -| `bookworm-slim` | `20` | -| `bullseye-slim` | `20`, `18` | -| `buster-slim` (deprecated) | `18`, `16`, `14` | +| Debian | Node versions | +| -------------------------- | ---------------- | +| `bookworm-slim` | `20` | +| `bullseye-slim` | `20`, `18` | +| `buster-slim` (deprecated) | `18`, `16`, `14` | If you are building this image from source, you can control the Node version with the `NODE_MAJOR_VERSION` build argument: @@ -100,11 +101,11 @@ jsii$ docker build [...] --build-arg NODE_MAJOR_VERSION=16 The image includes the most recent Python version available for the respecitve Debian distribution. A complete list can be viewed on the [Debian website](https://wiki.debian.org/Python#Supported_Python_Versions). -| Debian | Python version | -| ----------------------------| ---------------| -| `bookworm-slim` | `3.11` | -| `bullseye-slim` | `3.9` | -| `buster-slim` (deprecated) | `3.7` | +| Debian | Python version | +| -------------------------- | -------------- | +| `bookworm-slim` | `3.11` | +| `bullseye-slim` | `3.9` | +| `buster-slim` (deprecated) | `3.7` | ## Included Tools & Utilities diff --git a/superchain/gpg/nodesource.asc b/superchain/gpg/nodesource.asc index 1dc1d1016b..b7637b89f6 100644 --- a/superchain/gpg/nodesource.asc +++ b/superchain/gpg/nodesource.asc @@ -1,52 +1,29 @@ -----BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1 -Comment: GPGTools - https://gpgtools.org -mQINBFObJLYBEADkFW8HMjsoYRJQ4nCYC/6Eh0yLWHWfCh+/9ZSIj4w/pOe2V6V+ -W6DHY3kK3a+2bxrax9EqKe7uxkSKf95gfns+I9+R+RJfRpb1qvljURr54y35IZgs -fMG22Np+TmM2RLgdFCZa18h0+RbH9i0b+ZrB9XPZmLb/h9ou7SowGqQ3wwOtT3Vy -qmif0A2GCcjFTqWW6TXaY8eZJ9BCEqW3k/0Cjw7K/mSy/utxYiUIvZNKgaG/P8U7 -89QyvxeRxAf93YFAVzMXhoKxu12IuH4VnSwAfb8gQyxKRyiGOUwk0YoBPpqRnMmD -Dl7SdmY3oQHEJzBelTMjTM8AjbB9mWoPBX5G8t4u47/FZ6PgdfmRg9hsKXhkLJc7 -C1btblOHNgDx19fzASWX+xOjZiKpP6MkEEzq1bilUFul6RDtxkTWsTa5TGixgCB/ -G2fK8I9JL/yQhDc6OGY9mjPOxMb5PgUlT8ox3v8wt25erWj9z30QoEBwfSg4tzLc -Jq6N/iepQemNfo6Is+TG+JzI6vhXjlsBm/Xmz0ZiFPPObAH/vGCY5I6886vXQ7ft -qWHYHT8jz/R4tigMGC+tvZ/kcmYBsLCCI5uSEP6JJRQQhHrCvOX0UaytItfsQfLm -EYRd2F72o1yGh3yvWWfDIBXRmaBuIGXGpajC0JyBGSOWb9UxMNZY/2LJEwARAQAB -tB9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WGhT8u +JeFoTTHn5SQq5Ftyu4K3K2fbbpuu/APQF05AaljzVkDGNMW4pSkgOasdysj831cu +ssrHX2RYS22wg80k6C/Hwmh5F45faEuNxsV+bPx7oPUrt5n6GMx84vEP3i1+FDBi +0pt/B/QnDFBXki1BGvJ35f5NwDefK8VaInxXP3ZN/WIbtn5dqxppkV/YkO7GiJlp +Jlju9rf3kKUIQzKQWxFsbCAPIHoWv7rH9RSxgDithXtG6Yg5R1aeBbJaPNXL9wpJ +YBJbiMjkAFaz4B95FOqZm3r7oHugiCGsHX0AEQEAAYkBHwQYAQIACQUCV0M3UAIb +DAAKCRAvWbX5mxvgtE/OB/0VN88DR3Y3fuqy7lq/dthkn7Dqm9YXdorZl3L152eE +IF882aG8FE3qZdaLGjQO4oShAyNWmRfSGuoH0XERXAI9n0r8m4mDMxE6rtP7tHet +y/5M8x3CTyuMgx5GLDaEUvBusnTD+/v/fBMwRK/cZ9du5PSG4R50rtst+oYyC2ao +x4I2SgjtF/cY7bECsZDplzatN3gv34PkcdIg8SLHAVlL4N5tzumDeizRspcSyoy2 +K2+hwKU4C4+dekLLTg8rjnRROvplV2KtaEk6rxKtIRFDCoQng8wfJuIMrDNKvqZw +FRGt7cbvW5MCnuH8MhItOl9Uxp1wHp6gtav/h8Gp6MBa +=MARt -----END PGP PUBLIC KEY BLOCK----- diff --git a/yarn.lock b/yarn.lock index 210344317a..08650fb0ac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8573,9 +8573,9 @@ tar@6.1.11: yallist "^4.0.0" tar@^6.1.0, tar@^6.1.11, tar@^6.1.2, tar@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.0.tgz#b14ce49a79cb1cd23bc9b016302dea5474493f73" - integrity sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ== + version "6.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a" + integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0"