Skip to content

Commit c9b8636

Browse files
authored
Merge pull request #49 from CodeDead/feature/upgrades
Feature/upgrades
2 parents 4736c1e + 8c84bee commit c9b8636

34 files changed

Lines changed: 2775 additions & 823 deletions

File tree

.eslintignore

Lines changed: 0 additions & 10 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,59 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
release:
10+
publish-tauri:
1111
permissions:
1212
contents: write
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
platform: [ macos-latest, ubuntu-latest, windows-latest ]
16+
include:
17+
- platform: 'macos-latest'
18+
args: '--target aarch64-apple-darwin'
19+
- platform: 'macos-latest'
20+
args: '--target x86_64-apple-darwin'
21+
- platform: 'ubuntu-22.04'
22+
args: ''
23+
- platform: 'windows-latest'
24+
args: ''
25+
1726
runs-on: ${{ matrix.platform }}
1827
steps:
19-
- name: Checkout repository
20-
uses: actions/checkout@v4
28+
- uses: actions/checkout@v4
2129

22-
- name: Install dependencies (ubuntu only)
23-
if: matrix.platform == 'ubuntu-latest'
30+
- name: install dependencies (ubuntu only)
31+
if: matrix.platform == 'ubuntu-22.04'
2432
run: |
2533
sudo apt-get update
2634
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
2735
28-
- name: Node.js setup
36+
- name: setup node
2937
uses: actions/setup-node@v4
3038
with:
31-
node-version: 'lts/*'
39+
node-version: lts/*
3240
cache: 'yarn'
3341

34-
- name: Rust setup
42+
- name: install Rust stable
3543
uses: dtolnay/rust-toolchain@stable
44+
with:
45+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
3646

3747
- name: Rust cache
3848
uses: swatinem/rust-cache@v2
3949
with:
4050
workspaces: './src-tauri -> target'
4151

42-
- name: Install app dependencies and build web
43-
run: yarn && yarn build
52+
- name: Install frontend dependencies
53+
run: yarn install
4454

4555
- name: Build the app
4656
uses: tauri-apps/tauri-action@v0
47-
4857
env:
4958
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5059
with:
51-
tagName: ${{ github.ref_name }}
60+
tagName: app-v__VERSION__
5261
releaseName: 'Advanced PortChecker v__VERSION__'
53-
releaseBody: 'See the assets to download and install this version.'
62+
releaseBody: 'See the assets to download this version and install.'
5463
releaseDraft: true
5564
prerelease: false
65+
args: ${{ matrix.args }}

.github/workflows/test.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,55 @@ jobs:
1515
run: yarn
1616

1717
- name: Run ESLint
18-
run: yarn run eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0
18+
run: yarn lint
19+
20+
- name: Run Prettier
21+
run: yarn format
1922

2023
test-tauri:
2124
strategy:
2225
fail-fast: false
2326
matrix:
24-
platform: [ macos-latest, ubuntu-latest, windows-latest ]
27+
include:
28+
- platform: 'macos-latest'
29+
args: '--target aarch64-apple-darwin'
30+
- platform: 'macos-latest'
31+
args: '--target x86_64-apple-darwin'
32+
- platform: 'ubuntu-22.04'
33+
args: ''
34+
- platform: 'windows-latest'
35+
args: ''
2536

2637
runs-on: ${{ matrix.platform }}
2738
steps:
28-
- name: Checkout repository
29-
uses: actions/checkout@v4
39+
- uses: actions/checkout@v4
3040

31-
- name: Install dependencies (ubuntu only)
32-
if: matrix.platform == 'ubuntu-latest'
41+
- name: install dependencies (ubuntu only)
42+
if: matrix.platform == 'ubuntu-22.04'
3343
run: |
3444
sudo apt-get update
3545
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
3646
3747
- name: Setup node
3848
uses: actions/setup-node@v4
3949
with:
40-
node-version: 'lts/*'
50+
node-version: lts/*
4151
cache: 'yarn'
4252

43-
- name: Rust setup
53+
- name: Install Rust stable
4454
uses: dtolnay/rust-toolchain@stable
55+
with:
56+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
4557

4658
- name: Rust cache
4759
uses: swatinem/rust-cache@v2
4860
with:
4961
workspaces: './src-tauri -> target'
5062

51-
- name: Install app dependencies and build it
52-
run: yarn && yarn build
63+
- name: Install frontend dependencies
64+
run: yarn install
5365

54-
- uses: tauri-apps/tauri-action@v0
66+
- name: Build the app
67+
uses: tauri-apps/tauri-action@v0
5568
env:
5669
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dist
2+
.yarn
3+
dist
4+
node_modules
5+
nginx
6+
.idea
7+
README.md
8+
src-tauri
9+
.github

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"tabWidth": 2,
5+
"semi": true,
6+
"arrowParens": "always"
7+
}

eslint.config.js

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import js from '@eslint/js';
2+
import importPlugin from 'eslint-plugin-import';
3+
import react from 'eslint-plugin-react';
4+
import reactHooks from 'eslint-plugin-react-hooks';
5+
import reactRefresh from 'eslint-plugin-react-refresh';
6+
import globals from 'globals';
7+
8+
export default [
9+
importPlugin.flatConfigs.recommended,
10+
{
11+
ignores: [
12+
'dist',
13+
'.yarn',
14+
'dist',
15+
'node_modules',
16+
'nginx',
17+
'.idea',
18+
'src-tauri',
19+
'.github',
20+
],
21+
},
22+
{
23+
files: ['**/*.{js,jsx}'],
24+
languageOptions: {
25+
ecmaVersion: 'latest',
26+
globals: globals.browser,
27+
parserOptions: {
28+
ecmaVersion: 'latest',
29+
ecmaFeatures: { jsx: true },
30+
sourceType: 'module',
31+
},
32+
},
33+
settings: {
34+
react: { version: '19.0' },
35+
'import/resolver': {
36+
node: {
37+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
38+
},
39+
},
40+
},
41+
plugins: {
42+
react,
43+
'react-hooks': reactHooks,
44+
'react-refresh': reactRefresh,
45+
},
46+
rules: {
47+
...js.configs.recommended.rules,
48+
...react.configs.recommended.rules,
49+
...react.configs['jsx-runtime'].rules,
50+
...reactHooks.configs.recommended.rules,
51+
'no-multi-spaces': ['error', { ignoreEOLComments: false }],
52+
'no-trailing-spaces': ['error', { skipBlankLines: false }],
53+
'no-use-before-define': ['error', { functions: true }],
54+
'react/jsx-no-target-blank': 'off',
55+
'react-refresh/only-export-components': [
56+
'warn',
57+
{ allowConstantExport: true },
58+
],
59+
'react/function-component-definition': [
60+
2,
61+
{
62+
namedComponents: 'arrow-function',
63+
unnamedComponents: 'arrow-function',
64+
},
65+
],
66+
'react/prop-types': 0,
67+
'react/jsx-uses-vars': 'error',
68+
'react/jsx-uses-react': 'error',
69+
semi: [2, 'always'],
70+
quotes: [2, 'single'],
71+
'import/order': [
72+
'error',
73+
{
74+
groups: ['builtin', 'external', 'internal', ['parent', 'sibling']],
75+
pathGroups: [
76+
{
77+
pattern: 'react',
78+
group: 'external',
79+
position: 'before',
80+
},
81+
],
82+
pathGroupsExcludedImportTypes: ['react'],
83+
'newlines-between': 'never',
84+
alphabetize: {
85+
order: 'asc',
86+
caseInsensitive: true,
87+
},
88+
},
89+
],
90+
},
91+
},
92+
];

index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8"/>
5-
<link rel="icon" type="image/svg+xml" href="/favicon.svg"/>
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Advanced PortChecker</title>
8-
</head>
9-
<body>
10-
<div id="root"></div>
11-
<script type="module" src="/src/main.jsx"></script>
12-
</body>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.jsx"></script>
12+
</body>
1313
</html>

package.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "vite build",
9-
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
9+
"lint": "eslint .",
10+
"format": "prettier --check .",
1011
"preview": "vite preview",
1112
"tdev": "yarn tauri dev",
1213
"tbuild": "yarn tauri build"
@@ -17,27 +18,29 @@
1718
"@fontsource/roboto": "^5.2.5",
1819
"@mui/icons-material": "^7.0.2",
1920
"@mui/material": "^7.0.2",
20-
"@mui/x-data-grid": "^7.28.3",
21-
"@tauri-apps/api": "^2.4.1",
21+
"@mui/x-data-grid": "^8.0.0",
22+
"@tauri-apps/api": "^2.5.0",
2223
"@tauri-apps/plugin-dialog": "^2.2.1",
2324
"@tauri-apps/plugin-os": "^2.2.1",
2425
"react": "^19.1.0",
2526
"react-dom": "^19.1.0",
2627
"react-router-dom": "^7.5.0"
2728
},
2829
"devDependencies": {
29-
"@tauri-apps/cli": "^2.4.1",
30-
"@types/react": "^19.1.1",
30+
"@eslint/js": "^9.24.0",
31+
"@tauri-apps/cli": "^2.5.0",
32+
"@types/react": "^19.1.2",
3133
"@types/react-dom": "^19.1.2",
32-
"@vitejs/plugin-react": "^4.3.4",
33-
"eslint": "^8.57.1",
34-
"eslint-config-airbnb": "^19.0.4",
34+
"@vitejs/plugin-react": "^4.4.0",
35+
"eslint": "^9.24.0",
36+
"eslint-config-react-app": "^7.0.1",
3537
"eslint-plugin-import": "^2.31.0",
36-
"eslint-plugin-jsx-a11y": "^6.10.2",
3738
"eslint-plugin-react": "^7.37.5",
3839
"eslint-plugin-react-hooks": "^5.2.0",
3940
"eslint-plugin-react-refresh": "^0.4.19",
40-
"vite": "^6.2.6",
41+
"globals": "^16.0.0",
42+
"prettier": "^3.5.3",
43+
"vite": "^6.3.1",
4144
"vite-plugin-eslint": "^1.8.1",
4245
"vite-plugin-svgr": "^4.3.0"
4346
},

0 commit comments

Comments
 (0)