feat(DEP0192): migrate internal TLS imports to `node:tls`

Abierto
#554 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
54/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
node.js, typescript
Área
tooling

Línea de trabajo

Start by reading existing codemods and their fixtures to learn how this repository handles imports, aliases, and unresolved cases. Add a codemod for the listed _tls_common and _tls_wrap exports, preserving bindings and avoiding collisions; include the requested fixtures. Done means supported imports migrate to node:tls, while unsupported or unresolved cases are reported or skipped as specified.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

good first issue human help wanted

Description

Node.js 27.0.0-alpha.0.0.0 removes the _tls_common and _tls_wrap modules under DEP0192.

Add a codemod that migrates imports of their public equivalents to node:tls:

  • _tls_common: SecureContext and createSecureContext.
  • _tls_wrap: TLSSocket, Server, createServer, and connect.

Support specifiers with and without node:, CommonJS destructuring and property access, ESM imports, and aliases. Handle literal dynamic imports when their accessed exports can be resolved.

Additional Information

  • Preserve local binding names and avoid import collisions.
  • Namespace imports can be migrated only when all uses are understood and refer to equivalent public exports.
  • Report unsupported internal exports, such as translatePeerCertificate, for manual migration.
  • Skip namespace objects that escape into unknown code, computed exports that cannot be resolved, and dynamic module specifiers.
  • Include fixtures for supported exports, mixed supported/unsupported imports, aliases, and already migrated code.

Examples

-const { createSecureContext: makeContext } = require('_tls_common');
+const { createSecureContext: makeContext } = require('node:tls');

-import { TLSSocket, connect as tlsConnect } from 'node:_tls_wrap';
+import { TLSSocket, connect as tlsConnect } from 'node:tls';

 const context = makeContext(options);
 const socket = tlsConnect(connectionOptions);

Refs

Lenguaje dominante
TypeScript
Estrellas
85
Forks
58
Merge medio
1 d 21 h
PR fusionados (30 d)
8

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nodejs/userland-migrations

Todos los issues de nodejs/userland-migrations

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.