docs: update alias and fallback options type and description#161
docs: update alias and fallback options type and description#161
alias and fallback options type and description#161Conversation
There was a problem hiding this comment.
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 |
WalkthroughThe changes update documentation and comments across the codebase. The README and Rust documentation now clarify that the default values for the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
⏰ Context from checks skipped due to timeout of 90000ms (2)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 4e47004 in 1 minute and 4 seconds. Click for details.
- Reviewed
58lines of code in3files - Skipped
0files when reviewing. - Skipped posting
4draft 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%<= threshold50%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%<= threshold50%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%<= threshold50%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 by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
napi/src/options.rs (1)
88-90: Same mismatch between documented default and actual defaultFor
fallback, the comment should mirror the clarification made foralias.-/// 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 isOption<…>
aliasis declared asOption<HashMap<…>>. WhenNone,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 expectSome(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 clearerConsider 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 forfallback-| 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
📒 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 goodThe crate-level docs now reference the new crate and npm package names; no issues spotted.
CodSpeed Performance ReportMerging #161 will not alter performanceComparing Summary
|
4e47004 to
a3ee55a
Compare
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed a3ee55a in 1 minute and 2 seconds. Click for details.
- Reviewed
79lines of code in4files - Skipped
0files when reviewing. - Skipped posting
4draft 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%<= threshold50%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%<= threshold50%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%<= threshold50%None
4. napi/src/options.rs:22
- Draft comment:
There seems to be an issue with the markdown formatting. The textAliasValue::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 by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
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
📒 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 goodSwitching the default values of
aliasandfallbackfrom[]to{}accurately reflects their real types (hash maps).
No additional issues spotted in these rows.Also applies to: 198-198
a3ee55a to
01baf76
Compare
3358ea0 to
0bc644f
Compare
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed 01baf76 in 1 minute and 5 seconds. Click for details.
- Reviewed
80lines of code in4files - Skipped
0files when reviewing. - Skipped posting
7draft 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%<= threshold50%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%<= threshold50%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%<= threshold50%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%<= threshold50%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%<= threshold50%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%<= threshold50%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 by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
|
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed 0bc644f in 1 minute and 19 seconds. Click for details.
- Reviewed
80lines of code in4files - Skipped
0files when reviewing. - Skipped posting
3draft 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%<= threshold50%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%<= threshold50%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 by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.



related #557
Important
Update documentation for
aliasandfallbackoptions to reflect new default values and descriptions.aliasandfallbackdefault values from[]to{}inREADME.md,napi/index.d.ts, andnapi/src/options.rs.aliasandfallbackoptions innapi/index.d.tsandnapi/src/options.rs.src/lib.rsto reflect new project name and package URLs.This description was created by
for 0bc644f. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit