Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Component MakerNew to Visual Studio Code? Get it now.

Component Maker

Armane

|
21 installs
| (0) | Free
Generates necessary files for new components, does not depend on any language, framework
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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

image

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,

image

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

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft