-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update roblox extension #17934
base: main
Are you sure you want to change the base?
Update roblox extension #17934
Conversation
- Merge branch \'contributions/merge-1737665820630\' - feat: add \'Show Image\' command
- feat: enhance image display with ID in markdown - Update Changelog
Thank you for the update! 🎉 Due to our current reduced availability, the initial review may take up to 10-15 business days |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR adds a new command to view Roblox images using their Image ID, with caching and image type validation functionality.
- CHANGELOG.md entries use hardcoded dates (2024-11-22) instead of required {PR_MERGE_DATE} template string
- External API usage (toilettowerdefense.com) in show-image.tsx needs proper error handling and documentation
- Image fetching in show-image.tsx should be wrapped in try-catch and include memory management for large images
- Optional chaining in search-games.tsx is unnecessary since games array is initialized as empty by default
- Metadata folder missing for view commands in new extension (show-image)
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
7 file(s) reviewed, 9 comment(s)
Edit PR Review Bot Settings | Greptile
extensions/roblox/CHANGELOG.md
Outdated
- feat: New command to view an image from Roblox using its Image ID. | ||
|
||
## [Initial Version] - 2024-11-22 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: The date should be {PR_MERGE_DATE} instead of a hardcoded date
## [Initial Version] - 2024-11-22 | |
## [Initial Version] - {PR_MERGE_DATE} |
extensions/roblox/package.json
Outdated
{ | ||
"name": "show-image", | ||
"title": "Show Image", | ||
"description": "Show a Roblox Image!", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Add 'subtitle: "Roblox"' to provide context for the command
}; | ||
|
||
type ImageCache = { | ||
[assetId: string]: ImageData; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: assetId should be number type in ImageCache index signature since grabImage takes a number parameter
[assetId: string]: ImageData; | |
[assetId: number]: ImageData; |
extensions/roblox/package.json
Outdated
{ | ||
"name": "id", | ||
"placeholder": "Image ID", | ||
"type": "text", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider making 'id' required since the command won't work without it
"type": "text", | |
"type": "text", | |
"required": true |
} catch (error) { | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: silently returning null masks all errors - consider using showFailureToast from @raycast/utils to show error messages
extensions/roblox/package.json
Outdated
@@ -104,7 +104,7 @@ | |||
{ | |||
"name": "playing-game", | |||
"title": "Get Playing Game", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Title should be 'Show Playing Game' to follow verb-noun format
|
||
try { | ||
// Fetch the image if not in cache. | ||
const response = await fetch(`https://assetdelivery.roblox.com/v1/asset/?ID=${assetId}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: URL string should be defined as a constant at the module level
|
||
function getImageContentType(buffer: Buffer) { | ||
const magicNumbers = { | ||
"image/jpg": ["ffd8ff", "ffd8ffe0", "ffd8ffe1"], // Added variations for JPEG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: image/jpg is non-standard, should be image/jpeg
"image/jpg": ["ffd8ff", "ffd8ffe0", "ffd8ffe1"], // Added variations for JPEG | |
"image/jpeg": ["ffd8ff", "ffd8ffe0", "ffd8ffe1"], // Added variations for JPEG |
New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected] |
Do you need help with the CI error mentioned here |
It's actually a error with the CLI that stopped me from pushing. Didn't have time to try that again yet. |
If everything it going crazy, then you can also do that directly from GitHub by hitting .(dot) in this PR |
Description
Screencast
Checklist
npm run build
and tested this distribution build in Raycastassets
folder are used by the extension itselfREADME
are placed outside of themetadata
folder