5etools-utils 0.9.0 → 0.9.2

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 +205 -346
  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 +205 -346
  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 +205 -346
  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 +205 -346
  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 +304 -346
  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 +304 -346
  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.2",
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
  },