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.
- package/lib/BrewTester.js +1 -1
- package/lib/TestJson.js +5 -3
- package/package.json +1 -1
- package/schema/brew/backgrounds.json +13 -13
- package/schema/brew/class/class.json +205 -346
- package/schema/brew/items-shared.json +1 -1
- package/schema/brew/races.json +1 -1
- package/schema/brew/spells/spells.json +61 -61
- package/schema/brew/util.json +47 -1
- package/schema/brew-fast/backgrounds.json +13 -13
- package/schema/brew-fast/class/class.json +205 -346
- package/schema/brew-fast/items-shared.json +1 -1
- package/schema/brew-fast/races.json +1 -1
- package/schema/brew-fast/spells/spells.json +61 -61
- package/schema/brew-fast/util.json +47 -1
- package/schema/site/backgrounds.json +1 -1
- package/schema/site/class/class.json +205 -346
- package/schema/site/items-shared.json +1 -1
- package/schema/site/races.json +1 -1
- package/schema/site/spells/spells.json +1 -1
- package/schema/site/util.json +47 -1
- package/schema/site-fast/backgrounds.json +1 -1
- package/schema/site-fast/class/class.json +205 -346
- package/schema/site-fast/items-shared.json +1 -1
- package/schema/site-fast/races.json +1 -1
- package/schema/site-fast/spells/spells.json +1 -1
- package/schema/site-fast/util.json +47 -1
- package/schema/ua/backgrounds.json +13 -1
- package/schema/ua/class/class.json +304 -346
- package/schema/ua/items-shared.json +2 -2
- package/schema/ua/races.json +19 -1
- package/schema/ua/spells/spells.json +62 -2
- package/schema/ua/util.json +48 -2
- package/schema/ua-fast/backgrounds.json +13 -1
- package/schema/ua-fast/class/class.json +304 -346
- package/schema/ua-fast/items-shared.json +2 -2
- package/schema/ua-fast/races.json +19 -1
- package/schema/ua-fast/spells/spells.json +62 -2
- 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.
|
|
48
|
-
|
|
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
|
|
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,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.
|
|
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
|
},
|