Skip to content

Commit e4eed02

Browse files
authored
Merge branch 'v2' into feat/http/persist-cookies
2 parents 24f1e76 + 5b8efde commit e4eed02

File tree

220 files changed

+6339
-2903
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+6339
-2903
lines changed

.changes/config.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@
5656
"dependencies": [
5757
"barcode-scanner",
5858
"biometric",
59-
"log-plugin",
59+
"log",
6060
"cli",
6161
"clipboard-manager",
6262
"dialog",
6363
"fs",
6464
"global-shortcut",
65+
"opener",
6566
"http",
6667
"nfc",
6768
"notification",
@@ -87,6 +88,7 @@
8788
"dialog-js",
8889
"fs-js",
8990
"global-shortcut-js",
91+
"opener-js",
9092
"http-js",
9193
"nfc-js",
9294
"notification-js",
@@ -168,7 +170,8 @@
168170
},
169171
"dialog-js": {
170172
"path": "./plugins/dialog",
171-
"manager": "javascript"
173+
"manager": "javascript",
174+
"dependencies": ["fs-js"]
172175
},
173176
"geolocation": {
174177
"path": "./plugins/geolocation",
@@ -186,6 +189,14 @@
186189
"path": "./plugins/global-shortcut",
187190
"manager": "javascript"
188191
},
192+
"opener": {
193+
"path": "./plugins/opener",
194+
"manager": "rust"
195+
},
196+
"opener-js": {
197+
"path": "./plugins/opener",
198+
"manager": "javascript"
199+
},
189200
"haptics": {
190201
"path": "./plugins/haptics",
191202
"manager": "rust"
@@ -201,13 +212,14 @@
201212
},
202213
"http-js": {
203214
"path": "./plugins/http",
204-
"manager": "javascript"
215+
"manager": "javascript",
216+
"dependencies": ["fs-js"]
205217
},
206218
"localhost": {
207219
"path": "./plugins/localhost",
208220
"manager": "rust"
209221
},
210-
"log-plugin": {
222+
"log": {
211223
"path": "./plugins/log",
212224
"manager": "rust"
213225
},

.changes/fix-sql-blocking.md

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

.changes/fs-writeTextFile-utf8-path.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"log": patch
3+
"log-js": patch
4+
---
5+
6+
Make log functions omit caller location when failed to parse it instead of throwing

.changes/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ As you create PRs and make changes that require a version bump, please add a new
66

77
When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process.
88

9+
**Note, that in this repository, even if only the Rust code or only the JavaScript code of a plugin changed, both packages need to be bumped with the same increment!**
10+
911
Use the following format:
1012

1113
```md
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
2+
# SPDX-License-Identifier: Apache-2.0
3+
# SPDX-License-Identifier: MIT
4+
5+
name: check change files
6+
7+
on:
8+
pull_request:
9+
paths:
10+
- '.changes/*.md'
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
check:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: check change files end with .md
23+
run: |
24+
for file in .changes/*
25+
do
26+
if [[ ! "$file" =~ \.(md|json)$ ]]; then
27+
echo ".changes directory should only contain files that end with .md"
28+
echo "found an invalid file in .changes directory:"
29+
echo "$file"
30+
exit 1
31+
fi
32+
done
33+
34+
- uses: dorny/paths-filter@v3
35+
id: filter
36+
with:
37+
list-files: shell
38+
filters: |
39+
changes:
40+
- added|modified: '.changes/*.md'
41+
42+
- name: check
43+
run: node ./.scripts/ci/check-change-files.js ${{ steps.filter.outputs.changes_files }}
44+
if: ${{ steps.filter.outputs.changes == 'true' }}

.github/workflows/check-generated-files.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ jobs:
5353
- .github/workflows/check-generated-files.yml
5454
- plugins/global-shortcut/guest-js/**
5555
- plugins/global-shortcut/src/api-iife.js
56+
opener:
57+
- .github/workflows/check-generated-files.yml
58+
- plugins/opener/guest-js/**
59+
- plugins/opener/src/api-iife.js
5660
haptics:
5761
- .github/workflows/check-generated-files.yml
5862
- plugins/haptics/guest-js/**

.github/workflows/lint-rust.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ jobs:
6666
tauri-plugin-global-shortcut:
6767
- .github/workflows/lint-rust.yml
6868
- plugins/global-shortcut/**
69+
tauri-plugin-opener:
70+
- .github/workflows/lint-rust.yml
71+
- plugins/opener/**
6972
tauri-plugin-haptics:
7073
- .github/workflows/lint-rust.yml
7174
- plugins/haptics/**

.github/workflows/test-rust.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,109 +47,140 @@ jobs:
4747
tauri-plugin-autostart:
4848
- .github/workflows/test-rust.yml
4949
- Cargo.toml
50+
- Cargo.lock
5051
- plugins/autostart/**
5152
tauri-plugin-cli:
5253
- .github/workflows/test-rust.yml
5354
- Cargo.toml
55+
- Cargo.lock
5456
- plugins/cli/**
5557
tauri-plugin-clipboard-manager:
5658
- .github/workflows/test-rust.yml
5759
- Cargo.toml
60+
- Cargo.lock
5861
- plugins/clipboard-manager/**
5962
tauri-plugin-deep-link:
6063
- .github/workflows/test-rust.yml
6164
- Cargo.toml
65+
- Cargo.lock
6266
- plugins/deep-link/**
6367
tauri-plugin-dialog:
6468
- .github/workflows/test-rust.yml
6569
- Cargo.toml
70+
- Cargo.lock
6671
- plugins/dialog/**
6772
- plugins/fs/**
6873
tauri-plugin-fs:
6974
- .github/workflows/test-rust.yml
7075
- Cargo.toml
76+
- Cargo.lock
7177
- plugins/fs/**
7278
tauri-plugin-geolocation:
7379
- .github/workflows/test-rust.yml
7480
- Cargo.toml
81+
- Cargo.lock
7582
- plugins/geolocation/**
7683
tauri-plugin-global-shortcut:
7784
- .github/workflows/test-rust.yml
7885
- Cargo.toml
86+
- Cargo.lock
7987
- plugins/global-shortcut/**
88+
tauri-plugin-opener:
89+
- .github/workflows/test-rust.yml
90+
- Cargo.toml
91+
- Cargo.lock
92+
- plugins/opener/**
8093
tauri-plugin-haptics:
8194
- .github/workflows/test-rust.yml
8295
- Cargo.toml
96+
- Cargo.lock
8397
- plugins/haptics/**
8498
tauri-plugin-http:
8599
- .github/workflows/test-rust.yml
86100
- Cargo.toml
101+
- Cargo.lock
87102
- plugins/http/**
88103
- plugins/fs/**
89104
tauri-plugin-localhost:
90105
- .github/workflows/test-rust.yml
91106
- Cargo.toml
107+
- Cargo.lock
92108
- plugins/localhost/**
93109
tauri-plugin-log:
94110
- .github/workflows/test-rust.yml
95111
- Cargo.toml
112+
- Cargo.lock
96113
- plugins/log/**
97114
tauri-plugin-notification:
98115
- .github/workflows/test-rust.yml
99116
- Cargo.toml
117+
- Cargo.lock
100118
- plugins/notification/**
101119
tauri-plugin-os:
102120
- .github/workflows/test-rust.yml
103121
- Cargo.toml
122+
- Cargo.lock
104123
- plugins/os/**
105124
tauri-plugin-persisted-scope:
106125
- .github/workflows/test-rust.yml
107126
- Cargo.toml
127+
- Cargo.lock
108128
- plugins/persisted-scope/**
109129
- plugins/fs/**
110130
tauri-plugin-positioner:
111131
- .github/workflows/test-rust.yml
112132
- Cargo.toml
133+
- Cargo.lock
113134
- plugins/positioner/**
114135
tauri-plugin-process:
115136
- .github/workflows/test-rust.yml
116137
- Cargo.toml
138+
- Cargo.lock
117139
- plugins/process/**
118140
tauri-plugin-shell:
119141
- .github/workflows/test-rust.yml
120142
- Cargo.toml
143+
- Cargo.lock
121144
- plugins/shell/**
122145
tauri-plugin-single-instance:
123146
- .github/workflows/test-rust.yml
124147
- Cargo.toml
148+
- Cargo.lock
125149
- plugins/single-instance/**
126150
tauri-plugin-sql:
127151
- .github/workflows/test-rust.yml
128152
- Cargo.toml
153+
- Cargo.lock
129154
- plugins/sql/**
130155
tauri-plugin-store:
131156
- .github/workflows/test-rust.yml
132157
- Cargo.toml
158+
- Cargo.lock
133159
- plugins/store/**
134160
tauri-plugin-stronghold:
135161
- .github/workflows/test-rust.yml
136162
- Cargo.toml
163+
- Cargo.lock
137164
- plugins/stronghold/**
138165
tauri-plugin-updater:
139166
- .github/workflows/test-rust.yml
140167
- Cargo.toml
168+
- Cargo.lock
141169
- plugins/updater/**
142170
tauri-plugin-upload:
143171
- .github/workflows/test-rust.yml
144172
- Cargo.toml
173+
- Cargo.lock
145174
- plugins/upload/**
146175
tauri-plugin-websocket:
147176
- .github/workflows/test-rust.yml
148177
- Cargo.toml
178+
- Cargo.lock
149179
- plugins/websocket/**
150180
tauri-plugin-window-state:
151181
- .github/workflows/test-rust.yml
152182
- Cargo.toml
183+
- Cargo.lock
153184
- plugins/window-state/**
154185
155186
test:

.scripts/ci/check-change-files.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/usr/bin/env node
2+
3+
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
4+
// SPDX-License-Identifier: Apache-2.0
5+
// SPDX-License-Identifier: MIT
6+
7+
import { readFileSync, readdirSync } from 'fs'
8+
import { join } from 'path'
9+
10+
/* const ignorePackages = [
11+
'api-example',
12+
'api-example-js',
13+
'deep-link-example',
14+
'deep-link-example-js'
15+
] */
16+
17+
const rsOnly = ['localhost', 'persisted-scope']
18+
19+
function checkChangeFiles(changeFiles) {
20+
let code = 0
21+
22+
for (const file of changeFiles) {
23+
const content = readFileSync(file, 'utf8')
24+
const [frontMatter] = /^---[\s\S.]*---\n/i.exec(content)
25+
const packages = frontMatter
26+
.split('\n')
27+
.filter((l) => !(l === '---' || !l))
28+
.map((l) => l.replace(/('|")/g, '').split(':'))
29+
30+
const rsPackages = Object.fromEntries(
31+
packages
32+
.filter((v) => !v[0].endsWith('-js'))
33+
.map((v) => [v[0], v[1].trim()])
34+
)
35+
const jsPackages = Object.fromEntries(
36+
packages
37+
.filter((v) => v[0].endsWith('-js'))
38+
.map((v) => [v[0].slice(0, -3), v[1].trim()])
39+
)
40+
41+
for (const pkg in rsPackages) {
42+
if (rsOnly.includes(pkg)) continue
43+
44+
if (!jsPackages[pkg]) {
45+
console.error(
46+
`Missing "${rsPackages[pkg]}" bump for JS package "${pkg}-js" in ${file}.`
47+
)
48+
code = 1
49+
} else if (rsPackages[pkg] != jsPackages[pkg]) {
50+
console.error(
51+
`"${pkg}" and "${pkg}-js" have different version bumps in ${file}.`
52+
)
53+
code = 1
54+
}
55+
}
56+
57+
for (const pkg in jsPackages) {
58+
if (!rsPackages[pkg]) {
59+
console.error(
60+
`Missing "${jsPackages[pkg]}" bump for Rust package "${pkg}" in ${file}.`
61+
)
62+
code = 1
63+
} else if (rsPackages[pkg] != jsPackages[pkg]) {
64+
console.error(
65+
`"${pkg}" and "${pkg}-js" have different version bumps in ${file}.`
66+
)
67+
code = 1
68+
}
69+
}
70+
}
71+
72+
process.exit(code)
73+
}
74+
75+
const [_bin, _script, ...files] = process.argv
76+
77+
if (files.length > 0) {
78+
checkChangeFiles(
79+
files.filter((f) => f.toLowerCase() !== '.changes/readme.md')
80+
)
81+
} else {
82+
const changeFiles = readdirSync('.changes')
83+
.filter((f) => f.endsWith('.md') && f.toLowerCase() !== 'readme.md')
84+
.map((p) => join('.changes', p))
85+
checkChangeFiles(changeFiles)
86+
}

0 commit comments

Comments
 (0)