Current behavior:
typescript.importGraph defaults to src/**/*.ts. In TypeScript monorepos where package sources live under workspace folders such as packages/*/src, the default call can analyze zero files even though the project has TypeScript source files.
Minimal reproduction:
- Create a TypeScript workspace with files under
packages/example/src/index.ts and no root src directory.
- Run
typescript.importGraph without an explicit include argument.
Observed behavior:
No source files are analyzed because the default include pattern does not match the workspace layout.
Expected behavior:
The tool either infers source globs from package workspaces or tsconfig includes, or reports that the default include matched nothing with a concrete suggested include.
Proposed fix:
When include is omitted, derive candidate source globs from package.json workspaces and tsconfig include paths before falling back to src/**/*.ts. If no files match, return a compact diagnostic with suggested include patterns.
Current behavior:
typescript.importGraphdefaults tosrc/**/*.ts. In TypeScript monorepos where package sources live under workspace folders such aspackages/*/src, the default call can analyze zero files even though the project has TypeScript source files.Minimal reproduction:
packages/example/src/index.tsand no rootsrcdirectory.typescript.importGraphwithout an explicitincludeargument.Observed behavior:
No source files are analyzed because the default include pattern does not match the workspace layout.
Expected behavior:
The tool either infers source globs from package workspaces or tsconfig includes, or reports that the default include matched nothing with a concrete suggested include.
Proposed fix:
When
includeis omitted, derive candidate source globs frompackage.jsonworkspaces andtsconfiginclude paths before falling back tosrc/**/*.ts. If no files match, return a compact diagnostic with suggested include patterns.