1
- import * as ts from "./_namespaces/ts" ;
2
1
import {
3
2
AffectedFileResult ,
4
3
arrayToMap ,
@@ -52,6 +51,7 @@ import {
52
51
ForegroundColorEscapeSequences ,
53
52
formatColorAndReset ,
54
53
getAllProjectOutputs ,
54
+ getBuildInfo as ts_getBuildInfo ,
55
55
getBuildInfoFileVersionMap ,
56
56
getConfigFileParsingDiagnostics ,
57
57
getDirectoryPath ,
@@ -60,6 +60,7 @@ import {
60
60
getFilesInErrorForSummary ,
61
61
getFirstProjectOutput ,
62
62
getLocaleTimeString ,
63
+ getModifiedTime as ts_getModifiedTime ,
63
64
getNormalizedAbsolutePath ,
64
65
getParsedCommandLineOfConfigFile ,
65
66
getPendingEmitKind ,
@@ -108,6 +109,7 @@ import {
108
109
Status ,
109
110
sys ,
110
111
System ,
112
+ toPath as ts_toPath ,
111
113
TypeReferenceDirectiveResolutionCache ,
112
114
unorderedRemoveItem ,
113
115
updateErrorForNoInputFiles ,
@@ -525,7 +527,7 @@ function createSolutionBuilderState<T extends BuilderProgram>(watch: boolean, ho
525
527
}
526
528
527
529
function toPath < T extends BuilderProgram > ( state : SolutionBuilderState < T > , fileName : string ) {
528
- return ts . toPath ( fileName , state . compilerHost . getCurrentDirectory ( ) , state . compilerHost . getCanonicalFileName ) ;
530
+ return ts_toPath ( fileName , state . compilerHost . getCurrentDirectory ( ) , state . compilerHost . getCanonicalFileName ) ;
529
531
}
530
532
531
533
function toResolvedConfigFilePath < T extends BuilderProgram > ( state : SolutionBuilderState < T > , fileName : ResolvedConfigFileName ) : ResolvedConfigFilePath {
@@ -1150,7 +1152,7 @@ function createBuildOrUpdateInvalidedProject<T extends BuilderProgram>(
1150
1152
const path = toPath ( state , name ) ;
1151
1153
emittedOutputs . set ( toPath ( state , name ) , name ) ;
1152
1154
if ( data ?. buildInfo ) setBuildInfo ( state , data . buildInfo , projectPath , options , resultFlags ) ;
1153
- const modifiedTime = data ?. differsOnlyInMap ? ts . getModifiedTime ( state . host , name ) : undefined ;
1155
+ const modifiedTime = data ?. differsOnlyInMap ? ts_getModifiedTime ( state . host , name ) : undefined ;
1154
1156
writeFile ( writeFileCallback ? { writeFile : writeFileCallback } : compilerHost , emitterDiagnostics , name , text , writeByteOrderMark ) ;
1155
1157
// Revert the timestamp for the d.ts that is same
1156
1158
if ( data ?. differsOnlyInMap ) state . host . setModifiedTime ( name , modifiedTime ! ) ;
@@ -1565,7 +1567,7 @@ function getModifiedTime<T extends BuilderProgram>(state: SolutionBuilderState<T
1565
1567
// In watch mode we store the modified times in the cache
1566
1568
// This is either Date | FileWatcherWithModifiedTime because we query modified times first and
1567
1569
// then after complete compilation of the project, watch the files so we dont want to loose these modified times.
1568
- const result = ts . getModifiedTime ( state . host , fileName ) ;
1570
+ const result = ts_getModifiedTime ( state . host , fileName ) ;
1569
1571
if ( state . watch ) {
1570
1572
if ( existing ) ( existing as FileWatcherWithModifiedTime ) . modifiedTime = result ;
1571
1573
else state . filesWatched . set ( path , result ) ;
@@ -1657,7 +1659,7 @@ function getBuildInfo<T extends BuilderProgram>(state: SolutionBuilderState<T>,
1657
1659
return existing . buildInfo || undefined ;
1658
1660
}
1659
1661
const value = state . readFileWithCache ( buildInfoPath ) ;
1660
- const buildInfo = value ? ts . getBuildInfo ( buildInfoPath , value ) : undefined ;
1662
+ const buildInfo = value ? ts_getBuildInfo ( buildInfoPath , value ) : undefined ;
1661
1663
state . buildInfoCache . set ( resolvedConfigPath , { path, buildInfo : buildInfo || false , modifiedTime : modifiedTime || missingFileModifiedTime } ) ;
1662
1664
return buildInfo ;
1663
1665
}
@@ -1732,7 +1734,7 @@ function getUpToDateStatusWorker<T extends BuilderProgram>(state: SolutionBuilde
1732
1734
let buildInfoVersionMap : ReturnType < typeof getBuildInfoFileVersionMap > | undefined ;
1733
1735
if ( buildInfoPath ) {
1734
1736
const buildInfoCacheEntry = getBuildInfoCacheEntry ( state , buildInfoPath , resolvedPath ) ;
1735
- buildInfoTime = buildInfoCacheEntry ?. modifiedTime || ts . getModifiedTime ( host , buildInfoPath ) ;
1737
+ buildInfoTime = buildInfoCacheEntry ?. modifiedTime || ts_getModifiedTime ( host , buildInfoPath ) ;
1736
1738
if ( buildInfoTime === missingFileModifiedTime ) {
1737
1739
if ( ! buildInfoCacheEntry ) {
1738
1740
state . buildInfoCache . set ( resolvedPath , {
@@ -1864,7 +1866,7 @@ function getUpToDateStatusWorker<T extends BuilderProgram>(state: SolutionBuilde
1864
1866
// Output is missing; can stop checking
1865
1867
let outputTime = outputTimeStampMap ?. get ( path ) ;
1866
1868
if ( ! outputTime ) {
1867
- outputTime = ts . getModifiedTime ( state . host , output ) ;
1869
+ outputTime = ts_getModifiedTime ( state . host , output ) ;
1868
1870
outputTimeStampMap ?. set ( path , outputTime ) ;
1869
1871
}
1870
1872
0 commit comments