Skip to content

Align @types/node with VS Code extension host Node runtime #29

@SingleSourceStudios

Description

@SingleSourceStudios

Context

CodeRabbit flagged during PR #28 review that @types/node@^22.0.0 in editors/vscode/package.json overshoots the Node runtime available in the VS Code extension host for our declared minimum (engines.vscode: ^1.80.0).

VS Code 1.80 ships Node 16.x. VS Code 1.90+ (May 2024) ships Node 20.x. No released VS Code version yet ships Node 22.x, so @types/node@^22 exposes API surface that doesn't exist at runtime.

Why it didn't block v0.1.1

editors/vscode/src/extension.ts is purely declarative — it registers language config, grammars, and snippets via VS Code APIs only. It does not import Node stdlib (fs, path, process, Buffer, etc.), so the type/runtime mismatch has no practical impact on shipped v0.1.1.

Fix

Two viable alignments:

Option A — match current Node 20 host (recommended):

  • @types/node: ^22.0.0^20.0.0
  • engines.vscode: ^1.80.0^1.90.0

Covers ~99% of active VS Code installs (1.90 is ~2 years old). Allows safe use of Node 20 APIs if we ever add runtime logic (validation CLI integration, schema loading from disk, etc.).

Option B — match legacy Node 16 host (conservative):

  • @types/node: ^22.0.0^16.0.0
  • Keep engines.vscode: ^1.80.0

Only pick this if we care about users stuck on 3-year-old VS Code. Probably not worth the ceiling on Node API surface.

Acceptance Criteria

  • @types/node and engines.vscode are consistent (runtime supports types)
  • npm install in editors/vscode/ clean
  • npm run esbuild succeeds
  • Extension builds and loads in VS Code 1.90+ without warnings
  • Ship as part of the next extension release (v0.1.2+)

Out of scope

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions