Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: general improvements and tests (#20)
- removed unused dependencies - configured lint and fmt with eslint and prettier - add a vitest sample test in App.tsx - fixed format issues - fixed lint issues - added lint and fmt checks in ci
- Loading branch information
Showing
35 changed files
with
3,675 additions
and
3,815 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.DS_Store | ||
node_modules | ||
/build | ||
/package | ||
.env | ||
.env.* | ||
!.env.example | ||
|
||
pnpm-lock.yaml | ||
package-lock.json | ||
yarn.lock | ||
|
||
|
||
dist/ | ||
src-tauri/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react/recommended", | ||
"prettier", | ||
], | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["@typescript-eslint", "react"], | ||
parserOptions: { | ||
sourceType: "module", | ||
ecmaVersion: 2020, | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
env: { | ||
browser: true, | ||
es2017: true, | ||
node: true, | ||
}, | ||
settings: { | ||
react: { | ||
version: "detect", | ||
}, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["**/*.tsx", "**/*.jsx"], | ||
rules: { | ||
"react/prop-types": "off", | ||
"react/react-in-jsx-scope": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
}, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: Lint and Format | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CARGO_PROFILE_DEV_DEBUG: 0 | ||
RUST_BACKTRACE: 1 | ||
|
||
jobs: | ||
eslint-format: | ||
name: ESLint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2.2.2 | ||
with: | ||
version: 8.x.x | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
|
||
- name: Install pnpm dependencies | ||
run: pnpm i --frozen-lockfile | ||
|
||
- name: Perform linting | ||
run: pnpm lint | ||
|
||
rust-format: | ||
name: rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get install -y libgtk-3-dev | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: rustfmt | ||
|
||
- name: Run rustfmt | ||
run: cargo fmt --manifest-path ./src-tauri/Cargo.toml --all -- --check | ||
|
||
rust-lint: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev libssl-dev libsoup2.4-dev | ||
|
||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
components: clippy | ||
|
||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2.0.1 | ||
with: | ||
version: 8 | ||
run_install: false | ||
|
||
|
||
- name: Run Clippy | ||
run: cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets --all-features -- -D warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# .prettierignore | ||
src-tauri/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Tauri + React + TS</title> | ||
<script type="module" crossorigin src="/assets/index-7068198f.js"></script> | ||
<link rel="stylesheet" href="/assets/index-a485d9f9.css"> | ||
<script type="module" crossorigin src="/assets/index-JuZN40LF.js"></script> | ||
<link rel="stylesheet" crossorigin href="/assets/index-e3cyFvbq.css"> | ||
</head> | ||
|
||
<body class="arrow"> | ||
<div id="root"></div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,55 @@ | ||
{ | ||
"name": "kftray", | ||
"version": "0.0.0", | ||
"private": true, | ||
"scripts": { | ||
"build": "tsc && vite build", | ||
"dev": "vite", | ||
"format": "npx prettier --write . --ignore-path .gitignore ", | ||
"preview": "vite preview", | ||
"tauri": "tauri", | ||
"taze": "taze major -I", | ||
"taze:minor": "taze minor -w" | ||
}, | ||
"dependencies": { | ||
"@chakra-ui/icons": "^2.1.1", | ||
"@chakra-ui/react": "^2.8.2", | ||
"@emotion/react": "^11.11.1", | ||
"@emotion/styled": "^11.11.0", | ||
"@fortawesome/fontawesome-svg-core": "^6.5.1", | ||
"@fortawesome/free-solid-svg-icons": "^6.5.1", | ||
"@fortawesome/react-fontawesome": "^0.2.0", | ||
"@hookform/resolvers": "^3.1.1", | ||
"@radix-ui/react-accessible-icon": "^1.0.3", | ||
"@radix-ui/react-accordion": "^1.1.2", | ||
"@radix-ui/react-alert-dialog": "^1.0.4", | ||
"@radix-ui/react-aspect-ratio": "^1.0.3", | ||
"@radix-ui/react-avatar": "^1.0.3", | ||
"@radix-ui/react-checkbox": "^1.0.4", | ||
"@radix-ui/react-collapsible": "^1.0.3", | ||
"@radix-ui/react-context-menu": "^2.1.4", | ||
"@radix-ui/react-dialog": "^1.0.4", | ||
"@radix-ui/react-dropdown-menu": "^2.0.5", | ||
"@radix-ui/react-hover-card": "^1.0.6", | ||
"@radix-ui/react-icons": "^1.3.0", | ||
"@radix-ui/react-label": "^2.0.2", | ||
"@radix-ui/react-menubar": "^1.0.3", | ||
"@radix-ui/react-navigation-menu": "^1.1.3", | ||
"@radix-ui/react-popover": "^1.0.6", | ||
"@radix-ui/react-progress": "^1.0.3", | ||
"@radix-ui/react-radio-group": "^1.1.3", | ||
"@radix-ui/react-scroll-area": "^1.0.4", | ||
"@radix-ui/react-select": "^1.2.2", | ||
"@radix-ui/react-separator": "^1.0.3", | ||
"@radix-ui/react-slider": "^1.1.2", | ||
"@radix-ui/react-slot": "^1.0.2", | ||
"@radix-ui/react-switch": "^1.0.3", | ||
"@radix-ui/react-tabs": "^1.0.4", | ||
"@radix-ui/react-toast": "^1.1.4", | ||
"@radix-ui/react-toggle": "^1.0.3", | ||
"@radix-ui/react-toggle-group": "^1.0.4", | ||
"@radix-ui/react-tooltip": "^1.0.6", | ||
"@tauri-apps/api": "^1.5.1", | ||
"@vitejs/plugin-react": "^4.2.1", | ||
"@vitejs/plugin-react-swc": "^3.3.2", | ||
"cmdk": "^0.2.0", | ||
"date-fns": "^2.30.0", | ||
"framer-motion": "^10.16.14", | ||
"lucide-react": "^0.263.1", | ||
"next-themes": "^0.2.1", | ||
"react": "^18.2.0", | ||
"react-day-picker": "^8.8.0", | ||
"react-dom": "^18.2.0", | ||
"react-hook-form": "^7.45.2", | ||
"react-icons": "^4.12.0", | ||
"recharts": "^2.7.2", | ||
"shelljs": "^0.8.5", | ||
"tailwind-scrollbar": "^3.0.4", | ||
"tailwindcss-animate": "^1.0.6", | ||
"tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log#v1", | ||
"zod": "^3.21.4" | ||
}, | ||
"devDependencies": { | ||
"@ianvs/prettier-plugin-sort-imports": "^4.1.0", | ||
"@tauri-apps/cli": "^1.5.1", | ||
"@types/node": "^18.18.13", | ||
"@types/react": "^18.2.18", | ||
"@types/react-dom": "^18.2.7", | ||
"autoprefixer": "^10.4.14", | ||
"class-variance-authority": "^0.7.0", | ||
"clsx": "^2.0.0", | ||
"postcss": "^8.4.27", | ||
"prettier": "^3.0.1", | ||
"prettier-plugin-tailwindcss": "^0.4.1", | ||
"tailwind-merge": "^1.14.0", | ||
"tailwindcss": "^3.3.3", | ||
"taze": "^0.11.2", | ||
"typescript": "^5.1.6", | ||
"vite": "^4.4.8" | ||
} | ||
"name": "kftray", | ||
"version": "0.0.0", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"build": "tsc && vite build", | ||
"dev": "vite", | ||
"format": "prettier --write .", | ||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx", | ||
"preview": "vite preview", | ||
"tauri": "tauri", | ||
"taze": "taze major -I", | ||
"taze:minor": "taze minor -w", | ||
"test": "vitest", | ||
"test:ui": "vitest --ui" | ||
}, | ||
"dependencies": { | ||
"@chakra-ui/react": "^2.8.2", | ||
"@emotion/react": "^11.11.1", | ||
"@emotion/styled": "^11.11.0", | ||
"@fortawesome/fontawesome-svg-core": "^6.5.1", | ||
"@fortawesome/free-solid-svg-icons": "^6.5.1", | ||
"@fortawesome/react-fontawesome": "^0.2.0", | ||
"@tauri-apps/api": "^1.5.2", | ||
"@vitejs/plugin-react-swc": "^3.5.0", | ||
"framer-motion": "^10.16.16", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-icons": "^4.12.0", | ||
"tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log#v1" | ||
}, | ||
"devDependencies": { | ||
"@ianvs/prettier-plugin-sort-imports": "^4.1.1", | ||
"@tauri-apps/cli": "^1.5.8", | ||
"@testing-library/jest-dom": "^6.1.5", | ||
"@testing-library/react": "^14.1.2", | ||
"@types/node": " ^20.10.4", | ||
"@types/react": "^18.2.45", | ||
"@types/react-dom": "^18.2.18", | ||
"@typescript-eslint/eslint-plugin": "^6.14.0", | ||
"@typescript-eslint/parser": "^6.14.0", | ||
"eslint": "^8.56.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.0.1", | ||
"eslint-plugin-react": "^7.33.2", | ||
"jsdom": "^23.0.1", | ||
"prettier": "^3.1.1", | ||
"taze": "^0.13.0", | ||
"typecheck": "^0.1.2", | ||
"typescript": "^5.3.3", | ||
"vite": "^5.0.10", | ||
"vitest": "^1.0.4" | ||
} | ||
} |
Oops, something went wrong.