From ce0619bbe398b6e03e61641d3ecfae6d41d5bbca Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Tue, 28 Oct 2025 22:40:06 +0000 Subject: [PATCH 1/9] ci: adding releases --- .github/workflows/build-renderer.yml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-renderer.yml b/.github/workflows/build-renderer.yml index f7361883..0d219c1e 100644 --- a/.github/workflows/build-renderer.yml +++ b/.github/workflows/build-renderer.yml @@ -6,23 +6,38 @@ concurrency: on: push: - branches: [main] + branches: + - main + - release/** jobs: build: runs-on: ubuntu-latest + permissions: + contents: read + + env: + NODE_OPTIONS: --max-old-space-size=4096 + BRANCH_NAME: ${{ github.ref_name }} + steps: - name: Check out Git repository uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Install Node.js + - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: 22.21.0 + cache: 'yarn' + + - name: Enable Corepack (Yarn) + run: corepack enable - name: Install dependencies - run: yarn --frozen-lockfile --ignore-scripts + run: yarn install --frozen-lockfile --ignore-scripts - name: Build Renderer run: yarn build @@ -36,5 +51,5 @@ jobs: run: | npx --yes wrangler@3 pages deploy out/renderer \ --project-name="hydra" \ - --commit-dirty=true \ - --branch="main" + --branch "$BRANCH_NAME" \ + --commit-dirty \ No newline at end of file From dc8a19e8451e8e8466fe1453cb64d1fb9452f7a1 Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Tue, 28 Oct 2025 23:02:40 +0000 Subject: [PATCH 2/9] ci: adding ci vars --- .env.example | 1 + .github/workflows/build-renderer.yml | 4 ++-- .github/workflows/release.yml | 8 +++++--- src/main/services/window-manager.ts | 13 +++++++++---- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index 3f914eb3..051d8aa3 100644 --- a/.env.example +++ b/.env.example @@ -3,3 +3,4 @@ MAIN_VITE_AUTH_URL= MAIN_VITE_WS_URL= RENDERER_VITE_REAL_DEBRID_REFERRAL_ID= RENDERER_VITE_TORBOX_REFERRAL_CODE= +MAIN_VITE_LAUNCHER_SUBDOMAIN= diff --git a/.github/workflows/build-renderer.yml b/.github/workflows/build-renderer.yml index 0d219c1e..2904bcb8 100644 --- a/.github/workflows/build-renderer.yml +++ b/.github/workflows/build-renderer.yml @@ -31,7 +31,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22.21.0 - cache: 'yarn' + cache: "yarn" - name: Enable Corepack (Yarn) run: corepack enable @@ -52,4 +52,4 @@ jobs: npx --yes wrangler@3 pages deploy out/renderer \ --project-name="hydra" \ --branch "$BRANCH_NAME" \ - --commit-dirty \ No newline at end of file + --commit-dirty diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 75ff209a..7408665f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,9 @@ concurrency: on: push: - branches: [main] + branches: + - main + - release/** jobs: build: @@ -61,7 +63,7 @@ jobs: RENDERER_VITE_SENTRY_DSN: ${{ vars.SENTRY_DSN }} RENDERER_VITE_REAL_DEBRID_REFERRAL_ID: ${{ vars.RENDERER_VITE_REAL_DEBRID_REFERRAL_ID }} RENDERER_VITE_TORBOX_REFERRAL_CODE: ${{ vars.RENDERER_VITE_TORBOX_REFERRAL_CODE }} - MAIN_VITE_RENDERER_URL: ${{ vars.MAIN_VITE_RENDERER_URL }} + MAIN_VITE_LAUNCHER_SUBDOMAIN: ${{ vars.MAIN_VITE_LAUNCHER_SUBDOMAIN }} - name: Build Windows if: matrix.os == 'windows-2022' @@ -78,7 +80,7 @@ jobs: RENDERER_VITE_SENTRY_DSN: ${{ vars.SENTRY_DSN }} RENDERER_VITE_REAL_DEBRID_REFERRAL_ID: ${{ vars.RENDERER_VITE_REAL_DEBRID_REFERRAL_ID }} RENDERER_VITE_TORBOX_REFERRAL_CODE: ${{ vars.RENDERER_VITE_TORBOX_REFERRAL_CODE }} - MAIN_VITE_RENDERER_URL: ${{ vars.MAIN_VITE_RENDERER_URL }} + MAIN_VITE_LAUNCHER_SUBDOMAIN: ${{ vars.MAIN_VITE_LAUNCHER_SUBDOMAIN }} - name: Create artifact uses: actions/upload-artifact@v4 diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index 7055fc09..4c52b581 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -24,7 +24,8 @@ import type { UserPreferences, } from "@types"; import { AuthPage, generateAchievementCustomNotificationTest } from "@shared"; -import { isStaging } from "@main/constants"; +import { appVersion, isStaging } from "@main/constants"; +import { logger } from "./logger"; export class WindowManager { public static mainWindow: Electron.BrowserWindow | null = null; @@ -54,6 +55,10 @@ export class WindowManager { show: false, }; + private static formatVersionNumber(version: string) { + return version.replaceAll(".", "-"); + } + private static async loadWindowURL(window: BrowserWindow, hash: string = "") { // HMR for renderer base on electron-vite cli. // Load the remote URL for development or the local html file for production. @@ -63,12 +68,12 @@ export class WindowManager { // Try to load from remote URL in production try { await window.loadURL( - `${import.meta.env.MAIN_VITE_RENDERER_URL}#/${hash}` + `https://release-${this.formatVersionNumber(appVersion)}.${import.meta.env.MAIN_VITE_LAUNCHER_SUBDOMAIN}#/${hash}` ); } catch (error) { // Fall back to local file if remote URL fails - console.error( - "Failed to load from MAIN_VITE_RENDERER_URL, falling back to local file:", + logger.error( + "Failed to load from MAIN_VITE_LAUNCHER_SUBDOMAIN, falling back to local file:", error ); window.loadFile(path.join(__dirname, "../renderer/index.html"), { From 8a12c6e088195a6fb22e30c9ab2af0e1f1a7c3b7 Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Tue, 28 Oct 2025 23:26:28 +0000 Subject: [PATCH 3/9] chore: sync with main --- src/main/services/window-manager.ts | 2 +- src/main/vite-env.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index 33b6785c..c7335f8a 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -68,7 +68,7 @@ export class WindowManager { // Try to load from remote URL in production try { await window.loadURL( - `https://release-${this.formatVersionNumber(appVersion)}.${import.meta.env.MAIN_VITE_LAUNCHER_SUBDOMAIN}#/${hash}` + `https://release-v${this.formatVersionNumber(appVersion)}.${import.meta.env.MAIN_VITE_LAUNCHER_SUBDOMAIN}#/${hash}` ); } catch (error) { // Fall back to local file if remote URL fails diff --git a/src/main/vite-env.d.ts b/src/main/vite-env.d.ts index c9b006d5..7b0ed536 100644 --- a/src/main/vite-env.d.ts +++ b/src/main/vite-env.d.ts @@ -7,7 +7,7 @@ interface ImportMetaEnv { readonly MAIN_VITE_CHECKOUT_URL: string; readonly MAIN_VITE_EXTERNAL_RESOURCES_URL: string; readonly MAIN_VITE_WS_URL: string; - readonly MAIN_VITE_RENDERER_URL: string; + readonly MAIN_VITE_LAUNCHER_SUBDOMAIN: string; readonly ELECTRON_RENDERER_URL: string; } From dc6d578462a392ba359b61a034df7598d70f4a70 Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Tue, 28 Oct 2025 23:49:09 +0000 Subject: [PATCH 4/9] chore: sync with main --- src/main/services/window-manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index c7335f8a..aeff3808 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -64,7 +64,7 @@ export class WindowManager { // Load the remote URL for development or the local html file for production. if (is.dev && process.env["ELECTRON_RENDERER_URL"]) { window.loadURL(`${process.env["ELECTRON_RENDERER_URL"]}#/${hash}`); - } else if (import.meta.env.MAIN_VITE_RENDERER_URL) { + } else if (import.meta.env.MAIN_VITE_LAUNCHER_SUBDOMAIN) { // Try to load from remote URL in production try { await window.loadURL( From b1069426e4b035703ba2f79aeb758030bc0344c0 Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Wed, 29 Oct 2025 01:47:35 +0000 Subject: [PATCH 5/9] chore: sync with main --- package.json | 2 +- src/main/services/window-manager.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9ed25fa9..5d84e763 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hydralauncher", - "version": "3.7.1", + "version": "3.7.2", "description": "Hydra", "main": "./out/main/index.js", "author": "Los Broxas", diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index aeff3808..673bf1a0 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -24,7 +24,7 @@ import type { UserPreferences, } from "@types"; import { AuthPage, generateAchievementCustomNotificationTest } from "@shared"; -import { appVersion, isStaging } from "@main/constants"; +import { isStaging } from "@main/constants"; import { logger } from "./logger"; export class WindowManager { @@ -68,7 +68,7 @@ export class WindowManager { // Try to load from remote URL in production try { await window.loadURL( - `https://release-v${this.formatVersionNumber(appVersion)}.${import.meta.env.MAIN_VITE_LAUNCHER_SUBDOMAIN}#/${hash}` + `https://release-v${this.formatVersionNumber(app.getVersion())}.${import.meta.env.MAIN_VITE_LAUNCHER_SUBDOMAIN}#/${hash}` ); } catch (error) { // Fall back to local file if remote URL fails From 274080069fd7997600c9ad296c52a148f821c934 Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Wed, 29 Oct 2025 02:12:17 +0000 Subject: [PATCH 6/9] feat: forcing dev tools --- src/main/services/window-manager.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index 673bf1a0..3e241467 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -197,6 +197,8 @@ export class WindowManager { this.mainWindow.removeMenu(); this.mainWindow.on("ready-to-show", () => { + WindowManager.mainWindow?.webContents.openDevTools(); + if (!app.isPackaged || isStaging) WindowManager.mainWindow?.webContents.openDevTools(); WindowManager.mainWindow?.show(); From f99f8d95548638678b21610b8511e44207e00730 Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Wed, 29 Oct 2025 02:32:45 +0000 Subject: [PATCH 7/9] feat: forcing dev tools --- src/main/services/window-manager.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index 3e241467..a9b742ba 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -24,7 +24,7 @@ import type { UserPreferences, } from "@types"; import { AuthPage, generateAchievementCustomNotificationTest } from "@shared"; -import { isStaging } from "@main/constants"; +import { appVersion, isStaging } from "@main/constants"; import { logger } from "./logger"; export class WindowManager { @@ -197,8 +197,6 @@ export class WindowManager { this.mainWindow.removeMenu(); this.mainWindow.on("ready-to-show", () => { - WindowManager.mainWindow?.webContents.openDevTools(); - if (!app.isPackaged || isStaging) WindowManager.mainWindow?.webContents.openDevTools(); WindowManager.mainWindow?.show(); From e143fadf381a5992e26b699ca6c7b4a38e0bfc06 Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Wed, 29 Oct 2025 02:55:37 +0000 Subject: [PATCH 8/9] fix: fixing import --- src/main/services/window-manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index a9b742ba..673bf1a0 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -24,7 +24,7 @@ import type { UserPreferences, } from "@types"; import { AuthPage, generateAchievementCustomNotificationTest } from "@shared"; -import { appVersion, isStaging } from "@main/constants"; +import { isStaging } from "@main/constants"; import { logger } from "./logger"; export class WindowManager { From 499a830e3ec1bd50124f97c515be01363ecf770e Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Wed, 29 Oct 2025 18:23:06 +0000 Subject: [PATCH 9/9] chore: sync with main --- .github/workflows/release.yml | 1 - .../src/components/text-field/text-field.tsx | 16 ++++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7408665f..df01b358 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,6 @@ concurrency: on: push: branches: - - main - release/** jobs: diff --git a/src/renderer/src/components/text-field/text-field.tsx b/src/renderer/src/components/text-field/text-field.tsx index 7c0cbb58..76759126 100644 --- a/src/renderer/src/components/text-field/text-field.tsx +++ b/src/renderer/src/components/text-field/text-field.tsx @@ -4,10 +4,11 @@ import { useTranslation } from "react-i18next"; import cn from "classnames"; import "./text-field.scss"; -export interface TextFieldProps extends React.DetailedHTMLProps< - React.InputHTMLAttributes, - HTMLInputElement -> { +export interface TextFieldProps + extends React.DetailedHTMLProps< + React.InputHTMLAttributes, + HTMLInputElement + > { theme?: "primary" | "dark"; label?: string | React.ReactNode; hint?: string | React.ReactNode; @@ -42,7 +43,10 @@ export const TextField = React.forwardRef( const [isPasswordVisible, setIsPasswordVisible] = useState(false); const { t } = useTranslation("forms"); const showPasswordToggleButton = props.type === "password"; - const inputType = props.type === "password" && isPasswordVisible ? "text" : props.type ?? "text"; + const inputType = + props.type === "password" && isPasswordVisible + ? "text" + : (props.type ?? "text"); const hintContent = error ? ( {error} ) : hint ? ( @@ -106,4 +110,4 @@ export const TextField = React.forwardRef( ); } ); -TextField.displayName = "TextField"; \ No newline at end of file +TextField.displayName = "TextField";