@maizzle/framework
Version:
Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.
32 lines (31 loc) • 887 B
JavaScript
import { onCancel, scaffold } from "./scaffold.mjs";
import color from "picocolors";
import * as p from "@clack/prompts";
//#region src/commands/make/layout.ts
async function makeLayout(filePath) {
if (filePath) {
await scaffold(filePath, "Layout.vue");
return;
}
p.intro(`${color.bgCyan(color.black(" maizzle make:layout "))}`);
const result = await p.group({
filename: () => p.text({
message: "File name",
placeholder: "Layout.vue",
validate: (value) => {
if (!value) return "Please enter a file name.";
}
}),
path: () => p.text({
message: "Directory to place it in",
placeholder: "./components",
initialValue: "./components",
validate: (value) => {
if (!value) return "Please enter a path.";
}
})
}, { onCancel });
await scaffold(`${result.path}/${result.filename}`, "Layout.vue");
}
//#endregion
export { makeLayout as default };