@plexus-ms/lib 0.130.0 → 0.132.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.
Files changed (109) hide show
  1. package/dist/apply.d.ts +25 -0
  2. package/dist/apply.d.ts.map +1 -0
  3. package/dist/apply.js +204 -0
  4. package/dist/apply.js.map +1 -0
  5. package/dist/bookkeeping.js +3 -3
  6. package/dist/bookkeeping.js.map +1 -1
  7. package/dist/bundled.d.ts +15 -0
  8. package/dist/bundled.d.ts.map +1 -0
  9. package/dist/bundled.js +42 -0
  10. package/dist/bundled.js.map +1 -0
  11. package/dist/changeset.js +3 -3
  12. package/dist/changeset.js.map +1 -1
  13. package/dist/consumers.d.ts +6 -35
  14. package/dist/consumers.d.ts.map +1 -1
  15. package/dist/consumers.js +45 -83
  16. package/dist/consumers.js.map +1 -1
  17. package/dist/doctor.d.ts +17 -1
  18. package/dist/doctor.d.ts.map +1 -1
  19. package/dist/doctor.js +167 -11
  20. package/dist/doctor.js.map +1 -1
  21. package/dist/engine.d.ts +2 -0
  22. package/dist/engine.d.ts.map +1 -0
  23. package/dist/engine.js +9 -0
  24. package/dist/engine.js.map +1 -0
  25. package/dist/frontmatter.d.ts.map +1 -1
  26. package/dist/frontmatter.js +6 -5
  27. package/dist/frontmatter.js.map +1 -1
  28. package/dist/index.d.ts +13 -8
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +14 -9
  31. package/dist/index.js.map +1 -1
  32. package/dist/io.d.ts +1 -1
  33. package/dist/marker.d.ts +38 -0
  34. package/dist/marker.d.ts.map +1 -1
  35. package/dist/marker.js +269 -16
  36. package/dist/marker.js.map +1 -1
  37. package/dist/model.d.ts +15 -17
  38. package/dist/model.d.ts.map +1 -1
  39. package/dist/model.js +19 -21
  40. package/dist/model.js.map +1 -1
  41. package/dist/need.d.ts +1 -1
  42. package/dist/need.d.ts.map +1 -1
  43. package/dist/need.js +2 -2
  44. package/dist/need.js.map +1 -1
  45. package/dist/newSite.d.ts +31 -0
  46. package/dist/newSite.d.ts.map +1 -0
  47. package/dist/newSite.js +184 -0
  48. package/dist/newSite.js.map +1 -0
  49. package/dist/overview.d.ts +5 -9
  50. package/dist/overview.d.ts.map +1 -1
  51. package/dist/overview.js +26 -51
  52. package/dist/overview.js.map +1 -1
  53. package/dist/pull.d.ts +48 -21
  54. package/dist/pull.d.ts.map +1 -1
  55. package/dist/pull.js +183 -67
  56. package/dist/pull.js.map +1 -1
  57. package/dist/recursive.d.ts.map +1 -1
  58. package/dist/recursive.js +7 -5
  59. package/dist/recursive.js.map +1 -1
  60. package/dist/requirements.d.ts +1 -1
  61. package/dist/requirements.d.ts.map +1 -1
  62. package/dist/requirements.js +11 -13
  63. package/dist/requirements.js.map +1 -1
  64. package/dist/siteTemplates.d.ts +14 -0
  65. package/dist/siteTemplates.d.ts.map +1 -0
  66. package/dist/siteTemplates.js +107 -0
  67. package/dist/siteTemplates.js.map +1 -0
  68. package/dist/sites.d.ts +24 -0
  69. package/dist/sites.d.ts.map +1 -0
  70. package/dist/sites.js +89 -0
  71. package/dist/sites.js.map +1 -0
  72. package/dist/standard-index.json +1 -1
  73. package/dist/summary.d.ts +1 -1
  74. package/dist/summary.d.ts.map +1 -1
  75. package/dist/summary.js +6 -1
  76. package/dist/summary.js.map +1 -1
  77. package/dist/sync.d.ts +86 -0
  78. package/dist/sync.d.ts.map +1 -0
  79. package/dist/sync.js +227 -0
  80. package/dist/sync.js.map +1 -0
  81. package/dist/take.d.ts +20 -25
  82. package/dist/take.d.ts.map +1 -1
  83. package/dist/take.js +48 -142
  84. package/dist/take.js.map +1 -1
  85. package/dist/templatesRoot.d.ts +5 -0
  86. package/dist/templatesRoot.d.ts.map +1 -0
  87. package/dist/templatesRoot.js +37 -0
  88. package/dist/templatesRoot.js.map +1 -0
  89. package/dist/update.d.ts +48 -10
  90. package/dist/update.d.ts.map +1 -1
  91. package/dist/update.js +173 -78
  92. package/dist/update.js.map +1 -1
  93. package/dist/version.d.ts +2 -2
  94. package/dist/version.d.ts.map +1 -1
  95. package/dist/version.js +2 -8
  96. package/dist/version.js.map +1 -1
  97. package/dist/versionTemplates.d.ts +24 -0
  98. package/dist/versionTemplates.d.ts.map +1 -0
  99. package/dist/versionTemplates.js +168 -0
  100. package/dist/versionTemplates.js.map +1 -0
  101. package/package.json +2 -1
  102. package/dist/copier.d.ts +0 -17
  103. package/dist/copier.d.ts.map +0 -1
  104. package/dist/copier.js +0 -35
  105. package/dist/copier.js.map +0 -1
  106. package/dist/templates.d.ts +0 -21
  107. package/dist/templates.d.ts.map +0 -1
  108. package/dist/templates.js +0 -55
  109. package/dist/templates.js.map +0 -1
package/dist/take.js CHANGED
@@ -1,44 +1,38 @@
1
1
  // take: one repo takes a version (§ 3 PLX-Updates), in a scratch checkout of the
2
- // branch the version lands on (consumers.ts). `copier update` runs at the
3
- // version plx pins (copier.ts) at every site (the repo root, then its apps/*),
4
- // the lockfile refreshed where manifests moved, the hand-owned workflows pinned to the version; then one
5
- // commit, pushed as `plexus/<version>`, and a pull request against the branch.
6
- // A conflict is committed with its markers and reported, and the pull request
7
- // is opened all the same, as a draft where the forge offers one, whose body
8
- // opens with what needs a hand (pull.ts): that is where it gets resolved. Nothing here aborts
9
- // a run: what became of each site, the lockfile and the pull request is
10
- // returned as data (`Taken`), which the caller folds into the summary that
11
- // says what needs a human (summary.ts). Reviewing and merging the pull
12
- // request stays human.
2
+ // branch the version lands on (consumers.ts): its sites brought to the
3
+ // version by the caller's step, the lockfile refreshed where manifests moved,
4
+ // the hand-owned workflows pinned to the version; then one commit, pushed as
5
+ // `plexus/<version>`, whose message names each site's conflicted paths and
6
+ // the edited files the version drops, and a pull request against the branch. A conflict is
7
+ // committed with its markers and reported, and the pull request is opened all
8
+ // the same, as a draft where the forge offers one, whose body opens with what
9
+ // needs a hand (pull.ts): that is where it gets resolved. Nothing here aborts
10
+ // a run but the sites' step itself: what became of each site, the lockfile and
11
+ // the pull request is returned as data (`Taken`), which the caller folds into
12
+ // the summary that says what needs a human (summary.ts). Reviewing and merging
13
+ // the pull request stays human.
13
14
  //
14
15
  // `update` (update.ts) is the verb on top of it, and the only thing that
15
- // opens a version's pull request; `update --recursive` (recursive.ts) runs
16
- // that verb over many repos. The maintainers' preview of an unreleased
17
- // version (preview.ts of @plexus-ms/dev) uses the same steps with its own
18
- // `SiteUpdate`, against the local template checkouts, and opens nothing.
19
- import { join, relative } from 'node:path';
16
+ // opens a version's pull request, with the engine's step: both sides rendered
17
+ // and merged at every site, the version written into the root marker.
18
+ // `update --recursive` (recursive.ts) runs that verb over many repos. The
19
+ // maintainers' preview of an unreleased version (preview.ts of @plexus-ms/dev)
20
+ // uses the same steps with a step of its own, the engine's with the templates
21
+ // of the checkout being cut as the new side, under a dry run, and opens nothing.
22
+ import { join } from 'node:path';
20
23
  import { bumpWorkflowRefs, WORKFLOW_REF } from "./bookkeeping.js";
21
- import { filesWithConflictMarkers, hasConflictMarkers, hasUnmergedEntries } from "./conflicts.js";
22
- import { ANSWERS_FILE, copierVia, parseAnswers, setAnswer } from "./copier.js";
24
+ import { filesWithConflictMarkers } from "./conflicts.js";
23
25
  import { run, write } from "./effects.js";
24
26
  import { detailOf } from "./io.js";
25
- import { askForReviews, createPull, needsAHand, pullBody, pullOf, versionBranch, } from "./pull.js";
26
- import { namesOldTemplate, templateSource } from "./templates.js";
27
+ import { MARKER_FILE } from "./marker.js";
28
+ import { MISE_FILE } from "./overview.js";
29
+ import { askForReviews, commitMessage, createPull, needsAHand, pinGap, pinSaid, pullBody, pullOf, versionBranch, } from "./pull.js";
27
30
  /** Whether the consumer needs a hand beyond reviewing its pull request. */
28
31
  export const needsHand = (t) => t.sites.some((s) => s.outcome !== 'clean') ||
29
32
  (t.marked?.length ?? 0) > 0 ||
30
33
  t.lockfile === 'failed' ||
31
- t.failed !== undefined;
32
- /**
33
- * copier at the version plx pins, through mise, with the consumer's own mise
34
- * config ignored: copier needs no project tool, and a root `mise.toml` left
35
- * with conflict markers by the root site's update would otherwise fail every
36
- * later mise call in the directory, the apps' updates first of all.
37
- */
38
- export const copierIn = (dir, args) => [
39
- 'env',
40
- [`MISE_IGNORED_CONFIG_PATHS=${dir}`, 'mise', ...copierVia(args)],
41
- ];
34
+ t.failed !== undefined ||
35
+ t.pin !== undefined;
42
36
  /**
43
37
  * One consumer takes the version in `dir`, a scratch checkout of its branch:
44
38
  * every site updated, the lockfile refreshed, the workflow refs bumped, then
@@ -46,102 +40,12 @@ export const copierIn = (dir, args) => [
46
40
  */
47
41
  export async function takeVersion(ctx, consumer, dir, take) {
48
42
  const base = (await ctx.read('git', ['rev-parse', 'HEAD'], { cwd: dir })).trim();
49
- const update = take.update ?? fromTemplate(take.ref);
50
- const sites = [];
51
- for (const site of consumer.sites)
52
- sites.push(await updateSite(ctx, consumer, site, dir, update));
43
+ const sites = await take.sites(ctx, consumer, dir);
53
44
  const lockfile = await refreshLockfile(ctx, consumer, dir, base);
54
45
  await bumpConsumerRefs(ctx, consumer, dir, take.version);
55
46
  const taken = { rel: consumer.rel, sites, ...(lockfile ? { lockfile } : {}) };
56
47
  return { ...taken, ...(await openPull(ctx, consumer, dir, base, take, taken)) };
57
48
  }
58
- /** A commit of plain plumbing on a scratch checkout: unsigned, no hooks, a stand-in identity. */
59
- export const scratchCommit = (ctx, dir, message) => ctx
60
- .stage(run('git', ['add', '-A'], { cwd: dir }))
61
- .then(() => ctx.stage(run('git', [
62
- '-c',
63
- 'commit.gpgsign=false',
64
- '-c',
65
- 'user.name=plx',
66
- '-c',
67
- 'user.email=plx@localhost',
68
- 'commit',
69
- '--quiet',
70
- '--no-verify',
71
- '--allow-empty',
72
- '-m',
73
- message,
74
- ], { cwd: dir })));
75
- /** copier against the published template, at `ref`. */
76
- const fromTemplate = (ref) => async (ctx, site, target, dir) => {
77
- ctx.say(`→ ${site.rel}: copier update${ref ? ` to ${ref}` : ''}`);
78
- // A template renamed on a version: the answers still name the old source,
79
- // which copier would clone through the forge's redirect; point them at
80
- // the current name first, committed because copier refuses a dirty
81
- // subproject.
82
- const answers = await ctx.readFile(join(target, ANSWERS_FILE));
83
- const current = templateSource(site.template);
84
- const recorded = parseAnswers(answers).src;
85
- if (recorded && namesOldTemplate(recorded)) {
86
- ctx.say(` ${site.rel}: the template is ${current} now; the answers follow`);
87
- await ctx.stage(write(join(target, ANSWERS_FILE), setAnswer(answers, '_src_path', current)));
88
- await scratchCommit(ctx, dir, `plx: ${site.rel} reads ${current}, the template's name since its rename`);
89
- }
90
- // Template tasks (mise install, hook setup) serve a developer's checkout,
91
- // not a pull request. Unattended, a new question takes its default; on a
92
- // terminal copier asks. A dry run previews on the scratch checkout, so
93
- // the step is staged there rather than only announced.
94
- const args = [
95
- 'update',
96
- '--skip-answered',
97
- '--trust',
98
- '--skip-tasks',
99
- ...(ref ? ['--vcs-ref', ref] : []),
100
- ...(ctx.yes || ctx.dryRun ? ['--defaults'] : []),
101
- ];
102
- const step = run(...copierIn(dir, args), { cwd: target, interactive: !ctx.dryRun });
103
- if (ctx.dryRun)
104
- await ctx.stage(step);
105
- else
106
- await ctx.apply([step]);
107
- };
108
- async function updateSite(ctx, consumer, site, dir, update) {
109
- const target = join(dir, relative(consumer.path, site.path));
110
- try {
111
- await update(ctx, site, target, dir);
112
- }
113
- catch (error) {
114
- const why = detailOf(error);
115
- ctx.say(` ✗ FAILED — copier update exited nonzero${why ? `: ${why}` : ''}`);
116
- return { rel: site.rel, outcome: 'failed', ...(why ? { detail: why } : {}) };
117
- }
118
- // copier applies the template diff with `git apply --3way`, which leaves
119
- // unmerged index entries and inline markers when a hunk does not apply.
120
- // Scoped to the site: the root site's changes are still in the tree when
121
- // its apps are updated.
122
- const status = await ctx.read('git', ['status', '--porcelain', '--', '.'], { cwd: target });
123
- let conflict = hasUnmergedEntries(status);
124
- const changed = (await ctx.read('git', ['diff', '--name-only', '--relative', '--', '.'], { cwd: target }))
125
- .split('\n')
126
- .filter(Boolean);
127
- for (const f of changed) {
128
- const text = await ctx.readFile(join(target, f)).catch(() => '');
129
- if (hasConflictMarkers(text))
130
- conflict = true;
131
- }
132
- if (conflict)
133
- ctx.say(' ✗ CONFLICTS — committed with their <<<<<<< markers, to resolve in the pull request:');
134
- else
135
- ctx.say(' ✓ merged clean:');
136
- for (const line of status.split('\n').filter(Boolean))
137
- ctx.say(` ${line}`);
138
- // Staged, so that the next site starts from a whole index: a conflict
139
- // leaves unmerged entries, and copier's own git plumbing (`git
140
- // write-tree`) refuses an index with those, so the next site's update
141
- // would fail; staged, the markers are in the tree and the index is whole.
142
- await ctx.stage(run('git', ['add', '-A'], { cwd: dir }));
143
- return { rel: site.rel, outcome: conflict ? 'conflicted' : 'clean' };
144
- }
145
49
  /**
146
50
  * Refresh the lockfile when the updates touched a manifest (`mise exec` trusts the directory's own config).
147
51
  * The lockfile is what this step writes, so the install is never frozen: pnpm freezes it by default under CI,
@@ -195,8 +99,9 @@ async function bumpConsumerRefs(ctx, consumer, dir, version) {
195
99
  * already on origin is never moved (pull.ts). Hooks are skipped: the checks
196
100
  * are the pull request's job, and the mount's own checkout may carry the
197
101
  * repo's hooks. The pull request is a draft when anything needs a hand, and
198
- * its body says what, from what the sites and the lockfile came to and the
199
- * detector over the committed tree.
102
+ * its body says what, from what the sites and the lockfile came to, the
103
+ * detector over the committed tree, and the `plx` pin of the root `mise.toml`
104
+ * where the root marker names the version and the pin does not.
200
105
  */
201
106
  async function openPull(ctx, consumer, dir, base, take, taken) {
202
107
  const { version } = take;
@@ -213,11 +118,11 @@ async function openPull(ctx, consumer, dir, base, take, taken) {
213
118
  const head = `${consumer.origin ?? 'origin'} ${branch}`;
214
119
  try {
215
120
  await ctx.apply([
216
- // Staged first: a site whose copier run failed mid-merge can leave unmerged entries, which a reset refuses.
121
+ // Staged first: a site's step can leave unmerged entries, which a reset refuses.
217
122
  run('git', ['add', '-A'], { cwd: dir }),
218
- // One commit on the branch, the scratch ones folded in: a later run tells it from a human's by the count.
123
+ // One commit on the branch, any scratch ones folded in: a later run tells it from a human's by the count.
219
124
  run('git', ['reset', '--quiet', '--soft', base], { cwd: dir }),
220
- run('git', ['commit', '--quiet', '--no-verify', '-m', `chore: Plexus ${version}`], { cwd: dir }),
125
+ run('git', ['commit', '--quiet', '--no-verify', '-m', commitMessage(version, taken.sites)], { cwd: dir }),
221
126
  // An empty expected value: the branch must not exist on origin yet.
222
127
  run('git', [
223
128
  'push',
@@ -235,18 +140,26 @@ async function openPull(ctx, consumer, dir, base, take, taken) {
235
140
  return { failed: `push to ${head}${why ? `: ${why}` : ''}` };
236
141
  }
237
142
  const marked = await filesWithConflictMarkers(ctx, dir);
238
- const of = (outcome) => taken.sites.filter((s) => s.outcome === outcome).map((s) => siteOf(consumer, s.rel));
143
+ const read = (file) => ctx.readFile(join(dir, file)).catch(() => undefined);
144
+ const pin = pinGap(version, await read(MARKER_FILE), await read(MISE_FILE));
145
+ const gap = pin ? { pin } : {};
146
+ const of = (outcome) => taken.sites.filter((s) => s.outcome === outcome).map((s) => s.dir);
239
147
  const state = {
240
148
  version,
241
- sites: consumer.sites.map((s) => relative(consumer.path, s.path) || '.'),
149
+ sites: taken.sites.map((s) => s.dir),
242
150
  conflicted: of('conflicted'),
243
151
  marked,
244
152
  failed: of('failed'),
245
153
  lockfile: taken.lockfile === 'failed',
154
+ ...gap,
155
+ conflicts: Object.fromEntries(taken.sites.map((s) => [s.dir, s.conflicts ?? []])),
156
+ kept: Object.fromEntries(taken.sites.map((s) => [s.dir, s.kept ?? []])),
246
157
  note: `Opened by ${take.opener}${take.why ? `: ${take.why}` : ''}.`,
247
158
  };
248
159
  if (marked.length > 0)
249
160
  ctx.say(` ${consumer.rel}: conflict markers in ${marked.join(', ')}`);
161
+ if (pin)
162
+ ctx.say(` ${consumer.rel}: ${pinSaid(pin, version)}`);
250
163
  let draft;
251
164
  try {
252
165
  draft = await createPull(ctx, consumer.rel, { base: consumer.branch, version, body: pullBody(state), draft: needsAHand(state) }, dir);
@@ -254,7 +167,7 @@ async function openPull(ctx, consumer, dir, base, take, taken) {
254
167
  catch (error) {
255
168
  const why = detailOf(error);
256
169
  ctx.say(` ✗ FAILED — pull request${why ? `: ${why}` : ''}`);
257
- return { marked, failed: `pull request${why ? `: ${why}` : ''}` };
170
+ return { marked, ...gap, failed: `pull request${why ? `: ${why}` : ''}` };
258
171
  }
259
172
  // Asking the forge for what it opened is a read like any other: a failure is reported, never "none".
260
173
  let opened;
@@ -264,23 +177,16 @@ async function openPull(ctx, consumer, dir, base, take, taken) {
264
177
  catch (error) {
265
178
  const why = detailOf(error);
266
179
  ctx.say(` ✗ FAILED — ${consumer.rel}: the pull request opened, but listing it failed${why ? `: ${why}` : ''}`);
267
- return { marked, pull: { branch, draft }, failed: `listing the pull request: ${why}` };
180
+ return { marked, ...gap, pull: { branch, draft }, failed: `listing the pull request: ${why}` };
268
181
  }
269
182
  const url = opened?.url;
270
183
  ctx.say(`• ${consumer.rel}: ${draft ? 'draft ' : ''}pull request opened${url ? `: ${url}` : ''}`);
271
184
  const pull = { branch, draft, ...(url ? { url } : {}) };
272
185
  if (!opened)
273
- return { marked, pull, failed: 'the forge did not list the pull request it opened' };
274
- // Unless named, from the root answers as copier left them at every site: a renamed or changed answer counts.
275
- const from = take.reviewers ?? {
276
- answersFile: await ctx.readFile(join(dir, ANSWERS_FILE)).catch(() => ''),
277
- };
186
+ return { marked, ...gap, pull, failed: 'the forge did not list the pull request it opened' };
187
+ // Unless named, from the root marker as the sites' step left it: a default it wrote counts.
188
+ const from = take.reviewers ?? { marker: await ctx.readFile(join(dir, MARKER_FILE)).catch(() => '') };
278
189
  const review = await askForReviews(ctx, consumer.rel, opened, from, dir);
279
- return { marked, pull, ...(review ? { review } : {}) };
280
- }
281
- /** A site's name in the run, as the repo names it: `.` for its root. */
282
- function siteOf(consumer, rel) {
283
- const s = consumer.sites.find((x) => x.rel === rel);
284
- return s ? relative(consumer.path, s.path) || '.' : rel;
190
+ return { marked, ...gap, pull, ...(review ? { review } : {}) };
285
191
  }
286
192
  //# sourceMappingURL=take.js.map
package/dist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jG,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,EAAE,GAAG,CAAC;IACxB,GAAG,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,sBAAsB,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClG,MAAM,IAAI,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACxD,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,MAAM,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,mDAAmD,EAAE,CAAC;IAC1G,4FAA4F;IAC5F,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACtG,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;IACzE,OAAO,EAAE,MAAM,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACjE,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** The directory that holds one directory per bundled template. */
2
+ export declare function templatesRoot(from?: string): string;
3
+ /** Whether `path` is a directory. */
4
+ export declare function isDirectory(path: string): boolean;
5
+ //# sourceMappingURL=templatesRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templatesRoot.d.ts","sourceRoot":"","sources":["../src/templatesRoot.ts"],"names":[],"mappings":"AAkBA,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,IAAI,GAAE,MAAwB,GAAG,MAAM,CAMpE;AAED,qCAAqC;AACrC,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMjD"}
@@ -0,0 +1,37 @@
1
+ // Where the templates are: the one function that says, so that no caller
2
+ // builds the path itself. The templates are `templates/` at the root of
3
+ // `tooling`, a directory per template; `@plexus-ms/cli` carries a
4
+ // copy of that directory beside its bundle, `dist/templates`, which its build
5
+ // makes (packages/cli/build.js), so that the published package has them.
6
+ //
7
+ // Two layouts, told apart by what exists next to the running file: a
8
+ // `templates` directory beside it is the built package's, and without one the
9
+ // file is in a package of the workspace (`packages/<name>/src` or `dist`), and
10
+ // the root is the repo's, three directories up. Tests and a workspace build run
11
+ // the second; an installed `plx` the first. Where neither exists, as in an
12
+ // installed package that was not bundled, it throws and names both places. `from` is the file's URL and
13
+ // defaults to this one's, so that a bundle, which is one file, answers for
14
+ // itself; a caller passes none.
15
+ import { statSync } from 'node:fs';
16
+ import { dirname, join, resolve } from 'node:path';
17
+ import { fileURLToPath } from 'node:url';
18
+ /** The directory that holds one directory per bundled template. */
19
+ export function templatesRoot(from = import.meta.url) {
20
+ const here = dirname(fileURLToPath(from));
21
+ const beside = join(here, 'templates');
22
+ const repo = join(here, '..', '..', '..', 'templates');
23
+ for (const root of [beside, repo])
24
+ if (isDirectory(root))
25
+ return root;
26
+ throw new Error(`no bundled templates: looked for ${beside} and ${resolve(repo)}`);
27
+ }
28
+ /** Whether `path` is a directory. */
29
+ export function isDirectory(path) {
30
+ try {
31
+ return statSync(path).isDirectory();
32
+ }
33
+ catch {
34
+ return false;
35
+ }
36
+ }
37
+ //# sourceMappingURL=templatesRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templatesRoot.js","sourceRoot":"","sources":["../src/templatesRoot.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wEAAwE;AACxE,kEAAkE;AAClE,8EAA8E;AAC9E,yEAAyE;AACzE,EAAE;AACF,qEAAqE;AACrE,8EAA8E;AAC9E,+EAA+E;AAC/E,gFAAgF;AAChF,2EAA2E;AAC3E,wGAAwG;AACxG,2EAA2E;AAC3E,gCAAgC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,mEAAmE;AACnE,MAAM,UAAU,aAAa,CAAC,OAAe,MAAM,CAAC,IAAI,CAAC,GAAG;IAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;IACvD,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC;QAAE,IAAI,WAAW,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;IACtE,MAAM,IAAI,KAAK,CAAC,oCAAoC,MAAM,QAAQ,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrF,CAAC;AAED,qCAAqC;AACrC,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
package/dist/update.d.ts CHANGED
@@ -1,22 +1,30 @@
1
1
  import { type Consumer } from './consumers.ts';
2
2
  import type { Context } from './context.ts';
3
3
  import { type Release } from './need.ts';
4
- import { type Review } from './pull.ts';
5
- import { type Taken } from './take.ts';
4
+ import { type PinGap, type Review } from './pull.ts';
5
+ import { type Templates } from './sync.ts';
6
+ import { type SiteResult, type Taken } from './take.ts';
7
+ import { type FetchVersion } from './versionTemplates.ts';
6
8
  export interface UpdateOptions {
7
- /** The repo to update: a checkout whose root is a site of a repo template. */
9
+ /** The repo to update: a checkout whose root marker names the version it is on. */
8
10
  repo: string;
9
11
  /** What the repo is called in the narration and the summary; default: its directory's name. */
10
12
  name?: string;
11
- /** The version to take, which is asking for it; default: the template's newest release. */
13
+ /** The Plexus version of the running plx, whose templates are bundled. */
14
+ plxVersion: string;
15
+ /** The templates the running plx bundles; default `templatesRoot()`. */
16
+ templates?: string;
17
+ /** How another version's templates are fetched; default: from the npm registry (versionTemplates.ts). */
18
+ fetch?: FetchVersion;
19
+ /** The version to take, which is asking for it; default: the newest release. */
12
20
  to?: string;
13
21
  /** Take the newest version whatever its step: somebody asks. */
14
22
  now?: boolean;
15
- /** The interval in days; default: the repo's answer `update_max_age`, else 7. */
23
+ /** The interval in days; default: the root marker's answer `update_max_age`, else 7. */
16
24
  maxAge?: number;
17
25
  /** The clock the interval is measured against, as a date; default: now. */
18
26
  today?: string;
19
- /** The users asked to review the pull request it opens; default: the repo's answer `pr_reviewers`, else none. */
27
+ /** The users asked to review the pull request it opens; default: the root marker's answer `pr_reviewers`, else none. */
20
28
  reviewers?: string[];
21
29
  }
22
30
  /**
@@ -31,13 +39,13 @@ export interface Known {
31
39
  }
32
40
  /**
33
41
  * What one repo's run came to; `version` is the one it took, looked at, or
34
- * would take. `current`: every site records it already. `skipped`: left
42
+ * would take. `current`: its root marker names it already. `skipped`: left
35
43
  * untouched, with why. `resting`: needs no version yet (need.ts), with what
36
44
  * would end the rest. `found`: its version branch is on origin already, with
37
45
  * the pull request found or, when there was none, opened there, the files of
38
- * the branch that hold conflict markers, its sites whose answers do not
39
- * record the version, whether it is ready to merge, why
40
- * looking at it failed, if it did, and the review request of one opened.
46
+ * the branch that hold conflict markers, its sites not at the version (its
47
+ * root, when the root marker does not name it), whether it is ready to merge,
48
+ * why looking at it failed, if it did, and the review request of one opened.
41
49
  * A closed or merged one is no pull to list.
42
50
  * `taken`: it took the version. `failed`: it could not be worked on, with why.
43
51
  */
@@ -59,6 +67,8 @@ export type Outcome = {
59
67
  opening?: true;
60
68
  marked: string[];
61
69
  behind: string[];
70
+ /** The root marker of the branch names the version, and the `plx` pin does not. */
71
+ pin?: PinGap;
62
72
  mergeable: boolean;
63
73
  failed?: string;
64
74
  review?: Review;
@@ -70,6 +80,34 @@ export type Outcome = {
70
80
  detail: string;
71
81
  });
72
82
  export declare function update(ctx: Context, options: UpdateOptions, known?: Known): Promise<Outcome>;
83
+ /**
84
+ * The version the repo is on at `ref`, origin's branch: its root marker's
85
+ * `version`, with the root marker's answers. Refuses a repo that still tracks
86
+ * a copier answers file there, any marker that cannot be read, and a root
87
+ * marker that names no version.
88
+ */
89
+ export declare function versionOn(ctx: Context, consumer: Consumer, ref: string): Promise<{
90
+ version: string;
91
+ answers: Record<string, unknown>;
92
+ }>;
93
+ /**
94
+ * The template step of a version taken (the header's steps 1 and 2), in the
95
+ * worktree `dir`: every marker that lists at least one template, rendered at
96
+ * `from` and at `to` and merged, the root rendered for its answers whatever it
97
+ * lists, the defaults and the version written into the markers. What became of
98
+ * each site is what the merge reported. `templates` yields the two sides; it
99
+ * is asked once the step has said which versions it takes, so that a fetch
100
+ * follows the line that names them. The maintainers' preview of an unreleased
101
+ * version (preview.ts of @plexus-ms/dev) gives the new side as the templates
102
+ * of its own checkout.
103
+ */
104
+ export declare function renderSites(ctx: Context, consumer: Consumer, dir: string, versions: {
105
+ from: string;
106
+ to: string;
107
+ }, templates: () => Promise<{
108
+ old: Templates;
109
+ new: Templates;
110
+ }>): Promise<SiteResult[]>;
73
111
  /** The versions (§ 1.6 PLX: every version tag has a release), with the dates they were cut; a draft is no version yet. */
74
112
  export declare function releasesOf(ctx: Context): Promise<Release[]>;
75
113
  //# sourceMappingURL=update.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../src/update.ts"],"names":[],"mappings":"AA0DA,OAAO,EAAE,KAAK,QAAQ,EAA8B,MAAM,gBAAgB,CAAC;AAC3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C,OAAO,EAA+B,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAEtE,OAAO,EAAoB,KAAK,MAAM,EAAuD,MAAM,WAAW,CAAC;AAC/G,OAAO,EAAE,KAAK,KAAK,EAAe,MAAM,WAAW,CAAC;AAIpD,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,gEAAgE;IAChE,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iHAAiH;IACjH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,KAAK;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,OAAO,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,CACtD;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACnC;IACE,I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