Skip to content

chore: modernize for Node 12+, remove unused deps, fix bugs (v3) - #23

Merged
tecfu merged 3 commits into
masterfrom
modernize-v3
Sep 6, 2026
Merged

tecfu merged 3 commits into
masterfrom
modernize-v3

Conversation

@tecfu

@tecfu tecfu commented Sep 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

Modernization release addressing open issues #17, #18, #20, and #21.

  • Drop Node < 12 and remove the array.prototype.flat polyfill (large transitive dependency reduction)
  • Remove unused grapheme-splitter dependency
  • Fix undeclared result variable in ANSI parsing
  • CLI now correctly forwards all options (breakword, errorChar, etc.)
  • Replace Grunt test runner with plain Mocha
  • Add GitHub Actions CI matrix (Node 12–22)
  • Update yargs, strip-ansi, and devDependencies
  • Clean up source style (String.repeat, native Array.flat, consistent quotes)
  • Refresh README with options table and 3.0.0 breaking-changes section
  • Bump version to 3.0.0

Public wrapping behavior for previously supported inputs is intentionally preserved.

Test plan

  • npm test — 25 passing
  • GitHub Actions workflow added
  • CI green on Node 12–22
  • Manual smoke of CLI (echo "宽字符" | smartwrap -w 2)
  • Review dependency tree size before/after

Closes #17
Closes #18
Closes #20
Closes #21

- Drop support for Node < 12 and remove array.prototype.flat polyfill
  (eliminates a large transitive dependency tree; closes #17, #18)
- Remove unused grapheme-splitter dependency (closes #20)
- Fix undeclared `result` variable in ANSI parsing (closes #21)
- Pass all CLI options (including breakword / errorChar) correctly
- Replace Grunt test runner with plain Mocha
- Update yargs, strip-ansi, and devDependencies
- Clean up source style, use String.repeat, native Array.flat
- Refresh README with options table and 3.0.0 breaking changes
- Bump version to 3.0.0

Note: GitHub Actions CI workflow omitted from this PR because the
token lacks the `workflow` scope; can be added in a follow-up.

Behavior of the public API for previously supported inputs is preserved;
all existing unit tests pass.
Runs the test suite on a matrix of supported Node versions on every
push and pull request to master/main.
- Expand test matrix with 24.x (Active LTS) and 26.x (Current)
- Upgrade actions/checkout and actions/setup-node to v5 (Node 24
  runtime) to silence Node 20 deprecation warnings on the runner
- Print node --version so the resolved runtime is visible in logs
@tecfu
tecfu merged commit ffb1b87 into master Sep 6, 2026
9 checks passed
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.

eslint-ignore masks undeclared result variable Remove unused grapheme-splitter dependency Suggestion to reduce number of dependencies

1 participant