Skip to content

Conversation

@technologic-technologic
Copy link

This pull request implements the codemod to replace deprecated tls.createSecurePair() with TLSSocket, addressing DEP0064.

Changes included:

  • Updated the codemod workflow to transform createSecurePair(...) into new TLSSocket(underlyingSocket, {...}), preserving tls.TLSSocket for namespace usage.
  • Rewrote imports to replace { createSecurePair } with { TLSSocket } in CJS/ESM (keeps namespace imports intact).
  • Renamed assigned variables pairsocket where applicable.
  • Added tests for cjs/esm (destructured, namespace, flags, and mixed symbols).
  • Ensured idempotent runs and minimal, repo-style edits.
  • Added README.md and package.json metadata.
  • Added tests for assigned variables, destructured imports.

This PR is part of the feature branch feat/tls-createSecurePair-to-TLSSocket.

@AugustinMauroy
Copy link
Member

AugustinMauroy commented Nov 6, 2025

npm i on root should update the lock file and fix the ci

Missing import test case

  • défaut import ESM
  • ESM dynamic import

…uded default and dynamic ESM imports + needed refactors as PR comments)

WHAT Changed:
- AST-based migration
- ESM/default/dynamic cases
- Normalize rewritten CJS requires to `node:tls` as suggested to code section
- Remove duplicated `getNodeImportStatements/getNodeRequireCalls` invocations
  that attempted to handle `'node:tls'` vs `'tls'`
…d dynamic import (await/then)

WHAT :
- ESM default import
- ESM dynamic import (await assignment)
- ESM dynamic import (then callback)
…cation`)' into feat(`tls-createSecurePair-deprecation`)
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

Successfully merging this pull request may close these issues.

feat: handle tls.createSecurePair() depreciation

2 participants