mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-21 11:26:15 +02:00
chore: adjust prettier config, .gitignore and use taplo to format toml files (#1728)
* chore: adjust prettier config, .gitignore and use taplo to format toml files This brings the plugins-workspace repository to the same code style of the main tauri repo * format toml * ignore examples gen dir * add .vscode/extensions.json * remove packageManager field * fmt * fix audit * taplo ignore permissions autogenerated files * remove create dummy dist * fix prettier workflow * install fmt in prettier workflow --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
@@ -7,23 +7,23 @@ name: Audit JavaScript
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
- cron: '0 0 * * *'
|
||||
push:
|
||||
branches:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/audit-javascript.yml"
|
||||
- "**/pnpm-lock.yaml"
|
||||
- "**/package.json"
|
||||
- '.github/workflows/audit-javascript.yml'
|
||||
- '**/pnpm-lock.yaml'
|
||||
- '**/package.json'
|
||||
pull_request:
|
||||
branches:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/audit-javascript.yml"
|
||||
- "**/pnpm-lock.yaml"
|
||||
- "**/package.json"
|
||||
- '.github/workflows/audit-javascript.yml'
|
||||
- '**/pnpm-lock.yaml'
|
||||
- '**/package.json'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
${{ runner.os }}-
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
node-version: 'lts/*'
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.x.x
|
||||
|
||||
@@ -7,23 +7,23 @@ name: Audit Rust
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
- cron: '0 0 * * *'
|
||||
push:
|
||||
branches:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/audit-rust.yml"
|
||||
- "**/Cargo.lock"
|
||||
- "**/Cargo.toml"
|
||||
- '.github/workflows/audit-rust.yml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/Cargo.toml'
|
||||
pull_request:
|
||||
branches:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/audit-rust.yml"
|
||||
- "**/Cargo.lock"
|
||||
- "**/Cargo.toml"
|
||||
- '.github/workflows/audit-rust.yml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/Cargo.toml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
@@ -7,8 +7,8 @@ name: check generated files
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/check-generated-files.yml"
|
||||
- "**/guest-js/**"
|
||||
- '.github/workflows/check-generated-files.yml'
|
||||
- '**/guest-js/**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -136,7 +136,7 @@ jobs:
|
||||
${{ runner.os }}-
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
node-version: 'lts/*'
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.x.x
|
||||
|
||||
@@ -27,4 +27,4 @@ jobs:
|
||||
uses: jbolda/covector/packages/action@covector-v0
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
command: "status"
|
||||
command: 'status'
|
||||
|
||||
@@ -17,6 +17,6 @@ jobs:
|
||||
uses: jbolda/covector/packages/action@covector-v0
|
||||
id: covector
|
||||
with:
|
||||
command: "status"
|
||||
command: 'status'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment: true
|
||||
comment: true
|
||||
|
||||
@@ -34,8 +34,8 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
node-version: 'lts/*'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
@@ -65,7 +65,7 @@ jobs:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
command: "version-or-publish"
|
||||
command: 'version-or-publish'
|
||||
createRelease: true
|
||||
recognizeContributors: true
|
||||
|
||||
@@ -78,8 +78,8 @@ jobs:
|
||||
uses: tauri-apps/create-pull-request@v3
|
||||
if: steps.covector.outputs.commandRan == 'version'
|
||||
with:
|
||||
title: "Publish New Versions (${{ github.ref_name }})"
|
||||
commit-message: "publish new versions"
|
||||
labels: "version updates"
|
||||
branch: "ci/release-${{ github.ref_name }}"
|
||||
title: 'Publish New Versions (${{ github.ref_name }})'
|
||||
commit-message: 'publish new versions'
|
||||
labels: 'version updates'
|
||||
branch: 'ci/release-${{ github.ref_name }}'
|
||||
body: ${{ steps.covector.outputs.change }}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: check formatting
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
rustfmt:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install Rust stable and rustfmt
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt
|
||||
|
||||
- name: run cargo fmt
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
prettier:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache pnpm modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.x.x
|
||||
run_install: true
|
||||
- run: pnpm format:check
|
||||
|
||||
taplo:
|
||||
name: taplo (.toml files)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install Rust stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: install taplo-cli
|
||||
uses: taiki-e/install-action@v2
|
||||
with:
|
||||
tool: taplo-cli
|
||||
|
||||
- run: taplo fmt --check --diff
|
||||
@@ -10,15 +10,15 @@ on:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/integration-tests.yml"
|
||||
- "plugins/updater/src/**"
|
||||
- '.github/workflows/integration-tests.yml'
|
||||
- 'plugins/updater/src/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/integration-tests.yml"
|
||||
- "plugins/updater/src/**"
|
||||
- '.github/workflows/integration-tests.yml'
|
||||
- 'plugins/updater/src/**'
|
||||
|
||||
jobs:
|
||||
run-integration-tests:
|
||||
|
||||
@@ -10,23 +10,23 @@ on:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/lint-javascript.yml"
|
||||
- "plugins/*/guest-js/**"
|
||||
- ".eslintignore"
|
||||
- ".eslintrc.json"
|
||||
- ".prettierignore"
|
||||
- "**/package.json"
|
||||
- '.github/workflows/lint-javascript.yml'
|
||||
- 'plugins/*/guest-js/**'
|
||||
- '.eslintignore'
|
||||
- '.eslintrc.json'
|
||||
- '.prettierignore'
|
||||
- '**/package.json'
|
||||
pull_request:
|
||||
branches:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/lint-javascript.yml"
|
||||
- "plugins/*/guest-js/**"
|
||||
- ".eslintignore"
|
||||
- ".eslintrc.json"
|
||||
- ".prettierignore"
|
||||
- "**/package.json"
|
||||
- '.github/workflows/lint-javascript.yml'
|
||||
- 'plugins/*/guest-js/**'
|
||||
- '.eslintignore'
|
||||
- '.eslintrc.json'
|
||||
- '.prettierignore'
|
||||
- '**/package.json'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -46,30 +46,10 @@ jobs:
|
||||
${{ runner.os }}-
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
node-version: 'lts/*'
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.x.x
|
||||
run_install: true
|
||||
- name: eslint
|
||||
run: pnpm lint
|
||||
prettier:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache pnpm modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.x.x
|
||||
run_install: true
|
||||
- name: prettier check
|
||||
run: pnpm format-check
|
||||
|
||||
@@ -10,19 +10,19 @@ on:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/lint-rust.yml"
|
||||
- "plugins/*/src/**"
|
||||
- "!plugins/*/src/api-iife.js"
|
||||
- "**/Cargo.toml"
|
||||
- '.github/workflows/lint-rust.yml'
|
||||
- 'plugins/*/src/**'
|
||||
- '!plugins/*/src/api-iife.js'
|
||||
- '**/Cargo.toml'
|
||||
pull_request:
|
||||
branches:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/lint-rust.yml"
|
||||
- "plugins/*/src/**"
|
||||
- "!plugins/*/src/api-iife.js"
|
||||
- "**/Cargo.toml"
|
||||
- '.github/workflows/lint-rust.yml'
|
||||
- 'plugins/*/src/**'
|
||||
- '!plugins/*/src/api-iife.js'
|
||||
- '**/Cargo.toml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -147,10 +147,6 @@ jobs:
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: create dummy dist
|
||||
working-directory: examples/api
|
||||
run: mkdir dist
|
||||
|
||||
- name: clippy ${{ matrix.package }}
|
||||
if: matrix.package != 'tauri-plugin-sql'
|
||||
run: cargo clippy --package ${{ matrix.package }} --all-targets -- -D warnings
|
||||
@@ -162,17 +158,3 @@ jobs:
|
||||
- name: clippy ${{ matrix.package }} postgres
|
||||
if: matrix.package == 'tauri-plugin-sql'
|
||||
run: cargo clippy --package ${{ matrix.package }} --all-targets --no-default-features --features postgres -- -D warnings
|
||||
|
||||
fmt:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install rustfmt with nightly toolchain
|
||||
uses: dtolnay/rust-toolchain@nightly
|
||||
with:
|
||||
components: rustfmt
|
||||
|
||||
- name: Check formatting
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
node-version: 'lts/*'
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
|
||||
@@ -10,21 +10,21 @@ on:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/test-rust.yml"
|
||||
- "plugins/*/src/**"
|
||||
- "!plugins/*/src/api-iife.js"
|
||||
- "**/Cargo.toml"
|
||||
- "**/Cargo.lock"
|
||||
- '.github/workflows/test-rust.yml'
|
||||
- 'plugins/*/src/**'
|
||||
- '!plugins/*/src/api-iife.js'
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
pull_request:
|
||||
branches:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/test-rust.yml"
|
||||
- "plugins/*/src/**"
|
||||
- "!plugins/*/src/api-iife.js"
|
||||
- "**/Cargo.toml"
|
||||
- "**/Cargo.lock"
|
||||
- '.github/workflows/test-rust.yml'
|
||||
- 'plugins/*/src/**'
|
||||
- '!plugins/*/src/api-iife.js'
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -163,32 +163,32 @@ jobs:
|
||||
- {
|
||||
target: x86_64-pc-windows-msvc,
|
||||
os: windows-latest,
|
||||
runner: "cargo",
|
||||
command: "test",
|
||||
runner: 'cargo',
|
||||
command: 'test'
|
||||
}
|
||||
- {
|
||||
target: x86_64-unknown-linux-gnu,
|
||||
os: ubuntu-latest,
|
||||
runner: "cargo",
|
||||
command: "test",
|
||||
runner: 'cargo',
|
||||
command: 'test'
|
||||
}
|
||||
- {
|
||||
target: aarch64-apple-darwin,
|
||||
os: macos-latest,
|
||||
runner: "cargo",
|
||||
command: "test",
|
||||
runner: 'cargo',
|
||||
command: 'test'
|
||||
}
|
||||
- {
|
||||
target: aarch64-apple-ios,
|
||||
os: macos-latest,
|
||||
runner: "cargo",
|
||||
command: "build",
|
||||
runner: 'cargo',
|
||||
command: 'build'
|
||||
}
|
||||
- {
|
||||
target: aarch64-linux-android,
|
||||
os: ubuntu-latest,
|
||||
runner: "cross",
|
||||
command: "build",
|
||||
runner: 'cross',
|
||||
command: 'build'
|
||||
}
|
||||
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
@@ -210,10 +210,6 @@ jobs:
|
||||
with:
|
||||
key: cache-${{ matrix.package }}-${{ matrix.platform.target }}
|
||||
|
||||
- name: create dummy dist
|
||||
working-directory: examples/api
|
||||
run: mkdir dist
|
||||
|
||||
- name: install cross
|
||||
if: ${{ matrix.platform.runner == 'cross' }}
|
||||
run: cargo +stable install cross --git https://github.com/cross-rs/cross
|
||||
|
||||
Reference in New Issue
Block a user