chore(deps): migrate from unrs-resolver to oxc-resolver#445
Conversation
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR replaces ChangesResolver Migration from unrs-resolver to oxc-resolver
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to a2f0af3 in 57 seconds. Click for details.
- Reviewed
100lines of code in5files - Skipped
1files when reviewing. - Skipped posting
5draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. README.md:80
- Draft comment:
Updated reference tooxc-resolveris correct and clearly explains the behavioral differences. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. package.json:85
- Draft comment:
Dependency updates are consistent:unrs-resolverremoved,oxc-resolveradded, and eslint-import-context bumped to ^0.2.0. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
3. resolvers/README.md:107
- Draft comment:
Documentation sample now correctly usesoxc-resolverin the wrapper example. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
4. src/node-resolver.ts:4
- Draft comment:
Migration of the resolver import tooxc-resolveris implemented correctly. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
5. test/rules/no-duplicates.spec.ts:90
- Draft comment:
Test case updated to use './deprecated' instead of './bar' to match the new resolver behavior. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_wuPEGseKsLp4WXy3
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
@JounQin could you please check and review it? |
|
|
| code: "import { x } from './deprecated'; import { y } from 'deprecated';", | ||
| output: "import { x, y } from './deprecated'; ", |
There was a problem hiding this comment.
Any reason why this unit test is modified?
There was a problem hiding this comment.
Related to oxc-project/oxc-resolver#839.
Since node_modules/bar.js is not used by modern package managers, I'd ignore this case, WDYT? @SukkaW
commit: |
|
This change is related — the test verifies that two import paths resolving to the same file are flagged as duplicates. My understanding is that the test fixtures have both |
a2f0af3 to
e123a57
Compare
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
173557d to
da7f4e0
Compare
Resolves un-ts#412. - Replace unrs-resolver with oxc-resolver ^11.0.0 - Update eslint-import-context to ^0.2.0 - Update documentation references - Adjust test for oxc-resolver's directory-first resolution
da7f4e0 to
6a00aa5
Compare
a8dec38 to
86b75c0
Compare
Summary
Resolves #412.
This PR migrates eslint-plugin-import-x from
unrs-resolvertooxc-resolver, aligning with eslint-import-context's recent migration (v0.2.0).Changes
unrs-resolverwithoxc-resolver@^11.0.0eslint-import-contextto^0.2.0Behavioral Difference & Test Update
One test case was updated to accommodate a behavioral difference between resolvers.
Background
The original test came from eslint-plugin-import. It verifies that
'./bar'and'bar'(withpathssetting) are detected as duplicates by resolving to the same file.Resolution Behaviors
barresolves tobar.jsbar.jsbar/index.jsThe test fixtures include both
bar.jsandbar/index.jswith different content.Why oxc-resolver Differs
This is intentional per oxc-resolver's design. From their source code:
oxc-resolver follows webpack's enhanced-resolve behavior rather than Node.js's algorithm. For bare specifiers like
require('bar'), it assumes you want a directory (package) rather than a lone file.Our Solution
The test was updated to use
deprecatedinstead ofbar:deprecated.jsexists without a conflictingdeprecated/directorypathsbar/index.jsremain unaffectedWe acknowledge this is a nuanced difference and are very open to feedback if the maintainers prefer an alternate approach ( (like adding a resolver option, keeping the original test and accepting the behavior change, or another solution), we're happy to adjust.
Test Plan
yarn buildsucceedsImportant
Migrate from
unrs-resolvertooxc-resolver, updating dependencies, documentation, and tests to reflect the new resolver's behavior.unrs-resolverwithoxc-resolver@^11.0.0inpackage.json.eslint-import-contextto^0.2.0inpackage.json.unrs-resolvertooxc-resolverinREADME.mdandresolvers/README.md.test/rules/no-duplicates.spec.tsto usedeprecatedinstead ofbarto accommodateoxc-resolverbehavior.src/node-resolver.tsto useoxc-resolverinstead ofunrs-resolver.This description was created by
for a2f0af3. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
Chores
unrs-resolvertooxc-resolvereslint-import-contextto v0.2.0 and updated dependenciesDocumentation
Tests