@geonosis/release 2.0.0 → 2.1.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/{chunk-KQIWTXQP.js → chunk-MZWAN6WT.js} +1221 -919
- package/dist/index.d.ts +87 -10
- package/dist/index.js +17 -1
- package/dist/release-cli.js +68 -9
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
import { ReportEnvelope } from '@geonosis/ratchet';
|
|
2
2
|
|
|
3
|
+
type AdoptionVerdict = 'BEHIND' | 'FLOOR UNDECLARED' | 'INCOHERENT' | 'UNJUDGED';
|
|
4
|
+
type AdoptionFinding = {
|
|
5
|
+
consumer: string;
|
|
6
|
+
detail: string;
|
|
7
|
+
name: string;
|
|
8
|
+
verdict: AdoptionVerdict;
|
|
9
|
+
};
|
|
10
|
+
type AdoptionConsumer = {
|
|
11
|
+
/** How many specs naming a package of this workspace that consumer's manifests declare. */
|
|
12
|
+
declared: number;
|
|
13
|
+
findings: AdoptionFinding[];
|
|
14
|
+
name: string;
|
|
15
|
+
};
|
|
16
|
+
type AdoptionReport = {
|
|
17
|
+
considered: number;
|
|
18
|
+
consumers: AdoptionConsumer[];
|
|
19
|
+
excused: {
|
|
20
|
+
path: string;
|
|
21
|
+
reason: string;
|
|
22
|
+
}[];
|
|
23
|
+
/** The registry the current numbers came from, or undefined when they came off this workspace. */
|
|
24
|
+
registry: string | undefined;
|
|
25
|
+
versions: Record<string, string>;
|
|
26
|
+
};
|
|
27
|
+
declare const runAdoption: ({ declared, registry, root, }: {
|
|
28
|
+
declared: {
|
|
29
|
+
name: string;
|
|
30
|
+
}[];
|
|
31
|
+
registry?: string;
|
|
32
|
+
root: string;
|
|
33
|
+
}) => Promise<AdoptionReport>;
|
|
34
|
+
declare const formatAdoption: (report: AdoptionReport) => string;
|
|
35
|
+
declare const ADOPTION_TOOL = "release-adoption";
|
|
36
|
+
declare const ADOPTION_NEXT = "geonosis-release adoption --json and read `consumers` \u2014 every declared consumer leaves by exactly one door, read or excused, and a release review carries one row per consumer from it (D-061)";
|
|
37
|
+
declare const adoptionEnvelope: (report: AdoptionReport, durationMs: number) => ReportEnvelope;
|
|
38
|
+
|
|
3
39
|
/** The dialects the gate can route to. A dialect is never sniffed: it is what the repo declared. */
|
|
4
40
|
type Dialect = 'mikro-orm-ts' | 'postgres' | 'sqlite';
|
|
5
41
|
type Phase = 'down' | 'up';
|
|
@@ -40,8 +76,12 @@ type SchemaReport = {
|
|
|
40
76
|
why: string;
|
|
41
77
|
}[];
|
|
42
78
|
};
|
|
43
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* One consumer tree a release must be read against, how that one is installed, and the commands
|
|
81
|
+
* that are ITS gates when the three script names are not what that tree calls them.
|
|
82
|
+
*/
|
|
44
83
|
type SmokeSnapshotConfig = {
|
|
84
|
+
commands?: Partial<Record<'doctor' | 'lint' | 'typecheck', string>>;
|
|
45
85
|
install?: string;
|
|
46
86
|
name: string;
|
|
47
87
|
};
|
|
@@ -398,9 +438,17 @@ type Command = {
|
|
|
398
438
|
};
|
|
399
439
|
type SmokePhase = 'doctor' | 'lint' | 'typecheck';
|
|
400
440
|
declare const PHASES: SmokePhase[];
|
|
441
|
+
/** Where the source tree stood, or the sentence saying why nothing here could say. */
|
|
442
|
+
type RecordedCommit = {
|
|
443
|
+
sha: string;
|
|
444
|
+
} | {
|
|
445
|
+
why: string;
|
|
446
|
+
};
|
|
401
447
|
type SnapshotRecord = {
|
|
402
448
|
at: string;
|
|
403
449
|
bytes: number;
|
|
450
|
+
/** Absent in a recording taken before this was recorded at all. */
|
|
451
|
+
commit?: RecordedCommit;
|
|
404
452
|
commands: Record<SmokePhase, Command>;
|
|
405
453
|
excluded: string[];
|
|
406
454
|
files: number;
|
|
@@ -413,6 +461,8 @@ type SnapshotRecord = {
|
|
|
413
461
|
}[];
|
|
414
462
|
name: string;
|
|
415
463
|
};
|
|
464
|
+
/** git asked in THEIR tree, and only ever asked: law 5 forbids this tool writing a byte there. */
|
|
465
|
+
declare const headOf: (from: string) => RecordedCommit;
|
|
416
466
|
declare const snapshotDir: (root: string, name: string) => string;
|
|
417
467
|
declare const readSnapshot: (root: string, name: string) => SnapshotRecord;
|
|
418
468
|
type SnapshotInput = {
|
|
@@ -490,6 +540,7 @@ declare const rewriteManifests: (tree: string, manifests: string[], packed: Pack
|
|
|
490
540
|
path: string;
|
|
491
541
|
}[];
|
|
492
542
|
type RunInput = {
|
|
543
|
+
commands?: Partial<Record<SmokePhase, string>>;
|
|
493
544
|
install?: string;
|
|
494
545
|
name: string;
|
|
495
546
|
rc?: string;
|
|
@@ -499,16 +550,42 @@ declare const recordBaseline: (input: RunInput) => SmokeBaseline;
|
|
|
499
550
|
declare const readBaseline: (root: string, name: string) => SmokeBaseline;
|
|
500
551
|
declare const compareToBaseline: (name: string, baseline: SmokeBaseline, outcomes: PhaseOutcome[], findings: string[]) => SmokeComparison;
|
|
501
552
|
declare const runSmoke: (input: RunInput) => SmokeComparison;
|
|
502
|
-
|
|
553
|
+
/**
|
|
554
|
+
* What the sweep can say about WHEN a recording was taken: that its source has moved on, or that
|
|
555
|
+
* the question cannot be asked of it at all.
|
|
556
|
+
*/
|
|
557
|
+
type SweepNote = {
|
|
558
|
+
stale: string;
|
|
559
|
+
} | {
|
|
560
|
+
undated: string;
|
|
561
|
+
};
|
|
562
|
+
/** One declared consumer's turn in the sweep, in the order the repo declared it. */
|
|
563
|
+
type SweepEntry = {
|
|
564
|
+
comparison: SmokeComparison;
|
|
565
|
+
name: string;
|
|
566
|
+
note?: SweepNote;
|
|
567
|
+
} | {
|
|
503
568
|
name: string;
|
|
504
569
|
why: string;
|
|
505
570
|
};
|
|
506
571
|
type SmokeSweep = {
|
|
507
|
-
|
|
508
|
-
skipped: SmokeSkip[];
|
|
572
|
+
entries: SweepEntry[];
|
|
509
573
|
};
|
|
574
|
+
type WantedSnapshot = {
|
|
575
|
+
commands?: Partial<Record<SmokePhase, string>>;
|
|
576
|
+
install?: string;
|
|
577
|
+
name: string;
|
|
578
|
+
};
|
|
579
|
+
/**
|
|
580
|
+
* Where a consumer tree that has never been recorded lives on THIS machine.
|
|
581
|
+
*
|
|
582
|
+
* A never-recorded name has no `from` to look at, so the paths are declared here — uncommitted,
|
|
583
|
+
* under the directory D-048 already keeps out of git, because a machine's checkout layout is one
|
|
584
|
+
* developer's and not the repo's.
|
|
585
|
+
*/
|
|
586
|
+
declare const CONSUMER_TREES_FILE = ".geonosis/consumer-trees.local.json";
|
|
510
587
|
/**
|
|
511
|
-
* Every snapshot the release expects, read in turn.
|
|
588
|
+
* Every snapshot the release expects, read in turn, in the order the repo declared them.
|
|
512
589
|
*
|
|
513
590
|
* A tree that is not on this machine is SKIPPED with the sentence saying so — a laptop without the
|
|
514
591
|
* consumer trees must not fail, it must say what it could not ask. The skip is not free: its three
|
|
@@ -516,6 +593,8 @@ type SmokeSweep = {
|
|
|
516
593
|
* read as a sweep that asked everything.
|
|
517
594
|
*/
|
|
518
595
|
declare const sweepSmoke: (input: {
|
|
596
|
+
/** Declared names this run is excused from reading, each said out loud on the command line. */
|
|
597
|
+
absent?: string[];
|
|
519
598
|
rc?: string;
|
|
520
599
|
root: string;
|
|
521
600
|
/**
|
|
@@ -524,11 +603,9 @@ declare const sweepSmoke: (input: {
|
|
|
524
603
|
* has to be answered, not stepped around.
|
|
525
604
|
*/
|
|
526
605
|
skipMissing: boolean;
|
|
527
|
-
wanted:
|
|
528
|
-
install?: string;
|
|
529
|
-
name: string;
|
|
530
|
-
}[];
|
|
606
|
+
wanted: WantedSnapshot[];
|
|
531
607
|
}) => SmokeSweep;
|
|
608
|
+
declare const comparisonsIn: (sweep: SmokeSweep) => SmokeComparison[];
|
|
532
609
|
declare const formatSweep: (sweep: SmokeSweep) => string;
|
|
533
610
|
declare const sweepEnvelope: (sweep: SmokeSweep, durationMs: number) => ReportEnvelope;
|
|
534
611
|
declare const formatSmoke: (comparison: SmokeComparison) => string;
|
|
@@ -579,4 +656,4 @@ declare const statementsOf: (sql: string) => string;
|
|
|
579
656
|
/** One refusal per verb per file, at the line of that verb's first occurrence. */
|
|
580
657
|
declare const refusalsIn: (path: string, body: string, firstLine?: number) => Refusal[];
|
|
581
658
|
|
|
582
|
-
export { BASELINE_FILE, type Command, DEFAULT_REGISTRY, DEPLOYED_FILE, type Declared, type Deployed, type DeployedReport, type Dialect, type Drift, EXCLUDED_DIRS, EXISTS_BUT, type Manager, type MigrationDir, type MigrationsReport, NARROWING, NOTHING_SAYS, PHASES, PLANTS, type Packed, type Phase, type PhaseOutcome, type PlanReport, type ProveOutcome, type PublishedLine, type PublishedReport, type PublishedVerdict, type Refusal, type RegistryAnswer, type ReleaseConfig, Runner, SMOKE_NEXT, SMOKE_TOOL, SNAPSHOTS_DIR, STEPS, type SchemaConfig, type SchemaDomain, type SchemaFinding, type SchemaReport, type SmokeBaseline, type SmokeComparison, type SmokePhase, type
|
|
659
|
+
export { ADOPTION_NEXT, ADOPTION_TOOL, type AdoptionConsumer, type AdoptionFinding, type AdoptionReport, type AdoptionVerdict, BASELINE_FILE, CONSUMER_TREES_FILE, type Command, DEFAULT_REGISTRY, DEPLOYED_FILE, type Declared, type Deployed, type DeployedReport, type Dialect, type Drift, EXCLUDED_DIRS, EXISTS_BUT, type Manager, type MigrationDir, type MigrationsReport, NARROWING, NOTHING_SAYS, PHASES, PLANTS, type Packed, type Phase, type PhaseOutcome, type PlanReport, type ProveOutcome, type PublishedLine, type PublishedReport, type PublishedVerdict, type RecordedCommit, type Refusal, type RegistryAnswer, type ReleaseConfig, Runner, SMOKE_NEXT, SMOKE_TOOL, SNAPSHOTS_DIR, STEPS, type SchemaConfig, type SchemaDomain, type SchemaFinding, type SchemaReport, type SmokeBaseline, type SmokeComparison, type SmokePhase, type SmokeSweep, type SnapshotRecord, type SweepEntry, type SweepNote, type Verdict, WHY_VERSION_IDENTITY, type WantedSnapshot, addSqlIn, adoptionEnvelope, askRegistry, censusOf, compareToBaseline, comparisonsIn, declaredIn, driftBetween, formatAdoption, formatBaseline, formatDeployed, formatMigrations, formatPlan, formatProve, formatPublished, formatSchema, formatSmoke, formatSnapshot, formatSweep, formatVerdict, headOf, markersIn, packRc, parseJsonc, parseReleaseConfig, parseToml, promisedButNotPacked, prove, proveOver, readBaseline, readDeployed, readReleaseConfig, readSnapshot, readWrangler, recordBaseline, refusalsIn, registryPathOf, rewriteManifests, runAdoption, runDeployed, runMigrations, runPlan, runPublished, runSchema, runSmoke, runSnapshot, smokeEnvelope, snapshotDir, statementsOf, sweepEnvelope, sweepSmoke };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ADOPTION_NEXT,
|
|
3
|
+
ADOPTION_TOOL,
|
|
2
4
|
BASELINE_FILE,
|
|
5
|
+
CONSUMER_TREES_FILE,
|
|
3
6
|
DEFAULT_REGISTRY,
|
|
4
7
|
DEPLOYED_FILE,
|
|
5
8
|
EXCLUDED_DIRS,
|
|
@@ -15,11 +18,14 @@ import {
|
|
|
15
18
|
STEPS,
|
|
16
19
|
WHY_VERSION_IDENTITY,
|
|
17
20
|
addSqlIn,
|
|
21
|
+
adoptionEnvelope,
|
|
18
22
|
askRegistry,
|
|
19
23
|
censusOf,
|
|
20
24
|
compareToBaseline,
|
|
25
|
+
comparisonsIn,
|
|
21
26
|
declaredIn,
|
|
22
27
|
driftBetween,
|
|
28
|
+
formatAdoption,
|
|
23
29
|
formatBaseline,
|
|
24
30
|
formatDeployed,
|
|
25
31
|
formatMigrations,
|
|
@@ -31,6 +37,7 @@ import {
|
|
|
31
37
|
formatSnapshot,
|
|
32
38
|
formatSweep,
|
|
33
39
|
formatVerdict,
|
|
40
|
+
headOf,
|
|
34
41
|
markersIn,
|
|
35
42
|
packRc,
|
|
36
43
|
parseJsonc,
|
|
@@ -48,6 +55,7 @@ import {
|
|
|
48
55
|
refusalsIn,
|
|
49
56
|
registryPathOf,
|
|
50
57
|
rewriteManifests,
|
|
58
|
+
runAdoption,
|
|
51
59
|
runDeployed,
|
|
52
60
|
runMigrations,
|
|
53
61
|
runPlan,
|
|
@@ -60,9 +68,12 @@ import {
|
|
|
60
68
|
statementsOf,
|
|
61
69
|
sweepEnvelope,
|
|
62
70
|
sweepSmoke
|
|
63
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-MZWAN6WT.js";
|
|
64
72
|
export {
|
|
73
|
+
ADOPTION_NEXT,
|
|
74
|
+
ADOPTION_TOOL,
|
|
65
75
|
BASELINE_FILE,
|
|
76
|
+
CONSUMER_TREES_FILE,
|
|
66
77
|
DEFAULT_REGISTRY,
|
|
67
78
|
DEPLOYED_FILE,
|
|
68
79
|
EXCLUDED_DIRS,
|
|
@@ -78,11 +89,14 @@ export {
|
|
|
78
89
|
STEPS,
|
|
79
90
|
WHY_VERSION_IDENTITY,
|
|
80
91
|
addSqlIn,
|
|
92
|
+
adoptionEnvelope,
|
|
81
93
|
askRegistry,
|
|
82
94
|
censusOf,
|
|
83
95
|
compareToBaseline,
|
|
96
|
+
comparisonsIn,
|
|
84
97
|
declaredIn,
|
|
85
98
|
driftBetween,
|
|
99
|
+
formatAdoption,
|
|
86
100
|
formatBaseline,
|
|
87
101
|
formatDeployed,
|
|
88
102
|
formatMigrations,
|
|
@@ -94,6 +108,7 @@ export {
|
|
|
94
108
|
formatSnapshot,
|
|
95
109
|
formatSweep,
|
|
96
110
|
formatVerdict,
|
|
111
|
+
headOf,
|
|
97
112
|
markersIn,
|
|
98
113
|
packRc,
|
|
99
114
|
parseJsonc,
|
|
@@ -111,6 +126,7 @@ export {
|
|
|
111
126
|
refusalsIn,
|
|
112
127
|
registryPathOf,
|
|
113
128
|
rewriteManifests,
|
|
129
|
+
runAdoption,
|
|
114
130
|
runDeployed,
|
|
115
131
|
runMigrations,
|
|
116
132
|
runPlan,
|
package/dist/release-cli.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ADOPTION_NEXT,
|
|
2
3
|
CannotRun,
|
|
3
4
|
DEFAULT_REGISTRY,
|
|
4
5
|
MIGRATIONS_NEXT,
|
|
5
6
|
PUBLISHED_NEXT,
|
|
6
7
|
SCHEMA_NEXT,
|
|
7
8
|
SMOKE_NEXT,
|
|
9
|
+
adoptionEnvelope,
|
|
10
|
+
comparisonsIn,
|
|
11
|
+
formatAdoption,
|
|
8
12
|
formatBaseline,
|
|
9
13
|
formatDeployed,
|
|
10
14
|
formatMigrations,
|
|
@@ -21,6 +25,7 @@ import {
|
|
|
21
25
|
publishedEnvelope,
|
|
22
26
|
readReleaseConfig,
|
|
23
27
|
recordBaseline,
|
|
28
|
+
runAdoption,
|
|
24
29
|
runDeployed,
|
|
25
30
|
runMigrations,
|
|
26
31
|
runPlan,
|
|
@@ -31,7 +36,7 @@ import {
|
|
|
31
36
|
sweepEnvelope,
|
|
32
37
|
sweepSmoke,
|
|
33
38
|
writeEnvelope
|
|
34
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-MZWAN6WT.js";
|
|
35
40
|
|
|
36
41
|
// src/release-cli.ts
|
|
37
42
|
import { existsSync } from "fs";
|
|
@@ -101,6 +106,18 @@ var USAGE = `geonosis-release <command> [options]
|
|
|
101
106
|
|
|
102
107
|
Exit 0 the whole group is there, 1 a gap, 2 the registry could not be asked.
|
|
103
108
|
|
|
109
|
+
adoption [--registry <url>] [--root <dir>] [--json]
|
|
110
|
+
|
|
111
|
+
How far every declared consumer is from the version this workspace holds, read off
|
|
112
|
+
the recordings the smoke keeps and never off a consumer's disk. Per consumer: MATCH,
|
|
113
|
+
BEHIND <name> <declared> \u2192 <current>, INCOHERENT (a group published as one number
|
|
114
|
+
declared at two), FLOOR UNDECLARED (informational \u2014 a floor is opted into).
|
|
115
|
+
|
|
116
|
+
--registry compares against what npm answers instead of against this workspace.
|
|
117
|
+
|
|
118
|
+
Exit 0 always: it is a report, and the release review carries one row per consumer
|
|
119
|
+
from it (D-061).
|
|
120
|
+
|
|
104
121
|
smoke snapshot <name> --from <their tree> [--replace] [--root <dir>] [--json]
|
|
105
122
|
[--typecheck <cmd>] [--lint <cmd>] [--doctor <cmd>]
|
|
106
123
|
|
|
@@ -113,7 +130,8 @@ var USAGE = `geonosis-release <command> [options]
|
|
|
113
130
|
them be committed.
|
|
114
131
|
|
|
115
132
|
smoke baseline --snapshot <name> [--rc-dir <workspace>] [--install <cmd>] [--json]
|
|
116
|
-
smoke run --snapshot <name> [--rc-dir <workspace>] [--install <cmd>]
|
|
133
|
+
smoke run [--snapshot <name>] [--absent <name>]... [--rc-dir <workspace>] [--install <cmd>]
|
|
134
|
+
[--json]
|
|
117
135
|
|
|
118
136
|
Pack every workspace package of the release candidate (\`pnpm pack\` \u2014 a tarball is
|
|
119
137
|
what a consumer installs, and a release that shipped no declarations shipped them in
|
|
@@ -125,8 +143,15 @@ var USAGE = `geonosis-release <command> [options]
|
|
|
125
143
|
\`run\` compares against it and refuses only what THIS release broke, in their
|
|
126
144
|
compiler's and their doctor's own lines. Exit 0 nothing new, 1 a new failure,
|
|
127
145
|
2 the run could not be made \u2014 including a phase the baseline cannot be compared to.
|
|
146
|
+
|
|
147
|
+
With no --snapshot it sweeps every consumer geonosis.json declares, one block each in
|
|
148
|
+
declaration order. A declared name with no recording whose tree is on this machine \u2014
|
|
149
|
+
named in .geonosis/consumer-trees.local.json, uncommitted \u2014 REFUSES with the snapshot
|
|
150
|
+
command to run; --absent <name> excuses one out loud and keeps it in the count. A
|
|
151
|
+
recording whose source tree has moved since it was taken prints STALE.
|
|
128
152
|
`;
|
|
129
153
|
var VALUED = /* @__PURE__ */ new Set([
|
|
154
|
+
"--absent",
|
|
130
155
|
"--dialect",
|
|
131
156
|
"--doctor",
|
|
132
157
|
"--from",
|
|
@@ -144,6 +169,7 @@ var VALUED = /* @__PURE__ */ new Set([
|
|
|
144
169
|
var FLAGS = /* @__PURE__ */ new Set(["--check", "--group", "--i-accept-an-unproven-smoke", "--json", "--replace"]);
|
|
145
170
|
var DIALECTS = /* @__PURE__ */ new Set(["mikro-orm-ts", "postgres", "sqlite"]);
|
|
146
171
|
var parseArgs = (argv) => {
|
|
172
|
+
const many = {};
|
|
147
173
|
const read = {};
|
|
148
174
|
const flags = /* @__PURE__ */ new Set();
|
|
149
175
|
const rest = [];
|
|
@@ -163,9 +189,10 @@ var parseArgs = (argv) => {
|
|
|
163
189
|
const value = argv[index + 1];
|
|
164
190
|
if (value === void 0 || value.startsWith("--")) throw new CannotRun(`${flag} needs a value`);
|
|
165
191
|
read[flag] = value;
|
|
192
|
+
many[flag] = [...many[flag] ?? [], value];
|
|
166
193
|
index += 1;
|
|
167
194
|
}
|
|
168
|
-
return { command: argv[0] ?? "", flags, json, read, rest };
|
|
195
|
+
return { command: argv[0] ?? "", flags, json, many, read, rest };
|
|
169
196
|
};
|
|
170
197
|
var rootOf = (parsed, cwd) => resolve(cwd, parsed.read["--root"] ?? cwd);
|
|
171
198
|
var migrations = (parsed, cwd) => {
|
|
@@ -281,6 +308,28 @@ var published = async (parsed, cwd) => {
|
|
|
281
308
|
if (report.unreachable > 0) return 2;
|
|
282
309
|
return report.ok ? 0 : 1;
|
|
283
310
|
};
|
|
311
|
+
var adoption = async (parsed, cwd) => {
|
|
312
|
+
const root = rootOf(parsed, cwd);
|
|
313
|
+
const startedAt = Date.now();
|
|
314
|
+
const registry = parsed.read["--registry"];
|
|
315
|
+
const report = await runAdoption({
|
|
316
|
+
declared: readReleaseConfig(root).smoke?.snapshots ?? [],
|
|
317
|
+
...registry === void 0 ? {} : { registry },
|
|
318
|
+
root
|
|
319
|
+
});
|
|
320
|
+
process.stdout.write(
|
|
321
|
+
parsed.json ? `${JSON.stringify(report, void 0, 2)}
|
|
322
|
+
` : formatAdoption(report)
|
|
323
|
+
);
|
|
324
|
+
const at = writeEnvelope({
|
|
325
|
+
envelope: adoptionEnvelope(report, Date.now() - startedAt),
|
|
326
|
+
next: ADOPTION_NEXT,
|
|
327
|
+
root
|
|
328
|
+
});
|
|
329
|
+
if (!parsed.json) process.stdout.write(`envelope: ${at}
|
|
330
|
+
`);
|
|
331
|
+
return 0;
|
|
332
|
+
};
|
|
284
333
|
var namedCommands = (parsed) => ({
|
|
285
334
|
...parsed.read["--doctor"] === void 0 ? {} : { doctor: parsed.read["--doctor"] },
|
|
286
335
|
...parsed.read["--lint"] === void 0 ? {} : { lint: parsed.read["--lint"] },
|
|
@@ -315,7 +364,11 @@ var wantedSnapshots = (parsed, root) => {
|
|
|
315
364
|
const install = parsed.read["--install"];
|
|
316
365
|
const withFlag = (one) => {
|
|
317
366
|
const chosen = install ?? one.install;
|
|
318
|
-
return {
|
|
367
|
+
return {
|
|
368
|
+
...one.commands === void 0 ? {} : { commands: one.commands },
|
|
369
|
+
...chosen === void 0 ? {} : { install: chosen },
|
|
370
|
+
name: one.name
|
|
371
|
+
};
|
|
319
372
|
};
|
|
320
373
|
if (named === void 0) return configured.map(withFlag);
|
|
321
374
|
return [withFlag(configured.find((one) => one.name === named) ?? { name: named })];
|
|
@@ -336,6 +389,7 @@ var baseline = (parsed, root, cwd) => {
|
|
|
336
389
|
}
|
|
337
390
|
const rc = parsed.read["--rc-dir"];
|
|
338
391
|
const recorded = recordBaseline({
|
|
392
|
+
...one.commands === void 0 ? {} : { commands: one.commands },
|
|
339
393
|
...one.install === void 0 ? {} : { install: one.install },
|
|
340
394
|
name: one.name,
|
|
341
395
|
...rc === void 0 ? {} : { rc: resolve(cwd, rc) },
|
|
@@ -356,6 +410,7 @@ var smokeRun = (parsed, root, cwd) => {
|
|
|
356
410
|
);
|
|
357
411
|
}
|
|
358
412
|
const swept = sweepSmoke({
|
|
413
|
+
absent: parsed.many["--absent"] ?? [],
|
|
359
414
|
rc: rcOf(parsed, root, cwd),
|
|
360
415
|
root,
|
|
361
416
|
skipMissing: parsed.read["--snapshot"] === void 0,
|
|
@@ -372,8 +427,9 @@ var smokeRun = (parsed, root, cwd) => {
|
|
|
372
427
|
});
|
|
373
428
|
if (!parsed.json) process.stdout.write(`envelope: ${at}
|
|
374
429
|
`);
|
|
375
|
-
|
|
376
|
-
|
|
430
|
+
const comparisons = comparisonsIn(swept);
|
|
431
|
+
if (comparisons.some((one) => one.refused.length > 0)) return 2;
|
|
432
|
+
return comparisons.every((one) => one.ok) ? 0 : 1;
|
|
377
433
|
};
|
|
378
434
|
var smoke = (parsed, cwd) => {
|
|
379
435
|
const root = rootOf(parsed, cwd);
|
|
@@ -397,8 +453,10 @@ geonosis.json \u2192 "release" every key optional; a repo that configured n
|
|
|
397
453
|
sessionVariables string[]? the session variable names DDL may name
|
|
398
454
|
smoke object? the consumer trees this release is read against
|
|
399
455
|
exclude string[]? what a snapshot leaves behind, beyond the built and the installed
|
|
400
|
-
snapshots Entry[]? { name, install? } \u2014 the recorded snapshot,
|
|
401
|
-
tree is installed with when the manager's default is not it
|
|
456
|
+
snapshots Entry[]? { name, install?, commands? } \u2014 the recorded snapshot, the command
|
|
457
|
+
that tree is installed with when the manager's default is not it,
|
|
458
|
+
and { doctor?, lint?, typecheck? } when their gates are not the
|
|
459
|
+
scripts of those names
|
|
402
460
|
secrets string[]? the secret names a deployment carries
|
|
403
461
|
steps string[]? the release steps
|
|
404
462
|
workers string[]? the workers it deploys
|
|
@@ -431,8 +489,9 @@ var main = async () => {
|
|
|
431
489
|
if (parsed.command === "prove") return proving(parsed, process.cwd());
|
|
432
490
|
if (parsed.command === "deployed") return deployed(parsed, process.cwd());
|
|
433
491
|
if (parsed.command === "published") return published(parsed, process.cwd());
|
|
492
|
+
if (parsed.command === "adoption") return adoption(parsed, process.cwd());
|
|
434
493
|
throw new CannotRun(
|
|
435
|
-
`no command called "${parsed.command}" \u2014 this bin has migrations, plan, prove, deployed, published`
|
|
494
|
+
`no command called "${parsed.command}" \u2014 this bin has migrations, schema, plan, prove, deployed, published, adoption, smoke`
|
|
436
495
|
);
|
|
437
496
|
};
|
|
438
497
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geonosis/release",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"types": "./dist/index.d.ts",
|
|
5
5
|
"description": "The release contract with its proofs: an expand-only migration gate over three dialects, a smoke that must name the version that answered it, and declared ≠ deployed.",
|
|
6
6
|
"keywords": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"squawk-cli": "2.63.0",
|
|
48
|
-
"@geonosis/ratchet": "2.
|
|
48
|
+
"@geonosis/ratchet": "2.1.0"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
51
|
"node": ">=22"
|