Skip to content

Commit

Permalink
General repo cleanup (#3420)
Browse files Browse the repository at this point in the history
* Move electron-builder config into separate file

* Actually exclude yarn lock file from GitHub diffs

"-diff" only tells Git to treat the file as binary, which was not my
intention with the original change

* Remove unused ESLint config section

This isn't used, since we have a proper config file (.eslintrc)

* Include JS files in ESLint

* Move `scripts` above `dependencies`

This is just for readability’s sake. I'd argue that adding/modifying
scripts happens more often than manually modifying our dependency list

* Rename `.eslintrc` -> `.eslintrc.json`

* Add more Webstorm config files to the repo

This adds:
- ESLint and Prettier config
- A scope for the `src` directory
- Git commit lines being limited to 80 characters

* Remove comment from ESLint's tsconfig

Comments aren't valid JSON
  • Loading branch information
CommandMC authored Feb 3, 2024
1 parent 5c5e0fc commit f320fde
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 154 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
sign/**
flatpak-build/**
playwright-report/**
build/**/*
dist/**/*
File renamed without changes.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarn.lock -diff
yarn.lock linguist-generated=true
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/scopes/Source_Code.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

94 changes: 94 additions & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
@@ -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
175 changes: 26 additions & 149 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -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": []
}

0 comments on commit f320fde

Please sign in to comment.