@adobe/jsonschema2md 7.1.0 → 7.1.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/CHANGELOG.md +16 -0
- package/lib/index.js +1 -1
- package/lib/locales/{nl-NL.json → nl_NL.json} +0 -0
- package/lib/schemaProxy.js +21 -10
- package/package.json +13 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [7.1.2](https://github.com/adobe/jsonschema2md/compare/v7.1.1...v7.1.2) (2022-10-06)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **schemaproxy.js:** reuse previously proxied subschemas to fix max call stack size exceeded error ([1388449](https://github.com/adobe/jsonschema2md/commit/13884491df4c9ecc694f3881e40c1861f7acfdf8)), closes [/github.com/adobe/jsonschema2md/issues/252#issuecomment-806067867](https://github.com//github.com/adobe/jsonschema2md/issues/252/issues/issuecomment-806067867) [#252](https://github.com/adobe/jsonschema2md/issues/252)
|
|
7
|
+
|
|
8
|
+
## [7.1.1](https://github.com/adobe/jsonschema2md/compare/v7.1.0...v7.1.1) (2022-05-19)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **i18n:** align Dutch locale name with standard pattern ([d940cd4](https://github.com/adobe/jsonschema2md/commit/d940cd4114a04f16e3a41db99b095b40e58e4813)), closes [#426](https://github.com/adobe/jsonschema2md/issues/426)
|
|
14
|
+
* **i18n:** dutch locale available as command line option ([e8c9304](https://github.com/adobe/jsonschema2md/commit/e8c93048191394e53d2ab823f2b4489e843fbc40)), closes [#426](https://github.com/adobe/jsonschema2md/issues/426)
|
|
15
|
+
* **i18n:** support Dutch locale as command line option ([0c0fbbd](https://github.com/adobe/jsonschema2md/commit/0c0fbbdf1e668441e330d9f065a43580e3325be1))
|
|
16
|
+
|
|
1
17
|
# [7.1.0](https://github.com/adobe/jsonschema2md/compare/v7.0.1...v7.1.0) (2022-05-19)
|
|
2
18
|
|
|
3
19
|
|
package/lib/index.js
CHANGED
|
@@ -269,7 +269,7 @@ export async function main(args) {
|
|
|
269
269
|
|
|
270
270
|
.alias('l', 'language')
|
|
271
271
|
.describe('l', 'the selected language')
|
|
272
|
-
.choices('l', ['en_US', 'de'])
|
|
272
|
+
.choices('l', ['en_US', 'de', 'nl_NL'])
|
|
273
273
|
.default('l', 'en_US')
|
|
274
274
|
|
|
275
275
|
.alias('f', 'example-format')
|
|
File without changes
|
package/lib/schemaProxy.js
CHANGED
|
@@ -34,7 +34,7 @@ function loadExamples(file, num = 1) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
const handler = ({
|
|
37
|
-
root = '', fullpath = null, filename = '.', schemas, parent = null, slugger,
|
|
37
|
+
root = '', fullpath = null, filename = '.', schemas, subschemas, parent = null, slugger,
|
|
38
38
|
}) => {
|
|
39
39
|
const meta = {};
|
|
40
40
|
|
|
@@ -162,14 +162,23 @@ const handler = ({
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
// console.log('making new proxy from', target, prop, 'receiver', receiver[symbols.id]);
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
165
|
+
let subschema;
|
|
166
|
+
if (subschemas.has(retval)) {
|
|
167
|
+
subschema = subschemas.get(retval);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
subschema = new Proxy(retval, handler({
|
|
171
|
+
root: `${root}/${prop}`,
|
|
172
|
+
parent: receiver,
|
|
173
|
+
fullpath,
|
|
174
|
+
filename,
|
|
175
|
+
schemas,
|
|
176
|
+
subschemas,
|
|
177
|
+
slugger,
|
|
178
|
+
}));
|
|
179
|
+
|
|
180
|
+
subschemas.set(retval, subschema);
|
|
181
|
+
}
|
|
173
182
|
|
|
174
183
|
if (subschema[keyword`$id`]) {
|
|
175
184
|
// stow away the schema for lookup
|
|
@@ -190,6 +199,8 @@ export default function loader() {
|
|
|
190
199
|
files: {},
|
|
191
200
|
};
|
|
192
201
|
|
|
202
|
+
const subschemas = new Map();
|
|
203
|
+
|
|
193
204
|
const slugger = new GhSlugger();
|
|
194
205
|
|
|
195
206
|
return (/** @type {string} */ name, /** @type {any} */ schema) => {
|
|
@@ -197,7 +208,7 @@ export default function loader() {
|
|
|
197
208
|
const filename = path.basename(name);
|
|
198
209
|
const fullpath = name === filename ? undefined : name;
|
|
199
210
|
const proxied = new Proxy(schema, handler({
|
|
200
|
-
filename, fullpath, schemas, slugger,
|
|
211
|
+
filename, fullpath, schemas, subschemas, slugger,
|
|
201
212
|
}));
|
|
202
213
|
schemas.loaded.push(proxied);
|
|
203
214
|
if (proxied[keyword`$id`]) {
|
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": "7.1.
|
|
4
|
+
"version": "7.1.2",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "types",
|
|
7
7
|
"bin": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"start": "node cli.js",
|
|
17
17
|
"examples": "node cli.js -d examples/schemas/ -o examples/docs/ -x examples/generated-schemas/",
|
|
18
18
|
"test": " c8 --reporter=text --reporter=lcov --check-coverage --branches 80 --statements 95 --lines 95 mocha && node lib/locales/update.js",
|
|
19
|
-
"test-ci": "c8 --reporter=text --reporter=lcov --check-coverage --branches 80 --statements 95 --lines 95 mocha --reporter xunit --reporter-options output=./junit/test-results.xml
|
|
19
|
+
"test-ci": "c8 --reporter=text --reporter=lcov --check-coverage --branches 80 --statements 95 --lines 95 mocha --reporter xunit --reporter-options output=./junit/test-results.xml",
|
|
20
20
|
"emit-types": "npx -p typescript tsc",
|
|
21
21
|
"prepare": "husky install"
|
|
22
22
|
},
|
|
@@ -37,33 +37,32 @@
|
|
|
37
37
|
"remark-parse": "10.0.1",
|
|
38
38
|
"remark-stringify": "10.0.2",
|
|
39
39
|
"unified": "10.1.2",
|
|
40
|
-
"unist-util-inspect": "7.0.
|
|
41
|
-
"yargs": "17.
|
|
40
|
+
"unist-util-inspect": "7.0.1",
|
|
41
|
+
"yargs": "17.6.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@adobe/eslint-config-helix": "1.3.2",
|
|
45
45
|
"@semantic-release/changelog": "6.0.1",
|
|
46
46
|
"@semantic-release/git": "10.0.1",
|
|
47
|
-
"@semantic-release/github": "8.0.
|
|
47
|
+
"@semantic-release/github": "8.0.6",
|
|
48
48
|
"@types/fs-extra": "9.0.13",
|
|
49
49
|
"@types/github-slugger": "1.3.0",
|
|
50
50
|
"@types/js-yaml": "4.0.5",
|
|
51
|
-
"@types/node": "16.11.
|
|
52
|
-
"@types/yargs": "17.0.
|
|
53
|
-
"c8": "7.
|
|
54
|
-
"
|
|
55
|
-
"commitizen": "4.2.4",
|
|
51
|
+
"@types/node": "16.11.63",
|
|
52
|
+
"@types/yargs": "17.0.13",
|
|
53
|
+
"c8": "7.12.0",
|
|
54
|
+
"commitizen": "4.2.5",
|
|
56
55
|
"cz-conventional-changelog": "3.3.0",
|
|
57
|
-
"eslint": "8.
|
|
56
|
+
"eslint": "8.24.0",
|
|
58
57
|
"eslint-plugin-header": "3.1.1",
|
|
59
58
|
"eslint-plugin-import": "2.26.0",
|
|
60
59
|
"husky": "8.0.1",
|
|
61
60
|
"i18n-tag-schema": "2.5.0",
|
|
62
61
|
"json-logic-js": "axa-ch/cyclic-schemas-test",
|
|
63
|
-
"lint-staged": "
|
|
62
|
+
"lint-staged": "13.0.3",
|
|
64
63
|
"mocha": "10.0.0",
|
|
65
|
-
"semantic-release": "19.0.
|
|
66
|
-
"typescript": "4.
|
|
64
|
+
"semantic-release": "19.0.5",
|
|
65
|
+
"typescript": "4.8.4",
|
|
67
66
|
"unist-util-select": "4.0.1"
|
|
68
67
|
},
|
|
69
68
|
"engines": {
|