diff --git a/code-generation/config-scheme-gen.js b/code-generation/config-scheme-gen.js index 1d31d64..fbc6f93 100755 --- a/code-generation/config-scheme-gen.js +++ b/code-generation/config-scheme-gen.js @@ -1,6 +1,6 @@ #!/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 { format } = require('prettier') 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}`) -const zodSchema = parseSchema(schema, true) +const zodSchema = parseSchema(schema, false) const code = format( ` diff --git a/package-lock.json b/package-lock.json index 6b5e16e..dca4d7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "homebridge": "^1.3.5", "homebridge-cmdswitch2": "^0.2.10", "jest": "^29.3.0", - "json-schema-to-zod-with-defaults": "^0.2.1", + "json-schema-to-zod": "^0.6.0", "nodemon": "^2.0.13", "prettier": "^2.7.1", "release-it": "^15.5.0", @@ -2050,23 +2050,6 @@ "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": { "version": "5.46.0", "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" } }, - "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": { "version": "5.46.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.46.0.tgz", @@ -2291,23 +2234,6 @@ "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": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -7305,10 +7231,10 @@ "node": ">=10" } }, - "node_modules/json-schema-to-zod-with-defaults": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/json-schema-to-zod-with-defaults/-/json-schema-to-zod-with-defaults-0.2.1.tgz", - "integrity": "sha512-5T4GUM4Koo7COTrOknBwsIgBrhp4FqM5BAhofWewLiBt3Q+ViWy8xNIeB6d3ZGHnEwKGVIbMaRaJyuwpM9x4SA==", + "node_modules/json-schema-to-zod": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/json-schema-to-zod/-/json-schema-to-zod-0.6.0.tgz", + "integrity": "sha512-Ers1rJVwcp7hSmqucG2oFTlkeEIk34ST9BuY+PuZ8u0cBdaWG0NgwU1A6w59n8WCsy8d4RM4CMWS6aZ2dQoi3w==", "dev": true, "dependencies": { "@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": { "version": "5.46.0", "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": { "version": "5.46.0", "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": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -16380,10 +16265,10 @@ "@apidevtools/json-schema-ref-parser": "9.0.9" } }, - "json-schema-to-zod-with-defaults": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/json-schema-to-zod-with-defaults/-/json-schema-to-zod-with-defaults-0.2.1.tgz", - "integrity": "sha512-5T4GUM4Koo7COTrOknBwsIgBrhp4FqM5BAhofWewLiBt3Q+ViWy8xNIeB6d3ZGHnEwKGVIbMaRaJyuwpM9x4SA==", + "json-schema-to-zod": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/json-schema-to-zod/-/json-schema-to-zod-0.6.0.tgz", + "integrity": "sha512-Ers1rJVwcp7hSmqucG2oFTlkeEIk34ST9BuY+PuZ8u0cBdaWG0NgwU1A6w59n8WCsy8d4RM4CMWS6aZ2dQoi3w==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", diff --git a/package.json b/package.json index b7c1e06..7af4ea7 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "homebridge": "^1.3.5", "homebridge-cmdswitch2": "^0.2.10", "jest": "^29.3.0", - "json-schema-to-zod-with-defaults": "^0.2.1", + "json-schema-to-zod": "^0.6.0", "nodemon": "^2.0.13", "prettier": "^2.7.1", "release-it": "^15.5.0",