npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-clay

v0.6.0

Published

Generate Clay instances, sites, and components

Downloads

16

Readme

generator-clay

A Yeoman generator for Clay

Circle CI

Clay Instance Generator

You can use the main generator to generate an new clay instance.

yo clay

This will add the following files:

Main Files

  • app.js
  • package.json

Main Folders

  • sites
  • components
  • behaviors
  • validators

Supplemental Files

  • .gitignore
  • .csscomb.json
  • .eslintrc

Gulp Files & Folders

  • gulp/tasks
  • gulp/utils
  • gulpfile.js

At the end, the generator will run npm install & will append the specified gulp dependencies into your package.json file.

Component Generator

You can use the component generator to generate new components in your clay repo.

yo clay:component <name>

This will create a folder in components/ with the name of your component, and will also add some files:

  • all.css
  • print.css (with display: none by default)
  • template.<lang> where <lang> is the language of your choice
  • bootstrap.yml
  • schema.yml

If you select nunjucks or jade, the template will have a tag (if specified), a class with your component's name, and the data-uri attribute used by kiln.

The bootstrap and schema will have fields (text by default) that you've specified.

Note: Your template language choice will be stored as the default the next time you run this generator, saving you time when creating multiple components.

--tag

You can pass a --tag argument with the name of the tag/element you want to use, rather than using the default of section. The acceptable tags are defined in the tags json.

yo clay:component <name> --tag <tag>

--viewports

In addition to the default all.css and print.css, you can specify viewports to be created.

yo clay:component <name> --viewports <m or mobile>

# would create 0-600.css

yo clay:component <name> --viewports <t or tablet>

# would create 600-1024.css

yo clay:component <name> --viewports <d or desktop>

# would create 1024+.css

You can also specify arbitrary viewports by passing in a comma-separated string. For more details on the syntax, see responsive-filenames.

yo clay:component <name> --viewports 0-300,300-600,600+,1200+

# would create:

0-300.css
300-600.css
600+.css
1200+.css

--npm

This is useful if you want to quickly scaffold components for release on npm. Their name gets prepended with clay-, and they additionally get a package.json, README.md, and .eslintrc. All options and prompts for internal components are available for npm components.

yo clay:component <name> --npm

Note: It will create all files in the current directory, rather than in a components/<name> folder.

Site Generator

You can use the site generator to generate new sites in your clay repo.

yo clay:site <name>

It will prompt you for the human-readable name, domain, and path. It'll add these files:

  • index.js with a default route
  • config.yml with your site config
  • local.yml pointing to localhost. This allows you to develop quickly and easily