@plexus-ms/lib 0.127.0 → 0.129.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/bookkeeping.d.ts +0 -4
- package/dist/bookkeeping.d.ts.map +1 -1
- package/dist/bookkeeping.js +0 -4
- package/dist/bookkeeping.js.map +1 -1
- package/dist/compose.d.ts +14 -0
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +14 -0
- package/dist/compose.js.map +1 -1
- package/dist/conflicts.d.ts +12 -0
- package/dist/conflicts.d.ts.map +1 -0
- package/dist/conflicts.js +48 -0
- package/dist/conflicts.js.map +1 -0
- package/dist/consumers.d.ts +20 -0
- package/dist/consumers.d.ts.map +1 -1
- package/dist/consumers.js +34 -2
- package/dist/consumers.js.map +1 -1
- package/dist/copier.d.ts +2 -0
- package/dist/copier.d.ts.map +1 -1
- package/dist/copier.js +10 -2
- package/dist/copier.js.map +1 -1
- package/dist/deploy.d.ts +38 -0
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +194 -15
- package/dist/deploy.js.map +1 -1
- package/dist/deployTargets.d.ts +22 -5
- package/dist/deployTargets.d.ts.map +1 -1
- package/dist/deployTargets.js +53 -13
- package/dist/deployTargets.js.map +1 -1
- package/dist/doctor.d.ts +4 -2
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +19 -1
- package/dist/doctor.js.map +1 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/io.d.ts +6 -0
- package/dist/io.d.ts.map +1 -1
- package/dist/io.js +19 -0
- package/dist/io.js.map +1 -1
- package/dist/marker.d.ts.map +1 -1
- package/dist/marker.js +4 -2
- package/dist/marker.js.map +1 -1
- package/dist/overview.d.ts +13 -0
- package/dist/overview.d.ts.map +1 -1
- package/dist/overview.js +35 -2
- package/dist/overview.js.map +1 -1
- package/dist/pull.d.ts +153 -0
- package/dist/pull.d.ts.map +1 -0
- package/dist/pull.js +431 -0
- package/dist/pull.js.map +1 -0
- package/dist/recursive.d.ts +8 -0
- package/dist/recursive.d.ts.map +1 -0
- package/dist/recursive.js +60 -0
- package/dist/recursive.js.map +1 -0
- package/dist/standard-index.json +8 -1
- package/dist/summary.d.ts +35 -1
- package/dist/summary.d.ts.map +1 -1
- package/dist/summary.js +95 -8
- package/dist/summary.js.map +1 -1
- package/dist/take.d.ts +54 -43
- package/dist/take.d.ts.map +1 -1
- package/dist/take.js +152 -181
- package/dist/take.js.map +1 -1
- package/dist/update.d.ts +59 -2
- package/dist/update.d.ts.map +1 -1
- package/dist/update.js +146 -58
- package/dist/update.js.map +1 -1
- package/package.json +1 -1
- package/dist/propagate.d.ts +0 -16
- package/dist/propagate.d.ts.map +0 -1
- package/dist/propagate.js +0 -51
- package/dist/propagate.js.map +0 -1
package/dist/pull.d.ts
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { type Consumer } from './consumers.ts';
|
|
2
|
+
import type { Context } from './context.ts';
|
|
3
|
+
export declare const versionBranch: (version: string) => string;
|
|
4
|
+
/** The answer of the repo templates that names who reviews the version's pull requests. */
|
|
5
|
+
export declare const REVIEWERS_ANSWER = "pr_reviewers";
|
|
6
|
+
/**
|
|
7
|
+
* The user logins a comma-separated value names, in order, once each; blank
|
|
8
|
+
* for none. plx takes letters, digits and hyphens; a team (`org/team`) and
|
|
9
|
+
* anything else is refused, naming where it came from.
|
|
10
|
+
*/
|
|
11
|
+
export declare function parseReviewers(value: string, what: string): string[];
|
|
12
|
+
/** The reviewers a repo's root answers name; none when they name none. */
|
|
13
|
+
export declare function reviewersOf(answers: Record<string, unknown>): string[];
|
|
14
|
+
/** The request for reviews from users on a pull request, by its number, in the repo `cwd` belongs to. */
|
|
15
|
+
export declare const requestReviews: (number: number, logins: string[], cwd: string) => import("./effects.ts").Step;
|
|
16
|
+
/** The pull request to open: the version branch against `base`, with its body. */
|
|
17
|
+
export interface PullRequest {
|
|
18
|
+
base: string;
|
|
19
|
+
version: string;
|
|
20
|
+
body: string;
|
|
21
|
+
/** Asked for as a draft. */
|
|
22
|
+
draft: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Open the version's pull request, as a draft when one is asked for. A forge
|
|
26
|
+
* that refuses the draft, for whatever reason, is asked once more for the
|
|
27
|
+
* same pull request as an ordinary one, and the run says so; when that fails
|
|
28
|
+
* too, the error names both attempts. Resolves with whether it is a draft.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createPull(ctx: Context, name: string, req: PullRequest, cwd: string): Promise<boolean>;
|
|
31
|
+
/** The version's pull request as the forge lists it, in any state. */
|
|
32
|
+
export interface Pull {
|
|
33
|
+
url: string;
|
|
34
|
+
number: number;
|
|
35
|
+
draft: boolean;
|
|
36
|
+
/** Open, or closed or merged by a human: a closed one stays closed. */
|
|
37
|
+
open: boolean;
|
|
38
|
+
/** Who opened it: the App in CI, a maintainer's own login by hand. */
|
|
39
|
+
author?: string;
|
|
40
|
+
/** Its head commit: the branch's tip while it is open, the tip it had when it was closed. */
|
|
41
|
+
head?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The pull request from the version branch against the consumer's branch:
|
|
45
|
+
* the open one if there is one, else a closed or merged one whose head commit
|
|
46
|
+
* is `tip`, the branch's tip on origin, the highest numbered if several are.
|
|
47
|
+
* A closed one of an earlier branch of the same name, deleted since and
|
|
48
|
+
* pushed again, is not this branch's; nor is one from another repository (a
|
|
49
|
+
* fork's branch of that name). Undefined when there is none; a forge that
|
|
50
|
+
* cannot be asked is an error, never "none".
|
|
51
|
+
*/
|
|
52
|
+
export declare function pullOf(ctx: Context, consumer: Consumer, dir: string, version: string, tip?: string): Promise<Pull | undefined>;
|
|
53
|
+
/** What asking for reviews came to. */
|
|
54
|
+
export type Review = {
|
|
55
|
+
requested: string[];
|
|
56
|
+
} | {
|
|
57
|
+
failed: string;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Who is asked to review: the logins named (`--reviewer`), or the root
|
|
61
|
+
* answers file as the pull request's branch has it, after copier ran at every
|
|
62
|
+
* site, whose `pr_reviewers` is read, and checked, only when a pull request is
|
|
63
|
+
* opened.
|
|
64
|
+
*/
|
|
65
|
+
export type Reviewers = {
|
|
66
|
+
named: string[];
|
|
67
|
+
} | {
|
|
68
|
+
answersFile: string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Ask the users for a review of the pull request, once; none asked, nothing
|
|
72
|
+
* done. The request is one call for every login, so its author, who opened
|
|
73
|
+
* it (a maintainer running the verb by hand who is among the reviewers), is
|
|
74
|
+
* left out first, and the narration says so.
|
|
75
|
+
*/
|
|
76
|
+
export declare function askForReviews(ctx: Context, name: string, pull: Pull, from: Reviewers, cwd: string): Promise<Review | undefined>;
|
|
77
|
+
/** The hash of the branch's tip as origin has it, from `git ls-remote`. */
|
|
78
|
+
export declare function tipOnOrigin(ctx: Context, repo: string, branch: string): Promise<string>;
|
|
79
|
+
/** What a pull request's body says, as data. */
|
|
80
|
+
export interface PullState {
|
|
81
|
+
version: string;
|
|
82
|
+
/** The sites, relative to the repo (`.` for its root). */
|
|
83
|
+
sites: string[];
|
|
84
|
+
/** Sites where copier left a conflict. */
|
|
85
|
+
conflicted?: string[];
|
|
86
|
+
/** Tracked files that hold a conflict marker, relative to the repo. */
|
|
87
|
+
marked: string[];
|
|
88
|
+
/** Sites whose copier run failed, left as they were. */
|
|
89
|
+
failed?: string[];
|
|
90
|
+
/** Sites whose answers do not record the version: copier did not run there. */
|
|
91
|
+
behind?: string[];
|
|
92
|
+
/** The opening run: the lockfile refresh failed. A later run: run `pnpm install` and commit the lockfile. */
|
|
93
|
+
lockfile?: boolean;
|
|
94
|
+
/** Written by a later run from what it checked at the branch's tip, not by the run that opened it. */
|
|
95
|
+
checked?: boolean;
|
|
96
|
+
/** The last line: who opened it and why, or that a later run rewrote it. */
|
|
97
|
+
note: string;
|
|
98
|
+
}
|
|
99
|
+
/** Whether anything in the state needs a hand. */
|
|
100
|
+
export declare const needsAHand: (p: PullState) => boolean;
|
|
101
|
+
/**
|
|
102
|
+
* The copier update a human runs at a site to bring it to the version: the
|
|
103
|
+
* copier plx pins, at that version, never the newest tag (which, once a newer
|
|
104
|
+
* version is cut, would leave the site behind for good); trusted, as plx runs
|
|
105
|
+
* it; the questions answered already not asked again. Unlike plx's own run,
|
|
106
|
+
* new questions are asked and the template's tasks run: it is a developer's
|
|
107
|
+
* checkout.
|
|
108
|
+
*/
|
|
109
|
+
export declare const byHand: (version: string) => string;
|
|
110
|
+
/** The body: what needs a hand first, then what the pull request is. */
|
|
111
|
+
export declare function pullBody(p: PullState): string;
|
|
112
|
+
/** What a later run found of a pull request on origin, and did to it. */
|
|
113
|
+
export interface Revisited {
|
|
114
|
+
url: string;
|
|
115
|
+
/** Tracked files of the branch that hold a conflict marker. */
|
|
116
|
+
marked: string[];
|
|
117
|
+
/** Sites of the branch whose answers do not record the version. */
|
|
118
|
+
behind: string[];
|
|
119
|
+
/** Ready to merge once its checks pass: no longer a draft, no marker left, every site at the version. */
|
|
120
|
+
mergeable: boolean;
|
|
121
|
+
/** Why the rewrite or the change of state failed, when one did. */
|
|
122
|
+
failed?: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* A later run over the version's pull request, open on origin: the branch's
|
|
126
|
+
* tip read as origin has it (`readTip`), the body rewritten to what it found
|
|
127
|
+
* there, and the pull request ready when no tracked file holds a conflict
|
|
128
|
+
* marker and every site records the version, a draft again while either
|
|
129
|
+
* fails. Under a dry run it changes nothing and says what it would do.
|
|
130
|
+
*/
|
|
131
|
+
export declare function revisit(ctx: Context, consumer: Consumer, pull: Pull, version: string, tip: string): Promise<Revisited>;
|
|
132
|
+
/** What a later run that opened the missing pull request came to. */
|
|
133
|
+
export interface OpenedLate {
|
|
134
|
+
/** Undefined under a dry run, or when the forge did not list what it opened. */
|
|
135
|
+
pull?: Pull;
|
|
136
|
+
/** A dry run: the pull request it would have opened. */
|
|
137
|
+
previewed?: true;
|
|
138
|
+
marked: string[];
|
|
139
|
+
behind: string[];
|
|
140
|
+
/** No marker, and every site at the version. */
|
|
141
|
+
ready: boolean;
|
|
142
|
+
review?: Review;
|
|
143
|
+
failed?: string;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* A later run that finds the version branch on origin and no pull request of
|
|
147
|
+
* it opens one: the branch's tip read as origin has it (`readTip`), a draft
|
|
148
|
+
* unless no tracked file holds a conflict marker and every site records the
|
|
149
|
+
* version, with the review request. Under a dry run it opens nothing and says
|
|
150
|
+
* that it would.
|
|
151
|
+
*/
|
|
152
|
+
export declare function openLate(ctx: Context, consumer: Consumer, version: string, reviewers: Reviewers | undefined, tip: string): Promise<OpenedLate>;
|
|
153
|
+
//# sourceMappingURL=pull.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../src/pull.ts"],"names":[],"mappings":"AAkDA,OAAO,EAAE,KAAK,QAAQ,EAAe,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAK5C,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,KAAG,MAA6B,CAAC;AAE9E,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAUpE;AAYD,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CAItE;AAED,yGAAyG;AACzG,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,EAAE,EAAE,KAAK,MAAM,gCAWzE,CAAC;AAEJ,kFAAkF;AAClF,MAAM,WAAW,WA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,CAC3B,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,SAAS,CAAC,CA0CpB;AAKD,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,gFAAgF;IAChF,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,wDAAwD;IACxD,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,gDAAgD;IAChD,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAC5B,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,UAAU,CAAC,CA4CrB"}
|
package/dist/pull.js
ADDED
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
// pull: the version's pull request (§ 3 PLX-Updates), on `plexus/<version>`
|
|
2
|
+
// against the branch the version lands on. take.ts opens it; a later run
|
|
3
|
+
// that finds the branch on origin with the pull request open comes back to it
|
|
4
|
+
// here (`revisit`).
|
|
5
|
+
//
|
|
6
|
+
// A pull request that needs a hand is asked for as a draft, and its body
|
|
7
|
+
// opens with what needs it: the sites that conflicted, the tracked files that
|
|
8
|
+
// hold conflict markers (conflicts.ts), the sites whose copier run failed,
|
|
9
|
+
// and, when the lockfile did not refresh, that `pnpm install` is to be run
|
|
10
|
+
// after resolving. Where the forge refuses a draft, the same pull request is
|
|
11
|
+
// opened as an ordinary one, and the run says so; it needs a hand all the
|
|
12
|
+
// same. One that needs none is ready for review.
|
|
13
|
+
//
|
|
14
|
+
// The branch is never moved by any run, and plx never pushes to it again: it
|
|
15
|
+
// is the human's from the moment it is on origin. A later run, scheduled or
|
|
16
|
+
// manual, reads it as origin has it: its tip's hash from `git ls-remote`, and
|
|
17
|
+
// that commit fetched by hash with no ref, no FETCH_HEAD and no
|
|
18
|
+
// remote-tracking ref written, so no checkout and no ref of the repo is
|
|
19
|
+
// touched, under a dry run as in a real one. At the tip it checks two things:
|
|
20
|
+
// that no tracked file holds a conflict marker, and that every site the tip
|
|
21
|
+
// holds records the version in its answers (`_commit`); a site that does not
|
|
22
|
+
// is one copier did not run at. Both hold: the pull request is ready. It
|
|
23
|
+
// writes the body afresh for what it checked (it never reads the body), and
|
|
24
|
+
// marks the pull request ready, or a draft again while either fails; a forge
|
|
25
|
+
// that refuses the draft leaves it ordinary, which the run says and does not
|
|
26
|
+
// count as a failure of its own. Whether the refresh of the lockfile failed is
|
|
27
|
+
// not known then, so the body asks for `pnpm install` and the lockfile
|
|
28
|
+
// wherever the tip holds one and the pull request is not ready, or the branch
|
|
29
|
+
// holds commits beyond the one plx made (somebody resolved by hand); plx's
|
|
30
|
+
// commit is told from the others by the count of commits the forge says the
|
|
31
|
+
// branch is ahead of the one the version lands on. Whether the pull request is
|
|
32
|
+
// ready to merge is read from its draft state and the tip, never from its
|
|
33
|
+
// body.
|
|
34
|
+
//
|
|
35
|
+
// A later run that finds the branch with no pull request in any state
|
|
36
|
+
// (opening failed after the push) opens the pull request then (`openLate`),
|
|
37
|
+
// ready or a draft by the same check, with the review request; a closed or
|
|
38
|
+
// merged one is left as it is, a human's decision. A closed one counts only
|
|
39
|
+
// when it was closed at the tip origin has now: one of an earlier branch of
|
|
40
|
+
// the name, deleted and pushed again, is not this branch's, and neither is
|
|
41
|
+
// one from a fork's branch of the name.
|
|
42
|
+
//
|
|
43
|
+
// The review is requested once, when plx opens the pull request, draft or
|
|
44
|
+
// not, from the users the root answers name as the pull request's branch has
|
|
45
|
+
// them, after copier ran at every site (`pr_reviewers`, a
|
|
46
|
+
// comma-separated string of GitHub user logins, empty or absent for none), or
|
|
47
|
+
// those `--reviewer` names instead; nothing more when it is marked ready.
|
|
48
|
+
// Users only: a team is refused. The request is one call for all of them, so
|
|
49
|
+
// the pull request's author is left out of it, and the run says so.
|
|
50
|
+
import { filesWithConflictMarkers } from "./conflicts.js";
|
|
51
|
+
import { sitesOfTree } from "./consumers.js";
|
|
52
|
+
import { ANSWERS_FILE, copierVia, parseAnswers } from "./copier.js";
|
|
53
|
+
import { run } from "./effects.js";
|
|
54
|
+
import { detailOf } from "./io.js";
|
|
55
|
+
export const versionBranch = (version) => `plexus/${version}`;
|
|
56
|
+
/** The answer of the repo templates that names who reviews the version's pull requests. */
|
|
57
|
+
export const REVIEWERS_ANSWER = 'pr_reviewers';
|
|
58
|
+
/**
|
|
59
|
+
* The user logins a comma-separated value names, in order, once each; blank
|
|
60
|
+
* for none. plx takes letters, digits and hyphens; a team (`org/team`) and
|
|
61
|
+
* anything else is refused, naming where it came from.
|
|
62
|
+
*/
|
|
63
|
+
export function parseReviewers(value, what) {
|
|
64
|
+
const logins = value
|
|
65
|
+
.split(',')
|
|
66
|
+
.map((l) => l.trim())
|
|
67
|
+
.filter(Boolean);
|
|
68
|
+
for (const login of logins) {
|
|
69
|
+
if (login.includes('/'))
|
|
70
|
+
throw new Error(`${what} names \`${login}\`, a team; only users are requested`);
|
|
71
|
+
if (!/^[A-Za-z0-9-]+$/.test(login))
|
|
72
|
+
throw new Error(`${what} names \`${login}\`, not a GitHub user login`);
|
|
73
|
+
}
|
|
74
|
+
return [...new Set(logins)];
|
|
75
|
+
}
|
|
76
|
+
/** A root answers file's answers; a file that is not YAML, or empty, is refused with what it is. */
|
|
77
|
+
function answersOf(text) {
|
|
78
|
+
if (text.trim() === '')
|
|
79
|
+
throw new Error(`the root ${ANSWERS_FILE} is empty or missing`);
|
|
80
|
+
try {
|
|
81
|
+
return parseAnswers(text).answers;
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
throw new Error(`the root ${ANSWERS_FILE} cannot be read: ${error.message.split('\n')[0]}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/** The reviewers a repo's root answers name; none when they name none. */
|
|
88
|
+
export function reviewersOf(answers) {
|
|
89
|
+
const value = answers[REVIEWERS_ANSWER];
|
|
90
|
+
if (value === undefined || value === null)
|
|
91
|
+
return [];
|
|
92
|
+
return parseReviewers(String(value), `the answer ${REVIEWERS_ANSWER}`);
|
|
93
|
+
}
|
|
94
|
+
/** The request for reviews from users on a pull request, by its number, in the repo `cwd` belongs to. */
|
|
95
|
+
export const requestReviews = (number, logins, cwd) => run('gh', [
|
|
96
|
+
'api',
|
|
97
|
+
`repos/{owner}/{repo}/pulls/${number}/requested_reviewers`,
|
|
98
|
+
'--method',
|
|
99
|
+
'POST',
|
|
100
|
+
...logins.flatMap((l) => ['-f', `reviewers[]=${l}`]),
|
|
101
|
+
], { cwd });
|
|
102
|
+
/**
|
|
103
|
+
* Open the version's pull request, as a draft when one is asked for. A forge
|
|
104
|
+
* that refuses the draft, for whatever reason, is asked once more for the
|
|
105
|
+
* same pull request as an ordinary one, and the run says so; when that fails
|
|
106
|
+
* too, the error names both attempts. Resolves with whether it is a draft.
|
|
107
|
+
*/
|
|
108
|
+
export async function createPull(ctx, name, req, cwd) {
|
|
109
|
+
const create = (draft) => run('gh', [
|
|
110
|
+
'pr',
|
|
111
|
+
'create',
|
|
112
|
+
...(draft ? ['--draft'] : []),
|
|
113
|
+
'--base',
|
|
114
|
+
req.base,
|
|
115
|
+
'--head',
|
|
116
|
+
versionBranch(req.version),
|
|
117
|
+
'--title',
|
|
118
|
+
`chore: Plexus ${req.version}`,
|
|
119
|
+
'--body',
|
|
120
|
+
req.body,
|
|
121
|
+
], { cwd });
|
|
122
|
+
if (!req.draft) {
|
|
123
|
+
await ctx.apply([create(false)]);
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
try {
|
|
127
|
+
await ctx.apply([create(true)]);
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
catch (refused) {
|
|
131
|
+
try {
|
|
132
|
+
await ctx.apply([create(false)]);
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
throw new Error(`as a draft: ${detailOf(refused) || 'refused'}; as an ordinary one: ${detailOf(error) || 'refused'}`);
|
|
136
|
+
}
|
|
137
|
+
ctx.say(`• ${name}: the pull request is no draft: the forge refused one${detailOf(refused) ? ` (${detailOf(refused)})` : ''}`);
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/** How many pull requests of the version branch plx asks the forge for; none relies on gh's default. */
|
|
142
|
+
const LISTED = 1000;
|
|
143
|
+
/**
|
|
144
|
+
* The pull request from the version branch against the consumer's branch:
|
|
145
|
+
* the open one if there is one, else a closed or merged one whose head commit
|
|
146
|
+
* is `tip`, the branch's tip on origin, the highest numbered if several are.
|
|
147
|
+
* A closed one of an earlier branch of the same name, deleted since and
|
|
148
|
+
* pushed again, is not this branch's; nor is one from another repository (a
|
|
149
|
+
* fork's branch of that name). Undefined when there is none; a forge that
|
|
150
|
+
* cannot be asked is an error, never "none".
|
|
151
|
+
*/
|
|
152
|
+
export async function pullOf(ctx, consumer, dir, version, tip) {
|
|
153
|
+
const args = ['pr', 'list', '--head', versionBranch(version), '--base', consumer.branch, '--state', 'all'];
|
|
154
|
+
const fields = 'url,number,isDraft,state,author,headRefOid,isCrossRepository';
|
|
155
|
+
const out = await ctx.read('gh', [...args, '--limit', String(LISTED), '--json', fields], { cwd: dir });
|
|
156
|
+
let listed;
|
|
157
|
+
try {
|
|
158
|
+
listed = JSON.parse(out);
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
throw new Error(`gh pr list gave no JSON for ${versionBranch(version)}`);
|
|
162
|
+
}
|
|
163
|
+
if (!Array.isArray(listed))
|
|
164
|
+
throw new Error(`gh pr list gave no list for ${versionBranch(version)}`);
|
|
165
|
+
const pulls = listed.flatMap((p) => {
|
|
166
|
+
if (typeof p !== 'object' || p === null)
|
|
167
|
+
return [];
|
|
168
|
+
const { url, number, isDraft, state, author, headRefOid, isCrossRepository } = p;
|
|
169
|
+
if (typeof url !== 'string' || typeof number !== 'number' || isCrossRepository !== false)
|
|
170
|
+
return [];
|
|
171
|
+
const login = author?.login;
|
|
172
|
+
return [
|
|
173
|
+
{
|
|
174
|
+
url,
|
|
175
|
+
number,
|
|
176
|
+
draft: isDraft === true,
|
|
177
|
+
open: state === 'OPEN',
|
|
178
|
+
...(typeof login === 'string' ? { author: login } : {}),
|
|
179
|
+
...(typeof headRefOid === 'string' ? { head: headRefOid } : {}),
|
|
180
|
+
},
|
|
181
|
+
];
|
|
182
|
+
});
|
|
183
|
+
const open = pulls.find((p) => p.open);
|
|
184
|
+
if (open)
|
|
185
|
+
return open;
|
|
186
|
+
return pulls.filter((p) => tip !== undefined && p.head === tip).sort((a, b) => b.number - a.number)[0];
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Ask the users for a review of the pull request, once; none asked, nothing
|
|
190
|
+
* done. The request is one call for every login, so its author, who opened
|
|
191
|
+
* it (a maintainer running the verb by hand who is among the reviewers), is
|
|
192
|
+
* left out first, and the narration says so.
|
|
193
|
+
*/
|
|
194
|
+
export async function askForReviews(ctx, name, pull, from, cwd) {
|
|
195
|
+
let named;
|
|
196
|
+
try {
|
|
197
|
+
named = 'named' in from ? from.named : reviewersOf(answersOf(from.answersFile));
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
const why = error.message;
|
|
201
|
+
ctx.say(` ✗ FAILED — ${name}: no review requested: ${why}`);
|
|
202
|
+
return { failed: why };
|
|
203
|
+
}
|
|
204
|
+
const author = pull.author?.toLowerCase();
|
|
205
|
+
const reviewers = named.filter((l) => l.toLowerCase() !== author);
|
|
206
|
+
if (reviewers.length < named.length)
|
|
207
|
+
ctx.say(`• ${name}: ${pull.author} opened the pull request and is not asked to review it`);
|
|
208
|
+
if (reviewers.length === 0)
|
|
209
|
+
return undefined;
|
|
210
|
+
try {
|
|
211
|
+
await ctx.apply([requestReviews(pull.number, reviewers, cwd)]);
|
|
212
|
+
return { requested: reviewers };
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
const why = detailOf(error);
|
|
216
|
+
ctx.say(` ✗ FAILED — ${name}: review request from ${reviewers.join(', ')}${why ? `: ${why}` : ''}`);
|
|
217
|
+
return { failed: why || 'the forge refused it' };
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
/** The hash of the branch's tip as origin has it, from `git ls-remote`. */
|
|
221
|
+
export async function tipOnOrigin(ctx, repo, branch) {
|
|
222
|
+
const tip = (await ctx.read('git', ['ls-remote', '--heads', 'origin', `refs/heads/${branch}`], { cwd: repo }))
|
|
223
|
+
.split('\t')[0]
|
|
224
|
+
?.trim();
|
|
225
|
+
if (!tip)
|
|
226
|
+
throw new Error(`origin no longer has ${branch}`);
|
|
227
|
+
return tip;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* The commit's objects, fetched by hash with no ref, no FETCH_HEAD and no
|
|
231
|
+
* remote-tracking ref written. A later run needs the tip's tree only: in a
|
|
232
|
+
* shallow clone (CI's checkout) the tip comes alone, never the branch's
|
|
233
|
+
* history; a full clone is never made shallow by it.
|
|
234
|
+
*/
|
|
235
|
+
async function fetchTip(ctx, repo, tip) {
|
|
236
|
+
const shallow = (await ctx.read('git', ['rev-parse', '--is-shallow-repository'], { cwd: repo })).trim() === 'true';
|
|
237
|
+
// By hash, with no refmap: only the objects arrive; a fetch by name would move origin's remote-tracking ref.
|
|
238
|
+
await ctx.read('git', ['fetch', '--quiet', '--no-write-fetch-head', '--refmap=', ...(shallow ? ['--depth', '1'] : []), 'origin', tip], { cwd: repo });
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* How many commits the tip is ahead of the branch it is to land on, as the
|
|
242
|
+
* forge counts them (`ahead_by` of its compare, from their merge base, the
|
|
243
|
+
* count a pull request lists), never from local history, which a shallow or
|
|
244
|
+
* single-branch clone does not hold.
|
|
245
|
+
*/
|
|
246
|
+
async function aheadOf(ctx, consumer, tip) {
|
|
247
|
+
const out = await ctx.read('gh', ['api', `repos/{owner}/{repo}/compare/${consumer.branch}...${tip}`, '--jq', '.ahead_by'], { cwd: consumer.path });
|
|
248
|
+
const ahead = Number(out.trim());
|
|
249
|
+
if (out.trim() === '' || !Number.isInteger(ahead))
|
|
250
|
+
throw new Error(`the forge gave no count of commits for ${tip}`);
|
|
251
|
+
return ahead;
|
|
252
|
+
}
|
|
253
|
+
/** Whether anything in the state needs a hand. */
|
|
254
|
+
export const needsAHand = (p) => (p.conflicted?.length ?? 0) > 0 ||
|
|
255
|
+
p.marked.length > 0 ||
|
|
256
|
+
(p.failed?.length ?? 0) > 0 ||
|
|
257
|
+
(p.behind?.length ?? 0) > 0 ||
|
|
258
|
+
(p.lockfile === true && !p.checked);
|
|
259
|
+
const code = (s) => `\`${s}\``;
|
|
260
|
+
/**
|
|
261
|
+
* The copier update a human runs at a site to bring it to the version: the
|
|
262
|
+
* copier plx pins, at that version, never the newest tag (which, once a newer
|
|
263
|
+
* version is cut, would leave the site behind for good); trusted, as plx runs
|
|
264
|
+
* it; the questions answered already not asked again. Unlike plx's own run,
|
|
265
|
+
* new questions are asked and the template's tasks run: it is a developer's
|
|
266
|
+
* checkout.
|
|
267
|
+
*/
|
|
268
|
+
export const byHand = (version) => ['mise', ...copierVia(['update', '--trust', '--skip-answered', '--vcs-ref', version])].join(' ');
|
|
269
|
+
const site = (s) => (s === '.' ? 'the root' : code(s));
|
|
270
|
+
/** The body: what needs a hand first, then what the pull request is. */
|
|
271
|
+
export function pullBody(p) {
|
|
272
|
+
const hand = [
|
|
273
|
+
...(p.conflicted?.length
|
|
274
|
+
? [`- Conflicts at ${p.conflicted.map(site).join(', ')}, committed with their markers.`]
|
|
275
|
+
: []),
|
|
276
|
+
...(p.marked.length ? [`- Files that hold conflict markers: ${p.marked.map(code).join(', ')}.`] : []),
|
|
277
|
+
...(p.failed?.length
|
|
278
|
+
? [`- \`copier update\` failed at ${p.failed.map(site).join(', ')}, left as it was; run it there by hand.`]
|
|
279
|
+
: []),
|
|
280
|
+
...(p.behind ?? []).map((s) => `- The answers at ${site(s)} do not record ${p.version}: copier did not run here. On this branch, in ${site(s)}, run \`${byHand(p.version)}\` and commit what it changes.`),
|
|
281
|
+
...(p.lockfile && !p.checked
|
|
282
|
+
? ['- The lockfile did not refresh: run `pnpm install` after resolving, and commit the lockfile.']
|
|
283
|
+
: []),
|
|
284
|
+
];
|
|
285
|
+
// A later run cannot know whether the refresh failed; it asks for one where the branch may need it.
|
|
286
|
+
const lockfile = p.lockfile && p.checked ? ['- Run `pnpm install` once resolved, and commit the lockfile.'] : [];
|
|
287
|
+
// Ready, there is nothing left to resolve: the same request without the condition.
|
|
288
|
+
const settled = lockfile.length ? ['- Run `pnpm install`, and commit the lockfile if it changes.'] : [];
|
|
289
|
+
const head = hand.length > 0
|
|
290
|
+
? `**Needs a hand.** \`plx update\` marks this pull request ready once no tracked file holds a conflict marker and every site's answers record the version.\n\n${[...hand, ...lockfile].join('\n')}`
|
|
291
|
+
: p.checked
|
|
292
|
+
? `Ready for review: no tracked file holds a conflict marker, and every site's answers record ${p.version}.${settled.length ? `\n\n${settled.join('\n')}` : ''}`
|
|
293
|
+
: 'Nothing needs a hand: every site merged clean.';
|
|
294
|
+
return [
|
|
295
|
+
head,
|
|
296
|
+
`Plexus ${p.version} (§ 1.5 PLX): \`copier update\` at ${p.sites.map(site).join(', ')}, the lockfile where manifests moved, and the workflow refs.`,
|
|
297
|
+
p.note,
|
|
298
|
+
].join('\n\n');
|
|
299
|
+
}
|
|
300
|
+
/** The last line of a body a later run rewrote. */
|
|
301
|
+
const REVISITED = "Opened by `plx update`; rewritten by a later run from what it found at the branch's tip.";
|
|
302
|
+
/**
|
|
303
|
+
* The version branch's tip, read by hash: the detector over its tracked
|
|
304
|
+
* files, and its sites, every answers file it holds that names a template,
|
|
305
|
+
* each at the version or not. The lockfile is asked for where the tip holds
|
|
306
|
+
* one and the pull request is not ready, or holds commits beyond the one plx
|
|
307
|
+
* made (somebody resolved by hand), as the forge counts them (`aheadOf`).
|
|
308
|
+
*/
|
|
309
|
+
async function readTip(ctx, consumer, version, tip) {
|
|
310
|
+
const repo = consumer.path;
|
|
311
|
+
await fetchTip(ctx, repo, tip);
|
|
312
|
+
const marked = await filesWithConflictMarkers(ctx, repo, tip);
|
|
313
|
+
const { files, sites: held } = await sitesOfTree(ctx, repo, tip);
|
|
314
|
+
const sites = held.map((s) => s.dir);
|
|
315
|
+
const behind = held.filter((s) => s.answers?.commit !== version).map((s) => s.dir);
|
|
316
|
+
const ready = marked.length === 0 && behind.length === 0;
|
|
317
|
+
// Somebody pushed to the branch: more commits than the one plx made. Asked only when it decides something.
|
|
318
|
+
const lockfile = files.includes('pnpm-lock.yaml') && (!ready || (await aheadOf(ctx, consumer, tip)) > 1);
|
|
319
|
+
return { tip, sites, marked, behind, ready, lockfile };
|
|
320
|
+
}
|
|
321
|
+
/** What a later run found at the tip, as the run names it. */
|
|
322
|
+
function foundAt(at, version) {
|
|
323
|
+
const n = at.marked.length;
|
|
324
|
+
const parts = [
|
|
325
|
+
...(n > 0 ? [`${n} file${n === 1 ? '' : 's'} still hold${n === 1 ? 's' : ''} conflict markers`] : []),
|
|
326
|
+
...(at.behind.length > 0 ? [`${at.behind.map(site).join(', ')} not at ${version}: copier did not run there`] : []),
|
|
327
|
+
];
|
|
328
|
+
return parts.length > 0 ? parts.join('; ') : `no conflict marker remains, and every site is at ${version}`;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* A later run over the version's pull request, open on origin: the branch's
|
|
332
|
+
* tip read as origin has it (`readTip`), the body rewritten to what it found
|
|
333
|
+
* there, and the pull request ready when no tracked file holds a conflict
|
|
334
|
+
* marker and every site records the version, a draft again while either
|
|
335
|
+
* fails. Under a dry run it changes nothing and says what it would do.
|
|
336
|
+
*/
|
|
337
|
+
export async function revisit(ctx, consumer, pull, version, tip) {
|
|
338
|
+
const { path: repo, rel: name } = consumer;
|
|
339
|
+
const branch = versionBranch(version);
|
|
340
|
+
const at = await readTip(ctx, consumer, version, tip);
|
|
341
|
+
const { marked, behind, ready } = at;
|
|
342
|
+
const body = pullBody({
|
|
343
|
+
version,
|
|
344
|
+
sites: at.sites,
|
|
345
|
+
marked,
|
|
346
|
+
behind,
|
|
347
|
+
lockfile: at.lockfile,
|
|
348
|
+
checked: true,
|
|
349
|
+
note: REVISITED,
|
|
350
|
+
});
|
|
351
|
+
const line = `• ${name}: ${branch} is on origin (${pull.url}); ${foundAt(at, version)}`;
|
|
352
|
+
// Back to a draft is said once the forge has answered: a forge without drafts leaves it ordinary.
|
|
353
|
+
const undo = !ready && !pull.draft;
|
|
354
|
+
if (!undo)
|
|
355
|
+
ctx.say(ready && pull.draft ? `${line} — ready for review` : line);
|
|
356
|
+
// The body is written, never read: what it says decides nothing.
|
|
357
|
+
try {
|
|
358
|
+
await ctx.apply([
|
|
359
|
+
run('gh', ['api', `repos/{owner}/{repo}/pulls/${pull.number}`, '--method', 'PATCH', '-f', `body=${body}`], {
|
|
360
|
+
cwd: repo,
|
|
361
|
+
}),
|
|
362
|
+
...(ready && pull.draft ? [run('gh', ['pr', 'ready', pull.url], { cwd: repo })] : []),
|
|
363
|
+
]);
|
|
364
|
+
}
|
|
365
|
+
catch (error) {
|
|
366
|
+
if (undo)
|
|
367
|
+
ctx.say(line);
|
|
368
|
+
return { url: pull.url, marked, behind, mergeable: false, failed: `pull request ${pull.url}: ${detailOf(error)}` };
|
|
369
|
+
}
|
|
370
|
+
// A forge that refuses the draft leaves the pull request ordinary: what needs a hand keeps the run nonzero.
|
|
371
|
+
if (undo)
|
|
372
|
+
await ctx.apply([run('gh', ['pr', 'ready', pull.url, '--undo'], { cwd: repo })]).then(() => ctx.say(`${line} — a draft again`), (error) => {
|
|
373
|
+
const why = detailOf(error);
|
|
374
|
+
ctx.say(`${line} — no draft: the forge refused one${why ? ` (${why})` : ''}`);
|
|
375
|
+
});
|
|
376
|
+
// A dry run left the state as it was.
|
|
377
|
+
const draft = ctx.dryRun ? pull.draft : !ready;
|
|
378
|
+
return { url: pull.url, marked, behind, mergeable: ready && !draft };
|
|
379
|
+
}
|
|
380
|
+
/** The last line of a body a later run opened. */
|
|
381
|
+
const OPENED_LATE = 'Opened by `plx update`: a later run found the branch on origin with no pull request.';
|
|
382
|
+
/**
|
|
383
|
+
* A later run that finds the version branch on origin and no pull request of
|
|
384
|
+
* it opens one: the branch's tip read as origin has it (`readTip`), a draft
|
|
385
|
+
* unless no tracked file holds a conflict marker and every site records the
|
|
386
|
+
* version, with the review request. Under a dry run it opens nothing and says
|
|
387
|
+
* that it would.
|
|
388
|
+
*/
|
|
389
|
+
export async function openLate(ctx, consumer, version, reviewers, tip) {
|
|
390
|
+
const { path: repo, rel: name } = consumer;
|
|
391
|
+
const branch = versionBranch(version);
|
|
392
|
+
const at = await readTip(ctx, consumer, version, tip);
|
|
393
|
+
const { marked, behind, ready } = at;
|
|
394
|
+
const state = {
|
|
395
|
+
version,
|
|
396
|
+
sites: at.sites,
|
|
397
|
+
marked,
|
|
398
|
+
behind,
|
|
399
|
+
lockfile: at.lockfile,
|
|
400
|
+
checked: true,
|
|
401
|
+
note: OPENED_LATE,
|
|
402
|
+
};
|
|
403
|
+
const asDraft = !ready;
|
|
404
|
+
ctx.say(`• ${name}: ${branch} is on origin with no pull request — opening it${asDraft ? ' as a draft' : ''}`);
|
|
405
|
+
let draft;
|
|
406
|
+
try {
|
|
407
|
+
draft = await createPull(ctx, name, { base: consumer.branch, version, body: pullBody(state), draft: asDraft }, repo);
|
|
408
|
+
}
|
|
409
|
+
catch (error) {
|
|
410
|
+
const why = detailOf(error);
|
|
411
|
+
ctx.say(` ✗ FAILED — pull request${why ? `: ${why}` : ''}`);
|
|
412
|
+
return { marked, behind, ready, failed: `pull request: ${why}` };
|
|
413
|
+
}
|
|
414
|
+
if (ctx.dryRun) {
|
|
415
|
+
ctx.say(` (preview) ${name}: would open a pull request of ${branch} against ${consumer.branch}`);
|
|
416
|
+
return { marked, behind, ready, previewed: true };
|
|
417
|
+
}
|
|
418
|
+
const pull = await pullOf(ctx, consumer, repo, version);
|
|
419
|
+
if (!pull)
|
|
420
|
+
return { marked, behind, ready, failed: 'pull request: the forge did not list it after opening it' };
|
|
421
|
+
ctx.say(`• ${name}: ${draft ? 'draft ' : ''}pull request opened: ${pull.url}`);
|
|
422
|
+
// Unless named, from the root answers as the branch has them.
|
|
423
|
+
const from = reviewers ?? {
|
|
424
|
+
answersFile: await ctx
|
|
425
|
+
.read('git', ['cat-file', 'blob', `${at.tip}:${ANSWERS_FILE}`], { cwd: repo })
|
|
426
|
+
.catch(() => ''),
|
|
427
|
+
};
|
|
428
|
+
const review = await askForReviews(ctx, name, pull, from, repo);
|
|
429
|
+
return { pull, marked, behind, ready, ...(review ? { review } : {}) };
|
|
430
|
+
}
|
|
431
|
+
//# sourceMappingURL=pull.js.map
|
package/dist/pull.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pull.js","sourceRoot":"","sources":["../src/pull.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,yEAAyE;AACzE,8EAA8E;AAC9E,oBAAoB;AACpB,EAAE;AACF,yEAAyE;AACzE,8EAA8E;AAC9E,2EAA2E;AAC3E,2EAA2E;AAC3E,6EAA6E;AAC7E,0EAA0E;AAC1E,iDAAiD;AACjD,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,gEAAgE;AAChE,wEAAwE;AACxE,8EAA8E;AAC9E,4EAA4E;AAC5E,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,+EAA+E;AAC/E,uEAAuE;AACvE,8EAA8E;AAC9E,2EAA2E;AAC3E,4EAA4E;AAC5E,+EAA+E;AAC/E,0EAA0E;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C,EAAE,wBAAwB,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/E,8DAA8D;IAC9D,MAAM,IAAI,GAAG,SAAS,IAAI;QACxB,WAAW,EAAE,MAAM,GAAG;aACnB,IAAI,CAAC,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,YAAY,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;aAC7E,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC;KACnB,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAChE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Context } from './context.ts';
|
|
2
|
+
import { type Outcome, type UpdateOptions } from './update.ts';
|
|
3
|
+
export interface RecursiveOptions extends Omit<UpdateOptions, 'repo' | 'name'> {
|
|
4
|
+
/** The directory the repos sit under, at any depth. */
|
|
5
|
+
dir: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function updateRecursive(ctx: Context, options: RecursiveOptions): Promise<Outcome[]>;
|
|
8
|
+
//# sourceMappingURL=recursive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recursive.d.ts","sourceRoot":"","sources":["../src/recursive.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAK5C,OAAO,EAAE,KAAK,OAAO,EAAc,KAAK,aAAa,EAAU,MAAM,aAAa,CAAC;AAGnF,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5E,uDAAuD;IACvD,GAAG,EAAE,MAAM,CAAC;CACb;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CA6BjG"}
|