Skip to content

Commit aa1c860

Browse files
author
Andy Hanson
committed
Merge branch 'master' into refactor_findallrefs
2 parents 7739a88 + c949116 commit aa1c860

File tree

503 files changed

+4918
-5326
lines changed

Some content is hidden

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

503 files changed

+4918
-5326
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");
@@ -750,7 +751,7 @@ gulp.task("browserify", "Runs browserify on run.js to produce a file suitable fo
750751
const originalMap = file.sourceMap;
751752
const prebundledContent = file.contents.toString();
752753
// Make paths absolute to help sorcery deal with all the terrible paths being thrown around
753-
originalMap.sources = originalMap.sources.map(s => path.resolve(s));
754+
originalMap.sources = originalMap.sources.map(s => path.resolve(path.join("src/harness", s)));
754755
// intoStream (below) makes browserify think the input file is named this, so this is what it puts in the sourcemap
755756
originalMap.file = "built/local/_stream_0.js";
756757

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

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

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

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

Jakefile.js

Lines changed: 43 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ var thirdParty = "ThirdPartyNoticeText.txt";
2929
var nodeModulesPathPrefix = path.resolve("./node_modules/.bin/") + path.delimiter;
3030
if (process.env.path !== undefined) {
3131
process.env.path = nodeModulesPathPrefix + process.env.path;
32-
} else if (process.env.PATH !== undefined) {
32+
}
33+
else if (process.env.PATH !== undefined) {
3334
process.env.PATH = nodeModulesPathPrefix + process.env.PATH;
3435
}
3536

@@ -312,13 +313,15 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts
312313
if (useDebugMode) {
313314
if (opts.inlineSourceMap) {
314315
options += " --inlineSourceMap --inlineSources";
315-
} else {
316+
}
317+
else {
316318
options += " -sourcemap";
317319
if (!opts.noMapRoot) {
318320
options += " -mapRoot file:///" + path.resolve(path.dirname(outFile));
319321
}
320322
}
321-
} else {
323+
}
324+
else {
322325
options += " --newLine LF";
323326
}
324327

@@ -748,7 +751,8 @@ function exec(cmd, completeHandler, errorHandler) {
748751
ex.addListener("error", function (e, status) {
749752
if (errorHandler) {
750753
errorHandler(e, status);
751-
} else {
754+
}
755+
else {
752756
fail("Process exited with code " + status);
753757
}
754758
});
@@ -1006,21 +1010,32 @@ task("baseline-accept", function () {
10061010

10071011
function acceptBaseline(sourceFolder, targetFolder) {
10081012
console.log('Accept baselines from ' + sourceFolder + ' to ' + targetFolder);
1009-
var files = fs.readdirSync(sourceFolder);
10101013
var deleteEnding = '.delete';
1011-
for (var i in files) {
1012-
var filename = files[i];
1013-
var fullLocalPath = path.join(sourceFolder, filename);
1014-
if (fs.statSync(fullLocalPath).isFile()) {
1015-
if (filename.substr(filename.length - deleteEnding.length) === deleteEnding) {
1016-
filename = filename.substr(0, filename.length - deleteEnding.length);
1017-
fs.unlinkSync(path.join(targetFolder, filename));
1018-
} else {
1019-
var target = path.join(targetFolder, filename);
1020-
if (fs.existsSync(target)) {
1021-
fs.unlinkSync(target);
1014+
1015+
acceptBaselineFolder(sourceFolder, targetFolder);
1016+
1017+
function acceptBaselineFolder(sourceFolder, targetFolder) {
1018+
var files = fs.readdirSync(sourceFolder);
1019+
1020+
for (var i in files) {
1021+
var filename = files[i];
1022+
var fullLocalPath = path.join(sourceFolder, filename);
1023+
var stat = fs.statSync(fullLocalPath);
1024+
if (stat.isFile()) {
1025+
if (filename.substr(filename.length - deleteEnding.length) === deleteEnding) {
1026+
filename = filename.substr(0, filename.length - deleteEnding.length);
1027+
fs.unlinkSync(path.join(targetFolder, filename));
10221028
}
1023-
fs.renameSync(path.join(sourceFolder, filename), target);
1029+
else {
1030+
var target = path.join(targetFolder, filename);
1031+
if (fs.existsSync(target)) {
1032+
fs.unlinkSync(target);
1033+
}
1034+
fs.renameSync(path.join(sourceFolder, filename), target);
1035+
}
1036+
}
1037+
else if (stat.isDirectory()) {
1038+
acceptBaselineFolder(fullLocalPath, path.join(targetFolder, filename));
10241039
}
10251040
}
10261041
}
@@ -1177,43 +1192,16 @@ function spawnLintWorker(files, callback) {
11771192
}
11781193

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

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)