Skip to content

Migrate off source-map-support to native Node source maps - #11295

Merged
timotheeguerin merged 6 commits into
mainfrom
source-map-support-migrate
Jul 17, 2026
Merged

Migrate off source-map-support to native Node source maps#11295
timotheeguerin merged 6 commits into
mainfrom
source-map-support-migrate

Conversation

@timotheeguerin

Copy link
Copy Markdown
Member

Summary

Node has shipped native source-map support for stack traces since v14.6 via process.setSourceMapsEnabled(true), and every workspace package now requires Node >=22. The third-party source-map-support dependency is therefore no longer needed.

This replaces the source-map-support/register.js import with the native API in the CLI entrypoints and drops the dependency.

Changes

  • Replace source-map-support/register.js with process.setSourceMapsEnabled(true) in the CLI entrypoints (removing the associated try/catch + @ts-ignore/eslint-disable):
    • packages/compiler/src/core/cli/cli.ts
    • packages/pack/src/cli.ts
    • packages/tspd/src/cli.ts
    • packages/bundler/src/cli.ts
    • packages/spector/src/cli/cli.ts
  • Remove source-map-support from the pnpm-workspace.yaml catalog and from the package.json of @typespec/compiler, @typespec/pack, @typespec/tspd, and @typespec/spector.
  • Refresh pnpm-lock.yaml.

Out of scope

packages/http-client-*/package-lock.json reference source-map-support only transitively via the published @typespec/spector; those npm-managed lockfiles regenerate separately when spector is republished.

Validation

  • All affected packages build.
  • Lint (oxlint) and format (prettier) clean on touched files.
  • Remaining pnpm-lock.yaml hits are legitimate transitive deps (@babel/register, chronus tooling), not a direct dependency.

@microsoft-github-policy-service microsoft-github-policy-service Bot added compiler:core Issues for @typespec/compiler tspd Issues for the tspd tool spector Issues related to spector and the spec sets labels Jul 17, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

@typespec/bundler

npm i https://pkg.pr.new/microsoft/typespec/@typespec/bundler@11295

@typespec/compiler

npm i https://pkg.pr.new/microsoft/typespec/@typespec/compiler@11295

@typespec/graphql

npm i https://pkg.pr.new/microsoft/typespec/@typespec/graphql@11295

@typespec/spector

npm i https://pkg.pr.new/microsoft/typespec/@typespec/spector@11295

@typespec/tspd

npm i https://pkg.pr.new/microsoft/typespec/@typespec/tspd@11295

commit: 0ceb928

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/bundler
  • @typespec/compiler
  • @typespec/graphql
  • @typespec/spector
  • @typespec/tspd
Show changes

@typespec/compiler - internal ✏️

Replace the source-map-support dependency with the native Node.js process.setSourceMapsEnabled(true) API in the CLI entrypoints.

@typespec/tspd - internal ✏️

Replace the source-map-support dependency with the native Node.js process.setSourceMapsEnabled(true) API in the CLI entrypoints.

@typespec/spector - internal ✏️

Replace the source-map-support dependency with the native Node.js process.setSourceMapsEnabled(true) API in the CLI entrypoints.

@typespec/bundler - internal ✏️

Replace the source-map-support dependency with the native Node.js process.setSourceMapsEnabled(true) API in the CLI entrypoints.

@typespec/graphql - internal ✏️

Replace the source-map-support dependency with the native Node.js process.setSourceMapsEnabled(true) API in the CLI entrypoints.

@timotheeguerin
timotheeguerin marked this pull request as ready for review July 17, 2026 14:24
@microsoft-github-policy-service microsoft-github-policy-service Bot added emitter:graphql Issues for @typespec/graphql emitter eng labels Jul 17, 2026
@azure-sdk-automation

azure-sdk-automation Bot commented Jul 17, 2026

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@timotheeguerin
timotheeguerin added this pull request to the merge queue Jul 17, 2026
Merged via the queue into main with commit 9f51322 Jul 17, 2026
32 of 33 checks passed
@timotheeguerin
timotheeguerin deleted the source-map-support-migrate branch July 17, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler:core Issues for @typespec/compiler emitter:graphql Issues for @typespec/graphql emitter eng spector Issues related to spector and the spec sets tspd Issues for the tspd tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants