Host uses getDirectories from System#3165
Conversation
|
The playground still works, though the test failures have shown the effect of this on twoslash; now it's falling back to the disk and we're getting more info, it seeems? |
|
Yes, it seems it was getting extra documentation for |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-plant-05c166c10-3165.centralus.5.azurestaticapps.net |
|
@jakebailey Let me know if there's anything I should do on this PR. Happy to make any changes you'd like! |
|
I think the main concern is breaking people who depended on this behavior (e.g. shiki?) but I serious doubt it's a problem. |
|
Understood. FWIW, this shouldn't affect any browser uses; it's only in Node where additional type definitions would get picked up, which could break type checking but could be fixed with a On the other hand, from our perspective (building our own CLI for typechecking in the style of But I understand compatibility is a tricky issue; let me know if there's anything I can do to help investigate. |
I found that a
Hostcreated fromcreateVirtualCompilerHost/createVirtualTypeScriptEnvironmentignores thegetDirectoriesprovided by theSystem, despitegetDirectoriesbeing a required component ofSystem. Instead it forces a function that returns[]in all cases.This is problematic for fs-based systems. The end result in my application is that TypeScript fails to preload all the types in
node_modules/@typesbecause it's unable to list that directory.This one-line fix works for my application, and I added a somewhat realistic test (via existing
jestdefinitions innode_modules/@types) that works only with this change.