-
-
Notifications
You must be signed in to change notification settings - Fork 109
Add preact devtools #204
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
Add preact devtools #204
Changes from all commits
57440b4
e79e0da
6b86266
611228e
4a00b4b
2959fe4
3753583
aead2e2
2a67a98
9bc04b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@tanstack/ai-devtools-core': minor | ||
| '@tanstack/react-ai-devtools': minor | ||
| '@tanstack/solid-ai-devtools': minor | ||
| --- | ||
|
|
||
| Bump tanstack-devtools to 0.2.3 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@tanstack/preact-ai-devtools': minor | ||
| --- | ||
|
|
||
| Initial release |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # @tanstack/preact-ai-devtools |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,132 @@ | ||||||
| <div align="center"> | ||||||
| <img src="./media/header_ai.png" > | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add alt text to the header image. The header image is missing alt text, which impacts accessibility for screen reader users. ♿ Proposed fix- <img src="./media/header_ai.png" >
+ <img src="./media/header_ai.png" alt="TanStack AI Header">📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.18.1)2-2: Images should have alternate text (alt text) (MD045, no-alt-text) 🤖 Prompt for AI Agents |
||||||
| </div> | ||||||
|
|
||||||
| <br /> | ||||||
|
|
||||||
| <div align="center"> | ||||||
| <a href="https://npmjs.com/package/@tanstack/ai" target="\_parent"> | ||||||
| <img alt="" src="https://img.shields.io/npm/dm/@tanstack/ai.svg" /> | ||||||
| </a> | ||||||
| <a href="https://github.com/TanStack/ai" target="\_parent"> | ||||||
| <img alt="" src="https://img.shields.io/github/stars/TanStack/ai.svg?style=social&label=Star" alt="GitHub stars" /> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace hard tabs with spaces. Lines 12, 23-25 contain hard tabs instead of spaces, which should be corrected for consistency with the rest of the file. 🔧 Proposed fix <a href="https://github.com/TanStack/ai" target="\_parent">
- <img alt="" src="https://img.shields.io/github/stars/TanStack/ai.svg?style=social&label=Star" alt="GitHub stars" />
+ <img alt="" src="https://img.shields.io/github/stars/TanStack/ai.svg?style=social&label=Star" alt="GitHub stars" />
</a>- <a href="#badge">
- <img src="https://img.shields.io/github/v/release/tanstack/ai" alt="Release"/>
- </a>
+<a href="#badge">
+ <img src="https://img.shields.io/github/v/release/tanstack/ai" alt="Release"/>
+</a>Also applies to: 23-25 🧰 Tools🪛 markdownlint-cli2 (0.18.1)12-12: Hard tabs (MD010, no-hard-tabs) 🤖 Prompt for AI Agents |
||||||
| </a> | ||||||
| <a href="https://bundlephobia.com/result?p=@tanstack/ai@latest" target="\_parent"> | ||||||
| <img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/ai@latest" /> | ||||||
| </a> | ||||||
|
Comment on lines
+8
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Package references are incorrect for preact-ai-devtools. The badges reference 📦 Proposed fix-<a href="https://npmjs.com/package/@tanstack/ai" target="\_parent">
- <img alt="" src="https://img.shields.io/npm/dm/@tanstack/ai.svg" />
+<a href="https://npmjs.com/package/@tanstack/preact-ai-devtools" target="\_parent">
+ <img alt="" src="https://img.shields.io/npm/dm/@tanstack/preact-ai-devtools.svg" />
</a>
<a href="https://github.com/TanStack/ai" target="\_parent">
<img alt="" src="https://img.shields.io/github/stars/TanStack/ai.svg?style=social&label=Star" alt="GitHub stars" />
</a>
-<a href="https://bundlephobia.com/result?p=@tanstack/ai@latest" target="\_parent">
- <img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/ai@latest" />
+<a href="https://bundlephobia.com/result?p=@tanstack/preact-ai-devtools@latest" target="\_parent">
+ <img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/preact-ai-devtools@latest" />
</a>🧰 Tools🪛 markdownlint-cli2 (0.18.1)12-12: Hard tabs (MD010, no-hard-tabs) 🤖 Prompt for AI Agents |
||||||
| </div> | ||||||
|
|
||||||
| <div align="center"> | ||||||
| <a href="#badge"> | ||||||
| <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg"> | ||||||
| </a> | ||||||
| <a href="#badge"> | ||||||
| <img src="https://img.shields.io/github/v/release/tanstack/ai" alt="Release"/> | ||||||
| </a> | ||||||
| <a href="https://twitter.com/tan_stack"> | ||||||
| <img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/> | ||||||
| </a> | ||||||
| </div> | ||||||
|
|
||||||
| <div align="center"> | ||||||
|
|
||||||
| ### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/) | ||||||
| </div> | ||||||
|
|
||||||
| # TanStack AI | ||||||
|
|
||||||
| A powerful, type-safe AI SDK for building AI-powered applications. | ||||||
|
|
||||||
| - Provider-agnostic adapters (OpenAI, Anthropic, Gemini, Ollama, etc.) | ||||||
| - **Tree-shakeable adapters** - Import only what you need for smaller bundles | ||||||
| - **Multimodal content support** - Send images, audio, video, and documents | ||||||
| - **Image generation** - Generate images with OpenAI DALL-E/GPT-Image and Gemini Imagen | ||||||
| - Chat completion, streaming, and agent loop strategies | ||||||
| - Headless chat state management with adapters (SSE, HTTP stream, custom) | ||||||
| - Isomorphic type-safe tools with server/client execution | ||||||
| - **Enhanced integration with TanStack Start** - Share implementations between AI tools and server functions | ||||||
|
|
||||||
|
Comment on lines
+36
to
+48
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. README content is not specific to preact-ai-devtools. This README contains generic TanStack AI SDK documentation instead of preact-ai-devtools specific content. Users looking for information on how to install and use the Preact devtools will not find it here. Consider creating devtools-specific documentation that includes:
🤖 Prompt for AI Agents |
||||||
| ### <a href="https://tanstack.com/ai">Read the docs →</b></a> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix heading level increment. The heading jumps from h1 (line 36) to h3, skipping h2. This violates proper heading hierarchy. 📝 Proposed fix-### <a href="https://tanstack.com/ai">Read the docs →</b></a>
+## <a href="https://tanstack.com/ai">Read the docs →</b></a>📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.18.1)49-49: Heading levels should only increment by one level at a time (MD001, heading-increment) 🤖 Prompt for AI Agents |
||||||
|
|
||||||
| ## Tree-Shakeable Adapters | ||||||
|
|
||||||
| Import only the functionality you need for smaller bundle sizes: | ||||||
|
|
||||||
| ```typescript | ||||||
| // Only chat functionality - no summarization code bundled | ||||||
| import { openaiText } from '@tanstack/ai-openai/adapters' | ||||||
| import { generate } from '@tanstack/ai' | ||||||
|
|
||||||
| const textAdapter = openaiText() | ||||||
|
|
||||||
| const result = generate({ | ||||||
| adapter: textAdapter, | ||||||
| model: 'gpt-4o', | ||||||
| messages: [{ role: 'user', content: [{ type: 'text', content: 'Hello!' }] }], | ||||||
| }) | ||||||
|
|
||||||
| for await (const chunk of result) { | ||||||
| console.log(chunk) | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| Available adapters: `openaiText`, `openaiEmbed`, `openaiSummarize`, `anthropicText`, `geminiText`, `ollamaText`, and more. | ||||||
|
|
||||||
| ## Get Involved | ||||||
|
|
||||||
| - We welcome issues and pull requests! | ||||||
| - Participate in [GitHub discussions](https://github.com/TanStack/ai/discussions) | ||||||
| - Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ) | ||||||
| - See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions | ||||||
|
|
||||||
| ## Partners | ||||||
|
|
||||||
| <table align="center"> | ||||||
| <tr> | ||||||
| <td> | ||||||
| <a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" > | ||||||
| <picture> | ||||||
| <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" /> | ||||||
| <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" /> | ||||||
| <img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" /> | ||||||
| </picture> | ||||||
| </a> | ||||||
| </td> | ||||||
| <td> | ||||||
| <a href="https://www.cloudflare.com?utm_source=tanstack"> | ||||||
| <picture> | ||||||
| <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" /> | ||||||
| <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" /> | ||||||
| <img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" /> | ||||||
| </picture> | ||||||
| </a> | ||||||
| </td> | ||||||
| </tr> | ||||||
| </table> | ||||||
|
|
||||||
| <div align="center"> | ||||||
| <img src="./media/partner_logo.svg" alt="AI & you?" height="65"> | ||||||
| <p> | ||||||
| We're looking for TanStack AI Partners to join our mission! Partner with us to push the boundaries of TanStack AI and build amazing things together. | ||||||
| </p> | ||||||
| <a href="mailto:partners@tanstack.com?subject=TanStack AI Partnership"><b>LET'S CHAT</b></a> | ||||||
| </div> | ||||||
|
|
||||||
| ## Explore the TanStack Ecosystem | ||||||
|
|
||||||
| - <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages | ||||||
| - <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store | ||||||
| - <a href="https://github.com/tanstack/devtools"><b>TanStack Devtools</b></a> – Unified devtools panel | ||||||
| - <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state | ||||||
| - <a href="https://github.com/tanstack/pacer"><b>TanStack Pacer</b></a> – Debouncing, throttling, batching | ||||||
| - <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching | ||||||
| - <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives | ||||||
| - <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state | ||||||
| - <a href="https://github.com/tanstack/router"><b>TanStack Start</b></a> – Full‑stack SSR & streaming | ||||||
| - <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store | ||||||
| - <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids | ||||||
| - <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering | ||||||
|
|
||||||
| … and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a> | ||||||
|
|
||||||
| <!-- USE THE FORCE LUKE --> | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| { | ||
| "name": "@tanstack/preact-ai-devtools", | ||
| "version": "0.0.0", | ||
| "description": "Preact Devtools for TanStack AI.", | ||
| "author": "tannerlinsley", | ||
| "license": "MIT", | ||
| "homepage": "https://tanstack.com/ai", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/TanStack/ai.git", | ||
| "directory": "packages/typescript/preact-ai-devtools" | ||
| }, | ||
| "funding": { | ||
| "type": "github", | ||
| "url": "https://github.com/sponsors/tannerlinsley" | ||
| }, | ||
| "scripts": { | ||
| "clean": "premove ./build ./dist", | ||
| "lint:fix": "eslint ./src --fix", | ||
| "test:eslint": "eslint ./src", | ||
| "test:lib": "vitest --passWithNoTests", | ||
| "test:lib:dev": "pnpm test:lib --watch", | ||
| "test:types": "tsc", | ||
| "test:build": "publint --strict", | ||
| "build": "vite build" | ||
| }, | ||
| "type": "module", | ||
| "types": "./dist/esm/index.d.ts", | ||
| "module": "./dist/esm/index.js", | ||
| "exports": { | ||
| ".": { | ||
| "import": { | ||
| "types": "./dist/esm/index.d.ts", | ||
| "default": "./dist/esm/index.js" | ||
| } | ||
| }, | ||
| "./production": { | ||
| "import": { | ||
| "types": "./dist/esm/production.d.ts", | ||
| "default": "./dist/esm/production.js" | ||
| } | ||
| }, | ||
| "./package.json": "./package.json" | ||
| }, | ||
| "sideEffects": false, | ||
| "files": [ | ||
| "dist", | ||
| "src" | ||
| ], | ||
| "dependencies": { | ||
| "@tanstack/ai-devtools-core": "workspace:*", | ||
| "@tanstack/devtools-utils": "^0.2.3" | ||
| }, | ||
| "devDependencies": { | ||
| "@vitest/coverage-v8": "4.0.14", | ||
| "vite": "^7.2.7" | ||
| }, | ||
| "peerDependencies": { | ||
| "preact": "^10.0.0" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import { createPreactPanel } from '@tanstack/devtools-utils/preact' | ||
| import { AiDevtoolsCore } from '@tanstack/ai-devtools-core' | ||
| import type { DevtoolsPanelProps } from '@tanstack/devtools-utils/preact' | ||
|
|
||
| const [AiDevtoolsPanel, AiDevtoolsPanelNoOp] = createPreactPanel(AiDevtoolsCore) | ||
|
|
||
| export interface AiDevtoolsPreactInit extends DevtoolsPanelProps {} | ||
|
|
||
| export { AiDevtoolsPanel, AiDevtoolsPanelNoOp } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import * as Devtools from './AiDevtools' | ||
| import * as plugin from './plugin' | ||
|
|
||
| export const AiDevtoolsPanel = | ||
| process.env.NODE_ENV !== 'development' | ||
| ? Devtools.AiDevtoolsPanelNoOp | ||
| : Devtools.AiDevtoolsPanel | ||
|
|
||
| export const aiDevtoolsPlugin = | ||
| process.env.NODE_ENV !== 'development' | ||
| ? plugin.aiDevtoolsNoOpPlugin | ||
| : plugin.aiDevtoolsPlugin | ||
|
Comment on lines
+4
to
+12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, verify the file exists and check its contents
ls -la packages/typescript/preact-ai-devtools/src/
cat -n packages/typescript/preact-ai-devtools/src/index.tsRepository: TanStack/ai Length of output: 914 🏁 Script executed: # Check the package.json for build configuration and exports
cat packages/typescript/preact-ai-devtools/package.jsonRepository: TanStack/ai Length of output: 1588 🏁 Script executed: # Check if dist directory exists and what's in it
ls -la packages/typescript/preact-ai-devtools/dist/ 2>/dev/null || echo "dist/ does not exist yet"Repository: TanStack/ai Length of output: 79 🏁 Script executed: # Look for the Nx/build configuration files
fd -e "tsconfig.json" -e "vite.config.ts" -e "vite.config.js" packages/typescript/preact-ai-devtools/ 2>/dev/null | head -20Repository: TanStack/ai Length of output: 37 🏁 Script executed: # Check production.ts which appears to be an alternative export
cat -n packages/typescript/preact-ai-devtools/src/production.tsRepository: TanStack/ai Length of output: 239 🏁 Script executed: # Check AiDevtools.tsx to see the NoOp implementation
cat -n packages/typescript/preact-ai-devtools/src/AiDevtools.tsxRepository: TanStack/ai Length of output: 519 🏁 Script executed: # Check plugin.tsx to see the NoOp implementation
cat -n packages/typescript/preact-ai-devtools/src/plugin.tsxRepository: TanStack/ai Length of output: 467 🏁 Script executed: # Look for Vite configuration
find packages/typescript/preact-ai-devtools -name "vite.config.*" -o -name "tsconfig.json" | xargs cat -n 2>/dev/nullRepository: TanStack/ai Length of output: 1461 🏁 Script executed: # Check if there's a shared Vite config at the workspace root
find . -maxdepth 3 -name "vite.config.*" | head -10Repository: TanStack/ai Length of output: 324 🏁 Script executed: # Find the vite-config package to understand how NODE_ENV is handled
fd -e "vite-config" -type d | head -5Repository: TanStack/ai Length of output: 225 🏁 Script executed: # Search for documentation or configuration about NODE_ENV handling
rg "NODE_ENV" packages/typescript/preact-ai-devtools/ -C 3Repository: TanStack/ai Length of output: 991 🏁 Script executed: # Check if there's a shared vite config explanation
rg "define:" . --type ts --type js -C 2 | head -30Repository: TanStack/ai Length of output: 37 🏁 Script executed: # Look at how other devtools packages handle this
find packages/typescript -name "*devtools*" -type d | head -10Repository: TanStack/ai Length of output: 201 🏁 Script executed: # Check the ai-devtools-core to see if there's a similar pattern
cat packages/typescript/ai-devtools-core/src/index.ts 2>/dev/null | head -20Repository: TanStack/ai Length of output: 37 🏁 Script executed: # Look at how tanstackViteConfig is configured - might be in a shared package
rg "tanstackViteConfig" . --type-list | head -5Repository: TanStack/ai Length of output: 444 🏁 Script executed: # Check the vite-config package contents
find . -path "*/vite-config/*" -name "*.ts" | head -10Repository: TanStack/ai Length of output: 37 🏁 Script executed: # Search for packages that contain vite-config
ls -la packages/ | grep -i viteRepository: TanStack/ai Length of output: 37 🏁 Script executed: # Check if tanstackViteConfig is exported from a package
rg "export.*tanstackViteConfig" --type ts --type jsRepository: TanStack/ai Length of output: 37 🏁 Script executed: # Search for tanstackViteConfig definition or import
rg "tanstackViteConfig" --include="*.ts" --include="*.js"Repository: TanStack/ai Length of output: 496 🏁 Script executed: # Check node_modules or look for the package
find . -name "@tanstack" -type d | grep viteRepository: TanStack/ai Length of output: 37 🏁 Script executed: # Look at package.json files to find where tanstackViteConfig comes from
rg "@tanstack/vite-config" --include="package.json"Repository: TanStack/ai Length of output: 496 🏁 Script executed: # Check the vite config more carefully - look at what tanstackViteConfig does
# It might be handling NODE_ENV automatically
cat -n packages/typescript/react-ai-devtools/vite.config.ts 2>/dev/null | head -50Repository: TanStack/ai Length of output: 1102 🏁 Script executed: # Search for how other packages handle NODE_ENV
rg "NODE_ENV" packages/typescript/ -l | head -10Repository: TanStack/ai Length of output: 253 🏁 Script executed: # Check the structure of another devtools package to compare
cat packages/typescript/react-ai-devtools/src/index.ts 2>/dev/nullRepository: TanStack/ai Length of output: 478 🏁 Script executed: # Look at the learnings to understand the recommended pattern
# Check if there are any adapter patterns mentioned
rg "adapter" packages/typescript/preact-ai-devtools/ -iRepository: TanStack/ai Length of output: 37 🏁 Script executed: # Verify the package exports are correctly defined
cat packages/typescript/preact-ai-devtools/package.json | jq '.exports'Repository: TanStack/ai Length of output: 346 The environment-based export pattern is correct, but consider documenting the explicit The conditional 🤖 Prompt for AI Agents |
||
|
|
||
| export type { AiDevtoolsPreactInit } from './AiDevtools' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { createPreactPlugin } from '@tanstack/devtools-utils/preact' | ||
| import { AiDevtoolsPanel } from './AiDevtools' | ||
|
|
||
| const [aiDevtoolsPlugin, aiDevtoolsNoOpPlugin] = createPreactPlugin({ | ||
| Component: AiDevtoolsPanel, | ||
| name: 'TanStack AI', | ||
| id: 'tanstack-ai', | ||
| defaultOpen: true, | ||
| }) | ||
|
|
||
| export { aiDevtoolsPlugin, aiDevtoolsNoOpPlugin } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| export { AiDevtoolsPanel } from './AiDevtools' | ||
|
|
||
| export type { AiDevtoolsPreactInit } from './AiDevtools' | ||
|
|
||
| export { aiDevtoolsPlugin } from './plugin' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "extends": "../../../tsconfig.json", | ||
| "compilerOptions": { | ||
| "jsx": "preserve", | ||
| "jsxFactory": "h", | ||
| "jsxFragmentFactory": "Fragment", | ||
| "moduleResolution": "bundler", | ||
| "strictNullChecks": true | ||
| }, | ||
| "include": ["eslint.config.js", "prettier.config.js", "src"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { defineConfig, mergeConfig } from 'vitest/config' | ||
| import { tanstackViteConfig } from '@tanstack/vite-config' | ||
| import packageJson from './package.json' | ||
|
|
||
| const config = defineConfig({ | ||
| test: { | ||
| name: packageJson.name, | ||
| dir: './', | ||
| watch: false, | ||
| globals: true, | ||
| environment: 'node', | ||
| include: ['tests/**/*.test.ts'], | ||
| coverage: { | ||
| provider: 'v8', | ||
| reporter: ['text', 'json', 'html', 'lcov'], | ||
| exclude: [ | ||
| 'node_modules/', | ||
| 'dist/', | ||
| 'tests/', | ||
| '**/*.test.ts', | ||
| '**/*.config.ts', | ||
| '**/types.ts', | ||
| ], | ||
| include: ['src/**/*.ts'], | ||
| }, | ||
| }, | ||
| }) | ||
|
|
||
| export default mergeConfig( | ||
| config, | ||
| tanstackViteConfig({ | ||
| entry: ['./src/index.ts', './src/production.ts'], | ||
| srcDir: './src', | ||
| cjs: false, | ||
| }), | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { defineConfig } from 'vitest/config' | ||
|
|
||
| export default defineConfig({ | ||
| test: { | ||
| watch: false, | ||
| }, | ||
| }) | ||
|
Comment on lines
+1
to
+7
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Compare Vitest configurations in both files
echo "=== vite.config.ts ==="
cat packages/typescript/preact-ai-devtools/vite.config.ts
echo -e "\n=== vitest.config.ts ==="
cat packages/typescript/preact-ai-devtools/vitest.config.ts
echo -e "\n=== Check for other TanStack packages with similar pattern ==="
fd -t f "vitest.config.ts" packages/typescript/Repository: TanStack/ai Length of output: 1567 🏁 Script executed: #!/bin/bash
# Sample vitest.config.ts files from other packages
echo "=== ai-devtools vitest.config.ts ==="
cat packages/typescript/ai-devtools/vitest.config.ts
echo -e "\n=== ai-openai vitest.config.ts ==="
cat packages/typescript/ai-openai/vitest.config.ts
echo -e "\n=== ai-react vitest.config.ts ==="
cat packages/typescript/ai-react/vitest.config.ts
echo -e "\n=== Check corresponding vite.config.ts for ai-openai ==="
cat packages/typescript/ai-openai/vite.config.ts | head -20Repository: TanStack/ai Length of output: 2174 Remove redundant When both This pattern differs from other TanStack packages (ai-devtools, ai-openai, ai-react, etc.) which consolidate full test configuration into 🤖 Prompt for AI Agents |
||
Uh oh!
There was an error while loading. Please reload this page.