Skip to content

fix[notask]: emit NodeNext-compatible declaration specifiers#3381

Open
localhost41 wants to merge 1 commit into
tetherto:mainfrom
localhost41:fix/sdk-nodenext-declarations
Open

fix[notask]: emit NodeNext-compatible declaration specifiers#3381
localhost41 wants to merge 1 commit into
tetherto:mainfrom
localhost41:fix/sdk-nodenext-declarations

Conversation

@localhost41

Copy link
Copy Markdown

Closes #3323.

The SDK’s post-build alias resolver was adding .js extensions to runtime imports but leaving the corresponding declaration imports extensionless. Under moduleResolution: "NodeNext", TypeScript could not follow the declaration re-export chain, so model constants appeared to be missing even though they were available at runtime.

This updates the resolver to emit .js specifiers for internal references in declaration output as well. It also handles parent-directory paths such as ../schemas, which were still present in the generated declarations.

Added a regression test that:

  • checks the rewritten declaration paths;
  • covers both @qvac/sdk and @qvac/sdk/models;
  • runs a real tsc consumer using moduleResolution: "NodeNext";
  • verifies the model constants reported in the issue;
  • confirms external package subpaths are left unchanged.

Validated with:

  • SDK lint
  • SDK typecheck
  • full SDK build
  • full SDK unit suite
  • Node 24 NodeNext consumer
  • clean install from the generated npm tarball

Runtime JavaScript output is unchanged.

@github-actions

Copy link
Copy Markdown
Contributor

Review Status

Current Status: ❌ PENDING
Approvals so far: none

Pending reviews: Needs 1 Management or Team Lead, and 1 more from Management, Team Lead, or Member.

@github-actions github-actions Bot added the community-contribution PR or issue from an external contributor label Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution PR or issue from an external contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@qvac/sdk 0.15.0: model constants fail to typecheck under moduleResolution nodenext (runtime OK)

1 participant