add ai and todo example templates for native frontends (#293)

This commit is contained in:
Aman Varshney
2025-06-02 16:30:53 +05:30
committed by GitHub
parent 9dbeea8983
commit 7851d0636d
42 changed files with 1606 additions and 536 deletions

View File

@@ -599,6 +599,8 @@ export async function setupExamplesTemplate(
const serverAppDirExists = await fs.pathExists(serverAppDir);
const webAppDirExists = await fs.pathExists(webAppDir);
const nativeAppDir = path.join(projectDir, "apps/native");
const nativeAppDirExists = await fs.pathExists(nativeAppDir);
const hasReactWeb = context.frontend.some((f) =>
["tanstack-router", "react-router", "tanstack-start", "next"].includes(f),
@@ -758,6 +760,34 @@ export async function setupExamplesTemplate(
}
}
}
if (nativeAppDirExists) {
const hasNativeWind = context.frontend.includes("native-nativewind");
const hasUnistyles = context.frontend.includes("native-unistyles");
if (hasNativeWind || hasUnistyles) {
let nativeFramework = "";
if (hasNativeWind) {
nativeFramework = "nativewind";
} else if (hasUnistyles) {
nativeFramework = "unistyles";
}
const exampleNativeSrc = path.join(
exampleBaseDir,
`native/${nativeFramework}`,
);
if (await fs.pathExists(exampleNativeSrc)) {
await processAndCopyFiles(
"**/*",
exampleNativeSrc,
nativeAppDir,
context,
false,
);
}
}
}
}
}