Skip to content

Commit 7e0825a

Browse files
committed
Clean, etc
1 parent b1dedf2 commit 7e0825a

7 files changed

Lines changed: 350 additions & 68 deletions

File tree

src/compiler/diagnosticMessages.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3593,6 +3593,43 @@
35933593
"category": "Error",
35943594
"code": 6309
35953595
},
3596+
"Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'": {
3597+
"category": "Message",
3598+
"code": 6350
3599+
},
3600+
"Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'": {
3601+
"category": "Message",
3602+
"code": 6351
3603+
},
3604+
"Project '{0}' is out of date because output file '{1}' does not exist": {
3605+
"category": "Message",
3606+
"code": 6352
3607+
},
3608+
3609+
"Project '{0}' is up to date with its upstream types": {
3610+
"category": "Message",
3611+
"code": 6353
3612+
},
3613+
"Sorted list of input projects: {0}": {
3614+
"category": "Message",
3615+
"code": 6354
3616+
},
3617+
"Would delete the following files:{0}": {
3618+
"category": "Message",
3619+
"code": 6355
3620+
},
3621+
"Would build project '{0}'": {
3622+
"category": "Message",
3623+
"code": 6356
3624+
},
3625+
"Building project '{0}'...": {
3626+
"category": "Message",
3627+
"code": 6357
3628+
},
3629+
"Updating output timestamps of project '{0}'...": {
3630+
"category": "Message",
3631+
"code": 6358
3632+
},
35963633

35973634
"Variable '{0}' implicitly has an '{1}' type.": {
35983635
"category": "Error",

src/compiler/program.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@ namespace ts {
189189
getEnvironmentVariable: name => sys.getEnvironmentVariable ? sys.getEnvironmentVariable(name) : "",
190190
getDirectories: (path: string) => sys.getDirectories(path),
191191
realpath,
192-
readDirectory: (path, extensions, include, exclude, depth) => sys.readDirectory(path, extensions, include, exclude, depth)
192+
readDirectory: (path, extensions, include, exclude, depth) => sys.readDirectory(path, extensions, include, exclude, depth),
193+
getModifiedTime: path => sys.getModifiedTime(path),
194+
setModifiedTime: (path, date) => sys.setModifiedTime(path, date),
195+
deleteFile: path => sys.deleteFile(path)
193196
};
194197
}
195198

@@ -2692,7 +2695,7 @@ namespace ts {
26922695
/**
26932696
* Returns the target config filename of a project reference
26942697
*/
2695-
function resolveProjectReferencePath(host: CompilerHost, ref: ProjectReference): string | undefined {
2698+
export function resolveProjectReferencePath(host: CompilerHost, ref: ProjectReference): string | undefined {
26962699
if (!host.fileExists(ref.path)) {
26972700
return combinePaths(ref.path, "tsconfig.json");
26982701
}

src/compiler/sys.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ namespace ts {
432432
readFile(path: string, encoding?: string): string | undefined;
433433
getFileSize?(path: string): number;
434434
writeFile(path: string, data: string, writeByteOrderMark?: boolean): void;
435+
435436
/**
436437
* @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that
437438
* use native OS file watching
@@ -447,6 +448,8 @@ namespace ts {
447448
getDirectories(path: string): string[];
448449
readDirectory(path: string, extensions?: ReadonlyArray<string>, exclude?: ReadonlyArray<string>, include?: ReadonlyArray<string>, depth?: number): string[];
449450
getModifiedTime?(path: string): Date;
451+
setModifiedTime?(path: string, time: Date): void;
452+
deleteFile?(path: string): void;
450453
/**
451454
* This should be cryptographically secure.
452455
* A good implementation is node.js' `crypto.createHash`. (https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm)
@@ -589,6 +592,8 @@ namespace ts {
589592
},
590593
readDirectory,
591594
getModifiedTime,
595+
setModifiedTime,
596+
deleteFile,
592597
createHash: _crypto ? createMD5HashUsingNativeCrypto : generateDjb2Hash,
593598
getMemoryUsage() {
594599
if (global.gc) {
@@ -1063,6 +1068,22 @@ namespace ts {
10631068
}
10641069
}
10651070

1071+
function setModifiedTime(path: string, time: Date) {
1072+
try {
1073+
_fs.utimesSync(path, time, time);
1074+
}
1075+
catch (e) {
1076+
}
1077+
}
1078+
1079+
function deleteFile(path: string) {
1080+
try {
1081+
return _fs.unlinkSync(path);
1082+
}
1083+
catch (e) {
1084+
}
1085+
}
1086+
10661087
/**
10671088
* djb2 hashing algorithm
10681089
* http://www.cse.yorku.ca/~oz/hash.html

0 commit comments

Comments
 (0)