@plop-next/cli
v0.1.6
Published
Micro-generator framework CLI
Downloads
57
Maintainers
Readme
@plop-next/cli
CLI package for plop-next.
This package provides:
- the
plop-nextcommand line interface - TypeScript-friendly public types for your plopfile
Installation
Install as a development dependency:
npm install -D @plop-next/clior:
yarn add -D @plop-next/cliBasic usage
Run the CLI from your project:
npx plop-nextor with a script:
{
"scripts": {
"plop-next": "plop-next"
}
}Then run:
npm run plop-nextType-safe plopfile example
import type { PlopNext } from "@plop-next/cli";
export default function plop(plop: PlopNext) {
plop.setGenerator("component", {
description: "Create a component",
prompts: [
{
type: "input",
name: "name",
message: "Component name",
},
],
actions: [
{
type: "add",
path: "src/components/{{name}}.ts",
template: "export const {{name}} = () => null;",
},
],
});
}Links
- Documentation: https://nivvdiy.github.io/plop-next/
- Repository: https://github.com/Nivvdiy/plop-next
- Issues: https://github.com/Nivvdiy/plop-next/issues
