Skip to content

Commit 115b7c0

Browse files
authored
Add support for nodejs 20 (#124)
* Add support for nodejs 20 * Update python deps
1 parent 98fd852 commit 115b7c0

File tree

12 files changed

+5082
-2993
lines changed

12 files changed

+5082
-2993
lines changed

.github/workflows/cd.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v3
1616
- uses: actions/setup-node@v3
1717
with:
18-
node-version: 12
18+
node-version: 20
1919
registry-url: https://registry.npmjs.org/
2020
- name: Get Version from Git Tag
2121
id: tag_name
@@ -38,7 +38,7 @@ jobs:
3838
runs-on: ubuntu-latest
3939
strategy:
4040
matrix:
41-
python: [3.6]
41+
python: [3.8]
4242
steps:
4343
- uses: actions/checkout@v3
4444
- name: Setup Python ${{ matrix.python }}
@@ -65,10 +65,10 @@ jobs:
6565
uses: actions/download-artifact@v3
6666
with:
6767
name: package-npm
68-
- name: Download Python 3.6 Artifacts
68+
- name: Download Python 3.8 Artifacts
6969
uses: actions/download-artifact@v3
7070
with:
71-
name: dist-py3.6
71+
name: dist-py3.8
7272
path: dist/
7373
- name: List Artifacts
7474
run: |

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
strategy:
1717
matrix:
1818
os: [ ubuntu-latest, macos-latest ]
19-
python: [ 3.8, 3.9 ]
20-
node: [ 18 ]
19+
python: [ "3.8", "3.9", "3.10", "3.11"]
20+
node: [ 20 ]
2121
env:
2222
SAM_CLI_TELEMETRY: "0"
2323
AWS_REGION: "us-east-1"

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repos:
2424
- --indent=4
2525
- --no-sort-keys
2626
- id: check-merge-conflict
27-
- id: check-yaml
27+
# - id: check-yaml # have jinja yml templates so skipping this
2828
- repo: https://github.com/pycqa/flake8
2929
rev: "5.0.4"
3030
hooks:

Pipfile.lock

Lines changed: 701 additions & 483 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 4328 additions & 2493 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"test:debug": "npx --node-arg=--inspect jest --runInBand"
2323
},
2424
"engines": {
25-
"node": ">=14.0.0",
25+
"node": ">=20.0.0",
2626
"npm": ">=6.9.0"
2727
},
2828
"repository": {

python/rpdk/typescript/codegen.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def validate_no(value):
3737
class TypescriptLanguagePlugin(LanguagePlugin):
3838
MODULE_NAME = __name__
3939
NAME = "typescript"
40-
RUNTIME = "nodejs18.x"
40+
RUNTIME = "nodejs20.x"
4141
ENTRY_POINT = "dist/handlers.entrypoint"
4242
TEST_ENTRY_POINT = "dist/handlers.testEntrypoint"
4343
CODE_URI = "./"
@@ -156,20 +156,25 @@ def _copy_resource(path, resource_name=None):
156156
lib_name=SUPPORT_LIB_NAME,
157157
)
158158

159+
_render_template(
160+
project.root / "Makefile",
161+
)
162+
159163
# CloudFormation/SAM template for handler lambda
160164
handler_params = {
161165
"Handler": project.entrypoint,
162166
"Runtime": project.runtime,
163167
"CodeUri": self.CODE_URI,
164168
}
165-
handler_function = {
166-
"TestEntrypoint": {**handler_params, "Handler": project.test_entrypoint},
169+
test_handler_params = {
170+
**handler_params,
171+
"Handler": project.test_entrypoint,
167172
}
168-
handler_function[MAIN_HANDLER_FUNCTION] = handler_params
169173
_render_template(
170174
project.root / "template.yml",
171175
resource_type=project.type_name,
172-
functions=handler_function,
176+
handler_params=handler_params,
177+
test_handler_params=test_handler_params,
173178
)
174179

175180
LOG.debug("Init complete")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build-TypeFunction:
2+
npx npm ci
3+
npx npm run build

python/rpdk/typescript/templates/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"class-transformer": "0.3.1"
1818
},
1919
"devDependencies": {
20-
"@types/node": "^14.0.0",
20+
"@types/node": "^20.0.0",
2121
"typescript": "^4.1.2"
2222
},
2323
"optionalDependencies": {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
AWSTemplateFormatVersion: "2010-09-09"
2+
Transform: AWS::Serverless-2016-10-31
3+
Description: AWS SAM template for the {{ resource_type }} resource type
4+
5+
Globals:
6+
Function:
7+
Timeout: 180 # docker start-up times can be long for SAM CLI
8+
MemorySize: 256
9+
10+
Resources:
11+
TestEntrypoint:
12+
Type: AWS::Serverless::Function
13+
Properties:
14+
{% for key, value in test_handler_params.items() %}
15+
{{ key }}: {{ value }}
16+
{% endfor %}
17+
18+
TypeFunction:
19+
Type: AWS::Serverless::Function
20+
Properties:
21+
{% for key, value in handler_params.items() %}
22+
{{ key }}: {{ value }}
23+
{% endfor %}
24+
Metadata:
25+
BuildMethod: makefile

0 commit comments

Comments
 (0)