1.2.11 • Published 4 years ago

create-component-x v1.2.11

Weekly downloads
125
License
-
Repository
github
Last release
4 years ago

create-component-x is a command-line tool that allows you to create a component based on a blueprint

Installation

npm i -g create-component-x

Usage

Create a blueprint

Blueprint is a folder with component's structure. Use $compName$ as a placeholder for component name in filenames and inside the code.

Example of blueprint folder:

blueprint
│
│───src
│   │–––$compName$.js
│   └───$compName$.scss
│
│──tests
│   └───$compName$-test.js
│
│–––README.md
└───package.json

Example of component's blueprint:

import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';

import cls from 'classnames';
import styles from './$compName$.scss';

class $compName$ extends PureComponent {
  static propTypes = {};
  static defaultProps = {};
  render() {
    return (
      <div className={styles.$compName$}>
        $compName$
      </div>
    );
  }
}

export default $compName$;

Use the blueprint

Go to the blueprint folder and add it to the storage for further use:

c-c use

Create a component

To create a component go to the target directory and run:

c-c create

Then enter component's name and select a blueprint from the list. Component is created!

Options

Custom pattern for placeholder could be used:

c-c use --pat="$comp$"
1.2.10

4 years ago

1.2.11

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

6 years ago

1.1.0

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