Skip to content

Commit b2f49cc

Browse files
committed
Merge branch 'master' into optionsDescription
2 parents d78e5a1 + a71879c commit b2f49cc

File tree

482 files changed

+3683
-5245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

482 files changed

+3683
-5245
lines changed

Gulpfile.ts

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import * as cp from "child_process";
33
import * as path from "path";
44
import * as fs from "fs";
5+
import child_process = require("child_process");
56
import originalGulp = require("gulp");
67
import helpMaker = require("gulp-help");
78
import runSequence = require("run-sequence");
@@ -749,7 +750,7 @@ gulp.task("browserify", "Runs browserify on run.js to produce a file suitable fo
749750
const originalMap = file.sourceMap;
750751
const prebundledContent = file.contents.toString();
751752
// Make paths absolute to help sorcery deal with all the terrible paths being thrown around
752-
originalMap.sources = originalMap.sources.map(s => path.resolve(s));
753+
originalMap.sources = originalMap.sources.map(s => path.resolve(path.join("src/harness", s)));
753754
// intoStream (below) makes browserify think the input file is named this, so this is what it puts in the sourcemap
754755
originalMap.file = "built/local/_stream_0.js";
755756

@@ -1019,40 +1020,16 @@ function spawnLintWorker(files: {path: string}[], callback: (failures: number) =
10191020
}
10201021

10211022
gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are: --f[iles]=regex", ["build-rules"], () => {
1022-
const fileMatcher = RegExp(cmdLineOptions["files"]);
10231023
if (fold.isTravis()) console.log(fold.start("lint"));
1024-
1025-
let files: {stat: fs.Stats, path: string}[] = [];
1026-
return gulp.src(lintTargets, { read: false })
1027-
.pipe(through2.obj((chunk, enc, cb) => {
1028-
files.push(chunk);
1029-
cb();
1030-
}, (cb) => {
1031-
files = files.filter(file => fileMatcher.test(file.path)).sort((filea, fileb) => filea.stat.size - fileb.stat.size);
1032-
const workerCount = cmdLineOptions["workers"];
1033-
for (let i = 0; i < workerCount; i++) {
1034-
spawnLintWorker(files, finished);
1035-
}
1036-
1037-
let completed = 0;
1038-
let failures = 0;
1039-
function finished(fails) {
1040-
completed++;
1041-
failures += fails;
1042-
if (completed === workerCount) {
1043-
if (fold.isTravis()) console.log(fold.end("lint"));
1044-
if (failures > 0) {
1045-
throw new Error(`Linter errors: ${failures}`);
1046-
}
1047-
else {
1048-
cb();
1049-
}
1050-
}
1051-
}
1052-
}));
1024+
const fileMatcher = cmdLineOptions["files"];
1025+
const files = fileMatcher
1026+
? `src/**/${fileMatcher}`
1027+
: "Gulpfile.ts 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated.d.ts'";
1028+
const cmd = `node node_modules/tslint/bin/tslint ${files} --format stylish`;
1029+
console.log("Linting: " + cmd);
1030+
child_process.execSync(cmd, { stdio: [0, 1, 2] });
10531031
});
10541032

1055-
10561033
gulp.task("default", "Runs 'local'", ["local"]);
10571034

10581035
gulp.task("watch", "Watches the src/ directory for changes and executes runtests-parallel.", [], () => {

Jakefile.js

Lines changed: 15 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts
330330
options += " --lib " + opts.lib
331331
}
332332
else {
333-
options += " --lib es5,scripthost"
333+
options += " --lib es5"
334334
}
335335
options += " --noUnusedLocals --noUnusedParameters";
336336

@@ -584,13 +584,13 @@ var cancellationTokenFile = path.join(builtLocalDirectory, "cancellationToken.js
584584
compileFile(cancellationTokenFile, cancellationTokenSources, [builtLocalDirectory].concat(cancellationTokenSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true, { types: ["node"], outDir: builtLocalDirectory, noOutFile: true, lib: "es6" });
585585

586586
var typingsInstallerFile = path.join(builtLocalDirectory, "typingsInstaller.js");
587-
compileFile(typingsInstallerFile, typingsInstallerSources, [builtLocalDirectory].concat(typingsInstallerSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true, { types: ["node"], outDir: builtLocalDirectory, noOutFile: false, lib: "es6,scripthost" });
587+
compileFile(typingsInstallerFile, typingsInstallerSources, [builtLocalDirectory].concat(typingsInstallerSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true, { types: ["node"], outDir: builtLocalDirectory, noOutFile: false, lib: "es6" });
588588

589589
var watchGuardFile = path.join(builtLocalDirectory, "watchGuard.js");
590590
compileFile(watchGuardFile, watchGuardSources, [builtLocalDirectory].concat(watchGuardSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true, { types: ["node"], outDir: builtLocalDirectory, noOutFile: false, lib: "es6" });
591591

592592
var serverFile = path.join(builtLocalDirectory, "tsserver.js");
593-
compileFile(serverFile, serverSources, [builtLocalDirectory, copyright, cancellationTokenFile, typingsInstallerFile, watchGuardFile].concat(serverSources).concat(servicesSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true, { types: ["node"], preserveConstEnums: true, lib: "es6,scripthost" });
593+
compileFile(serverFile, serverSources, [builtLocalDirectory, copyright, cancellationTokenFile, typingsInstallerFile, watchGuardFile].concat(serverSources).concat(servicesSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true, { types: ["node"], preserveConstEnums: true, lib: "es6" });
594594
var tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js");
595595
var tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibrary.d.ts");
596596
compileFile(
@@ -714,7 +714,7 @@ compileFile(
714714
/*prereqs*/[builtLocalDirectory, tscFile].concat(libraryTargets).concat(servicesSources).concat(harnessSources),
715715
/*prefixes*/[],
716716
/*useBuiltCompiler:*/ true,
717-
/*opts*/ { inlineSourceMap: true, types: ["node", "mocha", "chai"], lib: "es6,scripthost" });
717+
/*opts*/ { inlineSourceMap: true, types: ["node", "mocha", "chai"], lib: "es6" });
718718

719719
var internalTests = "internal/";
720720

@@ -1187,43 +1187,16 @@ function spawnLintWorker(files, callback) {
11871187
}
11881188

11891189
desc("Runs tslint on the compiler sources. Optional arguments are: f[iles]=regex");
1190-
task("lint", ["build-rules"], function () {
1190+
task("lint", ["build-rules"], () => {
11911191
if (fold.isTravis()) console.log(fold.start("lint"));
1192-
var startTime = mark();
1193-
var failed = 0;
1194-
var fileMatcher = RegExp(process.env.f || process.env.file || process.env.files || "");
1195-
var done = {};
1196-
for (var i in lintTargets) {
1197-
var target = lintTargets[i];
1198-
if (!done[target] && fileMatcher.test(target)) {
1199-
done[target] = fs.statSync(target).size;
1200-
}
1201-
}
1202-
1203-
var workerCount = (process.env.workerCount && +process.env.workerCount) || os.cpus().length;
1204-
1205-
var names = Object.keys(done).sort(function (namea, nameb) {
1206-
return done[namea] - done[nameb];
1192+
const fileMatcher = process.env.f || process.env.file || process.env.files;
1193+
const files = fileMatcher
1194+
? `src/**/${fileMatcher}`
1195+
: "Gulpfile.ts 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated.d.ts'";
1196+
const cmd = `node node_modules/tslint/bin/tslint ${files} --format stylish`;
1197+
console.log("Linting: " + cmd);
1198+
jake.exec([cmd], { interactive: true }, () => {
1199+
if (fold.isTravis()) console.log(fold.end("lint"));
1200+
complete();
12071201
});
1208-
1209-
for (var i = 0; i < workerCount; i++) {
1210-
spawnLintWorker(names, finished);
1211-
}
1212-
1213-
var completed = 0;
1214-
var failures = 0;
1215-
function finished(fails) {
1216-
completed++;
1217-
failures += fails;
1218-
if (completed === workerCount) {
1219-
measure(startTime);
1220-
if (fold.isTravis()) console.log(fold.end("lint"));
1221-
if (failures > 0) {
1222-
fail('Linter errors.', failed);
1223-
}
1224-
else {
1225-
complete();
1226-
}
1227-
}
1228-
}
1229-
}, { async: true });
1202+
});

doc/logo.svg

Lines changed: 10 additions & 15 deletions
Loading

lib/tsc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53977,7 +53977,7 @@ var ts;
5397753977
var padding = makePadding(marginLength);
5397853978
output.push(getDiagnosticText(ts.Diagnostics.Examples_Colon_0, makePadding(marginLength - examplesLength) + "tsc hello.ts") + ts.sys.newLine);
5397953979
output.push(padding + "tsc --outFile file.js file.ts" + ts.sys.newLine);
53980-
output.push(padding + "tsc @args.txt" + ts.sys.newLine);
53980+
output.push(padding + "tsc --project tsconfig.json" + ts.sys.newLine);
5398153981
output.push(ts.sys.newLine);
5398253982
output.push(getDiagnosticText(ts.Diagnostics.Options_Colon) + ts.sys.newLine);
5398353983
var optsList = ts.filter(ts.optionDeclarations.slice(), function (v) { return !v.experimental; });

0 commit comments

Comments
 (0)