@ninjaxtools/slopdex 0.24.0 → 0.26.0

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 CHANGED
@@ -80,9 +80,15 @@ By default all available indexes are searched and ranked together.
80
80
 
81
81
  ```console
82
82
  $ slopdex search "keep the repository index synchronized"
83
- 0.4284 tests/languages.test.ts :: refresh
84
- 0.4200 src/cli.ts :: refreshIndex
85
- 0.4113 src/code-index.ts :: CodeIndex.updateFromGit
83
+ *** src/engine.rs
84
+ @@ 914-1082 @@ score=0.4284
85
+ impl Engine
86
+ pub fn search(&self, query: &str, kind: &str, options: &Value) -> Result<Vec<Value>>
87
+
88
+ *** src/engine.rs
89
+ @@ 376-409 @@ score=0.4200
90
+ impl Engine
91
+ pub fn map(&self, options: &Value) -> Result<Vec<Value>>
86
92
  ...
87
93
  ```
88
94
 
@@ -145,11 +151,20 @@ For the best matching files (configured with `--describe-full-file-threshold`, d
145
151
  Compare functions across files, exclude short wrappers, and group matches into clusters:
146
152
 
147
153
  ```console
148
- $ slopdex cross-search --cross-file-only --min-lines 4 --threshold 0.9
149
- Cluster 1 (3 functions, similarity 0.9124-0.9568)
150
- src/auth/session.ts:18:1 :: validateSession
151
- src/http/middleware.ts:42:1 :: authenticate
152
- src/users/user-service.ts:27:3 :: UserService.authenticate
154
+ $ slopdex cross-search --cross-file-only --lines 4 --threshold 0.9
155
+ Cluster 1 · 3 functions · similarity 0.9124-0.9568
156
+
157
+ *** src/auth/session.ts
158
+ @@ 18-29 @@
159
+ export function validateSession(token: string): Session
160
+
161
+ *** src/http/middleware.ts
162
+ @@ 42-57 @@
163
+ export function authenticate(req: Request): Session
164
+
165
+ *** src/users/user-service.ts
166
+ @@ 27-48 @@ UserService.authenticate
167
+ authenticate(token: string): Session
153
168
  ...
154
169
  ```
155
170
 
@@ -160,11 +175,13 @@ Clusters join matches transitively, so a low threshold can connect many groups
160
175
  into one large cluster. Use `0.9` for stricter duplicate detection, or explicitly
161
176
  pass `--threshold 0.3` for the pre-rewrite default.
162
177
 
163
- You can use threshold ranges as well:
178
+ You can use threshold and line-count ranges as well. Range starts are inclusive
179
+ and ends are exclusive, so `--lines 4-20` selects functions with 4 through 19
180
+ lines:
164
181
 
165
182
  ```console
166
- $ slopdex cross-search --cross-file-only --min-lines 4 --threshold 0.9
167
- $ slopdex cross-search --cross-file-only --min-lines 4 --threshold 0.85-0.9
183
+ $ slopdex cross-search --cross-file-only --lines 4 --threshold 0.9
184
+ $ slopdex cross-search --cross-file-only --lines 4-20 --threshold 0.85-0.9
168
185
  ```
169
186
 
170
187
  ### Restrict functions used in the cross-search
@@ -172,7 +189,7 @@ $ slopdex cross-search --cross-file-only --min-lines 4 --threshold 0.85-0.9
172
189
  Only use uncommitted working-tree functions as sources:
173
190
 
174
191
  ```console
175
- $ slopdex cross-search --uncommitted --cross-file-only --min-lines 4 --threshold 0.9
192
+ $ slopdex cross-search --uncommitted --cross-file-only --lines 4 --threshold 0.9
176
193
  ```
177
194
 
178
195
  Only use functions changed since origin/main as sources:
@@ -19,7 +19,7 @@
19
19
  "hasInstallScript": true,
20
20
  "license": "MIT",
21
21
  "name": "@ninjaxtools/slopdex",
22
- "version": "0.24.0"
22
+ "version": "0.26.0"
23
23
  },
24
24
  "node_modules/detect-libc": {
25
25
  "engines": {
@@ -48,5 +48,5 @@
48
48
  }
49
49
  },
50
50
  "requires": true,
51
- "version": "0.24.0"
51
+ "version": "0.26.0"
52
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "artifactDownloadUrls": [
3
- "https://github.com/ninjaxtools/slopdex/releases/download/v0.24.0"
3
+ "https://github.com/ninjaxtools/slopdex/releases/download/v0.26.0"
4
4
  ],
5
5
  "bin": {
6
6
  "slopdex": "run-slopdex.js"
@@ -80,7 +80,7 @@
80
80
  "zipExt": ".tar.xz"
81
81
  }
82
82
  },
83
- "version": "0.24.0",
83
+ "version": "0.26.0",
84
84
  "volta": {
85
85
  "node": "18.14.1",
86
86
  "npm": "9.5.0"