@wildwinter/toolkit 0.2.4 → 0.2.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @wildwinter/toolkit
2
2
 
3
+ ## 0.2.6
4
+
5
+ ### Added
6
+
7
+ - **Views and reads in a manifest** (`./extensions`, tier 2): `views` declares the web components an extension's
8
+ installed package supplies, each with an `id`, a `name`, an `entry` script inside the package, the custom `element`
9
+ it defines, and optionally the `hosts` that offer it; `reads` names the other extensions whose data the views read.
10
+ The manifest check holds both to their shape. `viewsFor(manifest, host)` lists the views a host offers, and
11
+ `isViewEntry` keeps an entry inside its package.
12
+
13
+ ## 0.2.5
14
+
15
+ ### Added
16
+
17
+ - **A `pick` value type** (`./extensions`): one choice from the sources a manifest names in `from`, in order:
18
+ fixed `words`, the nodes of a reference kind (`to`), and a list of text on the extension's own project node
19
+ (`list`). The value is text; empty is automatic. The manifest check holds each source to its shape and each
20
+ `list` to a list of text on the project target. `valueProblems` reports a value no source holds
21
+ (`not-a-choice`) and one two sources hold (`pick-ambiguous`, a warning), given the host's lists in the new
22
+ `ValueContext.list`. `pickChoices` lists the choices for an editor, `pickClashes` reports each name two sources
23
+ hold once for the project, and `pickLists` reads the lists off the project entry.
24
+
3
25
  ## 0.2.4
4
26
 
5
27
  ### Added
@@ -11,6 +11,7 @@
11
11
  { "name": "flags: none", "decl": { "name": "a", "type": "flags", "values": ["x"] }, "default": [] },
12
12
  { "name": "quality: the first stage", "decl": { "name": "a", "type": "quality", "stages": ["p", "q"] }, "default": "p" },
13
13
  { "name": "reference: none", "decl": { "name": "a", "type": "reference", "to": "card" }, "default": "" },
14
+ { "name": "pick: automatic", "decl": { "name": "a", "type": "pick", "from": [{ "words": ["all"] }, { "to": "cast" }] }, "default": "" },
14
15
  { "name": "record: each field's default", "decl": { "name": "a", "type": "record", "fields": [
15
16
  { "name": "s", "type": "text" }, { "name": "n", "type": "number", "default": 2 }, { "name": "q", "type": "quality", "stages": ["p", "q"] }
16
17
  ] }, "default": { "n": 2, "q": "p", "s": "" } },
@@ -1124,6 +1124,552 @@
1124
1124
  "code": "value-help"
1125
1125
  }
1126
1126
  ]
1127
+ },
1128
+ {
1129
+ "name": "a pick over words, a node kind and a project list passes",
1130
+ "manifest": {
1131
+ "schema": "wildwinter/extension@0",
1132
+ "id": "probe",
1133
+ "name": "Probe",
1134
+ "version": "1.0.0",
1135
+ "targets": {
1136
+ "patter": {
1137
+ "line": {
1138
+ "fields": [
1139
+ {
1140
+ "name": "to",
1141
+ "type": "pick",
1142
+ "from": [
1143
+ {
1144
+ "words": [
1145
+ "all"
1146
+ ]
1147
+ },
1148
+ {
1149
+ "to": "cast"
1150
+ },
1151
+ {
1152
+ "list": "pointsOfInterest"
1153
+ }
1154
+ ]
1155
+ }
1156
+ ]
1157
+ },
1158
+ "project": {
1159
+ "fields": [
1160
+ {
1161
+ "name": "pointsOfInterest",
1162
+ "type": "list",
1163
+ "of": {
1164
+ "type": "text"
1165
+ }
1166
+ }
1167
+ ]
1168
+ }
1169
+ }
1170
+ }
1171
+ },
1172
+ "problems": []
1173
+ },
1174
+ {
1175
+ "name": "a pick inside a record passes, its list checked",
1176
+ "manifest": {
1177
+ "schema": "wildwinter/extension@0",
1178
+ "id": "probe",
1179
+ "name": "Probe",
1180
+ "version": "1.0.0",
1181
+ "targets": {
1182
+ "patter": {
1183
+ "line": {
1184
+ "fields": [
1185
+ {
1186
+ "name": "look",
1187
+ "type": "record",
1188
+ "fields": [
1189
+ {
1190
+ "name": "at",
1191
+ "type": "pick",
1192
+ "from": [
1193
+ {
1194
+ "list": "pointsOfInterest"
1195
+ }
1196
+ ]
1197
+ }
1198
+ ]
1199
+ }
1200
+ ]
1201
+ },
1202
+ "project": {
1203
+ "fields": [
1204
+ {
1205
+ "name": "pointsOfInterest",
1206
+ "type": "list",
1207
+ "of": {
1208
+ "type": "text"
1209
+ }
1210
+ }
1211
+ ]
1212
+ }
1213
+ }
1214
+ }
1215
+ },
1216
+ "problems": []
1217
+ },
1218
+ {
1219
+ "name": "a pick with no sources",
1220
+ "manifest": {
1221
+ "schema": "wildwinter/extension@0",
1222
+ "id": "probe",
1223
+ "name": "Probe",
1224
+ "version": "1.0.0",
1225
+ "targets": {
1226
+ "patter": {
1227
+ "line": {
1228
+ "fields": [
1229
+ {
1230
+ "name": "to",
1231
+ "type": "pick"
1232
+ }
1233
+ ]
1234
+ }
1235
+ }
1236
+ }
1237
+ },
1238
+ "problems": [
1239
+ {
1240
+ "path": "targets.patter.line.fields[0].from",
1241
+ "code": "pick-from"
1242
+ }
1243
+ ]
1244
+ },
1245
+ {
1246
+ "name": "a pick source is one of words, to and list",
1247
+ "manifest": {
1248
+ "schema": "wildwinter/extension@0",
1249
+ "id": "probe",
1250
+ "name": "Probe",
1251
+ "version": "1.0.0",
1252
+ "targets": {
1253
+ "patter": {
1254
+ "line": {
1255
+ "fields": [
1256
+ {
1257
+ "name": "to",
1258
+ "type": "pick",
1259
+ "from": [
1260
+ {
1261
+ "words": [
1262
+ "all"
1263
+ ],
1264
+ "to": "cast"
1265
+ },
1266
+ {}
1267
+ ]
1268
+ }
1269
+ ]
1270
+ }
1271
+ }
1272
+ }
1273
+ },
1274
+ "problems": [
1275
+ {
1276
+ "path": "targets.patter.line.fields[0].from[0]",
1277
+ "code": "pick-source"
1278
+ },
1279
+ {
1280
+ "path": "targets.patter.line.fields[0].from[1]",
1281
+ "code": "pick-source"
1282
+ }
1283
+ ]
1284
+ },
1285
+ {
1286
+ "name": "a pick's nodes are of a kind the host references",
1287
+ "manifest": {
1288
+ "schema": "wildwinter/extension@0",
1289
+ "id": "probe",
1290
+ "name": "Probe",
1291
+ "version": "1.0.0",
1292
+ "targets": {
1293
+ "patter": {
1294
+ "line": {
1295
+ "fields": [
1296
+ {
1297
+ "name": "to",
1298
+ "type": "pick",
1299
+ "from": [
1300
+ {
1301
+ "to": "card"
1302
+ }
1303
+ ]
1304
+ }
1305
+ ]
1306
+ }
1307
+ }
1308
+ }
1309
+ },
1310
+ "problems": [
1311
+ {
1312
+ "path": "targets.patter.line.fields[0].from[0].to",
1313
+ "code": "reference-to"
1314
+ }
1315
+ ]
1316
+ },
1317
+ {
1318
+ "name": "a pick's words are named, once each",
1319
+ "manifest": {
1320
+ "schema": "wildwinter/extension@0",
1321
+ "id": "probe",
1322
+ "name": "Probe",
1323
+ "version": "1.0.0",
1324
+ "targets": {
1325
+ "patter": {
1326
+ "line": {
1327
+ "fields": [
1328
+ {
1329
+ "name": "to",
1330
+ "type": "pick",
1331
+ "from": [
1332
+ {
1333
+ "words": [
1334
+ "all",
1335
+ "",
1336
+ "all"
1337
+ ]
1338
+ }
1339
+ ]
1340
+ }
1341
+ ]
1342
+ }
1343
+ }
1344
+ }
1345
+ },
1346
+ "problems": [
1347
+ {
1348
+ "path": "targets.patter.line.fields[0].from[0].words[1]",
1349
+ "code": "value-empty"
1350
+ },
1351
+ {
1352
+ "path": "targets.patter.line.fields[0].from[0].words[2]",
1353
+ "code": "value-duplicate"
1354
+ }
1355
+ ]
1356
+ },
1357
+ {
1358
+ "name": "a pick's list is a list of text on the project node",
1359
+ "manifest": {
1360
+ "schema": "wildwinter/extension@0",
1361
+ "id": "probe",
1362
+ "name": "Probe",
1363
+ "version": "1.0.0",
1364
+ "targets": {
1365
+ "patter": {
1366
+ "line": {
1367
+ "fields": [
1368
+ {
1369
+ "name": "to",
1370
+ "type": "pick",
1371
+ "from": [
1372
+ {
1373
+ "list": "pointsOfInterest"
1374
+ },
1375
+ {
1376
+ "list": "moods"
1377
+ }
1378
+ ]
1379
+ }
1380
+ ]
1381
+ },
1382
+ "project": {
1383
+ "fields": [
1384
+ {
1385
+ "name": "moods",
1386
+ "type": "list",
1387
+ "of": {
1388
+ "type": "number"
1389
+ }
1390
+ }
1391
+ ]
1392
+ }
1393
+ }
1394
+ }
1395
+ },
1396
+ "problems": [
1397
+ {
1398
+ "path": "targets.patter.line.fields[0].from[0].list",
1399
+ "code": "pick-list"
1400
+ },
1401
+ {
1402
+ "path": "targets.patter.line.fields[0].from[1].list",
1403
+ "code": "pick-list"
1404
+ }
1405
+ ]
1406
+ },
1407
+ {
1408
+ "name": "a pick's default must be a choice when its words are all it has",
1409
+ "manifest": {
1410
+ "schema": "wildwinter/extension@0",
1411
+ "id": "probe",
1412
+ "name": "Probe",
1413
+ "version": "1.0.0",
1414
+ "targets": {
1415
+ "patter": {
1416
+ "line": {
1417
+ "fields": [
1418
+ {
1419
+ "name": "favour",
1420
+ "type": "pick",
1421
+ "from": [
1422
+ {
1423
+ "words": [
1424
+ "speaker"
1425
+ ]
1426
+ }
1427
+ ],
1428
+ "default": "crowd"
1429
+ }
1430
+ ]
1431
+ }
1432
+ }
1433
+ }
1434
+ },
1435
+ "problems": [
1436
+ {
1437
+ "path": "targets.patter.line.fields[0].default",
1438
+ "code": "default-misfit"
1439
+ }
1440
+ ]
1441
+ },
1442
+ {
1443
+ "name": "views and reads pass",
1444
+ "manifest": {
1445
+ "schema": "wildwinter/extension@0",
1446
+ "id": "probe",
1447
+ "name": "Probe",
1448
+ "version": "1.0.0",
1449
+ "targets": {
1450
+ "patter": {
1451
+ "line": {
1452
+ "fields": [
1453
+ {
1454
+ "name": "mood",
1455
+ "type": "text"
1456
+ }
1457
+ ]
1458
+ }
1459
+ }
1460
+ },
1461
+ "views": [
1462
+ {
1463
+ "id": "sheet",
1464
+ "name": "Sheet",
1465
+ "entry": "view/sheet.js",
1466
+ "element": "probe-sheet"
1467
+ },
1468
+ {
1469
+ "id": "cards",
1470
+ "name": "Cards",
1471
+ "entry": "cards.js",
1472
+ "element": "probe-cards",
1473
+ "hosts": [
1474
+ "patter"
1475
+ ]
1476
+ }
1477
+ ],
1478
+ "reads": [
1479
+ "patterstage"
1480
+ ]
1481
+ },
1482
+ "problems": []
1483
+ },
1484
+ {
1485
+ "name": "a view's shape is checked",
1486
+ "manifest": {
1487
+ "schema": "wildwinter/extension@0",
1488
+ "id": "probe",
1489
+ "name": "Probe",
1490
+ "version": "1.0.0",
1491
+ "targets": {
1492
+ "patter": {
1493
+ "line": {
1494
+ "fields": [
1495
+ {
1496
+ "name": "mood",
1497
+ "type": "text"
1498
+ }
1499
+ ]
1500
+ }
1501
+ }
1502
+ },
1503
+ "views": [
1504
+ {
1505
+ "id": "Sheet",
1506
+ "name": " ",
1507
+ "entry": "../sheet.js",
1508
+ "element": "sheet",
1509
+ "colour": "red"
1510
+ },
1511
+ {
1512
+ "id": "two",
1513
+ "name": "Two",
1514
+ "entry": "/abs/two.js",
1515
+ "element": "Probe-Two",
1516
+ "hosts": []
1517
+ },
1518
+ {
1519
+ "id": "three",
1520
+ "name": "Three",
1521
+ "entry": "view\\three.js",
1522
+ "element": "probe-three",
1523
+ "hosts": [
1524
+ "ink",
1525
+ "storylets"
1526
+ ]
1527
+ },
1528
+ {
1529
+ "id": "three",
1530
+ "name": "Again",
1531
+ "entry": "view/again.mjs",
1532
+ "element": "probe-three"
1533
+ }
1534
+ ]
1535
+ },
1536
+ "problems": [
1537
+ {
1538
+ "path": "views[0].colour",
1539
+ "code": "unknown-key",
1540
+ "severity": "warning"
1541
+ },
1542
+ {
1543
+ "path": "views[0].id",
1544
+ "code": "view-id"
1545
+ },
1546
+ {
1547
+ "path": "views[0].name",
1548
+ "code": "view-name"
1549
+ },
1550
+ {
1551
+ "path": "views[0].entry",
1552
+ "code": "view-entry"
1553
+ },
1554
+ {
1555
+ "path": "views[0].element",
1556
+ "code": "view-element"
1557
+ },
1558
+ {
1559
+ "path": "views[1].entry",
1560
+ "code": "view-entry"
1561
+ },
1562
+ {
1563
+ "path": "views[1].element",
1564
+ "code": "view-element"
1565
+ },
1566
+ {
1567
+ "path": "views[1].hosts",
1568
+ "code": "view-hosts"
1569
+ },
1570
+ {
1571
+ "path": "views[2].entry",
1572
+ "code": "view-entry"
1573
+ },
1574
+ {
1575
+ "path": "views[2].hosts[0]",
1576
+ "code": "unknown-host"
1577
+ },
1578
+ {
1579
+ "path": "views[2].hosts[1]",
1580
+ "code": "view-host-untargeted",
1581
+ "severity": "warning"
1582
+ },
1583
+ {
1584
+ "path": "views[3].id",
1585
+ "code": "view-duplicate"
1586
+ },
1587
+ {
1588
+ "path": "views[3].entry",
1589
+ "code": "view-entry"
1590
+ },
1591
+ {
1592
+ "path": "views[3].element",
1593
+ "code": "view-duplicate"
1594
+ }
1595
+ ]
1596
+ },
1597
+ {
1598
+ "name": "reads name other extensions, once each",
1599
+ "manifest": {
1600
+ "schema": "wildwinter/extension@0",
1601
+ "id": "probe",
1602
+ "name": "Probe",
1603
+ "version": "1.0.0",
1604
+ "targets": {
1605
+ "patter": {
1606
+ "line": {
1607
+ "fields": [
1608
+ {
1609
+ "name": "mood",
1610
+ "type": "text"
1611
+ }
1612
+ ]
1613
+ }
1614
+ }
1615
+ },
1616
+ "reads": [
1617
+ "patterstage",
1618
+ "probe",
1619
+ "patterstage",
1620
+ "Bad"
1621
+ ]
1622
+ },
1623
+ "problems": [
1624
+ {
1625
+ "path": "reads[1]",
1626
+ "code": "reads-self",
1627
+ "severity": "warning"
1628
+ },
1629
+ {
1630
+ "path": "reads[2]",
1631
+ "code": "reads-duplicate"
1632
+ },
1633
+ {
1634
+ "path": "reads[3]",
1635
+ "code": "reads-id"
1636
+ }
1637
+ ]
1638
+ },
1639
+ {
1640
+ "name": "views and reads must be lists",
1641
+ "manifest": {
1642
+ "schema": "wildwinter/extension@0",
1643
+ "id": "probe",
1644
+ "name": "Probe",
1645
+ "version": "1.0.0",
1646
+ "targets": {
1647
+ "patter": {
1648
+ "line": {
1649
+ "fields": [
1650
+ {
1651
+ "name": "mood",
1652
+ "type": "text"
1653
+ }
1654
+ ]
1655
+ }
1656
+ }
1657
+ },
1658
+ "views": {
1659
+ "id": "sheet"
1660
+ },
1661
+ "reads": "patterstage"
1662
+ },
1663
+ "problems": [
1664
+ {
1665
+ "path": "views",
1666
+ "code": "not-a-list"
1667
+ },
1668
+ {
1669
+ "path": "reads",
1670
+ "code": "not-a-list"
1671
+ }
1672
+ ]
1127
1673
  }
1128
1674
  ]
1129
1675
  }