Open History to see the last commit
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 // Live model prices (docs/advanced/model-prices.md)
62 '@modelschemas/rate-card': '^0.2.1',
63 '@cencori/ai-sdk': '^0.4.0',
64 '@soniox/tanstack-ai-adapter': '^0.1.2',
65 '@upstash/agentkit-tanstack-ai': '^0.1.1',
66 '@upstash/blob': '^0.0.8',
67 '@fal-ai/client': '1.11.0-alpha.5',
68 // Octane is a peer of @tanstack/ai-octane, not a root workspace dep.
69 octane: '^0.1.17',
70 // Remix 3 is a peer of @tanstack/ai-remix, not a root workspace dep.
71 remix: '^3.0.0-rc.1',
72 // TextPart highlighter examples. Not a workspace dependency.
73 // Subpath exports are mapped in tsconfig.docs.json because kiira
74 // does not read package.json exports.
75 '@tanstack/highlight': '^0.1.0',
76 // remix/ui re-exports this. Kiira's paths["*"] does not read the
77 // package.json exports field, so the jsx-runtime file must exist on disk.
78 '@remix-run/ui': '^0.8.0',
79 },
80 overrides: [
81 // React (and anything not overridden below) uses the automatic JSX
82 // runtime so snippets don't need an explicit `import React`.
83 // noImplicitReturns is off: doc snippets routinely show callbacks that
84 // return on some branches and fall through on others (e.g. a middleware
85 // hook that returns a decision or continues), which is valid and shouldn't
86 // force an explicit return type or trailing `return`.
87 {
88 include: ['docs/**/*.md', 'skills/**/*.md', 'packages/*/skills/**/*.md'],
89 jsx: 'react-jsx',
90 jsxImportSource: 'react',
91 noImplicitReturns: false,
92 },
93 // Solid snippets compile JSX through solid-js.
94 {
95 include: ['docs/api/ai-solid.md', 'docs/ui/solid.md'],
96 jsx: 'preserve',
97 jsxImportSource: 'solid-js',
98 },
99 // Preact snippets compile JSX through preact.
100 {
101 include: ['docs/api/ai-preact.md', 'docs/ui/preact.md'],
102 jsx: 'react-jsx',
103 jsxImportSource: 'preact',
104 },
105 // Octane snippets compile JSX through octane. Standard TSX works;
106 // TSRX (`@{`, `@for`) is not TypeScript, so docs use TSX here.
107 // `octane/jsx-runtime` is types-only via package.json exports;
108 // kiira's paths["*"] does not read exports, so `octane/dist` points
109 // at dist/jsx-runtime.d.ts, which exists on disk.
110 {
111 include: ['docs/api/ai-octane.md', 'docs/ui/octane.md'],
112 jsx: 'react-jsx',
113 jsxImportSource: 'octane/dist',
114 },
115 // Remix snippets compile JSX through remix/ui. `remix/ui/jsx-runtime`
116 // is types-only via package.json exports; kiira's paths["*"] does not
117 // read exports, so `remix/dist/ui` points at dist/ui/jsx-runtime.d.ts,
118 // which exists on disk. Subpath imports (`remix/ui`, `remix/router`)
119 // are mapped in tsconfig.docs.json for the same reason.
120 {
121 include: ['docs/api/ai-remix.md', 'docs/ui/remix.md'],
122 jsx: 'react-jsx',
123 jsxImportSource: 'remix/dist/ui',
124 },
125 ],
126})