Repository navigation
Expand file tree
/
Copy pathmanifests.json
More file actions
387 lines (387 loc) · 10.8 KB
/
Copy pathmanifests.json
File metadata and controls
387 lines (387 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
{
"$comment": "ADR-0064 Amendment 1. Every port with hash state runs these vectors against its own manifest store: fileNames (a package's manifest file name), placement (which manifest a path is filed under, given the loaded objects), legacySplit (a legacy .hashes.json becomes these package files, byte for byte, and is removed) and provenance (which generator and node each recorded path came from). 'package': null is the root manifest (.root.json). A manifest file's text is the object with keys sorted, two-space indentation and a trailing newline ('goldenText' is one file in full).",
"version": 1,
"objects": [
{
"name": "Order",
"package": "acme::shop"
},
{
"name": "OrderLine",
"package": "acme::lines"
},
{
"name": "Customer",
"package": "acme::crm"
},
{
"name": "Invoice",
"package": "acme::billing"
},
{
"name": "Item",
"package": "acme::shop"
},
{
"name": "Item",
"package": "acme::crm"
},
{
"name": "Widget",
"package": ""
},
{
"name": "URLMap",
"package": "acme::web"
}
],
"fileNames": [
{
"package": "acme::shop",
"file": "acme.shop.json"
},
{
"package": "acme",
"file": "acme.json"
},
{
"package": "acme::shop-v2",
"file": "acme.shop-v2.json"
},
{
"package": "Acme::Shop",
"file": "Acme.Shop.json"
},
{
"package": "a b",
"file": "a%20b.json"
},
{
"package": "acme::shöp",
"file": "acme.sh%C3%B6p.json"
},
{
"package": "acme::a.b",
"file": "acme.a%2Eb.json"
},
{
"package": null,
"file": ".root.json"
}
],
"placement": [
{
"path": "gen/acme/shop/Order.ts",
"package": "acme::shop",
"why": "stem equals an object name"
},
{
"path": "gen/Order.hooks.ts",
"package": "acme::shop",
"why": "the stem stops at the first dot"
},
{
"path": "gen/Order.generated.v2.ts",
"package": "acme::shop",
"why": "still the first dot"
},
{
"path": "gen/OrderDto.java",
"package": "acme::shop",
"why": "the rest of the stem is more words"
},
{
"path": "gen/Order_v2.ts",
"package": "acme::shop",
"why": "'_' ends a word"
},
{
"path": "gen/OrderLineDto.java",
"package": "acme::lines",
"why": "the match with the most words wins"
},
{
"path": "gen/OrderLine.ts",
"package": "acme::lines"
},
{
"path": "gen/Ordered.ts",
"package": null,
"why": "'ordered' is one word, not 'order' and 'ed'"
},
{
"path": "gen/order.hooks.ts",
"package": "acme::shop",
"why": "words match without regard to case"
},
{
"path": "gen/Order/index.ts",
"package": null,
"why": "only the base name counts, and 'index' matches no object"
},
{
"path": "gen/Item.ts",
"package": null,
"why": "the longest name is declared in two packages"
},
{
"path": "gen/Widget.ts",
"package": null,
"why": "an object in no package has no package manifest"
},
{
"path": "gen/index.ts",
"package": null,
"why": "a file of the whole model"
},
{
"path": "gen/index.ts",
"package": "acme::crm",
"entry": {
"hash": "h",
"generatedBy": "entity",
"sourceNode": "acme::crm::Customer"
},
"why": "a sourceNode wins over the stem"
},
{
"path": "gen/Order.ts",
"package": "acme::crm",
"entry": {
"hash": "h",
"generatedBy": "entity",
"sourceNode": "acme::crm::Customer"
},
"why": "a sourceNode wins even when the stem names another object"
},
{
"path": "gen/Order.ts",
"package": "acme::shop",
"entry": {
"hash": "h",
"generatedBy": "entity",
"sourceNode": "acme::shop::Order.id"
},
"why": "a sourceNode stops at its first dot"
},
{
"path": "gen/Order.ts",
"package": null,
"entry": {
"hash": "h",
"generatedBy": "entity",
"sourceNode": "Widget"
},
"why": "a sourceNode with no '::' is an object in no package"
},
{
"path": "gen/Order.ts",
"package": "acme::shop",
"entry": {
"hash": "h",
"generator": "java:dto",
"outputDir": "gen"
},
"why": "owner fields are not provenance: the stem decides"
},
{
"path": "gen/order_line.py",
"package": "acme::lines",
"why": "a snake_case stem matches a PascalCase name"
},
{
"path": "gen/order_line_dto.py",
"package": "acme::lines",
"why": "more words after the match"
},
{
"path": "gen/order.py",
"package": "acme::shop",
"why": "a one-word snake_case stem"
},
{
"path": "gen/order_names.py",
"package": "acme::shop",
"why": "the match with the most words wins: 'order' has no 'order_names'"
},
{
"path": "gen/order-line.hooks.ts",
"package": "acme::lines",
"why": "'-' ends a word"
},
{
"path": "gen/orders.py",
"package": null,
"why": "'orders' is one word, not 'order' and 's'"
},
{
"path": "gen/url_map.py",
"package": "acme::web",
"why": "an acronym name matches its snake_case stem"
},
{
"path": "gen/URLMap.cs",
"package": "acme::web",
"why": "a run of capitals ends before the last one when a lowercase letter follows"
},
{
"path": "gen/Order2.ts",
"package": null,
"why": "digits stay with the word before them: 'order2' is one word"
}
],
"legacySplit": {
"legacy": {
"gen/Customer.ts": {
"hash": "h3",
"generatedBy": "entity",
"sourceNode": "acme::crm::Customer"
},
"gen/Invoice.ts": "h5",
"gen/Order.ts": "h1",
"gen/OrderDto.java": {
"hash": "h2",
"generator": "java:dto",
"outputDir": "gen"
},
"gen/OrderLine.ts": "h6",
"gen/index.ts": "h4"
},
"files": {
".root.json": {
"gen/index.ts": "h4"
},
"acme.shop.json": {
"gen/Order.ts": "h1",
"gen/OrderDto.java": {
"hash": "h2",
"generator": "java:dto",
"outputDir": "gen"
}
},
"acme.crm.json": {
"gen/Customer.ts": {
"hash": "h3",
"generatedBy": "entity",
"sourceNode": "acme::crm::Customer"
}
},
"acme.billing.json": {
"gen/Invoice.ts": "h5"
},
"acme.lines.json": {
"gen/OrderLine.ts": "h6"
}
},
"goldenFile": "acme.shop.json",
"goldenText": "{\n \"gen/Order.ts\": \"h1\",\n \"gen/OrderDto.java\": {\n \"hash\": \"h2\",\n \"generator\": \"java:dto\",\n \"outputDir\": \"gen\"\n }\n}\n",
"gitignoreBefore": ".gen-state/*\n!.gen-state/.hashes.json\n",
"gitignoreAfter": ".gen-state/*\n!.gen-state/.hashes/\n"
},
"provenance": {
"$comment": "Generated-file provenance (the docs view's 'files'): after a write run, each recorded path's entry names the generator that wrote it and, for a file rendered from one node, that node's resolution key. A port seeds 'beforeFiles' as its .hashes/ directory, records 'records' (with the vectors' 'objects' as the loaded model), and must then hold exactly 'afterFiles'. A record with a sourceNode makes the entry { hash, <other fields kept in order>, generatedBy, sourceNode }; one without returns the entry to the plain hash (or to { hash, <other fields> } when it has owner fields); a path with no recorded hash is left out; the sourceNode then places the entry. 'goldenText' is one file's bytes in full. Recording the same records a second time changes no file.",
"beforeFiles": {
"acme.shop.json": {
"gen/Order.ts": "h1",
"gen/OrderDto.java": {
"hash": "h2",
"generator": "java:dto",
"outputDir": "gen"
}
},
"acme.crm.json": {
"gen/Customer.ts": {
"hash": "h3",
"generatedBy": "entity",
"sourceNode": "acme::crm::Customer"
}
},
"acme.billing.json": {
"gen/Invoice.ts": "h5"
},
"gone.json": {
"gen/index.ts": {
"hash": "h4",
"generatedBy": "barrel",
"sourceNode": "gone::X"
}
},
".root.json": {
"gen/Item.ts": "h6"
}
},
"records": [
{
"path": "gen/Order.ts",
"generatedBy": "entity",
"sourceNode": "acme::shop::Order",
"why": "a per-object file gains its generator and node"
},
{
"path": "gen/OrderDto.java",
"generatedBy": "dto",
"sourceNode": "acme::shop::Order",
"why": "the JVM owner fields stay, before the provenance"
},
{
"path": "gen/index.ts",
"generatedBy": "barrel",
"why": "a whole-model file returns to the plain hash and is placed by its stem"
},
{
"path": "gen/Customer.ts",
"generatedBy": "entity",
"sourceNode": "acme::crm::Customer",
"why": "already recorded so: unchanged"
},
{
"path": "gen/Item.ts",
"generatedBy": "entity",
"sourceNode": "acme::crm::Item",
"why": "the sourceNode places a file the stem cannot"
},
{
"path": "gen/Missing.ts",
"generatedBy": "entity",
"sourceNode": "acme::shop::Missing",
"why": "no recorded hash: provenance never records a write"
}
],
"afterFiles": {
"acme.shop.json": {
"gen/Order.ts": {
"hash": "h1",
"generatedBy": "entity",
"sourceNode": "acme::shop::Order"
},
"gen/OrderDto.java": {
"hash": "h2",
"generator": "java:dto",
"outputDir": "gen",
"generatedBy": "dto",
"sourceNode": "acme::shop::Order"
}
},
"acme.crm.json": {
"gen/Customer.ts": {
"hash": "h3",
"generatedBy": "entity",
"sourceNode": "acme::crm::Customer"
},
"gen/Item.ts": {
"hash": "h6",
"generatedBy": "entity",
"sourceNode": "acme::crm::Item"
}
},
"acme.billing.json": {
"gen/Invoice.ts": "h5"
},
".root.json": {
"gen/index.ts": "h4"
}
},
"goldenFile": "acme.shop.json",
"goldenText": "{\n \"gen/Order.ts\": {\n \"hash\": \"h1\",\n \"generatedBy\": \"entity\",\n \"sourceNode\": \"acme::shop::Order\"\n },\n \"gen/OrderDto.java\": {\n \"hash\": \"h2\",\n \"generator\": \"java:dto\",\n \"outputDir\": \"gen\",\n \"generatedBy\": \"dto\",\n \"sourceNode\": \"acme::shop::Order\"\n }\n}\n"
}
}