@ninjaxtools/slopdex 0.23.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 +30 -12
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -65,6 +65,7 @@ The index tracks the current git commit and is created or updated on every comma
|
|
|
65
65
|
```console
|
|
66
66
|
$ slopdex map src docs
|
|
67
67
|
$ slopdex map src -g '*.rs' -k fns -e 'refresh|search'
|
|
68
|
+
$ slopdex map src --private
|
|
68
69
|
$ slopdex map -g '*.md' -e '^Guide\.Setup' -i --format json
|
|
69
70
|
$ slopdex map --no-reindex
|
|
70
71
|
```
|
|
@@ -79,9 +80,15 @@ By default all available indexes are searched and ranked together.
|
|
|
79
80
|
|
|
80
81
|
```console
|
|
81
82
|
$ slopdex search "keep the repository index synchronized"
|
|
82
|
-
|
|
83
|
-
0.
|
|
84
|
-
|
|
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>>
|
|
85
92
|
...
|
|
86
93
|
```
|
|
87
94
|
|
|
@@ -144,11 +151,20 @@ For the best matching files (configured with `--describe-full-file-threshold`, d
|
|
|
144
151
|
Compare functions across files, exclude short wrappers, and group matches into clusters:
|
|
145
152
|
|
|
146
153
|
```console
|
|
147
|
-
$ slopdex cross-search --cross-file-only --
|
|
148
|
-
Cluster 1
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
|
152
168
|
...
|
|
153
169
|
```
|
|
154
170
|
|
|
@@ -159,11 +175,13 @@ Clusters join matches transitively, so a low threshold can connect many groups
|
|
|
159
175
|
into one large cluster. Use `0.9` for stricter duplicate detection, or explicitly
|
|
160
176
|
pass `--threshold 0.3` for the pre-rewrite default.
|
|
161
177
|
|
|
162
|
-
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:
|
|
163
181
|
|
|
164
182
|
```console
|
|
165
|
-
$ slopdex cross-search --cross-file-only --
|
|
166
|
-
$ slopdex cross-search --cross-file-only --
|
|
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
|
|
167
185
|
```
|
|
168
186
|
|
|
169
187
|
### Restrict functions used in the cross-search
|
|
@@ -171,7 +189,7 @@ $ slopdex cross-search --cross-file-only --min-lines 4 --threshold 0.85-0.9
|
|
|
171
189
|
Only use uncommitted working-tree functions as sources:
|
|
172
190
|
|
|
173
191
|
```console
|
|
174
|
-
$ slopdex cross-search --uncommitted --cross-file-only --
|
|
192
|
+
$ slopdex cross-search --uncommitted --cross-file-only --lines 4 --threshold 0.9
|
|
175
193
|
```
|
|
176
194
|
|
|
177
195
|
Only use functions changed since origin/main as sources:
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"hasInstallScript": true,
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"name": "@ninjaxtools/slopdex",
|
|
22
|
-
"version": "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.
|
|
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.
|
|
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.
|
|
83
|
+
"version": "0.26.0",
|
|
84
84
|
"volta": {
|
|
85
85
|
"node": "18.14.1",
|
|
86
86
|
"npm": "9.5.0"
|