@autotelic/protocol 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +183 -2
- package/dist/baseline.d.ts +41 -0
- package/dist/baseline.d.ts.map +1 -0
- package/dist/baseline.js +62 -0
- package/dist/baseline.js.map +1 -0
- package/dist/catalog.d.ts +275 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +437 -0
- package/dist/catalog.js.map +1 -0
- package/dist/compat.d.ts +12 -0
- package/dist/compat.d.ts.map +1 -0
- package/dist/compat.js +104 -0
- package/dist/compat.js.map +1 -0
- package/dist/config.d.ts +179 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +302 -0
- package/dist/config.js.map +1 -0
- package/dist/decode.d.ts +32 -0
- package/dist/decode.d.ts.map +1 -0
- package/dist/decode.js +71 -0
- package/dist/decode.js.map +1 -0
- package/dist/doc.d.ts +105 -0
- package/dist/doc.d.ts.map +1 -0
- package/dist/doc.js +159 -0
- package/dist/doc.js.map +1 -0
- package/dist/graph.d.ts +139 -0
- package/dist/graph.d.ts.map +1 -0
- package/dist/graph.js +258 -0
- package/dist/graph.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/intent.d.ts +32 -0
- package/dist/intent.d.ts.map +1 -0
- package/dist/intent.js +54 -0
- package/dist/intent.js.map +1 -0
- package/dist/json.d.ts +3 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +18 -0
- package/dist/json.js.map +1 -0
- package/dist/lexicon.d.ts +58 -0
- package/dist/lexicon.d.ts.map +1 -0
- package/dist/lexicon.js +176 -0
- package/dist/lexicon.js.map +1 -0
- package/dist/patterns.d.ts +65 -0
- package/dist/patterns.d.ts.map +1 -0
- package/dist/patterns.js +166 -0
- package/dist/patterns.js.map +1 -0
- package/dist/recipes.d.ts +34 -0
- package/dist/recipes.d.ts.map +1 -0
- package/dist/recipes.js +74 -0
- package/dist/recipes.js.map +1 -0
- package/dist/report.d.ts +218 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +330 -0
- package/dist/report.js.map +1 -0
- package/dist/version.d.ts +9 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +9 -0
- package/dist/version.js.map +1 -0
- package/package.json +45 -3
- package/schema/baseline.json +29 -0
- package/schema/catalog.json +206 -0
- package/schema/cutlist.config.json +103 -0
- package/schema/intent.json +43 -0
- package/schema/jig.config.json +56 -0
- package/schema/manifest.json +67 -0
- package/schema/menu.json +169 -0
- package/schema/onboarding.json +25 -0
- package/schema/patterns.json +141 -0
- package/schema/recipes.json +57 -0
- package/schema/report.json +141 -0
package/dist/catalog.js
ADDED
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import { arrayOf, bool, isRecord, num, oneOf, readLexiconRef, str, strings } from "./decode.js";
|
|
2
|
+
import { lexiconRef } from "./lexicon.js";
|
|
3
|
+
import { decodeTiers } from "./config.js";
|
|
4
|
+
import { PART_STATUSES } from "./intent.js";
|
|
5
|
+
/**
|
|
6
|
+
* Project the catalog onto the lint manifest. One source, one lookup table.
|
|
7
|
+
*
|
|
8
|
+
* Intent is optional because the catalog is derived and the manifest is a projection:
|
|
9
|
+
* a caller that has not read `intent/` still gets a valid manifest, just one whose rules
|
|
10
|
+
* cannot see a retirement. The caller that HAS read it passes the same map the menu uses,
|
|
11
|
+
* so a rule and a person never disagree about which part is retired.
|
|
12
|
+
*/
|
|
13
|
+
export const projectManifest = (catalog, intent) => ({
|
|
14
|
+
lexicon: lexiconRef("manifest"),
|
|
15
|
+
colors: catalog.tokens.colors,
|
|
16
|
+
sharedRoots: catalog.sharedRoots,
|
|
17
|
+
localRoots: catalog.localRoots,
|
|
18
|
+
components: catalog.components.map((component) => {
|
|
19
|
+
const authored = (component.id === undefined ? undefined : intent?.get(component.id)) ??
|
|
20
|
+
intent?.get(component.name);
|
|
21
|
+
return {
|
|
22
|
+
path: component.path,
|
|
23
|
+
name: component.name,
|
|
24
|
+
tier: component.tier,
|
|
25
|
+
owners: component.owners,
|
|
26
|
+
props: component.props,
|
|
27
|
+
tags: component.tags,
|
|
28
|
+
...(component.kind === undefined ? {} : { kind: component.kind }),
|
|
29
|
+
...(component.roles === undefined ? {} : { roles: component.roles }),
|
|
30
|
+
...(component.feature === undefined ? {} : { feature: component.feature }),
|
|
31
|
+
...(component.exports === undefined ? {} : { exports: component.exports }),
|
|
32
|
+
...(component.usedBy === undefined ? {} : { usedBy: component.usedBy }),
|
|
33
|
+
...(authored?.status === undefined ? {} : { status: authored.status }),
|
|
34
|
+
...(authored?.useInstead === undefined ? {} : { useInstead: authored.useInstead }),
|
|
35
|
+
signature: component.signature,
|
|
36
|
+
};
|
|
37
|
+
}),
|
|
38
|
+
});
|
|
39
|
+
/** The signature a component is compared by. */
|
|
40
|
+
export const signatureOf = (component) => new Set(component.signature);
|
|
41
|
+
/**
|
|
42
|
+
* React's own mechanics, not the part's domain.
|
|
43
|
+
*
|
|
44
|
+
* `useState`/`useEffect`/`useRef` are the frame every interactive component is built in,
|
|
45
|
+
* exactly like a host `<div>`. Two components that share only those are not thereby the same
|
|
46
|
+
* concept, and keeping them made a page of generic hook matches score 1.0 and swamp the real
|
|
47
|
+
* duplicates. They stay in the catalog signature — an agent may want them — but not in the
|
|
48
|
+
* signature a similarity question compares.
|
|
49
|
+
*
|
|
50
|
+
* The set lives in the format rather than in `cutlist` because the duplicate join and the
|
|
51
|
+
* `similar` query must answer by the same metric; a second copy is a second opinion.
|
|
52
|
+
*/
|
|
53
|
+
export const INCIDENTAL_HOOKS = new Set([
|
|
54
|
+
"hook:use",
|
|
55
|
+
"hook:useActionState",
|
|
56
|
+
"hook:useCallback",
|
|
57
|
+
"hook:useContext",
|
|
58
|
+
"hook:useDebugValue",
|
|
59
|
+
"hook:useDeferredValue",
|
|
60
|
+
"hook:useEffect",
|
|
61
|
+
"hook:useId",
|
|
62
|
+
"hook:useImperativeHandle",
|
|
63
|
+
"hook:useInsertionEffect",
|
|
64
|
+
"hook:useLayoutEffect",
|
|
65
|
+
"hook:useMemo",
|
|
66
|
+
"hook:useOptimistic",
|
|
67
|
+
"hook:useReducer",
|
|
68
|
+
"hook:useRef",
|
|
69
|
+
"hook:useState",
|
|
70
|
+
"hook:useSyncExternalStore",
|
|
71
|
+
"hook:useTransition",
|
|
72
|
+
]);
|
|
73
|
+
/** The signature a similarity question compares: the part's composition, not React's frame. */
|
|
74
|
+
export const comparableSignatureOf = (signature) => new Set(signature.filter((token) => !INCIDENTAL_HOOKS.has(token)));
|
|
75
|
+
/**
|
|
76
|
+
* Jaccard overlap of two signatures.
|
|
77
|
+
*
|
|
78
|
+
* Two empty signatures are NOT similar: an undocumented component with no recognisable
|
|
79
|
+
* skeleton should match nothing, not everything.
|
|
80
|
+
*/
|
|
81
|
+
export const similarityOf = ({ left, right, }) => {
|
|
82
|
+
if (left.size === 0 || right.size === 0)
|
|
83
|
+
return 0;
|
|
84
|
+
const [small, large] = left.size <= right.size ? [left, right] : [right, left];
|
|
85
|
+
let shared = 0;
|
|
86
|
+
for (const member of small)
|
|
87
|
+
if (large.has(member))
|
|
88
|
+
shared += 1;
|
|
89
|
+
return shared / (left.size + right.size - shared);
|
|
90
|
+
};
|
|
91
|
+
/** The nearest same-or-higher-tier twin of a component, at or above a threshold. */
|
|
92
|
+
export const nearestDuplicate = (catalog, subject, threshold) => {
|
|
93
|
+
const left = signatureOf(subject);
|
|
94
|
+
let best = null;
|
|
95
|
+
for (const candidate of catalog.components) {
|
|
96
|
+
if (candidate.path === subject.path)
|
|
97
|
+
continue;
|
|
98
|
+
const score = similarityOf({ left, right: signatureOf(candidate) });
|
|
99
|
+
if (score < threshold)
|
|
100
|
+
continue;
|
|
101
|
+
if (best === null || score > best.score) {
|
|
102
|
+
best = { left: subject.path, right: candidate.path, score, basis: "skeleton" };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return best;
|
|
106
|
+
};
|
|
107
|
+
/** An empty catalog, for a project that generates none. Every consumer degrades to silence. */
|
|
108
|
+
export const emptyCatalog = (root) => ({
|
|
109
|
+
lexicon: lexiconRef("catalog"),
|
|
110
|
+
hash: "",
|
|
111
|
+
root,
|
|
112
|
+
tokens: { colors: [], type: [], shape: [], spacing: [] },
|
|
113
|
+
tiers: { primitive: [], shared: [], local: [] },
|
|
114
|
+
sharedRoots: [],
|
|
115
|
+
localRoots: [],
|
|
116
|
+
components: [],
|
|
117
|
+
orphans: [],
|
|
118
|
+
duplicates: [],
|
|
119
|
+
});
|
|
120
|
+
/*
|
|
121
|
+
* Decoders — the catalog and the manifest, read as untrusted input.
|
|
122
|
+
*
|
|
123
|
+
* `plumb` reading the manifest without importing this package is the proof the format is
|
|
124
|
+
* not merely the TypeScript; these decoders are the TypeScript's own tolerant half, and
|
|
125
|
+
* they exist so a stale catalog written by an older cutlist degrades to an empty view
|
|
126
|
+
* rather than a false finding. Unknown fields are ignored, so a newer catalog still reads.
|
|
127
|
+
*/
|
|
128
|
+
const TIERS_NAMES = ["primitive", "shared", "local"];
|
|
129
|
+
export const PART_ROLES = [
|
|
130
|
+
"component",
|
|
131
|
+
"hook",
|
|
132
|
+
"context",
|
|
133
|
+
"provider",
|
|
134
|
+
"barrel",
|
|
135
|
+
"route",
|
|
136
|
+
"module",
|
|
137
|
+
];
|
|
138
|
+
const DECLARATION_KINDS = [
|
|
139
|
+
"function",
|
|
140
|
+
"class",
|
|
141
|
+
"variable",
|
|
142
|
+
"type",
|
|
143
|
+
];
|
|
144
|
+
const decodeDeclaration = (value) => {
|
|
145
|
+
if (!isRecord(value))
|
|
146
|
+
return undefined;
|
|
147
|
+
const name = str(value.name);
|
|
148
|
+
const kind = oneOf(value.kind, DECLARATION_KINDS);
|
|
149
|
+
const exported = bool(value.exported);
|
|
150
|
+
const renders = bool(value.renders);
|
|
151
|
+
const calls = strings(value.calls);
|
|
152
|
+
if (name === undefined ||
|
|
153
|
+
kind === undefined ||
|
|
154
|
+
exported === undefined ||
|
|
155
|
+
renders === undefined ||
|
|
156
|
+
calls === undefined) {
|
|
157
|
+
return undefined;
|
|
158
|
+
}
|
|
159
|
+
const objectKeys = strings(value.objectKeys);
|
|
160
|
+
return {
|
|
161
|
+
name,
|
|
162
|
+
kind,
|
|
163
|
+
exported,
|
|
164
|
+
renders,
|
|
165
|
+
calls,
|
|
166
|
+
...(objectKeys === undefined ? {} : { objectKeys }),
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
/** Read one feature record, or `undefined` when it is not one. */
|
|
170
|
+
export const decodeFeature = (value) => {
|
|
171
|
+
if (!isRecord(value))
|
|
172
|
+
return undefined;
|
|
173
|
+
const dir = str(value.dir);
|
|
174
|
+
const name = str(value.name);
|
|
175
|
+
const context = str(value.context);
|
|
176
|
+
const blocks = strings(value.blocks);
|
|
177
|
+
const hooks = strings(value.hooks);
|
|
178
|
+
const valueKeys = strings(value.valueKeys);
|
|
179
|
+
if (dir === undefined ||
|
|
180
|
+
name === undefined ||
|
|
181
|
+
context === undefined ||
|
|
182
|
+
blocks === undefined ||
|
|
183
|
+
hooks === undefined ||
|
|
184
|
+
valueKeys === undefined) {
|
|
185
|
+
return undefined;
|
|
186
|
+
}
|
|
187
|
+
const provider = str(value.provider);
|
|
188
|
+
const barrel = str(value.barrel);
|
|
189
|
+
return {
|
|
190
|
+
dir,
|
|
191
|
+
name,
|
|
192
|
+
context,
|
|
193
|
+
...(provider === undefined ? {} : { provider }),
|
|
194
|
+
...(barrel === undefined ? {} : { barrel }),
|
|
195
|
+
blocks,
|
|
196
|
+
hooks,
|
|
197
|
+
valueKeys,
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
/** Read a health block, or `undefined` when malformed. */
|
|
201
|
+
export const decodeHealth = (value) => {
|
|
202
|
+
if (!isRecord(value))
|
|
203
|
+
return undefined;
|
|
204
|
+
const parts = num(value.parts);
|
|
205
|
+
const sharedReach = num(value.sharedReach);
|
|
206
|
+
const localOnly = num(value.localOnly);
|
|
207
|
+
const duplicateClusters = num(value.duplicateClusters);
|
|
208
|
+
if (parts === undefined ||
|
|
209
|
+
sharedReach === undefined ||
|
|
210
|
+
localOnly === undefined ||
|
|
211
|
+
duplicateClusters === undefined) {
|
|
212
|
+
return undefined;
|
|
213
|
+
}
|
|
214
|
+
return { parts, sharedReach, localOnly, duplicateClusters };
|
|
215
|
+
};
|
|
216
|
+
/** Read one duplicate cluster, or `undefined` when malformed. */
|
|
217
|
+
export const decodeCluster = (value) => {
|
|
218
|
+
if (!isRecord(value))
|
|
219
|
+
return undefined;
|
|
220
|
+
const canonical = str(value.canonical);
|
|
221
|
+
const name = str(value.name);
|
|
222
|
+
const members = strings(value.members);
|
|
223
|
+
const score = num(value.score);
|
|
224
|
+
const usedBy = num(value.usedBy);
|
|
225
|
+
if (canonical === undefined ||
|
|
226
|
+
name === undefined ||
|
|
227
|
+
members === undefined ||
|
|
228
|
+
score === undefined ||
|
|
229
|
+
usedBy === undefined) {
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
return { canonical, name, members, score, usedBy };
|
|
233
|
+
};
|
|
234
|
+
/** Read one render edge, or `undefined` when malformed. */
|
|
235
|
+
export const decodeRenderEdge = (value) => {
|
|
236
|
+
if (!isRecord(value))
|
|
237
|
+
return undefined;
|
|
238
|
+
const part = str(value.part);
|
|
239
|
+
const tag = str(value.tag);
|
|
240
|
+
const line = num(value.line);
|
|
241
|
+
const count = num(value.count);
|
|
242
|
+
if (part === undefined || tag === undefined || line === undefined || count === undefined) {
|
|
243
|
+
return undefined;
|
|
244
|
+
}
|
|
245
|
+
return { part, tag, line, count };
|
|
246
|
+
};
|
|
247
|
+
/** Read one component, or `undefined` when malformed. */
|
|
248
|
+
export const decodeCatalogComponent = (value) => {
|
|
249
|
+
if (!isRecord(value))
|
|
250
|
+
return undefined;
|
|
251
|
+
const id = str(value.id);
|
|
252
|
+
const kind = oneOf(value.kind, PART_ROLES);
|
|
253
|
+
const roles = arrayOf(value.roles, (role) => oneOf(role, PART_ROLES));
|
|
254
|
+
const feature = str(value.feature);
|
|
255
|
+
const exports = strings(value.exports);
|
|
256
|
+
const usedBy = num(value.usedBy);
|
|
257
|
+
const declarations = arrayOf(value.declarations, decodeDeclaration);
|
|
258
|
+
const renders = arrayOf(value.renders, decodeRenderEdge);
|
|
259
|
+
const path = str(value.path);
|
|
260
|
+
const name = str(value.name);
|
|
261
|
+
const tier = oneOf(value.tier, TIERS_NAMES);
|
|
262
|
+
const owners = strings(value.owners);
|
|
263
|
+
const props = strings(value.props);
|
|
264
|
+
const tags = strings(value.tags);
|
|
265
|
+
const signature = strings(value.signature);
|
|
266
|
+
const documented = bool(value.documented);
|
|
267
|
+
if (path === undefined ||
|
|
268
|
+
name === undefined ||
|
|
269
|
+
tier === undefined ||
|
|
270
|
+
owners === undefined ||
|
|
271
|
+
props === undefined ||
|
|
272
|
+
tags === undefined ||
|
|
273
|
+
signature === undefined ||
|
|
274
|
+
documented === undefined) {
|
|
275
|
+
return undefined;
|
|
276
|
+
}
|
|
277
|
+
return {
|
|
278
|
+
...(id === undefined ? {} : { id }),
|
|
279
|
+
...(kind === undefined ? {} : { kind }),
|
|
280
|
+
...(roles === undefined ? {} : { roles }),
|
|
281
|
+
...(feature === undefined ? {} : { feature }),
|
|
282
|
+
...(exports === undefined ? {} : { exports }),
|
|
283
|
+
...(usedBy === undefined ? {} : { usedBy }),
|
|
284
|
+
...(declarations === undefined ? {} : { declarations }),
|
|
285
|
+
...(renders === undefined ? {} : { renders }),
|
|
286
|
+
path,
|
|
287
|
+
name,
|
|
288
|
+
tier,
|
|
289
|
+
owners,
|
|
290
|
+
props,
|
|
291
|
+
tags,
|
|
292
|
+
signature,
|
|
293
|
+
documented,
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
/** Read one duplicate candidate, or `undefined` when malformed. */
|
|
297
|
+
export const decodeDuplicate = (value) => {
|
|
298
|
+
if (!isRecord(value))
|
|
299
|
+
return undefined;
|
|
300
|
+
const left = str(value.left);
|
|
301
|
+
const right = str(value.right);
|
|
302
|
+
const score = num(value.score);
|
|
303
|
+
const basis = oneOf(value.basis, ["skeleton"]);
|
|
304
|
+
if (left === undefined || right === undefined || score === undefined || basis === undefined) {
|
|
305
|
+
return undefined;
|
|
306
|
+
}
|
|
307
|
+
return { left, right, score, basis };
|
|
308
|
+
};
|
|
309
|
+
const decodeTokens = (value) => {
|
|
310
|
+
if (!isRecord(value))
|
|
311
|
+
return undefined;
|
|
312
|
+
const colors = strings(value.colors);
|
|
313
|
+
const type = strings(value.type);
|
|
314
|
+
const shape = strings(value.shape);
|
|
315
|
+
const spacing = strings(value.spacing);
|
|
316
|
+
if (colors === undefined || type === undefined || shape === undefined || spacing === undefined) {
|
|
317
|
+
return undefined;
|
|
318
|
+
}
|
|
319
|
+
return { colors, type, shape, spacing };
|
|
320
|
+
};
|
|
321
|
+
/** Read a catalog, or `undefined` when the whole model is malformed. */
|
|
322
|
+
export const decodeCatalog = (value) => {
|
|
323
|
+
if (!isRecord(value))
|
|
324
|
+
return undefined;
|
|
325
|
+
const lexicon = readLexiconRef(value, "catalog");
|
|
326
|
+
const hash = str(value.hash);
|
|
327
|
+
const root = str(value.root);
|
|
328
|
+
const tokens = decodeTokens(value.tokens);
|
|
329
|
+
const tiers = decodeTiers(value.tiers);
|
|
330
|
+
const sharedRoots = strings(value.sharedRoots);
|
|
331
|
+
const localRoots = strings(value.localRoots);
|
|
332
|
+
const components = arrayOf(value.components, decodeCatalogComponent);
|
|
333
|
+
const features = arrayOf(value.features, decodeFeature);
|
|
334
|
+
const health = decodeHealth(value.health);
|
|
335
|
+
const clusters = arrayOf(value.clusters, decodeCluster);
|
|
336
|
+
const orphans = strings(value.orphans);
|
|
337
|
+
const duplicates = arrayOf(value.duplicates, decodeDuplicate);
|
|
338
|
+
if (lexicon === undefined ||
|
|
339
|
+
hash === undefined ||
|
|
340
|
+
root === undefined ||
|
|
341
|
+
tokens === undefined ||
|
|
342
|
+
tiers === undefined ||
|
|
343
|
+
sharedRoots === undefined ||
|
|
344
|
+
localRoots === undefined ||
|
|
345
|
+
components === undefined ||
|
|
346
|
+
orphans === undefined ||
|
|
347
|
+
duplicates === undefined) {
|
|
348
|
+
return undefined;
|
|
349
|
+
}
|
|
350
|
+
return {
|
|
351
|
+
lexicon,
|
|
352
|
+
hash,
|
|
353
|
+
root,
|
|
354
|
+
tokens,
|
|
355
|
+
tiers,
|
|
356
|
+
sharedRoots,
|
|
357
|
+
localRoots,
|
|
358
|
+
components,
|
|
359
|
+
...(features === undefined ? {} : { features }),
|
|
360
|
+
...(health === undefined ? {} : { health }),
|
|
361
|
+
...(clusters === undefined ? {} : { clusters }),
|
|
362
|
+
orphans,
|
|
363
|
+
duplicates,
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
/** Read one manifest component, or `undefined` when malformed. */
|
|
367
|
+
export const decodeManifestComponent = (value) => {
|
|
368
|
+
if (!isRecord(value))
|
|
369
|
+
return undefined;
|
|
370
|
+
const path = str(value.path);
|
|
371
|
+
const name = str(value.name);
|
|
372
|
+
const tier = oneOf(value.tier, TIERS_NAMES);
|
|
373
|
+
const owners = strings(value.owners);
|
|
374
|
+
const props = strings(value.props);
|
|
375
|
+
const tags = strings(value.tags);
|
|
376
|
+
if (path === undefined ||
|
|
377
|
+
name === undefined ||
|
|
378
|
+
tier === undefined ||
|
|
379
|
+
owners === undefined ||
|
|
380
|
+
props === undefined ||
|
|
381
|
+
tags === undefined) {
|
|
382
|
+
return undefined;
|
|
383
|
+
}
|
|
384
|
+
const signature = strings(value.signature);
|
|
385
|
+
const kind = oneOf(value.kind, PART_ROLES);
|
|
386
|
+
const roles = arrayOf(value.roles, (role) => oneOf(role, PART_ROLES));
|
|
387
|
+
const feature = str(value.feature);
|
|
388
|
+
const exports = strings(value.exports);
|
|
389
|
+
const usedBy = num(value.usedBy);
|
|
390
|
+
const status = oneOf(value.status, PART_STATUSES);
|
|
391
|
+
const useInstead = strings(value.useInstead);
|
|
392
|
+
return {
|
|
393
|
+
path,
|
|
394
|
+
name,
|
|
395
|
+
tier,
|
|
396
|
+
owners,
|
|
397
|
+
props,
|
|
398
|
+
tags,
|
|
399
|
+
...(kind === undefined ? {} : { kind }),
|
|
400
|
+
...(roles === undefined ? {} : { roles }),
|
|
401
|
+
...(feature === undefined ? {} : { feature }),
|
|
402
|
+
...(exports === undefined ? {} : { exports }),
|
|
403
|
+
...(usedBy === undefined ? {} : { usedBy }),
|
|
404
|
+
...(status === undefined ? {} : { status }),
|
|
405
|
+
...(useInstead === undefined ? {} : { useInstead }),
|
|
406
|
+
...(signature === undefined ? {} : { signature }),
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
/** The empty manifest, for a project that generates none. `plumb-ui`'s fail-open value. */
|
|
410
|
+
export const EMPTY_MANIFEST = {
|
|
411
|
+
lexicon: lexiconRef("manifest"),
|
|
412
|
+
colors: [],
|
|
413
|
+
sharedRoots: [],
|
|
414
|
+
localRoots: [],
|
|
415
|
+
components: [],
|
|
416
|
+
};
|
|
417
|
+
/** Read the manifest, degrading to the empty one — the shape `plumb` already reads. */
|
|
418
|
+
export const decodeManifest = (value) => {
|
|
419
|
+
if (!isRecord(value))
|
|
420
|
+
return EMPTY_MANIFEST;
|
|
421
|
+
// Manifest refs are optional in practice: the reader predates versioning and its own
|
|
422
|
+
// empty value has no ref, so a missing ref means "the current manifest", not corrupt.
|
|
423
|
+
const lexicon = "lexicon" in value ? readLexiconRef(value, "manifest") : undefined;
|
|
424
|
+
const colors = strings(value.colors);
|
|
425
|
+
const sharedRoots = strings(value.sharedRoots);
|
|
426
|
+
const localRoots = strings(value.localRoots);
|
|
427
|
+
const components = arrayOf(value.components, decodeManifestComponent);
|
|
428
|
+
if ((lexicon === undefined && "lexicon" in value) ||
|
|
429
|
+
colors === undefined ||
|
|
430
|
+
sharedRoots === undefined ||
|
|
431
|
+
localRoots === undefined ||
|
|
432
|
+
components === undefined) {
|
|
433
|
+
return EMPTY_MANIFEST;
|
|
434
|
+
}
|
|
435
|
+
return { lexicon: lexicon ?? lexiconRef("manifest"), colors, sharedRoots, localRoots, components };
|
|
436
|
+
};
|
|
437
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC/F,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,WAAW,EAA6B,MAAM,aAAa,CAAA;AACpE,OAAO,EAAE,aAAa,EAAgC,MAAM,aAAa,CAAA;AAkPzE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,OAAgB,EAChB,MAA+C,EACnC,EAAE,CAAC,CAAC;IAChB,OAAO,EAAE,UAAU,CAAC,UAAU,CAAC;IAC/B,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM;IAC7B,WAAW,EAAE,OAAO,CAAC,WAAW;IAChC,UAAU,EAAE,OAAO,CAAC,UAAU;IAC9B,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QAC/C,MAAM,QAAQ,GACZ,CAAC,SAAS,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;YACpE,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QAC7B,OAAO;YACL,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,IAAI,EAAE,SAAS,CA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EAAE,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,CAAA;AACpG,CAAC,CAAA"}
|
package/dist/compat.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The changes that would invalidate a record the previous schema accepted, as sentences.
|
|
3
|
+
*
|
|
4
|
+
* An empty list means the new schema is a superset over the structural subset checked here.
|
|
5
|
+
* `path` is the dotted location of the lexicon in the JSON document, for a readable finding.
|
|
6
|
+
*/
|
|
7
|
+
export declare const schemaBreakingChanges: ({ previous, next, path, }: {
|
|
8
|
+
readonly previous: unknown;
|
|
9
|
+
readonly next: unknown;
|
|
10
|
+
readonly path?: string;
|
|
11
|
+
}) => ReadonlyArray<string>;
|
|
12
|
+
//# sourceMappingURL=compat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.d.ts","sourceRoot":"","sources":["../src/compat.ts"],"names":[],"mappings":"AAwDA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,8BAI/B;IACD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB,KAAG,aAAa,CAAC,MAAM,CA6DvB,CAAA"}
|
package/dist/compat.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The compat analyzer: the pure half of the lexicon-compat linter.
|
|
3
|
+
*
|
|
4
|
+
* The rule, restated where code enforces it: once a lexicon is in the wild, a schema change
|
|
5
|
+
* must keep every previously-valid record valid. In schema terms, the language the new
|
|
6
|
+
* schema accepts must be a SUPERSET of the old. Adding an optional field does that; adding
|
|
7
|
+
* a required one, removing a field, narrowing a type or an enum, or flipping
|
|
8
|
+
* `additionalProperties` to `false` does not.
|
|
9
|
+
*
|
|
10
|
+
* This module is a best-effort structural pre-check over the keyword subset our schemas
|
|
11
|
+
* use. It is NOT the guarantee: the guarantee is the corpus in `fixtures/compat/`, which
|
|
12
|
+
* the linter validates against the current schemas — a concrete record is the only thing
|
|
13
|
+
* that cannot be argued with. Run `scripts/lexicon-compat.mjs` for that.
|
|
14
|
+
*
|
|
15
|
+
* No dependencies. The validator lives in the script and the tests, not here.
|
|
16
|
+
*/
|
|
17
|
+
import { isRecord } from "./decode.js";
|
|
18
|
+
const propertyOf = (schema, key) => schema[key];
|
|
19
|
+
const propertiesOf = (schema) => {
|
|
20
|
+
const properties = propertyOf(schema, "properties");
|
|
21
|
+
return isRecord(properties) ? properties : {};
|
|
22
|
+
};
|
|
23
|
+
const requiredOf = (schema) => {
|
|
24
|
+
const required = propertyOf(schema, "required");
|
|
25
|
+
if (!Array.isArray(required))
|
|
26
|
+
return new Set();
|
|
27
|
+
return new Set(required.filter((entry) => typeof entry === "string"));
|
|
28
|
+
};
|
|
29
|
+
const enumOf = (schema) => {
|
|
30
|
+
const values = propertyOf(schema, "enum");
|
|
31
|
+
return Array.isArray(values) ? values : undefined;
|
|
32
|
+
};
|
|
33
|
+
const typeOf = (schema) => typeof schema.type === "string" ? schema.type : undefined;
|
|
34
|
+
/** `number` accepts every integer, so `integer → number` widens and the reverse narrows. */
|
|
35
|
+
const widensType = ({ previous, next, }) => {
|
|
36
|
+
if (previous === undefined || next === undefined)
|
|
37
|
+
return true;
|
|
38
|
+
if (previous === next)
|
|
39
|
+
return true;
|
|
40
|
+
return previous === "integer" && next === "number";
|
|
41
|
+
};
|
|
42
|
+
const numberAt = (schema, key) => typeof schema[key] === "number" ? schema[key] : undefined;
|
|
43
|
+
/**
|
|
44
|
+
* The changes that would invalidate a record the previous schema accepted, as sentences.
|
|
45
|
+
*
|
|
46
|
+
* An empty list means the new schema is a superset over the structural subset checked here.
|
|
47
|
+
* `path` is the dotted location of the lexicon in the JSON document, for a readable finding.
|
|
48
|
+
*/
|
|
49
|
+
export const schemaBreakingChanges = ({ previous, next, path = "$", }) => {
|
|
50
|
+
if (!isRecord(previous) || !isRecord(next))
|
|
51
|
+
return [];
|
|
52
|
+
const findings = [];
|
|
53
|
+
const previousProperties = propertiesOf(previous);
|
|
54
|
+
const nextProperties = propertiesOf(next);
|
|
55
|
+
const previousAdditional = propertyOf(previous, "additionalProperties");
|
|
56
|
+
const nextAdditional = propertyOf(next, "additionalProperties");
|
|
57
|
+
for (const [name, previousProperty] of Object.entries(previousProperties)) {
|
|
58
|
+
const nextProperty = nextProperties[name];
|
|
59
|
+
if (nextProperty === undefined) {
|
|
60
|
+
// Removing a named property only breaks a record that still carries it. While
|
|
61
|
+
// `additionalProperties` is not `false`, extras ride along and the value survives.
|
|
62
|
+
if (nextAdditional === false)
|
|
63
|
+
findings.push(`${path}.${name}: property removed`);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
findings.push(...schemaBreakingChanges({
|
|
67
|
+
previous: previousProperty,
|
|
68
|
+
next: nextProperty,
|
|
69
|
+
path: `${path}.${name}`,
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
for (const name of requiredOf(next)) {
|
|
73
|
+
if (!requiredOf(previous).has(name)) {
|
|
74
|
+
findings.push(`${path}.${name}: newly required (a record lacking it is now invalid)`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// JSON Schema's default is open, so anything except an explicit `false` accepts extras.
|
|
78
|
+
if (previousAdditional !== false && nextAdditional === false) {
|
|
79
|
+
findings.push(`${path}: additionalProperties was open, is now closed`);
|
|
80
|
+
}
|
|
81
|
+
if (!widensType({ previous: typeOf(previous), next: typeOf(next) })) {
|
|
82
|
+
findings.push(`${path}: type narrowed (${typeOf(previous)} → ${typeOf(next)})`);
|
|
83
|
+
}
|
|
84
|
+
const previousEnum = enumOf(previous);
|
|
85
|
+
const nextEnum = enumOf(next);
|
|
86
|
+
if (previousEnum !== undefined && nextEnum !== undefined) {
|
|
87
|
+
for (const value of previousEnum) {
|
|
88
|
+
if (!nextEnum.includes(value))
|
|
89
|
+
findings.push(`${path}: enum value removed (${String(value)})`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const previousMinimum = numberAt(previous, "minimum");
|
|
93
|
+
const nextMinimum = numberAt(next, "minimum");
|
|
94
|
+
if (previousMinimum !== undefined && nextMinimum !== undefined && nextMinimum > previousMinimum) {
|
|
95
|
+
findings.push(`${path}: minimum raised (${previousMinimum} → ${nextMinimum})`);
|
|
96
|
+
}
|
|
97
|
+
const previousMaximum = numberAt(previous, "maximum");
|
|
98
|
+
const nextMaximum = numberAt(next, "maximum");
|
|
99
|
+
if (previousMaximum !== undefined && nextMaximum !== undefined && nextMaximum < previousMaximum) {
|
|
100
|
+
findings.push(`${path}: maximum lowered (${previousMaximum} → ${nextMaximum})`);
|
|
101
|
+
}
|
|
102
|
+
return findings;
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../src/compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,UAAU,GAAG,CAAC,MAA+B,EAAE,GAAW,EAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AAEzF,MAAM,YAAY,GAAG,CAAC,MAA+B,EAA2B,EAAE;IAChF,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACnD,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAA;AAC/C,CAAC,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,MAA+B,EAAuB,EAAE;IAC1E,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAC/C,IAAI,CAAC,KAAK,CA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