refactor: migrate repository to Cargo workspace (#20)#24
Merged
Conversation
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>
This was referenced Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #20.
Converts the single
lspfcrate into a Cargo workspace, the packaging foundation for the installablelspf-hellotemplate server (PRD #19).Changes
Cargo.tomlis 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 oldexamples/hellopromoted to an installable binary crate with its ownCargo.tomland a defaultlspf-hellobinary target. Depends onlspfvia bothpathandversionso local development uses the latest framework code while crates.io publishing stays possible.crates/lspf/tests/; the end-to-end smoke test moves tocrates/lspf-hello/tests/and drivestarget/debug/lspf-hellothrough Cargo'sCARGO_BIN_EXE_lspf-hello(replacingcargo build --example hello).Approach
Built test-first (TDD): confirmed
cargo build -p lspf-hellofailed (RED), performed the migration, then drove the relocated smoke suite against the new binary to GREEN.Acceptance criteria (#20)
Cargo.tomlbecomes a workspace manifest.crates/lspf/as a workspace member.examples/hellomoves tocrates/lspf-hello/with its ownCargo.tomland default binary target.lspf-hellodepends onlspfvia bothpathandversion.cargo test --workspace,cargo clippy --workspace --all-targets, andcargo fmt --allpass.lspfstays 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 hellopath, and a greencargo test --workspaceis a #20 acceptance criterion. The remaining slices are left to their own issues:cargo test --all-features --all-targetsalready runs at the workspace root and stays green)🤖 Generated with Claude Code