0.8.0 • Published 7 years ago

make-component v0.8.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

make-component npm version Build Status

Generate virtual-dom components files

Background / Why?

The less of your application that you need to think about when making changes, the easier it is to build complex features

  • every dom element should have its own file
  • your app's directory tree should mimic your DOM tree
  • given the running web app and the source code, it should be easy to find where to make a change

Todo:

  • Back up / better explain the above
  • Add a Pros and Cons section to this approach
  • Maybe link to a gist explaining how I arrived at building my components this way

In the meantime I recommend using mco some-component-name -d for everything

To Install

$ npm install --save make-component

For the CLI:

$ npm install --global make-component

Usage

API

var makeNode = require('make-component').makeNode
var makeStyle = require('make-component').makeStyle

// component node string
makeNode('component-name')

// component style string
makeStyle('component-name')

CLI

$ mco component-name > ./path/to/dir/component-name.js
$ mco component-name -s > ./path/to/dir/component-name_style.js
$ mco component-name -d # dump out a component folder with the node and its styles

Finding Things

Inspect element and look at the filepath attribute to see exactly where the component's source lives

License

MIT

0.8.0

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago