From e92f85483ae5694e8b38ae0ee97e722ffe6aff7d Mon Sep 17 00:00:00 2001 From: TsvetanMilanov Date: Tue, 8 Nov 2016 12:07:21 +0200 Subject: [PATCH] Update TypeScript to 2.0 Update all TypeScript related dependencies in order to be able to use TypeScript 2.0 --- lib/common | 2 +- lib/declarations.ts | 1 - lib/node-package-manager.ts | 4 ++-- lib/services/analytics-service.ts | 5 +++-- lib/services/plugin-variables-service.ts | 1 - package.json | 8 ++++---- test/project-service.ts | 26 ++++++++++++------------ 7 files changed, 23 insertions(+), 24 deletions(-) diff --git a/lib/common b/lib/common index 550bf55bd7..16a4c64e6f 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 550bf55bd7f3dfdfcb42f8b94b4d905579c9f345 +Subproject commit 16a4c64e6f1ac2c58d21d92a5da11bc73854451c diff --git a/lib/declarations.ts b/lib/declarations.ts index 9d232019b0..490889fb56 100644 --- a/lib/declarations.ts +++ b/lib/declarations.ts @@ -369,4 +369,3 @@ interface IXcprojInfo { */ xcprojAvailable: boolean; } - diff --git a/lib/node-package-manager.ts b/lib/node-package-manager.ts index 300f0538de..75f4d2b602 100644 --- a/lib/node-package-manager.ts +++ b/lib/node-package-manager.ts @@ -120,7 +120,7 @@ export class NodePackageManager implements INodePackageManager { let oldNpmPath: string = undefined; let callback = (err: Error, data: any) => { if (oldNpmPath) { - npm.prefix = oldNpmPath; + (npm).prefix = oldNpmPath; } if (err) { @@ -133,7 +133,7 @@ export class NodePackageManager implements INodePackageManager { if (opts && opts.path) { oldNpmPath = npm.prefix; - npm.prefix = opts.path; + (npm).prefix = opts.path; } let subCommandName: string = opts.subCommandName; diff --git a/lib/services/analytics-service.ts b/lib/services/analytics-service.ts index b8595811c1..563c3b551c 100644 --- a/lib/services/analytics-service.ts +++ b/lib/services/analytics-service.ts @@ -10,8 +10,9 @@ export class AnalyticsService extends AnalyticsServiceBase implements IAnalytics $prompter: IPrompter, $userSettingsService: UserSettings.IUserSettingsService, $analyticsSettingsService: IAnalyticsSettingsService, - $progressIndicator: IProgressIndicator) { - super($logger, $options, $staticConfig, $errors, $prompter, $userSettingsService, $analyticsSettingsService, $progressIndicator); + $progressIndicator: IProgressIndicator, + $osInfo: IOsInfo) { + super($logger, $options, $staticConfig, $errors, $prompter, $userSettingsService, $analyticsSettingsService, $progressIndicator, $osInfo); } protected checkConsentCore(trackFeatureUsage: boolean): IFuture { diff --git a/lib/services/plugin-variables-service.ts b/lib/services/plugin-variables-service.ts index 6ca63155a8..6813c0a423 100644 --- a/lib/services/plugin-variables-service.ts +++ b/lib/services/plugin-variables-service.ts @@ -120,4 +120,3 @@ export class PluginVariablesService implements IPluginVariablesService { } } $injector.register("pluginVariablesService", PluginVariablesService); - diff --git a/package.json b/package.json index b17c3e6360..5cc09027b8 100644 --- a/package.json +++ b/package.json @@ -88,15 +88,15 @@ "grunt-contrib-copy": "1.0.0", "grunt-contrib-watch": "1.0.0", "grunt-shell": "1.3.0", - "grunt-ts": "5.5.1", - "grunt-tslint": "3.1.0", + "grunt-ts": "6.0.0-beta.3", + "grunt-tslint": "3.3.0", "istanbul": "0.4.5", "mocha": "2.5.3", "mocha-fibers": "https://github.com/NativeScript/mocha-fibers.git", "mocha-typescript": "^1.0.4", "should": "7.0.2", - "tslint": "3.11.0", - "typescript": "^1.8.10" + "tslint": "3.15.1", + "typescript": "2.0.7" }, "license": "Apache-2.0", "engines": { diff --git a/test/project-service.ts b/test/project-service.ts index 1dc9547cd1..63dd46448f 100644 --- a/test/project-service.ts +++ b/test/project-service.ts @@ -1,24 +1,24 @@ import * as yok from "../lib/common/yok"; import * as stubs from "./stubs"; import * as constants from "./../lib/constants"; -import {ChildProcess} from "../lib/common/child-process"; +import { ChildProcess } from "../lib/common/child-process"; import * as ProjectServiceLib from "../lib/services/project-service"; -import {ProjectNameService} from "../lib/services/project-name-service"; +import { ProjectNameService } from "../lib/services/project-name-service"; import * as ProjectDataServiceLib from "../lib/services/project-data-service"; import * as ProjectDataLib from "../lib/project-data"; import * as ProjectHelperLib from "../lib/common/project-helper"; -import {StaticConfig} from "../lib/config"; +import { StaticConfig } from "../lib/config"; import * as NpmLib from "../lib/node-package-manager"; -import {NpmInstallationManager} from "../lib/npm-installation-manager"; +import { NpmInstallationManager } from "../lib/npm-installation-manager"; import * as HttpClientLib from "../lib/common/http-client"; -import {FileSystem} from "../lib/common/file-system"; +import { FileSystem } from "../lib/common/file-system"; import * as path from "path"; import temp = require("temp"); -import * as helpers from "../lib/common/helpers"; -import {assert} from "chai"; -import {Options} from "../lib/options"; -import {HostInfo} from "../lib/common/host-info"; -import {ProjectTemplatesService} from "../lib/services/project-templates-service"; +import helpers = require("../lib/common/helpers"); +import { assert } from "chai"; +import { Options } from "../lib/options"; +import { HostInfo } from "../lib/common/host-info"; +import { ProjectTemplatesService } from "../lib/services/project-templates-service"; import Future = require("fibers/future"); let mockProjectNameValidator = { @@ -52,10 +52,10 @@ class ProjectIntegrationTest { let defaultTemplatePath = path.join(cacheRoot, packageName); let latestVersion = npmInstallationManager.getLatestVersion(packageName).wait(); - if(!fs.exists(path.join(defaultTemplatePath, latestVersion)).wait()) { + if (!fs.exists(path.join(defaultTemplatePath, latestVersion)).wait()) { npmInstallationManager.addToCache(packageName, latestVersion).wait(); } - if(!fs.exists(path.join(defaultTemplatePath, latestVersion, "package", "app")).wait()) { + if (!fs.exists(path.join(defaultTemplatePath, latestVersion, "package", "app")).wait()) { npmInstallationManager.cacheUnpack(packageName, latestVersion).wait(); } @@ -461,7 +461,7 @@ describe("project upgrade procedure tests", () => { try { testInjector.resolve("projectData"); // This should trigger upgrade procedure - } catch(err) { + } catch (err) { isErrorThrown = true; let expectedErrorMessage = "No project found at or above '%s' and neither was a --path specified.," + tempFolder; assert.equal(expectedErrorMessage, err.toString());