Repository navigation
Update jsr extension - #22503
Update jsr extension#22503
Conversation
|
Thank you for the update! 🎉 You can expect an initial review within five business days. |
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR significantly improves the JSR extension through comprehensive refactoring and feature additions. The code has been reorganized into smaller, reusable components, making it more maintainable.
Key improvements:
- Refactored monolithic components into focused, single-responsibility modules (
Search.tsx,OptionalActions.tsx,StatsSections.tsx) - Added Windows platform support by declaring it in
package.json - Implemented scoped search functionality allowing users to search within specific package scopes (e.g.,
@scope/packageorscope:name) - Added runtime compatibility filters (e.g.,
runtime:deno,runtime:node) for more precise package discovery - Enhanced search with better result boosting and increased result limit from 20 to 50
- Migrated from
.eslintrc.jsonto flat ESLint config with stricter type import rules - Updated all dependencies to latest versions and removed unused
node-fetchdependency - Improved UI with clickable scope navigation and icons for dependencies/dependents
Issues found:
- Typo in preference description: "istead" should be "instead"
- Missing
runtimesinuseMemodependency array could cause stale formData
Confidence Score: 4/5
- This PR is safe to merge after addressing the missing dependency in useMemo
- The refactoring is well-executed with proper separation of concerns. Two minor issues were found: a typo (non-critical) and a missing dependency in useMemo (should be fixed to prevent stale data). The Windows support and new search features are properly implemented.
- Pay attention to
extensions/jsr/src/hooks/useJSRSearch.ts- fix the missing dependency in useMemo before merging
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| extensions/jsr/package.json | 4/5 | Updated dependencies and added Windows platform support; contains typo in preference description |
| extensions/jsr/src/hooks/useJSRSearch.ts | 3/5 | Added scoped search and runtime filtering; missing runtimes in useMemo dependency array |
| extensions/jsr/src/components/Search.tsx | 5/5 | New search component extracted from main file, clean implementation with proper state management |
| extensions/jsr/src/search-jsr.tsx | 5/5 | Simplified to wrapper component calling Search with null scope, excellent refactoring |
| extensions/jsr/src/components/ItemDetails.tsx | 5/5 | Added scope navigation and improved metadata display with icons for dependencies |
Additional Comments (1)
-
extensions/jsr/package.json, line 27 (link)syntax: typo: 'istead' should be 'instead'
14 files reviewed, 2 comments
|
@greptileai score the PR again after the latest changes, please keep it short and concise to the changes |
There was a problem hiding this comment.
Looking at the latest changes in this PR, here's my assessment:
Score: 8.5/10
Strengths:
- Excellent refactoring: Code is now much more modular and maintainable with proper component separation
- Smart search improvements: Added scope-based search and runtime filtering with intelligent query parsing
- Better type safety: Added proper TypeScript types and removed any implicit any types
- Good dependency management: Updated deps and removed unused packages (node-fetch)
- Windows support: Platform expansion is valuable
Minor concerns:
- Migration to eslint.config.js: The new flat config format is correct, but the
defineConfigusage seems non-standard (should be just exporting array directly) - Duplicate filtering logic: Both
useDependenciesanduseDependentshave similar filtering logic that could be abstracted - No error boundaries: New components like
<Search>lack error handling for rendering failures
Suggestion for eslint.config.js:
const raycastConfig = require("@raycast/eslint-config");
module.exports = [
...raycastConfig,
{
rules: {
"@typescript-eslint/consistent-type-imports": "error",
},
}
];
Overall, this is a solid improvement to the extension with well-thought-out features and clean architecture.
pernielsentikaer
left a comment
There was a problem hiding this comment.
Looks good to me, approved 🔥
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
Description
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare located outside the metadata folder if they were not generated with our metadata tool