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

Add Hearthstone #17952

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add Hearthstone #17952

wants to merge 1 commit into from

Conversation

RaffeYang
Copy link
Contributor

@RaffeYang RaffeYang commented Mar 18, 2025

Description

Hearthstone

⚡ Quickly find top Hearthstone decks and manage card collections directly from Raycast

Features

🃏 Competitive Deck Search

  • Wild/Standard Decks: Find top meta decks for both Wild and Standard formats
  • Class Filtering: Search decks by class (Druid, Warrior, Rogue, Priest, etc.)
  • Winrate Display: See deck winrates at a glance
  • Dust Cost: View deck crafting costs in your preferred currency

🚀 Quick Actions

  • Deck Code Copy: Instant copy-to-clipboard for deck codes (Enter)
  • Detailed Preview
  • Full card list with mana costs
  • High-resolution card images
  • Deck performance statistics
  • Quick Navigation: One-click access to HSGuru.com for full analysis (⌘+Enter)

Installation

  1. Raycast Store (Recommended):

  1. Manual Build:
    npm install && npm run dev

Workflow Example

  1. Open Raycast and type hs
  2. Select format:
    Wild → See top 25 wild decks
    Standard → View current meta decks
  3. Filter by class using ⌘F
  4. Press to:
    • Copy deck code (Enter)
    • View detailed card list (Enter)
    • Open in HSGuru.com (⌘ Enter)

Disclaimer: Not affiliated with Blizzard Entertainment. Card data © respective rights holders.
License: MIT

Checklist

Greptile Summary

This PR adds a comprehensive Hearthstone extension for Raycast, enabling users to search decks, browse cards, and manage collections with multi-language support and detailed card views.

  • The extension has view commands in package.json but missing metadata folder with screenshots for store listing - please add it following Raycast Documentation
  • launchCommand in src/utils/hsguru.ts should be wrapped in try-catch blocks when making API calls to HSGuru
  • Consider adding subtitle to commands in package.json with "Hearthstone" to help users distinguish them from other card game extensions
  • Lists and Grids should use isLoading to avoid empty state flicker per Raycast Documentation
  • Consider using showFailureToast from @raycast/utils instead of manual error handling in try-catch blocks

💡 (4/5) You can add custom instructions or style guidelines for the bot here!

@raycastbot raycastbot added the new extension Label for PRs with new extensions label Mar 18, 2025
@raycastbot
Copy link
Collaborator

Congratulations on your new Raycast extension! 🚀

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

Once the PR is approved and merged, the extension will be available on our Store.

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.

17 file(s) reviewed, 24 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +7 to +10
raycast-env.d.ts
.raycast-swift-build
.swiftpm
compiled_raycast_swift
Copy link
Contributor

Choose a reason for hiding this comment

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

style: These Swift-related ignore patterns (.raycast-swift-build, .swiftpm, compiled_raycast_swift) seem unnecessary since this appears to be a TypeScript/JavaScript extension. Consider removing them unless Swift functionality is planned.

Suggested change
raycast-env.d.ts
.raycast-swift-build
.swiftpm
compiled_raycast_swift
raycast-env.d.ts

@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Raffe Yang
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Copyright year 2025 is in the future. Should be current year 2024 or earlier.

Suggested change
Copyright (c) 2025 Raffe Yang
Copyright (c) 2024 Raffe Yang

Comment on lines +14 to +17
"title": "Decks",
"name": "search-best-decks",
"description": "Search the best Hearthstone decks",
"mode": "view"
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 adding subtitle 'Hearthstone' to differentiate from other deck-related commands

Comment on lines +20 to +23
"title": "Heroes",
"name": "search-class-decks",
"description": "Search the best Hearthstone decks per class",
"mode": "view"
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 adding subtitle 'Hearthstone' to differentiate from other hero-related commands

Comment on lines +26 to +29
"title": "Cards",
"name": "card-list",
"description": "Browse Hearthstone cards",
"mode": "view"
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 adding subtitle 'Hearthstone' to differentiate from other card-related commands

minGames?: number;
}

export const CardData: Card[] = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Empty CardData array is exported but never populated - consider removing if unused or document its purpose


export interface DeckListProps {
className?: ClassName;
format?: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

style: format is typed as number but should be a union type of valid formats (1 | 2) for better type safety

import { CacheEntry } from "./utils";

const CACHE_DURATION_IN_MS = 3600 * 1_000;
export const hsguru_BEST_DECKS_URL = (format: number) => `https://www.hsguru.com/decks/?format=${format}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

style: variable name should be camelCase (hsguru_BEST_DECKS_URL -> hsguruBestDecksUrl) to match TypeScript conventions

};

export const fetchDecks = async (url: string) => {
const response = await axios.get(url);
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: network request needs error handling - wrap in try/catch and use showFailureToast from @raycast/utils

Suggested change
const response = await axios.get(url);
try {
const response = await axios.get(url);
} catch (error) {
showFailureToast("Failed to fetch decks", { description: error instanceof Error ? error.message : String(error) });
return [];
}

return url;
};

export const gethsguruBestDecks = async (format: number = 1) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

style: function name should be camelCase (gethsguruBestDecks -> getHsguruBestDecks)

@ridemountainpig
Copy link
Contributor

I added some comments in #17812. Setting the default language value as the preference for the card list grid dropdown would greatly enhance the user experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new extension Label for PRs with new extensions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants