From d319384ee86a8d893ff26008087e6838d50a9373 Mon Sep 17 00:00:00 2001 From: Mihails Akimenko Date: Fri, 27 Dec 2019 13:21:47 +0200 Subject: [PATCH] #161: TS1086: An accessor cannot be declared in an ambient context. - Upgrade to Typescript 3.7.4 + workarounds - angularCompilerOptions.disableTypeScriptVersionCheck=true - added polyfills.ts: __importDefault --- package-lock.json | 12 +++++++++--- package.json | 2 +- projects/atft/package.json | 2 +- projects/atft/tsconfig.lib.json | 3 ++- src/polyfills.ts | 6 ++++++ tsconfig.json | 3 +++ 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 68d40865..a5773e94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -247,6 +247,12 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", "dev": true + }, + "typescript": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", + "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", + "dev": true } } }, @@ -18363,9 +18369,9 @@ "dev": true }, "typescript": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", - "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz", + "integrity": "sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==", "dev": true }, "ua-parser-js": { diff --git a/package.json b/package.json index a4ffa081..265e71aa 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,6 @@ "tsickle": "^0.37.1", "tslib": "^1.10.0", "tslint": "^5.20.1", - "typescript": "3.5.3" + "typescript": "3.7.4" } } diff --git a/projects/atft/package.json b/projects/atft/package.json index 0c9e7d64..4451629e 100644 --- a/projects/atft/package.json +++ b/projects/atft/package.json @@ -35,7 +35,7 @@ "peerDependencies": { "@angular/common": "^8.2.2", "@angular/core": "^8.2.2", - "three": "^0.110.0" + "three": "^0.112.0" }, "dependencies": {}, "engines": { diff --git a/projects/atft/tsconfig.lib.json b/projects/atft/tsconfig.lib.json index 9e13bb74..dabad9e1 100644 --- a/projects/atft/tsconfig.lib.json +++ b/projects/atft/tsconfig.lib.json @@ -25,7 +25,8 @@ "strictMetadataEmit": true, "fullTemplateTypeCheck": true, "strictInjectionParameters": true, - "enableResourceInlining": true + "enableResourceInlining": true, + "disableTypeScriptVersionCheck": true }, "exclude": [ "src/test.ts", diff --git a/src/polyfills.ts b/src/polyfills.ts index a52807b4..180d8b2b 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -32,3 +32,9 @@ import 'zone.js/dist/zone'; // Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS */ + +// TODO: Remove when Angular will support typescript 3.7+ +// @ts-ignore +window.__importDefault = function(mod) { + return mod && mod.__esModule ? mod : { default: mod }; +}; diff --git a/tsconfig.json b/tsconfig.json index 9b20ce98..1c36372e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -35,5 +35,8 @@ "node_modules/core-js/proposals/reflect-metadata" ] } + }, + "angularCompilerOptions": { + "disableTypeScriptVersionCheck": true } }