-
Notifications
You must be signed in to change notification settings - Fork 0
fix: address items from #44. #45
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
Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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
builtinSpecifiersinitialization 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.
Uh oh!
There was an error while loading. Please reload this page.