1.0.35 • Published 6 years ago

customaddcomponents v1.0.35

Weekly downloads
18
License
ISC
Repository
-
Last release
6 years ago

customaddcomponents

npm


A tool to create components based on custom templates.

npm address

github address

Documentation

Installation

npm install customaddcomponents

add script in your package.json

"scripts": {

    "add": "add-component",
},

create a templateconfig.json & write

{ "templatepath": "CustomTemplate", "componentPlacementPath": "src" }
  • templatepath: the placement of your template
  • CustomAddcCmponents: The root directory which you want to place your component

create two folders name src and CustomTemplate

create templates into the CustomTemplate folder like

image

Examples (Run it and see it)

npm run add
  • template is folder

gif

  • template is file

gif

About the to write your template

${component-name} -> component-name
${componentName}  -> componentName
${ComponentName}  -> ComponentName
${component-filename} -> component-filename
${componentFilename}  -> componentFilename
${ComponentFilename}  -> ComponentFilename

example

template.tsx.txt

import { Component } from 'react'

export default class ${TemplateName} extends Components {
  constructor(props) {
    super(props)
    this.state = {}
  }
  render() {
    return <div className='${template-name}'>${TemplateName}</div>
  }
}

your component file

import { Component } from 'react'

export default class YourComponent extends Components {
  constructor(props) {
    super(props)
    this.state = {}
  }
  render() {
    return <div className='your-component'>YourComponent</div>
  }
}
1.0.35

6 years ago

1.0.34

6 years ago

1.0.33

6 years ago

1.0.32

6 years ago

1.0.31

6 years ago

1.0.30

6 years ago

1.0.29

6 years ago

1.0.28

6 years ago

1.0.27

6 years ago

1.0.26

6 years ago

1.0.25

6 years ago

1.0.24

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago