[Pkg-javascript-commits] [node-typescript] 01/03: New upstream version 2.1.6

Julien Puydt julien.puydt at laposte.net
Tue Feb 14 06:25:33 UTC 2017


This is an automated email from the git hooks/post-receive script.

jpuydt-guest pushed a commit to branch master
in repository node-typescript.

commit 060bb7631c0584734ffe63ea4dcba607a1d31612
Author: Julien Puydt <julien.puydt at laposte.net>
Date:   Tue Feb 14 07:20:16 2017 +0100

    New upstream version 2.1.6
---
 .travis.yml                                     |  1 -
 lib/tsc.js                                      |  7 +++++--
 lib/tsserver.js                                 |  7 +++++--
 lib/tsserverlibrary.d.ts                        |  2 +-
 lib/tsserverlibrary.js                          |  7 +++++--
 lib/typescript.d.ts                             |  2 +-
 lib/typescript.js                               | 10 ++++++++--
 lib/typescriptServices.d.ts                     |  2 +-
 lib/typescriptServices.js                       | 10 ++++++++--
 lib/typingsInstaller.js                         | 16 ++++++++++++----
 package.json                                    |  2 +-
 src/compiler/core.ts                            |  2 +-
 src/compiler/sys.ts                             |  9 ++++++++-
 src/harness/unittests/typingsInstaller.ts       | 18 ++++++++++--------
 src/server/typingsInstaller/typingsInstaller.ts | 10 ++++++++--
 15 files changed, 74 insertions(+), 31 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 08bd781..92d6665 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,7 +22,6 @@ install:
   - npm uninstall typescript
   - npm uninstall tslint
   - npm install
-  - npm update
 
 cache:
   directories:
diff --git a/lib/tsc.js b/lib/tsc.js
index dfe001b..5146a0c 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -132,7 +132,7 @@ var ts;
 })(ts || (ts = {}));
 var ts;
 (function (ts) {
-    ts.version = "2.1.5";
+    ts.version = "2.1.6";
 })(ts || (ts = {}));
 (function (ts) {
     var createObject = Object.create;
@@ -2256,7 +2256,7 @@ var ts;
                 },
                 watchDirectory: function (directoryName, callback, recursive) {
                     var options;
-                    if (!directoryExists(directoryName)) {
+                    if (!directoryExists(directoryName) || (isUNCPath(directoryName) && process.platform === "win32")) {
                         return noOpFileWatcher;
                     }
                     if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) {
@@ -2271,6 +2271,9 @@ var ts;
                         }
                         ;
                     });
+                    function isUNCPath(s) {
+                        return s.length > 2 && s.charCodeAt(0) === 47 && s.charCodeAt(1) === 47;
+                    }
                 },
                 resolvePath: function (path) {
                     return _path.resolve(path);
diff --git a/lib/tsserver.js b/lib/tsserver.js
index dc8c627..be80ac4 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -137,7 +137,7 @@ var ts;
 })(ts || (ts = {}));
 var ts;
 (function (ts) {
-    ts.version = "2.1.5";
+    ts.version = "2.1.6";
 })(ts || (ts = {}));
 (function (ts) {
     var createObject = Object.create;
@@ -2261,7 +2261,7 @@ var ts;
                 },
                 watchDirectory: function (directoryName, callback, recursive) {
                     var options;
-                    if (!directoryExists(directoryName)) {
+                    if (!directoryExists(directoryName) || (isUNCPath(directoryName) && process.platform === "win32")) {
                         return noOpFileWatcher;
                     }
                     if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) {
@@ -2276,6 +2276,9 @@ var ts;
                         }
                         ;
                     });
+                    function isUNCPath(s) {
+                        return s.length > 2 && s.charCodeAt(0) === 47 && s.charCodeAt(1) === 47;
+                    }
                 },
                 resolvePath: function (path) {
                     return _path.resolve(path);
diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts
index 3b0cfc1..e155a24 100644
--- a/lib/tsserverlibrary.d.ts
+++ b/lib/tsserverlibrary.d.ts
@@ -3584,7 +3584,7 @@ declare namespace ts.performance {
     function disable(): void;
 }
 declare namespace ts {
-    const version = "2.1.5";
+    const version = "2.1.6";
 }
 declare namespace ts {
     const enum Ternary {
diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js
index 7d565bf..0c15abb 100644
--- a/lib/tsserverlibrary.js
+++ b/lib/tsserverlibrary.js
@@ -137,7 +137,7 @@ var ts;
 })(ts || (ts = {}));
 var ts;
 (function (ts) {
-    ts.version = "2.1.5";
+    ts.version = "2.1.6";
 })(ts || (ts = {}));
 (function (ts) {
     var createObject = Object.create;
@@ -2261,7 +2261,7 @@ var ts;
                 },
                 watchDirectory: function (directoryName, callback, recursive) {
                     var options;
-                    if (!directoryExists(directoryName)) {
+                    if (!directoryExists(directoryName) || (isUNCPath(directoryName) && process.platform === "win32")) {
                         return noOpFileWatcher;
                     }
                     if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) {
@@ -2276,6 +2276,9 @@ var ts;
                         }
                         ;
                     });
+                    function isUNCPath(s) {
+                        return s.length > 2 && s.charCodeAt(0) === 47 && s.charCodeAt(1) === 47;
+                    }
                 },
                 resolvePath: function (path) {
                     return _path.resolve(path);
diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts
index 5f4a696..c6f3587 100644
--- a/lib/typescript.d.ts
+++ b/lib/typescript.d.ts
@@ -2148,7 +2148,7 @@ declare namespace ts {
 }
 declare namespace ts {
     /** The version of the TypeScript compiler release */
-    const version = "2.1.5";
+    const version = "2.1.6";
 }
 declare namespace ts {
     type FileWatcherCallback = (fileName: string, removed?: boolean) => void;
diff --git a/lib/typescript.js b/lib/typescript.js
index 9780442..6f78768 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -1186,7 +1186,7 @@ var ts;
 var ts;
 (function (ts) {
     /** The version of the TypeScript compiler release */
-    ts.version = "2.1.5";
+    ts.version = "2.1.6";
 })(ts || (ts = {}));
 /* @internal */
 (function (ts) {
@@ -3688,7 +3688,10 @@ var ts;
                     // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
                     // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
                     var options;
-                    if (!directoryExists(directoryName)) {
+                    if (!directoryExists(directoryName) || (isUNCPath(directoryName) && process.platform === "win32")) {
+                        // do nothing if either 
+                        // - target folder does not exist
+                        // - this is UNC path on Windows (https://github.com/Microsoft/TypeScript/issues/13874)
                         return noOpFileWatcher;
                     }
                     if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) {
@@ -3707,6 +3710,9 @@ var ts;
                         }
                         ;
                     });
+                    function isUNCPath(s) {
+                        return s.length > 2 && s.charCodeAt(0) === 47 /* slash */ && s.charCodeAt(1) === 47 /* slash */;
+                    }
                 },
                 resolvePath: function (path) {
                     return _path.resolve(path);
diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts
index 90f148a..2a9648d 100644
--- a/lib/typescriptServices.d.ts
+++ b/lib/typescriptServices.d.ts
@@ -2148,7 +2148,7 @@ declare namespace ts {
 }
 declare namespace ts {
     /** The version of the TypeScript compiler release */
-    const version = "2.1.5";
+    const version = "2.1.6";
 }
 declare namespace ts {
     type FileWatcherCallback = (fileName: string, removed?: boolean) => void;
diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js
index 9780442..6f78768 100644
--- a/lib/typescriptServices.js
+++ b/lib/typescriptServices.js
@@ -1186,7 +1186,7 @@ var ts;
 var ts;
 (function (ts) {
     /** The version of the TypeScript compiler release */
-    ts.version = "2.1.5";
+    ts.version = "2.1.6";
 })(ts || (ts = {}));
 /* @internal */
 (function (ts) {
@@ -3688,7 +3688,10 @@ var ts;
                     // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
                     // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
                     var options;
-                    if (!directoryExists(directoryName)) {
+                    if (!directoryExists(directoryName) || (isUNCPath(directoryName) && process.platform === "win32")) {
+                        // do nothing if either 
+                        // - target folder does not exist
+                        // - this is UNC path on Windows (https://github.com/Microsoft/TypeScript/issues/13874)
                         return noOpFileWatcher;
                     }
                     if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) {
@@ -3707,6 +3710,9 @@ var ts;
                         }
                         ;
                     });
+                    function isUNCPath(s) {
+                        return s.length > 2 && s.charCodeAt(0) === 47 /* slash */ && s.charCodeAt(1) === 47 /* slash */;
+                    }
                 },
                 resolvePath: function (path) {
                     return _path.resolve(path);
diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js
index f8e9b9a..0f6cec6 100644
--- a/lib/typingsInstaller.js
+++ b/lib/typingsInstaller.js
@@ -137,7 +137,7 @@ var ts;
 })(ts || (ts = {}));
 var ts;
 (function (ts) {
-    ts.version = "2.1.5";
+    ts.version = "2.1.6";
 })(ts || (ts = {}));
 (function (ts) {
     var createObject = Object.create;
@@ -2261,7 +2261,7 @@ var ts;
                 },
                 watchDirectory: function (directoryName, callback, recursive) {
                     var options;
-                    if (!directoryExists(directoryName)) {
+                    if (!directoryExists(directoryName) || (isUNCPath(directoryName) && process.platform === "win32")) {
                         return noOpFileWatcher;
                     }
                     if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) {
@@ -2276,6 +2276,9 @@ var ts;
                         }
                         ;
                     });
+                    function isUNCPath(s) {
+                        return s.length > 2 && s.charCodeAt(0) === 47 && s.charCodeAt(1) === 47;
+                    }
                 },
                 resolvePath: function (path) {
                     return _path.resolve(path);
@@ -7044,8 +7047,7 @@ var ts;
                         this.log.writeLine("Installing typings " + JSON.stringify(typingsToInstall));
                     }
                     var filteredTypings = this.filterTypings(typingsToInstall);
-                    var scopedTypings = filteredTypings.map(function (x) { return "@types/" + x; });
-                    if (scopedTypings.length === 0) {
+                    if (filteredTypings.length === 0) {
                         if (this.log.isEnabled()) {
                             this.log.writeLine("All typings are known to be missing or invalid - no need to go any further");
                         }
@@ -7060,6 +7062,7 @@ var ts;
                         typingsInstallerVersion: ts.version,
                         projectName: req.projectName
                     });
+                    var scopedTypings = filteredTypings.map(typingsName);
                     this.installTypingsAsync(requestId, scopedTypings, cachePath, function (ok) {
                         try {
                             if (!ok) {
@@ -7170,6 +7173,11 @@ var ts;
                 return TypingsInstaller;
             }());
             typingsInstaller.TypingsInstaller = TypingsInstaller;
+            function typingsName(packageName) {
+                return "@types/" + packageName + "@ts" + versionMajorMinor;
+            }
+            typingsInstaller.typingsName = typingsName;
+            var versionMajorMinor = ts.version.split(".").slice(0, 2).join(".");
         })(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {}));
     })(server = ts.server || (ts.server = {}));
 })(ts || (ts = {}));
diff --git a/package.json b/package.json
index c27e428..e2b04e3 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
     "name": "typescript",
     "author": "Microsoft Corp.",
     "homepage": "http://typescriptlang.org/",
-    "version": "2.1.5",
+    "version": "2.1.6",
     "license": "Apache-2.0",
     "description": "TypeScript is a language for application scale JavaScript development",
     "keywords": [
diff --git a/src/compiler/core.ts b/src/compiler/core.ts
index 8a9d357..6d1ff23 100644
--- a/src/compiler/core.ts
+++ b/src/compiler/core.ts
@@ -3,7 +3,7 @@
 
 namespace ts {
     /** The version of the TypeScript compiler release */
-    export const version = "2.1.5";
+    export const version = "2.1.6";
 }
 
 /* @internal */
diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts
index a1e82a6..7c74de2 100644
--- a/src/compiler/sys.ts
+++ b/src/compiler/sys.ts
@@ -479,7 +479,10 @@ namespace ts {
                     // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
                     // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
                     let options: any;
-                    if (!directoryExists(directoryName)) {
+                    if (!directoryExists(directoryName) || (isUNCPath(directoryName) && process.platform === "win32")) {
+                        // do nothing if either 
+                        // - target folder does not exist
+                        // - this is UNC path on Windows (https://github.com/Microsoft/TypeScript/issues/13874)
                         return noOpFileWatcher;
                     }
 
@@ -503,6 +506,10 @@ namespace ts {
                             };
                         }
                     );
+
+                    function isUNCPath(s: string): boolean {
+                        return s.length > 2 && s.charCodeAt(0) === CharacterCodes.slash && s.charCodeAt(1) === CharacterCodes.slash;
+                    }
                 },
                 resolvePath: function(path: string): string {
                     return _path.resolve(path);
diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts
index 62d2f7a..12bd60b 100644
--- a/src/harness/unittests/typingsInstaller.ts
+++ b/src/harness/unittests/typingsInstaller.ts
@@ -44,6 +44,8 @@ namespace ts.projectSystem {
         });
     }
 
+    import typingsName = server.typingsInstaller.typingsName;
+
     describe("typingsInstaller", () => {
         it("configured projects (typings installed) 1", () => {
             const file1 = {
@@ -519,32 +521,32 @@ namespace ts.projectSystem {
             const commander = {
                 path: "/a/data/node_modules/@types/commander/index.d.ts",
                 content: "declare const commander: { x: number }",
-                typings: "@types/commander"
+                typings: typingsName("commander")
             };
             const jquery = {
                 path: "/a/data/node_modules/@types/jquery/index.d.ts",
                 content: "declare const jquery: { x: number }",
-                typings: "@types/jquery"
+                typings: typingsName("jquery")
             };
             const lodash = {
                 path: "/a/data/node_modules/@types/lodash/index.d.ts",
                 content: "declare const lodash: { x: number }",
-                typings: "@types/lodash"
+                typings: typingsName("lodash")
             };
             const cordova = {
                 path: "/a/data/node_modules/@types/cordova/index.d.ts",
                 content: "declare const cordova: { x: number }",
-                typings: "@types/cordova"
+                typings: typingsName("cordova")
             };
             const grunt = {
                 path: "/a/data/node_modules/@types/grunt/index.d.ts",
                 content: "declare const grunt: { x: number }",
-                typings: "@types/grunt"
+                typings: typingsName("grunt")
             };
             const gulp = {
                 path: "/a/data/node_modules/@types/gulp/index.d.ts",
                 content: "declare const gulp: { x: number }",
-                typings: "@types/gulp"
+                typings: typingsName("gulp")
             };
 
             const host = createServerHost([lodashJs, commanderJs, file3]);
@@ -554,7 +556,7 @@ namespace ts.projectSystem {
                 }
                 installWorker(_requestId: number, args: string[], _cwd: string, cb: TI.RequestCompletedAction): void {
                     let typingFiles: (FileOrFolder & { typings: string })[] = [];
-                    if (args.indexOf("@types/commander") >= 0) {
+                    if (args.indexOf(typingsName("commander")) >= 0) {
                         typingFiles = [commander, jquery, lodash, cordova];
                     }
                     else {
@@ -982,7 +984,7 @@ namespace ts.projectSystem {
                         return;
                     }
                     if (response.kind === server.EventEndInstallTypes) {
-                        assert.deepEqual(response.packagesToInstall, ["@types/commander"]);
+                        assert.deepEqual(response.packagesToInstall, [typingsName("commander")]);
                         seenTelemetryEvent = true;
                         return;
                     }
diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts
index 7a09c1f..e723146 100644
--- a/src/server/typingsInstaller/typingsInstaller.ts
+++ b/src/server/typingsInstaller/typingsInstaller.ts
@@ -295,8 +295,7 @@ namespace ts.server.typingsInstaller {
                 this.log.writeLine(`Installing typings ${JSON.stringify(typingsToInstall)}`);
             }
             const filteredTypings = this.filterTypings(typingsToInstall);
-            const scopedTypings = filteredTypings.map(x => `@types/${x}`);
-            if (scopedTypings.length === 0) {
+            if (filteredTypings.length === 0) {
                 if (this.log.isEnabled()) {
                     this.log.writeLine(`All typings are known to be missing or invalid - no need to go any further`);
                 }
@@ -316,6 +315,7 @@ namespace ts.server.typingsInstaller {
                 projectName: req.projectName
             });
 
+            const scopedTypings = filteredTypings.map(typingsName);
             this.installTypingsAsync(requestId, scopedTypings, cachePath, ok => {
                 try {
                     if (!ok) {
@@ -429,4 +429,10 @@ namespace ts.server.typingsInstaller {
         protected abstract installWorker(requestId: number, args: string[], cwd: string, onRequestCompleted: RequestCompletedAction): void;
         protected abstract sendResponse(response: SetTypings | InvalidateCachedTypings | BeginInstallTypes | EndInstallTypes): void;
     }
+
+    /* @internal */
+    export function typingsName(packageName: string): string {
+        return `@types/${packageName}@ts${versionMajorMinor}`;
+    }
+    const versionMajorMinor = version.split(".").slice(0, 2).join(".");
 }
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-typescript.git



More information about the Pkg-javascript-commits mailing list