Skip to content

Conversation

clydin
Copy link
Member

@clydin clydin commented Oct 14, 2025

This commit refactors the jasmine-to-vitest schematic to use a centralized and type-safe system for generating "TODO" comments. Previously, TODO messages were hardcoded strings scattered across various transformer files. This new system improves maintainability, consistency, and developer experience.

Key changes include:

  • A new utils/todo-notes.ts file acts as a single source of truth for all TODO messages, categories, and optional documentation URLs.
  • Advanced mapped types (TodoCategory, TodoContextMap) are used to infer types directly from the configuration, ensuring that all calls are type-safe and preventing runtime errors.
  • The addTodoComment helper is now overloaded to handle both static and dynamic (context-aware) messages, ensuring that specific details (like an unsupported function name) are included in the comment.
  • All transformers have been updated to use this new system, resulting in cleaner, more consistent, and more maintainable code.

…ine-to-vitest

This commit refactors the `jasmine-to-vitest` schematic to use a centralized and type-safe system for generating "TODO" comments. Previously, TODO messages were hardcoded strings scattered across various transformer files. This new system improves maintainability, consistency, and developer experience.

Key changes include:
- A new `utils/todo-notes.ts` file acts as a single source of truth for all TODO messages, categories, and optional documentation URLs.
- Advanced mapped types (`TodoCategory`, `TodoContextMap`) are used to infer types directly from the configuration, ensuring that all calls are type-safe and preventing runtime errors.
- The `addTodoComment` helper is now overloaded to handle both static and dynamic (context-aware) messages, ensuring that specific details (like an unsupported function name) are included in the comment.
- All transformers have been updated to use this new system, resulting in cleaner, more consistent, and more maintainable code.
@clydin clydin added the target: major This PR is targeted for the next major release label Oct 14, 2025
This commit introduces unit tests for the `addTodoComment` helper function in the `jasmine-to-vitest` schematic. It also adds detailed comments to the function's AST traversal logic to improve clarity.
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 15, 2025
@clydin clydin requested a review from alan-agius4 October 15, 2025 00:24
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 15, 2025
@clydin clydin merged commit b72fa91 into angular:main Oct 15, 2025
33 checks passed
@clydin clydin deleted the refactor/jasmine-vitest-7 branch October 15, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @schematics/angular target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants