-
-
Notifications
You must be signed in to change notification settings - Fork 29
feat(tls-securepair-to-tlssocket): introduce #286
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are some copy pasta
|
Pr title should be updated + the architecture need to fit with the good way to create a codemod |
|
@AugustinMauroy I have addressed the comments. Could you please review the code again? If the architecture is still not correct, could you please clarify the expected approach so I can be sure I understand? |
| - Supports both `new tls.SecurePair()` and `new SecurePair()`. | ||
|
|
||
| ## Examples | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can have on code snippets here that use diff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file isn't needed codemod cli furnish us the needed tooling
| const edits: Edit[] = []; | ||
| const linesToRemove: Range[] = []; | ||
|
|
||
| const importNodes = rootNode.findAll({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have utilities for that plz read that https://github.com/nodejs/userland-migrations/blob/main/utils/README.md
Co-authored-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com>
Co-authored-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com>
Co-authored-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com>
Co-authored-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com>
|
I've addressed the previous PR issues. The transformation now uses the recommended utilities from @nodejs/codemod-utils for detecting and manipulating imports/requires (getNodeImportStatements, getNodeRequireCalls, updateBinding, removeLines). I've also removed test.sh from Git, updated the documentation to reference npm test, and all eight tests pass. I hope my work will pass the tests this time. |
|
I just corrected the codemod error and ran all tests with npm run test. It should work correctly this time. Thank you for your patience |
This PR introduces a new codemod to migrate the deprecated tls.SecurePair class to tls.TLSSocket.
Key features of this codemod:
Testing: I have added comprehensive test cases covering:
Tests were verified locally using a custom test script ensuring input/output matches expectations.