Skip to content

chore: prepare the package manifest for crates.io - #1

Merged
backnotprop merged 1 commit into
mainfrom
chore/crates-io-prep
Oct 27, 2026
Merged

backnotprop merged 1 commit into
mainfrom
chore/crates-io-prep

Conversation

@backnotprop

Copy link
Copy Markdown
Contributor

First step toward publishing this crate to crates.io, so plannotator-tui can depend on it. This PR only makes the safe manifest changes. publish = false stays, because the three [patch.crates-io] overrides still block a faithful publish (see "Still blocked" below).

Changes

  • Metadata: adds repository, readme, keywords and categories, and updates description to match the repo description.
  • include list: the package now holds only src/**/*.rs, assets/pierre/**, examples/embedded_viewer.rs, README, EMBEDDING, LICENSE, NOTICE and the manifest/lockfile. That is 96 files, 930 KiB (208 KiB compressed). Tests, fixtures, tools, reports, docs/ and vendor/ stay in Git. The only include_bytes! that points at fixtures/ is in a #[cfg(test)] module.
  • dev-tty feature: crossterm's use-dev-tty was always on. It is now a default feature, dev-tty. The standalone build behaves exactly as before. Because crossterm features apply to the whole build, embedding hosts can now turn it off with default-features = false. EMBEDDING.md says how.
  • Exact pins relaxed: hashbrown = "=0.16.1" becomes "0.16.1", and arboard = "=3.6.1" becomes "3.6.1". As dependencies, exact pins conflict with any host that needs a newer semver-compatible version. Cargo.lock is unchanged, so --locked builds resolve the same versions.

Checks

  • cargo fmt --check: pass
  • cargo clippy --locked --all-targets -D warnings: pass, with default features, with --all-features, and with --lib --no-default-features
  • cargo test --release --locked -- --test-threads=1: 247 passed, 0 failed (macOS arm64)
  • cargo publish --dry-run: refused because publish = false, as intended. cargo package also fails on this branch, before it builds anything: package native-diff depends on syntect with feature owner-census but syntect does not have that feature. That is the patch blocker.
  • I also ran the dry-run in a scratch copy with publish unset, the diagnostic features removed and shared-engines removed, using --no-verify. It packaged 96 files, 930.4 KiB (207.5 KiB compressed). It also warned that clipboard-win 5.4.1 (a Windows-only arboard dependency) is yanked in the lockfile.

Still blocked (not in this PR)

  • libgit2-sys: the patch keeps whitespace in rename and copy filenames. diffs-rs can do this without the patch: before calling Diff::from_buffer, rewrite unquoted rename/copy from/to names into C-quoted form, then move hunk offsets back by the bytes added. A prototype passes all git_paths_contract tests and the full suite on stock libgit2-sys 0.18.8. Without it, two of those three contracts fail.
  • syntect and fancy-regex: these patches do the main work for performance and memory, so they can't be dropped (measurements are in the investigation report). Upstream syntect has not released since 5.3.0 (Sep 2025). Its master branch now has breaking API and dump-format changes and has not picked up these optimizations. The proposed path is renamed forks published from vendor/: diffs-fancy-regex, diffs-syntect and diffs-two-face. diffs-rs would depend on them through package = ... renames, with no source changes. A scratch build of that layout passes cargo check --all-targets --all-features.

Add repository, readme, keywords and categories. Restrict the package to
the sources, theme assets, embedding example and docs (96 files, 930 KiB),
so tests, fixtures, tools and vendor/ stay out of the crate.

Move crossterm's use-dev-tty behind a default dev-tty feature so embedding
hosts can turn it off. Relax the hashbrown and arboard exact pins to caret
requirements; Cargo.lock still resolves the same versions.

publish stays false: the [patch.crates-io] overrides still block a
faithful publish.
@backnotprop
backnotprop merged commit 3d37f4a into main Oct 27, 2026
3 checks passed
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.

1 participant