Skip to content

Conversation

@omermorad
Copy link
Contributor

No description provided.

…-v3)

Refactored transform naming from 'automock-to-suites' to follow the
industry-standard Codemod Registry pattern: <framework>/<version>/<transform>

BREAKING CHANGE: Transform argument now required. Users must specify:
  npx @suites/codemod automock/2/to-suites-v3 <path>

Changes:
- Transform registry: Updated to automock/2/to-suites-v3
- Directory structure: Created hierarchical namespace src/transforms/automock/2/
- CLI: Removed default transform, require explicit specification
- File processor: Renamed to generic naming (filterSourceFiles)
- Runner: Updated variable naming (automockFiles → sourceFiles)
- Tests: Updated imports, all 207 tests passing
- Documentation: Updated README with new usage examples

Benefits:
- Follows React codemod and Codemod Registry patterns
- Future-proof for v3-to-v4, v4-to-v5 migrations
- Support for multiple transforms per version
- Extensible to other frameworks (jest, vitest, etc.)
Changed success() and fileTransformed() methods to use heavy check mark (✔)
to match ora spinner's succeed() symbol for visual consistency.
- Add coverage workflow for master branch pushes with Codecov integration
- Update publishConfig to use public npm registry with provenance enabled
- Remove [skip ci] from semantic-release commit message format
- Add publish.yml workflow for manual npm publishing with dist-tag selection
- Add coverage.yml workflow for automatic coverage reporting on master pushes
- Support latest, next, rc, dev, alpha, and beta dist-tags
- Include provenance attestations for supply chain security
- Add job summaries for publish success/failure feedback
Added comprehensive documentation for:
- Codemod Registry pattern and architecture explanation
- Hierarchical transform structure (framework/version/transform)
- Updated 'Adding New Transforms' with new directory structure
- Updated Project Structure to reflect automock/2/ organization
- New 'Local Development' section with:
  - Running locally with node dist/cli.js
  - npm link for testing
  - Running tests

This helps contributors understand the versioned approach and provides
clear instructions for local testing and development.
Updated CLI flags to match Next.js @next/codemod patterns:
- Changed --dry-run to --dry (with -d short flag)
- Changed --print to have -p short flag
- Configured -v for --version (was -V by default)
- Kept --verbose without short flag (matching Next.js)
- Updated all option descriptions to match Next.js style

This provides a consistent experience for users familiar with
other codemods in the ecosystem.

References:
- @next/codemod CLI conventions
- Commander.js version/help customization
Changed argument names to match @next/codemod exactly:
- 'transform' → 'codemod' (codemod slug to run)
- 'path' → 'source' (path to source files or directory)

Updated help text to reference GitHub repo:
https://github.com/suites-dev/codemod

This provides consistent terminology with Next.js and other
popular codemods in the ecosystem.
Removed hardcoded symbols that were duplicating logger's built-in symbols:
- git-safety.ts: Removed ⚠️ and ❌ (logger.error/warn already add symbols)
- runner.ts: Removed hardcoded ✗ and ✓ (logger.error/success already add symbols)

Now all output uses consistent single symbols:
- ✔ for success (from logger.success())
- ✗ for errors (from logger.error())
- ⚠ for warnings (from logger.warn())
- ℹ for info (from logger.info())

No duplicate symbols in any output.
Added Arguments section to README to match Next.js codemod documentation:
- codemod: Codemod slug to run
- source: Path to source files or directory (with glob patterns)

Renamed 'CLI Options' to 'CLI Reference' with subsections for
Arguments and Options, providing clearer documentation structure.
@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 20.68966% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.57%. Comparing base (8abdedd) to head (94e91b4).
⚠️ Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
src/cli.ts 31.25% 11 Missing ⚠️
src/runner.ts 9.09% 10 Missing ⚠️
src/utils/git-safety.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master       #2      +/-   ##
==========================================
+ Coverage   61.50%   61.57%   +0.07%     
==========================================
  Files          23       23              
  Lines         969      963       -6     
  Branches      266      262       -4     
==========================================
- Hits          596      593       -3     
+ Misses        332      329       -3     
  Partials       41       41              
Flag Coverage Δ
unittests 61.57% <20.68%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Changed flag and terminology for consistency:
- CLI flag: --list-transforms → --list-codemods
- Usage: <transform> <path> → <codemod> <source>
- Section heading: 'Available Transforms' → 'Available Codemods'
- Error messages updated to reference --list-codemods

This aligns all terminology with the 'codemod' naming convention
used throughout the CLI and matches Next.js codemod patterns.
…ptions)

Removed options to match Next.js simplicity:
- Removed --extensions (hardcoded to .ts, .tsx)
- Removed --ignore (hardcoded ignorePatterns: node_modules, dist, .d.ts)
- Removed --skip-validation (validation always runs for safety)
- Removed --list-codemods (show list in error messages instead)

Final CLI options (matching Next.js):
- -v, --version
- -d, --dry
- -f, --force
- -p, --print
- --verbose
- --parser (our equivalent to Next.js -j, --jscodeshift)
- -h, --help

Benefits:
- Simpler, cleaner CLI matching industry standard
- Validation always runs (catches critical errors)
- Hardcoded sensible defaults for extensions and ignore patterns
- List of codemods shown automatically on errors
@omermorad omermorad merged commit c2e7c36 into master Dec 16, 2025
2 of 3 checks passed
@omermorad omermorad deleted the refactor/codemod-registry-naming branch December 16, 2025 05:27
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.

2 participants