detect-port icon indicating copy to clipboard operation
detect-port copied to clipboard

feat: refactor with typescript to support esm and cjs both

Open fengmk2 opened this issue 1 year ago • 3 comments

BREAKING CHANGE: Drop Node.js < 16 support

  1. 使用 ts 重构
  2. 使用 tshy 支持 esm 和 cjs
  3. test 使用 test-runner (这里需要 node v18 版本)

merge from https://github.com/node-modules/detect-port/pull/51

Summary by CodeRabbit

  • New Features

    • Introduced waitPort function to wait for a specified port to become available.
    • Added CLI tool tests for version display, usage information, available ports, and verbose logging.
  • Bug Fixes

    • Improved detectPort function to handle different parameter combinations and enhance error handling.
  • Documentation

    • Updated .gitignore to include new patterns and files.
  • Chores

    • Updated Node.js versions in workflows to support newer versions (16, 18, 20, 22).
    • Refined ESLint configurations to extend TypeScript rules and enforce node prefix conventions.
    • Updated package.json dependencies and scripts for better development workflow.
  • Refactor

    • Migrated CommonJS require to ES module imports for better compliance with modern JavaScript standards.

fengmk2 avatar May 29 '24 15:05 fengmk2