diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 000000000..97010c25e
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1,14 @@
+# Current WG Code Sub Teams:
+# @tauri-apps/admins
+# @tauri-apps/core
+# @tauri-apps/testing
+
+# admins default to review
+# Order is important; the last matching pattern takes the most precedence.
+* @tauri-apps/admins
+
+.github @tauri-apps/admins @tauri-apps/testing
+
+/examples/ @tauri-apps/testing
+
+/src/ @tauri-apps/core
diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..4ead0e1da
--- /dev/null
+++ b/.github/CODE_OF_CONDUCT.md
@@ -0,0 +1,13 @@
+# Contributor Code of Conduct
+
+As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
+
+We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
+
+Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
+
+This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
new file mode 100644
index 000000000..f4e8dbe99
--- /dev/null
+++ b/.github/CONTRIBUTING.md
@@ -0,0 +1,44 @@
+# Tauri Contributing Guide
+
+Hi! We, the maintainers, are really excited that you are interested in contributing to Tauri. Before submitting your contribution though, please make sure to take a moment and read through the [Code of Conduct](CODE_OF_CONDUCT.md), as well as the appropriate section for the contribution you intend to make:
+
+- [Issue Reporting Guidelines](#issue-reporting-guidelines)
+- [Pull Request Guidelines](#pull-request-guidelines)
+- [Development Guide](#development-guide)
+
+## Issue Reporting Guidelines
+
+- The issue list of this repo is **exclusively** for bug reports and feature requests. Non-conforming issues will be closed immediately.
+
+- If you have a question, you can get quick answers from the [Tauri Discord chat](https://discord.gg/SpmNs4S).
+
+- Try to search for your issue, it may have already been answered or even fixed in the development branch (`dev`).
+
+- Check if the issue is reproducible with the latest stable version of Tauri. If you are using a pre-release, please indicate the specific version you are using.
+
+- It is **required** that you clearly describe the steps necessary to reproduce the issue you are running into. Although we would love to help our users as much as possible, diagnosing issues without clear reproduction steps is extremely time-consuming and simply not sustainable.
+
+- Use only the minimum amount of code necessary to reproduce the unexpected behavior. A good bug report should isolate specific methods that exhibit unexpected behavior and precisely define how expectations were violated. What did you expect the method or methods to do, and how did the observed behavior differ? The more precisely you isolate the issue, the faster we can investigate.
+
+- Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed.
+
+- If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it.
+
+- Most importantly, we beg your patience: the team must balance your request against many other responsibilities — fixing other bugs, answering other questions, new features, new documentation, etc. The issue list is not paid support and we cannot make guarantees about how fast your issue can be resolved.
+
+## Pull Request Guidelines
+
+- It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging.
+
+- If adding new feature:
+
+ - Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it.
+
+- If fixing a bug:
+ - If you are resolving a special issue, add `(fix: #xxxx[,#xxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `fix: update entities encoding/decoding (fix #3899)`.
+ - Provide detailed description of the bug in the PR, or link to an issue that does.
+
+
+## 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.
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 000000000..b8121e4d4
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,8 @@
+# These are supported funding model platforms
+
+github: #
+patreon: #
+open_collective: tauri
+ko_fi: # Replace with a single Ko-fi username
+tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
+custom: # Replace with a single custom sponsorship URL
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 000000000..3a2675caf
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,36 @@
+
+
+
+
+
+**What kind of change does this PR introduce?** (check at least one)
+
+- [ ] Bugfix
+- [ ] Feature
+- [ ] Code style update
+- [ ] Refactor
+- [ ] Documentation
+- [ ] Build-related changes
+- [ ] Other, please describe:
+
+**Does this PR introduce a breaking change?** (check one)
+
+
+- [ ] Yes. Issue #___
+- [ ] No
+
+
+**The PR fulfills these requirements:**
+
+- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix: #xxx[,#xxx]`, where "xxx" is the issue number)
+- [ ] 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).
+
+If adding a **new feature**, the PR's description includes:
+- [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)
+
+**Other information:**
diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml
new file mode 100644
index 000000000..c105d2ed6
--- /dev/null
+++ b/.github/workflows/audit.yml
@@ -0,0 +1,20 @@
+name: Audit
+
+on:
+ workflow_dispatch:
+ schedule:
+ - cron: '0 0 * * *'
+ push:
+ paths:
+ - "Cargo.lock"
+ - "Cargo.toml"
+
+jobs:
+ audit-rust:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: rust audit
+ uses: actions-rs/audit-check@v1
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml
new file mode 100644
index 000000000..3a7e5a17b
--- /dev/null
+++ b/.github/workflows/fmt.yml
@@ -0,0 +1,24 @@
+name: fmt check
+
+on:
+ pull_request:
+ paths:
+ - 'src/**'
+ - 'Cargo.toml'
+
+jobs:
+ clippy_fmt_check:
+ runs-on: macos-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: nightly
+ override: true
+ components: rustfmt
+ - uses: actions-rs/cargo@v1
+ with:
+ command: fmt
+ args: --all -- --check
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 000000000..cbd06ded3
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,19 @@
+# Security Policy
+
+## Supported Versions
+
+| Version | Supported |
+| ------- | ------------------ |
+| > 1.0 | :white_check_mark: |
+| < 1.0 | :x: |
+
+## Reporting a Vulnerability
+
+If you have found a potential security threat, vulnerability or exploit in Tauri
+or one of its upstream dependencies, please DON’T create a pull-request, DON’T
+file an issue on GitHub, DON’T mention it on Discord and DON’T create a forum thread.
+
+We will be adding contact information to this page very soon.
+
+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.
diff --git a/build.rs b/build.rs
index e4eb85d9d..802995504 100644
--- a/build.rs
+++ b/build.rs
@@ -3,7 +3,7 @@ fn main() {}
#[cfg(target_os = "macos")]
fn main() {
- println!("cargo:rustc-link-lib=framework=WebKit");
+ println!("cargo:rustc-link-lib=framework=WebKit");
}
#[cfg(target_os = "windows")]
diff --git a/examples/dragndrop.rs b/examples/dragndrop.rs
index c71e74431..e8a56151a 100644
--- a/examples/dragndrop.rs
+++ b/examples/dragndrop.rs
@@ -9,20 +9,20 @@ Dropping files onto the following form is also possible:
"#;
fn main() -> Result<()> {
- let mut app = Application::new()?;
+ let mut app = Application::new()?;
- app.add_window_with_configs(
- Attributes {
- url: Some(TEST_HTML.to_string()),
- ..Default::default()
- },
- None,
- None,
- Some(Box::new(|data| {
- println!("Window 1: {:?}", data);
- false // Returning true will block the OS default behaviour.
- })),
- )?;
- app.run();
- Ok(())
+ app.add_window_with_configs(
+ Attributes {
+ url: Some(TEST_HTML.to_string()),
+ ..Default::default()
+ },
+ None,
+ None,
+ Some(Box::new(|data| {
+ println!("Window 1: {:?}", data);
+ false // Returning true will block the OS default behaviour.
+ })),
+ )?;
+ app.run();
+ Ok(())
}
diff --git a/examples/fullscreen.rs b/examples/fullscreen.rs
index c4f477a30..635092850 100644
--- a/examples/fullscreen.rs
+++ b/examples/fullscreen.rs
@@ -1,20 +1,19 @@
-use wry::Result;
-use wry::{Application, Attributes};
+use wry::{Application, Attributes, Result};
fn main() -> Result<()> {
- let mut app = Application::new()?;
+ let mut app = Application::new()?;
- let attributes = Attributes {
- url: Some("https://www.wirple.com/".to_string()),
- title: String::from("3D Render Test ^ ^"),
- fullscreen: true,
- transparent: true,
- ..Default::default()
- };
+ let attributes = Attributes {
+ url: Some("https://www.wirple.com/".to_string()),
+ title: String::from("3D Render Test ^ ^"),
+ fullscreen: true,
+ transparent: true,
+ ..Default::default()
+ };
- app.add_window(attributes)?;
- app.run();
- Ok(())
+ app.add_window(attributes)?;
+ app.run();
+ Ok(())
}
// Test Result:
diff --git a/examples/gtk.rs b/examples/gtk.rs
index 1e784bd25..77dbe8ade 100644
--- a/examples/gtk.rs
+++ b/examples/gtk.rs
@@ -4,12 +4,12 @@ use cairo::*;
use gtk::*;
fn main() -> Result<()> {
- gtk::init()?;
- let window = Window::new(WindowType::Toplevel);
+ gtk::init()?;
+ let window = Window::new(WindowType::Toplevel);
- window.show_all();
- // TODO add to webview
+ window.show_all();
+ // TODO add to webview
- gtk::main();
- Ok(())
+ gtk::main();
+ Ok(())
}
diff --git a/examples/hello_world.rs b/examples/hello_world.rs
index 49b467f2a..be99b37aa 100644
--- a/examples/hello_world.rs
+++ b/examples/hello_world.rs
@@ -1,15 +1,15 @@
use wry::{Application, Attributes, Result};
fn main() -> Result<()> {
- let mut app = Application::new()?;
+ let mut app = Application::new()?;
- let attributes = Attributes {
- url: Some("https://tauri.studio/".to_string()),
- title: String::from("Hello World!"),
- ..Default::default()
- };
+ let attributes = Attributes {
+ url: Some("https://tauri.studio/".to_string()),
+ title: String::from("Hello World!"),
+ ..Default::default()
+ };
- app.add_window(attributes)?;
- app.run();
- Ok(())
+ app.add_window(attributes)?;
+ app.run();
+ Ok(())
}
diff --git a/examples/multiwindow.rs b/examples/multiwindow.rs
index 397efb827..5e1b022f2 100644
--- a/examples/multiwindow.rs
+++ b/examples/multiwindow.rs
@@ -1,59 +1,58 @@
use serde_json::Value;
-use wry::Result;
-use wry::{Application, Attributes, RpcRequest, WindowProxy};
+use wry::{Application, Attributes, Result, RpcRequest, WindowProxy};
fn main() -> Result<()> {
- let mut app = Application::new()?;
+ let mut app = Application::new()?;
- let attributes = Attributes {
- url: Some(format!("https://tauri.studio")),
- // Initialization scripts can be used to define javascript functions and variables.
- initialization_scripts: vec![r#"async function openWindow() {
+ let attributes = Attributes {
+ url: Some(format!("https://tauri.studio")),
+ // Initialization scripts can be used to define javascript functions and variables.
+ initialization_scripts: vec![r#"async function openWindow() {
await window.rpc.notify("openWindow", "https://i.imgur.com/x6tXcr9.gif");
}"#
- .to_string()],
- ..Default::default()
- };
+ .to_string()],
+ ..Default::default()
+ };
- let (window_tx, window_rx) = std::sync::mpsc::channel::();
- let handler = Box::new(move |_: WindowProxy, req: RpcRequest| {
- if &req.method == "openWindow" {
- if let Some(params) = req.params {
- if let Value::String(url) = ¶ms[0] {
- let _ = window_tx.send(url.to_string());
- }
- }
+ let (window_tx, window_rx) = std::sync::mpsc::channel::();
+ let handler = Box::new(move |_: WindowProxy, req: RpcRequest| {
+ if &req.method == "openWindow" {
+ if let Some(params) = req.params {
+ if let Value::String(url) = ¶ms[0] {
+ let _ = window_tx.send(url.to_string());
}
- None
- });
+ }
+ }
+ None
+ });
- let window_proxy = app.add_window_with_configs(attributes, Some(handler), None, None)?;
- let app_proxy = app.application_proxy();
- std::thread::spawn(move || {
- let mut count = 1;
- loop {
- if let Ok(url) = window_rx.try_recv() {
- let new_window = app_proxy
- .add_window(Attributes {
- width: 426.,
- height: 197.,
- title: "RODA RORA DA".into(),
- url: Some(url),
- ..Default::default()
- })
- .unwrap();
- println!("ID of new window: {:?}", new_window.id());
- } else if count < 8 {
- println!("{} seconds have passed...", count);
- count += 1;
- } else if count == 8 {
- window_proxy.evaluate_script("openWindow()").unwrap();
- count += 1;
- }
- std::thread::sleep(std::time::Duration::new(1, 0));
- }
- });
+ let window_proxy = app.add_window_with_configs(attributes, Some(handler), None, None)?;
+ let app_proxy = app.application_proxy();
+ std::thread::spawn(move || {
+ let mut count = 1;
+ loop {
+ if let Ok(url) = window_rx.try_recv() {
+ let new_window = app_proxy
+ .add_window(Attributes {
+ width: 426.,
+ height: 197.,
+ title: "RODA RORA DA".into(),
+ url: Some(url),
+ ..Default::default()
+ })
+ .unwrap();
+ println!("ID of new window: {:?}", new_window.id());
+ } else if count < 8 {
+ println!("{} seconds have passed...", count);
+ count += 1;
+ } else if count == 8 {
+ window_proxy.evaluate_script("openWindow()").unwrap();
+ count += 1;
+ }
+ std::thread::sleep(std::time::Duration::new(1, 0));
+ }
+ });
- app.run();
- Ok(())
+ app.run();
+ Ok(())
}
diff --git a/examples/rpc.rs b/examples/rpc.rs
index 9c12604a9..29713ffd9 100644
--- a/examples/rpc.rs
+++ b/examples/rpc.rs
@@ -1,17 +1,16 @@
use serde::{Deserialize, Serialize};
use serde_json::Value;
-use wry::Result;
-use wry::{Application, Attributes, RpcRequest, RpcResponse, WindowProxy};
+use wry::{Application, Attributes, Result, RpcRequest, RpcResponse, WindowProxy};
#[derive(Debug, Serialize, Deserialize)]
struct MessageParameters {
- message: String,
+ message: String,
}
fn main() -> Result<()> {
- let mut app = Application::new()?;
+ let mut app = Application::new()?;
- let html = r#"
+ let html = r#"