@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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "about": "Value validation. A case gives a field declaration and a value (valueProblems), or a target and a node's entry (entryProblems), with the nodes that exist for references as kind:id. Paths are relative to the value or entry. A problem's severity is error unless the case says warning; `options` is checked where given.",
2
+ "about": "Value validation. A case gives a field declaration and a value (valueProblems), or a target and a node's entry (entryProblems), with the nodes that exist for references as kind:id and, for a pick's list sources, the extension's project lists by name (`lists`; absent, list sources are not checked). Paths are relative to the value or entry. A problem's severity is error unless the case says warning; `options` is checked where given. `picks` gives a pick's declaration and what the host offers (`nodes` by kind, as id and label, and `lists`): every choice `pickChoices` makes, in order, and the names `pickClashes` reports.",
3
3
  "cases": [
4
4
  {
5
5
  "name": "scalars that fit pass",
@@ -650,6 +650,291 @@
650
650
  "code": "wrong-type"
651
651
  }
652
652
  ]
653
+ },
654
+ {
655
+ "name": "a pick: empty is automatic",
656
+ "decl": {
657
+ "name": "to",
658
+ "type": "pick",
659
+ "from": [
660
+ {
661
+ "words": [
662
+ "all"
663
+ ]
664
+ },
665
+ {
666
+ "to": "cast"
667
+ },
668
+ {
669
+ "list": "pointsOfInterest"
670
+ }
671
+ ]
672
+ },
673
+ "value": "",
674
+ "refs": [],
675
+ "lists": {
676
+ "pointsOfInterest": []
677
+ },
678
+ "problems": []
679
+ },
680
+ {
681
+ "name": "a pick: a fixed word",
682
+ "decl": {
683
+ "name": "to",
684
+ "type": "pick",
685
+ "from": [
686
+ {
687
+ "words": [
688
+ "all"
689
+ ]
690
+ },
691
+ {
692
+ "to": "cast"
693
+ },
694
+ {
695
+ "list": "pointsOfInterest"
696
+ }
697
+ ]
698
+ },
699
+ "value": "all",
700
+ "refs": [],
701
+ "lists": {
702
+ "pointsOfInterest": []
703
+ },
704
+ "problems": []
705
+ },
706
+ {
707
+ "name": "a pick: a node of its kind",
708
+ "decl": {
709
+ "name": "to",
710
+ "type": "pick",
711
+ "from": [
712
+ {
713
+ "words": [
714
+ "all"
715
+ ]
716
+ },
717
+ {
718
+ "to": "cast"
719
+ },
720
+ {
721
+ "list": "pointsOfInterest"
722
+ }
723
+ ]
724
+ },
725
+ "value": "ANNA",
726
+ "refs": [
727
+ "cast:ANNA"
728
+ ],
729
+ "lists": {
730
+ "pointsOfInterest": [
731
+ "Gate"
732
+ ]
733
+ },
734
+ "problems": []
735
+ },
736
+ {
737
+ "name": "a pick: an entry of a project list",
738
+ "decl": {
739
+ "name": "to",
740
+ "type": "pick",
741
+ "from": [
742
+ {
743
+ "words": [
744
+ "all"
745
+ ]
746
+ },
747
+ {
748
+ "to": "cast"
749
+ },
750
+ {
751
+ "list": "pointsOfInterest"
752
+ }
753
+ ]
754
+ },
755
+ "value": "Gate",
756
+ "refs": [
757
+ "cast:ANNA"
758
+ ],
759
+ "lists": {
760
+ "pointsOfInterest": [
761
+ "Gate"
762
+ ]
763
+ },
764
+ "problems": []
765
+ },
766
+ {
767
+ "name": "a pick: a name in no source",
768
+ "decl": {
769
+ "name": "to",
770
+ "type": "pick",
771
+ "from": [
772
+ {
773
+ "words": [
774
+ "all"
775
+ ]
776
+ },
777
+ {
778
+ "to": "cast"
779
+ },
780
+ {
781
+ "list": "pointsOfInterest"
782
+ }
783
+ ]
784
+ },
785
+ "value": "Gaet",
786
+ "refs": [
787
+ "cast:ANNA"
788
+ ],
789
+ "lists": {
790
+ "pointsOfInterest": [
791
+ "Gate"
792
+ ]
793
+ },
794
+ "problems": [
795
+ {
796
+ "path": "",
797
+ "code": "not-a-choice"
798
+ }
799
+ ]
800
+ },
801
+ {
802
+ "name": "a pick: a name in two sources is ambiguous",
803
+ "decl": {
804
+ "name": "to",
805
+ "type": "pick",
806
+ "from": [
807
+ {
808
+ "words": [
809
+ "all"
810
+ ]
811
+ },
812
+ {
813
+ "to": "cast"
814
+ },
815
+ {
816
+ "list": "pointsOfInterest"
817
+ }
818
+ ]
819
+ },
820
+ "value": "Gate",
821
+ "refs": [
822
+ "cast:Gate"
823
+ ],
824
+ "lists": {
825
+ "pointsOfInterest": [
826
+ "Gate"
827
+ ]
828
+ },
829
+ "problems": [
830
+ {
831
+ "path": "",
832
+ "code": "pick-ambiguous",
833
+ "severity": "warning"
834
+ }
835
+ ]
836
+ },
837
+ {
838
+ "name": "a pick: a list the project leaves out holds nothing",
839
+ "decl": {
840
+ "name": "to",
841
+ "type": "pick",
842
+ "from": [
843
+ {
844
+ "words": [
845
+ "all"
846
+ ]
847
+ },
848
+ {
849
+ "to": "cast"
850
+ },
851
+ {
852
+ "list": "pointsOfInterest"
853
+ }
854
+ ]
855
+ },
856
+ "value": "Gate",
857
+ "refs": [
858
+ "cast:ANNA"
859
+ ],
860
+ "lists": {},
861
+ "problems": [
862
+ {
863
+ "path": "",
864
+ "code": "not-a-choice"
865
+ }
866
+ ]
867
+ },
868
+ {
869
+ "name": "a pick: unchecked when the host has no nodes or lists to hand",
870
+ "decl": {
871
+ "name": "to",
872
+ "type": "pick",
873
+ "from": [
874
+ {
875
+ "words": [
876
+ "all"
877
+ ]
878
+ },
879
+ {
880
+ "to": "cast"
881
+ },
882
+ {
883
+ "list": "pointsOfInterest"
884
+ }
885
+ ]
886
+ },
887
+ "value": "Gaet",
888
+ "problems": []
889
+ },
890
+ {
891
+ "name": "a pick of words alone is checked without the host",
892
+ "decl": {
893
+ "name": "favour",
894
+ "type": "pick",
895
+ "from": [
896
+ {
897
+ "words": [
898
+ "speaker",
899
+ "listener"
900
+ ]
901
+ }
902
+ ]
903
+ },
904
+ "value": "crowd",
905
+ "problems": [
906
+ {
907
+ "path": "",
908
+ "code": "not-a-choice"
909
+ }
910
+ ]
911
+ },
912
+ {
913
+ "name": "a pick holds text",
914
+ "decl": {
915
+ "name": "to",
916
+ "type": "pick",
917
+ "from": [
918
+ {
919
+ "words": [
920
+ "all"
921
+ ]
922
+ },
923
+ {
924
+ "to": "cast"
925
+ },
926
+ {
927
+ "list": "pointsOfInterest"
928
+ }
929
+ ]
930
+ },
931
+ "value": 3,
932
+ "problems": [
933
+ {
934
+ "path": "",
935
+ "code": "wrong-type"
936
+ }
937
+ ]
653
938
  }
654
939
  ],
655
940
  "claims": [
@@ -737,5 +1022,246 @@
737
1022
  ]
738
1023
  }
739
1024
  }
1025
+ ],
1026
+ "picks": [
1027
+ {
1028
+ "name": "choices in source order, each source's in its own",
1029
+ "decl": {
1030
+ "name": "to",
1031
+ "type": "pick",
1032
+ "from": [
1033
+ {
1034
+ "words": [
1035
+ "all"
1036
+ ]
1037
+ },
1038
+ {
1039
+ "to": "cast"
1040
+ },
1041
+ {
1042
+ "list": "pointsOfInterest"
1043
+ }
1044
+ ]
1045
+ },
1046
+ "nodes": {
1047
+ "cast": [
1048
+ {
1049
+ "id": "ANNA",
1050
+ "label": "ANNA"
1051
+ },
1052
+ {
1053
+ "id": "BO",
1054
+ "label": "BO"
1055
+ }
1056
+ ]
1057
+ },
1058
+ "lists": {
1059
+ "pointsOfInterest": [
1060
+ "Gate",
1061
+ "Well"
1062
+ ]
1063
+ },
1064
+ "choices": [
1065
+ {
1066
+ "value": "all",
1067
+ "source": 0
1068
+ },
1069
+ {
1070
+ "value": "ANNA",
1071
+ "source": 1
1072
+ },
1073
+ {
1074
+ "value": "BO",
1075
+ "source": 1
1076
+ },
1077
+ {
1078
+ "value": "Gate",
1079
+ "source": 2
1080
+ },
1081
+ {
1082
+ "value": "Well",
1083
+ "source": 2
1084
+ }
1085
+ ],
1086
+ "clashes": []
1087
+ },
1088
+ {
1089
+ "name": "a node's label is shown, its id held",
1090
+ "decl": {
1091
+ "name": "c",
1092
+ "type": "pick",
1093
+ "from": [
1094
+ {
1095
+ "to": "card"
1096
+ }
1097
+ ]
1098
+ },
1099
+ "nodes": {
1100
+ "card": [
1101
+ {
1102
+ "id": "c_1",
1103
+ "label": "The Storm"
1104
+ }
1105
+ ]
1106
+ },
1107
+ "choices": [
1108
+ {
1109
+ "value": "c_1",
1110
+ "label": "The Storm",
1111
+ "source": 0
1112
+ }
1113
+ ],
1114
+ "clashes": []
1115
+ },
1116
+ {
1117
+ "name": "a name in two sources is a clash, once",
1118
+ "decl": {
1119
+ "name": "to",
1120
+ "type": "pick",
1121
+ "from": [
1122
+ {
1123
+ "words": [
1124
+ "all"
1125
+ ]
1126
+ },
1127
+ {
1128
+ "to": "cast"
1129
+ },
1130
+ {
1131
+ "list": "pointsOfInterest"
1132
+ }
1133
+ ]
1134
+ },
1135
+ "nodes": {
1136
+ "cast": [
1137
+ {
1138
+ "id": "Gate",
1139
+ "label": "Gate"
1140
+ }
1141
+ ]
1142
+ },
1143
+ "lists": {
1144
+ "pointsOfInterest": [
1145
+ "Gate",
1146
+ "Gate"
1147
+ ]
1148
+ },
1149
+ "choices": [
1150
+ {
1151
+ "value": "all",
1152
+ "source": 0
1153
+ },
1154
+ {
1155
+ "value": "Gate",
1156
+ "source": 1
1157
+ },
1158
+ {
1159
+ "value": "Gate",
1160
+ "source": 2
1161
+ },
1162
+ {
1163
+ "value": "Gate",
1164
+ "source": 2
1165
+ }
1166
+ ],
1167
+ "clashes": [
1168
+ "Gate"
1169
+ ]
1170
+ },
1171
+ {
1172
+ "name": "empty entries are left out",
1173
+ "decl": {
1174
+ "name": "to",
1175
+ "type": "pick",
1176
+ "from": [
1177
+ {
1178
+ "words": [
1179
+ "all"
1180
+ ]
1181
+ },
1182
+ {
1183
+ "to": "cast"
1184
+ },
1185
+ {
1186
+ "list": "pointsOfInterest"
1187
+ }
1188
+ ]
1189
+ },
1190
+ "nodes": {
1191
+ "cast": []
1192
+ },
1193
+ "lists": {
1194
+ "pointsOfInterest": [
1195
+ "",
1196
+ "Gate"
1197
+ ]
1198
+ },
1199
+ "choices": [
1200
+ {
1201
+ "value": "all",
1202
+ "source": 0
1203
+ },
1204
+ {
1205
+ "value": "Gate",
1206
+ "source": 2
1207
+ }
1208
+ ],
1209
+ "clashes": []
1210
+ }
1211
+ ],
1212
+ "pickLists": [
1213
+ {
1214
+ "name": "the project's own list, else the field's default; another type is no list",
1215
+ "target": {
1216
+ "fields": [
1217
+ {
1218
+ "name": "pointsOfInterest",
1219
+ "type": "list",
1220
+ "of": {
1221
+ "type": "text"
1222
+ }
1223
+ },
1224
+ {
1225
+ "name": "moods",
1226
+ "type": "list",
1227
+ "of": {
1228
+ "type": "text"
1229
+ },
1230
+ "default": [
1231
+ "calm"
1232
+ ]
1233
+ },
1234
+ {
1235
+ "name": "studio",
1236
+ "type": "text"
1237
+ },
1238
+ {
1239
+ "name": "counts",
1240
+ "type": "list",
1241
+ "of": {
1242
+ "type": "number"
1243
+ }
1244
+ }
1245
+ ]
1246
+ },
1247
+ "entry": {
1248
+ "pointsOfInterest": [
1249
+ "Gate",
1250
+ "Well"
1251
+ ]
1252
+ },
1253
+ "lists": {
1254
+ "pointsOfInterest": [
1255
+ "Gate",
1256
+ "Well"
1257
+ ],
1258
+ "moods": [
1259
+ "calm"
1260
+ ],
1261
+ "studio": null,
1262
+ "counts": null,
1263
+ "nowhere": null
1264
+ }
1265
+ }
740
1266
  ]
741
1267
  }