Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package class-transformer introduces breaking changes to the model.ts generated file #126

Open
HeatherFlux opened this issue Apr 8, 2024 · 4 comments

Comments

@HeatherFlux
Copy link

Currently the package "class-transformer": "^0.3.1" is using a carat ^ for its version. On a install and build of the cfn cli it pulls version 0.3.2 from the registry. Version 0.3.2 has changed its interface for the @transform decorator from

@Transform((value: any, obj: any) => {})

to

@Transform((params: TransformFnParams) => {}

When doing the npm install with 0.3.2 you will get the following message

npm WARN deprecated [email protected]: This release contains a breaking change from 0.3.1 but otherwise functions properly. Please read the changelog on Github to learn more.

For any developer using this with a local class-transformer at 0.3.1 you would see no error in the generated model.ts file and no error in the cloudwatch logs since the logger proxy isn't instantiated until after the plainToClass function is called in the code. This function errors at the model.ts file and returns no transformed object. When manually updating the model.ts file to use the new interface the class-transformer functions correctly and no longer strips the fields and locking class-transformer to 0.3.2

Proposed Fix:

The cfn generate command should be updated to use the new class-transformer interfaces or the class-transformer package should be locked at 0.3.1 and a new patch should go out.

Further Investigation

Further investigation should be put into the current tsconfig using the node14 settings as well given node14 is no longer supported in aws lambdas.

HeatherFlux referenced this issue Jun 3, 2024
* Runtime(v1.0.6) + Tooling(v1.0.4) version bump

* Update ci workflow to install Docker with --cask option for Mac OSX

* Update ci workflow to install colima for Mac OSX

* Downgrade the macOS version used for Docker tests to macos-13 to fix recent Docker build failures

* Downgrade the macOS version used for Docker tests to macos-12 to fix recent Docker build failures

---------

Co-authored-by: Jared Deiner <[email protected]>
@HeatherFlux HeatherFlux changed the title package class-transformer introduces potential breaking changes to the model.ts generated file package class-transformer introduces breaking changes to the model.ts generated file Jun 4, 2024
@HeatherFlux
Copy link
Author

See a fix was merged in, am closing this issue

@kddejong
Copy link
Contributor

kddejong commented Jun 5, 2024

Thank you @HeatherFlux with your help with this

@HeatherFlux
Copy link
Author

Hey you did the work I just dug around a bit lol

@HeatherFlux HeatherFlux reopened this Aug 14, 2024
@HeatherFlux
Copy link
Author

Looks like it is still present
Left comments on this PR since I can not push my branch
#127 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants