Skip to content

fix: add CJS declarations for HTTP and LangChain exports - #139

Merged
sjungwon03 merged 1 commit into
devfrom
fix/138-cjs-http-langchain-types
Aug 3, 2026
Merged

fix: add CJS declarations for HTTP and LangChain exports#139
sjungwon03 merged 1 commit into
devfrom
fix/138-cjs-http-langchain-types

Conversation

@sjungwon03

Copy link
Copy Markdown
Member

Summary

  • Fixes Node16/CommonJS TypeScript static imports of @theorvane/type-mcp/http and @theorvane/type-mcp/langchain, which previously selected ESM declarations and failed with TS1479 despite working CJS runtime exports.
  • Adds nested import/require export conditions for root, HTTP, and LangChain entrypoints; CommonJS now selects generated .d.cts declarations and .cjs runtime files.
  • Releases this package-contract correction as @theorvane/type-mcp@0.3.1.
  • Extends packed Node16 CommonJS regression coverage to compile and execute legacy decorators together with static HTTP/LangChain imports, and verifies CJS declaration artifacts in package and publish checks.
  • Documents the Node16 CJS import contract and the required @langchain/core peer for the LangChain adapter.

Verification

  • npm run typecheck
  • npm run lint
  • npm test — 61 tests
  • npm run verify:package
  • npm run verify:consumer — packed Node16 CommonJS compile/runtime regression
  • npm run verify:publish
  • npm audit --omit=dev --audit-level=low — 0 vulnerabilities
  • git diff --check

Closes #138

@sjungwon03 sjungwon03 added area:core Metadata, decorators, compiler, resolver, or stdio core bug Something isn't working size:S About one day labels Aug 3, 2026
@github-actions github-actions Bot removed area:core Metadata, decorators, compiler, resolver, or stdio core size:S About one day bug Something isn't working labels Aug 3, 2026
@github-actions
github-actions Bot requested a review from sjungwon03-ai August 3, 2026 07:30

@sjungwon03-ai sjungwon03-ai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verified the exact Node16 CJS declaration head: http/langchain/root conditionally select generated .d.cts declarations for require, packed CJS static imports compile and execute with the LangChain peer, and package/publish artifact checks cover both declaration forms.

@sjungwon03
sjungwon03 merged commit cb819f7 into dev Aug 3, 2026
6 of 9 checks passed
@sjungwon03
sjungwon03 deleted the fix/138-cjs-http-langchain-types branch August 3, 2026 07:33
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.

fix: provide CJS declarations for http and langchain exports

2 participants