From bd87727d414ca8468a3aa7520a84554aada64375 Mon Sep 17 00:00:00 2001 From: Heather Nelson Date: Thu, 15 Aug 2024 11:49:59 -0400 Subject: [PATCH 1/6] bugfix: missing classtransformer upgrade and proper model types --- python/rpdk/typescript/__init__.py | 2 +- python/rpdk/typescript/codegen.py | 2 +- python/rpdk/typescript/templates/models.ts | 6 +++--- python/rpdk/typescript/templates/package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/python/rpdk/typescript/__init__.py b/python/rpdk/typescript/__init__.py index affdd60..e54d992 100644 --- a/python/rpdk/typescript/__init__.py +++ b/python/rpdk/typescript/__init__.py @@ -1,5 +1,5 @@ import logging -__version__ = "1.0.4" +__version__ = "1.0.5" logging.getLogger(__name__).addHandler(logging.NullHandler()) diff --git a/python/rpdk/typescript/codegen.py b/python/rpdk/typescript/codegen.py index 9056a22..8b693f6 100644 --- a/python/rpdk/typescript/codegen.py +++ b/python/rpdk/typescript/codegen.py @@ -26,7 +26,7 @@ SUPPORT_LIB_NAME = ( "@amazon-web-services-cloudformation/cloudformation-cli-typescript-lib" ) -SUPPORT_LIB_VERSION = "^1.0.1" +SUPPORT_LIB_VERSION = "^1.0.6" MAIN_HANDLER_FUNCTION = "TypeFunction" diff --git a/python/rpdk/typescript/templates/models.ts b/python/rpdk/typescript/templates/models.ts index 2d428b0..ae0b451 100644 --- a/python/rpdk/typescript/templates/models.ts +++ b/python/rpdk/typescript/templates/models.ts @@ -1,6 +1,6 @@ // This is a generated file. Modifications will be overwritten. import { BaseModel, Dict, integer, Integer, Optional, transformValue } from '{{lib_name}}'; -import { Exclude, Expose, Type, Transform } from 'class-transformer'; +import { Exclude, Expose, Type, Transform, TransformFnParams } from 'class-transformer'; {% for model, properties in models.items() %} export class {{ model|uppercase_first_letter }} extends BaseModel { @@ -31,8 +31,8 @@ export class {{ model|uppercase_first_letter }} extends BaseModel { @Type(() => {{ inner_type.type }}) {% else %} @Transform( - ({value, obj}) => - transformValue({{ inner_type.wrapper_type }}, '{{ name|lowercase_first_letter|safe_reserved }}', value, obj, [{{ inner_type.classes|join(', ') }}]), + (params: TransformFnParams) => + transformValue({{ inner_type.wrapper_type }}, '{{ name|lowercase_first_letter|safe_reserved }}', params.value, params.obj, [{{ inner_type.classes|join(', ') }}]), { toClassOnly: true, } diff --git a/python/rpdk/typescript/templates/package.json b/python/rpdk/typescript/templates/package.json index f644acc..c760bdb 100644 --- a/python/rpdk/typescript/templates/package.json +++ b/python/rpdk/typescript/templates/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "{{lib_name}}": "{{lib_path}}", - "class-transformer": "0.3.1" + "class-transformer": "0.5.1" }, "devDependencies": { "@types/node": "^20.0.0", From 9ff7aaaac6557973a64a7808bc96b36d1d5fa339 Mon Sep 17 00:00:00 2001 From: Heather Nelson Date: Thu, 15 Aug 2024 12:29:16 -0400 Subject: [PATCH 2/6] update package-lock --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index cda08a2..b8a7670 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@amazon-web-services-cloudformation/cloudformation-cli-typescript-lib", - "version": "1.0.5", + "version": "1.0.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@amazon-web-services-cloudformation/cloudformation-cli-typescript-lib", - "version": "1.0.5", + "version": "1.0.6", "license": "Apache License 2.0", "dependencies": { "@org-formation/tombok": "^0.0.1", From b3e34be9bbdccd39e87cc082b8ccb548465e0042 Mon Sep 17 00:00:00 2001 From: Heather Nelson Date: Thu, 15 Aug 2024 14:46:18 -0400 Subject: [PATCH 3/6] change the new Date to specify iso string --- tests/lib/log-delivery.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/lib/log-delivery.test.ts b/tests/lib/log-delivery.test.ts index fd0a73b..1b32144 100644 --- a/tests/lib/log-delivery.test.ts +++ b/tests/lib/log-delivery.test.ts @@ -1271,11 +1271,11 @@ describe('when delivering logs', () => { loggerProxy.addLogPublisher(s3Logger); loggerProxy.log('count: [%d]', 5.12); - loggerProxy.log('timestamp: [%s]', new Date('2020-01-01')); + loggerProxy.log('timestamp: [%s]', new Date('2020-01-01').toISOString()); - loggerProxy.log('timestamp: [%s]', new Date('2020-01-02')); - loggerProxy.log('timestamp: [%s]', new Date('2020-01-03')); - loggerProxy.log('timestamp: [%s]', new Date('2020-01-04')); + loggerProxy.log('timestamp: [%s]', new Date('2020-01-02').toISOString()); + loggerProxy.log('timestamp: [%s]', new Date('2020-01-03').toISOString()); + loggerProxy.log('timestamp: [%s]', new Date('2020-01-04').toISOString()); expect(inspect.defaultOptions.depth).toBe(8); await loggerProxy.waitCompletion(); From 206de88f89d20218789faf4e0559ce8b3abb33e7 Mon Sep 17 00:00:00 2001 From: Heather Nelson Date: Fri, 16 Aug 2024 09:50:11 -0400 Subject: [PATCH 4/6] Update the colima start to specify x86 arch --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c36fd9..f84c057 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: # Docker engine is no longer available because of licensing # Alternative Colima is part of the github macOS runner # SAM v1.47.0+ needed for colima support, unable to use Python 3.6 - colima start + colima start --arch x86_64 # Ensure colima is configured for later user echo "DOCKER_HOST=unix://$HOME/.colima/default/docker.sock" >> $GITHUB_ENV # Verify Docker From 4436e8af2f613ee9afccff9ae10b7be277789bf3 Mon Sep 17 00:00:00 2001 From: Heather Nelson Date: Fri, 7 Feb 2025 14:34:36 -0500 Subject: [PATCH 5/6] revert colima change --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f84c057..7c36fd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: # Docker engine is no longer available because of licensing # Alternative Colima is part of the github macOS runner # SAM v1.47.0+ needed for colima support, unable to use Python 3.6 - colima start --arch x86_64 + colima start # Ensure colima is configured for later user echo "DOCKER_HOST=unix://$HOME/.colima/default/docker.sock" >> $GITHUB_ENV # Verify Docker From 252aaa25ea8fe2366f06da1ca665d3dfc2a8d9e7 Mon Sep 17 00:00:00 2001 From: Heather Nelson Date: Wed, 19 Mar 2025 10:35:07 -0400 Subject: [PATCH 6/6] update the github cli --- .github/workflows/cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index e87853c..abb756d 100755 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -28,7 +28,7 @@ jobs: npm pack - name: Upload NPM Artifacts id: upload_npm - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: package-npm path: cfn-rpdk-${{ env.VERSION }}.tgz @@ -50,7 +50,7 @@ jobs: run: | python -m pip install --upgrade pip setuptools wheel python3 setup.py sdist bdist_wheel - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: dist-py${{ matrix.python }} path: dist