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

kiira.config.ts

122 lines5.5 KB

1import { defineConfig } from 'kiira-core'
2​
3export default defineConfig({
4 // skills/** are the repo-level discovery skills; packages/*/skills are the
5 // per-package skills that ship in each npm package.
6 include: ['docs/**/*.md', 'skills/**/*.md', 'packages/*/skills/**/*.md'],
7 tsconfig: 'tsconfig.docs.json',
8 exclude: [
9 // docs/reference/** is auto-generated by TypeDoc (`pnpm generate-docs`);
10 // hand-fixing those snippets would be overwritten on regeneration.
11 'docs/reference/**',
12 // @tanstack/ai-angular is an ng-packagr bundle: its published entries
13 // are dist/types/*.d.ts, which kiira's dist->src heuristic can't map back
14 // to a source file (unlike every other package's dist/esm/index.d.ts ->
15 // src/index.ts). So these docs only resolve against the built package,
16 // which isn't available during a source-based docs check. Excluded until
17 // ai-angular exposes a source-resolvable entry.
18 'docs/api/ai-angular.md',
19 'docs/ui/angular.md',
20 // docs/superpowers/** are internal planning/spec artifacts (design docs and
21 // implementation plans), not published, curated examples. Their snippets are
22 // illustrative pseudo-code, not meant to compile against package source.
23 'docs/superpowers/**',
24 ],
25 defaultValidate: 'type',
26 languages: ['ts', 'tsx', 'js', 'jsx'],
27 // Third-party packages the docs import but the workspace doesn't depend on.
28 // kiira installs these into an isolated cache (node_modules/.kiira) and
29 // type-checks against them, so snippets that show real integrations (Vercel
30 // AI SDK migration, community adapters, redis/pino/otel/express/hono, other
31 // schema libs) are validated instead of `ignore`d.
32 externalPackages: {
33 // Vercel AI SDK (comparison is v7; migration "before" fences stay on
34 // APIs that v7 still exports, including deprecated aliases)
35 ai: '^7.0.0',
36 '@ai-sdk/openai': '^4.0.0',
37 '@ai-sdk/anthropic': '^4.0.0',
38 '@ai-sdk/google': '^4.0.0',
39 '@ai-sdk/react': '^4.0.0',
40 // Provider SDKs / schema libraries shown in examples
41 openai: '^6.0.0',
42 arktype: '^2.0.0',
43 valibot: '^1.0.0',
44 '@valibot/to-json-schema': '^1.0.0',
45 '@modelcontextprotocol/sdk': '^1.29.0',
46 // Server / infra libraries used by real integration examples.
47 // (express is intentionally NOT declared here: it's already a transitive
48 // dependency in the workspace node_modules without its @types, which
49 // shadows any cache copy — so those two express snippets stay `ignore`d.)
50 hono: '^4.0.0',
51 '@hono/node-server': '^2.0.0',
52 redis: '^6.0.0',
53 ioredis: '^5.0.0',
54 pino: '^10.0.0',
55 '@opentelemetry/api': '^1.9.0',
56 // Community adapters (each documented page imports its published package)
57 '@cloudflare/tanstack-ai': '^0.1.0',
58 '@cloudflare/workers-types': '^4.20260317.1',
59 '@decartai/tanstack-ai-adapter': '^0.0.2',
60 '@mynthio/tanstack-ai-adapter': '^0.0.14',
61 '@cencori/ai-sdk': '^0.4.0',
62 '@soniox/tanstack-ai-adapter': '^0.1.2',
63 '@fal-ai/client': '1.11.0-alpha.2',
64 // Octane is a peer of @tanstack/ai-octane, not a root workspace dep.
65 octane: '^0.1.17',
66 // Remix 3 is a peer of @tanstack/ai-remix, not a root workspace dep.
67 remix: '^3.0.0-rc.1',
68 // TextPart highlighter examples. Not a workspace dependency.
69 // Subpath exports are mapped in tsconfig.docs.json because kiira
70 // does not read package.json exports.
71 '@tanstack/highlight': '^0.1.0',
72 // remix/ui re-exports this. Kiira's paths["*"] does not read the
73 // package.json exports field, so the jsx-runtime file must exist on disk.
74 '@remix-run/ui': '^0.8.0',
75 },
76 overrides: [
77 // React (and anything not overridden below) uses the automatic JSX
78 // runtime so snippets don't need an explicit `import React`.
79 // noImplicitReturns is off: doc snippets routinely show callbacks that
80 // return on some branches and fall through on others (e.g. a middleware
81 // hook that returns a decision or continues), which is valid and shouldn't
82 // force an explicit return type or trailing `return`.
83 {
84 include: ['docs/**/*.md', 'skills/**/*.md', 'packages/*/skills/**/*.md'],
85 jsx: 'react-jsx',
86 jsxImportSource: 'react',
87 noImplicitReturns: false,
88 },
89 // Solid snippets compile JSX through solid-js.
90 {
91 include: ['docs/api/ai-solid.md', 'docs/ui/solid.md'],
92 jsx: 'preserve',
93 jsxImportSource: 'solid-js',
94 },
95 // Preact snippets compile JSX through preact.
96 {
97 include: ['docs/api/ai-preact.md', 'docs/ui/preact.md'],
98 jsx: 'react-jsx',
99 jsxImportSource: 'preact',
100 },
101 // Octane snippets compile JSX through octane. Standard TSX works;
102 // TSRX (`@{`, `@for`) is not TypeScript, so docs use TSX here.
103 // `octane/jsx-runtime` is types-only via package.json exports;
104 // kiira's paths["*"] does not read exports, so `octane/dist` points
105 // at dist/jsx-runtime.d.ts, which exists on disk.
106 {
107 include: ['docs/api/ai-octane.md', 'docs/ui/octane.md'],
108 jsx: 'react-jsx',
109 jsxImportSource: 'octane/dist',
110 },
111 // Remix snippets compile JSX through remix/ui. `remix/ui/jsx-runtime`
112 // is types-only via package.json exports; kiira's paths["*"] does not
113 // read exports, so `remix/dist/ui` points at dist/ui/jsx-runtime.d.ts,
114 // which exists on disk. Subpath imports (`remix/ui`, `remix/router`)
115 // are mapped in tsconfig.docs.json for the same reason.
116 {
117 include: ['docs/api/ai-remix.md', 'docs/ui/remix.md'],
118 jsx: 'react-jsx',
119 jsxImportSource: 'remix/dist/ui',
120 },
121 ],
122})