Skip to content

Commit bc3a46b

Browse files
FabianLarstillmann-crabnebulachip-crabnebula
authored
docs: Clean up wip pages (#2282)
Co-authored-by: Tillmann <112912081+tillmann-crabnebula@users.noreply.github.com> Co-authored-by: Chip Reed <chip@crabnebula.dev>
1 parent 10d431e commit bc3a46b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+261
-358
lines changed

astro.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ export default defineConfig({
388388
// v1 /guides/debugging -> /guides/debug
389389
...i18nRedirect('/v1/guides/debugging/application', '/guides/debug/application'),
390390
...i18nRedirect('/v1/guides/debugging/vs-code', '/guides/debug/vs-code'),
391-
...i18nRedirect('/v1/guides/debugging/clion', '/guides/debug/clion'),
391+
...i18nRedirect('/v1/guides/debugging/rustrover', '/guides/debug/rustrover'),
392392
// v1 /guides/development -> /guides/develop
393393
...i18nRedirect(
394394
'/v1/guides/development/development-cycle',

packages/config-generator/build.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,16 @@ generatePageFromSchema(
2626
'Scope'
2727
);
2828

29-
async function generatePageFromSchema(schemaFile: string, outputFile: string, pageTitle: string, sidebarOrder: number = 1) {
29+
async function generatePageFromSchema(
30+
schemaFile: string,
31+
outputFile: string,
32+
pageTitle: string,
33+
sidebarOrder: number = 1
34+
) {
3035
if (!existsSync(schemaFile)) {
31-
throw Error(`Could not find the Tauri config schema ${schemaFile}. Is the Tauri submodule initialized?`);
36+
throw Error(
37+
`Could not find the Tauri config schema ${schemaFile}. Is the Tauri submodule initialized?`
38+
);
3239
}
3340

3441
let schema: JSONSchema7 = (await import(schemaFile)).default;

src/components/ShowSolution.astro

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
let { text } = Astro.props;
3-
text = text ?? "Show solution";
3+
text = text ?? 'Show solution';
44
---
55

66
<show-solution class="show-solution">
@@ -16,28 +16,22 @@ text = text ?? "Show solution";
1616
#button: HTMLButtonElement | null = null;
1717
constructor() {
1818
super();
19-
this.#button = this.querySelector("button");
20-
this.#button?.addEventListener("click", this.#toggle);
21-
this.#contentDiv = this.querySelector("div");
19+
this.#button = this.querySelector('button');
20+
this.#button?.addEventListener('click', this.#toggle);
21+
this.#contentDiv = this.querySelector('div');
2222
}
2323
#toggle = () => {
2424
if (this.#button)
25-
if (this.#contentDiv?.classList.contains("hidden")) {
26-
this.#contentDiv.classList.remove("hidden");
27-
this.#button.innerText = this.#button.innerText.replace(
28-
"Show",
29-
"Hide"
30-
);
25+
if (this.#contentDiv?.classList.contains('hidden')) {
26+
this.#contentDiv.classList.remove('hidden');
27+
this.#button.innerText = this.#button.innerText.replace('Show', 'Hide');
3128
} else {
32-
this.#contentDiv?.classList.add("hidden");
33-
this.#button.innerText = this.#button.innerText.replace(
34-
"Hide",
35-
"Show"
36-
);
29+
this.#contentDiv?.classList.add('hidden');
30+
this.#button.innerText = this.#button.innerText.replace('Hide', 'Show');
3731
}
3832
};
3933
}
40-
customElements.define("show-solution", ShowSolution);
34+
customElements.define('show-solution', ShowSolution);
4135
</script>
4236

4337
<style>

src/content/docs/blog/tauri-1-3.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,15 @@ Assuming a **fully trusted** web service on `https://trusted.example` it is now
7474
Shared domains **MUST NOT** be used for this in any circumstances. We do not limit access to paths or specific files. You can only scope with **trusted** _(sub)domains_[^6]. Another very risky catch is that developers must be sure that the domain ownership does not change over the lifetime of the application. Domain takeover could lead to compromised user devices.
7575

7676
[^1]: _Inter-Process Communication_, in this instance the communication between the Tauri core and the frontend code run inside the webview.
77+
7778
[^2]: _Security Impact_: What is the theoretical biggest impact of this threat combination? This highly depends on correct scoping of Tauri API endpoints and hardening of custom implemented Tauri commands.
79+
7880
[^3]: _Exposure_: Describes the exposed scope items of this feature to either an user or adversary. It is possible to restrict exposure to only certain domains, windows or only to custom implemented commands.
81+
7982
[^4]: _Adversary Capabilities_: Which kind of privileges has the adversary? Can range from tricking user into entering malicious input to code execution in the frontend via cross-site-scripting (which is the highest privilege for frontend code in our case). Common capabilities are described in the [OWASP documentation](https://owasp.org/www-community/attacks/).
83+
8084
[^5]: _An application can be exploited if it parses user input for making an URL redirection decision, which is then not properly validated._ [Wikipedia Source](https://en.wikipedia.org/wiki/Open_redirect)
85+
8186
[^6]: see the [Reqwest reference](https://docs.rs/reqwest/latest/reqwest/struct.Url.html#method.domain)
8287

8388
### Browser Arguments [#5799](https://github.com/tauri-apps/tauri/pull/5799)

src/content/docs/develop/Debug/index.mdx

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@ title: Debug
33
sidebar:
44
label: Overview
55
order: 10
6-
badge:
7-
text: WIP
8-
variant: caution
96
---
107

11-
{/* TODO: REVISE COPY TO V2 */}
12-
138
import CommandTabs from '@components/CommandTabs.astro';
149

1510
With all the moving pieces in Tauri, you may run into a problem that requires debugging. There are many locations where error details are printed, and Tauri includes some tools to make the debugging process more straightforward.
@@ -22,9 +17,19 @@ One of the most useful tools in your toolkit for debugging is the ability to add
2217

2318
```rs frame=none
2419
fn main() {
25-
// Tauri provided convenience function for whether you ran with `tauri dev`.
26-
let is_dev: bool = tauri::dev();
27-
// If debug assertions are enabled or not.
20+
// Whether the current instance was started with `tauri dev` or not.
21+
#[cfg(dev)]
22+
{
23+
// `tauri dev` only code
24+
}
25+
if cfg!(dev) {
26+
// `tauri dev` only code
27+
} else {
28+
// `tauri build` only code
29+
}
30+
let is_dev: bool = tauri::is_dev();
31+
32+
// Whether debug assertions are enabled or not. This is true for `tauri dev` and `tauri build --debug`.
2833
#[cfg(debug_assertions)]
2934
{
3035
// Debug only code
@@ -37,6 +42,8 @@ fn main() {
3742
}
3843
```
3944

45+
{/* TODO: js version */}
46+
4047
## Rust Console
4148

4249
The first place to look for errors is in the Rust Console. This is in the terminal where you ran, e.g., `tauri dev`. You can use the following code to print something to that console from within a Rust file:
@@ -51,10 +58,10 @@ Sometimes you may have an error in your Rust code, and the Rust compiler can giv
5158
RUST_BACKTRACE=1 tauri dev
5259
```
5360

54-
or like this on Windows:
61+
or like this on Windows (PowerShell):
5562

56-
```shell frame=none
57-
set RUST_BACKTRACE=1
63+
```powershell frame=none
64+
$env:RUST_BACKTRACE=1
5865
tauri dev
5966
```
6067

@@ -125,7 +132,7 @@ The devtools API is private on macOS. Using private APIs on macOS prevents your
125132

126133
:::
127134

128-
To enable the devtools in production builds, you must enable the `devtools` Cargo feature in the `src-tauri/Cargo.toml` file:
135+
To enable the devtools in **production builds**, you must enable the `devtools` Cargo feature in the `src-tauri/Cargo.toml` file:
129136

130137
```toml
131138
[dependencies]

src/content/docs/develop/Debug/intellij.mdx

Lines changed: 0 additions & 66 deletions
This file was deleted.

src/content/docs/develop/Debug/rustrover.mdx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
---
2-
title: Debug in RustRover
3-
sidebar:
4-
badge:
5-
text: WIP
6-
variant: caution
2+
title: Debug in JetBrains IDEs
73
---
84

9-
{/* TODO: Update links and internal navigation */}
105
{/* TODO: Add support to light/dark mode images */}
116

12-
In this guide, we'll be setting up JetBrains RustRover for debugging the [Core Process of your Tauri app](/concept/process-model/#the-core-process).
7+
In this guide, we'll be setting up JetBrains RustRover for debugging the [Core Process of your Tauri app](/concept/process-model/#the-core-process). It also mostly applies to IntelliJ and CLion.
138

149
## Setting up a Cargo project
1510

@@ -24,7 +19,7 @@ Alternatively, you could create a top-level Cargo workspace manually by adding t
2419
members = ["src-tauri"]
2520
```
2621

27-
Before you proceed, make sure that your project is fully loaded. If the Cargo tool window shows all the modules and targets of the workspace, youre good to go.
22+
Before you proceed, make sure that your project is fully loaded. If the Cargo tool window shows all the modules and targets of the workspace, you're good to go.
2823

2924
## Setting up Run Configurations
3025

src/content/docs/develop/Debug/vscode.mdx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
---
22
title: Debug in VS Code
3-
sidebar:
4-
badge:
5-
text: WIP
6-
variant: caution
73
---
84

9-
{/* TODO: REVISE COPY TO V2 */}
10-
{/* TODO: Revise this change: Debugging in VS Code > Debug in VS Code */}
11-
125
This guide will walk you through setting up VS Code for debugging the [Core Process of your Tauri app](/concept/process-model/#the-core-process).
136

147
## Prerequisites

src/content/docs/develop/Tests/Pipelines/github.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: GitHub
33
sidebar:
44
badge:
5-
text: WIP
5+
text: Stub
66
variant: caution
77
---
88

src/content/docs/develop/Tests/Pipelines/gitlab.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: GitLab
33
sidebar:
44
badge:
5-
text: WIP
5+
text: Stub
66
variant: caution
77
---
88

0 commit comments

Comments
 (0)