Skip to content

refactor(core): Phase 1 — set up Cargo workspace with root-level core crate #1411

@shm11C3

Description

@shm11C3

Parent

Part of #1402.

Goal

Convert the repo into a Cargo workspace and add a root-level core/ crate (Tauri-independent). Establishing the workspace boundary is what enforces "no tauri::* under core/" — at compile time, via the Cargo dependency graph, with no CI grep needed.

This issue replaces #1403; see #1402 for the reasoning behind the switch from src-tauri/src/core/ to a workspace crate.

Scope

  • Add a workspace Cargo.toml at the repo root with members core and src-tauri.
  • Create core/ crate at the repo root:
    • core/Cargo.toml — does not list tauri as a dependency. Package name TBD in this PR (e.g. hwviz-core to avoid shadowing the standard core crate).
    • core/src/lib.rs — empty pub mod placeholders for collector, persistence, monitoring, event_bus, settings, platform, infrastructure, models. No code is moved yet.
  • src-tauri/Cargo.toml adds the new crate as a path dependency (<core-crate> = { path = "../core" }).
  • Add mod app; (empty) under src-tauri/src/.
  • Update tooling that assumed src-tauri/ was the cargo root:
    • src-tauri/.cargo/config.toml aliases (tauri-fmt, tauri-lint, tauri-test) extended to --workspace where appropriate, or relocated to a workspace-level config.
    • .github/workflows/ci.yml — fmt / clippy / test now run against the workspace.
  • No code is moved. Existing modules under src-tauri/src/ stay in place.

Out of Scope

Definition of Done

  • cargo build, cargo test --workspace, cargo clippy --workspace -- -D warnings succeed at the repo root.
  • Adding use tauri::Manager; anywhere under core/src/ fails to compile. Verified manually on a draft branch — no CI grep needed.
  • cargo tauri-fmt, cargo tauri-lint, cargo tauri-test continue to pass.
  • npm run lint, npm run test unchanged.
  • tauri dev / tauri build continue to work end-to-end on at least one host platform.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions