Skip to content

Commit a48a3bb

Browse files
Copilotjherrautofix-ci[bot]
authored
Revert "ci: sync config between projects (#53)" (#54)
* Initial plan * Revert "ci: sync config between projects (#53)" This reverts commit 349c24c. The original commit introduced a regression breaking the main branch. Original commit: 349c24c Co-authored-by: jherr <22392+jherr@users.noreply.github.com> * ci: apply automated fixes --------- 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: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 349c24c commit a48a3bb

16 files changed

Lines changed: 234 additions & 71 deletions

File tree

.github/workflows/autofix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
uses: tanstack/config/.github/setup@main
2424
- name: Fix formatting
2525
run: pnpm prettier:write
26-
- name: Generate Docs
27-
run: pnpm generate-docs
26+
- name: Regenerate docs
27+
run: pnpm build:all && pnpm docs:generate
2828
- name: Apply fixes
2929
uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
3030
with:

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## Reverts
4+
5+
### Revert: ci: sync config between projects (#53)
6+
7+
**Reverted:** Commit [349c24c](https://github.com/TanStack/ai/commit/349c24cf58e59f956e10137b6b6d5516399c0931)
8+
9+
This commit was reverted due to a regression that was breaking the main branch. The changes affected CI configuration syncing between projects.
10+
11+
**Changes reverted:**
12+
13+
- Reverted workflow changes in `.github/workflows/autofix.yml`
14+
- Reverted nx.json configuration changes
15+
- Reverted package.json script changes
16+
- Reverted ai-solid package changes (tsconfig, test utilities, package scripts)
17+
- Restored `scripts/clean.sh`
18+
- Renamed `scripts/generate-docs.ts` back to `scripts/generateDocs.ts`
19+
- Restored size-limit configuration and dependencies
20+
- Restored pnpm overrides
21+
322
## Recent Refactoring (November 2025)
423

524
### New Packages

nx.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@
5252
"inputs": ["production", "^production"],
5353
"outputs": ["{projectRoot}/build", "{projectRoot}/dist"]
5454
},
55-
"test:docs": {
56-
"cache": true,
57-
"inputs": ["{workspaceRoot}/docs/**/*"]
58-
},
5955
"test:knip": {
6056
"cache": true,
6157
"inputs": ["{workspaceRoot}/**/*"]

package.json

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,61 @@
88
"packageManager": "pnpm@10.17.0",
99
"type": "module",
1010
"scripts": {
11-
"clean": "pnpm --filter \"./packages/**\" run clean",
11+
"dev:packages": "pnpm run --filter '@tanstack/ai*' dev",
12+
"typecheck": "pnpm run -r typecheck",
13+
"lint": "pnpm run -r lint",
14+
"build": "nx affected --skip-nx-cache --targets=build --exclude=examples/** && size-limit",
15+
"build:all": "nx run-many --targets=build --exclude=examples/** && size-limit",
16+
"build:core": "nx run-many --targets=build --projects=packages/ai && size-limit",
17+
"changeset": "changeset",
18+
"changeset:publish": "changeset publish",
19+
"changeset:version": "changeset version && pnpm install --no-frozen-lockfile && pnpm prettier:write",
20+
"clean": "find . -name 'dist' -type d -prune -exec rm -rf {} +",
21+
"clean:node_modules": "find . -name 'node_modules' -type d -prune -exec rm -rf {} +",
22+
"clean:all": "pnpm run clean && pnpm run clean:node_modules",
23+
"copy:readme": "cp README.md packages/typescript/ai/README.md && cp README.md packages/typescript/ai-devtools/README.md && cp README.md packages/typescript/ai-client/README.md && cp README.md packages/typescript/ai-gemini/README.md && cp README.md packages/typescript/ai-ollama/README.md && cp README.md packages/typescript/ai-openai/README.md && cp README.md packages/typescript/ai-react/README.md && cp README.md packages/typescript/ai-react-ui/README.md && cp README.md packages/typescript/react-ai-devtools/README.md && cp README.md packages/typescript/solid-ai-devtools/README.md",
24+
"dev": "pnpm run watch",
25+
"docs:generate": "node scripts/generateDocs.ts && pnpm run copy:readme",
26+
"format": "pnpm run prettier:write",
27+
"lint:fix": "nx affected --target=lint:fix --exclude=examples/**",
28+
"lint:fix:all": "pnpm run format && nx run-many --targets=lint --fix",
29+
"preinstall": "node -e \"if(process.env.CI == 'true') {console.log('Skipping preinstall...'); process.exit(1)}\" || npx -y only-allow pnpm",
30+
"prettier": "prettier --ignore-unknown '**/*'",
31+
"prettier:write": "pnpm run prettier --write",
32+
"size": "size-limit",
1233
"test": "pnpm run test:ci",
13-
"test:pr": "nx affected --targets=test:sherif,test:knip,test:docs,test:eslint,test:lib,test:types,test:build,build",
14-
"test:ci": "nx run-many --targets=test:sherif,test:knip,test:docs,test:eslint,test:lib,test:types,test:build,build",
34+
"test:build": "nx affected --target=test:build --exclude=examples/**",
35+
"test:ci": "nx run-many --targets=test:format,test:eslint,test:sherif,test:knip,test:lib,test:types,test:build,test:verify-links",
1536
"test:eslint": "nx affected --target=test:eslint --exclude=examples/**",
1637
"test:format": "pnpm run prettier --check",
17-
"test:sherif": "sherif",
38+
"test:knip": "knip --max-issues=33",
1839
"test:lib": "nx affected --targets=test:lib --exclude=examples/**",
1940
"test:lib:dev": "pnpm test:lib && nx watch --all -- pnpm test:lib",
20-
"test:build": "nx affected --target=test:build --exclude=examples/**",
41+
"test:pr": "nx affected --targets=test:format,test:eslint,test:sherif,test:knip,test:lib,test:types,test:build,build",
42+
"test:sherif": "sherif",
2143
"test:types": "nx affected --targets=test:types --exclude=examples/**",
22-
"test:knip": "knip --max-issues=33",
23-
"test:docs": "node scripts/verify-links.ts",
24-
"build": "nx affected --skip-nx-cache --targets=build --exclude=examples/**",
25-
"build:all": "nx run-many --targets=build --exclude=examples/**",
26-
"watch": "pnpm run build:all && nx watch --all -- pnpm run build:all",
27-
"dev": "pnpm run watch",
28-
"prettier": "prettier --ignore-unknown '**/*'",
29-
"prettier:write": "pnpm run prettier --write",
30-
"generate-docs": "node scripts/generate-docs.ts && pnpm run copy:readme",
31-
"copy:readme": "cp README.md packages/typescript/ai/README.md && cp README.md packages/typescript/ai-devtools/README.md && cp README.md packages/typescript/ai-client/README.md && cp README.md packages/typescript/ai-gemini/README.md && cp README.md packages/typescript/ai-ollama/README.md && cp README.md packages/typescript/ai-openai/README.md && cp README.md packages/typescript/ai-react/README.md && cp README.md packages/typescript/ai-react-ui/README.md && cp README.md packages/typescript/react-ai-devtools/README.md && cp README.md packages/typescript/solid-ai-devtools/README.md",
32-
"format": "pnpm run prettier:write",
33-
"changeset": "changeset",
34-
"changeset:publish": "changeset publish",
35-
"changeset:version": "changeset version && pnpm install --no-frozen-lockfile && pnpm prettier:write"
44+
"test:verify-links": "node scripts/verify-links.ts",
45+
"watch": "pnpm run build:all && nx watch --all -- pnpm run build:all"
3646
},
3747
"nx": {
3848
"includedScripts": [
39-
"test:docs",
4049
"test:knip",
4150
"test:sherif"
4251
]
4352
},
53+
"size-limit": [
54+
{
55+
"path": "packages/typescript/ai/dist/esm/index.js",
56+
"limit": "21 KB",
57+
"ignore": [
58+
"@alcyone-labs/zod-to-json-schema"
59+
]
60+
}
61+
],
4462
"devDependencies": {
4563
"@changesets/cli": "^2.29.8",
4664
"@faker-js/faker": "^10.1.0",
65+
"@size-limit/preset-small-lib": "^11.2.0",
4766
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
4867
"@tanstack/eslint-config": "0.3.3",
4968
"@tanstack/typedoc-config": "0.3.1",
@@ -60,9 +79,26 @@
6079
"prettier-plugin-svelte": "^3.4.0",
6180
"publint": "^0.3.15",
6281
"sherif": "^1.9.0",
82+
"size-limit": "^11.2.0",
6383
"tinyglobby": "^0.2.15",
6484
"typescript": "5.9.3",
6585
"vite": "^7.2.4",
6686
"vitest": "^4.0.14"
87+
},
88+
"pnpm": {
89+
"overrides": {
90+
"@tanstack/ai": "workspace:*",
91+
"@tanstack/ai-anthropic": "workspace:*",
92+
"@tanstack/ai-client": "workspace:*",
93+
"@tanstack/ai-devtools": "workspace:*",
94+
"@tanstack/ai-gemini": "workspace:*",
95+
"@tanstack/ai-ollama": "workspace:*",
96+
"@tanstack/ai-openai": "workspace:*",
97+
"@tanstack/ai-react": "workspace:*",
98+
"@tanstack/ai-react-ui": "workspace:*",
99+
"@tanstack/react-ai-devtools": "workspace:*",
100+
"@tanstack/solid-ai-devtools": "workspace:*",
101+
"@tanstack/tests-adapters": "workspace:*"
102+
}
67103
}
68104
}

packages/typescript/ai-solid-ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
"components"
3333
],
3434
"dependencies": {
35+
"@tanstack/ai-client": "workspace:*",
36+
"@tanstack/ai-solid": "workspace:*",
3537
"rehype-highlight": "^7.0.2",
3638
"rehype-raw": "^7.0.0",
3739
"rehype-sanitize": "^6.0.0",
@@ -44,8 +46,6 @@
4446
"solid-js": ">=1.9.7"
4547
},
4648
"devDependencies": {
47-
"@tanstack/ai-client": "workspace:*",
48-
"@tanstack/ai-solid": "workspace:*",
4949
"@vitest/coverage-v8": "4.0.14",
5050
"vite": "^7.2.4",
5151
"vite-plugin-solid": "^2.11.10"

packages/typescript/ai-solid/eslint.config.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/typescript/ai-solid/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@
2323
"src"
2424
],
2525
"scripts": {
26+
"build": "tsdown",
27+
"dev": "tsdown --watch",
28+
"test": "vitest run",
29+
"test:watch": "vitest",
30+
"test:coverage": "vitest run --coverage",
2631
"clean": "rm -rf dist node_modules",
27-
"test:eslint": "eslint ./src",
28-
"test:types": "tsc --noEmit",
29-
"test:lib": "vitest run",
30-
"test:lib:dev": "pnpm run test:lib --watch",
31-
"test:build": "pnpm run build",
32-
"build": "tsdown"
32+
"typecheck": "tsc --noEmit",
33+
"lint": "tsc --noEmit"
3334
},
3435
"keywords": [
3536
"ai",

packages/typescript/ai-solid/src/types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import type { Accessor } from 'solid-js'
21
import type { ModelMessage } from '@tanstack/ai'
32
import type {
43
ChatClientOptions,
5-
ChatRequestBody,
64
UIMessage,
5+
ChatRequestBody,
76
} from '@tanstack/ai-client'
7+
import { Accessor } from 'solid-js'
88

99
// Re-export types from ai-client
1010
export type { UIMessage, ChatRequestBody }
@@ -33,7 +33,7 @@ export interface UseChatReturn {
3333
/**
3434
* Current messages in the conversation
3535
*/
36-
messages: Accessor<Array<UIMessage>>
36+
messages: Accessor<UIMessage[]>
3737

3838
/**
3939
* Send a message and get a response
@@ -87,7 +87,7 @@ export interface UseChatReturn {
8787
/**
8888
* Set messages manually
8989
*/
90-
setMessages: (messages: Array<UIMessage>) => void
90+
setMessages: (messages: UIMessage[]) => void
9191

9292
/**
9393
* Clear all messages

packages/typescript/ai-solid/src/use-chat.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import { ChatClient } from '@tanstack/ai-client'
2+
import type { ModelMessage } from '@tanstack/ai'
3+
import type { UseChatOptions, UseChatReturn, UIMessage } from './types'
24
import {
35
createEffect,
46
createMemo,
57
createSignal,
68
createUniqueId,
79
} from 'solid-js'
8-
import type { ModelMessage } from '@tanstack/ai'
9-
import type { UIMessage, UseChatOptions, UseChatReturn } from './types'
1010

1111
export function useChat(options: UseChatOptions = {}): UseChatReturn {
1212
const hookId = createUniqueId()
1313
const clientId = options.id || hookId
1414

15-
const [messages, setMessages] = createSignal<Array<UIMessage>>(
15+
const [messages, setMessages] = createSignal<UIMessage[]>(
1616
options.initialMessages || [],
1717
)
1818
const [isLoading, setIsLoading] = createSignal(false)
@@ -34,7 +34,7 @@ export function useChat(options: UseChatOptions = {}): UseChatReturn {
3434
onError: options.onError,
3535
onToolCall: options.onToolCall,
3636
streamProcessor: options.streamProcessor,
37-
onMessagesChange: (newMessages: Array<UIMessage>) => {
37+
onMessagesChange: (newMessages: UIMessage[]) => {
3838
setMessages(newMessages)
3939
},
4040
onLoadingChange: (newIsLoading: boolean) => {
@@ -46,6 +46,7 @@ export function useChat(options: UseChatOptions = {}): UseChatReturn {
4646
})
4747
// Only recreate when clientId changes
4848
// Connection and other options are captured at creation time
49+
// eslint-disable-next-line react-hooks/exhaustive-deps
4950
}, [clientId])
5051

5152
// Sync initial messages on mount only
@@ -94,7 +95,7 @@ export function useChat(options: UseChatOptions = {}): UseChatReturn {
9495
client().clear()
9596
}
9697

97-
const setMessagesManually = (newMessages: Array<UIMessage>) => {
98+
const setMessagesManually = (newMessages: UIMessage[]) => {
9899
client().setMessagesManually(newMessages)
99100
}
100101

packages/typescript/ai-solid/tests/test-utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export {
66
type MockConnectionAdapterOptions,
77
} from '@tanstack/ai-client/tests/test-utils'
88

9-
import { renderHook } from '@solidjs/testing-library'
9+
import { renderHook, type RenderHookResult } from '@testing-library/react'
1010
import type { UseChatOptions, UseChatReturn } from '../src/types'
1111
import { useChat } from '../src/use-chat'
1212

@@ -22,6 +22,8 @@ import { useChat } from '../src/use-chat'
2222
* await result.current.sendMessage("Hello");
2323
* ```
2424
*/
25-
export function renderUseChat(options?: UseChatOptions) {
25+
export function renderUseChat(
26+
options?: UseChatOptions,
27+
): RenderHookResult<UseChatReturn, UseChatOptions> {
2628
return renderHook(() => useChat(options))
2729
}

0 commit comments

Comments
 (0)