Skip to content

Commit e852934

Browse files
authored
2 parents 0a2adcb + 3fc147d commit e852934

File tree

746 files changed

+2688
-42782
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

746 files changed

+2688
-42782
lines changed

.devcontainer.json

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
{
2-
"name": "Dev Container - aws/jsii",
3-
"build": {
4-
"dockerfile": "superchain/Dockerfile",
5-
"context": ".",
6-
"target": "superchain",
7-
"args": {
8-
"BUILD_TIMESTAMP": "unknown",
9-
"COMMIT_ID": "HEAD",
10-
"REGISTRY": "docker.io/library",
11-
},
12-
},
13-
"containerUser": "superchain",
14-
"remoteUser": "superchain",
15-
"postCreateCommand": "yarn install && yarn build",
16-
"extensions": [
17-
18-
],
2+
"name": "Dev Container - aws/jsii",
3+
"image": "public.ecr.aws/jsii/superchain:1-bookworm-slim",
4+
"containerUser": "superchain",
5+
"remoteUser": "superchain",
6+
"postCreateCommand": "yarn install",
7+
"customizations": {
8+
"vscode": {
9+
"extensions": ["dbaeumer.vscode-eslint", "Orta.vscode-jest"]
10+
}
11+
}
1912
}

.github/workflows/docker-images.yml

Lines changed: 0 additions & 287 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 23 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
# Workflows pertaining to the main branch
22
name: Main
3-
43
on:
54
merge_group: {}
65
pull_request:
76
branches: [main, release]
87
push:
98
branches: [main, release]
10-
119
env:
1210
DOTNET_NOLOGO: true
1311
NODE_OPTIONS: --max-old-space-size=4096
14-
1512
# This workflows currently has the following jobs:
1613
# - build : Builds the source tree as-is
1714
# - test : Runs all unit tests against the build result
1815
# - create-release-package : Prepares a release package with the "real" version
1916
# - integ-test : Runs integration tests against the release package
20-
2117
jobs:
2218
build:
2319
name: Build
@@ -101,7 +97,6 @@ jobs:
10197
&& echo "Untracked files: ${untracked:-<none>}" \
10298
&& test -z "${untracked}"
10399
shell: bash
104-
105100
create-release-package:
106101
name: Create Release Package
107102
permissions:
@@ -182,7 +177,6 @@ jobs:
182177
with:
183178
name: release-package
184179
path: ${{ github.workspace }}/dist/
185-
186180
test:
187181
permissions:
188182
contents: none
@@ -291,9 +285,7 @@ jobs:
291285
java: '8'
292286
node: '18'
293287
os: ubuntu-latest
294-
295288
runs-on: ${{ matrix.os }}
296-
297289
steps:
298290
# Check out the code
299291
- name: Download Artifact
@@ -366,80 +358,30 @@ jobs:
366358
&& echo "Untracked files: ${untracked:-<none>}" \
367359
&& test -z "${untracked}"
368360
shell: bash
369-
370361
test-ok:
371362
name: Unit Tests
372363
runs-on: ubuntu-latest
373-
needs: test
374-
steps:
375-
- name: OK
376-
# This is just a join target to simplify branch protection setup
377-
run: echo OK
378-
379-
benchmark:
380-
name: Run benchmark suite
381-
runs-on: ubuntu-latest
382-
permissions:
383-
contents: read
384-
pull-requests: write
385-
needs: build
364+
needs:
365+
- test
366+
if: always()
386367
steps:
387-
# Check out the code
388-
- name: Download Artifact
389-
uses: actions/download-artifact@v3
390-
with:
391-
name: built-tree
392-
- name: Extract Artifact
393-
run: |-
394-
echo "::group::Untar Archive"
395-
tar zxvf built-tree.tgz
396-
echo "::endgroup"
397-
398-
rm built-tree.tgz
399-
- name: Set up Node
400-
uses: actions/setup-node@v4
401-
with:
402-
cache: yarn
403-
node-version: 'lts/*'
404-
- name: Install Dependencies
405-
run: yarn install --frozen-lockfile
406-
- name: Run Benchmark
407-
working-directory: packages/@jsii/benchmarks
408-
run: yarn bench --output ${{ runner.temp }}/bench-output.json
409-
- name: Compare Benchmark Results
410-
if: github.event_name == 'pull_request'
411-
uses: benchmark-action/github-action-benchmark@v1
412-
with:
413-
name: jsii Benchmark Regression
414-
tool: 'customSmallerIsBetter'
415-
output-file-path: ${{ runner.temp }}/bench-output.json
416-
comment-always: true
417-
github-token: ${{ secrets.GITHUB_TOKEN }}
418-
fail-on-alert: true
419-
- name: Upload Benchmark Results
420-
if: github.event_name == 'push'
421-
uses: benchmark-action/github-action-benchmark@v1
422-
with:
423-
name: jsii Benchmark
424-
tool: 'customSmallerIsBetter'
425-
output-file-path: ${{ runner.temp }}/bench-output.json
426-
github-token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
427-
auto-push: true
428-
368+
- name: Build result
369+
run: echo ${{ needs.test.result }}
370+
- if: ${{ needs.test.result != 'success' }}
371+
name: Set status based on matrix build
372+
run: exit 1
429373
pacmak-integration-test:
430374
runs-on: ubuntu-latest
431375
needs: create-release-package
432376
strategy:
433377
fail-fast: false
434378
matrix:
435379
rosetta:
436-
# this will be the 1.x-dev version build in this repo
437-
- ./jsii-rosetta.tgz
438-
- 5.2.x
439-
- 5.3.x
380+
- latest
440381
- 5.4.x
441382
- 5.5.x
442383
- 5.6.x
384+
- 5.7.x
443385
steps:
444386
# Check out the code
445387
- name: Download Artifact
@@ -473,15 +415,11 @@ jobs:
473415
run: sudo apt install -y python3-venv
474416
# Show time!
475417
- name: Prepare Work Tree
476-
# 1) Move the locally build version of jsii-rosetta somewhere else
477-
# 2) Remove @jsii/integ-test because it messed up version dependencies and is not needed
478-
# 3) Install aws-cdk-lib, and all locally build packages minus jsii-rosetta & @jsii/integ-test,
479-
# and the specific version of jsii-rosetta
480-
# This ensures we are running jsii-pacmak with the correct peer-dependency
481-
# 4) Print the jsii-rosetta version for confirmation
418+
# 1) Install aws-cdk-lib,
419+
# all locally build packages,
420+
# the specific version of jsii-rosetta.
421+
# 2) Print the jsii-rosetta version for confirmation
482422
run: |-
483-
mv ${{ runner.temp }}/release-package/js/jsii-rosetta.tgz ./jsii-rosetta.tgz
484-
rm ${{ runner.temp }}/release-package/private/@jsii-integ-test.tgz
485423
npm install --no-save --omit=dev \
486424
aws-cdk-lib@2 \
487425
constructs@10 \
@@ -498,17 +436,20 @@ jobs:
498436
./node_modules/.bin/jsii-pacmak --no-parallel ./node_modules/aws-cdk-lib
499437
# Upload artifact only on main and for latest rosetta
500438
- name: 'Upload Artifact: integtest_aws-cdk-lib'
501-
if: github.ref == 'ref/head/main' && matrix.rosetta == '5.4.x'
439+
if: github.ref == 'ref/head/main' && matrix.rosetta == 'latest'
502440
uses: actions/upload-artifact@v4
503441
with:
504442
name: integtest_aws-cdk-lib
505443
path: ./node_modules/aws-cdk-lib/dist/
506-
507444
pacmak-integration-test-ok:
508445
name: Integration test (jsii-pacmak)
509446
runs-on: ubuntu-latest
510-
needs: pacmak-integration-test
447+
needs:
448+
- pacmak-integration-test
449+
if: always()
511450
steps:
512-
- name: OK
513-
# This is just a join target to simplify branch protection setup
514-
run: echo OK
451+
- name: Build result
452+
run: echo ${{ needs.pacmak-integration-test.result }}
453+
- if: ${{ needs.pacmak-integration-test.result != 'success' }}
454+
name: Set status based on matrix build
455+
run: exit 1

.github/workflows/yarn-upgrade.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ jobs:
8282
# Upgrade all production dependencies (and other always major-pinned dependencies)
8383
lerna exec --parallel ncu -- --upgrade --target=minor \
8484
--filter='@types/diff,@types/fs-extra,${{ steps.production-dependencies.outputs.list }}' \
85-
--reject='typescript,@xmldom/xmldom,${{ steps.monorepo-packages.outputs.list }}'
85+
--reject='typescript,@xmldom/xmldom,jsii,jsii-rosetta,${{ steps.monorepo-packages.outputs.list }}'
8686
8787
# Upgrade all minor-pinned dependencies
8888
lerna exec --parallel ncu -- --upgrade --target=patch \
8989
--filter=typescript,@xmldom/xmldom
9090
9191
# Upgrade all other dependencies (devDependencies) to the latest
9292
lerna exec --parallel ncu -- --upgrade --target=latest \
93-
--reject='@types/diff,@types/inquirer,@types/node,@types/fs-extra,@types/yargs,@xmldom/xmldom,glob,typescript,typescript-json-schema,${{ steps.production-dependencies.outputs.list }},${{ steps.monorepo-packages.outputs.list }}'
93+
--reject='@types/diff,@types/inquirer,@types/node,@types/fs-extra,@types/yargs,@xmldom/xmldom,glob,typescript,typescript-json-schema,${{ steps.production-dependencies.outputs.list }},jsii,jsii-rosetta,${{ steps.monorepo-packages.outputs.list }}'
9494
9595
# This will ensure the current lockfile is up-to-date with the dependency specifications (necessary for "yarn update" to run)
9696
- name: Run "yarn install"

.mergify/config.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
queue_rules:
33
- name: default-squash
44
conditions:
5-
- status-success~=^jsii/superchain
65
- status-success=Unit Tests
6+
- status-success=Integration test (jsii-pacmak)
77
commit_message_template: |-
88
{{ title }} (#{{ number }})
99
@@ -12,8 +12,8 @@ queue_rules:
1212

1313
- name: default-merge
1414
conditions:
15-
- status-success~=^jsii/superchain
1615
- status-success=Unit Tests
16+
- status-success=Integration test (jsii-pacmak)
1717
commit_message_template: |-
1818
{{ title }} (#{{ number }})
1919
@@ -47,9 +47,8 @@ pull_request_rules:
4747
- '#review-requested=0'
4848
- '#changes-requested-reviews-by=0'
4949
- status-success=Validate PR Title
50-
# Docker image validation
51-
- status-success~=^Done$
5250
- status-success=Unit Tests
51+
- status-success=Integration test (jsii-pacmak)
5352

5453
- name: Synchronize that PR to upstream and merge it (squash)
5554
actions:
@@ -73,9 +72,8 @@ pull_request_rules:
7372
- '#review-requested=0'
7473
- '#changes-requested-reviews-by=0'
7574
- status-success=Validate PR Title
76-
# Docker image validation
77-
- status-success~=^jsii/superchain
7875
- status-success=Unit Tests
76+
- status-success=Integration test (jsii-pacmak)
7977

8078
- name: Synchronize that PR to upstream and merge it (no-squash)
8179
actions:
@@ -99,9 +97,8 @@ pull_request_rules:
9997
- '#review-requested=0'
10098
- '#changes-requested-reviews-by=0'
10199
- status-success=Validate PR Title
102-
# Docker image validation
103-
- status-success~=^jsii/superchain
104100
- status-success=Unit Tests
101+
- status-success=Integration test (jsii-pacmak)
105102

106103
- name: Clean branch up
107104
actions:

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
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.
44

5+
## [1.106.0](https://github.com/aws/jsii/compare/v1.105.0...v1.106.0) (2024-12-16)
6+
7+
8+
### Features
9+
10+
* **pacmak:** support jsii-rosetta 5.7 ([#4718](https://github.com/aws/jsii/issues/4718)) ([c4f52a7](https://github.com/aws/jsii/commit/c4f52a7fbde25e124b64afea4a1884c6f1f0ded2))
11+
512
## [1.105.0](https://github.com/aws/jsii/compare/v1.104.0...v1.105.0) (2024-11-14)
613

714

CONTRIBUTING.md

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,9 @@ will need a number of tools.
1717
We have built a Docker image with all the required tools, which we are using for
1818
our own CI/CD: the ["superchain" image][superchain] from.
1919

20-
[superchain]: https://github.com/aws/jsii/blob/main/superchain/Dockerfile
20+
[superchain]: https://github.com/aws/jsii-superchain
2121

22-
The image can be built for local usage, too:
23-
24-
```console
25-
IMAGE=superchain
26-
docker build -t ${IMAGE} -f superchain/Dockerfile .
27-
```
28-
29-
In order to get an interactive shell within a Docker container using the
30-
*superchain* image you just built:
31-
32-
```console
33-
cd jsii # go to the root of the jsii repo
34-
docker run --rm --net=host -it -v $PWD:$PWD -w $PWD ${IMAGE}
35-
```
36-
37-
In the shell that pops up, the `npm run` commands in the following sections must
38-
be executed.
22+
Please see the superchain repo for usage instructions.
3923

4024
### Alternative: Manually install the toolchain
4125

@@ -99,7 +83,7 @@ Each one of these scripts can be executed either from the root of the repo using
9983
Troubleshooting bugs usually starts with adding a new test that demonstrates the
10084
faulty behavior, then modifying implementations until the test passes.
10185

102-
The `jsii-calc` and `@scope/*` packages are used to test expected brhavior from
86+
The `jsii-calc` and `@scope/*` packages are used to test expected behavior from
10387
the compiler (note that the [aws/jsii-compiler](github.com/aws/jsii-compiler)
10488
repository as a separate copy of these under the `fixtures` directory), as well
10589
as downstream tooling (`jsii-pacmak`, `jsii-rosetta`, etc...). Each language
@@ -265,14 +249,25 @@ whether or not it is supported and tested, and produces appropriate warnings in
265249
- [https://endoflife.date/nodejs](https://endoflife.date/nodejs)
266250
- [Adding support for node 22 PR](https://github.com/aws/jsii/pull/4489)
267251

268-
## Support for new `jsii-rosetta` versions
252+
## Support for new `jsii` & `jsii-rosetta` versions
269253

270254
When a new minor version of `jsii-rosetta` (modern) is released, we need to update the `jsii-pacmak` package.
271255
`jsii-pacmak` uses `jsii-rosetta` to transpile examples in documentation.
272256
Because every package can use its own version of jsii, TypeScript and jsii-rosetta, it is declared as a peer dependency.
273257
To ensure compatibility, we also have integration tests.
274258

275-
### Adding a new `jsii-rosetta` version
259+
### Adding a new `jsii` & `jsii-rosetta` version
276260

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)
261+
Run the following command. It takes care of the required changes.
262+
The script needs `jq` and `yq` installed to run.
263+
264+
```console
265+
yarn upgrade:jsii
266+
```
267+
268+
Then you need to run the build and update snapshots locally:
269+
270+
```console
271+
yarn build
272+
yarn test:update
273+
```

0 commit comments

Comments
 (0)