Skip to content

fix(dts-generator): fix runCheck for TS6 compatibility#582

Open
akudev wants to merge 2 commits into
mainfrom
fix/TS6
Open

fix(dts-generator): fix runCheck for TS6 compatibility#582
akudev wants to merge 2 commits into
mainfrom
fix/TS6

Conversation

@akudev
Copy link
Copy Markdown
Member

@akudev akudev commented May 28, 2026

TS6 introduced three breaking changes that affected runCheck:

  1. moduleResolution "Node16" rejects bare-specifier ambient module declarations (declare module "sap/ui/core/Control") — switched to module: ESNext + moduleResolution: Bundler which supports them.

  2. The default types list is now empty, so @types packages are no longer auto-included — added discovery logic that reads declared @types/* from the nearest package.json and walks up from CWD to locate them in potentially hoisted node_modules directories.

  3. In monorepo/workspace setups the walk-up could find unrelated @types packages (e.g. @types/openui5) that conflict with the .d.ts files being checked — scoped discovery to only declared dependencies.

TS6 introduced three breaking changes that affected runCheck:

1. moduleResolution "Node16" rejects bare-specifier ambient module
   declarations (declare module "sap/ui/core/Control") — switched to
   module: ESNext + moduleResolution: Bundler which supports them.

2. The default types list is now empty, so @types packages are no
   longer auto-included — added discovery logic that reads declared
   @types/* from the nearest package.json and walks up from CWD to
   locate them in potentially hoisted node_modules directories.

3. In monorepo/workspace setups the walk-up could find unrelated
   @types packages (e.g. @types/openui5) that conflict with the .d.ts
   files being checked — scoped discovery to only declared dependencies.
Runs the runCheck CLI against the snapshot .d.ts files as part of CI.
This would have caught the TS6 module resolution and @types discovery
regressions before they reached consumers.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the dts-generator runCheck compile check for TypeScript 6 compatibility, especially around module resolution and explicit inclusion of declared @types packages.

Changes:

  • Switches compile-check module settings from Node16 to ESNext/Bundler.
  • Adds discovery of declared @types/* dependencies from package.json.
  • Walks ancestor node_modules/@types folders to configure typeRoots and types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/dts-generator/src/runCheck.ts
Comment thread packages/dts-generator/src/runCheck.ts
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants