Last active
April 8, 2022 11:40
-
-
Save andersr/b5e27f188f8013120bebef7dcf7ccd29 to your computer and use it in GitHub Desktop.
Blog Post: How to start automating repetitive coding tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Props { | |
children?: React.ReactNode; | |
} | |
export function {{pascalCase name}} ({ children }: Props) { | |
return ( | |
<div> | |
{children} | |
</div> | |
); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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