deno
f8d4254c - feat(sync-types): merge user compilerOptions.types (guarded); npm paths cleanup

Commit
134 days ago
feat(sync-types): merge user compilerOptions.types (guarded); npm paths cleanup Stop clobbering the user's `compilerOptions.types`. An entry like `lume/types.ts` can carry both ambient declarations (a `Lume` namespace) and `/// <reference lib="dom" />`, so dropping it loses DOM globals and project namespaces the code relies on. Merge it with the injected deno/node types instead. Guard the merge: only emit a `types` entry we can actually resolve (a bare package name, or a slashed entry with a matching `paths` mapping). An unresolvable `types` entry makes stock tsc/tsgo fail the whole program build (TS2688) and silently skip every file, masking all real diagnostics, which is worse than dropping it. Also clean up npm path generation: always emit the version-less `npm:<pkg>` scheme key plus the exact specifier, drop the redundant alias keys for non-renamed aliases (bundler resolves those via node_modules), keep alias keys for renamed aliases (`$prism` -> `npm:prismjs`), and drop the over-strict "package must already exist on disk" gate for the bare mapping. Fixes latent test-only build breakage from an earlier signature change.
Author
Parents
Loading