Skip to content

Commit

Permalink
[Tech] Switch from react-scripts to Vite & clean up everything to wor…
Browse files Browse the repository at this point in the history
…k with strict mode (#1633)

* Change complete project structure

 - Rename "src" -> "src/frontend"
 - Rename "electron" -> "src/backend"
 - Move types.ts to "common/types.ts"

* Switch from react-scripts + foreman + webpack + ts-loader -> Vite

* Set GH_TOKEN and GITHUB_TOKEN in tests directly

This just cleans up package.json a bit

* Get SVG & JPG importing working in VSCode

* Move type definitions into common/typedefs

* Fixup tests

* Rewrite large chunks of the backend to be compatible with strict mode

* Modify frontend to reflect changes to type definition structure

* Remove unused files

These weren't necessary, at least as far as I can tell

* Update translations

* Fixup: Re-add `--filesystem` parameter for Proton

Turns out refactoring a lot of stuff can introduce issues, who would've
thought

* Remove `build` script

You never have to run this yourself, so it was a bit confusing to have.
If you really need its functionality, `vite build` isn't that hard to
type in on your own :^)

* Fully remove all remnants of UE support

* Add new 'codecheck' command

This command can be used to make sure that no files in the project
violate TS rules, since Vite itself doesn't check them

It would probably be a good idea to add them to GH Workflows and/or
pre-commit hooks, but I'm not too sure on how to do that

* Update translation files

* Fix translation files

Not sure how this happens, but it seems they've gotten screwed up
in the merge

* Remove some more unnecessary files

* Always get game updates from all libraries

This fixes an issue where refreshing the library while only showing
one library made the update icons of all the others disappear

* Some misc code style changes
  • Loading branch information
CommandMC committed Aug 25, 2022
1 parent a984992 commit 2ba6604
Show file tree
Hide file tree
Showing 376 changed files with 3,538 additions and 8,849 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
public/start-react.js
i18next-parser.config.js
flatpak/build/
flatpak/.flatpak-builder/
vite.config.ts
**/__tests__/**
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"ecmaVersion": 12,
"sourceType": "module",
"project": ["./tsconfig.json", "./electron/tsconfig.json"]
"project": ["./tsconfig.json"]
},
"plugins": ["react", "@typescript-eslint"],
"settings": {
Expand All @@ -27,6 +27,7 @@
}
},
"rules": {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-unused-vars": "error",
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-prs-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
run: yarn
- name: Build artifacts.
run: yarn dist:linux appimage --publish=never
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
- name: Upload AppImage.
uses: actions/upload-artifact@v2
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-prs-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
run: yarn
- name: Build artifacts.
run: yarn dist:mac --publish=never
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
- name: Upload DMG.
uses: actions/upload-artifact@v2
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-prs-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
run: npm i --legacy-peer-deps
- name: Build artifacts.
run: npm run dist:win portable
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
- name: Upload EXE.
uses: actions/upload-artifact@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/draft-release-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ jobs:
- run: npm run release:linux
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/draft-release-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ jobs:
- run: npm run release:mac
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ downloads*.json

flatpak/build
.flatpak-builder

vite-plugin-electron.log
.tool-versions
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ node_modules
dist
build
coverage
public/index.html
public/locales/
flatpak
2 changes: 0 additions & 2 deletions Procfile

This file was deleted.

0 comments on commit 2ba6604

Please sign in to comment.