kodevu 0.1.11 → 0.1.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kodevu",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "type": "module",
5
5
  "description": "Poll SVN revisions or Git commits, send each change diff to a reviewer CLI, and write configurable review reports.",
6
6
  "bin": {
@@ -414,26 +414,14 @@ async function runReviewerPrompt(config, backend, targetInfo, details, diffText)
414
414
  }
415
415
 
416
416
  function readLastReviewedId(state, backend, targetInfo) {
417
- if (state.vcs && state.vcs !== backend.kind) {
418
- return null;
419
- }
420
-
421
- if (state.targetKey && state.targetKey !== targetInfo.stateKey) {
422
- return null;
423
- }
424
-
425
417
  return backend.fromStateValue(state);
426
418
  }
427
419
 
428
420
  function buildStateSnapshot(backend, targetInfo, changeId) {
429
- const state = {
430
- vcs: backend.kind,
431
- targetKey: targetInfo.stateKey,
421
+ return {
432
422
  lastReviewedId: backend.toStateValue(changeId),
433
423
  updatedAt: new Date().toISOString()
434
424
  };
435
-
436
- return backend.extendState(state, changeId);
437
425
  }
438
426
 
439
427
  async function reviewChange(config, backend, targetInfo, changeId) {
package/src/vcs-client.js CHANGED
@@ -67,21 +67,8 @@ function createSvnBackend() {
67
67
  return Number(revision);
68
68
  },
69
69
  fromStateValue(state) {
70
- if (Number.isInteger(state.lastReviewedId)) {
71
- return state.lastReviewedId;
72
- }
73
-
74
- if (Number.isInteger(state.lastReviewedRevision)) {
75
- return state.lastReviewedRevision;
76
- }
77
-
78
- return null;
79
- },
80
- extendState(state, revision) {
81
- return {
82
- ...state,
83
- lastReviewedRevision: Number(revision)
84
- };
70
+ const id = state.lastReviewedId;
71
+ return Number.isInteger(id) ? id : null;
85
72
  }
86
73
  };
87
74
  }
@@ -137,21 +124,8 @@ function createGitBackend() {
137
124
  return String(commitHash);
138
125
  },
139
126
  fromStateValue(state) {
140
- if (typeof state.lastReviewedId === "string" && state.lastReviewedId) {
141
- return state.lastReviewedId;
142
- }
143
-
144
- if (typeof state.lastReviewedCommit === "string" && state.lastReviewedCommit) {
145
- return state.lastReviewedCommit;
146
- }
147
-
148
- return null;
149
- },
150
- extendState(state, commitHash) {
151
- return {
152
- ...state,
153
- lastReviewedCommit: String(commitHash)
154
- };
127
+ const id = state.lastReviewedId;
128
+ return typeof id === "string" && id ? id : null;
155
129
  }
156
130
  };
157
131
  }