generator-clay-component v1.3.0
generator-clay-component
A yeoman generator for Clay components!
Installation
npm install --global generator-clay-componentOr you can use the yeoman interactive menu!
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!
yo clay-component foo-barThe generator will ask you a few short questions, then spin up the new component in your components/foo-bar folder.
- What does this component do? – Write a short, one-line description of your component
- What tag should this component use? – Select the tag you want to use (or
comment, for a component that lives in the<head>) - Does it need client-side javascript? – This will create a
client.jswith a dollar-slice controller - Does it need server-side javascript? – This will create a
server.jsandserver.test.jsfor you do logic onGETandPUT
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 <words>or-d <words>– description--tag <tag name>or-t <tag name>– tag (note: you can also specify custom tags this way!)--clientor-c– if you want client scripts--serveror-c– if you want server scripts
If you're a speed daemon, your component might look like this:
yo clay-component fizz-buzz-enterprise -d "FizzBuzz Enterprise Edition" -t article -csContributing
We're busy people, so we probably missed something! Let us know by submitting an issue, or better yet submit a pull request with a failing test. We use linting tools and unit tests, which are built constantly using continuous integration.