fact-kit-facts 0.3.0 → 0.4.0-alpha.1

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.
@@ -1,9 +1,13 @@
1
1
  {
2
- "indexFormat": "1.1",
2
+ "indexFormat": "1.2",
3
3
  "package": "fact-kit-facts",
4
4
  "entry": "fact-kit-go",
5
- "component": "@go/fact-kit-facts",
5
+ "component": "fact-kit-facts.go",
6
6
  "describes": {},
7
+ "publish": {
8
+ "target": "go",
9
+ "name": "fact-kit"
10
+ },
7
11
  "facts": [
8
12
  {
9
13
  "id": "fact-kit-go.package",
@@ -136,6 +140,10 @@
136
140
  "name": "Describes",
137
141
  "js": "describes"
138
142
  },
143
+ {
144
+ "name": "Publish",
145
+ "js": "publish"
146
+ },
139
147
  {
140
148
  "name": "Facts",
141
149
  "js": "facts"
@@ -225,6 +233,10 @@
225
233
  "name": "Describes",
226
234
  "js": "describes"
227
235
  },
236
+ {
237
+ "name": "Publish",
238
+ "js": "publish"
239
+ },
228
240
  {
229
241
  "name": "Facts",
230
242
  "js": "facts"
@@ -1,9 +1,13 @@
1
1
  {
2
- "indexFormat": "1.1",
2
+ "indexFormat": "1.2",
3
3
  "package": "fact-kit-facts",
4
4
  "entry": "fact-kit-py",
5
- "component": "@pypi/fact-kit-facts",
5
+ "component": "fact-kit-facts.pypi",
6
6
  "describes": {},
7
+ "publish": {
8
+ "target": "pypi",
9
+ "name": "fact-kit"
10
+ },
7
11
  "facts": [
8
12
  {
9
13
  "id": "fact-kit-py.package",
@@ -122,6 +126,10 @@
122
126
  "name": "describes",
123
127
  "js": "describes"
124
128
  },
129
+ {
130
+ "name": "publish",
131
+ "js": "publish"
132
+ },
125
133
  {
126
134
  "name": "facts",
127
135
  "js": "facts"
@@ -211,6 +219,10 @@
211
219
  "name": "describes",
212
220
  "js": "describes"
213
221
  },
222
+ {
223
+ "name": "publish",
224
+ "js": "publish"
225
+ },
214
226
  {
215
227
  "name": "facts",
216
228
  "js": "facts"
@@ -1,9 +1,13 @@
1
1
  {
2
- "indexFormat": "1.1",
2
+ "indexFormat": "1.2",
3
3
  "package": "fact-kit-facts",
4
4
  "entry": "fact-kit-rs",
5
- "component": "@crates/fact-kit-facts",
5
+ "component": "fact-kit-facts.crates",
6
6
  "describes": {},
7
+ "publish": {
8
+ "target": "crates",
9
+ "name": "fact-kit"
10
+ },
7
11
  "facts": [
8
12
  {
9
13
  "id": "fact-kit-rs.package",
@@ -122,6 +126,10 @@
122
126
  "name": "describes",
123
127
  "js": "describes"
124
128
  },
129
+ {
130
+ "name": "publish",
131
+ "js": "publish"
132
+ },
125
133
  {
126
134
  "name": "facts",
127
135
  "js": "facts"
@@ -211,6 +219,10 @@
211
219
  "name": "describes",
212
220
  "js": "describes"
213
221
  },
222
+ {
223
+ "name": "publish",
224
+ "js": "publish"
225
+ },
214
226
  {
215
227
  "name": "facts",
216
228
  "js": "facts"
@@ -1,9 +1,13 @@
1
1
  {
2
- "indexFormat": "1.1",
2
+ "indexFormat": "1.2",
3
3
  "package": "fact-kit-facts",
4
4
  "entry": "fact-kit-swift",
5
- "component": "@swift/fact-kit-facts",
5
+ "component": "fact-kit-facts.swift",
6
6
  "describes": {},
7
+ "publish": {
8
+ "target": "swift",
9
+ "name": "fact-kit"
10
+ },
7
11
  "facts": [
8
12
  {
9
13
  "id": "fact-kit-swift.package",
@@ -135,6 +139,10 @@
135
139
  "name": "describes",
136
140
  "js": "describes"
137
141
  },
142
+ {
143
+ "name": "publish",
144
+ "js": "publish"
145
+ },
138
146
  {
139
147
  "name": "facts",
140
148
  "js": "facts"
@@ -223,6 +231,10 @@
223
231
  "name": "describes",
224
232
  "js": "describes"
225
233
  },
234
+ {
235
+ "name": "publish",
236
+ "js": "publish"
237
+ },
226
238
  {
227
239
  "name": "facts",
228
240
  "js": "facts"
package/dist/index.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
- "indexFormat": "1.1",
2
+ "indexFormat": "1.2",
3
3
  "package": "fact-kit-facts",
4
4
  "entry": ".",
5
- "component": "@npm/fact-kit-facts",
5
+ "component": "fact-kit-facts.npm",
6
6
  "describes": {
7
- "fact-kit": "0.8.0"
7
+ "fact-kit-js": "0.9.0-alpha.1"
8
+ },
9
+ "publish": {
10
+ "target": "npm",
11
+ "name": "fact-kit"
8
12
  },
9
13
  "facts": [
10
14
  {
@@ -514,6 +518,11 @@
514
518
  "rule": "`describes` names more than one component, or the entries of one package disagree (different components, or `{}` mixed with one).",
515
519
  "reads": "sources"
516
520
  },
521
+ {
522
+ "code": "publish",
523
+ "rule": "The entries of one package disagree on `publish` (different targets or names, or one entry without it).",
524
+ "reads": "sources"
525
+ },
517
526
  {
518
527
  "code": "since-format",
519
528
  "rule": "A `since` is not a version, `next`, or an array of versions that may end in `next`.",
@@ -651,6 +660,11 @@
651
660
  "rule": "`describes` names more than one component, or the entries of one package disagree (different components, or `{}` mixed with one).",
652
661
  "reads": "sources"
653
662
  },
663
+ {
664
+ "code": "publish",
665
+ "rule": "The entries of one package disagree on `publish` (different targets or names, or one entry without it).",
666
+ "reads": "sources"
667
+ },
654
668
  {
655
669
  "code": "since-format",
656
670
  "rule": "A `since` is not a version, `next`, or an array of versions that may end in `next`.",
@@ -811,6 +825,11 @@
811
825
  "rule": "`describes` names more than one component, or the entries of one package disagree (different components, or `{}` mixed with one).",
812
826
  "reads": "sources"
813
827
  },
828
+ {
829
+ "code": "publish",
830
+ "rule": "The entries of one package disagree on `publish` (different targets or names, or one entry without it).",
831
+ "reads": "sources"
832
+ },
814
833
  {
815
834
  "code": "since-format",
816
835
  "rule": "A `since` is not a version, `next`, or an array of versions that may end in `next`.",
@@ -1299,6 +1318,146 @@
1299
1318
  "title": {
1300
1319
  "en": "Fields of a built index.json"
1301
1320
  },
1321
+ "variants": [
1322
+ {
1323
+ "since": "0.0.0",
1324
+ "content": {
1325
+ "schema": {
1326
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1327
+ "title": "Fact index (dist/<entry>/index.json)",
1328
+ "type": "object",
1329
+ "required": [
1330
+ "package",
1331
+ "entry",
1332
+ "describes",
1333
+ "facts"
1334
+ ],
1335
+ "properties": {
1336
+ "indexFormat": {
1337
+ "type": "string",
1338
+ "pattern": "^[0-9]+\\.[0-9]+$",
1339
+ "description": "`1.1` for what this version builds. A missing field reads as `1.0`. Readers take any `1.x`."
1340
+ },
1341
+ "package": {
1342
+ "type": "string",
1343
+ "minLength": 1
1344
+ },
1345
+ "entry": {
1346
+ "type": "string",
1347
+ "minLength": 1,
1348
+ "description": "Sub-path of the entry, e.g. `claude-code`. In an aggregate package it is the path of the index in that package, and `.` for the root."
1349
+ },
1350
+ "component": {
1351
+ "type": "string",
1352
+ "minLength": 1,
1353
+ "description": "Aggregate package only: the name of the component package the index was built in."
1354
+ },
1355
+ "formatVersion": {
1356
+ "type": "string",
1357
+ "minLength": 1
1358
+ },
1359
+ "describes": {
1360
+ "description": "The component this entry describes and the latest published version it covers, e.g. `{ \"claude-code\": \"2.1.308\" }`. `{}` means the described thing has no version. `check` rejects an entry with several keys, and entries of one package that disagree (different components, or `{}` mixed with a component).",
1361
+ "type": "object",
1362
+ "additionalProperties": {
1363
+ "type": "string",
1364
+ "minLength": 1
1365
+ }
1366
+ },
1367
+ "facts": {
1368
+ "type": "array",
1369
+ "items": {
1370
+ "$ref": "urn:fact-kit:fact"
1371
+ }
1372
+ }
1373
+ }
1374
+ }
1375
+ }
1376
+ },
1377
+ {
1378
+ "since": "0.9.0-alpha.1",
1379
+ "content": {
1380
+ "schema": {
1381
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1382
+ "title": "Fact index (dist/<entry>/index.json)",
1383
+ "type": "object",
1384
+ "required": [
1385
+ "package",
1386
+ "entry",
1387
+ "describes",
1388
+ "facts"
1389
+ ],
1390
+ "properties": {
1391
+ "indexFormat": {
1392
+ "type": "string",
1393
+ "pattern": "^[0-9]+\\.[0-9]+$",
1394
+ "description": "`1.2` for what this version builds. A missing field reads as `1.0`. Readers take any `1.x`."
1395
+ },
1396
+ "package": {
1397
+ "type": "string",
1398
+ "minLength": 1
1399
+ },
1400
+ "entry": {
1401
+ "type": "string",
1402
+ "minLength": 1,
1403
+ "description": "Sub-path of the entry, e.g. `claude-code`. In an aggregate package it is the path of the index in that package, and `.` for the root."
1404
+ },
1405
+ "component": {
1406
+ "type": "string",
1407
+ "minLength": 1,
1408
+ "description": "Aggregate package only: the name of the component package the index was built in."
1409
+ },
1410
+ "formatVersion": {
1411
+ "type": "string",
1412
+ "minLength": 1
1413
+ },
1414
+ "describes": {
1415
+ "description": "The component this entry describes and the latest published version it covers, e.g. `{ \"claude-code\": \"2.1.308\" }`. `{}` means the described thing has no version. `check` rejects an entry with several keys, and entries of one package that disagree (different components, or `{}` mixed with a component).",
1416
+ "type": "object",
1417
+ "additionalProperties": {
1418
+ "type": "string",
1419
+ "minLength": 1
1420
+ }
1421
+ },
1422
+ "facts": {
1423
+ "type": "array",
1424
+ "items": {
1425
+ "$ref": "urn:fact-kit:fact"
1426
+ }
1427
+ },
1428
+ "publish": {
1429
+ "description": "Where the described component is published and under what name there (its PublishName), e.g. `{ \"target\": \"npm\", \"name\": \"fact-kit\" }`. `describes` is keyed by the component name, which can differ from the name on the registry. `readFacts` on the JS side uses it to find the installed package when `describes` is not keyed by an npm package name, and only when `target` is `npm`. The readers of the other languages return it and do not check any version. `check` rejects entries of one package that disagree. Left out, `readFacts` takes the `describes` key as the npm package name.",
1430
+ "type": "object",
1431
+ "required": [
1432
+ "target",
1433
+ "name"
1434
+ ],
1435
+ "additionalProperties": false,
1436
+ "properties": {
1437
+ "target": {
1438
+ "enum": [
1439
+ "npm",
1440
+ "pypi",
1441
+ "crates",
1442
+ "go",
1443
+ "swift"
1444
+ ]
1445
+ },
1446
+ "name": {
1447
+ "type": "string",
1448
+ "minLength": 1
1449
+ }
1450
+ }
1451
+ }
1452
+ }
1453
+ }
1454
+ }
1455
+ }
1456
+ ],
1457
+ "tool": "fact-kit",
1458
+ "source": {
1459
+ "kind": "published"
1460
+ },
1302
1461
  "content": {
1303
1462
  "schema": {
1304
1463
  "$schema": "https://json-schema.org/draft/2020-12/schema",
@@ -1314,7 +1473,7 @@
1314
1473
  "indexFormat": {
1315
1474
  "type": "string",
1316
1475
  "pattern": "^[0-9]+\\.[0-9]+$",
1317
- "description": "`1.1` for what this version builds. A missing field reads as `1.0`. Readers take any `1.x`."
1476
+ "description": "`1.2` for what this version builds. A missing field reads as `1.0`. Readers take any `1.x`."
1318
1477
  },
1319
1478
  "package": {
1320
1479
  "type": "string",
@@ -1347,13 +1506,33 @@
1347
1506
  "items": {
1348
1507
  "$ref": "urn:fact-kit:fact"
1349
1508
  }
1509
+ },
1510
+ "publish": {
1511
+ "description": "Where the described component is published and under what name there (its PublishName), e.g. `{ \"target\": \"npm\", \"name\": \"fact-kit\" }`. `describes` is keyed by the component name, which can differ from the name on the registry. `readFacts` on the JS side uses it to find the installed package when `describes` is not keyed by an npm package name, and only when `target` is `npm`. The readers of the other languages return it and do not check any version. `check` rejects entries of one package that disagree. Left out, `readFacts` takes the `describes` key as the npm package name.",
1512
+ "type": "object",
1513
+ "required": [
1514
+ "target",
1515
+ "name"
1516
+ ],
1517
+ "additionalProperties": false,
1518
+ "properties": {
1519
+ "target": {
1520
+ "enum": [
1521
+ "npm",
1522
+ "pypi",
1523
+ "crates",
1524
+ "go",
1525
+ "swift"
1526
+ ]
1527
+ },
1528
+ "name": {
1529
+ "type": "string",
1530
+ "minLength": 1
1531
+ }
1532
+ }
1350
1533
  }
1351
1534
  }
1352
1535
  }
1353
- },
1354
- "tool": "fact-kit",
1355
- "source": {
1356
- "kind": "published"
1357
1536
  }
1358
1537
  },
1359
1538
  {
@@ -1368,6 +1547,106 @@
1368
1547
  "description": {
1369
1548
  "en": "Run with Node type stripping, so only erasable syntax is allowed and relative imports end in `.ts`."
1370
1549
  },
1550
+ "variants": [
1551
+ {
1552
+ "since": "0.0.0",
1553
+ "content": {
1554
+ "schema": {
1555
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1556
+ "title": "Default export of facts/<entry>/index.ts",
1557
+ "type": "object",
1558
+ "required": [
1559
+ "describes",
1560
+ "facts"
1561
+ ],
1562
+ "additionalProperties": false,
1563
+ "properties": {
1564
+ "describes": {
1565
+ "type": "object",
1566
+ "additionalProperties": {
1567
+ "type": "string",
1568
+ "minLength": 1
1569
+ }
1570
+ },
1571
+ "formatVersion": {
1572
+ "type": "string",
1573
+ "minLength": 1
1574
+ },
1575
+ "facts": {
1576
+ "description": "Facts as they appear in the index, with three differences that the build resolves. `variants` may be the result of `history(...)`, and `content` may then be left out. `relates` lists other fact objects of this package, which become `derivedFrom`. An item may be `derive(upstreamSpec, id, map?)`, a fact computed from an installed upstream package.",
1577
+ "type": "array",
1578
+ "items": {
1579
+ "$ref": "urn:fact-kit:fact"
1580
+ }
1581
+ }
1582
+ }
1583
+ }
1584
+ }
1585
+ },
1586
+ {
1587
+ "since": "0.9.0-alpha.1",
1588
+ "content": {
1589
+ "schema": {
1590
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1591
+ "title": "Default export of facts/<entry>/index.ts",
1592
+ "type": "object",
1593
+ "required": [
1594
+ "describes",
1595
+ "facts"
1596
+ ],
1597
+ "additionalProperties": false,
1598
+ "properties": {
1599
+ "describes": {
1600
+ "type": "object",
1601
+ "additionalProperties": {
1602
+ "type": "string",
1603
+ "minLength": 1
1604
+ }
1605
+ },
1606
+ "formatVersion": {
1607
+ "type": "string",
1608
+ "minLength": 1
1609
+ },
1610
+ "facts": {
1611
+ "description": "Facts as they appear in the index, with three differences that the build resolves. `variants` may be the result of `history(...)`, and `content` may then be left out. `relates` lists other fact objects of this package, which become `derivedFrom`. An item may be `derive(upstreamSpec, id, map?)`, a fact computed from an installed upstream package.",
1612
+ "type": "array",
1613
+ "items": {
1614
+ "$ref": "urn:fact-kit:fact"
1615
+ }
1616
+ },
1617
+ "publish": {
1618
+ "description": "Where the described component is published and under what name there (its PublishName), e.g. `{ \"target\": \"npm\", \"name\": \"fact-kit\" }`. `describes` is keyed by the component name, which can differ from the name on the registry. `readFacts` on the JS side uses it to find the installed package when `describes` is not keyed by an npm package name, and only when `target` is `npm`. The readers of the other languages return it and do not check any version. `check` rejects entries of one package that disagree. Left out, `readFacts` takes the `describes` key as the npm package name.",
1619
+ "type": "object",
1620
+ "required": [
1621
+ "target",
1622
+ "name"
1623
+ ],
1624
+ "additionalProperties": false,
1625
+ "properties": {
1626
+ "target": {
1627
+ "enum": [
1628
+ "npm",
1629
+ "pypi",
1630
+ "crates",
1631
+ "go",
1632
+ "swift"
1633
+ ]
1634
+ },
1635
+ "name": {
1636
+ "type": "string",
1637
+ "minLength": 1
1638
+ }
1639
+ }
1640
+ }
1641
+ }
1642
+ }
1643
+ }
1644
+ }
1645
+ ],
1646
+ "tool": "fact-kit",
1647
+ "source": {
1648
+ "kind": "published"
1649
+ },
1371
1650
  "content": {
1372
1651
  "schema": {
1373
1652
  "$schema": "https://json-schema.org/draft/2020-12/schema",
@@ -1396,13 +1675,33 @@
1396
1675
  "items": {
1397
1676
  "$ref": "urn:fact-kit:fact"
1398
1677
  }
1678
+ },
1679
+ "publish": {
1680
+ "description": "Where the described component is published and under what name there (its PublishName), e.g. `{ \"target\": \"npm\", \"name\": \"fact-kit\" }`. `describes` is keyed by the component name, which can differ from the name on the registry. `readFacts` on the JS side uses it to find the installed package when `describes` is not keyed by an npm package name, and only when `target` is `npm`. The readers of the other languages return it and do not check any version. `check` rejects entries of one package that disagree. Left out, `readFacts` takes the `describes` key as the npm package name.",
1681
+ "type": "object",
1682
+ "required": [
1683
+ "target",
1684
+ "name"
1685
+ ],
1686
+ "additionalProperties": false,
1687
+ "properties": {
1688
+ "target": {
1689
+ "enum": [
1690
+ "npm",
1691
+ "pypi",
1692
+ "crates",
1693
+ "go",
1694
+ "swift"
1695
+ ]
1696
+ },
1697
+ "name": {
1698
+ "type": "string",
1699
+ "minLength": 1
1700
+ }
1701
+ }
1399
1702
  }
1400
1703
  }
1401
1704
  }
1402
- },
1403
- "tool": "fact-kit",
1404
- "source": {
1405
- "kind": "published"
1406
1705
  }
1407
1706
  },
1408
1707
  {
@@ -2369,6 +2668,7 @@
2369
2668
  "unknown-fact-id",
2370
2669
  "missing-schema-file",
2371
2670
  "describes",
2671
+ "publish",
2372
2672
  "since-format",
2373
2673
  "ambiguous-rows",
2374
2674
  "top-level-content",
@@ -2402,6 +2702,7 @@
2402
2702
  "unknown-fact-id",
2403
2703
  "missing-schema-file",
2404
2704
  "describes",
2705
+ "publish",
2405
2706
  "since-format",
2406
2707
  "ambiguous-rows",
2407
2708
  "top-level-content",
@@ -2442,6 +2743,7 @@
2442
2743
  "unknown-fact-id",
2443
2744
  "missing-schema-file",
2444
2745
  "describes",
2746
+ "publish",
2445
2747
  "since-format",
2446
2748
  "ambiguous-rows",
2447
2749
  "top-level-content",
@@ -2591,6 +2893,67 @@
2591
2893
  }
2592
2894
  }
2593
2895
  }
2896
+ },
2897
+ {
2898
+ "since": "0.9.0-alpha.1",
2899
+ "content": {
2900
+ "value": {
2901
+ "config": {
2902
+ "aggregate": {
2903
+ ".": "<component package>",
2904
+ "<sub-path>": "<component package>"
2905
+ }
2906
+ },
2907
+ "componentPackage": {
2908
+ "name": "<publish name without @<org>/>-facts, e.g. `promptex-macos-facts`. When that is also the base of another component package or of the aggregate in the repository, every one of them adds `.<publish target>`, e.g. `fact-kit-facts.npm` and `fact-kit-facts.go`. A unit with restricted access adds `@<scope>/`",
2909
+ "private": true,
2910
+ "dependedOnBy": "devDependencies of the aggregate, \"workspace:*\""
2911
+ },
2912
+ "placement": [
2913
+ {
2914
+ "component": "root, one entry",
2915
+ "dir": ".",
2916
+ "spec": "<aggregate>"
2917
+ },
2918
+ {
2919
+ "component": "root, several entries",
2920
+ "dir": "<entry>",
2921
+ "spec": "<aggregate>/<entry>",
2922
+ "conflict": "the entry has the name of another sub-path"
2923
+ },
2924
+ {
2925
+ "component": "sub-path, one entry",
2926
+ "dir": "<sub-path>",
2927
+ "spec": "<aggregate>/<sub-path>"
2928
+ },
2929
+ {
2930
+ "component": "sub-path, several entries",
2931
+ "dir": "<sub-path>/<entry>",
2932
+ "spec": "<aggregate>/<sub-path>/<entry>"
2933
+ }
2934
+ ],
2935
+ "exports": [
2936
+ "./<dir>/index.json",
2937
+ "./<dir>/schemas/*",
2938
+ "./<sub-path>/examples.json (`./examples.json` for the root), for each component that built examples"
2939
+ ],
2940
+ "rewrittenInIndex": {
2941
+ "package": "the aggregate package name",
2942
+ "entry": "the path of <dir>, `.` for the root",
2943
+ "component": "the component package name"
2944
+ },
2945
+ "rewrittenInFacts": "derivedFrom and movedTo that name a component package become the published spec",
2946
+ "examples": {
2947
+ "file": "examples.json",
2948
+ "dir": "<sub-path> (empty for the root), whatever number of entries the component has",
2949
+ "spec": "<aggregate>/<sub-path>, which is what `diff --impact` prints as `spec` of an example",
2950
+ "rewritten": {
2951
+ "package": "the aggregate package name"
2952
+ },
2953
+ "copied": "the groups as built by the component, unchanged"
2954
+ }
2955
+ }
2956
+ }
2594
2957
  }
2595
2958
  ],
2596
2959
  "tool": "fact-kit",
@@ -2606,7 +2969,7 @@
2606
2969
  }
2607
2970
  },
2608
2971
  "componentPackage": {
2609
- "name": "@<publish target>/<publish name>-facts",
2972
+ "name": "<publish name without @<org>/>-facts, e.g. `promptex-macos-facts`. When that is also the base of another component package or of the aggregate in the repository, every one of them adds `.<publish target>`, e.g. `fact-kit-facts.npm` and `fact-kit-facts.go`. A unit with restricted access adds `@<scope>/`",
2610
2973
  "private": true,
2611
2974
  "dependedOnBy": "devDependencies of the aggregate, \"workspace:*\""
2612
2975
  },
@@ -2664,6 +3027,225 @@
2664
3027
  "title": {
2665
3028
  "en": "readFacts parameters and return value"
2666
3029
  },
3030
+ "variants": [
3031
+ {
3032
+ "since": "0.0.0",
3033
+ "content": {
3034
+ "value": {
3035
+ "module": "fact-kit",
3036
+ "export": "readFacts",
3037
+ "signature": "readFacts(spec, options?) => FactReader",
3038
+ "parameters": [
3039
+ {
3040
+ "name": "spec",
3041
+ "type": "string",
3042
+ "required": true,
3043
+ "summary": "`<package>` or `<package>/<path>`, scoped names included, and the path may have several segments. The package must export `./index.json` or `./<path>/index.json`."
3044
+ },
3045
+ {
3046
+ "name": "options.root",
3047
+ "type": "string",
3048
+ "required": false,
3049
+ "default": "process.cwd()",
3050
+ "summary": "Directory the package is resolved from, normally the hub being built."
3051
+ },
3052
+ {
3053
+ "name": "options.version",
3054
+ "type": "string",
3055
+ "required": false,
3056
+ "default": "the installed version of the described component, else the latest published",
3057
+ "summary": "Version of the described component the reader runs, or `head` for the unreleased state. Without it, an installed described component sets the version, and one that is not installed leaves the latest published facts."
3058
+ },
3059
+ {
3060
+ "name": "options.include",
3061
+ "type": "string[]",
3062
+ "required": false,
3063
+ "default": "[]",
3064
+ "summary": "Labels of `pending` rows that a reader on `head` also gets."
3065
+ },
3066
+ {
3067
+ "name": "options.platform",
3068
+ "type": "string",
3069
+ "required": false,
3070
+ "summary": "Platform of the reader. A row with a `platforms` condition applies only when it lists this one."
3071
+ },
3072
+ {
3073
+ "name": "options.os",
3074
+ "type": "\"macos\" | \"linux\" | \"windows\"",
3075
+ "required": false,
3076
+ "summary": "Operating system of the reader. A row with an `os` condition applies only when it lists this one."
3077
+ },
3078
+ {
3079
+ "name": "options.onRead",
3080
+ "type": "(read: { package, version, entry, id, since }) => void",
3081
+ "required": false,
3082
+ "summary": "Called synchronously once per `get`, `value` and `has` that finds the fact, and once per read of a field other than `id` on an element of `facts`. Filtering `facts` by `id` does not call it."
3083
+ }
3084
+ ],
3085
+ "returns": {
3086
+ "members": [
3087
+ {
3088
+ "name": "package",
3089
+ "type": "string"
3090
+ },
3091
+ {
3092
+ "name": "version",
3093
+ "type": "string",
3094
+ "summary": "Version of the installed fact package, from its `package.json`."
3095
+ },
3096
+ {
3097
+ "name": "entry",
3098
+ "type": "string"
3099
+ },
3100
+ {
3101
+ "name": "describes",
3102
+ "type": "Record<string, string>"
3103
+ },
3104
+ {
3105
+ "name": "facts",
3106
+ "type": "SelectedFact[]",
3107
+ "summary": "The facts this reader sees, each flattened to its row."
3108
+ },
3109
+ {
3110
+ "name": "has",
3111
+ "type": "(id: string) => boolean"
3112
+ },
3113
+ {
3114
+ "name": "get",
3115
+ "type": "(id: string) => SelectedFact",
3116
+ "summary": "Throws when there is no such fact."
3117
+ },
3118
+ {
3119
+ "name": "value",
3120
+ "type": "<T>(id: string) => T",
3121
+ "summary": "The `content.value` of the fact. Throws when the fact has no value content."
3122
+ }
3123
+ ]
3124
+ },
3125
+ "throws": [
3126
+ "The spec is not of the form `<package>` or `<package>/<path>` (`not-found`).",
3127
+ "The package cannot be resolved from `root` (`not-found`).",
3128
+ "The resolved file is not a fact index (`not-an-index`) or has an index format other than 1.x (`unsupported-index-format`).",
3129
+ "A version is not semver (`invalid-version`).",
3130
+ "No `version` is given, and the described component is installed under `root` in a newer version than the facts describe."
3131
+ ]
3132
+ }
3133
+ }
3134
+ },
3135
+ {
3136
+ "since": "0.9.0-alpha.1",
3137
+ "content": {
3138
+ "value": {
3139
+ "module": "fact-kit",
3140
+ "export": "readFacts",
3141
+ "signature": "readFacts(spec, options?) => FactReader",
3142
+ "parameters": [
3143
+ {
3144
+ "name": "spec",
3145
+ "type": "string",
3146
+ "required": true,
3147
+ "summary": "`<package>` or `<package>/<path>`, scoped names included, and the path may have several segments. The package must export `./index.json` or `./<path>/index.json`."
3148
+ },
3149
+ {
3150
+ "name": "options.root",
3151
+ "type": "string",
3152
+ "required": false,
3153
+ "default": "process.cwd()",
3154
+ "summary": "Directory the package is resolved from, normally the hub being built."
3155
+ },
3156
+ {
3157
+ "name": "options.version",
3158
+ "type": "string",
3159
+ "required": false,
3160
+ "default": "the installed version of the described component, else the latest published",
3161
+ "summary": "Version of the described component the reader runs, or `head` for the unreleased state. Without it, an installed described component sets the version, and one that is not installed leaves the latest published facts."
3162
+ },
3163
+ {
3164
+ "name": "options.include",
3165
+ "type": "string[]",
3166
+ "required": false,
3167
+ "default": "[]",
3168
+ "summary": "Labels of `pending` rows that a reader on `head` also gets."
3169
+ },
3170
+ {
3171
+ "name": "options.platform",
3172
+ "type": "string",
3173
+ "required": false,
3174
+ "summary": "Platform of the reader. A row with a `platforms` condition applies only when it lists this one."
3175
+ },
3176
+ {
3177
+ "name": "options.os",
3178
+ "type": "\"macos\" | \"linux\" | \"windows\"",
3179
+ "required": false,
3180
+ "summary": "Operating system of the reader. A row with an `os` condition applies only when it lists this one."
3181
+ },
3182
+ {
3183
+ "name": "options.onRead",
3184
+ "type": "(read: { package, version, entry, id, since }) => void",
3185
+ "required": false,
3186
+ "summary": "Called synchronously once per `get`, `value` and `has` that finds the fact, and once per read of a field other than `id` on an element of `facts`. Filtering `facts` by `id` does not call it."
3187
+ }
3188
+ ],
3189
+ "returns": {
3190
+ "members": [
3191
+ {
3192
+ "name": "package",
3193
+ "type": "string"
3194
+ },
3195
+ {
3196
+ "name": "version",
3197
+ "type": "string",
3198
+ "summary": "Version of the installed fact package, from its `package.json`."
3199
+ },
3200
+ {
3201
+ "name": "entry",
3202
+ "type": "string"
3203
+ },
3204
+ {
3205
+ "name": "describes",
3206
+ "type": "Record<string, string>"
3207
+ },
3208
+ {
3209
+ "name": "publish",
3210
+ "type": "{ target: \"npm\" | \"pypi\" | \"crates\" | \"go\" | \"swift\"; name: string } | undefined",
3211
+ "summary": "The `publish` field of the index, as it is. Undefined for an index that has none."
3212
+ },
3213
+ {
3214
+ "name": "facts",
3215
+ "type": "SelectedFact[]",
3216
+ "summary": "The facts this reader sees, each flattened to its row."
3217
+ },
3218
+ {
3219
+ "name": "has",
3220
+ "type": "(id: string) => boolean"
3221
+ },
3222
+ {
3223
+ "name": "get",
3224
+ "type": "(id: string) => SelectedFact",
3225
+ "summary": "Throws when there is no such fact."
3226
+ },
3227
+ {
3228
+ "name": "value",
3229
+ "type": "<T>(id: string) => T",
3230
+ "summary": "The `content.value` of the fact. Throws when the fact has no value content."
3231
+ }
3232
+ ]
3233
+ },
3234
+ "throws": [
3235
+ "The spec is not of the form `<package>` or `<package>/<path>` (`not-found`).",
3236
+ "The package cannot be resolved from `root` (`not-found`).",
3237
+ "The resolved file is not a fact index (`not-an-index`) or has an index format other than 1.x (`unsupported-index-format`).",
3238
+ "A version is not semver (`invalid-version`).",
3239
+ "No `version` is given, and the described component is installed under `root` in a newer version than the facts describe (`describes-behind`). The component is looked up as `publish.name` when the index has `publish` with target `npm`, is not looked up when `publish` has another target, and is looked up by the `describes` key when there is no `publish`."
3240
+ ]
3241
+ }
3242
+ }
3243
+ }
3244
+ ],
3245
+ "tool": "fact-kit",
3246
+ "source": {
3247
+ "kind": "published"
3248
+ },
2667
3249
  "content": {
2668
3250
  "value": {
2669
3251
  "module": "fact-kit",
@@ -2735,6 +3317,11 @@
2735
3317
  "name": "describes",
2736
3318
  "type": "Record<string, string>"
2737
3319
  },
3320
+ {
3321
+ "name": "publish",
3322
+ "type": "{ target: \"npm\" | \"pypi\" | \"crates\" | \"go\" | \"swift\"; name: string } | undefined",
3323
+ "summary": "The `publish` field of the index, as it is. Undefined for an index that has none."
3324
+ },
2738
3325
  {
2739
3326
  "name": "facts",
2740
3327
  "type": "SelectedFact[]",
@@ -2761,13 +3348,9 @@
2761
3348
  "The package cannot be resolved from `root` (`not-found`).",
2762
3349
  "The resolved file is not a fact index (`not-an-index`) or has an index format other than 1.x (`unsupported-index-format`).",
2763
3350
  "A version is not semver (`invalid-version`).",
2764
- "No `version` is given, and the described component is installed under `root` in a newer version than the facts describe."
3351
+ "No `version` is given, and the described component is installed under `root` in a newer version than the facts describe (`describes-behind`). The component is looked up as `publish.name` when the index has `publish` with target `npm`, is not looked up when `publish` has another target, and is looked up by the `describes` key when there is no `publish`."
2765
3352
  ]
2766
3353
  }
2767
- },
2768
- "tool": "fact-kit",
2769
- "source": {
2770
- "kind": "published"
2771
3354
  }
2772
3355
  },
2773
3356
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fact-kit-facts",
3
- "version": "0.3.0",
3
+ "version": "0.4.0-alpha.1",
4
4
  "description": "Facts about fact-kit: the spec of its index format, commands and API",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,11 +13,11 @@
13
13
  "dist"
14
14
  ],
15
15
  "devDependencies": {
16
- "@npm/fact-kit-facts": "0.0.0",
17
- "@pypi/fact-kit-facts": "0.0.0",
18
- "@crates/fact-kit-facts": "0.0.0",
19
- "@go/fact-kit-facts": "0.0.0",
20
- "@swift/fact-kit-facts": "0.0.0"
16
+ "fact-kit-facts.npm": "0.0.0",
17
+ "fact-kit-facts.pypi": "0.0.0",
18
+ "fact-kit-facts.crates": "0.0.0",
19
+ "fact-kit-facts.go": "0.0.0",
20
+ "fact-kit-facts.swift": "0.0.0"
21
21
  },
22
22
  "exports": {
23
23
  "./index.json": "./dist/index.json",