@plexus-ms/lib 0.118.0 → 0.120.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 +6 -43
- package/dist/bookkeeping.d.ts.map +1 -1
- package/dist/bookkeeping.js +10 -65
- package/dist/bookkeeping.js.map +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.d.ts.map +1 -1
- package/dist/changeset.d.ts.map +1 -1
- package/dist/changeset.js +2 -11
- package/dist/changeset.js.map +1 -1
- package/dist/consumers.d.ts +15 -14
- package/dist/consumers.d.ts.map +1 -1
- package/dist/consumers.js +29 -25
- package/dist/consumers.js.map +1 -1
- package/dist/copier.d.ts +1 -1
- package/dist/copier.d.ts.map +1 -1
- package/dist/copier.js +1 -1
- package/dist/copier.js.map +1 -1
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +5 -10
- package/dist/deploy.js.map +1 -1
- package/dist/deployTargets.js +1 -1
- package/dist/deployTargets.js.map +1 -1
- package/dist/doctor.d.ts +2 -2
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +4 -4
- package/dist/doctor.js.map +1 -1
- package/dist/index.d.ts +8 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/io.d.ts +9 -0
- package/dist/io.d.ts.map +1 -1
- package/dist/io.js +18 -0
- package/dist/io.js.map +1 -1
- package/dist/manifest.d.ts +9 -9
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +15 -15
- package/dist/manifest.js.map +1 -1
- package/dist/need.d.ts +9 -9
- package/dist/need.d.ts.map +1 -1
- package/dist/need.js +17 -17
- package/dist/need.js.map +1 -1
- package/dist/propagate.d.ts +3 -3
- package/dist/propagate.d.ts.map +1 -1
- package/dist/propagate.js +14 -14
- package/dist/propagate.js.map +1 -1
- package/dist/requirements.d.ts +1 -1
- package/dist/requirements.d.ts.map +1 -1
- package/dist/requirements.js +2 -2
- package/dist/requirements.js.map +1 -1
- package/dist/summary.d.ts +10 -0
- package/dist/summary.d.ts.map +1 -0
- package/dist/summary.js +51 -0
- package/dist/summary.js.map +1 -0
- package/dist/take.d.ts +14 -14
- package/dist/take.d.ts.map +1 -1
- package/dist/take.js +46 -40
- package/dist/take.js.map +1 -1
- package/dist/update.d.ts +4 -4
- package/dist/update.d.ts.map +1 -1
- package/dist/update.js +58 -56
- package/dist/update.js.map +1 -1
- package/dist/version.d.ts +20 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +32 -0
- package/dist/version.js.map +1 -0
- package/package.json +2 -2
- package/dist/preview.d.ts +0 -4
- package/dist/preview.d.ts.map +0 -1
- package/dist/preview.js +0 -60
- package/dist/preview.js.map +0 -1
- package/dist/self.d.ts +0 -5
- package/dist/self.d.ts.map +0 -1
- package/dist/self.js +0 -13
- package/dist/self.js.map +0 -1
- package/dist/ship.d.ts +0 -27
- package/dist/ship.d.ts.map +0 -1
- package/dist/ship.js +0 -296
- package/dist/ship.js.map +0 -1
- package/dist/train.d.ts +0 -82
- package/dist/train.d.ts.map +0 -1
- package/dist/train.js +0 -138
- package/dist/train.js.map +0 -1
package/dist/update.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../src/update.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAQ5C,OAAO,EAAiD,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../src/update.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAQ5C,OAAO,EAAiD,KAAK,OAAO,EAA8B,MAAM,WAAW,CAAC;AAGpH,MAAM,WAAW,aAAa;IAC5B,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,+FAA+F;IAC/F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2FAA2F;IAC3F,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wEAAwE;IACxE,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAsGnF"}
|
package/dist/update.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
// update: a repo generated from the
|
|
1
|
+
// update: a repo generated from the templates takes the version itself (§ 3
|
|
2
2
|
// PLX-Updates), from inside the repo, in the tenant's own CI or by hand; it is
|
|
3
|
-
// the only thing that opens a
|
|
3
|
+
// the only thing that opens a version's pull request.
|
|
4
4
|
//
|
|
5
|
-
// It takes a
|
|
6
|
-
// (need.ts): when it is asked (`--now`, or a
|
|
5
|
+
// It takes a version when the repo needs one, not whenever one was cut
|
|
6
|
+
// (need.ts): when it is asked (`--now`, or a version named), when a module one
|
|
7
7
|
// of its markers declares has changed since that marker (read from the
|
|
8
|
-
// manifest on the
|
|
8
|
+
// manifest on the version's release, manifest.ts), or when the oldest version the
|
|
9
9
|
// repo has not taken is older than the backstop age, which the repo's answers
|
|
10
10
|
// set (`update_max_age`, in days; 30 when they do not say, zero for every
|
|
11
|
-
//
|
|
11
|
+
// version). Otherwise the repo rests: one line saying why, exit 0.
|
|
12
12
|
//
|
|
13
13
|
// The markers that count are those of the repo's sites, root and apps: the
|
|
14
|
-
// ones a pull brings up to the
|
|
14
|
+
// ones a pull brings up to the version. A marker anywhere else is kept by hand,
|
|
15
15
|
// a pull would not cure it, and `doctor` is what reports it.
|
|
16
16
|
//
|
|
17
|
-
// The
|
|
18
|
-
// by one, § 1.6 PLX, and the compendium is released last, so a
|
|
17
|
+
// The versions are the compendium's GitHub releases (every version tag is locked
|
|
18
|
+
// by one, § 1.6 PLX, and the compendium is released last, so a version shows
|
|
19
19
|
// there once it is cut everywhere), asked of the forge as an operator would
|
|
20
|
-
// (`gh api repos/plexus-ms/compendium/releases`): the newest is the
|
|
20
|
+
// (`gh api repos/plexus-ms/compendium/releases`): the newest is the version to
|
|
21
21
|
// take, and their dates are what the backstop is measured against. The work happens in a
|
|
22
22
|
// worktree of origin's branch, never in the checkout: a developer's branch and
|
|
23
23
|
// edits stay as they are, and in CI the worktree shares the checkout's
|
|
24
24
|
// credentials, so the push and the pull request need no second token. Then
|
|
25
|
-
// `
|
|
25
|
+
// `takeVersion` (propagate.ts): copier update at every site, marker, lockfile,
|
|
26
26
|
// workflow refs, one commit on `plexus/<version>`, one pull request.
|
|
27
27
|
//
|
|
28
|
-
// The
|
|
28
|
+
// The version is pulled once per repo: a `plexus/<version>` branch already on
|
|
29
29
|
// origin, from an earlier run or from a human resolving its conflicts, is
|
|
30
30
|
// left alone, so a daily run never moves a branch somebody is
|
|
31
31
|
// working on; deleting the branch is how a pull is redone. A repo whose every
|
|
32
|
-
// site already records the
|
|
32
|
+
// site already records the version does nothing at all.
|
|
33
33
|
//
|
|
34
|
-
// plx update # the newest
|
|
35
|
-
// plx update --now # the newest
|
|
34
|
+
// plx update # the newest version, if the repo needs it
|
|
35
|
+
// plx update --now # the newest version, whatever its triggers say
|
|
36
36
|
// plx -n update --now # preview in a worktree, push nothing
|
|
37
|
-
// plx -y update --
|
|
37
|
+
// plx -y update --to 0.102.0 # unattended, an explicit version
|
|
38
38
|
import { basename, join, relative } from 'node:path';
|
|
39
|
-
import { findConsumers,
|
|
39
|
+
import { findConsumers, TEMPLATES, templateSource } from "./consumers.js";
|
|
40
40
|
import { ANSWERS_FILE, parseAnswers } from "./copier.js";
|
|
41
|
-
import {
|
|
41
|
+
import { compareVersions } from "./doctor.js";
|
|
42
42
|
import { run } from "./effects.js";
|
|
43
43
|
import { catalogOf, MANIFEST_FILE, parseManifest } from "./manifest.js";
|
|
44
44
|
import { MARKER_FILE, parseMarker } from "./marker.js";
|
|
45
45
|
import { maxAgeOf, needOf, staleModules } from "./need.js";
|
|
46
46
|
import { overview } from "./overview.js";
|
|
47
|
-
import { CLEAN_BODY, detail, emptySummary, openPullUrl,
|
|
48
|
-
import { COMPENDIUM,
|
|
47
|
+
import { CLEAN_BODY, detail, emptySummary, openPullUrl, takeVersion, versionBranch } from "./take.js";
|
|
48
|
+
import { COMPENDIUM, isPlexusVersion, preflightForge, UsageError } from "./version.js";
|
|
49
49
|
export async function update(ctx, options) {
|
|
50
50
|
const { repo } = options;
|
|
51
51
|
const name = options.name ?? basename(repo);
|
|
52
|
-
if (options.
|
|
53
|
-
throw new UsageError(`'${options.
|
|
52
|
+
if (options.to !== undefined && !isPlexusVersion(options.to))
|
|
53
|
+
throw new UsageError(`'${options.to}' is not plain semver (X.Y.Z, no v)`);
|
|
54
54
|
const tree = await overview(ctx, repo);
|
|
55
|
-
const consumer = (await findConsumers(ctx, tree,
|
|
55
|
+
const consumer = (await findConsumers(ctx, tree, TEMPLATES)).find((c) => c.path === tree.path);
|
|
56
56
|
if (!consumer)
|
|
57
|
-
throw new Error(`${repo} is not a repo generated from the
|
|
57
|
+
throw new Error(`${repo} is not a repo generated from the templates: no ${ANSWERS_FILE} at its root naming one of ${TEMPLATES.map(templateSource).join(', ')}`);
|
|
58
58
|
if (consumer.skipped)
|
|
59
59
|
throw new Error(`${name}: ${consumer.skipped}`);
|
|
60
60
|
// Sites are named from the repo, not from a workspace.
|
|
@@ -63,12 +63,12 @@ export async function update(ctx, options) {
|
|
|
63
63
|
s.rel = s.rel === '.' ? name : join(name, s.rel);
|
|
64
64
|
const root = consumer.sites.find((s) => s.path === consumer.path);
|
|
65
65
|
if (!root)
|
|
66
|
-
throw new Error(`${name}: its root is not a site of a repo
|
|
66
|
+
throw new Error(`${name}: its root is not a site of a repo template`);
|
|
67
67
|
await preflightForge(ctx);
|
|
68
|
-
const releases = options.
|
|
69
|
-
const
|
|
70
|
-
const summary = emptySummary(
|
|
71
|
-
// The repo is judged by what its origin has on the branch the
|
|
68
|
+
const releases = options.to === undefined ? await releasesOf(ctx) : [];
|
|
69
|
+
const version = options.to ?? newestOf(releases);
|
|
70
|
+
const summary = emptySummary(version, ctx.dryRun);
|
|
71
|
+
// The repo is judged by what its origin has on the branch the version lands
|
|
72
72
|
// on, not by the checkout, which may be behind it or on a branch of its own.
|
|
73
73
|
await ctx.read('git', ['fetch', '--quiet', 'origin', consumer.branch], { cwd: repo }).catch(() => '');
|
|
74
74
|
const answers = await Promise.all(consumer.sites.map(async (s) => {
|
|
@@ -79,22 +79,22 @@ export async function update(ctx, options) {
|
|
|
79
79
|
return parseAnswers(onOrigin ?? (await ctx.readFile(join(s.path, ANSWERS_FILE))));
|
|
80
80
|
}));
|
|
81
81
|
const recorded = answers.map((a) => a.commit);
|
|
82
|
-
if (recorded.every((c) => c ===
|
|
83
|
-
ctx.say(`• ${name}: already at ${
|
|
82
|
+
if (recorded.every((c) => c === version)) {
|
|
83
|
+
ctx.say(`• ${name}: already at ${version}`);
|
|
84
84
|
return summary;
|
|
85
85
|
}
|
|
86
86
|
// copier refuses a downgrade; say so before a worktree is made for nothing.
|
|
87
|
-
const past = recorded.find((c) => c &&
|
|
87
|
+
const past = recorded.find((c) => c && isPlexusVersion(c) && compareVersions(c, version) > 0);
|
|
88
88
|
if (past)
|
|
89
|
-
throw new Error(`${name} is at ${past}, past ${
|
|
90
|
-
const branch =
|
|
89
|
+
throw new Error(`${name} is at ${past}, past ${version}; a repo is never taken back to an older version`);
|
|
90
|
+
const branch = versionBranch(version);
|
|
91
91
|
const onOrigin = await ctx
|
|
92
92
|
.read('git', ['ls-remote', '--exit-code', '--heads', 'origin', `refs/heads/${branch}`], { cwd: repo })
|
|
93
93
|
.then(() => true)
|
|
94
94
|
.catch(() => false);
|
|
95
95
|
if (onOrigin) {
|
|
96
|
-
const url = await openPullUrl(ctx, consumer, repo,
|
|
97
|
-
ctx.say(`• ${name}: ${branch} is already on origin${url ? ` (${url})` : ''} — nothing to do; delete the branch to pull the
|
|
96
|
+
const url = await openPullUrl(ctx, consumer, repo, version);
|
|
97
|
+
ctx.say(`• ${name}: ${branch} is already on origin${url ? ` (${url})` : ''} — nothing to do; delete the branch to pull the version again`);
|
|
98
98
|
if (url) {
|
|
99
99
|
summary.pulls.push(url);
|
|
100
100
|
// Whether it merged clean is what its body says (take.ts wrote it).
|
|
@@ -106,21 +106,21 @@ export async function update(ctx, options) {
|
|
|
106
106
|
}
|
|
107
107
|
return summary;
|
|
108
108
|
}
|
|
109
|
-
const asked = options.
|
|
109
|
+
const asked = options.to !== undefined ? `--to ${version}` : options.now ? '--now' : undefined;
|
|
110
110
|
const need = needOf({
|
|
111
111
|
recorded,
|
|
112
112
|
releases,
|
|
113
113
|
asked,
|
|
114
|
-
stale: asked ? [] : await staleIn(ctx, consumer, repo,
|
|
114
|
+
stale: asked ? [] : await staleIn(ctx, consumer, repo, version),
|
|
115
115
|
maxAge: options.maxAge ?? maxAgeOf(answers[consumer.sites.indexOf(root)]?.answers ?? {}),
|
|
116
116
|
now: options.today === undefined ? new Date() : new Date(options.today),
|
|
117
117
|
});
|
|
118
118
|
if (!need.take) {
|
|
119
|
-
ctx.say(`• ${name}: rests — ${need.why} (plx update --now takes ${
|
|
119
|
+
ctx.say(`• ${name}: rests — ${need.why} (plx update --now takes ${version})`);
|
|
120
120
|
summary.resting.push({ path: name, reason: need.why });
|
|
121
121
|
return summary;
|
|
122
122
|
}
|
|
123
|
-
ctx.say(`• ${name}: takes ${
|
|
123
|
+
ctx.say(`• ${name}: takes ${version} — ${need.why}`);
|
|
124
124
|
const scratch = (await ctx.stage(run('mktemp', ['-d'])))?.trim() ?? '';
|
|
125
125
|
const dir = join(scratch, name);
|
|
126
126
|
try {
|
|
@@ -134,7 +134,7 @@ export async function update(ctx, options) {
|
|
|
134
134
|
summary.failed.push(name);
|
|
135
135
|
return summary;
|
|
136
136
|
}
|
|
137
|
-
await
|
|
137
|
+
await takeVersion(ctx, consumer, dir, { version, ref: version, opener: '`plx update`', why: need.why }, summary);
|
|
138
138
|
}
|
|
139
139
|
finally {
|
|
140
140
|
await ctx.stage(run('git', ['worktree', 'remove', '--force', dir], { cwd: repo })).catch(() => undefined);
|
|
@@ -145,16 +145,16 @@ export async function update(ctx, options) {
|
|
|
145
145
|
}
|
|
146
146
|
/**
|
|
147
147
|
* The declared modules of the repo's sites that changed since their markers,
|
|
148
|
-
* by the manifest of the
|
|
148
|
+
* by the manifest of the version. A version without a manifest (one cut before
|
|
149
149
|
* there were any, or a forge that cannot be asked) is said and checked for
|
|
150
150
|
* nothing: the backstop still holds.
|
|
151
151
|
*/
|
|
152
|
-
async function staleIn(ctx, consumer, repo,
|
|
152
|
+
async function staleIn(ctx, consumer, repo, version) {
|
|
153
153
|
const text = await ctx
|
|
154
|
-
.read('gh', ['release', 'download',
|
|
154
|
+
.read('gh', ['release', 'download', version, '-R', RELEASES_REPO, '-p', MANIFEST_FILE, '-O', '-'])
|
|
155
155
|
.catch(() => undefined);
|
|
156
156
|
if (text === undefined) {
|
|
157
|
-
ctx.say(` ${consumer.rel}:
|
|
157
|
+
ctx.say(` ${consumer.rel}: Plexus ${version} carries no ${MANIFEST_FILE} that can be read; its modules are not checked`);
|
|
158
158
|
return [];
|
|
159
159
|
}
|
|
160
160
|
const catalog = catalogOf(parseManifest(text));
|
|
@@ -170,28 +170,30 @@ async function staleIn(ctx, consumer, repo, train) {
|
|
|
170
170
|
markers.push({ where: join(site.rel, MARKER_FILE), plexus, modules });
|
|
171
171
|
}
|
|
172
172
|
catch {
|
|
173
|
-
// An unreadable marker is doctor's finding, not a reason to take a
|
|
173
|
+
// An unreadable marker is doctor's finding, not a reason to take a version.
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
return staleModules(markers, catalog);
|
|
177
177
|
}
|
|
178
|
-
/** Where the
|
|
179
|
-
const
|
|
180
|
-
/** The
|
|
181
|
-
async function
|
|
178
|
+
/** Where the versions are read from: the compendium's releases. */
|
|
179
|
+
const RELEASES_REPO = `plexus-ms/${COMPENDIUM}`;
|
|
180
|
+
/** The versions (§ 1.6 PLX: every version tag has a release), with the dates they were cut; a draft is no version yet. */
|
|
181
|
+
async function releasesOf(ctx) {
|
|
182
182
|
const jq = '.[] | select(.draft | not) | "\\(.tag_name) \\(.published_at)"';
|
|
183
|
-
const lines = await ctx
|
|
183
|
+
const lines = await ctx
|
|
184
|
+
.read('gh', ['api', `repos/${RELEASES_REPO}/releases`, '--paginate', '--jq', jq])
|
|
185
|
+
.catch(() => '');
|
|
184
186
|
return lines
|
|
185
187
|
.split('\n')
|
|
186
188
|
.map((l) => l.trim().split(/\s+/))
|
|
187
|
-
.filter((p) => p.length === 2 &&
|
|
188
|
-
.map(([
|
|
189
|
+
.filter((p) => p.length === 2 && isPlexusVersion(p[0] ?? ''))
|
|
190
|
+
.map(([version, published]) => ({ version, published }));
|
|
189
191
|
}
|
|
190
|
-
/** The newest
|
|
192
|
+
/** The newest version among the releases. */
|
|
191
193
|
function newestOf(releases) {
|
|
192
|
-
const newest = releases.map((r) => r.
|
|
194
|
+
const newest = releases.map((r) => r.version).reduce((a, b) => (a && compareVersions(a, b) >= 0 ? a : b), '');
|
|
193
195
|
if (!newest)
|
|
194
|
-
throw new Error(`no release of ${
|
|
196
|
+
throw new Error(`no release of ${RELEASES_REPO} found — pass the version explicitly (--to <version>)`);
|
|
195
197
|
return newest;
|
|
196
198
|
}
|
|
197
199
|
//# sourceMappingURL=update.js.map
|
package/dist/update.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../src/update.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../src/update.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,+EAA+E;AAC/E,sDAAsD;AACtD,EAAE;AACF,uEAAuE;AACvE,+EAA+E;AAC/E,uEAAuE;A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;QAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,aAAa,uDAAuD,CAAC,CAAC;IACpH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Context } from './context.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The repo whose releases are the versions as a repo outside the workspace sees
|
|
4
|
+
* them: it is released last, so a version shows there once it is cut everywhere,
|
|
5
|
+
* and its release carries the module manifest (manifest.ts).
|
|
6
|
+
*/
|
|
7
|
+
export declare const COMPENDIUM = "compendium";
|
|
8
|
+
/** The repos stamped with the version tag, in release order; the templates among them are what a repo is generated from. */
|
|
9
|
+
export declare const VERSIONED_REPOS: readonly ["tooling", "template-repo-turbo", "template-app-nextjs", "template-repo-operations", "compendium"];
|
|
10
|
+
/** A Plexus version is plain semver, no `v` prefix (§ 1.5 PLX). */
|
|
11
|
+
export declare const isPlexusVersion: (v: string) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The forge CLI is what opens a pull request and creates a release; an expired
|
|
14
|
+
* login is found here, before anything is written.
|
|
15
|
+
*/
|
|
16
|
+
export declare function preflightForge(ctx: Context): Promise<void>;
|
|
17
|
+
/** A mistake in the arguments, as opposed to a failed run: exit code 2 in the CLI. */
|
|
18
|
+
export declare class UsageError extends Error {
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,UAAU,eAAe,CAAC;AAEvC,4HAA4H;AAC5H,eAAO,MAAM,eAAe,8GAMlB,CAAC;AAEX,mEAAmE;AACnE,eAAO,MAAM,eAAe,GAAI,GAAG,MAAM,KAAG,OAAoC,CAAC;AAEjF;;;GAGG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhE;AAED,sFAAsF;AACtF,qBAAa,UAAW,SAAQ,KAAK;CAAG"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The repo whose releases are the versions as a repo outside the workspace sees
|
|
3
|
+
* them: it is released last, so a version shows there once it is cut everywhere,
|
|
4
|
+
* and its release carries the module manifest (manifest.ts).
|
|
5
|
+
*/
|
|
6
|
+
export const COMPENDIUM = 'compendium';
|
|
7
|
+
/** The repos stamped with the version tag, in release order; the templates among them are what a repo is generated from. */
|
|
8
|
+
export const VERSIONED_REPOS = [
|
|
9
|
+
'tooling',
|
|
10
|
+
'template-repo-turbo',
|
|
11
|
+
'template-app-nextjs',
|
|
12
|
+
'template-repo-operations',
|
|
13
|
+
COMPENDIUM,
|
|
14
|
+
];
|
|
15
|
+
/** A Plexus version is plain semver, no `v` prefix (§ 1.5 PLX). */
|
|
16
|
+
export const isPlexusVersion = (v) => /^\d+\.\d+\.\d+$/.test(v);
|
|
17
|
+
/**
|
|
18
|
+
* The forge CLI is what opens a pull request and creates a release; an expired
|
|
19
|
+
* login is found here, before anything is written.
|
|
20
|
+
*/
|
|
21
|
+
export async function preflightForge(ctx) {
|
|
22
|
+
try {
|
|
23
|
+
await ctx.read('gh', ['auth', 'status']);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
throw new Error('gh is not logged in (gh auth status failed) — run gh auth login first');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** A mistake in the arguments, as opposed to a failed run: exit code 2 in the CLI. */
|
|
30
|
+
export class UsageError extends Error {
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC;AAEvC,4HAA4H;AAC5H,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,SAAS;IACT,qBAAqB;IACrB,qBAAqB;IACrB,0BAA0B;IAC1B,UAAU;CACF,CAAC;AAEX,mEAAmE;AACnE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAS,EAAW,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEjF;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAY;IAC/C,IAAI,CAAC;QACH,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;IAC3F,CAAC;AACH,CAAC;AAED,sFAAsF;AACtF,MAAM,OAAO,UAAW,SAAQ,KAAK;CAAG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plexus-ms/lib",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.120.0",
|
|
4
4
|
"description": "The Plexus verbs as a library: the plan-then-apply core behind plx, and the one parser of Plexus's own file shapes",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"type": "module",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/plexus-ms/
|
|
19
|
+
"url": "git+https://github.com/plexus-ms/tooling.git",
|
|
20
20
|
"directory": "packages/lib"
|
|
21
21
|
},
|
|
22
22
|
"publishConfig": {
|
package/dist/preview.d.ts
DELETED
package/dist/preview.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../src/preview.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAwB,KAAK,OAAO,EAAwB,MAAM,WAAW,CAAC;AAGrF,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAqCvG"}
|
package/dist/preview.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// preview: what an unreleased train would do to the consumers in the
|
|
2
|
-
// maintainers' workspace, before it is cut. Not propagation: a maintainer's
|
|
3
|
-
// test, run by the dry run of `ship` and by nothing else, and due to leave
|
|
4
|
-
// `ship` for a canary of its own. Cutting a train needs no knowledge of any
|
|
5
|
-
// consumer, and the real run of `ship` has none.
|
|
6
|
-
//
|
|
7
|
-
// Each consumer found under the workspace is cloned from its origin at the
|
|
8
|
-
// branch a train lands on into a scratch directory, and copier-updated there
|
|
9
|
-
// from the LOCAL preset checkout at main, so the diff and any conflicts show
|
|
10
|
-
// before a tag exists; nothing is committed to an origin, pushed or opened.
|
|
11
|
-
// The scratch work goes through `Context.stage`: performed although the run is
|
|
12
|
-
// a dry run, since nothing the operator owns changes.
|
|
13
|
-
import { join } from 'node:path';
|
|
14
|
-
import { findConsumers, presetSource } from "./consumers.js";
|
|
15
|
-
import { run } from "./effects.js";
|
|
16
|
-
import { overview } from "./overview.js";
|
|
17
|
-
import { detail, emptySummary, takeTrain } from "./take.js";
|
|
18
|
-
import { TRAIN_REPOS, UPSTREAM } from "./train.js";
|
|
19
|
-
export async function previewConsumers(ctx, workspace, train) {
|
|
20
|
-
const summary = emptySummary(train, ctx.dryRun);
|
|
21
|
-
const upstream = join(workspace, UPSTREAM);
|
|
22
|
-
const tree = await overview(ctx, workspace);
|
|
23
|
-
const upstreamDir = tree.children.find((c) => c.path === upstream);
|
|
24
|
-
const presets = TRAIN_REPOS.filter((r) => upstreamDir?.children.some((c) => c.name === r && c.template));
|
|
25
|
-
const consumers = await findConsumers(ctx, tree, presets);
|
|
26
|
-
for (const c of consumers) {
|
|
27
|
-
if (!c.skipped)
|
|
28
|
-
continue;
|
|
29
|
-
ctx.say(`⚠ ${c.rel}: ${c.skipped} — not previewed`);
|
|
30
|
-
summary.skipped.push({ path: c.rel, reason: c.skipped });
|
|
31
|
-
}
|
|
32
|
-
for (const preset of presets)
|
|
33
|
-
if (!consumers.some((c) => c.sites.some((s) => s.preset === preset)))
|
|
34
|
-
ctx.say(`• no consumers of ${presetSource(preset)} found under ${workspace}`);
|
|
35
|
-
const take = { train, opener: '`plx ship`', previewFrom: upstream };
|
|
36
|
-
const scratch = (await ctx.stage(run('mktemp', ['-d'])))?.trim() ?? '';
|
|
37
|
-
try {
|
|
38
|
-
for (const consumer of consumers) {
|
|
39
|
-
if (consumer.skipped || !consumer.origin)
|
|
40
|
-
continue;
|
|
41
|
-
const clone = join(scratch, consumer.rel);
|
|
42
|
-
ctx.say(`→ ${consumer.rel}: clone ${consumer.origin} at ${consumer.branch}`);
|
|
43
|
-
try {
|
|
44
|
-
await ctx.stage(run('git', ['clone', '--quiet', '--branch', consumer.branch, consumer.origin, clone]));
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
ctx.say(` ✗ FAILED — clone${detail(error)}`);
|
|
48
|
-
summary.failed.push(consumer.rel);
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
await takeTrain(ctx, consumer, clone, take, summary);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
finally {
|
|
55
|
-
if (scratch)
|
|
56
|
-
await ctx.stage(run('rm', ['-rf', scratch]));
|
|
57
|
-
}
|
|
58
|
-
return summary;
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=preview.js.map
|
package/dist/preview.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preview.js","sourceRoot":"","sources":["../src/preview.ts"],"names":[],"mappings":"AAAA,qEAAq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OAAO,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;YAC7E,IAAI,CAAC;gBACH,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;YACzG,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,GAAG,CAAC,GAAG,CAAC,qBAAqB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBAC9C,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;gBAClC,SAAS;YACX,CAAC;YACD,MAAM,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;YAAS,CAAC;QACT,IAAI,OAAO;YAAE,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/self.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Context } from './context.ts';
|
|
2
|
-
export declare const SELF_PACKAGE = "@plexus-ms/cli";
|
|
3
|
-
/** Throws when `running` is older than the registry's latest plx; warns when the registry cannot be asked. */
|
|
4
|
-
export declare function preflightSelf(ctx: Context, running: string): Promise<void>;
|
|
5
|
-
//# sourceMappingURL=self.d.ts.map
|
package/dist/self.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"self.d.ts","sourceRoot":"","sources":["../src/self.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,eAAO,MAAM,YAAY,mBAAmB,CAAC;AAE7C,8GAA8G;AAC9G,wBAAsB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUhF"}
|
package/dist/self.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { compareTrains } from "./doctor.js";
|
|
2
|
-
export const SELF_PACKAGE = '@plexus-ms/cli';
|
|
3
|
-
/** Throws when `running` is older than the registry's latest plx; warns when the registry cannot be asked. */
|
|
4
|
-
export async function preflightSelf(ctx, running) {
|
|
5
|
-
const latest = (await ctx.read('npm', ['view', SELF_PACKAGE, 'version']).catch(() => '')).trim();
|
|
6
|
-
if (!latest) {
|
|
7
|
-
ctx.say(`⚠ could not ask the registry for the newest ${SELF_PACKAGE}; going on with plx ${running}`);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
if (compareTrains(running, latest) < 0)
|
|
11
|
-
throw new Error(`plx ${running} is behind ${latest}, the newest release; update it first: mise cache clear npm:${SELF_PACKAGE} && mise up npm:${SELF_PACKAGE}`);
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=self.js.map
|
package/dist/self.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"self.js","sourceRoot":"","sources":["../src/self.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAE7C,8GAA8G;AAC9G,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,GAAY,EAAE,OAAe;IAC/D,MAAM,MAAM,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACjG,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,GAAG,CAAC,GAAG,CAAC,+CAA+C,YAAY,uBAAuB,OAAO,EAAE,CAAC,CAAC;QACrG,OAAO;IACT,CAAC;IACD,IAAI,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC;QACpC,MAAM,IAAI,KAAK,CACb,OAAO,OAAO,cAAc,MAAM,+DAA+D,YAAY,mBAAmB,YAAY,EAAE,CAC/I,CAAC;AACN,CAAC"}
|
package/dist/ship.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Context } from './context.ts';
|
|
2
|
-
import { type Summary } from './take.ts';
|
|
3
|
-
/** How the wait for npm between the phases behaves, in milliseconds. */
|
|
4
|
-
export interface PublishWait {
|
|
5
|
-
/** Between two polls of the registry. */
|
|
6
|
-
interval: number;
|
|
7
|
-
/** After which the run stops, resumable. */
|
|
8
|
-
timeout: number;
|
|
9
|
-
}
|
|
10
|
-
export interface ShipOptions {
|
|
11
|
-
/** The workspace: the upstream umbrella sits under it, and for the dry run's preview the consumers. */
|
|
12
|
-
workspace: string;
|
|
13
|
-
/** The train version; default: minor+1 over the latest. */
|
|
14
|
-
train?: string;
|
|
15
|
-
/** The date stamped on the map, `YYYY-MM-DD`; default: today. */
|
|
16
|
-
today?: string;
|
|
17
|
-
/** The running plx's version: when given, refuse to run behind its newest release (self.ts). */
|
|
18
|
-
plx?: string;
|
|
19
|
-
/** The publish wait's pacing; the defaults suit a real registry, tests shorten them. */
|
|
20
|
-
wait?: Partial<PublishWait>;
|
|
21
|
-
}
|
|
22
|
-
/** The train cut, and under a dry run what the preview found in the consumers; a real run's lists are empty. */
|
|
23
|
-
export interface ShipResult extends Summary {
|
|
24
|
-
released: boolean;
|
|
25
|
-
}
|
|
26
|
-
export declare function ship(ctx: Context, options: ShipOptions): Promise<ShipResult>;
|
|
27
|
-
//# sourceMappingURL=ship.d.ts.map
|
package/dist/ship.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ship.d.ts","sourceRoot":"","sources":["../src/ship.ts"],"names":[],"mappings":"AAyDA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAO5C,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAevD,wEAAwE;AACxE,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,MAAM,WAAW,WAAW;IAC1B,uGAAuG;IACvG,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gGAAgG;IAChG,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wFAAwF;IACxF,IAAI,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC7B;AAED,gHAAgH;AAChH,MAAM,WAAW,UAAW,SAAQ,OAAO;IACzC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAsB,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAYlF"}
|