.resolveSourceFileDependencies does not work as I would expect; no node_modules files
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 238
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
I would expect that the following code (in a file named 'index.ts') would list not only that index.ts file,
but also all files that are included by the import statement (in this case the "ts-morph" import).
This is not the case. This code only lists that 1 index.ts file.
What do I need to do to get the files in node_modules listed?
```ts
import * as tm from "ts-morph"
const project = new tm.Project({
tsConfigFilePath: "./tsconfig.json"
})
const files = project.resolveSourceFileDependencies()
files.forEach(($) => {
console.log($.getFilePath())
})
project.getSourceFiles().forEach(($) => {
console.log(">", $.getFilePath())
})
Contributor guide
Research direction
Start with index.ts, tsconfig.json, and the Project.resolveSourceFileDependencies() call shown in the issue. Run the example and inspect the resulting files alongside project.getSourceFiles(); done means the expected handling of the ts-morph import and node_modules files is established and the behavior or guidance matches that expectation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100