@tallyrelease/cli 0.1.1-beta.1 → 0.2.0-beta.7

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.
@@ -0,0 +1,127 @@
1
+ import { z } from "zod";
2
+ import type { Plan } from "@tallyrelease/core";
3
+ /** True only for identical types, including optional fields. */
4
+ type Equals<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? true : false;
5
+ /** Schema of `tallyrelease plan --json`, published as `plan.schema.json`. */
6
+ export declare const planSchema: z.ZodObject<{
7
+ line: z.ZodNullable<z.ZodObject<{
8
+ rule: z.ZodString;
9
+ kind: z.ZodEnum<{
10
+ default: "default";
11
+ maintenance: "maintenance";
12
+ }>;
13
+ channel: z.ZodNullable<z.ZodString>;
14
+ maxBump: z.ZodNullable<z.ZodEnum<{
15
+ patch: "patch";
16
+ minor: "minor";
17
+ }>>;
18
+ absolute: z.ZodNullable<z.ZodObject<{
19
+ unit: z.ZodNullable<z.ZodString>;
20
+ group: z.ZodNullable<z.ZodString>;
21
+ major: z.ZodNumber;
22
+ minor: z.ZodExactOptional<z.ZodNumber>;
23
+ }, z.core.$strict>>;
24
+ }, z.core.$strict>>;
25
+ units: z.ZodArray<z.ZodObject<{
26
+ id: z.ZodString;
27
+ path: z.ZodString;
28
+ plugin: z.ZodString;
29
+ scheme: z.ZodString;
30
+ tags: z.ZodArray<z.ZodString>;
31
+ group: z.ZodNullable<z.ZodString>;
32
+ affected: z.ZodNullable<z.ZodObject<{
33
+ reason: z.ZodEnum<{
34
+ direct: "direct";
35
+ dependent: "dependent";
36
+ global: "global";
37
+ all: "all";
38
+ group: "group";
39
+ }>;
40
+ via: z.ZodArray<z.ZodString>;
41
+ }, z.core.$strict>>;
42
+ kind: z.ZodEnum<{
43
+ none: "none";
44
+ rebuild: "rebuild";
45
+ prerelease: "prerelease";
46
+ }>;
47
+ baseTag: z.ZodNullable<z.ZodString>;
48
+ lineBaseTag: z.ZodNullable<z.ZodString>;
49
+ from: z.ZodNullable<z.ZodString>;
50
+ bump: z.ZodNullable<z.ZodEnum<{
51
+ patch: "patch";
52
+ major: "major";
53
+ minor: "minor";
54
+ }>>;
55
+ releaseAs: z.ZodNullable<z.ZodString>;
56
+ propagatedFrom: z.ZodArray<z.ZodString>;
57
+ absorbedFrom: z.ZodArray<z.ZodString>;
58
+ next: z.ZodNullable<z.ZodString>;
59
+ version: z.ZodNullable<z.ZodString>;
60
+ sha: z.ZodString;
61
+ changes: z.ZodArray<z.ZodObject<{
62
+ sha: z.ZodExactOptional<z.ZodString>;
63
+ type: z.ZodString;
64
+ breaking: z.ZodBoolean;
65
+ scope: z.ZodExactOptional<z.ZodString>;
66
+ subject: z.ZodString;
67
+ pr: z.ZodExactOptional<z.ZodNumber>;
68
+ via: z.ZodExactOptional<z.ZodString>;
69
+ releaseAs: z.ZodExactOptional<z.ZodString>;
70
+ }, z.core.$strict>>;
71
+ }, z.core.$strict>>;
72
+ groups: z.ZodArray<z.ZodObject<{
73
+ name: z.ZodString;
74
+ members: z.ZodArray<z.ZodString>;
75
+ baseTag: z.ZodNullable<z.ZodString>;
76
+ from: z.ZodNullable<z.ZodString>;
77
+ bump: z.ZodNullable<z.ZodEnum<{
78
+ patch: "patch";
79
+ major: "major";
80
+ minor: "minor";
81
+ }>>;
82
+ next: z.ZodNullable<z.ZodString>;
83
+ version: z.ZodNullable<z.ZodString>;
84
+ }, z.core.$strict>>;
85
+ released: z.ZodArray<z.ZodObject<{
86
+ id: z.ZodString;
87
+ path: z.ZodString;
88
+ version: z.ZodString;
89
+ tag: z.ZodString;
90
+ floatingTags: z.ZodArray<z.ZodString>;
91
+ releaseSha: z.ZodString;
92
+ catchUp: z.ZodBoolean;
93
+ pr: z.ZodNullable<z.ZodNumber>;
94
+ line: z.ZodEnum<{
95
+ default: "default";
96
+ maintenance: "maintenance";
97
+ }>;
98
+ }, z.core.$strict>>;
99
+ schema: z.ZodLiteral<1>;
100
+ tool: z.ZodString;
101
+ repo: z.ZodString;
102
+ branch: z.ZodString;
103
+ head: z.ZodString;
104
+ build: z.ZodObject<{
105
+ base: z.ZodNullable<z.ZodString>;
106
+ baseSource: z.ZodEnum<{
107
+ cli: "cli";
108
+ "push-before": "push-before";
109
+ "pr-merge-base": "pr-merge-base";
110
+ "merge-group": "merge-group";
111
+ "forge-last-success": "forge-last-success";
112
+ "local-merge-base": "local-merge-base";
113
+ none: "none";
114
+ }>;
115
+ all: z.ZodBoolean;
116
+ globalInputs: z.ZodArray<z.ZodString>;
117
+ }, z.core.$strict>;
118
+ unattributed: z.ZodArray<z.ZodString>;
119
+ warnings: z.ZodArray<z.ZodObject<{
120
+ code: z.ZodString;
121
+ message: z.ZodString;
122
+ plugin: z.ZodExactOptional<z.ZodString>;
123
+ unit: z.ZodExactOptional<z.ZodString>;
124
+ }, z.core.$strict>>;
125
+ }, z.core.$strict>;
126
+ export declare const planSchemaExact: Equals<z.infer<typeof planSchema>, Plan>;
127
+ export {};
@@ -0,0 +1,81 @@
1
+ import { z } from "zod";
2
+ import { affectedDocSchema } from "./affected-schema.js";
3
+ /* eslint-enable @typescript-eslint/no-unnecessary-type-parameters */
4
+ const bump = z.enum(["major", "minor", "patch"]);
5
+ /** Schema of `tallyrelease plan --json`, published as `plan.schema.json`. */
6
+ export const planSchema = z.strictObject({
7
+ ...affectedDocSchema.omit({ units: true }).shape,
8
+ line: z
9
+ .strictObject({
10
+ rule: z.string(),
11
+ kind: z.enum(["default", "maintenance"]),
12
+ channel: z.string().nullable(),
13
+ maxBump: z.enum(["minor", "patch"]).nullable(),
14
+ absolute: z
15
+ .strictObject({
16
+ unit: z.string().nullable(),
17
+ group: z.string().nullable(),
18
+ major: z.number(),
19
+ minor: z.number().exactOptional(),
20
+ })
21
+ .nullable(),
22
+ })
23
+ .nullable(),
24
+ units: z.array(z.strictObject({
25
+ id: z.string(),
26
+ path: z.string(),
27
+ plugin: z.string(),
28
+ scheme: z.string(),
29
+ tags: z.array(z.string()),
30
+ group: z.string().nullable(),
31
+ affected: z
32
+ .strictObject({
33
+ reason: affectedDocSchema.shape.units.element.shape.reason,
34
+ via: z.array(z.string()),
35
+ })
36
+ .nullable(),
37
+ kind: z.enum(["prerelease", "rebuild", "none"]),
38
+ baseTag: z.string().nullable(),
39
+ lineBaseTag: z.string().nullable(),
40
+ from: z.string().nullable(),
41
+ bump: bump.nullable(),
42
+ releaseAs: z.string().nullable(),
43
+ propagatedFrom: z.array(z.string()),
44
+ absorbedFrom: z.array(z.string()),
45
+ next: z.string().nullable(),
46
+ version: z.string().nullable(),
47
+ sha: z.string(),
48
+ changes: z.array(z.strictObject({
49
+ sha: z.string().exactOptional(),
50
+ type: z.string(),
51
+ breaking: z.boolean(),
52
+ scope: z.string().exactOptional(),
53
+ subject: z.string(),
54
+ pr: z.number().exactOptional(),
55
+ via: z.string().exactOptional(),
56
+ releaseAs: z.string().exactOptional(),
57
+ })),
58
+ })),
59
+ groups: z.array(z.strictObject({
60
+ name: z.string(),
61
+ members: z.array(z.string()),
62
+ baseTag: z.string().nullable(),
63
+ from: z.string().nullable(),
64
+ bump: bump.nullable(),
65
+ next: z.string().nullable(),
66
+ version: z.string().nullable(),
67
+ })),
68
+ released: z.array(z.strictObject({
69
+ id: z.string(),
70
+ path: z.string(),
71
+ version: z.string(),
72
+ tag: z.string(),
73
+ floatingTags: z.array(z.string()),
74
+ releaseSha: z.string(),
75
+ catchUp: z.boolean(),
76
+ pr: z.number().nullable(),
77
+ line: z.enum(["default", "maintenance"]),
78
+ })),
79
+ });
80
+ // Fails to compile when the schema misses or adds a field of `Plan`.
81
+ export const planSchemaExact = true;
@@ -0,0 +1,515 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "schema": {
6
+ "type": "number",
7
+ "const": 1
8
+ },
9
+ "tool": {
10
+ "type": "string"
11
+ },
12
+ "repo": {
13
+ "type": "string"
14
+ },
15
+ "branch": {
16
+ "type": "string"
17
+ },
18
+ "head": {
19
+ "type": "string"
20
+ },
21
+ "build": {
22
+ "type": "object",
23
+ "properties": {
24
+ "base": {
25
+ "type": [
26
+ "string",
27
+ "null"
28
+ ]
29
+ },
30
+ "baseSource": {
31
+ "type": "string",
32
+ "enum": [
33
+ "cli",
34
+ "push-before",
35
+ "pr-merge-base",
36
+ "merge-group",
37
+ "forge-last-success",
38
+ "local-merge-base",
39
+ "none"
40
+ ]
41
+ },
42
+ "all": {
43
+ "type": "boolean"
44
+ },
45
+ "globalInputs": {
46
+ "type": "array",
47
+ "items": {
48
+ "type": "string"
49
+ }
50
+ }
51
+ },
52
+ "required": [
53
+ "base",
54
+ "baseSource",
55
+ "all",
56
+ "globalInputs"
57
+ ],
58
+ "additionalProperties": false
59
+ },
60
+ "unattributed": {
61
+ "type": "array",
62
+ "items": {
63
+ "type": "string"
64
+ }
65
+ },
66
+ "warnings": {
67
+ "type": "array",
68
+ "items": {
69
+ "type": "object",
70
+ "properties": {
71
+ "code": {
72
+ "type": "string"
73
+ },
74
+ "message": {
75
+ "type": "string"
76
+ },
77
+ "plugin": {
78
+ "type": "string"
79
+ },
80
+ "unit": {
81
+ "type": "string"
82
+ }
83
+ },
84
+ "required": [
85
+ "code",
86
+ "message"
87
+ ],
88
+ "additionalProperties": false
89
+ }
90
+ },
91
+ "line": {
92
+ "anyOf": [
93
+ {
94
+ "type": "object",
95
+ "properties": {
96
+ "rule": {
97
+ "type": "string"
98
+ },
99
+ "kind": {
100
+ "type": "string",
101
+ "enum": [
102
+ "default",
103
+ "maintenance"
104
+ ]
105
+ },
106
+ "channel": {
107
+ "type": [
108
+ "string",
109
+ "null"
110
+ ]
111
+ },
112
+ "maxBump": {
113
+ "anyOf": [
114
+ {
115
+ "type": "string",
116
+ "enum": [
117
+ "minor",
118
+ "patch"
119
+ ]
120
+ },
121
+ {
122
+ "type": "null"
123
+ }
124
+ ]
125
+ },
126
+ "absolute": {
127
+ "anyOf": [
128
+ {
129
+ "type": "object",
130
+ "properties": {
131
+ "unit": {
132
+ "type": [
133
+ "string",
134
+ "null"
135
+ ]
136
+ },
137
+ "group": {
138
+ "type": [
139
+ "string",
140
+ "null"
141
+ ]
142
+ },
143
+ "major": {
144
+ "type": "number"
145
+ },
146
+ "minor": {
147
+ "type": "number"
148
+ }
149
+ },
150
+ "required": [
151
+ "unit",
152
+ "group",
153
+ "major"
154
+ ],
155
+ "additionalProperties": false
156
+ },
157
+ {
158
+ "type": "null"
159
+ }
160
+ ]
161
+ }
162
+ },
163
+ "required": [
164
+ "rule",
165
+ "kind",
166
+ "channel",
167
+ "maxBump",
168
+ "absolute"
169
+ ],
170
+ "additionalProperties": false
171
+ },
172
+ {
173
+ "type": "null"
174
+ }
175
+ ]
176
+ },
177
+ "units": {
178
+ "type": "array",
179
+ "items": {
180
+ "type": "object",
181
+ "properties": {
182
+ "id": {
183
+ "type": "string"
184
+ },
185
+ "path": {
186
+ "type": "string"
187
+ },
188
+ "plugin": {
189
+ "type": "string"
190
+ },
191
+ "scheme": {
192
+ "type": "string"
193
+ },
194
+ "tags": {
195
+ "type": "array",
196
+ "items": {
197
+ "type": "string"
198
+ }
199
+ },
200
+ "group": {
201
+ "type": [
202
+ "string",
203
+ "null"
204
+ ]
205
+ },
206
+ "affected": {
207
+ "anyOf": [
208
+ {
209
+ "type": "object",
210
+ "properties": {
211
+ "reason": {
212
+ "type": "string",
213
+ "enum": [
214
+ "direct",
215
+ "dependent",
216
+ "global",
217
+ "all",
218
+ "group"
219
+ ]
220
+ },
221
+ "via": {
222
+ "type": "array",
223
+ "items": {
224
+ "type": "string"
225
+ }
226
+ }
227
+ },
228
+ "required": [
229
+ "reason",
230
+ "via"
231
+ ],
232
+ "additionalProperties": false
233
+ },
234
+ {
235
+ "type": "null"
236
+ }
237
+ ]
238
+ },
239
+ "kind": {
240
+ "type": "string",
241
+ "enum": [
242
+ "prerelease",
243
+ "rebuild",
244
+ "none"
245
+ ]
246
+ },
247
+ "baseTag": {
248
+ "type": [
249
+ "string",
250
+ "null"
251
+ ]
252
+ },
253
+ "lineBaseTag": {
254
+ "type": [
255
+ "string",
256
+ "null"
257
+ ]
258
+ },
259
+ "from": {
260
+ "type": [
261
+ "string",
262
+ "null"
263
+ ]
264
+ },
265
+ "bump": {
266
+ "anyOf": [
267
+ {
268
+ "type": "string",
269
+ "enum": [
270
+ "major",
271
+ "minor",
272
+ "patch"
273
+ ]
274
+ },
275
+ {
276
+ "type": "null"
277
+ }
278
+ ]
279
+ },
280
+ "releaseAs": {
281
+ "type": [
282
+ "string",
283
+ "null"
284
+ ]
285
+ },
286
+ "propagatedFrom": {
287
+ "type": "array",
288
+ "items": {
289
+ "type": "string"
290
+ }
291
+ },
292
+ "absorbedFrom": {
293
+ "type": "array",
294
+ "items": {
295
+ "type": "string"
296
+ }
297
+ },
298
+ "next": {
299
+ "type": [
300
+ "string",
301
+ "null"
302
+ ]
303
+ },
304
+ "version": {
305
+ "type": [
306
+ "string",
307
+ "null"
308
+ ]
309
+ },
310
+ "sha": {
311
+ "type": "string"
312
+ },
313
+ "changes": {
314
+ "type": "array",
315
+ "items": {
316
+ "type": "object",
317
+ "properties": {
318
+ "sha": {
319
+ "type": "string"
320
+ },
321
+ "type": {
322
+ "type": "string"
323
+ },
324
+ "breaking": {
325
+ "type": "boolean"
326
+ },
327
+ "scope": {
328
+ "type": "string"
329
+ },
330
+ "subject": {
331
+ "type": "string"
332
+ },
333
+ "pr": {
334
+ "type": "number"
335
+ },
336
+ "via": {
337
+ "type": "string"
338
+ },
339
+ "releaseAs": {
340
+ "type": "string"
341
+ }
342
+ },
343
+ "required": [
344
+ "type",
345
+ "breaking",
346
+ "subject"
347
+ ],
348
+ "additionalProperties": false
349
+ }
350
+ }
351
+ },
352
+ "required": [
353
+ "id",
354
+ "path",
355
+ "plugin",
356
+ "scheme",
357
+ "tags",
358
+ "group",
359
+ "affected",
360
+ "kind",
361
+ "baseTag",
362
+ "lineBaseTag",
363
+ "from",
364
+ "bump",
365
+ "releaseAs",
366
+ "propagatedFrom",
367
+ "absorbedFrom",
368
+ "next",
369
+ "version",
370
+ "sha",
371
+ "changes"
372
+ ],
373
+ "additionalProperties": false
374
+ }
375
+ },
376
+ "groups": {
377
+ "type": "array",
378
+ "items": {
379
+ "type": "object",
380
+ "properties": {
381
+ "name": {
382
+ "type": "string"
383
+ },
384
+ "members": {
385
+ "type": "array",
386
+ "items": {
387
+ "type": "string"
388
+ }
389
+ },
390
+ "baseTag": {
391
+ "type": [
392
+ "string",
393
+ "null"
394
+ ]
395
+ },
396
+ "from": {
397
+ "type": [
398
+ "string",
399
+ "null"
400
+ ]
401
+ },
402
+ "bump": {
403
+ "anyOf": [
404
+ {
405
+ "type": "string",
406
+ "enum": [
407
+ "major",
408
+ "minor",
409
+ "patch"
410
+ ]
411
+ },
412
+ {
413
+ "type": "null"
414
+ }
415
+ ]
416
+ },
417
+ "next": {
418
+ "type": [
419
+ "string",
420
+ "null"
421
+ ]
422
+ },
423
+ "version": {
424
+ "type": [
425
+ "string",
426
+ "null"
427
+ ]
428
+ }
429
+ },
430
+ "required": [
431
+ "name",
432
+ "members",
433
+ "baseTag",
434
+ "from",
435
+ "bump",
436
+ "next",
437
+ "version"
438
+ ],
439
+ "additionalProperties": false
440
+ }
441
+ },
442
+ "released": {
443
+ "type": "array",
444
+ "items": {
445
+ "type": "object",
446
+ "properties": {
447
+ "id": {
448
+ "type": "string"
449
+ },
450
+ "path": {
451
+ "type": "string"
452
+ },
453
+ "version": {
454
+ "type": "string"
455
+ },
456
+ "tag": {
457
+ "type": "string"
458
+ },
459
+ "floatingTags": {
460
+ "type": "array",
461
+ "items": {
462
+ "type": "string"
463
+ }
464
+ },
465
+ "releaseSha": {
466
+ "type": "string"
467
+ },
468
+ "catchUp": {
469
+ "type": "boolean"
470
+ },
471
+ "pr": {
472
+ "type": [
473
+ "number",
474
+ "null"
475
+ ]
476
+ },
477
+ "line": {
478
+ "type": "string",
479
+ "enum": [
480
+ "default",
481
+ "maintenance"
482
+ ]
483
+ }
484
+ },
485
+ "required": [
486
+ "id",
487
+ "path",
488
+ "version",
489
+ "tag",
490
+ "floatingTags",
491
+ "releaseSha",
492
+ "catchUp",
493
+ "pr",
494
+ "line"
495
+ ],
496
+ "additionalProperties": false
497
+ }
498
+ }
499
+ },
500
+ "required": [
501
+ "schema",
502
+ "tool",
503
+ "repo",
504
+ "branch",
505
+ "head",
506
+ "build",
507
+ "unattributed",
508
+ "warnings",
509
+ "line",
510
+ "units",
511
+ "groups",
512
+ "released"
513
+ ],
514
+ "additionalProperties": false
515
+ }