expo template
This commit is contained in:
28
index.ts
28
index.ts
@@ -18,13 +18,22 @@ const project = await p.group(
|
||||
return undefined
|
||||
},
|
||||
}),
|
||||
frontend: async () =>
|
||||
frontend: async () =>
|
||||
await p.select({
|
||||
message: 'Pick a frontend framework.',
|
||||
options: [
|
||||
{value: "svelte-kit", label:"SvelteKit"},
|
||||
{value: "solid-start", label:"SolidStart"},
|
||||
{value: "none", label:"None"}
|
||||
{ value: "svelte-kit", label: "SvelteKit" },
|
||||
{ value: "solid-start", label: "SolidStart" },
|
||||
{ value: "none", label: "None" }
|
||||
]
|
||||
})
|
||||
,
|
||||
mobile: async () =>
|
||||
await p.select({
|
||||
message: 'Pick a mobile framework.',
|
||||
options: [
|
||||
{ value: "expo", label: "ReactNative + Expo" },
|
||||
{ value: "none", label: "None" }
|
||||
]
|
||||
})
|
||||
,
|
||||
@@ -55,15 +64,18 @@ const render = createRenderer(z.object({
|
||||
frontend: z.string(),
|
||||
})
|
||||
}))
|
||||
const destDir = path.join("./",project.name);
|
||||
render(destDir,{project},{reverseMap: true})
|
||||
const destDir = path.join("./", project.name);
|
||||
render(destDir, { project }, { reverseMap: true })
|
||||
|
||||
const s = p.spinner();
|
||||
s.start("Installing dependencies");
|
||||
await Bun.$`bun install`.cwd(path.join(destDir)).quiet();
|
||||
await Bun.$`bun install`.cwd(path.join(destDir,'packages','rpc')).quiet();
|
||||
await Bun.$`bun install`.cwd(path.join(destDir, 'packages', 'rpc')).quiet();
|
||||
if (project.frontend !== "none") {
|
||||
await Bun.$`bun install`.cwd(path.join(destDir,'apps','web')).quiet();
|
||||
await Bun.$`bun install`.cwd(path.join(destDir, 'apps', 'web')).quiet();
|
||||
}
|
||||
if (project.mobile !== "none") {
|
||||
await Bun.$`bun install`.cwd(path.join(destDir, 'apps', 'mobile')).quiet();
|
||||
}
|
||||
s.stop("Dependencies installed.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user