Skip to content

Latest commit

 

History

History
104 lines (67 loc) · 4.66 KB

File metadata and controls

104 lines (67 loc) · 4.66 KB

Packages

A jscpd release is one Rust workspace published under several names. Everything lives under rust/; rust/scripts/sync-version.mjs keeps the versions below in step (the engine version comes from rust/package.json).

Crates (crates.io)

jscpd

Path: rust/crates/cpd crates.io: jscpd Version: 5.4.0

The CLI. cargo install jscpd installs two identical binaries, jscpd and cpd. Its library target is internal (test helpers only); depend on the crates below for programmatic use. See Rust docs.

cpd-core

Path: rust/crates/cpd-core crates.io: cpd-core Version: 0.1.20

Core data models and the Rabin-Karp rolling hash implementation.

cpd-tokenizer

Path: rust/crates/cpd-tokenizer crates.io: cpd-tokenizer Version: 0.1.19

Source code tokenizer (224 formats, listed in FORMATS.md). Uses oxc_parser for JavaScript/TypeScript/JSX and per-block tokenization for Vue SFC, Svelte, Astro, and Markdown. Pure — no filesystem or network access (enforced in CI).

cpd-finder

Path: rust/crates/cpd-finder crates.io: cpd-finder Version: 0.1.20

File walking, orchestration, baseline handling, and git blame. Uses rayon for parallelism, ignore + globset for file matching. The entry point for the Rust API.

cpd-reporter

Path: rust/crates/cpd-reporter crates.io: cpd-reporter Version: 0.1.21

Output format rendering for the 15 reporters.

cpd-semantic

Path: rust/crates/cpd-semantic crates.io: cpd-semantic Version: 0.1.1

Semantic clones (--semantic, experimental): function extraction for the languages --similarity does not parse (Rust, Python, and tree-sitter grammars for C, C++, C#, Go, Java, Kotlin, PHP, Ruby, Scala and Swift), code embeddings from CodeRankEmbed or jina-embeddings-v2-base-code run in-process with candle or taken from an OpenAI-compatible API, the thresholds calibrated for nine models, a vector cache, and the pairing rule. It plugs into the finder as a clone pass (cpd_finder::pass::ClonePass), so the other crates build without its dependencies. Unlike the crates above, it reads and writes the user cache directory and makes network calls: the model download and the embeddings API.

npm packages

All npm packages share the engine version (5.4.0). None of them needs a Node.js runtime to run jscpd — Node.js is only the delivery mechanism.

jscpd

Path: rust/jscpd npm: jscpd

Installs the jscpd command. A thin launcher that resolves the platform package below for the current OS/CPU and executes the binary.

cpd

Path: rust npm: cpd

Installs the cpd command. Same launcher, same binary, shorter name.

Platform packages

Path: rust/npm/<package>

Each contains one prebuilt binary and is pulled in as an optional dependency of jscpd and cpd; npm installs only the one matching the host.

Package Rust target
jscpd-darwin-arm64 aarch64-apple-darwin
jscpd-darwin-x64 x86_64-apple-darwin
jscpd-linux-arm64-gnu aarch64-unknown-linux-gnu
jscpd-linux-arm64-musl aarch64-unknown-linux-musl
jscpd-linux-x64-gnu x86_64-unknown-linux-gnu
jscpd-linux-x64-musl x86_64-unknown-linux-musl
jscpd-windows-arm64-msvc aarch64-pc-windows-msvc
jscpd-windows-x64-msvc x86_64-pc-windows-msvc

The same binaries are attached to every GitHub Release as jscpd-<platform>.tar.gz with checksums, Sigstore signatures and SLSA provenance, and packaged into the ghcr.io/kucherenko/jscpd Docker image.

Other distribution channels

Channel Source
GitHub Action kucherenko/jscpd@v5 action.yml
Docker ghcr.io/kucherenko/jscpd Dockerfile
Nix github:kucherenko/jscpd flake.nix
Homebrew brew install jscpd homebrew-core formula
install.sh / install.ps1 https://jscpd.dev

jscpd v4 packages

The TypeScript packages (jscpd@4, jscpd-server, @jscpd/core, @jscpd/finder, @jscpd/tokenizer, @jscpd/html-reporter, @jscpd/badge-reporter, jscpd-sarif-reporter, @jscpd/leveldb-store, @jscpd/redis-store) are maintained on the master-v4 branch.