Skip to content
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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Update roblox extension #17934

wants to merge 8 commits into from

Conversation

iamEvanYT
Copy link
Contributor

@iamEvanYT iamEvanYT commented Mar 17, 2025

Description

  • fix: Fixed some errors and improved the code.
  • chore: updated dependencies
  • I don't know why it said I added a command, but that command was already added in Update roblox extension #16576

Screencast

Checklist

Sorry, something went wrong.

- Merge branch \'contributions/merge-1737665820630\'
- feat: add \'Show Image\' command
- feat: enhance image display with ID in markdown
- Update Changelog
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: roblox Issues related to the roblox extension labels Mar 17, 2025
@raycastbot
Copy link
Collaborator

Thank you for the update! 🎉

Due to our current reduced availability, the initial review may take up to 10-15 business days

@raycastbot raycastbot added the OP is author The OP of the PR is the author of the extension label Mar 17, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

- feat: New command to view an image from Roblox using its Image ID.

## [Initial Version] - 2024-11-22
Copy link
Contributor

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

Suggested change
## [Initial Version] - 2024-11-22
## [Initial Version] - {PR_MERGE_DATE}

{
"name": "show-image",
"title": "Show Image",
"description": "Show a Roblox Image!",
Copy link
Contributor

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;
Copy link
Contributor

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

Suggested change
[assetId: string]: ImageData;
[assetId: number]: ImageData;

{
"name": "id",
"placeholder": "Image ID",
"type": "text",
Copy link
Contributor

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

Suggested change
"type": "text",
"type": "text",
"required": true

Comment on lines 76 to 78
} catch (error) {
return null;
}
Copy link
Contributor

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

@@ -104,7 +104,7 @@
{
"name": "playing-game",
"title": "Get Playing Game",
Copy link
Contributor

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}`);
Copy link
Contributor

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
Copy link
Contributor

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

Suggested change
"image/jpg": ["ffd8ff", "ffd8ffe0", "ffd8ffe1"], // Added variations for JPEG
"image/jpeg": ["ffd8ff", "ffd8ffe0", "ffd8ffe1"], // Added variations for JPEG

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@raycast/[email protected] environment, filesystem +2 459 kB thomlom
npm/[email protected] network 0 93.3 kB lquixada
npm/[email protected]8.57.1 filesystem Transitive: shell +6 4.53 MB eslintbot
npm/[email protected] None 0 22.4 MB typescript-bot

🚮 Removed packages: npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

@raycast raycast deleted a comment from greptile-apps bot Mar 18, 2025
@pernielsentikaer
Copy link
Collaborator

Do you need help with the CI error mentioned here

@iamEvanYT
Copy link
Contributor Author

It's actually a error with the CLI that stopped me from pushing. Didn't have time to try that again yet.

@pernielsentikaer
Copy link
Collaborator

If everything it going crazy, then you can also do that directly from GitHub by hitting .(dot) in this PR

@pernielsentikaer pernielsentikaer self-assigned this Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension fix / improvement Label for PRs with extension's fix improvements extension: roblox Issues related to the roblox extension OP is author The OP of the PR is the author of the extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants