ts-json-schema-generator
Advanced tools
Comparing version 2.3.1--canary.2067.707b946.0 to 2.3.1--canary.2118.810c30f.0
#!/usr/bin/env node | ||
// eslint-disable-next-line no-undef | ||
// eslint-disable-next-line @typescript-eslint/no-require-imports | ||
require("../dist/ts-json-schema-generator.js"); |
{ | ||
"name": "ts-json-schema-generator", | ||
"version": "2.3.1--canary.2067.707b946.0", | ||
"version": "2.3.1--canary.2118.810c30f.0", | ||
"description": "Generate JSON schema from your Typescript sources", | ||
@@ -52,5 +52,5 @@ "keywords": [ | ||
"run": "tsx ts-json-schema-generator.ts", | ||
"test": "vitest run", | ||
"test:coverage": "yarn vitest run --coverage", | ||
"test:fast": "cross-env FAST_TEST=1 vitest run", | ||
"test": "jest test/ --verbose", | ||
"test:coverage": "yarn jest test/ --collectCoverage=true", | ||
"test:fast": "cross-env FAST_TEST=1 jest test/ --verbose", | ||
"test:update": "cross-env UPDATE_SCHEMA=true yarn test:fast", | ||
@@ -66,31 +66,32 @@ "watch": "tsc -w" | ||
"safe-stable-stringify": "^2.5.0", | ||
"tslib": "^2.7.0", | ||
"typescript": "^5.5.4" | ||
"tslib": "^2.8.1", | ||
"typescript": "^5.6.3" | ||
}, | ||
"devDependencies": { | ||
"@auto-it/conventional-commits": "^11.2.1", | ||
"@auto-it/first-time-contributor": "^11.2.1", | ||
"@babel/core": "^7.25.2", | ||
"@babel/preset-env": "^7.25.4", | ||
"@babel/preset-typescript": "^7.24.7", | ||
"@eslint/js": "^9.10.0", | ||
"@auto-it/conventional-commits": "^11.3.0", | ||
"@auto-it/first-time-contributor": "^11.3.0", | ||
"@babel/core": "^7.26.0", | ||
"@babel/preset-env": "^7.26.0", | ||
"@babel/preset-typescript": "^7.26.0", | ||
"@eslint/js": "^9.15.0", | ||
"@types/eslint": "^9.6.1", | ||
"@types/glob": "^8.1.0", | ||
"@types/node": "^22.5.4", | ||
"@types/jest": "^29.5.14", | ||
"@types/node": "^22.9.0", | ||
"@types/normalize-path": "^3.0.2", | ||
"@vitest/coverage-v8": "^2.0.5", | ||
"ajv": "^8.17.1", | ||
"ajv-formats": "^3.0.1", | ||
"auto": "^11.2.1", | ||
"chai": "^5.1.1", | ||
"auto": "^11.3.0", | ||
"chai": "^5.1.2", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^9.10.0", | ||
"eslint": "9.14.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.2.1", | ||
"jest": "^29.7.0", | ||
"jest-junit": "^16.0.0", | ||
"prettier": "^3.3.3", | ||
"tsx": "^4.19.0", | ||
"typescript-eslint": "^8.4.0", | ||
"tsx": "^4.19.2", | ||
"typescript-eslint": "^8.14.0", | ||
"vega": "^5.30.0", | ||
"vega-lite": "^5.21.0", | ||
"vitest": "^2.0.5" | ||
"vega-lite": "^5.21.0" | ||
}, | ||
@@ -97,0 +98,0 @@ "engines": { |
@@ -8,2 +8,3 @@ "use strict"; | ||
const safe_stable_stringify_1 = tslib_1.__importDefault(require("safe-stable-stringify")); | ||
const typescript_1 = require("typescript"); | ||
const generator_js_1 = require("./factory/generator.js"); | ||
@@ -42,3 +43,3 @@ const BaseError_js_1 = require("./src/Error/BaseError.js"); | ||
path: args.path, | ||
tsconfig: args.tsconfig, | ||
tsconfig: typeof args.tsconfig === "string" ? args.tsconfig : (0, typescript_1.findConfigFile)(process.cwd(), (f) => typescript_1.sys.fileExists(f)), | ||
type: args.type, | ||
@@ -45,0 +46,0 @@ schemaId: args.id, |
{ | ||
"name": "ts-json-schema-generator", | ||
"version": "2.3.1--canary.2067.707b946.0", | ||
"version": "2.3.1--canary.2118.810c30f.0", | ||
"description": "Generate JSON schema from your Typescript sources", | ||
@@ -52,5 +52,5 @@ "keywords": [ | ||
"run": "tsx ts-json-schema-generator.ts", | ||
"test": "vitest run", | ||
"test:coverage": "yarn vitest run --coverage", | ||
"test:fast": "cross-env FAST_TEST=1 vitest run", | ||
"test": "jest test/ --verbose", | ||
"test:coverage": "yarn jest test/ --collectCoverage=true", | ||
"test:fast": "cross-env FAST_TEST=1 jest test/ --verbose", | ||
"test:update": "cross-env UPDATE_SCHEMA=true yarn test:fast", | ||
@@ -66,31 +66,32 @@ "watch": "tsc -w" | ||
"safe-stable-stringify": "^2.5.0", | ||
"tslib": "^2.7.0", | ||
"typescript": "^5.5.4" | ||
"tslib": "^2.8.1", | ||
"typescript": "^5.6.3" | ||
}, | ||
"devDependencies": { | ||
"@auto-it/conventional-commits": "^11.2.1", | ||
"@auto-it/first-time-contributor": "^11.2.1", | ||
"@babel/core": "^7.25.2", | ||
"@babel/preset-env": "^7.25.4", | ||
"@babel/preset-typescript": "^7.24.7", | ||
"@eslint/js": "^9.10.0", | ||
"@auto-it/conventional-commits": "^11.3.0", | ||
"@auto-it/first-time-contributor": "^11.3.0", | ||
"@babel/core": "^7.26.0", | ||
"@babel/preset-env": "^7.26.0", | ||
"@babel/preset-typescript": "^7.26.0", | ||
"@eslint/js": "^9.15.0", | ||
"@types/eslint": "^9.6.1", | ||
"@types/glob": "^8.1.0", | ||
"@types/node": "^22.5.4", | ||
"@types/jest": "^29.5.14", | ||
"@types/node": "^22.9.0", | ||
"@types/normalize-path": "^3.0.2", | ||
"@vitest/coverage-v8": "^2.0.5", | ||
"ajv": "^8.17.1", | ||
"ajv-formats": "^3.0.1", | ||
"auto": "^11.2.1", | ||
"chai": "^5.1.1", | ||
"auto": "^11.3.0", | ||
"chai": "^5.1.2", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^9.10.0", | ||
"eslint": "9.14.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.2.1", | ||
"jest": "^29.7.0", | ||
"jest-junit": "^16.0.0", | ||
"prettier": "^3.3.3", | ||
"tsx": "^4.19.0", | ||
"typescript-eslint": "^8.4.0", | ||
"tsx": "^4.19.2", | ||
"typescript-eslint": "^8.14.0", | ||
"vega": "^5.30.0", | ||
"vega-lite": "^5.21.0", | ||
"vitest": "^2.0.5" | ||
"vega-lite": "^5.21.0" | ||
}, | ||
@@ -97,0 +98,0 @@ "engines": { |
@@ -38,2 +38,4 @@ # ts-json-schema-generator | ||
By default, the command-line generator will use the `tsconfig.json` file in the current working directory, or the first parent directory that contains a `tsconfig.json` file up to the root of the filesystem. If you want to use a different `tsconfig.json` file, you can use the `--tsconfig` option. In particular, if you need to use different compilation options for types, you may want to create a separate `tsconfig.json` file for the schema generation only. | ||
### Options | ||
@@ -40,0 +42,0 @@ |
@@ -23,3 +23,4 @@ import ts from "typescript"; | ||
case ts.SyntaxKind.MinusToken: | ||
return new LiteralType(-(operand.getValue() as number)); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-unary-minus | ||
return new LiteralType(-operand.getValue()); | ||
case ts.SyntaxKind.TildeToken: | ||
@@ -26,0 +27,0 @@ return new LiteralType(~operand.getValue()); |
@@ -35,3 +35,2 @@ import ts from "typescript"; | ||
//@ts-expect-error - internal typescript API | ||
const awaitedType = this.typeChecker.getAwaitedType(type); | ||
@@ -65,4 +64,3 @@ | ||
const type = this.typeChecker.getTypeAtLocation(node); | ||
//@ts-expect-error - internal typescript API | ||
const awaitedType = this.typeChecker.getAwaitedType(type); | ||
const awaitedType = this.typeChecker.getAwaitedType(type)!; | ||
const awaitedNode = this.typeChecker.typeToTypeNode(awaitedType, undefined, ts.NodeBuilderFlags.IgnoreErrors); | ||
@@ -69,0 +67,0 @@ |
@@ -5,2 +5,3 @@ import { Command, Option } from "commander"; | ||
import stableStringify from "safe-stable-stringify"; | ||
import { findConfigFile, sys as tsSys } from "typescript"; | ||
import { createGenerator } from "./factory/generator.js"; | ||
@@ -60,3 +61,4 @@ import type { Config } from "./src/Config.js"; | ||
path: args.path, | ||
tsconfig: args.tsconfig, | ||
tsconfig: | ||
typeof args.tsconfig === "string" ? args.tsconfig : findConfigFile(process.cwd(), (f) => tsSys.fileExists(f)), | ||
type: args.type, | ||
@@ -63,0 +65,0 @@ schemaId: args.id, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
858267
13285
259
26
Updatedtslib@^2.8.1
Updatedtypescript@^5.6.3