Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

kiira.config.ts

85 lines3.5 KB

1import { defineConfig } from 'kiira-core'
2​
3export default defineConfig({
4 include: ['docs/**/*.md'],
5 exclude: [
6 // docs/reference/** is auto-generated by TypeDoc (`pnpm generate-docs`);
7 // hand-fixing those snippets would be overwritten on regeneration.
8 'docs/reference/**',
9 // @tanstack/ai-angular is an ng-packagr bundle: its only published entry
10 // is dist/types/*.d.ts, which kiira's dist->src heuristic can't map back
11 // to a source file (unlike every other package's dist/esm/index.d.ts ->
12 // src/index.ts). So these docs only resolve against the built package,
13 // which isn't available during a source-based docs check. Excluded until
14 // ai-angular exposes a source-resolvable entry.
15 'docs/api/ai-angular.md',
16 'docs/getting-started/quick-start-angular.md',
17 // docs/superpowers/** are internal planning/spec artifacts (design docs and
18 // implementation plans), not published, curated examples. Their snippets are
19 // illustrative pseudo-code, not meant to compile against package source.
20 'docs/superpowers/**',
21 ],
22 defaultValidate: 'type',
23 languages: ['ts', 'tsx', 'js', 'jsx'],
24 // Third-party packages the docs import but the workspace doesn't depend on.
25 // kiira installs these into an isolated cache (node_modules/.kiira) and
26 // type-checks against them, so snippets that show real integrations (Vercel
27 // AI SDK migration, community adapters, redis/pino/otel/express/hono, other
28 // schema libs) are validated instead of `ignore`d.
29 externalPackages: {
30 // Vercel AI SDK (migration / comparison "before" examples)
31 ai: '^6.0.0',
32 '@ai-sdk/openai': '^3.0.0',
33 '@ai-sdk/anthropic': '^3.0.0',
34 '@ai-sdk/google': '^3.0.0',
35 '@ai-sdk/react': '^3.0.0',
36 // Provider SDKs / schema libraries shown in examples
37 openai: '^6.0.0',
38 arktype: '^2.0.0',
39 valibot: '^1.0.0',
40 '@valibot/to-json-schema': '^1.0.0',
41 '@modelcontextprotocol/sdk': '^1.29.0',
42 // Server / infra libraries used by real integration examples.
43 // (express is intentionally NOT declared here: it's already a transitive
44 // dependency in the workspace node_modules without its @types, which
45 // shadows any cache copy — so those two express snippets stay `ignore`d.)
46 hono: '^4.0.0',
47 '@hono/node-server': '^2.0.0',
48 redis: '^6.0.0',
49 ioredis: '^5.0.0',
50 pino: '^10.0.0',
51 '@opentelemetry/api': '^1.9.0',
52 // Community adapters (each documented page imports its published package)
53 '@cloudflare/tanstack-ai': '^0.1.0',
54 '@decartai/tanstack-ai-adapter': '^0.0.2',
55 '@mynthio/tanstack-ai-adapter': '^0.0.14',
56 '@cencori/ai-sdk': '^0.4.0',
57 '@soniox/tanstack-ai-adapter': '^0.1.2',
58 },
59 overrides: [
60 // React (and anything not overridden below) uses the automatic JSX
61 // runtime so snippets don't need an explicit `import React`.
62 // noImplicitReturns is off: doc snippets routinely show callbacks that
63 // return on some branches and fall through on others (e.g. a middleware
64 // hook that returns a decision or continues), which is valid and shouldn't
65 // force an explicit return type or trailing `return`.
66 {
67 include: ['docs/**/*.md'],
68 jsx: 'react-jsx',
69 jsxImportSource: 'react',
70 noImplicitReturns: false,
71 },
72 // Solid snippets compile JSX through solid-js.
73 {
74 include: ['docs/api/ai-solid.md'],
75 jsx: 'preserve',
76 jsxImportSource: 'solid-js',
77 },
78 // Preact snippets compile JSX through preact.
79 {
80 include: ['docs/api/ai-preact.md'],
81 jsx: 'react-jsx',
82 jsxImportSource: 'preact',
83 },
84 ],
85})