feat: adding pycache to gitignore

This commit is contained in:
Hydra 2024-04-24 10:22:12 +01:00
parent 18de7ca671
commit ca1b9b2170
No known key found for this signature in database
15 changed files with 1084 additions and 1319 deletions

View File

@ -4,6 +4,6 @@ module.exports = {
"plugin:react/recommended", "plugin:react/recommended",
"plugin:react/jsx-runtime", "plugin:react/jsx-runtime",
"@electron-toolkit/eslint-config-ts/recommended", "@electron-toolkit/eslint-config-ts/recommended",
"@electron-toolkit/eslint-config-prettier", "prettier",
], ],
}; };

3
.gitignore vendored
View File

@ -1,4 +1,7 @@
.vscode
node_modules node_modules
hydra-download-manager
__pycache__
dist dist
out out
.DS_Store .DS_Store

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -2,6 +2,8 @@ appId: site.hydralauncher.hydra
productName: Hydra productName: Hydra
directories: directories:
buildResources: build buildResources: build
extraResources:
- hydra-download-manager
files: files:
- "!**/.vscode/*" - "!**/.vscode/*"
- "!src/*" - "!src/*"
@ -13,6 +15,7 @@ asarUnpack:
- resources/** - resources/**
win: win:
executableName: Hydra executableName: Hydra
requestedExecutionLevel: requireAdministrator
nsis: nsis:
artifactName: ${name}-${version}-setup.${ext} artifactName: ${name}-${version}-setup.${ext}
shortcutName: ${productName} shortcutName: ${productName}

View File

@ -4,6 +4,7 @@ import {
loadEnv, loadEnv,
swcPlugin, swcPlugin,
externalizeDepsPlugin, externalizeDepsPlugin,
bytecodePlugin,
} from "electron-vite"; } from "electron-vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin"; import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
@ -25,7 +26,7 @@ export default defineConfig(({ command, mode }) => {
"@locales": resolve("src/locales"), "@locales": resolve("src/locales"),
}, },
}, },
plugins: [externalizeDepsPlugin(), swcPlugin()], plugins: [externalizeDepsPlugin(), swcPlugin(), bytecodePlugin()],
}, },
preload: { preload: {
plugins: [externalizeDepsPlugin()], plugins: [externalizeDepsPlugin()],
@ -37,7 +38,7 @@ export default defineConfig(({ command, mode }) => {
"@locales": resolve("src/locales"), "@locales": resolve("src/locales"),
}, },
}, },
plugins: [svgr(), react(), vanillaExtractPlugin()], plugins: [svgr(), react(), vanillaExtractPlugin(), bytecodePlugin()],
}, },
}; };
}); });

View File

@ -3,7 +3,7 @@
"version": "1.0.0", "version": "1.0.0",
"description": "An Electron application with React and TypeScript", "description": "An Electron application with React and TypeScript",
"main": "./out/main/index.js", "main": "./out/main/index.js",
"author": "example.com", "author": "Hydra Launcher",
"homepage": "https://electron-vite.org", "homepage": "https://electron-vite.org",
"type": "module", "type": "module",
"scripts": { "scripts": {
@ -14,7 +14,7 @@
"typecheck": "npm run typecheck:node && npm run typecheck:web", "typecheck": "npm run typecheck:node && npm run typecheck:web",
"start": "electron-vite preview", "start": "electron-vite preview",
"dev": "electron-vite dev", "dev": "electron-vite dev",
"build": "npm run typecheck && electron-vite build", "build": "electron-vite build",
"postinstall": "electron-builder install-app-deps", "postinstall": "electron-builder install-app-deps",
"build:unpack": "npm run build && electron-builder --dir", "build:unpack": "npm run build && electron-builder --dir",
"build:win": "npm run build && electron-builder --win", "build:win": "npm run build && electron-builder --win",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

View File

@ -7,7 +7,7 @@ import { formatName, getSteamAppAsset, repackerFormatter } from "@main/helpers";
import { stateManager } from "@main/state-manager"; import { stateManager } from "@main/state-manager";
const { Index } = flexSearch; const { Index } = flexSearch;
const repacksIndex = new Index(); const repacksIndex = new Index({ tokenize: "strict" });
const steamGamesIndex = new Index({ tokenize: "forward" }); const steamGamesIndex = new Index({ tokenize: "forward" });
const repacks = stateManager.getValue("repacks"); const repacks = stateManager.getValue("repacks");
@ -21,6 +21,8 @@ for (let i = 0; i < repacks.length; i++) {
repacksIndex.add(i, formatName(formatter(repack.title))); repacksIndex.add(i, formatName(formatter(repack.title)));
} }
console.log(true);
for (let i = 0; i < steamGames.length; i++) { for (let i = 0; i < steamGames.length; i++) {
const steamGame = steamGames[i]; const steamGame = steamGames[i];
steamGamesIndex.add(i, formatName(steamGame.name)); steamGamesIndex.add(i, formatName(steamGame.name));

View File

@ -50,7 +50,6 @@ export class TorrentClient {
const binaryName = binaryNameByPlatform[process.platform]; const binaryName = binaryNameByPlatform[process.platform];
const binaryPath = path.join( const binaryPath = path.join(
process.resourcesPath, process.resourcesPath,
"dist",
"hydra-download-manager", "hydra-download-manager",
binaryName binaryName
); );

View File

@ -1,15 +1,10 @@
<!doctype html> <!doctype html>
<html> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>Electron</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> <title>Hydra</title>
<!-- <meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
/> -->
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script type="module" src="/src/main.tsx"></script> <script type="module" src="/src/main.tsx"></script>

View File

@ -22,7 +22,7 @@ import {
document.body.classList.add(themeClass); document.body.classList.add(themeClass);
export function App() { export function App({ children }: any) {
const contentRef = useRef<HTMLDivElement>(null); const contentRef = useRef<HTMLDivElement>(null);
const { updateLibrary } = useLibrary(); const { updateLibrary } = useLibrary();
@ -112,7 +112,7 @@ export function App() {
/> />
<section ref={contentRef} className={styles.content}> <section ref={contentRef} className={styles.content}>
<Outlet /> {children}
</section> </section>
</article> </article>
</main> </main>

View File

@ -4,7 +4,7 @@ import i18n from "i18next";
import { initReactI18next } from "react-i18next"; import { initReactI18next } from "react-i18next";
import { Provider } from "react-redux"; import { Provider } from "react-redux";
import LanguageDetector from "i18next-browser-languagedetector"; import LanguageDetector from "i18next-browser-languagedetector";
import { createHashRouter, RouterProvider } from "react-router-dom"; import { HashRouter, Route, Routes } from "react-router-dom";
import { init } from "@sentry/electron/renderer"; import { init } from "@sentry/electron/renderer";
import { init as reactInit } from "@sentry/react"; import { init as reactInit } from "@sentry/react";
@ -46,39 +46,6 @@ if (import.meta.env.RENDERER_VITE_SENTRY_DSN) {
); );
} }
const router = createHashRouter([
{
path: "/",
Component: App,
children: [
{
path: "/",
Component: Home,
},
{
path: "/catalogue",
Component: Catalogue,
},
{
path: "/downloads",
Component: Downloads,
},
{
path: "/game/:shop/:objectID",
Component: GameDetails,
},
{
path: "/search",
Component: SearchResults,
},
{
path: "/settings",
Component: Settings,
},
],
},
]);
i18n i18n
.use(LanguageDetector) .use(LanguageDetector)
.use(initReactI18next) .use(initReactI18next)
@ -96,7 +63,19 @@ i18n
ReactDOM.createRoot(document.getElementById("root")!).render( ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode> <React.StrictMode>
<Provider store={store}> <Provider store={store}>
<RouterProvider router={router} /> <HashRouter>
<App>
<Routes>
<Route path="/" Component={Home} />
<Route path="/catalogue" Component={Catalogue} />
<Route path="/downloads" Component={Downloads} />
<Route path="/game/:shop/:objectID" Component={GameDetails} />
<Route path="/search" Component={SearchResults} />
<Route path="/settings" Component={Settings} />
</Routes>
</App>
</HashRouter>
{/* <RouterProvider router={router} /> */}
</Provider> </Provider>
</React.StrictMode> </React.StrictMode>
); );

View File

@ -3,7 +3,7 @@ from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning. # Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = { build_exe_options = {
"packages": ["libtorrent"], "packages": ["libtorrent"],
"build_exe": "resources/dist/hydra-download-manager", "build_exe": "hydra-download-manager",
"include_msvcr": True "include_msvcr": True
} }

2315
yarn.lock

File diff suppressed because it is too large Load Diff