chore(bootstrap): scaffold Tauri 2 + cleanup samples#2
Conversation
Generate minimal Tauri 2 + React 19 + Vite 7 scaffold via
`pnpm dlx create-tauri-app@latest --template react-ts -y`, then
strip sample greet command + Welcome page + logos. Customize
`tauri.conf.json` (identifier com.forgent.app, productName Forgent,
version 0.0.1, window 1280x800, bundle targets appimage/deb/rpm/dmg/msi).
Set Cargo.toml `license = "AGPL-3.0-only"`, drop `tauri-plugin-opener`
(unused). Use `eprintln! + std::process::exit(1)` in main.rs to surface
startup errors without violating CLAUDE.md ban on `.expect()`. Replace
scaffold's `@ts-expect-error` (forbidden) with `@types/node` typing in
single-config tsconfig.json (no composite project — avoids emitted
`vite.config.{js,d.ts}` artifacts polluting repo root).
Verification: cargo build clean (no warnings), cargo clippy -D warnings
clean, cargo fmt --check OK, tsc -b strict mode passes, vite build
produces 193 kB (60 kB gzip) bundle, `tauri info` confirms Tauri 2.11
+ React framework + Vite bundler resolved. All 9 acceptance criteria
verified per .claude/output/sprints/sprint-2026-05-01/tasks/05-*.md.
Source: ARCHI.md §21 Sprint 0 + §4.1 layout + §5.1/5.2 main/lib.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a Tauri 2 desktop app scaffold with a Rust backend and a React 19 + Vite frontend, including entrypoints, build/config files, tooling manifests, and changelog updates. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Vite as Vite Dev Server
participant Tauri as Tauri Runtime (Rust)
participant App as Application Window
Dev->>Vite: start dev server (port 1420)
Dev->>Tauri: tauri dev (beforeDevCommand -> devUrl)
Tauri->>Vite: load frontend from devUrl
Vite-->>App: serve JS/HTML
App->>Tauri: runtime APIs (`@tauri-apps/api`) calls
Tauri->>App: window creation & native integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 3/5 reviews remaining, refill in 18 minutes and 6 seconds. Comment |
Edition 2024 stabilized in Rust 1.85 (Feb 2025); local toolchain is 1.95. No source-level changes required — `lib.rs` and `main.rs` use constructs compatible with both editions. Verified: - cargo build: clean - cargo clippy --all-targets -- -D warnings: zero issues - cargo fmt --check: pass
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src-tauri/tauri.conf.json`:
- Around line 20-22: Replace the insecure "csp": null in tauri.conf.json with a
restrictive CSP object that explicitly lists trusted sources for each directive
(e.g., default-src, connect-src, font-src, img-src, style-src) so CSP is
enforced in production; update the "csp" key to an object (not null), include
'self' and your app-specific schemes (e.g., asset:, customprotocol:, ipc:) and
trusted external hosts (e.g., fonts.googleapis.com, fonts.gstatic.com) as
needed, and ensure you adjust script-src/style-src for nonce/hash injection or
add flags like 'wasm-unsafe-eval' or dangerousDisableAssetCspModification only
if required by your build; also mirror this CSP in your dev server
(vite.config.ts) via response headers to surface CSP issues early.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9090e85b-9b1e-4be3-aa38-a17a2a195bd1
⛔ Files ignored due to path filters (17)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlsrc-tauri/Cargo.lockis excluded by!**/*.locksrc-tauri/icons/128x128.pngis excluded by!**/*.pngsrc-tauri/icons/128x128@2x.pngis excluded by!**/*.pngsrc-tauri/icons/32x32.pngis excluded by!**/*.pngsrc-tauri/icons/Square107x107Logo.pngis excluded by!**/*.pngsrc-tauri/icons/Square142x142Logo.pngis excluded by!**/*.pngsrc-tauri/icons/Square150x150Logo.pngis excluded by!**/*.pngsrc-tauri/icons/Square284x284Logo.pngis excluded by!**/*.pngsrc-tauri/icons/Square30x30Logo.pngis excluded by!**/*.pngsrc-tauri/icons/Square310x310Logo.pngis excluded by!**/*.pngsrc-tauri/icons/Square44x44Logo.pngis excluded by!**/*.pngsrc-tauri/icons/Square71x71Logo.pngis excluded by!**/*.pngsrc-tauri/icons/Square89x89Logo.pngis excluded by!**/*.pngsrc-tauri/icons/StoreLogo.pngis excluded by!**/*.pngsrc-tauri/icons/icon.icois excluded by!**/*.icosrc-tauri/icons/icon.pngis excluded by!**/*.png
📒 Files selected for processing (16)
CHANGELOG.mdindex.htmlpackage.jsonsrc-tauri/.gitignoresrc-tauri/Cargo.tomlsrc-tauri/build.rssrc-tauri/capabilities/default.jsonsrc-tauri/icons/icon.icnssrc-tauri/src/lib.rssrc-tauri/src/main.rssrc-tauri/tauri.conf.jsonsrc/App.tsxsrc/main.tsxsrc/vite-env.d.tstsconfig.jsonvite.config.ts
There was a problem hiding this comment.
2 issues found across 33 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src-tauri/tauri.conf.json">
<violation number="1" location="src-tauri/tauri.conf.json:21">
P1: `csp: null` disables Content Security Policy for the app. Define a restrictive CSP instead of leaving it disabled.</violation>
</file>
<file name="package.json">
<violation number="1" location="package.json:29">
P1: The new dependency scaffold omits CLI packages used by existing scripts (`vitest`, `tsx`, `oxlint`, `oxfmt`), which can break CI/local script execution in clean installs.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Summary
Adds complete Tauri 2 (React 19 + TypeScript + Vite 7) scaffold with minimal cleanup: removed sample components, custom Rust entry point without
.expect()violations, and configuration aligned to Forgent hexagonal layout. Blocks frontend tooling (T06 Tailwind) and backend setup (T07 cargo add).Why
Task 05 is the foundation for all subsequent sprint work. Provides working dev environment (
pnpm exec tauri dev) and CI-ready build pipeline. Custom configurations avoid template footguns: single tsconfig.json (no composite artifacts), proper error handling viaResult<>, correctbeforeDevCommandto avoid infinite loops.Changes
src-tauri/backend with Rust 2021 edition, AGPL-3.0 license, minimallib.rs(4 lines returning Result) andmain.rs(8 lines with proper error propagation via eprintln + exit(1))main.tsx), minimalApp.tsxplaceholder div, strict TypeScript withnoEmit: trueTesting
cargo build(src-tauri/) succeeds zero warningscargo clippy -- -D warningspassespnpm exec tsc -b(strict mode) passes, no errorspnpm exec tauri devlaunches Tauri window with "Forgent" placeholder (verified Linux)pnpm exec tauri infoconfirms: framework React, bundler Vite, Rust toolchain validgrep -r "greet\|Welcome\|Counter" src/returns no matches (zero sample code)Related Issues
Notes for Reviewer
Key architectural choices:
Result<(), tauri::Error>at boundary (lib.rs) propagated to main.rs with eprintln + exit(1). Avoids.expect()per CLAUDE.md ban.tsc -bwould emit vite.config.d.ts / vite.config.js artifacts. Single config withnoEmit: trueis cleaner.pnpm vite(notpnpm dev) to avoid callingtauri devrecursively.@types/nodetyping in compilerOptions.Checklist
.expect()or.unwrap()in lib.rs / main.rs (proper Result types)Summary by CodeRabbit