Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": [
"@svitejs/changesets-changelog-github-compact",
{ "repo": "TanStack/ai" }
],
"commit": false,
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"fixed": [],
"linked": [],
"ignore": []
}
1 change: 1 addition & 0 deletions .cursorignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/reference/**
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: tannerlinsley
100 changes: 100 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: '🐛 Bug report'
description: Report a reproducible bug or regression
body:
- type: markdown
attributes:
value: |
Thank you for reporting an issue :pray:.

This issue tracker is for reporting reproducible bugs or regression's found in [react-ai](https://github.com/tanstack/ai)
If you have a question about how to achieve or implement something and are struggling, please post a question
inside of react-ai's [Discussions tab](https://github.com/tanstack/ai/discussions) instead of filing an issue.

Before submitting a new bug/issue, please check the links below to see if there is a solution or question posted there already:
- TanStack AI's [Discussions tab](https://github.com/tanstack/ai/discussions)
- TanStack AI's [Open Issues](https://github.com/tanstack/ai/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
- TanStack AI's [Closed Issues](https://github.com/tanstack/ai/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed)

The more information you fill in, the better the community can help you.

- type: input
id: tanstack-ai-version
attributes:
label: TanStack AI version
description: |
- Please let us know the exact version of the TanStack AI framework adapter that you were using when the issue occurred. If you are using an older version, check to see if your bug has already been solved in the latest version. Please don't just put in "latest", as this is subject to change.
- The latest "ai" version is <img alt="" src="https://badgen.net/npm/v/@tanstack/react-ai" />
placeholder: |
e.g. v8.11.6
validations:
required: true

- type: input
id: framework-library-version
attributes:
label: Framework/Library version
description: Which framework and what version of that framework are you using?
placeholder: |
e.g. React v17.0.2
validations:
required: true

- type: textarea
id: description
attributes:
label: Describe the bug and the steps to reproduce it
description: Provide a clear and concise description of the challenge you are running into, and the steps we should take to try to reproduce your bug.
validations:
required: true

- type: input
id: link
attributes:
label: Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
description: |
Please add a link to a minimal reproduction.
Note:
- Your bug may get fixed much faster if we can run your code and it doesn't have dependencies other than React.
- To create a shareable code example for web, you can use CodeSandbox (https://codesandbox.io/s/new) or Stackblitz (https://stackblitz.com/).
- Please make sure the example is complete and runnable without prior dependencies and free of unnecessary abstractions
- Feel free to fork any of the official CodeSandbox examples to reproduce your issue: https://github.com/tanstack/ai/tree/main/examples/
- For React Native, you can use: https://snack.expo.dev/
- For TypeScript related issues only, a TypeScript Playground link might be sufficient: https://www.typescriptlang.org/play
- Please read these tips for providing a minimal example: https://stackoverflow.com/help/mcve.
placeholder: |
e.g. Code Sandbox, Stackblitz, TypeScript Playground, etc.
validations:
required: true

- type: textarea
id: screenshots_or_videos
attributes:
label: Screenshots or Videos (Optional)
description: |
If applicable, add screenshots or a video to help explain your problem.
For more information on the supported file image/file types and the file size limits, please refer
to the following link: https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/attaching-files
placeholder: |
You can drag your video or image files inside of this editor ↓

- type: dropdown
attributes:
options:
- No, because I do not know how
- No, because I do not have time to dig into it
- Maybe, I'll investigate and start debugging
- Yes, I think I know how to fix it and will discuss it in the comments of this issue
- Yes, I am also opening a PR that solves the problem along side this issue
label: Do you intend to try to help solve this bug with your own PR?
description: |
If you think you know the cause of the problem, the fastest way to get it fixed is to suggest a fix, or fix it yourself! However, it is ok if you cannot solve this yourself and are just wanting help.
- type: checkboxes
id: agrees-to-terms
attributes:
label: Terms & Code of Conduct
description: By submitting this issue, you agree to follow our Code of Conduct and can verify that you have followed the requirements outlined above to the best of your ability.
options:
- label: I agree to follow this project's Code of Conduct
required: true
- label: I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
required: true
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Feature Requests & Questions
url: https://github.com/TanStack/ai/discussions
about: Please ask and answer questions here.
- name: Community Chat
url: https://discord.gg/mQd7egN
about: A dedicated discord server hosted by TanStack
58 changes: 30 additions & 28 deletions .github/instructions/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
---
applyTo: '**'
---
Provide project context and coding guidelines that AI should follow when generating code, answering questions, or reviewing changes.

Whenever you want to build the packages to test if they work you should run `pnpm run build` from the root of the repository.

If you want to check if the examples work you need to go to `examples/<example-name>` and run `pnpm run dev`.

When writing code, please follow these guidelines:
- Use TypeScript for all new code.
- Ensure all new code is covered by tests.
- Do not use `any` type; prefer specific types or generics.
- Follow existing code style and conventions.

If you get an error "address already in use :::42069 you should kill the process using that port.

If we add a new functionality add a section about it in the `docs/` folder explaining how to use it and update the `README.md` file to mention it.

Write tests for any new functionality.

When defining new types, first check if the types exist somewhere and re-use them, do not create new types that are similar to existing ones.

When modifying existing functionality, ensure backward compatibility unless there's a strong reason to introduce breaking changes. If breaking changes are necessary, document them clearly in the relevant documentation files.

When subscribing to an event using `aiEventClient.on` in the devtools packages, always add the option `{ withEventTarget: false }` as the second argument to prevent over-subscriptions in the devtools.

Under no circumstances should casting `as any` be used in the codebase. Always strive to find or create the appropriate type definitions. Avoid casting unless absolutely neccessary, and even then, prefer using `satisfies` for type assertions to maintain type safety.
---
applyTo: '**'
---

Provide project context and coding guidelines that AI should follow when generating code, answering questions, or reviewing changes.

Whenever you want to build the packages to test if they work you should run `pnpm run build` from the root of the repository.

If you want to check if the examples work you need to go to `examples/<example-name>` and run `pnpm run dev`.

When writing code, please follow these guidelines:

- Use TypeScript for all new code.
- Ensure all new code is covered by tests.
- Do not use `any` type; prefer specific types or generics.
- Follow existing code style and conventions.

If you get an error "address already in use :::42069 you should kill the process using that port.

If we add a new functionality add a section about it in the `docs/` folder explaining how to use it and update the `README.md` file to mention it.

Write tests for any new functionality.

When defining new types, first check if the types exist somewhere and re-use them, do not create new types that are similar to existing ones.

When modifying existing functionality, ensure backward compatibility unless there's a strong reason to introduce breaking changes. If breaking changes are necessary, document them clearly in the relevant documentation files.

When subscribing to an event using `aiEventClient.on` in the devtools packages, always add the option `{ withEventTarget: false }` as the second argument to prevent over-subscriptions in the devtools.

Under no circumstances should casting `as any` be used in the codebase. Always strive to find or create the appropriate type definitions. Avoid casting unless absolutely neccessary, and even then, prefer using `satisfies` for type assertions to maintain type safety.
31 changes: 31 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: autofix.ci # needed to securely identify the workflow

on:
pull_request:
push:
branches: [main, alpha, beta, rc]

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
autofix:
name: autofix
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5.0.0
- name: Setup Tools
uses: tanstack/config/.github/setup@main
- name: Fix formatting
run: pnpm prettier:write
- name: Regenerate docs
run: pnpm build:all && pnpm docs:generate
- name: Apply fixes
uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
with:
commit-message: 'ci: apply automated fixes'
50 changes: 50 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: PR

on:
pull_request:
paths-ignore:
- "docs/**"
- "media/**"
- "**/*.md"

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

permissions:
contents: read

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5.0.0
with:
fetch-depth: 0
- name: Setup Tools
uses: tanstack/config/.github/setup@main
- name: Get base and head commits for `nx affected`
uses: nrwl/nx-set-shas@v4.4.0
with:
main-branch-name: main
- name: Run Checks
run: pnpm run test:pr
preview:
name: Preview
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5.0.0
with:
fetch-depth: 0
- name: Setup Tools
uses: tanstack/config/.github/setup@main
- name: Build Packages
run: pnpm run build:all
- name: Publish Previews
run: pnpx pkg-pr-new publish --pnpm './packages/typescript/*'
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
push:
branches: [main, alpha, beta, rc]

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

permissions:
contents: write
id-token: write
pull-requests: write

jobs:
release:
name: Release
if: github.repository_owner == 'TanStack'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5.0.0
with:
fetch-depth: 0
- name: Setup Tools
uses: tanstack/config/.github/setup@main
- name: Run Tests
run: pnpm run test:ci
- name: Run Changesets (version or publish)
uses: changesets/action@v1.5.3
with:
version: pnpm run changeset:version
publish: pnpm run changeset:publish
commit: 'ci: Version Packages'
title: 'ci: Version Packages'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ output/

# My TODOs. Feel free to ignore this.
*-TODO.md
.nx
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
link-workspace-packages=true
prefer-workspace-packages=true
provenance=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.12.0
11 changes: 11 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
**/.nx/
**/.nx/cache
**/.svelte-kit
**/build
**/coverage
**/dist
**/docs
pnpm-lock.yaml

.angular
.github/**
Loading
Loading