From 25c97962f4c14c9b946100be4cb133e1483bb7c8 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Tue, 16 Oct 2018 03:47:48 +1100 Subject: Update to TypeScript 3.1 and ts-simple-ast 17 (#980) --- package.json | 4 ++-- tests/error_003_typescript.ts.out | 4 ++-- third_party | 2 +- tools/ts_library_builder/build_library.ts | 6 +++--- tools/ts_library_builder/test.ts | 9 +++------ 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index c25c94ee3..fa3ac670b 100644 --- a/package.json +++ b/package.json @@ -22,10 +22,10 @@ "source-map-support": "^0.5.6", "text-encoding": "0.6.4", "ts-node": "^7.0.1", - "ts-simple-ast": "^16.0.4", + "ts-simple-ast": "^17.0.0", "tslint": "^5.10.0", "tslint-eslint-rules": "^5.3.1", "tslint-no-circular-imports": "^0.5.0", - "typescript": "3.0.3" + "typescript": "3.1.3" } } diff --git a/tests/error_003_typescript.ts.out b/tests/error_003_typescript.ts.out index 438b65609..c0e14c351 100644 --- a/tests/error_003_typescript.ts.out +++ b/tests/error_003_typescript.ts.out @@ -1,7 +1,7 @@ [WILDCARD]tests/error_003_typescript.tsILDCARD] - error TS2552: Cannot find name 'consol'. Did you mean 'console'? -[WILDCARD][0m consol.log("hello world!"); -  ~~~~~~ +[WILDCARD] consol.log("hello world!"); +[WILDCARD]~~~~~~ $asset$/lib.deno_runtime.d.tsILDCARD] [WILDCARD]const console: console.Console; diff --git a/third_party b/third_party index a133fa714..e1a853036 160000 --- a/third_party +++ b/third_party @@ -1 +1 @@ -Subproject commit a133fa714b960d8f88c55188ccc1a41882961e6e +Subproject commit e1a853036189b8694dcc42db4d43433edb6c9036 diff --git a/tools/ts_library_builder/build_library.ts b/tools/ts_library_builder/build_library.ts index 589e26a82..9bd4d4ee5 100644 --- a/tools/ts_library_builder/build_library.ts +++ b/tools/ts_library_builder/build_library.ts @@ -2,12 +2,10 @@ import { writeFileSync } from "fs"; import * as prettier from "prettier"; import { ExpressionStatement, - ModuleKind, - ModuleResolutionKind, NamespaceDeclarationKind, Project, - ScriptTarget, SourceFile, + ts, Type, TypeGuards } from "ts-simple-ast"; @@ -52,6 +50,8 @@ export interface BuildLibraryOptions { silent?: boolean; } +const { ModuleKind, ModuleResolutionKind, ScriptTarget } = ts; + /** * A preamble which is appended to the start of the library. */ diff --git a/tools/ts_library_builder/test.ts b/tools/ts_library_builder/test.ts index e5317b393..b123cb1c5 100644 --- a/tools/ts_library_builder/test.ts +++ b/tools/ts_library_builder/test.ts @@ -2,16 +2,13 @@ // // ./node_modules/.bin/ts-node --project tools/ts_library_builder/tsconfig.json tools/ts_library_builder/test.ts -import { - ModuleKind, - ModuleResolutionKind, - Project, - ScriptTarget -} from "ts-simple-ast"; +import { Project, ts } from "ts-simple-ast"; import { assert, assertEqual, test } from "../../js/testing/testing"; import { flatten, merge } from "./build_library"; import { loadDtsFiles } from "./ast_util"; +const { ModuleKind, ModuleResolutionKind, ScriptTarget } = ts; + /** setups and returns the fixtures for testing */ function setupFixtures() { const basePath = process.cwd(); -- cgit v1.2.3