@plexus-ms/lib 0.1.0 → 0.3.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 (57) hide show
  1. package/LICENSE +674 -0
  2. package/dist/bookkeeping.d.ts +26 -0
  3. package/dist/bookkeeping.d.ts.map +1 -0
  4. package/dist/bookkeeping.js +51 -0
  5. package/dist/bookkeeping.js.map +1 -0
  6. package/dist/catalog.d.ts +23 -0
  7. package/dist/catalog.d.ts.map +1 -0
  8. package/dist/catalog.js +38 -0
  9. package/dist/catalog.js.map +1 -0
  10. package/dist/consumers.d.ts +31 -0
  11. package/dist/consumers.d.ts.map +1 -0
  12. package/dist/consumers.js +70 -0
  13. package/dist/consumers.js.map +1 -0
  14. package/dist/context.d.ts +7 -1
  15. package/dist/context.d.ts.map +1 -1
  16. package/dist/context.js +19 -3
  17. package/dist/context.js.map +1 -1
  18. package/dist/doctor.d.ts +19 -0
  19. package/dist/doctor.d.ts.map +1 -0
  20. package/dist/doctor.js +79 -0
  21. package/dist/doctor.js.map +1 -0
  22. package/dist/frontmatter.d.ts +9 -0
  23. package/dist/frontmatter.d.ts.map +1 -0
  24. package/dist/frontmatter.js +42 -0
  25. package/dist/frontmatter.js.map +1 -0
  26. package/dist/index.d.ts +10 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +9 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/io.d.ts +5 -1
  31. package/dist/io.d.ts.map +1 -1
  32. package/dist/io.js +5 -1
  33. package/dist/io.js.map +1 -1
  34. package/dist/overview.d.ts +5 -1
  35. package/dist/overview.d.ts.map +1 -1
  36. package/dist/overview.js +6 -7
  37. package/dist/overview.js.map +1 -1
  38. package/dist/plan.d.ts +2 -0
  39. package/dist/plan.d.ts.map +1 -1
  40. package/dist/plan.js.map +1 -1
  41. package/dist/propagate.d.ts +20 -0
  42. package/dist/propagate.d.ts.map +1 -0
  43. package/dist/propagate.js +226 -0
  44. package/dist/propagate.js.map +1 -0
  45. package/dist/requirements.d.ts +27 -0
  46. package/dist/requirements.d.ts.map +1 -0
  47. package/dist/requirements.js +188 -0
  48. package/dist/requirements.js.map +1 -0
  49. package/dist/ship.d.ts +18 -0
  50. package/dist/ship.d.ts.map +1 -0
  51. package/dist/ship.js +131 -0
  52. package/dist/ship.js.map +1 -0
  53. package/dist/train.d.ts +45 -0
  54. package/dist/train.d.ts.map +1 -0
  55. package/dist/train.js +102 -0
  56. package/dist/train.js.map +1 -0
  57. package/package.json +9 -10
@@ -0,0 +1,26 @@
1
+ /** `galaxy.yml` mirrors the tag: SCM installs record this version and reinstall on any different one. */
2
+ export declare const bumpGalaxyVersion: (text: string, train: string) => string;
3
+ /** The `plexus.platform` collection's pin in a platform repo's requirements; another collection in the same file stays. */
4
+ export declare function bumpCollectionPin(text: string, train: string): string;
5
+ export declare const WORKFLOW_REF = "plexus-ms/ci-cd/.github/workflows/";
6
+ /** Every `uses: plexus-ms/ci-cd/.github/workflows/<file>@<ref>` pinned to the train. */
7
+ export declare const bumpWorkflowRefs: (text: string, train: string) => string;
8
+ /** The map's frontmatter carries the train version and the date it was cut (§ 1.5 PLX). */
9
+ export declare const stampStandard: (text: string, train: string, today: string) => string;
10
+ /** `changed: <train>` on a module page: replaced in place, or inserted after `binds:` (the field order of § 1.3 PLX). */
11
+ export declare const stampChanged: (text: string, train: string) => string;
12
+ /** Leftovers of a three-way apply that did not go through. */
13
+ export declare const hasConflictMarkers: (text: string) => boolean;
14
+ /** Whether `git status --porcelain` output shows unmerged entries. */
15
+ export declare const hasUnmergedEntries: (porcelain: string) => boolean;
16
+ /**
17
+ * The marker says which train a unit was brought up to (§ 1.4 PLX). copier
18
+ * re-renders it only when the preset's content changed, so a train that
19
+ * touched nothing in a preset would leave `plexus:` behind while bumping the
20
+ * answers file; this syncs it to the answers file's `_commit`, which copier
21
+ * always writes. A marker with conflict markers is left to the human.
22
+ */
23
+ export declare function syncMarker(marker: string, commit: string): string;
24
+ /** Today as `YYYY-MM-DD` in local time, like `date +%F`. */
25
+ export declare function today(now?: Date): string;
26
+ //# sourceMappingURL=bookkeeping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bookkeeping.d.ts","sourceRoot":"","sources":["../src/bookkeeping.ts"],"names":[],"mappings":"AAMA,yGAAyG;AACzG,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MACN,CAAC;AAE3D,2HAA2H;AAC3H,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAYrE;AAED,eAAO,MAAM,YAAY,uCAAuC,CAAC;AAEjE,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MACqC,CAAC;AAErG,2FAA2F;AAC3F,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,OAAO,MAAM,KAAG,MACW,CAAC;AAEvF,yHAAyH;AACzH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MACM,CAAC;AAElE,8DAA8D;AAC9D,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,OAAkC,CAAC;AAErF,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,GAAI,WAAW,MAAM,KAAG,OAA4C,CAAC;AAEpG;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED,4DAA4D;AAC5D,wBAAgB,KAAK,CAAC,GAAG,OAAa,GAAG,MAAM,CAG9C"}
@@ -0,0 +1,51 @@
1
+ // The train bookkeeping as text transforms: every version number a train repo
2
+ // carries becomes the train version, so cross-repo pins are right by
3
+ // construction (§ 1.5 PLX). Pure functions from a file's text to its new text;
4
+ // `ship` reads, transforms and plans a write for each one that changed.
5
+ import { setFrontmatterField } from "./frontmatter.js";
6
+ /** `galaxy.yml` mirrors the tag: SCM installs record this version and reinstall on any different one. */
7
+ export const bumpGalaxyVersion = (text, train) => text.replace(/^(version: )\d+\.\d+\.\d+/m, `$1${train}`);
8
+ /** The `plexus.platform` collection's pin in a platform repo's requirements; another collection in the same file stays. */
9
+ export function bumpCollectionPin(text, train) {
10
+ const lines = text.split('\n');
11
+ const start = lines.findIndex((l) => l.includes('plexus-ms/platform.git'));
12
+ if (start === -1)
13
+ return text;
14
+ for (let i = start; i < lines.length; i++) {
15
+ const m = /^(\s*version: )v?[\d.]+$/.exec(lines[i] ?? '');
16
+ if (m) {
17
+ lines[i] = `${m[1]}${train}`;
18
+ break;
19
+ }
20
+ }
21
+ return lines.join('\n');
22
+ }
23
+ export const WORKFLOW_REF = 'plexus-ms/ci-cd/.github/workflows/';
24
+ /** Every `uses: plexus-ms/ci-cd/.github/workflows/<file>@<ref>` pinned to the train. */
25
+ export const bumpWorkflowRefs = (text, train) => text.replace(/(plexus-ms\/ci-cd\/\.github\/workflows\/[A-Za-z0-9._-]+)@v?[0-9.]+/g, `$1@${train}`);
26
+ /** The map's frontmatter carries the train version and the date it was cut (§ 1.5 PLX). */
27
+ export const stampStandard = (text, train, today) => setFrontmatterField(setFrontmatterField(text, 'version', train), 'timestamp', today);
28
+ /** `changed: <train>` on a module page: replaced in place, or inserted after `binds:` (the field order of § 1.3 PLX). */
29
+ export const stampChanged = (text, train) => setFrontmatterField(text, 'changed', train, { after: 'binds' });
30
+ /** Leftovers of a three-way apply that did not go through. */
31
+ export const hasConflictMarkers = (text) => /^<<<<<<< /m.test(text);
32
+ /** Whether `git status --porcelain` output shows unmerged entries. */
33
+ export const hasUnmergedEntries = (porcelain) => /^(UU|AA|DU|UD)/m.test(porcelain);
34
+ /**
35
+ * The marker says which train a unit was brought up to (§ 1.4 PLX). copier
36
+ * re-renders it only when the preset's content changed, so a train that
37
+ * touched nothing in a preset would leave `plexus:` behind while bumping the
38
+ * answers file; this syncs it to the answers file's `_commit`, which copier
39
+ * always writes. A marker with conflict markers is left to the human.
40
+ */
41
+ export function syncMarker(marker, commit) {
42
+ if (hasConflictMarkers(marker))
43
+ return marker;
44
+ return setFrontmatterField(marker, 'plexus', commit);
45
+ }
46
+ /** Today as `YYYY-MM-DD` in local time, like `date +%F`. */
47
+ export function today(now = new Date()) {
48
+ const pad = (n) => String(n).padStart(2, '0');
49
+ return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`;
50
+ }
51
+ //# sourceMappingURL=bookkeeping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bookkeeping.js","sourceRoot":"","sources":["../src/bookkeeping.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,qEAAqE;AACrE,+EAA+E;AAC/E,wEAAwE;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,yGAAyG;AACzG,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,KAAa,EAAU,EAAE,CACvE,IAAI,CAAC,OAAO,CAAC,4BAA4B,EAAE,KAAK,KAAK,EAAE,CAAC,CAAC;AAE3D,2HAA2H;AAC3H,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,KAAa;IAC3D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAC3E,IAAI,KAAK,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9B,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,MAAM,CAAC,GAAG,0BAA0B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE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,OAAO,mBAAmB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AACvD,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,KAAK,CAAC,GAAG,GAAG,IAAI,IAAI,EAAE;IACpC,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACtD,OAAO,GAAG,GAAG,CAAC,WAAW,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;AACjF,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { Context } from './context.ts';
2
+ export interface Module {
3
+ code: string;
4
+ kind: 'contract' | 'approach';
5
+ maturity: string;
6
+ binds: string;
7
+ /** The train in which the module's requirements last changed; standard modules only. */
8
+ changed?: string;
9
+ /** Codes on the same side of every seam that a declaration of this module has to accompany. */
10
+ depends: string[];
11
+ /** Contracts on the other side of a seam; never the declaring unit's to satisfy. */
12
+ consumes: string[];
13
+ }
14
+ export type Catalog = Map<string, Module>;
15
+ export declare const CATALOG_DIRS: {
16
+ readonly contracts: "contract";
17
+ readonly approaches: "approach";
18
+ };
19
+ /** The module a page declares, or undefined for a note. */
20
+ export declare function parseModule(text: string, kind: Module['kind']): Module | undefined;
21
+ /** Every module of a compendium checkout, by code. */
22
+ export declare function readCatalog(ctx: Context, compendium: string): Promise<Catalog>;
23
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+FAA+F;IAC/F,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,oFAAoF;IACpF,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1C,eAAO,MAAM,YAAY;;;CAA6D,CAAC;AAEvF,2DAA2D;AAC3D,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAYlF;AAMD,sDAAsD;AACtD,wBAAsB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAUpF"}
@@ -0,0 +1,38 @@
1
+ // The module catalogue: what the compendium's `contracts/` and `approaches/`
2
+ // pages declare in their frontmatter (§ 1.3 PLX). Only pages with a `code`
3
+ // are modules a marker can declare; notes have none and are skipped.
4
+ import { join } from 'node:path';
5
+ import { splitFrontmatter } from "./marker.js";
6
+ export const CATALOG_DIRS = { contracts: 'contract', approaches: 'approach' };
7
+ /** The module a page declares, or undefined for a note. */
8
+ export function parseModule(text, kind) {
9
+ const { data } = splitFrontmatter(text);
10
+ if (typeof data.code !== 'string')
11
+ return undefined;
12
+ return {
13
+ code: data.code,
14
+ kind,
15
+ maturity: String(data.maturity ?? ''),
16
+ binds: String(data.binds ?? ''),
17
+ changed: data.changed === undefined ? undefined : String(data.changed),
18
+ depends: codes(data.depends),
19
+ consumes: codes(data.consumes),
20
+ };
21
+ }
22
+ function codes(value) {
23
+ return Array.isArray(value) ? value.map(String) : [];
24
+ }
25
+ /** Every module of a compendium checkout, by code. */
26
+ export async function readCatalog(ctx, compendium) {
27
+ const catalog = new Map();
28
+ for (const [dir, kind] of Object.entries(CATALOG_DIRS)) {
29
+ const entries = await ctx.readDir(join(compendium, dir));
30
+ for (const e of entries.filter((e) => !e.directory && e.name.endsWith('.md') && e.name !== 'index.md').sort()) {
31
+ const module = parseModule(await ctx.readFile(join(compendium, dir, e.name)), kind);
32
+ if (module)
33
+ catalog.set(module.code, module);
34
+ }
35
+ }
36
+ return catalog;
37
+ }
38
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,2EAA2E;AAC3E,qEAAqE;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAiB/C,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAW,CAAC;AAEvF,2DAA2D;AAC3D,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,IAAoB;IAC5D,MAAM,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACpD,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI;QACJ,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;QACrC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACtE,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;QAC5B,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;KAC/B,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,KAAc;IAC3B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACvD,CAAC;AAED,sDAAsD;AACtD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAY,EAAE,UAAkB;IAChE,MAAM,OAAO,GAAY,IAAI,GAAG,EAAE,CAAC;IACnC,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACvD,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;QACzD,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YAC9G,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;YACpF,IAAI,MAAM;gBAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { Context } from './context.ts';
2
+ import type { Declaration } from './marker.ts';
3
+ import type { Directory } from './model.ts';
4
+ export interface Site {
5
+ path: string;
6
+ /** Relative to the workspace. */
7
+ rel: string;
8
+ /** The preset the site is generated from, e.g. `preset-repo-web`. */
9
+ preset: string;
10
+ }
11
+ export interface Consumer {
12
+ path: string;
13
+ rel: string;
14
+ branch: string;
15
+ expected?: 'main' | 'develop';
16
+ /** Why the consumer is left untouched this run, if it is. */
17
+ skipped?: string;
18
+ /** Its sites in tree order: the repo root before its apps. */
19
+ sites: Site[];
20
+ }
21
+ /** The branch a consumer must be on for an update to touch it; undefined when the marker says neither. */
22
+ export declare function expectedBranch(declaration?: Declaration): Consumer['expected'];
23
+ /** The template source copier records for a preset of the upstream organisation. */
24
+ export declare const presetSource: (preset: string) => string;
25
+ /**
26
+ * The consumers under a scanned workspace (`overview` with git facets), for
27
+ * the given presets. A site inside a template directory is the template's own
28
+ * and never a consumer; a site outside any git repo is reported, not updated.
29
+ */
30
+ export declare function findConsumers(ctx: Context, root: Directory, presets: readonly string[]): Promise<Consumer[]>;
31
+ //# sourceMappingURL=consumers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consumers.d.ts","sourceRoot":"","sources":["../src/consumers.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,0GAA0G;AAC1G,wBAAgB,cAAc,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,CAK9E;AAED,oFAAoF;AACpF,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,KAAG,MAAkC,CAAC;AAEjF;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAyClH"}
@@ -0,0 +1,70 @@
1
+ // The consumers of the presets: every copier-managed site in a workspace
2
+ // (tenant repo roots and their apps/*) and the repo each belongs to, with the
3
+ // rule that protects a consumer from an update it did not ask for: a repo is
4
+ // touched only on its expected branch and with no tracked modifications;
5
+ // untracked files do not block. The expected branch is read from the repo's
6
+ // marker (§ 1.4 PLX): a platform repo (declares PLX-Platform) rides main, an
7
+ // app repo (declares PLX-Repo) rides develop.
8
+ import { relative } from 'node:path';
9
+ /** The branch a consumer must be on for an update to touch it; undefined when the marker says neither. */
10
+ export function expectedBranch(declaration) {
11
+ if (!declaration)
12
+ return undefined;
13
+ if (declaration.modules.includes('PLX-Platform'))
14
+ return 'main';
15
+ if (declaration.modules.includes('PLX-Repo'))
16
+ return 'develop';
17
+ return undefined;
18
+ }
19
+ /** The template source copier records for a preset of the upstream organisation. */
20
+ export const presetSource = (preset) => `gh:plexus-ms/${preset}`;
21
+ /**
22
+ * The consumers under a scanned workspace (`overview` with git facets), for
23
+ * the given presets. A site inside a template directory is the template's own
24
+ * and never a consumer; a site outside any git repo is reported, not updated.
25
+ */
26
+ export async function findConsumers(ctx, root, presets) {
27
+ const sources = new Map(presets.map((p) => [presetSource(p), p]));
28
+ const consumers = new Map();
29
+ const orphans = [];
30
+ const visit = (dir, repo, inTemplate) => {
31
+ const here = dir.git ? dir : repo;
32
+ const template = inTemplate || Boolean(dir.template);
33
+ const preset = dir.copier?.src ? sources.get(dir.copier.src) : undefined;
34
+ if (preset && !template) {
35
+ const site = { path: dir.path, rel: relative(root.path, dir.path) || '.', preset };
36
+ if (!here)
37
+ orphans.push(site);
38
+ else {
39
+ let consumer = consumers.get(here.path);
40
+ if (!consumer) {
41
+ consumer = {
42
+ path: here.path,
43
+ rel: relative(root.path, here.path) || '.',
44
+ branch: here.git?.branch ?? '?',
45
+ expected: expectedBranch(here.declaration),
46
+ sites: [],
47
+ };
48
+ consumers.set(here.path, consumer);
49
+ }
50
+ consumer.sites.push(site);
51
+ }
52
+ }
53
+ for (const child of dir.children)
54
+ visit(child, here, template);
55
+ };
56
+ visit(root, undefined, false);
57
+ for (const site of orphans)
58
+ ctx.say(`⚠ ${site.rel}: not inside a git repo — skipped`);
59
+ for (const c of consumers.values()) {
60
+ if (c.expected && c.branch !== c.expected) {
61
+ c.skipped = `on '${c.branch}', expected '${c.expected}'`;
62
+ continue;
63
+ }
64
+ const tracked = (await ctx.read('git', ['status', '--porcelain', '--untracked-files=no'], { cwd: c.path })).trim();
65
+ if (tracked !== '')
66
+ c.skipped = 'has uncommitted changes';
67
+ }
68
+ return [...consumers.values()];
69
+ }
70
+ //# sourceMappingURL=consumers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consumers.js","sourceRoot":"","sources":["../src/consumers.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,8EAA8E;AAC9E,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,6EAA6E;AAC7E,8CAA8C;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAwBrC,0GAA0G;AAC1G,MAAM,UAAU,cAAc,CAAC,WAAyB;IACtD,IAAI,CAAC,WAAW;QAAE,OAAO,SAAS,CAAC;IACnC,IAAI,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;QAAE,OAAO,MAAM,CAAC;IAChE,IAAI,WAAW,CAAC,OAAO,CAAC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M,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,sBAAsB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACnH,IAAI,OAAO,KAAK,EAAE;YAAE,CAAC,CAAC,OAAO,GAAG,yBAAyB,CAAC;IAC5D,CAAC;IACD,OAAO,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;AACjC,CAAC"}
package/dist/context.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type DirEntry, type ExecOptions, type Io } from './io.ts';
2
- import { type Plan } from './plan.ts';
2
+ import { type Plan, type Step } from './plan.ts';
3
3
  export interface Options {
4
4
  dryRun?: boolean;
5
5
  /** 0: every effect; 1: reads and inputs too; 2: subprocess output too. */
@@ -36,6 +36,12 @@ export declare class Context {
36
36
  confirm(question: string): Promise<boolean>;
37
37
  /** Narrate and perform each step in order; the first failure stops the run. */
38
38
  apply(plan: Plan): Promise<void>;
39
+ /**
40
+ * Perform a step on scratch state, whatever the mode: the one exception to
41
+ * "a dry run performs no effect", for a preview that has to run a tool
42
+ * against a throwaway copy to be honest. Resolves with the output of a run.
43
+ */
44
+ stage(step: Step): Promise<string | undefined>;
39
45
  private perform;
40
46
  }
41
47
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,KAAK,EAAE,EAAU,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAkB,KAAK,IAAI,EAAa,MAAM,WAAW,CAAC;AAEjE,MAAM,WAAW,OAAO;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CA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QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKvC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAO1C;;;OAGG;IACG,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IASjD,+EAA+E;IACzE,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAStC;;;;OAIG;IACH,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;YAOhC,OAAO;CAYtB"}
package/dist/context.js CHANGED
@@ -4,6 +4,9 @@
4
4
  // read look at the world; always performed, so a dry run sees real state
5
5
  // apply perform a Plan (plan.ts); every step is narrated with its exact
6
6
  // shell line, and performed unless --dry-run
7
+ // stage perform a step on scratch state the run owns (a preview clone, a
8
+ // temporary directory): narrated as a read, performed even under
9
+ // --dry-run, because nothing the operator owns changes
7
10
  // result print the command's product: human-readable, or JSON under --json
8
11
  //
9
12
  // Plan, then confirm, then apply: validation and every read happen while
@@ -86,15 +89,28 @@ export class Context {
86
89
  await this.perform(step);
87
90
  }
88
91
  }
89
- perform(step) {
90
- const inherit = this.verbose >= 2;
92
+ /**
93
+ * Perform a step on scratch state, whatever the mode: the one exception to
94
+ * "a dry run performs no effect", for a preview that has to run a tool
95
+ * against a throwaway copy to be honest. Resolves with the output of a run.
96
+ */
97
+ stage(step) {
98
+ this.say(`? ${describe(step)}`, 1);
99
+ const input = body(step);
100
+ if (input !== undefined)
101
+ this.say(indent(input), 2);
102
+ return this.perform(step);
103
+ }
104
+ async perform(step) {
105
+ const inherit = this.verbose >= 2 || (step.kind === 'run' && step.interactive === true);
91
106
  switch (step.kind) {
92
107
  case 'run':
93
108
  return this.io.exec(step.command, step.args, { cwd: step.cwd, input: step.input, inherit });
94
109
  case 'ssh':
95
110
  return this.io.exec('ssh', [step.host, 'bash', '-s'], { input: step.script, inherit });
96
111
  case 'write':
97
- return this.io.writeFile(step.path, step.content);
112
+ await this.io.writeFile(step.path, step.content);
113
+ return undefined;
98
114
  }
99
115
  }
100
116
  }
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,sCAAsC;AACtC,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,sDAAsD;AACtD,6EAA6E;AAC7E,EAAE;AACF,yEAAyE;AACzE,6EAA6E;AAC7E,wEAAwE;AACxE,4EAA4E;AAC5E,oEAAoE;AACpE,OAAO,EAA4C,MAAM,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAwB,MAAM,WAAW,CAAC;AAWjE,MAAM,OAAO,OAAO;IACT,MAAM,CAAU;IAChB,OAAO,CAAS;IAChB,KAAK,CAAU;IACf,GAAG,CAAU;IACb,IAAI,CAAU;IACd,EAAE,CAAK;IAEhB,YAAY,OAAgB,EAAE,KAAS,MAAM,EAAE;QAC7C,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC;QACtC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC;QACpC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,KAAK,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,KAAK,CAAC;IACpC,CAAC;IAED,6EAA6E;IAE7E,kFAAkF;IAClF,GAAG,CAAC,IAAY,EAAE,KAAK,GAAG,CAAC;QACzB,IAAI,IAA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CAAC;gBACjD,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;CACF;AAED,SAAS,WAAW,CAAC,IAAa;IAChC,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5D,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,IAAI;SACR,OAAO,EAAE;SACT,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;SACtB,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { Catalog } from './catalog.ts';
2
+ import type { Directory } from './model.ts';
3
+ export interface Diagnosis {
4
+ /** The marker's directory, relative to the scanned root. */
5
+ path: string;
6
+ plexus?: string;
7
+ modules: string[];
8
+ findings: string[];
9
+ }
10
+ export interface Report {
11
+ declarations: Diagnosis[];
12
+ /** Declarations with at least one finding. */
13
+ stale: number;
14
+ }
15
+ /** A scanned tree against a catalogue: pure, so a test compares reports. */
16
+ export declare function diagnose(root: Directory, catalog: Catalog): Report;
17
+ /** Numeric comparison of two train versions; suffixes ignored. */
18
+ export declare function compareTrains(a: string, b: string): number;
19
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,WAAW,SAAS;IACxB,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,MAAM;IACrB,YAAY,EAAE,SAAS,EAAE,CAAC;IAC1B,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAIlE;AA4DD,kEAAkE;AAClE,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAS1D"}
package/dist/doctor.js ADDED
@@ -0,0 +1,79 @@
1
+ // doctor: the staleness check (§ 13.4 PLX), a verb, not a system.
2
+ //
3
+ // Every PLEXUS.md marker under a directory is read, and for each module it
4
+ // declares the module's `changed` train is compared with the marker's
5
+ // `plexus`; every `depends` entry of a declared module has to be declared
6
+ // where § 1.4 says it is satisfied: by the unit itself, by an enclosing
7
+ // declaration (an app's repo, a repo's tenant) or by a contained one (a
8
+ // repo's apps, a tenant's repos). What a module `consumes` is the other side
9
+ // of a seam and never this unit's to declare. Findings are reported, never
10
+ // fixed. A tenant is a directory whose repos sit side by side; the repo whose
11
+ // marker declares PLX-Tenancy is the tenant's declaration.
12
+ //
13
+ // plx doctor # every marker, one line each
14
+ // plx doctor ~/dev --compendium ~/dev/plexus-ms/compendium
15
+ import { relative } from 'node:path';
16
+ /** A scanned tree against a catalogue: pure, so a test compares reports. */
17
+ export function diagnose(root, catalog) {
18
+ const units = collect(root, []);
19
+ const declarations = units.map((u) => diagnoseUnit(u, units, catalog, root.path));
20
+ return { declarations, stale: declarations.filter((d) => d.findings.length > 0).length };
21
+ }
22
+ function collect(dir, ancestors, parent) {
23
+ const here = dir.declaration || dir.problems?.some((p) => p.startsWith('PLEXUS.md')) ? [{ dir, ancestors, parent }] : [];
24
+ const below = dir.declaration ? [...ancestors, dir] : ancestors;
25
+ return [...here, ...dir.children.flatMap((c) => collect(c, below, dir))];
26
+ }
27
+ function diagnoseUnit(unit, units, catalog, root) {
28
+ const { dir } = unit;
29
+ const path = relative(root, dir.path) || '.';
30
+ const problem = dir.problems?.find((p) => p.startsWith('PLEXUS.md'));
31
+ if (!dir.declaration)
32
+ return { path, modules: [], findings: [problem?.replace(/^PLEXUS\.md: /, '') ?? 'unreadable marker'] };
33
+ const { plexus, modules } = dir.declaration;
34
+ const context = new Set(contextOf(unit, units).flatMap((d) => d.declaration?.modules ?? []));
35
+ const findings = [];
36
+ for (const code of modules) {
37
+ const module = catalog.get(code);
38
+ if (!module) {
39
+ findings.push(`declares ${code}, which no module carries`);
40
+ continue;
41
+ }
42
+ if (module.changed && compareTrains(module.changed, plexus) > 0)
43
+ findings.push(`${code} changed in ${module.changed}, declared at ${plexus}`);
44
+ for (const dep of module.depends)
45
+ if (!modules.includes(dep) && !context.has(dep))
46
+ findings.push(`${code} depends on ${dep}, declared neither here nor by an enclosing or contained declaration`);
47
+ }
48
+ return { path, plexus, modules, findings };
49
+ }
50
+ /** The declarations that may satisfy a unit's dependencies: enclosing and contained ones (§ 1.4 PLX). */
51
+ function contextOf(unit, units) {
52
+ const { dir, ancestors } = unit;
53
+ const context = [...ancestors, ...descendants(dir)];
54
+ // The tenant: the repo's siblings. A unit inside a repo belongs to that repo; a repo is its own.
55
+ const repo = ancestors[0] ?? dir;
56
+ const repoParent = units.find((u) => u.dir === repo)?.parent;
57
+ const siblings = repoParent?.children.filter((c) => c !== repo && c.declaration) ?? [];
58
+ const isTenancy = (d) => d.declaration?.modules.includes('PLX-Tenancy') ?? false;
59
+ context.push(...siblings.filter(isTenancy));
60
+ if (isTenancy(dir))
61
+ context.push(...siblings);
62
+ return context;
63
+ }
64
+ function descendants(dir) {
65
+ return dir.children.flatMap((c) => [...(c.declaration ? [c] : []), ...descendants(c)]);
66
+ }
67
+ /** Numeric comparison of two train versions; suffixes ignored. */
68
+ export function compareTrains(a, b) {
69
+ const nums = (v) => v
70
+ .split('.')
71
+ .slice(0, 3)
72
+ .map((p) => Number.parseInt(p, 10) || 0);
73
+ const [x, y] = [nums(a), nums(b)];
74
+ for (let i = 0; i < 3; i++)
75
+ if ((x[i] ?? 0) !== (y[i] ?? 0))
76
+ return (x[i] ?? 0) > (y[i] ?? 0) ? 1 : -1;
77
+ return 0;
78
+ }
79
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,2EAA2E;AAC3E,sEAAsE;AACtE,0EAA0E;AAC1E,wEAAwE;AACxE,wEAAwE;AACxE,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,2DAA2D;AAC3D,EAAE;AACF,0EAA0E;AAC1E,6DAA6D;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAkBrC,4EAA4E;AAC5E,MAAM,UAAU,QAAQ,CAAC,IAAe,EAAE,OAAgB;IACxD,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAChC,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAClF,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AAC3F,CAAC;AAUD,SAAS,OAAO,CAAC,GAAc,EAAE,SAAsB,EAAE,MAAkB;IACzE,MAAM,IAAI,GACR,GA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,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;QAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvG,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,9 @@
1
+ export interface SetFieldOptions {
2
+ /** When the field is absent, insert it after this key; at the end of the frontmatter otherwise. */
3
+ after?: string;
4
+ }
5
+ /** The page with `key: value` set in its frontmatter; the same text when already so. */
6
+ export declare function setFrontmatterField(text: string, key: string, value: string, options?: SetFieldOptions): string;
7
+ /** The value of a frontmatter field as written, trimmed; undefined when absent. */
8
+ export declare function frontmatterField(text: string, key: string): string | undefined;
9
+ //# sourceMappingURL=frontmatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../src/frontmatter.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,eAAe;IAC9B,mGAAmG;IACnG,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wFAAwF;AACxF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,MAAM,CAgBnH;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAM9E"}
@@ -0,0 +1,42 @@
1
+ // Line-based edits of a page's YAML frontmatter: the marker's `plexus`, the
2
+ // map's `version` and `timestamp`, a module's `changed`. Pages are authored by
3
+ // hand, so an edit replaces or inserts one line and leaves everything else,
4
+ // comments and order included, exactly as written; re-serialising the YAML
5
+ // would not. Reading frontmatter is marker.ts's `splitFrontmatter`.
6
+ /** The index range of the frontmatter's inner lines, or undefined when the page has none. */
7
+ function frontmatterLines(lines) {
8
+ if (lines[0] !== '---')
9
+ return undefined;
10
+ const end = lines.findIndex((l, i) => i > 0 && l === '---');
11
+ return end === -1 ? undefined : { start: 1, end };
12
+ }
13
+ /** The page with `key: value` set in its frontmatter; the same text when already so. */
14
+ export function setFrontmatterField(text, key, value, options = {}) {
15
+ const lines = text.split('\n');
16
+ const fm = frontmatterLines(lines);
17
+ if (!fm)
18
+ throw new Error('no frontmatter: expected a `---` block at the top');
19
+ const line = `${key}: ${value}`;
20
+ const isKey = (l) => l.startsWith(`${key}:`);
21
+ const existing = lines.findIndex((l, i) => i >= fm.start && i < fm.end && isKey(l));
22
+ if (existing !== -1) {
23
+ lines[existing] = line;
24
+ }
25
+ else {
26
+ const anchor = options.after
27
+ ? lines.findIndex((l, i) => i >= fm.start && i < fm.end && l.startsWith(`${options.after}:`))
28
+ : -1;
29
+ lines.splice(anchor === -1 ? fm.end : anchor + 1, 0, line);
30
+ }
31
+ return lines.join('\n');
32
+ }
33
+ /** The value of a frontmatter field as written, trimmed; undefined when absent. */
34
+ export function frontmatterField(text, key) {
35
+ const lines = text.split('\n');
36
+ const fm = frontmatterLines(lines);
37
+ if (!fm)
38
+ return undefined;
39
+ const line = lines.slice(fm.start, fm.end).find((l) => l.startsWith(`${key}:`));
40
+ return line?.slice(key.length + 1).trim();
41
+ }
42
+ //# sourceMappingURL=frontmatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../src/frontmatter.ts"],"names":[],"mappings":"AAAA,4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ergedEntries, stampChanged, stampStandard, syncMarker, today, } from './bookkeeping.ts';
2
+ export { CATALOG_DIRS, type Catalog, type Module, parseModule, readCatalog } from './catalog.ts';
3
+ export { type Consumer, expectedBranch, findConsumers, presetSource, type Site } from './consumers.ts';
1
4
  export { Context, type Options } from './context.ts';
2
5
  export { ANSWERS_FILE, type Answers, parseAnswers, TEMPLATE_FILES } from './copier.ts';
6
+ export { compareTrains, type Diagnosis, diagnose, type Report } from './doctor.ts';
7
+ export { frontmatterField, setFrontmatterField } from './frontmatter.ts';
3
8
  export { type DirEntry, ExecError, type ExecOptions, type Io, realIo, render } from './io.ts';
4
9
  export { type Declaration, MARKER_FILE, parseMarker, splitFrontmatter } from './marker.ts';
5
10
  export { type Directory, type GitFacet, isNotable, type Kind, kindOf, shortRemote, type TemplateFacet, } from './model.ts';
6
- export { overview, PRUNED } from './overview.ts';
11
+ export { overview, PRUNED, type ScanOptions } from './overview.ts';
7
12
  export { body, describe, type Plan, run, type Step, ssh, write } from './plan.ts';
13
+ export { isClean, propagate, type Summary } from './propagate.ts';
14
+ export { type CompendiumCheck, checkCompendium, extractRequirements, MAP_PAGE, modulePages, type PageMode, type Scan, scanPage, } from './requirements.ts';
15
+ export { type ShipOptions, type ShipResult, ship } from './ship.ts';
16
+ export { isTrainVersion, latestTag, nextMinor, preflightRelease, readTrain, resolveVersion, TRAIN_REPOS, type Train, type TrainRepo, UPSTREAM, UsageError, } from './train.ts';
8
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,KAAK,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,KAAK,QAAQ,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,E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AAkB,CAAC;AACzE,OAAO,EAAE,KAAK,QAAQ,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9F,OAAO,EAAE,KAAK,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,EACL,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,SAAS,EACT,KAAK,IAAI,EACT,MAAM,EACN,WAAW,EACX,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EACL,KAAK,eAAe,EACpB,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,KAAK,QAAQ,EACb,KAAK,IAAI,EACT,QAAQ,GACT,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EACL,cAAc,EACd,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,WAAW,EACX,KAAK,KAAK,EACV,KAAK,SAAS,EACd,QAAQ,EACR,UAAU,GACX,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -6,11 +6,20 @@
6
6
  // package is an adapter that maps argv onto this. The parsers of Plexus's own
7
7
  // file shapes (marker.ts, copier.ts) live here, once, for every verb.
8
8
  // Conventions: compendium/miscellaneous/cli-design.md.
9
+ export { bumpCollectionPin, bumpGalaxyVersion, bumpWorkflowRefs, hasConflictMarkers, hasUnmergedEntries, stampChanged, stampStandard, syncMarker, today, } from "./bookkeeping.js";
10
+ export { CATALOG_DIRS, parseModule, readCatalog } from "./catalog.js";
11
+ export { expectedBranch, findConsumers, presetSource } from "./consumers.js";
9
12
  export { Context } from "./context.js";
10
13
  export { ANSWERS_FILE, parseAnswers, TEMPLATE_FILES } from "./copier.js";
14
+ export { compareTrains, diagnose } from "./doctor.js";
15
+ export { frontmatterField, setFrontmatterField } from "./frontmatter.js";
11
16
  export { ExecError, realIo, render } from "./io.js";
12
17
  export { MARKER_FILE, parseMarker, splitFrontmatter } from "./marker.js";
13
18
  export { isNotable, kindOf, shortRemote, } from "./model.js";
14
19
  export { overview, PRUNED } from "./overview.js";
15
20
  export { body, describe, run, ssh, write } from "./plan.js";
21
+ export { isClean, propagate } from "./propagate.js";
22
+ export { checkCompendium, extractRequirements, MAP_PAGE, modulePages, scanPage, } from "./requirements.js";
23
+ export { ship } from "./ship.js";
24
+ export { isTrainVersion, latestTag, nextMinor, preflightRelease, readTrain, resolveVersion, TRAIN_REPOS, UPSTREAM, UsageError, } from "./train.js";
16
25
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,0EAA0E;AAC1E,8EAA8E;AAC9E,sEAAsE;AACtE,uDAAuD;AACvD,OAAO,EAAE,OAAO,EAAgB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,YAAY,EAAgB,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAiB,SAAS,EAA6B,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9F,OAAO,EAAoB,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,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