feat:初始化Tauri应用。
This commit is contained in:
23
.github/instructions/tauri-svelte-workflow.instructions.md
vendored
Normal file
23
.github/instructions/tauri-svelte-workflow.instructions.md
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
description: "Use when implementing or refactoring features in this Tauri + SvelteKit app, especially when editing src/**/*.svelte, src/**/*.ts, or src-tauri/src/**/*.rs. Covers frontend-backend command contracts, validation, and project checks."
|
||||
name: "Tauri Svelte Workflow"
|
||||
applyTo:
|
||||
- "src/**/*.svelte"
|
||||
- "src/**/*.ts"
|
||||
- "src-tauri/src/**/*.rs"
|
||||
---
|
||||
# Tauri Svelte Workflow
|
||||
|
||||
- Project default preference: keep UI concerns in route components and move reusable logic into src/lib.
|
||||
- Preserve SPA mode by default unless the task explicitly requires SSR: keep src/routes/+layout.ts with ssr set to false.
|
||||
- When adding a Tauri command, prefer defining it in src-tauri/src/lib.rs and registering it in tauri::generate_handler.
|
||||
- For fallible Rust commands, prefer Result<T, String> with actionable error messages.
|
||||
- Keep the Rust command name and frontend invoke name aligned and stable.
|
||||
- Validate user input before invoke on the frontend, and validate again in Rust before processing.
|
||||
- For data passed between frontend and Rust, prefer explicit types over loosely shaped payloads.
|
||||
- Prefer small focused changes and avoid editing generated outputs in build/, target/, and node_modules/.
|
||||
- Before considering work complete, run both checks when changes affect frontend or Rust build paths:
|
||||
- npm run check
|
||||
- cargo check --manifest-path src-tauri/Cargo.toml
|
||||
|
||||
If a task gives explicit conflicting requirements, follow the task and document the exception in your response.
|
||||
Reference in New Issue
Block a user