You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
getSourceFilePathInNewDir broken by recent commits #9768
The common directory is C:/Users/Nicholas/example.
If the current directory is C:/Users/Nicholas/example/b, for the a.ts source file:
cannonical source = ../a/a.ts
cannonical common = ..
So isSourceFileInCommonSourceDirectory will be true.
However, for the b.ts source file:
cannonical source = b.ts
cannonical common = ..
So isSourceFileInCommonSourceDirectory will be false - which will result in the absolute path to the source file - C:/Users/Nicholas/example/b/b.ts - being returned.
Specifically, this change to the implementation breaks my tsify-based builds.
I don't quite understand. The sourceFilePath is always an absolute path returned by getNormalizedAbsolutePath, and getCanonicalFileName only changes casing, so why does the cannonical source file path of C:/Users/Nicholas/example/b/b.ts become b.ts?
getCanonicalFileName does more than change the case; it returns a relative path. And if C:/Users/Nicholas/example/b is the current directory, b.ts is the cannonical path. The examples I gave were from console outputs I placed in the source - with some upper directory levels removed.
getCanonicalFileName is implemented in the host, so it's tsify's implementation that's being called. It's not calling the TypeScript implementation of getCanonicalFileName - which, as you've said, just changes the case.
Activity
zhengbli commentedon Aug 3, 2016
I don't quite understand. The
sourceFilePathis always an absolute path returned bygetNormalizedAbsolutePath, andgetCanonicalFileNameonly changes casing, so why does the cannonical source file path ofC:/Users/Nicholas/example/b/b.tsbecomeb.ts?cartant commentedon Aug 3, 2016
getCanonicalFileNamedoes more than change the case; it returns a relative path. And ifC:/Users/Nicholas/example/bis the current directory,b.tsis the cannonical path. The examples I gave were from console outputs I placed in the source - with some upper directory levels removed.cartant commentedon Aug 3, 2016
I think I see the problem.
getCanonicalFileNameis implemented in the host, so it'stsify's implementation that's being called. It's not calling the TypeScript implementation ofgetCanonicalFileName- which, as you've said, just changes the case.Thanks. I guess I have something to fix in
tsify.