Skip to content
Draft
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
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ jobs:
# rather than on every target the matrix above cross-compiles for.
- run: cargo xtask test-plugins

test_code_mode:
name: Test code-mode API
runs-on: ubuntu-22.04
steps:
# v4.2.2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dtolnay/rust-toolchain@1.85.0
- run: npm install --global bun@1.3.14
- run: sudo apt-get update && sudo apt-get install -y ripgrep
- run: bun install --frozen-lockfile
- run: bun run build:api
- run: bun run typecheck
- run: bun run test:code-mode

test_mime_db:
name: Test with MIME database
runs-on: ubuntu-22.04
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@ plugin.wasm

# Generated data left behind by the retired review web viewer.
/examples/review/viewer/data/

# Node binding build and JS dependencies.
/bindings/node/*.node
/node_modules/

# Optional computed diff store.
/.cache/diffr/
157 changes: 157 additions & 0 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ include = [
]

[dependencies]
sha2 = "0.10"
rusqlite = { version = "0.32", features = ["bundled"] }
tempfile = "3.27.0"
git2 = { version = "0.20", default-features = false }
regex = "1.10.4"
clap = { version = "4.0.0", features = ["cargo", "env", "wrap_help", "string"] }
Expand Down Expand Up @@ -164,7 +167,6 @@ assert_cmd = "2.0.17"
predicates = "3.1.3"

pretty_assertions = "1.3.0"
tempfile = "3.27.0"

[build-dependencies]
toml = "0.8"
Expand All @@ -177,6 +179,7 @@ version_check = "0.9.4"
[workspace]
members = [
"xtask",
"crates/diffr-node",
"crates/diffr-plugin-sdk",
"plugins/context",
"plugins/deleted-bodies",
Expand Down
12 changes: 12 additions & 0 deletions bindings/node/build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { execFileSync } from "node:child_process";
import { copyFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { join } from "node:path";

const cwd = fileURLToPath(new URL("../../", import.meta.url));
execFileSync("cargo", ["build", "-p", "diffr-node"], { cwd, stdio: "inherit" });
const metadata = JSON.parse(execFileSync("cargo", ["metadata", "--no-deps", "--format-version=1"], { cwd }));
const library = process.platform === "darwin" ? "libdiffr_node.dylib"
: process.platform === "win32" ? "diffr_node.dll" : "libdiffr_node.so";
copyFileSync(join(metadata.target_directory, "debug", library),
new URL("./diffr.node", import.meta.url));
Loading
Loading