@stephencollinstech/hotspots 1.25.3
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/bin/hotspots.js +50 -0
- package/package.json +38 -0
package/bin/hotspots.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { execFileSync } = require("child_process");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const os = require("os");
|
|
7
|
+
|
|
8
|
+
function getBinaryPath() {
|
|
9
|
+
const platform = os.platform();
|
|
10
|
+
const arch = os.arch();
|
|
11
|
+
|
|
12
|
+
let pkgName;
|
|
13
|
+
let binName;
|
|
14
|
+
|
|
15
|
+
if (platform === "linux" && arch === "x64") {
|
|
16
|
+
pkgName = "@stephencollinstech/hotspots-linux-x64";
|
|
17
|
+
binName = "hotspots";
|
|
18
|
+
} else if (platform === "darwin" && arch === "arm64") {
|
|
19
|
+
pkgName = "@stephencollinstech/hotspots-darwin-arm64";
|
|
20
|
+
binName = "hotspots";
|
|
21
|
+
} else if (platform === "win32" && arch === "x64") {
|
|
22
|
+
pkgName = "@stephencollinstech/hotspots-win32-x64";
|
|
23
|
+
binName = "hotspots.exe";
|
|
24
|
+
} else {
|
|
25
|
+
console.error(
|
|
26
|
+
`hotspots: unsupported platform ${platform}/${arch}\n` +
|
|
27
|
+
`Supported: linux/x64, darwin/arm64, win32/x64\n` +
|
|
28
|
+
`Install from source: cargo install hotspots-cli`
|
|
29
|
+
);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
return require.resolve(`${pkgName}/bin/${binName}`);
|
|
35
|
+
} catch {
|
|
36
|
+
console.error(
|
|
37
|
+
`hotspots: could not find binary package ${pkgName}\n` +
|
|
38
|
+
`Try reinstalling: npm install hotspots`
|
|
39
|
+
);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const bin = getBinaryPath();
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
execFileSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
48
|
+
} catch (err) {
|
|
49
|
+
process.exit(err.status ?? 1);
|
|
50
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stephencollinstech/hotspots",
|
|
3
|
+
"version": "1.25.3",
|
|
4
|
+
"description": "Static analysis CLI for TypeScript that computes Local Risk Score (LRS)",
|
|
5
|
+
"bin": {
|
|
6
|
+
"hotspots": "./bin/hotspots.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/hotspots.js"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"postinstall": "node bin/hotspots.js --version > /dev/null 2>&1 || true"
|
|
13
|
+
},
|
|
14
|
+
"optionalDependencies": {
|
|
15
|
+
"@stephencollinstech/hotspots-linux-x64": "1.25.3",
|
|
16
|
+
"@stephencollinstech/hotspots-darwin-arm64": "1.25.3",
|
|
17
|
+
"@stephencollinstech/hotspots-win32-x64": "1.25.3"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"hotspots",
|
|
21
|
+
"complexity",
|
|
22
|
+
"static-analysis",
|
|
23
|
+
"typescript",
|
|
24
|
+
"code-quality",
|
|
25
|
+
"lrs",
|
|
26
|
+
"cyclomatic-complexity"
|
|
27
|
+
],
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/Stephen-Collins-tech/hotspots.git",
|
|
32
|
+
"directory": "packages/hotspots"
|
|
33
|
+
},
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/Stephen-Collins-tech/hotspots/issues"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://hotspots.dev"
|
|
38
|
+
}
|