diff --git a/package-lock.json b/package-lock.json index 3d8caf8f..3d9d0ce1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23066,7 +23066,6 @@ "figures": "^5.0.0", "httpsnippet-client-api": "file:../httpsnippet-client-api", "js-yaml": "^4.1.0", - "json-schema-to-ts": "^2.9.2", "license": "^1.0.3", "lodash.camelcase": "^4.3.0", "lodash.deburr": "^4.1.0", @@ -23428,6 +23427,7 @@ "caseless": "^0.12.0", "datauri": "^4.1.0", "fetch-har": "^11.0.1", + "json-schema-to-ts": "^2.9.2", "json-schema-traverse": "^1.0.0", "lodash.merge": "^4.6.2", "oas": "^23.1.0", diff --git a/packages/api/package.json b/packages/api/package.json index 560481ca..40f60791 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -56,7 +56,6 @@ "figures": "^5.0.0", "httpsnippet-client-api": "file:../httpsnippet-client-api", "js-yaml": "^4.1.0", - "json-schema-to-ts": "^2.9.2", "license": "^1.0.3", "lodash.camelcase": "^4.3.0", "lodash.deburr": "^4.1.0", diff --git a/packages/api/src/codegen/languages/typescript/index.ts b/packages/api/src/codegen/languages/typescript/index.ts index a0bad684..aa5510f6 100644 --- a/packages/api/src/codegen/languages/typescript/index.ts +++ b/packages/api/src/codegen/languages/typescript/index.ts @@ -123,12 +123,6 @@ export default class TSGenerator extends CodeGenerator { url: 'https://tsup.egoist.dev/', version: '^7.2.0', }, - 'json-schema-to-ts': { - dependencyType: 'production', - reason: 'Required for TypeScript type handling.', - url: 'https://npm.im/json-schema-to-ts', - version: '^2.9.2', - }, typescript: { dependencyType: 'development', reason: 'Required for `tsup`.', @@ -751,7 +745,7 @@ Generated at ${createdAt} const sourceFile = sourceDirectory.createSourceFile('types.ts', ''); sourceFile.addImportDeclarations([ - { defaultImport: 'type { FromSchema }', moduleSpecifier: 'json-schema-to-ts' }, + { defaultImport: 'type { FromSchema }', moduleSpecifier: '@readme/api-core/types' }, { defaultImport: '* as schemas', moduleSpecifier: './schemas' }, ]); diff --git a/packages/api/src/lockfileSchema.ts b/packages/api/src/lockfileSchema.ts index ba59068e..5139c5b8 100644 --- a/packages/api/src/lockfileSchema.ts +++ b/packages/api/src/lockfileSchema.ts @@ -1,4 +1,4 @@ -import type { FromSchema } from 'json-schema-to-ts'; +import type { FromSchema } from '@readme/api-core/types'; import { SupportedLanguages } from './codegen/factory.js'; diff --git a/packages/core/package.json b/packages/core/package.json index 1fb69cc8..524cac28 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -53,6 +53,7 @@ "caseless": "^0.12.0", "datauri": "^4.1.0", "fetch-har": "^11.0.1", + "json-schema-to-ts": "^2.9.2", "json-schema-traverse": "^1.0.0", "lodash.merge": "^4.6.2", "oas": "^23.1.0", diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 3ae94f1a..2bb5778a 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -1,3 +1,5 @@ +export { FromSchema } from 'json-schema-to-ts'; + export interface ConfigOptions { /** * Override the default `fetch` request timeout of 30 seconds. This number should be represented diff --git a/packages/test-utils/sdks/alby/package.json b/packages/test-utils/sdks/alby/package.json index 62587cf9..8ff8d431 100644 --- a/packages/test-utils/sdks/alby/package.json +++ b/packages/test-utils/sdks/alby/package.json @@ -23,8 +23,7 @@ "lint": "tsc --noEmit" }, "dependencies": { - "@readme/api-core": "file:../../../../../core", - "json-schema-to-ts": "^2.9.2" + "@readme/api-core": "file:../../../../../core" }, "devDependencies": { "tsup": "^7.2.0", diff --git a/packages/test-utils/sdks/alby/src/types.ts b/packages/test-utils/sdks/alby/src/types.ts index d1a1a501..c7570eb5 100644 --- a/packages/test-utils/sdks/alby/src/types.ts +++ b/packages/test-utils/sdks/alby/src/types.ts @@ -1,4 +1,4 @@ -import type { FromSchema } from 'json-schema-to-ts'; +import type { FromSchema } from '@readme/api-core/types'; import * as schemas from './schemas'; export type AmqpExternalRulePatch = FromSchema; diff --git a/packages/test-utils/sdks/metrotransit/package.json b/packages/test-utils/sdks/metrotransit/package.json index fa09a7ba..1922637e 100644 --- a/packages/test-utils/sdks/metrotransit/package.json +++ b/packages/test-utils/sdks/metrotransit/package.json @@ -23,8 +23,7 @@ "lint": "tsc --noEmit" }, "dependencies": { - "@readme/api-core": "file:../../../../../core", - "json-schema-to-ts": "^2.9.2" + "@readme/api-core": "file:../../../../../core" }, "devDependencies": { "tsup": "^7.2.0", diff --git a/packages/test-utils/sdks/metrotransit/src/types.ts b/packages/test-utils/sdks/metrotransit/src/types.ts index 7265985e..deae49f8 100644 --- a/packages/test-utils/sdks/metrotransit/src/types.ts +++ b/packages/test-utils/sdks/metrotransit/src/types.ts @@ -1,4 +1,4 @@ -import type { FromSchema } from 'json-schema-to-ts'; +import type { FromSchema } from '@readme/api-core/types'; import * as schemas from './schemas'; export type Agency = FromSchema; diff --git a/packages/test-utils/sdks/operationid-quirks/package.json b/packages/test-utils/sdks/operationid-quirks/package.json index dfd79e10..38df579f 100644 --- a/packages/test-utils/sdks/operationid-quirks/package.json +++ b/packages/test-utils/sdks/operationid-quirks/package.json @@ -19,8 +19,7 @@ "lint": "tsc --noEmit" }, "dependencies": { - "@readme/api-core": "file:../../../../../core", - "json-schema-to-ts": "^2.9.2" + "@readme/api-core": "file:../../../../../core" }, "devDependencies": { "tsup": "^7.2.0", diff --git a/packages/test-utils/sdks/optional-payload/package.json b/packages/test-utils/sdks/optional-payload/package.json index 5aef59e1..cdfb394a 100644 --- a/packages/test-utils/sdks/optional-payload/package.json +++ b/packages/test-utils/sdks/optional-payload/package.json @@ -23,8 +23,7 @@ "lint": "tsc --noEmit" }, "dependencies": { - "@readme/api-core": "file:../../../../../core", - "json-schema-to-ts": "^2.9.2" + "@readme/api-core": "file:../../../../../core" }, "devDependencies": { "tsup": "^7.2.0", diff --git a/packages/test-utils/sdks/optional-payload/src/types.ts b/packages/test-utils/sdks/optional-payload/src/types.ts index 307a1250..4f5597c9 100644 --- a/packages/test-utils/sdks/optional-payload/src/types.ts +++ b/packages/test-utils/sdks/optional-payload/src/types.ts @@ -1,4 +1,4 @@ -import type { FromSchema } from 'json-schema-to-ts'; +import type { FromSchema } from '@readme/api-core/types'; import * as schemas from './schemas'; export type UpdatePetWithFormFormDataParam = FromSchema; diff --git a/packages/test-utils/sdks/petstore/package.json b/packages/test-utils/sdks/petstore/package.json index 68fbf777..6a25f877 100644 --- a/packages/test-utils/sdks/petstore/package.json +++ b/packages/test-utils/sdks/petstore/package.json @@ -24,8 +24,7 @@ "lint": "tsc --noEmit" }, "dependencies": { - "@readme/api-core": "file:../../../../../core", - "json-schema-to-ts": "^2.9.2" + "@readme/api-core": "file:../../../../../core" }, "devDependencies": { "tsup": "^7.2.0", diff --git a/packages/test-utils/sdks/petstore/src/types.ts b/packages/test-utils/sdks/petstore/src/types.ts index 2680bda0..4be4f9f4 100644 --- a/packages/test-utils/sdks/petstore/src/types.ts +++ b/packages/test-utils/sdks/petstore/src/types.ts @@ -1,4 +1,4 @@ -import type { FromSchema } from 'json-schema-to-ts'; +import type { FromSchema } from '@readme/api-core/types'; import * as schemas from './schemas'; export type ApiResponse = FromSchema; diff --git a/packages/test-utils/sdks/readme/package.json b/packages/test-utils/sdks/readme/package.json index d33980c3..5aebd42d 100644 --- a/packages/test-utils/sdks/readme/package.json +++ b/packages/test-utils/sdks/readme/package.json @@ -23,8 +23,7 @@ "lint": "tsc --noEmit" }, "dependencies": { - "@readme/api-core": "file:../../../../../core", - "json-schema-to-ts": "^2.9.2" + "@readme/api-core": "file:../../../../../core" }, "devDependencies": { "tsup": "^7.2.0", diff --git a/packages/test-utils/sdks/readme/src/types.ts b/packages/test-utils/sdks/readme/src/types.ts index 317a54b2..aa8478cd 100644 --- a/packages/test-utils/sdks/readme/src/types.ts +++ b/packages/test-utils/sdks/readme/src/types.ts @@ -1,4 +1,4 @@ -import type { FromSchema } from 'json-schema-to-ts'; +import type { FromSchema } from '@readme/api-core/types'; import * as schemas from './schemas'; export type Apply = FromSchema; diff --git a/packages/test-utils/sdks/response-title-quirks/package.json b/packages/test-utils/sdks/response-title-quirks/package.json index 04bae117..0be9a0f1 100644 --- a/packages/test-utils/sdks/response-title-quirks/package.json +++ b/packages/test-utils/sdks/response-title-quirks/package.json @@ -23,8 +23,7 @@ "lint": "tsc --noEmit" }, "dependencies": { - "@readme/api-core": "file:../../../../../core", - "json-schema-to-ts": "^2.9.2" + "@readme/api-core": "file:../../../../../core" }, "devDependencies": { "tsup": "^7.2.0", diff --git a/packages/test-utils/sdks/response-title-quirks/src/types.ts b/packages/test-utils/sdks/response-title-quirks/src/types.ts index b0ed5649..1445e404 100644 --- a/packages/test-utils/sdks/response-title-quirks/src/types.ts +++ b/packages/test-utils/sdks/response-title-quirks/src/types.ts @@ -1,4 +1,4 @@ -import type { FromSchema } from 'json-schema-to-ts'; +import type { FromSchema } from '@readme/api-core/types'; import * as schemas from './schemas'; export type GetAnythingMetadataParam = FromSchema; diff --git a/packages/test-utils/sdks/simple/package.json b/packages/test-utils/sdks/simple/package.json index c857021f..a0698270 100644 --- a/packages/test-utils/sdks/simple/package.json +++ b/packages/test-utils/sdks/simple/package.json @@ -23,8 +23,7 @@ "lint": "tsc --noEmit" }, "dependencies": { - "@readme/api-core": "file:../../../../../core", - "json-schema-to-ts": "^2.9.2" + "@readme/api-core": "file:../../../../../core" }, "devDependencies": { "tsup": "^7.2.0", diff --git a/packages/test-utils/sdks/simple/src/types.ts b/packages/test-utils/sdks/simple/src/types.ts index 4ea47267..e875be3e 100644 --- a/packages/test-utils/sdks/simple/src/types.ts +++ b/packages/test-utils/sdks/simple/src/types.ts @@ -1,4 +1,4 @@ -import type { FromSchema } from 'json-schema-to-ts'; +import type { FromSchema } from '@readme/api-core/types'; import * as schemas from './schemas'; export type Category = FromSchema; diff --git a/packages/test-utils/sdks/star-trek/package.json b/packages/test-utils/sdks/star-trek/package.json index 6d4333fd..d26d5947 100644 --- a/packages/test-utils/sdks/star-trek/package.json +++ b/packages/test-utils/sdks/star-trek/package.json @@ -23,8 +23,7 @@ "lint": "tsc --noEmit" }, "dependencies": { - "@readme/api-core": "file:../../../../../core", - "json-schema-to-ts": "^2.9.2" + "@readme/api-core": "file:../../../../../core" }, "devDependencies": { "tsup": "^7.2.0", diff --git a/packages/test-utils/sdks/star-trek/src/types.ts b/packages/test-utils/sdks/star-trek/src/types.ts index bba7f622..695c98c3 100644 --- a/packages/test-utils/sdks/star-trek/src/types.ts +++ b/packages/test-utils/sdks/star-trek/src/types.ts @@ -1,4 +1,4 @@ -import type { FromSchema } from 'json-schema-to-ts'; +import type { FromSchema } from '@readme/api-core/types'; import * as schemas from './schemas'; export type AnimalBase = FromSchema;