unslop 0.1.0 → 0.1.1

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.
Files changed (3) hide show
  1. package/README.md +3 -0
  2. package/bin.js +28 -5
  3. package/package.json +6 -5
package/README.md CHANGED
@@ -24,6 +24,9 @@ Requires Go 1.22+ and CGO (for tree-sitter).
24
24
  # Scan current directory
25
25
  unslop .
26
26
 
27
+ # Run directly with npx (no go install)
28
+ npx unslop .
29
+
27
30
  # Verbose text output (full findings)
28
31
  unslop --verbose .
29
32
 
package/bin.js CHANGED
@@ -10,8 +10,30 @@ const PLATFORMS = {
10
10
  "darwin-x64": "@unslop/darwin-x64",
11
11
  "linux-x64": "@unslop/linux-x64",
12
12
  "linux-arm64": "@unslop/linux-arm64",
13
+ "win32-x64": "@unslop/win32-x64",
13
14
  };
14
15
 
16
+ function resolvePackageBinary(pkg) {
17
+ const candidates = ["bin/unslop", "bin/unslop.exe"];
18
+ for (const rel of candidates) {
19
+ try {
20
+ return require.resolve(`${pkg}/${rel}`);
21
+ } catch {}
22
+ }
23
+ return null;
24
+ }
25
+
26
+ function resolveLocalBinary(key) {
27
+ const candidates = ["unslop", "unslop.exe"];
28
+ for (const name of candidates) {
29
+ const localPath = path.join(__dirname, "npm", key, "bin", name);
30
+ if (existsSync(localPath)) {
31
+ return localPath;
32
+ }
33
+ }
34
+ return null;
35
+ }
36
+
15
37
  function getBinaryPath() {
16
38
  const platform = os.platform();
17
39
  const arch = os.arch();
@@ -26,13 +48,14 @@ function getBinaryPath() {
26
48
  }
27
49
 
28
50
  // Try installed npm package first
29
- try {
30
- return require.resolve(`${pkg}/bin/unslop`);
31
- } catch {}
51
+ const fromPackage = resolvePackageBinary(pkg);
52
+ if (fromPackage) {
53
+ return fromPackage;
54
+ }
32
55
 
33
56
  // Fallback: local development build (npm/<platform>/bin/unslop)
34
- const localPath = path.join(__dirname, "npm", key, "bin", "unslop");
35
- if (existsSync(localPath)) {
57
+ const localPath = resolveLocalBinary(key);
58
+ if (localPath) {
36
59
  return localPath;
37
60
  }
38
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unslop",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Detect duplicated code, dead code, and anti-patterns in AI-generated codebases",
5
5
  "bin": {
6
6
  "unslop": "bin.js"
@@ -9,10 +9,11 @@
9
9
  "bin.js"
10
10
  ],
11
11
  "optionalDependencies": {
12
- "@unslop/darwin-arm64": "0.1.0",
13
- "@unslop/darwin-x64": "0.1.0",
14
- "@unslop/linux-x64": "0.1.0",
15
- "@unslop/linux-arm64": "0.1.0"
12
+ "@unslop/darwin-arm64": "0.1.1",
13
+ "@unslop/darwin-x64": "0.1.1",
14
+ "@unslop/linux-arm64": "0.1.1",
15
+ "@unslop/linux-x64": "0.1.1",
16
+ "@unslop/win32-x64": "0.1.1"
16
17
  },
17
18
  "license": "Apache-2.0",
18
19
  "repository": {