Skip to content

Commit 82061a5

Browse files
authored
Export the schema as a JSON file (#3)
Enables use in tools that simply needs a JSON Schema file while still having the authorative source be in the js file where it is typed to match the expected parsed output and thus validated to be correct.
1 parent 9ebe415 commit 82061a5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Generated types
1414
*.d.ts
1515
*.d.ts.map
16-
!/lib/types/**/*.d.ts
1716

1817
# Library specific ones
1918
!/.vscode/extensions.json
19+
/schema.json

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
"files": [
2121
"index.js",
2222
"index.d.ts",
23-
"index.d.ts.map"
23+
"index.d.ts.map",
24+
"schema.json"
2425
],
2526
"scripts": {
2627
"build:0": "run-s clean",
2728
"build:1-declaration": "tsc -p declaration.tsconfig.json",
29+
"build:2-schema-file": "echo \"console.log(JSON.stringify(require('.').socketYmlSchema, undefined, 2))\" | node > schema.json",
2830
"build": "run-s build:*",
2931
"check:dependency-check": "dependency-check '*.js' 'test/**/*.js' --no-dev",
3032
"check:installed-check": "installed-check -i eslint-plugin-jsdoc",

0 commit comments

Comments
 (0)