feat(cli): add streamdown in ai example of all react web templates (#554)

This commit is contained in:
Aman Varshney
2025-08-30 22:08:22 +05:30
committed by GitHub
parent 383ea6ff33
commit f8684863a6
9 changed files with 51 additions and 24 deletions

View File

@@ -108,6 +108,7 @@ export const dependencyVersionMap = {
"@ai-sdk/vue": "^2.0.9",
"@ai-sdk/svelte": "^3.0.9",
"@ai-sdk/react": "^2.0.9",
streamdown: "^1.1.6",
"@orpc/server": "^1.8.4",
"@orpc/client": "^1.8.4",

View File

@@ -43,7 +43,7 @@ export async function setupExamples(config: ProjectConfig) {
} else if (hasSvelte) {
dependencies.push("@ai-sdk/svelte");
} else if (hasReactWeb) {
dependencies.push("@ai-sdk/react");
dependencies.push("@ai-sdk/react", "streamdown");
}
await addPackageDependency({
dependencies,

View File

@@ -740,6 +740,19 @@ export async function setupExamplesTemplate(
if (hasReactWeb) {
const exampleWebSrc = path.join(exampleBaseDir, "web/react");
if (await fs.pathExists(exampleWebSrc)) {
if (example === "ai") {
const exampleWebBaseSrc = path.join(exampleWebSrc, "base");
if (await fs.pathExists(exampleWebBaseSrc)) {
await processAndCopyFiles(
"**/*",
exampleWebBaseSrc,
webAppDir,
context,
false,
);
}
}
const reactFramework = context.frontend.find((f) =>
[
"next",