forked from vercel/ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
239 lines (236 loc) · 6.98 KB
/
Copy pathnext.config.ts
File metadata and controls
239 lines (236 loc) · 6.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
import { createMDX } from 'fumadocs-mdx/next';
import type { NextConfig } from 'next';
import { exampleRedirects } from './lib/example-redirects';
const withMDX = createMDX();
const config: NextConfig = {
images: {
remotePatterns: [
{
hostname: 'e742qlubrjnjqpp0.public.blob.vercel-storage.com',
protocol: 'https',
},
],
},
redirects: () => [
// AI SDK 4 is archived separately so it remains available without adding
// its content families to this app's already memory-intensive build.
{
source: '/v4',
destination: 'https://v4.ai-sdk.dev/docs/introduction',
permanent: true,
},
{
source: '/v4/:path*',
destination: 'https://v4.ai-sdk.dev/:path*',
permanent: true,
},
{
source: '/v7',
destination: '/',
permanent: true,
},
{
source: '/v7/:path*',
destination: '/:path*',
permanent: true,
},
{
source: '/docs',
destination: '/docs/introduction',
permanent: false,
},
// Legacy section landing pages (card grids) were folded into their
// Overview pages; the content sync drops the folder index when an
// overview sibling exists (see scripts/sync-content-utils.mjs).
{
source:
'/docs/:section(foundations|agents|ai-sdk-core|ai-sdk-harnesses|ai-sdk-ui|ai-sdk-rsc)',
destination: '/docs/:section/overview',
permanent: true,
},
{
source:
'/docs/:section(foundations|agents|ai-sdk-core|ai-sdk-harnesses|ai-sdk-ui|ai-sdk-rsc).md',
destination: '/docs/:section/overview.md',
permanent: true,
},
{
source:
'/v6/docs/:section(foundations|agents|ai-sdk-core|ai-sdk-ui|ai-sdk-rsc)',
destination: '/v6/docs/:section/overview',
permanent: true,
},
{
source:
'/v6/docs/:section(foundations|agents|ai-sdk-core|ai-sdk-ui|ai-sdk-rsc).md',
destination: '/v6/docs/:section/overview.md',
permanent: true,
},
{
source:
'/v5/docs/:section(foundations|agents|ai-sdk-core|ai-sdk-ui|ai-sdk-rsc)',
destination: '/v5/docs/:section/overview',
permanent: true,
},
{
source:
'/v5/docs/:section(foundations|agents|ai-sdk-core|ai-sdk-ui|ai-sdk-rsc).md',
destination: '/v5/docs/:section/overview.md',
permanent: true,
},
{
source: '/v6/docs',
destination: '/v6/docs/introduction',
permanent: false,
},
{
source: '/v5/docs',
destination: '/v5/docs/introduction',
permanent: false,
},
{
source: '/providers',
destination: '/providers/ai-sdk-providers',
permanent: false,
},
{
source: '/v6/providers',
destination: '/v6/providers/ai-sdk-providers',
permanent: false,
},
{
source: '/v5/providers',
destination: '/v5/providers/ai-sdk-providers',
permanent: false,
},
// Legacy resource URLs, mirroring production.
{
source: '/tools-registry',
destination: '/resources/tools',
permanent: true,
},
{
source: '/tools-registry/:slug',
destination: '/resources/tools/:slug',
permanent: true,
},
{
source: '/showcase',
destination: '/resources/showcase',
permanent: true,
},
// /examples and its deep URLs are still linked from docs content; they
// chain to their cookbook replacements exactly as on production.
...exampleRedirects,
{
source: '/elements',
destination: 'https://elements.ai-sdk.dev',
permanent: true,
},
{
source: '/elements/:path*',
destination: 'https://elements.ai-sdk.dev/:path*',
permanent: true,
},
{
source: '/model-library',
destination: 'https://vercel.com/docs/ai-gateway',
permanent: true,
},
// The cookbook family root mirrors production (ai-sdk.dev/cookbook):
// the legacy app permanently redirects it to the Recipes landing page.
...['', '/v6', '/v5'].flatMap(prefix => [
{
source: `${prefix}/cookbook`,
destination: `${prefix}/resources/recipes`,
permanent: true,
},
// Cookbook section landing pages have no content (the content sync
// drops their frontmatter-only index.mdx); the legacy app redirects
// each section to its first recipe.
...['/cookbook', '/resources/recipes'].flatMap(family => [
{
source: `${prefix}${family}/:section(next|node|rsc)`,
destination: `${prefix}${family}/:section/generate-text`,
permanent: false,
},
{
source: `${prefix}${family}/:section(next|node|rsc).md`,
destination: `${prefix}${family}/:section/generate-text.md`,
permanent: false,
},
{
source: `${prefix}${family}/api-servers`,
destination: `${prefix}${family}/api-servers/node-http-server`,
permanent: false,
},
{
source: `${prefix}${family}/api-servers.md`,
destination: `${prefix}${family}/api-servers/node-http-server.md`,
permanent: false,
},
]),
]),
{
source: '/docs/ai-sdk-core/prompts',
destination: '/docs/foundations/prompts',
permanent: true,
},
{
source: '/docs/ai-sdk-core/prompts.md',
destination: '/docs/foundations/prompts.md',
permanent: true,
},
{
source: '/v6/docs/ai-sdk-core/prompts',
destination: '/v6/docs/foundations/prompts',
permanent: true,
},
{
source: '/v6/docs/ai-sdk-core/prompts.md',
destination: '/v6/docs/foundations/prompts.md',
permanent: true,
},
{
source: '/v5/docs/ai-sdk-core/prompts',
destination: '/v5/docs/foundations/prompts',
permanent: true,
},
{
source: '/v5/docs/ai-sdk-core/prompts.md',
destination: '/v5/docs/foundations/prompts.md',
permanent: true,
},
{
source: '/docs/reference/ai-sdk-core/validate-json-rpc-message',
destination: '/docs/reference/ai-sdk-core/create-mcp-client',
permanent: false,
},
{
source: '/docs/reference/ai-sdk-core/validate-json-rpc-message.md',
destination: '/docs/reference/ai-sdk-core/create-mcp-client.md',
permanent: false,
},
{
source: '/v6/docs/reference/ai-sdk-core/validate-json-rpc-message',
destination: '/v6/docs/reference/ai-sdk-core/create-mcp-client',
permanent: false,
},
{
source: '/v6/docs/reference/ai-sdk-core/validate-json-rpc-message.md',
destination: '/v6/docs/reference/ai-sdk-core/create-mcp-client.md',
permanent: false,
},
{
source: '/v5/docs/reference/ai-sdk-core/validate-json-rpc-message',
destination: '/v5/docs/reference/ai-sdk-core/create-mcp-client',
permanent: false,
},
{
source: '/v5/docs/reference/ai-sdk-core/validate-json-rpc-message.md',
destination: '/v5/docs/reference/ai-sdk-core/create-mcp-client.md',
permanent: false,
},
],
};
export default withMDX(config);