5etools-utils 0.7.5 → 0.8.0
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/bin/test-file-extensions.js +5 -0
- package/bin/test-file-locations.js +5 -0
- package/lib/BrewTester.js +25 -0
- package/lib/UtilClean.js +1 -0
- package/package.json +4 -2
- package/schema/brew/entry.json +5 -1
- package/schema/brew-fast/entry.json +5 -1
- package/schema/site/entry.json +5 -1
- package/schema/site-fast/entry.json +5 -1
package/lib/BrewTester.js
CHANGED
|
@@ -4,6 +4,7 @@ import Um from "./UtilMisc.js";
|
|
|
4
4
|
import {JsonTester} from "./TestJson.js";
|
|
5
5
|
import {listJsonFiles} from "./UtilFs.js";
|
|
6
6
|
import * as pathlib from "path";
|
|
7
|
+
import * as Uf from "./UtilFs.js";
|
|
7
8
|
|
|
8
9
|
class _BrewTesterJson {
|
|
9
10
|
static _LOG_TAG = "JSON";
|
|
@@ -70,9 +71,33 @@ class _BrewTesterFileLocations {
|
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
|
|
74
|
+
class _BrewTesterFileExtensions {
|
|
75
|
+
static _LOG_TAG = `FILE_EXTS`;
|
|
76
|
+
|
|
77
|
+
static run () {
|
|
78
|
+
Um.info(this._LOG_TAG, `Testing for incorrect file extensions...`);
|
|
79
|
+
|
|
80
|
+
const errors = [];
|
|
81
|
+
|
|
82
|
+
Uf.runOnDirs((dir) => {
|
|
83
|
+
errors.push(
|
|
84
|
+
...fs.readdirSync(dir)
|
|
85
|
+
.filter(it => !it.endsWith(".json"))
|
|
86
|
+
.map(it => `File did not have ".json" extension: ${it}`),
|
|
87
|
+
);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
if (!errors.length) return Um.info(this._LOG_TAG, `Files had expected extensions.`);
|
|
91
|
+
|
|
92
|
+
errors.forEach(it => console.error(it));
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
73
97
|
class BrewTester {
|
|
74
98
|
static async pTestJson (args) { return _BrewTesterJson.pRun(args); }
|
|
75
99
|
static testFileLocations () { return _BrewTesterFileLocations.run(); }
|
|
100
|
+
static testFileExtensions () { return _BrewTesterFileExtensions.run(); }
|
|
76
101
|
}
|
|
77
102
|
|
|
78
103
|
export {BrewTester};
|
package/lib/UtilClean.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "5etools-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Shared utilities for the 5etools ecosystem.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/Api.js",
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
"lib": "./lib"
|
|
13
13
|
},
|
|
14
14
|
"bin": {
|
|
15
|
-
"test-json-brew": "bin/test-json-brew.js"
|
|
15
|
+
"test-json-brew": "bin/test-json-brew.js",
|
|
16
|
+
"test-file-extensions": "bin/test-file-extensions.js",
|
|
17
|
+
"test-file-locations": "bin/test-file-locations.js"
|
|
16
18
|
},
|
|
17
19
|
"scripts": {
|
|
18
20
|
"build": "node node/compile-schemas.js",
|
package/schema/brew/entry.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"$id": "entry.json",
|
|
4
4
|
"title": "Entry",
|
|
5
5
|
"description": "A recursively renderable object.",
|
|
6
|
-
"version": "1.8.
|
|
6
|
+
"version": "1.8.9",
|
|
7
7
|
"$defs": {
|
|
8
8
|
"_arrayOfSpell": {
|
|
9
9
|
"type": "array",
|
|
@@ -705,10 +705,14 @@
|
|
|
705
705
|
"list-hang",
|
|
706
706
|
"list-hang-notitle",
|
|
707
707
|
"list-lower-roman",
|
|
708
|
+
"list-upper-roman",
|
|
708
709
|
"list-name",
|
|
709
710
|
"list-no-bullets"
|
|
710
711
|
]
|
|
711
712
|
},
|
|
713
|
+
"start": {
|
|
714
|
+
"type": "integer"
|
|
715
|
+
},
|
|
712
716
|
"items": {
|
|
713
717
|
"type": "array",
|
|
714
718
|
"items": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"$id": "entry.json",
|
|
4
4
|
"title": "Entry",
|
|
5
5
|
"description": "A recursively renderable object.",
|
|
6
|
-
"version": "1.8.
|
|
6
|
+
"version": "1.8.9",
|
|
7
7
|
"$defs": {
|
|
8
8
|
"_arrayOfSpell": {
|
|
9
9
|
"type": "array",
|
|
@@ -705,10 +705,14 @@
|
|
|
705
705
|
"list-hang",
|
|
706
706
|
"list-hang-notitle",
|
|
707
707
|
"list-lower-roman",
|
|
708
|
+
"list-upper-roman",
|
|
708
709
|
"list-name",
|
|
709
710
|
"list-no-bullets"
|
|
710
711
|
]
|
|
711
712
|
},
|
|
713
|
+
"start": {
|
|
714
|
+
"type": "integer"
|
|
715
|
+
},
|
|
712
716
|
"items": {
|
|
713
717
|
"type": "array",
|
|
714
718
|
"items": {
|
package/schema/site/entry.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"$id": "entry.json",
|
|
4
4
|
"title": "Entry",
|
|
5
5
|
"description": "A recursively renderable object.",
|
|
6
|
-
"version": "1.8.
|
|
6
|
+
"version": "1.8.9",
|
|
7
7
|
"$defs": {
|
|
8
8
|
"_arrayOfSpell": {
|
|
9
9
|
"type": "array",
|
|
@@ -691,10 +691,14 @@
|
|
|
691
691
|
"list-hang",
|
|
692
692
|
"list-hang-notitle",
|
|
693
693
|
"list-lower-roman",
|
|
694
|
+
"list-upper-roman",
|
|
694
695
|
"list-name",
|
|
695
696
|
"list-no-bullets"
|
|
696
697
|
]
|
|
697
698
|
},
|
|
699
|
+
"start": {
|
|
700
|
+
"type": "integer"
|
|
701
|
+
},
|
|
698
702
|
"items": {
|
|
699
703
|
"type": "array",
|
|
700
704
|
"items": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"$id": "entry.json",
|
|
4
4
|
"title": "Entry",
|
|
5
5
|
"description": "A recursively renderable object.",
|
|
6
|
-
"version": "1.8.
|
|
6
|
+
"version": "1.8.9",
|
|
7
7
|
"$defs": {
|
|
8
8
|
"_arrayOfSpell": {
|
|
9
9
|
"type": "array",
|
|
@@ -691,10 +691,14 @@
|
|
|
691
691
|
"list-hang",
|
|
692
692
|
"list-hang-notitle",
|
|
693
693
|
"list-lower-roman",
|
|
694
|
+
"list-upper-roman",
|
|
694
695
|
"list-name",
|
|
695
696
|
"list-no-bullets"
|
|
696
697
|
]
|
|
697
698
|
},
|
|
699
|
+
"start": {
|
|
700
|
+
"type": "integer"
|
|
701
|
+
},
|
|
698
702
|
"items": {
|
|
699
703
|
"type": "array",
|
|
700
704
|
"items": {
|