tauri-plugin-debug-tools 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +346 -0
- package/LICENSE +21 -0
- package/README.md +303 -0
- package/dist-js/consoleLogger.d.ts +92 -0
- package/dist-js/consoleLogger.d.ts.map +1 -0
- package/dist-js/consoleLogger.js +317 -0
- package/dist-js/debugBridge.d.ts +50 -0
- package/dist-js/debugBridge.d.ts.map +1 -0
- package/dist-js/debugBridge.js +66 -0
- package/dist-js/index.d.ts +3 -0
- package/dist-js/index.d.ts.map +1 -0
- package/dist-js/index.js +2 -0
- package/dist-js/logAdapter.d.ts +36 -0
- package/dist-js/logAdapter.d.ts.map +1 -0
- package/dist-js/logAdapter.js +42 -0
- package/dist-js/screenshotHelper.d.ts +60 -0
- package/dist-js/screenshotHelper.d.ts.map +1 -0
- package/dist-js/screenshotHelper.js +100 -0
- package/examples/.vscode/extensions.json +3 -0
- package/examples/README.md +51 -0
- package/examples/bun.lock +265 -0
- package/examples/package.json +19 -0
- package/examples/src/assets/javascript.svg +1 -0
- package/examples/src/assets/tauri.svg +6 -0
- package/examples/src/index.html +56 -0
- package/examples/src/main.js +91 -0
- package/examples/src/styles.css +112 -0
- package/examples/src-tauri/Cargo.lock +5674 -0
- package/examples/src-tauri/Cargo.toml +25 -0
- package/examples/src-tauri/build.rs +3 -0
- package/examples/src-tauri/capabilities/default.json +7 -0
- package/examples/src-tauri/icons/128x128.png +0 -0
- package/examples/src-tauri/icons/128x128@2x.png +0 -0
- package/examples/src-tauri/icons/32x32.png +0 -0
- package/examples/src-tauri/icons/Square107x107Logo.png +0 -0
- package/examples/src-tauri/icons/Square142x142Logo.png +0 -0
- package/examples/src-tauri/icons/Square150x150Logo.png +0 -0
- package/examples/src-tauri/icons/Square284x284Logo.png +0 -0
- package/examples/src-tauri/icons/Square30x30Logo.png +0 -0
- package/examples/src-tauri/icons/Square310x310Logo.png +0 -0
- package/examples/src-tauri/icons/Square44x44Logo.png +0 -0
- package/examples/src-tauri/icons/Square71x71Logo.png +0 -0
- package/examples/src-tauri/icons/Square89x89Logo.png +0 -0
- package/examples/src-tauri/icons/StoreLogo.png +0 -0
- package/examples/src-tauri/icons/icon.icns +0 -0
- package/examples/src-tauri/icons/icon.ico +0 -0
- package/examples/src-tauri/icons/icon.png +0 -0
- package/examples/src-tauri/src/lib.rs +15 -0
- package/examples/src-tauri/src/main.rs +6 -0
- package/examples/src-tauri/tauri.conf.json +33 -0
- package/examples/tests/e2e.mac.test.ts +203 -0
- package/examples/tests/e2e.test.ts +131 -0
- package/examples/vitest.config.ts +10 -0
- package/guest-js/consoleLogger.ts +369 -0
- package/guest-js/debugBridge.ts +93 -0
- package/guest-js/index.ts +2 -0
- package/guest-js/logAdapter.ts +62 -0
- package/guest-js/screenshotHelper.ts +122 -0
- package/package.json +84 -0
- package/permissions/autogenerated/commands/append_debug_logs.toml +13 -0
- package/permissions/autogenerated/commands/capture_webview_state.toml +13 -0
- package/permissions/autogenerated/commands/get_console_logs.toml +13 -0
- package/permissions/autogenerated/commands/reset_debug_logs.toml +13 -0
- package/permissions/autogenerated/commands/send_debug_command.toml +13 -0
- package/permissions/autogenerated/commands/write_debug_snapshot.toml +13 -0
- package/permissions/autogenerated/reference.md +201 -0
- package/permissions/debug-with-logging.toml +26 -0
- package/permissions/default.toml +26 -0
- package/permissions/schemas/schema.json +384 -0
- package/skills/debug-tauri/SKILL.md +114 -0
- package/skills/debug-tauri/references/IPC_COMMANDS.md +196 -0
- package/skills/debug-tauri/references/LOGGING.md +195 -0
- package/skills/debug-tauri/references/MIGRATION.md +487 -0
- package/skills/debug-tauri/references/REFERENCE.md +206 -0
- package/skills/debug-tauri/references/REPORT_TEMPLATE.md +166 -0
- package/skills/debug-tauri/references/SCREENSHOTS.md +193 -0
- package/skills/debug-tauri/references/TROUBLESHOOTING.md +144 -0
- package/skills/debug-tauri/scripts/analyze_logs.sh +127 -0
- package/skills/debug-tauri/scripts/capture.sh +89 -0
- package/skills/debug-tauri/scripts/validate_setup.sh +181 -0
- package/src/commands.rs +147 -0
- package/src/lib.rs +41 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
const { invoke } = window.__TAURI__.core;
|
|
2
|
+
const { listen } = window.__TAURI__.event ?? {};
|
|
3
|
+
|
|
4
|
+
let greetInputEl;
|
|
5
|
+
let greetMsgEl;
|
|
6
|
+
let debugWebviewOutputEl;
|
|
7
|
+
let debugLogsOutputEl;
|
|
8
|
+
let debugCommandOutputEl;
|
|
9
|
+
let debugSnapshotOutputEl;
|
|
10
|
+
|
|
11
|
+
async function greet() {
|
|
12
|
+
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
|
|
13
|
+
greetMsgEl.textContent = await invoke("greet", { name: greetInputEl.value });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
window.addEventListener("DOMContentLoaded", () => {
|
|
17
|
+
greetInputEl = document.querySelector("#greet-input");
|
|
18
|
+
greetMsgEl = document.querySelector("#greet-msg");
|
|
19
|
+
document.querySelector("#greet-form").addEventListener("submit", (e) => {
|
|
20
|
+
e.preventDefault();
|
|
21
|
+
greet();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
debugWebviewOutputEl = document.querySelector("#debug-webview-output");
|
|
25
|
+
debugLogsOutputEl = document.querySelector("#debug-logs-output");
|
|
26
|
+
debugCommandOutputEl = document.querySelector("#debug-command-output");
|
|
27
|
+
debugSnapshotOutputEl = document.querySelector("#debug-snapshot-output");
|
|
28
|
+
|
|
29
|
+
if (listen) {
|
|
30
|
+
listen("debug-command", (event) => {
|
|
31
|
+
debugCommandOutputEl.textContent = JSON.stringify(event.payload);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
document
|
|
36
|
+
.querySelector("#debug-capture")
|
|
37
|
+
.addEventListener("click", async () => {
|
|
38
|
+
const state = await invoke("plugin:debug-tools|capture_webview_state");
|
|
39
|
+
debugWebviewOutputEl.textContent = JSON.stringify(state);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
document
|
|
43
|
+
.querySelector("#debug-get-logs")
|
|
44
|
+
.addEventListener("click", async () => {
|
|
45
|
+
const logs = await invoke("plugin:debug-tools|get_console_logs");
|
|
46
|
+
debugLogsOutputEl.textContent = JSON.stringify(logs);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
document
|
|
50
|
+
.querySelector("#debug-send-command")
|
|
51
|
+
.addEventListener("click", async () => {
|
|
52
|
+
await invoke("plugin:debug-tools|send_debug_command", {
|
|
53
|
+
command: "ping",
|
|
54
|
+
payload: { ok: true },
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
document
|
|
59
|
+
.querySelector("#debug-reset-logs")
|
|
60
|
+
.addEventListener("click", async () => {
|
|
61
|
+
const path = await invoke("plugin:debug-tools|reset_debug_logs");
|
|
62
|
+
debugLogsOutputEl.textContent = String(path);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
document
|
|
66
|
+
.querySelector("#debug-append-logs")
|
|
67
|
+
.addEventListener("click", async () => {
|
|
68
|
+
const payload = [
|
|
69
|
+
{
|
|
70
|
+
timestamp: Date.now(),
|
|
71
|
+
level: "info",
|
|
72
|
+
message: "e2e-log",
|
|
73
|
+
args: ["e2e-log"],
|
|
74
|
+
stack_trace: null,
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
const path = await invoke("plugin:debug-tools|append_debug_logs", {
|
|
78
|
+
logs: payload,
|
|
79
|
+
});
|
|
80
|
+
debugLogsOutputEl.textContent = String(path);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
document
|
|
84
|
+
.querySelector("#debug-write-snapshot")
|
|
85
|
+
.addEventListener("click", async () => {
|
|
86
|
+
const path = await invoke("plugin:debug-tools|write_debug_snapshot", {
|
|
87
|
+
payload: { source: "e2e", ok: true },
|
|
88
|
+
});
|
|
89
|
+
debugSnapshotOutputEl.textContent = String(path);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
.logo.vanilla:hover {
|
|
2
|
+
filter: drop-shadow(0 0 2em #ffe21c);
|
|
3
|
+
}
|
|
4
|
+
:root {
|
|
5
|
+
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
|
|
6
|
+
font-size: 16px;
|
|
7
|
+
line-height: 24px;
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
|
|
10
|
+
color: #0f0f0f;
|
|
11
|
+
background-color: #f6f6f6;
|
|
12
|
+
|
|
13
|
+
font-synthesis: none;
|
|
14
|
+
text-rendering: optimizeLegibility;
|
|
15
|
+
-webkit-font-smoothing: antialiased;
|
|
16
|
+
-moz-osx-font-smoothing: grayscale;
|
|
17
|
+
-webkit-text-size-adjust: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.container {
|
|
21
|
+
margin: 0;
|
|
22
|
+
padding-top: 10vh;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
text-align: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.logo {
|
|
30
|
+
height: 6em;
|
|
31
|
+
padding: 1.5em;
|
|
32
|
+
will-change: filter;
|
|
33
|
+
transition: 0.75s;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.logo.tauri:hover {
|
|
37
|
+
filter: drop-shadow(0 0 2em #24c8db);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.row {
|
|
41
|
+
display: flex;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
a {
|
|
46
|
+
font-weight: 500;
|
|
47
|
+
color: #646cff;
|
|
48
|
+
text-decoration: inherit;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
a:hover {
|
|
52
|
+
color: #535bf2;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
h1 {
|
|
56
|
+
text-align: center;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
input,
|
|
60
|
+
button {
|
|
61
|
+
border-radius: 8px;
|
|
62
|
+
border: 1px solid transparent;
|
|
63
|
+
padding: 0.6em 1.2em;
|
|
64
|
+
font-size: 1em;
|
|
65
|
+
font-weight: 500;
|
|
66
|
+
font-family: inherit;
|
|
67
|
+
color: #0f0f0f;
|
|
68
|
+
background-color: #ffffff;
|
|
69
|
+
transition: border-color 0.25s;
|
|
70
|
+
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
button {
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
button:hover {
|
|
78
|
+
border-color: #396cd8;
|
|
79
|
+
}
|
|
80
|
+
button:active {
|
|
81
|
+
border-color: #396cd8;
|
|
82
|
+
background-color: #e8e8e8;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
input,
|
|
86
|
+
button {
|
|
87
|
+
outline: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
#greet-input {
|
|
91
|
+
margin-right: 5px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@media (prefers-color-scheme: dark) {
|
|
95
|
+
:root {
|
|
96
|
+
color: #f6f6f6;
|
|
97
|
+
background-color: #2f2f2f;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
a:hover {
|
|
101
|
+
color: #24c8db;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
input,
|
|
105
|
+
button {
|
|
106
|
+
color: #ffffff;
|
|
107
|
+
background-color: #0f0f0f98;
|
|
108
|
+
}
|
|
109
|
+
button:active {
|
|
110
|
+
background-color: #0f0f0f69;
|
|
111
|
+
}
|
|
112
|
+
}
|