reslop 0.1.7 → 0.1.8
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/CHANGELOG.md +19 -1
- package/README.md +1 -1
- package/bin/reslop.js +3 -1
- package/lib/capabilities.js +106 -0
- package/lib/cli.js +18 -14
- package/lib/deps/changes.js +331 -0
- package/lib/deps/items.js +131 -0
- package/lib/deps/manifest.js +145 -0
- package/lib/deps/merge.js +120 -0
- package/lib/deps/proposals.js +164 -0
- package/lib/deps/reports.js +180 -0
- package/lib/deps/rows.js +177 -0
- package/lib/deps/scan.js +138 -0
- package/lib/deps/usage.js +68 -0
- package/lib/deps/versions.js +119 -0
- package/lib/deps.js +65 -1348
- package/lib/diff/align.js +226 -0
- package/lib/diff/display.js +101 -0
- package/lib/diff/edit.js +47 -0
- package/lib/diff/inline.js +300 -0
- package/lib/diff/items.js +101 -0
- package/lib/diff/parse.js +156 -0
- package/lib/diff/patch.js +103 -0
- package/lib/diff.js +13 -932
- package/lib/editor.js +37 -0
- package/lib/files.js +88 -3
- package/lib/git/branches.js +291 -0
- package/lib/git/changes.js +164 -0
- package/lib/git/dependencies.js +489 -0
- package/lib/git/proc.js +162 -0
- package/lib/git/read.js +253 -0
- package/lib/git/run.js +100 -0
- package/lib/git.js +82 -1193
- package/lib/github.js +92 -222
- package/lib/gitlab.js +72 -216
- package/lib/highlight/bash.js +5 -9
- package/lib/highlight/core.js +1 -1
- package/lib/highlight/css.js +1 -3
- package/lib/highlight/csv.js +1 -3
- package/lib/highlight/dart.js +6 -20
- package/lib/highlight/dot.js +13 -13
- package/lib/highlight/html.js +1 -5
- package/lib/highlight/js.js +151 -115
- package/lib/highlight/json.js +1 -3
- package/lib/highlight/log.js +1 -3
- package/lib/highlight/txt.js +5 -10
- package/lib/highlight.js +4 -4
- package/lib/keys.js +59 -167
- package/lib/npm/commands.js +100 -0
- package/lib/remote/changes.js +37 -0
- package/lib/remote/headers.js +36 -0
- package/lib/remote/http.js +122 -0
- package/lib/remote/notes.js +94 -0
- package/lib/render/branches.js +218 -0
- package/lib/render/chrome.js +575 -0
- package/lib/render/diff.js +307 -0
- package/lib/render/files.js +166 -0
- package/lib/render/frame.js +197 -0
- package/lib/render/notes.js +201 -0
- package/lib/render/present.js +25 -0
- package/lib/render/primitives.js +200 -0
- package/lib/render.js +13 -1687
- package/lib/review/format.js +434 -0
- package/lib/review/storage.js +150 -0
- package/lib/review/store.js +178 -0
- package/lib/review/templates.js +49 -0
- package/lib/review.js +14 -747
- package/lib/select.js +3 -5
- package/lib/session/accessors.js +25 -0
- package/lib/session/actions.js +275 -0
- package/lib/session/branches.js +304 -0
- package/lib/session/change-actions.js +320 -0
- package/lib/session/commit.js +124 -0
- package/lib/session/compose.js +540 -0
- package/lib/session/dispatch.js +105 -0
- package/lib/session/files-pane.js +234 -0
- package/lib/session/items.js +177 -0
- package/lib/session/lifecycle.js +476 -0
- package/lib/session/load.js +85 -0
- package/lib/session/navigation.js +93 -0
- package/lib/session/ops.js +110 -0
- package/lib/session/origins.js +7 -0
- package/lib/session/pointer.js +154 -0
- package/lib/session/progress.js +29 -0
- package/lib/session/review.js +88 -0
- package/lib/session/templates.js +64 -0
- package/lib/session/terminal.js +169 -0
- package/lib/session/todos.js +269 -0
- package/lib/session/update.js +125 -0
- package/lib/session/view.js +129 -0
- package/lib/session/watch.js +219 -0
- package/lib/session.js +574 -2354
- package/lib/source.js +11 -11
- package/lib/sys.js +25 -4
- package/lib/wrap.js +4 -2
- package/package.json +2 -2
package/lib/source.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const { parseGithubPrUrl } = require('./github.js');
|
|
4
4
|
const { parseGitlabMrUrl } = require('./gitlab.js');
|
|
5
|
+
const { capabilitiesFor, attachCapabilities } = require('./capabilities.js');
|
|
5
6
|
|
|
6
7
|
const selectChangeSource = (paths) => {
|
|
7
8
|
if (!paths.length) return { kind: 'local', paths };
|
|
@@ -13,19 +14,18 @@ const selectChangeSource = (paths) => {
|
|
|
13
14
|
return { kind: 'local', paths };
|
|
14
15
|
};
|
|
15
16
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const createLoadedSource = (loaded) => ({
|
|
19
|
-
load: () => {
|
|
17
|
+
const createLoadedSource = (loaded, kind = 'github-pr', extra = {}) => {
|
|
18
|
+
const load = () => {
|
|
20
19
|
const items = loaded.items ?? [];
|
|
21
20
|
return { ...loaded, items: [...items] };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
};
|
|
22
|
+
const impl = {
|
|
23
|
+
load,
|
|
24
|
+
resolveRev: () => null,
|
|
25
|
+
};
|
|
26
|
+
if (extra.loadAsync) impl.loadAsync = extra.loadAsync;
|
|
27
|
+
return attachCapabilities(impl, capabilitiesFor(kind));
|
|
28
|
+
};
|
|
29
29
|
|
|
30
30
|
module.exports = {
|
|
31
31
|
selectChangeSource,
|
package/lib/sys.js
CHANGED
|
@@ -25,15 +25,35 @@ const clipTools = (platform = process.platform) => {
|
|
|
25
25
|
return UNIX_CLIP;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
const listen = (emitter, event, handler) => {
|
|
29
|
+
if (!emitter || typeof emitter.on !== 'function') return () => {};
|
|
30
|
+
emitter.on(event, handler);
|
|
31
|
+
return () => {
|
|
32
|
+
if (typeof emitter.removeListener === 'function') {
|
|
33
|
+
emitter.removeListener(event, handler);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (typeof emitter.off === 'function') emitter.off(event, handler);
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
|
|
28
40
|
const watchResize = (stdout, proc, onResize, signal) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
41
|
+
const stopStdout = listen(stdout, 'resize', onResize);
|
|
42
|
+
let stopProc = () => {};
|
|
32
43
|
try {
|
|
33
|
-
proc
|
|
44
|
+
stopProc = listen(proc, 'SIGWINCH', onResize);
|
|
34
45
|
} catch {
|
|
35
46
|
// SIGWINCH is not available on Windows
|
|
36
47
|
}
|
|
48
|
+
const stop = () => {
|
|
49
|
+
stopStdout();
|
|
50
|
+
stopProc();
|
|
51
|
+
};
|
|
52
|
+
if (signal) {
|
|
53
|
+
if (signal.aborted) stop();
|
|
54
|
+
else signal.addEventListener('abort', stop, { once: true });
|
|
55
|
+
}
|
|
56
|
+
return stop;
|
|
37
57
|
};
|
|
38
58
|
|
|
39
59
|
const canonPath = (value) => {
|
|
@@ -58,6 +78,7 @@ module.exports = {
|
|
|
58
78
|
spawnBase,
|
|
59
79
|
npmOpts,
|
|
60
80
|
clipTools,
|
|
81
|
+
listen,
|
|
61
82
|
watchResize,
|
|
62
83
|
samePath,
|
|
63
84
|
};
|
package/lib/wrap.js
CHANGED
|
@@ -100,9 +100,11 @@ const indexAtWrapCol = (row, col, limit) => {
|
|
|
100
100
|
const wrapMove = (text, cursor, width, delta, wantCol) => {
|
|
101
101
|
const rows = wrapDoc(text, width);
|
|
102
102
|
const pos = cursorInWrap(text, cursor, width);
|
|
103
|
-
|
|
103
|
+
let next = pos.row + delta;
|
|
104
|
+
if (next < 0) next = 0;
|
|
105
|
+
if (next >= rows.length) next = rows.length - 1;
|
|
104
106
|
const col = wantCol ?? pos.col;
|
|
105
|
-
if (next
|
|
107
|
+
if (next === pos.row) return { cursor, col };
|
|
106
108
|
const row = rows[next];
|
|
107
109
|
let limit = text.length + 1;
|
|
108
110
|
if (next + 1 < rows.length) limit = rows[next + 1].start;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reslop",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Interactive code review and repair planning for AI-assisted changes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"code-review",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"eslint": "^9.39.4",
|
|
60
60
|
"eslint-config-metarhia": "^9.1.9",
|
|
61
61
|
"metaskills": "^1.0.5",
|
|
62
|
-
"prettier": "^3.
|
|
62
|
+
"prettier": "^3.9.7"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"metautil": "^5.5.2"
|