v8r 2.1.0 → 3.0.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/CHANGELOG.md +5 -0
- package/package.json +6 -7
- package/src/index.js +2 -4
- package/src/parser.js +3 -0
- package/src/test-helpers.js +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 📦 [3.0.0](https://www.npmjs.com/package/v8r/v/3.0.0) - 2024-01-25
|
|
4
|
+
|
|
5
|
+
* Drop compatibility with node 16
|
|
6
|
+
* Add ability to validate Toml documents
|
|
7
|
+
|
|
3
8
|
## 📦 [2.1.0](https://www.npmjs.com/package/v8r/v/2.1.0) - 2023-10-23
|
|
4
9
|
|
|
5
10
|
* Add compatibility with JSON schemas serialized as Yaml
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "v8r",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "A command-line JSON and YAML validator that's on your wavelength",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "V8R_CACHE_NAME=v8r-test c8 --reporter=text mocha \"src/**/*.spec.js\"",
|
|
@@ -32,21 +32,20 @@
|
|
|
32
32
|
"ajv-draft-04": "^1.0.0",
|
|
33
33
|
"ajv-formats": "^2.1.1",
|
|
34
34
|
"chalk": "^5.0.0",
|
|
35
|
-
"cosmiconfig": "^
|
|
35
|
+
"cosmiconfig": "^9.0.0",
|
|
36
36
|
"decamelize": "^6.0.0",
|
|
37
|
-
"flat-cache": "^
|
|
37
|
+
"flat-cache": "^4.0.0",
|
|
38
38
|
"glob": "^10.1.0",
|
|
39
39
|
"got": "^13.0.0",
|
|
40
40
|
"is-url": "^1.2.4",
|
|
41
41
|
"js-yaml": "^4.0.0",
|
|
42
42
|
"json5": "^2.2.0",
|
|
43
43
|
"minimatch": "^9.0.0",
|
|
44
|
+
"smol-toml": "^1.0.1",
|
|
44
45
|
"yargs": "^17.0.1"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
|
-
"c8": "^
|
|
48
|
-
"chai": "^4.2.0",
|
|
49
|
-
"chai-as-promised": "^7.1.1",
|
|
48
|
+
"c8": "^9.1.0",
|
|
50
49
|
"eslint": "^8.0.1",
|
|
51
50
|
"eslint-config-prettier": "^9.0.0",
|
|
52
51
|
"eslint-plugin-mocha": "^10.0.3",
|
|
@@ -57,7 +56,7 @@
|
|
|
57
56
|
"prettier": "^3.0.0"
|
|
58
57
|
},
|
|
59
58
|
"engines": {
|
|
60
|
-
"node": ">=
|
|
59
|
+
"node": ">=18"
|
|
61
60
|
},
|
|
62
61
|
"type": "module",
|
|
63
62
|
"keywords": [
|
package/src/index.js
CHANGED
package/src/parser.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import JSON5 from "json5";
|
|
2
2
|
import yaml from "js-yaml";
|
|
3
|
+
import { parse } from "smol-toml";
|
|
3
4
|
|
|
4
5
|
function parseDocument(contents, format) {
|
|
5
6
|
switch (format) {
|
|
@@ -13,6 +14,8 @@ function parseDocument(contents, format) {
|
|
|
13
14
|
case ".yml":
|
|
14
15
|
case ".yaml":
|
|
15
16
|
return yaml.load(contents);
|
|
17
|
+
case ".toml":
|
|
18
|
+
return parse(contents);
|
|
16
19
|
default:
|
|
17
20
|
throw new Error(`Unsupported format ${format}`);
|
|
18
21
|
}
|
package/src/test-helpers.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import chai from "chai";
|
|
2
|
-
import chaiAsPromised from "chai-as-promised";
|
|
3
1
|
import flatCache from "flat-cache";
|
|
4
2
|
import logger from "./logger.js";
|
|
5
3
|
|
|
6
|
-
chai.use(chaiAsPromised);
|
|
7
|
-
|
|
8
4
|
const origWriteOut = logger.writeOut;
|
|
9
5
|
const origWriteErr = logger.writeErr;
|
|
10
6
|
const testCacheName = process.env.V8R_CACHE_NAME;
|
|
@@ -48,7 +44,6 @@ function logContainsError(expectedString, expectedCount = 1) {
|
|
|
48
44
|
}
|
|
49
45
|
|
|
50
46
|
export {
|
|
51
|
-
chai,
|
|
52
47
|
testCacheName,
|
|
53
48
|
setUp,
|
|
54
49
|
tearDown,
|