Skip to content

First UMD global in wins #9801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 316 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
316 commits
Select commit Hold shift + click to select a range
af0c548
Merge pull request #9750 from Microsoft/fixFormatDiagnostics
vladima Jul 15, 2016
f184668
Merge branch 'master' into travis-cache
weswigham Jul 15, 2016
a9906e5
Add npm update call to install, lets see how it goes
weswigham Jul 15, 2016
bf8937c
remove extra semicolon
vladima Jul 15, 2016
124305d
Emit parens around type-asserted binary operators
RyanCavanaugh Jul 15, 2016
40ca4a0
Incorrectly included some unrelated files
RyanCavanaugh Jul 15, 2016
5319fa3
Fix linting error (#9762)
yuit Jul 15, 2016
2037ec6
Try removing the conflicting package before install/update
weswigham Jul 16, 2016
b5a5758
No subtype reduction in createUnionOrIntersectionProperty for perform…
ahejlsberg Jul 16, 2016
01a33f7
Accept new baselines
ahejlsberg Jul 16, 2016
614d171
Include type parameter constrains in literal type context determination
ahejlsberg Jul 16, 2016
a96d38e
Accept new baselines
ahejlsberg Jul 16, 2016
2b8c1f9
Merge pull request #9764 from Microsoft/port-9750
vladima Jul 17, 2016
9ef65cf
remove unused method declaration
mhegazy Jul 18, 2016
290caad
Fix #9636: Report unused type paramters only on last declaration
mhegazy Jul 18, 2016
a3b0810
Merge branch 'release-2.0' into Fix9636
mhegazy Jul 18, 2016
9886f88
[Release-2.0] Fix 9685: missing decoratedClassAlias emit in self-refe…
yuit Jul 18, 2016
7f045ad
Code review comments
mhegazy Jul 18, 2016
cb27e54
Fix fourslash test
ahejlsberg Jul 18, 2016
c48cd4a
Unify 'boolean' and 'true | false'
ahejlsberg Jul 18, 2016
32f4cbb
Accept new baselines
ahejlsberg Jul 18, 2016
08b3b8b
Merge pull request #9784 from Microsoft/Fix9636
mhegazy Jul 18, 2016
59c4d3f
Merge branch 'release-2.0'
mhegazy Jul 18, 2016
ac72aff
Update LKG
mhegazy Jul 18, 2016
ee43dab
First UMD global in wins
RyanCavanaugh Jul 18, 2016
32a9196
Merge branch 'mergerRelease-2.0InMaster'
mhegazy Jul 18, 2016
e52e165
Port Fix9685 to master (#9788)
yuit Jul 18, 2016
0f132cd
Order union type constituents by type ID
ahejlsberg Jul 19, 2016
15a6667
Fix fourslash tests
ahejlsberg Jul 19, 2016
7d1c2fc
Accept new baselines
ahejlsberg Jul 19, 2016
a17bd02
Associate type alias names with union, intersection and literal types
ahejlsberg Jul 19, 2016
a53a53f
Accept new baselines
ahejlsberg Jul 19, 2016
26713c8
Expand top level of declared type in type alias declaration
ahejlsberg Jul 19, 2016
a2c4176
Fix fourslash test
ahejlsberg Jul 19, 2016
1868f2e
Remove bizarre fourslash test
ahejlsberg Jul 19, 2016
2a26beb
Add performance framework from transforms branch (#9536)
weswigham Jul 19, 2016
80db0f2
[Release-2.0] Fix 9782: do not report blocked-scope-used-before-decl…
yuit Jul 19, 2016
f5f8a45
Optimize checkTypeRelatedTo
ahejlsberg Jul 20, 2016
729464d
Integrate feedback from @mihailik to performance framework (#9845)
weswigham Jul 20, 2016
82de932
Merge branch 'master' into tsaImmutable
DanielRosenwasser Jul 21, 2016
1b07fbb
Fix #9843. IScriptSnapshot can return undefined
HerringtonDarkholme Jul 21, 2016
6e4dd75
Merge pull request #9561 from Microsoft/tsaImmutable
DanielRosenwasser Jul 21, 2016
a2f45e9
Merge pull request #9853 from HerringtonDarkholme/master
DanielRosenwasser Jul 21, 2016
57eac1b
Merge pull request #9692 from Microsoft/fix-emit-with-this-and-rest-p…
sandersn Jul 21, 2016
451f48b
Optimize checkTypeRelatedTo, part 2
ahejlsberg Jul 21, 2016
f24341f
Remove dependency on tsd, Related to #9658 (#9724)
sudheesh001 Jul 21, 2016
bd25c13
Port PR 9745 to master (#9881)
yuit Jul 22, 2016
f94025d
Improve web tests
Jul 1, 2016
bd48e55
Merge remote-tracking branch 'origin/master' into explicitly_included…
riknoll Jul 22, 2016
046e9ea
Merge pull request #9895 from Microsoft/better_web_test
Jul 22, 2016
2552560
Test that protected constructors are accessible
sandersn Jul 22, 2016
8b2ea39
Merge pull request #9528 from Microsoft/explicitly_included_globs
riknoll Jul 22, 2016
97ef839
Protected ctors are accessible in subclass static methods
sandersn Jul 22, 2016
4b21839
Add src to absolute paths in browserify task
sandersn Jul 22, 2016
afd39cc
Enum type is also a union of the literal enum types it declares
ahejlsberg Jul 22, 2016
8c64759
Fix bug in binder uncovered by changes
ahejlsberg Jul 22, 2016
9a23b11
Change parser to use token() function for accessing current token
ahejlsberg Jul 22, 2016
a0406c7
Port Fix 9894 to master (#9896)
yuit Jul 22, 2016
f7753af
Reduce unions of enum literal types when displaying types
ahejlsberg Jul 22, 2016
d3c91e0
Accept new baselines
ahejlsberg Jul 22, 2016
2169928
Protected constructors now accessible everywhere in subclasses
sandersn Jul 23, 2016
7224f22
throw error when paths option mapping empty array
YuichiNukiyama Jul 23, 2016
bf2783f
to run CI
YuichiNukiyama Jul 23, 2016
178883a
Fix issue in getTypeDefinitionAtPosition
ahejlsberg Jul 23, 2016
835645c
Fix fourslash test
ahejlsberg Jul 23, 2016
b70132a
Fix linting errors
ahejlsberg Jul 23, 2016
6a6f5db
Merge pull request #9909 from YuichiNukiyama/fix9772
mhegazy Jul 23, 2016
60cc5df
Change getUnionType to default to no subtype reduction
ahejlsberg Jul 23, 2016
d7aa40d
Remove unnecessary subtype reduction operations
ahejlsberg Jul 23, 2016
b673d5f
Use binary searching in union types to improve performance
ahejlsberg Jul 23, 2016
ff0cbb5
Merge branch 'master' into literalTypes
ahejlsberg Jul 24, 2016
a1a8725
Optimize type inference
ahejlsberg Jul 25, 2016
8cbbcd0
Fixed broken singleAsteriskRegex. Fixes #9918 (#9920)
Artazor Jul 25, 2016
4ef4cf1
Lock ts-node to 1.1.0 while perf issue is investigated (#9933)
weswigham Jul 25, 2016
ac2c41c
Merge pull request #9904 from Microsoft/protected-constructors-access…
sandersn Jul 25, 2016
3ad83cb
Merge pull request #9905 from Microsoft/add-src-to-browserify-paths
sandersn Jul 25, 2016
3474480
Fix typo in comment for MAX_SAFE_INTEGER
hckr Jul 26, 2016
1b15608
In ts.performance.now, bind window.performance.now
sandersn Jul 26, 2016
acb003a
Add lint enforcing line endings (#9942)
weswigham Jul 26, 2016
2f8df90
Merge branch 'master' into travis-cache
weswigham Jul 26, 2016
670f0c9
Merge pull request #9956 from Microsoft/bind-window-performance-now
sandersn Jul 26, 2016
89788f8
Add servicesSources to the list of prerequisites for running tests
Jul 26, 2016
0e0220d
Support emitting static properties for classes with no name
Jul 26, 2016
e12f2d8
Add assertion whitespace lint rule (#9931)
weswigham Jul 26, 2016
e9240a8
Limit travis build matrix (#9968)
weswigham Jul 26, 2016
a32234c
Convert getErrorBaseline to use canonical diagnostic formatting (#9708)
weswigham Jul 26, 2016
ac96a86
Merge pull request #9963 from Microsoft/jake_runtests_services
Jul 27, 2016
c578367
Merge pull request #9969 from Microsoft/class_expression_static_property
Jul 27, 2016
30761ef
Unify nodeKind implementations for navigationBar and navigateTo
Jul 26, 2016
38e201e
Fix test and rename a function
Jul 27, 2016
958620b
Fix lint errors
Jul 27, 2016
2873eea
Remove hardcoded port, use the custom port
Jul 27, 2016
0783743
Unlock ts-node version (#9960)
weswigham Jul 27, 2016
80b7613
Allow an abstract class to appear in a local scope
Jul 27, 2016
3446557
Add find and findIndex to ReadonlyArray
joshaber Jul 27, 2016
34e78e6
The optional this should be readonly too.
joshaber Jul 27, 2016
09f5182
Re-add concat overload to support inferring tuples
sandersn Jul 27, 2016
e8bd372
Update baselines with new concat overload
sandersn Jul 27, 2016
a5fcd5f
Display enum member types using qualified names
ahejlsberg Jul 28, 2016
5ff07dc
Accept new baselines
ahejlsberg Jul 28, 2016
a25b664
Fix lint error
Jul 28, 2016
0c131fa
Merge pull request #9407 from Microsoft/literalTypes
ahejlsberg Jul 28, 2016
d5beef9
Get rid of port parameter
Jul 28, 2016
20ffb5f
Remove [port] in usage message
Jul 28, 2016
013744b
Merge pull request #9994 from Microsoft/local_abstract_class
Jul 28, 2016
878cf85
Merge pull request #9985 from Microsoft/fix_runtests_browser
Jul 29, 2016
3e3b808
Properly reset type guards in loops
ahejlsberg Jul 29, 2016
d9b6723
Add regression test
ahejlsberg Jul 29, 2016
97bbbd7
Introduce the `EntityNameExpression` type
Jul 28, 2016
f9fd496
Allow `export =` and `export default` to alias any EntityNameExpressi…
Jul 29, 2016
c696030
Merge pull request #9984 from Microsoft/node_kind
Jul 29, 2016
a485aab
Lint tests helper files
Jul 27, 2016
5e86a10
Fix tests and merge
RyanCavanaugh Jul 29, 2016
33f72c7
Merge pull request #8636 from RyanCavanaugh/classOrdering
RyanCavanaugh Jul 29, 2016
0f1585f
recreate program if baseUrl or paths changed in tsconfig
Jul 29, 2016
c50ccbf
Simplify some code
Jul 29, 2016
2c156ed
Have travis use a newer image for the OSX build (#10034)
weswigham Jul 29, 2016
394dbbf
Merge branch 'travis-cache'
weswigham Jul 29, 2016
cbb06ab
Correctly check for ambient class flag
RyanCavanaugh Jul 30, 2016
1d979cc
Merge pull request #9951 from hckr/patch-1
RyanCavanaugh Jul 30, 2016
fc85bc5
Use "best choice type" for || and ?: operators
ahejlsberg Jul 31, 2016
5c4c997
jsx opening element formatting
saschanaz Jul 31, 2016
030fbdc
Merge pull request #10046 from RyanCavanaugh/fix10045
RyanCavanaugh Aug 1, 2016
6c6de2a
Merge pull request #9990 from Microsoft/lint_tests
Aug 1, 2016
ade89a6
Fix issue related to this and #8383
ahejlsberg Aug 1, 2016
b3b4c34
Add additional tests
ahejlsberg Aug 1, 2016
0a90a4b
Accept new baselines
ahejlsberg Aug 1, 2016
cb1ea7b
Provide `realpath` for module resolution in LSHost
Aug 1, 2016
47f6bb2
Add test
ahejlsberg Aug 1, 2016
aa8c6c8
Add test baselines
ahejlsberg Aug 1, 2016
c7d2e59
Accept new baselines
ahejlsberg Aug 1, 2016
4f27f65
Merge pull request #10068 from Microsoft/lshost_realpath
Aug 1, 2016
36b6113
Merge pull request #10028 from Microsoft/fixDiscriminantInLoop
ahejlsberg Aug 1, 2016
1435fb1
Merge pull request #10069 from Microsoft/bestChoiceType
ahejlsberg Aug 1, 2016
2d20dbf
Merge pull request #9767 from RyanCavanaugh/fix9766
RyanCavanaugh Aug 1, 2016
6caa261
Merge pull request #10054 from SaschaNaz/jsxopening
RyanCavanaugh Aug 1, 2016
f78b909
CR feedback
Aug 1, 2016
f06413b
Merge pull request #10035 from zhengbli/9522
zhengbli Aug 2, 2016
91c9d76
Remove `SupportedExpressionWithTypeArguments` type; just check that t…
Aug 2, 2016
db44a71
Fix bug
Aug 2, 2016
4a470bd
Merge pull request #9997 from Microsoft/re-add-strict-concat-signature
sandersn Aug 2, 2016
0eeb9cb
Fix #10083 - allowSyntheticDefaultImports alters getExternalModuleMem…
weswigham Aug 2, 2016
dc19223
Use recursion, and fix error for undefined node
Aug 2, 2016
6814a9f
Rename function
Aug 2, 2016
7908257
Fix lint error
Aug 2, 2016
4189b4d
Narrowing type parameter intersects w/narrowed types
sandersn Aug 2, 2016
204f2c1
Add a helper function `getOrUpdateProperty` to prevent unprotected ac…
Aug 3, 2016
7ab6e11
Limit type guards as assertions to incomplete types in loops
ahejlsberg Aug 3, 2016
917d18a
Accept new baselines
ahejlsberg Aug 3, 2016
12eb57c
Fix linting error
ahejlsberg Aug 3, 2016
045b51a
Use {} type facts for unconstrained type params
sandersn Aug 3, 2016
38ee13c
Fix newline lint
sandersn Aug 3, 2016
14f0aa0
Merge pull request #10118 from Microsoft/limitTypeGuardAssertions
ahejlsberg Aug 3, 2016
0a8afc9
Merge pull request #10115 from Microsoft/export_specifiers_map
Aug 4, 2016
10b36ab
[Release-2.0] Fix 9662: Visual Studio 2015 with TS2.0 gives incorrect…
yuit Aug 4, 2016
18fb33d
Remove unused reference files: these tests produce erros so they will…
yuit Aug 4, 2016
9947ac2
Don't allow properties inherited from Object to be automatically incl…
Aug 4, 2016
b54aec1
Merge pull request #10153 from Microsoft/tsx_toString
Aug 5, 2016
ceab31c
Port PR #10016 to Master (#10100)
yuit Aug 5, 2016
02a79e3
Try using runtests-parallel for CI (#9970)
weswigham Aug 5, 2016
269b828
Fix lssl task (#9967)
weswigham Aug 5, 2016
37e96b3
Stricter check for discriminant properties in type guards
ahejlsberg Aug 6, 2016
1375505
Add tests
ahejlsberg Aug 6, 2016
01f865d
Fix instanceof operator narrowing issues
ahejlsberg Aug 7, 2016
f50226b
Accept new baselines
ahejlsberg Aug 7, 2016
67b3fe5
Add regression test
ahejlsberg Aug 7, 2016
e25db39
Merge branch 'master' into narrowing-a-type-parameter-intersects-conc…
sandersn Aug 8, 2016
5f665ad
Merge pull request #9996 from joshaber/patch-1
sandersn Aug 8, 2016
acfdfe0
Merge pull request #10103 from Microsoft/narrowing-a-type-parameter-i…
sandersn Aug 8, 2016
a0c5608
Update comment
ahejlsberg Aug 8, 2016
ce5a3f4
Add more tests
ahejlsberg Aug 8, 2016
ba521de
Accept new baselines
ahejlsberg Aug 8, 2016
f6a850b
Merge pull request #10188 from Microsoft/discriminantPropertyCheck
ahejlsberg Aug 8, 2016
8ea90ab
Merge pull request #10194 from Microsoft/fixInstanceofNarrowing
ahejlsberg Aug 8, 2016
30e95df
Reduce worker count to 3 (#10210)
weswigham Aug 8, 2016
ce7f554
Speed up fourslash tests
RyanCavanaugh Aug 8, 2016
e724e88
Duh
RyanCavanaugh Aug 8, 2016
eac7a48
Fix non-strict-compliant test
RyanCavanaugh Aug 8, 2016
3f6aa3f
Fix 10076: Fix Tuple Destructing with "this" (#10208)
yuit Aug 8, 2016
40f0c60
use transpileModule
RyanCavanaugh Aug 8, 2016
624e52e
Improve instanceof for structurally identical types
ahejlsberg Aug 8, 2016
5ebfad6
Introduce isTypeInstanceOf function
ahejlsberg Aug 9, 2016
9277b3f
Add test
ahejlsberg Aug 9, 2016
fe1854e
Accept new baselines
ahejlsberg Aug 9, 2016
3f1ec7a
Merge pull request #10216 from Microsoft/structurallyIdenticalInstanceof
ahejlsberg Aug 9, 2016
4f54c6c
Fix loop over array to use for-of instead of for-in
Aug 9, 2016
7e115bb
Use correct this in tuple type parameter constraints
sandersn Aug 9, 2016
d34bbe5
Add explanatory comment to resolveTupleTypeMembers
sandersn Aug 9, 2016
a5ea55a
Ignore null, undefined, void when checking for discriminant property
ahejlsberg Aug 9, 2016
6c0bca0
Add regression test
ahejlsberg Aug 9, 2016
6a8f4cb
Delay tuple type constraint resolution
sandersn Aug 9, 2016
80963ba
Always use thisType when generating tuple id
sandersn Aug 9, 2016
9d4547c
Optimize format of type list id strings used in maps
ahejlsberg Aug 9, 2016
8975cd7
Make ReadonlyArray iterable.
joshaber Aug 10, 2016
557fc38
Merge pull request #10235 from Microsoft/fixDiscriminantWithNullableType
ahejlsberg Aug 10, 2016
bc5f41e
Merge pull request #10227 from Microsoft/for_of
Aug 10, 2016
ecc51af
Allow OSX to fail while we investigate (#10255)
weswigham Aug 10, 2016
2f6f74d
Merge pull request #10243 from joshaber/iterable-readonlyarray
RyanCavanaugh Aug 10, 2016
56cb07a
avoid using the global name
Aug 10, 2016
4087808
Fix single-quote lint
sandersn Aug 10, 2016
e16326d
Merge pull request #10260 from zhengbli/fixSession
zhengbli Aug 10, 2016
65e1293
Optimize performance of maps
ahejlsberg Aug 10, 2016
cba2e1a
Update API sample
ahejlsberg Aug 10, 2016
3ff89f7
Fix processDiagnosticMessages script
ahejlsberg Aug 11, 2016
fa991b5
Have travis take shallow clones of the repo (#10275)
weswigham Aug 11, 2016
5b9bd82
Merge branch 'master' into resolve_entity_name
Aug 11, 2016
688e9bc
Merge pull request #10234 from Microsoft/correct-this-in-tuple-type-p…
sandersn Aug 11, 2016
c9f62f3
Add folds to travis log (#10269)
weswigham Aug 11, 2016
e900952
Merge pull request #10013 from Microsoft/resolve_entity_name
Aug 11, 2016
e00ce94
Merge pull request #10240 from Microsoft/optimizeTypeListIds
ahejlsberg Aug 11, 2016
24d8d84
Optimize filterType to only call getUnionType if necessary
ahejlsberg Aug 11, 2016
9ac13ab
Add shorthand types declaration for travis-fold (#10293)
Aug 11, 2016
a3845a9
Optimize getTypeWithFacts
ahejlsberg Aug 11, 2016
c22a54f
Filter out nullable and primitive types in isDiscriminantProperty
ahejlsberg Aug 11, 2016
b336c69
Fix typo
ahejlsberg Aug 11, 2016
29ae2b2
Add regression tests
ahejlsberg Aug 11, 2016
644d655
Optimize core filter function to only allocate when necessary
ahejlsberg Aug 11, 2016
f1ea145
Address CR comments + more optimizations
ahejlsberg Aug 11, 2016
e64675e
Faster path for creating union types from filterType
ahejlsberg Aug 12, 2016
df739fd
Allow an @types direcotry to have a package.json which specifies `"ty…
Aug 11, 2016
b988bc9
Merge pull request #10303 from Microsoft/not_needed_types
Aug 12, 2016
19d89c4
Merge pull request #10296 from Microsoft/fixDiscriminantWithPrimtive
ahejlsberg Aug 12, 2016
87393e0
Merge branch 'master' into optimizeMaps
ahejlsberg Aug 12, 2016
ec49525
Merge pull request #10211 from RyanCavanaugh/fourslashTestPerf
RyanCavanaugh Aug 12, 2016
d206046
Collect timing information for commands running on travis (#10308)
weswigham Aug 12, 2016
c816244
Simplifies performance API
rbuckton Aug 12, 2016
5bdde3b
Merge pull request #10270 from Microsoft/optimizeMaps
ahejlsberg Aug 13, 2016
73d53e8
Use 'MapLike' instead of 'Map' in 'preferConstRule.ts'.
DanielRosenwasser Aug 13, 2016
10d1e02
Merge pull request #10323 from Microsoft/fixLint
DanielRosenwasser Aug 13, 2016
3835302
narrow from 'any' in most situations
yortus Aug 13, 2016
59c09d9
Update instanceof conformance tests
yortus Aug 13, 2016
cc8f326
accept new baselines
yortus Aug 14, 2016
66047c8
add tests
yortus Aug 14, 2016
837688f
accept new baselines
yortus Aug 14, 2016
78cea2a
Merge pull request #10334 from yortus/narrow-from-any
DanielRosenwasser Aug 15, 2016
592805f
Use proper response codes in web tests
Aug 15, 2016
a1eda3c
Merge pull request #10341 from Microsoft/runtests_browser_response_code
Aug 15, 2016
a1dad91
Parallel linting (#10313)
weswigham Aug 15, 2016
2d1b68f
Fix the style fix (#10344)
weswigham Aug 15, 2016
4e04b75
Aligned mark names with values used by ts-perf.
rbuckton Aug 15, 2016
75cb595
Merge pull request #10327 from Microsoft/simplePerformanceAPI
rbuckton Aug 15, 2016
2953c7f
Use an enum in checkClassForDuplicateDeclarations to aid readability
Aug 15, 2016
8f1960f
Rename to Accessor
Aug 15, 2016
7ee05ba
Merge pull request #10345 from Microsoft/meaning
Aug 15, 2016
bd35b2a
First UMD global in wins
RyanCavanaugh Jul 18, 2016
6083d63
Get up to date
RyanCavanaugh Aug 15, 2016
81bf117
Merge
RyanCavanaugh Aug 15, 2016
5b033bb
First UMD global in wins
RyanCavanaugh Jul 18, 2016
a5efa13
Get up to date
RyanCavanaugh Aug 15, 2016
86a52fa
Merge branch 'fix9771' of https://github.com/RyanCavanaugh/TypeScript…
RyanCavanaugh Aug 15, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 27 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,33 @@ node_js:

sudo: false

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

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

branches:
only:
- master
- transforms

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

cache:
directories:
- node_modules

git:
depth: 1
153 changes: 79 additions & 74 deletions Gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import through2 = require("through2");
import merge2 = require("merge2");
import intoStream = require("into-stream");
import * as os from "os";
import Linter = require("tslint");
import fold = require("travis-fold");
const gulp = helpMaker(originalGulp);
const mochaParallel = require("./scripts/mocha-parallel.js");
const {runTestsInParallel} = mochaParallel;
Expand All @@ -59,7 +59,6 @@ const cmdLineOptions = minimist(process.argv.slice(2), {
browser: process.env.browser || process.env.b || "IE",
tests: process.env.test || process.env.tests || process.env.t,
light: process.env.light || false,
port: process.env.port || process.env.p || "8888",
reporter: process.env.reporter || process.env.r,
lint: process.env.lint || true,
files: process.env.f || process.env.file || process.env.files || "",
Expand Down Expand Up @@ -450,7 +449,7 @@ gulp.task(tsserverLibraryFile, false, [servicesFile], (done) => {
});

gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile]);
gulp.task("local", "Builds the full compiler and services", [builtLocalCompiler, servicesFile, serverFile, builtGeneratedDiagnosticMessagesJSON]);
gulp.task("local", "Builds the full compiler and services", [builtLocalCompiler, servicesFile, serverFile, builtGeneratedDiagnosticMessagesJSON, tsserverLibraryFile]);
gulp.task("tsc", "Builds only the compiler", [builtLocalCompiler]);


Expand Down Expand Up @@ -504,7 +503,7 @@ gulp.task("VerifyLKG", false, [], () => {
return gulp.src(expectedFiles).pipe(gulp.dest(LKGDirectory));
});

gulp.task("LKGInternal", false, ["lib", "local", "lssl"]);
gulp.task("LKGInternal", false, ["lib", "local"]);

gulp.task("LKG", "Makes a new LKG out of the built js files", ["clean", "dontUseDebugMode"], () => {
return runSequence("LKGInternal", "VerifyLKG");
Expand Down Expand Up @@ -710,7 +709,7 @@ gulp.task("browserify", "Runs browserify on run.js to produce a file suitable fo
const originalMap = file.sourceMap;
const prebundledContent = file.contents.toString();
// Make paths absolute to help sorcery deal with all the terrible paths being thrown around
originalMap.sources = originalMap.sources.map(s => path.resolve(s));
originalMap.sources = originalMap.sources.map(s => path.resolve("src", s));
// intoStream (below) makes browserify think the input file is named this, so this is what it puts in the sourcemap
originalMap.file = "built/local/_stream_0.js";

Expand Down Expand Up @@ -766,7 +765,7 @@ function writeTestConfigFile(tests: string, light: boolean, taskConfigsFolder?:
}


gulp.task("runtests-browser", "Runs the tests using the built run.js file like 'gulp runtests'. Syntax is gulp runtests-browser. Additional optional parameters --tests=[regex], --port=, --browser=[chrome|IE]", ["browserify", nodeServerOutFile], (done) => {
gulp.task("runtests-browser", "Runs the tests using the built run.js file like 'gulp runtests'. Syntax is gulp runtests-browser. Additional optional parameters --tests=[regex], --browser=[chrome|IE]", ["browserify", nodeServerOutFile], (done) => {
cleanTestDirs((err) => {
if (err) { console.error(err); done(err); process.exit(1); }
host = "node";
Expand All @@ -781,9 +780,6 @@ gulp.task("runtests-browser", "Runs the tests using the built run.js file like '
}

const args = [nodeServerOutFile];
if (cmdLineOptions["port"]) {
args.push(cmdLineOptions["port"]);
}
if (cmdLineOptions["browser"]) {
args.push(cmdLineOptions["browser"]);
}
Expand Down Expand Up @@ -918,57 +914,20 @@ gulp.task("update-sublime", "Updates the sublime plugin's tsserver", ["local", s
return gulp.src([serverFile, serverFile + ".map"]).pipe(gulp.dest("../TypeScript-Sublime-Plugin/tsserver/"));
});


const tslintRuleDir = "scripts/tslint";
const tslintRules = [
"nextLineRule",
"preferConstRule",
"booleanTriviaRule",
"typeOperatorSpacingRule",
"noInOperatorRule",
"noIncrementDecrementRule",
"objectLiteralSurroundingSpaceRule",
];
const tslintRulesFiles = tslintRules.map(function(p) {
return path.join(tslintRuleDir, p + ".ts");
});
const tslintRulesOutFiles = tslintRules.map(function(p, i) {
const pathname = path.join(builtLocalDirectory, "tslint", p + ".js");
gulp.task(pathname, false, [], () => {
const settings: tsc.Settings = getCompilerSettings({ module: "commonjs" }, /*useBuiltCompiler*/ false);
return gulp.src(tslintRulesFiles[i])
.pipe(newer(pathname))
.pipe(sourcemaps.init())
.pipe(tsc(settings))
.pipe(sourcemaps.write("."))
.pipe(gulp.dest(path.join(builtLocalDirectory, "tslint")));
});
return pathname;
gulp.task("build-rules", "Compiles tslint rules to js", () => {
const settings: tsc.Settings = getCompilerSettings({ module: "commonjs" }, /*useBuiltCompiler*/ false);
const dest = path.join(builtLocalDirectory, "tslint");
return gulp.src("scripts/tslint/**/*.ts")
.pipe(newer({
dest,
ext: ".js"
}))
.pipe(sourcemaps.init())
.pipe(tsc(settings))
.pipe(sourcemaps.write("."))
.pipe(gulp.dest(dest));
});

gulp.task("build-rules", "Compiles tslint rules to js", tslintRulesOutFiles);


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

function lintFileContents(options, path, contents) {
const ll = new Linter(path, contents, options);
console.log("Linting '" + path + "'.");
return ll.lint();
}

function lintFile(options, path) {
const contents = fs.readFileSync(path, "utf8");
return lintFileContents(options, path, contents);
}

const lintTargets = [
"Gulpfile.ts",
"src/compiler/**/*.ts",
Expand All @@ -977,29 +936,75 @@ const lintTargets = [
"src/server/**/*.ts",
"scripts/tslint/**/*.ts",
"src/services/**/*.ts",
"tests/*.ts", "tests/webhost/*.ts" // Note: does *not* descend recursively
];

function sendNextFile(files: {path: string}[], child: cp.ChildProcess, callback: (failures: number) => void, failures: number) {
const file = files.pop();
if (file) {
console.log(`Linting '${file.path}'.`);
child.send({ kind: "file", name: file.path });
}
else {
child.send({ kind: "close" });
callback(failures);
}
}

function spawnLintWorker(files: {path: string}[], callback: (failures: number) => void) {
const child = cp.fork("./scripts/parallel-lint");
let failures = 0;
child.on("message", function(data) {
switch (data.kind) {
case "result":
if (data.failures > 0) {
failures += data.failures;
console.log(data.output);
}
sendNextFile(files, child, callback, failures);
break;
case "error":
console.error(data.error);
failures++;
sendNextFile(files, child, callback, failures);
break;
}
});
sendNextFile(files, child, callback, failures);
}

gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are: --f[iles]=regex", ["build-rules"], () => {
const fileMatcher = RegExp(cmdLineOptions["files"]);
const lintOptions = getLinterOptions();
let failed = 0;
return gulp.src(lintTargets)
.pipe(insert.transform((contents, file) => {
if (!fileMatcher.test(file.path)) return contents;
const result = lintFile(lintOptions, file.path);
if (result.failureCount > 0) {
console.log(result.output);
failed += result.failureCount;
if (fold.isTravis()) console.log(fold.start("lint"));

let files: {stat: fs.Stats, path: string}[] = [];
return gulp.src(lintTargets, { read: false })
.pipe(through2.obj((chunk, enc, cb) => {
files.push(chunk);
cb();
}, (cb) => {
files = files.filter(file => fileMatcher.test(file.path)).sort((filea, fileb) => filea.stat.size - fileb.stat.size);
const workerCount = (process.env.workerCount && +process.env.workerCount) || os.cpus().length;
for (let i = 0; i < workerCount; i++) {
spawnLintWorker(files, finished);
}
return contents; // TODO (weswig): Automatically apply fixes? :3
}))
.on("end", () => {
if (failed > 0) {
console.error("Linter errors.");
process.exit(1);

let completed = 0;
let failures = 0;
function finished(fails) {
completed++;
failures += fails;
if (completed === workerCount) {
if (fold.isTravis()) console.log(fold.end("lint"));
if (failures > 0) {
throw new Error(`Linter errors: ${failures}`);
}
else {
cb();
}
}
}
});
}));
});


Expand Down
Loading