From ad341517dfe20ca1abfa628aca7bd5065a0050f8 Mon Sep 17 00:00:00 2001 From: nothingismagick Date: Thu, 24 Jun 2021 13:57:12 +0200 Subject: [PATCH 1/9] chore(issue-template): make tauri info required [skip ci] (#2066) Make our expectations clear. --- .github/ISSUE_TEMPLATE/bug_report.md | 62 +++++++++++++++++++++------- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index a42514839..55e8e4861 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,32 +7,66 @@ assignees: '' --- -**Describe the bug** + + + +### **Describe the bug** A clear and concise description of what the bug is. -**To Reproduce** +### **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error -**Expected behavior** +### **Expected behavior** A clear and concise description of what you expected to happen. -**Screenshots** +### **Screenshots** If applicable, add screenshots to help explain your problem. -**Platform and Versions (please complete the following information):** - -OS: -Node: -NPM: -Yarn: -Rustc: +### **Platform and Versions (required):** + +``` +Operating System -**Additional context** +Node.js environment +Node.js +@tauri-apps/cli +@tauri-apps/api + +Global packages +npm +yarn + +Rust environment +rustc +cargo + +App directory structure + + +App +tauri.rs +build-type +CSP +``` + +### **Additional context** Add any other context about the problem here. -**Stack Trace** - \ No newline at end of file +### **Stack Trace** + From 394b6e0572e7a0a92e103e462a7f603f7d569319 Mon Sep 17 00:00:00 2001 From: Roojay Date: Thu, 24 Jun 2021 20:38:29 +0800 Subject: [PATCH 2/9] fix(api): http `ResponseType` export type error (#2065) Co-authored-by: Lucas Nogueira --- .changes/api-export-type-fix.md | 5 +++++ tooling/api/src/http.ts | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changes/api-export-type-fix.md diff --git a/.changes/api-export-type-fix.md b/.changes/api-export-type-fix.md new file mode 100644 index 000000000..8c871e80c --- /dev/null +++ b/.changes/api-export-type-fix.md @@ -0,0 +1,5 @@ +--- +"api": patch +--- + +Export `Response` and `ResponseType` as value instead of type. diff --git a/tooling/api/src/http.ts b/tooling/api/src/http.ts index 64dac1386..9975b587d 100644 --- a/tooling/api/src/http.ts +++ b/tooling/api/src/http.ts @@ -348,13 +348,11 @@ async function fetch( export type { ClientOptions, - ResponseType, Part, HttpVerb, HttpOptions, RequestOptions, - FetchOptions, - Response + FetchOptions } -export { getClient, fetch, Body, Client } +export { getClient, fetch, Body, Client, Response, ResponseType } From c57139f16f65834189d35ff713ee9bc4bfbc36fd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 24 Jun 2021 09:39:00 -0300 Subject: [PATCH 3/9] chore(deps) Update dependency typedoc-plugin-markdown to v3.10.1 (#2059) Co-authored-by: Renovate Bot --- tooling/api/package.json | 2 +- tooling/api/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tooling/api/package.json b/tooling/api/package.json index f626d16f0..7b560e9b3 100644 --- a/tooling/api/package.json +++ b/tooling/api/package.json @@ -67,7 +67,7 @@ "rollup-plugin-terser": "7.0.2", "tslib": "2.3.0", "typedoc": "0.21.0", - "typedoc-plugin-markdown": "3.10.0", + "typedoc-plugin-markdown": "3.10.1", "typescript": "4.3.4" } } diff --git a/tooling/api/yarn.lock b/tooling/api/yarn.lock index f6953edcd..a0f9a4b19 100644 --- a/tooling/api/yarn.lock +++ b/tooling/api/yarn.lock @@ -3231,10 +3231,10 @@ typedoc-default-themes@^0.12.10: resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.12.10.tgz#614c4222fe642657f37693ea62cad4dafeddf843" integrity sha512-fIS001cAYHkyQPidWXmHuhs8usjP5XVJjWB8oZGqkTowZaz3v7g3KDZeeqE82FBrmkAnIBOY3jgy7lnPnqATbA== -typedoc-plugin-markdown@3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.10.0.tgz#fa06e9e67376095e68e2ce0a778b4827748d1b8b" - integrity sha512-FYset/F0zFuoTVn3ljUEH+CShMe95JPMnFOTFuqxJViztmgIIvGiygcQz2DKjdEv+fHTohrvjq30KGPkuv+6Qg== +typedoc-plugin-markdown@3.10.1: + version "3.10.1" + resolved "https://registry.yarnpkg.com/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.10.1.tgz#9d15c16c1a29da4c137123565019d1de967987b4" + integrity sha512-C7s9p6DOGagPPp65g7af8OKm6Ou0rT/TP0Nphy6PQ4w6bC9BZnlOzWt1l05ER38HhON6/2prONnYwEMK5YOYCA== dependencies: handlebars "^4.7.7" From df95fb6aaaf3aa8342c4fce52455adcb41ff27e0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 24 Jun 2021 09:47:49 -0300 Subject: [PATCH 4/9] Apply Version Updates From Current Changes (#2068) Co-authored-by: lucasfernog --- .changes/pre.json | 1 + tooling/api/CHANGELOG.md | 5 +++++ tooling/api/package.json | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.changes/pre.json b/.changes/pre.json index 15361b684..c57043973 100644 --- a/.changes/pre.json +++ b/.changes/pre.json @@ -5,6 +5,7 @@ ".changes/api-cjs-chunks.md", ".changes/api-export-BaseDirectory.md", ".changes/api-export-package-json.md", + ".changes/api-export-type-fix.md", ".changes/api-export-type.md", ".changes/api-feature-flags.md", ".changes/api-focus.md", diff --git a/tooling/api/CHANGELOG.md b/tooling/api/CHANGELOG.md index 5693c7592..8d1d7f853 100644 --- a/tooling/api/CHANGELOG.md +++ b/tooling/api/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## \[1.0.0-beta.3] + +- Export `Response` and `ResponseType` as value instead of type. + - [394b6e05](https://www.github.com/tauri-apps/tauri/commit/394b6e0572e7a0a92e103e462a7f603f7d569319) fix(api): http `ResponseType` export type error ([#2065](https://www.github.com/tauri-apps/tauri/pull/2065)) on 2021-06-24 + ## \[1.0.0-beta.2] - Export `BaseDirectory` in `path` module diff --git a/tooling/api/package.json b/tooling/api/package.json index 7b560e9b3..a64926602 100644 --- a/tooling/api/package.json +++ b/tooling/api/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/api", - "version": "1.0.0-beta.2", + "version": "1.0.0-beta.3", "description": "Tauri API definitions", "type": "module", "funding": { From 9125affab793974205ca32acb48f320a39932a06 Mon Sep 17 00:00:00 2001 From: Thad Guidry Date: Thu, 24 Jun 2021 15:28:41 -0500 Subject: [PATCH 5/9] Add note about Toast notifications (#2071) ...in case user's actually search with "toast" a typical word used in web and app development for brief auto-expiring OS window element for notifying user. --- tooling/api/src/notification.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tooling/api/src/notification.ts b/tooling/api/src/notification.ts index dc94222e2..ef03af64f 100644 --- a/tooling/api/src/notification.ts +++ b/tooling/api/src/notification.ts @@ -3,7 +3,8 @@ // SPDX-License-Identifier: MIT /** - * Send notifications to your user. Can also be used with the Notification Web API. + * Send toast notifications (brief auto-expiring OS window element) to your user. + * Can also be used with the Notification Web API. * * This package is also accessible with `window.__TAURI__.notification` when `tauri.conf.json > build > withGlobalTauri` is set to true. * From b46a2884acdd1249c74e1dca7bab8c93f6d477e3 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Fri, 25 Jun 2021 00:12:01 -0300 Subject: [PATCH 6/9] fix: menu docs --- docs/usage/guides/visual/menu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/guides/visual/menu.md b/docs/usage/guides/visual/menu.md index 65e006eb1..960036ba2 100644 --- a/docs/usage/guides/visual/menu.md +++ b/docs/usage/guides/visual/menu.md @@ -29,7 +29,7 @@ Create a `Menu` instance: // here `"quit".to_string()` defines the menu item id, and the second parameter is the menu item label. let quit = CustomMenuItem::new("quit".to_string(), "Quit"); let close = CustomMenuItem::new("close".to_string(), "Close"); -let submenu = Menu::new().add_item(quit).add_item(close); +let submenu = Submenu::new("File", Menu::new().add_item(quit).add_item(close)); let menu = Menu::new() .add_native_item(MenuItem::Copy) .add_item(CustomMenuItem::new("hide", "Hide")) From ed5c1cd51455a83ca1427a7b77dc2bf9e9e3e093 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Fri, 25 Jun 2021 00:43:27 -0300 Subject: [PATCH 7/9] fix: error message on `path` API usage when not allowlisted --- core/tauri/src/endpoints/file_system.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tauri/src/endpoints/file_system.rs b/core/tauri/src/endpoints/file_system.rs index 0dabb702d..8794ed74d 100644 --- a/core/tauri/src/endpoints/file_system.rs +++ b/core/tauri/src/endpoints/file_system.rs @@ -207,7 +207,7 @@ impl Cmd { resolve_path_handler(&config, package_info, path, directory).map(Into::into) } #[cfg(not(fs_path))] - Self::ResolvePath { .. } => Err(crate::Error::ApiNotAllowlisted("fs > pathApi".to_string())), + Self::ResolvePath { .. } => Err(crate::Error::ApiNotAllowlisted("fs > path".to_string())), } } } From a61572127df839ed23e34e9b49b2bada5f18f7fb Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Fri, 25 Jun 2021 21:15:45 -0300 Subject: [PATCH 8/9] fix(bundler): resources bundling on Windows with nested folder structure (#2081) --- .changes/fix-wix-resources.md | 5 ++ tooling/bundler/src/bundle/windows/msi/wix.rs | 82 ++++++++----------- 2 files changed, 41 insertions(+), 46 deletions(-) create mode 100644 .changes/fix-wix-resources.md diff --git a/.changes/fix-wix-resources.md b/.changes/fix-wix-resources.md new file mode 100644 index 000000000..5239c020d --- /dev/null +++ b/.changes/fix-wix-resources.md @@ -0,0 +1,5 @@ +--- +"tauri-bundler": patch +--- + +Properly bundle resources with nested folder structure. diff --git a/tooling/bundler/src/bundle/windows/msi/wix.rs b/tooling/bundler/src/bundle/windows/msi/wix.rs index 99641621d..1f7ec0326 100644 --- a/tooling/bundler/src/bundle/windows/msi/wix.rs +++ b/tooling/bundler/src/bundle/windows/msi/wix.rs @@ -486,6 +486,7 @@ pub fn build_wix_app_installer( data.insert("binaries", binaries_json); let resources = generate_resource_data(settings)?; + println!("{:?}", serde_json::to_string(&resources).unwrap()); let mut resources_wix_string = String::from(""); let mut files_ids = Vec::new(); for (_, dir) in resources { @@ -703,19 +704,35 @@ fn generate_resource_data(settings: &Settings) -> crate::Result { }; // split the resource path directories - let mut directories = src + let directories = src .components() .filter(|component| { let comp = component.as_os_str(); comp != "." && comp != ".." }) .collect::>(); - directories.truncate(directories.len() - 1); // transform the directory structure to a chained vec structure let first_directory = directories .first() .map(|d| d.as_os_str().to_string_lossy().into_owned()) .unwrap_or_else(String::new); + + if !resources.contains_key(&first_directory) { + resources.insert( + first_directory.clone(), + ResourceDirectory { + path: first_directory.clone(), + name: first_directory.clone(), + directories: vec![], + files: vec![], + }, + ); + } + + let mut directory_entry = resources + .get_mut(&first_directory) + .expect("Unable to handle resources"); + let last_index = directories.len() - 1; let mut path = String::new(); for (i, directory) in directories.into_iter().enumerate() { @@ -725,57 +742,30 @@ fn generate_resource_data(settings: &Settings) -> crate::Result { .into_string() .expect("failed to read resource folder name"); path.push_str(directory_name.as_str()); + path.push(std::path::MAIN_SEPARATOR); - // if the directory is already on the map - if resources.contains_key(&first_directory) { - let directory_entry = &mut resources - .get_mut(&first_directory) - .expect("Unable to handle resources"); - if last_index == 0 { - // the directory entry is the root of the chain - directory_entry.add_file(resource_entry.clone()); - } else { - let index = directory_entry - .directories - .iter() - .position(|f| f.path == path); - if let Some(index) = index { - // the directory entry is already a part of the chain - if i == last_index { - let dir = directory_entry - .directories - .get_mut(index) - .expect("Unable to get directory"); - dir.add_file(resource_entry.clone()); - } - } else { - // push it to the chain + if i == last_index { + directory_entry.add_file(resource_entry); + break; + } else if i == 0 { + continue; + } else { + let index = directory_entry + .directories + .iter() + .position(|f| f.path == path); + match index { + Some(i) => directory_entry = directory_entry.directories.iter_mut().nth(i).unwrap(), + None => { directory_entry.directories.push(ResourceDirectory { path: path.clone(), - name: directory_name.clone(), + name: directory_name, directories: vec![], - files: if i == last_index { - vec![resource_entry.clone()] - } else { - vec![] - }, + files: vec![], }); + directory_entry = directory_entry.directories.iter_mut().last().unwrap(); } } - } else { - resources.insert( - directory_name.clone(), - ResourceDirectory { - path: path.clone(), - name: directory_name.clone(), - directories: vec![], - files: if i == last_index { - vec![resource_entry.clone()] - } else { - vec![] - }, - }, - ); } } } From 2a65ac1a7782aaf065d0f9ab5fcef3d19ed3d26a Mon Sep 17 00:00:00 2001 From: Laegel Date: Sat, 26 Jun 2021 17:14:54 +0200 Subject: [PATCH 9/9] Fix/update docs (#2070) * fix: Adding SSH inspector * debug: Update docs * debug: With SSH * fix: Wrong target path for typedocusaurus * fix: Search bot is SCPed in a deeper directory --- .github/workflows/update-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml index 0b68d616b..4a04f3fd3 100644 --- a/.github/workflows/update-docs.yml +++ b/.github/workflows/update-docs.yml @@ -68,7 +68,7 @@ jobs: with: originPath: ./tauri/tooling/api/ sidebarFile: "${{ github.workspace }}/tauri-docs/sidebars/typedoc.json" - targetPath: ./tauri-docs/en/api/js + targetPath: ${{ github.workspace }}/tauri-docs/docs/en/api/js docusaurusPath: ./tauri-docs/ # Moving docs for Indexation @@ -121,7 +121,7 @@ jobs: host: ${{ secrets.DISCORD_BOT_HOST }} username: ${{ secrets.DISCORD_BOT_SSH_USER }} key: ${{ secrets.DISCORD_BOT_SSH_KEY }} - script: cd ~/tauri-search-bot && yarn && forever stopall && forever start ./src/index.js + script: cd ~/tauri-search-bot/github/workspace/tauri-search-bot/ && yarn && forever stopall && forever start ./src/index.js # tauri-docs PR - name: git config