Compare commits

...

859 Commits

Author SHA1 Message Date
Lucas Nogueira
cf331cdc3e fix(core): lint 2024-07-01 23:54:56 -03:00
Lucas Nogueira
574076541a fix(ci): downgrade crates for MSRV check 2024-07-01 23:52:09 -03:00
github-actions[bot]
89f3048f52 apply version updates (#9871)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2024-07-01 23:13:05 -03:00
Amr Bashir
08f57efefd fix(cli): parse --profile=<profile> syntax (#10136)
* fix(cli): parse `--profile=<profile>` syntax

ref: https://github.com/tauri-apps/tauri/issues/6255#issuecomment-2192466839

* Update tooling/cli/src/interface/rust.rs

* derive default

* safe check next arg

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2024-06-27 06:53:29 -03:00
Fabian-Lars
63da834ce4 ci: Fix msrv check (#10118)
* ci: Fix os_pipe precise version

* reading is hard

* downgrade syn

* more specific

* WHO DO YOU CALL UNSTABLE

* i just want to go to bed
2024-06-25 02:58:20 +03:00
chip
c2d3afa4fb prevent uncomment collision in 1.x invoke_key templating (fix #10084) (#10087)
* don't use invoke key template name in comment (fix #10084)

* undo whitespace change
2024-06-18 19:42:19 +03:00
Harry Mallon
924387092e feat: add dmg settings, cherry picked from #7964 (#8334)
* feat(bundler): add dmg settings, closes #4669 (#7964)

* fix(bundler): lint and cleanup for #7964 (#8275)

* fmt

---------

Co-authored-by: Andrew <andrey255@live.com>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
2024-06-17 13:25:12 +02:00
Pylogmon
d2786bf699 chore(template): template format error (#10018)
* chore(template): template format error

* fix
2024-06-12 04:30:24 +03:00
Pylogmon
674accad75 fix: missing depends for rpm package (#10015)
* fix: missing depends for rpm package

* chore: add changes
2024-06-12 04:24:03 +03:00
Fabian-Lars
09152d83e1 ci(msrv-list): Downgrade os_pipe (#10014) 2024-06-11 21:12:44 +03:00
Fabian-Lars
3752eb1e6b ci(msrv-list): downgrade hyper earlier (#10002) 2024-06-06 17:42:42 +03:00
Fabian-Lars
d104abb656 fix(bench): Update time, backport of #9993 (#10000)
* fix(bench): Update time, backport of #9993

* x
2024-06-06 16:07:32 +03:00
anatawa12
940aa183c7 fix(nsis): run app as normal user (#9944) (#9995)
(cherry picked from commit 6f469534b0)

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2024-06-06 15:00:23 +02:00
anatawa12
a423c52c1c fix(cli): not working with license.workspace = true (#9998) 2024-06-06 13:17:33 +02:00
anatawa12
c12ed92da5 fix(cli): Cargo.lock is not synchronized with Cargo.toml (#9996) 2024-06-06 13:05:13 +02:00
Pylogmon
8b66174f0d fix(bundler): fix error when renaming the downloaded zip of NSIS (#9956) 2024-06-05 04:47:03 +03:00
Lucas Fernandes Nogueira
07b02c9f96 fix(core): test invoke key, closes #9960 (#9972) 2024-06-04 17:02:18 -03:00
Jerry
8ee8f09390 fix(core): fix check temp path permission on mac os, fix #6256 (#9588)
* fix: check temp path permission on mac os

* chore: format code
2024-06-04 10:02:54 -03:00
Pylogmon
78fc841370 feat(bundler): add provides, conflicts and replaces for deb and rpm (#9942)
Backport of #9331
2024-06-04 04:47:17 +03:00
AnthonyNGarcia
a301be52d2 fix(windows): Fix Windows System User build failures by using the current directory for bundling tools (fix: 9895) (#9914)
Co-authored-by: amrbashir <amr.bashir2015@gmail.com>
2024-06-03 21:45:44 +03:00
muwoo
5909662766 feat(bundler): support custom sign command on Windows (#9902) 2024-06-03 21:34:49 +03:00
Harry Mallon
253595a22d feat(bundler): Add RPM packaging, closes #4402 (#5202) (#9809)
* feat(bundler): Add RPM packaging

* feat(bundler): Update 'rpm' to 0.13.1

* Fix fmt

Co-authored-by: Olivier Lemasle <olivier.lemasle@apalia.net>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-05-28 22:31:29 -03:00
Fabian-Lars
a020828d0e feat(bundler/windows): Update wix to fix vulnerabilities and add arm support (#9861)
* feat(bundler/windows): Update wix to fix vulnerbilities and add arm support

* is this what it's complaining about?

* delete change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-05-28 22:31:16 -03:00
Amr Bashir
e48157da2f fix(core/shell/command): retry sending events when it fails, closes #7684 (#9698)
* fix(core/shell/command): retry sending events when it fails, closes #7684

* try normally first

* sleep first
2024-05-28 11:48:57 -03:00
Amr Bashir
44e3335da8 fix(core/shell): speedup Command.execute & fix extra new lines (#9796)
* fix(core/shell): speedup `Command.execute` & fix extra new lines (#9706)

* fix(core/shell): speedup `Command.execute` & fix extra new lines

The speed gains comes from running the Command in Rust fully and returning the result in one go instead of using events.

The extra new lines was a regression from https://github.com/tauri-apps/tauri/pull/6519

ref: https://github.com/tauri-apps/tauri/issues/7684#issuecomment-2100897383

* fix unix build

* clippy

* cleanup

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>

* lock file

* minor

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2024-05-24 13:40:05 -03:00
github-actions[bot]
bf708a21a8 apply version updates (#9857)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2024-05-22 23:10:41 -03:00
chip
f6d81dfe08 Merge pull request from GHSA-57fm-592m-34r7
* add __TAURI_INVOKE_KEY__ to ipc calls to detect initialized frames

* move ipc key check to start of on_message

* cargo +nightly fmt

* undo Cargo.toml formatting changes

* undo Cargo.toml formatting changes

* undo Cargo.toml formatting changes

* remove merged changefiles

* undo formatting changes to js files

* undo formatting changes to js files

* Update to patched wry  release

* fix: optional chaining is not supported on older webviews (#9529)

* Revert "undo formatting changes to js files"

This reverts commit a7ef0d91ea1b183e091ea65a2b201d65522cc1d5.

* Revert "undo formatting changes to js files"

This reverts commit 0fcfd4664b915af51b71e7ea68929fd5b6cb5fc3.

* revert core.js

* inject __TAURI_INVOKE_KEY__ to __TAURI_IPC__ instead

* remove unrelated changes file

* remove left over dbg! call

* change file

---------

Co-authored-by: Tillmann <28728469+tweidinger@users.noreply.github.com>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-05-22 17:49:08 -03:00
木偶
50aabad1f6 refactor(updater/nsis): migrate run updater using powershell to ShellExecute (#9818) 2024-05-22 21:26:17 +03:00
github-actions[bot]
d78fa20d86 Apply Version Updates From Current Changes (v1) (#9793)
Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
2024-05-15 20:09:07 +03:00
Amr Bashir
3b69c1384b Revert "fix(core/shell): speedup Command.execute & fix extra new lines (#9706)" (#9792)
* Revert "fix(core/shell): speedup `Command.execute` & fix extra new lines (#9706)"

This reverts commit 7f885bd5ed.

* change file
2024-05-15 19:28:15 +03:00
Amr Bashir
704260bb3c fix(macos/dialog): avoid setting empty default_path (#9784)
closes #7566

ref: https://github.com/tauri-apps/tauri/issues/4065
ref: https://github.com/tauri-apps/tauri/pull/4028
ref: https://github.com/tauri-apps/tauri/issues/9762
2024-05-15 18:45:11 +03:00
Amr Bashir
36b082a9c8 ci: pull .crate file from workspace target directory (#9732) 2024-05-10 02:32:15 +03:00
github-actions[bot]
f45d35cf06 Apply Version Updates From Current Changes (v1) (#9730)
Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
2024-05-10 00:13:21 +03:00
Amr Bashir
ef35a793c5 fix(core): fix compilation when shell-execute or shell-sidecar (#9729)
* fix(core): fix compilation when `shell-execute` or `shell-sidecar`

regression from: https://github.com/tauri-apps/tauri/pull/9706

* change file
2024-05-09 23:56:52 +03:00
github-actions[bot]
15c62b5d99 Apply Version Updates From Current Changes (v1) (#9721)
* apply version updates

* fmt

---------

Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-05-09 15:22:45 -03:00
Lucas Fernandes Nogueira
9b90b67ed2 Revert "Apply Version Updates From Current Changes (v1)" (#9724)
This reverts commit 6bb721cd3d.
2024-05-09 14:02:31 -03:00
Angel S. Moreno
f1b0b00159 docs: added example of tauri.allowlist.protocol (#9726) 2024-05-09 19:52:55 +03:00
github-actions[bot]
6bb721cd3d Apply Version Updates From Current Changes (v1) (#9709)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2024-05-09 12:28:21 -03:00
Amr Bashir
7f885bd5ed fix(core/shell): speedup Command.execute & fix extra new lines (#9706)
* fix(core/shell): speedup `Command.execute` & fix extra new lines

The speed gains comes from running the Command in Rust fully and returning the result in one go instead of using events.

The extra new lines was a regression from https://github.com/tauri-apps/tauri/pull/6519

ref: https://github.com/tauri-apps/tauri/issues/7684#issuecomment-2100897383

* fix unix build

* clippy

* cleanup

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-05-09 18:14:53 +03:00
Lucas Fernandes Nogueira
2eb21378a6 fix(tauri-runtime-wry): window draw span not closing (#9718)
* fix(tauri-runtime-wry): window draw span not closing

* use .retain
2024-05-09 10:09:48 -03:00
Enkhjil Enkhbaatar
ab9ec42c10 fix(windows): nsis failed to resolve resources with $ in their name, closes #9657 (#9659) 2024-05-08 20:32:09 +03:00
github-actions[bot]
07b6f9fa83 apply version updates (#9683)
Co-authored-by: FabianLars <FabianLars@users.noreply.github.com>
2024-05-06 22:33:33 +02:00
Fabian-Lars
db9ec4e79c ci: fix msrv check (#9682)
* ci: fix msrv check
2024-05-06 21:59:34 +02:00
Fabian-Lars
2a9a28044b ci: fix msrv check (#9681) 2024-05-06 21:48:13 +02:00
Fabian-Lars
5ee5ed4dc6 fix: schemars 0.8.18 compatibility (#9680)
* fix: schemars 0.8.18 compatibility

backport of #9676

Co-authored-by: Hankung <73242257+Hankung7183@users.noreply.github.com>

* fix clippy lol

---------

Co-authored-by: Hankung <73242257+Hankung7183@users.noreply.github.com>
2024-05-06 21:35:01 +02:00
Amr Bashir
b8fd8e1bac refactor(nsis): use nsis's built-in com plugin instead of ApplicationID plugin (#9606)
* Use WinShell instead of ApplicationID

* Uninst shortcut before removing start menu one

* Use nsis's buit-in com plugin instead of WinShell

* Remove download ApplicationID code

* Add change file

* Clippy and format

* Allow dead code on extract_zip

* Qualify extract_zip path to make clippy happy

* Move macro up

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2024-04-30 15:11:00 +03:00
Amr Bashir
0749a84ae0 chore(cli/deps): update nsis-tauri-utils to 0.3 (#9605) 2024-04-30 13:05:08 +02:00
Amr Bashir
80db9dff28 ci: use node 16 (#9600)
* ci: use lts node version in CI

* lts/*

* 16

* more 16
2024-04-29 17:33:28 +03:00
Fabian-Lars
532279b724 ci(1.x): Fix publishing of cli-macos-x64 (#9575)
* ci: Fix publishing of cli-macos-x64

* temp: only publish darwin-x64

* temp: wrong version

* temp: disable everything but darwin-x64

* temp: wrong test arch...

* temp: last one

* temp: last one for realsies

* remove temp stuff

* revert more
2024-04-29 16:23:18 +03:00
Lucas Fernandes Nogueira
3e98145ac3 fix(core): run plugin init script in a separate context (#9570)
* fix(core): run plugin init script in a separate context

* fix ci
2024-04-28 11:15:26 -03:00
Fabian-Lars
fd2f8ab774 ci(1.x): Remove nodejs14 test in cli.js publishing workflow (#9569) 2024-04-25 12:45:06 +02:00
github-actions[bot]
caddd5bdd8 Apply Version Updates From Current Changes (v1) (#9544)
* apply version updates

* downgrade tokio deps

---------

Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-04-22 12:34:26 -03:00
Lucas Fernandes Nogueira
72c2636527 chore(ci): fix MSRV downgrade (#9543) 2024-04-22 11:17:33 -03:00
Lucas Fernandes Nogueira
83e024c670 chore(ci): downgrade home crate (#9542)
* chore(ci): downgrade home crate

* chore: update deps
2024-04-22 10:57:59 -03:00
Lucas Fernandes Nogueira
07c9e352df fix(ci): downgrade cc crate for MSRV compatibility (#9541) 2024-04-22 10:15:52 -03:00
Fabian-Lars
d00178d60c ci: Fix package downgrades in covector workflow (#9538)
* ci: Fix package downgrades in covector workflow

* some more packages
2024-04-22 09:16:16 -03:00
Lucas Fernandes Nogueira
705da977a9 fix: optional chaining is not supported on older webviews (#9529) 2024-04-21 20:53:51 -03:00
Fabian-Lars
1675e41f05 fix(bundler): don't convert product name to snake case when cross compiling (#9481)
* fix(bundler): Don't convert product name to snake case when cross compiling

fixes #9221

* Update bundler-cross-uppercase-productname.md

* Update .changes/bundler-cross-uppercase-productname.md
2024-04-18 17:04:17 +02:00
Fabian-Lars
f9638b6315 fix(cli): append extension to app binary manually on rename (#9491)
fixes #9488
fixes #8848
2024-04-18 05:31:07 +02:00
Amr Bashir
aeddc40b9e fix(cli/info): fix crash when checking node version (#9411)
closes #9396
2024-04-15 11:39:17 +02:00
Amr Bashir
fe6f81fa88 chore: fix clippy false positive (#9329) 2024-04-01 13:11:09 -03:00
Jet Li
9dd67abd93 fix(cli): upgrade heck to better support Chinese/Japanese prodcut name on Linux (#9298) 2024-04-01 17:23:15 +02:00
Fabian-Lars
dbe81b8410 fix(bundler/nsis): Don't use /R flag on installation dir (#9282) 2024-03-27 00:55:57 +02:00
Fabian-Lars
017861e4d5 fix(bundler): Fix nsis resource paths on non-windows build systems. (#9281)
* fix(bundler): Fix nsis resource paths on non-windows build systems.

* remove leftover from alternative
2024-03-27 00:40:29 +02:00
Fabian-Lars
77cc49ac3c fix(cli): Clone Options struct after mutating it. (#9188) 2024-03-19 10:37:12 -03:00
Amr Bashir
e3b6d38d26 fix(core/path): remove suffix in basename only once (#9166)
* fix(core/path): remove suffix in basename only once

ref: #9064

* Update tooling/api/src/path.ts

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-03-18 08:40:18 -03:00
github-actions[bot]
b705f89a10 Apply Version Updates From Current Changes (v1) (#9074)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2024-03-07 15:18:27 -03:00
Amr Bashir
97a05145fb fix(cli): migrate to stable features of log crate (#9119)
* fix(cli): migrate to stable features of `log` crate

* to_cow_str
2024-03-07 13:39:32 -03:00
anatawa12
b15948b11c fix(cli): use matched_path_or_any_parents when checking if a file is ignored (#8903)
* fix: taurignore ignoreing folders not working for watch

* docs: add to changes

* fix: panic: path is expected to be under the root

* Update taurignore-ignoring-folders-not-working-for-watch.md

* Update taurignore-ignoring-folders-not-working-for-watch.md
2024-03-06 21:12:41 +02:00
bifs
5163861588 fix(bundler): escape potentially problematic strings in an XML (#9040)
* fix(bundler): escape potentially problematic strings in an XML (#9030)

- replace characters invalid in XML with their escaped form to properly bundle resources with such characters in their pathnames.

* change file
2024-03-04 21:08:12 +02:00
github-actions[bot]
80a215a6f3 Apply Version Updates From Current Changes (v1) (#9013)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2024-02-28 00:11:02 -03:00
Amr Bashir
01ae1218dc ci: downgrade thread_local to 1.1.7 in msrv list (#9012) 2024-02-27 23:03:28 -03:00
Amr Bashir
d42668ce17 fix(runtime-wry): avoid panic during clipboard initialization on wayland (#9003)
closes #8964
2024-02-27 14:35:22 -03:00
Amr Bashir
1ab0db6352 chore: port PR template from dev branch (#9004) 2024-02-27 18:48:00 +02:00
Lucas Nogueira
e816a46b95 chore: update lock files 2024-02-18 23:46:17 -03:00
Lucas Nogueira
a4b82d9dba chore: bump tauri-utils 2024-02-18 22:31:35 -03:00
github-actions[bot]
b735b6799f Apply Version Updates From Current Changes (v1) (#8475)
* chore: change bump to patch

* apply version updates

---------

Co-authored-by: amrbashir <amr.bashir2015@gmail.com>
Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
2024-02-18 19:31:52 -03:00
amrbashir
7b5e8712e7 ci: update msrv test and cargo.lock 2024-02-14 04:01:01 +02:00
Lucas Fernandes Nogueira
2421073576 fix(macos): use BTreeMap for windows map to prevent crash on idle (#8117)
* fix(macos): use BTreeMap for windows map to prevent crash on idle

* use arc [skip ci]

* add change file
2024-02-14 01:15:21 +02:00
Fabian-Lars
510b62261c chore(core): Add missing changefile for #8546 (#8822) 2024-02-08 16:27:19 +02:00
Amr Bashir
b0f27814b9 fix(cli): map --profile dev to debug folder when finding executable (#8776) 2024-02-05 16:12:08 +02:00
John Smith
cc3d8e7731 fix(core): Command::output suspend while wait for response (#8539)
* fix: Command::output suspend while wait for response

* add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-02-01 08:06:05 -03:00
Amr Bashir
8ce51cec3b feat: retain cli args when relaunching after update, closes #7402 (#7718)
* feat: retain cli args when relaunching after update, closes #7402

* 1.61 compatible OsString join

* fix msi impl as well

* fix tests

* Update .changes/tauri-bundler-nsis-args.md

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>

* Update .changes/tauri-updater-retain-args.md

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>

* more typos

* fix update args

* pull args from Env

* check if not empty

* pin memchr

* Update core.rs

* Update core.rs

* move /args

* fix build

* lint

* more lints

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
2024-01-31 16:02:48 -03:00
Fabian-Lars
0bff8c325d fix(cli): Ignore query parameter in dev server (#8697)
* fix(cli): Ignore query parameter in dev server

fixes #8148
additional ref: https://discord.com/channels/616186924390023171/1201199918379974766

* Update .changes/cli-devserver-queryparam.md

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2024-01-29 14:58:23 +02:00
Fabian-Lars
a9b2c0625c chore: Commit Cargo.lock (#8586)
* chore: Commit Cargo.lock

* memchr for non-windows

* cfg-expr for non-windows

* add msrv check to covector

* update script

* downgrade arboard

* downgrade petgraph

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-01-17 16:21:45 -03:00
Naman Garg
7aa30dec85 feat: Add Section, Priority and Changelog options (#8620)
* Init section, priority and changelog

* Add section. priority and changelog support

* fix variable name

* Add .changes file

* Fix Formatting

* Apply suggestions from code review
2024-01-17 04:21:46 +02:00
Naman Garg
4926648751 deps: Libflate to flate2 (#8618)
* Replace libflate with flate2

* Add .changes file

* Cargo fmt
2024-01-16 15:52:19 +02:00
Amr Bashir
06890c70c6 feat: enable socks-proxy for bundler download (#8596) (#8611)
* feat: enable socks-proxy for bundler download

* change file

Co-authored-by: Lai Zn <laizenan@gmail.com>
2024-01-16 15:42:53 +02:00
阿良仔
1ca69bcf2f fix(clipboard): build issues on wayland (fix #8515) (#8546)
* fix(clipboard): fail to build on wayland

* specify exact version

* bump MSRV to 1.63

* revert msrv changes

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2024-01-15 19:52:49 +02:00
Naman Garg
6bdba1f330 fix(bundler/deb): use lintian-compliant permissions , closes #7992 (#8585) 2024-01-15 18:08:07 +02:00
Fabian-Lars
b546b42db7 fix(core): Retain order of map keys in ipc, fixes #7922 (#8577)
* fix(core): Retain order of map keys in ipc, fixes #7922

* enable dep on http-api feature instead of http-request

* Create fix-formbody-order.md

* Update fix-formbody-order.md
2024-01-10 21:03:25 +02:00
Fabian-Lars
67d7877f27 fix(cli): Watch workspace members if tauri dir is workspace root (#8520)
* fix(cli): Watch workspace members if tauri dir is ws root

See title. This PR also includes a fix/workaround for paths with funny characters that may not make the glob expansion panic.

Fixes #8509

* extract into function

* cleanup
2024-01-04 01:37:05 +02:00
Jason Tsai
89911296e4 feat(bundler): codesign nested code on macos (#8259)
* feat(bundler): codesign nested code on macos

* chore: update changelog tag

* typo

* also sign stuff in the Libraries folder

tested this for spacedrive, which has a bunch of dylib inside the libraries folder

* Update .changes/mac-bundler-nested-code-sign.md [skip ci]

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-12-28 13:58:24 -03:00
Amr Bashir
8f8729d918 fix(core): allow canceling data-tauri-drag-region maximization on macOS, closes #8306 (#8312)
* fix(core): allow canceling `data-tauri-drag-region` maximization on macOS, closes #8306

* Update .changes/tauri-data-drag-region-macos-maximize.md

* fix typo

* cancel if mouse moves

* Update tauri-data-drag-region-macos-maximize.md

[skip ci]

* Update core/tauri/scripts/core.js [skip ci]

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2023-12-28 09:13:48 -03:00
Amr Bashir
446fc99bbe ci: use default options for repository-dispatch (#8456) 2023-12-27 13:00:37 -03:00
Amr Bashir
6e48837860 feat: re-export Url (#8474)
* feat: re-exoprt `Url`

`Url` is used/returned from public API, we should re-export it

* Update .changes/export-url.md
2023-12-27 12:59:26 -03:00
renovate[bot]
883e52153e chore(deps) Update Tauri API Definitions (1.x) (#8449)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-20 14:16:58 -03:00
github-actions[bot]
5966812735 Apply Version Updates From Current Changes (v1) (#8396)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2023-12-20 13:50:17 -03:00
Amr Bashir
b44e9c0fcb feat(bundler): redownload outdated/mis-hashed files (#8431)
* feat(bundler): redownload outdata/mis-hashed files

* change import location

* Update util.rs

* Update util.rs

* Update bundler-mishashed-files.md

* Update bundler-mishashed-files.md

* rename fn

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-12-20 12:46:19 -03:00
Fabian-Lars
b2f83f03a8 fix(core): Replace Rc with Arc to prevent crashes when sending events (#8402)
* fix(core): Prevent crash when sending events.

* add change file

* use dedicated type for windows refcell map

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-12-20 12:13:00 -03:00
Fabian-Lars
0a2175eabb fix(cli): expand globs in workspace member paths (#8439)
* fix(cli): Expand globs in workspace member paths

fixes #8403

* unusued import

* into_iter

* return error instead of of empty vec

* Update dev-watcher-glob.md
2023-12-20 15:57:10 +02:00
Amr Bashir
645e1dcc6e fix(core/updater): check if installer args are not empty before passing -ArgumentList closes #8296 (#8404) 2023-12-20 01:08:38 +02:00
Amr Bashir
50a3d170f2 fix(core/dialog): reconstruct path using appropriate separator, closes #8074 (#8408)
* fix(core/dialog): reconstruct path using appropraite separator, closes #8074

* Update dialog-window-forward-slash.md

* Update dialog.rs

* Update core/tauri/src/endpoints/dialog.rs

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2023-12-18 21:08:18 -03:00
Amr Bashir
9b230de7bc fix(utils/config): fix parsing f64 values, closes #8252 (#8407) 2023-12-18 18:18:44 -03:00
Amr Bashir
50e9caad64 ci: access cli release id directly (#8398) 2023-12-18 18:17:39 -03:00
Amr Bashir
e5cc72eb40 ci: fix msrv tests (#8409)
* ci: remove `is-terminal` from crate pinning step

* pin cross-beam

* crossbeam-utils

* image

* linux-raw-sys

* fix version

* comon

* ha?

* tar

* now?

* rustix

* kill me, kill me now

* tar first???

* is-terminal

* I am dying

* remove rustix

* image
2023-12-18 18:15:28 -03:00
Lucas Fernandes Nogueira
0d0501cb7b refactor(clipboard): use arboard instead of tao closes #8177 (#8394)
* refactor(clipboard): use arboard instead of tao closes #8177

* update api lock

* add change file
2023-12-14 13:41:20 -03:00
Amr Bashir
1c582a942e refactor(api): generate types next to modules (#8392)
* refactor(api): generate types next to modules"

this fixes an issue with `moduleResolution: node`

* change file

* Update api-module-resolution-node.md
2023-12-14 13:27:48 -03:00
Alexandre Dang
3c371aa8ee feat(core): add test::test::get_ipc_response, closes #8199 (#8228)
* feat(core): Add additional functions to the

* Add documentation and cleanup the code

* Improve and add tests to helper functions

* Clean unecessary code and correct tests

* Make `Ipc` and `IpcKey` public

* Open `Ipc` with public functions

* Update core/tauri/src/test/mod.rs

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>

* cleanup, change file

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Nogueira <lucas@crabnebula.dev>
2023-12-14 11:52:45 -03:00
Amr Bashir
c1bc4d2948 chore(cli/help): mention the need for a second -- in tauri dev (#8388)
* chore(cli/help): mention the need for a second `--` in `tauri dev`

ref: https://github.com/tauri-apps/tauri/issues/8382#issuecomment-1854016310

* add example to clarify [skip ci]

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-12-14 09:20:52 -03:00
github-actions[bot]
f9c97b7e5b Apply Version Updates From Current Changes (v1) (#8377)
Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
2023-12-13 14:43:54 -03:00
Amr Bashir
5ff9d4592a fix(bundler/nsis): only kill processes of current user (#8390)
* fix(bundler/nsis): only kill processes of current user

Co-authored-by: FabianLars-crabnebula <fabianlars@crabnebula.dev>

* change file

---------

Co-authored-by: FabianLars-crabnebula <fabianlars@crabnebula.dev>
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-12-13 18:57:32 +02:00
Amr Bashir
30adc8d45d ci: fix publish @tauri-apps/api to latest instead of next (#8371)
* ci: fix publish `@tauri-apps/api` to `latest` instead of `next`

closes #8335

* just remove tag
2023-12-12 12:17:11 +02:00
Amr Bashir
777ddf434a fix(bundler): unset NSISDIR and NSISCONFDIR when running makensis (#8376)
closes #8359
2023-12-12 12:17:03 +02:00
Lucas Fernandes Nogueira
327c7aec30 fix(ci): skip installing unnecessary deps (#8277) 2023-12-01 17:06:59 +02:00
amrbashir
14e29f320d chore: update tauri-cli lock file 2023-12-01 04:27:26 +02:00
amrbashir
cf7d584033 chore: manually bump tauri-utils 2023-12-01 03:46:30 +02:00
github-actions[bot]
61cc7d9c5a Apply Version Updates From Current Changes (v1) (#8203)
* apply version updates

* fmt

---------

Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
Co-authored-by: amrbashir <amr.bashir2015@gmail.com>
2023-12-01 03:05:05 +02:00
Robin van Boven
c4b5df12bb perf: skip large Window and AppHandle fields on traces (#8318)
* perf: Skip large Window and AppHandle fields on traces

These contain large fields like image buffers, causing spans/events to be very large when serialized.

Especially the `window::emit::eval` one which is in a hot code path.

* fix: MSRV issues
2023-11-30 16:56:24 +02:00
i-c-b
977a39f4f7 fix(bundler): migrate WebView2 offline installer to shorturl (#8292) 2023-11-29 03:51:42 +02:00
Chase Knowlden
c34710de67 fix: Fix archived links, Closes #8302 (#8315) 2023-11-29 03:41:41 +02:00
Lucas Nogueira
5e05236b49 feat(core): add tracing for vital functionality closes #5204 (#8289)
* feat(core): add tracing for vital functionality

* Update core/tauri-runtime-wry/src/lib.rs [skip ci]

* Update Cargo.toml [skip ci]

* tracing feature

* wry 0.24.6

* add change tag

* add tracing to CI test

* enhance spans for update check

* remove app from debug impl
2023-11-27 16:56:46 +02:00
Lucas Nogueira
b3e53e7243 feat(core): add AssetManager::iter (#8288)
This new function allows users to iterate on all embedded assets, important if you want to AssetManager::get an asset you are not sure exists.
2023-11-23 16:12:38 +02:00
Amr Bashir
5046270273 fix(api): add top-level main, module and types fields (#8267) 2023-11-20 18:12:52 -03:00
Amr Bashir
b8756bc34e perf: remove extranous call in StateManager::get (#8272) 2023-11-20 17:55:18 -03:00
Fabian-Lars
f26d9f0884 fix(bundler/nsis): remove empty resources folders on uninstall (#8263)
* fix(bundler/nsis): remove empty resources folders on uninstall

* make clippy happy for once
2023-11-20 14:43:47 +02:00
renovate[bot]
8accd6940e chore(deps) Update Rust crate handlebars to 4.5 (1.x) (#8231)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-19 08:58:27 -03:00
Amr Bashir
26ccfef999 ci: fix parsing covector ouput (#8240) 2023-11-19 08:54:05 -03:00
Amr Bashir
d8f1b6c59b feat: migrate manual implementation to the light windows-version crate (#8242) 2023-11-19 08:51:17 -03:00
Amr Bashir
4b6a602a89 fix(updater): Use escaped installer path when starting the updater msi (#8234)
* fix(updater): Use escaped installer path when starting the updater msi

Continuation of https://github.com/tauri-apps/tauri/pull/7956

* fix build
2023-11-16 01:26:03 +02:00
Fabian-Lars
92bc7d0e16 fix(bundler/nsis): calculate estimated size on build system (#8233)
* fix(bundler): Fix nsis installer taking longer than expected to install resources

* create dir structure for resources before extracting files

* calculate size in rust on the build system

* i'm sorry clippy, i programmed in unholy languages where += wasn't a thing so i forgot it exists in rust...

* i'm a better clippy than clippy🌚
2023-11-15 20:53:15 +02:00
renovate[bot]
9e3aff0a3a chore(deps) Update Tauri Build (1.x) (#8102)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-11-14 10:18:35 -03:00
renovate[bot]
e221aae531 chore(deps) Update Tauri Utils (1.x) (#8105)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-11-14 09:52:58 -03:00
renovate[bot]
626121e7bf chore(deps) Update Tauri CLI (1.x) (#8193)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-11-13 23:58:27 -03:00
Lucas Fernandes Nogueira
2ba8856343 fix(core): docs.rs build failing for macOS (#8095) 2023-11-13 22:34:22 -03:00
renovate[bot]
f964cbdb93 chore(deps) Update dependency eslint to v8.53.0 (1.x) (#8189)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-13 21:45:24 -03:00
renovate[bot]
0f7b2c4298 chore(deps) Update Rust crate tempfile to 3.8.1 (1.x) (#8188)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-13 21:43:45 -03:00
Merlin Gough
14544e4b87 fix(api): avoid crashing in clearMocks, closes #8179 (#8219)
* fix(api): do nothing in clearMocks if __TAURI_INTERNALS__ is not defined (fix: #8179)

Prevents tests that didn't define any mocks from failing in `afterEach` test hook.

* Update fix-clearmocks.md

* check for indvidiual properties instead
2023-11-13 17:48:54 +02:00
Olivier Lemasle
1d5aa38ae4 fix(cli): Fixes errors on command output, closes #8110 (#8162)
Fixes #8110
2023-11-09 15:34:16 -03:00
i-c-b
416370a627 enhance(docs): Document Windows-specific icon behaviour (#8153) 2023-11-06 20:12:26 -03:00
Lucas Fernandes Nogueira
2c7d683ae3 chore(renovate): ignore cargo_toml and minisign (#8118) 2023-10-26 15:38:09 -03:00
renovate[bot]
b6ef1fab0e chore(deps) Update Tauri API Definitions (1.x) (#8100)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-26 13:42:15 -03:00
renovate[bot]
bf859859d6 chore(deps) Update Rust crate libflate to v2 (1.x) (#8106)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-26 13:33:01 -03:00
Lucas Fernandes Nogueira
a635ec2345 feat(cli): add unit test for empty updater private key password (#8096) 2023-10-25 19:13:48 -03:00
github-actions[bot]
ae75004cee Apply Version Updates From Current Changes (v1) (#8065)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2023-10-23 21:20:02 -03:00
Lucas Fernandes Nogueira
13ce9ac836 fix: e2e test using invalid updater private keys (#8086) 2023-10-23 19:43:01 -03:00
Fabian-Lars
5264e41db3 fix(deps): Downgrade minisign to 0.7.3 again (#8082) 2023-10-23 15:12:00 -03:00
renovate[bot]
5f75ebbbbb chore(deps) Update Tauri CLI (1.x) (#8051)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-10-20 02:26:11 +00:00
renovate[bot]
10da70307a chore(deps) Update Tauri Codegen (1.x) (#7576)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-10-19 23:44:04 +00:00
Johannes Velde
cfe6fa6c91 feat(lang) added german language (#8061) 2023-10-19 22:47:34 +00:00
github-actions[bot]
ae13be2d17 Apply Version Updates From Current Changes (v1) (#8062)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2023-10-19 16:48:27 +00:00
Lucas Fernandes Nogueira
3880b42d18 feat(bundler): enhance notarization error message (#7974) 2023-10-19 15:56:20 +00:00
Lucas Fernandes Nogueira
9bead42dbc feat(cli): allow rotating updater private key (#8059) 2023-10-19 15:43:48 +00:00
Olivier Lemasle
2da043f04d fix: improve French translations for nsis installer (cherry-pick #7523 on 1.x) (#8058)
Co-authored-by: Stanislas Michalak <stanislas-m@users.noreply.github.com>
2023-10-19 10:48:16 -03:00
renovate[bot]
de985bad18 chore(deps) Update Tauri Bundler (1.x) (#7639)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-18 13:26:24 -03:00
Lucas Fernandes Nogueira
be8e5aa307 fix(cli): duplicated newlines on child process output (#8042) 2023-10-18 15:29:12 +00:00
renovate[bot]
94bef1c705 chore(deps) Update Tauri CLI (1.x) (#7641)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-10-18 09:48:30 -03:00
Amr Bashir
99865d9e9a refactor(cli): cleanup info command (#7204)
Co-authored-by: martin frances <martinfrances107@hotmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-10-17 13:09:59 -03:00
github-actions[bot]
550173aaf5 Apply Version Updates From Current Changes (v1) (#8022)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-10-17 12:29:33 -03:00
Amr Bashir
f259db3596 chore: downgrade bump to patch (#8033) 2023-10-17 10:00:03 -03:00
Amr Bashir
2b0212af49 feat(api): add mock for convertFileSrc, closes #7935 (#7961)
* feat(api): add mock for `convertFileSrc`, closes #7935

* fix lint

* Update tooling/api/src/mocks.ts

* fmt
2023-10-17 15:33:44 +03:00
Amr Bashir
dfe0badf19 docs: document macOS restrictions on Menu::add_item (#7983) 2023-10-16 09:15:15 -03:00
Amr Bashir
d6e10e216e chore: rename webview2 offline installer guid consts for more clarity (#8001) 2023-10-16 09:13:32 -03:00
Amr Bashir
9d40840299 chore: update tauri-cli lock file (#8015) 2023-10-16 08:50:11 -03:00
Olivier Lemasle
113bcd7b68 fix(bundler): In .deb packages, set uid=0 for all files (#7980) 2023-10-16 08:33:06 -03:00
Caijinglong
d0ae67503c fix(bundler): read proxy when downloading resources. (#8012)
* fix(bundler): read http_proxy env when downloading resources.

Signed-off-by: CaiJingLong <cjl_spy@163.com>

* Update .changes/add-proxy-for-nsis-download.md

* Update add-proxy-for-nsis-download.md

* Update tooling/bundler/src/bundle/windows/util.rs

---------

Signed-off-by: CaiJingLong <cjl_spy@163.com>
2023-10-13 15:06:34 +03:00
github-actions[bot]
441eb4f4a5 Apply Version Updates From Current Changes (v1) (#7988)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2023-10-11 17:27:37 +00:00
Lucas Fernandes Nogueira
bab05ff607 fix(ci): properly detect @tauri-apps/cli release id from covector output (#8004) 2023-10-11 15:53:01 +00:00
i-c-b
f552c1796a fix(bundler): WebView2 offline installer GUID changes (#7998) 2023-10-11 10:50:21 +00:00
Ziyang Hu
21cdbb41a3 fix: truncate file when not appending in writeFile, closes #7973 (#7982)
* Fix https://github.com/tauri-apps/tauri/issues/7973

* Fix https://github.com/tauri-apps/tauri/issues/7973

* Fix https://github.com/tauri-apps/tauri/issues/7973
2023-10-09 16:22:54 +03:00
github-actions[bot]
1241014a46 Apply Version Updates From Current Changes (v1) (#7960)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
fix(bundler): team ID is now required for notarytool via app password (#7972)
fix(bundler): team ID is now required for notarytool via app password (#7972)"
2023-10-08 11:12:42 +00:00
Lucas Fernandes Nogueira
40d340021c fix(bundler): team ID is now required for notarytool via app password (#7972) 2023-10-06 14:33:49 -03:00
Fabian-Lars
cdd5516f33 fix(bundler): Use escaped installer path when starting the updater setup, fixes #7931 (#7956)
* fix(bundler): Use escaped installer path when starting the updater setup, fixes #7931

* fun ci stuff

* who needs lockfiles anyway

* stahp

* please let it be the last one. i want to leave
2023-10-05 00:45:43 +03:00
github-actions[bot]
19249d78fb Apply Version Updates From Current Changes (v1) (#7938)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2023-10-02 13:16:57 -03:00
Jason Tsai
d6eb46cf11 fix(macos): fix notraytool's apple-id option name, close #7917 (#7934)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2023-10-02 11:30:39 -03:00
Lucas Fernandes Nogueira
3671edbcff fix(core): toggle devtools via global shortcut (#7937)
* fix(core): toggle devtools via global shortcut

* Update .changes/fix-toggle-devtools.md
2023-10-02 17:19:01 +03:00
github-actions[bot]
a3277a245c Apply Version Updates From Current Changes (v1) (#7924)
Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
2023-09-30 04:41:23 +03:00
Lucas Fernandes Nogueira
d1e09da084 hotfix(build): bump tauri-build to 1.5 (#7918) 2023-09-30 02:20:27 +03:00
Lucas Fernandes Nogueira
c001a91d15 fix(ci): update tauri-driver's Cargo.lock file on version bump (#7915) 2023-09-28 15:29:53 -03:00
github-actions[bot]
0af553da72 Apply Version Updates From Current Changes (v1) (#7261)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2023-09-28 14:01:19 -03:00
Lucas Fernandes Nogueira
e9e68abb33 fix(ci): downgrade async-executor to 1.5.2 (#7911) 2023-09-28 10:48:52 -03:00
Lucas Fernandes Nogueira
c68fbfcb2d fix: Returns a warning instead of panicking if an AppImage is not mounted, closes #7736 (#7912)
Co-authored-by: Benjamin Demetz <50681275+Benji377@users.noreply.github.com>
2023-09-28 10:46:17 -03:00
Fabian-Lars
d1858de7a0 fix(cli): help output mixed up for private-key and private-key-path (#7901) 2023-09-26 14:41:32 -03:00
Fabian-Lars
9aa34ada57 feat(core): Allow http origin on Windows, fixes: #3007 (#7645)
Co-authored-by: Lucas Nogueira <118899497+lucasfernog-crabnebula@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-09-26 14:40:38 -03:00
Fabian-Lars
e8ff6b153e docs: change icon help output to ask for 1024px source icons, closes #7886 (#7896) 2023-09-25 14:44:27 +03:00
Trey Smith
5ecb46b341 fix: rpath missing from app, closes #7710 (#7773)
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
fix: codesign doesn't sign frameworks or sidecar, closes #7690 (#7774)
2023-09-24 19:11:20 -03:00
Trey Smith
dcdbe3eb6c fix: codesign doesn't sign frameworks or sidecar, closes #7690 (#7774)
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-09-15 12:09:10 -03:00
Trey Smith
2f8881c010 feat: add team_id option for apple notarization (#7775)
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-09-15 08:30:27 -03:00
Lucas Fernandes Nogueira
995ffc629b fix(ci): recreate symlink so the integration tests works (#7833) 2023-09-13 21:55:47 -03:00
Lucas Fernandes Nogueira
b3ebe4de3c chore(config-schema): remove unused deps (#7824) 2023-09-12 23:55:27 +03:00
Amr Bashir
4bf1e85e6b fix(windows): respect focused: false for webview, closes #7519 (#7722)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
fix(windows): respect `focused: false` for webview, closes #7519
2023-09-11 17:00:06 -03:00
Davis Silverman
0b0bc81710 Extend context.rs to dynamically find the OUT_DIR for certain assets (#7534)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
2023-09-11 16:59:30 -03:00
Lucas Fernandes Nogueira
1945dec81f fix(ci): adjust downgrade crates step (#7812) 2023-09-11 15:30:37 -03:00
Jason Tsai
e3bfb01411 feat(nsis): support choosing compression algorithms, closes #7685 (#7776) 2023-09-07 18:45:15 +03:00
Lucas Fernandes Nogueira
dfbbca423b feat(bundler): try to find API key file for notarization, ref #7616 (#7771) 2023-09-07 10:01:12 -03:00
Jason Tsai
0797a002ca fix: use button property for data-tauri-drag-region mouse button detection, closes #7694 (#7746) 2023-09-07 09:55:47 -03:00
Amr Bashir
53ab2042fd refactor: remove unnecessary mutex (#7728) 2023-09-07 09:09:59 -03:00
martin frances
50878901ba chore: resolves a warning seen while running cargo update (#7753)
* chore: resolves a warning seen while running cargo update

warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest

* Now using resolver 2.
2023-09-05 14:28:33 +03:00
Amr Bashir
49beb67dab ci: fix clippy lints (#7721)
* ci: fix clippy lints

* more lints
2023-08-31 13:53:15 +03:00
Colin McDonnell
e152662687 feat: support Bun package manager (#7723)
* Support bun

* clippy
2023-08-31 02:48:36 +03:00
i-c-b
13279917d4 enhance(cli): Add Cargo Tauri CLI version to tauri info output (#7713)
* enhance(cli): Add Cargo Tauri CLI version to `tauri info` output

* Create enhance-cli-cargo-tauri-cli-version-info.md
2023-08-31 01:53:37 +03:00
Fabian-Lars
85112e7f8f ci: downgrade h2 and reqwest (#7717)
* ci: downgrade h2 to 0.3.20

* reqwest

* Update test-core.yml

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-08-30 20:43:01 +03:00
Amr Bashir
09f7f57eea chore(deps): update nsis_tuari_utils to 0.2.1 (#7711)
* chore(deps): update nsis_tuari_utils to 0.2.1

* Update .changes/nsis-kill-own-process.md
2023-08-30 15:49:47 +03:00
Fabian-Lars
f19c7fc5c3 ci: Update serde_with downgrade to match 3.3.0 (#7654) 2023-08-30 03:44:05 +03:00
Fabian-Lars
8c5fcf41e3 ci: Downgrade tokio to 1.29 and flate2 to 1.0.26 (#7646)
* ci: Downgrade tokio to 1.29

* downgrade flate2 too
2023-08-18 03:14:38 +03:00
Fabian-Lars
58d6b899e2 feat(api): Add append option to writeFile apis (#7636)
* feat(api): Add `append` option to writeFile apis.

* wording

* fmt

* Update .changes/fs-append-file.md


* clippeeeyyyy
2023-08-16 19:09:05 +03:00
Lucas Fernandes Nogueira
964d81ff01 refactor(bundler): switch to notarytool, closes #4300 (#7616) 2023-08-16 11:10:02 +09:00
Amr Bashir
a7777ff485 feat(bundler/NSIS): Add Bulgarian to supported NSIS languages. (#7624) (#7626)
* Create Bulgarian.nsh

* Update nsis.rs

* Create nsis-bulgarian.md

Co-authored-by: Angelo II <62988428+AngeloCore@users.noreply.github.com>
2023-08-16 11:09:45 +09:00
Amr Bashir
72a3d75e8f chore(deps): update nsis_tuari_utils to 0.2 (#7625) 2023-08-15 23:23:26 +03:00
Jet Li
ca977f4b87 fix(bundler/nsis): revert shell context change before deleting appdata, closes #7588 (#7591)
* fix(bundler/nsis): delete app data of current user when uninstall, closes #7588

* fix(bundler/nsis): delete app data of current user when uninstall, closes #7588

* Update .changes/fix-nsis-uninstall-delete-app-data.md

---------
2023-08-15 18:59:44 +03:00
Fabian-Lars
9308dee0a1 docs: Be more specific about plugin names in ipc scope (#7605) 2023-08-15 10:56:05 -03:00
Graeme McHale
10e362d098 feat: allow more flexible http requests in updater closes #7422 (#7432)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-08-10 07:23:52 -03:00
renovate[bot]
b420962377 chore(deps) Update Tauri API Definitions (1.x) (#7577)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-10 07:22:45 -03:00
Lucas Fernandes Nogueira
cca5301b88 added missing futures-util (#7260) (#7565)
Co-authored-by: Simon Hyll <hyllsimon@gmail.com>
2023-08-09 17:39:27 -03:00
Isaac Cambron
eeb6be5422 feat(core): Manager::emit_filter and optimize serialization (#7512)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-08-08 16:57:30 -03:00
Amr Bashir
a6b52e44f2 fix(tauri-utils): include \n in io::read_line, closes #6388 (#6519)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
fix(tauri-utils): include `\n` in `io::read_line`, closes #6388
2023-08-08 16:43:19 -03:00
Alejandro González
9edebbba4e fix(driver): bump locked dependencies to fix build issue on Windows (#7475) 2023-08-08 15:46:32 -03:00
Fabian-Lars
cb1d4164e7 fix(bundler): sign the exe before the bundler step (#7487) 2023-08-08 15:16:00 -03:00
Amr Bashir
6c408b736c feat: add notification sound (#7269)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-08-08 15:09:04 -03:00
Lorenzo Lewis
c272e4afbf chore: remove typedoc integration (#7515)
Signed-off-by: Lorenzo Lewis <lorenzo_lewis@icloud.com>
2023-07-28 15:37:27 +03:00
Fabian-Lars
e374bc130d ci: lock tempfile and serde_with versions in CI (#7495)
* ci: lock tempfile and serde_with versions in CI

* Update test-core.yml
2023-07-25 18:25:14 +03:00
Jet Li
57f73f1b6a fix(bundler/nsis): use temp dir for webview2 installer, closes #7409 (#7486)
* fix(bundler/nsis): use temp dir for webview2 installer, closes #7409

* Update .changes/fix-nsis-webview2-installer-use-tempdir.md

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-07-25 17:29:59 +03:00
Alejandro González
2d35f937de fix(bundler): do not skip updater bundle target if only a macOS DMG is generated (#7481) 2023-07-24 09:27:11 -03:00
Lucas Fernandes Nogueira
4dd4893d7d feat: allow specifying a resource map, closes #5844 (#5950)
Co-authored-by: amrbashir <amr.bashir2015@gmail.com>
closes #5844
2023-07-13 18:28:52 -03:00
Dave Ceddia
ef962c43af fix(cli): handle symlinks in updater bundler, closes #3933 (#3934)
Co-authored-by: chip <chip@chip.sh>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2023-07-13 14:35:22 -03:00
Fabian-Lars
290e366ae9 fix(build): Copy wv2 runtime in dev, fixes #7373 (#7419) 2023-07-13 14:34:31 -03:00
Lucas Fernandes Nogueira
c98273387c feat(core): enhance readDir error message, closes #7379 (#7416) 2023-07-13 08:00:51 -07:00
Amr Bashir
2eab150563 feat(api/http): properly handle Files in Body.form, closes #7390 (#7394)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
closes #7390
2023-07-13 08:58:21 -03:00
Amr Bashir
fdaee9a5ce feat(core/plugin): add register_uri_scheme_protocol, closes #7330 (#7350)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
closes #7330
2023-07-12 16:49:32 -03:00
Amr Bashir
71a0240166 chore: remove hotkey.js script and replace var with const (#7343)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-07-12 08:44:26 -03:00
Amr Bashir
a2be88a21d refactor: remove bitness crate from bundler (#7405)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-07-12 07:38:25 -03:00
清茶
907425df55 feat(cli): check cwd for config file before traversing (#7395) 2023-07-11 18:29:15 +03:00
Amr Bashir
764968ab38 feat(bundler/nsis): sign uninstaller, closes #7348 (#7398)
* feat(bundler/nsis): sign uninstaller, closes #7348

* Update bundler-nsis-sign-uninstaller.md

* clippy
2023-07-11 15:54:59 +03:00
Amr Bashir
757e959eb2 feat: respect base tag's target attribute, closes #7285 (#7344)
* feat: respect `base` tag's `target` attribute, closes #7285

* Update core.js

* fix condition
2023-07-11 15:11:23 +03:00
Amr Bashir
fa7f9b77ab fix(core/updater): set max_redirections of 5, closes #7329 (#7341)
* fix(core/updater): set `max_redirections` of 5, closes #7329

* Update .changes/updater-redirect.md
2023-07-11 15:08:53 +03:00
Lucas Fernandes Nogueira
eeff1784e1 chore(deps): update unmaintained dependency from kuchiki to kuchikiki (#7359) (#7367)
Co-authored-by: Davide Baldo <davide@baldo.me>
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-07-11 19:19:13 +09:00
Amr Bashir
e05cd940d6 ci: fix audit workflow and add resolutions for vuln packages (#7392)
* ci: fix audit workflow and add resolutions for vuln packages

* revert rust audit changes
2023-07-11 00:25:18 +03:00
Amr Bashir
f6a13f6f23 ci: downgrade more crates is-terminal, colored and toml:0.7.6 (#7391)
* ci: downgrade more crates `is-terminal`, `colored` and `toml:0.7.6`

* downgrade all versions of toml and cargo_toml

* revert
2023-07-10 16:45:50 +03:00
luofei
eba8e1315e fix(bundler/nsis): fix installer incorrect copyright info (#7386)
Signed-off-by: luofei <luoffei@outlook.com>
2023-07-10 14:56:13 +03:00
Amr Bashir
6e36ebbf84 fix(nsis): set correct ShellVarContext for uninstaller, closes #7315 (#7342) 2023-07-10 14:46:15 +03:00
luofei
32218a6f8c fix(bundler/nsis): use uninstallstring to find wix installation (#7326)
* add change file

Signed-off-by: luofei <luoffei@outlook.com>

* fix(bundler/nsis): Check if the previous installation was done using WiX

Signed-off-by: luofei <luoffei@outlook.com>

* Update .changes/fix-nsis-previous-installation-method.md

---------

Signed-off-by: luofei <luoffei@outlook.com>
2023-07-08 04:26:40 +03:00
luofei
0ae53f4139 fix(bundler/nsis): fix error message appears even after successful uninstall, closes #7317 (#7361)
* fix(bundler/nsis): Uninstall the previous installation package

* Update .changes/fix-nsis-uninstall-previous-version.md

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-07-08 03:43:35 +03:00
Amr Bashir
46df2c9b91 fix(bundler): sort package types before bundling, closes #7349 (#7360)
fix(bundler): sort package types before bundling, closes #7349
2023-07-05 17:17:31 -03:00
Lucas Fernandes Nogueira
f4aedce96c fix(ci): adjust crate downgrades for test-core MSRV (#7346) 2023-07-03 15:42:34 -07:00
Lucas Fernandes Nogueira
539247aacf fix(ci): adjust downgrade crates version step on test-core workflow (#7309) 2023-06-30 09:04:09 -07:00
Fabian-Lars
dad4f54eec fix(cli): Disable version check, fixes #7273 (#7277) 2023-06-21 19:19:31 +08:00
Lucas Fernandes Nogueira
df6712cfb3 docs(core): fix panic section on manage documentation (#7251) 2023-06-21 07:50:41 -03:00
Raphii
1a3dcdb830 fix(core): fix nsis updater unable to launch installers requiring elevation, closes #7184 (#7185)
* Launch NSIS updaters requiring elevation from non-elevated process

* Add changes file

* remove detached process, use powershell

* Update updater-admin-launch-fix.md

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-06-19 18:11:16 +03:00
Amr Bashir
8c0166f459 ci: use toJSON (#7248) 2023-06-18 06:58:34 -03:00
Lucas Fernandes Nogueira
fdf68405a4 chore(ci): use a separate covector workflor for 1.x (#7243) 2023-06-18 06:57:37 -03:00
Lucas Fernandes Nogueira
be6f4319ff fix(ci): correctly set tag for tauri-cli release (#7246) 2023-06-17 19:14:12 -03:00
Lucas Fernandes Nogueira
2acc474ccb fix(ci): only check change tags on added or modified files (#7236) 2023-06-17 16:57:25 +03:00
github-actions[bot]
4b3d66c793 Apply Version Updates From Current Changes (v1) (#7234)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2023-06-17 10:45:52 -03:00
Lucas Fernandes Nogueira
49dbbbbcdf feat(ci): prepare CI for 1.x branch (#7231) 2023-06-17 09:41:22 -03:00
Amr Bashir
6afd34727f fix(core): revert #6680, remove default notification sound on Windows (#7229)
fix(core): revert #6680, remove default notification sound on Windows
2023-06-17 09:18:16 -03:00
Amr Bashir
066c09a6ea fix(core): fix require_literal_leading_dot flipped behavior (#7227) 2023-06-17 09:17:36 -03:00
Amr Bashir
28921cb8e8 ci: fix getting release id (#7207) 2023-06-15 08:36:05 -03:00
Lucas Fernandes Nogueira
2071265fea add to additionals (#7206) 2023-06-14 16:10:52 -07:00
Fabian-Lars
3fb3f11fc8 docs(api.js): fix since version for locale() (#7205) 2023-06-14 20:30:57 +03:00
github-actions[bot]
b7ae725c5e Apply Version Updates From Current Changes (#6901)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2023-06-14 12:59:28 -03:00
Lucas Fernandes Nogueira
bd96edd2b9 fix: bump macros, codegen and build crates with minor (#7203) 2023-06-14 12:09:11 -03:00
Lucas Fernandes Nogueira
aa94f049c1 fix(tests): adjust default bundle target for updater integration test (#7201) 2023-06-14 11:17:02 -03:00
Lucas Fernandes Nogueira
c1d36e4953 chore: remove duplicated crate in change file (#7198) 2023-06-14 15:05:44 +03:00
Fabian-Lars
4cfb686d2b fix(cli): Pin minisign to 0.7.3 to prevent issues with empty key passwords (#7197) 2023-06-14 08:00:28 -03:00
renovate[bot]
d5769b3bfb chore(deps) Update Rust crate log to 0.4.19 (#7193)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-14 07:37:06 -03:00
renovate[bot]
066417d3f0 chore(deps) Update Rust crate log to 0.4.19 (#7194)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-14 07:36:46 -03:00
renovate[bot]
29a287ee82 chore(deps) Update Tauri API Definitions to v5.59.11 (#7195)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-14 07:36:26 -03:00
Amr Bashir
d75c1b829b fix(cli): warn about bundling updater target without appropriate targets, closes #7181 (#7189)
* fix(cli): warn about bundling updater target without appropriate targets, closes #7181

* change tags

* cleanup

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-06-14 02:14:35 +03:00
Lucas Fernandes Nogueira
696d77c3ce fix(core): global events now reaches window listeners, closes #4493 (#7163)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-06-13 08:05:58 -03:00
Fabian-Lars
5d85d0990c fix(core): Send updater status events when default dialog is enabled, closes #7128 (#7157) 2023-06-13 08:05:42 -03:00
Amr Bashir
076e1a81a5 fix(core): use u32 for js listeners ids, closes #7119 (#7159) 2023-06-07 17:54:04 -03:00
Amr Bashir
fc2e4083b0 ci: check for change tag (#7149)
* ci: check for change tag

* fix workflow

* Update .scripts/ci/check-change-tags.js

* feat: also check if tag is known

seems like covector does not check that so we can do it here for now

* remove push run

* only check changed files

* add missing tag

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
2023-06-07 16:32:36 +03:00
Lucas Fernandes Nogueira
1d99f8a3c2 feat(core): expose test utils (#4752) 2023-06-07 10:22:14 -03:00
renovate[bot]
d33672cffe chore(deps) Update Tauri Bundler (#7152)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-07 09:39:31 -03:00
renovate[bot]
ba6e5813e6 chore(deps) Update Tauri API Definitions (#7151)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-07 09:38:27 -03:00
dependabot[bot]
a6da7ef8af chore(deps-dev): bump vite from 2.9.13 to 2.9.16 in /examples/api (#7138)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-06 14:06:29 -03:00
Fabian-Lars
db7c5fbf2e refactor(core): Remove attohttpc in favor of reqwest (#7143)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
2023-06-06 13:29:52 -03:00
Lucas Fernandes Nogueira
52474e479d feat(cli): enhance Cargo features injection, add tests (#7141) 2023-06-06 13:29:28 -03:00
Amr Bashir
b41b57ebb2 fix(core): avoid panics in global shortcut, closes #7105 (#7136) 2023-06-05 16:43:44 -03:00
Lucas Fernandes Nogueira
647800c563 refactor(cli): use rewrite manifest logic on table entry (#7134) 2023-06-05 14:38:26 -03:00
renovate[bot]
3a8bb4c153 chore(deps) Update Tauri JS CLI (#7093)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-05 10:06:45 -03:00
renovate[bot]
c2acf96306 chore(deps) Update Tauri API Definitions to v5.59.8 (#7091)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-05 09:52:05 -03:00
renovate[bot]
f8bdc7be62 chore(deps) Update Rust crate log to 0.4.18 (#7090)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-05 09:51:40 -03:00
Amr Bashir
0503eb69ce fix(core): account for data: uri when calculating origin, closes #7078 (#7133)
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-06-05 09:47:21 -03:00
Reupen Shah
85e77fb797 fix: correct MIME type of .txt files (ref: #6762) (#7111)
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-06-05 09:16:05 -03:00
fcfangcc
3327dd641d fix(bundler/macos): clean up .app bundle if only .dmg is enabled #7081 (#7116)
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-06-05 08:49:37 -03:00
icedrocket
c596aaefcf fix(examples): make video fits within window (#7129) 2023-06-05 08:11:32 -03:00
Raphii
4d4b72ba38 Fix missing quote in Japanese NSIS language file. (#7086)
* Update Japanese.nsh

* Create nsis-japanese-fix.md

* Update .changes/nsis-japanese-fix.md

Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>

---------

Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
2023-06-03 13:08:10 +02:00
Fabian-Lars
d7a0a2cd1a ci: Use correct native-tls feature flags for win32-arm64 cli, ref #7098 (#7107) 2023-06-02 19:04:48 +08:00
Fabian-Lars
0ddbb3a1dc feat(cli): Build the CLI for Windows ARM64, closes #7015 (#7098)
* feat(cli): Build the CLI for Windows ARM64

* lockfile
2023-06-01 11:04:14 +08:00
Lucas Fernandes Nogueira
3303041c92 chore(api): document new options from #6665 (#7072) 2023-05-27 04:39:37 -07:00
Lucas Fernandes Nogueira
27c5f364a8 fix(macros): use full path to Result to avoid issues with type aliases (#7071) 2023-05-27 04:37:19 -07:00
Amr Bashir
000104bc3b feat: add is_focused APIs, closes #6472 (#6530)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-05-26 13:37:28 -03:00
Kevin Yue
8fd9cfa1f2 fix(doc): correct the doc of content_protected() (#7065) 2023-05-26 09:23:57 -03:00
Bo
17d5a4f51f feat(core): early panic if the PNG icon is not RGBA, closes #6706 (#6712) 2023-05-26 15:26:21 +08:00
Pascal Sommer
d68a25e32e Improve compile errors for async commands without Result return type (#6124)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-05-26 01:04:30 -03:00
Lucas Fernandes Nogueira
154ccbe503 fix(tests): only download update when it is available (#7061) 2023-05-25 21:22:55 -03:00
Jonas Kruckenberg
6c5ade08d9 feat(cli.rs) Shell completions (#4537)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Co-authored-by: Simon Hyll <hyllsimon@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-05-25 11:34:37 -03:00
Amr Bashir
1b8001b8b8 fix(bundler/nsis): calculate accurate app size, closes #7056 (#7057) 2023-05-25 11:34:05 -03:00
Tomáš Diblík
c4d6fb4b1e feat(core): Ability to disable minimize/maximize/close native window's buttons, closes #2353 (#6665)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-05-24 17:23:32 -03:00
Lej77
65fd674f50 fix: sound for notifications on windows (fix #6652) (#6680) 2023-05-24 17:20:13 -03:00
Francis The Basilisk
35cd751adc feat(bundler): custom desktop file template, closes #5176 (#5180)
Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-05-24 16:04:54 -03:00
Amr Bashir
ff5e4dbbb0 fix(core): populate webview_attrs from config, closes #6794 (#6797)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-05-24 15:39:51 -03:00
Amr Bashir
df89ccc191 feat(nsis): implement passive mode, closes #6955 (#6998)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-05-24 14:16:12 -03:00
Amr Bashir
60334f9e02 feat(bundler/NSIS): uninstall previous wix if exist, closes #6859 (#6933) 2023-05-24 13:33:30 -03:00
renovate[bot]
0f707d2b53 chore(deps) Update Rust crate serde_with to v3 (#7048)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-24 13:17:21 -03:00
Amr Bashir
2317913b71 fix(core): use safe_block_on (#7047)
fixes regression introduced in 45330e3819

ref: https://github.com/tauri-apps/tauri/issues/6375#issuecomment-1560063696
2023-05-24 05:07:31 +03:00
Amr Bashir
359058cecc feat(api): add locale function, closes #5939 (#5960) 2023-05-23 16:02:33 -03:00
Amr Bashir
45330e3819 fix(core): rewrite asset protocol streaming, closes #6375 (#6390)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-05-23 15:30:31 -03:00
Amr Bashir
17da87d3cd fix(bundler/nsis): write installer templates UTF16LE encoded, closes #7036 (#7040)
* fix(bundler/nsis): write installer templates UTF16LE encoded, closes #7036

* cleanup

* lint

* return err instead of panic

* Update .changes/nsis-encoding.md [skip ci]

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-05-23 19:00:21 +03:00
Amr Bashir
8b9f6cf868 chore: add change tags for existing change files (#7041) 2023-05-23 18:56:47 +03:00
Amirhossein Akhlaghpour
4c39e46a3b feat: current_version feature (#7026)
* feat: reexport webview_verion

* chore: clippy problems

* fix: add .changes md file

* Update .changes/add-webview-version.md
2023-05-23 18:35:49 +03:00
Usman Rajab
43858a3197 feat(bundler/NSIS): Add Swedish to supported NSIS languages (#7038) 2023-05-23 17:41:40 +03:00
Amr Bashir
3cb7a3e642 fix(cli/devserver): inject autoreload into HTML only, closes #6997 (#7032) 2023-05-23 17:39:11 +03:00
Amr Bashir
baa581b814 ci: fix version-or-publish workflow (#7031)
* ci: fix version-or-publish workflow

* test syntax

* how about this?

* just use jq

* Delete test.js
2023-05-23 17:38:31 +03:00
Nathanael Rea
fb7ef8dacd fix(cli.js): detect node-20 binary (#6667)
* fix nodejs binary regex

* Update clijs-node-version-20.md
2023-05-23 01:09:49 +03:00
dependabot[bot]
1161b6788e chore(deps): bump h2 from 0.3.15 to 0.3.19 in /examples/api/src-tauri (#7030)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-22 16:35:19 -03:00
renovate[bot]
76714dc628 chore(deps) Update Tauri API Definitions (#6798)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-22 16:34:55 -03:00
Amr Bashir
af93729031 fix: add missing file properties on Windows, closes #6676 (#6693)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
2023-05-22 16:34:33 -03:00
Amr Bashir
262776d8d8 docs(tauri-build): clarify common-controls-v6 dependency, closes #6732 (#6736) 2023-05-22 15:07:08 -03:00
renovate[bot]
86d3c0cc0f chore(deps) Update Tauri CLI (major) (#6688)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-05-22 14:22:46 -03:00
Lucas Fernandes Nogueira
a541820aa8 fix(cli): revert metadata.json field rename from #6795 (#7029) 2023-05-22 14:07:53 -03:00
renovate[bot]
0974ecccd6 chore(deps) Update Tauri Bundler (#6683)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-22 14:06:16 -03:00
Amr Bashir
5ec6353a60 refactor: change package names to match published packages (#6795)
Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
2023-05-22 12:52:44 -03:00
renovate[bot]
9e67ec68ac chore(deps) Update dependency prettier to v2.8.8 (#6799)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-22 11:41:03 -03:00
dependabot[bot]
ffd4db5ae4 chore(deps): bump enumflags2 from 0.7.5 to 0.7.7 in /examples/api/src-tauri (#6786)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-22 11:40:40 -03:00
Gökçe Merdun
ac183948d6 feat(bundler/NSIS): Add Turkish to supported NSIS languages (#7018) 2023-05-21 19:15:17 +03:00
Risto Stevcev
0032daf2a3 Docs: Added void linux to readme (#6711) 2023-05-21 11:29:09 -03:00
Amr Bashir
5eba069b1d docs: curate and document tauri's env vars (#6983)
* docs: curate and document tauri's env vars

* fill apple env vars

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-05-21 13:23:47 +03:00
yutotnh
2b487c9467 Fix typo (#7012)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-05-20 08:24:07 -03:00
Amr Bashir
b9eac96cdc ci: pin toml to 0.7.3 (#7011)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-05-20 07:52:21 -03:00
Lucas Fernandes Nogueira
1253bbf7ae fix(cli): correctly remove Cargo features (#7013) 2023-05-20 00:12:11 -03:00
Soumt
61e3ad89e9 feat(bundler/NSIS): Add Korean to supported NSIS languages (#7010)
* Feat: Add Korean language

* fmt
2023-05-20 01:49:20 +03:00
Simon Hyll
fc7f9ebada feat: adding copyright text to BrandingText (#7001) 2023-05-19 19:42:24 +08:00
Risto Stevcev
0302138f2f fix: updated appimage script to follow symlinks for /usr/lib* (fix: #6992) (#6996)
* Updated appimage script to follow symlinks for /usr/lib*

* Added appimage-follow-symlinks change file
2023-05-19 13:22:22 +08:00
Fabian-Lars
c7056d1b20 fix(cli): improve vs build tools detection (#6982)
* fix(cli): improve vs build tools detection

* clean up

* typos

* changefile

* patch instead of minor

* update vswhere

* use vswhere instead of custom logic. update wording

* sort and dedup manually
2023-05-18 22:47:28 +03:00
Amr Bashir
acc36fe117 feat(core): add option for require_literal_leading_dot, closes #6158 (#6969)
* feat(core): add option for `require_literal_leading_dot`, closes #6158

* change to `Option<bool>`

* fix to tokens impl

* Apply suggestions from code review

Co-authored-by: Simon Hyll <hyllsimon@gmail.com>

---------

Co-authored-by: Simon Hyll <hyllsimon@gmail.com>
2023-05-18 16:11:50 +03:00
Amr Bashir
cd3846c8ce feat(nsis): restart app after updating, closes #6955 (#6987)
* feat(nsis): restart app after updating, closes #6955

* Apply suggestions from code review
2023-05-18 16:11:31 +03:00
Amr Bashir
fd3b5a16b1 fix(cli): find correct binary when --profile is used, closes #6954 (#6979)
* fix(cli): find correct binary when `--profile` is used, closes #6954

* clippy
2023-05-17 16:17:47 +03:00
Amr Bashir
82169e69fc fix(core): remove trailing slash in http scope url, closes #5208 (#6974)
* fix(core): remove trailing slash in http scope url, closes #5208

* fix tests

* one more tests fix

* clippy
2023-05-17 14:33:10 +03:00
Amr Bashir
aecf146909 fix(core/ipc): access url through webview native object, closes #6889 (#6976) 2023-05-17 14:32:45 +03:00
Fabian-Lars
2b26b2e611 fix(bundler): Add new lang_file option in persian variant. (#6972) 2023-05-16 15:33:08 +03:00
Fabian-Lars
d2710e9d2e fix(core): unpin all dependencies, closes #6944 (#6966) 2023-05-16 19:27:15 +08:00
Amr Bashir
3700793a2f fix(updater): emit UPTODATE when server responds with 204, closes #6934 (#6970) 2023-05-16 13:00:00 +08:00
Amirhossein Akhlaghpour
21d5eb84ab feat: add Persian language to NSIS installer (#6965) 2023-05-16 12:58:30 +08:00
Amr Bashir
46a58afd9e chore: remove duplicate tauri in tauri-config-schema name (#6967) 2023-05-15 15:12:51 -03:00
Amr Bashir
3cc295e997 fix(nsis): prefill $INSTDIR with previous install path and respect /D flag, closes #6928 (#6935)
* fix(bundler/nsis): prefill $INSTDIR with previous install path

* fix(nsis): prefill $INSTDIR with previous install path and respect `/D` flag, closes #6928
2023-05-15 18:14:15 +03:00
Amr Bashir
2948820579 feat(bundler/NSIS): allow specifying custom lang files (#6867)
* feat(bundler/NSIS): allow specifying custom lang files

* add dunc as dep on all platforms

* clippy

* Update tooling/bundler/src/bundle/windows/nsis.rs

Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>

* Update core/tauri-utils/src/config.rs

Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>

* schema files

---------

Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-05-15 18:11:10 +03:00
Amr Bashir
e0c30a7e8b refactor: use const instead of a function (#6958) 2023-05-14 17:03:40 -03:00
Jack Wills
441f964654 feat(core/tauri): add try_get_item for SystemTray and WindowMenu, closes #5491 (#6408)
* feat: try_get_item() for window menu

Add a method in the MenuHandle struct, that will return an Optional MenuItemHandle

feat: try_get_item() for systemtray

Add a method in the SystemTrayHandle struct, that will return an Optional SystemTrayMenuItemHandle

docs: features documented in ./changes/minor.md

fix: suggested changes

fix CI

* Update .changes/tray_get_item.md

---------
2023-05-12 16:15:36 +03:00
Pierre Cashon
2c1fd570f8 fix(bundler): ensure that there are no duplicate extension arguments when bundling on Windows, fixes #6103 (#6917)
* fix(bundler): ensure that there are no duplicate extension arguments during bundling on Windows (fix #6103)

* fix(bundler): ensure that there are no duplicate extension arguments during bundling on Windows (fix #6103)
2023-05-12 15:52:26 +03:00
Guilherme Oenning
7c23720920 feat: add tauri::version, similar to getTauriVersion available on JS API (#6546)
Signed-off-by: goenning <me@goenning.net>

Apply suggestions from code review
2023-05-12 15:36:31 +03:00
KurikoMoe
fb485d25a0 fix(cli): fix cli connection timeout to dev server (fix #6045) (#6046)
Fix tauri-cli connection to dev server stucks and waits for TCP timeout.
2023-05-12 15:01:24 +03:00
Akshay
a08d1b248f chore: fix broken symlinks in license files (#6336)
symlink to repo root
2023-05-12 14:56:32 +03:00
Amr Bashir
dc682155de fix(core): Fix WindowBuilder::on_navigation handler never registerd, closes #6865 (#6921)
* fix(core): Fix `WindowBuilder::on_navigation` handler never registerd, closes #6865

* clippy
2023-05-12 14:03:42 +03:00
Amr Bashir
e092f79946 feat(bundler/nsis): allow specifying custom template, closes #6887 (#6922) 2023-05-12 14:02:07 +03:00
Fabian-Lars
c2b0dab7ef docs: Fix api.js docs pipeline with updated typedoc dependencies (#6945) 2023-05-12 07:54:15 -03:00
nathan-fall
b257bebf9e feat(bundler): Add Japanese to supported NSIS languages, ref #6906 (#6940) 2023-05-11 09:50:35 +02:00
hanaTsuk1
bf49a7679a update bundler nsis template(SimpChinese, TradChinese) (#6939) 2023-05-11 14:30:13 +08:00
Simon Hyll
469d9f8a4a docs(tauri-utils): described behavior of version field when omitted (#6938) 2023-05-11 14:18:45 +08:00
Simon Hyll
41e10b22fa chore: fixed grammar and typos (#6937) 2023-05-11 02:21:15 +03:00
Ronie Martinez
96d346222f docs: Update Github workflow status shields (#6910)
* docs: Update Github workflow status shields

* Update with name, icon and fix
2023-05-10 04:04:12 +03:00
Amr Bashir
2b47426be8 chore: explain covector tags (#6923) 2023-05-09 21:59:01 +03:00
Amr Bashir
aa2a30e96b chore: setup covector change tags/sections/groups (#6920)
![image](https://github.com/tauri-apps/tauri/assets/48618675/ac4f22dd-630d-4bfc-8966-48d19492593f)
2023-05-09 17:45:50 +03:00
Raphii
540ddd4e6a feat(bundler): Add Dutch to supported NSIS languages, ref #6906 (#6907)
* Add Dutch to supported NSIS languages

* Added change file

* Reference Dutch language in nsis bundler

* Fix formatting
2023-05-09 15:37:05 +02:00
Lucas Fernandes Nogueira
2659ca1ab4 feat(cli): add rustls as default Cargo feature (#6900) 2023-05-08 09:29:17 -03:00
chip
24490bca19 use handlebars::no_escape instead of closures (#6899) 2023-05-08 08:39:54 -03:00
github-actions[bot]
73a0ad41c7 apply version updates (#6858)
Co-authored-by: wusyong <wusyong@users.noreply.github.com>
2023-05-08 18:51:23 +08:00
LuisFerLCC
422b481798 Add Spanish and SpanishInternational languages (#6871) 2023-05-06 16:25:10 +08:00
Fabian-Lars
6a6b1388ea fix(bundler): correctly escape resource xml, fixes #6853 (#6855) 2023-05-04 09:10:33 -03:00
Amr Bashir
6788bb4984 chore: update reproduction wording (#6850)
* chore: update reproduction wording

* Update bug_report.yml

* Update .github/ISSUE_TEMPLATE/bug_report.yml

Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>

* Update bug_report.yml

---------

Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>
2023-05-04 19:28:22 +08:00
Fabian-Lars
2915bd068e fix(bundler): Fix webview install modes in NSIS bundler (#6854) 2023-05-04 19:27:27 +08:00
Lucas Fernandes Nogueira
5053a9c4c4 fix(ci): use rustls on publish-cli-js workflow (#6847) 2023-05-03 14:59:09 -03:00
Lucas Fernandes Nogueira
20f582f6c3 chore: update changelog with v1.3 remote IPC backport (#6848) 2023-05-03 14:58:57 -03:00
Lucas Nogueira
dafdcc9b42 fix(ci): use ubuntu-20.04 to build the CLI 2023-05-03 12:05:49 -03:00
Lucas Nogueira
7fd4ca0aef chore(api): downgrade documentation dependencies 2023-05-03 10:10:59 -03:00
Lucas Fernandes Nogueira
0dfd5f875f fix(core): pin winnow dependency to 0.4.1 to keep 1.60 MSRV (#6845) 2023-05-03 09:31:59 -03:00
Lucas Fernandes Nogueira
14b3667420 fix(api): downgrade typedoc to 0.23 (#6844) 2023-05-03 09:19:37 -03:00
github-actions[bot]
bf804657f5 Apply Version Updates From Current Changes (#5815)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2023-05-03 08:19:06 -03:00
Lucas Fernandes Nogueira
93452b791a feat(bundler): download NSIS zip from tauri-apps/binary-releases (#6838) 2023-05-02 16:36:33 -03:00
Lucas Fernandes Nogueira
6d6b6e653e feat: configure escaping on handlebars templates (#6678)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-05-02 09:59:59 -03:00
Lucas Fernandes Nogueira
40f137c214 fix(core): IPC remote domain check bypassed by isolation iframe usage (#6691) 2023-05-02 09:58:51 -03:00
renovate[bot]
e8e214b72e chore(deps) Update Tauri API Definitions (#6739)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-24 11:19:59 -03:00
renovate[bot]
eae0150b0a chore(deps) Update Rust crate serde_json to 1.0.96 (#6738)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-24 11:19:49 -03:00
Kárándi Tamás
51460340bf fix: copy failure in NSIS bundler #6743 (#6744) 2023-04-19 19:42:38 -03:00
renovate[bot]
dfb5f52d3c chore(deps) Update Tauri API Definitions (#6684)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-12 11:20:44 -03:00
renovate[bot]
80069e1dc0 chore(deps) Update Rust crate json-patch to v1 (#6686)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-12 11:20:08 -03:00
renovate[bot]
5fcb55e420 chore(deps) Update Rust crate json-patch to v1 (#6687)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-12 11:19:55 -03:00
Lucas Fernandes Nogueira
ee71c31fd0 feat(core): allow configuring remote domains with IPC access, closes #5088 (#5918) 2023-04-11 08:50:15 -03:00
Amr Bashir
6ff801e27d chore: rename config-schema to tauri-config-schema (#6250)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-04-07 12:11:05 -03:00
renovate[bot]
44b4e2ee00 chore(deps) Update dependency eslint-config-standard-with-typescript to v34 (#6180)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-06 21:15:51 -03:00
renovate[bot]
5a1d86b346 chore(deps) Update Tauri JS CLI (#6177)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-06 21:14:04 -03:00
renovate[bot]
f4c9635724 chore(deps) Update Rust crate cargo_toml to 0.15 (#6214)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-06 21:13:25 -03:00
renovate[bot]
565dc3baa7 chore(deps) Update Tauri Utils (major) (#4717)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-06 21:12:33 -03:00
renovate[bot]
a3c9754950 chore(deps) Update Tauri Bundler (#6640)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-06 13:03:43 -03:00
thep0y
708efbd9b7 fix(core/tauri): upgrade open to 3.2 to fix a bug on Windows (#6441)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-04-06 12:08:32 -03:00
Si Yang
da30753754 style: needless_borrow, useless_format (#6620) 2023-04-04 10:10:47 -03:00
Amr Bashir
0b46637eba fix(api): construct correct object for onResized and onMoved, closes #6507 (#6509)
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-04-03 12:18:36 -03:00
renovate[bot]
d3e4fb20b5 chore(deps) Update Tauri API Definitions (#6523)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-04-03 11:33:47 -03:00
dependabot[bot]
919d96dd8a chore(deps): bump openssl from 0.10.40 to 0.10.49 in /tooling/cli (#6618)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-03 10:57:03 -03:00
dependabot[bot]
6c7eac7288 chore(deps): bump openssl from 0.10.45 to 0.10.48 in /examples/api/src-tauri (#6551)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-03 10:05:45 -03:00
dependabot[bot]
901ce937d6 chore(deps): bump openssl from 0.10.45 to 0.10.48 in /examples/updater/src-tauri (#6550)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-03 10:05:36 -03:00
Mokhtar Hamdoune
81b9c505cc return the commment of maximum number of redirects to its right place… (#6607) 2023-04-03 08:39:15 -03:00
afa
7489f96697 fix(bundler): fix problem of macOS bunder while i18n is set, closes #6614 (#6615)
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-04-03 08:37:50 -03:00
Miniontoby
a926b49a01 Fix Github Actions of Tauri Plugin with-api template (#6603)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2023-04-03 08:12:49 -03:00
Zeeshan Ali Khan
5fdc616df9 feat: Use the zbus-backed of notify-rust (#6332)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-03-31 12:36:59 -03:00
Amr Bashir
1487b18dcb refactor: add useful diagnostics to tauri info (#6570)
* refactor: add useful diagnostics to `tauri info`

this also paves the way for interactive fixes in the future

* refactor: add useful diagnostics to `tauri info`

this also paves the way for interactive fixes in the future

* fix use_npm logic [skip ci]

* lint [skip ci]

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-03-31 10:23:34 -03:00
Lucas Fernandes Nogueira
7f820ee190 chore(tests): enhance and document updater NSIS test (#6556) 2023-03-31 10:13:35 -03:00
Lucas Fernandes Nogueira
54c6f158d9 chore(cli): enhance empty updater key password warning (#6558) 2023-03-31 10:13:25 -03:00
Fabian-Lars
23282873e7 docs(api.js): Fix basename example, closes tauri-apps/tauri-docs#1180 (#6553) 2023-03-31 10:13:04 -03:00
Amr Bashir
eb1ec0416c fix(core/updater): read and parse response after checking status code, closes #6192 (#6575) 2023-03-31 10:06:59 -03:00
Lucas Fernandes Nogueira
5e0c4489df fix(bundler): enhance extract_zip security by using enclosed_name() (#6555)
See https://docs.rs/zip/0.6.4/zip/read/struct.ZipFile.html#method.enclosed_name
2023-03-31 10:05:44 -03:00
Lucas Fernandes Nogueira
d788d23071 refactor(core): do not allow JS API to set additional browser args (#6216)
This was introduced in #5799, but it's dangerous to let the frontend set this option.
2023-03-31 10:05:18 -03:00
Amr Bashir
a7ee5ca7c3 fix(cli): look for available ports for built-in dev server, closes #6511 (#6514)
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-03-31 10:03:38 -03:00
Amr Bashir
ff4ea1eabb fix: dispatch focus event to app.run on Windows, closes #6460 (#6504) 2023-03-31 10:03:25 -03:00
CzBiX
57c6bf07bb fix(cli): fix default-run not deserialized (#6584)
* fix(cli): fix default-run not deserialized

* Create fix-cli-default-run.md

* Update .changes/fix-cli-default-run.md [skip ci]

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2023-03-29 14:43:16 -03:00
amrbashir
38ee5066e7 chore: update schema files 2023-03-28 16:25:33 +02:00
Elliot Waite
8c07076e25 docs: update grammer 2023-03-28 16:04:44 +02:00
passivedragon
2f70d8da2b fix: symlink issue bundling for linux #5781 (#6391)
* bundler for linux: fix error on pre-existing links

* fix: symlink issue bundling for linux #5781
2023-03-17 15:03:40 -03:00
Lucas Fernandes Nogueira
c46c09f31d fix(deps): pin raw-window-handle to 0.5.0 (#6480)
* fix(deps): pin raw-window-handle to 0.5.0

* lint [skip ci]
2023-03-17 14:11:24 -03:00
Shaun Hamilton
c2867a65d8 feat: add config links to json schema (closes #5479) (#6356)
* feat(core): add config links to json schema

* feat(core): add schema builds
2023-03-17 13:17:34 -03:00
Amr Bashir
058469114d docs: update formdata usage (#6374)
* docs: update formdata usage

* update generated files

* update generated files

* run workflow on push for dev only

* remove `js-api.json` from generated files check

* restore js-api.json before checking diff
2023-03-17 13:13:02 -03:00
sameoldlab
00c60097c5 fix scope example (#6401)
Changed `scope` example to provide an array, as described in the docs and how it works.
2023-03-17 13:11:43 -03:00
Fabian-Lars
1d0de2a558 fix(core): export SystemTrayMenuItemHandle to fix doc generation. (#6440) 2023-03-17 13:09:27 -03:00
Fabian-Lars
1fa729b218 fix(docs): mark internal interfaces as such to deduplicate markdown output (#6260) 2023-03-16 09:25:13 -03:00
renovate[bot]
808deecfff chore(deps) Update Tauri API Definitions (#6277)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-16 09:22:20 -03:00
Amr Bashir
b7a2ce2c63 feat(cli): add --port, closes #6186 (#6283)
* feat(cli): add --dev-server-port, closes #6186

* add http:// prefix

* name it to `--port`

* rename in all places
2023-03-16 09:22:02 -03:00
2nthony
3536aa00d1 fix(api): event name types (#6318)
* fix(api): event name

* suggestion change

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-03-16 09:16:50 -03:00
Amr Bashir
1c8229fbe2 fix(cli.js): detect node-<version> binary, closes #6427 (#6432)
* fix(cli.js): detect `node-<version>` binary, closes #6427

* use `?` instead of `*` and escape the hyphen

Co-authored-by: TurtleIdiot <18502738+TurtleIdiot@users.noreply.github.com>

---------

Co-authored-by: TurtleIdiot <18502738+TurtleIdiot@users.noreply.github.com>
2023-03-16 09:01:41 -03:00
amrbashir
e513b69d98 chore: fix info rendering in bug issue template 2023-03-06 15:37:27 +02:00
Lorenzo Lewis
cfcc7f3c20 Commit JS AST, update check-generated-file checkout action (#6262)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-02-22 10:10:54 -03:00
Lucas Fernandes Nogueira
5fdf8dcb8e fix(core): mime type of .less, .sass and .styl files (#6316) 2023-02-19 16:23:18 -03:00
Lucas Fernandes Nogueira
36e4837cea chore(examples): delete mobile.toml file (#6317) 2023-02-19 16:23:09 -03:00
Lucas Fernandes Nogueira
17bf7f1f0f feat(ci): add workflow to check license header (#6315) 2023-02-19 10:33:59 -03:00
Lucas Fernandes Nogueira
46e6187c89 chore: update license year (#6311) 2023-02-19 10:17:49 -03:00
Lucas Fernandes Nogueira
3d16461b68 fix(core): pin time to 0.3.15 (#6312) 2023-02-19 09:02:36 -03:00
dependabot[bot]
8661e4a0d7 chore(deps): bump undici from 5.9.1 to 5.19.1 in /examples/api (#6296)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-18 16:23:25 -03:00
Amr Bashir
f6c3ea6faa chore: simplify windows_subsystem attribute (#6273) 2023-02-18 16:23:09 -03:00
Amr Bashir
bfa69691a5 fix(cli): detect --profile. closes #6255 (#6268) 2023-02-18 16:20:21 -03:00
Lucas Fernandes Nogueira
e8014a7f61 fix(cli): do not crash on watcher (#6303) 2023-02-17 22:06:10 -03:00
Lucas Fernandes Nogueira
138cb8d739 fix(tauri-runtime-wry): tray event listener not registered (#6270) 2023-02-14 14:56:36 -03:00
dependabot[bot]
852e11e17b chore(deps): bump tokio from 1.23.1 to 1.24.2 in /tooling/cli (#6194)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-02-08 09:15:49 -03:00
renovate[bot]
c9364c2a4c chore(deps) Update Tauri API Definitions (#6215)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-08 09:14:15 -03:00
Lucas Fernandes Nogueira
a8d640b3c6 fix(core): pin unarray and os_info (#6212) 2023-02-07 20:47:31 -03:00
dependabot[bot]
b72adc0a66 chore(deps): bump tokio from 1.20.3 to 1.20.4 in /tooling/webdriver (#6193)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-07 19:46:31 -03:00
renovate[bot]
7e8e0e76ec chore(deps) Update Tauri API Definitions (#6178)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-02 16:45:17 -03:00
chip
50576a5e1e fix 1.67 clippy warnings (compatible with MSRV) (#6179) 2023-02-01 14:24:01 -03:00
Alain Nicolas Schneble
314f0e212f fix(cli): web_dev_server html template serialization (fix #6165) (#6166)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-29 15:12:01 -03:00
Fabian-Lars
f7ac2e9250 docs(api.js): fix heading level in window api docs (#6157) 2023-01-29 15:00:50 -03:00
renovate[bot]
db7765edad chore(deps) Update Tauri Codegen (#6034)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-26 11:23:08 -03:00
Fabian-Lars
d20a728892 feat: Further improve workspace inheritance, closes #6122, #5070 (#6144)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-26 10:47:23 -03:00
Amr Bashir
9da996073f fix(cli): fix printing paths on Windows (#6137) 2023-01-26 10:45:58 -03:00
renovate[bot]
ed6b81b29d chore(deps) Update Rust crate toml to 0.6.0 (#6139)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-26 09:32:34 -03:00
Fabian-Lars
b0d3128597 fix(bundler): NSIS: default to user permission level (#6135) 2023-01-26 09:24:57 -03:00
renovate[bot]
2d9936931a chore(deps) Update Tauri JS CLI (#6138)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-26 09:24:08 -03:00
renovate[bot]
0d6bc3b583 chore(deps) Update dependency eslint-config-standard-with-typescript to v32 (#6141)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-26 09:16:57 -03:00
Amr Bashir
aff1fd2c7d chore: update nsis-tauri-utils to 0.1.1 (#6136) 2023-01-26 09:16:43 -03:00
renovate[bot]
7a17c1e89f chore(deps) Update Tauri API Definitions to v5.49.0 (#6140)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-26 09:12:36 -03:00
Jonas Kruckenberg
e71e375c29 chore: enable aarch64-apple-darwin cargo-binstall builds (#6145) 2023-01-26 09:09:04 -03:00
Fabian-Lars
36540ce3c3 feat(bundler): enable arm64 target for nsis bundle (#6070)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-23 18:32:45 -03:00
Ludea
275800a603 feat: add french support for nsis (#6114)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-23 18:29:27 -03:00
Amr Bashir
f29c56da8c feat(NSIS): option to remove user data & uninstaller lang & fix RTL (#6129)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-23 18:25:01 -03:00
Amr Bashir
328583e12e feat(bundler/nsis): migrate to nsis_tauri_utils (#6120)
Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
2023-01-23 18:12:14 -03:00
Chris Ohk
26f306d65c fix: Correct minor typos (#6132) 2023-01-23 18:10:42 -03:00
dependabot[bot]
87ea607ef4 chore(deps): bump bumpalo from 3.10.0 to 3.12.0 in /tooling/cli (#6118)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-23 18:10:07 -03:00
Golden Water
763f0bdcb0 feat: add Simplified Chinese support for nsis. (#6109)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-20 11:35:08 -03:00
DK Liao
27fa1022ee feat: add Traditional Chinese support for nsis (#6111) 2023-01-20 11:11:18 -03:00
DK Liao
e601b9a790 fix: quick typo fix for nsis (#6112) 2023-01-20 11:10:31 -03:00
Fabian-Lars
60e6f6c3f1 feat(bundler): Add support for creating NSIS bundles on unix hosts (#5788)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-19 15:42:40 -03:00
Amr Bashir
35b587c830 feat: add languages support for nsis (#6039)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-19 14:39:53 -03:00
renovate[bot]
b9559b35d1 chore(deps) Update dependency eslint-config-standard-with-typescript to v30 (#6091)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-19 00:25:18 -03:00
Lucas Nogueira
d4f89af18d feat: skip password prompt on the build command if CI is set fixes #6089 2023-01-18 23:54:30 -03:00
Amr Bashir
8fb1df8aa6 feat(cli): add --ci flag to signer generate, closes #6089 (#6097)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-18 23:43:37 -03:00
renovate[bot]
e0631d379c chore(deps) Update Tauri API Definitions (#6087)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-18 22:39:53 -03:00
renovate[bot]
581b515e08 chore(deps) Update Tauri JS CLI (#6088)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-18 22:39:44 -03:00
Fabian-Lars
20ff1f4596 feat(bundler): Add support for numeric-only build numbers in msi version (#6096)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-18 22:30:44 -03:00
Fabian-Lars
fc193a502f ci: downgrade benchmark runner to ubuntu20.04 (#6095) 2023-01-18 22:28:42 -03:00
Amr Bashir
d4d6a98d98 fix(core): convert js Map to object before serialization, closes #6078 (#6099)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-18 22:17:01 -03:00
Lucas Nogueira
a822a6ad74 chore: update versions after ignore=0.4.18 patch 2023-01-18 21:47:26 -03:00
Lucas Nogueira
6ed2b04872 chore(deps): revert phf to 0.10 2023-01-17 13:26:22 -03:00
Lucas Nogueira
7ccfa2fb0b chore(deps): pin ignore to =0.4.18 2023-01-17 13:10:09 -03:00
Lucas Nogueira
1b9f0ec350 fix(core): adjust aes_gcm usage 2023-01-17 13:09:49 -03:00
Lucas Nogueira
2455328f81 fix(core): WindowBuilder::from_config documentation example 2023-01-17 12:28:11 -03:00
Lucas Nogueira
f4fe3beb84 chore(tauri-utils): update dependencies 2023-01-17 12:25:01 -03:00
Lucas Nogueira
54a4a14b41 Revert "chore(deps): update embed_plist to 1.4"
This reverts commit b3591d46e6.
2023-01-17 12:21:35 -03:00
Lucas Nogueira
b3591d46e6 chore(deps): update embed_plist to 1.4 2023-01-17 12:19:36 -03:00
Amr Bashir
0b4882ed92 fix(cli/node): add json5 resolution, fix audit ci (#5991) 2023-01-16 22:55:18 -03:00
dependabot[bot]
ca3a53005a chore(deps): bump tokio from 1.21.2 to 1.23.1 in /tooling/cli (#5997)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 22:47:48 -03:00
dependabot[bot]
6ccfce4180 chore(deps): bump tokio from 1.19.2 to 1.20.3 in /tooling/webdriver (#5996)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 22:47:34 -03:00
dependabot[bot]
7aca4527e8 chore(deps): bump tokio from 1.21.2 to 1.24.1 in /examples/api/src-tauri (#5998)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 22:42:50 -03:00
dependabot[bot]
9d543f6ed3 chore(deps): bump tokio from 1.21.2 to 1.24.1 in /examples/resources/src-tauri (#5999)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 22:42:35 -03:00
dependabot[bot]
2761dd037f chore(deps): bump tokio from 1.21.2 to 1.23.1 in /examples/tauri-dynamic-lib/src-tauri (#6000)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 22:42:24 -03:00
dependabot[bot]
9afbeb6b7a chore(deps): bump tokio from 1.21.2 to 1.24.1 in /examples/sidecar/src-tauri (#6001)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 22:42:15 -03:00
dependabot[bot]
6e60bd637c chore(deps): bump tokio from 1.21.2 to 1.24.1 in /examples/updater/src-tauri (#6002)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 22:42:05 -03:00
dependabot[bot]
8e4820642e chore(deps): bump tokio from 1.21.2 to 1.24.1 in /examples/web/core (#6003)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 22:41:57 -03:00
dependabot[bot]
a788aea85d chore(deps): bump tokio from 1.23.0 to 1.24.1 in /examples/workspace (#6004)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 22:41:47 -03:00
Amr Bashir
7aab3e2076 fix(cli.rs): improve rustc not found error msg (#6021) 2023-01-16 22:41:05 -03:00
dependabot[bot]
05662b3129 chore(deps): bump bzip2 from 0.4.3 to 0.4.4 in /tooling/cli (#6028)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 22:40:44 -03:00
renovate[bot]
62f8659bef chore(deps) Update Tauri API Definitions (#6031)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-16 22:40:34 -03:00
renovate[bot]
8ac2f412be chore(deps) Update Tauri JS CLI (#6032)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-16 22:40:21 -03:00
Fabian-Lars
01b876761a fix(bundler): fix order of webview2 installer args in nsis bundle (#6042) 2023-01-16 22:35:22 -03:00
Jonas Kruckenberg
8eabb09e80 Update FUNDING.yml to point to the org sponsors (#6056) 2023-01-16 22:33:42 -03:00
Fabian-Lars
49dff27ef1 feat(core): create WindowBuilder from WindowConfig (#6073)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-16 22:29:21 -03:00
Fabian-Lars
b08ae637a0 fix(cli): remove default features from template (#6074) 2023-01-16 21:43:29 -03:00
Shogo Hida
8c842a54a6 feature: disable mouse event when building windows on Linux, closes #5913 (#6025)
Co-authored-by: Wu Yu Wei <wusyong9104@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Fixes https://github.com/tauri-apps/tauri/issues/5913
2023-01-16 10:33:06 -03:00
matthme
72aa17f79a added additional information to AllowlistConfid documentation (#5985)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-04 18:21:26 -03:00
renovate[bot]
7ae67dde69 chore(deps) Update dependency eslint-config-standard-with-typescript to v26 (#5981)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-04 13:05:00 -03:00
dependabot[bot]
2809171fb4 chore(deps): bump json5 from 1.0.1 to 1.0.2 in /tooling/api (#5973)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-04 10:11:46 -03:00
renovate[bot]
4b9a5af3cf chore(deps) Update dependency @napi-rs/cli to v2.14.1 (#5977)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-04 10:10:51 -03:00
renovate[bot]
d2df2e831b chore(deps) Update Tauri API Definitions (#5978)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-04 10:10:10 -03:00
Amr Bashir
c94e1326a7 feat(bundler): add nsis, closes #4450, closes #2319 (#4674)
Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-01-03 14:29:20 -03:00
Jason
4892637f83 fix: Resizing glitch on custom titlebar click (closes #2549) (#5966)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
closes https://github.com/tauri-apps/tauri/issues/2549
2023-01-03 14:14:37 -03:00
alesharik
ce76d95ab1 feat(tauri-cli): add dylib support to tauri.bundle.macOS.frameworks, closes #4615 (#5732)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-31 13:53:35 -03:00
luofei
2265e09718 feat(windows): implement with_tooltip (#5938)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-31 13:24:39 -03:00
dependabot[bot]
6d5dc9489c chore(deps): bump json5 from 2.2.0 to 2.2.2 in /tooling/cli/node (#5949)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-31 12:55:52 -03:00
renovate[bot]
d703c7f459 chore(deps) Update Rust crate cargo_toml to 0.14 (#5928)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-31 12:55:19 -03:00
renovate[bot]
281714e567 chore(deps) Update dependency @napi-rs/cli to v2.14.0 (#5930)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-31 12:48:50 -03:00
renovate[bot]
c1d84e8127 chore(deps) Update Tauri API Definitions (#5927)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-31 12:47:45 -03:00
renovate[bot]
04ddee91e8 chore(deps) Update Rust crate ico to 0.3 (#5929)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-31 12:47:25 -03:00
Lucas Nogueira
864dfe4de5 fix(examples): use new MessageDialogButtons variant name 2022-12-30 20:15:45 -03:00
Amr Bashir
077605f58b refactor: use windows manifest already present in tauri-build crate (#5936)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-30 08:44:31 -03:00
Bo
00e1efaa9b feat: customize button texts of message dialog (#4383)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-27 18:15:53 -03:00
Amr Bashir
7a8d570db7 fix: sync webview theme with window theme on Windows, closes #5802 (#5874)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-27 14:57:02 -03:00
Amr Bashir
0d5835d133 chore: update plugin example based on CTA (#5213)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-27 14:32:29 -03:00
renovate[bot]
488a7562bb chore(deps) Update dependency eslint-config-standard-with-typescript to v24 (#5832)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-27 13:15:58 -03:00
Darin Morrison
3f35b45263 Expose wry navigation_handler via WindowBuilder closes #4080 (#5686)
Co-authored-by: silvanshade <silvanshade@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-27 12:54:57 -03:00
Amr Bashir
146a794cb6 fix(core): sync windows metadata across all windows, closes #5571 (#5615)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-27 12:19:07 -03:00
TomatoCake
ff99a9bf74 docs(api): Add missing APIs to dialog allowlist (#5858) 2022-12-27 10:40:28 -03:00
renovate[bot]
bf550f94cc chore(deps) Update Tauri JS CLI (#5882)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-27 10:39:55 -03:00
renovate[bot]
f439122622 chore(deps) Update Tauri API Definitions (#5883)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-27 10:39:46 -03:00
khuongduy354
9d2144128f feat(cli): add option to make custom icon sizes, closes #5121 (#5246)
Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-27 10:34:20 -03:00
tweidinger
f5305de251 Added GitHub disclosure process (#5905) 2022-12-26 19:01:45 -03:00
Lucas Fernandes Nogueira
d17027e1a0 feat: expose url method (#5914)
Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
Co-authored-by: Jonas Kruckenberg <iterpre@protonmail.com>
2022-12-26 15:31:40 -03:00
Amr Bashir
72621892fe fix(cli): use unicode feature for heck crate, closes #5860 (#5872) 2022-12-26 11:38:13 -03:00
Amr Bashir
89602cdce3 feat(bundler): check Launch app by default for WiX, closes #5859 (#5871) 2022-12-26 11:36:43 -03:00
Amr Bashir
c2608423b6 fix(cli): don't panic when a crate version couldn't be parsed (#5873)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
2022-12-26 11:35:04 -03:00
Lucas Nogueira
1956a3aeda fix(core): window allowlist error message for internal APIs 2022-12-23 22:28:04 -03:00
Lucas Nogueira
14d567f7ec chore: update tauri changelog 2022-12-22 11:35:29 -03:00
Amr Bashir
72389b00d7 Merge pull request from GHSA-6mv3-wm7j-h4w5
* fix(core): use `require_literal_separator` when matching paths

* document the need for `require_literal_separator`

* use `require_literal_leading_dot`
2022-12-22 15:53:46 +02:00
Lucas Nogueira
4f2fd4dcf7 chore: run cargo fmt 2022-12-15 18:40:57 -03:00
Lucas Nogueira
cf0986491c chore(cli): fix clippy warnings 2022-12-15 18:30:32 -03:00
Lucas Nogueira
d7ffa7f95e chore: addition to previous commit 2022-12-15 18:28:44 -03:00
Lucas Nogueira
015020760a chore: fix clippy warnings 2022-12-15 18:03:28 -03:00
renovate[bot]
a02c6c4c81 chore(deps) Update Rust crate toml to 0.5.10 (#5836)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-15 12:35:58 -03:00
Fabian-Lars
cd8c074ae6 feat(cli): add support for Cargo's workspace inheritance for the package version, closes #5070 (#5775)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-14 13:39:05 -03:00
Robin van Boven
f7a080a121 fix(bench): Result interpretation problems (#5798)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-14 12:44:05 -03:00
Amr Bashir
bca09f7f5f feat(tauri-build): add option to specify Windows manifest, closes #5584 (#5730)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-14 12:18:46 -03:00
Lucas Nogueira
2bf9c27375 fix(ci): use client-payload input to trigger cli.js publish workflow 2022-12-14 12:17:43 -03:00
Noam Zaks
3dc38b150e feat(core): expose additional_browser_args to window config (fix: #5757) (#5799)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-14 11:46:24 -03:00
renovate[bot]
28133c5155 chore(deps) Update dependency @napi-rs/cli to v2.13.2 (#5827)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-14 09:01:29 -03:00
renovate[bot]
1efe861d3c chore(deps) Update Rust crate json-patch to 0.3 (#5828)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-14 09:01:20 -03:00
renovate[bot]
0eddb812c6 chore(deps) Update Tauri API Definitions (#5829)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-14 09:00:53 -03:00
renovate[bot]
19ec53fae4 chore(deps) Update Tauri Codegen (#5830)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-14 09:00:36 -03:00
filip
73fd60eef2 expose set_device_event_filter in tauri (#5562)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Closes https://github.com/tauri-apps/tauri/issues/5496
2022-12-13 13:57:32 -03:00
Amr Bashir
5fd4d20e3b chore: remove duplicate field (#5824) 2022-12-13 12:56:58 -03:00
Amr Bashir
4ab5545b7a feat: add content protection api, closes #5132 (#5513)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-13 01:04:22 -03:00
Amr Bashir
233e43b0c3 feat: add title getter on window, closes #5023 (#5515)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-13 00:59:09 -03:00
Lucas Fernandes Nogueira
d0d873e39a feat(core): add support to mailto: and tel: links, closes #5521 (#5544) 2022-12-13 00:57:39 -03:00
Lucas Nogueira
9db9e6c037 feat(ci): also run check-generated-files on pull request 2022-12-12 10:36:25 -03:00
crpz1
62144ef3be feat: add is_minimized (fix #3878) (#5618)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
fixes https://github.com/tauri-apps/tauri/issues/3878
2022-12-12 10:34:19 -03:00
Lucas Fernandes Nogueira
eaf0d71779 fix(ci): do not test cli.js on node v12 (#5784) 2022-12-08 13:23:50 -03:00
github-actions[bot]
75a0c79dea Apply Version Updates From Current Changes (#5710)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2022-12-08 11:57:21 -03:00
Orvar Segerström
c14b1df372 fix(core): Invoke event listener in windows safely to avoid causing uncaught errors in windows that have loaded external urls (#5563)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-12-08 11:32:52 -03:00
Lucas Fernandes Nogueira
41a471b23a feat(covector): improve published version check (#5783) 2022-12-08 09:49:55 -03:00
Avaab Razzaq
9e7ce0a8ee feat(cli): detect SolidJS and SolidStart (#5758) 2022-12-08 09:47:32 -03:00
Lucas Nogueira
b293da35dd fix(changes): change enable_macos_default_menu bump to patch
This is a regression so we can publish it as a patch.
2022-12-08 09:32:59 -03:00
Lucas Nogueira
fdcd77338c chore(deps): update wry to 0.23 2022-12-08 09:01:12 -03:00
Lucas Fernandes Nogueira
9093ef3314 fix(bundler): blank taskbar icon on WiX update, closes #5631 (#5779) 2022-12-08 08:49:54 -03:00
Lucas Nogueira
ffe21e0225 chore(cli): rerun build on template changes 2022-12-07 16:30:35 -03:00
Lucas Nogueira
4f087cfd92 chore(deps): pin wry to 0.22.6 2022-12-07 16:28:40 -03:00
renovate[bot]
7225501c13 chore(deps) Update dependency prettier to v2.8.1 (#5777)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-07 16:27:02 -03:00
renovate[bot]
9c632ee35d chore(deps) Update dependency prettier to v2.8.1 (#5776)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-07 16:26:52 -03:00
renovate[bot]
b5059d77e9 chore(deps) Update Tauri API Definitions (#5772)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-07 16:06:27 -03:00
Lucas Nogueira
f81c3f2922 fix(ci): install libfuse2 to run integration tests 2022-12-07 16:06:06 -03:00
Amr Bashir
8866ecac3c feat(core): add tauri::Builder::enable_macos_default_menu (#5756) 2022-12-07 11:01:53 +08:00
Amr Bashir
0f26960891 fix(core/api): cleanup before exit (#5765) 2022-12-07 11:01:13 +08:00
Antoine Meloche
c7bffb01be DOCS: incorrect descriptions in AboutMetadata fields (#5744) 2022-12-03 10:22:17 -03:00
Lucas Fernandes Nogueira
9d872ab872 feat(cli): detect SvelteKit and Vite (#5742) 2022-12-02 08:18:28 -03:00
renovate[bot]
b6027b2dd2 chore(deps) Update Tauri API Definitions (#5729)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-30 11:31:11 -03:00
renovate[bot]
2a0b2cea03 chore(deps) Update dependency fs-extra to v11 (#5727)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-30 11:30:53 -03:00
renovate[bot]
873840a204 chore(deps) Update Rust crate image to 0.24.5 (#5675)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-30 11:25:53 -03:00
renovate[bot]
445a8b6062 chore(deps) Update Tauri API Definitions (#5676)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-30 11:11:07 -03:00
renovate[bot]
677db85877 chore(deps) Update Tauri JS CLI (#5678)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-30 11:10:54 -03:00
Amr Bashir
c0989848b9 feat(cli/dev): add --no-dev-server, ref #5708 (#5722) 2022-11-30 10:34:51 -03:00
Fabian-Lars
04681a6b13 fix(docs): cross-link to correct PathResolver method in path module docs. (#5714) 2022-11-29 11:26:13 +08:00
Fabian-Lars
2d545eff58 fix(cli): corrupted icons in bundled macOS icons (#5698)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-11-28 08:57:32 -03:00
Vilian Gerdzhikov
0e8d3a6f16 wording & version corrections (#5696) 2022-11-28 08:57:11 -03:00
Fabian-Lars
b490308c88 fix(core): compilation error on older Linux versions, fixes #5684 (#5697) 2022-11-28 08:39:19 -03:00
github-actions[bot]
527bd9feea Apply Version Updates From Current Changes (#5644)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2022-11-24 12:52:54 -03:00
Lucas Fernandes Nogueira
d710946064 refactor: move Linux custom protocol headers support behind feature flag (#5683) 2022-11-24 09:38:19 -03:00
Eric Veilleux
15ebeb1851 Update ico package (#5577) 2022-11-22 11:15:54 -03:00
Lucas Nogueira
50fbd49273 chore(examples): simplify streaming example code, closes #5670 2022-11-22 10:47:03 -03:00
LucasJavaudin
677838ccfa fix double serialize on invoke (#5639)
Co-authored-by: LucasJavaudin <lucas.javaudin@cyu.fr>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-11-20 10:20:09 -03:00
renovate[bot]
168c3d0148 chore(deps) Update Tauri API Definitions (#5590)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-20 09:38:42 -03:00
renovate[bot]
2eec3e13fb chore(deps) Update Tauri Codegen (#5593)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-20 09:38:31 -03:00
renovate[bot]
a883c31088 chore(deps) Update dependency jest to v29.3.1 (#5594)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-20 09:37:57 -03:00
renovate[bot]
f2d7405df4 chore(deps) Update Rust crate attohttpc to 0.24 (#5591)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-20 09:37:49 -03:00
Lucas Nogueira
1ecaeb29aa fix(cli): inject config feature flags when features arg is not provided 2022-11-18 13:12:50 -03:00
Lucas Nogueira
7e3d672b9b chore(examples): ignore mobile artifacts on api example 2022-11-18 13:11:18 -03:00
Amr Bashir
bb2510876d fix(core): extend allowlist with app's allowlist, closes #5650 (#5652) 2022-11-18 12:27:38 -03:00
Oscar Beaumont
ed43ff3243 fix(tauri): add missing generics on AppHandle and App (#5642)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-11-17 18:54:47 -03:00
Fabian-Lars
5fe68b1cec docs: Various docs improvements (#5643) 2022-11-17 18:47:54 -03:00
看彩虹的人
3d37ed38c7 fix(examples): fix command args case (#5635) 2022-11-17 15:04:10 +02:00
Justin Syme
830ae97955 docs(api.js): update app.show docs (#5633)
Grammar correction.
2022-11-16 12:39:22 +02:00
Lucas Nogueira
67f14b4ce8 chore(tauri): update CHANGELOG.md 2022-11-11 12:09:27 -03:00
Lucas Fernandes Nogueira
6e879742f0 feat(ci): improve cache, add test-core features matrix (#5604) 2022-11-10 17:30:10 -03:00
Orhun Parmaksız
a836373328 chore: fix a typo in changelog (#5580) 2022-11-08 23:23:25 +02:00
Lucas Nogueira
2e1bd04775 fix(cli.js): set version to 1.2.0 2022-11-08 10:33:33 -03:00
github-actions[bot]
45a5cd569b Apply Version Updates From Current Changes (#5295)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-11-08 09:24:09 -03:00
Lucas Fernandes Nogueira
3afccfce17 chore(deps): update wry to 0.22 (#5573) 2022-11-08 08:47:29 -03:00
Lucas Fernandes Nogueira
1aba1780de feat(ci): define workspace for rust-cache, improving cache key (#5559) 2022-11-06 16:27:29 -03:00
Ben Wishovich
878421beb7 fix: Add WASM files to Vite Allow List and change devPath to localhost to fix Web Example (#5560)
Co-authored-by: Ben Wishovich <ben@benw.is>
2022-11-06 16:26:27 -03:00
Lucas Nogueira
777c086590 feat(ci): improve cache usage 2022-11-05 13:14:56 -03:00
Lucas Nogueira
60e08605d5 chore(ci): do not cache artifacts-updater on failure 2022-11-05 09:33:00 -03:00
Lucas Nogueira
d8b996c00a chore(changes): adjust config-schema build scripts 2022-11-05 09:32:23 -03:00
Lucas Fernandes Nogueira
7aaf27ce5f fix(bundler): load WiX DLLs on Github Actions (#5552) 2022-11-04 21:00:02 -03:00
Lucas Fernandes Nogueira
014aeca11f fix(ci): use python 3.10 on bench workflow (#5550) 2022-11-04 19:25:55 -03:00
renovate[bot]
e7078a3030 chore(deps) Update dependency jest to v29 (#5542)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-04 18:29:15 -03:00
Lucas Fernandes Nogueira
b41447b811 feat(ci): use Swatinem/rust-cache@v2 (#5547) 2022-11-04 18:26:30 -03:00
Lucas Fernandes Nogueira
aa119f2836 feat(api): add FormData support on Body.form, closes #5545 (#5546) 2022-11-04 15:18:28 -03:00
Amr Bashir
99fe1c562f fix(core): resolve base dir in shell scope, closes #5480 (#5508) 2022-11-04 12:38:06 -03:00
Lucas Fernandes Nogueira
9b1a6a1c02 fix(core): set correct mimetype for asset protocol streams, #5203 (#5536) 2022-11-04 12:35:45 -03:00
Lucas Fernandes Nogueira
c6321a610c fix(cli): remove unused dependencies, closes #5522 (#5543) 2022-11-04 12:35:21 -03:00
Dotan J. Nahum
e055c69c23 small typo fix (#5541) 2022-11-04 08:59:57 -03:00
Lucas Fernandes Nogueira
582c25a0f0 refactor(cli): disable api-all on templates (#5538) 2022-11-03 18:57:32 -03:00
renovate[bot]
dc9269bc8d chore(deps) Update Tauri API Definitions (#5523)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-03 18:31:27 -03:00
Lucas Fernandes Nogueira
6c13840cee feat(examples): add desktop/web application example (#5537) 2022-11-03 18:01:47 -03:00
Amr Bashir
2d9c2b4724 Revert "fix(core): set correct mimetype for asset protocol streams, closes #5203 (#5210)"
This reverts commit 39443b4350.
2022-11-03 10:00:49 -03:00
Lucas Nogueira
23859f7502 fix(prettier): ignore core/config-schema/schema.json 2022-11-03 09:39:03 -03:00
Lucas Nogueira
ab29908aba chore(cli): remove unneeded create_dir_all call 2022-11-03 09:37:18 -03:00
Lucas Nogueira
873b9aee90 chore: run yarn format 2022-11-03 09:27:43 -03:00
Webber Takken
35264b4c18 docs: fix missing object to read from for listen example (#5505) 2022-10-29 08:56:14 -03:00
Amr Bashir
a178f95d68 feat: config schema generator (#5193)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-10-28 10:44:37 -03:00
Amr Bashir
cc186c7a0e fix(cli): keep dev watcher alive if config is incorrect, closes #5173 (#5495)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-10-27 19:47:50 -03:00
Lucas Fernandes Nogueira
79dd6e16a7 fix(core): properly emit events with object payload, closes #5482 (#5492) 2022-10-27 19:01:37 -03:00
Amr Bashir
9417ce401c fix(cli): apply .taurignore rules to workspace members, closes #5355 (#5460)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-10-27 19:01:28 -03:00
Amr Bashir
7a231cd1c9 fix(cli): detect deno (#5475)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-10-27 19:00:56 -03:00
renovate[bot]
6ca8a056e8 chore(deps) Update Rust crate serde_json to 1.0.87 (#5483)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-26 11:25:11 -03:00
renovate[bot]
e599d92681 chore(deps) Update Tauri API Definitions (#5484)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-26 11:25:00 -03:00
Amr Bashir
a3a70218f3 fix(cli): pass --no-default-features to runner instead of app, closes #5415 (#5474) 2022-10-25 10:26:30 -03:00
Webber Takken
cb6ee77e69 fix(docs): remove parameter from example that's not in the api [skip ci] (#5471)
* Remove parameter from example that's not in the API

* Update filter extensions

Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
2022-10-23 21:46:40 +02:00
Jonas Kruckenberg
5b1e99f264 Fix/hook env vars (#5452)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-10-22 10:33:15 -03:00
Lucas Fernandes Nogueira
e00b1e5f94 fix(core): update metadata before window-created listeners, closes #5191 (#5458) 2022-10-22 10:04:56 -03:00
renovate[bot]
161d5be49a chore(deps) Update dependency eslint-plugin-promise to v6.1.1 (#5444)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-20 10:54:24 -03:00
Lucas Fernandes Nogueira
e7ccbd8573 feat(cli): detect JSON5 and TOML configuration files in the dev watcher (#5439) 2022-10-19 15:37:54 -03:00
Tnze
9076d5d2e7 feat(cli): add prompt information when file changing detected, closes #5417 (#5428)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-10-19 10:24:56 -03:00
renovate[bot]
ef41c5bfd4 chore(deps) Update Tauri API Definitions (#5438)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-19 10:07:23 -03:00
renovate[bot]
0b43033c5c chore(deps) Update dependency eslint-config-standard-with-typescript to v23 (#5187)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-19 10:06:48 -03:00
renovate[bot]
a65b5fea3d chore(deps) Update Rust crate clap to v4 (#5353)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-10-19 10:04:13 -03:00
renovate[bot]
87ebf4e084 chore(deps) Update Tauri JS CLI (#5351)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-19 09:43:15 -03:00
Lucas Nogueira
e37b7677cd chore: update schema.json 2022-10-19 09:40:34 -03:00
renovate[bot]
fc2bac959b chore(deps) Update Tauri API Definitions (#5350)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-19 09:26:46 -03:00
Lucas Fernandes Nogueira
9d8b377481 feat(tauri-runtime-wry): drop the WebContext on WebView drop (#5240) 2022-10-19 09:23:10 -03:00
Caesar Schinas
4137ab44a8 feat(macos): add tabbing_identifier option, closes #2804, #3912 (#5399)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-10-19 09:20:17 -03:00
renovate[bot]
bddf59e5d0 chore(deps) Update Rust crate cargo_toml to 0.13 (#5434)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-19 09:19:14 -03:00
Lucas Nogueira
b713aed21b chore(cli): update Cargo.lock 2022-10-18 09:39:52 -03:00
Lucas Fernandes Nogueira
d23d6f60e8 feat(ci): check if generated files match source (#5422) 2022-10-17 12:09:23 -03:00
Lucas Fernandes Nogueira
357480f4ae feat(core): custom protocol headers on Linux, closes #4496 (#5421) 2022-10-17 12:08:59 -03:00
Lucas Fernandes Nogueira
95f467add5 feat(core): add window accept_first_mouse option, closes #5347 (#5374) 2022-10-17 11:07:45 -03:00
renovate[bot]
b8bf8e0fac chore(deps) Update Rust crate attohttpc to 0.23 (#5392)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-17 11:06:56 -03:00
я котик пур-пур
60bf067913 chore(examples): remove the legacy X-UA-Compatible meta (#5394) 2022-10-17 11:05:31 -03:00
Pedro Luiz Cabral Salomon Prado
49f06ca4b9 fix: deepfreeze check by prop (#5407)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-10-17 10:59:06 -03:00
Lucas Fernandes Nogueira
4036e15f5a feat(core): reimplement window initial focus flag, closes #5120 (#5338) 2022-10-08 16:37:12 -03:00
Kasper
8357ce5b2e Fix dialog.save return type (#5373)
Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
2022-10-08 15:59:13 -03:00
Lucas Nogueira
ecf6a8ad10 chore(deps): set wry to git dev branch 2022-10-08 15:53:38 -03:00
Amr Bashir
208ce34f1e feat: update to wry 0.22 (#5306) 2022-10-08 15:52:25 -03:00
Amr Bashir
4cbdf0fb1c fix(core): escape glob characters in drop/dialogs , closes #5234 (#5237)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-10-04 19:50:29 -03:00
Amr Bashir
f756cd5e7e fix(core): wait for tray cleanup before exiting app, closes #5244 (#5245) 2022-10-04 17:02:54 -03:00
Amr Bashir
a5861d8294 chore: add covector readme (#5255) 2022-10-04 17:02:30 -03:00
Amr Bashir
1129f4f575 refactor: simplify api.js bundling (#4277)
Co-authored-by: Jonas Kruckenberg <iterpre@protonmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-10-04 16:56:35 -03:00
Amr Bashir
d4cac20292 fix(bundler): fix japanese lang code, closes #5342 (#5346) 2022-10-04 13:25:58 -03:00
Amr Bashir
095b18620b fix(cli.js): fix invoking cli from a node shim, closes #5343 (#5345) 2022-10-04 13:25:02 -03:00
Amr Bashir
a4aec9f0a8 feat(cli): expose TAURI_TARGET_TRIPLE to before*Commands, closes #5091 (#5101)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-10-03 16:11:06 -03:00
Kasper
39bf895b73 feat(macOS): Add application show and hide methods (#3689)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-10-03 14:49:59 -03:00
Lucas Fernandes Nogueira
7c0fa1f3f9 fix(bundler): clear env before calling wix, closes #4791 (#4819) 2022-10-03 14:43:34 -03:00
Eric Hagman
a6c94119d8 feat(core): expose user_agent to window config (#5317)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-10-02 10:37:53 -03:00
Kasper
321f3fed19 feat(macos): title_bar_style and hidden_title window options, closes #2663 (#3965)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-30 17:15:45 -03:00
Amr Bashir
39443b4350 fix(core): set correct mimetype for asset protocol streams, closes #5203 (#5210)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-30 15:38:20 -03:00
Amr Bashir
6f41a27124 fix(api.js): fix Monitor initialization, closes #4672 (#5314)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-30 14:39:51 -03:00
Lucas Nogueira
1377f8e13b perf(ci): do not run Rust jobs when the tauri script changes 2022-09-30 14:34:20 -03:00
Tomáš Vojtášek
8f1ace7795 feat: expose set_title for MacOS tray (#5182)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-30 14:08:11 -03:00
Amr Bashir
63011ca84e fix(macos): fix regression in with_menu_on_left_click, closes #5220 (#5235)
Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
2022-09-30 13:16:33 -03:00
Amr Bashir
73d9cd51b2 chore: cleanup readme (#5312) 2022-09-30 13:06:24 -03:00
Lucas Fernandes Nogueira
a06dc69931 fix(core): canonicalize resource dir to fix scope check, closes #5196 (#5218) 2022-09-29 16:33:48 -03:00
Rafael Keramidas
ca3cd8b3d1 fix(api): fs/exists return type previously set to void when it should be boolean (#5252) 2022-09-29 15:55:45 -03:00
Lucas Nogueira
0d3a97ec7b chore(cli): update to tokio 1.21.2 2022-09-29 10:35:44 -03:00
renovate[bot]
04201d43b1 chore(deps) Update Rust crate notify to v5, clap to v4 (#5109)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-29 10:34:50 -03:00
renovate[bot]
d9d430e5a5 chore(deps) Update Tauri API Definitions (#5299)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-29 09:28:29 -03:00
Caesar Schinas
5d89905e39 feat(api): add app-specific directory APIs, closes #5263 (#5272)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-28 19:34:09 -03:00
jabza
eedfa5e618 feat(core): Expose "ignore_cursor_events" to Tauri and API (#5032)
Co-authored-by: Thomas Kilsby <>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-28 16:55:35 -03:00
Lucas Fernandes Nogueira
7d9aa3987e feat: bump MSRV to 1.59 (#5296) 2022-09-28 14:33:35 -03:00
Lucas Fernandes Nogueira
1dd722c4a7 feat(command): add rename_all attribute, closes #4898 (#4903) 2022-09-28 13:52:18 -03:00
renovate[bot]
f98e1b128c chore(deps) Update Tauri API Definitions (#5249)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-28 13:48:06 -03:00
renovate[bot]
82e915c487 chore(deps) Update Rust crate env_logger to 0.9.1 (#5248)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-28 13:47:50 -03:00
Amr Bashir
628285c1cf feat(bundler): add publisher field, closes #5273 (#5283)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-28 13:42:26 -03:00
Amr Bashir
54c337e06f feat(cli): hotreload support for frontend static files, closes #2173 (#5256)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-28 13:16:58 -03:00
renovate[bot]
e8e2853830 chore(deps) Update Rust crate cargo_toml to 0.12 (#5290)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-28 11:44:40 -03:00
Amr Bashir
b9316a64ea fix(cli): validate productName in config, closes #5233 (#5262) 2022-09-28 11:44:14 -03:00
Amr Bashir
ae65951bc4 fix(core): fix deadlock in on_menu_event, closes #5254 (#5257) 2022-09-28 11:36:58 -03:00
Caesar Schinas
08a44490d7 docs: correct path for desktop_dir, closes #5267 (#5268) 2022-09-28 11:36:15 -03:00
renovate[bot]
3baa6ac9b8 chore(deps) Update Rust crate image to 0.24.4 (#5289)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-28 11:11:44 -03:00
Lucas Fernandes Nogueira
aec5537de0 fix(codegen): serialize template tags, closes #4410 (#5247) 2022-09-28 11:10:56 -03:00
Caesar Schinas
4c5a30370c fix(examples): use a less common port in API example, closes #5276 (#5277) 2022-09-28 11:10:12 -03:00
Lucas Nogueira
013fb354d9 docs(path): fix log directory documentation 2022-09-23 20:06:52 -03:00
Amr Bashir
adba73a9ff ci: migrate to the org-level token 2022-09-23 18:00:13 +02:00
Amr Bashir
1d7171a1ec chore: add prettierignore and fmt the repo (#5192)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-18 09:16:35 -03:00
renovate[bot]
ecb489a77c chore(deps) Update Tauri API Definitions (#5184)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-18 09:16:19 -03:00
renovate[bot]
0563fe3d46 chore(deps) Update Tauri Core (#5186)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-18 09:15:33 -03:00
Lucas Fernandes Nogueira
18b17a954c chore(cli): remove unused dependencies (#5219) 2022-09-18 09:07:06 -03:00
Fabian-Lars
60c15750c1 ci: Don't trigger docs update when no packages were published (#5221) 2022-09-18 09:06:50 -03:00
Lucas Nogueira
ee9706d8ae chore: update tauri CHANGELOG.md to include 1.0.6 2022-09-16 18:08:58 -03:00
Lucas Fernandes Nogueira
7950fcb9a8 fix(ci): add inputs to publish-cli-js (#5217) 2022-09-16 16:16:29 -03:00
github-actions[bot]
e4292ce7be apply version updates (#5216) 2022-09-16 14:30:18 -03:00
Amr Bashir
db26aaf2b4 fix: fix wrong cli metadata (#5214)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
2022-09-16 13:54:09 -03:00
Lucas Nogueira
c8445a69ca chore: add cursor allowlist checks in to_features function 2022-09-16 13:33:46 -03:00
Fabian-Lars
c764408da7 fix: Add missing allowlist config for cursor apis, closes #5207 (#5211) 2022-09-16 13:26:27 -03:00
Lucas Nogueira
2954f6d252 fix(cli): wrong metadata 2022-09-15 14:51:42 -03:00
Lucas Nogueira
0967da262e fix(cli.js): revert jest update 2022-09-15 14:36:31 -03:00
Lucas Nogueira
e939e6d9e4 fix(ci): adjust publish-cli-js workflow to only install prod deps 2022-09-15 14:14:59 -03:00
Lucas Nogueira
3ceed62686 chore: add exists function to the changelog 2022-09-15 12:35:05 -03:00
github-actions[bot]
83a6dab7b2 Revert "Apply Version Updates From Current Changes (#5198)"
This reverts commit 9190206387.
2022-09-15 12:34:10 -03:00
github-actions[bot]
9190206387 Apply Version Updates From Current Changes (#5198)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2022-09-15 12:32:51 -03:00
github-actions[bot]
fbdd0a7ca9 Apply Version Updates From Current Changes (#4753)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2022-09-15 12:03:45 -03:00
Fabian-Lars
3c62dbc902 feat(api): Add exists function to the fs module. (#5060)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
2022-09-15 11:28:52 -03:00
Amr Bashir
255ebcb7ef refactor: upload schema to tauri-build release instead of cli (#5197) 2022-09-15 11:27:38 -03:00
Lucas Fernandes Nogueira
447370fa50 chore(deps): update to wry 0.21 (#5181) 2022-09-13 10:56:54 -03:00
Yuyi Wang
9b793eeb68 Remove futures & futures-lite and use futures-util directily. (#5172) 2022-09-12 19:24:57 -03:00
Amr Bashir
5e74aefd4a chore(api.js): add @since tag where appropriate (#5169) 2022-09-12 16:45:57 -03:00
Lucas Nogueira
6b737315b0 fix(api): revert broken @rollup/plugin-node-resolve 2022-09-12 16:41:33 -03:00
renovate[bot]
1c98751da4 chore(deps) Update Rust crate url to 2.3 (#5157)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-10 09:45:32 -03:00
Fabian-Lars
b779e52ba7 docs: Add link to usage example to State docs (#5165) 2022-09-08 15:27:31 -03:00
Fabian-Lars
3fdd287704 fix(cli): fix wrong filename for 256px png icon (#5164) 2022-09-08 15:14:22 -03:00
Amr Bashir
f4121c128e fix(endpoints/fs/readDir): don't read symlinks that are not allowed b… (#5123) 2022-09-08 10:59:05 -03:00
renovate[bot]
5b0b8ef83f chore(deps) Update dependency @rollup/plugin-node-resolve to v14 (#5156)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-07 12:05:19 -03:00
Lucas Fernandes Nogueira
e9412fb983 chore(deps): use less specific version for tokio and once_cell (#5158) 2022-09-07 11:55:21 -03:00
renovate[bot]
83eefccefd chore(deps) Update Rust crate once_cell to 1.14 (#5152)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-07 10:46:15 -03:00
renovate[bot]
cdb5c8e068 chore(deps) Update dependency jest to v29.0.2 (#5151)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-07 10:45:23 -03:00
renovate[bot]
824aec9e40 chore(deps) Update Tauri API Definitions (#5153)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-07 10:45:04 -03:00
renovate[bot]
1d55a5fe1f chore(deps) Update Tauri Core (#5154)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-07 10:44:54 -03:00
Lucas Nogueira
bf5a9ab9e6 chore(cli): update lockfile 2022-09-04 13:49:13 -03:00
Fabian-Lars
12e9d811e6 feat(cli): Add icon command (tauricon) (#4992)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-03 14:37:41 -03:00
Fabian-Lars
0837454b00 fix(api): Remove unused @ts-expect-error (#5131) 2022-09-03 11:56:15 -03:00
Amr Bashir
e6d9b670b0 refactor: remove unneeded focus code (#5065)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-03 11:07:18 -03:00
renovate[bot]
8183153a86 chore(deps) Update dependency eslint-config-standard-with-typescript to v22 (#4603)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-03 09:38:47 -03:00
Lucas Nogueira
5790218fb6 chore: update core/tauri/scripts/bundle.js 2022-09-03 01:05:48 -03:00
Rafael Keramidas
a9381f3b40 refactor(core/api): use constants for events in core, add new enum for core events in api (#5100) 2022-09-03 01:04:55 -03:00
Josh Soref
8fd79b8fc0 Spelling (#4880)
Co-authored-by: Lorenzo Lewis <lorenzo_lewis@icloud.com>
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2022-09-03 01:03:02 -03:00
Akirami
14f337d8ad docs(updater): fix configure missing required key (#5058)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
2022-09-03 00:47:33 -03:00
renovate[bot]
4cd8507ea0 chore(deps) Update dependency jest to v29 (#5110)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-09-02 20:57:46 -03:00
dependabot[bot]
89af335156 chore(deps-dev): bump vite from 2.9.12 to 2.9.13 in /examples/api (#5103)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-02 20:57:37 -03:00
renovate[bot]
bca796be2f chore(deps) Update Tauri API Definitions (#5108)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-02 20:57:17 -03:00
Lucas Nogueira
0668dd4220 fix(tauri-runtime-wry): ignore events on unknown windows 2022-08-29 14:23:11 -03:00
Lucas Fernandes Nogueira
b9fb53ed73 docs(cli): clarify passing arguments to the application on tauri dev closes #5079 (#5086) 2022-08-29 09:31:21 -03:00
Lucas Nogueira
ef8ca7b363 fix(ci): actually use MSRV toolchain 2022-08-28 23:04:19 -03:00
Lucas Nogueira
d88de30076 fix(ci): checkout repo in udeps.yml 2022-08-28 17:52:40 -03:00
Lucas Nogueira
1629c5ad27 fix(ci): set target on test-core.yml 2022-08-28 17:50:05 -03:00
Lucas Fernandes Nogueira
8a380fc4e3 feat(ci): test core on MSRV (#5077) 2022-08-28 16:26:32 -03:00
Lucas Fernandes Nogueira
2901145c49 chore: update license headers (#5067) 2022-08-28 15:13:21 -03:00
Olivier Lemasle
38449bc57d chore: update links from tauri.studio to tauri.app (#5069) 2022-08-27 16:18:16 -03:00
Lucas Fernandes Nogueira
8f6ab87fb4 feat(cli): package license files (#5066) 2022-08-27 10:10:05 -03:00
renovate[bot]
cf6f0c511b chore(deps) Update Tauri API Definitions to v5.35.1 (#5034)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-26 09:24:34 -03:00
Akirami
bd51cddd6f docs(updater): fix server missing required key (#5050) 2022-08-26 09:23:59 -03:00
Jonas Kruckenberg
4fa968dc0e fix(api): add async mockIPC() handler signature (#5056) 2022-08-26 13:12:24 +02:00
Amr Bashir
e9f1e627f8 feat: upload tauri config schema to cli github release (#5038) 2022-08-25 10:09:46 -03:00
renovate[bot]
ab5a307bc1 chore(deps) Update Tauri API Definitions (#5018)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-24 12:40:50 -03:00
renovate[bot]
238fdc9563 chore(deps) Update Tauri JS CLI (#5019)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-24 12:40:40 -03:00
Mateo Gallardo
d35cc77831 docs(clipboard): Added allowlist section to the Clipboard module (#5014) 2022-08-23 13:54:32 -03:00
Amr Bashir
169682219a covector: reduce cargo audit/publish noise in release notes (#5011) 2022-08-23 12:04:28 -03:00
Lucas Nogueira
4ac8006efd feat(tauri-build): rerun-if-changed Info.plist 2022-08-23 10:47:41 -03:00
Dave Lage
02a2ec52f1 fix: Grammar in signer generate (#5004) 2022-08-22 18:12:41 -03:00
Lucas Nogueira
28a1ec34a4 fix(tauri-runtime-wry): only emit global tray event if tray was found 2022-08-21 17:53:09 -03:00
Lucas Fernandes Nogueira
436f3d8d66 feat(cli): load Cargo configuration to check default build target (#4990) 2022-08-21 17:48:28 -03:00
Lucas Nogueira
fa44c44379 fix(tauri-runtime-wry): trigger global tray event listeners 2022-08-21 17:44:13 -03:00
Fabian-Lars
fea70effad refactor(cli): Use cargo metadata to detect the workspace root and target directory, closes #4632, #4928. (#4932) 2022-08-21 10:42:26 -03:00
renovate[bot]
e16b366174 chore(deps) Update Tauri API Definitions (#4960)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-20 10:25:34 -03:00
dependabot[bot]
9ac6135c2a chore(deps): bump undici from 5.8.0 to 5.9.1 in /examples/api (#4976)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-20 10:25:07 -03:00
renovate[bot]
8bf0f66c06 chore(deps) Update dependency @napi-rs/cli to v2.11.4 (#4961)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-20 10:24:36 -03:00
Angelo Huang
9bbc30590b chore: add missing closing tag in a comment (#4958) 2022-08-17 00:22:24 +02:00
Lucas Fernandes Nogueira
c53d9ea1b3 refactor(cli): prepare for mobile implementation (#4952) 2022-08-16 10:13:14 -03:00
Lucas Nogueira
e4d5022077 perf(ci): adjust test-core.yml paths 2022-08-16 10:06:01 -03:00
Amr Bashir
725236cea0 refactor: enhance api demo app mobile experience (#4929)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-08-14 18:39:35 -03:00
Lucas Nogueira
d2572050be chore(examples): remove mobile code from API example 2022-08-14 17:54:26 -03:00
Amr Bashir
20a7036ba5 Revert "fix(core): avoid conflict with user-defined cmd arg in invoke, closes #4875 (#4892)" (#4924)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-08-12 20:34:17 -03:00
Lucas Fernandes Nogueira
6ba99689aa feat(codegen): use TARGET environment variable if set (#4921) 2022-08-12 19:11:33 -03:00
Amr Bashir
8958e9fdb5 docs: fix bullet point alignment in js api (#4922) 2022-08-12 19:08:18 -03:00
Lucas Nogueira
6119f4582e chore(examples): update API dist 2022-08-11 09:55:49 -03:00
Lucas Fernandes Nogueira
ff8fd7619a fix(tauri-build): rerun if assets or icons change (#4910) 2022-08-10 16:32:52 -03:00
Lucas Nogueira
0e925fd8f0 feat(examples): prepare API example for mobile 2022-08-10 16:30:07 -03:00
Lucas Fernandes Nogueira
64546cb9cc refactor: use RefCell instead of Mutex for windows map, closes #4870 (#4909) 2022-08-10 15:36:01 -03:00
Lucas Nogueira
96885b6e5a chore(cli): remove unused encode_unicode dependency 2022-08-10 08:46:01 -03:00
renovate[bot]
9e48da502f chore(deps) Update Rust crate attohttpc to 0.22 (#4906)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-10 08:39:11 -03:00
renovate[bot]
3951aac930 chore(deps) Update Tauri JS CLI (#4905)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-10 08:38:55 -03:00
renovate[bot]
e86c9df9f0 chore(deps) Update Tauri API Definitions to v22.0.2 (#4904)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-10 08:38:39 -03:00
Lucas Fernandes Nogueira
4d063ae9ee feat(core): create system tray at runtime, closes #2278 (#4862) 2022-08-09 14:43:51 -03:00
Lucas Nogueira
fd992c547e fix(core): before_bundle_command kebab-case alias 2022-08-09 14:17:11 -03:00
Lucas Nogueira
e602432ef6 chore(ci): run udeps on push to dev 2022-08-09 14:00:57 -03:00
Lucas Fernandes Nogueira
698a31aa79 feat(ci): improve udeps check performance (#4900) 2022-08-09 14:00:12 -03:00
Amr Bashir
57ab9847eb feat(cli): add beforeBundleCommand, closes #4879 (#4893)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-08-09 12:54:44 -03:00
Lorenzo Lewis
4c24d10ff3 Update path.ts (#4895) 2022-08-09 11:36:50 -03:00
Amr Bashir
5813f08386 ci: publish cli.js *.node modules to the existing cli.js release (#4883) 2022-08-09 11:36:21 -03:00
Lucas Nogueira
08584fc657 fix(codegen): adapt for iOS build 2022-08-09 09:16:39 -03:00
Amr Bashir
4e8b122df6 refactor(cli/core/bundler): use absolute path for msiexec and powershell (#4884) 2022-08-08 18:59:59 -03:00
Lucas Fernandes Nogueira
ed581950ea fix(tauri-build): use ::tauri as root for the CodegenContext (#4894) 2022-08-08 16:33:48 -03:00
Brian Li
f957cbb56c fix(codegen): write output file when contents change (#4889) 2022-08-08 16:07:05 -03:00
Amr Bashir
5109c27501 fix(core): avoid conflict with user-defined cmd arg in invoke, closes #4875 (#4892) 2022-08-08 15:51:56 -03:00
Lucas Fernandes Nogueira
d88b9de7aa feat(core): add fips_compliant wix config option, closes #4541 (#4843) 2022-08-04 14:58:26 -03:00
Lucas Nogueira
1caf485fce perf(ci): do not run artifacts-updater on PRs except on example update 2022-08-04 14:56:02 -03:00
Kilian Gosewisch
3b44b01412 Fix typo (#4854) 2022-08-04 14:05:35 -03:00
renovate[bot]
49f9334e19 chore(deps) Update Tauri API Definitions (#4844)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-04 14:05:17 -03:00
renovate[bot]
3be8c238cc chore(deps) Update Rust crate os_info to 3.5 (#4845)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-04 14:05:01 -03:00
renovate[bot]
e59407f2bd chore(deps) Update Rust crate serde_json to 1.0.83 (#4855)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-04 14:04:46 -03:00
Lucas Fernandes Nogueira
58fc1f2150 fix(updater): blank icon after update on macOS, closes #4613 (#4861) 2022-08-04 14:04:37 -03:00
Paul Soporan
f7d2dfc7a6 chore: add libc field to node packages (#4856) 2022-08-04 01:04:24 -03:00
Lucas Fernandes Nogueira
964926ff85 feat(core): enhance SystemTray::with_icon (#4849) 2022-08-03 11:39:16 -03:00
Lucas Fernandes Nogueira
52f0c8bb83 feat(core): improve tray icon read error messages (#4850) 2022-08-03 11:38:43 -03:00
Lucas Fernandes Nogueira
fa23310f23 fix(cli): set MACOSX_DEPLOYMENT_TARGET env var, closes #4704 (#4842) 2022-08-02 19:54:31 -03:00
Lucas Fernandes Nogueira
dcd506676c fix(core): parse inner CLI subcommands, closes #4688 (#4841) 2022-08-02 19:49:01 -03:00
Lucas Fernandes Nogueira
d6f7d3cfe8 Add cwd option to before commands, add wait option to dev #4740 #3551 (#4834) 2022-08-02 18:54:50 -03:00
Lucas Fernandes Nogueira
90d5929fea feat(cli.rs): add support to cargo-binstall, closes #4651 (#4817) 2022-08-02 18:54:40 -03:00
Lucas Fernandes Nogueira
f21cbecdeb feat(core): implement theme APIs for Linux (#4808) 2022-08-02 18:54:14 -03:00
Lucas Fernandes Nogueira
331f346002 feat(core): add option to use vendored openssl, closes #4470 (#4809) 2022-08-02 18:54:05 -03:00
Lucas Fernandes Nogueira
e6012b88af docs(core): enhance initialization_script documentation, ref #4831 (#4832) 2022-08-02 18:53:55 -03:00
Lucas Fernandes Nogueira
9f1d34c288 feat: implement From<Command> for std::process::Command, closes #4673 (#4836) 2022-08-02 18:53:48 -03:00
Lucas Fernandes Nogueira
5c5c42edb6 feat(build): use modern dialog styles on Windows, closes #4709 (#4840) 2022-08-02 18:53:34 -03:00
Lucas Nogueira
75d3d677ae chore(examples): update window-vibrancy and window-shadows 2022-08-02 18:32:15 -03:00
Lucas Fernandes Nogueira
ae83d008f9 feat: add support to TOML config file Tauri.toml, closes #4806 (#4813) 2022-08-02 14:12:26 -03:00
Lucas Fernandes Nogueira
c04d0340e2 feat(core): prepare build for mobile targets (#4830)
Co-authored-by: Yu-Wei Wu <wusyong9104@gmail.com>
2022-08-02 11:25:28 -03:00
Lucas Fernandes Nogueira
5cc1fd0f7b feat(tauri-build): validate sidecar name, closes #4780 closes #4823 (#4814) 2022-08-02 10:37:16 -03:00
Lucas Fernandes Nogueira
d576e8ae72 feat(core): do not follow redirects if max_redirects is 0 closes #4795 (#4812) 2022-07-31 20:00:48 -03:00
Lucas Fernandes Nogueira
ba5560b2a1 feat(core): implement max_redirections for attohttpc, ref #4795 (#4811) 2022-07-31 19:12:34 -03:00
Amr Bashir
0ad9531d79 chore(deps): update tao to 0.13, wry to 0.20, rfd to 0.10, raw-window-handle to 0.5 (#4804) 2022-07-31 10:41:49 -03:00
Lucas Fernandes Nogueira
0983d7ce7f feat(cli): add --no-watch argument to the dev command, closes #4617 (#4793) 2022-07-29 18:34:43 -03:00
Brian Li
024620529e fix(bundler): cache appimage bundle tools (#4790)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
2022-07-29 18:34:12 -03:00
Lucas Fernandes Nogueira
596fa08d48 feat(cli): automatically use .taurignore, ref #4617 (#4623) 2022-07-28 18:58:38 -03:00
renovate[bot]
77e48ab7db chore(deps) Update dependency rollup to v2.77.2 (#4781)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-27 18:24:08 -03:00
horochx
d8cf9f9fcd Command support for specified character encoding, closes #4644 (#4772)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-07-27 18:23:27 -03:00
Lucas Fernandes Nogueira
433dafa01a feat: add docker images for cross (#4702) 2022-07-27 14:58:43 -03:00
renovate[bot]
810b3be080 chore(deps) Update Tauri API Definitions (#4776)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-27 14:54:08 -03:00
renovate[bot]
77f4a7173b chore(deps) Update dependency @napi-rs/cli to v2.10.3 (#4778)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-27 14:53:49 -03:00
@RubenKelevra
08deda5f99 Fix: issue template rendering poorly 'platform and version' response (#4648)
* Issue template change rendering of 'platform and version'

The previously used 'shell' is for shellscript, not for console output with commands. 'console' does render much more nicely text output and commands.

* remove `tauri info` render

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-07-26 17:31:45 -03:00
Danil Karpenko
aa9f1243e6 Improved EventEmitter for tauri api shell (#4697)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-07-25 19:35:35 -03:00
Lucas Nogueira
f7ea867d31 fix(core): clear env args on restart test 2022-07-25 19:17:32 -03:00
Lucas Nogueira
816f474c3e fix(cli): only try to read updater private key if we've bundled it 2022-07-25 14:04:52 -03:00
Lucas Fernandes Nogueira
47fab6809a fix(cli): dev watcher incorrectly killing process on multiple file write (#4684) 2022-07-25 13:51:04 -03:00
renovate[bot]
e903dfe762 chore(deps) Update Tauri API Definitions (#4660)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-25 12:46:50 -03:00
renovate[bot]
b47d8c88c5 chore(deps) Update Rust crate ureq to 2.5 (#4661)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-25 12:46:19 -03:00
renovate[bot]
9b7caab672 chore(deps) Update dependency jest to v28.1.3 (#4666)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-25 12:46:08 -03:00
Lorenzo Lewis
2adef93faf Update readme badges (#4696) 2022-07-25 12:03:18 -03:00
Jonas Kruckenberg
c7fec3e1ff fix typo in state.rs (#4699) 2022-07-25 11:54:10 -03:00
renovate[bot]
fd4c851ee9 chore(deps) Update Rust crate image to 0.24.3 (#4716)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-25 11:05:45 -03:00
renovate[bot]
d2b6351157 chore(deps) Update Rust crate serde_with to v2 (#4719)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-25 11:01:20 -03:00
dependabot[bot]
c2c1e6f081 chore(deps): bump terser from 5.7.0 to 5.14.2 in /tooling/api (#4718)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-25 11:00:43 -03:00
dependabot[bot]
38604a111e chore(deps): bump undici from 5.5.1 to 5.8.0 in /examples/api (#4731)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-25 11:00:02 -03:00
dependabot[bot]
5785aeb806 chore(deps-dev): bump svelte from 3.48.0 to 3.49.0 in /examples/api (#4686)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-25 10:59:54 -03:00
Lucas Fernandes Nogueira
6218c31e17 fix(core): retain command line arguments on restart, closes #4760 (#4763) 2022-07-25 10:59:24 -03:00
Amr Bashir
6d4945c9f0 feat(cli): prompt for before*Command, closes #4691 (#4721)
* feat(cli): prompt for before*Command, closes #4691

* fix default command

* add allow_empty argument

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-07-25 10:59:08 -03:00
Lucas Fernandes Nogueira
b2a8930b3c feat(cli): validate updater private key when signing (#4754) 2022-07-25 10:58:25 -03:00
Axel Lindeberg
b48962ed15 fix(cli): don't warn on first dev server connection attempt (#4751)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
2022-07-24 09:41:37 -03:00
shniubobo
accbc5e880 fix(codegen): fix relative paths in version field of tauri.config.json, closes #4723 (#4725) 2022-07-24 09:41:14 -03:00
669 changed files with 56417 additions and 18313 deletions

2
.cargo/config.toml Normal file
View File

@@ -0,0 +1,2 @@
[env]
__TAURI_WORKSPACE__ = "true"

View File

@@ -1,14 +1,24 @@
{
"gitSiteUrl": "https://www.github.com/tauri-apps/tauri/",
"timeout": 3600000,
"changeTags": {
"feat": "New Features",
"enhance": "Enhancements",
"bug": "Bug Fixes",
"pref": "Performance Improvements",
"changes": "What's Changed",
"sec": "Security fixes",
"deps": "Dependencies",
"breaking": "Breaking Changes"
},
"defaultChangeTag": "changes",
"pkgManagers": {
"rust": {
"errorOnVersionRange": "^2.0.0-0",
"version": true,
"getPublishedVersion": "cargo search ${ pkgFile.pkg.package.name } --limit 1 | sed -nE \"s/^[^\\\"]*\\\"//; s/\\\".*//1p\"",
"getPublishedVersion": "node ../../.scripts/covector/package-latest-version.js cargo ${ pkgFile.pkg.package.name } ${ pkgFile.pkg.package.version }",
"prepublish": [
"sudo apt-get update",
"sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf",
"sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev",
"cargo install cargo-audit --features=fix",
{
"command": "cargo generate-lockfile",
@@ -17,12 +27,7 @@
"pipe": true
},
{
"command": "echo \"# Cargo Audit\"",
"dryRunCommand": true,
"pipe": true
},
{
"command": "echo '```'",
"command": "echo '<details>\n<summary><em><h4>Cargo Audit</h4></em></summary>\n\n```'",
"dryRunCommand": true,
"pipe": true
},
@@ -33,7 +38,7 @@
"pipe": true
},
{
"command": "echo '```'",
"command": "echo '```\n\n</details>\n'",
"dryRunCommand": true,
"pipe": true
}
@@ -45,12 +50,7 @@
"dryRunCommand": true
},
{
"command": "echo \"# Cargo Publish\"",
"dryRunCommand": true,
"pipe": true
},
{
"command": "echo '```'",
"command": "echo '<details>\n<summary><em><h4>Cargo Publish</h4></em></summary>\n\n```'",
"dryRunCommand": true,
"pipe": true
},
@@ -60,7 +60,7 @@
"pipe": true
},
{
"command": "echo '```'",
"command": "echo '```\n\n</details>\n'",
"dryRunCommand": true,
"pipe": true
}
@@ -72,7 +72,7 @@
],
"assets": [
{
"path": "${ pkg.path }/target/package/${ pkg.pkg }-${ pkgFile.version }.crate",
"path": "./target/package/${ pkg.pkg }-${ pkgFile.version }.crate",
"name": "${ pkg.pkg }-${ pkgFile.version }.crate"
}
]
@@ -80,19 +80,14 @@
"javascript": {
"errorOnVersionRange": "^2.0.0-0",
"version": true,
"getPublishedVersion": "npm view ${ pkgFile.pkg.name } version",
"getPublishedVersion": "node ../../.scripts/covector/package-latest-version.js npm ${ pkgFile.pkg.name } ${ pkgFile.pkg.version }",
"prepublish": [
{
"command": "yarn",
"dryRunCommand": true
},
{
"command": "echo \"# Yarn Audit\n\"",
"dryRunCommand": true,
"pipe": true
},
{
"command": "echo '<details>\n<summary>click to view</summary>\n\n```'",
"command": "echo '<details>\n<summary><em><h4>Yarn Audit</h4></em></summary>\n\n```'",
"dryRunCommand": true,
"pipe": true
},
@@ -115,12 +110,7 @@
"publish": [
"sleep 15s",
{
"command": "echo \"# Yarn Package Publish\"",
"dryRunCommand": true,
"pipe": true
},
{
"command": "echo '```'",
"command": "echo '<details>\n<summary><em><h4>Yarn Publish</h4></em></summary>\n\n```'",
"dryRunCommand": true,
"pipe": true
},
@@ -130,7 +120,7 @@
"pipe": true
},
{
"command": "echo '```'",
"command": "echo '```\n\n</details>\n'",
"dryRunCommand": true,
"pipe": true
}
@@ -143,13 +133,13 @@
}
},
"packages": {
"api": {
"@tauri-apps/api": {
"path": "./tooling/api",
"manager": "javascript",
"assets": [
{
"path": "./tooling/api/dist/tauri-apps-api-${ pkgFile.version }.tgz",
"name": "api-${ pkgFile.version }.tgz"
"name": "tauri-apps-api-${ pkgFile.version }.tgz"
}
],
"prepublish": [
@@ -158,12 +148,7 @@
"dryRunCommand": true
},
{
"command": "echo \"# Yarn Audit\n\"",
"dryRunCommand": true,
"pipe": true
},
{
"command": "echo '<details>\n<summary>click to view</summary>\n\n```'",
"command": "echo '<details>\n<summary><em><h4>Yarn Audit</h4></em></summary>\n\n```'",
"dryRunCommand": true,
"pipe": true
},
@@ -185,12 +170,7 @@
],
"publish": [
{
"command": "echo \"# Yarn Package Publish\"",
"dryRunCommand": true,
"pipe": true
},
{
"command": "echo '```'",
"command": "echo '<details>\n<summary><em><h4>Yarn Publish</h4></em></summary>\n\n```'",
"dryRunCommand": true,
"pipe": true
},
@@ -200,7 +180,7 @@
"pipe": true
},
{
"command": "echo '```'",
"command": "echo '```\n\n</details>\n'",
"dryRunCommand": true,
"pipe": true
}
@@ -239,7 +219,16 @@
"path": "./core/tauri-build",
"manager": "rust",
"dependencies": ["tauri-codegen", "tauri-utils"],
"postversion": "node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }"
"postversion": [
"node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
"cargo build --manifest-path ../tauri-config-schema/Cargo.toml"
],
"assets": [
{
"path": "./tooling/cli/schema.json",
"name": "schema.json"
}
]
},
"tauri": {
"path": "./core/tauri",
@@ -252,20 +241,27 @@
],
"postversion": "node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }"
},
"cli.js": {
"@tauri-apps/cli": {
"path": "./tooling/cli/node",
"manager": "javascript",
"dependencies": ["cli.rs"],
"postversion": "node ../../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
"getPublishedVersion": "node ../../../.scripts/covector/package-latest-version.js npm ${ pkgFile.pkg.name } ${ pkgFile.pkg.version }",
"dependencies": ["tauri-cli"],
"postversion": [
"node ../../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
"cargo build --manifest-path ../../../core/tauri-config-schema/Cargo.toml"
],
"prepublish": [],
"publish": [],
"postpublish": []
},
"cli.rs": {
"tauri-cli": {
"path": "./tooling/cli",
"manager": "rust",
"dependencies": ["tauri-bundler", "tauri-utils"],
"postversion": "cargo check",
"postversion": [
"cargo check",
"cargo build --manifest-path ../../core/tauri-config-schema/Cargo.toml"
],
"assets": [
{
"path": "${ pkg.path }/target/package/tauri-cli-${ pkgFile.version }.crate",
@@ -275,7 +271,8 @@
},
"tauri-driver": {
"path": "./tooling/webdriver",
"manager": "rust"
"manager": "rust",
"postversion": "cargo check"
}
}
}

44
.changes/readme.md Normal file
View File

@@ -0,0 +1,44 @@
# Changes
##### via https://github.com/jbolda/covector
As you create PRs and make changes that require a version bump, please add a new markdown file in this folder. You do not note the version _number_, but rather the type of bump that you expect: major, minor, or patch. The filename is not important, as long as it is a `.md`, but we recommend that it represents the overall change for organizational purposes.
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.
Use the following format:
```md
---
'package-a': patch
'package-b': patch
---
Change summary goes here
```
Summaries do not have a specific character limit, but are text only. These summaries are used within the (future implementation of) changelogs. They will give context to the change and also point back to the original PR if more details and context are needed.
Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/).
Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards compatible manner, and
- PATCH version when you make backwards compatible bug fixes.
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format, but will be discussed prior to usage (as extra steps will be necessary in consideration of merging and publishing).
Additionally you could specify a tag for the change file to group it with other changes by prefixing the bump with `:<tag>`, for example:
```md
---
'package-a': patch:bug
---
Change summary goes here
```
which will group this change file with other changes that specify the `bug` tag.
For list of available tags, see the `changeTags` key in [./config.json](./config.json)

View File

@@ -5,7 +5,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
# Derived from Tauri contribution and setup guides:
# See: https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md#development-guide
# See: https://tauri.studio/v1/guides/getting-started/prerequisites/#setting-up-linux
# See: https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-linux
ARG TAURI_BUILD_DEPS="build-essential curl libappindicator3-dev libgtk-3-dev librsvg2-dev libssl-dev libwebkit2gtk-4.0-dev wget"
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \

View File

@@ -24,7 +24,7 @@ Prerequisites are mainly derived from VS Code's instructions for usage of develo
### A note on filesystem performance
Due to limititations in how Docker shares files between the Docker host and a container, it's also recommended that developers [clone Tauri source code into a container volume](https://code.visualstudio.com/remote/advancedcontainers/improve-performance#_use-clone-repository-in-container-volume). This is optional, but highly advised as many filesystem/IO heavy opearations (`cargo build`, `yarn install`, etc) will be very slow if they operate on directories shared with a Docker container from the Docker host.
Due to limitations in how Docker shares files between the Docker host and a container, it's also recommended that developers [clone Tauri source code into a container volume](https://code.visualstudio.com/remote/advancedcontainers/improve-performance#_use-clone-repository-in-container-volume). This is optional, but highly advised as many filesystem/IO heavy operations (`cargo build`, `yarn install`, etc) will be very slow if they operate on directories shared with a Docker container from the Docker host.
To do this, open your project with VS Code and run **Remote-Containers: Clone Repository in Container Volume...** from the Command Palette (<kbd>F1</kbd>).

View File

@@ -0,0 +1,44 @@
FROM ubuntu:18.04
ARG DEBIAN_FRONTEND=noninteractive
COPY common.sh lib.sh /
RUN /common.sh
COPY cmake.sh /
RUN /cmake.sh
COPY xargo.sh /
RUN /xargo.sh
RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
g++-aarch64-linux-gnu \
libc6-dev-arm64-cross
COPY deny-debian-packages.sh /
RUN TARGET_ARCH=arm64 /deny-debian-packages.sh \
binutils \
binutils-aarch64-linux-gnu
COPY qemu.sh /
RUN /qemu.sh aarch64 softmmu
COPY dropbear.sh /
RUN /dropbear.sh
COPY linux-image.sh /
RUN /linux-image.sh aarch64
COPY linux-runner /
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="/linux-runner aarch64" \
CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc \
CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ \
BINDGEN_EXTRA_CLANG_ARGS_aarch64_unknown_linux_gnu="--sysroot=/usr/aarch64-linux-gnu" \
QEMU_LD_PREFIX=/usr/aarch64-linux-gnu \
RUST_TEST_THREADS=1 \
PKG_CONFIG_PATH="/usr/lib/aarch64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}"
RUN dpkg --add-architecture arm64
RUN apt-get update
RUN apt-get install --assume-yes --no-install-recommends libssl-dev:arm64 libdbus-1-dev:arm64 libsoup2.4-dev:arm64 libssl-dev:arm64 libgtk-3-dev:arm64 webkit2gtk-4.0-dev:arm64 libappindicator3-1:arm64 librsvg2-dev:arm64 patchelf:arm64

31
.docker/cross/cmake.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -x
set -euo pipefail
# shellcheck disable=SC1091
. lib.sh
main() {
local version=3.23.1
install_packages curl
local td
td="$(mktemp -d)"
pushd "${td}"
curl --retry 3 -sSfL "https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-linux-x86_64.sh" -o cmake.sh
sh cmake.sh --skip-license --prefix=/usr/local
popd
purge_packages
rm -rf "${td}"
rm -rf /var/lib/apt/lists/*
rm "${0}"
}
main "${@}"

40
.docker/cross/common.sh Executable file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/env bash
set -x
set -euo pipefail
# shellcheck disable=SC1091
. lib.sh
# For architectures except amd64 and i386, look for packages on ports.ubuntu.com instead.
# This is important if you enable additional architectures so you can install libraries to cross-compile against.
# Look for 'dpkg --add-architecture' in the README for more details.
if grep -i ubuntu /etc/os-release >/dev/null; then
sed 's/http:\/\/\(.*\).ubuntu.com\/ubuntu\//[arch-=amd64,i386] http:\/\/ports.ubuntu.com\/ubuntu-ports\//g' /etc/apt/sources.list > /etc/apt/sources.list.d/ports.list
sed -i 's/http:\/\/\(.*\).ubuntu.com\/ubuntu\//[arch=amd64,i386] http:\/\/\1.archive.ubuntu.com\/ubuntu\//g' /etc/apt/sources.list
fi
install_packages \
autoconf \
automake \
binutils \
ca-certificates \
curl \
file \
gcc \
git \
libtool \
m4 \
make
if_centos install_packages \
clang-devel \
gcc-c++ \
glibc-devel \
pkgconfig
if_ubuntu install_packages \
g++ \
libc6-dev \
libclang-dev \
pkg-config

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -x
set -euo pipefail
main() {
local package
for package in "${@}"; do
echo "Package: ${package}:${TARGET_ARCH}
Pin: release *
Pin-Priority: -1" > "/etc/apt/preferences.d/${package}"
echo "${package}"
done
rm "${0}"
}
main "${@}"

56
.docker/cross/dropbear.sh Executable file
View File

@@ -0,0 +1,56 @@
#!/usr/bin/env bash
set -x
set -euo pipefail
# shellcheck disable=SC1091
. lib.sh
main() {
local version=2022.82
install_packages \
autoconf \
automake \
bzip2 \
curl \
make
if_centos install_packages zlib-devel
if_ubuntu install_packages zlib1g-dev
local td
td="$(mktemp -d)"
pushd "${td}"
curl --retry 3 -sSfL "https://matt.ucc.asn.au/dropbear/releases/dropbear-${version}.tar.bz2" -O
tar --strip-components=1 -xjf "dropbear-${version}.tar.bz2"
# Remove some unwanted message
sed -i '/skipping hostkey/d' cli-kex.c
sed -i '/failed to identify current user/d' cli-runopts.c
./configure \
--disable-syslog \
--disable-shadow \
--disable-lastlog \
--disable-utmp \
--disable-utmpx \
--disable-wtmp \
--disable-wtmpx \
--disable-pututline \
--disable-pututxline
make "-j$(nproc)" PROGRAMS=dbclient
cp dbclient /usr/local/bin/
purge_packages
popd
rm -rf "${td}"
rm "${0}"
}
main "${@}"

45
.docker/cross/lib.sh Normal file
View File

@@ -0,0 +1,45 @@
purge_list=()
install_packages() {
if grep -i ubuntu /etc/os-release; then
apt-get update
for pkg in "${@}"; do
if ! dpkg -L "${pkg}" >/dev/null 2>/dev/null; then
apt-get install --assume-yes --no-install-recommends "${pkg}"
purge_list+=( "${pkg}" )
fi
done
else
for pkg in "${@}"; do
if ! yum list installed "${pkg}" >/dev/null 2>/dev/null; then
yum install -y "${pkg}"
purge_list+=( "${pkg}" )
fi
done
fi
}
purge_packages() {
if (( ${#purge_list[@]} )); then
if grep -i ubuntu /etc/os-release; then
apt-get purge --assume-yes --auto-remove "${purge_list[@]}"
else
yum remove -y "${purge_list[@]}"
fi
fi
}
if_centos() {
if grep -q -i centos /etc/os-release; then
eval "${@}"
fi
}
if_ubuntu() {
if grep -q -i ubuntu /etc/os-release; then
eval "${@}"
fi
}

274
.docker/cross/linux-image.sh Executable file
View File

@@ -0,0 +1,274 @@
#!/usr/bin/env bash
set -x
set -euo pipefail
# shellcheck disable=SC1091
. lib.sh
main() {
# arch in the rust target
local arch="${1}" \
kversion=4.19.0-20
local debsource="deb http://http.debian.net/debian/ buster main"
debsource="${debsource}\ndeb http://security.debian.org/ buster/updates main"
local dropbear="dropbear-bin"
local -a deps
local kernel=
local libgcc="libgcc1"
# select debian arch and kernel version
case "${arch}" in
aarch64)
arch=arm64
kernel="${kversion}-arm64"
;;
armv7)
arch=armhf
kernel="${kversion}-armmp"
;;
i686)
arch=i386
kernel="${kversion}-686"
;;
mips|mipsel)
kernel="${kversion}-4kc-malta"
;;
mips64el)
kernel="${kversion}-5kc-malta"
;;
powerpc)
# there is no buster powerpc port, so we use jessie
# use a more recent kernel from backports
kversion='4.9.0-0.bpo.6'
kernel="${kversion}-powerpc"
debsource="deb http://archive.debian.org/debian jessie main"
debsource="${debsource}\ndeb http://archive.debian.org/debian jessie-backports main"
debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unstable main"
debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unreleased main"
# archive.debian.org Release files are expired.
echo "Acquire::Check-Valid-Until false;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid
echo "APT::Get::AllowUnauthenticated true;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid
dropbear="dropbear"
deps=(libcrypt1:"${arch}")
;;
powerpc64)
# there is no stable port
arch=ppc64
# https://packages.debian.org/en/sid/linux-image-powerpc64
kversion='5.*'
kernel="${kversion}-powerpc64"
libgcc="libgcc-s1"
debsource="deb http://ftp.ports.debian.org/debian-ports unstable main"
debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unreleased main"
# sid version of dropbear requires these dependencies
deps=(libcrypt1:"${arch}")
;;
powerpc64le)
arch=ppc64el
kernel="${kversion}-powerpc64le"
;;
s390x)
arch=s390x
kernel="${kversion}-s390x"
;;
sparc64)
# there is no stable port
# https://packages.debian.org/en/sid/linux-image-sparc64
kernel='*-sparc64'
libgcc="libgcc-s1"
debsource="deb http://ftp.ports.debian.org/debian-ports unstable main"
debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unreleased main"
# sid version of dropbear requires these dependencies
deps=(libcrypt1:"${arch}")
;;
x86_64)
arch=amd64
kernel="${kversion}-amd64"
;;
*)
echo "Invalid arch: ${arch}"
exit 1
;;
esac
install_packages ca-certificates \
curl \
cpio \
sharutils \
gnupg
# Download packages
mv /etc/apt/sources.list /etc/apt/sources.list.bak
echo -e "${debsource}" > /etc/apt/sources.list
# Old ubuntu does not support --add-architecture, so we directly change multiarch file
if [ -f /etc/dpkg/dpkg.cfg.d/multiarch ]; then
cp /etc/dpkg/dpkg.cfg.d/multiarch /etc/dpkg/dpkg.cfg.d/multiarch.bak
fi
dpkg --add-architecture "${arch}" || echo "foreign-architecture ${arch}" > /etc/dpkg/dpkg.cfg.d/multiarch
# Add Debian keys.
curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{7.0,8,9,10}.asc' -O
curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{8,9,10}-security.asc' -O
curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/release-{7,8,9,10}.asc' -O
curl --retry 3 -sSfL 'https://www.ports.debian.org/archive_{2020,2021,2022}.key' -O
for key in *.asc *.key; do
apt-key add "${key}"
rm "${key}"
done
# allow apt-get to retry downloads
echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries
apt-get update
mkdir -p "/qemu/${arch}"
chmod 777 /qemu "/qemu/${arch}"
cd "/qemu/${arch}"
apt-get -d --no-install-recommends download \
${deps[@]+"${deps[@]}"} \
"busybox:${arch}" \
"${dropbear}:${arch}" \
"libtommath1:${arch}" \
"libtomcrypt1:${arch}" \
"libgmp10:${arch}" \
"libc6:${arch}" \
"${libgcc}:${arch}" \
"libstdc++6:${arch}" \
"linux-image-${kernel}:${arch}" \
ncurses-base \
"zlib1g:${arch}"
cd /qemu
# Install packages
root="root-${arch}"
mkdir -p "${root}"/{bin,etc/dropbear,root,sys,dev,proc,sbin,tmp,usr/{bin,sbin},var/log}
for deb in "${arch}"/*deb; do
dpkg -x "${deb}" "${root}"/
done
cp "${root}/boot/vmlinu"* kernel
# initrd
mkdir -p "${root}/modules"
cp -v \
"${root}/lib/modules"/*/kernel/drivers/net/net_failover.ko \
"${root}/lib/modules"/*/kernel/drivers/net/virtio_net.ko \
"${root}/lib/modules"/*/kernel/drivers/virtio/* \
"${root}/lib/modules"/*/kernel/fs/netfs/netfs.ko \
"${root}/lib/modules"/*/kernel/fs/9p/9p.ko \
"${root}/lib/modules"/*/kernel/fs/fscache/fscache.ko \
"${root}/lib/modules"/*/kernel/net/9p/9pnet.ko \
"${root}/lib/modules"/*/kernel/net/9p/9pnet_virtio.ko \
"${root}/lib/modules"/*/kernel/net/core/failover.ko \
"${root}/modules" || true # some file may not exist
rm -rf "${root:?}/boot"
rm -rf "${root:?}/lib/modules"
cat << 'EOF' > "${root}/etc/hosts"
127.0.0.1 localhost qemu
EOF
cat << 'EOF' > $root/etc/hostname
qemu
EOF
cat << 'EOF' > $root/etc/passwd
root::0:0:root:/root:/bin/sh
EOF
cat << 'EOF' | uudecode -o $root/etc/dropbear/dropbear_rsa_host_key
begin 600 dropbear_rsa_host_key
M````!W-S:"UR<V$````#`0`!```!`0"N!-<%K,3Z.!Z,OEMB2.N\O.$IWQ*F
M#5%(_;(^2YKY_J_.RQW/7U@_MK&J#!Z0_\;EH#98ZW*E1\.<FF%P/*Y.W56-
M31.'EJE`TN@=T5EC(8"Y%3'ZBYH)^WIVJ]S*G/_;#RH\_?S"U^1L_<<.F`O+
MZVI?*]\KTDOT&QV0#B-M;"%_7:\>+3[X=QMH,B<HM$+0E[\B6*^!XKLR@V,K
M)<V80HHK:_#;D]26XKN&CB./EZAC%4)78R!G""4HT@UK<5I4B^$/""`,?*\T
M>*4$RYULV,V3X6]K:7@Q?80"#WXGGQZNFN6CZ7LTDX(F6J[\]F5<0`HEOF:Z
MX;^53`L'4I/A```!``$L:$Z*#6<^3@+O%.[-#/5H+.C'3\#QQZN[1;J>L`8I
MZ_&T'!"J'/Y+?R?55G:M^=]R*-&I3TOJYZA8@&H51ZOAF59'1_>>Z@?E4#)$
MQU)X/RWH51ZB5KSDWJS:D'7GD(!?NAY`C'7\)I:_4)J")QBV/P"RJQGHG'%B
M1BT2LE6676>`1K,0\NIMZTKQNB(IC+88<7#8%_-=P<&6<"9LH>60TSS?3?-C
MN`T36YB/3^<(Q;`N1NT>I9EZS`BAC^-?.:,R\7EL"<4>7E=]^1]B\K9])AQU
MBM\]M;4V(S(6KH-I.4[6>9E+@\UEM.J6:[2LUEEJDG:G:+:/EVF^Y75@(S$`
M``"!`.O+KW=&*CBCHL"11&SVO4/K]$R-]7MV7,3RR)Q[X'0;6.?4JHW!3VR6
M*FGBY--37ZD-+UV.8_+"$<?B"#&K$.[V)F7V2\UY!7(0FZ@A2`0ADDY*J-_B
M4AU&.*GP#F/!I([:?E],.>6PH9)(/E.\G19#G0K`LRM?JWS!58&;D0C1````
M@0"\[@NYWSTW(?Q@:_A*1Y3/AKYO5?S=0"<2>#V-AH6W-NCSDTSRP=2D79FS
M"D?[;.)V>8'#9&I3"MU@+:2\Z%$0-MG0+J'(0>T1_C6?*C=4U0I$DI<=@D]1
H_&DE8Y(OT%%EPG]!$H&5HX*),_D1A2\P=R.7G'`0L%YM-79Y"T">$0``
`
end
EOF
# dropbear complains when this file is missing
touch "${root}/var/log/lastlog"
cat << 'EOF' > $root/init
#!/bin/busybox sh
set -e
/bin/busybox --install
mount -t devtmpfs devtmpfs /dev
mount -t proc none /proc
mount -t sysfs none /sys
mkdir /dev/pts
mount -t devpts none /dev/pts/
# some archs does not have virtio modules
insmod /modules/failover.ko || true
insmod /modules/net_failover.ko || true
insmod /modules/virtio.ko || true
insmod /modules/virtio_ring.ko || true
insmod /modules/virtio_mmio.ko || true
insmod /modules/virtio_pci_legacy_dev.ko || true
insmod /modules/virtio_pci_modern_dev.ko || true
insmod /modules/virtio_pci.ko || true
insmod /modules/virtio_net.ko || true
insmod /modules/netfs.ko || true
insmod /modules/fscache.ko
insmod /modules/9pnet.ko
insmod /modules/9pnet_virtio.ko || true
insmod /modules/9p.ko
ifconfig lo 127.0.0.1
ifconfig eth0 10.0.2.15
route add default gw 10.0.2.2 eth0
mkdir /target
mount -t 9p -o trans=virtio target /target -oversion=9p2000.u || true
exec dropbear -F -E -B
EOF
chmod +x "${root}/init"
cd "${root}"
find . | cpio --create --format='newc' --quiet | gzip > ../initrd.gz
cd -
# Clean up
rm -rf "/qemu/${root}" "/qemu/${arch}"
mv -f /etc/apt/sources.list.bak /etc/apt/sources.list
if [ -f /etc/dpkg/dpkg.cfg.d/multiarch.bak ]; then
mv /etc/dpkg/dpkg.cfg.d/multiarch.bak /etc/dpkg/dpkg.cfg.d/multiarch
fi
# can fail if arch is used (amd64 and/or i386)
dpkg --remove-architecture "${arch}" || true
apt-get update
purge_packages
ls -lh /qemu
}
main "${@}"

173
.docker/cross/linux-runner Executable file
View File

@@ -0,0 +1,173 @@
#!/usr/bin/env bash
set -e
LOG=/tmp/qemu.log
LOCK=/tmp/qemu.lock
if [ -n "${CROSS_DEBUG}" ]; then
set -x
fi
# arch in the rust target
arch="${1}"
shift
if [ "${CROSS_RUNNER}" = "" ]; then
if [[ "${arch}" == i?86 ]] || [[ "${arch}" == x86_64 ]]; then
CROSS_RUNNER=native
else
CROSS_RUNNER=qemu-user
fi
fi
# select qemu arch
qarch="${arch}"
case "${arch}" in
armv7)
qarch="arm"
;;
i686)
qarch="i386"
;;
powerpc)
qarch="ppc"
;;
powerpc64)
qarch="ppc64"
;;
powerpc64le)
if [ "${CROSS_RUNNER}" = "qemu-user" ]; then
qarch="ppc64le"
else
qarch="ppc64"
fi
;;
esac
case "${CROSS_RUNNER}" in
native)
exec "${@}"
;;
qemu-user)
exec "qemu-${qarch}" "${@}"
;;
qemu-system)
true
;;
*)
echo "Invalid runner: \"${CROSS_RUNNER}\"";
echo "Valid runners are: native, qemu-user and qemu-system"
exit 1
;;
esac
n="$(nproc)"
memory=1G
driver9p="virtio-9p-pci"
drivernet="virtio-net-pci"
# select qemu parameters
case "${arch}" in
aarch64)
# 8 is the max number of cpu supported by qemu-aarch64
n=$(( n > 8 ? 8 : n ))
opt="-machine virt -cpu cortex-a57"
;;
armv7)
opt="-machine virt"
driver9p="virtio-9p-device"
drivernet="virtio-net-device"
;;
i686)
opt="-append console=ttyS0"
;;
mips|mipsel)
# avoid kernel error
# https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/
opt="-append nokaslr"
n=1
;;
mips64el)
# avoid kernel error
# https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/
opt="-append nokaslr -cpu MIPS64R2-generic"
n=1
;;
powerpc)
opt="-append console=ttyPZ0"
n=1
;;
powerpc64|powerpc64le)
opt="-append console=hvc0 --nodefaults -serial stdio"
;;
s390x)
n=1
driver9p="virtio-9p-ccw"
drivernet="virtio-net-ccw"
;;
sparc64)
n=1
driver9p+=",bus=pciB"
drivernet+=",bus=pciB"
;;
x86_64)
opt="-append console=ttyS0"
;;
esac
(
flock -n 200 || exit 0
echo Booting QEMU virtual machine with $n cpus...
QEMU_CMD="qemu-system-${qarch} \
-m ${memory} \
-smp ${n} \
-nographic \
-monitor none \
-netdev user,id=net0,hostfwd=tcp::10022-:22 \
-device ${drivernet},netdev=net0 \
-kernel /qemu/kernel \
-initrd /qemu/initrd.gz \
${opt} \
-fsdev local,id=fs0,path=/target,security_model=mapped \
-device ${driver9p},fsdev=fs0,mount_tag=target"
touch "${LOG}"
if [[ -n "${CROSS_DEBUG}" ]]; then
(${QEMU_CMD} 2>&1 | tee -a "${LOG}") &
else
${QEMU_CMD} >> "${LOG}" 2>&1 &
fi
# wait for dropbear
for _ in $(seq 240); do
if grep -q "Not backgrounding" "${LOG}"; then
READY=1
break
fi
sleep 0.5s
done
if [ -z "${READY}" ]; then
if [ -n "${CROSS_DEBUG}" ]; then
echo "Not ready but continuing because CROSS_DEBUG is set"
else
echo "Qemu is not ready after ${SECONDS} seconds..."
echo "Set the environment variable CROSS_DEBUG=1 to debug"
echo "Last 100 lines of qemu output:"
tail -n 100 "${LOG}"
exit 1
fi
fi
echo "Booted in ${SECONDS} seconds"
) 200>"${LOCK}"
if [[ -t 1 ]] && [[ -t 2 ]]; then
tty_flag='-t'
fi
exec dbclient ${tty_flag} -p 10022 -y -y root@localhost "${@}"

233
.docker/cross/qemu.sh Executable file
View File

@@ -0,0 +1,233 @@
#!/usr/bin/env bash
set -x
set -euo pipefail
# shellcheck disable=SC1091
. lib.sh
build_static_libffi () {
local version=3.0.13
local td
td="$(mktemp -d)"
pushd "${td}"
curl --retry 3 -sSfL "https://github.com/libffi/libffi/archive/refs/tags/v${version}.tar.gz" -O -L
tar --strip-components=1 -xzf "v${version}.tar.gz"
./configure --prefix="$td"/lib --disable-builddir --disable-shared --enable-static
make "-j$(nproc)"
install -m 644 ./.libs/libffi.a /usr/lib64/
popd
rm -rf "${td}"
}
build_static_libmount () {
local version_spec=2.23.2
local version=2.23
local td
td="$(mktemp -d)"
pushd "${td}"
curl --retry 3 -sSfL "https://kernel.org/pub/linux/utils/util-linux/v${version}/util-linux-${version_spec}.tar.xz" -O -L
tar --strip-components=1 -xJf "util-linux-${version_spec}.tar.xz"
./configure --disable-shared --enable-static --without-ncurses
make "-j$(nproc)" mount blkid
install -m 644 ./.libs/*.a /usr/lib64/
popd
rm -rf "${td}"
}
build_static_libattr() {
local version=2.4.46
local td
td="$(mktemp -d)"
pushd "${td}"
yum install -y gettext
curl --retry 3 -sSfL "https://download.savannah.nongnu.org/releases/attr/attr-${version}.src.tar.gz" -O
tar --strip-components=1 -xzf "attr-${version}.src.tar.gz"
cp /usr/share/automake*/config.* .
./configure
make "-j$(nproc)"
install -m 644 ./libattr/.libs/libattr.a /usr/lib64/
yum remove -y gettext
popd
rm -rf "${td}"
}
build_static_libcap() {
local version=2.22
local td
td="$(mktemp -d)"
pushd "${td}"
curl --retry 3 -sSfL "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-${version}.tar.xz" -O
tar --strip-components=1 -xJf "libcap-${version}.tar.xz"
make "-j$(nproc)"
install -m 644 libcap/libcap.a /usr/lib64/
popd
rm -rf "${td}"
}
build_static_pixman() {
local version=0.34.0
local td
td="$(mktemp -d)"
pushd "${td}"
curl --retry 3 -sSfL "https://www.cairographics.org/releases/pixman-${version}.tar.gz" -O
tar --strip-components=1 -xzf "pixman-${version}.tar.gz"
./configure
make "-j$(nproc)"
install -m 644 ./pixman/.libs/libpixman-1.a /usr/lib64/
popd
rm -rf "${td}"
}
main() {
local version=5.1.0
if_centos version=4.2.1
local arch="${1}" \
softmmu="${2:-}"
install_packages \
autoconf \
automake \
bison \
bzip2 \
curl \
flex \
libtool \
make \
patch \
python3 \
if_centos install_packages \
gcc-c++ \
pkgconfig \
xz \
glib2-devel \
glib2-static \
glibc-static \
libattr-devel \
libcap-devel \
libfdt-devel \
pcre-static \
pixman-devel \
libselinux-devel \
libselinux-static \
libffi \
libuuid-devel \
libblkid-devel \
libmount-devel \
zlib-devel \
zlib-static
if_centos 'curl --retry 3 -sSfL "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" -o /usr/share/automake*/config.guess'
if_centos 'curl --retry 3 -sSfL "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" -o /usr/share/automake*/config.sub'
# these are not packaged as static libraries in centos; build them manually
if_centos build_static_libffi
if_centos build_static_libmount
if_centos build_static_libattr
if_centos build_static_libcap
if_centos build_static_pixman
if_ubuntu install_packages \
g++ \
pkg-config \
xz-utils \
libattr1-dev \
libcap-ng-dev \
libffi-dev \
libglib2.0-dev \
libpixman-1-dev \
libselinux1-dev \
zlib1g-dev
# if we have python3.6+, we can install qemu 6.1.0, which needs ninja-build
# ubuntu 16.04 only provides python3.5, so remove when we have a newer qemu.
is_ge_python36=$(python3 -c "import sys; print(int(sys.version_info >= (3, 6)))")
if [[ "${is_ge_python36}" == "1" ]]; then
if_ubuntu version=6.1.0
if_ubuntu install_packages ninja-build
fi
local td
td="$(mktemp -d)"
pushd "${td}"
curl --retry 3 -sSfL "https://download.qemu.org/qemu-${version}.tar.xz" -O
tar --strip-components=1 -xJf "qemu-${version}.tar.xz"
local targets="${arch}-linux-user"
local virtfs=""
case "${softmmu}" in
softmmu)
if [ "${arch}" = "ppc64le" ]; then
targets="${targets},ppc64-softmmu"
else
targets="${targets},${arch}-softmmu"
fi
virtfs="--enable-virtfs"
;;
"")
true
;;
*)
echo "Invalid softmmu option: ${softmmu}"
exit 1
;;
esac
./configure \
--disable-kvm \
--disable-vnc \
--disable-guest-agent \
--enable-linux-user \
--static \
${virtfs} \
--target-list="${targets}"
make "-j$(nproc)"
make install
# HACK the binfmt_misc interpreter we'll use expects the QEMU binary to be
# in /usr/bin. Create an appropriate symlink
ln -s "/usr/local/bin/qemu-${arch}" "/usr/bin/qemu-${arch}-static"
purge_packages
popd
rm -rf "${td}"
rm "${0}"
}
main "${@}"

28
.docker/cross/xargo.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -x
set -euo pipefail
# shellcheck disable=SC1091
. lib.sh
main() {
install_packages ca-certificates curl
export RUSTUP_HOME=/tmp/rustup
export CARGO_HOME=/tmp/cargo
curl --retry 3 -sSfL https://sh.rustup.rs -o rustup-init.sh
sh rustup-init.sh -y --no-modify-path --profile minimal
rm rustup-init.sh
PATH="${CARGO_HOME}/bin:${PATH}" cargo install xargo --root /usr/local
rm -r "${RUSTUP_HOME}" "${CARGO_HOME}"
purge_packages
rm "${0}"
}
main "${@}"

View File

@@ -61,7 +61,7 @@ representative at an online or offline event.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[contact@tauri.studio](mailto:contact@tauri.studio).
[contact@tauri.app](mailto:contact@tauri.app).
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the

View File

@@ -48,26 +48,26 @@ Hi! We, the maintainers, are really excited that you are interested in contribut
First, [join our Discord server](https://discord.gg/SpmNs4S) and let us know that you want to contribute. This way we can point you in the right direction and help ensure your contribution will be as helpful as possible.
To set up your machine for development, follow the [Tauri setup guide](https://tauri.studio/guides/getting-started/prerequisites/) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [Yarn](https://yarnpkg.com/), it is only required if you are developing the Node CLI or API packages (`tooling/cli/node` and `tooling/api`). Next, fork and clone this repo. It is structured as a monorepo, which means that all the various Tauri packages are under the same repository. The development process varies depending on what part of Tauri you are contributing to, see the guides below for per-package instructions.
To set up your machine for development, follow the [Tauri setup guide](https://tauri.app/v1/guides/getting-started/prerequisites/) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [Yarn](https://yarnpkg.com/), it is only required if you are developing the Node CLI or API packages (`tooling/cli/node` and `tooling/api`). Next, fork and clone this repo. It is structured as a monorepo, which means that all the various Tauri packages are under the same repository. The development process varies depending on what part of Tauri you are contributing to, see the guides below for per-package instructions.
Some Tauri packages will be automatically built when running one of the examples. Others, however, will need to be built beforehand. To build these automatically, run the `.scripts/setup.sh` (Linux and macOS) or `.scripts/setup.ps1` (Windows) script. This will install the Rust and Node.js CLI and build the JS API. After that, you should be able to run all the examples. Note that the setup script should be executed from the root folder of the respository in order to run correctly.
Some Tauri packages will be automatically built when running one of the examples. Others, however, will need to be built beforehand. To build these automatically, run the `.scripts/setup.sh` (Linux and macOS) or `.scripts/setup.ps1` (Windows) script. This will install the Rust and Node.js CLI and build the JS API. After that, you should be able to run all the examples. Note that the setup script should be executed from the root folder of the repository in order to run correctly.
### Packages Overview
- The JS API (`/tooling/api`) contains JS bindings to the builtin Rust functions in the Rust API.
- cli.rs (`/tooling/cli`) is the primary CLI for creating and developing Tauri apps.
- cli.js (`/tooling/cli/node`) is a Node.js CLI wrapper for `cli.rs`.
- Tauri Bundler (`/tooling/bundler`) is used by the Rust CLI to package executables into installers.
- Tauri Core (`/core/tauri`) is the heart of Tauri. It contains the code that starts the app, configures communication between Rust and the Webview, and ties all the other packages together.
- The Macros (`/core/tauri-macros`) are used by Tauri Core for various functions.
### Developing The Node.js CLI (cli.js)
`cli.js` is a wrapper to `cli.rs` so most changes should be written on the Rust CLI. The `[Tauri repo root]/tooling/cli/node` folder contains only packaging scripts to properly publish the Rust CLI binaries to NPM.
- Tauri Bundler (`/tooling/bundler`) is used by the Rust CLI to package executables into installers.
- The Rust CLI aka `tauri-cli` (`/tooling/cli`) is the primary CLI for creating and developing Tauri apps.
- The JS CLI aka `@tauri-apps/cli` (`/tooling/cli/node`) is a Node.js CLI wrapper for `tauri-cli`.
- The JS API aka `@tauri-apps/api` (`/tooling/api`) contains JS bindings to the builtin Rust functions in the Rust API.
### Developing Tauri Bundler and Rust CLI
The code for the bundler is located in `[Tauri repo root]/tooling/bundler`, and the code for the Rust CLI is located in `[Tauri repo root]/tooling/cli`. If you are using your local copy of cli.js (see above), any changes you make to the bundler and CLI will be automatically built and applied when running the build or dev command. Otherwise, running `cargo install --path .` in the Rust CLI directory will allow you to run `cargo tauri build` and `cargo tauri dev` anywhere, using the updated copy of the bundler and cli. You will have to run this command each time you make a change in either package.
The code for the bundler is located in `[Tauri repo root]/tooling/bundler`, and the code for the Rust CLI is located in `[Tauri repo root]/tooling/cli`. If you are using your local copy of `@tauri-apps/cli` (see above), any changes you make to the bundler and CLI will be automatically built and applied when running the build or dev command. Otherwise, running `cargo install --path .` in the Rust CLI directory will allow you to run `cargo tauri build` and `cargo tauri dev` anywhere, using the updated copy of the bundler and cli. You will have to run this command each time you make a change in either package.
### Developing The Node.js CLI (`@tauri-apps/cli`)
`@tauri-apps/cli` is a wrapper to `tauri-cli` so most changes should be written on the Rust CLI. The `[Tauri repo root]/tooling/cli/node` folder contains only packaging scripts to properly publish the Rust CLI binaries to NPM.
### Developing Tauri Core and Related Components (Rust API, Macros, Codegen, and Utils)
@@ -87,4 +87,4 @@ The JS API provides bindings between the developer's JS in the Webview and the b
## Financial Contribution
Tauri is an MIT-licensed open source project. Its ongoing development can be supported via [Github Sponsors](https://github.com/sponsors/nothingismagick) or [Open Collective](https://opencollective.com/tauri). We prefer Github Sponsors as donations made are doubled through the matching fund program.
Tauri is an MIT-licensed open source project. Its ongoing development can be supported via [GitHub Sponsors](https://github.com/sponsors/nothingismagick) or [Open Collective](https://opencollective.com/tauri). We prefer GitHub Sponsors as donations made are doubled through the matching fund program.

6
.github/FUNDING.yml vendored
View File

@@ -1,6 +1,10 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
# These are supported funding model platforms
github: nothingismagick
github: tauri-apps
patreon: #
open_collective: tauri
ko_fi: # Replace with a single Ko-fi username

View File

@@ -1,3 +1,7 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: 🐞 Bug Report
title: '[bug] '
description: Report a bug
@@ -26,11 +30,10 @@ body:
id: reproduction
attributes:
label: Reproduction
description: Steps to reproduce the behavior.
description: A link to a reproduction repo or steps to reproduce the behaviour.
placeholder: |
1. Go to ...
2. Click on ...
3. See error
Please provide a minimal reproduction or steps to reproduce, see this guide https://stackoverflow.com/help/minimal-reproducible-example
Why reproduction is required? see this article https://antfu.me/posts/why-reproductions-are-required
- type: textarea
id: expected-behavior
@@ -43,7 +46,7 @@ body:
attributes:
label: Platform and versions
description: "Output of `npm run tauri info` or `cargo tauri info`"
render: shell
render: text
validations:
required: true
@@ -51,8 +54,8 @@ body:
id: logs
attributes:
label: Stack trace
render: shell
render: text
- type: textarea
id: context
attributes:

View File

@@ -1,3 +1,7 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
contact_links:
- name: 💬 Discord Chat
url: https://discord.com/invite/tauri

View File

@@ -1,3 +1,7 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: 💡 Feature Request
title: '[feat] '
description: Suggest an idea

View File

@@ -1,30 +1,21 @@
<!--
Update "[ ]" to "[x]" to check a box
Before submitting a PR, please read https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
Please make sure to read the Pull Request Guidelines: https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
1. Give the PR a descriptive title.
Examples of good title:
- fix(windows): fix race condition in event loop
- docs: update docstrings
- feat: add `Window::set_fullscreen`
Examples of bad title:
- fix #7123
- update docs
- fix bugs
2. If there is a related issue, reference it in the PR text, e.g. closes #123.
3. If this change requires a new version, then add a change file in `.changes` directory with the appropriate bump, see https://github.com/tauri-apps/tauri/blob/dev/.changes/readme.md
4. Ensure that all your commits are signed https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
5. Ensure `cargo test` and `cargo clippy` passes.
6. Propose your changes as a draft PR if your work is still in progress.
-->
### What kind of change does this PR introduce?
<!-- Check at least one. If you are introducing a new binding, you must reference an issue where this binding has been proposed, discussed and approved by the maintainers. -->
- [ ] Bugfix
- [ ] Feature
- [ ] Docs
- [ ] New Binding issue #___
- [ ] Code style update
- [ ] Refactor
- [ ] Build-related changes
- [ ] Other, please describe:
### Does this PR introduce a breaking change?
<!-- If yes, please describe the impact and migration path for existing applications in an attached issue. -->
- [ ] Yes, and the changes were approved in issue #___
- [ ] No
### Checklist
- [ ] When resolving issues, they are referenced in the PR's title (e.g `fix: remove a typo, closes #___, #___`)
- [ ] A change file is added if any packages will require a version bump due to this PR per [the instructions in the readme](https://github.com/tauri-apps/tauri/blob/dev/.changes/readme.md).
- [ ] I have added a convincing reason for adding this feature, if necessary
### Other information

3
.github/config.yml vendored
View File

@@ -0,0 +1,3 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

View File

@@ -1,4 +1,4 @@
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
@@ -10,6 +10,7 @@ on:
- cron: '0 0 * * *'
push:
paths:
- '.github/workflows/audit.yml'
- '**/Cargo.lock'
- '**/Cargo.toml'
- '**/package.json'
@@ -33,6 +34,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: yarn audit
- name: audit workspace
run: yarn audit
- name: audit @tauri-apps/api
working-directory: tooling/api
run: yarn audit
- name: audit @tauri-apps/cli
working-directory: tooling/cli/node
run: yarn audit

View File

@@ -1,16 +1,20 @@
name: benches
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: bench
on:
push:
branches:
- dev
- next
- 1.x
workflow_dispatch:
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
LC_ALL: en_US.UTF-8 # This prevents strace from changing it's number format to use commas.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -23,7 +27,7 @@ jobs:
matrix:
rust: [nightly]
platform:
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
- { target: x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
runs-on: ${{ matrix.platform.os }}
@@ -34,72 +38,30 @@ jobs:
with:
toolchain: ${{ matrix.rust }}
override: true
default: true
components: rust-src
target: ${{ matrix.platform.target }}
- name: setup python
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.10'
architecture: x64
- name: install depedencies
- name: install dependencies
run: |
python -m pip install --upgrade pip
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf xvfb
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev xvfb
wget https://github.com/sharkdp/hyperfine/releases/download/v1.11.0/hyperfine_1.11.0_amd64.deb
sudo dpkg -i hyperfine_1.11.0_amd64.deb
pip install memory_profiler
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Cache cargo state
uses: actions/cache@v2
env:
cache-name: cargo_state
- uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
- name: Cache core cargo target
uses: actions/cache@v2
env:
cache-name: cargo_core
with:
path: target
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-
${{ matrix.platform }}-${{ matrix.rust }}-
${{ matrix.platform }}-
- name: cache cargo `tooling/bench/tests` target
uses: actions/cache@v2
env:
cache-name: cargo_benches
with:
path: tooling/bench/tests/target
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-${{ hashFiles('tooling/bench/tests/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-${{ hashFiles('tooling/bench/tests/Cargo.lock') }}
${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-
${{ matrix.platform }}-${{ matrix.rust }}-
${{ matrix.platform }}-
workspaces: |
core -> ../target
tooling/bench/tests
- name: run benchmarks
run: |
@@ -126,7 +88,7 @@ jobs:
git commit --message "Update Tauri benchmarks"
git push origin gh-pages
- name: Worker info
- name: Print worker info
run: |
cat /proc/cpuinfo
cat /proc/meminfo

32
.github/workflows/check-change-tags.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: check change tags
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@v3
- uses: dorny/paths-filter@v2
id: filter
with:
list-files: shell
filters: |
changes:
- added|modified: '.changes/*.md'
- name: check
run: node ./.scripts/ci/check-change-tags.js ${{ steps.filter.outputs.changes_files }}
if: ${{ steps.filter.outputs.changes == 'true' }}

View File

@@ -0,0 +1,83 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: check generated files
on:
pull_request:
paths:
- '.github/workflows/check-generated-files.yml'
- 'tooling/api/src/**'
- 'core/tauri/scripts/bundle.global.js'
- 'core/tauri-utils/src/config.rs'
- 'tooling/cli/schema.json'
- 'core/tauri-config-schema/schema.json'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
outputs:
api: ${{ steps.filter.outputs.api }}
schema: ${{ steps.filter.outputs.schema }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
api:
- 'tooling/api/src/**'
- 'core/tauri/scripts/bundle.global.js'
schema:
- 'core/tauri-utils/src/config.rs'
- 'tooling/cli/schema.json'
- 'core/tauri-config-schema/schema.json'
api:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.api == 'true'
steps:
- uses: actions/checkout@v3
- name: build api
working-directory: tooling/api
run: yarn && yarn build
- name: check api
run: ./.scripts/ci/has-diff.sh
schema:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.schema == 'true'
steps:
- uses: actions/checkout@v3
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
- uses: Swatinem/rust-cache@v2
with:
workspaces: core -> ../target
- name: generate schema.json
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./core/tauri-config-schema/Cargo.toml
- name: check schema
run: ./.scripts/ci/has-diff.sh

View File

@@ -0,0 +1,28 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: check license headers
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
list-files: shell
filters: |
added:
- added: '**'
- name: check header license on new files
if: ${{ steps.filter.outputs.added == 'true' }}
run: node ./.scripts/ci/check-license-header.js ${{ steps.filter.outputs.added_files }}

View File

@@ -1,4 +1,4 @@
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

View File

@@ -0,0 +1,242 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: covector version or publish
on:
push:
branches:
- 1.x
- v1/msrv-check
jobs:
msrv-list:
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- {
target: x86_64-pc-windows-msvc,
os: windows-latest,
toolchain: '1.61.0'
}
- {
target: x86_64-unknown-linux-gnu,
os: ubuntu-latest,
toolchain: '1.60.0'
}
- {
target: x86_64-apple-darwin,
os: macos-13,
toolchain: '1.60.0'
}
steps:
- uses: actions/checkout@v4
- name: install rust ${{ matrix.platform.toolchain }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.platform.toolchain }}
target: ${{ matrix.platform.target }}
override: true
default: true
- name: install Linux dependencies
if: contains(matrix.platform.target, 'unknown-linux')
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
- uses: Swatinem/rust-cache@v2
- name: delete lockfile
run: rm Cargo.lock
- name: Downgrade crates with MSRV conflict
# The --precise flag can only be used once per invocation.
run: |
cargo update -p system-deps:6.2.2 --precise 6.1.1
cargo update -p toml:0.7.8 --precise 0.7.3
cargo update -p toml_edit:0.19.15 --precise 0.19.8
cargo update -p embed-resource --precise 2.3.0
cargo update -p notify-rust --precise 4.10.0
cargo update -p toml_datetime --precise 0.6.1
cargo update -p serde_spanned --precise 0.6.1
cargo update -p winnow --precise 0.4.1
cargo update -p plist --precise 1.5.1
cargo update -p serde_with:3.8.2 --precise 3.0.0
cargo update -p time --precise 0.3.15
cargo update -p ignore --precise 0.4.18
cargo update -p raw-window-handle --precise 0.5.0
cargo update -p cargo_toml:0.15.3 --precise 0.15.2
cargo update -p zbus --precise 3.13.0
cargo update -p zbus_names --precise 2.5.0
cargo update -p colored --precise 2.0.2
cargo update -p arboard --precise 3.2.1
cargo update -p tempfile --precise 3.6.0
cargo update -p tokio --precise 1.29.0
cargo update -p flate2 --precise 1.0.26
cargo update -p hyper --precise 0.14.28
cargo update -p h2 --precise 0.3.20
cargo update -p reqwest --precise 0.11.18
cargo update -p bstr --precise 1.6.2
cargo update -p cfg-expr:0.15.8 --precise 0.15.4
cargo update -p memchr --precise 2.6.2
cargo update -p async-executor --precise 1.5.1
cargo update -p proptest --precise 1.2.0
cargo update -p regex --precise 1.9.6
cargo update -p bstr --precise 1.6.2
cargo update -p backtrace --precise 0.3.68
cargo update -p blocking --precise 1.4.1
cargo update -p ignore --precise 0.4.18
cargo update -p globset --precise 0.4.13
cargo update -p crossbeam-channel --precise 0.5.8
cargo update -p crossbeam-utils --precise 0.8.16
cargo update -p image --precise 0.24.4
cargo update -p async-process --precise 1.7.0
cargo update -p is-terminal --precise 0.4.7
cargo update -p tar --precise 0.4.39
cargo update -p serde_json --precise 1.0.97
cargo update -p petgraph --precise 0.6.3
cargo update -p os_str_bytes --precise 6.5.1
cargo update -p thread_local --precise 1.1.7
cargo update -p cc --precise 1.0.94
cargo update -p home --precise 0.5.5
cargo update -p tree_magic_mini --precise 3.0.3
cargo update -p tokio-test --precise 0.4.3
cargo update -p tokio-stream --precise 0.1.14
cargo update -p tokio-util --precise 0.7.10
cargo update -p os_pipe --precise 1.1.5
cargo update -p syn:2.0.68 --precise 2.0.67
cargo update -p derive_more --precise 0.99.17
cargo update -p native-tls --precise 0.2.11
- name: test build
run: cargo check --target ${{ matrix.platform.target }} --features tracing,compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart,test
run-integration-tests:
runs-on: ${{ matrix.platform }}
needs: msrv-list
if: github.ref == 'refs/heads/1.x'
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-13, windows-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev libfuse2
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
core -> ../target
tooling/cli
- name: build CLI
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./tooling/cli/Cargo.toml
- name: run integration tests
run: cargo test --test '*' -- --ignored
- name: run CLI tests
timeout-minutes: 30
run: |
cd ./tooling/cli/node
yarn
yarn build
yarn test
version-or-publish:
runs-on: ubuntu-latest
timeout-minutes: 65
outputs:
change: ${{ steps.covector.outputs.change }}
commandRan: ${{ steps.covector.outputs.commandRan }}
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
needs:
- run-integration-tests
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
cache: yarn
cache-dependency-path: tooling/*/yarn.lock
- name: cargo login
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
- name: git config
run: |
git config --global user.name "${{ github.event.pusher.name }}"
git config --global user.email "${{ github.event.pusher.email }}"
- name: covector version or publish (publish when no change files present)
uses: jbolda/covector/packages/action@covector-v0
id: covector
env:
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: 'version-or-publish'
createRelease: true
- name: Create Pull Request With Versions Bumped
if: steps.covector.outputs.commandRan == 'version'
uses: tauri-apps/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: release/version-updates-v1
title: Apply Version Updates From Current Changes (v1)
commit-message: 'apply version updates'
labels: 'version updates'
body: ${{ steps.covector.outputs.change }}
- name: Trigger doc update
if: |
steps.covector.outputs.successfulPublish == 'true' &&
steps.covector.outputs.packagesPublished != ''
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
repository: tauri-apps/tauri-docs
event-type: update-docs
- name: Trigger `@tauri-apps/cli` publishing workflow
if: |
steps.covector.outputs.successfulPublish == 'true' &&
contains(steps.covector.outputs.packagesPublished, '@tauri-apps/cli')
uses: peter-evans/repository-dispatch@v1
with:
event-type: publish-js-cli
client-payload: >-
{"releaseId": "${{ steps.covector.outputs['-tauri-apps-cli-releaseId'] }}" }
- name: Trigger `tauri-cli` publishing workflow
if: |
steps.covector.outputs.successfulPublish == 'true' &&
contains(steps.covector.outputs.packagesPublished, 'tauri-cli')
uses: peter-evans/repository-dispatch@v1
with:
event-type: publish-clirs

View File

@@ -1,8 +1,8 @@
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: version or publish
name: covector version or publish
on:
push:
@@ -16,8 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# platform: [ubuntu-latest, macos-latest, windows-latest]
platform: [ubuntu-latest, macos-latest]
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
@@ -31,61 +30,13 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev libfuse2
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
- name: Get current date
if: matrix.platform == 'windows-latest'
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache cargo state
uses: actions/cache@v2
env:
cache-name: cargo_state
- uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
- name: Cache core cargo target
uses: actions/cache@v2
env:
cache-name: cargo_core
with:
path: target
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
- name: Cache CLI cargo target
uses: actions/cache@v2
env:
cache-name: cargo_cli
with:
path: tooling/cli/target
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
workspaces: |
core -> ../target
tooling/cli
- name: build CLI
uses: actions-rs/cargo@v1
@@ -120,13 +71,13 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
registry-url: 'https://registry.npmjs.org'
cache: yarn
cache-dependency-path: tooling/*/yarn.lock
- name: cargo login
run: cargo login ${{ secrets.crate_token }}
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
- name: git config
run: |
git config --global user.name "${{ github.event.pusher.name }}"
@@ -136,7 +87,7 @@ jobs:
uses: jbolda/covector/packages/action@covector-v0
id: covector
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
@@ -145,7 +96,7 @@ jobs:
- name: Create Pull Request With Versions Bumped
if: steps.covector.outputs.commandRan == 'version'
uses: tauri-apps/create-pull-request@v3.4.1
uses: tauri-apps/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: release/version-updates
@@ -155,19 +106,29 @@ jobs:
body: ${{ steps.covector.outputs.change }}
- name: Trigger doc update
if: steps.covector.outputs.successfulPublish == 'true'
if: |
steps.covector.outputs.successfulPublish == 'true' &&
steps.covector.outputs.packagesPublished != ''
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.TAURI_BOT_PAT }}
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
repository: tauri-apps/tauri-docs
event-type: update-docs
- name: Trigger cli.js publishing workflow
- name: Trigger `@tauri-apps/cli` publishing workflow
if: |
steps.covector.outputs.successfulPublish == 'true' &&
contains(steps.covector.outputs.packagesPublished, 'cli.rs')
contains(steps.covector.outputs.packagesPublished, '@tauri-apps/cli')
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.TAURI_BOT_PAT }}
repository: tauri-apps/tauri
event-type: publish-clijs
event-type: publish-js-cli
client-payload: >-
{"releaseId": "${{ steps.covector.outputs['-tauri-apps-cli-releaseId'] }}" }
- name: Trigger `tauri-cli` publishing workflow
if: |
steps.covector.outputs.successfulPublish == 'true' &&
contains(steps.covector.outputs.packagesPublished, 'tauri-cli')
uses: peter-evans/repository-dispatch@v1
with:
event-type: publish-clirs

137
.github/workflows/docker.yml vendored Normal file
View File

@@ -0,0 +1,137 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: docker
on:
workflow_dispatch:
#pull_request:
# paths:
# - '.docker/**'
# - '.github/workflows/docker.yml'
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
- name: install cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Upload cross
uses: actions/upload-artifact@v3
with:
name: cross
path: '~/.cargo/bin/cross'
if-no-files-found: error
- name: build CLI
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./tooling/cli/Cargo.toml
- name: Upload CLI
uses: actions/upload-artifact@v3
with:
name: cargo-tauri
path: tooling/cli/target/debug/cargo-tauri
if-no-files-found: error
docker:
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- { name: 'aarch64-unknown-linux-gnu', filename: 'aarch64' }
steps:
- name: Checkout
uses: actions/checkout@v3
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
default: true
target: ${{ matrix.target.name }}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Download cross
uses: actions/download-artifact@v3
with:
name: cross
path: '~/.cargo/bin'
- name: Download CLI
uses: actions/download-artifact@v3
with:
name: cargo-tauri
path: 'examples/api'
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and export to Docker
uses: docker/build-push-action@v3
with:
context: .docker/cross
file: .docker/cross/${{ matrix.target.filename }}.Dockerfile
load: true
tags: ${{ matrix.target.name }}:latest
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
- name: Test
run: |
cd tooling/api
yarn && yarn build
cd ../../examples/api
yarn
. .setup-cross.sh
chmod +x cargo-tauri
chmod +x $HOME/.cargo/bin/cross
./cargo-tauri build --runner cross --bundles deb --target ${{ matrix.target.name }} --verbose
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .docker/cross
file: .docker/cross/${{ matrix.target.filename }}.Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/${{ matrix.target.name }}:latest

70
.github/workflows/lint-cli.yml vendored Normal file
View File

@@ -0,0 +1,70 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: lint cli
on:
push:
branches:
- dev
- 1.x
pull_request:
paths:
- '.github/workflows/lint-cli.yml'
- 'tooling/cli/**'
env:
RUST_BACKTRACE: 1
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./tooling/cli/Cargo.toml --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
- uses: Swatinem/rust-cache@v2
with:
workspaces: tooling/cli
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./tooling/cli/Cargo.toml --all-targets --all-features -- -D warnings
name: cli

83
.github/workflows/lint-core.yml vendored Normal file
View File

@@ -0,0 +1,83 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: lint core
on:
push:
branches:
- dev
- 1.x
pull_request:
paths:
- '.github/workflows/lint-core.yml'
- 'core/**'
- '!core/tauri/scripts/**'
- 'examples/**'
env:
RUST_BACKTRACE: 1
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
runs-on: ubuntu-latest
strategy:
matrix:
clippy:
- { args: '', key: 'empty' }
- {
args: '--features compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart,test',
key: 'all'
}
- { args: '--features custom-protocol', key: 'custom-protocol' }
- { args: '--features api-all', key: 'api-all' }
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: core -> ../target
save-if: ${{ matrix.clippy.key == 'all' }}
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./core/tauri/Cargo.toml --all-targets ${{ matrix.clippy.args }} -- -D warnings
name: ${{ matrix.clippy.key }}

View File

@@ -1,101 +0,0 @@
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: cli clippy and fmt check
on:
push:
branches:
- dev
- next
pull_request:
paths:
- '.github/workflows/lint-fmt-cli.yml'
- 'tooling/cli/**'
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
fmt_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./tooling/cli/Cargo.toml --all -- --check
cli_clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- name: install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Cache cargo state
uses: actions/cache@v2
env:
cache-name: cargo_state
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
restore-keys: |
ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
ubuntu-latest-stable-${{ env.cache-name }}-
ubuntu-latest-stable-
ubuntu-latest-
- name: Cache CLI cargo target
uses: actions/cache@v2
env:
cache-name: cargo_cli
with:
path: tooling/cli/target
# Add date to the cache to keep it up to date
key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
ubuntu-latest-stable-${{ env.cache-name }}-
ubuntu-latest-stable-
ubuntu-latest-
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./tooling/cli/Cargo.toml --all-targets --all-features -- -D warnings
name: cli

View File

@@ -1,116 +0,0 @@
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: core clippy and fmt check
on:
push:
branches:
- dev
- next
pull_request:
paths:
- '.github/workflows/lint-fmt-core.yml'
- 'core/**'
- 'examples/**'
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
fmt_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
core_clippy_check:
runs-on: ubuntu-latest
strategy:
matrix:
clippy:
- { args: '', key: 'empty' }
- {
args: '--features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart',
key: 'all'
}
- { args: '--features custom-protocol', key: 'custom-protocol' }
- { args: '--features api-all', key: 'api-all' }
steps:
- uses: actions/checkout@v2
- name: install webkit2gtk
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
- name: Get current date
if: matrix.platform == 'windows-latest'
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache cargo state
uses: actions/cache@v2
env:
cache-name: cargo_state
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
restore-keys: |
ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
ubuntu-latest-stable-${{ env.cache-name }}-
ubuntu-latest-stable-
ubuntu-latest-
- name: Cache core cargo target
uses: actions/cache@v2
env:
cache-name: cargo_core
with:
path: target
# Add date to the cache to keep it up to date
key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
ubuntu-latest-stable-${{ env.cache-name }}-
ubuntu-latest-stable-
ubuntu-latest-
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./core/tauri/Cargo.toml --all-targets ${{ matrix.clippy.args }} -- -D warnings
name: ${{ matrix.clippy.key }}

View File

@@ -1,8 +1,8 @@
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: api and cli.js lint check
name: lint js
on:
pull_request:
@@ -16,32 +16,45 @@ concurrency:
cancel-in-progress: true
jobs:
eslint-check:
eslint-cli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: 16
cache: yarn
cache-dependency-path: tooling/*/yarn.lock
- name: install cli.js deps via yarn
cache-dependency-path: tooling/cli/node/yarn.lock
- name: install deps via yarn
working-directory: ./tooling/cli/node/
run: yarn
# nothing to lint
#- name: run cli.js lint
#- name: run lint
# working-directory: ./tooling/cli/node/
# run: yarn lint
- name: run cli.js format
- name: run format
working-directory: ./tooling/cli/node/
run: yarn format:check
- name: install api deps via yarn
eslint-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
cache-dependency-path: tooling/api/yarn.lock
- name: install deps via yarn
working-directory: ./tooling/api/
run: yarn
- name: run api lint
- name: run ts:check
working-directory: ./tooling/api/
run: yarn ts:check
- name: run lint
working-directory: ./tooling/api/
run: yarn lint
- name: run api format
- name: run format
working-directory: ./tooling/api/
run: yarn format:check

View File

@@ -1,12 +1,20 @@
name: publish cli.js
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: publish `@tauri-apps/cli`
env:
DEBUG: napi:*
APP_NAME: cli
MACOSX_DEPLOYMENT_TARGET: '10.13'
on:
workflow_dispatch:
inputs:
releaseId:
description: 'ID of the `@tauri-apps/cli` release'
required: true
repository_dispatch:
types: [publish-clijs]
types: [publish-js-cli]
defaults:
run:
@@ -22,7 +30,7 @@ jobs:
target: x86_64-apple-darwin
architecture: x64
build: |
yarn build:release
yarn build:release --target=x86_64-apple-darwin
strip -x *.node
- host: windows-latest
build: yarn build:release
@@ -32,14 +40,18 @@ jobs:
build: yarn build:release --target i686-pc-windows-msvc
target: i686-pc-windows-msvc
architecture: x64
- host: ubuntu-18.04
- host: windows-latest
architecture: x64
target: aarch64-pc-windows-msvc
build: yarn build:release --target aarch64-pc-windows-msvc --features native-tls,native-tls-vendored --cargo-flags="--no-default-features"
- host: ubuntu-20.04
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |
cd tooling/cli/node
yarn build:release --target x86_64-unknown-linux-gnu
strip *.node
- host: ubuntu-18.04
- host: ubuntu-20.04
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |
@@ -51,14 +63,14 @@ jobs:
build: |
yarn build:release --target=aarch64-apple-darwin
strip -x *.node
- host: ubuntu-18.04
- host: ubuntu-20.04
target: aarch64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: |
cd tooling/cli/node
yarn build:release --target aarch64-unknown-linux-gnu
aarch64-unknown-linux-gnu-strip *.node
- host: ubuntu-18.04
- host: ubuntu-20.04
architecture: x64
target: armv7-unknown-linux-gnueabihf
setup: |
@@ -67,7 +79,7 @@ jobs:
build: |
yarn build:release --target=armv7-unknown-linux-gnueabihf
arm-linux-gnueabihf-strip *.node
- host: ubuntu-18.04
- host: ubuntu-20.04
architecture: x64
target: aarch64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
@@ -76,10 +88,6 @@ jobs:
rustup target add aarch64-unknown-linux-musl
yarn build:release --target aarch64-unknown-linux-musl
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
#- host: windows-latest
# architecture: x64
# target: aarch64-pc-windows-msvc
# build: yarn build:release --target aarch64-pc-windows-msvc
name: stable - ${{ matrix.settings.target }} - node@16
runs-on: ${{ matrix.settings.host }}
steps:
@@ -150,7 +158,7 @@ jobs:
# usesh: true
# mem: 3000
# prepare: |
# pkg install -y curl node14 python2
# pkg install -y curl node16 python2
# curl -qL https://www.npmjs.com/install.sh | sh
# npm install -g yarn
# curl https://sh.rustup.rs -sSf --output rustup.sh
@@ -190,14 +198,13 @@ jobs:
matrix:
settings:
- host: macos-latest
target: 'x86_64-apple-darwin'
target: 'aarch64-apple-darwin'
- host: windows-latest
target: x86_64-pc-windows-msvc
node:
- '12'
- '14'
- '16'
- '18'
- '20'
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v3
@@ -228,10 +235,9 @@ jobs:
fail-fast: false
matrix:
node:
- '12'
- '14'
- '16'
- '18'
- '20'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -255,7 +261,7 @@ jobs:
- name: install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
- name: Test bindings
run: yarn test
test-linux-x64-musl-binding:
@@ -266,10 +272,9 @@ jobs:
fail-fast: false
matrix:
node:
- '12'
- '14'
- '16'
- '18'
- '20'
runs-on: ubuntu-latest
container:
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
@@ -292,14 +297,10 @@ jobs:
- name: List packages
run: ls -R .
shell: bash
- name: Install system dependencies
run: |
apk add openssl-dev musl-dev glib-dev cairo-dev pkgconfig gdk-pixbuf-dev webkit2gtk-dev curl libappindicator-dev patchelf librsvg-dev gtk+3.0-dev
- name: Setup and run tests
run: |
yarn tauri --help
ls -la
# TODO: fix this test: https://github.com/tauri-apps/tauri/runs/5145729140?check_suite_focus=true#step:9:704
#- name: Setup and run tests
# run: |
# rustup install stable
@@ -314,10 +315,9 @@ jobs:
fail-fast: false
matrix:
node:
- '12'
- '14'
- '16'
- '18'
- '20'
image:
- ghcr.io/napi-rs/napi-rs/nodejs:aarch64-16
- ghcr.io/napi-rs/napi-rs/nodejs:armhf-16
@@ -351,7 +351,7 @@ jobs:
set -e
export PATH=/usr/local/cargo/bin/:/usr/local/fnm:$PATH
apt-get update
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --no-install-recommends -y unzip libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --no-install-recommends -y unzip webkit2gtk-4.0 libayatana-appindicator3-dev
bash
curl https://sh.rustup.rs -sSf | bash -s -- -y
curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "/usr/local/fnm" --skip-shell
@@ -375,7 +375,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
check-latest: true
cache: yarn
cache-dependency-path: 'tooling/cli/node/yarn.lock'
@@ -396,4 +396,5 @@ jobs:
npm publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
RELEASE_ID: ${{ github.event.client_payload.releaseId || github.event.inputs.releaseId }}

99
.github/workflows/publish-cli-rs.yml vendored Normal file
View File

@@ -0,0 +1,99 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: publish `tauri-cli`
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
on:
workflow_dispatch:
repository_dispatch:
types: [publish-clirs]
jobs:
build:
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- os: ubuntu-20.04
rust_target: x86_64-unknown-linux-gnu
ext: ''
args: ''
- os: macos-latest
rust_target: x86_64-apple-darwin
ext: ''
args: ''
- os: macos-latest
rust_target: aarch64-apple-darwin
ext: ''
args: ''
- os: windows-latest
rust_target: x86_64-pc-windows-msvc
ext: '.exe'
args: ''
- os: windows-latest
rust_target: aarch64-pc-windows-msvc
ext: '.exe'
args: '--no-default-features --features native-tls,native-tls-vendored'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: 'Setup Rust'
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.config.rust_target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.config.rust_target }}
- name: install Linux dependencies
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
- name: Build CLI
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./tooling/cli/Cargo.toml --release ${{ matrix.config.args }}
- name: Upload CLI
uses: actions/upload-artifact@v3
with:
name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }}
path: tooling/cli/target/release/cargo-tauri${{ matrix.config.ext }}
if-no-files-found: error
upload:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download built CLIs
uses: actions/download-artifact@v3
with:
path: outputs
- name: Pack archives
run: ./.scripts/ci/pack-cli.sh
- name: Get CLI version
run: echo "CLI_VERSION=$(cat tooling/cli/metadata.json | jq '."cli.js".version' -r)" >> $GITHUB_ENV
- name: Publish release
uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa
with:
tag_name: tauri-cli-v${{ env.CLI_VERSION }}
files: |
outputs/cargo-tauri-*.zip
outputs/cargo-tauri-*.tgz

View File

@@ -1,161 +0,0 @@
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: test bundler
on:
push:
branches:
- dev
- next
pull_request:
paths:
- '.github/workflows/test-bundler.yml'
- 'tooling/bundler/**'
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-tauri-bundler:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
- name: Get current date
if: matrix.platform == 'windows-latest'
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache cargo state
uses: actions/cache@v2
env:
cache-name: cargo_state
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
- name: Cache bundler cargo target
uses: actions/cache@v2
env:
cache-name: cargo_bundler
with:
path: tooling/bundler/target
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
- name: test
run: |
cd ./tooling/bundler
cargo test
fmt_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./tooling/bundler/Cargo.toml --all -- --check
clippy-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install minimal stable with clippy and rustfmt
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
- name: Get current date
if: matrix.platform == 'windows-latest'
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache cargo state
uses: actions/cache@v2
env:
cache-name: cargo_state
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
- name: Cache bundler cargo target
uses: actions/cache@v2
env:
cache-name: cargo_bundler
with:
path: tooling/bundler/target
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
- name: clippy check
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./tooling/bundler/Cargo.toml --all-targets -- -D warnings
name: bundler

View File

@@ -1,23 +1,22 @@
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: test cli.js
name: test `@tauri-apps/cli`
on:
push:
branches:
- dev
- next
- 1.x
pull_request:
paths:
- '.github/workflows/test-cli-js.yml'
# currently cli.js only tests the template
# currently` @tauri-apps/cli` only tests the template
- 'tooling/cli/templates/app/**'
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
concurrency:
@@ -25,7 +24,7 @@ concurrency:
cancel-in-progress: true
jobs:
test-tauri-js-cli:
test:
runs-on: ${{ matrix.platform }}
strategy:
@@ -35,6 +34,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
@@ -43,7 +43,7 @@ jobs:
- name: setup node
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
cache: yarn
cache-dependency-path: tooling/cli/node/yarn.lock
@@ -51,61 +51,13 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
- name: Get current date
if: matrix.platform == 'windows-latest'
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache cargo state
uses: actions/cache@v2
env:
cache-name: cargo_state
- uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
- name: Cache CLI cargo target
uses: actions/cache@v2
env:
cache-name: cargo_cli
with:
path: tooling/cli/target
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
- name: Cache template cargo target
uses: actions/cache@v2
env:
cache-name: cargo_template
with:
path: tooling/cli/node/test/jest/fixtures/empty/src-tauri/target
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/templates/app/**') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/templates/app/**') }}
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
workspaces: |
tooling/cli
tooling/cli/node/test/jest/fixtures/empty/src-tauri
- name: test
timeout-minutes: 30

View File

@@ -1,14 +1,14 @@
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: test cli.rs
name: test `tauri-cli`
on:
push:
branches:
- dev
- next
- 1.x
pull_request:
paths:
- '.github/workflows/test-cli-rs.yml'
@@ -16,7 +16,6 @@ on:
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
concurrency:
@@ -24,7 +23,7 @@ concurrency:
cancel-in-progress: true
jobs:
test-tauri-cli:
test:
runs-on: ${{ matrix.platform }}
strategy:
@@ -34,6 +33,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: install stable
uses: actions-rs/toolchain@v1
with:
@@ -46,47 +46,12 @@ jobs:
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
- name: Get current date
if: matrix.platform == 'windows-latest'
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache cargo state
uses: actions/cache@v2
env:
cache-name: cargo_state
- uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
workspaces: tooling/cli
- name: Cache CLI cargo target
uses: actions/cache@v2
env:
cache-name: cargo_cli
with:
path: tooling/cli/target
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
- name: build CLI
- name: test CLI
uses: actions-rs/cargo@v1
with:
command: build
command: test
args: --manifest-path ./tooling/cli/Cargo.toml

View File

@@ -1,4 +1,4 @@
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
@@ -8,17 +8,15 @@ on:
push:
branches:
- dev
- next
- 1.x
pull_request:
paths:
- '.github/workflows/test-core.yml'
- 'core/**'
- 'examples/**'
- 'tooling/cli/**'
- '!core/tauri/scripts/**'
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
concurrency:
@@ -26,67 +24,63 @@ concurrency:
cancel-in-progress: true
jobs:
test-tauri-core:
runs-on: ${{ matrix.platform }}
test:
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
platform:
- {
target: x86_64-pc-windows-msvc,
os: windows-latest,
toolchain: '1.61.0'
}
- {
target: x86_64-unknown-linux-gnu,
os: ubuntu-latest,
toolchain: '1.60.0'
}
- {
target: x86_64-apple-darwin,
os: macos-13,
toolchain: '1.60.0'
}
features:
- {
args: --no-default-features,
key: no-default
}
- {
args: --features api-all,
key: api-all
}
- {
args: --features tracing,compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart,test,
key: all
}
steps:
- uses: actions/checkout@v2
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: ${{ matrix.platform.toolchain }}
target: ${{ matrix.platform.target }}
override: true
default: true
- name: install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
if: contains(matrix.platform.target, 'unknown-linux')
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
- name: Get current date
if: matrix.platform == 'windows-latest'
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache cargo state
uses: actions/cache@v2
env:
cache-name: cargo_state
- uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
- name: Cache core cargo target
uses: actions/cache@v2
env:
cache-name: cargo_core
with:
path: target
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
workspaces: core -> ../target
save-if: ${{ matrix.features.key == 'all' }}
- name: test
run: |
cargo test
cargo test --features api-all
cargo test --features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart
run: cargo test --target ${{ matrix.platform.target }} ${{ matrix.features.args }}

93
.github/workflows/test-lint-bundler.yml vendored Normal file
View File

@@ -0,0 +1,93 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: test and lint bundler
on:
push:
branches:
- dev
- 1.x
pull_request:
paths:
- '.github/workflows/test-bundler.yml'
- 'tooling/bundler/**'
env:
RUST_BACKTRACE: 1
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: tooling/bundler
- name: test
run: |
cd ./tooling/bundler
cargo test
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./tooling/bundler/Cargo.toml --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install minimal stable with clippy and rustfmt
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
default: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: tooling/bundler
- name: clippy check
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./tooling/bundler/Cargo.toml --all-targets -- -D warnings
name: bundler

View File

@@ -1,24 +1,19 @@
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: updater test artifacts
name: test updater artifacts
on:
push:
branches:
- dev
- next
schedule:
- cron: '0 0 * * *'
pull_request:
paths:
- '.github/workflows/artifacts-updater.yml'
- 'core/tauri/**'
- 'tooling/cli/**'
- 'tooling/bundler/**'
- '.github/workflows/test-updater-artifacts.yml'
- 'examples/updater/**'
workflow_dispatch:
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
concurrency:
@@ -26,7 +21,7 @@ concurrency:
cancel-in-progress: true
jobs:
build-artifacs:
test:
runs-on: ${{ matrix.platform }}
strategy:
@@ -45,63 +40,15 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
- name: Get current date
if: matrix.platform == 'windows-latest'
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache cargo state
uses: actions/cache@v2
env:
cache-name: cargo_state
- uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
workspaces: |
core -> ../target
tooling/cli
- name: Cache core cargo target
uses: actions/cache@v2
env:
cache-name: cargo_core
with:
path: target
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
- name: Cache CLI cargo target
uses: actions/cache@v2
env:
cache-name: cargo_cli
with:
path: tooling/cli/target
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
${{ matrix.platform }}-stable-${{ env.cache-name }}-
${{ matrix.platform }}-stable-
${{ matrix.platform }}-
- name: build and install cli.rs
- name: build and install `tauri-cli`
run: cargo install --path tooling/cli --force
- name: Check whether code signing should be enabled
id: enablecodesigning
@@ -110,13 +57,14 @@ jobs:
run: |
echo "Enable code signing: ${{ env.ENABLE_CODE_SIGNING != '' }}"
echo "::set-output name=enabled::${{ env.ENABLE_CODE_SIGNING != '' }}"
# run only on tauri-apps/tauri repo (require secrets)
- name: build sample artifacts + code signing (updater)
if: steps.enablecodesigning.outputs.enabled == 'true'
working-directory: ./examples/updater
run: |
yarn install
cargo tauri build
cargo tauri build --verbose
env:
# Notarization (disabled)
# FIXME: enable only on `dev` push maybe? as it take some times...
@@ -130,15 +78,17 @@ jobs:
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
# Updater signature is exposed here to make sure it works in PR's
TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
TAURI_KEY_PASSWORD:
# run on PRs and forks
- name: build sample artifacts (updater)
if: steps.enablecodesigning.outputs.enabled != 'true'
working-directory: ./examples/updater
run: |
yarn install
cargo tauri build
cargo tauri build --verbose
env:
TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
TAURI_KEY_PASSWORD:
# upload assets
- uses: actions/upload-artifact@v2
if: matrix.platform == 'ubuntu-latest'

View File

@@ -1,20 +1,17 @@
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: Udeps
on:
pull_request:
paths:
- '.github/workflows/udeps.yml'
- 'core/**'
- 'tooling/bundler/**'
- 'tooling/cli/**'
push:
branches:
- dev
- 1.x
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
concurrency:
@@ -22,26 +19,58 @@ concurrency:
cancel-in-progress: true
jobs:
udeps:
changes:
runs-on: ubuntu-latest
strategy:
matrix:
clippy:
- {
path: './core/tauri/Cargo.toml',
args: '--features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart'
}
- { path: './core/tauri-build/Cargo.toml', args: '--all-features' }
- { path: './core/tauri-codegen/Cargo.toml', args: '--all-features' }
- { path: './core/tauri-macros/Cargo.toml', args: '--all-features' }
- { path: './core/tauri-runtime/Cargo.toml', args: '--all-features' }
- {
path: './core/tauri-runtime-wry/Cargo.toml',
args: '--features devtools,system-tray,macos-private-api,objc-exception'
}
- { path: './core/tauri-utils/Cargo.toml', args: '--all-features' }
- { path: './tooling/bundler/Cargo.toml', args: '--all-features' }
- { path: './tooling/cli/Cargo.toml', args: '--all-features' }
outputs:
tauri: ${{ steps.filter.outputs.tauri }}
build: ${{ steps.filter.outputs.build }}
codegen: ${{ steps.filter.outputs.codegen }}
macros: ${{ steps.filter.outputs.macros }}
runtime: ${{ steps.filter.outputs.runtime }}
wry: ${{ steps.filter.outputs.wry }}
utils: ${{ steps.filter.outputs.utils }}
bundler: ${{ steps.filter.outputs.bundler }}
cli: ${{ steps.filter.outputs.cli }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
tauri:
- 'core/tauri/**'
- '!core/tauri/scripts/**'
build:
- 'core/tauri-build/**'
codegen:
- 'core/tauri-codegen/**'
macros:
- 'core/tauri-macros/**'
runtime:
- 'core/tauri-runtime/**'
wry:
- 'core/tauri-runtime-wry/**'
utils:
- 'core/tauri-utils/**'
bundler:
- 'tooling/bundler/**'
cli:
- 'tooling/cli/**'
setup:
runs-on: ubuntu-latest
needs: changes
if: |
needs.changes.outputs.tauri == 'true' ||
needs.changes.outputs.build == 'true' ||
needs.changes.outputs.codegen == 'true' ||
needs.changes.outputs.macros == 'true' ||
needs.changes.outputs.runtime == 'true' ||
needs.changes.outputs.wry == 'true' ||
needs.changes.outputs.utils == 'true' ||
needs.changes.outputs.bundler == 'true' ||
needs.changes.outputs.cli == 'true'
steps:
- uses: actions/checkout@v2
@@ -51,86 +80,86 @@ jobs:
toolchain: nightly
override: true
- name: install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Cache cargo state
uses: actions/cache@v2
env:
cache-name: cargo_state
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
restore-keys: |
ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
ubuntu-latest-nightly-${{ env.cache-name }}-
ubuntu-latest-nightly-
ubuntu-latest-
- name: Cache core cargo target
uses: actions/cache@v2
env:
cache-name: cargo_core
with:
path: target
# Add date to the cache to keep it up to date
key: ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
ubuntu-latest-nightly-${{ env.cache-name }}-
ubuntu-latest-nightly-
ubuntu-latest-
- name: Cache bundler cargo target
uses: actions/cache@v2
env:
cache-name: cargo_bundler
with:
path: tooling/bundler/target
# Add date to the cache to keep it up to date
key: ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}
ubuntu-latest-nightly-${{ env.cache-name }}-
ubuntu-latest-nightly-
ubuntu-latest-
- name: Cache CLI cargo target
uses: actions/cache@v2
env:
cache-name: cargo_cli
with:
path: tooling/cli/target
# Add date to the cache to keep it up to date
key: ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
ubuntu-latest-nightly-${{ env.cache-name }}-
ubuntu-latest-nightly-
ubuntu-latest-
- uses: actions-rs/cargo@v1
with:
command: install
args: cargo-udeps --locked --force
- name: Upload udeps
uses: actions/upload-artifact@v3
with:
name: udeps
path: '~/.cargo/bin/cargo-udeps'
if-no-files-found: error
- name: Create udeps matrix
id: create-matrix
env:
TAURI: ${{ needs.changes.outputs.tauri == 'true' }}
BUILD: ${{ needs.changes.outputs.build == 'true' }}
CODEGEN: ${{ needs.changes.outputs.codegen == 'true' }}
MACROS: ${{ needs.changes.outputs.macros == 'true' }}
RUNTIME: ${{ needs.changes.outputs.runtime == 'true' }}
WRY: ${{ needs.changes.outputs.wry == 'true' }}
UTILS: ${{ needs.changes.outputs.utils == 'true' }}
BUNDLER: ${{ needs.changes.outputs.bundler == 'true' }}
CLI: ${{ needs.changes.outputs.cli == 'true' }}
run: |
crates=()
if [ "${TAURI}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri\""; fi
if [ "${BUILD}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-build\""; fi
if [ "${CODEGEN}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-codegen\""; fi
if [ "${MACROS}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-macros\""; fi
if [ "${RUNTIME}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-runtime\""; fi
if [ "${WRY}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-runtime-wry\""; fi
if [ "${UTILS}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-utils\""; fi
if [ "${BUNDLER}" == "true" ]; then crates[${#crates[@]}]="\"./tooling/bundler\""; fi
if [ "${CLI}" == "true" ]; then crates[${#crates[@]}]="\"./tooling/cli\""; fi
echo ::set-output name=matrix::[$crates]
outputs:
matrix: ${{ steps.create-matrix.outputs.matrix }}
udeps:
runs-on: ubuntu-latest
needs: setup
strategy:
matrix:
path: ${{ fromJson(needs.setup.outputs.matrix) }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
core -> ../target
tooling/cli
tooling/bundler
- name: Download udeps
uses: actions/download-artifact@v3
with:
name: udeps
path: '~/.cargo/bin'
- run: chmod +x $HOME/.cargo/bin/cargo-udeps
- name: Install required packages
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
- uses: actions-rs/cargo@v1
with:
command: udeps
args: --manifest-path ${{ matrix.clippy.path }} --all-targets ${{ matrix.clippy.args }}
args: --manifest-path ${{ matrix.path }}/Cargo.toml --all-targets --all-features

2
.gitignore vendored
View File

@@ -73,7 +73,7 @@ TODO.md
target
# lock for libs
/Cargo.lock
#/Cargo.lock Committed to prevent msrv checks from failing
/tooling/bench/tests/Cargo.lock
/yarn.lock

View File

@@ -1,6 +1,6 @@
#!/bin/sh
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
@@ -11,12 +11,12 @@ if [ -z "$(git diff --name-only tooling/api)" ]; then
else
cd tooling/api
yarn format
yarn lint-fix
yarn lint:fix
cd ../..
fi
if [ -z "$(git diff --name-only tooling/cli/node)" ]; then
echo "skipping cli.js - no changes detected"
echo "skipping \`@tauri-apps/cli\` - no changes detected"
else
cd tooling/cli/node
yarn format

12
.prettierignore Normal file
View File

@@ -0,0 +1,12 @@
/.github
/.husky
/.vscode
/audits
node_modules
target
dist
/core/tauri/scripts
/tooling/cli/templates
/tooling/cli/node
/tooling/cli/schema.json
/core/tauri-config-schema/schema.json

5
.prettierrc Normal file
View File

@@ -0,0 +1,5 @@
{
"singleQuote": true,
"semi": false,
"trailingComma": "none"
}

View File

@@ -1,5 +0,0 @@
module.exports = {
singleQuote: true,
semi: false,
trailingComma: 'none'
}

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env pwsh
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env sh
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

View File

@@ -0,0 +1,79 @@
#!/usr/bin/env node
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
const fs = require('fs')
const path = require('path')
const ignorePackages = [
'tauri-macros',
'tauri-codegen',
'tauri-runtime',
'tauri-runtime-wry',
'tauri-driver'
]
const covectorConfig = JSON.parse(
fs.readFileSync('.changes/config.json', 'utf8')
)
const tags = Object.keys(covectorConfig.changeTags)
const missingTagsFiles = {}
const unknownTagsFiles = {}
function checkChangeFiles(changeFiles) {
for (const file of changeFiles) {
const content = fs.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(':'))
for (const [package, _, tag] of packages) {
if (!tag) {
if (ignorePackages.includes(package)) continue
if (!missingTagsFiles[file]) missingTagsFiles[file] = []
missingTagsFiles[file].push(package)
} else if (!tags.includes(tag)) {
if (!unknownTagsFiles[file]) unknownTagsFiles[file] = []
unknownTagsFiles[file].push({ package, tag })
}
}
}
const missingTagsEntries = Object.entries(missingTagsFiles)
const unknownTagsEntries = Object.entries(unknownTagsFiles)
if (missingTagsEntries.length > 0 || unknownTagsEntries.length > 0) {
for (const [file, packages] of missingTagsEntries) {
for (const package of packages) {
console.error(
`Package \`${package}\` is missing a change tag in ${file} `
)
}
}
for (const [file, packages] of unknownTagsEntries) {
for (const { package, tag } of packages) {
console.error(
`Package \`${package}\` has an uknown change tag ${tag} in ${file} `
)
}
}
process.exit(1)
}
}
const [_bin, _script, ...files] = process.argv
if (files.length > 0) {
checkChangeFiles(files.filter((f) => f.toLowerCase() !== 'readme.md'))
} else {
const changeFiles = fs
.readdirSync('.changes')
.filter((f) => f.endsWith('.md') && f.toLowerCase() !== 'readme.md')
.map((p) => path.join('.changes', p))
checkChangeFiles(changeFiles)
}

View File

@@ -0,0 +1,117 @@
#!/usr/bin/env node
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
const fs = require('fs')
const path = require('path')
const readline = require('readline')
const header = `Copyright 2019-2023 Tauri Programme within The Commons Conservancy
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: MIT`
const bundlerLicense =
'// Copyright 2016-2019 Cargo-Bundle developers <https://github.com/burtonageo/cargo-bundle>'
const extensions = ['.rs', '.js', '.ts', '.yml']
const ignore = [
'target',
'templates',
'node_modules',
'gen',
'dist',
'bundle.js',
'bundle.global.js'
]
async function checkFile(file) {
if (extensions.some((e) => file.endsWith(e))) {
const fileStream = fs.createReadStream(file)
const rl = readline.createInterface({
input: fileStream,
crlfDelay: Infinity
})
let contents = ``
let i = 0
for await (let line of rl) {
// ignore empty lines, allow shebang and bundler license
if (
line.length === 0 ||
line.startsWith('#!') ||
line === bundlerLicense
) {
continue
}
// strip comment marker
if (line.startsWith('// ')) {
line = line.substring(3)
} else if (line.startsWith('# ')) {
line = line.substring(2)
}
contents += line
if (++i === 3) {
break
}
contents += '\n'
}
if (contents !== header) {
return true
}
}
return false
}
async function check(src) {
const missingHeader = []
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
const p = path.join(src, entry.name)
if (entry.isSymbolicLink() || ignore.includes(entry.name)) {
continue
}
if (entry.isDirectory()) {
const missing = await check(p)
missingHeader.push(...missing)
} else {
const isMissing = await checkFile(p)
if (isMissing) {
missingHeader.push(p)
}
}
}
return missingHeader
}
const [_bin, _script, ...files] = process.argv
if (files.length > 0) {
async function run() {
const missing = []
for (const f of files) {
const isMissing = await checkFile(f)
if (isMissing) {
missing.push(f)
}
}
if (missing.length > 0) {
console.log(missing.join('\n'))
process.exit(1)
}
}
run()
} else {
check('.').then((missing) => {
if (missing.length > 0) {
console.log(missing.join('\n'))
process.exit(1)
}
})
}

13
.scripts/ci/has-diff.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
if git diff --quiet --ignore-submodules HEAD
then
echo "working directory is clean"
else
echo "found diff"
exit 1
fi

23
.scripts/ci/pack-cli.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
set -euxo pipefail
for o in outputs/*; do
pushd "$o"
chmod +x cargo-tauri*
cp ../../tooling/cli/LICENSE* ../../tooling/cli/README.md .
target=$(basename "$o" | cut -d. -f1)
if grep -qE '(apple|windows)' <<< "$target"; then
zip "../${target}.zip" *
else
tar cv * | gzip -9 > "../${target}.tgz"
fi
popd
done

View File

@@ -0,0 +1,57 @@
#!/usr/bin/env node
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
/*
This script is solely intended to be run as part of the `covector publish` step to
check the latest version of a crate, considering the current minor version.
*/
const https = require('https')
const kind = process.argv[2]
const packageName = process.argv[3]
const packageVersion = process.argv[4]
const target = packageVersion.substring(0, packageVersion.lastIndexOf('.'))
let url = null
switch (kind) {
case 'cargo':
url = `https://crates.io/api/v1/crates/${packageName}`
break
case 'npm':
url = `https://registry.npmjs.org/${packageName}`
break
default:
throw new Error('unexpected kind ' + kind)
}
const options = {
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
'User-Agent': 'tauri (https://github.com/tauri-apps/tauri)'
}
}
https.get(url, options, (response) => {
let chunks = []
response.on('data', function (chunk) {
chunks.push(chunk)
})
response.on('end', function () {
const data = JSON.parse(chunks.join(''))
if (kind === 'cargo') {
const versions = data.versions.filter((v) => v.num.startsWith(target))
console.log(versions.length ? versions[0].num : '0.0.0')
} else if (kind === 'npm') {
const versions = Object.keys(data.versions).filter((v) =>
v.startsWith(target)
)
console.log(versions[versions.length - 1] || '0.0.0')
}
})
})

View File

@@ -1,43 +1,49 @@
#!/usr/bin/env node
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
/*
This script is solely intended to be run as part of the `covector version` step to
keep the `../tooling/cli/metadata.json` up to date with other version bumps. Long term
we should look to find a more "rusty way" to import / "pin" a version value in our cli.rs
we should look to find a more "rusty way" to import / "pin" a version value in our tauri-cli
rust binaries.
*/
const {
readFileSync,
writeFileSync
} = require('fs')
const { readFileSync, writeFileSync } = require('fs')
const packageNickname = process.argv[2]
const filePath = packageNickname === 'cli.js' ? `../../../tooling/cli/metadata.json` : `../../tooling/cli/metadata.json`
const filePath =
packageNickname === '@tauri-apps/cli'
? `../../../tooling/cli/metadata.json`
: `../../tooling/cli/metadata.json`
const bump = process.argv[3]
let index = null
switch (bump) {
case 'major':
index = 0;
break;
index = 0
break
case 'minor':
index = 1;
break;
index = 1
break
case 'patch':
index = 2;
break;
index = 2
break
default:
throw new Error('unexpected bump ' + bump)
}
const inc = (version) => {
const v = version.split('.')
const n = v[index]
v[index] = String(Number(n) + 1)
for (let i = 0; i < v.length; i++) {
if (i === index) {
v[i] = String(Number(v[i]) + 1)
} else if (i > index) {
v[i] = 0
}
}
return v.join('.')
}
@@ -46,9 +52,9 @@ const metadata = JSON.parse(readFileSync(filePath, 'utf-8'))
// set field version
let version
if (packageNickname === 'cli.js') {
version = inc(metadata[packageNickname].version)
metadata[packageNickname].version = version
if (packageNickname === '@tauri-apps/cli') {
version = inc(metadata['cli.js'].version)
metadata['cli.js'].version = version
} else {
version = inc(metadata[packageNickname])
metadata[packageNickname] = version

7
.scripts/docker/build.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
docker build -t aarch64-unknown-linux-gnu:latest --file .docker/cross/aarch64.Dockerfile .docker/cross

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env pwsh
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

View File

@@ -1,9 +1,10 @@
#!/usr/bin/env sh
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
declare -a examples=("api" "sidecar" "updater" "resources" "tauri-dynamic-lib")
declare -a examples=("api" "sidecar" "updater" "resources" "tauri-dynamic-lib" "workspace")
declare -a tooling=("bench" "cli" "webdriver")
for example in "${examples[@]}"

View File

@@ -1,6 +1,10 @@
: Copyright 2019-2023 Tauri Programme within The Commons Conservancy
: SPDX-License-Identifier: Apache-2.0
: SPDX-License-Identifier: MIT
@ECHO OFF
REM Copyright 2019-2021 Tauri Programme within The Commons Conservancy
REM Copyright 2019-2023 Tauri Programme within The Commons Conservancy
REM SPDX-License-Identifier: Apache-2.0
REM SPDX-License-Identifier: MIT
@@ -59,4 +63,4 @@ IF EXIST %SourceFiles% DEL %SourceFiles%
IF EXIST %Config% DEL %Config%
IF EXIST %Source7ZFile% DEL %Source7ZFile%
ENDLOCAL
ENDLOCAL

View File

@@ -1,5 +1,6 @@
# The Tauri Architecture
https://tauri.studio
https://tauri.app
https://github.com/tauri-apps/tauri
## Introduction
@@ -38,16 +39,16 @@ This is common code that is reused in many places and offers useful utilities li
### Tauri Tooling
#### [api](https://github.com/tauri-apps/tauri/tree/dev/tooling/api) [TS -> JS]
A typescript library that creates `cjs` and `esm` Javascript endpoints for you to import into your Frontend framework so that the Webview can call and listen to backend activity. We also ship the pure typescript, because for some frameworks this is more optimal. It uses the message passing of webviews to their hosts.
#### [@tauri-apps/api](https://github.com/tauri-apps/tauri/tree/dev/tooling/api) [TS -> JS]
A TypeScript library that creates `cjs` and `esm` JavaScript endpoints for you to import into your Frontend framework so that the Webview can call and listen to backend activity. We also ship the pure TypeScript, because for some frameworks this is more optimal. It uses the message passing of webviews to their hosts.
#### [bundler](https://github.com/tauri-apps/tauri/tree/dev/tooling/bundler) [RUST / SHELL]
The bundler is a library that builds a Tauri App for the platform triple it detects / is told. At the moment it currently supports macOS, Windows and Linux - but in the near future will support mobile platforms as well. May be used outside of Tauri projects.
#### [cli.js](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli/node) [JS]
It is a wrapper around [cli.rs](https://github.com/tauri-apps/tauri/blob/dev/tooling/cli) using [napi-rs](https://github.com/napi-rs/napi-rs) to produce NPM packages for each platform.
#### [@tauri-apps/cli](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli/node) [JS]
It is a wrapper around [tauri-cli](https://github.com/tauri-apps/tauri/blob/dev/tooling/cli) using [napi-rs](https://github.com/napi-rs/napi-rs) to produce NPM packages for each platform.
#### [cli.rs](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli) [RUST]
#### [tauri-cli](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli) [RUST]
This rust executable provides the full interface to all of the required activities for which the CLI is required. It will run on macOS, Windows, and Linux.
#### [create-tauri-app](https://github.com/tauri-apps/create-tauri-app) [JS]
@@ -66,9 +67,6 @@ Tauri uses WRY as the abstract layer responsible to determine which webview is u
# Additional tooling
## [binary-releases](https://github.com/tauri-apps/binary-releases)
This is the delivery mechanism for tauri prebuilt binaries: currently the cli.rs (used by cli.js) and rustup binaries (used by the deps install command of cli.js). These artifacts are automatically created on release.
## [tauri-action](https://github.com/tauri-apps/tauri-action)
This is a github workflow that builds tauri binaries for all platforms. It is not the fastest out there, but it gets the job done and is highly configurable. Even allowing you to create a (very basic) tauri app even if tauri is not setup.
@@ -81,7 +79,7 @@ This plugin allows you to very quickly install tauri in a vue-cli project.
## [tauri-vscode](https://github.com/tauri-apps/tauri-vscode)
This project enhances the VS Code interface with several nice-to-have features.
# Tauri Plugins [documentation](https://tauri.studio/en/docs/guides/plugin)
# Tauri Plugins [documentation](https://tauri.app/v1/guides/features/plugin/)
Generally speaking, plugins are authored by third parties (even though there may be official, supported plugins). A plugin generally does 3 things:
1. It provides rust code to do "something".
@@ -118,7 +116,7 @@ This will do several things:
1. start the JS Framework devserver
2. begin the long process of downloading and compiling the rust libraries
3. open an application window with devtools enabled
4. keep a long-lived console alive
4. keep a long-lived console alive
If you change your HTML/CSS/TS/JS, your framework devserver should give you its best shot at instant hot module reloading and you will see the changes instantly.
@@ -148,7 +146,7 @@ After some time, the process will end and you can see the results in the `./src-
End users will be provided with binaries in ways that are appropriate for their systems. Whether macOS, Linux, or Windows, direct download or store installations - they will be able to follow procedures for installing and removing that they are used to.
## What does the Updating flow look like?
When a new version is ready, the developer publishes the new signed artifacts to a server (that they have configured within `tauri.conf.json`).
When a new version is ready, the developer publishes the new signed artifacts to a server (that they have configured within `tauri.conf.json`).
The application can poll this server to see if there is a new release. When there is a new release, the user is prompted to update. The application update is downloaded, verified (checksum & signature), updated, closed, and restarted.

5737
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
# core
"core/tauri",
@@ -8,10 +9,11 @@ members = [
"core/tauri-utils",
"core/tauri-build",
"core/tauri-codegen",
"core/tauri-config-schema",
# integration tests
"core/tests/restart",
"core/tests/app-updater"
"core/tests/app-updater",
]
exclude = [
@@ -19,12 +21,13 @@ exclude = [
"examples/api/src-tauri",
"examples/updater/src-tauri",
"examples/resources/src-tauri",
"examples/sidecar/src-tauri"
"examples/sidecar/src-tauri",
"examples/web/core",
"examples/workspace",
]
# default to small, optimized workspace release binaries
[profile.release]
strip = true
panic = "abort"
codegen-units = 1
lto = true

View File

@@ -6,7 +6,7 @@ PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy
PackageHomePage: https://tauri.app
PackageLicenseDeclared: Apache-2.0
PackageLicenseDeclared: MIT
PackageCopyrightText: 2019-2021, The Tauri Programme in the Commons Conservancy
PackageCopyrightText: 2019-2022, The Tauri Programme in the Commons Conservancy
PackageSummary: <text>Tauri is a rust project that enables developers to make secure
and small desktop applications using a web frontend.
</text>
@@ -17,4 +17,4 @@ Created: 2019-05-20T09:00:00Z
PackageDownloadLocation: git://github.com/tauri-apps/tauri
PackageDownloadLocation: git+https://github.com/tauri-apps/tauri.git
PackageDownloadLocation: git+ssh://github.com/tauri-apps/tauri.git
Creator: Person: Daniel Thompson-Yvetot
Creator: Person: Daniel Thompson-Yvetot

View File

@@ -1,15 +1,13 @@
<img src=".github/splash.png" alt="Tauri" />
[![status](https://img.shields.io/badge/Status-Stable-green.svg)](https://github.com/tauri-apps/tauri/tree/dev)
[![status](https://img.shields.io/badge/status-stable-blue.svg)](https://github.com/tauri-apps/tauri/tree/dev)
[![License](https://img.shields.io/badge/License-MIT%20or%20Apache%202-green.svg)](https://opencollective.com/tauri)
[![test library](https://img.shields.io/github/workflow/status/tauri-apps/tauri/test%20library?label=test%20library)](https://github.com/tauri-apps/tauri/actions?query=workflow%3A%22test+library%22)
[![test core](https://img.shields.io/github/actions/workflow/status/tauri-apps/tauri/test-core.yml?label=test%20core&logo=github)](https://github.com/tauri-apps/tauri/actions/workflows/test-core.yml)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri?ref=badge_shield)
[![Chat Server](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/SpmNs4S)
[![devto](https://img.shields.io/badge/blog-dev.to-black.svg)](https://dev.to/tauri)
[![devto](https://img.shields.io/badge/documentation-tauri.app-purple.svg)](https://tauri.app)
[![Chat Server](https://img.shields.io/badge/chat-discord-7289da.svg)](https://discord.gg/SpmNs4S)
[![website](https://img.shields.io/badge/website-tauri.app-purple.svg)](https://tauri.app)
[![https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg](https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg)](https://good-labs.github.io/greater-good-affirmation)
[![support](https://img.shields.io/badge/sponsor-open%20collective-blue.svg)](https://opencollective.com/tauri)
[![support](https://img.shields.io/badge/sponsor-Open%20Collective-blue.svg)](https://opencollective.com/tauri)
## Current Releases
@@ -27,12 +25,12 @@
### Tooling
| Component | Description | Version | Lin | Win | Mac |
| --------------------------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------ | --- | --- | --- |
| [**bundler**](https://github.com/tauri-apps/tauri/tree/dev/tooling/bundler) | manufacture the final binaries | [![](https://img.shields.io/crates/v/tauri-bundler.svg)](https://crates.io/crates/tauri-bundler) | ✅ | ✅ | ✅ |
| [**api.js**](https://github.com/tauri-apps/tauri/tree/dev/tooling/api) | JS API for interaction with Rust backend | [![](https://img.shields.io/npm/v/@tauri-apps/api.svg)](https://www.npmjs.com/package/@tauri-apps/api) | ✅ | ✅ | ✅ |
| [**cli.rs**](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli) | create, develop and build apps | [![](https://img.shields.io/crates/v/tauri-cli.svg)](https://crates.io/crates/tauri-cli) | ✅ | ✅ | ✅ |
| [**cli.js**](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli/node) | Node.js CLI wrapper for cli.rs | [![](https://img.shields.io/npm/v/@tauri-apps/cli.svg)](https://www.npmjs.com/package/@tauri-apps/cli) | ✅ | ✅ | ✅ |
| Component | Description | Version | Lin | Win | Mac |
| ------------------------------------------------------------------------------------ | ---------------------------------------- | ------------------------------------------------------------------------------------------------------ | --- | --- | --- |
| [**bundler**](https://github.com/tauri-apps/tauri/tree/dev/tooling/bundler) | manufacture the final binaries | [![](https://img.shields.io/crates/v/tauri-bundler.svg)](https://crates.io/crates/tauri-bundler) | ✅ | ✅ | ✅ |
| [**tauri-cli**](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli) | create, develop and build apps | [![](https://img.shields.io/crates/v/tauri-cli.svg)](https://crates.io/crates/tauri-cli) | ✅ | ✅ | ✅ |
| [**@tauri-apps/cli**](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli/node) | Node.js CLI wrapper for `tauri-cli` | [![](https://img.shields.io/npm/v/@tauri-apps/cli.svg)](https://www.npmjs.com/package/@tauri-apps/cli) | ✅ | ✅ | ✅ |
| [**@tauri-apps/api**](https://github.com/tauri-apps/tauri/tree/dev/tooling/api) | JS API for interaction with Rust backend | [![](https://img.shields.io/npm/v/@tauri-apps/api.svg)](https://www.npmjs.com/package/@tauri-apps/api) | ✅ | ✅ | ✅ |
### Utilities and Plugins
@@ -51,7 +49,7 @@ To learn more about the details of how all of these pieces fit together, please
## Get Started
If you are interested in making a tauri app, please visit the [documentation website](https://tauri.studio). This README is directed towards those who are interested in contributing to the core library. But if you just want a quick overview about where `tauri` is at in its development, here's a quick burndown:
If you are interested in making a tauri app, please visit the [documentation website](https://tauri.app). This README is directed towards those who are interested in contributing to the core library. But if you just want a quick overview about where `tauri` is at in its development, here's a quick burndown:
### Platforms
@@ -77,25 +75,21 @@ For **running** Tauri apps we support the below configurations (these are automa
- `webkit2gtk`, `gtk3`, `libayatana-appindicator`<sup>1</sup>
- Fedora (latest 2 versions) with the following packages installed:
- `webkit2gtk3`, `gtk3`, `libappindicator-gtk3`<sup>1</sup>
- Void with the following packages installed:
- `webkit2gtk`, `gtk+3`, `libappindicator`<sup>1</sup>
<sup>1</sup> `appindicator` is only required if system trays are used
### App Bundles
### Features
- [x] App Icons
- [x] Build on macOS (.app, .dmg)
- [x] Build on Linux (.deb, AppImage)
- [x] Build on Windows (.exe, .msi)
- [x] Copy Buffer
- [x] Device Notifications (toast)
- [x] Desktop Bundler (.app, .dmg, .deb, AppImage, .msi)
- [x] Self Updater
- [x] App Signing
- [x] Frameless Mode
- [x] Transparent Mode
- [x] Multiwindow Mode
- [x] Tray
- [ ] deeplink RPC (in progress)
- [ ] One-Time commands (coming soon)
- [x] Native Notifications (toast)
- [x] App Tray
- [x] Core Plugin System
- [x] Scoped Filesystem
- [x] Sidecar
### Security Features
@@ -108,39 +102,9 @@ For **running** Tauri apps we support the below configurations (these are automa
### Utilities
- [x] Rust-based CLI
- [x] GH Action for creating binaries for all platforms
- [x] VS Code Extension
- [x] Tauri Core Plugins
- [x] Update core dependencies automatically from the command line
- [x] Rust-based CLI
### Comparison between Tauri and Electron
| Detail | Tauri | Electron |
| -------------------------- | ------ | -------------------- |
| Installer Size Linux | 3.1 MB | 52.1 MB |
| Memory Consumption Linux | 180 MB | 462 MB |
| Launch Time Linux | 0.39s | 0.80s |
| Interface Service Provider | WRY | Chromium |
| Backend Binding | Rust | Node.js (ECMAScript) |
| Underlying Engine | Rust | V8 (C/C++) |
| FLOSS | Yes | No |
| Multithreading | Yes | Yes |
| Bytecode Delivery | Yes | No |
| Multiple Windows | Yes | Yes |
| Auto Updater | Yes | Yes<sup>1</sup> |
| Custom App Icon | Yes | Yes |
| Windows Binary | Yes | Yes |
| macOS Binary | Yes | Yes |
| Linux Binary | Yes | Yes |
| iOS Binary | Soon | No |
| Android Binary | Soon | No |
| Desktop Tray | Yes | Yes |
| Sidecar Binaries | Yes | No |
#### Notes
1. Electron has no native auto updater on Linux, but is offered by electron-packager
## Development
@@ -155,18 +119,6 @@ Tauri is a system composed of a number of moving pieces:
- Netlify-hosted documentation website
- DigitalOcean Meilisearch instance
### Major Runtimes
- Node.js for running the CLI (deno and pure rust are on the roadmap)
- Cargo for testing, running the dev service, building binaries and as the runtime harness for the webview
### Major Languages
- Rust for the CLI
- ECMAScript bindings to the Rust API, written in typescript
- Rust for bindings, rust side of the API, harnesses
- Rust plugins to Tauri backend
### Operating systems
Tauri core can be developed on Mac, Linux and Windows, but you are encouraged to use the latest possible operating systems and build tools for your OS.
@@ -188,7 +140,7 @@ Documentation in a polyglot system is a tricky proposition. To this end, we pref
Test all the things! We have a number of test suites, but are always looking to improve our coverage:
- Rust (`cargo test`) => sourced via inline `#[cfg(test)]` declarations
- TS (`jest`) => via spec files
- Typescript (`jest`) => via spec files
- Smoke Tests (run on merges to latest)
- eslint, clippy

View File

@@ -13,7 +13,16 @@ If you have found a potential security threat, vulnerability or exploit in Tauri
or one of its upstream dependencies, please DONT create a pull-request, DONT
file an issue on GitHub, DONT mention it on Discord and DONT create a forum thread.
We will be adding contact information to this page very soon.
Please submit your report via the GitHub Private Vulnerability Disclosure functionality.
Find out more about the reporting process [here](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability).
Our team will triage your report and keep you informed about the progress.
We may ask questions or request further guidance on reproduction of the vulnerability in the comments of the advisory, which will be publicized.
Additionally, we may ask you to independently verify our patch, which will be available in the private advisory branch. Please do not publish your vulnerability during the process or before coordinated public disclosure from our side. We try to adhere to common standards of publication within 90-Days of disclosure.
Depending on your decision to accept or deny credit for the vulnerability, you will be publicly attributed to the vulnerability and may be mentioned in our announcements.
At the current time we do not have the financial ability to reward bounties,
but in extreme cases will at our discretion consider a reward.

View File

@@ -1,5 +1,98 @@
# Changelog
## \[1.5.3]
### Dependencies
- Upgraded to `tauri-utils@1.6.0`
- Upgraded to `tauri-codegen@1.4.4`
## \[1.5.2]
### Dependencies
- Upgraded to `tauri-utils@1.5.4`
- Upgraded to `tauri-codegen@1.4.3`
## \[1.5.1]
### Dependencies
- Upgraded to `tauri-utils@1.5.2`
- Upgraded to `tauri-codegen@1.4.2`
## \[1.5.0]
### What's Changed
- [`d1e09da0`](https://www.github.com/tauri-apps/tauri/commit/d1e09da084b849b9e384fc27ed250dd17e72c7a3)([#7918](https://www.github.com/tauri-apps/tauri/pull/7918)) Bump to 1.5 due to tauri-utils dependency bump.
## \[1.4.1]
### Bug Fixes
- [`5ecb46b3`](https://www.github.com/tauri-apps/tauri/commit/5ecb46b3410afd1b5c82494c1e0a91d5a358c41a)([#7773](https://www.github.com/tauri-apps/tauri/pull/7773)) Automatically set rpath on macOS if frameworks are bundled and copy frameworks to `src-tauri/target/Frameworks` for usage in development.
- [`290e366a`](https://www.github.com/tauri-apps/tauri/commit/290e366ae98e9a52b1b43bfd3e285150427ebffa)([#7419](https://www.github.com/tauri-apps/tauri/pull/7419)) Correctly copy the WebView2 runtime in development when `webviewInstallMode` is used instead of `webviewFixedRuntimePath`.
### Dependencies
- Upgraded to `tauri-utils@1.5.0`
- Upgraded to `tauri-codegen@1.4.1`
## \[1.4.0]
### Enhancements
- [`52474e47`](https://www.github.com/tauri-apps/tauri/commit/52474e479d695865299d8c8d868fb98b99731020)([#7141](https://www.github.com/tauri-apps/tauri/pull/7141)) Enhance Cargo features check.
- [`af937290`](https://www.github.com/tauri-apps/tauri/commit/af93729031565a69d1fde6cf16bea3b9b6e43a65)([#6676](https://www.github.com/tauri-apps/tauri/pull/6676)) On Windows, set `LegalCopyright` and `FileDescription` file properties on the executable from `tauri.bundle.copyright` and `tauri.bundle.shortDescription`,
- [`d2710e9d`](https://www.github.com/tauri-apps/tauri/commit/d2710e9d2e8fd93975ef6494512370faa8cb3b7e)([#6944](https://www.github.com/tauri-apps/tauri/pull/6944)) Unpin `time`, `ignore`, and `winnow` crate versions. Developers now have to pin crates if needed themselves. A list of crates that need pinning to adhere to Tauri's MSRV will be visible in Tauri's GitHub workflow: https://github.com/tauri-apps/tauri/blob/dev/.github/workflows/test-core.yml#L85.
## \[1.3.0]
- Bump minimum supported Rust version to 1.60.
- [5fdc616d](https://www.github.com/tauri-apps/tauri/commit/5fdc616df9bea633810dcb814ac615911d77222c) feat: Use the zbus-backed of notify-rust ([#6332](https://www.github.com/tauri-apps/tauri/pull/6332)) on 2023-03-31
- Add initial support for building `nsis` bundles on non-Windows platforms.
- [60e6f6c3](https://www.github.com/tauri-apps/tauri/commit/60e6f6c3f1605f3064b5bb177992530ff788ccf0) feat(bundler): Add support for creating NSIS bundles on unix hosts ([#5788](https://www.github.com/tauri-apps/tauri/pull/5788)) on 2023-01-19
- Add `WindowsAttributes::app_manifest` to specify the application manifest on Windows.
- [bca09f7f](https://www.github.com/tauri-apps/tauri/commit/bca09f7f5ff1c9c5a4b51da043bdd5da668a179b) feat(tauri-build): add option to specify Windows manifest, closes [#5584](https://www.github.com/tauri-apps/tauri/pull/5584) ([#5730](https://www.github.com/tauri-apps/tauri/pull/5730)) on 2022-12-14
- Added support for Cargo's workspace inheritance for package information. The cli now also detects inherited `tauri` and `tauri-build` dependencies and disables manifest rewrites accordingly.
- [cd8c074a](https://www.github.com/tauri-apps/tauri/commit/cd8c074ae6592303d3f6844a4fb6d262eae913b2) feat(cli): add support for Cargo's workspace inheritance for the package version, closes [#5070](https://www.github.com/tauri-apps/tauri/pull/5070) ([#5775](https://www.github.com/tauri-apps/tauri/pull/5775)) on 2022-12-14
- [d20a7288](https://www.github.com/tauri-apps/tauri/commit/d20a728892eee1858ab525ab6216cd721f473ab5) feat: Further improve workspace inheritance, closes [#6122](https://www.github.com/tauri-apps/tauri/pull/6122), [#5070](https://www.github.com/tauri-apps/tauri/pull/5070) ([#6144](https://www.github.com/tauri-apps/tauri/pull/6144)) on 2023-01-26
- Pin `winnow` crate to 0.4.1 to keep the 1.60 MSRV.
## \[1.2.1]
- Fix `allowlist > app > show/hide` always disabled when `allowlist > app > all: false`.
- Bumped due to a bump in tauri-utils.
- [bb251087](https://www.github.com/tauri-apps/tauri/commit/bb2510876d0bdff736d36bf3a465cdbe4ad2b90c) fix(core): extend allowlist with `app`'s allowlist, closes [#5650](https://www.github.com/tauri-apps/tauri/pull/5650) ([#5652](https://www.github.com/tauri-apps/tauri/pull/5652)) on 2022-11-18
## \[1.2.0]
- - [7d9aa398](https://www.github.com/tauri-apps/tauri/commit/7d9aa3987efce2d697179ffc33646d086c68030c) feat: bump MSRV to 1.59 ([#5296](https://www.github.com/tauri-apps/tauri/pull/5296)) on 2022-09-28
## \[1.1.1]
- Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs.
- Bumped due to a bump in tauri-utils.
- [c764408d](https://www.github.com/tauri-apps/tauri/commit/c764408da7fae123edd41115bda42fa75a4731d2) fix: Add missing allowlist config for cursor apis, closes [#5207](https://www.github.com/tauri-apps/tauri/pull/5207) ([#5211](https://www.github.com/tauri-apps/tauri/pull/5211)) on 2022-09-16
## \[1.1.0]
- Rerun codegen if assets or icons change.
- [ff8fd761](https://www.github.com/tauri-apps/tauri/commit/ff8fd7619ae894b70f149b192d8635d842827141) fix(tauri-build): rerun if assets or icons change ([#4910](https://www.github.com/tauri-apps/tauri/pull/4910)) on 2022-08-10
- Create the `desktop` and `mobile` cfg aliases.
- [c04d0340](https://www.github.com/tauri-apps/tauri/commit/c04d0340e2f163483f3556c7aabe35322ee71e6a) feat(core): prepare build for mobile targets ([#4830](https://www.github.com/tauri-apps/tauri/pull/4830)) on 2022-08-02
- Added support to configuration files in TOML format (Tauri.toml file).
- [ae83d008](https://www.github.com/tauri-apps/tauri/commit/ae83d008f9e1b89bfc8dddaca42aa5c1fbc36f6d) feat: add support to TOML config file `Tauri.toml`, closes [#4806](https://www.github.com/tauri-apps/tauri/pull/4806) ([#4813](https://www.github.com/tauri-apps/tauri/pull/4813)) on 2022-08-02
- Enhance the dialog style on Windows via the manifest dependency `Microsoft.Windows.Common-Controls v6.0.0.0`.
- [5c5c42ed](https://www.github.com/tauri-apps/tauri/commit/5c5c42edb64adf4250af6891d7d226fda7d4d783) feat(build): use modern dialog styles on Windows, closes [#4709](https://www.github.com/tauri-apps/tauri/pull/4709) ([#4840](https://www.github.com/tauri-apps/tauri/pull/4840)) on 2022-08-02
- Fix root of codegen output when using the `CodegenContext` API.
- [ed581950](https://www.github.com/tauri-apps/tauri/commit/ed581950ea6fd0afee47aa73fb63083d2483429f) fix(tauri-build): use `::tauri` as root for the CodegenContext ([#4894](https://www.github.com/tauri-apps/tauri/pull/4894)) on 2022-08-08
- Return an error if a sidecar is configured with the same file name as the application.
- [5cc1fd0f](https://www.github.com/tauri-apps/tauri/commit/5cc1fd0f7b01b257a461d4e867ddc8cd5072ff15) feat(tauri-build): validate sidecar name, closes [#4780](https://www.github.com/tauri-apps/tauri/pull/4780) closes [#4823](https://www.github.com/tauri-apps/tauri/pull/4823) ([#4814](https://www.github.com/tauri-apps/tauri/pull/4814)) on 2022-08-02
- Only rewrite temporary icon files when the content change, avoid needless rebuilds.
- [f957cbb5](https://www.github.com/tauri-apps/tauri/commit/f957cbb56ccbd8d1c047a978b4579946252a6fd2) fix(codegen): write output file when contents change ([#4889](https://www.github.com/tauri-apps/tauri/pull/4889)) on 2022-08-09
## \[1.0.4]
- Reduce the amount of allocations when converting cases.

View File

@@ -1,6 +1,6 @@
[package]
name = "tauri-build"
version = "1.0.4"
version = "1.5.3"
authors = [ "Tauri Programme within The Commons Conservancy" ]
categories = [ "gui", "web-programming" ]
license = "Apache-2.0 OR MIT"
@@ -8,8 +8,8 @@ homepage = "https://tauri.app"
repository = "https://github.com/tauri-apps/tauri/tree/dev/core/tauri-build"
description = "build time code to pair with https://crates.io/crates/tauri"
edition = "2021"
rust-version = "1.57"
exclude = [ ".license_template", "CHANGELOG.md", "/target" ]
rust-version = "1.60"
exclude = [ "CHANGELOG.md", "/target" ]
readme = "README.md"
[package.metadata.docs.rs]
@@ -19,18 +19,20 @@ rustdoc-args = [ "--cfg", "doc_cfg" ]
[dependencies]
anyhow = "1"
quote = { version = "1", optional = true }
tauri-codegen = { version = "1.0.4", path = "../tauri-codegen", optional = true }
tauri-utils = { version = "1.0.3", path = "../tauri-utils", features = [ "build", "resources" ] }
cargo_toml = "0.11"
tauri-codegen = { version = "1.4.4", path = "../tauri-codegen", optional = true }
tauri-utils = { version = "1.6.0", path = "../tauri-utils", features = [ "build", "resources" ] }
cargo_toml = "0.15"
serde = "1"
serde_json = "1"
heck = "0.4"
json-patch = "0.2"
[target."cfg(windows)".dependencies]
winres = "0.1"
heck = "0.5"
json-patch = "1.2"
tauri-winres = "0.1"
semver = "1"
walkdir = "2"
dirs-next = "2"
[features]
codegen = [ "tauri-codegen", "quote" ]
isolation = [ "tauri-codegen/isolation", "tauri-utils/isolation" ]
config-json5 = [ "tauri-utils/config-json5" ]
config-toml = [ "tauri-utils/config-toml" ]

View File

@@ -2,15 +2,14 @@
<img align="right" src="https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" height="128" width="128">
[![status](https://img.shields.io/badge/Status-Stable-green.svg)](https://github.com/tauri-apps/tauri)
[![Chat Server](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/SpmNs4S)
[![devto](https://img.shields.io/badge/blog-dev.to-black.svg)](https://dev.to/tauri)
![](https://img.shields.io/github/workflow/status/tauri-apps/tauri/test%20library?label=test%20library)
[![devto](https://img.shields.io/badge/documentation-site-purple.svg)](https://tauri.app)
[![status](https://img.shields.io/badge/status-stable-blue.svg)](https://github.com/tauri-apps/tauri/tree/dev)
[![License](https://img.shields.io/badge/License-MIT%20or%20Apache%202-green.svg)](https://opencollective.com/tauri)
[![test core](https://img.shields.io/github/actions/workflow/status/tauri-apps/tauri/test-core.yml?label=test%20core&logo=github)](https://github.com/tauri-apps/tauri/actions/workflows/test-core.yml)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri?ref=badge_shield)
[![Chat Server](https://img.shields.io/badge/chat-discord-7289da.svg)](https://discord.gg/SpmNs4S)
[![website](https://img.shields.io/badge/website-tauri.app-purple.svg)](https://tauri.app)
[![https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg](https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg)](https://good-labs.github.io/greater-good-affirmation)
[![support](https://img.shields.io/badge/sponsor-Opencollective-blue.svg)](https://opencollective.com/tauri)
[![support](https://img.shields.io/badge/sponsor-Open%20Collective-blue.svg)](https://opencollective.com/tauri)
| Component | Version |
| ----------- | ---------------------------------------------------------------------------------------------------------- |

View File

@@ -0,0 +1,211 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use anyhow::{anyhow, Result};
use cargo_toml::{Dependency, Manifest};
use tauri_utils::config::{Config, PatternKind, TauriConfig};
#[derive(Debug, Default, PartialEq, Eq)]
struct Diff {
remove: Vec<String>,
add: Vec<String>,
}
#[derive(Debug, Clone, Copy)]
enum DependencyKind {
Build,
Normal,
}
#[derive(Debug)]
struct AllowlistedDependency {
name: String,
alias: Option<String>,
kind: DependencyKind,
all_cli_managed_features: Option<Vec<&'static str>>,
expected_features: Vec<String>,
}
pub fn check(config: &Config, manifest: &mut Manifest) -> Result<()> {
let dependencies = vec![
AllowlistedDependency {
name: "tauri-build".into(),
alias: None,
kind: DependencyKind::Build,
all_cli_managed_features: Some(vec!["isolation"]),
expected_features: match config.tauri.pattern {
PatternKind::Isolation { .. } => vec!["isolation".to_string()],
_ => vec![],
},
},
AllowlistedDependency {
name: "tauri".into(),
alias: None,
kind: DependencyKind::Normal,
all_cli_managed_features: Some(TauriConfig::all_features()),
expected_features: config
.tauri
.features()
.into_iter()
.map(|f| f.to_string())
.collect::<Vec<String>>(),
},
];
for metadata in dependencies {
let mut name = metadata.name.clone();
let mut deps = find_dependency(manifest, &metadata.name, metadata.kind);
if deps.is_empty() {
if let Some(alias) = &metadata.alias {
deps = find_dependency(manifest, alias, metadata.kind);
name = alias.clone();
}
}
for dep in deps {
if let Err(error) = check_features(dep, &metadata) {
return Err(anyhow!("
The `{}` dependency features on the `Cargo.toml` file does not match the allowlist defined under `tauri.conf.json`.
Please run `tauri dev` or `tauri build` or {}.
", name, error));
}
}
}
Ok(())
}
fn find_dependency(manifest: &mut Manifest, name: &str, kind: DependencyKind) -> Vec<Dependency> {
let dep = match kind {
DependencyKind::Build => manifest.build_dependencies.remove(name),
DependencyKind::Normal => manifest.dependencies.remove(name),
};
if let Some(dep) = dep {
vec![dep]
} else {
let mut deps = Vec::new();
for target in manifest.target.values_mut() {
if let Some(dep) = match kind {
DependencyKind::Build => target.build_dependencies.remove(name),
DependencyKind::Normal => target.dependencies.remove(name),
} {
deps.push(dep);
}
}
deps
}
}
fn features_diff(current: &[String], expected: &[String]) -> Diff {
let mut remove = Vec::new();
let mut add = Vec::new();
for feature in current {
if !expected.contains(feature) {
remove.push(feature.clone());
}
}
for feature in expected {
if !current.contains(feature) {
add.push(feature.clone());
}
}
Diff { remove, add }
}
fn check_features(dependency: Dependency, metadata: &AllowlistedDependency) -> Result<(), String> {
let features = match dependency {
Dependency::Simple(_) => Vec::new(),
Dependency::Detailed(dep) => dep.features,
Dependency::Inherited(dep) => dep.features,
};
let diff = if let Some(all_cli_managed_features) = &metadata.all_cli_managed_features {
features_diff(
&features
.into_iter()
.filter(|f| all_cli_managed_features.contains(&f.as_str()))
.collect::<Vec<String>>(),
&metadata.expected_features,
)
} else {
features_diff(
&features
.into_iter()
.filter(|f| f.starts_with("allow-"))
.collect::<Vec<String>>(),
&metadata.expected_features,
)
};
let mut error_message = String::new();
if !diff.remove.is_empty() {
error_message.push_str("remove the `");
error_message.push_str(&diff.remove.join(", "));
error_message.push_str(if diff.remove.len() == 1 {
"` feature"
} else {
"` features"
});
if !diff.add.is_empty() {
error_message.push_str(" and ");
}
}
if !diff.add.is_empty() {
error_message.push_str("add the `");
error_message.push_str(&diff.add.join(", "));
error_message.push_str(if diff.add.len() == 1 {
"` feature"
} else {
"` features"
});
}
if error_message.is_empty() {
Ok(())
} else {
Err(error_message)
}
}
#[cfg(test)]
mod tests {
use super::Diff;
#[test]
fn array_diff() {
for (current, expected, result) in [
(vec![], vec![], Default::default()),
(
vec!["a".into()],
vec![],
Diff {
remove: vec!["a".into()],
add: vec![],
},
),
(vec!["a".into()], vec!["a".into()], Default::default()),
(
vec!["a".into(), "b".into()],
vec!["a".into()],
Diff {
remove: vec!["b".into()],
add: vec![],
},
),
(
vec!["a".into(), "b".into()],
vec!["a".into(), "c".into()],
Diff {
remove: vec!["b".into()],
add: vec!["c".into()],
},
),
] {
assert_eq!(super::features_diff(&current, &expected), result);
}
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
@@ -10,6 +10,7 @@ use std::{
path::PathBuf,
};
use tauri_codegen::{context_codegen, ContextData};
use tauri_utils::config::{AppUrl, WindowUrl};
// TODO docs
/// A builder for generating a Tauri application context during compile time.
@@ -52,13 +53,13 @@ impl CodegenContext {
///
/// **Note:** This path should be relative to the `OUT_DIR`.
///
/// Don't set this if you are using [`tauri::include_codegen_context!`] as that helper macro
/// Don't set this if you are using [`tauri::tauri_build_context!`] as that helper macro
/// expects the default value. This option can be useful if you are not using the helper and
/// instead using [`std::include!`] on the generated code yourself.
///
/// Defaults to `tauri-build-context.rs`.
///
/// [`tauri::include_codegen_context!`]: https://docs.rs/tauri/0.12/tauri/macro.include_codegen_context.html
/// [`tauri::tauri_build_context!`]: https://docs.rs/tauri/latest/tauri/macro.tauri_build_context.html
#[must_use]
pub fn out_file(mut self, filename: PathBuf) -> Self {
self.out_file = filename;
@@ -85,20 +86,60 @@ impl CodegenContext {
pub fn build(self) -> PathBuf {
match self.try_build() {
Ok(out) => out,
Err(error) => panic!("Error found during Codegen::build: {}", error),
Err(error) => panic!("Error found during Codegen::build: {error}"),
}
}
/// Non-panicking [`Self::build`]
pub fn try_build(self) -> Result<PathBuf> {
let (config, config_parent) = tauri_codegen::get_config(&self.config_path)?;
// rerun if changed
let app_url = if self.dev {
&config.build.dev_path
} else {
&config.build.dist_dir
};
match app_url {
AppUrl::Url(WindowUrl::App(p)) => {
println!("cargo:rerun-if-changed={}", config_parent.join(p).display());
}
AppUrl::Files(files) => {
for path in files {
println!(
"cargo:rerun-if-changed={}",
config_parent.join(path).display()
);
}
}
_ => (),
}
for icon in &config.tauri.bundle.icon {
println!(
"cargo:rerun-if-changed={}",
config_parent.join(icon).display()
);
}
if let Some(tray_icon) = config.tauri.system_tray.as_ref().map(|t| &t.icon_path) {
println!(
"cargo:rerun-if-changed={}",
config_parent.join(tray_icon).display()
);
}
#[cfg(target_os = "macos")]
println!(
"cargo:rerun-if-changed={}",
config_parent.join("Info.plist").display()
);
let code = context_codegen(ContextData {
dev: self.dev,
config,
config_parent,
// it's very hard to have a build script for unit tests, so assume this is always called from
// outside the tauri crate, making the ::tauri root valid.
root: quote::quote!(::tauri::Context),
root: quote::quote!(::tauri),
})?;
// get the full output file path
@@ -120,7 +161,7 @@ impl CodegenContext {
)
})?;
writeln!(file, "{}", code).with_context(|| {
writeln!(file, "{code}").with_context(|| {
format!(
"Unable to write tokenstream to out file during tauri-build {}",
out.display()

View File

@@ -1,4 +1,4 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

View File

@@ -1,19 +1,24 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
#![cfg_attr(doc_cfg, feature(doc_cfg))]
use anyhow::Context;
pub use anyhow::Result;
use cargo_toml::Manifest;
use heck::AsShoutySnakeCase;
use tauri_utils::resources::{external_binaries, resource_relpath, ResourcePaths};
use tauri_utils::{
config::{BundleResources, Config, WebviewInstallMode},
resources::{external_binaries, ResourcePaths},
};
use std::path::{Path, PathBuf};
mod allowlist;
#[cfg(feature = "codegen")]
mod codegen;
#[cfg(windows)]
mod static_vcruntime;
#[cfg(feature = "codegen")]
@@ -35,17 +40,29 @@ fn copy_file(from: impl AsRef<Path>, to: impl AsRef<Path>) -> Result<()> {
Ok(())
}
fn copy_binaries<'a>(binaries: ResourcePaths<'a>, target_triple: &str, path: &Path) -> Result<()> {
fn copy_binaries(
binaries: ResourcePaths,
target_triple: &str,
path: &Path,
package_name: Option<&String>,
) -> Result<()> {
for src in binaries {
let src = src?;
println!("cargo:rerun-if-changed={}", src.display());
let dest = path.join(
src
.file_name()
.expect("failed to extract external binary filename")
.to_string_lossy()
.replace(&format!("-{}", target_triple), ""),
);
let file_name = src
.file_name()
.expect("failed to extract external binary filename")
.to_string_lossy()
.replace(&format!("-{target_triple}"), "");
if package_name.map_or(false, |n| n == &file_name) {
return Err(anyhow::anyhow!(
"Cannot define a sidecar with the same name as the Cargo package name `{}`. Please change the sidecar name in the filesystem and the Tauri configuration.",
file_name
));
}
let dest = path.join(file_name);
if dest.exists() {
std::fs::remove_file(&dest).unwrap();
}
@@ -56,11 +73,117 @@ fn copy_binaries<'a>(binaries: ResourcePaths<'a>, target_triple: &str, path: &Pa
/// Copies resources to a path.
fn copy_resources(resources: ResourcePaths<'_>, path: &Path) -> Result<()> {
for src in resources {
let src = src?;
println!("cargo:rerun-if-changed={}", src.display());
let dest = path.join(resource_relpath(&src));
copy_file(&src, &dest)?;
for resource in resources.iter() {
let resource = resource?;
println!("cargo:rerun-if-changed={}", resource.path().display());
copy_file(resource.path(), path.join(resource.target()))?;
}
Ok(())
}
#[cfg(unix)]
fn symlink_dir(src: &Path, dst: &Path) -> std::io::Result<()> {
std::os::unix::fs::symlink(src, dst)
}
/// Makes a symbolic link to a directory.
#[cfg(windows)]
fn symlink_dir(src: &Path, dst: &Path) -> std::io::Result<()> {
std::os::windows::fs::symlink_dir(src, dst)
}
/// Makes a symbolic link to a file.
#[cfg(unix)]
fn symlink_file(src: &Path, dst: &Path) -> std::io::Result<()> {
std::os::unix::fs::symlink(src, dst)
}
/// Makes a symbolic link to a file.
#[cfg(windows)]
fn symlink_file(src: &Path, dst: &Path) -> std::io::Result<()> {
std::os::windows::fs::symlink_file(src, dst)
}
fn copy_dir(from: &Path, to: &Path) -> Result<()> {
for entry in walkdir::WalkDir::new(from) {
let entry = entry?;
debug_assert!(entry.path().starts_with(from));
let rel_path = entry.path().strip_prefix(from)?;
let dest_path = to.join(rel_path);
if entry.file_type().is_symlink() {
let target = std::fs::read_link(entry.path())?;
if entry.path().is_dir() {
symlink_dir(&target, &dest_path)?;
} else {
symlink_file(&target, &dest_path)?;
}
} else if entry.file_type().is_dir() {
std::fs::create_dir(dest_path)?;
} else {
std::fs::copy(entry.path(), dest_path)?;
}
}
Ok(())
}
// Copies the framework under `{src_dir}/{framework}.framework` to `{dest_dir}/{framework}.framework`.
fn copy_framework_from(src_dir: &Path, framework: &str, dest_dir: &Path) -> Result<bool> {
let src_name = format!("{}.framework", framework);
let src_path = src_dir.join(&src_name);
if src_path.exists() {
copy_dir(&src_path, &dest_dir.join(&src_name))?;
Ok(true)
} else {
Ok(false)
}
}
// Copies the macOS application bundle frameworks to the target folder
fn copy_frameworks(dest_dir: &Path, frameworks: &[String]) -> Result<()> {
std::fs::create_dir_all(dest_dir).with_context(|| {
format!(
"Failed to create frameworks output directory at {:?}",
dest_dir
)
})?;
for framework in frameworks.iter() {
if framework.ends_with(".framework") {
let src_path = PathBuf::from(framework);
let src_name = src_path
.file_name()
.expect("Couldn't get framework filename");
let dest_path = dest_dir.join(src_name);
copy_dir(&src_path, &dest_path)?;
continue;
} else if framework.ends_with(".dylib") {
let src_path = PathBuf::from(framework);
if !src_path.exists() {
return Err(anyhow::anyhow!("Library not found: {}", framework));
}
let src_name = src_path.file_name().expect("Couldn't get library filename");
let dest_path = dest_dir.join(src_name);
copy_file(&src_path, &dest_path)?;
continue;
} else if framework.contains('/') {
return Err(anyhow::anyhow!(
"Framework path should have .framework extension: {}",
framework
));
}
if let Some(home_dir) = dirs_next::home_dir() {
if copy_framework_from(&home_dir.join("Library/Frameworks/"), framework, dest_dir)? {
continue;
}
}
if copy_framework_from(&PathBuf::from("/Library/Frameworks/"), framework, dest_dir)?
|| copy_framework_from(
&PathBuf::from("/Network/Library/Frameworks/"),
framework,
dest_dir,
)?
{
continue;
}
}
Ok(())
}
@@ -78,7 +201,7 @@ fn has_feature(feature: &str) -> bool {
// `alias` must be a snake case string.
fn cfg_alias(alias: &str, has_feature: bool) {
if has_feature {
println!("cargo:rustc-cfg={}", alias);
println!("cargo:rustc-cfg={alias}");
}
}
@@ -94,10 +217,37 @@ pub struct WindowsAttributes {
///
/// For MSVC the Windows SDK has to be installed. It comes with the resource compiler rc.exe.
/// This should be set to the root directory of the Windows SDK, e.g., "C:\Program Files (x86)\Windows Kits\10" or,
/// if multiple 10 versions are installed, set it directly to the corret bin directory "C:\Program Files (x86)\Windows Kits\10\bin\10.0.14393.0\x64"
/// if multiple 10 versions are installed, set it directly to the correct bin directory "C:\Program Files (x86)\Windows Kits\10\bin\10.0.14393.0\x64"
///
/// If it is left unset, it will look up a path in the registry, i.e. HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots
sdk_dir: Option<PathBuf>,
/// A string containing an [application manifest] to be included with the application on Windows.
///
/// Defaults to:
/// ```text
#[doc = include_str!("window-app-manifest.xml")]
/// ```
///
/// ## Warning
///
/// if you are using tauri's dialog APIs, you need to specify a dependency on Common Control v6 by adding the following to your custom manifest:
/// ```text
/// <dependency>
/// <dependentAssembly>
/// <assemblyIdentity
/// type="win32"
/// name="Microsoft.Windows.Common-Controls"
/// version="6.0.0.0"
/// processorArchitecture="*"
/// publicKeyToken="6595b64144ccf1df"
/// language="*"
/// />
/// </dependentAssembly>
/// </dependency>
/// ```
///
/// [application manifest]: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests
app_manifest: Option<String>,
}
impl WindowsAttributes {
@@ -123,6 +273,63 @@ impl WindowsAttributes {
self.sdk_dir = Some(sdk_dir.as_ref().into());
self
}
/// Sets the [application manifest] to be included with the application on Windows.
///
/// Defaults to:
/// ```text
#[doc = include_str!("window-app-manifest.xml")]
/// ```
///
/// ## Warning
///
/// if you are using tauri's dialog APIs, you need to specify a dependency on Common Control v6 by adding the following to your custom manifest:
/// ```text
/// <dependency>
/// <dependentAssembly>
/// <assemblyIdentity
/// type="win32"
/// name="Microsoft.Windows.Common-Controls"
/// version="6.0.0.0"
/// processorArchitecture="*"
/// publicKeyToken="6595b64144ccf1df"
/// language="*"
/// />
/// </dependentAssembly>
/// </dependency>
/// ```
///
/// # Example
///
/// The following manifest will brand the exe as requesting administrator privileges.
/// Thus, everytime it is executed, a Windows UAC dialog will appear.
///
/// ```rust,no_run
/// let mut windows = tauri_build::WindowsAttributes::new();
/// windows = windows.app_manifest(r#"
/// <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
/// <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
/// <security>
/// <requestedPrivileges>
/// <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
/// </requestedPrivileges>
/// </security>
/// </trustInfo>
/// </assembly>
/// "#);
/// let attrs = tauri_build::Attributes::new().windows_attributes(windows);
/// tauri_build::try_build(attrs).expect("failed to run build script");
/// ```
///
/// Note that you can move the manifest contents to a separate file and use `include_str!("manifest.xml")`
/// instead of the inline string.
///
/// [manifest]: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests
#[must_use]
pub fn app_manifest<S: AsRef<str>>(mut self, manifest: S) -> Self {
self.app_manifest = Some(manifest.as_ref().to_string());
self
}
}
/// The attributes used on the build.
@@ -167,8 +374,8 @@ impl Attributes {
/// This is typically desirable when running inside a build script; see [`try_build`] for no panics.
pub fn build() {
if let Err(error) = try_build(Attributes::default()) {
let error = format!("{:#}", error);
println!("{}", error);
let error = format!("{error:#}");
println!("{error}");
if error.starts_with("unknown field") {
print!("found an unknown configuration field. This usually means that you are using a CLI version that is newer than `tauri-build` and is incompatible. ");
println!(
@@ -183,13 +390,18 @@ pub fn build() {
#[allow(unused_variables)]
pub fn try_build(attributes: Attributes) -> Result<()> {
use anyhow::anyhow;
use cargo_toml::{Dependency, Manifest};
use tauri_utils::config::{Config, TauriConfig};
println!("cargo:rerun-if-env-changed=TAURI_CONFIG");
println!("cargo:rerun-if-changed=tauri.conf.json");
#[cfg(feature = "config-json5")]
println!("cargo:rerun-if-changed=tauri.conf.json5");
#[cfg(feature = "config-toml")]
println!("cargo:rerun-if-changed=Tauri.toml");
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
let mobile = target_os == "ios" || target_os == "android";
cfg_alias("desktop", !mobile);
cfg_alias("mobile", mobile);
let mut config = serde_json::from_value(tauri_utils::config::parse::read_from(
std::env::current_dir().unwrap(),
@@ -202,58 +414,22 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
cfg_alias("dev", !has_feature("custom-protocol"));
let mut manifest = Manifest::from_path("Cargo.toml")?;
if let Some(tauri) = manifest.dependencies.remove("tauri") {
let features = match tauri {
Dependency::Simple(_) => Vec::new(),
Dependency::Detailed(dep) => dep.features,
};
let ws_path = get_workspace_dir()?;
let mut manifest =
Manifest::<cargo_toml::Value>::from_slice_with_metadata(&std::fs::read("Cargo.toml")?)?;
let all_cli_managed_features = TauriConfig::all_features();
let diff = features_diff(
&features
.into_iter()
.filter(|f| all_cli_managed_features.contains(&f.as_str()))
.collect::<Vec<String>>(),
&config
.tauri
.features()
.into_iter()
.map(|f| f.to_string())
.collect::<Vec<String>>(),
);
let mut error_message = String::new();
if !diff.remove.is_empty() {
error_message.push_str("remove the `");
error_message.push_str(&diff.remove.join(", "));
error_message.push_str(if diff.remove.len() == 1 {
"` feature"
} else {
"` features"
});
if !diff.add.is_empty() {
error_message.push_str(" and ");
}
}
if !diff.add.is_empty() {
error_message.push_str("add the `");
error_message.push_str(&diff.add.join(", "));
error_message.push_str(if diff.add.len() == 1 {
"` feature"
} else {
"` features"
});
}
if !error_message.is_empty() {
return Err(anyhow!("
The `tauri` dependency features on the `Cargo.toml` file does not match the allowlist defined under `tauri.conf.json`.
Please run `tauri dev` or `tauri build` or {}.
", error_message));
}
if let Ok(ws_manifest) = Manifest::from_path(ws_path.join("Cargo.toml")) {
Manifest::complete_from_path_and_workspace(
&mut manifest,
Path::new("Cargo.toml"),
Some((&ws_manifest, ws_path.as_path())),
)?;
} else {
Manifest::complete_from_path(&mut manifest, Path::new("Cargo.toml"))?;
}
allowlist::check(&config, &mut manifest)?;
let target_triple = std::env::var("TARGET").unwrap();
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());
// TODO: far from ideal, but there's no other way to get the target dir, see <https://github.com/rust-lang/cargo/issues/5457>
@@ -270,30 +446,60 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
ResourcePaths::new(external_binaries(paths, &target_triple).as_slice(), true),
&target_triple,
target_dir,
manifest.package.as_ref().map(|p| &p.name),
)?;
}
#[allow(unused_mut, clippy::redundant_clone)]
let mut resources = config.tauri.bundle.resources.clone().unwrap_or_default();
#[cfg(windows)]
if let Some(fixed_webview2_runtime_path) = &config.tauri.bundle.windows.webview_fixed_runtime_path
{
resources.push(fixed_webview2_runtime_path.display().to_string());
let mut resources = config
.tauri
.bundle
.resources
.clone()
.unwrap_or_else(|| BundleResources::List(Vec::new()));
if target_triple.contains("windows") {
if let Some(fixed_webview2_runtime_path) =
match &config.tauri.bundle.windows.webview_fixed_runtime_path {
Some(path) => Some(path),
None => match &config.tauri.bundle.windows.webview_install_mode {
WebviewInstallMode::FixedRuntime { path } => Some(path),
_ => None,
},
}
{
resources.push(fixed_webview2_runtime_path.display().to_string());
}
}
match resources {
BundleResources::List(res) => {
copy_resources(ResourcePaths::new(res.as_slice(), true), target_dir)?
}
BundleResources::Map(map) => copy_resources(ResourcePaths::from_map(&map, true), target_dir)?,
}
copy_resources(ResourcePaths::new(resources.as_slice(), true), target_dir)?;
#[cfg(target_os = "macos")]
{
if let Some(version) = config.tauri.bundle.macos.minimum_system_version {
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET={}", version);
if target_triple.contains("darwin") {
if let Some(frameworks) = &config.tauri.bundle.macos.frameworks {
if !frameworks.is_empty() {
let frameworks_dir = target_dir.parent().unwrap().join("Frameworks");
let _ = std::fs::remove_dir_all(&frameworks_dir);
// copy frameworks to the root `target` folder (instead of `target/debug` for instance)
// because the rpath is set to `@executable_path/../Frameworks`.
copy_frameworks(&frameworks_dir, frameworks)?;
// If we have frameworks, we need to set the @rpath
// https://github.com/tauri-apps/tauri/issues/7710
println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path/../Frameworks");
}
}
if let Some(version) = &config.tauri.bundle.macos.minimum_system_version {
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET={version}");
}
}
#[cfg(windows)]
{
use anyhow::Context;
if target_triple.contains("windows") {
use semver::Version;
use winres::{VersionInfo, WindowsResource};
use tauri_winres::{VersionInfo, WindowsResource};
fn find_icon<F: Fn(&&String) -> bool>(config: &Config, predicate: F, default: &str) -> PathBuf {
let icon_path = config
@@ -314,27 +520,30 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
if window_icon_path.exists() {
let mut res = WindowsResource::new();
if let Some(sdk_dir) = &attributes.windows_attributes.sdk_dir {
if let Some(sdk_dir_str) = sdk_dir.to_str() {
res.set_toolkit_path(sdk_dir_str);
} else {
return Err(anyhow!(
"sdk_dir path is not valid; only UTF-8 characters are allowed"
));
}
if let Some(manifest) = attributes.windows_attributes.app_manifest {
res.set_manifest(&manifest);
} else {
res.set_manifest(include_str!("window-app-manifest.xml"));
}
if let Some(version) = &config.package.version {
if let Ok(v) = Version::parse(version) {
if let Some(version_str) = &config.package.version {
if let Ok(v) = Version::parse(version_str) {
let version = v.major << 48 | v.minor << 32 | v.patch << 16;
res.set_version_info(VersionInfo::FILEVERSION, version);
res.set_version_info(VersionInfo::PRODUCTVERSION, version);
}
res.set("FileVersion", version);
res.set("ProductVersion", version);
res.set("FileVersion", version_str);
res.set("ProductVersion", version_str);
}
if let Some(product_name) = &config.package.product_name {
res.set("ProductName", product_name);
res.set("FileDescription", product_name);
}
if let Some(short_description) = &config.tauri.bundle.short_description {
res.set("FileDescription", short_description);
}
if let Some(copyright) = &config.tauri.bundle.copyright {
res.set("LegalCopyright", copyright);
}
res.set_icon_with_id(&window_icon_path.display().to_string(), "32512");
res.compile().with_context(|| {
@@ -386,65 +595,22 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
Ok(())
}
#[derive(Debug, Default, PartialEq, Eq)]
struct Diff {
remove: Vec<String>,
add: Vec<String>,
#[derive(serde::Deserialize)]
struct CargoMetadata {
workspace_root: PathBuf,
}
fn features_diff(current: &[String], expected: &[String]) -> Diff {
let mut remove = Vec::new();
let mut add = Vec::new();
for feature in current {
if !expected.contains(feature) {
remove.push(feature.clone());
}
fn get_workspace_dir() -> Result<PathBuf> {
let output = std::process::Command::new("cargo")
.args(["metadata", "--no-deps", "--format-version", "1"])
.output()?;
if !output.status.success() {
return Err(anyhow::anyhow!(
"cargo metadata command exited with a non zero exit code: {}",
String::from_utf8(output.stderr)?
));
}
for feature in expected {
if !current.contains(feature) {
add.push(feature.clone());
}
}
Diff { remove, add }
}
#[cfg(test)]
mod tests {
use super::Diff;
#[test]
fn array_diff() {
for (current, expected, result) in [
(vec![], vec![], Default::default()),
(
vec!["a".into()],
vec![],
Diff {
remove: vec!["a".into()],
add: vec![],
},
),
(vec!["a".into()], vec!["a".into()], Default::default()),
(
vec!["a".into(), "b".into()],
vec!["a".into()],
Diff {
remove: vec!["b".into()],
add: vec![],
},
),
(
vec!["a".into(), "b".into()],
vec!["a".into(), "c".into()],
Diff {
remove: vec!["b".into()],
add: vec!["c".into()],
},
),
] {
assert_eq!(super::features_diff(&current, &expected), result);
}
}
Ok(serde_json::from_slice::<CargoMetadata>(&output.stdout)?.workspace_root)
}

View File

@@ -1,4 +1,4 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
@@ -10,7 +10,7 @@ use std::{env, fs, io::Write, path::Path};
pub fn build() {
override_msvcrt_lib();
// Disable conflicting libraries that aren't hard coded by Rust.
// Disable conflicting libraries that aren't hard coded by Rust
println!("cargo:rustc-link-arg=/NODEFAULTLIB:libvcruntimed.lib");
println!("cargo:rustc-link-arg=/NODEFAULTLIB:vcruntime.lib");
println!("cargo:rustc-link-arg=/NODEFAULTLIB:vcruntimed.lib");
@@ -48,11 +48,11 @@ fn override_msvcrt_lib() {
let f = fs::OpenOptions::new()
.write(true)
.create_new(true)
.open(&path);
.open(path);
if let Ok(mut f) = f {
f.write_all(machine).unwrap();
f.write_all(bytes).unwrap();
}
// Add the output directory to the native library path.
println!("cargo:rustc-link-search=native={}", out_dir);
println!("cargo:rustc-link-search=native={out_dir}");
}

View File

@@ -0,0 +1,14 @@
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

View File

@@ -1,5 +1,74 @@
# Changelog
## \[1.4.4]
### Dependencies
- Upgraded to `tauri-utils@1.6.0`
## \[1.4.3]
### Dependencies
- Upgraded to `tauri-utils@1.5.4`
## \[1.4.2]
### Dependencies
- Upgraded to `tauri-utils@1.5.2`
## \[1.4.1]
### Dependencies
- Upgraded to `tauri-utils@1.5.0`
## \[1.4.0]
### Enhancements
- [`17d5a4f5`](https://www.github.com/tauri-apps/tauri/commit/17d5a4f51f244d3ff42014b5d1b075fad7c636a5)([#6706](https://www.github.com/tauri-apps/tauri/pull/6706)) Early panic if the PNG icon is not RGBA.
- [`d2710e9d`](https://www.github.com/tauri-apps/tauri/commit/d2710e9d2e8fd93975ef6494512370faa8cb3b7e)([#6944](https://www.github.com/tauri-apps/tauri/pull/6944)) Unpin `time`, `ignore`, and `winnow` crate versions. Developers now have to pin crates if needed themselves. A list of crates that need pinning to adhere to Tauri's MSRV will be visible in Tauri's GitHub workflow: https://github.com/tauri-apps/tauri/blob/dev/.github/workflows/test-core.yml#L85.
## \[1.3.0]
- Bump minimum supported Rust version to 1.60.
- [5fdc616d](https://www.github.com/tauri-apps/tauri/commit/5fdc616df9bea633810dcb814ac615911d77222c) feat: Use the zbus-backed of notify-rust ([#6332](https://www.github.com/tauri-apps/tauri/pull/6332)) on 2023-03-31
- Pin `time` to `0.3.15`.
- [3d16461b](https://www.github.com/tauri-apps/tauri/commit/3d16461b68583ba7db037fbc217786e79b46ddf2) fix(core): pin time to 0.3.15 ([#6312](https://www.github.com/tauri-apps/tauri/pull/6312)) on 2023-02-19
## \[1.2.1]
- Fix `allowlist > app > show/hide` always disabled when `allowlist > app > all: false`.
- Bumped due to a bump in tauri-utils.
- [bb251087](https://www.github.com/tauri-apps/tauri/commit/bb2510876d0bdff736d36bf3a465cdbe4ad2b90c) fix(core): extend allowlist with `app`'s allowlist, closes [#5650](https://www.github.com/tauri-apps/tauri/pull/5650) ([#5652](https://www.github.com/tauri-apps/tauri/pull/5652)) on 2022-11-18
## \[1.2.0]
- Properly serialize HTML template tags.
- [aec5537d](https://www.github.com/tauri-apps/tauri/commit/aec5537de0205f62b2ae5c89da04d21930a6fc2e) fix(codegen): serialize template tags, closes [#4410](https://www.github.com/tauri-apps/tauri/pull/4410) ([#5247](https://www.github.com/tauri-apps/tauri/pull/5247)) on 2022-09-28
- - [7d9aa398](https://www.github.com/tauri-apps/tauri/commit/7d9aa3987efce2d697179ffc33646d086c68030c) feat: bump MSRV to 1.59 ([#5296](https://www.github.com/tauri-apps/tauri/pull/5296)) on 2022-09-28
## \[1.1.1]
- Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs.
- Bumped due to a bump in tauri-utils.
- [c764408d](https://www.github.com/tauri-apps/tauri/commit/c764408da7fae123edd41115bda42fa75a4731d2) fix: Add missing allowlist config for cursor apis, closes [#5207](https://www.github.com/tauri-apps/tauri/pull/5207) ([#5211](https://www.github.com/tauri-apps/tauri/pull/5211)) on 2022-09-16
## \[1.1.0]
- Use `TARGET` environment variable for code generation inside build scripts.
- [6ba99689](https://www.github.com/tauri-apps/tauri/commit/6ba99689aa7ed0ffa9072a1c8ab5db12c9bf95af) feat(codegen): use TARGET environment variable if set ([#4921](https://www.github.com/tauri-apps/tauri/pull/4921)) on 2022-08-12
- Added support to configuration files in TOML format (Tauri.toml file).
- [ae83d008](https://www.github.com/tauri-apps/tauri/commit/ae83d008f9e1b89bfc8dddaca42aa5c1fbc36f6d) feat: add support to TOML config file `Tauri.toml`, closes [#4806](https://www.github.com/tauri-apps/tauri/pull/4806) ([#4813](https://www.github.com/tauri-apps/tauri/pull/4813)) on 2022-08-02
- Improve tray icon read error message.
- [52f0c8bb](https://www.github.com/tauri-apps/tauri/commit/52f0c8bb836c6d50b7ce2393161394f4ce78f5ae) feat(core): improve tray icon read error messages ([#4850](https://www.github.com/tauri-apps/tauri/pull/4850)) on 2022-08-03
- Fix relative paths in `version` field of `tauri.config.json` not being correctly parsed by `generate_context!()`.
- [accbc5e8](https://www.github.com/tauri-apps/tauri/commit/accbc5e8806a32efc555d019634fc2fa14d17f0a) fix(codegen): fix relative paths in `version` field of `tauri.config.json`, closes [#4723](https://www.github.com/tauri-apps/tauri/pull/4723) ([#4725](https://www.github.com/tauri-apps/tauri/pull/4725)) on 2022-07-24
- Only rewrite temporary icon files when the content change, avoid needless rebuilds.
- [f957cbb5](https://www.github.com/tauri-apps/tauri/commit/f957cbb56ccbd8d1c047a978b4579946252a6fd2) fix(codegen): write output file when contents change ([#4889](https://www.github.com/tauri-apps/tauri/pull/4889)) on 2022-08-09
## \[1.0.4]
- Validate `__TAURI_ISOLATION_HOOK__` being set by a file in the isolation application.

View File

@@ -1,6 +1,6 @@
[package]
name = "tauri-codegen"
version = "1.0.4"
version = "1.4.4"
authors = [ "Tauri Programme within The Commons Conservancy" ]
categories = [ "gui", "web-programming" ]
license = "Apache-2.0 OR MIT"
@@ -8,27 +8,27 @@ homepage = "https://tauri.app"
repository = "https://github.com/tauri-apps/tauri/tree/dev/core/tauri-codegen"
description = "code generation meant to be consumed inside of `tauri` through `tauri-build` or `tauri-macros`"
edition = "2021"
rust-version = "1.57"
exclude = [ ".license_template", "CHANGELOG.md", "/target" ]
rust-version = "1.60"
exclude = [ "CHANGELOG.md", "/target" ]
readme = "README.md"
[dependencies]
sha2 = "0.10"
base64 = "0.13"
base64 = "0.21"
proc-macro2 = "1"
quote = "1"
serde = { version = "1", features = [ "derive" ] }
serde_json = "1"
tauri-utils = { version = "1.0.3", path = "../tauri-utils", features = [ "build" ] }
tauri-utils = { version = "1.6.0", path = "../tauri-utils", features = [ "build" ] }
thiserror = "1"
walkdir = "2"
brotli = { version = "3", optional = true, default-features = false, features = [ "std" ] }
regex = { version = "1.6.0", optional = true }
regex = { version = "1", optional = true }
uuid = { version = "1", features = [ "v4" ] }
semver = "1"
ico = "0.1"
ico = "0.3"
png = "0.17"
json-patch = "0.2"
json-patch = "1.2"
[target."cfg(target_os = \"macos\")".dependencies]
plist = "1"
@@ -40,3 +40,4 @@ compression = [ "brotli", "tauri-utils/compression" ]
isolation = [ "tauri-utils/isolation" ]
shell-scope = [ "regex" ]
config-json5 = [ "tauri-utils/config-json5" ]
config-toml = [ "tauri-utils/config-toml" ]

View File

@@ -6,7 +6,7 @@
[![Chat Server](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/SpmNs4S)
[![devto](https://img.shields.io/badge/blog-dev.to-black.svg)](https://dev.to/tauri)
![](https://img.shields.io/github/workflow/status/tauri-apps/tauri/test%20library?label=test%20library)
[![test core](https://img.shields.io/github/actions/workflow/status/tauri-apps/tauri/test-core.yml?label=test%20core&logo=github)](https://github.com/tauri-apps/tauri/actions/workflows/test-core.yml)
[![devto](https://img.shields.io/badge/documentation-site-purple.svg)](https://tauri.app)
[![https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg](https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg)](https://good-labs.github.io/greater-good-affirmation)

View File

@@ -1,17 +1,20 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use std::path::{Path, PathBuf};
use std::{ffi::OsStr, str::FromStr};
use base64::Engine;
use proc_macro2::TokenStream;
use quote::quote;
use sha2::{Digest, Sha256};
use tauri_utils::assets::AssetKey;
use tauri_utils::config::{AppUrl, Config, PatternKind, WindowUrl};
use tauri_utils::html::{inject_nonce_token, parse as parse_html};
use tauri_utils::html::{
inject_nonce_token, parse as parse_html, serialize_node as serialize_html_node,
};
#[cfg(feature = "shell-scope")]
use tauri_utils::config::{ShellAllowedArg, ShellAllowedArgs, ShellAllowlistScope};
@@ -28,6 +31,7 @@ pub struct ContextData {
fn map_core_assets(
options: &AssetOptions,
target: Target,
) -> impl Fn(&AssetKey, &Path, &mut Vec<u8>, &mut CspHashes) -> Result<(), EmbeddedAssetsError> {
#[cfg(feature = "isolation")]
let pattern = tauri_utils::html::PatternObject::from(&options.pattern);
@@ -36,12 +40,13 @@ fn map_core_assets(
options.dangerous_disable_asset_csp_modification.clone();
move |key, path, input, csp_hashes| {
if path.extension() == Some(OsStr::new("html")) {
let mut document = parse_html(String::from_utf8_lossy(input).into_owned());
#[allow(clippy::collapsible_if)]
if csp {
#[cfg(target_os = "linux")]
::tauri_utils::html::inject_csp_token(&mut document);
let mut document = parse_html(String::from_utf8_lossy(input).into_owned());
if target == Target::Linux {
::tauri_utils::html::inject_csp_token(&mut document);
}
inject_nonce_token(&mut document, &dangerous_disable_asset_csp_modification);
@@ -53,7 +58,10 @@ fn map_core_assets(
let mut hasher = Sha256::new();
hasher.update(&script);
let hash = hasher.finalize();
scripts.push(format!("'sha256-{}'", base64::encode(&hash)));
scripts.push(format!(
"'sha256-{}'",
base64::engine::general_purpose::STANDARD.encode(hash)
));
}
csp_hashes
.inline_scripts
@@ -70,14 +78,15 @@ fn map_core_assets(
let mut hasher = Sha256::new();
hasher.update(tauri_utils::pattern::isolation::IFRAME_STYLE);
let hash = hasher.finalize();
csp_hashes
.styles
.push(format!("'sha256-{}'", base64::encode(&hash)));
csp_hashes.styles.push(format!(
"'sha256-{}'",
base64::engine::general_purpose::STANDARD.encode(hash)
));
}
}
}
*input = document.to_string().as_bytes().to_vec();
*input = serialize_html_node(&document);
}
}
Ok(())
}
@@ -106,6 +115,16 @@ fn map_isolation(
}
}
#[derive(PartialEq, Eq, Clone, Copy)]
enum Target {
Linux,
Windows,
Darwin,
Android,
// iOS.
Ios,
}
/// Build a `tauri::Context` for including in application code.
pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsError> {
let ContextData {
@@ -115,6 +134,34 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
root,
} = data;
let target = if let Ok(target) = std::env::var("TARGET") {
if target.contains("unknown-linux") {
Target::Linux
} else if target.contains("pc-windows") {
Target::Windows
} else if target.contains("apple-darwin") {
Target::Darwin
} else if target.contains("android") {
Target::Android
} else if target.contains("apple-ios") {
Target::Ios
} else {
panic!("unknown codegen target {target}");
}
} else if cfg!(target_os = "linux") {
Target::Linux
} else if cfg!(windows) {
Target::Windows
} else if cfg!(target_os = "macos") {
Target::Darwin
} else if cfg!(target_os = "android") {
Target::Android
} else if cfg!(target_os = "ios") {
Target::Ios
} else {
panic!("unknown codegen target");
};
let mut options = AssetOptions::new(config.tauri.pattern.clone())
.freeze_prototype(config.tauri.security.freeze_prototype)
.dangerous_disable_asset_csp_modification(
@@ -129,10 +176,10 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
.tauri
.security
.dev_csp
.clone()
.or_else(|| config.tauri.security.csp.clone())
.as_ref()
.or(config.tauri.security.csp.as_ref())
} else {
config.tauri.security.csp.clone()
config.tauri.security.csp.as_ref()
};
if csp.is_some() {
options = options.with_csp();
@@ -162,7 +209,7 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
path
)
}
EmbeddedAssets::new(assets_path, &options, map_core_assets(&options))?
EmbeddedAssets::new(assets_path, &options, map_core_assets(&options, target))?
}
_ => unimplemented!(),
},
@@ -172,7 +219,7 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
.map(|p| config_parent.join(p))
.collect::<Vec<_>>(),
&options,
map_core_assets(&options),
map_core_assets(&options, target),
)?,
_ => unimplemented!(),
};
@@ -189,18 +236,28 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
out_dir
};
// handle default window icons for Windows targets
#[cfg(windows)]
let default_window_icon = {
let icon_path = find_icon(
&config,
&config_parent,
|i| i.ends_with(".ico"),
"icons/icon.ico",
);
if icon_path.exists() {
ico_icon(&root, &out_dir, icon_path)?
} else {
if target == Target::Windows {
// handle default window icons for Windows targets
let icon_path = find_icon(
&config,
&config_parent,
|i| i.ends_with(".ico"),
"icons/icon.ico",
);
if icon_path.exists() {
ico_icon(&root, &out_dir, icon_path)?
} else {
let icon_path = find_icon(
&config,
&config_parent,
|i| i.ends_with(".png"),
"icons/icon.png",
);
png_icon(&root, &out_dir, icon_path)?
}
} else if target == Target::Linux {
// handle default window icons for Linux targets
let icon_path = find_icon(
&config,
&config_parent,
@@ -208,23 +265,12 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
"icons/icon.png",
);
png_icon(&root, &out_dir, icon_path)?
} else {
quote!(None)
}
};
#[cfg(target_os = "linux")]
let default_window_icon = {
let icon_path = find_icon(
&config,
&config_parent,
|i| i.ends_with(".png"),
"icons/icon.png",
);
png_icon(&root, &out_dir, icon_path)?
};
#[cfg(not(any(windows, target_os = "linux")))]
let default_window_icon = quote!(None);
#[cfg(target_os = "macos")]
let app_icon = if dev {
let app_icon = if target == Target::Darwin && dev {
let mut icon_path = find_icon(
&config,
&config_parent,
@@ -243,8 +289,6 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
} else {
quote!(None)
};
#[cfg(not(target_os = "macos"))]
let app_icon = quote!(None);
let package_name = if let Some(product_name) = &config.package.product_name {
quote!(#product_name.to_string())
@@ -283,56 +327,52 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
};
#[cfg(target_os = "macos")]
let info_plist = {
if dev {
let info_plist_path = config_parent.join("Info.plist");
let mut info_plist = if info_plist_path.exists() {
plist::Value::from_file(&info_plist_path)
.unwrap_or_else(|e| panic!("failed to read plist {}: {}", info_plist_path.display(), e))
} else {
plist::Value::Dictionary(Default::default())
};
if let Some(plist) = info_plist.as_dictionary_mut() {
if let Some(product_name) = &config.package.product_name {
plist.insert("CFBundleName".into(), product_name.clone().into());
}
if let Some(version) = &config.package.version {
plist.insert("CFBundleShortVersionString".into(), version.clone().into());
}
let format =
time::format_description::parse("[year][month][day].[hour][minute][second]").unwrap();
if let Ok(build_number) = time::OffsetDateTime::now_utc().format(&format) {
plist.insert("CFBundleVersion".into(), build_number.into());
}
}
let out_path = out_dir.join("Info.plist");
info_plist
.to_file_xml(&out_path)
.expect("failed to write Info.plist");
let info_plist_path = out_path.display().to_string();
quote!({
tauri::embed_plist::embed_info_plist!(#info_plist_path);
})
let info_plist = if target == Target::Darwin && dev {
let info_plist_path = config_parent.join("Info.plist");
let mut info_plist = if info_plist_path.exists() {
plist::Value::from_file(&info_plist_path)
.unwrap_or_else(|e| panic!("failed to read plist {}: {}", info_plist_path.display(), e))
} else {
quote!(())
plist::Value::Dictionary(Default::default())
};
if let Some(plist) = info_plist.as_dictionary_mut() {
if let Some(product_name) = &config.package.product_name {
plist.insert("CFBundleName".into(), product_name.clone().into());
}
if let Some(version) = &config.package.version {
plist.insert("CFBundleShortVersionString".into(), version.clone().into());
}
let format =
time::format_description::parse("[year][month][day].[hour][minute][second]").unwrap();
if let Ok(build_number) = time::OffsetDateTime::now_utc().format(&format) {
plist.insert("CFBundleVersion".into(), build_number.into());
}
}
info_plist
.to_file_xml(out_dir.join("Info.plist"))
.expect("failed to write Info.plist");
quote!({
tauri::embed_plist::embed_info_plist!(concat!(std::env!("OUT_DIR"), "/Info.plist"));
})
} else {
quote!(())
};
#[cfg(not(target_os = "macos"))]
let info_plist = quote!(());
let pattern = match &options.pattern {
PatternKind::Brownfield => quote!(#root::Pattern::Brownfield(std::marker::PhantomData)),
#[cfg(not(feature = "isolation"))]
PatternKind::Isolation { dir: _ } => {
quote!(#root::Pattern::Brownfield(std::marker::PhantomData))
}
#[cfg(feature = "isolation")]
PatternKind::Isolation { dir } => {
let dir = config_parent.join(dir);
if !dir.exists() {
panic!(
"The isolation application path is set to `{:?}` but it does not exist",
dir
)
panic!("The isolation application path is set to `{dir:?}` but it does not exist")
}
let mut sets_isolation_hook = false;
@@ -373,7 +413,7 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
let shell_scope_open = match &config.tauri.allowlist.shell.open {
ShellAllowlistOpen::Flag(false) => quote!(::std::option::Option::None),
ShellAllowlistOpen::Flag(true) => {
quote!(::std::option::Option::Some(#root::regex::Regex::new("^https?://").unwrap()))
quote!(::std::option::Option::Some(#root::regex::Regex::new(r#"^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+"#).unwrap()))
}
ShellAllowlistOpen::Validate(regex) => match Regex::new(regex) {
Ok(_) => quote!(::std::option::Option::Some(#root::regex::Regex::new(#regex).unwrap())),
@@ -415,69 +455,54 @@ fn ico_icon<P: AsRef<Path>>(
out_dir: &Path,
path: P,
) -> Result<TokenStream, EmbeddedAssetsError> {
use std::fs::File;
use std::io::Write;
let path = path.as_ref();
let bytes = std::fs::read(&path)
.unwrap_or_else(|_| panic!("failed to read icon {}", path.display()))
let bytes = std::fs::read(path)
.unwrap_or_else(|e| panic!("failed to read icon {}: {}", path.display(), e))
.to_vec();
let icon_dir = ico::IconDir::read(std::io::Cursor::new(bytes))
.unwrap_or_else(|_| panic!("failed to parse icon {}", path.display()));
.unwrap_or_else(|e| panic!("failed to parse icon {}: {}", path.display(), e));
let entry = &icon_dir.entries()[0];
let rgba = entry
.decode()
.unwrap_or_else(|_| panic!("failed to decode icon {}", path.display()))
.unwrap_or_else(|e| panic!("failed to decode icon {}: {}", path.display(), e))
.rgba_data()
.to_vec();
let width = entry.width();
let height = entry.height();
let out_path = out_dir.join(path.file_name().unwrap());
let mut out_file = File::create(&out_path).map_err(|error| EmbeddedAssetsError::AssetWrite {
path: out_path.clone(),
let icon_file_name = path.file_name().unwrap();
let out_path = out_dir.join(icon_file_name);
write_if_changed(&out_path, &rgba).map_err(|error| EmbeddedAssetsError::AssetWrite {
path: path.to_owned(),
error,
})?;
out_file
.write_all(&rgba)
.map_err(|error| EmbeddedAssetsError::AssetWrite {
path: path.to_owned(),
error,
})?;
let out_path = out_path.display().to_string();
let icon = quote!(Some(#root::Icon::Rgba { rgba: include_bytes!(#out_path).to_vec(), width: #width, height: #height }));
let icon_file_name = icon_file_name.to_str().unwrap();
let icon = quote!(Some(
#root::Icon::Rgba {
rgba: include_bytes!(concat!(std::env!("OUT_DIR"), "/", #icon_file_name)).to_vec(),
width: #width,
height: #height
}));
Ok(icon)
}
#[cfg(target_os = "macos")]
fn raw_icon<P: AsRef<Path>>(out_dir: &Path, path: P) -> Result<TokenStream, EmbeddedAssetsError> {
use std::fs::File;
use std::io::Write;
let path = path.as_ref();
let bytes = std::fs::read(&path)
.unwrap_or_else(|_| panic!("failed to read icon {}", path.display()))
let bytes = std::fs::read(path)
.unwrap_or_else(|e| panic!("failed to read icon {}: {}", path.display(), e))
.to_vec();
let out_path = out_dir.join(path.file_name().unwrap());
let mut out_file = File::create(&out_path).map_err(|error| EmbeddedAssetsError::AssetWrite {
path: out_path.clone(),
write_if_changed(&out_path, &bytes).map_err(|error| EmbeddedAssetsError::AssetWrite {
path: path.to_owned(),
error,
})?;
out_file
.write_all(&bytes)
.map_err(|error| EmbeddedAssetsError::AssetWrite {
path: path.to_owned(),
error,
})?;
let out_path = out_path.display().to_string();
let icon = quote!(Some(include_bytes!(#out_path).to_vec()));
let icon_path = path.file_name().unwrap().to_str().unwrap().to_string();
let icon = quote!(::std::option::Option::Some(
include_bytes!(concat!(std::env!("OUT_DIR"), "/", #icon_path)).to_vec()
));
Ok(icon)
}
@@ -486,17 +511,21 @@ fn png_icon<P: AsRef<Path>>(
out_dir: &Path,
path: P,
) -> Result<TokenStream, EmbeddedAssetsError> {
use std::fs::File;
use std::io::Write;
let path = path.as_ref();
let bytes = std::fs::read(&path)
.unwrap_or_else(|_| panic!("failed to read icon {}", path.display()))
let bytes = std::fs::read(path)
.unwrap_or_else(|e| panic!("failed to read icon {}: {}", path.display(), e))
.to_vec();
let decoder = png::Decoder::new(std::io::Cursor::new(bytes));
let mut reader = decoder
.read_info()
.unwrap_or_else(|_| panic!("failed to read icon {}", path.display()));
.unwrap_or_else(|e| panic!("failed to read icon {}: {}", path.display(), e));
let (color_type, _) = reader.output_color_type();
if color_type != png::ColorType::Rgba {
panic!("icon {} is not RGBA", path.display());
}
let mut buffer: Vec<u8> = Vec::new();
while let Ok(Some(row)) = reader.next_row() {
buffer.extend(row.data());
@@ -504,25 +533,38 @@ fn png_icon<P: AsRef<Path>>(
let width = reader.info().width;
let height = reader.info().height;
let out_path = out_dir.join(path.file_name().unwrap());
let mut out_file = File::create(&out_path).map_err(|error| EmbeddedAssetsError::AssetWrite {
path: out_path.clone(),
let icon_file_name = path.file_name().unwrap();
let out_path = out_dir.join(icon_file_name);
write_if_changed(&out_path, &buffer).map_err(|error| EmbeddedAssetsError::AssetWrite {
path: path.to_owned(),
error,
})?;
out_file
.write_all(&buffer)
.map_err(|error| EmbeddedAssetsError::AssetWrite {
path: path.to_owned(),
error,
})?;
let out_path = out_path.display().to_string();
let icon = quote!(Some(#root::Icon::Rgba { rgba: include_bytes!(#out_path).to_vec(), width: #width, height: #height }));
let icon_file_name = icon_file_name.to_str().unwrap();
let icon = quote!(Some(
#root::Icon::Rgba {
rgba: include_bytes!(concat!(std::env!("OUT_DIR"), "/", #icon_file_name)).to_vec(),
width: #width,
height: #height,
}
));
Ok(icon)
}
fn write_if_changed(out_path: &Path, data: &[u8]) -> std::io::Result<()> {
use std::fs::File;
use std::io::Write;
if let Ok(curr) = std::fs::read(out_path) {
if curr == data {
return Ok(());
}
}
let mut out_file = File::create(out_path)?;
out_file.write_all(data)
}
fn find_icon<F: Fn(&&String) -> bool>(
config: &Config,
config_parent: &Path,

View File

@@ -1,7 +1,8 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use base64::Engine;
use proc_macro2::TokenStream;
use quote::{quote, ToTokens, TokenStreamExt};
use sha2::{Digest, Sha256};
@@ -181,9 +182,10 @@ impl CspHashes {
})?,
);
let hash = hasher.finalize();
self
.scripts
.push(format!("'sha256-{}'", base64::encode(hash)));
self.scripts.push(format!(
"'sha256-{}'",
base64::engine::general_purpose::STANDARD.encode(hash)
));
}
}
@@ -343,14 +345,14 @@ impl EmbeddedAssets {
let mut hex = String::with_capacity(2 * bytes.len());
for b in bytes {
write!(hex, "{:02x}", b).map_err(EmbeddedAssetsError::Hex)?;
write!(hex, "{b:02x}").map_err(EmbeddedAssetsError::Hex)?;
}
hex
};
// use the content hash to determine filename, keep extensions that exist
let out_path = if let Some(ext) = path.extension().and_then(|e| e.to_str()) {
out_dir.join(format!("{}.{}", hash, ext))
out_dir.join(format!("{hash}.{ext}"))
} else {
out_dir.join(hash)
};
@@ -431,6 +433,7 @@ impl ToTokens for EmbeddedAssets {
// we expect phf related items to be in path when generating the path code
tokens.append_all(quote! {{
#[allow(unused)]
use ::tauri::utils::assets::{CspHash, EmbeddedAssets, phf, phf::phf_map};
EmbeddedAssets::new(phf_map! { #assets }, &[#global_hashes], phf_map! { #html_hashes })
}});

View File

@@ -1,4 +1,4 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
@@ -64,5 +64,14 @@ pub fn get_config(path: &Path) -> Result<(Config, PathBuf), CodegenConfigError>
json_patch::merge(&mut config, &merge_config);
}
Ok((serde_json::from_value(config)?, parent))
let old_cwd = std::env::current_dir().map_err(CodegenConfigError::CurrentDir)?;
// Set working directory to where `tauri.config.json` is, so that relative paths in it are parsed correctly.
std::env::set_current_dir(parent.clone()).map_err(CodegenConfigError::CurrentDir)?;
let config = serde_json::from_value(config)?;
// Reset working directory.
std::env::set_current_dir(old_cwd).map_err(CodegenConfigError::CurrentDir)?;
Ok((config, parent))
}

View File

@@ -1,4 +1,4 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

View File

@@ -1,4 +1,4 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

View File

@@ -0,0 +1,14 @@
[package]
name = "tauri-config-schema"
version = "0.0.0"
edition = "2021"
publish = false
[build-dependencies]
tauri-utils = { version = "1.0.0", features = [
"schema",
], path = "../tauri-utils" }
schemars = { version = "0.8.18", features = ["url", "preserve_order"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
url = { version = "2.3", features = ["serde"] }

View File

@@ -0,0 +1,25 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use std::{
error::Error,
fs::File,
io::{BufWriter, Write},
path::PathBuf,
};
pub fn main() -> Result<(), Box<dyn Error>> {
let schema = schemars::schema_for!(tauri_utils::config::Config);
let schema_str = serde_json::to_string_pretty(&schema).unwrap();
let crate_dir = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR")?);
for file in [
crate_dir.join("schema.json"),
crate_dir.join("../../tooling/cli/schema.json"),
] {
let mut schema_file = BufWriter::new(File::create(file)?);
write!(schema_file, "{schema_str}")?;
}
Ok(())
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
fn main() {}

View File

@@ -1,5 +1,71 @@
# Changelog
## \[1.4.5]
### Dependencies
- Upgraded to `tauri-utils@1.6.0`
- Upgraded to `tauri-codegen@1.4.4`
## \[1.4.4]
### Dependencies
- Upgraded to `tauri-utils@1.5.4`
- Upgraded to `tauri-codegen@1.4.3`
## \[1.4.3]
### Dependencies
- Upgraded to `tauri-utils@1.5.2`
- Upgraded to `tauri-codegen@1.4.2`
## \[1.4.2]
### Enhancements
- [`5e05236b`](https://www.github.com/tauri-apps/tauri/commit/5e05236b4987346697c7caae0567d3c50714c198)([#8289](https://www.github.com/tauri-apps/tauri/pull/8289)) Added tracing for window startup, plugins, `Window::eval`, events, IPC, updater and custom protocol request handlers behind the `tracing` feature flag.
## \[1.4.1]
### Dependencies
- Upgraded to `tauri-utils@1.5.0`
- Upgraded to `tauri-codegen@1.4.1`
## \[1.4.0]
### Enhancements
- [`d68a25e3`](https://www.github.com/tauri-apps/tauri/commit/d68a25e32e012e57a9e5225b589b9ecbea70a887)([#6124](https://www.github.com/tauri-apps/tauri/pull/6124)) Improve compiler error message when generating an async command that has a reference input and don't return a Result.
## \[1.3.0]
- Bump minimum supported Rust version to 1.60.
- [5fdc616d](https://www.github.com/tauri-apps/tauri/commit/5fdc616df9bea633810dcb814ac615911d77222c) feat: Use the zbus-backed of notify-rust ([#6332](https://www.github.com/tauri-apps/tauri/pull/6332)) on 2023-03-31
## \[1.2.1]
- Fix `allowlist > app > show/hide` always disabled when `allowlist > app > all: false`.
- Bumped due to a bump in tauri-utils.
- [bb251087](https://www.github.com/tauri-apps/tauri/commit/bb2510876d0bdff736d36bf3a465cdbe4ad2b90c) fix(core): extend allowlist with `app`'s allowlist, closes [#5650](https://www.github.com/tauri-apps/tauri/pull/5650) ([#5652](https://www.github.com/tauri-apps/tauri/pull/5652)) on 2022-11-18
## \[1.2.0]
- - [7d9aa398](https://www.github.com/tauri-apps/tauri/commit/7d9aa3987efce2d697179ffc33646d086c68030c) feat: bump MSRV to 1.59 ([#5296](https://www.github.com/tauri-apps/tauri/pull/5296)) on 2022-09-28
## \[1.1.1]
- Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs.
- Bumped due to a bump in tauri-utils.
- [c764408d](https://www.github.com/tauri-apps/tauri/commit/c764408da7fae123edd41115bda42fa75a4731d2) fix: Add missing allowlist config for cursor apis, closes [#5207](https://www.github.com/tauri-apps/tauri/pull/5207) ([#5211](https://www.github.com/tauri-apps/tauri/pull/5211)) on 2022-09-16
## \[1.1.0]
- Added support to configuration files in TOML format (Tauri.toml file).
- [ae83d008](https://www.github.com/tauri-apps/tauri/commit/ae83d008f9e1b89bfc8dddaca42aa5c1fbc36f6d) feat: add support to TOML config file `Tauri.toml`, closes [#4806](https://www.github.com/tauri-apps/tauri/pull/4806) ([#4813](https://www.github.com/tauri-apps/tauri/pull/4813)) on 2022-08-02
## \[1.0.4]
- Adjust command imports to fix `items_after_statements` Clippy warning.

View File

@@ -1,6 +1,6 @@
[package]
name = "tauri-macros"
version = "1.0.4"
version = "1.4.5"
authors = [ "Tauri Programme within The Commons Conservancy" ]
categories = [ "gui", "os", "filesystem", "web-programming" ]
license = "Apache-2.0 OR MIT"
@@ -8,20 +8,20 @@ homepage = "https://tauri.app"
repository = "https://github.com/tauri-apps/tauri"
description = "Macros for the tauri crate."
edition = "2021"
rust-version = "1.57"
exclude = [ ".license_template", "CHANGELOG.md", "/target" ]
rust-version = "1.60"
exclude = [ "CHANGELOG.md", "/target" ]
readme = "README.md"
[lib]
proc-macro = true
[dependencies]
proc-macro2 = "1"
proc-macro2 = { version = "1", features = [ "span-locations" ] }
quote = "1"
syn = { version = "1", features = [ "full" ] }
heck = "0.4"
tauri-codegen = { version = "1.0.4", default-features = false, path = "../tauri-codegen" }
tauri-utils = { version = "1.0.3", path = "../tauri-utils" }
heck = "0.5"
tauri-codegen = { version = "1.4.4", default-features = false, path = "../tauri-codegen" }
tauri-utils = { version = "1.6.0", path = "../tauri-utils" }
[features]
custom-protocol = [ ]
@@ -29,3 +29,5 @@ compression = [ "tauri-codegen/compression" ]
isolation = [ "tauri-codegen/isolation" ]
shell-scope = [ "tauri-codegen/shell-scope" ]
config-json5 = [ "tauri-codegen/config-json5", "tauri-utils/config-json5" ]
config-toml = [ "tauri-codegen/config-toml", "tauri-utils/config-toml" ]
tracing = [ ]

View File

@@ -2,15 +2,14 @@
<img align="right" src="https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" height="128" width="128">
[![status](https://img.shields.io/badge/Status-Stable-green.svg)](https://github.com/tauri-apps/tauri)
[![Chat Server](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/SpmNs4S)
[![devto](https://img.shields.io/badge/blog-dev.to-black.svg)](https://dev.to/tauri)
![](https://img.shields.io/github/workflow/status/tauri-apps/tauri/test%20library?label=test%20library)
[![devto](https://img.shields.io/badge/documentation-site-purple.svg)](https://tauri.app)
[![status](https://img.shields.io/badge/status-stable-blue.svg)](https://github.com/tauri-apps/tauri/tree/dev)
[![License](https://img.shields.io/badge/License-MIT%20or%20Apache%202-green.svg)](https://opencollective.com/tauri)
[![test core](https://img.shields.io/github/actions/workflow/status/tauri-apps/tauri/test-core.yml?label=test%20core&logo=github)](https://github.com/tauri-apps/tauri/actions/workflows/test-core.yml)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri?ref=badge_shield)
[![Chat Server](https://img.shields.io/badge/chat-discord-7289da.svg)](https://discord.gg/SpmNs4S)
[![website](https://img.shields.io/badge/website-tauri.app-purple.svg)](https://tauri.app)
[![https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg](https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg)](https://good-labs.github.io/greater-good-affirmation)
[![support](https://img.shields.io/badge/sponsor-Opencollective-blue.svg)](https://opencollective.com/tauri)
[![support](https://img.shields.io/badge/sponsor-Open%20Collective-blue.svg)](https://opencollective.com/tauri)
| Component | Version |
| ------------ | ------------------------------------------------------------------------------------------------------------ |

View File

@@ -1,4 +1,4 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

View File

@@ -1,4 +1,4 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

View File

@@ -1,40 +1,83 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use heck::{ToLowerCamelCase, ToSnakeCase};
use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2;
use quote::{format_ident, quote};
use quote::{format_ident, quote, quote_spanned};
use syn::{
ext::IdentExt,
parse::{Parse, ParseBuffer},
parse::{Parse, ParseStream},
parse_macro_input,
spanned::Spanned,
FnArg, Ident, ItemFn, Pat, Token, Visibility,
FnArg, Ident, ItemFn, Lit, Meta, Pat, Token, Visibility,
};
struct WrapperAttributes {
execution_context: ExecutionContext,
argument_case: ArgumentCase,
}
impl Parse for WrapperAttributes {
fn parse(input: ParseStream) -> syn::Result<Self> {
let mut wrapper_attributes = WrapperAttributes {
execution_context: ExecutionContext::Blocking,
argument_case: ArgumentCase::Camel,
};
loop {
match input.parse::<Meta>() {
Ok(Meta::List(_)) => {}
Ok(Meta::NameValue(v)) => {
if v.path.is_ident("rename_all") {
if let Lit::Str(s) = v.lit {
wrapper_attributes.argument_case = match s.value().as_str() {
"snake_case" => ArgumentCase::Snake,
"camelCase" => ArgumentCase::Camel,
_ => {
return Err(syn::Error::new(
s.span(),
"expected \"camelCase\" or \"snake_case\"",
))
}
};
}
}
}
Ok(Meta::Path(p)) => {
if p.is_ident("async") {
wrapper_attributes.execution_context = ExecutionContext::Async;
} else {
return Err(syn::Error::new(p.span(), "expected `async`"));
}
}
Err(_e) => {
break;
}
}
let lookahead = input.lookahead1();
if lookahead.peek(Token![,]) {
input.parse::<Token![,]>()?;
}
}
Ok(wrapper_attributes)
}
}
/// The execution context of the command.
enum ExecutionContext {
Async,
Blocking,
}
impl Parse for ExecutionContext {
fn parse(input: &ParseBuffer<'_>) -> syn::Result<Self> {
if input.is_empty() {
return Ok(Self::Blocking);
}
input
.parse::<Token![async]>()
.map(|_| Self::Async)
.map_err(|_| {
syn::Error::new(
input.span(),
"only a single item `async` is currently allowed",
)
})
}
/// The case of each argument name.
#[derive(Copy, Clone)]
enum ArgumentCase {
Snake,
Camel,
}
/// The bindings we attach to `tauri::Invoke`.
@@ -60,22 +103,113 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {
resolver: format_ident!("__tauri_resolver__"),
};
// Tauri currently doesn't support async commands that take a reference as input and don't return
// a result. See: https://github.com/tauri-apps/tauri/issues/2533
//
// For now, we provide an informative error message to the user in that case. Once #2533 is
// resolved, this check can be removed.
let mut async_command_check = TokenStream2::new();
if function.sig.asyncness.is_some() {
// This check won't catch all possible problems but it should catch the most common ones.
let mut ref_argument_span = None;
for arg in &function.sig.inputs {
if let syn::FnArg::Typed(pat) = arg {
match &*pat.ty {
syn::Type::Reference(_) => {
ref_argument_span = Some(pat.span());
}
syn::Type::Path(path) => {
// Check if the type contains a lifetime argument
let last = path.path.segments.last().unwrap();
if let syn::PathArguments::AngleBracketed(args) = &last.arguments {
if args
.args
.iter()
.any(|arg| matches!(arg, syn::GenericArgument::Lifetime(_)))
{
ref_argument_span = Some(pat.span());
}
}
}
_ => {}
}
if let Some(span) = ref_argument_span {
if let syn::ReturnType::Type(_, return_type) = &function.sig.output {
// To check if the return type is `Result` we require it to check a trait that is
// only implemented by `Result`. That way we don't exclude renamed result types
// which we wouldn't otherwise be able to detect purely from the token stream.
// The "error message" displayed to the user is simply the trait name.
async_command_check = quote_spanned! {return_type.span() =>
#[allow(unreachable_code, clippy::diverging_sub_expression)]
const _: () = if false {
trait AsyncCommandMustReturnResult {}
impl<A, B> AsyncCommandMustReturnResult for ::std::result::Result<A, B> {}
let _check: #return_type = unreachable!();
let _: &dyn AsyncCommandMustReturnResult = &_check;
};
};
} else {
return quote_spanned! {
span => compile_error!("async commands that contain references as inputs must return a `Result`");
}.into();
}
}
}
}
}
// body to the command wrapper or a `compile_error!` of an error occurred while parsing it.
let body = syn::parse::<ExecutionContext>(attributes)
.map(|context| match function.sig.asyncness {
Some(_) => ExecutionContext::Async,
None => context,
let (body, attributes) = syn::parse::<WrapperAttributes>(attributes)
.map(|mut attrs| {
if function.sig.asyncness.is_some() {
attrs.execution_context = ExecutionContext::Async;
}
attrs
})
.and_then(|context| match context {
ExecutionContext::Async => body_async(&function, &invoke),
ExecutionContext::Blocking => body_blocking(&function, &invoke),
.and_then(|attrs| {
let body = match attrs.execution_context {
ExecutionContext::Async => body_async(&function, &invoke, attrs.argument_case),
ExecutionContext::Blocking => body_blocking(&function, &invoke, attrs.argument_case),
};
body.map(|b| (b, Some(attrs)))
})
.unwrap_or_else(syn::Error::into_compile_error);
.unwrap_or_else(|e| (syn::Error::into_compile_error(e), None));
let Invoke { message, resolver } = invoke;
let kind = match attributes.as_ref().map(|a| &a.execution_context) {
Some(ExecutionContext::Async) if function.sig.asyncness.is_none() => "sync_threadpool",
Some(ExecutionContext::Async) => "async",
Some(ExecutionContext::Blocking) => "sync",
_ => "sync",
};
let loc = function.span().start();
let line = loc.line;
let col = loc.column;
let maybe_span = if cfg!(feature = "tracing") {
quote!({
let _span = tracing::debug_span!(
"ipc::request::handler",
cmd = #message.command(),
kind = #kind,
loc.line = #line,
loc.col = #col,
is_internal = false,
)
.entered();
})
} else {
quote!()
};
// Rely on rust 2018 edition to allow importing a macro from a path.
quote!(
#async_command_check
#function
#maybe_macro_export
@@ -89,6 +223,8 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {
#[allow(unused_variables)]
let ::tauri::Invoke { message: #message, resolver: #resolver } = $invoke;
#maybe_span
#body
}};
}
@@ -105,9 +241,23 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {
/// See the [`tauri::command`] module for all the items and traits that make this possible.
///
/// [`tauri::command`]: https://docs.rs/tauri/*/tauri/runtime/index.html
fn body_async(function: &ItemFn, invoke: &Invoke) -> syn::Result<TokenStream2> {
fn body_async(function: &ItemFn, invoke: &Invoke, case: ArgumentCase) -> syn::Result<TokenStream2> {
let Invoke { message, resolver } = invoke;
parse_args(function, message).map(|args| {
parse_args(function, message, case).map(|args| {
#[cfg(feature = "tracing")]
quote! {
use tracing::Instrument;
let span = tracing::debug_span!("ipc::request::run");
#resolver.respond_async_serialized(async move {
let result = $path(#(#args?),*);
let kind = (&result).async_kind();
kind.future(result).await
}
.instrument(span));
}
#[cfg(not(feature = "tracing"))]
quote! {
#resolver.respond_async_serialized(async move {
let result = $path(#(#args?),*);
@@ -123,9 +273,13 @@ fn body_async(function: &ItemFn, invoke: &Invoke) -> syn::Result<TokenStream2> {
/// See the [`tauri::command`] module for all the items and traits that make this possible.
///
/// [`tauri::command`]: https://docs.rs/tauri/*/tauri/runtime/index.html
fn body_blocking(function: &ItemFn, invoke: &Invoke) -> syn::Result<TokenStream2> {
fn body_blocking(
function: &ItemFn,
invoke: &Invoke,
case: ArgumentCase,
) -> syn::Result<TokenStream2> {
let Invoke { message, resolver } = invoke;
let args = parse_args(function, message)?;
let args = parse_args(function, message, case)?;
// the body of a `match` to early return any argument that wasn't successful in parsing.
let match_body = quote!({
@@ -133,7 +287,14 @@ fn body_blocking(function: &ItemFn, invoke: &Invoke) -> syn::Result<TokenStream2
Err(err) => return #resolver.invoke_error(err),
});
let maybe_span = if cfg!(feature = "tracing") {
quote!(let _span = tracing::debug_span!("ipc::request::run").entered();)
} else {
quote!()
};
Ok(quote! {
#maybe_span
let result = $path(#(match #args #match_body),*);
let kind = (&result).blocking_kind();
kind.block(result, #resolver);
@@ -141,17 +302,26 @@ fn body_blocking(function: &ItemFn, invoke: &Invoke) -> syn::Result<TokenStream2
}
/// Parse all arguments for the command wrapper to use from the signature of the command function.
fn parse_args(function: &ItemFn, message: &Ident) -> syn::Result<Vec<TokenStream2>> {
fn parse_args(
function: &ItemFn,
message: &Ident,
case: ArgumentCase,
) -> syn::Result<Vec<TokenStream2>> {
function
.sig
.inputs
.iter()
.map(|arg| parse_arg(&function.sig.ident, arg, message))
.map(|arg| parse_arg(&function.sig.ident, arg, message, case))
.collect()
}
/// Transform a [`FnArg`] into a command argument.
fn parse_arg(command: &Ident, arg: &FnArg, message: &Ident) -> syn::Result<TokenStream2> {
fn parse_arg(
command: &Ident,
arg: &FnArg,
message: &Ident,
case: ArgumentCase,
) -> syn::Result<TokenStream2> {
// we have no use for self arguments
let mut arg = match arg {
FnArg::Typed(arg) => arg.pat.as_ref().clone(),
@@ -185,9 +355,13 @@ fn parse_arg(command: &Ident, arg: &FnArg, message: &Ident) -> syn::Result<Token
));
}
// snake_case -> camelCase
if key.as_str().contains('_') {
key = snake_case_to_camel_case(key.as_str());
match case {
ArgumentCase::Camel => {
key = key.to_lower_camel_case();
}
ArgumentCase::Snake => {
key = key.to_snake_case();
}
}
Ok(quote!(::tauri::command::CommandArg::from_command(
@@ -198,19 +372,3 @@ fn parse_arg(command: &Ident, arg: &FnArg, message: &Ident) -> syn::Result<Token
}
)))
}
/// Convert a snake_case string into camelCase, no underscores will be left.
fn snake_case_to_camel_case(key: &str) -> String {
let mut camel = String::with_capacity(key.len());
let mut to_upper = false;
for c in key.chars() {
match c {
'_' => to_upper = true,
c if std::mem::take(&mut to_upper) => camel.push(c.to_ascii_uppercase()),
c => camel.push(c),
}
}
camel
}

View File

@@ -1,4 +1,4 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
@@ -272,12 +272,12 @@ pub fn command_handler(attributes: HandlerAttributes, function: ItemFn) -> Token
pub fn command_test(attributes: HandlerTestAttributes, function: ItemFn) -> TokenStream2 {
let allowlist = attributes.allowlist;
let error_message = attributes.error_message.as_str();
let signature = function.sig.clone();
let signature = &function.sig;
let enum_variant_name = function.sig.ident.to_string().to_lower_camel_case();
let response = match attributes.allowlist_check_kind {
AllowlistCheckKind::Runtime => {
let test_name = function.sig.ident.clone();
let test_name = &signature.ident;
quote!(super::Cmd::#test_name(crate::test::mock_invoke_context()))
}
AllowlistCheckKind::Serde => quote! {

View File

@@ -1,4 +1,4 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
@@ -11,7 +11,7 @@ use syn::{
LitStr, PathArguments, PathSegment, Token,
};
use tauri_codegen::{context_codegen, get_config, ContextData};
use tauri_utils::config::parse::does_supported_extension_exist;
use tauri_utils::config::parse::does_supported_file_name_exist;
pub(crate) struct ContextItems {
config_file: PathBuf,
@@ -36,7 +36,7 @@ impl Parse for ContextItems {
VarError::NotUnicode(_) => "CARGO_MANIFEST_DIR env var contained invalid utf8".into(),
})
.and_then(|path| {
if does_supported_extension_exist(&path) {
if does_supported_file_name_exist(&path) {
Ok(path)
} else {
Err(format!(

View File

@@ -1,4 +1,4 @@
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
@@ -88,7 +88,7 @@ pub fn derive_command_module(input: TokenStream) -> TokenStream {
/// The `run` method takes a `tauri::endpoints::InvokeContext`
/// and returns a `tauri::Result<tauri::endpoints::InvokeResponse>`.
/// It matches on each enum variant and call a method with name equal to the variant name, lowercased and snake_cased,
/// passing the the context and the variant's fields as arguments.
/// passing the context and the variant's fields as arguments.
/// That function must also return the same `Result<InvokeResponse>`.
#[doc(hidden)]
#[proc_macro_attribute]

Some files were not shown because too many files have changed in this diff Show More