From 1bdebbbd0a6531f1984946134b48026c24db86d4 Mon Sep 17 00:00:00 2001 From: Sidharth Menon Date: Mon, 5 Oct 2026 23:05:15 -0700 Subject: [PATCH 1/2] Make diffr 0.1.12 publishable on crates.io Restore the existing diffr-cli registry name and include crate-local grammar, highlight, plugin and fixture assets in source archives. Verify extracted crate packages in CI and document the release steps. AI assistance: prepared and validated with Codex. Agent-Session: 82924cb5-dcfa-42e4-abb0-ef40393249f8 Agent-Session: 01a10e7a-1dfa-7bd1-a6f4-8449c22813e2 Agent-Session: 01a10f90-e4ce-70f2-84d1-26d64820eed3 --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 10 +++ Cargo.lock | 59 ++++++++++++++++- Cargo.toml | 3 +- crates/diffr-core/Cargo.toml | 12 ++++ crates/diffr-core/LICENSE | 1 + crates/diffr-core/NOTICE | 1 + crates/diffr-core/build.rs | 2 +- crates/diffr-core/examples | 1 + crates/diffr-core/plugins | 1 + crates/diffr-core/src/parse/fold_tests.rs | 11 ++-- .../src/parse/tree_sitter_parser.rs | 28 ++++----- crates/diffr-core/src/plugin/builtin.rs | 2 +- crates/diffr-core/vendored_parsers | 1 + crates/diffr-grammars/Cargo.toml | 63 +++++++++++++++++++ crates/diffr-grammars/LICENSE | 1 + crates/diffr-grammars/NOTICE | 1 + crates/diffr-grammars/build.rs | 2 +- crates/diffr-grammars/vendored_parsers | 1 + docs/releasing.md | 35 +++++++++++ 20 files changed, 211 insertions(+), 26 deletions(-) create mode 120000 crates/diffr-core/LICENSE create mode 120000 crates/diffr-core/NOTICE create mode 120000 crates/diffr-core/examples create mode 120000 crates/diffr-core/plugins create mode 120000 crates/diffr-core/vendored_parsers create mode 120000 crates/diffr-grammars/LICENSE create mode 120000 crates/diffr-grammars/NOTICE create mode 120000 crates/diffr-grammars/vendored_parsers create mode 100644 docs/releasing.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f7c8435a..334463577 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ jobs: env: RELEASE_TAG: ${{ github.ref_type == 'tag' && github.ref_name || '' }} run: | - version=$(cargo metadata --no-deps --format-version 1 | "$PYTHON" -c 'import json, sys; print(next(p["version"] for p in json.load(sys.stdin)["packages"] if p["name"] == "diffr"), end="")') + version=$(cargo metadata --no-deps --format-version 1 | "$PYTHON" -c 'import json, sys; print(next(p["version"] for p in json.load(sys.stdin)["packages"] if p["name"] == "diffr-cli"), end="")') if [ -n "$RELEASE_TAG" ] && [ "$RELEASE_TAG" != "$version" ]; then echo "Tag $RELEASE_TAG does not match Cargo version $version" >&2 exit 1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6b9815eaf..d68e41d56 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,6 +51,16 @@ jobs: shell: bash run: $BUILD_CMD test --target ${{ matrix.job.target }} + crate_packages: + name: Verify crates.io packages + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - uses: dtolnay/rust-toolchain@1.99.0 + # Build extracted archives together, with their internal dependencies + # staged locally instead of requiring them to be published already. + - run: cargo package --locked -p diffr-grammars -p diffr-core -p diffr-cli + test_wasm_plugins: name: Test WASM component plugins runs-on: ubuntu-22.04 diff --git a/Cargo.lock b/Cargo.lock index 580d00053..9cad434ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -652,7 +652,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" [[package]] -name = "diffr" +name = "diffr-cli" version = "0.1.12" dependencies = [ "anyhow", @@ -784,8 +784,65 @@ dependencies = [ "rayon", "serde_json", "tree-sitter", + "tree-sitter-ada", + "tree-sitter-asm", + "tree-sitter-bash", "tree-sitter-c", + "tree-sitter-c-sharp", + "tree-sitter-clojure-orchard", + "tree-sitter-cmake", + "tree-sitter-commonlisp", + "tree-sitter-containerfile", + "tree-sitter-cpp", + "tree-sitter-css", + "tree-sitter-dart-orchard", + "tree-sitter-devicetree", + "tree-sitter-elisp", + "tree-sitter-elixir", + "tree-sitter-elm", + "tree-sitter-erlang", + "tree-sitter-fish", + "tree-sitter-fortran", + "tree-sitter-fsharp", + "tree-sitter-gleam", + "tree-sitter-go", + "tree-sitter-haskell", + "tree-sitter-hcl", + "tree-sitter-html", + "tree-sitter-java-orchard", + "tree-sitter-javascript", + "tree-sitter-json", + "tree-sitter-julia", "tree-sitter-language", + "tree-sitter-lua", + "tree-sitter-make", + "tree-sitter-newick", + "tree-sitter-nix", + "tree-sitter-objc", + "tree-sitter-ocaml", + "tree-sitter-pascal", + "tree-sitter-php", + "tree-sitter-proto", + "tree-sitter-python", + "tree-sitter-qmljs", + "tree-sitter-r", + "tree-sitter-racket", + "tree-sitter-ruby", + "tree-sitter-rust-orchard", + "tree-sitter-scala", + "tree-sitter-scheme", + "tree-sitter-sequel", + "tree-sitter-sfapex", + "tree-sitter-solidity", + "tree-sitter-swift", + "tree-sitter-toml-ng", + "tree-sitter-typescript", + "tree-sitter-verilog", + "tree-sitter-vhdl", + "tree-sitter-xml", + "tree-sitter-yaml", + "tree-sitter-zig", + "ts-parser-perl", "zstd", "zstd-sys", ] diff --git a/Cargo.toml b/Cargo.toml index ef671eb87..dcf1b4cbe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "diffr" +name = "diffr-cli" description = "Structural diffs with a streaming API and interactive terminal frontend." repository = "https://github.com/devdotfast/diffr" homepage = "https://github.com/devdotfast/diffr" @@ -21,6 +21,7 @@ include = [ "/vendored_parsers/*-src/**/*.c", "/vendored_parsers/*-src/**/*.h", "/LICENSE", + "/NOTICE", "/README.md", ] diff --git a/crates/diffr-core/Cargo.toml b/crates/diffr-core/Cargo.toml index c75c76067..cdbeeb501 100644 --- a/crates/diffr-core/Cargo.toml +++ b/crates/diffr-core/Cargo.toml @@ -14,6 +14,18 @@ rust-version = "1.99.0" include = [ "/build.rs", "/src/", + "/plugins/shape/**/plugin.toml", + "/plugins/shape/**/plugin.wasm", + "/plugins/shape/**/*.scm", + "/plugins/classify/plugin.toml", + "/plugins/classify/plugin.wasm", + "/plugins/classify/rust/src/linguist/LICENSE", + "/vendored_parsers/highlights/*.scm", + "/examples/review/real/*/before.*", + "/examples/review/real/*/after.*", + "/examples/review/real/*/provenance.json", + "/LICENSE", + "/NOTICE", ] [dependencies] diff --git a/crates/diffr-core/LICENSE b/crates/diffr-core/LICENSE new file mode 120000 index 000000000..30cff7403 --- /dev/null +++ b/crates/diffr-core/LICENSE @@ -0,0 +1 @@ +../../LICENSE \ No newline at end of file diff --git a/crates/diffr-core/NOTICE b/crates/diffr-core/NOTICE new file mode 120000 index 000000000..fb376cfaa --- /dev/null +++ b/crates/diffr-core/NOTICE @@ -0,0 +1 @@ +../../NOTICE \ No newline at end of file diff --git a/crates/diffr-core/build.rs b/crates/diffr-core/build.rs index a0ba3a666..c5423e6da 100644 --- a/crates/diffr-core/build.rs +++ b/crates/diffr-core/build.rs @@ -11,7 +11,7 @@ use std::path::PathBuf; /// Embed the component, manifest and queries from every bundled shape plugin /// folder under `plugins/shape/`, and the classifier in `plugins/classify/`. fn main() { - let root = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()).join("../.."); + let root = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()); println!("cargo:rerun-if-changed={}", root.join("plugins").display()); let mut files = String::from("const FILES: &[(&str, &str)] = &[\n"); let mut components = String::from("const COMPONENTS: &[(&str, &[u8])] = &[\n"); diff --git a/crates/diffr-core/examples b/crates/diffr-core/examples new file mode 120000 index 000000000..d15735c1d --- /dev/null +++ b/crates/diffr-core/examples @@ -0,0 +1 @@ +../../examples \ No newline at end of file diff --git a/crates/diffr-core/plugins b/crates/diffr-core/plugins new file mode 120000 index 000000000..9aa30addd --- /dev/null +++ b/crates/diffr-core/plugins @@ -0,0 +1 @@ +../../plugins \ No newline at end of file diff --git a/crates/diffr-core/src/parse/fold_tests.rs b/crates/diffr-core/src/parse/fold_tests.rs index 28b3a0529..16cb02ecf 100644 --- a/crates/diffr-core/src/parse/fold_tests.rs +++ b/crates/diffr-core/src/parse/fold_tests.rs @@ -214,8 +214,8 @@ mod folds { #[test] fn added_rust_test_body_is_foldable_without_hiding_signature_or_brace() { - let lhs = include_str!("../../../../examples/review/real/08-ripgrep-3496/before.rs"); - let rhs = include_str!("../../../../examples/review/real/08-ripgrep-3496/after.rs"); + let lhs = include_str!("../../examples/review/real/08-ripgrep-3496/before.rs"); + let rhs = include_str!("../../examples/review/real/08-ripgrep-3496/after.rs"); let review = DiffResult::from_sources("walk.rs", lhs, rhs); let signature = rhs .lines() @@ -351,8 +351,8 @@ mod matcher { #[test] fn a_reindented_rename_target_stays_an_unchanged_token() { - let lhs = include_str!("../../../../examples/review/real/02-review-175/before.ts"); - let rhs = include_str!("../../../../examples/review/real/02-review-175/after.ts"); + let lhs = include_str!("../../examples/review/real/02-review-175/before.ts"); + let rhs = include_str!("../../examples/review/real/02-review-175/after.ts"); let review = DiffResult::from_sources("parser.ts", lhs, rhs); let token = review .lhs_positions @@ -420,8 +420,7 @@ mod results { #[test] fn real_fixture_folds_have_valid_reciprocal_ranges() { - let root = - std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../examples/review/real"); + let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("examples/review/real"); for dir in std::fs::read_dir(root).unwrap() { let dir = dir.unwrap().path(); let p: serde_json::Value = diff --git a/crates/diffr-core/src/parse/tree_sitter_parser.rs b/crates/diffr-core/src/parse/tree_sitter_parser.rs index 2eb370ad2..32b8dd82d 100644 --- a/crates/diffr-core/src/parse/tree_sitter_parser.rs +++ b/crates/diffr-core/src/parse/tree_sitter_parser.rs @@ -126,7 +126,7 @@ fn build_config(language: guess::Language) -> TreeSitterConfig { ignore_trailing_tokens: vec![], highlight_query: ts::Query::new( &language, - include_str!("../../../../vendored_parsers/highlights/ada.scm"), + include_str!("../../vendored_parsers/highlights/ada.scm"), ) .unwrap(), sub_languages: vec![], @@ -250,7 +250,7 @@ fn build_config(language: guess::Language) -> TreeSitterConfig { ignore_trailing_tokens: vec![], highlight_query: ts::Query::new( &language, - include_str!("../../../../vendored_parsers/highlights/cmake.scm"), + include_str!("../../vendored_parsers/highlights/cmake.scm"), ) .unwrap(), sub_languages: vec![], @@ -286,7 +286,7 @@ fn build_config(language: guess::Language) -> TreeSitterConfig { ignore_trailing_tokens: vec![], highlight_query: ts::Query::new( &language, - include_str!("../../../../vendored_parsers/highlights/c-sharp.scm"), + include_str!("../../vendored_parsers/highlights/c-sharp.scm"), ) .unwrap(), sub_languages: vec![], @@ -341,7 +341,7 @@ fn build_config(language: guess::Language) -> TreeSitterConfig { ignore_trailing_tokens: vec![], highlight_query: ts::Query::new( &language, - include_str!("../../../../vendored_parsers/highlights/devicetree.scm"), + include_str!("../../vendored_parsers/highlights/devicetree.scm"), ) .unwrap(), sub_languages: vec![], @@ -539,7 +539,7 @@ fn build_config(language: guess::Language) -> TreeSitterConfig { ignore_trailing_tokens: vec![], highlight_query: ts::Query::new( &language, - include_str!("../../../../vendored_parsers/highlights/hcl.scm"), + include_str!("../../vendored_parsers/highlights/hcl.scm"), ) .unwrap(), sub_languages: vec![], @@ -598,7 +598,7 @@ fn build_config(language: guess::Language) -> TreeSitterConfig { ignore_trailing_tokens: vec![], highlight_query: ts::Query::new( &language, - include_str!("../../../../vendored_parsers/highlights/janet_simple.scm"), + include_str!("../../vendored_parsers/highlights/janet_simple.scm"), ) .unwrap(), sub_languages: vec![], @@ -699,7 +699,7 @@ fn build_config(language: guess::Language) -> TreeSitterConfig { ignore_trailing_tokens: vec![], highlight_query: ts::Query::new( &language, - include_str!("../../../../vendored_parsers/highlights/julia.scm"), + include_str!("../../vendored_parsers/highlights/julia.scm"), ) .unwrap(), sub_languages: vec![], @@ -727,7 +727,7 @@ fn build_config(language: guess::Language) -> TreeSitterConfig { ignore_trailing_tokens: vec![], highlight_query: ts::Query::new( &language, - include_str!("../../../../vendored_parsers/highlights/kotlin.scm"), + include_str!("../../vendored_parsers/highlights/kotlin.scm"), ) .unwrap(), sub_languages: vec![], @@ -742,7 +742,7 @@ fn build_config(language: guess::Language) -> TreeSitterConfig { ignore_trailing_tokens: vec![], highlight_query: ts::Query::new( &language, - include_str!("../../../../vendored_parsers/highlights/latex.scm"), + include_str!("../../vendored_parsers/highlights/latex.scm"), ) .unwrap(), sub_languages: vec![], @@ -793,7 +793,7 @@ fn build_config(language: guess::Language) -> TreeSitterConfig { ignore_trailing_tokens: vec![], highlight_query: ts::Query::new( &language, - include_str!("../../../../vendored_parsers/highlights/newick.scm"), + include_str!("../../vendored_parsers/highlights/newick.scm"), ) .unwrap(), sub_languages: vec![], @@ -872,7 +872,7 @@ fn build_config(language: guess::Language) -> TreeSitterConfig { ignore_trailing_tokens: vec![], highlight_query: ts::Query::new( &language, - include_str!("../../../../vendored_parsers/highlights/pascal.scm"), + include_str!("../../vendored_parsers/highlights/pascal.scm"), ) .unwrap(), sub_languages: vec![], @@ -926,7 +926,7 @@ fn build_config(language: guess::Language) -> TreeSitterConfig { ignore_trailing_tokens: vec![], highlight_query: ts::Query::new( &language, - include_str!("../../../../vendored_parsers/highlights/proto.scm"), + include_str!("../../vendored_parsers/highlights/proto.scm"), ) .unwrap(), sub_languages: vec![], @@ -1100,7 +1100,7 @@ fn build_config(language: guess::Language) -> TreeSitterConfig { ignore_trailing_tokens: vec![], highlight_query: ts::Query::new( &language, - include_str!("../../../../vendored_parsers/highlights/smali.scm"), + include_str!("../../vendored_parsers/highlights/smali.scm"), ) .unwrap(), sub_languages: Vec::new(), @@ -1250,7 +1250,7 @@ fn build_config(language: guess::Language) -> TreeSitterConfig { delimiter_tokens: vec![("(", ")"), ("[", "]"), ("begin", "end")], highlight_query: ts::Query::new( &language, - include_str!("../../../../vendored_parsers/highlights/verilog.scm"), + include_str!("../../vendored_parsers/highlights/verilog.scm"), ) .unwrap(), sub_languages: vec![], diff --git a/crates/diffr-core/src/plugin/builtin.rs b/crates/diffr-core/src/plugin/builtin.rs index 6809757b7..30d26ff61 100644 --- a/crates/diffr-core/src/plugin/builtin.rs +++ b/crates/diffr-core/src/plugin/builtin.rs @@ -69,7 +69,7 @@ mod tests { #[test] fn every_plugin_folder_is_embedded_and_described() { - let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../plugins/shape"); + let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("plugins/shape"); let mut on_disk = BTreeSet::new(); let mut folders = BTreeSet::new(); for folder in std::fs::read_dir(&root).unwrap() { diff --git a/crates/diffr-core/vendored_parsers b/crates/diffr-core/vendored_parsers new file mode 120000 index 000000000..22bf13044 --- /dev/null +++ b/crates/diffr-core/vendored_parsers @@ -0,0 +1 @@ +../../vendored_parsers \ No newline at end of file diff --git a/crates/diffr-grammars/Cargo.toml b/crates/diffr-grammars/Cargo.toml index 1cbbd1ebd..f6d280e46 100644 --- a/crates/diffr-grammars/Cargo.toml +++ b/crates/diffr-grammars/Cargo.toml @@ -12,6 +12,11 @@ rust-version = "1.99.0" include = [ "/build.rs", "/src/", + "/vendored_parsers/*-src/**/*.c", + "/vendored_parsers/*-src/**/*.h", + "/vendored_parsers/*/LICENSE", + "/LICENSE", + "/NOTICE", ] [dependencies] @@ -28,3 +33,61 @@ tree-sitter = "0.26.10" tree-sitter-c = "0.24" zstd = { version = "0.13.3", default-features = false } +# The build script reads the parser sources from these packages. +tree-sitter-ada = "0.1.0" +tree-sitter-asm = "0.24.0" +tree-sitter-bash = "0.25.1" +tree-sitter-c-sharp = "0.23.1" +tree-sitter-clojure-orchard = "0.2.5" +tree-sitter-cmake = "0.7.1" +tree-sitter-commonlisp = "0.4.1" +tree-sitter-containerfile = "0.8.0" +tree-sitter-cpp = "0.23.4" +tree-sitter-css = "0.25.0" +tree-sitter-dart-orchard = "0.5.0" +tree-sitter-devicetree = "0.14.1" +tree-sitter-elisp = "1.7.0" +tree-sitter-elixir = "0.3.4" +tree-sitter-elm = "5.8.0" +tree-sitter-erlang = "0.20.0" +tree-sitter-fish = "3.6.0" +tree-sitter-fortran = "0.6.0" +tree-sitter-fsharp = "0.3.0" +tree-sitter-gleam = "1.0.0" +tree-sitter-go = "0.25.0" +tree-sitter-haskell = "0.23.1" +tree-sitter-hcl = "1.1.0" +tree-sitter-html = "0.23.2" +tree-sitter-java-orchard = "0.5.9" +tree-sitter-javascript = "0.25.0" +tree-sitter-json = "0.24.8" +tree-sitter-julia = "0.23.1" +tree-sitter-lua = "0.5" +tree-sitter-make = "1.1.1" +tree-sitter-newick = "1.1.0" +tree-sitter-nix = "0.3.0" +tree-sitter-objc = "3.0.2" +tree-sitter-ocaml = "0.25.0" +tree-sitter-pascal = "0.10.0" +tree-sitter-php = "0.24.0" +tree-sitter-proto = "0.4.0" +tree-sitter-python = "0.25.0" +tree-sitter-qmljs = "0.3.0" +tree-sitter-r = "1.2.0" +tree-sitter-racket = "0.24.7" +tree-sitter-ruby = "0.23.1" +tree-sitter-rust-orchard = "0.16.6" +tree-sitter-scala = "0.26.2" +tree-sitter-scheme = "0.24.7" +tree-sitter-sequel = "0.3.11" +tree-sitter-sfapex = "2.4.0" +tree-sitter-solidity = "1.2.13" +tree-sitter-swift = "0.7.1" +tree-sitter-toml-ng = "0.7.0" +tree-sitter-typescript = "0.23.2" +tree-sitter-verilog = "1.0.3" +tree-sitter-vhdl = "1.4.0" +tree-sitter-xml = "0.7.0" +tree-sitter-yaml = "0.7.0" +tree-sitter-zig = "1.1.2" +ts-parser-perl = "1.2.0" diff --git a/crates/diffr-grammars/LICENSE b/crates/diffr-grammars/LICENSE new file mode 120000 index 000000000..30cff7403 --- /dev/null +++ b/crates/diffr-grammars/LICENSE @@ -0,0 +1 @@ +../../LICENSE \ No newline at end of file diff --git a/crates/diffr-grammars/NOTICE b/crates/diffr-grammars/NOTICE new file mode 120000 index 000000000..fb376cfaa --- /dev/null +++ b/crates/diffr-grammars/NOTICE @@ -0,0 +1 @@ +../../NOTICE \ No newline at end of file diff --git a/crates/diffr-grammars/build.rs b/crates/diffr-grammars/build.rs index 828149b92..78eb61459 100644 --- a/crates/diffr-grammars/build.rs +++ b/crates/diffr-grammars/build.rs @@ -128,7 +128,7 @@ fn main() { sources.extend( VENDORED .iter() - .map(|&(symbol, folder)| (symbol, Path::new("../../vendored_parsers").join(folder))), + .map(|&(symbol, folder)| (symbol, Path::new("vendored_parsers").join(folder))), ); for (_, source) in &sources { println!("cargo:rerun-if-changed={}", source.display()); diff --git a/crates/diffr-grammars/vendored_parsers b/crates/diffr-grammars/vendored_parsers new file mode 120000 index 000000000..22bf13044 --- /dev/null +++ b/crates/diffr-grammars/vendored_parsers @@ -0,0 +1 @@ +../../vendored_parsers \ No newline at end of file diff --git a/docs/releasing.md b/docs/releasing.md new file mode 100644 index 000000000..02ce7af83 --- /dev/null +++ b/docs/releasing.md @@ -0,0 +1,35 @@ +# Releasing diffr + +Start from current `origin/main` and choose an unused `X.Y.Z` version. + +1. Bump the CLI, core, and grammar versions in `Cargo.toml`, + `crates/diffr-core/Cargo.toml`, and `crates/diffr-grammars/Cargo.toml`. + Update their internal dependency versions, `Cargo.lock`, and + `diffr-ts/package.json`. The plugin SDK has its own release cycle. +2. Verify the crates outside the checkout: + `cargo package --locked -p diffr-grammars -p diffr-core -p diffr-cli`. + Cargo stages the internal dependencies locally and builds the extracted + archives. Symlinks under the library crates point to the repository's + canonical assets; Cargo packages their contents as regular files. +3. Merge the release PR after CI passes, then push an annotated tag matching + the version exactly, without a `v` prefix. +4. Verify the Release workflow. It builds five platform archives, generates + checksums and a Homebrew formula, tests installation, publishes the GitHub + release and npm packages, and tests npm installation on all five platforms. + npm may take several minutes to expose an accepted publication; if smoke + tests fail because the version is unavailable, wait for it to appear and + rerun the failed jobs. +5. Run the Homebrew tap's **Update diffr** workflow, or wait for its hourly run. +6. Publish to crates.io with Cargo credentials configured through `cargo login` + or `CARGO_REGISTRY_TOKEN`: + `cargo publish --locked -p diffr-grammars -p diffr-core -p diffr-cli`. + Cargo publishes in dependency order. The crates.io CLI package is + `diffr-cli`; its installed executable is `diffr`. The name `diffr` on + crates.io belongs to a different project. + +Verify the registry version and, in a fresh install directory, run: + +```sh +cargo install diffr-cli --version X.Y.Z --locked --root /tmp/diffr-release-check +/tmp/diffr-release-check/bin/diffr --version +``` From 3cb78b748aef20bafb878b5b663f384eafd91f95 Mon Sep 17 00:00:00 2001 From: Sidharth Menon Date: Mon, 5 Oct 2026 23:08:30 -0700 Subject: [PATCH 2/2] Include WIT and upstream licenses in crate archives Expose shared files outside nested Cargo package boundaries so source archives contain the host contract and all vendored licenses. AI assistance: prepared and validated with Codex. Agent-Session: 82924cb5-dcfa-42e4-abb0-ef40393249f8 Agent-Session: 01a10e7a-1dfa-7bd1-a6f4-8449c22813e2 Agent-Session: 01a10f90-e4ce-70f2-84d1-26d64820eed3 --- Cargo.toml | 2 +- crates/diffr-core/Cargo.toml | 2 +- crates/diffr-core/licenses/GitHub-Linguist | 1 + crates/diffr-grammars/Cargo.toml | 2 +- crates/diffr-grammars/licenses/tree-sitter-janet-simple | 1 + crates/diffr-grammars/licenses/tree-sitter-kotlin | 1 + crates/diffr-grammars/licenses/tree-sitter-latex | 1 + crates/diffr-grammars/licenses/tree-sitter-smali | 1 + crates/diffr-grammars/licenses/tree-sitter-tsx | 1 + src/plugin/bindings.rs | 4 ++-- wit | 1 + 11 files changed, 12 insertions(+), 5 deletions(-) create mode 120000 crates/diffr-core/licenses/GitHub-Linguist create mode 120000 crates/diffr-grammars/licenses/tree-sitter-janet-simple create mode 120000 crates/diffr-grammars/licenses/tree-sitter-kotlin create mode 120000 crates/diffr-grammars/licenses/tree-sitter-latex create mode 120000 crates/diffr-grammars/licenses/tree-sitter-smali create mode 120000 crates/diffr-grammars/licenses/tree-sitter-tsx create mode 120000 wit diff --git a/Cargo.toml b/Cargo.toml index dcf1b4cbe..f50371784 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ rust-version = "1.99.0" include = [ "/build.rs", "/src/", - "/crates/diffr-plugin-sdk/wit/", + "/wit/", "/plugins/", "/vendored_parsers/highlights/*.scm", "/vendored_parsers/*-src/**/*.c", diff --git a/crates/diffr-core/Cargo.toml b/crates/diffr-core/Cargo.toml index cdbeeb501..5c2e66b4d 100644 --- a/crates/diffr-core/Cargo.toml +++ b/crates/diffr-core/Cargo.toml @@ -19,7 +19,7 @@ include = [ "/plugins/shape/**/*.scm", "/plugins/classify/plugin.toml", "/plugins/classify/plugin.wasm", - "/plugins/classify/rust/src/linguist/LICENSE", + "/licenses/", "/vendored_parsers/highlights/*.scm", "/examples/review/real/*/before.*", "/examples/review/real/*/after.*", diff --git a/crates/diffr-core/licenses/GitHub-Linguist b/crates/diffr-core/licenses/GitHub-Linguist new file mode 120000 index 000000000..553ef106e --- /dev/null +++ b/crates/diffr-core/licenses/GitHub-Linguist @@ -0,0 +1 @@ +../../../plugins/classify/rust/src/linguist/LICENSE \ No newline at end of file diff --git a/crates/diffr-grammars/Cargo.toml b/crates/diffr-grammars/Cargo.toml index f6d280e46..c4e67bd94 100644 --- a/crates/diffr-grammars/Cargo.toml +++ b/crates/diffr-grammars/Cargo.toml @@ -14,7 +14,7 @@ include = [ "/src/", "/vendored_parsers/*-src/**/*.c", "/vendored_parsers/*-src/**/*.h", - "/vendored_parsers/*/LICENSE", + "/licenses/", "/LICENSE", "/NOTICE", ] diff --git a/crates/diffr-grammars/licenses/tree-sitter-janet-simple b/crates/diffr-grammars/licenses/tree-sitter-janet-simple new file mode 120000 index 000000000..3cd6eb208 --- /dev/null +++ b/crates/diffr-grammars/licenses/tree-sitter-janet-simple @@ -0,0 +1 @@ +../../../vendored_parsers/tree-sitter-janet-simple/LICENSE \ No newline at end of file diff --git a/crates/diffr-grammars/licenses/tree-sitter-kotlin b/crates/diffr-grammars/licenses/tree-sitter-kotlin new file mode 120000 index 000000000..93723e537 --- /dev/null +++ b/crates/diffr-grammars/licenses/tree-sitter-kotlin @@ -0,0 +1 @@ +../../../vendored_parsers/tree-sitter-kotlin/LICENSE \ No newline at end of file diff --git a/crates/diffr-grammars/licenses/tree-sitter-latex b/crates/diffr-grammars/licenses/tree-sitter-latex new file mode 120000 index 000000000..1eab95534 --- /dev/null +++ b/crates/diffr-grammars/licenses/tree-sitter-latex @@ -0,0 +1 @@ +../../../vendored_parsers/tree-sitter-latex/LICENSE \ No newline at end of file diff --git a/crates/diffr-grammars/licenses/tree-sitter-smali b/crates/diffr-grammars/licenses/tree-sitter-smali new file mode 120000 index 000000000..4b81bdf9d --- /dev/null +++ b/crates/diffr-grammars/licenses/tree-sitter-smali @@ -0,0 +1 @@ +../../../vendored_parsers/tree-sitter-smali/LICENSE \ No newline at end of file diff --git a/crates/diffr-grammars/licenses/tree-sitter-tsx b/crates/diffr-grammars/licenses/tree-sitter-tsx new file mode 120000 index 000000000..c7b870c12 --- /dev/null +++ b/crates/diffr-grammars/licenses/tree-sitter-tsx @@ -0,0 +1 @@ +../../../vendored_parsers/tree-sitter-tsx/LICENSE \ No newline at end of file diff --git a/src/plugin/bindings.rs b/src/plugin/bindings.rs index faa537c6e..d981657fc 100644 --- a/src/plugin/bindings.rs +++ b/src/plugin/bindings.rs @@ -7,7 +7,7 @@ use diffr_core::plugin::cursor; use diffr_core::protocol::{self, FileChange, FileStatus}; wasmtime::component::bindgen!({ - path: "crates/diffr-plugin-sdk/wit/plugin.wit", + path: "wit/plugin.wit", world: "diffr-plugin", with: { "diffr:plugin/host.cursor": diffr_core::plugin::cursor::Cursor }, imports: { default: trappable }, @@ -20,7 +20,7 @@ pub(crate) use diffr::plugin::types; /// The classifier's world. pub(crate) mod classifier { wasmtime::component::bindgen!({ - path: "crates/diffr-plugin-sdk/wit/plugin.wit", + path: "wit/plugin.wit", world: "diffr-classifier", with: { "diffr:plugin/types": super::diffr::plugin::types, diff --git a/wit b/wit new file mode 120000 index 000000000..11ff9bf91 --- /dev/null +++ b/wit @@ -0,0 +1 @@ +crates/diffr-plugin-sdk/wit \ No newline at end of file