Skip to content

Commit 8276ab7

Browse files
authored
chore(cli/plugin): update plugin template (#9346)
closes #9342
1 parent f8fde4f commit 8276ab7

File tree

19 files changed

+127
-351
lines changed

19 files changed

+127
-351
lines changed

tooling/cli/src/plugin/init.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ pub fn command(mut options: Options) -> Result<()> {
194194
}
195195
}
196196
"ios" if !(options.ios || options.mobile) => return Ok(None),
197-
"webview-dist" | "webview-src" | "package.json" => {
198-
if options.no_api {
199-
return Ok(None);
200-
}
197+
"guest-js" | "rollup.config.js" | "tsconfig.json" | "package.json"
198+
if options.no_api =>
199+
{
200+
return Ok(None);
201201
}
202202
_ => (),
203203
}

tooling/cli/templates/plugin/.changes/config.json

-91
This file was deleted.

tooling/cli/templates/plugin/.changes/initial-release.md

-6
This file was deleted.

tooling/cli/templates/plugin/.changes/readme.md

-16
This file was deleted.

tooling/cli/templates/plugin/.github/workflows/audit.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,27 @@ on:
88
branches:
99
- main
1010
paths:
11+
- ".github/workflows/audit.yml"
1112
- "**/Cargo.lock"
1213
- "**/Cargo.toml"
1314
pull_request:
1415
branches:
1516
- main
1617
paths:
18+
- ".github/workflows/audit.yml"
1719
- "**/Cargo.lock"
1820
- "**/Cargo.toml"
1921

22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
2026
jobs:
2127
audit:
2228
runs-on: ubuntu-latest
2329
steps:
24-
- uses: actions/checkout@v3
30+
- uses: actions/checkout@v4
2531
- uses: rustsec/audit-check@v1
2632
with:
2733
token: ${{ secrets.GITHUB_TOKEN }}
28-
permissions:
29-
issues: write
30-
checks: write
3134
{{{{/raw}}}}
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,55 @@
11
{{{{raw}}}}
2-
name: Clippy
2+
name: Check
33

44
on:
55
push:
66
branches:
77
- main
8+
paths:
9+
- ".github/workflows/check.yml"
10+
- "**/*.rs"
11+
- "**/Cargo.toml"
812
pull_request:
913
branches:
1014
- main
11-
- dev
15+
paths:
16+
- ".github/workflows/check.yml"
17+
- "**/*.rs"
18+
- "**/Cargo.toml"
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
1223

1324
jobs:
14-
clippy:
25+
fmt:
1526
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: dtolnay/rust-toolchain@stable
31+
with:
32+
components: rustfmt
33+
- run: cargo fmt --all -- --check
34+
35+
clippy:
1636
strategy:
1737
fail-fast: false
38+
matrix:
39+
platform: [ubuntu-latest, macos-latest, windows-latest]
1840

19-
steps:
20-
- uses: actions/checkout@v3
41+
runs-on: ${{ matrix.platform }}
2142

22-
- name: Install dependencies
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: dtolnay/rust-toolchain@stable
46+
with:
47+
components: clippy
48+
- name: install webkit2gtk
49+
if: matrix.platform == 'ubuntu-latest'
2350
run: |
2451
sudo apt-get update
2552
sudo apt-get install -y webkit2gtk-4.1
26-
27-
- name: Install clippy with stable toolchain
28-
uses: dtolnay/rust-toolchain@stable
29-
with:
30-
components: clippy
31-
3253
- uses: Swatinem/rust-cache@v2
33-
34-
- run: cargo clippy --manifest-path=Cargo.toml --all-targets --all-features -- -D warnings
54+
- run: cargo clippy --all-targets --all-features -- -D warnings
3555
{{{{/raw}}}}

tooling/cli/templates/plugin/.github/workflows/covector-version-or-publish.yml

-48
This file was deleted.

tooling/cli/templates/plugin/.github/workflows/format.yml

-30
This file was deleted.

tooling/cli/templates/plugin/.github/workflows/test.yml

+13-21
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,28 @@ on:
88
pull_request:
99
branches:
1010
- main
11-
- dev
12-
paths-ignore:
13-
- 'webview-src/**'
14-
- 'webview-dist/**'
15-
- 'examples/**'
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
1615

1716
jobs:
18-
build-and-test:
19-
runs-on: ${{ matrix.os }}
17+
test:
2018
strategy:
2119
fail-fast: false
2220
matrix:
23-
os: [ubuntu-latest, macos-latest, windows-latest]
24-
25-
steps:
26-
- uses: actions/checkout@v3
21+
platform: [ubuntu-latest, macos-latest, windows-latest]
2722

28-
- name: Install stable toolchain
29-
uses: dtolnay/rust-toolchain@stable
30-
with:
31-
components: clippy
23+
runs-on: ${{ matrix.platform }}
3224

33-
- name: Install Linux dependencies
34-
if: matrix.os == 'ubuntu-latest'
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: dtolnay/rust-toolchain@stable
28+
- name: install webkit2gtk
29+
if: matrix.platform == 'ubuntu-latest'
3530
run: |
3631
sudo apt-get update
3732
sudo apt-get install -y webkit2gtk-4.1
38-
3933
- uses: Swatinem/rust-cache@v2
40-
41-
- name: Run tests
42-
run: cargo test --manifest-path=Cargo.toml --release
34+
- run: cargo test --all-targets --all-features -- -D warnings
4335
{{{{/raw}}}}

tooling/cli/templates/plugin/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ yarn.lock
1212
/target
1313
Cargo.lock
1414
node_modules/
15+
16+
dist-js
17+
dist

0 commit comments

Comments
 (0)