mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-10-03 19:48:01 +03:00
chore: run pnpm format on the repo
This commit is contained in:
parent
88a1dd17c3
commit
ab57f9531a
@ -216,9 +216,7 @@
|
||||
"tauri-plugin": {
|
||||
"path": "./core/tauri-plugin",
|
||||
"manager": "rust",
|
||||
"dependencies": [
|
||||
"tauri-utils"
|
||||
],
|
||||
"dependencies": ["tauri-utils"],
|
||||
"postversion": "node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }"
|
||||
},
|
||||
"tauri-build": {
|
||||
|
@ -33,6 +33,7 @@ To do this, open your project with VS Code and run **Remote-Containers: Clone Re
|
||||
Docker Desktop provides facilities for [allowing the development container to connect to a service on the Docker host](https://docs.docker.com/desktop/windows/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host). So long as you have an X window server running on your Docker host, the devcontainer can connect to it and expose your Tauri GUI via an X window.
|
||||
|
||||
**Export the `DISPLAY` variable within the devcontainer terminal you launch your Tauri application from to expose your GUI outside of the devcontainer**.
|
||||
|
||||
```bash
|
||||
export DISPLAY="host.docker.internal:0"
|
||||
```
|
||||
|
@ -11,3 +11,6 @@ dist
|
||||
/tooling/cli/schema.json
|
||||
/core/tauri-config-schema/schema.json
|
||||
CHANGELOG.md
|
||||
*.wxs
|
||||
**/reference.md
|
||||
*schema.json
|
@ -45,7 +45,8 @@ https.get(url, options, (response) => {
|
||||
response.on('end', function () {
|
||||
const data = JSON.parse(chunks.join(''))
|
||||
if (kind === 'cargo') {
|
||||
const versions = data.versions?.filter((v) => v.num.startsWith(target)) ?? []
|
||||
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) =>
|
||||
|
@ -1,103 +1,132 @@
|
||||
# The Tauri Architecture
|
||||
|
||||
https://tauri.app
|
||||
|
||||
https://github.com/tauri-apps/tauri
|
||||
|
||||
## Introduction
|
||||
|
||||
Tauri is a polyglot and generic toolkit that is very composable and allows engineers to make a wide variety of applications. It is used for building applications for Desktop Computers using a combination of Rust tools and HTML rendered in a Webview. Apps built with Tauri can ship with any number of pieces of an optional JS API / Rust API so that webviews can control the system via message passing. In fact, developers can extend the default API with their own functionality and bridge the Webview and Rust-based backend easily.
|
||||
|
||||
Tauri apps can have custom menus and have tray-type interfaces. They can be updated, and are managed by the user's operating system as expected. They are very small, because they use the OS's webview. They do not ship a runtime, since the final binary is compiled from Rust. This makes the reversing of Tauri apps not a trivial task.
|
||||
|
||||
## What Tauri is NOT
|
||||
|
||||
- Tauri is not a lightweight kernel wrapper...instead it directly uses [WRY](#wry) and [TAO](#tao) to do the heavy-lifting in making system calls to the OS.
|
||||
- Tauri is not a VM or virtualized environment...instead it is an application toolkit that allows making Webview OS applications.
|
||||
|
||||
## Major Components
|
||||
|
||||
The following section briefly describes the roles of the various parts of Tauri.
|
||||
|
||||
### Tauri Core [STABLE RUST]
|
||||
|
||||
#### [tauri](https://github.com/tauri-apps/tauri/tree/dev/core/tauri)
|
||||
|
||||
This is the major crate that holds everything together. It brings the runtimes, macros, utilities and API into one final product. It reads the `tauri.conf.json` file at compile time in order to bring in features and undertake actual configuration of the app (and even the `Cargo.toml` file in the project's folder). It handles script injection (for polyfills / prototype revision) at runtime, hosts the API for systems interaction, and even manages updating.
|
||||
|
||||
#### [tauri-build](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-build)
|
||||
|
||||
Apply the macros at build-time in order to rig some special features needed by `cargo`.
|
||||
|
||||
#### [tauri-codegen](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-codegen)
|
||||
|
||||
- Embed, hash, and compress assets, including icons for the app as well as the system-tray.
|
||||
- Parse `tauri.conf.json` at compile time and generate the Config struct.
|
||||
|
||||
#### [tauri-macros](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-macros)
|
||||
|
||||
Create macros for the context, handler, and commands by leveraging the `tauri-codegen` crate.
|
||||
|
||||
#### [tauri-runtime](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-runtime)
|
||||
|
||||
This is the glue layer between tauri itself and lower level webview libraries.
|
||||
|
||||
#### [tauri-runtime-wry](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-runtime-wry)
|
||||
|
||||
This crate opens up direct systems-level interactions specifically for WRY, such as printing, monitor detection, and other windowing related tasks. `tauri-runtime` implementation for WRY.
|
||||
|
||||
#### [tauri-utils](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-utils)
|
||||
|
||||
This is common code that is reused in many places and offers useful utilities like parsing configuration files, detecting platform triples, injecting the CSP, and managing assets.
|
||||
|
||||
|
||||
### Tauri Tooling
|
||||
|
||||
#### [@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.
|
||||
|
||||
#### [@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.
|
||||
|
||||
#### [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]
|
||||
|
||||
This is a toolkit that will enable engineering teams to rapidly scaffold out a new tauri-apps project using the frontend framework of their choice (as long as it has been configured).
|
||||
|
||||
# External Crates
|
||||
|
||||
The Tauri-Apps organisation maintains two "upstream" crates from Tauri, namely TAO for creating and managing application windows, and WRY for interfacing with the Webview that lives within the window.
|
||||
|
||||
## [TAO](https://github.com/tauri-apps/tao)
|
||||
|
||||
Cross-platform application window creation library in Rust that supports all major platforms like Windows, macOS, Linux, iOS and Android. Written in Rust, it is a fork of [winit](https://github.com/rust-windowing/winit) that we have extended for our own needs like menu bar and system tray.
|
||||
|
||||
|
||||
## [WRY](https://github.com/tauri-apps/wry)
|
||||
|
||||
WRY is a cross-platform WebView rendering library in Rust that supports all major desktop platforms like Windows, macOS, and Linux.
|
||||
Tauri uses WRY as the abstract layer responsible to determine which webview is used (and how interactions are made).
|
||||
|
||||
# Additional tooling
|
||||
|
||||
## [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.
|
||||
|
||||
## [create-pull-request](https://github.com/tauri-apps/create-pull-request)
|
||||
|
||||
Because this is a very risky (potentially destructive) github action, we forked it in order to have strong guarantees that the code we think is running is actually the code that is running.
|
||||
|
||||
## [vue-cli-plugin-tauri](https://github.com/tauri-apps/vue-cli-plugin-tauri)
|
||||
|
||||
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.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".
|
||||
2. It provides interface glue to make it easy to integrate into an app.
|
||||
3. It provides a JS API for interfacing with the rust code.
|
||||
|
||||
Here are several examples of Tauri Plugins:
|
||||
|
||||
- https://github.com/tauri-apps/tauri-plugin-sql
|
||||
- https://github.com/tauri-apps/tauri-plugin-stronghold
|
||||
- https://github.com/tauri-apps/tauri-plugin-authenticator
|
||||
|
||||
# Workflows
|
||||
|
||||
## What does the Development flow look like?
|
||||
|
||||
A developer must first install the prerequisite toolchains for creating a Tauri app. At the very least this will entail installing rust & cargo, and most likely also a modern version of node.js and potentially another package manager. Some platforms may also require other tooling and libraries, but this has been documented carefully in the respective platform docs.
|
||||
|
||||
Because of the many ways to build front-ends, we will stick with a common node.js based approach for development. (Note: Tauri does not by default ship a node.js runtime.)
|
||||
|
||||
The easiest way to do this is to run the following:
|
||||
|
||||
```
|
||||
npx create-tauri-app
|
||||
```
|
||||
@ -107,12 +136,15 @@ Which will ask you a bunch of questions about the framework you want to install
|
||||
> If you don't use this process, you will have to manually install the tauri cli, initialise tauri and manually configure the `tauri.conf.json` file.
|
||||
|
||||
Once everything is installed, you can run:
|
||||
|
||||
```
|
||||
yarn tauri dev
|
||||
-or-
|
||||
npm run tauri dev
|
||||
```
|
||||
|
||||
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
|
||||
@ -128,7 +160,6 @@ If you need to get deeper insight into your current project, or triage requires
|
||||
yarn tauri info
|
||||
```
|
||||
|
||||
|
||||
## What does the Release flow look like?
|
||||
|
||||
The release flow begins with proper configuration in the `tauri.conf.json` file. In this file, the developer can configure not only the basic behaviour of the application (like window size and decoration), they can also provide settings for signing and updating.
|
||||
@ -136,6 +167,7 @@ The release flow begins with proper configuration in the `tauri.conf.json` file.
|
||||
Depending upon the operating system that the developer (or CI) is building the application on, there will be an app built for them for that system. (Cross compilation is not currently available, however there is an official [GitHub Action](https://github.com/tauri-apps/tauri-action) that can be used to build for all platforms.)
|
||||
|
||||
To kick off this process, just:
|
||||
|
||||
```
|
||||
yarn tauri build
|
||||
```
|
||||
@ -143,14 +175,17 @@ yarn tauri build
|
||||
After some time, the process will end and you can see the results in the `./src-tauri/target/release` folder.
|
||||
|
||||
## What does the End-User flow look like?
|
||||
|
||||
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`).
|
||||
|
||||
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.
|
||||
|
||||
## License
|
||||
|
||||
Tauri itself is licensed under MIT or Apache-2.0. If you repackage it and modify any source code, it is your responsibility to verify that you are complying with all upstream licenses. Tauri is provided AS-IS with no explicit claim for suitability for any purpose.
|
||||
|
||||
Here you may peruse our [Software Bill of Materials](https://app.fossa.com/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri).
|
||||
|
@ -24,5 +24,5 @@ Additionally, we may ask you to independently verify our patch, which will be av
|
||||
|
||||
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,
|
||||
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.
|
||||
|
@ -12,26 +12,32 @@
|
||||
[![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)
|
||||
|
||||
| Component | Version |
|
||||
| --------- | ------------------------------------------- |
|
||||
| tauri-runtime-wry | [![](https://img.shields.io/crates/v/tauri-runtime-wry?style=flat-square)](https://crates.io/crates/tauri-runtime-wry) |
|
||||
| Component | Version |
|
||||
| ----------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
||||
| tauri-runtime-wry | [![](https://img.shields.io/crates/v/tauri-runtime-wry?style=flat-square)](https://crates.io/crates/tauri-runtime-wry) |
|
||||
|
||||
## About Tauri
|
||||
|
||||
Tauri is a polyglot and generic system that is very composable and allows engineers to make a wide variety of applications. It is used for building applications for Desktop Computers using a combination of Rust tools and HTML rendered in a Webview. Apps built with Tauri can ship with any number of pieces of an optional JS API / Rust API so that webviews can control the system via message passing. In fact, developers can extend the default API with their own functionality and bridge the Webview and Rust-based backend easily.
|
||||
|
||||
Tauri apps can have custom menus and have tray-type interfaces. They can be updated, and are managed by the user's operating system as expected. They are very small, because they use the system's webview. They do not ship a runtime, since the final binary is compiled from rust. This makes the reversing of Tauri apps not a trivial task.
|
||||
|
||||
## This module
|
||||
|
||||
This crate opens up direct systems-level interactions specifically for WRY, such as printing, monitor detection, and other windowing related tasks. `tauri-runtime` implementation for WRY.
|
||||
|
||||
To learn more about the details of how all of these pieces fit together, please consult this [ARCHITECTURE.md](https://github.com/tauri-apps/tauri/blob/dev/ARCHITECTURE.md) document.
|
||||
|
||||
## Semver
|
||||
|
||||
**tauri** is following [Semantic Versioning 2.0](https://semver.org/).
|
||||
|
||||
## Licenses
|
||||
|
||||
Code: (c) 2021 - The Tauri Programme within The Commons Conservancy.
|
||||
|
||||
MIT or MIT/Apache 2.0 where applicable.
|
||||
|
||||
Logo: CC-BY-NC-ND
|
||||
|
||||
- Original Tauri Logo Designs by [Daniel Thompson-Yvetot](https://github.com/nothingismagick) and [Guillaume Chau](https://github.com/akryum)
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
// this is a function and not an iife so use it carefully
|
||||
|
||||
(function (message) {
|
||||
;(function (message) {
|
||||
if (
|
||||
message instanceof ArrayBuffer ||
|
||||
ArrayBuffer.isView(message) ||
|
||||
|
@ -10,8 +10,9 @@
|
||||
// while macOS macos maximization should be on mouseup and if the mouse
|
||||
// moves after the double click, it should be cancelled (see https://github.com/tauri-apps/tauri/issues/8306)
|
||||
//-----------------------//
|
||||
const TAURI_DRAG_REGION_ATTR = 'data-tauri-drag-region';
|
||||
let x = 0, y = 0;
|
||||
const TAURI_DRAG_REGION_ATTR = 'data-tauri-drag-region'
|
||||
let x = 0,
|
||||
y = 0
|
||||
document.addEventListener('mousedown', (e) => {
|
||||
if (
|
||||
// element has the magic data attribute
|
||||
@ -20,8 +21,7 @@
|
||||
e.button === 0 &&
|
||||
// and was normal click to drag or double click to maximize
|
||||
(e.detail === 1 || e.detail === 2)
|
||||
) {
|
||||
|
||||
) {
|
||||
// macOS maximization happens on `mouseup`,
|
||||
// so we save needed state and early return
|
||||
if (osName === 'macos' && e.detail == 2) {
|
||||
@ -44,7 +44,7 @@
|
||||
})
|
||||
// on macOS we maximze on mouseup instead, to match the system behavior where maximization can be canceled
|
||||
// if the mouse moves outside the data-tauri-drag-region
|
||||
if (osName === "macos") {
|
||||
if (osName === 'macos') {
|
||||
document.addEventListener('mouseup', (e) => {
|
||||
if (
|
||||
// element has the magic data attribute
|
||||
@ -54,9 +54,12 @@
|
||||
// and was double click
|
||||
e.detail === 2 &&
|
||||
// and the cursor hasn't moved from initial mousedown
|
||||
e.clientX === x && e.clientY === y
|
||||
e.clientX === x &&
|
||||
e.clientY === y
|
||||
) {
|
||||
window.__TAURI_INTERNALS__.invoke('plugin:window|internal_toggle_maximize')
|
||||
window.__TAURI_INTERNALS__.invoke(
|
||||
'plugin:window|internal_toggle_maximize'
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
{
|
||||
"identifier": "run-app",
|
||||
"description": "app capability",
|
||||
"windows": [
|
||||
"main"
|
||||
],
|
||||
"windows": ["main"],
|
||||
"permissions": [
|
||||
{
|
||||
"identifier": "fs:read",
|
||||
@ -38,4 +36,4 @@
|
||||
},
|
||||
"fs:read-download-dir"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,7 @@
|
||||
"$schema": "./schemas/desktop-schema.json",
|
||||
"identifier": "run-app",
|
||||
"description": "permissions to run the app",
|
||||
"windows": [
|
||||
"main",
|
||||
"main-*"
|
||||
],
|
||||
"windows": ["main", "main-*"],
|
||||
"permissions": [
|
||||
"sample:allow-ping-scoped",
|
||||
"sample:global-scope",
|
||||
@ -88,4 +85,4 @@
|
||||
"tray:allow-set-icon-as-template",
|
||||
"tray:allow-set-show-menu-on-left-click"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -1,26 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>File Associations</title>
|
||||
</head>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>File Associations</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>File Associations</h1>
|
||||
<div id="files"></div>
|
||||
|
||||
<body>
|
||||
<h1>File Associations</h1>
|
||||
<div id="files"></div>
|
||||
<script>
|
||||
const d = document.getElementById('files')
|
||||
d.textContent = window.openedUrls
|
||||
|
||||
<script>
|
||||
const d = document.getElementById('files')
|
||||
d.textContent = window.openedUrls
|
||||
|
||||
window.onFileOpen = (files) => {
|
||||
console.log(files)
|
||||
d.textContent = files
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
window.onFileOpen = (files) => {
|
||||
console.log(files)
|
||||
d.textContent = files
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -9,7 +9,5 @@
|
||||
"scripts": {
|
||||
"tauri": "node ../../tooling/cli/node/tauri.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
}
|
||||
}
|
||||
"devDependencies": {}
|
||||
}
|
||||
|
@ -1,84 +1,88 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<style>
|
||||
#response {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="window-label"></div>
|
||||
<div id="container"></div>
|
||||
<div id="response"></div>
|
||||
|
||||
<script>
|
||||
const WebviewWindow = window.__TAURI__.webview.WebviewWindow
|
||||
const appWindow = window.__TAURI__.window.getCurrent()
|
||||
const windowLabel = appWindow.label
|
||||
const windowLabelContainer = document.getElementById('window-label')
|
||||
windowLabelContainer.innerText = 'This is the ' + windowLabel + ' window.'
|
||||
|
||||
const container = document.getElementById('container')
|
||||
|
||||
function createWindowMessageBtn(label) {
|
||||
const button = document.createElement('button')
|
||||
button.innerText = 'Send message to ' + label
|
||||
button.addEventListener('click', function () {
|
||||
appWindow.emitTo(label, 'clicked', 'message from ' + windowLabel)
|
||||
})
|
||||
container.appendChild(button)
|
||||
}
|
||||
|
||||
// global listener
|
||||
const responseContainer = document.getElementById('response')
|
||||
window.__TAURI__.event.listen('clicked', function (event) {
|
||||
responseContainer.innerHTML +=
|
||||
'Got ' + JSON.stringify(event) + ' on global listener\n\n'
|
||||
})
|
||||
window.__TAURI__.event.listen('tauri://webview-created', function (event) {
|
||||
createWindowMessageBtn(event.payload.label)
|
||||
})
|
||||
|
||||
// listener tied to this window
|
||||
appWindow.listen('clicked', function (event) {
|
||||
responseContainer.innerText +=
|
||||
'Got ' + JSON.stringify(event) + ' on window listener\n\n'
|
||||
})
|
||||
|
||||
const createWindowButton = document.createElement('button')
|
||||
createWindowButton.innerHTML = 'Create window'
|
||||
createWindowButton.addEventListener('click', function () {
|
||||
const id = Math.random().toString().replace('.', '')
|
||||
const webview = new WebviewWindow(id, { tabbingIdentifier: windowLabel })
|
||||
webview.once('tauri://created', function () {
|
||||
responseContainer.innerHTML += 'Created new window'
|
||||
})
|
||||
webview.once('tauri://error', function (e) {
|
||||
responseContainer.innerHTML += 'Error creating new window ' + e.payload
|
||||
})
|
||||
})
|
||||
container.appendChild(createWindowButton)
|
||||
|
||||
const globalMessageButton = document.createElement('button')
|
||||
globalMessageButton.innerHTML = 'Send global message'
|
||||
globalMessageButton.addEventListener('click', function () {
|
||||
// emit to all windows
|
||||
appWindow.emit('clicked', 'message from ' + windowLabel)
|
||||
})
|
||||
container.appendChild(globalMessageButton)
|
||||
|
||||
const allWindows = window.__TAURI__.window.getAll()
|
||||
for (const index in allWindows) {
|
||||
const label = allWindows[index].label
|
||||
if (label === windowLabel) {
|
||||
continue
|
||||
<head>
|
||||
<style>
|
||||
#response {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
createWindowMessageBtn(label)
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="window-label"></div>
|
||||
<div id="container"></div>
|
||||
<div id="response"></div>
|
||||
|
||||
<script>
|
||||
const WebviewWindow = window.__TAURI__.webview.WebviewWindow
|
||||
const appWindow = window.__TAURI__.window.getCurrent()
|
||||
const windowLabel = appWindow.label
|
||||
const windowLabelContainer = document.getElementById('window-label')
|
||||
windowLabelContainer.innerText = 'This is the ' + windowLabel + ' window.'
|
||||
|
||||
const container = document.getElementById('container')
|
||||
|
||||
function createWindowMessageBtn(label) {
|
||||
const button = document.createElement('button')
|
||||
button.innerText = 'Send message to ' + label
|
||||
button.addEventListener('click', function () {
|
||||
appWindow.emitTo(label, 'clicked', 'message from ' + windowLabel)
|
||||
})
|
||||
container.appendChild(button)
|
||||
}
|
||||
|
||||
// global listener
|
||||
const responseContainer = document.getElementById('response')
|
||||
window.__TAURI__.event.listen('clicked', function (event) {
|
||||
responseContainer.innerHTML +=
|
||||
'Got ' + JSON.stringify(event) + ' on global listener\n\n'
|
||||
})
|
||||
window.__TAURI__.event.listen(
|
||||
'tauri://webview-created',
|
||||
function (event) {
|
||||
createWindowMessageBtn(event.payload.label)
|
||||
}
|
||||
)
|
||||
|
||||
// listener tied to this window
|
||||
appWindow.listen('clicked', function (event) {
|
||||
responseContainer.innerText +=
|
||||
'Got ' + JSON.stringify(event) + ' on window listener\n\n'
|
||||
})
|
||||
|
||||
const createWindowButton = document.createElement('button')
|
||||
createWindowButton.innerHTML = 'Create window'
|
||||
createWindowButton.addEventListener('click', function () {
|
||||
const id = Math.random().toString().replace('.', '')
|
||||
const webview = new WebviewWindow(id, {
|
||||
tabbingIdentifier: windowLabel
|
||||
})
|
||||
webview.once('tauri://created', function () {
|
||||
responseContainer.innerHTML += 'Created new window'
|
||||
})
|
||||
webview.once('tauri://error', function (e) {
|
||||
responseContainer.innerHTML +=
|
||||
'Error creating new window ' + e.payload
|
||||
})
|
||||
})
|
||||
container.appendChild(createWindowButton)
|
||||
|
||||
const globalMessageButton = document.createElement('button')
|
||||
globalMessageButton.innerHTML = 'Send global message'
|
||||
globalMessageButton.addEventListener('click', function () {
|
||||
// emit to all windows
|
||||
appWindow.emit('clicked', 'message from ' + windowLabel)
|
||||
})
|
||||
container.appendChild(globalMessageButton)
|
||||
|
||||
const allWindows = window.__TAURI__.window.getAll()
|
||||
for (const index in allWindows) {
|
||||
const label = allWindows[index].label
|
||||
if (label === windowLabel) {
|
||||
continue
|
||||
}
|
||||
createWindowMessageBtn(label)
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,59 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
#response {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<head>
|
||||
<style>
|
||||
#response {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="window-label"></div>
|
||||
<div id="container"></div>
|
||||
<div id="response"></div>
|
||||
|
||||
<body>
|
||||
<div id="window-label"></div>
|
||||
<div id="container"></div>
|
||||
<div id="response"></div>
|
||||
<script>
|
||||
const WebviewWindow = window.__TAURI__.webview.WebviewWindow
|
||||
const thisTauriWindow = window.__TAURI__.window.getCurrent()
|
||||
const windowLabel = thisTauriWindow.label
|
||||
const windowLabelContainer = document.getElementById('window-label')
|
||||
windowLabelContainer.innerText = 'This is the ' + windowLabel + ' window.'
|
||||
|
||||
<script>
|
||||
const WebviewWindow = window.__TAURI__.webview.WebviewWindow
|
||||
const thisTauriWindow = window.__TAURI__.window.getCurrent()
|
||||
const windowLabel = thisTauriWindow.label
|
||||
const windowLabelContainer = document.getElementById('window-label')
|
||||
windowLabelContainer.innerText = 'This is the ' + windowLabel + ' window.'
|
||||
const container = document.getElementById('container')
|
||||
|
||||
const container = document.getElementById('container')
|
||||
|
||||
const responseContainer = document.getElementById('response')
|
||||
function runCommand(commandName, args, optional) {
|
||||
window.__TAURI__.core
|
||||
.invoke(commandName, args)
|
||||
.then((response) => {
|
||||
responseContainer.innerText += `Ok(${response})\n\n`
|
||||
})
|
||||
.catch((error) => {
|
||||
responseContainer.innerText += `Err(${error})\n\n`
|
||||
})
|
||||
}
|
||||
window.__TAURI__.event.listen('tauri://window-created', function (event) {
|
||||
responseContainer.innerText += 'Got window-created event\n\n'
|
||||
})
|
||||
|
||||
const createWindowButton = document.createElement('button')
|
||||
const windowId = Math.random().toString().replace('.', '')
|
||||
let windowNumber = 1
|
||||
createWindowButton.innerHTML = 'Create child window ' + windowNumber
|
||||
createWindowButton.addEventListener('click', function () {
|
||||
new WebviewWindow(`child-${windowId}-${windowNumber}`, {
|
||||
title: 'Child',
|
||||
width: 400,
|
||||
height: 300,
|
||||
parent: thisTauriWindow
|
||||
const responseContainer = document.getElementById('response')
|
||||
function runCommand(commandName, args, optional) {
|
||||
window.__TAURI__.core
|
||||
.invoke(commandName, args)
|
||||
.then((response) => {
|
||||
responseContainer.innerText += `Ok(${response})\n\n`
|
||||
})
|
||||
.catch((error) => {
|
||||
responseContainer.innerText += `Err(${error})\n\n`
|
||||
})
|
||||
}
|
||||
window.__TAURI__.event.listen('tauri://window-created', function (event) {
|
||||
responseContainer.innerText += 'Got window-created event\n\n'
|
||||
})
|
||||
windowNumber += 1
|
||||
createWindowButton.innerHTML = 'Create child window ' + windowNumber
|
||||
})
|
||||
container.appendChild(createWindowButton)
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
const createWindowButton = document.createElement('button')
|
||||
const windowId = Math.random().toString().replace('.', '')
|
||||
let windowNumber = 1
|
||||
createWindowButton.innerHTML = 'Create child window ' + windowNumber
|
||||
createWindowButton.addEventListener('click', function () {
|
||||
new WebviewWindow(`child-${windowId}-${windowNumber}`, {
|
||||
title: 'Child',
|
||||
width: 400,
|
||||
height: 300,
|
||||
parent: thisTauriWindow
|
||||
})
|
||||
windowNumber += 1
|
||||
createWindowButton.innerHTML = 'Create child window ' + windowNumber
|
||||
})
|
||||
container.appendChild(createWindowButton)
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -5,19 +5,22 @@ This example demonstrates the Tauri bundle resources functionality. The example
|
||||
## Running the example
|
||||
|
||||
- Compile Tauri
|
||||
go to root of the Tauri repo and run:
|
||||
Linux / Mac:
|
||||
go to root of the Tauri repo and run:
|
||||
Linux / Mac:
|
||||
|
||||
```
|
||||
# choose to install node cli (1)
|
||||
bash .scripts/setup.sh
|
||||
```
|
||||
|
||||
Windows:
|
||||
|
||||
```
|
||||
./.scripts/setup.ps1
|
||||
```
|
||||
|
||||
- Install dependencies (Run inside of this folder `examples/resources/`)
|
||||
|
||||
```bash
|
||||
# with yarn
|
||||
$ yarn
|
||||
@ -29,6 +32,7 @@ $ yarn package
|
||||
```
|
||||
|
||||
- Run the app in development mode (Run inside of this folder `examples/resources/`)
|
||||
|
||||
```bash
|
||||
# with yarn
|
||||
$ yarn tauri dev
|
||||
@ -37,6 +41,7 @@ $ npm run tauri dev
|
||||
```
|
||||
|
||||
- Build an run the release app (Run inside of this folder `examples/resources/`)
|
||||
|
||||
```bash
|
||||
$ yarn tauri build
|
||||
$ ./src-tauri/target/release/app
|
||||
|
@ -1,9 +1,6 @@
|
||||
{
|
||||
"$schema": "./schemas/desktop-schema.json",
|
||||
"identifier": "app",
|
||||
"permissions": [
|
||||
"event:default",
|
||||
"window:default"
|
||||
],
|
||||
"permissions": ["event:default", "window:default"],
|
||||
"windows": ["main"]
|
||||
}
|
||||
}
|
||||
|
@ -12,21 +12,27 @@
|
||||
[![support](https://img.shields.io/badge/sponsor-Open%20Collective-blue.svg)](https://opencollective.com/tauri)
|
||||
|
||||
## About Tauri
|
||||
|
||||
Tauri is a polyglot and generic system that is very composable and allows engineers to make a wide variety of applications. It is used for building applications for Desktop Computers using a combination of Rust tools and HTML rendered in a Webview. Apps built with Tauri can ship with any number of pieces of an optional JS API / Rust API so that webviews can control the system via message passing. In fact, developers can extend the default API with their own functionality and bridge the Webview and Rust-based backend easily.
|
||||
|
||||
Tauri apps can have custom menus and have tray-type interfaces. They can be updated, and are managed by the user's operating system as expected. They are very small, because they use the system's webview. They do not ship a runtime, since the final binary is compiled from rust. This makes the reversing of Tauri apps not a trivial task.
|
||||
|
||||
## This module
|
||||
|
||||
This rust module run on CI, provides internal metrics results of Tauri. To learn more see [benchmark_results](https://github.com/tauri-apps/benchmark_results) repository.
|
||||
|
||||
***_Internal use only_**
|
||||
**\*_Internal use only_**
|
||||
|
||||
## Semver
|
||||
|
||||
**tauri** is following [Semantic Versioning 2.0](https://semver.org/).
|
||||
|
||||
## Licenses
|
||||
|
||||
Code: (c) 2015 - 2021 - The Tauri Programme within The Commons Conservancy.
|
||||
|
||||
MIT or MIT/Apache 2.0 where applicable.
|
||||
|
||||
Logo: CC-BY-NC-ND
|
||||
|
||||
- Original Tauri Logo Designs by [Daniel Thompson-Yvetot](https://github.com/nothingismagick) and [Guillaume Chau](https://github.com/akryum)
|
||||
|
@ -12,182 +12,181 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-------
|
||||
|
||||
---
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
@ -6,7 +6,7 @@ The above copyright notice and this permission notice shall be included in all c
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
----
|
||||
---
|
||||
|
||||
MIT License
|
||||
|
||||
|
@ -14,67 +14,67 @@ Tauri automatically loads configurations from the `tauri.conf.json > bundle` obj
|
||||
|
||||
These settings apply to bundles for all (or most) OSes.
|
||||
|
||||
* `name`: The name of the built application. If this is not present, then it will use the `name` value from
|
||||
your `Cargo.toml` file.
|
||||
* `identifier`: [REQUIRED] A string that uniquely identifies your application,
|
||||
in reverse-DNS form (for example, `"com.example.appname"` or
|
||||
`"io.github.username.project"`). For OS X and iOS, this is used as the
|
||||
bundle's `CFBundleIdentifier` value; for Windows, this is hashed to create
|
||||
an application GUID.
|
||||
* `icon`: [OPTIONAL] The icons used for your application. This should be an array of file paths or globs (with images
|
||||
in various sizes/formats); `tauri-bundler` will automatically convert between image formats as necessary for
|
||||
different platforms. Supported formats include ICNS, ICO, PNG, and anything else that can be decoded by the
|
||||
[`image`](https://crates.io/crates/image) crate. Icons intended for high-resolution (e.g. Retina) displays
|
||||
should have a filename with `@2x` just before the extension (see example below).
|
||||
* `version`: [OPTIONAL] The version of the application. If this is not present, then it will use the `version`
|
||||
value from your `Cargo.toml` file.
|
||||
* `resources`: [OPTIONAL] List of files or directories which will be copied to the resources section of the
|
||||
bundle. Globs are supported.
|
||||
* `copyright`: [OPTIONAL] This contains a copyright string associated with your application.
|
||||
* `category`: [OPTIONAL] What kind of application this is. This can
|
||||
be a human-readable string (e.g. `"Puzzle game"`), or a Mac OS X
|
||||
LSApplicationCategoryType value
|
||||
(e.g. `"public.app-category.puzzle-games"`), or a GNOME desktop
|
||||
file category name (e.g. `"LogicGame"`), and `tauri-bundler` will
|
||||
automatically convert as needed for different platforms.
|
||||
* `short_description`: [OPTIONAL] A short, one-line description of the application. If this is not present, then it
|
||||
will use the `description` value from your `Cargo.toml` file.
|
||||
* `long_description`: [OPTIONAL] A longer, multi-line description of the application.
|
||||
- `name`: The name of the built application. If this is not present, then it will use the `name` value from
|
||||
your `Cargo.toml` file.
|
||||
- `identifier`: [REQUIRED] A string that uniquely identifies your application,
|
||||
in reverse-DNS form (for example, `"com.example.appname"` or
|
||||
`"io.github.username.project"`). For OS X and iOS, this is used as the
|
||||
bundle's `CFBundleIdentifier` value; for Windows, this is hashed to create
|
||||
an application GUID.
|
||||
- `icon`: [OPTIONAL] The icons used for your application. This should be an array of file paths or globs (with images
|
||||
in various sizes/formats); `tauri-bundler` will automatically convert between image formats as necessary for
|
||||
different platforms. Supported formats include ICNS, ICO, PNG, and anything else that can be decoded by the
|
||||
[`image`](https://crates.io/crates/image) crate. Icons intended for high-resolution (e.g. Retina) displays
|
||||
should have a filename with `@2x` just before the extension (see example below).
|
||||
- `version`: [OPTIONAL] The version of the application. If this is not present, then it will use the `version`
|
||||
value from your `Cargo.toml` file.
|
||||
- `resources`: [OPTIONAL] List of files or directories which will be copied to the resources section of the
|
||||
bundle. Globs are supported.
|
||||
- `copyright`: [OPTIONAL] This contains a copyright string associated with your application.
|
||||
- `category`: [OPTIONAL] What kind of application this is. This can
|
||||
be a human-readable string (e.g. `"Puzzle game"`), or a Mac OS X
|
||||
LSApplicationCategoryType value
|
||||
(e.g. `"public.app-category.puzzle-games"`), or a GNOME desktop
|
||||
file category name (e.g. `"LogicGame"`), and `tauri-bundler` will
|
||||
automatically convert as needed for different platforms.
|
||||
- `short_description`: [OPTIONAL] A short, one-line description of the application. If this is not present, then it
|
||||
will use the `description` value from your `Cargo.toml` file.
|
||||
- `long_description`: [OPTIONAL] A longer, multi-line description of the application.
|
||||
|
||||
### Debian-specific settings
|
||||
|
||||
These settings are used only when bundling `deb` packages.
|
||||
|
||||
* `depends`: A list of strings indicating other packages (e.g. shared
|
||||
libraries) that this package depends on to be installed. If present, this
|
||||
- `depends`: A list of strings indicating other packages (e.g. shared
|
||||
libraries) that this package depends on to be installed. If present, this
|
||||
forms the `Depends:` field of the `deb` package control file.
|
||||
|
||||
### Mac OS X-specific settings
|
||||
|
||||
These settings are used only when bundling `app` and `dmg` packages.
|
||||
|
||||
* `frameworks`: A list of strings indicating any Mac OS X frameworks that
|
||||
need to be bundled with the app. Each string can either be the name of a
|
||||
- `frameworks`: A list of strings indicating any Mac OS X frameworks that
|
||||
need to be bundled with the app. Each string can either be the name of a
|
||||
framework (without the `.framework` extension, e.g. `"SDL2"`), in which case
|
||||
`tauri-bundler` will search for that framework in the standard install
|
||||
locations (`~/Library/Frameworks/`, `/Library/Frameworks/`, and
|
||||
`/Network/Library/Frameworks/`), or a path to a specific framework bundle
|
||||
(e.g. `./data/frameworks/SDL2.framework`). Note that this setting just makes
|
||||
(e.g. `./data/frameworks/SDL2.framework`). Note that this setting just makes
|
||||
`tauri-bundler` copy the specified frameworks into the OS X app bundle (under
|
||||
`Foobar.app/Contents/Frameworks/`); you are still responsible for (1)
|
||||
arranging for the compiled binary to link against those frameworks (e.g. by
|
||||
emitting lines like `cargo:rustc-link-lib=framework=SDL2` from your
|
||||
`build.rs` script), and (2) embedding the correct rpath in your binary
|
||||
(e.g. by running `install_name_tool -add_rpath
|
||||
"@executable_path/../Frameworks" path/to/binary` after compiling).
|
||||
* `minimum_system_version`: A version string indicating the minimum Mac OS
|
||||
X version that the bundled app supports (e.g. `"10.11"`). If you are using
|
||||
"@executable_path/../Frameworks" path/to/binary` after compiling).
|
||||
- `minimum_system_version`: A version string indicating the minimum Mac OS
|
||||
X version that the bundled app supports (e.g. `"10.11"`). If you are using
|
||||
this config field, you may also want have your `build.rs` script emit
|
||||
`cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.11` (or whatever version number
|
||||
you want) to ensure that the compiled binary has the same minimum version.
|
||||
* `license`: Path to the license file for the DMG bundle.
|
||||
* `exception_domain`: The exception domain to use on the macOS .app bundle. Allows communication to the outside world e.g. a web server you're shipping.
|
||||
* `provider_short_name`: If your Apple ID is connected to multiple teams, you have to specify the provider short name of the team you want to use to notarize your app. See [Customizing the notarization workflow](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow) and search for `--list-providers` for more information how to obtain your provider short name.
|
||||
- `license`: Path to the license file for the DMG bundle.
|
||||
- `exception_domain`: The exception domain to use on the macOS .app bundle. Allows communication to the outside world e.g. a web server you're shipping.
|
||||
- `provider_short_name`: If your Apple ID is connected to multiple teams, you have to specify the provider short name of the team you want to use to notarize your app. See [Customizing the notarization workflow](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow) and search for `--list-providers` for more information how to obtain your provider short name.
|
||||
|
||||
### Example `tauri.conf.json`:
|
||||
|
||||
@ -83,7 +83,7 @@ These settings are used only when bundling `app` and `dmg` packages.
|
||||
"productName": "Your Awesome App",
|
||||
"version": "0.1.0",
|
||||
"identifier": "com.my.app",
|
||||
"app": { },
|
||||
"app": {},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"shortDescription": "",
|
||||
@ -111,6 +111,7 @@ These settings are used only when bundling `app` and `dmg` packages.
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
(c) 2017 - present, George Burton, Tauri-Apps Organization
|
||||
|
||||
This program is licensed either under the terms of the
|
||||
|
@ -9,13 +9,15 @@ native WebDriver server for you behind the scenes. It requires two separate
|
||||
ports to be used since two distinct [WebDriver Remote Ends] run.
|
||||
|
||||
You can configure the ports used with arguments when starting the binary:
|
||||
* `--port` (default: `4444`)
|
||||
* `--native-port` (default: `4445`)
|
||||
|
||||
- `--port` (default: `4444`)
|
||||
- `--native-port` (default: `4445`)
|
||||
|
||||
Supported platforms:
|
||||
* **[pre-alpha]** Linux w/ `WebKitWebDriver`
|
||||
* **[pre-alpha]** Windows w/ [Microsoft Edge Driver]
|
||||
* **[Todo]** macOS w/ [Appium Mac2 Driver] (probably)
|
||||
|
||||
- **[pre-alpha]** Linux w/ `WebKitWebDriver`
|
||||
- **[pre-alpha]** Windows w/ [Microsoft Edge Driver]
|
||||
- **[Todo]** macOS w/ [Appium Mac2 Driver] (probably)
|
||||
|
||||
_note: the (probably) items haven't been proof-of-concept'd yet, and if it is
|
||||
not possible to use the listed native webdriver, then a custom implementation
|
||||
|
Loading…
Reference in New Issue
Block a user