Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ diffr's history before this file begins is difftastic's; see
https://github.com/Wilfred/difftastic/blob/master/CHANGELOG.md for releases
up to 0.71.

## 0.1.1

- Published to crates.io as `diffr-cli` (binary `diffr`) and
`diffr-plugin-sdk`, with the bundled plugins as `diffr-plugin-*`.
- `cargo binstall diffr-cli` installs the prebuilt `diffr` from a release.

## 0.1.0

First public release of diffr as its own project.
Expand Down
140 changes: 70 additions & 70 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 17 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "difftastic"
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"
license = "MIT"
version = "0.1.0"
version = "0.1.1"
authors = ["dev.fast"]
keywords = ["diff", "syntax"]
categories = ["development-tools", "command-line-utilities", "parser-implementations"]
Expand All @@ -23,6 +23,7 @@ rust-version = "1.85.0"
include = [
"/build.rs",
"/src/",
"/wit/",
"/plugins/",
"/vendored_parsers/highlights/*.scm",
"/vendored_parsers/*-src/**/*.c",
Expand Down Expand Up @@ -145,14 +146,14 @@ wasmtime-wasi = { version = "34.0.2", default-features = false }
bytes = "1.12"
# The plugin contract, and the bundled plugins: each a crate the native
# registry calls, which also builds as a WASM component.
diffr-plugin-sdk = { path = "crates/diffr-plugin-sdk" }
diffr-plugin-context = { path = "plugins/context" }
diffr-plugin-deleted-bodies = { path = "plugins/deleted-bodies" }
diffr-plugin-group = { path = "plugins/group" }
diffr-plugin-hide-files = { path = "plugins/hide-files" }
diffr-plugin-removed-runs = { path = "plugins/removed-runs" }
diffr-plugin-summarize = { path = "plugins/summarize" }
diffr-plugin-test-bodies = { path = "plugins/test-bodies" }
diffr-plugin-sdk = { path = "crates/diffr-plugin-sdk", version = "0.1.1" }
diffr-plugin-context = { path = "plugins/context", version = "0.1.1" }
diffr-plugin-deleted-bodies = { path = "plugins/deleted-bodies", version = "0.1.1" }
diffr-plugin-group = { path = "plugins/group", version = "0.1.1" }
diffr-plugin-hide-files = { path = "plugins/hide-files", version = "0.1.1" }
diffr-plugin-removed-runs = { path = "plugins/removed-runs", version = "0.1.1" }
diffr-plugin-summarize = { path = "plugins/summarize", version = "0.1.1" }
diffr-plugin-test-bodies = { path = "plugins/test-bodies", version = "0.1.1" }
wasmtime-wasi-http = { version = "34.0.2", default-features = false }


Expand Down Expand Up @@ -210,6 +211,12 @@ lto = "thin"
name = "diffr"
path = "src/main.rs"

[package.metadata.binstall]
# Tags have no "v" prefix; binaries sit at the archive root.
pkg-url = "{ repo }/releases/download/{ version }/diffr-{ version }-{ target }{ archive-suffix }"
pkg-fmt = "tgz"
bin-dir = "{ bin }{ binary-ext }"

[package.metadata.deb]
depends = "$auto"
section = "utility"
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ for every upstream and its license.

## Installation

The CLI, from crates.io (prebuilt via [cargo-binstall](https://github.com/cargo-bins/cargo-binstall), or compiled):

```sh
cargo xtask install
cargo binstall diffr-cli
cargo install diffr-cli --locked
```

Run this from the checkout with Rust and [Bun](https://bun.sh) on `PATH`.
The terminal UI is not yet published. From a checkout, with Rust and
[Bun](https://bun.sh) installed, `cargo xtask install` builds and installs
both the CLI and the UI.

## Configuration

Expand Down
15 changes: 10 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,17 @@ fn native_plugins() {
"shared/queries",
&mut files,
);
for (dependency, spec) in manifest["dependencies"].as_table().unwrap() {
let Some(path) = spec.get("path").and_then(toml::Value::as_str) else {
for dependency in manifest["dependencies"].as_table().unwrap().keys() {
// Resolve assets through Cargo links metadata.
if !dependency.starts_with("diffr-plugin-") || dependency == "diffr-plugin-sdk" {
continue;
};
let file = root.join(path).join("Cargo.toml");
}
let variable = format!("DEP_{}_ASSETS", dependency.to_uppercase().replace('-', "_"));
let folder = PathBuf::from(
std::env::var_os(&variable)
.unwrap_or_else(|| panic!("{dependency} did not publish {variable}")),
);
let file = folder.join("Cargo.toml");
println!("cargo:rerun-if-changed={}", file.display());
let package: toml::Value = std::fs::read_to_string(file).unwrap().parse().unwrap();
let Some(plugin) = package
Expand All @@ -143,7 +149,6 @@ fn native_plugins() {
.get("native")
.and_then(toml::Value::as_bool)
.unwrap_or(false);
let folder = root.join(path);
let plugin_manifest = folder.join("plugin.toml");
let description: toml::Value = std::fs::read_to_string(&plugin_manifest)
.expect("a plugin has plugin.toml")
Expand Down
3 changes: 1 addition & 2 deletions crates/diffr-plugin-sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[package]
name = "diffr-plugin-sdk"
description = "The diffr plugin contract in Rust: one trait for native and WASM plugins."
version = "0.1.0"
version = "0.1.1"
edition = "2021"
rust-version = "1.85.0"
license = "MIT"
publish = false

[dependencies]
anyhow = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/diffr-plugin-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub trait Plugin: Sized {
#[doc(hidden)]
pub mod bindings {
wit_bindgen::generate!({
path: "../../wit",
path: "wit",
world: "plugin",
pub_export_macro: true,
default_bindings_module: "diffr_plugin_sdk::bindings",
Expand Down
Loading
Loading