Skip to content

refactor: migrate repository to Cargo workspace (#20)#24

Merged
meymchen merged 1 commit into
mainfrom
feat/cargo-workspace
Jun 18, 2026
Merged

refactor: migrate repository to Cargo workspace (#20)#24
meymchen merged 1 commit into
mainfrom
feat/cargo-workspace

Conversation

@meymchen

Copy link
Copy Markdown
Owner

Closes #20.

Converts the single lspf crate into a Cargo workspace, the packaging foundation for the installable lspf-hello template server (PRD #19).

Changes

  • Root Cargo.toml is now a workspace manifest (members = ["crates/lspf", "crates/lspf-hello"], resolver = "3"), with shared metadata in [workspace.package] and common deps in [workspace.dependencies].
  • crates/lspf/ — framework source moved unchanged (git mv, history preserved). Still a single crate per ADR 0013.
  • crates/lspf-hello/ — the old examples/hello promoted to an installable binary crate with its own Cargo.toml and a default lspf-hello binary target. Depends on lspf via both path and version so local development uses the latest framework code while crates.io publishing stays possible.
  • Tests — framework-level tests stay in crates/lspf/tests/; the end-to-end smoke test moves to crates/lspf-hello/tests/ and drives target/debug/lspf-hello through Cargo's CARGO_BIN_EXE_lspf-hello (replacing cargo build --example hello).

Approach

Built test-first (TDD): confirmed cargo build -p lspf-hello failed (RED), performed the migration, then drove the relocated smoke suite against the new binary to GREEN.

Acceptance criteria (#20)

  • Root Cargo.toml becomes a workspace manifest.
  • Framework source moves to crates/lspf/ as a workspace member.
  • examples/hello moves to crates/lspf-hello/ with its own Cargo.toml and default binary target.
  • lspf-hello depends on lspf via both path and version.
  • cargo test --workspace, cargo clippy --workspace --all-targets, and cargo fmt --all pass.
  • ADR 0013 respected: lspf stays a single crate with feature flags; only the example/template binary is split out.

Scope notes

Relocating the smoke test was pulled in here because removing the example breaks the old cargo build --example hello path, and a green cargo test --workspace is a #20 acceptance criterion. The remaining slices are left to their own issues:

🤖 Generated with Claude Code

Convert the single `lspf` crate into a Cargo workspace with two members:

- `crates/lspf/` — the framework library (source moved unchanged).
- `crates/lspf-hello/` — the `examples/hello` server promoted to an
  installable binary crate with its own `Cargo.toml` and a default
  `lspf-hello` binary target.

`lspf-hello` depends on `lspf` via both `path` and `version` (through a
`[workspace.dependencies]` entry) so local edits apply while crates.io
publishing stays possible. Shared package metadata and common
dependencies are hoisted to `[workspace.package]` / `[workspace.dependencies]`.

The end-to-end smoke test moves with the binary to
`crates/lspf-hello/tests/` and drives `target/debug/lspf-hello` via
Cargo's `CARGO_BIN_EXE_lspf-hello`, replacing the old
`cargo build --example hello` path; this keeps `cargo test --workspace`
green, which is a #20 acceptance criterion. Framework-level tests stay
in `crates/lspf/tests/`.

Per ADR 0013, the `lspf` framework itself remains a single crate — only
the example/template binary is split out.

`cargo test --workspace`, `cargo clippy --workspace --all-targets`, and
`cargo fmt --all` all pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@meymchen meymchen merged commit e0e2d42 into main Jun 18, 2026
7 of 8 checks passed
@meymchen meymchen deleted the feat/cargo-workspace branch June 18, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[VS Code/Zed MVP] Migrate repository to Cargo workspace

1 participant