Skip to content

Commit

Permalink
Merge branch 'v2' into feat/http/persist-cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir authored Dec 8, 2024
2 parents 24f1e76 + 5b8efde commit e4eed02
Show file tree
Hide file tree
Showing 220 changed files with 6,339 additions and 2,903 deletions.
20 changes: 16 additions & 4 deletions .changes/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@
"dependencies": [
"barcode-scanner",
"biometric",
"log-plugin",
"log",
"cli",
"clipboard-manager",
"dialog",
"fs",
"global-shortcut",
"opener",
"http",
"nfc",
"notification",
Expand All @@ -87,6 +88,7 @@
"dialog-js",
"fs-js",
"global-shortcut-js",
"opener-js",
"http-js",
"nfc-js",
"notification-js",
Expand Down Expand Up @@ -168,7 +170,8 @@
},
"dialog-js": {
"path": "./plugins/dialog",
"manager": "javascript"
"manager": "javascript",
"dependencies": ["fs-js"]
},
"geolocation": {
"path": "./plugins/geolocation",
Expand All @@ -186,6 +189,14 @@
"path": "./plugins/global-shortcut",
"manager": "javascript"
},
"opener": {
"path": "./plugins/opener",
"manager": "rust"
},
"opener-js": {
"path": "./plugins/opener",
"manager": "javascript"
},
"haptics": {
"path": "./plugins/haptics",
"manager": "rust"
Expand All @@ -201,13 +212,14 @@
},
"http-js": {
"path": "./plugins/http",
"manager": "javascript"
"manager": "javascript",
"dependencies": ["fs-js"]
},
"localhost": {
"path": "./plugins/localhost",
"manager": "rust"
},
"log-plugin": {
"log": {
"path": "./plugins/log",
"manager": "rust"
},
Expand Down
5 changes: 0 additions & 5 deletions .changes/fix-sql-blocking.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changes/fs-writeTextFile-utf8-path.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changes/log-caller-location-throw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"log": patch
"log-js": patch
---

Make log functions omit caller location when failed to parse it instead of throwing
2 changes: 2 additions & 0 deletions .changes/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ As you create PRs and make changes that require a version bump, please add a new

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.

**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!**

Use the following format:

```md
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/check-change-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

name: check change files

on:
pull_request:
paths:
- '.changes/*.md'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: check change files end with .md
run: |
for file in .changes/*
do
if [[ ! "$file" =~ \.(md|json)$ ]]; then
echo ".changes directory should only contain files that end with .md"
echo "found an invalid file in .changes directory:"
echo "$file"
exit 1
fi
done
- uses: dorny/paths-filter@v3
id: filter
with:
list-files: shell
filters: |
changes:
- added|modified: '.changes/*.md'
- name: check
run: node ./.scripts/ci/check-change-files.js ${{ steps.filter.outputs.changes_files }}
if: ${{ steps.filter.outputs.changes == 'true' }}
4 changes: 4 additions & 0 deletions .github/workflows/check-generated-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ jobs:
- .github/workflows/check-generated-files.yml
- plugins/global-shortcut/guest-js/**
- plugins/global-shortcut/src/api-iife.js
opener:
- .github/workflows/check-generated-files.yml
- plugins/opener/guest-js/**
- plugins/opener/src/api-iife.js
haptics:
- .github/workflows/check-generated-files.yml
- plugins/haptics/guest-js/**
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lint-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ jobs:
tauri-plugin-global-shortcut:
- .github/workflows/lint-rust.yml
- plugins/global-shortcut/**
tauri-plugin-opener:
- .github/workflows/lint-rust.yml
- plugins/opener/**
tauri-plugin-haptics:
- .github/workflows/lint-rust.yml
- plugins/haptics/**
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/test-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,109 +47,140 @@ jobs:
tauri-plugin-autostart:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/autostart/**
tauri-plugin-cli:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/cli/**
tauri-plugin-clipboard-manager:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/clipboard-manager/**
tauri-plugin-deep-link:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/deep-link/**
tauri-plugin-dialog:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/dialog/**
- plugins/fs/**
tauri-plugin-fs:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/fs/**
tauri-plugin-geolocation:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/geolocation/**
tauri-plugin-global-shortcut:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/global-shortcut/**
tauri-plugin-opener:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/opener/**
tauri-plugin-haptics:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/haptics/**
tauri-plugin-http:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/http/**
- plugins/fs/**
tauri-plugin-localhost:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/localhost/**
tauri-plugin-log:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/log/**
tauri-plugin-notification:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/notification/**
tauri-plugin-os:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/os/**
tauri-plugin-persisted-scope:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/persisted-scope/**
- plugins/fs/**
tauri-plugin-positioner:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/positioner/**
tauri-plugin-process:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/process/**
tauri-plugin-shell:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/shell/**
tauri-plugin-single-instance:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/single-instance/**
tauri-plugin-sql:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/sql/**
tauri-plugin-store:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/store/**
tauri-plugin-stronghold:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/stronghold/**
tauri-plugin-updater:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/updater/**
tauri-plugin-upload:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/upload/**
tauri-plugin-websocket:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/websocket/**
tauri-plugin-window-state:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/window-state/**
test:
Expand Down
86 changes: 86 additions & 0 deletions .scripts/ci/check-change-files.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/env node

// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

import { readFileSync, readdirSync } from 'fs'
import { join } from 'path'

/* const ignorePackages = [
'api-example',
'api-example-js',
'deep-link-example',
'deep-link-example-js'
] */

const rsOnly = ['localhost', 'persisted-scope']

function checkChangeFiles(changeFiles) {
let code = 0

for (const file of changeFiles) {
const content = readFileSync(file, 'utf8')
const [frontMatter] = /^---[\s\S.]*---\n/i.exec(content)
const packages = frontMatter
.split('\n')
.filter((l) => !(l === '---' || !l))
.map((l) => l.replace(/('|")/g, '').split(':'))

const rsPackages = Object.fromEntries(
packages
.filter((v) => !v[0].endsWith('-js'))
.map((v) => [v[0], v[1].trim()])
)
const jsPackages = Object.fromEntries(
packages
.filter((v) => v[0].endsWith('-js'))
.map((v) => [v[0].slice(0, -3), v[1].trim()])
)

for (const pkg in rsPackages) {
if (rsOnly.includes(pkg)) continue

if (!jsPackages[pkg]) {
console.error(
`Missing "${rsPackages[pkg]}" bump for JS package "${pkg}-js" in ${file}.`
)
code = 1
} else if (rsPackages[pkg] != jsPackages[pkg]) {
console.error(
`"${pkg}" and "${pkg}-js" have different version bumps in ${file}.`
)
code = 1
}
}

for (const pkg in jsPackages) {
if (!rsPackages[pkg]) {
console.error(
`Missing "${jsPackages[pkg]}" bump for Rust package "${pkg}" in ${file}.`
)
code = 1
} else if (rsPackages[pkg] != jsPackages[pkg]) {
console.error(
`"${pkg}" and "${pkg}-js" have different version bumps in ${file}.`
)
code = 1
}
}
}

process.exit(code)
}

const [_bin, _script, ...files] = process.argv

if (files.length > 0) {
checkChangeFiles(
files.filter((f) => f.toLowerCase() !== '.changes/readme.md')
)
} else {
const changeFiles = readdirSync('.changes')
.filter((f) => f.endsWith('.md') && f.toLowerCase() !== 'readme.md')
.map((p) => join('.changes', p))
checkChangeFiles(changeFiles)
}
1 change: 1 addition & 0 deletions .taurignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plugins/*/permissions/autogenerated/
Loading

0 comments on commit e4eed02

Please sign in to comment.