processors/typescript: depend on files listed in includes in nearest tsconfig.json#17
processors/typescript: depend on files listed in includes in nearest tsconfig.json#17christianscott wants to merge 6 commits intomainfrom
includes in nearest tsconfig.json#17Conversation
2ddcc39 to
6085e67
Compare
6085e67 to
8641356
Compare
| return []; | ||
| } | ||
|
|
||
| const json = ts.parseJsonText( |
There was a problem hiding this comment.
much nicer :)
| expect(result).toStrictEqual({ | ||
| missing: new Map(), | ||
| resolved: new Map([ | ||
| [fixture('tsconfigs', 'project', 'project.ts'), new Set([decl1])], |
There was a problem hiding this comment.
| [fixture('tsconfigs', 'decls', 'one.d.ts'), new Set([decl2])], | ||
| [fixture('tsconfigs', 'decls', 'two.d.ts'), new Set([decl1])], |
There was a problem hiding this comment.
this seemed a little odd to me at first but it makes sense. If I have decls/a.d.ts and decls/b.d.ts which uses types from a, then any file that uses types from b should transitively depend on a.
joscha
left a comment
There was a problem hiding this comment.
Looking great! Almost there!
| ); | ||
| return parsed.fileNames.filter( | ||
| (fileName) => | ||
| // only include .d.ts files. all other references should be made using `import` or `require`. |
There was a problem hiding this comment.
I think standard ts(x) files can be referenced with types in them? Can you check? Maybe it makes sense for us to not filter this at all and just take the references verbatim?
|
|
||
| // TypeScript files can *implicitly* depend on .d.ts files. We discover | ||
| // these files by extracting them from the nearest tsconfig.json file. | ||
| // These do not need to be processed further since they have already been fully |
There was a problem hiding this comment.
We are sure these are absolute paths at all times?
What happens if a non-existent file is referenced, does it end up in the unresolvable set of files correctly? Did you add a test or if not, could you please?
No description provided.