@plexus-ms/lib 0.122.1 → 0.124.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 (90) hide show
  1. package/dist/bookkeeping.d.ts +0 -8
  2. package/dist/bookkeeping.d.ts.map +1 -1
  3. package/dist/bookkeeping.js +5 -16
  4. package/dist/bookkeeping.js.map +1 -1
  5. package/dist/compose.d.ts +41 -0
  6. package/dist/compose.d.ts.map +1 -0
  7. package/dist/compose.js +169 -0
  8. package/dist/compose.js.map +1 -0
  9. package/dist/consumers.d.ts +3 -18
  10. package/dist/consumers.d.ts.map +1 -1
  11. package/dist/consumers.js +13 -42
  12. package/dist/consumers.js.map +1 -1
  13. package/dist/context.d.ts +6 -0
  14. package/dist/context.d.ts.map +1 -1
  15. package/dist/context.js +14 -5
  16. package/dist/context.js.map +1 -1
  17. package/dist/deploy.d.ts +11 -3
  18. package/dist/deploy.d.ts.map +1 -1
  19. package/dist/deploy.js +185 -120
  20. package/dist/deploy.js.map +1 -1
  21. package/dist/deployTargets.d.ts.map +1 -1
  22. package/dist/deployTargets.js +8 -7
  23. package/dist/deployTargets.js.map +1 -1
  24. package/dist/doctor.d.ts +121 -15
  25. package/dist/doctor.d.ts.map +1 -1
  26. package/dist/doctor.js +512 -71
  27. package/dist/doctor.js.map +1 -1
  28. package/dist/effects.d.ts +3 -0
  29. package/dist/effects.d.ts.map +1 -1
  30. package/dist/effects.js.map +1 -1
  31. package/dist/frontmatter.js +1 -1
  32. package/dist/frontmatter.js.map +1 -1
  33. package/dist/index.d.ts +10 -10
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +10 -10
  36. package/dist/index.js.map +1 -1
  37. package/dist/io.d.ts +28 -0
  38. package/dist/io.d.ts.map +1 -1
  39. package/dist/io.js +86 -4
  40. package/dist/io.js.map +1 -1
  41. package/dist/marker.d.ts +22 -5
  42. package/dist/marker.d.ts.map +1 -1
  43. package/dist/marker.js +100 -13
  44. package/dist/marker.js.map +1 -1
  45. package/dist/model.d.ts +48 -4
  46. package/dist/model.d.ts.map +1 -1
  47. package/dist/model.js +59 -11
  48. package/dist/model.js.map +1 -1
  49. package/dist/need.d.ts +11 -34
  50. package/dist/need.d.ts.map +1 -1
  51. package/dist/need.js +92 -54
  52. package/dist/need.js.map +1 -1
  53. package/dist/overview.d.ts +25 -0
  54. package/dist/overview.d.ts.map +1 -1
  55. package/dist/overview.js +106 -14
  56. package/dist/overview.js.map +1 -1
  57. package/dist/propagate.d.ts +3 -3
  58. package/dist/propagate.d.ts.map +1 -1
  59. package/dist/propagate.js +8 -6
  60. package/dist/propagate.js.map +1 -1
  61. package/dist/requirements.d.ts +1 -1
  62. package/dist/requirements.d.ts.map +1 -1
  63. package/dist/requirements.js +6 -5
  64. package/dist/requirements.js.map +1 -1
  65. package/dist/standard-index.json +90 -6
  66. package/dist/take.d.ts +1 -1
  67. package/dist/take.d.ts.map +1 -1
  68. package/dist/take.js +6 -25
  69. package/dist/take.js.map +1 -1
  70. package/dist/templates.d.ts +21 -0
  71. package/dist/templates.d.ts.map +1 -0
  72. package/dist/templates.js +55 -0
  73. package/dist/templates.js.map +1 -0
  74. package/dist/update.d.ts +3 -3
  75. package/dist/update.d.ts.map +1 -1
  76. package/dist/update.js +58 -71
  77. package/dist/update.js.map +1 -1
  78. package/dist/version.d.ts +7 -2
  79. package/dist/version.d.ts.map +1 -1
  80. package/dist/version.js +17 -2
  81. package/dist/version.js.map +1 -1
  82. package/package.json +1 -1
  83. package/dist/catalog.d.ts +0 -23
  84. package/dist/catalog.d.ts.map +0 -1
  85. package/dist/catalog.js +0 -38
  86. package/dist/catalog.js.map +0 -1
  87. package/dist/manifest.d.ts +0 -20
  88. package/dist/manifest.d.ts.map +0 -1
  89. package/dist/manifest.js +0 -59
  90. package/dist/manifest.js.map +0 -1
package/dist/doctor.d.ts CHANGED
@@ -1,19 +1,125 @@
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. */
1
+ import { type Compose, type Mapping } from './compose.ts';
2
+ import type { Context } from './context.ts';
3
+ import { type Declaration } from './marker.ts';
4
+ import { type Kind } from './model.ts';
5
+ export type Profile = 'stateless' | 'stateful';
6
+ /** The marker as read: its declaration, or why it cannot be read. */
7
+ export interface MarkerRead {
8
+ declaration?: Declaration;
9
+ problem?: string;
10
+ }
11
+ /** What doctor read of a repo. */
12
+ export interface RepoFacts {
13
+ kind: 'repo' | 'operations';
14
+ /** Relative to the directory doctor was run on. */
15
+ path: string;
16
+ /** Undefined when the repo carries no marker. */
17
+ marker?: MarkerRead;
18
+ /** The root mise tasks, or why mise could not list them. */
19
+ tasks: {
20
+ names: string[];
21
+ } | {
22
+ problem: string;
23
+ };
24
+ /** The files git tracks, relative to the repo; undefined outside a git checkout. */
25
+ tracked?: string[];
26
+ /** Its apps' directories, relative to the repo (`apps/<name>`). */
27
+ apps: string[];
28
+ }
29
+ /** What doctor read of an app. */
30
+ export interface AppFacts {
31
+ kind: 'app';
5
32
  path: string;
6
- plexus?: string;
7
- modules: string[];
8
- findings: string[];
33
+ /** The app's source repo. */
34
+ repo: RepoFacts;
35
+ /** The app's directory, relative to the repo (`apps/<name>`). */
36
+ dir: string;
37
+ thirdParty: boolean;
38
+ marker: MarkerRead;
39
+ /** `docker/compose.yaml`; neither field set when there is none. */
40
+ compose?: Compose;
41
+ composeProblem?: string;
42
+ /** Whether `docker/Dockerfile` exists. */
43
+ dockerfile: boolean;
44
+ /** `package.json`; neither field set when there is none. */
45
+ packageJson?: Mapping;
46
+ packageJsonProblem?: string;
47
+ }
48
+ export type Facts = RepoFacts | AppFacts;
49
+ interface RepoCheck {
50
+ binds: 'repo';
51
+ check: (repo: RepoFacts) => string[];
52
+ }
53
+ /** A check of whichever unit holds what it finds, a repo or an app. */
54
+ interface UnitCheck {
55
+ binds: 'unit';
56
+ check: (unit: Facts) => string[];
57
+ }
58
+ interface AppCheck {
59
+ binds: 'app';
60
+ /** Only an app of this profile. */
61
+ profile?: Profile;
62
+ /** Only a built app, never a third-party one. */
63
+ built?: true;
64
+ check: (app: AppFacts) => string[];
65
+ }
66
+ /** Every requirement doctor checks, by name: what the contract pages list, in their order. */
67
+ export declare const CHECKS: Readonly<Record<string, RepoCheck | AppCheck | UnitCheck>>;
68
+ export interface Finding {
69
+ /** The requirement's name, e.g. `PLX-App/LoopbackPort`. */
70
+ requirement: string;
71
+ problem: string;
72
+ }
73
+ export interface UnitReport {
74
+ path: string;
75
+ kind: Kind;
76
+ /** An app's profile, when its marker states a valid one. */
77
+ profile?: Profile;
78
+ /** The deviations its marker lists, whose checks were not run. */
79
+ deviations: string[];
80
+ findings: Finding[];
81
+ /** What is worth doing and fails no check, such as deleting keys nothing reads any more. */
82
+ hints?: string[];
9
83
  }
10
84
  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 Plexus versions; suffixes ignored. */
18
- export declare function compareVersions(a: string, b: string): number;
85
+ units: UnitReport[];
86
+ /** Units with at least one finding. */
87
+ failed: number;
88
+ }
89
+ /** The requirement names the index this plx carries knows: what a deviation may name. */
90
+ export declare const knownRequirements: () => Set<string>;
91
+ /** What was read, against the checks: pure, so a test compares reports. */
92
+ export declare function diagnose(facts: Facts[], known?: Set<string>): Report;
93
+ /** What doctor read under the directory it was given. */
94
+ export interface Examination {
95
+ /** What the unit paths are relative to: the repo's root when the directory is in a repo, else the directory. */
96
+ root: string;
97
+ /** Whether the directory is in a repo; then `root` is that repo's root, and only that repo is read. */
98
+ inRepo: boolean;
99
+ /** Each repo, then its apps. */
100
+ facts: Facts[];
101
+ /** In a workspace, the git roots that are not Plexus repos and were not checked, relative to `root`. */
102
+ skipped: string[];
103
+ /** Symbolic links not followed, so not checked: a directory in a repo's `apps/`, or a repo in a workspace; relative to `root`. */
104
+ links: string[];
105
+ /** Directories that could not be read, so nothing beneath them was checked, with why; relative to `root`. */
106
+ unreadable: {
107
+ path: string;
108
+ why: string;
109
+ }[];
110
+ }
111
+ /**
112
+ * Read the units (§ 1.2 PLX) under `dir`. A repo is a git root; its apps are
113
+ * what `appsOf` finds in its `apps/` (overview.ts; overview reads them by it
114
+ * too), with a marker or without. `dir` is a workspace when git roots lie
115
+ * beneath it, whatever lies above: every git root beneath it is read that is
116
+ * a Plexus repo, which carries a marker or has an app, and the others are
117
+ * named. Otherwise `dir` is in a repo, the nearest git root at or above it,
118
+ * and that repo is read from its root, with no git root nested in it: that
119
+ * is another repo, and none of its files are this repo's. A directory that
120
+ * cannot be read, and a symbolic link to an app or a repo, are named, never
121
+ * fatal.
122
+ */
123
+ export declare function examine(ctx: Context, dir: string): Promise<Examination>;
124
+ export {};
19
125
  //# sourceMappingURL=doctor.d.ts.map
@@ -1 +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,mEAAmE;AACnE,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CA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