dsh-diff-approval 0.19.2 → 0.20.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/lib/client.js +2782 -726
- package/lib/index.js +521 -59
- package/lib/types/client/PathPicker.d.ts +43 -0
- package/lib/types/client/PendingPanel.d.ts +13 -17
- package/lib/types/client/highlight.d.ts +51 -8
- package/lib/types/client/lang.d.ts +8 -0
- package/lib/types/client/locales.d.ts +71 -0
- package/lib/types/client/port.d.ts +11 -5
- package/lib/types/client/search.d.ts +23 -0
- package/lib/types/client/settings.d.ts +41 -0
- package/lib/types/client/slots.d.ts +13 -5
- package/lib/types/client/split-diff.d.ts +7 -5
- package/lib/types/client/store.d.ts +12 -5
- package/lib/types/client/whole-file-diff.d.ts +21 -0
- package/lib/types/client/windowed-highlight.d.ts +66 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/pending.d.ts +10 -0
- package/lib/types/types.d.ts +67 -0
- package/lib/types/vcs.d.ts +6 -0
- package/package.json +1 -1
package/lib/types/pending.d.ts
CHANGED
|
@@ -74,6 +74,16 @@ export declare class PendingDiffStore {
|
|
|
74
74
|
* @returns whether the store changed.
|
|
75
75
|
*/
|
|
76
76
|
restore(entry: PendingEntry): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Admit one entry into the list without the change guard {@link fold} applies.
|
|
79
|
+
* A listed entry may carry no diff at all: a path the user added by hand has
|
|
80
|
+
* no local change until one appears, and a fully-resolved file has already
|
|
81
|
+
* folded its diff away. This is the guard-free put {@link restore} performs,
|
|
82
|
+
* named for its other caller.
|
|
83
|
+
* @param entry - the entry to insert or replace by path.
|
|
84
|
+
* @returns whether the store changed.
|
|
85
|
+
*/
|
|
86
|
+
insert(entry: PendingEntry): boolean;
|
|
77
87
|
/**
|
|
78
88
|
* Merge persisted entries into the store, one per path after folding. A live
|
|
79
89
|
* entry wins over a persisted one only when its time is newer (folders are
|
package/lib/types/types.d.ts
CHANGED
|
@@ -123,6 +123,22 @@ export interface DiffApprovalBulkValue {
|
|
|
123
123
|
/** How many pending entries were kept/reverted (0 when the session had none). */
|
|
124
124
|
affected: number;
|
|
125
125
|
}
|
|
126
|
+
/** What one file's VCS refresh found. */
|
|
127
|
+
export type DiffApprovalRefreshOutcome =
|
|
128
|
+
/** The tracked diff was replaced with the file's current VCS change. */
|
|
129
|
+
'refreshed'
|
|
130
|
+
/** A VCS change exists but matches what the entry already tracks. */
|
|
131
|
+
| 'unchanged'
|
|
132
|
+
/** The file has no local VCS change (untracked-and-excluded, or already clean). */
|
|
133
|
+
| 'no-change'
|
|
134
|
+
/** No pending entry existed for the id. */
|
|
135
|
+
| 'missing'
|
|
136
|
+
/** The workspace is not inside a git/svn/p4 checkout. */
|
|
137
|
+
| 'no-vcs';
|
|
138
|
+
/** Value returned by the channel's vcs-refresh endpoint. */
|
|
139
|
+
export interface DiffApprovalRefreshValue {
|
|
140
|
+
outcome: DiffApprovalRefreshOutcome;
|
|
141
|
+
}
|
|
126
142
|
/** Value returned by the channel's keep and revert endpoints. */
|
|
127
143
|
export interface DiffApprovalActionValue {
|
|
128
144
|
/** What the request did; `missing` means no pending entry existed. */
|
|
@@ -133,3 +149,54 @@ export interface DiffApprovalActionValue {
|
|
|
133
149
|
* block (the entry stays listed with no pending diff). */
|
|
134
150
|
resolved?: boolean | undefined;
|
|
135
151
|
}
|
|
152
|
+
/** One row of a browsed directory level. */
|
|
153
|
+
export interface DiffApprovalBrowseEntry {
|
|
154
|
+
/** Base name inside the listed directory. */
|
|
155
|
+
name: string;
|
|
156
|
+
/** What the child is; `other` covers anything neither file nor directory. */
|
|
157
|
+
type: 'file' | 'directory' | 'other';
|
|
158
|
+
/** Absolute host path — the same value `add-path` takes, so the panel can show
|
|
159
|
+
* (and add) exactly what a row names. */
|
|
160
|
+
path: string;
|
|
161
|
+
/** Byte size, present only for a regular file the backend reports. */
|
|
162
|
+
size?: number | undefined;
|
|
163
|
+
}
|
|
164
|
+
/** Value returned by the channel's list-path endpoint: one directory level. */
|
|
165
|
+
export interface DiffApprovalBrowseValue {
|
|
166
|
+
/** The listed directory's absolute path. */
|
|
167
|
+
path: string;
|
|
168
|
+
/** Direct children: directories first, then files, each name-sorted. */
|
|
169
|
+
entries: DiffApprovalBrowseEntry[];
|
|
170
|
+
/** The response hit the entry cap, so children are missing from `entries`. */
|
|
171
|
+
truncated: boolean;
|
|
172
|
+
}
|
|
173
|
+
/** What one hand-added path did. */
|
|
174
|
+
export type DiffApprovalAddOutcome =
|
|
175
|
+
/** At least one entry landed in the list (a directory can add many). */
|
|
176
|
+
'added'
|
|
177
|
+
/** Everything scanned was already listed; nothing changed. */
|
|
178
|
+
| 'duplicate'
|
|
179
|
+
/** The path has no local VCS change and the caller did not ask to add those. */
|
|
180
|
+
| 'unchanged'
|
|
181
|
+
/** A directory scan found nothing to add and nothing was listed already. */
|
|
182
|
+
| 'empty'
|
|
183
|
+
/** The path does not exist (or is neither a file nor a directory). */
|
|
184
|
+
| 'missing'
|
|
185
|
+
/** The path lies outside the session's workspace. */
|
|
186
|
+
| 'outside'
|
|
187
|
+
/** The workspace is not inside a git/svn/p4 checkout. */
|
|
188
|
+
| 'no-vcs'
|
|
189
|
+
/** The scan itself failed; `message` carries the reason. */
|
|
190
|
+
| 'failed';
|
|
191
|
+
/** Value returned by the channel's add-path endpoint. */
|
|
192
|
+
export interface DiffApprovalAddValue {
|
|
193
|
+
outcome: DiffApprovalAddOutcome;
|
|
194
|
+
/** How many entries the add put into the list. */
|
|
195
|
+
added: number;
|
|
196
|
+
/** How many scanned paths were already listed (left untouched). */
|
|
197
|
+
duplicates: number;
|
|
198
|
+
/** Whether the no-change walk hit its file cap, so some files were not added. */
|
|
199
|
+
truncated?: boolean | undefined;
|
|
200
|
+
/** Failure detail for `outcome: 'failed'`. */
|
|
201
|
+
message?: string | undefined;
|
|
202
|
+
}
|
package/lib/types/vcs.d.ts
CHANGED
|
@@ -68,6 +68,12 @@ export interface VcsImportInput {
|
|
|
68
68
|
workspaceRoot: string;
|
|
69
69
|
/** Whether new/untracked files are imported (git `??`, svn `?`). */
|
|
70
70
|
includeUntracked: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Restrict the scan to one absolute path (a file, or a directory's subtree).
|
|
73
|
+
* Absent scans the whole workspace, which is what an import does; the review
|
|
74
|
+
* panel's per-file refresh passes the file so a large tree is not rescanned.
|
|
75
|
+
*/
|
|
76
|
+
scope?: string | undefined;
|
|
71
77
|
shell: ShellExecutorLike;
|
|
72
78
|
/** Reads working-file content (the host passes a node fs reader). */
|
|
73
79
|
readText: VcsFileReader;
|
package/package.json
CHANGED