@ninjaxtools/slopdex 0.28.0 → 0.29.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 +5 -19
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -153,29 +153,15 @@ Compare functions across files, exclude short wrappers, and group matches into c
|
|
|
153
153
|
|
|
154
154
|
```console
|
|
155
155
|
$ slopdex cross-search --cross-file-only --lines 4 --threshold 0.9
|
|
156
|
-
Cluster 1 · 3
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
export function validateSession(token: string): Session
|
|
161
|
-
|
|
162
|
-
*** src/http/middleware.ts
|
|
163
|
-
@@ 42-57 @@
|
|
164
|
-
export function authenticate(req: Request): Session
|
|
165
|
-
|
|
166
|
-
*** src/users/user-service.ts
|
|
167
|
-
@@ 27-48 @@ UserService.authenticate
|
|
168
|
-
authenticate(token: string): Session
|
|
156
|
+
*** Cluster 1 · 3 symbols · similarity 0.91-0.96
|
|
157
|
+
src/auth/session.ts:18-29:validateSession
|
|
158
|
+
src/http/middleware.ts:42-57:authenticate
|
|
159
|
+
src/users/user-service.ts:27-48:UserService.authenticate
|
|
169
160
|
...
|
|
170
161
|
```
|
|
171
162
|
|
|
172
163
|
Using `--cross-file-only` is useful to exclude similar code in the same file.
|
|
173
164
|
|
|
174
|
-
Cross-search defaults to `--threshold 0.8` (query search defaults to `0.3`).
|
|
175
|
-
Clusters join matches transitively, so a low threshold can connect many groups
|
|
176
|
-
into one large cluster. Use `0.9` for stricter duplicate detection, or explicitly
|
|
177
|
-
pass `--threshold 0.3` for the pre-rewrite default.
|
|
178
|
-
|
|
179
165
|
You can use threshold and line-count ranges as well. Range starts are inclusive
|
|
180
166
|
and ends are exclusive, so `--lines 4-20` selects functions with 4 through 19
|
|
181
167
|
lines:
|
|
@@ -219,7 +205,7 @@ Just put this in your `AGENTS.md` file and adjust as desired, no skill necessary
|
|
|
219
205
|
```
|
|
220
206
|
- use `slopdex map -g "<glob>" -i -e "<regex>" <files or directories...>` to obtain a compact structural code skeleton, and then perform targeted reads using the line numbers for implementation details. To filter for specific symbols, use `-e`. To only include specific kinds of symbols use `-k` with `imports`, `fns`, `consts`, `types`, or `classes`.
|
|
221
207
|
- use semantic code search to find code with: `slopdex search "<query>" --threshold 0.5`; vary the search query if you get no results
|
|
222
|
-
- when reviewing uncommitted
|
|
208
|
+
- when reviewing uncommitted determine if similar code elsewhere warrants a refactor: `slopdex cross-search --uncommitted --cross-file-only --threshold 0.8`
|
|
223
209
|
- when tasked to do advanced codebase analysis, use `slopdex --help` first to see all options
|
|
224
210
|
```
|
|
225
211
|
|
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.29.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.29.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.29.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.29.0",
|
|
84
84
|
"volta": {
|
|
85
85
|
"node": "18.14.1",
|
|
86
86
|
"npm": "9.5.0"
|