Files
scriptc/tests/fixtures/node-types
Malte UblandClaude Opus 5.5 f669c46f0d Carry runtime-decided dns.lookup answers dynamically, dial Node-typed net lookups, and keep tsc enum exports undefined until assigned
- dns.lookup with options known only at run time (a checked-dynamic
  value, or one cast to an overload's option type) may answer a string or,
  with `all: true`, an address list, whatever the overload the checker
  picked says: an inline callback now binds its parameters as
  checked-dynamic values. Array.isArray tests a checker-narrowed dyn read's
  dyn value instead of folding on the extracted type, so it never answers
  false for an address list the declared type omits.
- net.connect({ lookup }) accepts a lookup of Node's own type
  (net.LookupFunction: options plus a callback taking an address string
  or list), called as Node's autoSelectFamily dial does ({ hints, all:
  true }); the fallback declarations spell net.LookupFunction that way.
  dns.lookup accepts Node's hints flags (ADDRCONFIG, V4MAPPED, ALL) and
  passes them to getaddrinfo.
- A CommonJS export typed as the empty object literal (tsc's enum output
  `exports.E || (exports.E = {})` after `exports.E = void 0`) rides
  checked-dynamic storage, so the preamble's undefined no longer traps at
  module load: @opentelemetry/api loads and its no-op metrics and trace
  APIs run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 07:58:15 -07:00
..
2026-07-22 18:08:04 -05:00
2026-07-22 18:08:04 -05:00
2026-10-14 21:17:46 -05:00
2026-07-22 18:08:04 -05:00
2026-07-22 18:08:04 -05:00
2026-07-22 18:08:04 -05:00
2026-07-22 18:08:04 -05:00

node-types fixture

A project whose node_modules contains @types/node — the adoption path for real-world Node/TypeScript projects. The vendored node_modules are COMMITTED TEST DATA, pinned so the type surface (and therefore the pinned diagnostics) never drifts with the registry:

  • @types/node 24.13.3
  • undici-types 7.18.2 (its dependency — declares the web-platform globals: fetch/Response/AbortSignal/ReadableStream/...)

What the fixture pins (see tests/harness/project-config.test.ts):

  • argv-env.ts — the SUPPORTED process surface (argv, env) typed by @types/node lowers statically and the binary runs: with @types/node present, the shipped fallback declarations for process/node:fs/ console stand down (their types come from @types/node), but the same members lower to the same libCalls, recognized by name + @types/node provenance.
  • fenced.ts — surface @types/node DECLARES but scriptc does not lower (process.uptime, Buffer.from, setInterval) reports the SC2020-family fence naming @types/node, instead of typechecking its way into a broken binary — and never a raw "Cannot find name" error.
  • source-import/ — an imported TypeScript source may use the RequestInfo global supplied by TypeScript's default DOM lib while scriptc adopts the project's @types/node declarations.

Projects WITHOUT @types/node (every other fixture and the whole corpus) keep the shipped fallback declarations and behave exactly as before.