reslop 0.2.5 → 0.2.6
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 +12 -1
- package/LICENSE +1 -1
- package/README.md +11 -11
- package/bin/reslop.js +3 -8
- package/lib/ansi.js +32 -19
- package/lib/capabilities.js +8 -8
- package/lib/cli.js +40 -74
- package/lib/clipboard.js +39 -47
- package/lib/dashboard/git.js +128 -0
- package/lib/dashboard/model.js +332 -0
- package/lib/dashboard/npm.js +193 -0
- package/lib/dashboard/tree.js +278 -0
- package/lib/deps-diff.js +197 -402
- package/lib/deps.js +113 -240
- package/lib/detect.js +8 -18
- package/lib/diff/align.js +41 -113
- package/lib/diff/diff.js +12 -43
- package/lib/diff/display.js +25 -36
- package/lib/diff/edit.js +6 -20
- package/lib/diff/inline.js +76 -144
- package/lib/diff/items.js +33 -47
- package/lib/diff/parse.js +28 -56
- package/lib/diff/patch.js +12 -33
- package/lib/diff/unit.js +79 -178
- package/lib/editor.js +52 -69
- package/lib/files.js +71 -89
- package/lib/git-branches.js +254 -416
- package/lib/git-deps.js +147 -272
- package/lib/git-reword-todo.js +5 -13
- package/lib/git-worktree.js +141 -212
- package/lib/git.js +21 -49
- package/lib/github.js +67 -181
- package/lib/gitlab.js +40 -90
- package/lib/highlight/bash.js +55 -177
- package/lib/highlight/core.js +155 -141
- package/lib/highlight/css.js +25 -58
- package/lib/highlight/csv.js +19 -37
- package/lib/highlight/dart.js +72 -213
- package/lib/highlight/dot.js +14 -14
- package/lib/highlight/html.js +42 -63
- package/lib/highlight/js.js +177 -506
- package/lib/highlight/json.js +17 -37
- package/lib/highlight/log.js +19 -25
- package/lib/highlight/txt.js +7 -10
- package/lib/highlight.js +17 -46
- package/lib/keys.js +49 -82
- package/lib/manifest.js +67 -126
- package/lib/npm-commands.js +120 -169
- package/lib/remote.js +140 -190
- package/lib/render/branches.js +63 -61
- package/lib/render/chrome.js +220 -333
- package/lib/render/commits.js +160 -361
- package/lib/render/dash-activity.js +212 -0
- package/lib/render/dash-blocks.js +245 -0
- package/lib/render/dash-table.js +290 -0
- package/lib/render/dashboard.js +62 -0
- package/lib/render/diff.js +123 -258
- package/lib/render/files.js +40 -85
- package/lib/render/frame.js +78 -117
- package/lib/render/notes.js +139 -210
- package/lib/render/npm.js +213 -177
- package/lib/render/present.js +4 -11
- package/lib/render/primitives.js +72 -174
- package/lib/render/render.js +5 -14
- package/lib/render/report.js +43 -0
- package/lib/render/tiles.js +260 -0
- package/lib/render/unit.js +15 -31
- package/lib/report-model.js +110 -33
- package/lib/report-parse.js +56 -37
- package/lib/report-render.js +102 -59
- package/lib/report-run.js +87 -77
- package/lib/report-test.js +221 -99
- package/lib/report-tools.js +96 -154
- package/lib/review-merge.js +33 -41
- package/lib/review.js +68 -129
- package/lib/runs.js +225 -0
- package/lib/select.js +53 -91
- package/lib/session/accessors.js +14 -21
- package/lib/session/actions.js +61 -43
- package/lib/session/branches.js +166 -222
- package/lib/session/change-actions.js +49 -119
- package/lib/session/commit.js +274 -355
- package/lib/session/compose.js +556 -714
- package/lib/session/dashboard.js +385 -0
- package/lib/session/dispatch.js +162 -170
- package/lib/session/files-pane.js +76 -44
- package/lib/session/items.js +6 -17
- package/lib/session/lifecycle.js +393 -466
- package/lib/session/load.js +1 -14
- package/lib/session/navigation.js +2 -2
- package/lib/session/npm.js +403 -420
- package/lib/session/ops.js +5 -13
- package/lib/session/pointer.js +16 -14
- package/lib/session/progress.js +39 -30
- package/lib/session/review.js +1 -3
- package/lib/session/tasks.js +276 -235
- package/lib/session/templates.js +51 -59
- package/lib/session/terminal.js +85 -132
- package/lib/session/view.js +47 -81
- package/lib/session/watch.js +196 -212
- package/lib/session.js +81 -161
- package/lib/update.js +44 -111
- package/lib/utilities.js +46 -88
- package/lib/wrap.js +29 -55
- package/package.json +1 -1
package/lib/session/ops.js
CHANGED
|
@@ -6,17 +6,8 @@ const QUIET_KIND = new Set(['staged', 'unstaged']);
|
|
|
6
6
|
const pickRepoWrite = (repo, name, uiOpen) => {
|
|
7
7
|
const asyncFn = repo[`${name}Async`];
|
|
8
8
|
const allowAsync = uiOpen === true || ASYNC_WITHOUT_UI.includes(name);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
async: true,
|
|
12
|
-
write: (top, ...args) => asyncFn(top, ...args),
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
const syncFn = repo[name];
|
|
16
|
-
return {
|
|
17
|
-
async: false,
|
|
18
|
-
write: (top, ...args) => syncFn(top, ...args),
|
|
19
|
-
};
|
|
9
|
+
const isAsync = allowAsync && typeof asyncFn === 'function';
|
|
10
|
+
return { async: isAsync, write: isAsync ? asyncFn : repo[name] };
|
|
20
11
|
};
|
|
21
12
|
|
|
22
13
|
const showsBusy = (kind) => Boolean(kind) && !QUIET_KIND.has(kind);
|
|
@@ -86,7 +77,6 @@ class ChangeQueue {
|
|
|
86
77
|
|
|
87
78
|
startReload() {
|
|
88
79
|
const { ui } = this;
|
|
89
|
-
if (typeof ui.reloadAfterChange !== 'function') return void ui.paint();
|
|
90
80
|
this.reloading = true;
|
|
91
81
|
ui.reloadAfterChange(() => {
|
|
92
82
|
this.reloading = false;
|
|
@@ -231,15 +221,17 @@ class OpsRunner {
|
|
|
231
221
|
this.finishBusy(done, after);
|
|
232
222
|
}
|
|
233
223
|
|
|
234
|
-
runWrite(name, args, kind, done, after) {
|
|
224
|
+
runWrite(name, args, kind, done, after, leave = null) {
|
|
235
225
|
const { ui } = this;
|
|
236
226
|
const picked = pickRepoWrite(ui.repo, name, ui.uiOpen);
|
|
237
227
|
const write = (top) => picked.write(top, ...args);
|
|
238
228
|
if (picked.async) {
|
|
229
|
+
if (leave) leave();
|
|
239
230
|
const refresh = () => after({ doneStatus: done });
|
|
240
231
|
return void this.runBusy(kind, done, write, refresh);
|
|
241
232
|
}
|
|
242
233
|
if (!this.runRepo(done, write)) return;
|
|
234
|
+
if (leave) leave();
|
|
243
235
|
after({});
|
|
244
236
|
if (!ui.status) ui.status = done;
|
|
245
237
|
}
|
package/lib/session/pointer.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const select = require('../select.js');
|
|
4
4
|
const editClick = require('./edit-click.js');
|
|
5
|
+
const filesPane = require('./files-pane.js');
|
|
5
6
|
const { extractText, isRange } = select;
|
|
6
7
|
const keys = require('../keys.js');
|
|
7
8
|
const { hitAction } = keys;
|
|
@@ -94,16 +95,21 @@ const RELEASE_TARGETS = [
|
|
|
94
95
|
hits: 'statusHits',
|
|
95
96
|
onHit: (ui, hit) => {
|
|
96
97
|
if (hit.id === 'branch') return void ui.gitBranches.onBranch();
|
|
97
|
-
ui.
|
|
98
|
+
ui.confirmChoice(hit.id);
|
|
98
99
|
},
|
|
99
100
|
},
|
|
101
|
+
{
|
|
102
|
+
match: (ui) => ui.pane === 'dashboard',
|
|
103
|
+
hits: 'fileHits',
|
|
104
|
+
onHit: (ui, hit) => ui.dashboard.open(hit.cursor),
|
|
105
|
+
},
|
|
100
106
|
{
|
|
101
107
|
match: (ui) => ui.pane === 'files',
|
|
102
108
|
hits: 'fileHits',
|
|
103
109
|
onHit: (ui, hit) => {
|
|
104
110
|
const again = armDoubleClick(ui.nav, 'files', hit.cursor);
|
|
105
111
|
ui.nav.fileCursor = hit.cursor;
|
|
106
|
-
if (again)
|
|
112
|
+
if (again) filesPane.onOpenFile(ui);
|
|
107
113
|
},
|
|
108
114
|
},
|
|
109
115
|
{
|
|
@@ -122,7 +128,7 @@ const RELEASE_TARGETS = [
|
|
|
122
128
|
if (ui.mode === 'compose') return;
|
|
123
129
|
const again = armDoubleClick(ui.nav, 'commits', hit.cursor);
|
|
124
130
|
ui.nav.commitCursor = hit.cursor;
|
|
125
|
-
if (again)
|
|
131
|
+
if (again) filesPane.onOpenFile(ui);
|
|
126
132
|
},
|
|
127
133
|
},
|
|
128
134
|
{
|
|
@@ -135,11 +141,11 @@ const RELEASE_TARGETS = [
|
|
|
135
141
|
},
|
|
136
142
|
},
|
|
137
143
|
{
|
|
138
|
-
match: (ui) => ui.pane === '
|
|
144
|
+
match: (ui) => ui.pane === 'tasks',
|
|
139
145
|
hits: 'taskHits',
|
|
140
146
|
onHit: (ui, hit) => {
|
|
141
|
-
if (hit.check) return void ui.composer.onTaskCheck(hit.cursor);
|
|
142
|
-
ui.composer.onTaskHit(hit.cursor);
|
|
147
|
+
if (hit.check) return void ui.composer.tasks.onTaskCheck(hit.cursor);
|
|
148
|
+
ui.composer.tasks.onTaskHit(hit.cursor);
|
|
143
149
|
},
|
|
144
150
|
},
|
|
145
151
|
{
|
|
@@ -171,14 +177,14 @@ const onRelease = (ui, event) => {
|
|
|
171
177
|
};
|
|
172
178
|
|
|
173
179
|
const POINTER_HANDLERS = {
|
|
174
|
-
wheelUp: (ui) =>
|
|
175
|
-
wheelDown: (ui) =>
|
|
180
|
+
wheelUp: (ui) => filesPane.onScroll(ui, -1),
|
|
181
|
+
wheelDown: (ui) => filesPane.onScroll(ui, 1),
|
|
176
182
|
press: onPress,
|
|
177
183
|
drag: onDrag,
|
|
178
184
|
release: onRelease,
|
|
179
185
|
};
|
|
180
186
|
|
|
181
|
-
const
|
|
187
|
+
const handlePointer = (ui, event) => {
|
|
182
188
|
const kind = event.kind;
|
|
183
189
|
const handler = POINTER_HANDLERS[kind];
|
|
184
190
|
if (!handler) return;
|
|
@@ -187,8 +193,4 @@ const handle = (ui, event) => {
|
|
|
187
193
|
handler(ui, event);
|
|
188
194
|
};
|
|
189
195
|
|
|
190
|
-
|
|
191
|
-
handle: (event) => handle(ui, event),
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
module.exports = { createPointer };
|
|
196
|
+
module.exports = { handlePointer };
|
package/lib/session/progress.js
CHANGED
|
@@ -1,32 +1,41 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
3
|
+
class Progress {
|
|
4
|
+
constructor(term, onTick, intervalMs) {
|
|
5
|
+
this.term = term;
|
|
6
|
+
this.onTick = onTick;
|
|
7
|
+
this.intervalMs = intervalMs;
|
|
8
|
+
this.active = new Set();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
tick() {
|
|
12
|
+
if (!this.active.size) return;
|
|
13
|
+
this.onTick();
|
|
14
|
+
this.schedule();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
schedule() {
|
|
18
|
+
this.term.later('progress', () => this.tick(), this.intervalMs);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
start(id) {
|
|
22
|
+
this.active.add(id);
|
|
23
|
+
this.schedule();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
stop(id) {
|
|
27
|
+
this.active.delete(id);
|
|
28
|
+
if (!this.active.size) this.term.cancel('progress');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
clear() {
|
|
32
|
+
this.active.clear();
|
|
33
|
+
this.term.cancel('progress');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
size() {
|
|
37
|
+
return this.active.size;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
module.exports = { Progress };
|