Skip to content

docs: update alias and fallback options type and description#161

Merged
JounQin merged 1 commit intomainfrom
docs/alias_fallback_types
Jun 24, 2025
Merged

docs: update alias and fallback options type and description#161
JounQin merged 1 commit intomainfrom
docs/alias_fallback_types

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Jun 24, 2025

related #557


Important

Update documentation for alias and fallback options to reflect new default values and descriptions.

  • Documentation:
    • Update alias and fallback default values from [] to {} in README.md, napi/index.d.ts, and napi/src/options.rs.
    • Correct descriptions for alias and fallback options in napi/index.d.ts and napi/src/options.rs.
    • Update crate-level documentation in src/lib.rs to reflect new project name and package URLs.

This description was created by Ellipsis for 0bc644f. You can customize this summary. It will automatically update as commits are pushed.


Summary by CodeRabbit

  • Documentation
    • Updated configuration documentation to clarify default values and descriptions for alias and fallback fields.
    • Revised crate-level documentation to reflect the new project name and updated package URLs.

@JounQin JounQin requested a review from Copilot June 24, 2025 05:37
@JounQin JounQin self-assigned this Jun 24, 2025
@JounQin JounQin added the documentation Improvements or additions to documentation label Jun 24, 2025
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 updates the resolver documentation and options defaults to reflect a new project name and revised type defaults for the alias and fallback options.

  • Updated project name from "Oxc Resolver" to "UnRS Resolver" in the library documentation.
  • Revised the default values for alias and fallback from arrays ([]) to hash maps ({}), with corresponding documentation updates in both code and README.

Reviewed Changes

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

File Description
src/lib.rs Updated header documentation to reflect new project naming.
napi/src/options.rs Adjusted default value docs for alias and fallback options.
README.md Updated default values and descriptions to match new changes.
Comments suppressed due to low confidence (5)

src/lib.rs:1

  • Ensure that the project name change is consistently applied across all related documentation, including repository and package links.
//! # UnRS Resolver

napi/src/options.rs:25

  • [nitpick] Confirm that the updated alias default documentation accurately reflects the intended default value in the implementation.
    /// Default `{}`

napi/src/options.rs:88

  • [nitpick] Verify that the fallback option's default value documentation is correct and consistent with the actual implementation change from an array to a hash map.
    /// Default `{}`

README.md:190

  • Check that the alias default value update in the README is aligned with the implementation and that any usage examples are updated accordingly.
| alias            | {}                        | A hash map of module alias configurations                                                                                                                 |

README.md:198

  • Ensure that the fallback documentation accurately reflects the new default value and that any related examples in the README are consistent with this change.
| fallback         | {}                        | Same as `alias`, but only used if default resolving fails                                                                                                 |

@coderabbitai
Copy link

coderabbitai bot commented Jun 24, 2025

Walkthrough

The changes update documentation and comments across the codebase. The README and Rust documentation now clarify that the default values for the alias and fallback configuration options are empty objects (hash maps), not arrays. Additionally, the crate's name and URLs have been updated from "Oxc Resolver" to "UnRS Resolver" in the documentation.

Changes

File(s) Change Summary
README.md, napi/index.d.ts, napi/src/options.rs Updated descriptions and default values for alias and fallback to reflect empty objects.
src/lib.rs Renamed project in crate-level docs and updated URLs from "Oxc Resolver" to "UnRS Resolver".

Poem

In the meadow of docs, a gentle breeze blew,
Changing arrays to maps, and names to something new.
UnRS hops forward, with clarity in sight,
Aliases and fallbacks now mapped just right.
A hop, a skip, a README delight—
The rabbit approves, with whiskers so bright!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a3ee55a and 0bc644f.

📒 Files selected for processing (4)
  • README.md (1 hunks)
  • napi/index.d.ts (2 hunks)
  • napi/src/options.rs (2 hunks)
  • src/lib.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • napi/src/options.rs
  • napi/index.d.ts
  • README.md
  • src/lib.rs
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Benchmark
  • GitHub Check: Test (windows-latest)
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to 4e47004 in 1 minute and 4 seconds. Click for details.
  • Reviewed 58 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft 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:188
  • Draft comment:
    Updated alias & fallback defaults to '{}' instead of '[]'. This now correctly describes a hash map. Verify that all examples match this change.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify that all examples match the change, which violates the rule against asking for confirmation or verification. It does not provide a specific suggestion or point out a specific issue with the code.
2. napi/src/options.rs:25
  • Draft comment:
    Doc comments for 'alias' and 'fallback' now show default as '{}' to match the HashMap type. Looks consistent with the implementation.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, stating that the doc comments now show a default value to match the HashMap type. It doesn't provide any actionable feedback or suggestions for improvement.
3. src/lib.rs:1
  • Draft comment:
    Project renaming: Changed doc header from 'Oxc Resolver' to 'UnRS Resolver' and updated release links. Ensure consistency across documentation.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, as it just describes the changes made without providing any actionable feedback or suggestions. It doesn't ask for any specific confirmation or suggest any improvements.
4. napi/src/options.rs:22
  • Draft comment:
    It appears there is a typographical error in the inline code formatting on this line. The comment reads: /// AliasValue::Path(String) It seems you intended to wrap the code reference in backticks. Consider adding an opening backtick before 'AliasValue' to correct it to: ///AliasValue::Path(String)`
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_FpRXYQhCnAgXPcIv

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@codecov
Copy link

codecov bot commented Jun 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.20%. Comparing base (ade786e) to head (0bc644f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #161   +/-   ##
=======================================
  Coverage   92.20%   92.20%           
=======================================
  Files          13       13           
  Lines        3068     3068           
=======================================
  Hits         2829     2829           
  Misses        239      239           

☔ 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

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
napi/src/options.rs (1)

88-90: Same mismatch between documented default and actual default

For fallback, the comment should mirror the clarification made for alias.

-/// Default `{}`
+/// Default `None` (treated as an empty map `{}` during sanitization)
🧹 Nitpick comments (3)
napi/src/options.rs (1)

25-27: Docstring says default {} but the field type is Option<…>

alias is declared as Option<HashMap<…>>. When None, sanitize() interprets this as “no aliases” – semantically the same as an empty map, but not literally {}.
Clarify the wording to avoid confusion for API users who might expect Some(HashMap::new()) as the default.

-/// Default `{}`
+/// Default `None` (behaves like an empty map `{}` after sanitization)
README.md (2)

190-191: Updated default matches code but wording could be clearer

Consider stating explicitly that the absence of the option is interpreted as an empty object:

-| alias            | {}                        | A hash map of module alias configurations
+| alias            | {}                        | A hash map of module alias configurations (omit or use `{}` for none)

198-199: Minor clarification mirror for fallback

-| fallback         | {}                        | Same as `alias`, but only used if default resolving fails
+| fallback         | {}                        | Same as `alias`; omit or use `{}` for no fallbacks. Only applied if normal resolution fails
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ade786e and 4e47004.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • napi/src/options.rs (2 hunks)
  • src/lib.rs (1 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[misspelling] ~195-~195: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...alse | Enforce that a extension from extensions must be used ...

(EN_A_VS_AN)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test (windows-latest)
  • GitHub Check: Benchmark
🔇 Additional comments (1)
src/lib.rs (1)

1-6: Project rename looks good

The crate-level docs now reference the new crate and npm package names; no issues spotted.

@codspeed-hq
Copy link

codspeed-hq bot commented Jun 24, 2025

CodSpeed Performance Report

Merging #161 will not alter performance

Comparing docs/alias_fallback_types (0bc644f) with main (ade786e)

Summary

✅ 3 untouched benchmarks

@JounQin JounQin force-pushed the docs/alias_fallback_types branch from 4e47004 to a3ee55a Compare June 24, 2025 05:41
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed a3ee55a in 1 minute and 2 seconds. Click for details.
  • Reviewed 79 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft 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. napi/index.d.ts:50
  • Draft comment:
    The alias (and fallback) doc now shows a default of {} instead of an empty array. This change correctly reflects its type as a Record, so ensure all consumers are updated accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. napi/src/options.rs:25
  • Draft comment:
    The alias and fallback fields now use Option<HashMap<...>> with a default of {} (as noted in the doc comments). This update aligns the implementation with the TS definitions; no issues found.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. src/lib.rs:1
  • Draft comment:
    The crate-level docs have been updated to reflect the new project name (UnRS Resolver) and updated package URLs. This enhances clarity for users; just verify consistency across all documentation.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. napi/src/options.rs:22
  • Draft comment:
    There seems to be an issue with the markdown formatting. The text AliasValue::Path(String) only has a trailing backtick. It probably should be enclosed in backticks (i.e., `AliasValue::Path(String)`) for consistency.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_PuGpa093AnpHGCBb

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
README.md (1)

195-195: Minor grammar nit – use “an extension”

-| enforceExtension | false                     | Enforce that a extension from extensions must be used |
+| enforceExtension | false                     | Enforce that an extension from extensions must be used |
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e47004 and a3ee55a.

📒 Files selected for processing (4)
  • README.md (1 hunks)
  • napi/index.d.ts (2 hunks)
  • napi/src/options.rs (2 hunks)
  • src/lib.rs (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • napi/index.d.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • napi/src/options.rs
  • src/lib.rs
🧰 Additional context used
🪛 LanguageTool
README.md

[misspelling] ~195-~195: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...alse | Enforce that a extension from extensions must be used ...

(EN_A_VS_AN)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Benchmark
  • GitHub Check: Test (windows-latest)
🔇 Additional comments (1)
README.md (1)

190-190: Alignment with actual default types looks good

Switching the default values of alias and fallback from [] to {} accurately reflects their real types (hash maps).
No additional issues spotted in these rows.

Also applies to: 198-198

@JounQin JounQin force-pushed the docs/alias_fallback_types branch from a3ee55a to 01baf76 Compare June 24, 2025 05:47
@JounQin JounQin force-pushed the docs/alias_fallback_types branch from 3358ea0 to 0bc644f Compare June 24, 2025 05:48
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed 01baf76 in 1 minute and 5 seconds. Click for details.
  • Reviewed 80 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 7 draft 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:188
  • Draft comment:
    Alias default value changed from an empty array to an empty object ({}). This improves clarity on its structure. Ensure that users know it now expects a hash map.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None
2. README.md:198
  • Draft comment:
    Fallback default also updated to {} (from an array) to clarify that it’s an object mapping. This should be clearly communicated to users.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None
3. napi/index.d.ts:51
  • Draft comment:
    Updated alias documentation reflects a default value of {}. This update aligns the TypeScript interface with the expected object mapping.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None
4. napi/index.d.ts:119
  • Draft comment:
    Fallback option default is updated to {} in the docs, ensuring consistency with the alias field.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None
5. napi/src/options.rs:25
  • Draft comment:
    The documentation for the alias field now shows a default of {}. This accurately reflects its type (HashMap) and matches the TS declaration.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None
6. src/lib.rs:1
  • Draft comment:
    Header documentation updated with the new project name 'UnRS Resolver' and updated package links. This ensures consistency across docs.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None
7. napi/src/options.rs:22
  • Draft comment:
    There's an extraneous backtick at the end of the comment on line 22 (/// AliasValue::Path(String)). It appears to be a typographical error; please remove it if it's unintended.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_kxX8lLMrOPZrnKNO

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@sonarqubecloud
Copy link

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed 0bc644f in 1 minute and 19 seconds. Click for details.
  • Reviewed 80 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft 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. napi/index.d.ts:51
  • Draft comment:
    Updated the alias default value documentation to '{}' (instead of '[]') – this is clear and now consistent with the intended hash map type.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, explaining a change made to documentation. It doesn't provide a suggestion, ask for confirmation, or highlight a potential issue.
2. napi/index.d.ts:120
  • Draft comment:
    The fallback option’s default value is now documented as '{}' rather than '[]'. This update clearly communicates that fallback is a hash map similar to alias.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, explaining a change in documentation. It does not provide a suggestion, ask for confirmation, or highlight a potential issue. It simply states what has been changed in the documentation.
3. napi/src/options.rs:26
  • Draft comment:
    Doc comments for both the 'alias' and 'fallback' fields now state a default of '{}' – this improves clarity. Consider whether making these fields non-optional (with a default empty map) might further reduce potential unwrap issues, though API compatibility is maintained.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_vCKnILpUCLoPGOt4

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@JounQin JounQin merged commit bbe873d into main Jun 24, 2025
22 checks passed
@JounQin JounQin deleted the docs/alias_fallback_types branch June 24, 2025 05:54
@JounQin JounQin mentioned this pull request Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants