Skip to content

Conversation

@knightedcodemonkey
Copy link
Owner

@knightedcodemonkey knightedcodemonkey commented Jan 1, 2026

Copilot AI review requested due to automatic review settings January 1, 2026 18:21
@codecov
Copy link

codecov bot commented Jan 1, 2026

Codecov Report

❌ Patch coverage is 85.89744% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.76%. Comparing base (cd4a6d2) to head (308da76).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/module.ts 73.17% 10 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #45      +/-   ##
==========================================
- Coverage   95.64%   93.76%   -1.89%     
==========================================
  Files          25       26       +1     
  Lines        4959     4986      +27     
  Branches     1110     1114       +4     
==========================================
- Hits         4743     4675      -68     
- Misses        202      277      +75     
- Partials       14       34      +20     

☔ 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.

Copy link

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 addresses items from issue #44 by adding template literal rewriting control, improving circular dependency detection for TypeScript files, and refactoring shared code. The main changes include a new rewriteTemplateLiterals option to control whether interpolated template literals are rewritten during specifier transformation, enhanced cycle detection with TypeScript extension support and path normalization, and extraction of duplicated builtinSpecifiers logic into a shared utility module.

Key Changes:

  • Added rewriteTemplateLiterals: 'allow' | 'static-only' option to skip rewriting interpolated template literals when set to 'static-only'
  • Enhanced circular require detection to support TypeScript extensions (.ts, .mts, .cts) and normalize paths using realpath for symlink handling
  • Refactored duplicated builtinSpecifiers initialization code into a shared utility module

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/module.ts Adds tests for export star reexports, circular require detection in TypeScript files, and template literal rewriting behavior
test/fixtures/specifier/templateExpr.mjs New test fixture demonstrating static vs interpolated template literal imports
test/fixtures/exportAll.mjs New test fixture for export star reexport transformation
test/fixtures/cycles/tsB.cts New test fixture for circular dependency detection in TypeScript files
test/fixtures/cycles/tsA.cts New test fixture creating a circular dependency with tsB.cts
test/cli.ts Adds CLI test for --rewrite-template-literals flag behavior
src/utils/builtinSpecifiers.ts New shared utility module extracting duplicated builtin specifier set creation
src/types.ts Adds rewriteTemplateLiterals option type definition with documentation
src/module.ts Implements template literal rewriting logic, TypeScript extension support for cycle detection, path normalization, and refactors to use shared builtinSpecifiers utility
src/format.ts Removes duplicated builtinSpecifiers code in favor of shared utility import
src/cli.ts Adds CLI flag for --rewrite-template-literals and implements the option in specifier updates
package.json Version bump to 1.4.0-rc.3
package-lock.json Updates lock file for version bump
docs/roadmap.md Documents potential breaking changes related to template literal rewriting and cycle detection
README.md Adds documentation for the new rewriteTemplateLiterals option

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

@knightedcodemonkey knightedcodemonkey merged commit 1129cdd into main Jan 1, 2026
6 checks passed
@knightedcodemonkey knightedcodemonkey deleted the bananas branch January 1, 2026 18:59
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.

Technical review: CJS↔ESM transformation, Windows/Linux portability, and dual package hazards

2 participants