From b6a87ea061bd292363160a6535962ec348f64d82 Mon Sep 17 00:00:00 2001 From: cmidgley Date: Thu, 26 May 2022 14:52:14 -0400 Subject: [PATCH] Generics and TypeScript limited to 4.6.* --- CHANGELOG.md | 7 +++++++ package.json | 4 ++-- src/transformer/before/visitor/visit-call-expression.ts | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6c10a6..0f68755 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.2.7](https://github.com/wessberg/di-compiler/compare/v2.2.6...v2.2.7) (2022-5-26) + +### Bug fixes + +* Fixed issue with generics to allow `container.register, Service>()`. +* Restricted `typescript` to minor version updates from `~4.6.4` as version 4.7 is currently incompatible. + ## [2.2.6](https://github.com/wessberg/di-compiler/compare/v2.2.5...v2.2.6) (2021-11-19) diff --git a/package.json b/package.json index e6126ba..504929d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wessberg/di-compiler", - "version": "2.2.6", + "version": "2.2.7", "description": "A Custom Transformer for Typescript that enables compile-time Dependency Injection", "scripts": { "generate:sandhog": "sandhog all --yes", @@ -76,7 +76,7 @@ "crosspath": "^1.0.0", "ts-node": "^10.8.0", "npm-check-updates": "^13.0.3", - "typescript": "^4.6.4", + "typescript": "~4.6.4", "typescript-3-4-1": "npm:typescript@3.4.1", "typescript-3-5-1": "npm:typescript@3.5.1", "typescript-3-6-2": "npm:typescript@3.6.2", diff --git a/src/transformer/before/visitor/visit-call-expression.ts b/src/transformer/before/visitor/visit-call-expression.ts index b977870..5c16bd0 100644 --- a/src/transformer/before/visitor/visit-call-expression.ts +++ b/src/transformer/before/visitor/visit-call-expression.ts @@ -44,7 +44,7 @@ export function visitCallExpression( factory.createPropertyAssignment( "identifier", factory.createStringLiteral( - node.typeArguments[0].getFullText().trim() + node.typeArguments[0].getFirstToken()!.getFullText().trim() ) ), ]),