From 3e0198118d0d76e1812f132e1f0ba83609a6b1f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20R=C3=A4ntil=C3=A4?= Date: Sat, 18 Jun 2022 11:25:37 +0200 Subject: [PATCH] feat(typescript): bumped to TypeScript 4.7 BREAKING CHANGE: TypeScript 4.6 has a breaking API (and ABI) surface --- lib/json-schema-to-suretype.ts | 8 +++++++- package.json | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/json-schema-to-suretype.ts b/lib/json-schema-to-suretype.ts index ac34639..00b140a 100644 --- a/lib/json-schema-to-suretype.ts +++ b/lib/json-schema-to-suretype.ts @@ -350,6 +350,8 @@ function createImportHeader( annotate: boolean ) { + const hasNonTypeImport = regular || raw || compile || annotate; + const importedMembers = [ ...( regular ? [ 'suretype', 'v' ] : [ ] ), ...( raw ? [ 'raw' ] : [ ] ), @@ -358,7 +360,11 @@ function createImportHeader( ...( TypeOf ? [ 'TypeOf' ] : [ ] ), ] .map( name => - factory.createImportSpecifier( undefined, t.ident( name ) ) + factory.createImportSpecifier( + !hasNonTypeImport, + undefined, + t.ident( name ) + ) ); return factory.createImportDeclaration( undefined, // decorators diff --git a/package.json b/package.json index ed6c0c5..d986779 100644 --- a/package.json +++ b/package.json @@ -40,14 +40,14 @@ "dependencies": { "@types/json-schema": "^7.0.9", "core-types": "^1.10.0", - "core-types-json-schema": "^1.6.2", - "core-types-ts": "^1.5.0", + "core-types-json-schema": "^1.6.3", + "core-types-ts": "^2.0.0", "json-schema-cycles": "^1.1.0", "jsonpos": "^1.1.0", "openapi-json-schema": "^1.1.3", "suretype": "^2.4.1", "toposort": "^2.0.2", - "typescript": "^4.4.3" + "typescript": "^4.7.4" }, "devDependencies": { "@types/jest": "^27.0.1",