Skip to content

Commit 9ecea56

Browse files
authored
fix(pacmak): support jsii-rosetta 5.5 (#4619)
Declare support in peerDependencies and add integration test. Updated some docs while I'm at it. --- 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
1 parent 84e1fa0 commit 9ecea56

File tree

6 files changed

+41
-29
lines changed

6 files changed

+41
-29
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ jobs:
438438
- 5.2.x
439439
- 5.3.x
440440
- 5.4.x
441+
- 5.5.x
441442
steps:
442443
# Check out the code
443444
- name: Download Artifact

CONTRIBUTING.md

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Contributing to jsii
2+
23
Thanks for your interest in contributing to AWS JSII! :heart:
34

45
This document describes how to set up a development environment and submit your
56
contributions. Please read it carefully and let us know if it's not up-to date
67
(or even better, submit a pull request with your corrections! :wink:).
78

89
## Pre-requisites
10+
911
### Setup Docker image
12+
1013
Due to the polyglot nature of `jsii`, the toolchain requirements are somewhat
1114
more complicated than for most projects. In order to locally develop `jsii`, you
1215
will need a number of tools.
@@ -19,37 +22,38 @@ our own CI/CD: the ["superchain" image][superchain] from.
1922
The image can be built for local usage, too:
2023

2124
```console
22-
$ IMAGE=superchain
23-
$ docker build -t ${IMAGE} -f superchain/Dockerfile .
25+
IMAGE=superchain
26+
docker build -t ${IMAGE} -f superchain/Dockerfile .
2427
```
2528

2629
In order to get an interactive shell within a Docker container using the
2730
*superchain* image you just built:
2831

2932
```console
30-
$ cd jsii # go to the root of the jsii repo
31-
$ docker run --rm --net=host -it -v $PWD:$PWD -w $PWD ${IMAGE}
33+
cd jsii # go to the root of the jsii repo
34+
docker run --rm --net=host -it -v $PWD:$PWD -w $PWD ${IMAGE}
3235
```
3336

3437
In the shell that pops up, the `npm run` commands in the following sections must
3538
be executed.
3639

3740
### Alternative: Manually install the toolchain
41+
3842
The following tools need to be installed to develop on JSII locally. We recommend
3943
using the docker image from the above section, but if you wish to, you can install
4044
in your development environment.
4145

4246
- [Node `18.0.0`] or later
4347
- [Yarn `1.19.1`] or later
4448
- An OpenJDK-8 distribution (e.g: [Oracle's OpenJDK8], [Amazon Corretto 8])
45-
+ [`maven >= 3.0.5`](https://maven.apache.org)
49+
- [`maven >= 3.0.5`](https://maven.apache.org)
4650
- [.NET `6.0`] or later
47-
+ *Recommended:* [`mono >= 6`](https://www.mono-project.com)
51+
- *Recommended:* [`mono >= 6`](https://www.mono-project.com)
4852
- [Python `3.8.10`] or later
49-
+ [`pip`](https://pip.pypa.io/en/stable/installing/)
50-
+ [`setuptools >= 38.6.0`](https://pypi.org/project/setuptools/)
51-
+ [`wheel`](https://pypi.org/project/wheel/)
52-
+ *Recommended:* [`twine`](https://pypi.org/project/twine/)
53+
- [`pip`](https://pip.pypa.io/en/stable/installing/)
54+
- [`setuptools >= 38.6.0`](https://pypi.org/project/setuptools/)
55+
- [`wheel`](https://pypi.org/project/wheel/)
56+
- *Recommended:* [`twine`](https://pypi.org/project/twine/)
5357
- [Go] `1.18` or newer
5458

5559
[Node `18.0.0`]: https://nodejs.org/download/release/latest-v18.x/
@@ -61,6 +65,7 @@ in your development environment.
6165
[Go]: https://go.dev/dl/
6266

6367
## Getting Started
68+
6469
### Bootstrapping
6570

6671
The project is managed as a [monorepo] using [lerna].
@@ -98,7 +103,7 @@ The `jsii-calc` and `@scope/*` packages are used to test expected brhavior from
98103
the compiler (note that the [aws/jsii-compiler](github.com/aws/jsii-compiler)
99104
repository as a separate copy of these under the `fixtures` directory), as well
100105
as downstream tooling (`jsii-pacmak`, `jsii-rosetta`, etc...). Each language
101-
runtime has its own test suite, within which is a _compliance_ suite that tests
106+
runtime has its own test suite, within which is a *compliance* suite that tests
102107
the same behaviors in all languages, and which should contain tests related to
103108
behavior that isn't strictly specific to the given language.
104109

@@ -138,8 +143,8 @@ better:
138143
to wait for a debugger to attach before proceeding. This is useful to attach
139144
Node dev tools to the runtime as it starts in order to use its debugger.
140145

141-
The [Visual Studio Code](https://code.visualstudio.com) _JavaScript Debug
142-
Terminal_ feature can be particularly useful paired with appropriate
146+
The [Visual Studio Code](https://code.visualstudio.com) *JavaScript Debug
147+
Terminal* feature can be particularly useful paired with appropriate
143148
`JSII_RUNTIME` setting to run arbitrary jsii programs, automatically attaching
144149
the VSCode debugger at startup. These terminals inject a specially crafted
145150
`NODE_OPTIONS` variable that allows the VSCode debugger to consistently attach
@@ -205,10 +210,10 @@ The runtime client library should be implemented as a module under
205210

206211
The jsii runtime client library usually includes the following components:
207212

208-
- Child process manager: responsible to start/stop the **@jsii/runtime** child
213+
- Child process manager: responsible to start/stop the __@jsii/runtime__ child
209214
process.
210215
- Protocol layer: implements the STDIN/STDOUT protocol that interacts with the
211-
**@jsii/runtime**.
216+
__@jsii/runtime__.
212217
- Proxy layer: includes base classes and serialization utilities to implement
213218
the generated proxy classes.
214219

@@ -244,8 +249,8 @@ on [ECR Public Gallery](https://gallery.ecr.aws/jsii/superchain)
244249
## Support for new Node Major versions
245250

246251
When a new major version of node is released, we need to update the `@jsii/check-node` package.
247-
This package is responsible for identifiying which node version is being used by the current process,
248-
whether or not it is supported and tested, and produces appropriate warnings in case it isnt.
252+
This package is responsible for identifying which node version is being used by the current process,
253+
whether or not it is supported and tested, and produces appropriate warnings in case it isn't.
249254

250255
> Note that `jsii` will execute on every node version, so "adding support" here only means supressing or showing
251256
> warnings that inform the user on the level of support it has.
@@ -258,4 +263,16 @@ whether or not it is supported and tested, and produces appropriate warnings in
258263
### Useful Resources
259264

260265
- [https://endoflife.date/nodejs](https://endoflife.date/nodejs)
261-
- [Adding support for node 22 PR](https://github.com/aws/jsii/pull/4489)
266+
- [Adding support for node 22 PR](https://github.com/aws/jsii/pull/4489)
267+
268+
## Support for new `jsii-rosetta` versions
269+
270+
When a new minor version of `jsii-rosetta` (modern) is released, we need to update the `jsii-pacmak` package.
271+
`jsii-pacmak` uses `jsii-rosetta` to transpile examples in documentation.
272+
Because every package can use its own version of jsii, TypeScript and jsii-rosetta, it is declared as a peer dependency.
273+
To ensure compatibility, we also have integration tests.
274+
275+
### Adding a new `jsii-rosetta` version
276+
277+
1. Add the new version to the `jsii-rosetta` peer dependency in [package.json](./packages/jsii-pacmak/package.json)
278+
2. Add the new version to the `pacmak-integration-test` matrix in the main build workflow in [main.yml](.github/workflows/main.yml)

gh-pages/content/overview/toolchain.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
| [jsii-rosetta1] | `1.x` | [Maintenance] | Transpile code snippets (in docs) from TypeScript to jsii languages |
1616
| [jsii-rosetta] | `5.x` | GA | Transpile code snippets (in docs) from TypeScript to jsii languages |
1717
| [jsii-config] | `1.x` | Experimental | Interactive tool for generating jsii configuration |
18-
| [jsii-release] | `1.x` | Community | Publishes jsii modules to all supported package managers |
1918
| [jsii-srcmak] | `1.x` | Community | Generates relocatable source code in jsii languages from typescript |
2019
| [jsii-docgen] | *any* | Community | Generates markdown API documentation for jsii modules |
2120

@@ -41,6 +40,5 @@
4140
[jsii-diff]: https://github.com/aws/jsii/tree/main/packages/jsii-diff
4241
[jsii-rosetta1]: https://github.com/aws/jsii/tree/main/packages/jsii-rosetta
4342
[jsii-rosetta]: https://github.com/aws/jsii-rosetta#readme
44-
[jsii-release]: https://github.com/eladb/jsii-release
45-
[jsii-srcmak]: https://github.com/eladb/jsii-srcmak
46-
[jsii-docgen]: https://github.com/eladb/jsii-docgen
43+
[jsii-srcmak]: https://github.com/cdklabs/jsii-srcmak
44+
[jsii-docgen]: https://github.com/cdklabs/jsii-docgen

gh-pages/content/user-guides/language-support/index.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ possible to publish artifacts even when tests in the suite are failing. As soon
103103
contribute to this process by documenting a general architecture that should be implementable in any programming
104104
languages (and thus, abstracting away language specificities).
105105

106-
## Building & Packaging
106+
## Building and Packaging
107107

108108
The necessary toolchains should be added to he [`public.ecr.aws/jsii/superchain`] Docker image, so that the
109109
[`jsii-pacmak`] generation can be changed to support building ready to publish artifacts instead of just code.
@@ -115,10 +115,6 @@ PyPI, and **NuGet** packages were published with a pre-release version such as `
115115
Additionally, [`aws-delivlib`] needs to be augmented to support publishing artifacts to the language's package
116116
repository.
117117

118-
!!! bug "Unimplemented"
119-
The package publishing is being extracted from [`aws-delivlib`] into a standalone library, currently hosted at
120-
[`eladb/jsii-release`](https://github.com/eladb/jsii-release).
121-
122118
## Documentation
123119

124120
Before releasing the new language support to _Developer Preview_, basic documentation needs to be produced to explain

packages/@jsii/go-runtime/build-tools/package.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ rm -fr dist
77
mkdir -p dist/go
88
rsync -av jsii-runtime-go/* dist/go/
99

10-
# create a "version" file which is needed by jsii-release
10+
# create a "version" file which is needed by publib
1111
version=$(node -p "require('./package.json').version")
1212
echo ${version} > dist/go/version

packages/jsii-pacmak/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"pyright": "^1.1.376"
6969
},
7070
"peerDependencies": {
71-
"jsii-rosetta": "^0.0.0 || ~5.2.0 || ~5.3.0 || ~5.4.0"
71+
"jsii-rosetta": "^0.0.0 || ~5.2.0 || ~5.3.0 || ~5.4.0 || ~5.5.0"
7272
},
7373
"keywords": [
7474
"jsii",

0 commit comments

Comments
 (0)