cpd 5.0.11 → 5.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +7 -7
- package/platform-map.js +6 -6
- package/run-cpd.js +3 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Fast copy/paste detector for programming source code. 24-37x faster than Node.js. Rust rewrite of [jscpd](https://github.com/kucherenko/jscpd), supports 223 language formats.
|
|
4
4
|
|
|
5
|
-
Also available as an npm package: [`jscpd@5`](https://www.npmjs.com/package/jscpd) (installs
|
|
5
|
+
Also available as an npm package: [`jscpd@5`](https://www.npmjs.com/package/jscpd) (installs the `jscpd` command) or [`cpd`](https://www.npmjs.com/package/cpd) (installs the `cpd` command). The crates.io install exposes both `jscpd` and `cpd` binaries.
|
|
6
6
|
|
|
7
7
|
## Performance
|
|
8
8
|
|
|
@@ -19,10 +19,10 @@ See [performance-comparison.md](../docs/performance-comparison.md) for full meth
|
|
|
19
19
|
### npm (recommended)
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
# installs
|
|
22
|
+
# npm — installs the jscpd command
|
|
23
23
|
npm install -g jscpd
|
|
24
24
|
|
|
25
|
-
# installs only the cpd command
|
|
25
|
+
# npm — installs only the cpd command
|
|
26
26
|
npm install -g cpd
|
|
27
27
|
```
|
|
28
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cpd",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.12",
|
|
4
4
|
"description": "Copy/paste detector — fast Rust-based CLI for code duplication detection",
|
|
5
5
|
"homepage": "https://jscpd.dev",
|
|
6
6
|
"bin": {
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"platform-map.js"
|
|
12
12
|
],
|
|
13
13
|
"optionalDependencies": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
14
|
+
"jscpd-linux-x64-gnu": "5.0.11",
|
|
15
|
+
"jscpd-linux-arm64-gnu": "5.0.11",
|
|
16
|
+
"jscpd-linux-x64-musl": "5.0.11",
|
|
17
|
+
"jscpd-darwin-arm64": "5.0.11",
|
|
18
|
+
"jscpd-darwin-x64": "5.0.11",
|
|
19
|
+
"jscpd-windows-x64-msvc": "5.0.11"
|
|
20
20
|
},
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
package/platform-map.js
CHANGED
|
@@ -4,7 +4,7 @@ const { platform, arch } = process;
|
|
|
4
4
|
|
|
5
5
|
const PLATFORM_MAP = {
|
|
6
6
|
"linux-x64-gnu": {
|
|
7
|
-
packageName: "
|
|
7
|
+
packageName: "jscpd-linux-x64-gnu",
|
|
8
8
|
os: "linux",
|
|
9
9
|
cpu: "x64",
|
|
10
10
|
libc: "glibc",
|
|
@@ -12,7 +12,7 @@ const PLATFORM_MAP = {
|
|
|
12
12
|
runner: "ubuntu-latest",
|
|
13
13
|
},
|
|
14
14
|
"linux-arm64-gnu": {
|
|
15
|
-
packageName: "
|
|
15
|
+
packageName: "jscpd-linux-arm64-gnu",
|
|
16
16
|
os: "linux",
|
|
17
17
|
cpu: "arm64",
|
|
18
18
|
libc: "glibc",
|
|
@@ -20,7 +20,7 @@ const PLATFORM_MAP = {
|
|
|
20
20
|
runner: "ubuntu-latest",
|
|
21
21
|
},
|
|
22
22
|
"linux-x64-musl": {
|
|
23
|
-
packageName: "
|
|
23
|
+
packageName: "jscpd-linux-x64-musl",
|
|
24
24
|
os: "linux",
|
|
25
25
|
cpu: "x64",
|
|
26
26
|
libc: "musl",
|
|
@@ -28,21 +28,21 @@ const PLATFORM_MAP = {
|
|
|
28
28
|
runner: "ubuntu-latest",
|
|
29
29
|
},
|
|
30
30
|
"darwin-arm64": {
|
|
31
|
-
packageName: "
|
|
31
|
+
packageName: "jscpd-darwin-arm64",
|
|
32
32
|
os: "darwin",
|
|
33
33
|
cpu: "arm64",
|
|
34
34
|
rustTarget: "aarch64-apple-darwin",
|
|
35
35
|
runner: "macos-latest",
|
|
36
36
|
},
|
|
37
37
|
"darwin-x64": {
|
|
38
|
-
packageName: "
|
|
38
|
+
packageName: "jscpd-darwin-x64",
|
|
39
39
|
os: "darwin",
|
|
40
40
|
cpu: "x64",
|
|
41
41
|
rustTarget: "x86_64-apple-darwin",
|
|
42
42
|
runner: "macos-13",
|
|
43
43
|
},
|
|
44
44
|
"windows-x64-msvc": {
|
|
45
|
-
packageName: "
|
|
45
|
+
packageName: "jscpd-windows-x64-msvc",
|
|
46
46
|
os: "win32",
|
|
47
47
|
cpu: "x64",
|
|
48
48
|
rustTarget: "x86_64-pc-windows-msvc",
|
package/run-cpd.js
CHANGED
|
@@ -14,14 +14,14 @@ if (!key) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const entry = PLATFORM_MAP[key];
|
|
17
|
-
const binaryName = process.platform === "win32" ? "
|
|
17
|
+
const binaryName = process.platform === "win32" ? "jscpd.exe" : "jscpd";
|
|
18
18
|
|
|
19
19
|
let binaryPath;
|
|
20
20
|
try {
|
|
21
21
|
const pkgJson = require.resolve(`${entry.packageName}/package.json`, {
|
|
22
22
|
paths: [path.resolve(__dirname, ".."), __dirname],
|
|
23
23
|
});
|
|
24
|
-
binaryPath = path.join(path.dirname(pkgJson), "
|
|
24
|
+
binaryPath = path.join(path.dirname(pkgJson), "bin", binaryName);
|
|
25
25
|
} catch {
|
|
26
26
|
const localBuild = path.join(
|
|
27
27
|
__dirname,
|
|
@@ -58,4 +58,4 @@ if (result.error) {
|
|
|
58
58
|
if (result.signal) {
|
|
59
59
|
process.kill(process.pid, result.signal);
|
|
60
60
|
}
|
|
61
|
-
process.exit(result.status ?? 0);
|
|
61
|
+
process.exit(result.status ?? 0);
|