Skip to content

Commit

Permalink
chore: replace rome with prettier 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rel1cx committed Jul 20, 2023
1 parent 47523bd commit a76ff41
Show file tree
Hide file tree
Showing 25 changed files with 8,635 additions and 6,432 deletions.
32 changes: 26 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,45 @@
"root": true,
"extends": ["with-tsconfig"],
"rules": {
"new-cap": "off",
"@typescript-eslint/explicit-module-boundary-types": "off"
"semi": ["error", "never"],
"no-console": [
"warn",
{
"allow": ["info", "warn", "error"]
}
],
"sonarjs/no-duplicate-string": "warn",
"import/namespace": "off",
"import/no-default-export": "off",
"react/no-unused-prop-types": "off",
"@typescript-eslint/no-redeclare": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"tailwindcss/no-custom-classname": "off",
"security/detect-object-injection": "off"
},
"ignorePatterns": ["node_modules/", "dist/", "src-tauri", "updater"],
"overrides": [
{
"files": ["scripts/**/*.ts", "vite.config.ts"],
"parserOptions": {
"project": "tsconfig.node.json"
},
"files": ["scripts/**/*.ts", "./*.config.ts"],
"rules": {
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off"
},
"parserOptions": {
"project": "tsconfig.node.json"
}
},
{
"files": ["src/i18n/i18n-*.@(ts|tsx)"],
"rules": {
"unicorn/no-abusive-eslint-disable": "off"
}
},
{
"files": ["src/**/*.css.ts"],
"rules": {
"sonarjs/no-duplicate-string": "off"
}
}
]
}
12 changes: 6 additions & 6 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- dev
tags:
- 'v*-beta.*'
- "v*-beta.*"
jobs:
release:
runs-on: macos-12
Expand Down Expand Up @@ -45,13 +45,13 @@ jobs:
run: pnpm run update-version
- uses: tauri-apps/tauri-action@dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: 'v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseName: "v__VERSION__"
releaseBody: "See the assets to download this version and install."
releaseDraft: false
prerelease: true
args: --target universal-apple-darwin
Expand Down
216 changes: 108 additions & 108 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,120 +1,120 @@
name: Release
on:
push:
branches:
- main
push:
branches:
- main
jobs:
# Job that allows the creation of the release
release_please:
name: Release Please
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.release.outputs.tag_name }}
release_id: ${{ steps.release.outputs.id }}
upload_url: ${{ steps.release.outputs.upload_url }}
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
# Job that allows the creation of the release
release_please:
name: Release Please
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.release.outputs.tag_name }}
release_id: ${{ steps.release.outputs.id }}
upload_url: ${{ steps.release.outputs.upload_url }}
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node

# Job that builds the executables
build_tauri:
name: "Build and upload release binaries"
needs: release_please
if: ${{ needs.release_please.outputs.release_created }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest]
# Job that builds the executables
build_tauri:
name: "Build and upload release binaries"
needs: release_please
if: ${{ needs.release_please.outputs.release_created }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest]

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-release-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-release-
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- name: Install front-end dependencies
run: pnpm i
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Update version
run: pnpm run update-version
- uses: tauri-apps/tauri-action@dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
args: --target universal-apple-darwin
releaseId: ${{ needs.release_please.outputs.release_id }}
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-release-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-release-
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- name: Install front-end dependencies
run: pnpm i
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Update version
run: pnpm run update-version
- uses: tauri-apps/tauri-action@dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
args: --target universal-apple-darwin
releaseId: ${{ needs.release_please.outputs.release_id }}

create_update_json:
name: "Create latest.json file"
needs: [release_please, build_tauri]
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
create_update_json:
name: "Create latest.json file"
needs: [release_please, build_tauri]
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- run: mkdir -p _output
- run: mkdir -p _output

- uses: Swatinem/rust-cache@v2
with:
workspaces: updater
- uses: Swatinem/rust-cache@v2
with:
workspaces: updater

- name: install rust stable
uses: dtolnay/rust-toolchain@stable
- name: install rust stable
uses: dtolnay/rust-toolchain@stable

- name: Generate update.json
run: cargo run > ../_output/latest.json
working-directory: updater
- name: Generate update.json
run: cargo run > ../_output/latest.json
working-directory: updater

- name: remove old latest.json
uses: flcdrg/remove-release-asset-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.release_please.outputs.release_id }}
asset_name: latest.json
- name: remove old latest.json
uses: flcdrg/remove-release-asset-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.release_please.outputs.release_id }}
asset_name: latest.json

- name: upload new latest.json
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release_please.outputs.upload_url }}
asset_path: _output/latest.json
asset_name: latest.json
asset_content_type: application/json
- name: upload new latest.json
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release_please.outputs.upload_url }}
asset_path: _output/latest.json
asset_name: latest.json
asset_content_type: application/json
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist
node_modules
src/i18n/i18n-*
src-tauri
updater
.eslintcache
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 120,
"endOfLine": "lf",
"semi": false,
"singleQuote": false,
"tabWidth": 4,
"trailingComma": "all",
"arrowParens": "always"
}
2 changes: 1 addition & 1 deletion .typesafe-i18n.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://unpkg.com/typesafe-i18n@5.24.3/schema/typesafe-i18n.json",
"$schema": "https://unpkg.com/typesafe-i18n@5.25.0/schema/typesafe-i18n.json",
"adapter": "node",
"esmImports": true
}
Loading

0 comments on commit a76ff41

Please sign in to comment.