Skip to content

Commit

Permalink
Upgrade to tauri 2 (#16)
Browse files Browse the repository at this point in the history
* tidy up vscode settings

* tidy up gitignores

* remove lock file from git

* update app title

* update to new tauri recommended

* modernise eslint and prettier config

* update dependencies

* update vite config for tauri 2 recommendations

* tidy up types into global types folder

* remove unneeded react imports

* update tauri api imports

* chore: Clean up Chessboard component code

* chore: Remove unused 'title' prop from Copywrite component

* chore: Remove unused 'appName' prop from Header component

* update tab spacing

* update tauri backend config for v2

* move run call out to library file from main

* move data mod out to new file and simplify global data api

* improve idiomatic syntax of backend logic
  • Loading branch information
jamessizeland authored Aug 9, 2024
1 parent 0f6cd6a commit 1eec27e
Show file tree
Hide file tree
Showing 52 changed files with 4,848 additions and 4,360 deletions.
57 changes: 0 additions & 57 deletions .eslintrc.js

This file was deleted.

14 changes: 2 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
# Generated by Cargo
# will have compiled files and executables
/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# Logs
logs
*.log
Expand All @@ -22,6 +11,7 @@ node_modules
dist
dist-ssr
*.local
bun.lockb

# Editor directories and files
.idea
Expand All @@ -30,4 +20,4 @@ dist-ssr
*.ntvs*
*.njsproj
*.sln
*.sw?
*.sw?
8 changes: 2 additions & 6 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"wix.vscode-import-cost",
"esbenp.prettier-vscode",
"formulahendry.auto-rename-tag",
"tamasfe.even-better-toml",
"rust-lang.rust-analyzer",
"tauri-apps.tauri-vscode",
"serayuzgur.crates"
"rust-lang.rust-analyzer",
"fill-labs.dependi"
]
}
15 changes: 0 additions & 15 deletions .vscode/launch.json

This file was deleted.

12 changes: 2 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
{
"files.associations": {
".babelrc": "jsonc",
".eslintrc": "js",
".prettierrc": "jsonc",
".eslintignore": "ignore"
},

"javascript.validate.enable": false,
"javascript.format.enable": false,
"typescript.format.enable": false,
Expand All @@ -20,12 +13,11 @@
"node_modules": true,
"npm-debug.log.*": true,
"test/**/__snapshots__": true,
"yarn.lock": true,
"*.lock": true,
"*.lockb":true,
"*.{css,sass,scss}.d.ts": true
},
// force format on save to be enabled for this project
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file"

// "typescript.tsdk": "node_modules\\typescript\\lib"
}
13 changes: 13 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";

export default [
{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{ extends: ["plugin:react/jsx-runtime"] },
];
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/assets/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
<title>Tauri Chess</title>
</head>
<body>
<div id="root"></div>
Expand Down
65 changes: 28 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "chess-tauri",
"private": true,
"version": "1.10.0",
"type": "module",
"author": {
"name": "James Sizeland"
Expand All @@ -14,49 +13,41 @@
"tauri": "tauri"
},
"dependencies": {
"@headlessui/react": "^1.6.4",
"@tauri-apps/api": "^1.5.3",
"chess.js": "^1.0.0-beta.8",
"clsx": "^2.1.0",
"daisyui": "^4.7.2",
"dayjs": "^1.11.3",
"debounce": "^2.0.0",
"@headlessui/react": "^2.1.2",
"@tauri-apps/api": ">=2.0.0-rc.0",
"@tauri-apps/plugin-shell": ">=2.0.0-rc.0",
"daisyui": "^4.12.10",
"dayjs": "^1.11.12",
"debounce": "^2.1.0",
"react": "^18.2.0",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18.0.0",
"react-router-dom": "^6.3.0",
"react-toastify": "^10.0.4",
"tailwind-merge": "^2.2.1"
"react-dom": "^18.2.0",
"react-router-dom": "^6.26.0",
"react-toastify": "^10.0.5"
},
"devDependencies": {
"@tauri-apps/cli": "*",
"@types/debounce": "^1.2.1",
"@types/node": "^17.0.41",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"@eslint/js": "^9.8.0",
"@tauri-apps/cli": ">=2.0.0-rc.0",
"@types/node": "^22.1.0",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@vitejs/plugin-react": "^4.2.1",
"animated-tailwindcss": "^4.0.0",
"autoprefixer": "^10.4.7",
"eslint": "^8.17.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-react-hooks": "^4.5.0",
"postcss": "^8.4.14",
"prettier": "^2.6.2",
"sass": "^1.52.3",
"tailwindcss": "^3.1.2",
"typescript": "*",
"vite": "^5.0.0",
"autoprefixer": "^10.4.20",
"clsx": "^2.1.1",
"eslint": "9.x",
"eslint-plugin-react": "^7.35.0",
"globals": "^15.9.0",
"postcss": "^8.4.41",
"prettier": "3.3.3",
"sass": "^1.77.8",
"tailwind-merge": "^2.4.0",
"tailwindcss": "^3.4.8",
"typescript": "^5.2.2",
"typescript-eslint": "^8.0.1",
"vite": "^5.3.1",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.3.1"
"vite-tsconfig-paths": "^5.0.0"
}
}
File renamed without changes.
5 changes: 4 additions & 1 deletion src-tauri/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Generated by Cargo
# will have compiled files and executables
/target/
WixTools

# Generated by Tauri
# will have schema files for capabilities auto-completion
/gen/schemas
Loading

0 comments on commit 1eec27e

Please sign in to comment.