@plexus-ms/lib 0.129.1 → 0.131.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 (92) hide show
  1. package/dist/apply.d.ts +25 -0
  2. package/dist/apply.d.ts.map +1 -0
  3. package/dist/apply.js +205 -0
  4. package/dist/apply.js.map +1 -0
  5. package/dist/bundled.d.ts +15 -0
  6. package/dist/bundled.d.ts.map +1 -0
  7. package/dist/bundled.js +42 -0
  8. package/dist/bundled.js.map +1 -0
  9. package/dist/consumers.d.ts +8 -21
  10. package/dist/consumers.d.ts.map +1 -1
  11. package/dist/consumers.js +62 -58
  12. package/dist/consumers.js.map +1 -1
  13. package/dist/doctor.d.ts +17 -1
  14. package/dist/doctor.d.ts.map +1 -1
  15. package/dist/doctor.js +173 -15
  16. package/dist/doctor.js.map +1 -1
  17. package/dist/engine.d.ts +2 -0
  18. package/dist/engine.d.ts.map +1 -0
  19. package/dist/engine.js +9 -0
  20. package/dist/engine.js.map +1 -0
  21. package/dist/frontmatter.d.ts.map +1 -1
  22. package/dist/frontmatter.js +6 -5
  23. package/dist/frontmatter.js.map +1 -1
  24. package/dist/index.d.ts +11 -4
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +11 -4
  27. package/dist/index.js.map +1 -1
  28. package/dist/marker.d.ts +38 -0
  29. package/dist/marker.d.ts.map +1 -1
  30. package/dist/marker.js +269 -16
  31. package/dist/marker.js.map +1 -1
  32. package/dist/model.d.ts +5 -2
  33. package/dist/model.d.ts.map +1 -1
  34. package/dist/model.js +8 -4
  35. package/dist/model.js.map +1 -1
  36. package/dist/need.d.ts +1 -1
  37. package/dist/need.d.ts.map +1 -1
  38. package/dist/need.js +2 -2
  39. package/dist/need.js.map +1 -1
  40. package/dist/newSite.d.ts +31 -0
  41. package/dist/newSite.d.ts.map +1 -0
  42. package/dist/newSite.js +185 -0
  43. package/dist/newSite.js.map +1 -0
  44. package/dist/overview.d.ts +4 -8
  45. package/dist/overview.d.ts.map +1 -1
  46. package/dist/overview.js +9 -32
  47. package/dist/overview.js.map +1 -1
  48. package/dist/pull.d.ts +48 -21
  49. package/dist/pull.d.ts.map +1 -1
  50. package/dist/pull.js +183 -67
  51. package/dist/pull.js.map +1 -1
  52. package/dist/recursive.d.ts.map +1 -1
  53. package/dist/recursive.js +7 -5
  54. package/dist/recursive.js.map +1 -1
  55. package/dist/siteTemplates.d.ts +14 -0
  56. package/dist/siteTemplates.d.ts.map +1 -0
  57. package/dist/siteTemplates.js +107 -0
  58. package/dist/siteTemplates.js.map +1 -0
  59. package/dist/sites.d.ts +24 -0
  60. package/dist/sites.d.ts.map +1 -0
  61. package/dist/sites.js +89 -0
  62. package/dist/sites.js.map +1 -0
  63. package/dist/standard-index.json +1 -1
  64. package/dist/summary.d.ts +1 -1
  65. package/dist/summary.d.ts.map +1 -1
  66. package/dist/summary.js +6 -1
  67. package/dist/summary.js.map +1 -1
  68. package/dist/sync.d.ts +86 -0
  69. package/dist/sync.d.ts.map +1 -0
  70. package/dist/sync.js +227 -0
  71. package/dist/sync.js.map +1 -0
  72. package/dist/take.d.ts +20 -25
  73. package/dist/take.d.ts.map +1 -1
  74. package/dist/take.js +48 -142
  75. package/dist/take.js.map +1 -1
  76. package/dist/templates.d.ts +1 -3
  77. package/dist/templates.d.ts.map +1 -1
  78. package/dist/templates.js +5 -9
  79. package/dist/templates.js.map +1 -1
  80. package/dist/templatesRoot.d.ts +5 -0
  81. package/dist/templatesRoot.d.ts.map +1 -0
  82. package/dist/templatesRoot.js +37 -0
  83. package/dist/templatesRoot.js.map +1 -0
  84. package/dist/update.d.ts +18 -9
  85. package/dist/update.d.ts.map +1 -1
  86. package/dist/update.js +166 -78
  87. package/dist/update.js.map +1 -1
  88. package/dist/versionTemplates.d.ts +24 -0
  89. package/dist/versionTemplates.d.ts.map +1 -0
  90. package/dist/versionTemplates.js +168 -0
  91. package/dist/versionTemplates.js.map +1 -0
  92. package/package.json +2 -1
package/dist/take.js.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AC;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"}
@@ -7,7 +7,7 @@ export declare const templateSource: (template: string) => string;
7
7
  * became the Turborepo template, the platform repo the operations repo; 0.120.0:
8
8
  * the repos' `preset-` prefix became `template-`, copier's own word). A
9
9
  * consumer whose answers still name the old one is a consumer of the current
10
- * one, and its next update points the answers at the new name.
10
+ * one.
11
11
  */
12
12
  export declare const RENAMED_TEMPLATES: Readonly<Record<string, string>>;
13
13
  /**
@@ -16,6 +16,4 @@ export declare const RENAMED_TEMPLATES: Readonly<Record<string, string>>;
16
16
  * templates. Owner and repo name are compared, not the spelling.
17
17
  */
18
18
  export declare function templateOf(src: string, templates: readonly string[]): string | undefined;
19
- /** Whether a recorded source names a template by a name it had before a rename, in any spelling. */
20
- export declare function namesOldTemplate(src: string): boolean;
21
19
  //# sourceMappingURL=templates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAMA,iFAAiF;AACjF,eAAO,MAAM,SAAS,EAAE,SAAS,MAAM,EAA6D,CAAC;AAErG,sFAAsF;AACtF,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,KAAG,MAAoC,CAAC;AAEvF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAM9D,CAAC;AAmBF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAMxF;AAED,oGAAoG;AACpG,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGrD"}
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAOA,iFAAiF;AACjF,eAAO,MAAM,SAAS,EAAE,SAAS,MAAM,EAA6D,CAAC;AAErG,sFAAsF;AACtF,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,KAAG,MAAoC,CAAC;AAEvF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAM9D,CAAC;AAmBF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAMxF"}
package/dist/templates.js CHANGED
@@ -1,7 +1,8 @@
1
1
  // The templates (§ 1.6 PLX) by name, and what a copier answers file's recorded
2
- // source says about which one a site is generated from. Both the model (which
3
- // repo is the operations repo) and the consumers (which sites an update
4
- // takes) read a source through `templateOf`.
2
+ // source says about which one a site is generated from. The model (which repo
3
+ // is the operations repo) and the consumers (which repos `update` refuses as
4
+ // not crossed over, which sites the preview of an unreleased version takes)
5
+ // read a source through `templateOf`.
5
6
  import { VERSIONED_REPOS } from "./version.js";
6
7
  /** The versioned repos that are templates: what a repo can be generated from. */
7
8
  export const TEMPLATES = VERSIONED_REPOS.filter((r) => r.startsWith('template-'));
@@ -12,7 +13,7 @@ export const templateSource = (template) => `gh:plexus-ms/${template}`;
12
13
  * became the Turborepo template, the platform repo the operations repo; 0.120.0:
13
14
  * the repos' `preset-` prefix became `template-`, copier's own word). A
14
15
  * consumer whose answers still name the old one is a consumer of the current
15
- * one, and its next update points the answers at the new name.
16
+ * one.
16
17
  */
17
18
  export const RENAMED_TEMPLATES = {
18
19
  'preset-repo-web': 'template-repo-turbo',
@@ -47,9 +48,4 @@ export function templateOf(src, templates) {
47
48
  const current = Object.hasOwn(RENAMED_TEMPLATES, repo.name) ? RENAMED_TEMPLATES[repo.name] : undefined;
48
49
  return current && templates.includes(current) ? current : undefined;
49
50
  }
50
- /** Whether a recorded source names a template by a name it had before a rename, in any spelling. */
51
- export function namesOldTemplate(src) {
52
- const repo = githubRepoOf(src);
53
- return repo?.owner === UPSTREAM && Object.hasOwn(RENAMED_TEMPLATES, repo.name);
54
- }
55
51
  //# sourceMappingURL=templates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"templates.js","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,wEAAwE;AACxE,6CAA6C;AAC7C,OAAO,EAAE,eAAe,EAA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,MAAM,QAAQ,GAAG,WAAW,CAAC;AAE7B;;;;;GAKG;AACH,SAAS,YAAY,CAAC,GAAW;IAC/B,MAAM,CAAC,GACL,4HAA4H,CAAC,IAAI,CAC/H,GAAG,CAAC,IAAI,EAAE,CACX,CAAC;IACJ,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9F,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW,EAAE,SAA4B;IAClE,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,IAAI,EAAE,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC/C,IAAI,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IACpD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACvG,OAAO,OAAO,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACtE,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,29 @@
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';
4
+ import { type PinGap, type Review } from './pull.ts';
5
5
  import { type Taken } from './take.ts';
6
+ import { type FetchVersion } from './versionTemplates.ts';
6
7
  export interface UpdateOptions {
7
- /** The repo to update: a checkout whose root is a site of a repo template. */
8
+ /** The repo to update: a checkout whose root marker names the version it is on. */
8
9
  repo: string;
9
10
  /** What the repo is called in the narration and the summary; default: its directory's name. */
10
11
  name?: string;
11
- /** The version to take, which is asking for it; default: the template's newest release. */
12
+ /** The Plexus version of the running plx, whose templates are bundled. */
13
+ plxVersion: string;
14
+ /** The templates the running plx bundles; default `templatesRoot()`. */
15
+ templates?: string;
16
+ /** How another version's templates are fetched; default: from the npm registry (versionTemplates.ts). */
17
+ fetch?: FetchVersion;
18
+ /** The version to take, which is asking for it; default: the newest release. */
12
19
  to?: string;
13
20
  /** Take the newest version whatever its step: somebody asks. */
14
21
  now?: boolean;
15
- /** The interval in days; default: the repo's answer `update_max_age`, else 7. */
22
+ /** The interval in days; default: the root marker's answer `update_max_age`, else 7. */
16
23
  maxAge?: number;
17
24
  /** The clock the interval is measured against, as a date; default: now. */
18
25
  today?: string;
19
- /** The users asked to review the pull request it opens; default: the repo's answer `pr_reviewers`, else none. */
26
+ /** The users asked to review the pull request it opens; default: the root marker's answer `pr_reviewers`, else none. */
20
27
  reviewers?: string[];
21
28
  }
22
29
  /**
@@ -31,13 +38,13 @@ export interface Known {
31
38
  }
32
39
  /**
33
40
  * 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
41
+ * would take. `current`: its root marker names it already. `skipped`: left
35
42
  * untouched, with why. `resting`: needs no version yet (need.ts), with what
36
43
  * would end the rest. `found`: its version branch is on origin already, with
37
44
  * 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.
45
+ * the branch that hold conflict markers, its sites not at the version (its
46
+ * root, when the root marker does not name it), whether it is ready to merge,
47
+ * why looking at it failed, if it did, and the review request of one opened.
41
48
  * A closed or merged one is no pull to list.
42
49
  * `taken`: it took the version. `failed`: it could not be worked on, with why.
43
50
  */
@@ -59,6 +66,8 @@ export type Outcome = {
59
66
  opening?: true;
60
67
  marked: string[];
61
68
  behind: string[];
69
+ /** The root marker of the branch names the version, and the `plx` pin does not. */
70
+ pin?: PinGap;
62
71
  mergeable: boolean;
63
72
  failed?: string;
64
73
  review?: Review;
@@ -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;IAA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MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,mFAAmF;IACnF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CACrC,CAAC;AAEF,wBAAsB,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CA6IlG;AA0HD,0HAA0H;AAC1H,wBAAsB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAUjE"}
package/dist/update.js CHANGED
@@ -5,25 +5,59 @@
5
5
  // Which version it takes, if any, is need.ts's decision, by the step of the
6
6
  // version number: a patch (a hotfix) at once, a minor (routine) at the repo's
7
7
  // next scheduled pull, once the oldest version it has not taken is as old as
8
- // its interval (`update_max_age` in its answers, in days; 7 when they do not
9
- // say, zero for every version), a major (a changed contract) only when asked.
10
- // Asked (`--now`, or a version named), it takes the newest version, or the one
11
- // named, whatever its step. Otherwise the repo rests: one line saying why,
12
- // exit 0.
8
+ // its interval (`update_max_age` in its root marker, in days; 7 when it does
9
+ // not say, zero for every version), a major (a changed contract) only when
10
+ // asked. Asked (`--now`, or a version named), it takes the newest version, or
11
+ // the one named, whatever its step. Otherwise the repo rests: one line saying
12
+ // why, exit 0.
13
13
  //
14
14
  // The versions are the compendium's GitHub releases (every version tag is locked
15
15
  // by one, § 1.6 PLX, and the compendium is released last, so a version shows
16
16
  // there once it is cut everywhere), asked of the forge as an operator would
17
17
  // (`gh api repos/plexus-ms/compendium/releases`): their numbers are the steps,
18
- // and their dates are what the interval is measured against. The work happens in a
19
- // worktree of origin's branch, never in the checkout: a developer's branch and
20
- // edits stay as they are, and in CI the worktree shares the checkout's
21
- // credentials, so the push and the pull request need no second token. Then
22
- // `takeVersion` (take.ts): copier update at every site, lockfile,
23
- // workflow refs, one commit on `plexus/<version>`, one pull request. The
24
- // sites are those origin's branch holds, by the walk's rule
25
- // (`sitesOfTree`, consumers.ts), as a later run reads them at the version
26
- // branch's tip; a site the checkout lacks is updated all the same.
18
+ // and their dates are what the interval is measured against.
19
+ //
20
+ // The repo is judged by what origin has on the branch the version lands on
21
+ // (consumers.ts), never by the checkout, which may be behind it or on a branch
22
+ // of its own. Its markers there are its configuration (sites.ts): the root
23
+ // marker's `version` is the version the repo is on, and refusing a downgrade,
24
+ // the interval and readiness all read it. A repo that still tracks a copier
25
+ // answers file there has not crossed over to the markers, and is refused with
26
+ // the crossover runbook: that refusal is the only crossover code. So is a
27
+ // marker that cannot be read, and a root marker that names no version.
28
+ //
29
+ // Taking the version happens in a worktree of origin's branch, never in the
30
+ // checkout: a developer's branch and edits stay as they are, and in CI the
31
+ // worktree shares the checkout's credentials, so the push and the pull request
32
+ // need no second token. The template step, then `takeVersion` (take.ts):
33
+ // 1. A site is a marker in the worktree that lists at least one template
34
+ // (sites.ts); one that lists none, or names no `templates` at all, is
35
+ // valid and renders nothing, and is no site of the update. The root is
36
+ // rendered in any case, for the answers it gives the nested sites and for
37
+ // the `version` it is written, and merged only where it is a site. Each
38
+ // site, the root first, has two sides, its markers' answers and
39
+ // templates as they are: the old side rendered with the templates of the
40
+ // version the repo is on, the new side with those of the version it
41
+ // takes. The templates of the running plx's own version are the ones it
42
+ // bundles, rendered by its own engine; any other version's are fetched
43
+ // from the registry and rendered by that version's plx-template
44
+ // (versionTemplates.ts). A version that cannot be fetched or rendered
45
+ // fails the run, which pushes nothing.
46
+ // 2. The two renders are merged into each site by the engine's rules
47
+ // (sync.ts): a local edit merges, a conflict stays in the file between
48
+ // `<<<<<<< current` and `>>>>>>> new render`, a file the version drops and
49
+ // the user edited is kept without markers, named by the commit and the
50
+ // pull request since nothing in the file shows it, and a born-once file
51
+ // the old render holds stays as the user left it. The defaults of questions that became
52
+ // applicable and the new `version` are spliced into the markers in one
53
+ // write each. Birth commands are never run, and neither is `mise
54
+ // install`: tools serve a developer's checkout, not a pull request.
55
+ // 3. The lockfile where a manifest moved, the workflow refs, one commit on
56
+ // `plexus/<version>`, and one pull request (take.ts). The `plx` pin is a
57
+ // line of a template's mise.toml, and nothing writes it apart: where the
58
+ // line merges, it moves in the same commit as the version; where it does
59
+ // not (the line edited or deleted, mise.toml gone, a root without
60
+ // templates), the pull request waits, and its body says so (pull.ts).
27
61
  //
28
62
  // What the run came to is returned as data, one `Outcome` for the repo, which
29
63
  // the caller folds into the summary (summary.ts). Run over many repos
@@ -35,93 +69,77 @@
35
69
  // never moved, so a daily run never touches a branch somebody is working on;
36
70
  // deleting the branch is how a pull is redone. With its pull request open, the
37
71
  // run looks at it again (pull.ts): the branch read as origin has it, the body
38
- // rewritten to what still needs a hand, ready once no conflict marker remains
39
- // and every site's answers record the version.
72
+ // rewritten to what still needs a hand, ready once no conflict marker remains,
73
+ // the root marker names the version, and the root mise.toml pins plx at it.
40
74
  // With no pull request in any state (opening it failed after the push), the
41
75
  // run opens it then; a closed or merged one stays as a human left it.
42
- // A repo whose every site already records the newest version does nothing at
76
+ // A repo whose root marker already names the newest version does nothing at
43
77
  // all.
44
78
  //
45
79
  // The pull request it opens asks for a review from the users the repo's root
46
- // answers name (`pr_reviewers`), or from those `reviewers` names instead
80
+ // marker names (`pr_reviewers`), or from those `reviewers` names instead
47
81
  // (pull.ts), once, when it is opened. The answer is read and checked only
48
- // then, from the answers as the pull request's branch has them, after copier
49
- // ran: a renamed or changed answer counts in the very pull request that
50
- // brings it, a bad one fails no run that opens nothing, and the pull request
51
- // is opened all the same, with the refused answer reported.
82
+ // then, from the root marker as the pull request's branch has it: a bad one
83
+ // fails no run that opens nothing, and the pull request is opened all the
84
+ // same, with the refused answer reported.
52
85
  //
53
86
  // plx update # the version the repo's schedule takes, if any
54
87
  // plx update --now # the newest version, whatever its step
55
88
  // plx -n update --now # preview in a worktree, push nothing
56
89
  // plx -y update --to 0.102.0 # unattended, an explicit version
57
90
  // plx update --recursive ~/dev # every repo under a directory (recursive.ts)
58
- import { basename, join, relative } from 'node:path';
59
- import { findConsumers, sitesOfTree } from "./consumers.js";
60
- import { ANSWERS_FILE, parseAnswers } from "./copier.js";
91
+ import { basename, join } from 'node:path';
92
+ import { CROSSOVER_RUNBOOK } from "./apply.js";
93
+ import { findRepos } from "./consumers.js";
94
+ import { ANSWERS_FILE } from "./copier.js";
95
+ import { crossedOver } from "./doctor.js";
61
96
  import { run } from "./effects.js";
62
97
  import { detailOf, ExecError } from "./io.js";
98
+ import { MARKER_FILE } from "./marker.js";
63
99
  import { maxAgeOf, needOf } from "./need.js";
64
100
  import { overview } from "./overview.js";
65
- import { openLate, pullOf, revisit, tipOnOrigin, versionBranch } from "./pull.js";
101
+ import { openLate, pullOf, revisit, tipOnOrigin, versionBranch, } from "./pull.js";
102
+ import { findSites, siteAnswers } from "./sites.js";
103
+ import { planSync } from "./sync.js";
66
104
  import { takeVersion } from "./take.js";
67
- import { TEMPLATES, templateSource } from "./templates.js";
68
105
  import { COMPENDIUM, compareVersions, isPlexusVersion, preflightForge, UsageError } from "./version.js";
106
+ import { templatesOf } from "./versionTemplates.js";
69
107
  export async function update(ctx, options, known) {
70
108
  if (options.to !== undefined && !isPlexusVersion(options.to))
71
109
  throw new UsageError(`'${options.to}' is not plain semver (X.Y.Z, no v)`);
72
110
  const consumer = known?.consumer ?? (await repoAt(ctx, options.repo, options.name ?? basename(options.repo)));
73
111
  const { path: repo, rel: name } = consumer;
74
- const root = consumer.sites.find((s) => s.path === consumer.path);
75
- if (!root)
76
- throw new Error(`${name}: its root is not a site of a repo template`);
77
112
  if (!known)
78
113
  await preflightForge(ctx);
79
114
  const releases = known?.releases ?? (options.to === undefined ? await releasesOf(ctx) : []);
80
115
  const newest = options.to ?? newestOf(releases);
81
- // The repo is judged by what its origin has on the branch the version lands
82
- // on, not by the checkout, which may be behind it or on a branch of its own.
83
- // Without that branch on origin there is nothing to take the version on.
116
+ // Without the branch the version lands on there is nothing to take it on.
84
117
  if ((await onOrigin(ctx, repo, consumer.branch)) === false) {
85
118
  const reason = `origin has no branch \`${consumer.branch}\`, the one the version lands on`;
86
119
  ctx.say(`⚠ ${name}: ${reason} — skipped`);
87
120
  return { repo: name, version: newest, kind: 'skipped', reason };
88
121
  }
89
122
  await ctx.read('git', ['fetch', '--quiet', 'origin', consumer.branch], { cwd: repo }).catch(() => '');
90
- // The sites origin's branch holds, by the walk's rule; the checkout's, read on origin where they can be, when it cannot be read.
91
- const onBranch = await sitesOfTree(ctx, repo, `refs/remotes/origin/${consumer.branch}`).catch(() => undefined);
92
- const answers = onBranch
93
- ? onBranch.sites.map((s) => s.answers ?? { answers: {} })
94
- : await Promise.all(consumer.sites.map(async (s) => {
95
- const file = join(relative(consumer.path, s.path), ANSWERS_FILE);
96
- const onOrigin = await ctx
97
- .read('git', ['show', `origin/${consumer.branch}:${file}`], { cwd: repo })
98
- .catch(() => undefined);
99
- return parseAnswers(onOrigin ?? (await ctx.readFile(join(s.path, ANSWERS_FILE))));
100
- }));
101
- const rootAnswers = onBranch
102
- ? onBranch.sites.find((s) => s.dir === '.')?.answers
103
- : answers[consumer.sites.indexOf(root)];
104
- const recorded = answers.map((a) => a.commit);
105
- if (recorded.every((c) => c === newest)) {
123
+ const base = `refs/remotes/origin/${consumer.branch}`;
124
+ const on = await versionOn(ctx, consumer, base);
125
+ if (on.version === newest) {
106
126
  ctx.say(`• ${name}: already at ${newest}`);
107
127
  return { repo: name, version: newest, kind: 'current' };
108
128
  }
109
- // copier refuses a downgrade; say so before a worktree is made for nothing.
110
- const past = recorded.find((c) => c && isPlexusVersion(c) && compareVersions(c, newest) > 0);
111
- if (past)
112
- throw new Error(`${name} is at ${past}, past ${newest}; a repo is never taken back to an older version`);
129
+ if (compareVersions(on.version, newest) > 0)
130
+ throw new Error(`${name} is at ${on.version}, past ${newest}; a repo is never taken back to an older version`);
113
131
  const asked = options.to !== undefined || options.now === true;
114
132
  const need = asked
115
133
  ? { take: true, version: newest, why: `asked for (${options.to !== undefined ? `--to ${newest}` : '--now'})` }
116
134
  : needOf({
117
- recorded,
135
+ recorded: [on.version],
118
136
  releases,
119
- maxAge: options.maxAge ?? maxAgeOf(rootAnswers?.answers ?? {}),
137
+ maxAge: options.maxAge ?? maxAgeOf(on.answers),
120
138
  now: options.today === undefined ? new Date() : new Date(options.today),
121
139
  });
122
140
  if (need.held)
123
141
  ctx.say(`• ${name}: ${need.held} (plx update --now takes it)`);
124
- // Unless named, read where the pull request is opened, from its branch's answers, and only then.
142
+ // Unless named, read where the pull request is opened, from its branch's root marker, and only then.
125
143
  const reviewers = options.reviewers ? { named: options.reviewers } : undefined;
126
144
  // A repo that rests is looked at for the newest version: one asked for earlier may be on origin.
127
145
  const version = need.take ? need.version : newest;
@@ -144,6 +162,7 @@ export async function update(ctx, options, known) {
144
162
  ...(late.previewed ? { opening: true } : {}),
145
163
  marked: late.marked,
146
164
  behind: late.behind,
165
+ ...(late.pin ? { pin: late.pin } : {}),
147
166
  mergeable: late.pull !== undefined && !late.pull.draft && late.ready,
148
167
  ...(late.failed ? { failed: late.failed } : {}),
149
168
  ...(late.review ? { review: late.review } : {}),
@@ -198,19 +217,21 @@ export async function update(ctx, options, known) {
198
217
  ctx.say(` ✗ FAILED — worktree of origin/${consumer.branch}${why ? `: ${why}` : ''}`);
199
218
  return { repo: name, version, kind: 'failed', detail: `worktree of origin/${consumer.branch}: ${why}` };
200
219
  }
201
- // The sites the worktree of origin's branch holds, which is what is judged, not the checkout's.
202
- const held = (await sitesOfTree(ctx, dir, 'HEAD')).sites;
203
- const sites = held.flatMap((s) => s.template
204
- ? [{ path: join(repo, s.dir), rel: s.dir === '.' ? name : join(name, s.dir), template: s.template }]
205
- : []);
206
- const taken = await takeVersion(ctx, { ...consumer, sites }, dir, {
207
- version,
208
- ref: version,
209
- opener: '`plx update`',
210
- why: need.why,
211
- ...(reviewers ? { reviewers } : {}),
212
- });
213
- return { repo: name, version, kind: 'taken', taken };
220
+ try {
221
+ const taken = await takeVersion(ctx, consumer, dir, {
222
+ version,
223
+ opener: '`plx update`',
224
+ why: need.why,
225
+ sites: (ctx, consumer, dir) => renderSites(ctx, consumer, dir, { from: on.version, to: version, scratch: join(scratch, 'versions') }, options),
226
+ ...(reviewers ? { reviewers } : {}),
227
+ });
228
+ return { repo: name, version, kind: 'taken', taken };
229
+ }
230
+ catch (error) {
231
+ const why = error.message;
232
+ ctx.say(` ✗ FAILED — ${name}: ${why}`);
233
+ return { repo: name, version, kind: 'failed', detail: why };
234
+ }
214
235
  }
215
236
  finally {
216
237
  await ctx.stage(run('git', ['worktree', 'remove', '--force', dir], { cwd: repo })).catch(() => undefined);
@@ -219,21 +240,88 @@ export async function update(ctx, options, known) {
219
240
  }
220
241
  }
221
242
  /**
222
- * The repo at `path`, which must be generated from a repo template, as a
223
- * consumer whose sites are named from `name` rather than from a workspace.
243
+ * The version the repo is on at `ref`, origin's branch: its root marker's
244
+ * `version`, with the root marker's answers. Refuses a repo that still tracks
245
+ * a copier answers file there, any marker that cannot be read, and a root
246
+ * marker that names no version.
247
+ */
248
+ async function versionOn(ctx, consumer, ref) {
249
+ const where = `on origin's \`${consumer.branch}\``;
250
+ const tracked = (await ctx.read('git', ['ls-tree', '-r', '-z', '--name-only', ref], { cwd: consumer.path }))
251
+ .split('\0')
252
+ .filter(Boolean);
253
+ if (!crossedOver(tracked))
254
+ throw new Error(`${consumer.rel} still tracks a ${ANSWERS_FILE} ${where}: it has not crossed over from copier to the markers, which plx update reads; follow ${CROSSOVER_RUNBOOK}`);
255
+ const sites = await findSites(ctx, consumer.path, ref);
256
+ const problems = sites.filter((s) => s.problem !== undefined);
257
+ if (problems.length > 0)
258
+ throw new Error(problems.map((s) => `${join(s.dir, MARKER_FILE)} ${where}: ${s.problem}`).join('\n'));
259
+ const root = sites.find((s) => s.dir === '.')?.config;
260
+ if (root?.version === undefined)
261
+ throw new Error(`the root ${MARKER_FILE} of ${consumer.rel} ${where} names no version, so plx update cannot tell which version it is on`);
262
+ return { version: root.version, answers: root.answers };
263
+ }
264
+ /**
265
+ * The template step of a version taken (the header's steps 1 and 2), in the
266
+ * worktree `dir`: every marker that lists at least one template, rendered at
267
+ * `from` and at `to` and merged, the root rendered for its answers whatever it
268
+ * lists, the defaults and the version written into the markers. What became of
269
+ * each site is what the merge reported.
224
270
  */
271
+ async function renderSites(ctx, consumer, dir, versions, options) {
272
+ const sites = await findSites(ctx, dir, 'HEAD');
273
+ const sourceOf = (site) => ({
274
+ templates: site.config?.templates ?? [],
275
+ answers: siteAnswers(sites, site.dir),
276
+ });
277
+ const lists = (site) => (site.config?.templates?.length ?? 0) > 0;
278
+ const taken = sites.filter((s) => s.dir === '.' || lists(s));
279
+ const sides = taken.map((s) => ({
280
+ dir: s.dir,
281
+ old: sourceOf(s),
282
+ new: sourceOf(s),
283
+ ...(lists(s) ? {} : { contextOnly: true }),
284
+ }));
285
+ const siblings = sites
286
+ .filter((s) => s.dir !== '.')
287
+ .map((s) => ({ dir: s.dir, templates: s.config?.templates ?? [], answers: s.config?.answers ?? {} }));
288
+ ctx.say(`→ ${consumer.rel}: the templates of ${versions.from} and ${versions.to}, merged`);
289
+ const of = (version) => templatesOf(ctx, version, {
290
+ plxVersion: options.plxVersion,
291
+ scratch: versions.scratch,
292
+ ...(options.templates ? { bundled: options.templates } : {}),
293
+ ...(options.fetch ? { fetch: options.fetch } : {}),
294
+ });
295
+ const plan = await planSync(ctx, dir, { old: await of(versions.from), new: await of(versions.to) }, sides, {
296
+ labels: { old: `the templates of ${versions.from}`, new: `the templates of ${versions.to}` },
297
+ siblings,
298
+ version: versions.to,
299
+ });
300
+ await plan.perform();
301
+ return plan.sites.map((s) => {
302
+ const rel = s.dir === '.' ? consumer.rel : join(consumer.rel, s.dir);
303
+ const inRepo = (path) => (s.dir === '.' ? path : join(s.dir, path));
304
+ const dropped = plan.dropped[s.dir] ?? [];
305
+ const kept = dropped.map(inRepo);
306
+ const conflicts = s.report
307
+ .filter((e) => e.outcome === 'conflicted' && !dropped.includes(e.path))
308
+ .map((e) => inRepo(e.path));
309
+ const conflicted = conflicts.length + kept.length > 0;
310
+ ctx.say(conflicted ? ` ✗ CONFLICTS at ${rel}, committed with their markers` : ` ✓ merged clean: ${rel}`);
311
+ for (const path of kept)
312
+ ctx.say(` kept although ${versions.to} drops it, since it was edited here: ${path}`);
313
+ return { rel, dir: s.dir, outcome: conflicted ? 'conflicted' : 'clean', conflicts, kept };
314
+ });
315
+ }
316
+ /** The repo at `path`, which must be generated from the templates, named `name` rather than from a workspace. */
225
317
  async function repoAt(ctx, path, name) {
226
318
  const tree = await overview(ctx, path);
227
- const found = (await findConsumers(ctx, tree, TEMPLATES)).find((c) => c.path === tree.path);
319
+ const found = (await findRepos(ctx, tree)).find((c) => c.path === tree.path);
228
320
  if (!found)
229
- throw new Error(`${path} is not a repo generated from the templates: no ${ANSWERS_FILE} at its root naming one of ${TEMPLATES.map(templateSource).join(', ')}`);
321
+ throw new Error(`${path} is not a repo generated from the templates: its root ${MARKER_FILE} names no version and lists no templates`);
230
322
  if (found.skipped)
231
323
  throw new Error(`${name}: ${found.skipped}`);
232
- return {
233
- ...found,
234
- rel: name,
235
- sites: found.sites.map((s) => ({ ...s, rel: s.rel === '.' ? name : join(name, s.rel) })),
236
- };
324
+ return { ...found, rel: name };
237
325
  }
238
326
  /**
239
327
  * Whether origin has the branch: true or false as `git ls-remote` answers,