Skip to content

Commit

Permalink
Merge branch 'tsserverVS-WIP' of https://github.com/Microsoft/TypeScript
Browse files Browse the repository at this point in the history
 into compileOnSave0
  • Loading branch information
zhengbli committed Aug 22, 2016
2 parents 2a021bd + 41b61cb commit 54f5c72
Show file tree
Hide file tree
Showing 438 changed files with 14,502 additions and 31,082 deletions.
28 changes: 21 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,33 @@ node_js:

sudo: false

os:
- linux
- osx
env:
- workerCount=3

matrix:
fast_finish: true
exclude:
include:
- os: osx
node_js: '4'
node_js: stable
osx_image: xcode7.3
env: workerCount=2
allow_failures:
- os: osx
node_js: '0.10'

branches:
only:
- master
- transforms
- transforms

install:
- npm uninstall typescript
- npm uninstall tslint
- npm install
- npm update

cache:
directories:
- node_modules

git:
depth: 1
226 changes: 125 additions & 101 deletions Gulpfile.ts

Large diffs are not rendered by default.

531 changes: 293 additions & 238 deletions Jakefile.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[![Join the chat at https://gitter.im/Microsoft/TypeScript](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Microsoft/TypeScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[TypeScript](http://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types, classes, and modules to JavaScript. TypeScript supports tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](http://www.typescriptlang.org/Playground), and stay up to date via [our blog](http://blogs.msdn.com/typescript) and [Twitter account](https://twitter.com/typescriptlang).
[TypeScript](http://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types, classes, and modules to JavaScript. TypeScript supports tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](http://www.typescriptlang.org/Playground), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescriptlang).

## Installing

Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
},
"devDependencies": {
"@types/browserify": "latest",
"@types/convert-source-map": "latest",
"@types/chai": "latest",
"@types/convert-source-map": "latest",
"@types/del": "latest",
"@types/glob": "latest",
"@types/gulp": "latest",
Expand Down Expand Up @@ -69,16 +69,18 @@
"mkdirp": "latest",
"mocha": "latest",
"mocha-fivemat-progress-reporter": "latest",
"q": "latest",
"run-sequence": "latest",
"sorcery": "latest",
"through2": "latest",
"travis-fold": "latest",
"ts-node": "latest",
"tslint": "next",
"typescript": "next"
},
"scripts": {
"pretest": "jake tests",
"test": "jake runtests",
"test": "jake runtests-parallel",
"build": "npm run build:compiler && npm run build:tests",
"build:compiler": "jake local",
"build:tests": "jake tests",
Expand Down
2 changes: 1 addition & 1 deletion scripts/ior.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../src/harness/external/node.d.ts" />
/// <reference types="node"/>

import fs = require('fs');
import path = require('path');
Expand Down
45 changes: 45 additions & 0 deletions scripts/parallel-lint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
var Linter = require("tslint");
var fs = require("fs");

function getLinterOptions() {
return {
configuration: require("../tslint.json"),
formatter: "prose",
formattersDirectory: undefined,
rulesDirectory: "built/local/tslint"
};
}

function lintFileContents(options, path, contents) {
var ll = new Linter(path, contents, options);
return ll.lint();
}

function lintFileAsync(options, path, cb) {
fs.readFile(path, "utf8", function (err, contents) {
if (err) {
return cb(err);
}
var result = lintFileContents(options, path, contents);
cb(undefined, result);
});
}

process.on("message", function (data) {
switch (data.kind) {
case "file":
var target = data.name;
var lintOptions = getLinterOptions();
lintFileAsync(lintOptions, target, function (err, result) {
if (err) {
process.send({ kind: "error", error: err.toString() });
return;
}
process.send({ kind: "result", failures: result.failureCount, output: result.output });
});
break;
case "close":
process.exit(0);
break;
}
});
2 changes: 1 addition & 1 deletion scripts/processDiagnosticMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function checkForUniqueCodes(messages: string[], diagnosticTable: InputDiagnosti
}

function buildUniqueNameMap(names: string[]): ts.Map<string> {
var nameMap: ts.Map<string> = {};
var nameMap = ts.createMap<string>();

var uniqueNames = NameGenerator.ensureUniqueness(names, /* isCaseSensitive */ false, /* isFixed */ undefined);

Expand Down
13 changes: 6 additions & 7 deletions scripts/tslint/preferConstRule.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as Lint from "tslint/lib/lint";
import * as ts from "typescript";


export class Rule extends Lint.Rules.AbstractRule {
public static FAILURE_STRING_FACTORY = (identifier: string) => `Identifier '${identifier}' never appears on the LHS of an assignment - use const instead of let for its declaration.`;

Expand Down Expand Up @@ -64,7 +63,7 @@ interface DeclarationUsages {
}

class PreferConstWalker extends Lint.RuleWalker {
private inScopeLetDeclarations: ts.Map<DeclarationUsages>[] = [];
private inScopeLetDeclarations: ts.MapLike<DeclarationUsages>[] = [];
private errors: Lint.RuleFailure[] = [];
private markAssignment(identifier: ts.Identifier) {
const name = identifier.text;
Expand Down Expand Up @@ -172,7 +171,7 @@ class PreferConstWalker extends Lint.RuleWalker {
}

private visitAnyForStatement(node: ts.ForOfStatement | ts.ForInStatement) {
const names: ts.Map<DeclarationUsages> = {};
const names: ts.MapLike<DeclarationUsages> = {};
if (isLet(node.initializer)) {
if (node.initializer.kind === ts.SyntaxKind.VariableDeclarationList) {
this.collectLetIdentifiers(node.initializer as ts.VariableDeclarationList, names);
Expand All @@ -194,7 +193,7 @@ class PreferConstWalker extends Lint.RuleWalker {
}

visitBlock(node: ts.Block) {
const names: ts.Map<DeclarationUsages> = {};
const names: ts.MapLike<DeclarationUsages> = {};
for (const statement of node.statements) {
if (statement.kind === ts.SyntaxKind.VariableStatement) {
this.collectLetIdentifiers((statement as ts.VariableStatement).declarationList, names);
Expand All @@ -205,15 +204,15 @@ class PreferConstWalker extends Lint.RuleWalker {
this.popDeclarations();
}

private collectLetIdentifiers(list: ts.VariableDeclarationList, ret: ts.Map<DeclarationUsages>) {
private collectLetIdentifiers(list: ts.VariableDeclarationList, ret: ts.MapLike<DeclarationUsages>) {
for (const node of list.declarations) {
if (isLet(node) && !isExported(node)) {
this.collectNameIdentifiers(node, node.name, ret);
}
}
}

private collectNameIdentifiers(declaration: ts.VariableDeclaration, node: ts.Identifier | ts.BindingPattern, table: ts.Map<DeclarationUsages>) {
private collectNameIdentifiers(declaration: ts.VariableDeclaration, node: ts.Identifier | ts.BindingPattern, table: ts.MapLike<DeclarationUsages>) {
if (node.kind === ts.SyntaxKind.Identifier) {
table[(node as ts.Identifier).text] = { declaration, usages: 0 };
}
Expand All @@ -222,7 +221,7 @@ class PreferConstWalker extends Lint.RuleWalker {
}
}

private collectBindingPatternIdentifiers(value: ts.VariableDeclaration, pattern: ts.BindingPattern, table: ts.Map<DeclarationUsages>) {
private collectBindingPatternIdentifiers(value: ts.VariableDeclaration, pattern: ts.BindingPattern, table: ts.MapLike<DeclarationUsages>) {
for (const element of pattern.elements) {
this.collectNameIdentifiers(value, element.name, table);
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/types/ambient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ declare module "gulp-insert" {
export function append(text: string | Buffer): NodeJS.ReadWriteStream;
export function prepend(text: string | Buffer): NodeJS.ReadWriteStream;
export function wrap(text: string | Buffer, tail: string | Buffer): NodeJS.ReadWriteStream;
export function transform(cb: (contents: string, file: {path: string}) => string): NodeJS.ReadWriteStream; // file is a vinyl file
export function transform(cb: (contents: string, file: {path: string, relative: string}) => string): NodeJS.ReadWriteStream; // file is a vinyl file
}

declare module "into-stream" {
Expand All @@ -22,3 +22,4 @@ declare module "into-stream" {
}

declare module "sorcery";
declare module "travis-fold";
Loading

0 comments on commit 54f5c72

Please sign in to comment.