Skip to content
Source
Sign inSign up
TanStack/ai

fix: resolve skipLibCheck-masked dangling .d.ts imports (+ test:dts guardrail) #924

Mergedtombeckenhammerged 2 commits intomain fromrefs/pull/924/headmerged by tombeckenham View on GitHub

tombeckenhamcommented

Summary

  • Fix directory-barrel imports that emit as dangling ../utils.js / ../tools.js / ../middleware.js in published .d.ts (no /index fallback under bundler/node16/nodenext). Under consumer skipLibCheck those symbols silently became any — same root cause as #919, swept across 10 packages including the Gemini experimental adapter #919 missed.
  • Add pnpm test:dts (scripts/scan-dangling-dts.mjs) and wire it into test:pr / test:ci so regressions fail on the producer side.
  • Fix remaining @arethetypeswrong/cli InternalResolutionErrors under --profile esm-only: bare '.' (anthropic), extensionless model-catalog.generated (bedrock), version-dot meta basenames like model-meta-llama3.1 (ollama).

Closes #920

Test plan

  • pnpm test:dts clean after build:all (692 .d.ts files)
  • test:types green on affected packages
  • attw --pack --profile esm-only exit 0 for ai-anthropic, ai-bedrock, ai-ollama, ai-fal, ai-gemini
  • CI test:pr / full PR checks green

Summary by CodeRabbit

  • Bug Fixes

    • Fixed published TypeScript declarations so imports resolve correctly in Node ESM and modern bundlers.
    • Prevented unresolved type references from being incorrectly treated as any.
    • Improved module compatibility across Anthropic, Bedrock, and Ollama integrations.
  • Tests

    • Added automated validation to detect unresolved imports in generated declaration files before release.
    • Enhanced checks for common TypeScript and ESM resolution patterns.
    1. Review Change Stack

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro

      Run ID: 7183cada-d892-484b-ba43-23eac2719225

      📥 Commits

      Reviewing files that changed from the base of the PR and between d2b1e5fce7ab70ac11c243dff90aee0a2d4723d5 and 569e768cadbcc8aae7e965665fa440618e70169c.

      📒 Files selected for processing (6)
      • .changeset/fix-dangling-dts-barrel-imports.md
      • nx.json
      • packages/ai-anthropic/src/tools/tool-converter.ts
      • packages/ai-bedrock/src/model-meta.ts
      • packages/ai-ollama/src/model-meta.ts
      • scripts/scan-dangling-dts.mjs
      ✅ Files skipped from review due to trivial changes (3)
      • packages/ai-bedrock/src/model-meta.ts
      • packages/ai-anthropic/src/tools/tool-converter.ts
      • .changeset/fix-dangling-dts-barrel-imports.md
      🚧 Files skipped from review as they are similar to previous changes (3)
      • nx.json
      • packages/ai-ollama/src/model-meta.ts
      • scripts/scan-dangling-dts.mjs

      📝 Walkthrough

      Walkthrough

      Provider package imports now use resolvable ESM and declaration paths. A recursive scanner validates built .d.ts imports, and Nx caches the new test:dts target. A Changesets entry records patch releases for the affected packages.

      Changes

      DTS resolution cleanup

      Layer / File(s)Summary
      Provider package import paths
      packages/ai-anthropic/src/tools/tool-converter.ts, packages/ai-bedrock/src/model-meta.ts, packages/ai-ollama/src/model-meta.ts
      Provider imports now reference explicit ./index or .js module paths for generated models and model metadata types.
      Dangling DTS scanner and test wiring
      scripts/scan-dangling-dts.mjs, nx.json
      The scanner recursively checks built declarations using Node/bundler resolution rules, reports sorted dangling imports, and runs through a cached test:dts target.
      Release metadata
      .changeset/fix-dangling-dts-barrel-imports.md
      Patch releases and the declaration import fix are recorded for the listed packages.

      Estimated code review effort: 3 (Moderate) | ~20 minutes

      Possibly related PRs

      • TanStack/ai#919: Both update generated declaration imports to concrete module specifiers.
      • TanStack/ai#922: Both involve dangling declaration imports and scanner-based test:dts verification.

      Suggested reviewers: AlemTuzlak, KevinVandy

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 inconclusive)

      Check nameStatusExplanationResolution
      Description check❓ InconclusiveThe description covers the change summary and test plan, but it does not follow the template's checklist and release-impact sections.Add the checklist items and explicit release-impact section to match the repository template.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title is concise and accurately summarizes the main fix and added guardrail.
      Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      ✨ Finishing Touches
      📝 Generate docstrings
      • Create stacked PR
      • Commit on current branch
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `920-sweep-fix-skiplibcheck-masked-dangling-dts-imports-across-packages-+-add-a-guardrail`

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. AlemTuzlak approved these changes

    3. 🚀 Changeset Version Preview

      13 package(s) bumped directly, 32 bumped as dependents.

      🟥 Major bumps

      PackageVersionReason
      @tanstack/ai-anthropic0.16.1 → 1.0.0Changeset
      @tanstack/ai-bedrock0.1.2 → 1.0.0Changeset
      @tanstack/ai-fal0.9.10 → 1.0.0Changeset
      @tanstack/ai-gemini0.19.1 → 1.0.0Changeset
      @tanstack/ai-grok0.14.7 → 1.0.0Changeset
      @tanstack/ai-groq0.5.1 → 1.0.0Changeset
      @tanstack/ai-mistral0.2.1 → 1.0.0Changeset
      @tanstack/ai-ollama0.8.14 → 1.0.0Changeset
      @tanstack/ai-openai0.16.0 → 1.0.0Changeset
      @tanstack/ai-openrouter0.15.8 → 1.0.0Changeset
      @tanstack/ai-react0.16.4 → 1.0.0Changeset
      @tanstack/ai-acp0.2.1 → 1.0.0Dependent
      @tanstack/ai-angular0.2.3 → 1.0.0Dependent
      @tanstack/ai-claude-code0.2.1 → 1.0.0Dependent
      @tanstack/ai-code-mode0.3.6 → 1.0.0Dependent
      @tanstack/ai-code-mode-skills0.3.9 → 1.0.0Dependent
      @tanstack/ai-codex0.2.1 → 1.0.0Dependent
      @tanstack/ai-elevenlabs0.2.32 → 1.0.0Dependent
      @tanstack/ai-grok-build0.2.1 → 1.0.0Dependent
      @tanstack/ai-isolate-node0.1.45 → 1.0.0Dependent
      @tanstack/ai-isolate-quickjs0.1.45 → 1.0.0Dependent
      @tanstack/ai-opencode0.2.1 → 1.0.0Dependent
      @tanstack/ai-preact0.10.3 → 1.0.0Dependent
      @tanstack/ai-react-ui0.8.13 → 1.0.0Dependent
      @tanstack/ai-sandbox0.2.2 → 1.0.0Dependent
      @tanstack/ai-sandbox-cloudflare0.2.2 → 1.0.0Dependent
      @tanstack/ai-sandbox-daytona0.2.0 → 1.0.0Dependent
      @tanstack/ai-sandbox-docker0.2.0 → 1.0.0Dependent
      @tanstack/ai-sandbox-local-process0.2.0 → 1.0.0Dependent
      @tanstack/ai-sandbox-sprites0.2.1 → 1.0.0Dependent
      @tanstack/ai-sandbox-vercel0.2.0 → 1.0.0Dependent
      @tanstack/ai-solid0.14.3 → 1.0.0Dependent
      @tanstack/ai-solid-ui0.7.12 → 1.0.0Dependent
      @tanstack/ai-svelte0.14.3 → 1.0.0Dependent
      @tanstack/ai-vue0.14.3 → 1.0.0Dependent
      @tanstack/openai-base0.9.7 → 1.0.0Dependent

      🟨 Minor bumps

      PackageVersionReason
      @tanstack/ai0.40.0 → 0.41.0Changeset
      @tanstack/ai-client0.20.0 → 0.21.0Changeset

      🟩 Patch bumps

      PackageVersionReason
      @tanstack/ai-devtools-core0.4.22 → 0.4.23Dependent
      @tanstack/ai-isolate-cloudflare0.2.36 → 0.2.37Dependent
      @tanstack/ai-mcp0.2.3 → 0.2.4Dependent
      @tanstack/ai-vue-ui0.2.31 → 0.2.32Dependent
      @tanstack/preact-ai-devtools0.1.65 → 0.1.66Dependent
      @tanstack/react-ai-devtools0.2.65 → 0.2.66Dependent
      @tanstack/solid-ai-devtools0.2.65 → 0.2.66Dependent
    4. View your CI Pipeline Execution ↗ for commit 569e768cadbcc8aae7e965665fa440618e70169c

      CommandStatusDurationResult
      nx affected --targets=test:sherif,test:knip,tes...✅ Succeeded4sView ↗

      ☁️ Nx Cloud last updated this comment at 2026-07-10 11:00:15 UTC

    5. Open in StackBlitz

      @tanstack/ai

      npm i https://pkg.pr.new/@tanstack/ai@924

      @tanstack/ai-acp

      npm i https://pkg.pr.new/@tanstack/ai-acp@924

      @tanstack/ai-angular

      npm i https://pkg.pr.new/@tanstack/ai-angular@924

      @tanstack/ai-anthropic

      npm i https://pkg.pr.new/@tanstack/ai-anthropic@924

      @tanstack/ai-bedrock

      npm i https://pkg.pr.new/@tanstack/ai-bedrock@924

      @tanstack/ai-claude-code

      npm i https://pkg.pr.new/@tanstack/ai-claude-code@924

      @tanstack/ai-client

      npm i https://pkg.pr.new/@tanstack/ai-client@924

      @tanstack/ai-code-mode

      npm i https://pkg.pr.new/@tanstack/ai-code-mode@924

      @tanstack/ai-code-mode-skills

      npm i https://pkg.pr.new/@tanstack/ai-code-mode-skills@924

      @tanstack/ai-codex

      npm i https://pkg.pr.new/@tanstack/ai-codex@924

      @tanstack/ai-devtools-core

      npm i https://pkg.pr.new/@tanstack/ai-devtools-core@924

      @tanstack/ai-elevenlabs

      npm i https://pkg.pr.new/@tanstack/ai-elevenlabs@924

      @tanstack/ai-event-client

      npm i https://pkg.pr.new/@tanstack/ai-event-client@924

      @tanstack/ai-fal

      npm i https://pkg.pr.new/@tanstack/ai-fal@924

      @tanstack/ai-gemini

      npm i https://pkg.pr.new/@tanstack/ai-gemini@924

      @tanstack/ai-grok

      npm i https://pkg.pr.new/@tanstack/ai-grok@924

      @tanstack/ai-grok-build

      npm i https://pkg.pr.new/@tanstack/ai-grok-build@924

      @tanstack/ai-groq

      npm i https://pkg.pr.new/@tanstack/ai-groq@924

      @tanstack/ai-isolate-cloudflare

      npm i https://pkg.pr.new/@tanstack/ai-isolate-cloudflare@924

      @tanstack/ai-isolate-node

      npm i https://pkg.pr.new/@tanstack/ai-isolate-node@924

      @tanstack/ai-isolate-quickjs

      npm i https://pkg.pr.new/@tanstack/ai-isolate-quickjs@924

      @tanstack/ai-mcp

      npm i https://pkg.pr.new/@tanstack/ai-mcp@924

      @tanstack/ai-mistral

      npm i https://pkg.pr.new/@tanstack/ai-mistral@924

      @tanstack/ai-ollama

      npm i https://pkg.pr.new/@tanstack/ai-ollama@924

      @tanstack/ai-openai

      npm i https://pkg.pr.new/@tanstack/ai-openai@924

      @tanstack/ai-opencode

      npm i https://pkg.pr.new/@tanstack/ai-opencode@924

      @tanstack/ai-openrouter

      npm i https://pkg.pr.new/@tanstack/ai-openrouter@924

      @tanstack/ai-preact

      npm i https://pkg.pr.new/@tanstack/ai-preact@924

      @tanstack/ai-react

      npm i https://pkg.pr.new/@tanstack/ai-react@924

      @tanstack/ai-react-ui

      npm i https://pkg.pr.new/@tanstack/ai-react-ui@924

      @tanstack/ai-sandbox

      npm i https://pkg.pr.new/@tanstack/ai-sandbox@924

      @tanstack/ai-sandbox-cloudflare

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-cloudflare@924

      @tanstack/ai-sandbox-daytona

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-daytona@924

      @tanstack/ai-sandbox-docker

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-docker@924

      @tanstack/ai-sandbox-local-process

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-local-process@924

      @tanstack/ai-sandbox-sprites

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-sprites@924

      @tanstack/ai-sandbox-vercel

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-vercel@924

      @tanstack/ai-solid

      npm i https://pkg.pr.new/@tanstack/ai-solid@924

      @tanstack/ai-solid-ui

      npm i https://pkg.pr.new/@tanstack/ai-solid-ui@924

      @tanstack/ai-svelte

      npm i https://pkg.pr.new/@tanstack/ai-svelte@924

      @tanstack/ai-utils

      npm i https://pkg.pr.new/@tanstack/ai-utils@924

      @tanstack/ai-vue

      npm i https://pkg.pr.new/@tanstack/ai-vue@924

      @tanstack/ai-vue-ui

      npm i https://pkg.pr.new/@tanstack/ai-vue-ui@924

      @tanstack/openai-base

      npm i https://pkg.pr.new/@tanstack/openai-base@924

      @tanstack/preact-ai-devtools

      npm i https://pkg.pr.new/@tanstack/preact-ai-devtools@924

      @tanstack/react-ai-devtools

      npm i https://pkg.pr.new/@tanstack/react-ai-devtools@924

      @tanstack/solid-ai-devtools

      npm i https://pkg.pr.new/@tanstack/solid-ai-devtools@924

      commit: 569e768

    6. tombeckenham merged this5fcaf90

    7. tombeckenham closed this

Sign in to join this conversation.