Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor(tauri): move tauri-api and tauri-updater to tauri #1455

Merged
merged 12 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .changes/api-path-cwd.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
"api": minor
"tauri-api": minor
---
Add current working directory to the path api module.
1 change: 0 additions & 1 deletion .changes/config-refactor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
"tauri-utils": minor
"tauri-api": minor
"tauri": minor
---

Expand Down
34 changes: 19 additions & 15 deletions .changes/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,18 @@
"tauri-cli": {
"path": "./cli/core",
"manager": "rust",
"dependencies": ["api", "tauri-bundler", "tauri"]
"dependencies": [
"api",
"tauri-bundler",
"tauri"
]
},
"tauri.js": {
"path": "./cli/tauri.js",
"manager": "javascript",
"dependencies": ["tauri-cli"],
"dependencies": [
"tauri-cli"
],
"assets": [
{
"path": "./cli/tauri.js/tauri-${ pkgFile.version }.tgz",
Expand All @@ -172,25 +178,20 @@
"create-tauri-app": {
"path": "./cli/create-tauri-app",
"manager": "javascript",
"dependencies": ["tauri.js"]
"dependencies": [
"tauri.js"
]
},
"tauri-utils": {
"path": "./core/tauri-utils",
"manager": "rust"
},
"tauri-api": {
"path": "./core/tauri-api",
"manager": "rust",
"dependencies": ["tauri-utils"]
},
"tauri-macros": {
"path": "./core/tauri-macros",
"manager": "rust",
"dependencies": ["tauri-utils"]
},
"tauri-updater": {
"path": "./core/tauri-updater",
"manager": "rust"
"dependencies": [
"tauri-utils"
]
},
"tauri-build": {
"path": "./core/tauri-build",
Expand All @@ -203,7 +204,10 @@
"tauri": {
"path": "./core/tauri",
"manager": "rust",
"dependencies": ["api", "tauri-api", "tauri-macros", "tauri-updater"]
"dependencies": [
"api",
"tauri-macros"
]
}
}
}
}
2 changes: 1 addition & 1 deletion .changes/correct-http-api-types.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"tauri-api": patch
"tauri": patch
---

Align HTTP API types with the [documentation](https://tauri.studio/en/docs/api/js#http).
2 changes: 1 addition & 1 deletion .changes/dialog-api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"tauri-api": minor
"tauri": minor
---

The `message` and `ask` dialogs now use `tinyfiledialogs-rs` instead of `tauri-dialog-rs`.
1 change: 0 additions & 1 deletion .changes/event-unlisten-js.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
"tauri-api": minor
"tauri": minor
---

Expand Down
2 changes: 1 addition & 1 deletion .changes/file-dialog-refactor.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"tauri-api": minor
"tauri": minor
"api": minor
---

Expand Down
1 change: 0 additions & 1 deletion .changes/http-api-refactor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
"api": minor
"tauri-api": minor
"tauri": minor
---

Expand Down
1 change: 0 additions & 1 deletion .changes/js-app-metadata.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
"tauri-api": minor
"tauri": minor
---

Expand Down
2 changes: 1 addition & 1 deletion .changes/js-event-once.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"tauri-api": minor
"tauri": minor
---

The event listener `once` kind was moved to a dedicated function.
2 changes: 1 addition & 1 deletion .changes/json-parse-rpc.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"tauri-api": patch
"tauri": patch
---

Use ``JSON.parse(String.raw`{arg}`)`` for communicating serialized JSON objects and arrays < 1 GB to the Webview from Rust.
Expand Down
2 changes: 0 additions & 2 deletions .changes/license.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"tauri-cli": patch
"tauri.js": patch
"tauri-utils": patch
"tauri-api": patch
"tauri-macros": patch
"tauri-updater": patch
"tauri-build": patch
"tauri-codegen": patch
"tauri": patch
Expand Down
2 changes: 0 additions & 2 deletions .changes/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ Use the following format:
"tauri-cli": patch
"tauri.js": patch
"tauri-utils": patch
"tauri-api": patch
"tauri-macros": patch
"tauri-updater": patch
"tauri-build": patch
"tauri-codegen": patch
"tauri": patch
Expand Down
1 change: 0 additions & 1 deletion .changes/shortcut-api.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
"api": minor
"tauri-api": minor
"tauri": minor
---

Expand Down
1 change: 0 additions & 1 deletion .changes/updater-alpha.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
"tauri-updater": minor
"tauri-cli": minor
"tauri-bundler": minor
"tauri": minor
Expand Down
6 changes: 1 addition & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@

/cli/tauri.js/ @tauri-apps/js-cli

/tauri-update/ @tauri-apps/core

/tauri-api/ @tauri-apps/core

/tauri/ @tauri-apps/core
/core/** @tauri-apps/core
1 change: 0 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Some Tauri packages will be automatically built when running one of the examples
### Packages Overview

- The JS API (`/api`) contains JS bindings to the builtin Rust functions in the Rust API.
- The Rust API (`/core/tauri-api`) contains the Rust functions used by the JS API.
- Tauri.js (`/cli/tauri.js`) is the primary CLI for creating and developing Tauri apps.
- The Rust CLI (`/cli/core`) is a new version of the CLI that will replace Tauri.js, but now it only supports build and dev commands. Tauri.js will automatically use the Rust CLI for these commands.
- Tauri Bundler (`/cli/tauri-bundler`) is used by the Rust CLI to package executables into installers.
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/artifacts-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
paths:
- '.github/workflows/artifacts-updater.yml'
- 'core/tauri/**'
- 'core/tauri-updater/**'
- 'cli/core/**'
- 'cli/tauri-bundler/**'
- 'examples/updater/**'
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/covector-version-or-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ jobs:
registryName: tauri-bundler
- name: tauri-utils
registryName: tauri-utils
- name: tauri-api
registryName: tauri-api
- name: tauri-updater
registryName: tauri-updater
- name: tauri-core
registryName: tauri

Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
members = [
# core
"core/tauri",
"core/tauri-api",
"core/tauri-macros",
"core/tauri-utils",
"core/tauri-build",
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ Tauri Apps
|-----------|---------|------|-----|-----|-----|
| [**tauri.js CLI**](https://github.com/tauri-apps/tauri/tree/dev/cli/tauri.js) | create, develop and build apps | [![](https://img.shields.io/npm/v/tauri.svg)](https://www.npmjs.com/package/tauri) |✅|✅|✅|
| [**tauri core**](https://github.com/tauri-apps/tauri/tree/dev/tauri) | binding to the low level WEBVIEW | [![](https://img.shields.io/crates/v/tauri.svg)](https://crates.io/crates/tauri)|✅|✅|✅|
| [**tauri api**](https://github.com/tauri-apps/tauri/tree/dev/tauri-api) | interface with the underlying OS | [![](https://img.shields.io/crates/v/tauri-api.svg)](https://crates.io/crates/tauri-api) |✅|✅|✅ |
| [**tauri bundler**](https://github.com/tauri-apps/tauri/tree/dev/cli/tauri-bundler) | manufacture the final binaries | [![](https://img.shields.io/crates/v/tauri-bundler.svg)](https://crates.io/crates/tauri-bundler) |✅|✅|✅ |
| [**tauri utils**](https://github.com/tauri-apps/tauri/tree/dev/tauri-utils) | common tools for tauri| [![](https://img.shields.io/crates/v/tauri-utils.svg)](https://crates.io/crates/tauri-utils) |✅|✅|✅ |
| [**tauri updater**](https://github.com/tauri-apps/tauri/tree/dev/tauri-updater) [WIP] | update the userland app | [![](https://img.shields.io/crates/v/tauri-updater.svg)](https://crates.io/crates/tauri-updater) | | | |


## Introduction
Expand Down
1 change: 0 additions & 1 deletion core/tauri-api/.license_template

This file was deleted.

48 changes: 0 additions & 48 deletions core/tauri-api/CHANGELOG.md

This file was deleted.

54 changes: 0 additions & 54 deletions core/tauri-api/Cargo.toml

This file was deleted.

2 changes: 1 addition & 1 deletion core/tauri-build/src/codegen/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl CodegenContext {
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.
context_path: quote::quote!(::tauri::Context),
root: quote::quote!(::tauri::Context),
})?;

// get the full output file path
Expand Down
2 changes: 1 addition & 1 deletion core/tauri-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ proc-macro2 = "1"
quote = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tauri-api = { path = "../tauri-api", features = ["build"] }
tauri-utils = { path = "../tauri-utils", features = ["build"] }
thiserror = "1"
walkdir = "2"
zstd = "0.7"
10 changes: 5 additions & 5 deletions core/tauri-codegen/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ use crate::embedded_assets::{EmbeddedAssets, EmbeddedAssetsError};
use proc_macro2::TokenStream;
use quote::quote;
use std::path::PathBuf;
use tauri_api::config::Config;
use tauri_utils::config::Config;

/// Necessary data needed by [`context_codegen`] to generate code for a Tauri application context.
pub struct ContextData {
pub dev: bool,
pub config: Config,
pub config_parent: PathBuf,
pub context_path: TokenStream,
pub root: TokenStream,
}

/// Build a `tauri::Context` for including in application code.
Expand All @@ -22,7 +22,7 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
dev,
config,
config_parent,
context_path,
root,
} = data;
let assets_path = if dev {
// if dev_path is a dev server, we don't have any assets to embed
Expand Down Expand Up @@ -51,11 +51,11 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
};

// double braces are purposeful to force the code into a block expression
Ok(quote!(#context_path {
Ok(quote!(#root::Context {
config: #config,
assets: #assets,
default_window_icon: #default_window_icon,
package_info: ::tauri::api::PackageInfo {
package_info: #root::api::PackageInfo {
name: env!("CARGO_PKG_NAME"),
version: env!("CARGO_PKG_VERSION")
}
Expand Down