Skip to content

Commit 0100b46

Browse files
committed
Rewrite UI in Svelte
1 parent 8068aae commit 0100b46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+5982
-15645
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Once the plugin is installed you can run the app which will show data once you'r
3030

3131
## Architecture
3232

33-
The game plugin continually collects telemetry from the running game and sends it over UDP as JSON to the GUI application. The GUI is implemented with [React](https://reactjs.org/) + [Tauri](https://tauri.studio/).
33+
The game plugin continually collects telemetry from the running game and sends it over UDP as JSON to the GUI application. The GUI is implemented with [SvelteKit](https://kit.svelte.dev/) + [Tauri](https://tauri.studio/).
3434

3535
## Building the plugin
3636

@@ -55,6 +55,8 @@ yarn tauri build
5555

5656
The build output will be in the `peekr-ui/src-tauri/target/release` directory.
5757

58+
Alternatively, the script `windows_tiny_build.ps1` in the `peekr-ui` folder can be used to build for windows, making use of a few extra tricks to get a smaller binary size. It requires [UPX](https://upx.github.io/) being available on the command line.
59+
5860
## Credits
5961

6062
The layout was inspired by the [Distplay](https://github.com/Californ1a/distplay) input viewer.

peekr-ui/.eslintrc.cjs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
root: true,
3+
parser: "@typescript-eslint/parser",
4+
extends: [
5+
"eslint:recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"prettier",
8+
],
9+
plugins: ["svelte3", "@typescript-eslint"],
10+
ignorePatterns: ["*.cjs"],
11+
overrides: [{ files: ["*.svelte"], processor: "svelte3/svelte3" }],
12+
settings: {
13+
"svelte3/typescript": () => require("typescript"),
14+
},
15+
parserOptions: {
16+
sourceType: "module",
17+
ecmaVersion: 2019,
18+
},
19+
env: {
20+
browser: true,
21+
es2017: true,
22+
node: true,
23+
},
24+
};

peekr-ui/.gitignore

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
7-
8-
# testing
9-
/coverage
10-
11-
# production
12-
/build
13-
14-
# misc
151
.DS_Store
16-
.env.local
17-
.env.development.local
18-
.env.test.local
19-
.env.production.local
20-
21-
npm-debug.log*
22-
yarn-debug.log*
23-
yarn-error.log*
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package

peekr-ui/.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.svelte-kit/
2+
build/
3+
node_modules/
4+
src-tauri/target/
5+
src-tauri/WixTools/

peekr-ui/package.json

Lines changed: 33 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,40 @@
11
{
22
"name": "telemetry-ui",
3-
"version": "0.1.0",
4-
"private": true,
5-
"dependencies": {
6-
"@chakra-ui/react": "^1.0.0",
7-
"@emotion/react": "^11.0.0",
8-
"@emotion/styled": "^11.0.0",
9-
"@tauri-apps/api": "^1.0.0-beta.1",
10-
"@testing-library/jest-dom": "^5.9.0",
11-
"@testing-library/react": "^10.2.1",
12-
"@testing-library/user-event": "^12.0.2",
13-
"@types/jest": "^25.0.0",
14-
"@types/node": "^12.0.0",
15-
"@types/react": "^16.9.0",
16-
"@types/react-dom": "^16.9.0",
17-
"framer-motion": "^4.0.0",
18-
"husky": "^6.0.0",
19-
"lint-staged": "^11.0.0",
20-
"prettier": "^2.3.1",
21-
"react": "^17.0.2",
22-
"react-dom": "^17.0.2",
23-
"react-icons": "^3.0.0",
24-
"react-scripts": "4.0.3",
25-
"runtypes": "^6.3.0",
26-
"typescript": "^4.3.4",
27-
"web-vitals": "^0.2.2"
28-
},
3+
"version": "0.0.1",
294
"scripts": {
30-
"start": "react-scripts start",
31-
"build": "react-scripts build",
32-
"test": "react-scripts test",
33-
"eject": "react-scripts eject"
34-
},
35-
"eslintConfig": {
36-
"extends": "react-app"
37-
},
38-
"browserslist": {
39-
"production": [
40-
">0.2%",
41-
"not dead",
42-
"not op_mini all"
43-
],
44-
"development": [
45-
"last 1 chrome version",
46-
"last 1 firefox version",
47-
"last 1 safari version"
48-
]
49-
},
50-
"husky": {
51-
"hooks": {
52-
"pre-commit": "lint-staged"
53-
}
54-
},
55-
"lint-staged": {
56-
"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [
57-
"prettier --write"
58-
]
5+
"dev": "svelte-kit dev",
6+
"build": "svelte-kit build",
7+
"preview": "svelte-kit preview",
8+
"check": "svelte-check --tsconfig ./tsconfig.json",
9+
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
10+
"lint": "prettier --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
11+
"format": "prettier --write --plugin-search-dir=. ."
5912
},
6013
"devDependencies": {
61-
"@tauri-apps/cli": "^1.0.0-beta.2"
14+
"@sveltejs/adapter-static": "^1.0.0-next.18",
15+
"@sveltejs/kit": "next",
16+
"@tauri-apps/cli": "^1.0.0-beta.10",
17+
"@typescript-eslint/eslint-plugin": "^4.19.0",
18+
"@typescript-eslint/parser": "^4.19.0",
19+
"autoprefixer": "^10.3.1",
20+
"cssnano": "^5.0.6",
21+
"eslint": "^7.22.0",
22+
"eslint-config-prettier": "^8.1.0",
23+
"eslint-plugin-svelte3": "^3.2.0",
24+
"postcss": "^8.3.5",
25+
"postcss-load-config": "^3.1.0",
26+
"prettier": "~2.2.1",
27+
"prettier-plugin-svelte": "^2.2.0",
28+
"svelte": "^3.34.0",
29+
"svelte-check": "^2.0.0",
30+
"svelte-preprocess": "^4.7.4",
31+
"tailwindcss": "^2.2.4",
32+
"tslib": "^2.0.0",
33+
"typescript": "^4.0.0"
34+
},
35+
"type": "module",
36+
"dependencies": {
37+
"@tauri-apps/api": "^1.0.0-beta.8",
38+
"purify-ts": "^1.0.0"
6239
}
6340
}

peekr-ui/postcss.config.cjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const tailwindcss = require("tailwindcss");
2+
const autoprefixer = require("autoprefixer");
3+
const cssnano = require("cssnano");
4+
5+
const mode = process.env.NODE_ENV;
6+
const dev = mode === "development";
7+
8+
const config = {
9+
plugins: [
10+
//Some plugins, like tailwindcss/nesting, need to run before Tailwind,
11+
tailwindcss(),
12+
//But others, like autoprefixer, need to run after,
13+
autoprefixer(),
14+
!dev &&
15+
cssnano({
16+
preset: "default",
17+
}),
18+
],
19+
};
20+
21+
module.exports = config;

peekr-ui/src-tauri/.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
target/
2-
WixTools/
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
/target/
4+
WixTools

0 commit comments

Comments
 (0)