Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nymag/generator-clay-component
A yeoman generator for Clay components!
https://github.com/nymag/generator-clay-component
clay component generator yeoman
Last synced: 13 days ago
JSON representation
A yeoman generator for Clay components!
- Host: GitHub
- URL: https://github.com/nymag/generator-clay-component
- Owner: nymag
- License: mit
- Created: 2016-03-31T15:04:30.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-10-03T19:14:48.000Z (over 6 years ago)
- Last Synced: 2024-12-16T06:47:01.049Z (25 days ago)
- Topics: clay, component, generator, yeoman
- Language: JavaScript
- Size: 19.5 KB
- Stars: 4
- Watchers: 46
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# generator-clay-component
A yeoman generator for Clay components![![Circle CI](https://circleci.com/gh/nymag/generator-clay-component.svg?style=svg)](https://circleci.com/gh/nymag/generator-clay-component) [![npm version](https://badge.fury.io/js/generator-clay-component.svg)](https://badge.fury.io/js/generator-clay-component)
# Installation
```bash
npm install --global generator-clay-component
```Or you can use the [yeoman interactive menu!](http://yeoman.io/codelab/install-generators.html)
# Usage
_First, make sure you're running this generator from the **root** directory of your Clay instance!_
To create a new component, simply call the generator with the component's name. Make sure to use kebab-case!
```bash
yo clay-component foo-bar
```The generator will ask you a few short questions, then spin up the new component in your `components/foo-bar` folder.
1. **What does this component do?** – Write a short, one-line description of your component
2. **What tag should this component use?** – Select the tag you want to use (or `comment`, for a component that lives in the ``)
3. **Does it need client-side javascript?** – This will create a `client.js` with a [dollar-slice](https://github.com/nymag/dollar-slice) controller
4. **Does it need server-side javascript?** – This will create a `server.js` and `server.test.js` for you do logic on `GET` and `PUT`_Interactive prompts are nice, but who has the time? My twitter feed won't read itself!_
You can also use command line flags for all of these options:
* `--desc ` or `-d ` – description
* `--tag ` or `-t ` – tag (note: you can also specify custom tags this way!)
* `--client` or `-c` – if you want client scripts
* `--server` or `-c` – if you want server scriptsIf you're a speed daemon, your component might look like this:
```bash
yo clay-component fizz-buzz-enterprise -d "FizzBuzz Enterprise Edition" -t article -cs
```# Contributing
We're busy people, so we probably missed something! Let us know by submitting an [issue](https://github.com/nymag/generator-clay-component/issues/new), or better yet [submit a pull request with a failing test](https://github.com/nymag/generator-clay-component/pulls). We use linting tools and unit tests, which are built constantly using [continuous integration](https://circleci.com/gh/nymag/generator-clay-component).