reslop 0.2.0 → 0.2.3

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/README.md +13 -2
  3. package/lib/ansi.js +263 -6
  4. package/lib/api.js +2 -0
  5. package/lib/capabilities.js +6 -0
  6. package/lib/cli.js +13 -2
  7. package/lib/deps.js +43 -3
  8. package/lib/git-branches.js +228 -17
  9. package/lib/git-reword-todo.js +20 -0
  10. package/lib/git.js +20 -3
  11. package/lib/keys.js +10 -4
  12. package/lib/npm-commands.js +513 -0
  13. package/lib/render/branches.js +23 -58
  14. package/lib/render/chrome.js +156 -99
  15. package/lib/render/commits.js +643 -31
  16. package/lib/render/diff.js +4 -4
  17. package/lib/render/frame.js +51 -5
  18. package/lib/render/notes.js +22 -5
  19. package/lib/render/npm.js +228 -0
  20. package/lib/render/primitives.js +48 -34
  21. package/lib/render/render.js +3 -3
  22. package/lib/report-model.js +127 -0
  23. package/lib/report-parse.js +94 -0
  24. package/lib/report-render.js +87 -0
  25. package/lib/report-run.js +164 -0
  26. package/lib/report-test.js +506 -0
  27. package/lib/report-tools.js +311 -0
  28. package/lib/review-merge.js +270 -0
  29. package/lib/review.js +38 -6
  30. package/lib/session/actions.js +81 -5
  31. package/lib/session/commit.js +187 -19
  32. package/lib/session/compose.js +96 -32
  33. package/lib/session/dispatch.js +36 -2
  34. package/lib/session/files-pane.js +36 -6
  35. package/lib/session/lifecycle.js +116 -16
  36. package/lib/session/navigation.js +1 -0
  37. package/lib/session/npm.js +335 -0
  38. package/lib/session/pointer.js +12 -1
  39. package/lib/session/todos.js +29 -1
  40. package/lib/session/view.js +14 -3
  41. package/lib/session/watch.js +120 -8
  42. package/lib/session.js +11 -2
  43. package/package.json +7 -7
package/lib/session.js CHANGED
@@ -23,6 +23,7 @@ const { createOpsRunner } = require('./session/ops.js');
23
23
  const { createChangeActions } = require('./session/change-actions.js');
24
24
  const { createCommitController } = require('./session/commit.js');
25
25
  const { createBranchController } = require('./session/branches.js');
26
+ const { createNpmController } = require('./session/npm.js');
26
27
  const accessors = require('./session/accessors.js');
27
28
  const { bindAccessors, bindGetters, bindAlias } = accessors;
28
29
  const { createView } = require('./session/view.js');
@@ -32,7 +33,7 @@ const { createPointer } = require('./session/pointer.js');
32
33
  const { createDispatcher, createInput } = require('./session/dispatch.js');
33
34
 
34
35
  const CURSOR_BLINK_MS = 500;
35
- const PROGRESS_MS = 80;
36
+ const PROGRESS_MS = 160;
36
37
 
37
38
  const NAV_FIELDS = [
38
39
  'pane',
@@ -40,6 +41,7 @@ const NAV_FIELDS = [
40
41
  'fileCursor',
41
42
  'branchCursor',
42
43
  'commitCursor',
44
+ 'npmCursor',
43
45
  'scroll',
44
46
  'listScroll',
45
47
  'reviewPath',
@@ -127,6 +129,7 @@ const assignControllers = (session) => {
127
129
  session.changeActions = createChangeActions(session);
128
130
  session.commits = createCommitController(session);
129
131
  session.gitBranches = createBranchController(session);
132
+ session.npm = createNpmController(session);
130
133
  };
131
134
 
132
135
  const bindSessionAccessors = (session) => {
@@ -185,6 +188,7 @@ const bindViewer = (session) => {
185
188
  review: session.review,
186
189
  gitBranches: session.gitBranches,
187
190
  commits: session.commits,
191
+ npm: session.npm,
188
192
  updater: session.updater,
189
193
  ui: session,
190
194
  });
@@ -242,6 +246,7 @@ class Session {
242
246
  if (this.ops) this.ops.reset();
243
247
  if (this.gitBranches) this.gitBranches.reset();
244
248
  if (this.commits) this.commits.reset();
249
+ if (this.npm) this.npm.reset();
245
250
  this.top = this.cwd;
246
251
  this.branch = '';
247
252
  this.status = '';
@@ -312,10 +317,12 @@ class Session {
312
317
  if (
313
318
  this.pane === 'files' ||
314
319
  this.pane === 'branches' ||
315
- this.pane === 'commits'
320
+ this.pane === 'commits' ||
321
+ this.pane === 'npm'
316
322
  ) {
317
323
  this.nav.listScroll = frame.listScroll;
318
324
  }
325
+ if (this.nav.todoOpen) this.nav.scroll = frame.scroll;
319
326
  const composing = this.mode === 'compose';
320
327
  const cursor = composing && this.blinkOn ? frame.cursor : null;
321
328
  this.term.paint(frame, size, cursor);
@@ -394,6 +401,7 @@ class Session {
394
401
  this.status = result.error.message;
395
402
  return false;
396
403
  }
404
+ if (this.lifecycle) this.lifecycle.noteReviewStamp();
397
405
  return result.wrote;
398
406
  }
399
407
 
@@ -401,6 +409,7 @@ class Session {
401
409
  if (!result) return;
402
410
  if (result.kind === 'commit') this.commits.finishGitCommit();
403
411
  if (result.kind === 'branch') this.gitBranches.finishCreateBranch();
412
+ if (result.kind === 'npm') this.npm.finishEdit();
404
413
  }
405
414
 
406
415
  selectTemplate(index) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reslop",
3
- "version": "0.2.0",
3
+ "version": "0.2.3",
4
4
  "description": "Interactive code review and repair planning for AI-assisted changes",
5
5
  "keywords": [
6
6
  "code-review",
@@ -46,20 +46,20 @@
46
46
  "CHANGELOG.md"
47
47
  ],
48
48
  "engines": {
49
- "node": ">=18"
49
+ "node": ">=18.15.0"
50
50
  },
51
51
  "scripts": {
52
+ "test": "reslop t -- npm run -s lint && reslop t -- node --test",
53
+ "lint": "reslop t -- eslint . && reslop t -- prettier -c \"**/*.js\" \"**/*.json\" \"**/*.md\"",
54
+ "fix": "reslop t -- eslint . --fix && reslop t -- prettier --write \"**/*.js\" \"**/*.json\" \"**/*.md\"",
52
55
  "enable": "node scripts/enable.js",
53
- "disable": "node scripts/disable.js",
54
- "lint": "eslint . && prettier -c \"**/*.js\" \"**/*.json\" \"**/*.md\"",
55
- "fix": "eslint . --fix && prettier --write \"**/*.js\" \"**/*.json\" \"**/*.md\"",
56
- "test": "npm run -s lint && node --test"
56
+ "disable": "node scripts/disable.js"
57
57
  },
58
58
  "devDependencies": {
59
59
  "eslint": "^9.39.4",
60
60
  "eslint-config-metarhia": "^9.1.9",
61
61
  "metaskills": "^1.0.5",
62
- "prettier": "^3.9.8"
62
+ "prettier": "^3.9.9"
63
63
  },
64
64
  "dependencies": {
65
65
  "metautil": "^5.5.2"