Automatically consume @types/ folders - #8670
Conversation
|
Vladimir Matveev (@vladima) any ideas why the baselines are failing on the CI server but not locally? |
|
It could potentially have to do with with case-sensitivity. The CI servers run Linux. |
|
Anyone? This is blocking the blog post |
| for (let i = 0; i < options.types.length; i++) { | ||
| processTypeReferenceDirective(options.types[i], resolutions[i]); | ||
| let typeReferences: string[]; | ||
| if (options.types) { |
There was a problem hiding this comment.
it won't work in VS since these files won't be discovered during preprocessing (both then and else statements are affected)
There was a problem hiding this comment.
What do we need to do?
| } | ||
|
|
||
| function getDirectories(path: string): string[] { | ||
| return _fs.readdirSync(path); |
There was a problem hiding this comment.
now it returns both files and folders. is it the intent?
There was a problem hiding this comment.
Fixed
|
|
||
| // or load all types from the automatic type import fields | ||
| if (host && host.getDefaultTypeDirectiveNames) { | ||
| const commonRoot = computeCommonSourceDirectoryOfFilenames(rootFiles, host.getCurrentDirectory(), host.getCanonicalFileName); |
There was a problem hiding this comment.
currently we are tearing off this which might be wrong in cases if custom version of CompilerHost uses it in its implementation of getCanonicalFileName. Probably instead we can make computeCommonSourceDirectoryOfFilenames to accept { getCanonicalFileName(s: string): string } so we can just pass host/
There was a problem hiding this comment.
It also needs getDefaultTypeDirectiveNames
| if (typeReferences) { | ||
| const resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, /*containingFile*/ undefined); | ||
| for (let i = 0; i < typeReferences.length; i++) { | ||
| processTypeReferenceDirective(typeReferences[i], resolutions[i]); |
There was a problem hiding this comment.
Why not just add types and node_modules\@types in parseJsonConfigFileContent.getFileNames?
There was a problem hiding this comment.
Is that called even if there's no config file?
There was a problem hiding this comment.
No, but why do we need to do this if there is no confit file?
There was a problem hiding this comment.
I think we want this to be useful even if you're specifying options on the commandline (or maybe I'm misunderstanding what you're getting at?)
526ff80 to
dba9049
Compare
dba9049 to
4b13348
Compare
|
Any other comments? |
|
|
||
| function getDirectories(path: string): string[] { | ||
| const folder = fso.GetFolder(path); | ||
| return getNames(folder.subfolders); |
There was a problem hiding this comment.
SubFolders is the canonical spelling
Fixes #8275
C++-side implementation of
getDirctoriesis in internal PR 22662