Skip to content

"tsc -b" with minimal watch capabilities #24465

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

Merged
merged 53 commits into from
Jun 9, 2018
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d98a9a0
WIP
RyanCavanaugh May 15, 2018
aeb5625
WIP
RyanCavanaugh May 17, 2018
a4eb156
WIP, need to lint
RyanCavanaugh May 17, 2018
b2720ad
Lint
RyanCavanaugh May 21, 2018
b1dedf2
WIP
RyanCavanaugh May 21, 2018
7e0825a
Clean, etc
RyanCavanaugh May 22, 2018
6d04378
Testing WIP
RyanCavanaugh May 22, 2018
76d2ba6
Testing WIP
SeaRyanC May 22, 2018
5a9a883
WIP
SeaRyanC May 22, 2018
18f2baa
Fix errors
RyanCavanaugh May 22, 2018
fa07830
Passing tests
RyanCavanaugh May 22, 2018
5a664be
Baseline accept
RyanCavanaugh May 22, 2018
d4a56b9
WIP more tests
RyanCavanaugh May 23, 2018
fc22b5b
WIP
RyanCavanaugh May 24, 2018
8a883ae
Comments
RyanCavanaugh May 24, 2018
0781279
Add resolution branding
RyanCavanaugh May 24, 2018
d9bfbfe
Fix tests run in parallel
RyanCavanaugh May 24, 2018
8936b03
Merge branch 'master' into tsbuild
RyanCavanaugh May 24, 2018
19ab8ab
Fix strictNullChecks breaks
RyanCavanaugh May 24, 2018
cb8aa9b
Don't use invalid cached SourceFiles
RyanCavanaugh May 24, 2018
8ac795b
Correctly skip upstream-blocked projects
RyanCavanaugh May 24, 2018
1863d3f
Graph ordering test WIP
RyanCavanaugh May 25, 2018
a7fcbcd
Use better toposorting algorithm
RyanCavanaugh May 25, 2018
70fa29b
Add graph ordering tests
RyanCavanaugh May 29, 2018
fe191fe
Merge branch 'master' into tsbuild
RyanCavanaugh May 29, 2018
129f747
VFS fixes
RyanCavanaugh May 29, 2018
f8c4301
Add more errors; commandline help for --build; invalid flag combo det…
RyanCavanaugh May 30, 2018
cd7a844
We definitely have a type system
RyanCavanaugh May 30, 2018
8adbf85
Candidate sectional sourcemap emit implementation
weswigham May 31, 2018
eb1973a
Fixup sourcemap positions and text writer calculations
weswigham May 31, 2018
d21c03a
Invalidation + separated downstream builds
RyanCavanaugh May 31, 2018
7a1de61
Scaffold watch mode
RyanCavanaugh Jun 1, 2018
7e9e29c
Store + use the resolved path of sourceFiles in proj. ref. scenarios
RyanCavanaugh Jun 1, 2018
9b0dc37
Merge branch 'fixMissingScriptInfo' into tsbuild
RyanCavanaugh Jun 4, 2018
45842a0
Merge remote-tracking branch 'weswigham/sourcemap-concatenation-stati…
RyanCavanaugh Jun 5, 2018
17dc380
Reorganize tsbuild unit test file
RyanCavanaugh Jun 5, 2018
514a0d8
Add outfile-concat project refs test
RyanCavanaugh Jun 5, 2018
394e29f
Accept baselines for sourcemap sections
RyanCavanaugh Jun 5, 2018
e407780
Complicate the paths of the project for better sourcemap testing
RyanCavanaugh Jun 5, 2018
449d60c
Don't crash on no args
RyanCavanaugh Jun 5, 2018
5065c54
Tidy
RyanCavanaugh Jun 5, 2018
fad8f67
Lint
RyanCavanaugh Jun 5, 2018
cf87bd4
Merge branch 'master' into tsbuild
RyanCavanaugh Jun 5, 2018
7ad9d57
Include filename when reporting not found
RyanCavanaugh Jun 5, 2018
5111f4d
Move proj ref logic to the right place
RyanCavanaugh Jun 5, 2018
11df004
Include all lib files in tsbuild harness
RyanCavanaugh Jun 5, 2018
856fc79
Lint
RyanCavanaugh Jun 5, 2018
291289f
Update messages
RyanCavanaugh Jun 6, 2018
b107849
Improve handling of container projects and issue relative filename me…
RyanCavanaugh Jun 6, 2018
21a65f5
Improved watch mode
RyanCavanaugh Jun 6, 2018
1de2f83
PR fixups
RyanCavanaugh Jun 9, 2018
b97bc8e
Use native map
SeaRyanC Jun 9, 2018
0f626fd
Last round PR comments
SeaRyanC Jun 9, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3604,6 +3604,59 @@
"category": "Error",
"code": 6309
},
"Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'": {
"category": "Message",
"code": 6350
},
"Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'": {
"category": "Message",
"code": 6351
},
"Project '{0}' is out of date because output file '{1}' does not exist": {
"category": "Message",
"code": 6352
},

"Project '{0}' is up to date with its upstream types": {
"category": "Message",
"code": 6353
},
"Sorted list of input projects: {0}": {
"category": "Message",
"code": 6354
},
"Would delete the following files:{0}": {
"category": "Message",
"code": 6355
},
"Would build project '{0}'": {
"category": "Message",
"code": 6356
},
"Building project '{0}'...": {
"category": "Message",
"code": 6357
},
"Updating output timestamps of project '{0}'...": {
"category": "Message",
"code": 6358
},
"Project '{0}' is up to date because it was previously built": {
"category": "Message",
"code": 6359
},
"Project '{0}' is up to date": {
"category": "Message",
"code": 6360
},
"Skipping build of project '{0}' because its upstream project '{1}' has errors": {
"category": "Message",
"code": 6361
},
"Project '{0}' can't be built because it depends on a project with errors": {
"category": "Message",
"code": 6362
},

"Variable '{0}' implicitly has an '{1}' type.": {
"category": "Error",
Expand Down
7 changes: 5 additions & 2 deletions src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ namespace ts {
getEnvironmentVariable: name => sys.getEnvironmentVariable ? sys.getEnvironmentVariable(name) : "",
getDirectories: (path: string) => sys.getDirectories(path),
realpath,
readDirectory: (path, extensions, include, exclude, depth) => sys.readDirectory(path, extensions, include, exclude, depth)
readDirectory: (path, extensions, include, exclude, depth) => sys.readDirectory(path, extensions, include, exclude, depth),
getModifiedTime: sys.getModifiedTime && (path => sys.getModifiedTime!(path)),
setModifiedTime: sys.setModifiedTime && ((path, date) => sys.setModifiedTime!(path, date)),
deleteFile: sys.deleteFile && (path => sys.deleteFile!(path))
};
}

Expand Down Expand Up @@ -2706,7 +2709,7 @@ namespace ts {
/**
* Returns the target config filename of a project reference
*/
function resolveProjectReferencePath(host: CompilerHost, ref: ProjectReference): string | undefined {
export function resolveProjectReferencePath(host: CompilerHost, ref: ProjectReference): string | undefined {
if (!host.fileExists(ref.path)) {
return combinePaths(ref.path, "tsconfig.json");
}
Expand Down
23 changes: 23 additions & 0 deletions src/compiler/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ namespace ts {
readFile(path: string, encoding?: string): string | undefined;
getFileSize?(path: string): number;
writeFile(path: string, data: string, writeByteOrderMark?: boolean): void;

/**
* @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that
* use native OS file watching
Expand All @@ -448,6 +449,8 @@ namespace ts {
getDirectories(path: string): string[];
readDirectory(path: string, extensions?: ReadonlyArray<string>, exclude?: ReadonlyArray<string>, include?: ReadonlyArray<string>, depth?: number): string[];
getModifiedTime?(path: string): Date;
setModifiedTime?(path: string, time: Date): void;
deleteFile?(path: string): void;
/**
* A good implementation is node.js' `crypto.createHash`. (https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm)
*/
Expand Down Expand Up @@ -592,6 +595,8 @@ namespace ts {
},
readDirectory,
getModifiedTime,
setModifiedTime,
deleteFile,
createHash: _crypto ? createMD5HashUsingNativeCrypto : generateDjb2Hash,
createSHA256Hash: _crypto ? createSHA256Hash : undefined,
getMemoryUsage() {
Expand Down Expand Up @@ -1069,6 +1074,24 @@ namespace ts {
}
}

function setModifiedTime(path: string, time: Date) {
try {
_fs.utimesSync(path, time, time);
}
catch (e) {
return;
}
}

function deleteFile(path: string) {
try {
return _fs.unlinkSync(path);
}
catch (e) {
return;
}
}

/**
* djb2 hashing algorithm
* http://www.cse.yorku.ca/~oz/hash.html
Expand Down
Loading