Skip to content

feat(logger): add codemode name #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

AugustinMauroy
Copy link
Member

No description provided.

@AugustinMauroy AugustinMauroy requested review from a team and Copilot July 1, 2025 12:24
Copy link

@Copilot 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 configurable codemod name for log output, enabling dynamic updates to logger prefixes.

  • Adds a new exported function setCodemodName to update the codemod name.
  • Updates log statements and test snapshots to reflect the codemod name change.
  • Updates the workflow file to set the codemod name as needed.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

File Description
utils/src/logger.ts Added codemodName variable and exported setCodemodName function.
utils/src/logger.test.ts Updated tests to use setCodemodName and validate log output changes.
utils/src/logger.test.snap.cjs Updated snapshot values to reflect the new codemod name usage.
recipes/correct-ts-specifiers/src/workflow.ts Imported and applied setCodemodName for setting the codemod name.
Comments suppressed due to low confidence (1)

utils/src/logger.ts:8

  • The default codemod name 'nodjs-codemod' appears to have a potential typo. If it is meant to be 'nodejs-codemod', consider updating the default value for clarity.
let codemodName = 'nodjs-codemod';

Copy link
Member

@JakobJingleheimer JakobJingleheimer left a comment

Choose a reason for hiding this comment

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

Multiple codemods could be running at the same time as part of a multi-part migration. In that case, the module-level "name" will get clobbered.

@AugustinMauroy
Copy link
Member Author

🤦🏼 you have right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

2 participants