Component Maker
A VS Code extension for generating new component files depending on your custom template
no framework or language dependencies, this documentation is done by react/typescript, but it also works with any other technology.
Right click in the file editor or on a file in the explorer and click 🦯Make Component
to generate a component as needed

How it works ?
basically it's an extension that depends on your files
it clones your model just like plop does.
the first thing to do is to create your template folder,

your model might look similar to this :
import { Container } from "./_ComponentName_.style";
import type { FC } from "react";
interface I_ComponentName_Props {}
const _ComponentName_: FC<I_ComponentName_Props> = ({}) => {
return <Container></Container>;
};
export default _ComponentName_;
the extension will generate a .mcrc.json
file on startup, you just need to provide 2 information :
property |
type |
value |
templateComponentName |
string |
path to template folder, default.templates |
templateFolder |
string |
the interpolation variable in your custom model, the variable that will be replaced by the component name, default_ComponentName_ |
.mcrc.json
:
{
"templateComponentName": "_ComponentName_",
"templateFolder": ".templates"
}
done with 💙, Armane