Skip to content

Instantly share code, notes, and snippets.

@andersr
Last active April 8, 2022 11:40
Show Gist options
  • Save andersr/b5e27f188f8013120bebef7dcf7ccd29 to your computer and use it in GitHub Desktop.
Save andersr/b5e27f188f8013120bebef7dcf7ccd29 to your computer and use it in GitHub Desktop.
Blog Post: How to start automating repetitive coding tasks
interface Props {
children?: React.ReactNode;
}
export function {{pascalCase name}} ({ children }: Props) {
return (
<div>
{children}
</div>
);
};
const generators = (plop) => {
plop.setGenerator("component", {
description: "Create a component",
prompts: [
{
type: "input",
name: "name",
message: "Component name?",
},
],
actions: [
{
type: "add",
path: "src/components/{{pascalCase name}}.tsx",
templateFile: "plop-templates/components/Component.js.hbs",
},
],
});
};
export default generators;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment