Switch back to json-schema-to-zod mainline (#60)
After https://github.com/StefanTerdell/json-schema-to-zod/pull/18 and https://github.com/StefanTerdell/json-schema-to-zod/pull/24 got merged, let’s switch back to the mainline.
This commit is contained in:
parent
5e5a9acf9f
commit
a1aa1d775b
3 changed files with 12 additions and 127 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
const { parseSchema } = require('json-schema-to-zod-with-defaults')
|
const { parseSchema } = require('json-schema-to-zod')
|
||||||
const { schema } = require('../config.schema.json')
|
const { schema } = require('../config.schema.json')
|
||||||
const { format } = require('prettier')
|
const { format } = require('prettier')
|
||||||
const { join, basename } = require('path')
|
const { join, basename } = require('path')
|
||||||
|
@ -11,7 +11,7 @@ const file = join(__dirname, '../src/generated/config_boundary.ts')
|
||||||
|
|
||||||
console.log(`Starting code generation for ${file}`)
|
console.log(`Starting code generation for ${file}`)
|
||||||
|
|
||||||
const zodSchema = parseSchema(schema, true)
|
const zodSchema = parseSchema(schema, false)
|
||||||
|
|
||||||
const code = format(
|
const code = format(
|
||||||
`
|
`
|
||||||
|
|
133
package-lock.json
generated
133
package-lock.json
generated
|
@ -31,7 +31,7 @@
|
||||||
"homebridge": "^1.3.5",
|
"homebridge": "^1.3.5",
|
||||||
"homebridge-cmdswitch2": "^0.2.10",
|
"homebridge-cmdswitch2": "^0.2.10",
|
||||||
"jest": "^29.3.0",
|
"jest": "^29.3.0",
|
||||||
"json-schema-to-zod-with-defaults": "^0.2.1",
|
"json-schema-to-zod": "^0.6.0",
|
||||||
"nodemon": "^2.0.13",
|
"nodemon": "^2.0.13",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"release-it": "^15.5.0",
|
"release-it": "^15.5.0",
|
||||||
|
@ -2050,23 +2050,6 @@
|
||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/scope-manager": {
|
|
||||||
"version": "5.45.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.45.1.tgz",
|
|
||||||
"integrity": "sha512-D6fCileR6Iai7E35Eb4Kp+k0iW7F1wxXYrOhX/3dywsOJpJAQ20Fwgcf+P/TDtvQ7zcsWsrJaglaQWDhOMsspQ==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@typescript-eslint/types": "5.45.1",
|
|
||||||
"@typescript-eslint/visitor-keys": "5.45.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/typescript-eslint"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@typescript-eslint/type-utils": {
|
"node_modules/@typescript-eslint/type-utils": {
|
||||||
"version": "5.46.0",
|
"version": "5.46.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.46.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.46.0.tgz",
|
||||||
|
@ -2151,46 +2134,6 @@
|
||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/types": {
|
|
||||||
"version": "5.45.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.45.1.tgz",
|
|
||||||
"integrity": "sha512-HEW3U0E5dLjUT+nk7b4lLbOherS1U4ap+b9pfu2oGsW3oPu7genRaY9dDv3nMczC1rbnRY2W/D7SN05wYoGImg==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/typescript-eslint"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@typescript-eslint/typescript-estree": {
|
|
||||||
"version": "5.45.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.45.1.tgz",
|
|
||||||
"integrity": "sha512-76NZpmpCzWVrrb0XmYEpbwOz/FENBi+5W7ipVXAsG3OoFrQKJMiaqsBMbvGRyLtPotGqUfcY7Ur8j0dksDJDng==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@typescript-eslint/types": "5.45.1",
|
|
||||||
"@typescript-eslint/visitor-keys": "5.45.1",
|
|
||||||
"debug": "^4.3.4",
|
|
||||||
"globby": "^11.1.0",
|
|
||||||
"is-glob": "^4.0.3",
|
|
||||||
"semver": "^7.3.7",
|
|
||||||
"tsutils": "^3.21.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/typescript-eslint"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"typescript": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@typescript-eslint/utils": {
|
"node_modules/@typescript-eslint/utils": {
|
||||||
"version": "5.46.0",
|
"version": "5.46.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.46.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.46.0.tgz",
|
||||||
|
@ -2291,23 +2234,6 @@
|
||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/visitor-keys": {
|
|
||||||
"version": "5.45.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.45.1.tgz",
|
|
||||||
"integrity": "sha512-cy9ln+6rmthYWjH9fmx+5FU/JDpjQb586++x2FZlveq7GdGuLLW9a2Jcst2TGekH82bXpfmRNSwP9tyEs6RjvQ==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@typescript-eslint/types": "5.45.1",
|
|
||||||
"eslint-visitor-keys": "^3.3.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/typescript-eslint"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/abbrev": {
|
"node_modules/abbrev": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
||||||
|
@ -7305,10 +7231,10 @@
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/json-schema-to-zod-with-defaults": {
|
"node_modules/json-schema-to-zod": {
|
||||||
"version": "0.2.1",
|
"version": "0.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/json-schema-to-zod-with-defaults/-/json-schema-to-zod-with-defaults-0.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/json-schema-to-zod/-/json-schema-to-zod-0.6.0.tgz",
|
||||||
"integrity": "sha512-5T4GUM4Koo7COTrOknBwsIgBrhp4FqM5BAhofWewLiBt3Q+ViWy8xNIeB6d3ZGHnEwKGVIbMaRaJyuwpM9x4SA==",
|
"integrity": "sha512-Ers1rJVwcp7hSmqucG2oFTlkeEIk34ST9BuY+PuZ8u0cBdaWG0NgwU1A6w59n8WCsy8d4RM4CMWS6aZ2dQoi3w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/json-schema": "^7.0.9",
|
"@types/json-schema": "^7.0.9",
|
||||||
|
@ -12525,16 +12451,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@typescript-eslint/scope-manager": {
|
|
||||||
"version": "5.45.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.45.1.tgz",
|
|
||||||
"integrity": "sha512-D6fCileR6Iai7E35Eb4Kp+k0iW7F1wxXYrOhX/3dywsOJpJAQ20Fwgcf+P/TDtvQ7zcsWsrJaglaQWDhOMsspQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@typescript-eslint/types": "5.45.1",
|
|
||||||
"@typescript-eslint/visitor-keys": "5.45.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@typescript-eslint/type-utils": {
|
"@typescript-eslint/type-utils": {
|
||||||
"version": "5.46.0",
|
"version": "5.46.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.46.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.46.0.tgz",
|
||||||
|
@ -12580,27 +12496,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@typescript-eslint/types": {
|
|
||||||
"version": "5.45.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.45.1.tgz",
|
|
||||||
"integrity": "sha512-HEW3U0E5dLjUT+nk7b4lLbOherS1U4ap+b9pfu2oGsW3oPu7genRaY9dDv3nMczC1rbnRY2W/D7SN05wYoGImg==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"@typescript-eslint/typescript-estree": {
|
|
||||||
"version": "5.45.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.45.1.tgz",
|
|
||||||
"integrity": "sha512-76NZpmpCzWVrrb0XmYEpbwOz/FENBi+5W7ipVXAsG3OoFrQKJMiaqsBMbvGRyLtPotGqUfcY7Ur8j0dksDJDng==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@typescript-eslint/types": "5.45.1",
|
|
||||||
"@typescript-eslint/visitor-keys": "5.45.1",
|
|
||||||
"debug": "^4.3.4",
|
|
||||||
"globby": "^11.1.0",
|
|
||||||
"is-glob": "^4.0.3",
|
|
||||||
"semver": "^7.3.7",
|
|
||||||
"tsutils": "^3.21.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@typescript-eslint/utils": {
|
"@typescript-eslint/utils": {
|
||||||
"version": "5.46.0",
|
"version": "5.46.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.46.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.46.0.tgz",
|
||||||
|
@ -12660,16 +12555,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@typescript-eslint/visitor-keys": {
|
|
||||||
"version": "5.45.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.45.1.tgz",
|
|
||||||
"integrity": "sha512-cy9ln+6rmthYWjH9fmx+5FU/JDpjQb586++x2FZlveq7GdGuLLW9a2Jcst2TGekH82bXpfmRNSwP9tyEs6RjvQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@typescript-eslint/types": "5.45.1",
|
|
||||||
"eslint-visitor-keys": "^3.3.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"abbrev": {
|
"abbrev": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
||||||
|
@ -16380,10 +16265,10 @@
|
||||||
"@apidevtools/json-schema-ref-parser": "9.0.9"
|
"@apidevtools/json-schema-ref-parser": "9.0.9"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"json-schema-to-zod-with-defaults": {
|
"json-schema-to-zod": {
|
||||||
"version": "0.2.1",
|
"version": "0.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/json-schema-to-zod-with-defaults/-/json-schema-to-zod-with-defaults-0.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/json-schema-to-zod/-/json-schema-to-zod-0.6.0.tgz",
|
||||||
"integrity": "sha512-5T4GUM4Koo7COTrOknBwsIgBrhp4FqM5BAhofWewLiBt3Q+ViWy8xNIeB6d3ZGHnEwKGVIbMaRaJyuwpM9x4SA==",
|
"integrity": "sha512-Ers1rJVwcp7hSmqucG2oFTlkeEIk34ST9BuY+PuZ8u0cBdaWG0NgwU1A6w59n8WCsy8d4RM4CMWS6aZ2dQoi3w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/json-schema": "^7.0.9",
|
"@types/json-schema": "^7.0.9",
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
"homebridge": "^1.3.5",
|
"homebridge": "^1.3.5",
|
||||||
"homebridge-cmdswitch2": "^0.2.10",
|
"homebridge-cmdswitch2": "^0.2.10",
|
||||||
"jest": "^29.3.0",
|
"jest": "^29.3.0",
|
||||||
"json-schema-to-zod-with-defaults": "^0.2.1",
|
"json-schema-to-zod": "^0.6.0",
|
||||||
"nodemon": "^2.0.13",
|
"nodemon": "^2.0.13",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"release-it": "^15.5.0",
|
"release-it": "^15.5.0",
|
||||||
|
|
Loading…
Reference in a new issue