@adobe/jsonschema2md 8.0.2 → 8.0.4

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 CHANGED
@@ -1,3 +1,23 @@
1
+ ## [8.0.4](https://github.com/adobe/jsonschema2md/compare/v8.0.3...v8.0.4) (2025-07-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **markdownBuilder:** boolean defaults didn't render when the default was false ([#656](https://github.com/adobe/jsonschema2md/issues/656)) ([fb87124](https://github.com/adobe/jsonschema2md/commit/fb87124fb384e36678bb09e0c13b857f3b9a4aa9))
7
+
8
+ ## [8.0.3](https://github.com/adobe/jsonschema2md/compare/v8.0.2...v8.0.3) (2025-06-18)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update external fixes ([#625](https://github.com/adobe/jsonschema2md/issues/625)) ([2f05d79](https://github.com/adobe/jsonschema2md/commit/2f05d7908e2a014e7e1d5fcf0e598b181fb5361c))
14
+ * **deps:** update external fixes ([#628](https://github.com/adobe/jsonschema2md/issues/628)) ([40d6a3e](https://github.com/adobe/jsonschema2md/commit/40d6a3e364891dbc01aaef646d163cf272b4adc5))
15
+ * **deps:** update external major (major) ([#604](https://github.com/adobe/jsonschema2md/issues/604)) ([8d7af7c](https://github.com/adobe/jsonschema2md/commit/8d7af7cce0f97767e914c2d0849e1f2eb79d8547))
16
+ * release ([d18c15c](https://github.com/adobe/jsonschema2md/commit/d18c15c5a3868a8a6d3b74fd2acc8c80e624536c))
17
+ * release ([9e0a69e](https://github.com/adobe/jsonschema2md/commit/9e0a69e4031857a522d1fc95741b9b015ca13fd6))
18
+ * release ([5f6b431](https://github.com/adobe/jsonschema2md/commit/5f6b431482b44e44661837c2ce33d4e92875906a))
19
+ * release ([1b002a8](https://github.com/adobe/jsonschema2md/commit/1b002a820e2efb0edd0c47377cc54dec06cbea68))
20
+
1
21
  ## [8.0.2](https://github.com/adobe/jsonschema2md/compare/v8.0.1...v8.0.2) (2024-04-09)
2
22
 
3
23
 
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Copyright 2025 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ import { defineConfig, globalIgnores } from '@eslint/config-helpers'
13
+ import { recommended, source, test } from '@adobe/eslint-config-helix';
14
+
15
+ export default defineConfig([
16
+ globalIgnores([
17
+ '.vscode/*',
18
+ 'coverage/*',
19
+ ]),
20
+ {
21
+ rules: {
22
+ strict: 0,
23
+
24
+ // Forbid multiple statements in one line
25
+ 'max-statements-per-line': ['error', { max: 1 }],
26
+
27
+ // Allow for-of loops
28
+ 'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
29
+
30
+ // Allow return before else & redundant else statements
31
+ 'no-else-return': 'off',
32
+
33
+ // allow dangling underscores for 'fields'
34
+ 'no-underscore-dangle': 'off',
35
+
36
+ // Allow marking variables unused using a underscore at the start
37
+ 'no-unused-vars': ['error', {
38
+ varsIgnorePattern: '^_.*$',
39
+ argsIgnorePattern: '^_.*$',
40
+ caughtErrorsIgnorePattern: '^_.*$',
41
+ caughtErrors: 'none',
42
+ }],
43
+
44
+ 'import/no-named-as-default-member': 0,
45
+ 'default-param-last': 0,
46
+ },
47
+ plugins: {
48
+ import: recommended.plugins.import,
49
+ },
50
+ extends: [recommended],
51
+ },
52
+ source,
53
+ test,
54
+ ]);
package/lib/index.js CHANGED
@@ -12,7 +12,7 @@
12
12
  /* @ts-check */
13
13
  import yargs from 'yargs';
14
14
  import fs from 'fs-extra';
15
- import readdirp from 'readdirp';
15
+ import { readdirpPromise } from 'readdirp';
16
16
  import {
17
17
  iter, pipe, filter, map, obj,
18
18
  } from 'ferrum';
@@ -307,7 +307,10 @@ export async function main(args) {
307
307
  const schemaExtension = argv.e;
308
308
 
309
309
  // list all schema files in the specified directory
310
- const schemaFiles = await readdirp.promise(schemaPath, { root: schemaPath, fileFilter: `*.${schemaExtension}` });
310
+ const schemaFiles = await readdirpPromise(
311
+ schemaPath,
312
+ { root: schemaPath, fileFilter: (f) => f.path.endsWith(schemaExtension) },
313
+ );
311
314
 
312
315
  console.log(`loading ${schemaFiles.length} schemas`);
313
316
 
@@ -705,7 +705,7 @@ export default function build({
705
705
  }
706
706
 
707
707
  function makedefault(schema, level = 1) {
708
- if (schema[keyword`default`]) {
708
+ if (schema[keyword`default`] !== undefined) {
709
709
  return [
710
710
  heading(level + 1, text(i18n`${simpletitle(schema)} Default Value`)),
711
711
  paragraph(text(i18n`The default value is:`)),
@@ -42,6 +42,7 @@ function makeversionnote(schemas) {
42
42
  /**
43
43
  * Generate the README.md
44
44
  * @param {object} opts
45
+ * @returns {function(Array): import('unist').Parent|null}
45
46
  */
46
47
  export default function build({ readme = true }) {
47
48
  return (schemas) => {
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": "8.0.2",
4
+ "version": "8.0.4",
5
5
  "main": "lib/index.js",
6
6
  "typings": "types",
7
7
  "bin": {
@@ -23,43 +23,45 @@
23
23
  "dependencies": {
24
24
  "@types/json-schema": "^7.0.8",
25
25
  "@types/mdast": "^4.0.0",
26
+ "@types/unist": "^3.0.3",
26
27
  "es2015-i18n-tag": "1.6.1",
27
28
  "ferrum": "1.9.4",
28
- "fs-extra": "11.2.0",
29
+ "fs-extra": "11.3.0",
29
30
  "github-slugger": "2.0.0",
30
31
  "js-yaml": "4.1.0",
31
32
  "json-schema": "^0.4.0",
32
33
  "mdast-builder": "1.1.1",
33
34
  "mdast-util-to-string": "4.0.0",
34
- "readdirp": "3.6.0",
35
+ "readdirp": "4.1.2",
35
36
  "remark-gfm": "^4.0.0",
36
37
  "remark-parse": "11.0.0",
37
38
  "remark-stringify": "11.0.0",
38
- "unified": "11.0.4",
39
- "unist-util-inspect": "8.0.0",
40
- "yargs": "17.7.2"
39
+ "unified": "11.0.5",
40
+ "unist-util-inspect": "8.1.0",
41
+ "yargs": "18.0.0"
41
42
  },
42
43
  "devDependencies": {
43
- "@adobe/eslint-config-helix": "2.0.6",
44
+ "@adobe/eslint-config-helix": "3.0.8",
45
+ "@eslint/config-helpers": "0.3.0",
44
46
  "@semantic-release/changelog": "6.0.3",
45
47
  "@semantic-release/git": "10.0.1",
46
- "@semantic-release/github": "10.0.3",
48
+ "@semantic-release/github": "11.0.3",
47
49
  "@types/fs-extra": "11.0.4",
48
50
  "@types/github-slugger": "2.0.0",
49
51
  "@types/js-yaml": "4.0.9",
50
- "@types/node": "20.12.5",
51
- "@types/yargs": "17.0.32",
52
- "c8": "9.1.0",
53
- "commitizen": "4.3.0",
52
+ "@types/node": "22.16.5",
53
+ "@types/yargs": "17.0.33",
54
+ "c8": "10.1.3",
55
+ "commitizen": "4.3.1",
54
56
  "cz-conventional-changelog": "3.3.0",
55
- "eslint": "8.57.0",
56
- "husky": "9.0.11",
57
+ "eslint": "9.4.0",
58
+ "husky": "9.1.7",
57
59
  "i18n-tag-schema": "2.5.0",
58
60
  "json-logic-js": "axa-ch/cyclic-schemas-test",
59
- "lint-staged": "15.2.2",
60
- "mocha": "10.4.0",
61
- "semantic-release": "23.0.7",
62
- "typescript": "5.4.4",
61
+ "lint-staged": "16.1.2",
62
+ "mocha": "11.7.1",
63
+ "semantic-release": "24.2.7",
64
+ "typescript": "5.8.3",
63
65
  "unist-util-select": "5.1.0"
64
66
  },
65
67
  "engines": {
package/types/index.d.ts CHANGED
@@ -42,7 +42,7 @@
42
42
  * skip in markdown.
43
43
  * @returns {GeneratedOutput} List of raw markdown that were generated from input schema.
44
44
  */
45
- export function jsonschema2md(schema: JsonSchema | import("../types/api").SchemaFiles, options: {
45
+ export function jsonschema2md(schema: JsonSchema | SchemaFiles, options: {
46
46
  schemaPath?: string;
47
47
  outDir?: string;
48
48
  metadata?: {
@@ -1,5 +1,4 @@
1
1
  export default function build({ header, links, includeProperties, rewritelinks, exampleFormat, skipProperties, }?: {
2
- header: any;
3
2
  links?: {};
4
3
  includeProperties?: any[];
5
4
  rewritelinks?: (x: any) => any;
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Generate the README.md
3
3
  * @param {object} opts
4
+ * @returns {function(Array): import('unist').Parent|null}
4
5
  */
5
- export default function build({ readme }: object): (schemas: any) => import("mdast-builder/node_modules/@types/unist").Parent<import("mdast-builder/node_modules/@types/unist").Node<import("mdast-builder/node_modules/@types/unist").Data>, import("mdast-builder/node_modules/@types/unist").Data>;
6
+ export default function build({ readme }: object): (arg0: any[]) => import("unist").Parent | null;
@@ -1 +1 @@
1
- export default function loader(): (name: string, schema: any) => any;
1
+ export default function loader(): (/** @type {string} */ name: string, /** @type {any} */ schema: any) => any;
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
- .vscode/*
2
- coverage/*
package/.eslintrc.cjs DELETED
@@ -1,41 +0,0 @@
1
- /*
2
- * Copyright 2019 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- module.exports = {
14
- root: true,
15
- extends: '@adobe/helix',
16
- rules: {
17
- strict: 0,
18
-
19
- // Forbid multiple statements in one line
20
- 'max-statements-per-line': ['error', { max: 1 }],
21
-
22
- // Allow for-of loops
23
- 'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
24
-
25
- // Allow return before else & redundant else statements
26
- 'no-else-return': 'off',
27
-
28
- // allow dangling underscores for 'fields'
29
- 'no-underscore-dangle': 'off',
30
-
31
- // Allow marking variables unused using a underscore at the start
32
- 'no-unused-vars': ['error', {
33
- varsIgnorePattern: '^_.*$',
34
- argsIgnorePattern: '^_.*$',
35
- caughtErrorsIgnorePattern: '^_.*$',
36
- }],
37
-
38
- 'import/no-named-as-default-member': 0,
39
- 'default-param-last': 0,
40
- },
41
- };