Skip to content

Commit

Permalink
Revert "fix(compiler-cli): fix case-sensitivity issues in NgtscCompil…
Browse files Browse the repository at this point in the history
…erHost (#36968)" (#37003)

This reverts commit 4abd603.

The changes to the case-sensitivity handling in #36968 caused multiple
projects to fail to build. See #36992, #36993 and #37000.

The issue is related to the logical path handling. But it is felt that
it is safer to revert the entire PR and then to investigate further.

PR Close #37003
  • Loading branch information
petebacondarwin authored and alxhub committed May 8, 2020
1 parent 00b9de5 commit 99b63b6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
Expand Up @@ -44,7 +44,7 @@ export class NgtscCompilerHost implements ts.CompilerHost {
}

getCanonicalFileName(fileName: string): string {
return this.useCaseSensitiveFileNames() ? fileName : fileName.toLowerCase();
return this.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase();
}

useCaseSensitiveFileNames(): boolean {
Expand Down
Expand Up @@ -41,27 +41,5 @@ runInEachFileSystem(() => {
expect(host.getSourceFile(directory, ts.ScriptTarget.ES2015)).toBe(undefined);
});
});

describe('useCaseSensitiveFileNames()', () => {
it('should return the same as `FileSystem.isCaseSensitive()', () => {
const directory = absoluteFrom('/a/b/c');
const fs = getFileSystem();
fs.ensureDir(directory);
const host = new NgtscCompilerHost(fs);
expect(host.useCaseSensitiveFileNames()).toEqual(fs.isCaseSensitive());
});
});

describe('getCanonicalFileName()', () => {
it('should return the original filename if FS is case-sensitive or lower case otherwise',
() => {
const directory = absoluteFrom('/a/b/c');
const fs = getFileSystem();
fs.ensureDir(directory);
const host = new NgtscCompilerHost(fs);
expect(host.getCanonicalFileName(('AbCd.ts')))
.toEqual(fs.isCaseSensitive() ? 'AbCd.ts' : 'abcd.ts');
});
});
});
});

0 comments on commit 99b63b6

Please sign in to comment.