Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Heroic-Games-Launcher/HeroicGamesLa…
Browse files Browse the repository at this point in the history
…uncher into refactor-sidebar-cleanup
  • Loading branch information
arielj committed Apr 25, 2024
2 parents d145c71 + 7a7a558 commit be86363
Show file tree
Hide file tree
Showing 224 changed files with 14,802 additions and 11,190 deletions.
14 changes: 0 additions & 14 deletions .devcontainer/devcontainer.json

This file was deleted.

2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarn.lock linguist-generated=true
pnpm-lock.yaml linguist-generated=true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ body:
- type: markdown
attributes:
value: |-
## Latest stable version of Heroic is v2.11.0. Please, update Heroic before reporting a bug if you have an older version.
## Latest stable version of Heroic is v2.14.1. Please, update Heroic before reporting a bug if you have an older version.
- type: dropdown
id: heroic_version
attributes:
Expand Down
8 changes: 6 additions & 2 deletions .github/actions/install-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ runs:
- uses: actions/setup-node@v3
with:
node-version: '20'
- uses: pnpm/action-setup@v3
with:
version: 8
standalone: ${{ runner.os == 'Windows' }}
- name: Install node-gyp
run: npm install --global node-gyp
run: pnpm add --global node-gyp
shell: bash
- name: Install modules
run: npm install --legacy-peer-deps
run: pnpm install
shell: bash
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
8 changes: 4 additions & 4 deletions .github/workflows/build-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- name: Build Windows Portable version
run: yarn dist:win portable
run: pnpm dist:win portable
if: runner.os == 'Windows'
- name: Build macOS x64 & arm64 versions
run: yarn dist:mac --x64 --arm64 --publish=never
run: pnpm dist:mac --x64 --arm64 --publish=never
env:
GITHUB_TOKEN: ${{ secrets.workflowToken }}
GH_TOKEN: ${{ secrets.workflowToken }}
Expand All @@ -35,12 +35,12 @@ jobs:
- name: Build and publish Snap version
run: |
sudo apt-get install --no-install-recommends -y snapcraft
yarn dist:linux Snap --publish=always
pnpm dist:linux Snap --publish=always
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraftIdEdge }}
if: runner.os == 'Linux' && inputs.publish-snap
- name: Build AppImage version
run: yarn dist:linux AppImage --publish=never
run: pnpm dist:linux AppImage --publish=never
if: runner.os == 'Linux'
- name: Upload built version
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build:
uses: ./.github/workflows/build-base.yml
with:
publish-snap: true
publish-snap: false
secrets:
snapcraftIdEdge: ${{ secrets.SNAPCRAFT_ID_EDGE }}
workflowToken: ${{ secrets.WORKFLOW_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/codecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- name: Check Typescript syntax
run: yarn codecheck
run: pnpm codecheck
2 changes: 1 addition & 1 deletion .github/workflows/draft-release-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- run: sudo apt-get install --no-install-recommends -y libarchive-tools libopenjp2-tools rpm snapcraft
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- run: npm run release:linux
- run: pnpm release:linux
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/draft-release-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
with:
python-version: '3.10'
- run: python3 -m pip install castlabs-evs
- run: npm run release:mac
- run: pnpm release:mac
2 changes: 1 addition & 1 deletion .github/workflows/draft-release-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
python-version: '3.10'
- run: python3 -m pip install castlabs-evs
- run: npm run release:win
- run: pnpm release:win
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/flatpak-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,14 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install modules.
run: npm i --legacy-peer-deps
- uses: ./.github/actions/install-deps
- name: Build artifacts.
run: npm run dist:linux appimage --publish=never
run: pnpm dist:linux appimage --publish=never
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
- name: Prepare Flatpak
run: npm run flatpak:prepare
run: pnpm flatpak:prepare
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- name: Lint code.
run: yarn lint
run: pnpm lint
- name: Prettier code.
run: yarn prettier
run: pnpm prettier
- name: Find dead code
run: yarn find-deadcode
run: pnpm find-deadcode
2 changes: 1 addition & 1 deletion .github/workflows/release_flathub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Checkout flathub repository.
run: git clone https://github.com/flathub/com.heroicgameslauncher.hgl.git
- name: Update flathub release
run: export RELEASE_VERSION=${{ github.ref_name }} && yarn release:updateFlathub:ci
run: export RELEASE_VERSION=${{ github.ref_name }} && pnpm release:updateFlathub:ci
- name: Branch flathub repo
run: git checkout -b "${{ github.ref_name }}"
working-directory: ./com.heroicgameslauncher.hgl
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- name: Test CI
run: yarn test:ci
run: pnpm test:ci
e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout repository.
uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- name: Test E2E
run: yarn test:e2e
run: pnpm test:e2e
2 changes: 1 addition & 1 deletion .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
yarn
pnpm i
2 changes: 1 addition & 1 deletion .husky/post-merge
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
yarn
pnpm i
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
#yarn lint-fix
#pnpm lint-fix
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
yarn codecheck && yarn lint && yarn prettier && yarn i18n --fail-on-update
pnpm codecheck && pnpm lint && pnpm prettier && pnpm i18n --fail-on-update
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ sign/
.github/workflows/build-base.yml
signatures/version1/cla.json
playwright-report
pnpm-lock.yaml
20 changes: 10 additions & 10 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
{
"type": "shell",
"label": "Run tests",
"command": "yarn test",
"detail": "yarn test",
"command": "pnpm test",
"detail": "pnpm test",
"group": "test"
},
{
"type": "shell",
"label": "Build for Linux",
"command": "yarn dist:linux",
"detail": "yarn dist:linux",
"command": "pnpm dist:linux",
"detail": "pnpm dist:linux",
"group": {
"kind": "build",
"isDefault": true
Expand All @@ -21,22 +21,22 @@
{
"type": "shell",
"label": "Build for Windows",
"command": "yarn dist:win",
"detail": "yarn dist:win",
"command": "pnpm dist:win",
"detail": "pnpm dist:win",
"group": "build"
},
{
"type": "shell",
"label": "Build for MacOS",
"command": "yarn dist:mac",
"detail": "yarn dist:mac",
"command": "pnpm dist:mac",
"detail": "pnpm dist:mac",
"group": "build"
},
{
"type": "shell",
"label": "Check code for errors",
"command": "yarn codecheck",
"detail": "yarn codecheck",
"command": "pnpm codecheck",
"detail": "pnpm codecheck",
"group": "test"
}
]
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile

This file was deleted.

81 changes: 9 additions & 72 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Heroic is built with Web Technologies:
- [Building Heroic Binaries](#building-heroic-binaries)
- [Building with VS Code](#building-with-vs-code)
- [Quickly testing/debugging Heroic on your own system](#quickly-testingdebugging-heroic-on-your-own-system)
- [Development Using a Container](#development-using-a-container)
- [Testing with Docker](#testing-with-docker)
- [Sponsors](#sponsors)
- [Screenshots](#screenshots)
Expand Down Expand Up @@ -208,15 +207,17 @@ Otherwise, download the file ending in .dmg from the [latest release](https://gi

This part will walk you through setting up a development environment so you can build Heroic binaries yourself or make changes to the code.

1. Make sure Git, NodeJS, and Yarn are installed
1. Make sure Git, NodeJS, and PNPM are installed
**NOTE**: On Windows, due to an issue with electron-builder, you'll need the standalone version of pnpm (`@pnpm/exe`)
to build packages
2. Clone the repo and enter the cloned folder, for example with these commands:

```bash
git clone https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher.git --recurse-submodules
cd HeroicGamesLauncher
```

3. Make sure all dependencies are installed by running `yarn`
3. Make sure all dependencies are installed by running `pnpm install`

### Building Heroic Binaries

Expand All @@ -225,18 +226,18 @@ Run the appropriate command for your OS:
- Build for Linux:

```bash
yarn dist:linux # Optionally specify a package to create (eg: deb, pacman, tar.xz, rpm, AppImage); default: AppImage
pnpm dist:linux # Optionally specify a package to create (eg: deb, pacman, tar.xz, rpm, AppImage); default: AppImage
```

- Build for Windows:

```bash
yarn dist:win
pnpm dist:win
```

- Build for Mac:
```bash
yarn dist:mac
pnpm dist:mac
```

### Building with VS Code
Expand All @@ -247,73 +248,9 @@ To do that, open up the command palette (Ctrl + P), type in "task" and press Spa
### Quickly testing/debugging Heroic on your own system

If you want to quickly test a change, or you're implementing features that require a lot of restarts, you can use Vite's development server to speed up the process:
Go to the "Run and Debug" tab of VSCode and start the "Launch Heroic (HMR & HR)" task (alternatively, if you're not using VSCode or just prefer the terminal, run `yarn start`). Heroic will start up after a short while, and once you make any change to the code, it'll reload/restart.
Go to the "Run and Debug" tab of VSCode and start the "Launch Heroic (HMR & HR)" task (alternatively, if you're not using VSCode or just prefer the terminal, run `pnpm start`). Heroic will start up after a short while, and once you make any change to the code, it'll reload/restart.

Note: If you do not need the React developer tools while testing changes, you can skip their install by setting the `HEROIC_NO_REACT_DEVTOOLS` environment variable before running `yarn start` (for example with `HEROIC_NO_REACT_DEVTOOLS=1 yarn start`).

### Development Using a Container

<details>
<summary>Expand</summary>

If you would prefer, we have a docker container defined to develop / build Heroic with (a potential reason being to avoid loading tons of dependencies on your host filesystem). There are two methods, based on whether you use VS Code.

**VS Code**

There is a `.devcontainer` directory containing a definition that VS Code will recognize for automatically opening your local Heroic directory in a container in VS Code.

**NOTE: this requires that you install the 'Remote - Containers' extension.**

1. Open the root of your local Heroic directory in VS Code.
2. You should get a prompt in the bottom right to build and open the project in the dev container.
3. If the above prompt does not occur, on the bottom left, there is a green icon that should be there if the remote extension is installed. Click on it, and select "Reopen in container".
4. The bottom left green icon should now say: "Dev Container: Heroic Games Launcher".

After the container's package manager runs, open a new terminal session and you should be able to run bash commands from within the container. Any yarn dist:linux builds should also now show up on your host filesystem.

**Manually Building the Docker Image**

If you don't use VS Code or don't want it integrated with the container, you can build and run the container manually using either Docker or Podman.

1. From the root of your local Heroic directory, run:

```bash
docker build -t heroicdevcontainer -f Dockerfile .
```

2. Assuming all went well, you can now enter the container:

```bash
docker run -it -v ./:/tmp/heroic localhost/heroicdevcontainer:latest
```

3. The above command will mount your local Heroic dir to `/tmp/heroic` in the container (unless you used a different path).

```
cd /tmp/heroic
```

And you should be good to go, code and build away!

</details>

### Testing with Docker

It is recommended to run end to end tests with Docker so you don't alter your local config files or have your local config files interfere with the tests.

To run e2e tests on the unpackaged app running in dev mode.
From the root of your local Heroic directory, run:

```bash
yarn test:e2e
```

To run e2e tests on the packaged app.
From the root of your local Heroic directory, run:

```bash
yarn test:e2ePackaged
```
Note: If you do not need the React developer tools while testing changes, you can skip their install by setting the `HEROIC_NO_REACT_DEVTOOLS` environment variable before running `pnpm start` (for example with `HEROIC_NO_REACT_DEVTOOLS=1 pnpm start`).

## Sponsors

Expand Down
6 changes: 4 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ init:

install:
- pip install castlabs-evs
- yarn install --force
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- pnpm install

environment:
GH_TOKEN:
secure: kZMGyhBmfPsJKEryrd+I7gTEudm8tW0jSrKKhtT/3fbqKQzndTWp47C1Eetx5kFs

build_script:
- yarn sign:win
- npm run sign:win
- 7z.exe a -tzip dist\HeroicWin.zip dist\*x64.exe dist\*.blockmap dist\*.yml

test: off
Expand Down
Loading

0 comments on commit be86363

Please sign in to comment.