Skip to content

Commit 8fdafd1

Browse files
KevinVandyAlemTuzlakautofix-ci[bot]jherrCopilot
authored
chore: migrating to tanstack config (#30)
* start migrating to tanstack config * remove nx files from git * fix sherif lint and format, fix some builds and bugs * fix * fix * fix builds for all projects * fix package json exports * fix most of the bundling and failing test issues * fix knip * fix additional issues * revert openai to use responses api * remove fallback * fix * fix * fix * ci: apply automated fixes * fix * fix * fixing ai-react tests * fixing adapters * removing lingering cli package.json * ai-client tests fixed * removing the use clients, we aren't next * [WIP] Fix TypeDoc configuration and autofix action issues (#34) * Initial plan * chore: ensure typedoc.exclude is array; avoid formatting .github files Co-authored-by: jherr <22392+jherr@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jherr <22392+jherr@users.noreply.github.com> --------- Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Jack Herrington <jherr@pobox.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: jherr <22392+jherr@users.noreply.github.com>
1 parent 17dcb63 commit 8fdafd1

File tree

343 files changed

+34268
-31368
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

343 files changed

+34268
-31368
lines changed

.changeset/config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": [
4+
"@svitejs/changesets-changelog-github-compact",
5+
{ "repo": "TanStack/ai" }
6+
],
7+
"commit": false,
8+
"access": "public",
9+
"baseBranch": "main",
10+
"updateInternalDependencies": "patch",
11+
"fixed": [],
12+
"linked": [],
13+
"ignore": []
14+
}

.cursorignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/reference/**

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: tannerlinsley
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: '🐛 Bug report'
2+
description: Report a reproducible bug or regression
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
Thank you for reporting an issue :pray:.
8+
9+
This issue tracker is for reporting reproducible bugs or regression's found in [react-ai](https://github.com/tanstack/ai)
10+
If you have a question about how to achieve or implement something and are struggling, please post a question
11+
inside of react-ai's [Discussions tab](https://github.com/tanstack/ai/discussions) instead of filing an issue.
12+
13+
Before submitting a new bug/issue, please check the links below to see if there is a solution or question posted there already:
14+
- TanStack AI's [Discussions tab](https://github.com/tanstack/ai/discussions)
15+
- TanStack AI's [Open Issues](https://github.com/tanstack/ai/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
16+
- TanStack AI's [Closed Issues](https://github.com/tanstack/ai/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed)
17+
18+
The more information you fill in, the better the community can help you.
19+
20+
- type: input
21+
id: tanstack-ai-version
22+
attributes:
23+
label: TanStack AI version
24+
description: |
25+
- 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.
26+
- The latest "ai" version is <img alt="" src="https://badgen.net/npm/v/@tanstack/react-ai" />
27+
placeholder: |
28+
e.g. v8.11.6
29+
validations:
30+
required: true
31+
32+
- type: input
33+
id: framework-library-version
34+
attributes:
35+
label: Framework/Library version
36+
description: Which framework and what version of that framework are you using?
37+
placeholder: |
38+
e.g. React v17.0.2
39+
validations:
40+
required: true
41+
42+
- type: textarea
43+
id: description
44+
attributes:
45+
label: Describe the bug and the steps to reproduce it
46+
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.
47+
validations:
48+
required: true
49+
50+
- type: input
51+
id: link
52+
attributes:
53+
label: Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
54+
description: |
55+
Please add a link to a minimal reproduction.
56+
Note:
57+
- Your bug may get fixed much faster if we can run your code and it doesn't have dependencies other than React.
58+
- To create a shareable code example for web, you can use CodeSandbox (https://codesandbox.io/s/new) or Stackblitz (https://stackblitz.com/).
59+
- Please make sure the example is complete and runnable without prior dependencies and free of unnecessary abstractions
60+
- Feel free to fork any of the official CodeSandbox examples to reproduce your issue: https://github.com/tanstack/ai/tree/main/examples/
61+
- For React Native, you can use: https://snack.expo.dev/
62+
- For TypeScript related issues only, a TypeScript Playground link might be sufficient: https://www.typescriptlang.org/play
63+
- Please read these tips for providing a minimal example: https://stackoverflow.com/help/mcve.
64+
placeholder: |
65+
e.g. Code Sandbox, Stackblitz, TypeScript Playground, etc.
66+
validations:
67+
required: true
68+
69+
- type: textarea
70+
id: screenshots_or_videos
71+
attributes:
72+
label: Screenshots or Videos (Optional)
73+
description: |
74+
If applicable, add screenshots or a video to help explain your problem.
75+
For more information on the supported file image/file types and the file size limits, please refer
76+
to the following link: https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/attaching-files
77+
placeholder: |
78+
You can drag your video or image files inside of this editor ↓
79+
80+
- type: dropdown
81+
attributes:
82+
options:
83+
- No, because I do not know how
84+
- No, because I do not have time to dig into it
85+
- Maybe, I'll investigate and start debugging
86+
- Yes, I think I know how to fix it and will discuss it in the comments of this issue
87+
- Yes, I am also opening a PR that solves the problem along side this issue
88+
label: Do you intend to try to help solve this bug with your own PR?
89+
description: |
90+
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.
91+
- type: checkboxes
92+
id: agrees-to-terms
93+
attributes:
94+
label: Terms & Code of Conduct
95+
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.
96+
options:
97+
- label: I agree to follow this project's Code of Conduct
98+
required: true
99+
- 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.
100+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Feature Requests & Questions
4+
url: https://github.com/TanStack/ai/discussions
5+
about: Please ask and answer questions here.
6+
- name: Community Chat
7+
url: https://discord.gg/mQd7egN
8+
about: A dedicated discord server hosted by TanStack
Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1-
---
2-
applyTo: '**'
3-
---
4-
Provide project context and coding guidelines that AI should follow when generating code, answering questions, or reviewing changes.
5-
6-
Whenever you want to build the packages to test if they work you should run `pnpm run build` from the root of the repository.
7-
8-
If you want to check if the examples work you need to go to `examples/<example-name>` and run `pnpm run dev`.
9-
10-
When writing code, please follow these guidelines:
11-
- Use TypeScript for all new code.
12-
- Ensure all new code is covered by tests.
13-
- Do not use `any` type; prefer specific types or generics.
14-
- Follow existing code style and conventions.
15-
16-
If you get an error "address already in use :::42069 you should kill the process using that port.
17-
18-
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.
19-
20-
Write tests for any new functionality.
21-
22-
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.
23-
24-
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.
25-
26-
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.
27-
28-
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.
1+
---
2+
applyTo: '**'
3+
---
4+
5+
Provide project context and coding guidelines that AI should follow when generating code, answering questions, or reviewing changes.
6+
7+
Whenever you want to build the packages to test if they work you should run `pnpm run build` from the root of the repository.
8+
9+
If you want to check if the examples work you need to go to `examples/<example-name>` and run `pnpm run dev`.
10+
11+
When writing code, please follow these guidelines:
12+
13+
- Use TypeScript for all new code.
14+
- Ensure all new code is covered by tests.
15+
- Do not use `any` type; prefer specific types or generics.
16+
- Follow existing code style and conventions.
17+
18+
If you get an error "address already in use :::42069 you should kill the process using that port.
19+
20+
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.
21+
22+
Write tests for any new functionality.
23+
24+
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.
25+
26+
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.
27+
28+
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.
29+
30+
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.

.github/workflows/autofix.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: autofix.ci # needed to securely identify the workflow
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main, alpha, beta, rc]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
autofix:
17+
name: autofix
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v5.0.0
22+
- name: Setup Tools
23+
uses: tanstack/config/.github/setup@main
24+
- name: Fix formatting
25+
run: pnpm prettier:write
26+
- name: Regenerate docs
27+
run: pnpm build:all && pnpm docs:generate
28+
- name: Apply fixes
29+
uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
30+
with:
31+
commit-message: 'ci: apply automated fixes'

.github/workflows/pr.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- "docs/**"
7+
- "media/**"
8+
- "**/*.md"
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
test:
22+
name: Test
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v5.0.0
27+
with:
28+
fetch-depth: 0
29+
- name: Setup Tools
30+
uses: tanstack/config/.github/setup@main
31+
- name: Get base and head commits for `nx affected`
32+
uses: nrwl/nx-set-shas@v4.4.0
33+
with:
34+
main-branch-name: main
35+
- name: Run Checks
36+
run: pnpm run test:pr
37+
preview:
38+
name: Preview
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v5.0.0
43+
with:
44+
fetch-depth: 0
45+
- name: Setup Tools
46+
uses: tanstack/config/.github/setup@main
47+
- name: Build Packages
48+
run: pnpm run build:all
49+
- name: Publish Previews
50+
run: pnpx pkg-pr-new publish --pnpm './packages/typescript/*'

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main, alpha, beta, rc]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
9+
cancel-in-progress: true
10+
11+
env:
12+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
13+
14+
permissions:
15+
contents: write
16+
id-token: write
17+
pull-requests: write
18+
19+
jobs:
20+
release:
21+
name: Release
22+
if: github.repository_owner == 'TanStack'
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v5.0.0
27+
with:
28+
fetch-depth: 0
29+
- name: Setup Tools
30+
uses: tanstack/config/.github/setup@main
31+
- name: Run Tests
32+
run: pnpm run test:ci
33+
- name: Run Changesets (version or publish)
34+
uses: changesets/action@v1.5.3
35+
with:
36+
version: pnpm run changeset:version
37+
publish: pnpm run changeset:publish
38+
commit: 'ci: Version Packages'
39+
title: 'ci: Version Packages'
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ output/
4949

5050
# My TODOs. Feel free to ignore this.
5151
*-TODO.md
52+
.nx

0 commit comments

Comments
 (0)