-
-
Notifications
You must be signed in to change notification settings - Fork 111
chore: dependency revision for changeset fixes #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughRemoved Changes
Estimated code review effortπ― 2 (Simple) | β±οΈ ~10 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touchesβ Failed checks (1 warning)
β Passed checks (2 passed)
β¨ Finishing touchesπ§ͺ Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and canβt be posted inline due to platform limitations.
β οΈ Outside diff range comments (2)
packages/typescript/ai-react-ui/package.json (1)
8-12: Correct the repository directory path.The repository directory field points to
"packages/typescript/ai"but should point to"packages/typescript/ai-react-ui"to match this package's actual location.π Proposed fix
"repository": { "type": "git", "url": "git+https://github.com/TanStack/ai.git", - "directory": "packages/typescript/ai" + "directory": "packages/typescript/ai-react-ui" },packages/typescript/ai-react/package.json (1)
43-57: Verify consuming applications handle @tanstack/ai peer dependency correctly.ai-react imports types from @tanstack/ai (AnyClientTool, ModelMessage in use-chat.ts and types.ts) but has moved it to peerDependencies only. This is a breaking change: applications that previously relied on transitive dependency resolution will fail at build time with type resolution errors unless they explicitly install @tanstack/ai.
Ensure:
- Consuming applications and examples have @tanstack/ai explicitly listed as a dependency (ts-react-chat already does this)
- Breaking change is documented in CHANGELOG/migration guide
- TypeScript strict mode is tested to confirm type resolution works
π Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
π Files selected for processing (10)
packages/typescript/ai-anthropic/package.jsonpackages/typescript/ai-gemini/package.jsonpackages/typescript/ai-ollama/package.jsonpackages/typescript/ai-openai/package.jsonpackages/typescript/ai-react-ui/package.jsonpackages/typescript/ai-react/package.jsonpackages/typescript/ai-solid/package.jsonpackages/typescript/ai-svelte/package.jsonpackages/typescript/ai-vue-ui/package.jsonpackages/typescript/ai-vue/package.json
π§° Additional context used
π§ Learnings (5)
π Common learnings
Learnt from: CR
Repo: TanStack/ai PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T17:09:09.794Z
Learning: Applies to packages/typescript/*/src/index.ts : Export tree-shakeable adapters with clear subpath exports in package.json (e.g., `tanstack/ai/adapters`, `tanstack/ai-openai/adapters`) to minimize bundle size
Learnt from: CR
Repo: TanStack/ai PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T17:09:09.794Z
Learning: Applies to packages/*/package.json : Use `workspace:*` protocol for internal package dependencies in package.json (e.g., `"tanstack/ai": "workspace:*"`)
Learnt from: CR
Repo: TanStack/ai PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T17:09:09.794Z
Learning: Implement framework integrations using the headless `tanstack/ai-client` for state management with framework-specific hooks (useChat) on top
π Learning: 2025-12-13T17:09:09.794Z
Learnt from: CR
Repo: TanStack/ai PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T17:09:09.794Z
Learning: Applies to packages/typescript/*/src/index.ts : Export tree-shakeable adapters with clear subpath exports in package.json (e.g., `tanstack/ai/adapters`, `tanstack/ai-openai/adapters`) to minimize bundle size
Applied to files:
packages/typescript/ai-react/package.jsonpackages/typescript/ai-react-ui/package.jsonpackages/typescript/ai-solid/package.jsonpackages/typescript/ai-ollama/package.jsonpackages/typescript/ai-openai/package.jsonpackages/typescript/ai-vue/package.jsonpackages/typescript/ai-gemini/package.jsonpackages/typescript/ai-anthropic/package.jsonpackages/typescript/ai-vue-ui/package.jsonpackages/typescript/ai-svelte/package.json
π Learning: 2025-12-13T17:09:09.794Z
Learnt from: CR
Repo: TanStack/ai PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T17:09:09.794Z
Learning: Applies to packages/*/package.json : Use `workspace:*` protocol for internal package dependencies in package.json (e.g., `"tanstack/ai": "workspace:*"`)
Applied to files:
packages/typescript/ai-react/package.jsonpackages/typescript/ai-react-ui/package.jsonpackages/typescript/ai-solid/package.jsonpackages/typescript/ai-ollama/package.jsonpackages/typescript/ai-openai/package.jsonpackages/typescript/ai-vue/package.jsonpackages/typescript/ai-gemini/package.jsonpackages/typescript/ai-anthropic/package.jsonpackages/typescript/ai-vue-ui/package.jsonpackages/typescript/ai-svelte/package.json
π Learning: 2025-12-13T17:09:09.794Z
Learnt from: CR
Repo: TanStack/ai PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T17:09:09.794Z
Learning: Applies to packages/typescript/*/src/adapters/*.ts : Create individual adapter implementations for each provider capability (text, embed, summarize, image) with separate exports to enable tree-shaking
Applied to files:
packages/typescript/ai-ollama/package.jsonpackages/typescript/ai-gemini/package.json
π Learning: 2025-12-13T17:09:09.794Z
Learnt from: CR
Repo: TanStack/ai PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T17:09:09.794Z
Learning: Applies to .eslintrc* : Use ESLint with custom TanStack config for linting all TypeScript and JavaScript files
Applied to files:
packages/typescript/ai-ollama/package.jsonpackages/typescript/ai-openai/package.jsonpackages/typescript/ai-gemini/package.jsonpackages/typescript/ai-anthropic/package.json
π Additional comments (16)
packages/typescript/ai-vue/package.json (2)
41-43: Correct dependency structure for framework integration.The dependency on
@tanstack/ai-clientwithworkspace:*protocol is correct. This aligns with the established pattern where framework integrations depend on the headless client library for state management.Based on learnings, framework integrations should use
@tanstack/ai-clientand theworkspace:*protocol is appropriate for internal monorepo dependencies.
54-56: No actionable feedback required. Theworkspace:*protocol in peerDependencies is the correct and intentional pattern used across this monorepo for internal package dependencies.Likely an incorrect or invalid review comment.
packages/typescript/ai-vue-ui/package.json (1)
37-48: The removal of@tanstack/ai-clientfromai-vue-uidependencies is safe and correct. The@tanstack/ai-vuepackage already depends on@tanstack/ai-clientand re-exports key functionality includingfetchServerSentEvents,fetchHttpStream,stream, andcreateChatClientOptions, soai-vue-uireceives the headless client functionality transitively through@tanstack/ai-vue. This is a clean architectural approach that removes unnecessary direct dependencies while maintaining proper access to the client through the appropriate abstraction layer.packages/typescript/ai-anthropic/package.json (1)
42-52: Ensure a changeset is generated for this dependency architecture change.Converting
@tanstack/aifrom a direct dependency to peer-only is a potentially breaking change that alters installation requirements for consumers. The PR checklist indicates that changeset generation is unchecked. Please ensure a changeset is created to document this change, especially since it affects published packages and installation semantics.packages/typescript/ai-gemini/package.json (2)
49-52: Theworkspace:*protocol for@tanstack/aiis correct for monorepo development.pnpm automatically transforms workspace: dependencies to concrete versions when publishing, allowing packages to be published to npm without intermediary steps. No action needed if using standard pnpm publish commands.
42-44: Migration guidance required for peer dependency change.Peer dependencies are dependencies your app relies on but expects another package to provide, and they are a crucial tool in reducing the size of your final production app. Moving
@tanstack/aifrom dependencies to peerDependencies-only is the correct design for adapter packages to prevent duplicate core library bundling. However, this creates a breaking change requiring:
- Changeset verification: Confirm a major version bump changeset was created to document this breaking change.
- Installation guidance: Ensure users understand they must explicitly install
@tanstack/aialongside this adapter package (this appears addressed in official migration documentation).- Consistency check: Verify this pattern is applied uniformly across all adapter packages (@tanstack/ai-openai, @tanstack/ai-anthropic, @tanstack/ai-ollama).
packages/typescript/ai-react-ui/package.json (1)
44-49: LGTM! Peer dependency structure is architecturally sound.Removing
@tanstack/ai-clientfrom peerDependencies is correct. The package depends on@tanstack/ai-react(which itself depends on@tanstack/ai-client), so there's no need forai-react-uito declare a direct peer dependency on the lower-level client package. This follows proper layering where UI components use hooks from ai-react rather than directly interacting with ai-client.Based on learnings, this aligns with the architecture where framework integrations use the headless
@tanstack/ai-clientfor state management, with UI layers built on top.packages/typescript/ai-react/package.json (1)
54-54: The@tanstack/aipeer dependency is correctly declared. The ai-react source code importsAnyClientToolandModelMessagetypes from@tanstack/aiin bothuse-chat.tsandtypes.ts, confirming this dependency is required.packages/typescript/ai-ollama/package.json (1)
43-53: No action required. The dependency change is intentional, consistent across all adapter packages, and already documented in the changeset as part of the tree-shakeable adapter architecture refactoring. Source code imports work correctly with the new structure.packages/typescript/ai-openai/package.json (2)
49-52: The peerDependencies configuration is correct. Theworkspace:*protocol is automatically resolved by pnpm when publishing to npmβno additional configuration is needed. This pattern is consistently used throughout the repository and properly handled by the changeset + pnpm publishing workflow.
42-44: No changes neededβthe peerDependencies pattern is correct for adapter packages.The ai-openai package does not import
@tanstack/aidirectly, confirming this is an adapter pattern where consumers explicitly import both@tanstack/ai(core) and@tanstack/ai-openai(adapter) separately. Moving@tanstack/aito peerDependencies only clarifies the actual dependency relationship and supports tree-shaking optimization goals. This is not a breaking change if documented in the changeset.packages/typescript/ai-svelte/package.json (2)
45-63: Changeset for dependency restructuring has been created.A changeset file (.changeset/honest-bugs-tell.md) has been added that documents this release. The changeset includes
@tanstack/ai-sveltewith a minor version bump, along with other affected packages. The change is now properly tracked for automated versioning and changelog generation.
45-48: The dependency restructuring is correct and follows the intended architecture for all TanStack AI framework integrations. The concern about build failures is unfounded.ai-svelte imports only type definitions from
@tanstack/ai(specificallyAnyClientToolandModelMessage), not runtime code. Type-only imports are erased at compile time and don't require the package in dependencies.This peer dependency pattern is intentional and consistent across all framework packages (ai-react, ai-solid, ai-vue, and ai-svelte). Users must explicitly install
@tanstack/aito access adapters and tool definitionsβit's not meant to be transitively bundled. The architecture correctly separates:
- Framework packages bundle
@tanstack/ai-clientfor state management- Users install
@tanstack/aiseparately for providers/adapters and tool definitionsLikely an incorrect or invalid review comment.
packages/typescript/ai-solid/package.json (3)
41-43: This change is correctly aligned with the dependency architecture across all framework packages.All framework integration packages (ai-react, ai-vue, ai-svelte, and ai-solid) consistently declare
@tanstack/ai-clientas a regular dependency using theworkspace:*protocol. This is the established pattern and is intentional.
1-58: Generate a changeset for this breaking dependency change.The PR checklist indicates that a changeset has not yet been generated. This dependency restructuring is a breaking change because:
- Users must now explicitly install
@tanstack/ai(moved to peerDependencies)- Module resolution semantics have changed for
@tanstack/ai-client- Existing projects may fail if they don't have
@tanstack/aiinstalledEnsure a changeset is created to document this breaking change for consumers. Run:
#!/bin/bash # Description: Check for changeset files related to this PR # Look for changeset files fd -e md . .changeset --exec cat {}
54-56: The current dependency structure is correct.ai-solidlegitimately imports types (AnyClientTool,ModelMessage) from@tanstack/ai, which is appropriate for a peer dependency since type-only imports have no runtime cost and are erased during compilation. The package correctly uses@tanstack/ai-clientas a regular dependency for the headlessChatClientat runtime, following the documented architecture pattern of framework integrations wrapping the shared client.Likely an incorrect or invalid review comment.
| "dependencies": { | ||
| "@anthropic-ai/sdk": "^0.71.0", | ||
| "@tanstack/ai": "workspace:*" | ||
| "@anthropic-ai/sdk": "^0.71.0" | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π§© Analysis chain
π Script executed:
#!/bin/bash
# Search for @tanstack/ai imports in ai-anthropic source code
echo "Checking for @tanstack/ai imports in packages/typescript/ai-anthropic/src/"
rg -n "from ['\"]@tanstack/ai['\"]" packages/typescript/ai-anthropic/src/ || echo "No direct imports found"
echo ""
echo "Also checking for relative imports that might reference tanstack/ai types:"
rg -n "@tanstack/ai" packages/typescript/ai-anthropic/src/ || echo "No @tanstack/ai references found"Repository: TanStack/ai
Length of output: 2777
This is a breaking change that requires a changeset.
The source code in packages/typescript/ai-anthropic/src/ directly imports from @tanstack/ai, including non-type imports from @tanstack/ai and @tanstack/ai/adapters in the adapter implementations (text.ts, summarize.ts). Removing @tanstack/ai from dependencies while retaining only a peerDependency means consuming projects must now explicitly install @tanstack/ai themselves, or the package will fail at runtime.
While this peer-dependency architecture may be intentional for adapter packages, it represents a breaking change in the installation contract. Verify this change is deliberate and check the changeset item in the PR checklist.
|
View your CI Pipeline Execution β for commit 249669d
βοΈ Nx Cloud last updated this comment at |
@tanstack/ai
@tanstack/ai-anthropic
@tanstack/ai-client
@tanstack/ai-devtools-core
@tanstack/ai-gemini
@tanstack/ai-ollama
@tanstack/ai-openai
@tanstack/ai-react
@tanstack/ai-react-ui
@tanstack/ai-solid
@tanstack/ai-solid-ui
@tanstack/ai-svelte
@tanstack/ai-vue
@tanstack/ai-vue-ui
@tanstack/react-ai-devtools
@tanstack/solid-ai-devtools
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and canβt be posted inline due to platform limitations.
β οΈ Outside diff range comments (1)
packages/typescript/ai-react/package.json (1)
43-57: The changeset severity is incorrect for this breaking dependency change.A changeset (
.changeset/honest-bugs-tell.md) has been added, which is good. However, it documents@tanstack/ai-reactwith aminorversion bump, but moving@tanstack/aifrom dependencies to peerDependencies is a breaking change that requires amajorversion bump per semantic versioning. Consumers who relied on@tanstack/aias a transitive dependency will now break and must install it explicitly themselves.Update the changeset to bump
@tanstack/ai-reactfromminortomajor.
π Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
β Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
π Files selected for processing (9)
packages/typescript/ai-anthropic/package.jsonpackages/typescript/ai-gemini/package.jsonpackages/typescript/ai-ollama/package.jsonpackages/typescript/ai-openai/package.jsonpackages/typescript/ai-react/package.jsonpackages/typescript/ai-solid-ui/package.jsonpackages/typescript/ai-solid/package.jsonpackages/typescript/ai-svelte/package.jsonpackages/typescript/ai-vue/package.json
π§ Files skipped from review as they are similar to previous changes (7)
- packages/typescript/ai-ollama/package.json
- packages/typescript/ai-anthropic/package.json
- packages/typescript/ai-svelte/package.json
- packages/typescript/ai-solid/package.json
- packages/typescript/ai-gemini/package.json
- packages/typescript/ai-openai/package.json
- packages/typescript/ai-vue/package.json
π§° Additional context used
π§ Learnings (3)
π Common learnings
Learnt from: CR
Repo: TanStack/ai PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T17:09:09.794Z
Learning: Create changesets with `pnpm changeset` before making changes to prepare for release version bumping and publishing
Learnt from: CR
Repo: TanStack/ai PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T17:09:09.794Z
Learning: Applies to packages/*/package.json : Use `workspace:*` protocol for internal package dependencies in package.json (e.g., `"tanstack/ai": "workspace:*"`)
Learnt from: CR
Repo: TanStack/ai PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T17:09:09.794Z
Learning: Applies to packages/typescript/*/src/index.ts : Export tree-shakeable adapters with clear subpath exports in package.json (e.g., `tanstack/ai/adapters`, `tanstack/ai-openai/adapters`) to minimize bundle size
Learnt from: CR
Repo: TanStack/ai PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T17:09:09.794Z
Learning: Use Nx workspace with affected commands to optimize testing and building only changed packages and their dependents
Learnt from: CR
Repo: TanStack/ai PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T17:09:09.794Z
Learning: Implement framework integrations using the headless `tanstack/ai-client` for state management with framework-specific hooks (useChat) on top
π Learning: 2025-12-13T17:09:09.794Z
Learnt from: CR
Repo: TanStack/ai PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T17:09:09.794Z
Learning: Applies to packages/*/package.json : Use `workspace:*` protocol for internal package dependencies in package.json (e.g., `"tanstack/ai": "workspace:*"`)
Applied to files:
packages/typescript/ai-solid-ui/package.jsonpackages/typescript/ai-react/package.json
π Learning: 2025-12-13T17:09:09.794Z
Learnt from: CR
Repo: TanStack/ai PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T17:09:09.794Z
Learning: Applies to packages/typescript/*/src/index.ts : Export tree-shakeable adapters with clear subpath exports in package.json (e.g., `tanstack/ai/adapters`, `tanstack/ai-openai/adapters`) to minimize bundle size
Applied to files:
packages/typescript/ai-solid-ui/package.jsonpackages/typescript/ai-react/package.json
β° Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test
* chore: dependency revision for changeset fixes * fix * ci: apply automated fixes * update package.josns * lock update * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
π― Changes
β Checklist
pnpm run test:pr.π Release Impact
Summary by CodeRabbit
βοΈ Tip: You can customize this high-level summary in your review settings.