Skip to content

Revert "refactor!: remove modules options (#484)"#504

Merged
Boshen merged 1 commit intomainfrom
revert-modules
May 9, 2025
Merged

Revert "refactor!: remove modules options (#484)"#504
Boshen merged 1 commit intomainfrom
revert-modules

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented May 9, 2025

This reverts commit f64911c.

closes #502
closes #493

I don't have have a clear understanding of how .d.ts resolution works so reverting the previous commit.

This reverts commit f64911c.

closes #502
closes #493

I don't have have a clear understanding of how .d.ts resolution works
so reverting the `modules`.
Copilot AI review requested due to automatic review settings May 9, 2025 07:33
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 reverts the changes from commit f64911c by reintroducing the modules option support in Resolver and its related tests and N-API bindings. The changes update tests, adjust configuration options and resolvers, and update the documentation accordingly.

  • Reintroduces the modules option to ResolveOptions and adds a helper method for it.
  • Updates various test cases to use new module-based resolution paths.
  • Updates the N-API bindings and README to reflect the modules option.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/integration_test.rs Adds a test using the with_module option
src/tests/resolve.rs Reintroduces a new test (issue238_resolve) using modules
src/tests/fallback.rs Updates fallback tests to use new module paths
src/tests/dependencies.rs Adjusts paths to expect modules-based resolution
src/tests/alias.rs Updates alias tests to work with new module paths
src/options.rs Adds the modules field and with_module helper method
src/lib.rs Modifies module resolution logic to use options.modules
src/fs_cache.rs Adds caching for node_modules lookups
src/cache.rs Updates the CachedPath trait to include module methods
napi/src/options.rs Adds modules option to NAPI resolve options
napi/src/lib.rs Uses the modules option in NAPI resolver initialization
README.md Updates documentation to include the modules option
Comments suppressed due to low confidence (1)

src/options.rs:337

  • [nitpick] Consider renaming 'with_module' to 'with_modules' or 'add_module' for clarity, since the underlying field is a vector of modules.
pub fn with_module<M: Into<String>>(mut self, module: M) -> Self {

@codecov
Copy link

codecov bot commented May 9, 2025

Codecov Report

Attention: Patch coverage is 88.46154% with 12 lines in your changes missing coverage. Please review.

Project coverage is 93.84%. Comparing base (f7c841c) to head (17b0d02).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/lib.rs 85.18% 12 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #504   +/-   ##
=======================================
  Coverage   93.84%   93.84%           
=======================================
  Files          13       13           
  Lines        2795     2829   +34     
=======================================
+ Hits         2623     2655   +32     
- Misses        172      174    +2     

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

@codspeed-hq
Copy link

codspeed-hq bot commented May 9, 2025

CodSpeed Performance Report

Merging #504 will not alter performance

Comparing revert-modules (17b0d02) with main (f7c841c)

Summary

✅ 3 untouched benchmarks

@Boshen Boshen merged commit 6e03810 into main May 9, 2025
18 checks passed
@Boshen Boshen deleted the revert-modules branch May 9, 2025 07:36
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.

feat: resolve from node_modules/@types

2 participants