@adobe/jsonschema2md 7.1.5 → 8.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/.eslintrc.cjs +3 -13
- package/CHANGELOG.md +22 -0
- package/README.md +7 -6
- package/lib/markdownBuilder.js +7 -7
- package/lib/schemaProxy.js +1 -2
- package/package.json +26 -28
- package/types/formatInfo.d.ts +2 -2
package/.eslintrc.cjs
CHANGED
|
@@ -11,20 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
module.exports = {
|
|
14
|
-
env: {
|
|
15
|
-
node: true,
|
|
16
|
-
es6: true,
|
|
17
|
-
},
|
|
18
|
-
// this is the root project for all sub modules. stop searching for any
|
|
19
|
-
// eslintrc files in parent directories.
|
|
20
14
|
root: true,
|
|
21
|
-
parserOptions: {
|
|
22
|
-
sourceType: 'module',
|
|
23
|
-
ecmaVersion: 2020,
|
|
24
|
-
},
|
|
25
|
-
plugins: [
|
|
26
|
-
'header',
|
|
27
|
-
],
|
|
28
15
|
extends: '@adobe/helix',
|
|
29
16
|
rules: {
|
|
30
17
|
strict: 0,
|
|
@@ -47,5 +34,8 @@ module.exports = {
|
|
|
47
34
|
argsIgnorePattern: '^_.*$',
|
|
48
35
|
caughtErrorsIgnorePattern: '^_.*$',
|
|
49
36
|
}],
|
|
37
|
+
|
|
38
|
+
'import/no-named-as-default-member': 0,
|
|
39
|
+
'default-param-last': 0,
|
|
50
40
|
},
|
|
51
41
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
# [8.0.0](https://github.com/adobe/jsonschema2md/compare/v7.1.6...v8.0.0) (2024-03-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Build System
|
|
5
|
+
|
|
6
|
+
* require node 18 ([3b74f4f](https://github.com/adobe/jsonschema2md/commit/3b74f4f31fc16d28c9a4a8f317cdd1beb2242d7e))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* requires node 18
|
|
12
|
+
|
|
13
|
+
## [7.1.6](https://github.com/adobe/jsonschema2md/compare/v7.1.5...v7.1.6) (2024-03-25)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* **deps:** update dependency @adobe/helix-log to v6.0.1 ([b54415a](https://github.com/adobe/jsonschema2md/commit/b54415a0ae4a66a8ec5da9d433403cf46b0cf351))
|
|
19
|
+
* **deps:** update external fixes ([f515169](https://github.com/adobe/jsonschema2md/commit/f5151691a394c139f07ecaf8ec465e71dba49631))
|
|
20
|
+
* **deps:** update external fixes ([e23d8f0](https://github.com/adobe/jsonschema2md/commit/e23d8f01666fedc12442fa2f9bab660c5aa58d8a))
|
|
21
|
+
* **deps:** update external major ([#516](https://github.com/adobe/jsonschema2md/issues/516)) ([d7d72e6](https://github.com/adobe/jsonschema2md/commit/d7d72e61e2b65f0a790b8945d756082bf2fd3bcf))
|
|
22
|
+
|
|
1
23
|
## [7.1.5](https://github.com/adobe/jsonschema2md/compare/v7.1.4...v7.1.5) (2022-12-12)
|
|
2
24
|
|
|
3
25
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# JSON Schema Markdown Tools
|
|
2
2
|
|
|
3
|
-
[](https://github.com/adobe/jsonschema2md/actions/workflows/main.yaml)
|
|
4
4
|
|
|
5
5
|
Documenting and validating complex JSON Schemas can be hard. This tool makes it easier by providing a number of scripts that can turn JSON Schema files into readable Markdown documentation that is ready for consumption on GitHub or processed using Jekyll or other static site generators.
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@ These tools have been introduced by Adobe to document Adobe's Experience Data Mo
|
|
|
13
13
|
## Requirements
|
|
14
14
|
|
|
15
15
|
- `npm` version 3.10.8 or up
|
|
16
|
-
- `node`
|
|
16
|
+
- `node` v18 or v20 or up
|
|
17
17
|
|
|
18
18
|
## Example Output
|
|
19
19
|
|
|
@@ -45,10 +45,11 @@ Supported languages are:
|
|
|
45
45
|
If you want to provide a translation of your own, [please use GitLocalize](https://gitlocalize.com/repo/3622)
|
|
46
46
|
|
|
47
47
|
## Display custom attributes in the property description
|
|
48
|
-
`jsonschema2md` displays only the attributes of an property which are defined by the JSON Schema standard. If you want to display additional attributes in the property description you could provide
|
|
48
|
+
`jsonschema2md` displays only the attributes of an property which are defined by the JSON Schema standard. If you want to display additional attributes in the property description you could provide these with the `--properties` (or `-p`) parameter.
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
|
|
51
|
+
# include both the `version` and the `test` attribute
|
|
52
|
+
$ jsonschema2md -d examples/schemas -o examples/docs -p version -p test
|
|
52
53
|
```
|
|
53
54
|
|
|
54
55
|
## Disable header template
|
|
@@ -109,8 +110,8 @@ This will run our Jasmine test suite as well as lint the JavaScript according to
|
|
|
109
110
|
|
|
110
111
|
### CI
|
|
111
112
|
|
|
112
|
-
Continuous integration runs on
|
|
113
|
-
All pull requests automatically trigger a job that runs the [tests](#tests) by executing the [`
|
|
113
|
+
Continuous integration runs on Github Actions.
|
|
114
|
+
All pull requests automatically trigger a job that runs the [tests](#tests) by executing the [`main.yml`](.github/workflows/main.yaml).
|
|
114
115
|
|
|
115
116
|
### Code Coverage
|
|
116
117
|
|
package/lib/markdownBuilder.js
CHANGED
|
@@ -398,11 +398,11 @@ export default function build({
|
|
|
398
398
|
return [listItem(paragraph(text(i18n`and all following items may follow any schema`)))];
|
|
399
399
|
} else if (typeof additional === 'object') {
|
|
400
400
|
return [listItem(paragraph([text(i18n`and all following items must follow the schema: `),
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
401
|
+
link(
|
|
402
|
+
`${additional[s.slug]}.md`,
|
|
403
|
+
i18n`check type definition`,
|
|
404
|
+
text(gentitle(additional[s.titles], additional[keyword`type`])),
|
|
405
|
+
)]))];
|
|
406
406
|
}
|
|
407
407
|
return [];
|
|
408
408
|
})(),
|
|
@@ -664,12 +664,12 @@ export default function build({
|
|
|
664
664
|
if (schema[keyword`minContains`] !== undefined && schema[keyword`contains`]) {
|
|
665
665
|
// console.log('minContains!', schema[s.filename], schema[s.pointer]);
|
|
666
666
|
constraints.push(paragraph([strong(text(i18n`minimum number of contained items`)), text(': '), text(`${i18n`this array may not contain fewer than ${String(schema[keyword`minContains`])} items that validate against the schema:`} `),
|
|
667
|
-
|
|
667
|
+
link(`${schema[keyword`contains`][s.slug]}.md`, i18n`check type definition`, text(gentitle(schema[keyword`contains`][s.titles], schema[keyword`contains`][keyword`type`])))]));
|
|
668
668
|
}
|
|
669
669
|
if (schema[keyword`maxContains`] !== undefined && schema[keyword`contains`]) {
|
|
670
670
|
// console.log('maxContains!', schema[s.filename], schema[s.pointer]);
|
|
671
671
|
constraints.push(paragraph([strong(text(i18n`maximum number of contained items`)), text(': '), text(`${i18n`this array may not contain more than ${String(schema[keyword`maxContains`])} items that validate against the schema:`} `),
|
|
672
|
-
|
|
672
|
+
link(`${schema[keyword`contains`][s.slug]}.md`, i18n`check type definition`, text(gentitle(schema[keyword`contains`][s.titles], schema[keyword`contains`][keyword`type`])))]));
|
|
673
673
|
}
|
|
674
674
|
|
|
675
675
|
// https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.5
|
package/lib/schemaProxy.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/jsonschema2md",
|
|
3
3
|
"description": "Validate and document complex JSON Schemas the easy way.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "8.0.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "types",
|
|
7
7
|
"bin": {
|
|
@@ -21,52 +21,50 @@
|
|
|
21
21
|
"prepare": "husky install"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@adobe/helix-log": "6.0.
|
|
24
|
+
"@adobe/helix-log": "6.0.1",
|
|
25
25
|
"@types/json-schema": "^7.0.8",
|
|
26
|
-
"@types/mdast": "^
|
|
26
|
+
"@types/mdast": "^4.0.0",
|
|
27
27
|
"es2015-i18n-tag": "1.6.1",
|
|
28
28
|
"ferrum": "1.9.4",
|
|
29
|
-
"fs-extra": "11.
|
|
29
|
+
"fs-extra": "11.2.0",
|
|
30
30
|
"github-slugger": "2.0.0",
|
|
31
31
|
"js-yaml": "4.1.0",
|
|
32
32
|
"json-schema": "^0.4.0",
|
|
33
33
|
"mdast-builder": "1.1.1",
|
|
34
|
-
"mdast-util-to-string": "
|
|
34
|
+
"mdast-util-to-string": "4.0.0",
|
|
35
35
|
"readdirp": "3.6.0",
|
|
36
36
|
"remark-gfm": "^3.0.0",
|
|
37
|
-
"remark-parse": "10.0.
|
|
38
|
-
"remark-stringify": "10.0.
|
|
37
|
+
"remark-parse": "10.0.2",
|
|
38
|
+
"remark-stringify": "10.0.3",
|
|
39
39
|
"unified": "10.1.2",
|
|
40
|
-
"unist-util-inspect": "
|
|
41
|
-
"yargs": "17.
|
|
40
|
+
"unist-util-inspect": "8.0.0",
|
|
41
|
+
"yargs": "17.7.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@adobe/eslint-config-helix": "
|
|
45
|
-
"@semantic-release/changelog": "6.0.
|
|
44
|
+
"@adobe/eslint-config-helix": "2.0.6",
|
|
45
|
+
"@semantic-release/changelog": "6.0.3",
|
|
46
46
|
"@semantic-release/git": "10.0.1",
|
|
47
|
-
"@semantic-release/github": "
|
|
48
|
-
"@types/fs-extra": "
|
|
47
|
+
"@semantic-release/github": "9.2.6",
|
|
48
|
+
"@types/fs-extra": "11.0.4",
|
|
49
49
|
"@types/github-slugger": "1.3.0",
|
|
50
|
-
"@types/js-yaml": "4.0.
|
|
51
|
-
"@types/node": "18.
|
|
52
|
-
"@types/yargs": "17.0.
|
|
53
|
-
"c8": "
|
|
54
|
-
"commitizen": "4.
|
|
50
|
+
"@types/js-yaml": "4.0.9",
|
|
51
|
+
"@types/node": "18.19.26",
|
|
52
|
+
"@types/yargs": "17.0.32",
|
|
53
|
+
"c8": "8.0.1",
|
|
54
|
+
"commitizen": "4.3.0",
|
|
55
55
|
"cz-conventional-changelog": "3.3.0",
|
|
56
|
-
"eslint": "8.
|
|
57
|
-
"
|
|
58
|
-
"eslint-plugin-import": "2.26.0",
|
|
59
|
-
"husky": "8.0.2",
|
|
56
|
+
"eslint": "8.57.0",
|
|
57
|
+
"husky": "8.0.3",
|
|
60
58
|
"i18n-tag-schema": "2.5.0",
|
|
61
59
|
"json-logic-js": "axa-ch/cyclic-schemas-test",
|
|
62
|
-
"lint-staged": "
|
|
63
|
-
"mocha": "10.
|
|
64
|
-
"semantic-release": "
|
|
65
|
-
"typescript": "4.
|
|
66
|
-
"unist-util-select": "
|
|
60
|
+
"lint-staged": "14.0.1",
|
|
61
|
+
"mocha": "10.3.0",
|
|
62
|
+
"semantic-release": "21.1.2",
|
|
63
|
+
"typescript": "5.4.3",
|
|
64
|
+
"unist-util-select": "5.1.0"
|
|
67
65
|
},
|
|
68
66
|
"engines": {
|
|
69
|
-
"node": ">=
|
|
67
|
+
"node": "^18.0.0 || >= 20.0.0"
|
|
70
68
|
},
|
|
71
69
|
"repository": {
|
|
72
70
|
"type": "git",
|
package/types/formatInfo.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default function formatmeta(schema: any): {
|
|
2
|
-
longcomment: import("mdast").Root;
|
|
2
|
+
longcomment: import("remark-stringify/node_modules/@types/mdast").Root;
|
|
3
3
|
shortcomment: any;
|
|
4
4
|
comment: string;
|
|
5
|
-
longdescription: import("mdast").Root;
|
|
5
|
+
longdescription: import("remark-stringify/node_modules/@types/mdast").Root;
|
|
6
6
|
shortdescription: any;
|
|
7
7
|
description: any;
|
|
8
8
|
abstract: boolean;
|