Skip to content

Conversation

@AugustinMauroy
Copy link
Member

TODO

  • put shared into utilities package
  • add more doc

@AugustinMauroy
Copy link
Member Author

I need review on test cases so I can finish/clean the implementation

@AugustinMauroy AugustinMauroy requested review from a team and Copilot October 31, 2025 14:09
@AugustinMauroy AugustinMauroy added awaiting reviewer Author has responded and needs action from the reviewer dep:v24 Migration handles deprecation introduced in node v24 dep:EoL Migration handles deprecation introduced in an EoL version of node labels Oct 31, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a comprehensive codemod recipe to migrate deprecated Node.js timers APIs to modern timer functions. The codemod replaces timers.enroll(), timers.unenroll(), timers.active(), and timers._unrefActive() with standard setTimeout(), clearTimeout(), and Timer#unref() constructs, addressing Node.js deprecations DEP0095, DEP0096, DEP0126, and DEP0127.

Key changes include:

  • New utility functions for GCD calculation and indent detection in the codemod-utils package
  • Five transformation modules that handle different deprecated APIs
  • Comprehensive test suite covering various import/require patterns
  • Automated cleanup of unused imports after transformations

Reviewed Changes

Copilot reviewed 45 out of 46 changed files in this pull request and generated 107 comments.

Show a summary per file
File Description
utils/src/math.ts Implements GCD function to calculate indentation units
utils/src/math.test.ts Tests for GCD function including edge cases
utils/src/ast-grep/indent.ts Detects indentation style and retrieves line indentation
utils/src/ast-grep/indent.test.ts Tests for indentation detection utilities
utils/src/ast-grep/general.ts Helper functions for AST manipulation
utils/src/ast-grep/general.test.ts Tests for AST manipulation helpers
recipes/timers-deprecations/src/*.ts Five transformation modules for each deprecated API
recipes/timers-deprecations/tests/** Comprehensive test cases for all transformations
recipes/timers-deprecations/workflow.yaml Workflow configuration for codemod execution
recipes/timers-deprecations/package.json Package configuration and test scripts
recipes/timers-deprecations/codemod.yaml Codemod metadata and registry configuration
recipes/timers-deprecations/README.md Documentation with examples and caveats

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AugustinMauroy AugustinMauroy linked an issue Nov 1, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviewer Author has responded and needs action from the reviewer dep:EoL Migration handles deprecation introduced in an EoL version of node dep:v24 Migration handles deprecation introduced in node v24

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: handle timers deprecation

2 participants