diff --git a/.eslintignore b/.eslintignore index 359335e5f1..9e691040eb 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,5 @@ sign/** flatpak-build/** playwright-report/** +build/**/* +dist/**/* diff --git a/.eslintrc b/.eslintrc.json similarity index 100% rename from .eslintrc rename to .eslintrc.json diff --git a/.gitattributes b/.gitattributes index bf1a0c8740..1afcec494d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -yarn.lock -diff \ No newline at end of file +yarn.lock linguist-generated=true diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000000..03d9549ea8 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/prettier.xml b/.idea/prettier.xml index b0ab31a954..78546c3d7d 100644 --- a/.idea/prettier.xml +++ b/.idea/prettier.xml @@ -1,6 +1,7 @@ + - \ No newline at end of file + diff --git a/.idea/scopes/Source_Code.xml b/.idea/scopes/Source_Code.xml new file mode 100644 index 0000000000..421352179e --- /dev/null +++ b/.idea/scopes/Source_Code.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 3e19a6f0fd..869d84622a 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,7 +2,10 @@ - + + + diff --git a/electron-builder.yml b/electron-builder.yml new file mode 100644 index 0000000000..6ab663ea93 --- /dev/null +++ b/electron-builder.yml @@ -0,0 +1,94 @@ +appId: com.heroicgameslauncher.hgl +productName: Heroic +afterSign: sign/afterSign.js +afterPack: sign/afterPack.js +files: + - build/**/* + - node_modules/**/* + - '!build/bin/*' + - build/bin/legendary.LICENSE + +asarUnpack: + - build/icon.png + - build/icon.icns + - build/win_icon.ico + - build/icon-dark.png + - build/icon-light.png + - build/webviewPreload.js + +electronDownload: + mirror: https://github.com/castlabs/electron-releases/releases/download/v + +protocols: + - name: heroic + schemes: + - heroic + +win: + artifactName: ${productName}-${version}-Setup-${arch}.${ext} + icon: build/win_icon.ico + asarUnpack: + - build/bin/win32/legendary.exe + - build/bin/win32/gogdl.exe + - build/bin/win32/nile.exe + files: build/bin/win32/* + +portable: + artifactName: ${productName}-${version}-Portable-${arch}.${ext} + +mac: + artifactName: ${productName}-${version}-macOS-${arch}.${ext} + category: public.app-category.games + icon: build/icon.icns + entitlements: build/entitlements.mac.plist + entitlementsInherit: build/entitlements.mac.plist + extendInfo: + com.apple.security.cs.allow-jit: true + asarUnpack: + - build/bin/darwin/legendary + - build/bin/darwin/gogdl + - build/bin/darwin/nile + files: + - build/bin/darwin/* + +dmg: + background: public/dmg.png + window: + width: 600 + height: 500 + contents: + - x: 10 + y: 215 + type: file + - x: 420 + y: 215 + type: link + path: /Applications + +linux: + category: Game + icon: build/icon.icns + description: An Open Source Launcher for GOG and Epic Games + desktop: + Name: Heroic Games Launcher + Comment[de]: Ein Open Source Spielelauncher for GOG und Epic Games + asarUnpack: + - build/bin/linux/legendary + - build/bin/linux/gogdl + - build/bin/linux/nile + - build/bin/linux/vulkan-helper + files: + - build/bin/linux/* + +snap: + base: core20 + confinement: strict + grade: stable + category: Games + synopsis: An Open Source Launcher for GOG Amazon and Epic Games + description: Heroic is an Open Source Games Launcher. Right now it supports launching games from the Epic Games Store using Legendary Amazon Games using Nile and GOG Games using our custom implementations Nile and gogdl. + publish: + provider: snapStore + channels: + - edge + repo: heroic diff --git a/package.json b/package.json index 44655abf1e..692e25f53b 100644 --- a/package.json +++ b/package.json @@ -21,122 +21,32 @@ "engines": { "node": ">= 16" }, - "build": { - "appId": "com.heroicgameslauncher.hgl", - "productName": "Heroic", - "afterSign": "sign/afterSign.js", - "afterPack": "sign/afterPack.js", - "files": [ - "build/**/*", - "node_modules/**/*", - "!build/bin/*", - "build/bin/legendary.LICENSE" - ], - "asarUnpack": [ - "build/icon.png", - "build/icon.icns", - "build/win_icon.ico", - "build/icon-dark.png", - "build/icon-light.png", - "build/webviewPreload.js" - ], - "electronDownload": { - "mirror": "https://github.com/castlabs/electron-releases/releases/download/v" - }, - "protocols": [ - { - "name": "heroic", - "schemes": [ - "heroic" - ] - } - ], - "win": { - "artifactName": "${productName}-${version}-Setup-${arch}.${ext}", - "icon": "build/win_icon.ico", - "asarUnpack": [ - "build/bin/win32/legendary.exe", - "build/bin/win32/gogdl.exe", - "build/bin/win32/nile.exe" - ], - "files": [ - "build/bin/win32/*" - ] - }, - "portable": { - "artifactName": "${productName}-${version}-Portable-${arch}.${ext}" - }, - "mac": { - "artifactName": "${productName}-${version}-macOS-${arch}.${ext}", - "category": "public.app-category.games", - "icon": "build/icon.icns", - "entitlements": "build/entitlements.mac.plist", - "entitlementsInherit": "build/entitlements.mac.plist", - "extendInfo": { - "com.apple.security.cs.allow-jit": true - }, - "asarUnpack": [ - "build/bin/darwin/legendary", - "build/bin/darwin/gogdl", - "build/bin/darwin/nile" - ], - "files": [ - "build/bin/darwin/*" - ] - }, - "dmg": { - "background": "public/dmg.png", - "window": { - "width": "600", - "height": "500" - }, - "contents": [ - { - "x": 10, - "y": 215, - "type": "file" - }, - { - "x": 420, - "y": 215, - "type": "link", - "path": "/Applications" - } - ] - }, - "linux": { - "category": "Game", - "icon": "build/icon.icns", - "description": "An Open Source Launcher for GOG and Epic Games", - "desktop": { - "Name": "Heroic Games Launcher", - "Comment[de]": "Ein Open Source Spielelauncher for GOG und Epic Games" - }, - "asarUnpack": [ - "build/bin/linux/legendary", - "build/bin/linux/gogdl", - "build/bin/linux/nile", - "build/bin/linux/vulkan-helper" - ], - "files": [ - "build/bin/linux/*" - ] - }, - "snap": { - "base": "core20", - "confinement": "strict", - "grade": "stable", - "category": "Games", - "synopsis": "An Open Source Launcher for GOG, Amazon and Epic Games", - "description": "Heroic is an Open Source Games Launcher. Right now it supports launching games from the Epic Games Store using Legendary, Amazon Games using Nile and GOG Games using our custom implementations Nile and gogdl.", - "publish": { - "provider": "snapStore", - "channels": [ - "edge" - ], - "repo": "heroic" - } - } + "scripts": { + "start": "vite", + "codecheck": "tsc --noEmit", + "find-deadcode": "ts-prune --error", + "test": "jest", + "test-watch": "jest --watch --maxWorkers=25%", + "test:ci": "jest --runInBand --silent", + "test:e2e": "vite build && cross-env CI=e2e xvfb-maybe -- playwright test", + "release:linux": "vite build && electron-builder -p always --linux deb AppImage rpm pacman tar.xz snap", + "release:mac": "vite build && electron-builder -p always --mac --x64 --arm64", + "release:win": "vite build && electron-builder -p always --win portable --x64", + "release:updateFlathub:ci": "tsc flathub/update-flathub.ts --skipLibCheck --target es2015 --moduleResolution node --module commonjs && node flathub/update-flathub.js", + "sign:win": "vite build && electron-builder -p never --win nsis --x64", + "dist:linux": "vite build && electron-builder --linux", + "dist:mac": "export CSC_IDENTITY_AUTO_DISCOVERY=false && vite build && electron-builder --mac", + "dist:win": "vite build && electron-builder --win", + "dist:flatpak": "yarn dist:linux appimage && yarn flatpak:prepare && yarn flatpak:build", + "lint": "eslint --cache --ext .tsx,ts .", + "lint-fix": "eslint --fix --ext .tsx,ts ./src", + "flatpak:build": "cd flatpak-build && flatpak-builder build com.heroicgameslauncher.hgl.yml --install --force-clean --user", + "flatpak:prepare": "node ./flatpak/prepareFlatpak.js", + "flatpak:prepare-release": "node ./flatpak/prepareFlatpak.js release", + "i18n": "i18next --silent", + "prepare": "husky install", + "prettier": "prettier --check .", + "prettier-fix": "prettier --write ." }, "dependencies": { "@emotion/react": "11.10.6", @@ -193,39 +103,6 @@ "xvfb-maybe": "^0.2.1", "zod": "3.22.3" }, - "scripts": { - "start": "vite", - "codecheck": "tsc --noEmit", - "find-deadcode": "ts-prune --error", - "test": "jest", - "test-watch": "jest --watch --maxWorkers=25%", - "test:ci": "jest --runInBand --silent", - "test:e2e": "vite build && cross-env CI=e2e xvfb-maybe -- playwright test", - "release:linux": "vite build && electron-builder -p always --linux deb AppImage rpm pacman tar.xz snap", - "release:mac": "vite build && electron-builder -p always --mac --x64 --arm64", - "release:win": "vite build && electron-builder -p always --win portable --x64", - "release:updateFlathub:ci": "tsc flathub/update-flathub.ts --skipLibCheck --target es2015 --moduleResolution node --module commonjs && node flathub/update-flathub.js", - "sign:win": "vite build && electron-builder -p never --win nsis --x64", - "dist:linux": "vite build && electron-builder --linux", - "dist:mac": "export CSC_IDENTITY_AUTO_DISCOVERY=false && vite build && electron-builder --mac", - "dist:win": "vite build && electron-builder --win", - "dist:flatpak": "yarn dist:linux appimage && yarn flatpak:prepare && yarn flatpak:build", - "lint": "eslint --cache -c .eslintrc --ext .tsx,ts .", - "lint-fix": "eslint --fix -c .eslintrc --ext .tsx,ts ./src", - "flatpak:build": "cd flatpak-build && flatpak-builder build com.heroicgameslauncher.hgl.yml --install --force-clean --user", - "flatpak:prepare": "node ./flatpak/prepareFlatpak.js", - "flatpak:prepare-release": "node ./flatpak/prepareFlatpak.js release", - "i18n": "i18next --silent", - "prepare": "husky install", - "prettier": "prettier --check .", - "prettier-fix": "prettier --write ." - }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, "devDependencies": { "@electron/notarize": "^2.1.0", "@playwright/test": "1.39.0", diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index ebbd01cf94..4af46af947 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -1,6 +1,5 @@ { - // extend your base config so you don't have to redefine your compilerOptions "extends": "./tsconfig.json", - "include": ["**/*.ts", "**/*.tsx"], + "include": ["**/*.ts", "**/*.tsx", "**/*.js"], "exclude": [] }