Skip to content

Commit d40adfe

Browse files
chore: fix solid bundling (TanStack#334)
* chore: fix solid bundling * ci: apply automated fixes * chore: fix solid bundling * ci: apply automated fixes * chore: fix solid bundling * ci: apply automated fixes * chore: fix solid bundling * chore: fix solid bundling * ci: apply automated fixes * chore: fix solid bundling * ci: apply automated fixes * chore: fix solid bundling * chore: fix solid bundling * ci: apply automated fixes * fix: versioning packages * ci: apply automated fixes * chore: add solid conditional exports to ai-devtools production subpath Build production.ts through tsup-preset-solid (separate out_dir) so the ./production export gets the same workerd/browser/node conditional structure as the main entry. * chore: version fixes * ci: apply automated fixes * fix: lock * fix: lock --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 228e0e3 commit d40adfe

13 files changed

Lines changed: 535 additions & 167 deletions

File tree

.changeset/swift-bikes-check.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@tanstack/solid-ai-devtools': patch
3+
'@tanstack/ai-devtools-core': patch
4+
---
5+
6+
fix solid bundling of devtools

.changeset/tiny-coats-divide.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@tanstack/preact-ai-devtools': patch
3+
'@tanstack/react-ai-devtools': patch
4+
'@tanstack/solid-ai-devtools': patch
5+
'@tanstack/ai-devtools-core': patch
6+
---
7+
8+
Bump up package versions

examples/ts-group-chat/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@tanstack/ai-anthropic": "workspace:*",
1414
"@tanstack/ai-client": "workspace:*",
1515
"@tanstack/ai-react": "workspace:*",
16-
"@tanstack/react-devtools": "^0.8.2",
16+
"@tanstack/react-devtools": "^0.9.10",
1717
"@tanstack/react-router": "^1.158.4",
1818
"@tanstack/react-router-devtools": "^1.158.4",
1919
"@tanstack/react-router-ssr-query": "^1.158.4",
@@ -27,7 +27,7 @@
2727
"ws": "^8.18.3"
2828
},
2929
"devDependencies": {
30-
"@tanstack/devtools-vite": "^0.3.11",
30+
"@tanstack/devtools-vite": "^0.5.3",
3131
"@testing-library/dom": "^10.4.1",
3232
"@testing-library/react": "^16.3.0",
3333
"@types/node": "^24.10.1",

examples/ts-react-chat/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@tanstack/ai-react": "workspace:*",
2222
"@tanstack/ai-react-ui": "workspace:*",
2323
"@tanstack/nitro-v2-vite-plugin": "^1.154.7",
24-
"@tanstack/react-devtools": "^0.8.2",
24+
"@tanstack/react-devtools": "^0.9.10",
2525
"@tanstack/react-router": "^1.158.4",
2626
"@tanstack/react-router-devtools": "^1.158.4",
2727
"@tanstack/react-router-ssr-query": "^1.158.4",
@@ -43,7 +43,7 @@
4343
"zod": "^4.2.0"
4444
},
4545
"devDependencies": {
46-
"@tanstack/devtools-vite": "^0.3.11",
46+
"@tanstack/devtools-vite": "^0.5.3",
4747
"@tanstack/react-ai-devtools": "workspace:*",
4848
"@testing-library/dom": "^10.4.1",
4949
"@testing-library/react": "^16.3.0",

examples/ts-solid-chat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"devDependencies": {
4141
"@solidjs/testing-library": "^0.8.10",
4242
"@tanstack/devtools-event-client": "^0.4.0",
43-
"@tanstack/devtools-vite": "^0.3.11",
43+
"@tanstack/devtools-vite": "^0.5.3",
4444
"@testing-library/dom": "^10.4.1",
4545
"@types/node": "^24.10.1",
4646
"jsdom": "^27.2.0",

packages/typescript/ai-devtools/package.json

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,48 @@
1010
"directory": "packages/typescript/ai"
1111
},
1212
"type": "module",
13-
"types": "./dist/esm/index.d.ts",
14-
"module": "./dist/esm/index.js",
13+
"types": "./dist/index.d.ts",
14+
"module": "./dist/index.js",
1515
"exports": {
1616
".": {
17-
"types": "./dist/esm/index.d.ts",
18-
"import": "./dist/esm/index.js"
17+
"workerd": {
18+
"types": "./dist/index.d.ts",
19+
"import": "./dist/server.js"
20+
},
21+
"browser": {
22+
"development": {
23+
"types": "./dist/index.d.ts",
24+
"import": "./dist/dev.js"
25+
},
26+
"types": "./dist/index.d.ts",
27+
"import": "./dist/index.js"
28+
},
29+
"node": {
30+
"types": "./dist/index.d.ts",
31+
"import": "./dist/server.js"
32+
},
33+
"types": "./dist/index.d.ts",
34+
"import": "./dist/index.js"
1935
},
2036
"./production": {
21-
"types": "./dist/esm/production.d.ts",
22-
"import": "./dist/esm/production.js"
37+
"workerd": {
38+
"types": "./dist/production/index.d.ts",
39+
"import": "./dist/production/server.js"
40+
},
41+
"browser": {
42+
"development": {
43+
"types": "./dist/production/index.d.ts",
44+
"import": "./dist/production/dev.js"
45+
},
46+
"types": "./dist/production/index.d.ts",
47+
"import": "./dist/production/index.js"
48+
},
49+
"node": {
50+
"types": "./dist/production/index.d.ts",
51+
"import": "./dist/production/server.js"
52+
},
53+
"types": "./dist/production/index.d.ts",
54+
"import": "./dist/production/index.js"
2355
},
2456
"./package.json": "./package.json"
2557
},
@@ -28,7 +60,7 @@
2860
"src"
2961
],
3062
"scripts": {
31-
"build": "vite build",
63+
"build": "tsup",
3264
"clean": "premove ./build ./dist",
3365
"lint:fix": "eslint ./src --fix",
3466
"test:build": "publint --strict",
@@ -47,14 +79,16 @@
4779
],
4880
"dependencies": {
4981
"@tanstack/ai": "workspace:*",
50-
"@tanstack/devtools-ui": "^0.4.4",
51-
"@tanstack/devtools-utils": "^0.3.0",
82+
"@tanstack/devtools-ui": "^0.5.0",
83+
"@tanstack/devtools-utils": "0.3.2",
5284
"goober": "^2.1.18",
5385
"solid-js": "^1.9.10"
5486
},
5587
"devDependencies": {
5688
"@vitest/coverage-v8": "4.0.14",
5789
"jsdom": "^27.2.0",
90+
"tsup": "^8.5.1",
91+
"tsup-preset-solid": "^2.2.0",
5892
"vite": "^7.2.7",
5993
"vite-plugin-solid": "^2.11.10"
6094
}
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { lazy } from 'solid-js'
2-
import { constructCoreClass } from '@tanstack/devtools-utils/solid'
3-
4-
const Component = lazy(() => import('./components/Shell'))
1+
import { constructCoreClass } from '@tanstack/devtools-utils/solid/class'
52

63
export interface AiDevtoolsInit {}
74

8-
const [AiDevtoolsCore, AiDevtoolsCoreNoOp] = constructCoreClass(Component)
5+
const [AiDevtoolsCore, AiDevtoolsCoreNoOp] = constructCoreClass(
6+
() => import('./components/Shell'),
7+
)
98

109
export { AiDevtoolsCore, AiDevtoolsCoreNoOp }
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { defineConfig } from 'tsup'
2+
import { generateTsupOptions, parsePresetOptions } from 'tsup-preset-solid'
3+
4+
const index_preset = {
5+
entries: {
6+
entry: 'src/index.ts',
7+
dev_entry: true,
8+
server_entry: true,
9+
},
10+
cjs: false,
11+
drop_console: true,
12+
}
13+
14+
const production_preset = {
15+
entries: {
16+
entry: 'src/production.ts',
17+
dev_entry: true,
18+
server_entry: true,
19+
},
20+
cjs: false,
21+
drop_console: true,
22+
out_dir: 'dist/production',
23+
}
24+
25+
export default defineConfig(() => {
26+
const index_options = generateTsupOptions(parsePresetOptions(index_preset))
27+
const production_options = generateTsupOptions(
28+
parsePresetOptions(production_preset),
29+
)
30+
31+
return [...index_options, ...production_options].map((option) => ({
32+
...option,
33+
clean: false,
34+
}))
35+
})
Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { defineConfig, mergeConfig } from 'vitest/config'
2-
import { tanstackViteConfig } from '@tanstack/vite-config'
1+
import { defineConfig } from 'vitest/config'
32
import solid from 'vite-plugin-solid'
43
import packageJson from './package.json'
54

6-
const config = defineConfig({
5+
export default defineConfig({
76
plugins: [solid() as any],
87
test: {
98
name: packageJson.name,
@@ -14,12 +13,3 @@ const config = defineConfig({
1413
typecheck: { enabled: true },
1514
},
1615
})
17-
18-
export default mergeConfig(
19-
config,
20-
tanstackViteConfig({
21-
entry: ['./src/index.ts', './src/production.ts'],
22-
srcDir: './src',
23-
cjs: false,
24-
}),
25-
)

packages/typescript/preact-ai-devtools/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
],
5050
"dependencies": {
5151
"@tanstack/ai-devtools-core": "workspace:*",
52-
"@tanstack/devtools-utils": "^0.3.0"
52+
"@tanstack/devtools-utils": "0.3.2"
5353
},
5454
"devDependencies": {
5555
"@vitest/coverage-v8": "4.0.14",

0 commit comments

Comments
 (0)