@dialecte/cli 0.11.0 → 0.12.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/dist/lookups.d.ts CHANGED
@@ -104,12 +104,13 @@ declare function runApi(params: {
104
104
  declare function packagesText(indexes: readonly ApiJson[]): string;
105
105
 
106
106
  /** The host seam's constants, the same for every host. */
107
+
107
108
  /** The names of the known host vendors: what the config key `host` is checked against (`config/` imports this, never a vendor). */
108
109
  declare const HOST_VENDOR_NAMES: readonly ["github"];
109
110
  /** The adapter methods a live probe may call: reads only (a probe never writes). */
110
- declare const HOST_READ_METHODS: readonly ["readChangeRequest", "readChecks", "readQueued", "probeStacks"];
111
+ declare const HOST_READ_METHODS: readonly ["readChangeRequest", "readChecks", "readQueued", "readQueueKind", "probeStacks"];
111
112
 
112
- /** A pull request on the host, as a landing reads it. */
113
+ /** A change request on the host, as a landing reads it. */
113
114
  type ChangeRequest = {
114
115
  number: number;
115
116
  url: string;
@@ -118,7 +119,7 @@ type ChangeRequest = {
118
119
  body: string;
119
120
  state: 'open' | 'merged' | 'closed';
120
121
  draft: boolean;
121
- /** True while the host merges it once its checks pass: auto-merge on, or in the merge queue. */
122
+ /** True while the host merges it once its checks pass: auto-merge on, or in the queue. */
122
123
  queued: boolean;
123
124
  /** The commit its head branch pointed at (the last push). */
124
125
  head: string;
@@ -127,24 +128,24 @@ type ChangeRequest = {
127
128
  /** The page of its changed files, which `lot review` prints; absent when the host gives none (its `url` is then printed). */
128
129
  filesUrl?: string;
129
130
  };
130
- /** Whether the host links pull requests into stacks here, and why not when it does not. */
131
+ /** Whether the host links change requests into stacks here, and why not when it does not. */
131
132
  type StackSupport = {
132
133
  stacks: true;
133
134
  } | {
134
135
  stacks: false;
135
136
  why: string;
136
137
  };
137
- /** How the checks on a pull request's head stand: all passed, one failed, one still running, or none at all. */
138
+ /** How the checks on a change request's head stand: all passed, one failed, one still running, or none at all. */
138
139
  type ChecksState = 'green' | 'failing' | 'pending' | 'none';
139
- /** The checks on a pull request's head: their state and the names of the failing and the pending ones. */
140
+ /** The checks on a change request's head: their state and the names of the failing and the pending ones. */
140
141
  type ChangeRequestChecks = {
141
- /** The commit the checks ran on (the pull request's head). */
142
+ /** The commit the checks ran on (the change request's head). */
142
143
  head: string;
143
144
  state: ChecksState;
144
145
  failing: string[];
145
146
  pending: string[];
146
147
  };
147
- /** A line comment of a pull request's review: on a file, at a line when it has one; a reply names what it answers. */
148
+ /** A line comment of a change request's review: on a file, at a line when it has one; a reply names what it answers. */
148
149
  type ReviewComment = {
149
150
  id: number;
150
151
  path: string;
@@ -153,6 +154,18 @@ type ReviewComment = {
153
154
  /** The comment this one answers in its thread; absent for a thread's first comment. */
154
155
  replyTo?: number;
155
156
  };
157
+ /** How a vendor names its change requests in printed text; the keys are the placeholders a message fills. */
158
+ type HostNouns = {
159
+ changeRequestNoun: string;
160
+ changeRequestNouns: string;
161
+ };
162
+ /** How the host merges a change request once its checks pass: a queue (merge queue, merge train), auto-merge, or neither. */
163
+ type QueueKind = 'queue' | 'auto-merge' | 'none';
164
+ /** The queue the change request's base offers, and the vendor's word for it. */
165
+ type QueueSupport = {
166
+ kind: QueueKind;
167
+ noun: string;
168
+ };
156
169
  /** A host operation's refusal: git's or the host tool's first line. */
157
170
  type HostRefusal = {
158
171
  refusal: string;
@@ -162,12 +175,12 @@ type HostRefusal = {
162
175
  * repository at `root`; none prompts.
163
176
  */
164
177
  type HostAdapter = {
165
- /** The pull request `ref` names (a number, or a branch: its newest); undefined when there is none. */
178
+ /** The change request `ref` names (a number, or a branch: its newest); undefined when there is none. */
166
179
  readChangeRequest(params: {
167
180
  root: string;
168
181
  ref: string;
169
182
  }): ChangeRequest | undefined | HostRefusal;
170
- /** A new pull request of `branch` into `base`. */
183
+ /** A new change request of `branch` into `base`. */
171
184
  openChangeRequest(params: {
172
185
  root: string;
173
186
  branch: string;
@@ -176,26 +189,26 @@ type HostAdapter = {
176
189
  body: string;
177
190
  draft: boolean;
178
191
  }): ChangeRequest | HostRefusal;
179
- /** The pull request's title and body replaced by `title` and `body`. */
192
+ /** The change request's title and body replaced by `title` and `body`. */
180
193
  editChangeRequest(params: {
181
194
  root: string;
182
195
  number: number;
183
196
  title: string;
184
197
  body: string;
185
198
  }): HostRefusal | undefined;
186
- /** The pull request closed: taken out of the merge queue, never merged. */
199
+ /** The change request closed: taken out of the queue, never merged. */
187
200
  closeChangeRequest(params: {
188
201
  root: string;
189
202
  number: number;
190
203
  }): HostRefusal | undefined;
191
- /** The pull request queued: merged by the host once its checks pass (a draft made ready first). */
204
+ /** The change request queued: merged by the host once its checks pass (a draft made ready first). */
192
205
  queueChangeRequest(params: {
193
206
  root: string;
194
207
  number: number;
195
208
  draft: boolean;
196
209
  }): HostRefusal | undefined;
197
210
  /**
198
- * The pull request taken back out of the queue: auto-merge turned off when `queued`, made a draft when not `draft`
211
+ * The change request taken back out of the queue: auto-merge turned off when `queued`, made a draft when not `draft`
199
212
  * (an approval is for one head); nothing asked when it is a draft not queued.
200
213
  */
201
214
  draftChangeRequest(params: {
@@ -205,8 +218,8 @@ type HostAdapter = {
205
218
  draft: boolean;
206
219
  }): HostRefusal | undefined;
207
220
  /**
208
- * Whether the host merges the pull request once its checks pass: auto-merge on, or in the merge queue (which a
209
- * pull request read cannot say).
221
+ * Whether the host merges the change request once its checks pass: auto-merge on, or in the queue (which a
222
+ * change request read cannot say).
210
223
  */
211
224
  readQueued(params: {
212
225
  root: string;
@@ -214,26 +227,31 @@ type HostAdapter = {
214
227
  }): {
215
228
  queued: boolean;
216
229
  } | HostRefusal;
217
- /** The checks on the pull request's head. */
230
+ /** The queue the change request's base offers (a queue, auto-merge or neither), named in the vendor's word. */
231
+ readQueueKind(params: {
232
+ root: string;
233
+ number: number;
234
+ }): QueueSupport | HostRefusal;
235
+ /** The checks on the change request's head. */
218
236
  readChecks(params: {
219
237
  root: string;
220
238
  number: number;
221
239
  }): ChangeRequestChecks | HostRefusal;
222
- /** The line comments of the pull request's reviews, oldest first. */
240
+ /** The line comments of the change request's reviews, oldest first. */
223
241
  readReviewComments(params: {
224
242
  root: string;
225
243
  number: number;
226
244
  }): ReviewComment[] | HostRefusal;
227
- /** The pull request's changed files opened in the browser (`url` is the pull request's page). */
245
+ /** The change request's changed files opened in the browser (`url` is the change request's page). */
228
246
  openFiles(params: {
229
247
  root: string;
230
248
  url: string;
231
249
  }): HostRefusal | undefined;
232
- /** Whether the host links pull requests into stacks here (33CI CI4); no network asked. */
250
+ /** Whether the host links change requests into stacks here (33CI CI4); no network asked. */
233
251
  probeStacks(params: {
234
252
  root: string;
235
253
  }): StackSupport;
236
- /** The pull request at `child` (its url) linked on top of the one at `parent` as a stack. */
254
+ /** The change request at `child` (its url) linked on top of the one at `parent` as a stack. */
237
255
  linkStack(params: {
238
256
  root: string;
239
257
  parent: string;
@@ -248,7 +266,7 @@ type HostAdapter = {
248
266
  number: number;
249
267
  draft: boolean;
250
268
  }): HostRefusal | undefined;
251
- /** The pull request's base branch changed to `base`. */
269
+ /** The change request's base branch changed to `base`. */
252
270
  retargetChangeRequest(params: {
253
271
  root: string;
254
272
  number: number;
@@ -290,11 +308,19 @@ type HostVendor<Calls extends HostCallTable, Subject extends keyof Calls> = {
290
308
  tool: string;
291
309
  /** The hosts of an origin that mean this vendor (lower-case). */
292
310
  remoteHosts: readonly string[];
311
+ /** Its change-request nouns, for printed text. */
312
+ nouns: HostNouns;
313
+ /** Where a repository of this vendor keeps its change-request template. */
314
+ changeRequestTemplate: string;
315
+ /** Its change-request noun as words of an identifier, lower case (a compound joined: `pullrequest`). */
316
+ nounWords: readonly string[];
317
+ /** Its change-request noun in a file's path. */
318
+ nounPathPattern: RegExp;
293
319
  /** The calls the adapter makes, by name. */
294
320
  calls: Calls;
295
321
  /** The versions of the tool the record was taken from, by part (the keys `describe.versionOf` takes). */
296
322
  recordedVersions: Readonly<Record<string, string>>;
297
- /** The read that finds the pull request the other probes read, and its probe. */
323
+ /** The read that finds the change request the other probes read, and its probe. */
298
324
  subject: {
299
325
  call: Calls[Subject]['kind'] extends 'write' ? never : Subject;
300
326
  find: HostSubjectProbe<Calls>;
@@ -423,7 +449,7 @@ type HostToolRun<Calls extends HostCallTable = HostCallTable> = {
423
449
  }['bivarianceHack'];
424
450
  /**
425
451
  * One live probe of a read call: its line, whose subject is `subject` (the probe's key in the vendor's table);
426
- * `pullRequest` is the one the vendor's subject probe found, when it did.
452
+ * `changeRequest` is the one the vendor's subject probe found, when it did.
427
453
  */
428
454
  type HostProbe<Calls extends HostCallTable = HostCallTable> = (params: {
429
455
  root: string;
@@ -433,8 +459,8 @@ type HostProbe<Calls extends HostCallTable = HostCallTable> = (params: {
433
459
  changeRequest?: number;
434
460
  }) => HostLine;
435
461
  /**
436
- * The probe of the read that finds the pull request the other probes read: its line (its subject `subject`, the
437
- * read's name), and the pull request found.
462
+ * The probe of the read that finds the change request the other probes read: its line (its subject `subject`, the
463
+ * read's name), and the change request found.
438
464
  */
439
465
  type HostSubjectProbe<Calls extends HostCallTable = HostCallTable> = (params: {
440
466
  root: string;