1
1
# Contributing to jsii
2
+
2
3
Thanks for your interest in contributing to AWS JSII! :heart :
3
4
4
5
This document describes how to set up a development environment and submit your
5
6
contributions. Please read it carefully and let us know if it's not up-to date
6
7
(or even better, submit a pull request with your corrections! :wink : ).
7
8
8
9
## Pre-requisites
10
+
9
11
### Setup Docker image
12
+
10
13
Due to the polyglot nature of ` jsii ` , the toolchain requirements are somewhat
11
14
more complicated than for most projects. In order to locally develop ` jsii ` , you
12
15
will need a number of tools.
@@ -19,37 +22,38 @@ our own CI/CD: the ["superchain" image][superchain] from.
19
22
The image can be built for local usage, too:
20
23
21
24
``` console
22
- $ IMAGE=superchain
23
- $ docker build -t ${IMAGE} -f superchain/Dockerfile .
25
+ IMAGE=superchain
26
+ docker build -t ${IMAGE} -f superchain/Dockerfile .
24
27
```
25
28
26
29
In order to get an interactive shell within a Docker container using the
27
30
* superchain* image you just built:
28
31
29
32
``` 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}
32
35
```
33
36
34
37
In the shell that pops up, the ` npm run ` commands in the following sections must
35
38
be executed.
36
39
37
40
### Alternative: Manually install the toolchain
41
+
38
42
The following tools need to be installed to develop on JSII locally. We recommend
39
43
using the docker image from the above section, but if you wish to, you can install
40
44
in your development environment.
41
45
42
46
- [ Node ` 18.0.0 ` ] or later
43
47
- [ Yarn ` 1.19.1 ` ] or later
44
48
- 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 )
46
50
- [ .NET ` 6.0 ` ] or later
47
- + * Recommended:* [ ` mono >= 6 ` ] ( https://www.mono-project.com )
51
+ - * Recommended:* [ ` mono >= 6 ` ] ( https://www.mono-project.com )
48
52
- [ 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/ )
53
57
- [ Go] ` 1.18 ` or newer
54
58
55
59
[ Node `18.0.0` ] : https://nodejs.org/download/release/latest-v18.x/
@@ -61,6 +65,7 @@ in your development environment.
61
65
[ Go ] : https://go.dev/dl/
62
66
63
67
## Getting Started
68
+
64
69
### Bootstrapping
65
70
66
71
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
98
103
the compiler (note that the [ aws/jsii-compiler] ( github.com/aws/jsii-compiler )
99
104
repository as a separate copy of these under the ` fixtures ` directory), as well
100
105
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
102
107
the same behaviors in all languages, and which should contain tests related to
103
108
behavior that isn't strictly specific to the given language.
104
109
@@ -138,8 +143,8 @@ better:
138
143
to wait for a debugger to attach before proceeding. This is useful to attach
139
144
Node dev tools to the runtime as it starts in order to use its debugger.
140
145
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
143
148
` JSII_RUNTIME ` setting to run arbitrary jsii programs, automatically attaching
144
149
the VSCode debugger at startup. These terminals inject a specially crafted
145
150
` 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
205
210
206
211
The jsii runtime client library usually includes the following components:
207
212
208
- - Child process manager: responsible to start/stop the ** @jsii/runtime ** child
213
+ - Child process manager: responsible to start/stop the __ @jsii/runtime __ child
209
214
process.
210
215
- Protocol layer: implements the STDIN/STDOUT protocol that interacts with the
211
- ** @jsii/runtime ** .
216
+ __ @jsii/runtime __ .
212
217
- Proxy layer: includes base classes and serialization utilities to implement
213
218
the generated proxy classes.
214
219
@@ -244,8 +249,8 @@ on [ECR Public Gallery](https://gallery.ecr.aws/jsii/superchain)
244
249
## Support for new Node Major versions
245
250
246
251
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 .
249
254
250
255
> Note that ` jsii ` will execute on every node version, so "adding support" here only means supressing or showing
251
256
> 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
258
263
### Useful Resources
259
264
260
265
- [ 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 )
0 commit comments