Skip to content

feat: updated eslint, dependency upgrades #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .eslintignore

This file was deleted.

30 changes: 0 additions & 30 deletions .eslintrc.json

This file was deleted.

64 changes: 23 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,77 +7,59 @@ on:
workflow_dispatch:

jobs:
docker-publish:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Publish
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ vars.DOCKERHUB_REPO }}:latest

app-publish:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [ macos-latest, ubuntu-latest, windows-latest ]
include:
- platform: 'macos-latest'
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest'
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04'
args: ''
- platform: 'windows-latest'
args: ''

runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: Node.js setup
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
node-version: lts/*
cache: 'yarn'

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

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- name: Install app dependencies and build web
run: yarn && yarn build
- name: Install frontend dependencies
run: yarn install

- name: Build the app
uses: tauri-apps/tauri-action@v0

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ github.ref_name }}
releaseName: 'Advanced PassGen v__VERSION__'
releaseBody: 'See the assets to download and install this version.'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
35 changes: 24 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,55 @@ jobs:
run: yarn

- name: Run ESLint
run: yarn run eslint . --ext .ts,.tsx,.js,.jsx
run: yarn lint

- name: Run Prettier
run: yarn format

test-tauri:
strategy:
fail-fast: false
matrix:
platform: [ macos-latest, ubuntu-latest, windows-latest ]
include:
- platform: 'macos-latest'
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest'
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04'
args: ''
- platform: 'windows-latest'
args: ''

runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
node-version: lts/*
cache: 'yarn'

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

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- name: Install app dependencies and build it
run: yarn && yarn build
- name: Install frontend dependencies
run: yarn install

- uses: tauri-apps/tauri-action@v0
- name: Build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dist
.yarn
dist
node_modules
nginx
.idea
README.md
src-tauri
.github
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"arrowParens": "always"
}
92 changes: 92 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import js from '@eslint/js';
import importPlugin from 'eslint-plugin-import';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import globals from 'globals';

export default [
importPlugin.flatConfigs.recommended,
{
ignores: [
'dist',
'.yarn',
'dist',
'node_modules',
'nginx',
'.idea',
'src-tauri',
'.github',
],
},
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 'latest',
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
settings: {
react: { version: '19.0' },
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
plugins: {
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...js.configs.recommended.rules,
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
...reactHooks.configs.recommended.rules,
'no-multi-spaces': ['error', { ignoreEOLComments: false }],
'no-trailing-spaces': ['error', { skipBlankLines: false }],
'no-use-before-define': ['error', { functions: true }],
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react/function-component-definition': [
2,
{
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
},
],
'react/prop-types': 0,
'react/jsx-uses-vars': 'error',
'react/jsx-uses-react': 'error',
semi: [2, 'always'],
quotes: [2, 'single'],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', ['parent', 'sibling']],
pathGroups: [
{
pattern: 'react',
group: 'external',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['react'],
'newlines-between': 'never',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
},
];
32 changes: 16 additions & 16 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<link rel="icon" href="/favicon.ico"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="theme-color" content="#000000"/>
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Advanced PassGen is a password generator that can be used to quickly generate thousands of passwords"
name="description"
content="Advanced PassGen is a password generator that can be used to quickly generate thousands of passwords"
/>
<link rel="apple-touch-icon" href="/logo192.png"/>
<link rel="manifest" href="/manifest.json"/>
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" />
<title>Advanced PassGen</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.jsx"></script>
</body>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.jsx"></script>
</body>
</html>
Loading
Loading