deno
d4d088da - feat(sync-types): materialize remote deps via error-tolerant graph discovery

Commit
133 days ago
feat(sync-types): materialize remote deps via error-tolerant graph discovery The specifier-discovery step was silently a no-op on real projects. `collect_specifiers(".")` globbed node_modules, the DENO_DIR cache, and the generated .deno/ tree (tens of thousands of files), and `check_specifiers` then aborted the whole build on the first unresolved module, discarding everything. Nothing got discovered, so http dependencies referenced only from source (e.g. a `lume/` prefix alias) were never mirrored. Filter graph roots to the project's own source, and build the graph with `create_graph_with_options`, which records unresolved modules as error entries and returns the partial graph instead of failing outright. A real project always has some broken file (dead example scripts, etc.); we keep every specifier that did resolve. Permissions are unchanged: un-allowlisted import hosts are still skipped with the standard --allow-import hint, same as `deno install`. Mark mirrored remote script modules `// @ts-nocheck`. Remote dependencies are not the user's code and Deno doesn't re-type-check them; without this, stock tsc/tsgo reports every type error inside the dependency, dwarfing the project's own diagnostics. The directive suppresses errors in the file while keeping its exported and ambient types available to importers. Also fix the `compilerOptions.types` merge: that field resolves entries as type packages via typeRoots/node_modules and never consults `paths`, so only bare package names belong there. Subpath entries like `lume/types.ts` are dropped (they'd otherwise fail the build with TS2688 and mask every diagnostic) and are instead pulled into the program by the `include` glob, which carries their ambient declarations and lib references just the same. On the sample projects (project's own errors): docs 471 -> 90, dotcom ~83 -> 26, fresh 463 -> 174, std 133 -> 130.
Author
Parents
Loading