5etools-utils 0.9.0 → 0.9.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.
Files changed (39) hide show
  1. package/lib/BrewTester.js +1 -1
  2. package/lib/TestJson.js +5 -3
  3. package/package.json +1 -1
  4. package/schema/brew/backgrounds.json +13 -13
  5. package/schema/brew/class/class.json +1 -1
  6. package/schema/brew/items-shared.json +1 -1
  7. package/schema/brew/races.json +1 -1
  8. package/schema/brew/spells/spells.json +61 -61
  9. package/schema/brew/util.json +47 -1
  10. package/schema/brew-fast/backgrounds.json +13 -13
  11. package/schema/brew-fast/class/class.json +1 -1
  12. package/schema/brew-fast/items-shared.json +1 -1
  13. package/schema/brew-fast/races.json +1 -1
  14. package/schema/brew-fast/spells/spells.json +61 -61
  15. package/schema/brew-fast/util.json +47 -1
  16. package/schema/site/backgrounds.json +1 -1
  17. package/schema/site/class/class.json +1 -1
  18. package/schema/site/items-shared.json +1 -1
  19. package/schema/site/races.json +1 -1
  20. package/schema/site/spells/spells.json +1 -1
  21. package/schema/site/util.json +47 -1
  22. package/schema/site-fast/backgrounds.json +1 -1
  23. package/schema/site-fast/class/class.json +1 -1
  24. package/schema/site-fast/items-shared.json +1 -1
  25. package/schema/site-fast/races.json +1 -1
  26. package/schema/site-fast/spells/spells.json +1 -1
  27. package/schema/site-fast/util.json +47 -1
  28. package/schema/ua/backgrounds.json +13 -1
  29. package/schema/ua/class/class.json +100 -1
  30. package/schema/ua/items-shared.json +2 -2
  31. package/schema/ua/races.json +19 -1
  32. package/schema/ua/spells/spells.json +62 -2
  33. package/schema/ua/util.json +48 -2
  34. package/schema/ua-fast/backgrounds.json +13 -1
  35. package/schema/ua-fast/class/class.json +100 -1
  36. package/schema/ua-fast/items-shared.json +2 -2
  37. package/schema/ua-fast/races.json +19 -1
  38. package/schema/ua-fast/spells/spells.json +62 -2
  39. package/schema/ua-fast/util.json +48 -2
package/lib/BrewTester.js CHANGED
@@ -95,7 +95,7 @@ class _BrewTesterFileExtensions {
95
95
  }
96
96
 
97
97
  class BrewTester {
98
- static async pTestJson (args) { return _BrewTesterJson.pRun(args); }
98
+ static async pTestJson (args, opts) { return _BrewTesterJson.pRun(args, opts); }
99
99
  static testFileLocations () { return _BrewTesterFileLocations.run(); }
100
100
  static testFileExtensions () { return _BrewTesterFileExtensions.run(); }
101
101
  }
package/lib/TestJson.js CHANGED
@@ -36,6 +36,8 @@ class JsonTester {
36
36
  tagLog = LOG_TAG,
37
37
  },
38
38
  ) {
39
+ this._tagLog = tagLog;
40
+
39
41
  if (mode && dirSchema) throw new Error(`"mode" and "dirSchema" are mutually exclusive!`);
40
42
  if (mode != null && !Object.values(MODES).includes(mode)) throw new Error(`"mode" must be one of ${Object.values(MODES).join("/")}!`);
41
43
  if (!fnGetSchemaId) throw new Error(`"fnGetSchemaId" is required!`);
@@ -44,8 +46,8 @@ class JsonTester {
44
46
  this._dirSchemaBrew = path.join(__dirname, "..", "schema", "brew");
45
47
  this._dirSchemaUa = path.join(__dirname, "..", "schema", "ua");
46
48
 
47
- this._dirSchema = dirSchema ?? (mode === "site" ? this._dirSchemaSite : mode === "brew" ? this._dirSchemaBrew : this._dirSchemaSite);
48
- this._tagLog = tagLog;
49
+ this._dirSchema = dirSchema ?? (mode === "site" ? this._dirSchemaSite : mode === "brew" ? this._dirSchemaBrew : this._dirSchemaUa);
50
+
49
51
  this._fnGetSchemaId = fnGetSchemaId;
50
52
 
51
53
  // region Set up validator
@@ -211,7 +213,7 @@ class JsonTester {
211
213
  }
212
214
 
213
215
  async pGetErrorsOnDirsWorkers ({isFailFast = false, fileList = null} = {}) {
214
- Um.info(this._tagLog, `Validating JSON against schema`);
216
+ Um.info(this._tagLog, `Validating JSON against schemas in dir: ${this._dirSchema}`);
215
217
 
216
218
  const cntWorkers = Math.max(1, os.cpus().length - 1);
217
219
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "5etools-utils",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Shared utilities for the 5etools ecosystem.",
5
5
  "type": "module",
6
6
  "main": "lib/Api.js",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "backgrounds.json",
4
- "version": "1.3.2",
4
+ "version": "1.3.3",
5
5
  "type": "object",
6
6
  "$defs": {
7
7
  "backgroundData": {
@@ -74,6 +74,10 @@
74
74
  "hasFluffImages": {
75
75
  "type": "boolean"
76
76
  },
77
+ "fluff": {
78
+ "description": "This is intended to be used for Homebrew only - site data should include a fluff file per source",
79
+ "$ref": "util.json#/$defs/fluffObject"
80
+ },
77
81
  "expertise": {
78
82
  "$ref": "util.json#/$defs/expertise"
79
83
  },
@@ -95,10 +99,6 @@
95
99
  "conditionImmune": {
96
100
  "$ref": "util.json#/$defs/conditionImmunityArrayPlayer"
97
101
  },
98
- "fluff": {
99
- "description": "This is intended to be used for Homebrew only - site data should include a fluff file per source",
100
- "$ref": "util.json#/$defs/fluffObject"
101
- },
102
102
  "foundrySystem": {
103
103
  "$ref": "util.json#/$defs/foundrySystemObject"
104
104
  },
@@ -189,6 +189,10 @@
189
189
  "hasFluffImages": {
190
190
  "type": "boolean"
191
191
  },
192
+ "fluff": {
193
+ "description": "This is intended to be used for Homebrew only - site data should include a fluff file per source",
194
+ "$ref": "util.json#/$defs/fluffObject"
195
+ },
192
196
  "expertise": {
193
197
  "$ref": "util.json#/$defs/expertise"
194
198
  },
@@ -210,10 +214,6 @@
210
214
  "conditionImmune": {
211
215
  "$ref": "util.json#/$defs/conditionImmunityArrayPlayer"
212
216
  },
213
- "fluff": {
214
- "description": "This is intended to be used for Homebrew only - site data should include a fluff file per source",
215
- "$ref": "util.json#/$defs/fluffObject"
216
- },
217
217
  "foundrySystem": {
218
218
  "$ref": "util.json#/$defs/foundrySystemObject"
219
219
  },
@@ -307,6 +307,10 @@
307
307
  "hasFluffImages": {
308
308
  "type": "boolean"
309
309
  },
310
+ "fluff": {
311
+ "description": "This is intended to be used for Homebrew only - site data should include a fluff file per source",
312
+ "$ref": "util.json#/$defs/fluffObject"
313
+ },
310
314
  "expertise": {
311
315
  "$ref": "util.json#/$defs/expertise"
312
316
  },
@@ -328,10 +332,6 @@
328
332
  "conditionImmune": {
329
333
  "$ref": "util.json#/$defs/conditionImmunityArrayPlayer"
330
334
  },
331
- "fluff": {
332
- "description": "This is intended to be used for Homebrew only - site data should include a fluff file per source",
333
- "$ref": "util.json#/$defs/fluffObject"
334
- },
335
335
  "foundrySystem": {
336
336
  "$ref": "util.json#/$defs/foundrySystemObject"
337
337
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "version": "2.11.4",
3
+ "version": "2.11.5",
4
4
  "$id": "class.json",
5
5
  "type": "object",
6
6
  "$defs": {
@@ -3,7 +3,7 @@
3
3
  "$id": "items-shared.json",
4
4
  "title": "Shared Item Schema",
5
5
  "description": "Shared item definitions to be used in item schemas.",
6
- "version": "1.0.2",
6
+ "version": "1.0.3",
7
7
  "$defs": {
8
8
  "_itemModifySpeedEqual": {
9
9
  "type": "string",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "races.json",
4
- "version": "1.12.3",
4
+ "version": "1.12.4",
5
5
  "type": "object",
6
6
  "$defs": {
7
7
  "sharedData": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "spells.json",
4
- "version": "1.9.6",
4
+ "version": "1.9.7",
5
5
  "title": "Spells",
6
6
  "type": "object",
7
7
  "$defs": {
@@ -341,6 +341,26 @@
341
341
  "hasFluffImages": {
342
342
  "type": "boolean"
343
343
  },
344
+ "groups": {
345
+ "type": "array",
346
+ "items": {
347
+ "type": "object",
348
+ "properties": {
349
+ "name": {
350
+ "type": "string"
351
+ },
352
+ "source": {
353
+ "$ref": "../util.json#/$defs/source"
354
+ }
355
+ },
356
+ "required": [
357
+ "name",
358
+ "source"
359
+ ]
360
+ },
361
+ "minItems": 1,
362
+ "uniqueItems": true
363
+ },
344
364
  "classes": {
345
365
  "type": "object",
346
366
  "properties": {
@@ -497,26 +517,6 @@
497
517
  "minItems": 1,
498
518
  "uniqueItems": true
499
519
  },
500
- "groups": {
501
- "type": "array",
502
- "items": {
503
- "type": "object",
504
- "properties": {
505
- "name": {
506
- "type": "string"
507
- },
508
- "source": {
509
- "$ref": "../util.json#/$defs/source"
510
- }
511
- },
512
- "required": [
513
- "name",
514
- "source"
515
- ]
516
- },
517
- "minItems": 1,
518
- "uniqueItems": true
519
- },
520
520
  "subschools": {
521
521
  "description": "For homebrew use only.",
522
522
  "type": "array",
@@ -886,6 +886,26 @@
886
886
  "hasFluffImages": {
887
887
  "type": "boolean"
888
888
  },
889
+ "groups": {
890
+ "type": "array",
891
+ "items": {
892
+ "type": "object",
893
+ "properties": {
894
+ "name": {
895
+ "type": "string"
896
+ },
897
+ "source": {
898
+ "$ref": "../util.json#/$defs/source"
899
+ }
900
+ },
901
+ "required": [
902
+ "name",
903
+ "source"
904
+ ]
905
+ },
906
+ "minItems": 1,
907
+ "uniqueItems": true
908
+ },
889
909
  "classes": {
890
910
  "type": "object",
891
911
  "properties": {
@@ -1042,26 +1062,6 @@
1042
1062
  "minItems": 1,
1043
1063
  "uniqueItems": true
1044
1064
  },
1045
- "groups": {
1046
- "type": "array",
1047
- "items": {
1048
- "type": "object",
1049
- "properties": {
1050
- "name": {
1051
- "type": "string"
1052
- },
1053
- "source": {
1054
- "$ref": "../util.json#/$defs/source"
1055
- }
1056
- },
1057
- "required": [
1058
- "name",
1059
- "source"
1060
- ]
1061
- },
1062
- "minItems": 1,
1063
- "uniqueItems": true
1064
- },
1065
1065
  "subschools": {
1066
1066
  "description": "For homebrew use only.",
1067
1067
  "type": "array",
@@ -1439,6 +1439,26 @@
1439
1439
  "hasFluffImages": {
1440
1440
  "type": "boolean"
1441
1441
  },
1442
+ "groups": {
1443
+ "type": "array",
1444
+ "items": {
1445
+ "type": "object",
1446
+ "properties": {
1447
+ "name": {
1448
+ "type": "string"
1449
+ },
1450
+ "source": {
1451
+ "$ref": "../util.json#/$defs/source"
1452
+ }
1453
+ },
1454
+ "required": [
1455
+ "name",
1456
+ "source"
1457
+ ]
1458
+ },
1459
+ "minItems": 1,
1460
+ "uniqueItems": true
1461
+ },
1442
1462
  "classes": {
1443
1463
  "type": "object",
1444
1464
  "properties": {
@@ -1595,26 +1615,6 @@
1595
1615
  "minItems": 1,
1596
1616
  "uniqueItems": true
1597
1617
  },
1598
- "groups": {
1599
- "type": "array",
1600
- "items": {
1601
- "type": "object",
1602
- "properties": {
1603
- "name": {
1604
- "type": "string"
1605
- },
1606
- "source": {
1607
- "$ref": "../util.json#/$defs/source"
1608
- }
1609
- },
1610
- "required": [
1611
- "name",
1612
- "source"
1613
- ]
1614
- },
1615
- "minItems": 1,
1616
- "uniqueItems": true
1617
- },
1618
1618
  "subschools": {
1619
1619
  "description": "For homebrew use only.",
1620
1620
  "type": "array",
@@ -3,7 +3,7 @@
3
3
  "$id": "util.json",
4
4
  "title": "Util",
5
5
  "description": "Utility definitions to be used in other schemas.",
6
- "version": "1.13.29",
6
+ "version": "1.13.30",
7
7
  "$defs": {
8
8
  "metaDependenciesArray": {
9
9
  "type": "array",
@@ -193,6 +193,7 @@
193
193
  "auran",
194
194
  "celestial",
195
195
  "common",
196
+ "common sign language",
196
197
  "deep speech",
197
198
  "draconic",
198
199
  "druidic",
@@ -237,6 +238,9 @@
237
238
  "common": {
238
239
  "const": true
239
240
  },
241
+ "common sign language": {
242
+ "const": true
243
+ },
240
244
  "deep speech": {
241
245
  "const": true
242
246
  },
@@ -683,6 +687,12 @@
683
687
  "celestial": {
684
688
  "const": true
685
689
  },
690
+ "common": {
691
+ "const": true
692
+ },
693
+ "common sign language": {
694
+ "const": true
695
+ },
686
696
  "deep speech": {
687
697
  "const": true
688
698
  },
@@ -692,9 +702,36 @@
692
702
  "infernal": {
693
703
  "const": true
694
704
  },
705
+ "gith": {
706
+ "const": true
707
+ },
708
+ "gnomish": {
709
+ "const": true
710
+ },
711
+ "goblin": {
712
+ "const": true
713
+ },
714
+ "halfling": {
715
+ "const": true
716
+ },
717
+ "orc": {
718
+ "const": true
719
+ },
695
720
  "primordial": {
696
721
  "const": true
697
722
  },
723
+ "aquan": {
724
+ "const": true
725
+ },
726
+ "auran": {
727
+ "const": true
728
+ },
729
+ "ignan": {
730
+ "const": true
731
+ },
732
+ "terran": {
733
+ "const": true
734
+ },
698
735
  "sylvan": {
699
736
  "const": true
700
737
  },
@@ -710,6 +747,15 @@
710
747
  "giant": {
711
748
  "const": true
712
749
  },
750
+ "other": {
751
+ "const": true
752
+ },
753
+ "druidic": {
754
+ "const": true
755
+ },
756
+ "thieves' cant": {
757
+ "const": true
758
+ },
713
759
  "otherLanguage": {
714
760
  "const": true
715
761
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "backgrounds.json",
4
- "version": "1.3.2",
4
+ "version": "1.3.3",
5
5
  "type": "object",
6
6
  "$defs": {
7
7
  "backgroundData": {
@@ -74,6 +74,10 @@
74
74
  "hasFluffImages": {
75
75
  "type": "boolean"
76
76
  },
77
+ "fluff": {
78
+ "description": "This is intended to be used for Homebrew only - site data should include a fluff file per source",
79
+ "$ref": "util.json#/$defs/fluffObject"
80
+ },
77
81
  "expertise": {
78
82
  "$ref": "util.json#/$defs/expertise"
79
83
  },
@@ -95,10 +99,6 @@
95
99
  "conditionImmune": {
96
100
  "$ref": "util.json#/$defs/conditionImmunityArrayPlayer"
97
101
  },
98
- "fluff": {
99
- "description": "This is intended to be used for Homebrew only - site data should include a fluff file per source",
100
- "$ref": "util.json#/$defs/fluffObject"
101
- },
102
102
  "foundrySystem": {
103
103
  "$ref": "util.json#/$defs/foundrySystemObject"
104
104
  },
@@ -189,6 +189,10 @@
189
189
  "hasFluffImages": {
190
190
  "type": "boolean"
191
191
  },
192
+ "fluff": {
193
+ "description": "This is intended to be used for Homebrew only - site data should include a fluff file per source",
194
+ "$ref": "util.json#/$defs/fluffObject"
195
+ },
192
196
  "expertise": {
193
197
  "$ref": "util.json#/$defs/expertise"
194
198
  },
@@ -210,10 +214,6 @@
210
214
  "conditionImmune": {
211
215
  "$ref": "util.json#/$defs/conditionImmunityArrayPlayer"
212
216
  },
213
- "fluff": {
214
- "description": "This is intended to be used for Homebrew only - site data should include a fluff file per source",
215
- "$ref": "util.json#/$defs/fluffObject"
216
- },
217
217
  "foundrySystem": {
218
218
  "$ref": "util.json#/$defs/foundrySystemObject"
219
219
  },
@@ -307,6 +307,10 @@
307
307
  "hasFluffImages": {
308
308
  "type": "boolean"
309
309
  },
310
+ "fluff": {
311
+ "description": "This is intended to be used for Homebrew only - site data should include a fluff file per source",
312
+ "$ref": "util.json#/$defs/fluffObject"
313
+ },
310
314
  "expertise": {
311
315
  "$ref": "util.json#/$defs/expertise"
312
316
  },
@@ -328,10 +332,6 @@
328
332
  "conditionImmune": {
329
333
  "$ref": "util.json#/$defs/conditionImmunityArrayPlayer"
330
334
  },
331
- "fluff": {
332
- "description": "This is intended to be used for Homebrew only - site data should include a fluff file per source",
333
- "$ref": "util.json#/$defs/fluffObject"
334
- },
335
335
  "foundrySystem": {
336
336
  "$ref": "util.json#/$defs/foundrySystemObject"
337
337
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "version": "2.11.4",
3
+ "version": "2.11.5",
4
4
  "$id": "class.json",
5
5
  "type": "object",
6
6
  "$defs": {
@@ -3,7 +3,7 @@
3
3
  "$id": "items-shared.json",
4
4
  "title": "Shared Item Schema",
5
5
  "description": "Shared item definitions to be used in item schemas.",
6
- "version": "1.0.2",
6
+ "version": "1.0.3",
7
7
  "$defs": {
8
8
  "_itemModifySpeedEqual": {
9
9
  "type": "string",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "races.json",
4
- "version": "1.12.3",
4
+ "version": "1.12.4",
5
5
  "type": "object",
6
6
  "$defs": {
7
7
  "sharedData": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "spells.json",
4
- "version": "1.9.6",
4
+ "version": "1.9.7",
5
5
  "title": "Spells",
6
6
  "type": "object",
7
7
  "$defs": {
@@ -341,6 +341,26 @@
341
341
  "hasFluffImages": {
342
342
  "type": "boolean"
343
343
  },
344
+ "groups": {
345
+ "type": "array",
346
+ "items": {
347
+ "type": "object",
348
+ "properties": {
349
+ "name": {
350
+ "type": "string"
351
+ },
352
+ "source": {
353
+ "$ref": "../util.json#/$defs/source"
354
+ }
355
+ },
356
+ "required": [
357
+ "name",
358
+ "source"
359
+ ]
360
+ },
361
+ "minItems": 1,
362
+ "uniqueItems": true
363
+ },
344
364
  "classes": {
345
365
  "type": "object",
346
366
  "properties": {
@@ -497,26 +517,6 @@
497
517
  "minItems": 1,
498
518
  "uniqueItems": true
499
519
  },
500
- "groups": {
501
- "type": "array",
502
- "items": {
503
- "type": "object",
504
- "properties": {
505
- "name": {
506
- "type": "string"
507
- },
508
- "source": {
509
- "$ref": "../util.json#/$defs/source"
510
- }
511
- },
512
- "required": [
513
- "name",
514
- "source"
515
- ]
516
- },
517
- "minItems": 1,
518
- "uniqueItems": true
519
- },
520
520
  "subschools": {
521
521
  "description": "For homebrew use only.",
522
522
  "type": "array",
@@ -886,6 +886,26 @@
886
886
  "hasFluffImages": {
887
887
  "type": "boolean"
888
888
  },
889
+ "groups": {
890
+ "type": "array",
891
+ "items": {
892
+ "type": "object",
893
+ "properties": {
894
+ "name": {
895
+ "type": "string"
896
+ },
897
+ "source": {
898
+ "$ref": "../util.json#/$defs/source"
899
+ }
900
+ },
901
+ "required": [
902
+ "name",
903
+ "source"
904
+ ]
905
+ },
906
+ "minItems": 1,
907
+ "uniqueItems": true
908
+ },
889
909
  "classes": {
890
910
  "type": "object",
891
911
  "properties": {
@@ -1042,26 +1062,6 @@
1042
1062
  "minItems": 1,
1043
1063
  "uniqueItems": true
1044
1064
  },
1045
- "groups": {
1046
- "type": "array",
1047
- "items": {
1048
- "type": "object",
1049
- "properties": {
1050
- "name": {
1051
- "type": "string"
1052
- },
1053
- "source": {
1054
- "$ref": "../util.json#/$defs/source"
1055
- }
1056
- },
1057
- "required": [
1058
- "name",
1059
- "source"
1060
- ]
1061
- },
1062
- "minItems": 1,
1063
- "uniqueItems": true
1064
- },
1065
1065
  "subschools": {
1066
1066
  "description": "For homebrew use only.",
1067
1067
  "type": "array",
@@ -1439,6 +1439,26 @@
1439
1439
  "hasFluffImages": {
1440
1440
  "type": "boolean"
1441
1441
  },
1442
+ "groups": {
1443
+ "type": "array",
1444
+ "items": {
1445
+ "type": "object",
1446
+ "properties": {
1447
+ "name": {
1448
+ "type": "string"
1449
+ },
1450
+ "source": {
1451
+ "$ref": "../util.json#/$defs/source"
1452
+ }
1453
+ },
1454
+ "required": [
1455
+ "name",
1456
+ "source"
1457
+ ]
1458
+ },
1459
+ "minItems": 1,
1460
+ "uniqueItems": true
1461
+ },
1442
1462
  "classes": {
1443
1463
  "type": "object",
1444
1464
  "properties": {
@@ -1595,26 +1615,6 @@
1595
1615
  "minItems": 1,
1596
1616
  "uniqueItems": true
1597
1617
  },
1598
- "groups": {
1599
- "type": "array",
1600
- "items": {
1601
- "type": "object",
1602
- "properties": {
1603
- "name": {
1604
- "type": "string"
1605
- },
1606
- "source": {
1607
- "$ref": "../util.json#/$defs/source"
1608
- }
1609
- },
1610
- "required": [
1611
- "name",
1612
- "source"
1613
- ]
1614
- },
1615
- "minItems": 1,
1616
- "uniqueItems": true
1617
- },
1618
1618
  "subschools": {
1619
1619
  "description": "For homebrew use only.",
1620
1620
  "type": "array",