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

Đang mở
#554 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
54/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript
Lĩnh vực
tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
85
Fork
58
Merge trung bình
1 ngày 21 giờ
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nodejs/userland-migrations

Tất cả issue của nodejs/userland-migrations

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.