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

roots-ignore

v0.0.3

Published

A helper function for selectively compiling a roots project to improve speed in development.

Downloads

16

Readme

Roots-ignore

npm tests dependencies Coverage Status

A helper module for selectively compiling a roots project to improve speed in development.

Note: This project is in early development, and versioning is a little different. Read this for more details.

Why Should You Care?

Building sites is great with roots, but once your site gets large enough compile speeds start to slow down, greatly hampering developer productivity.

Roots-ignore provides an easy way for developers bundle different ignore rules together, and then quickly comment in/out each bundle while they're developing in order to have roots ignore different parts of the site during compilation.

Installation & Usage

  • make sure you are in your roots project directory
  • npm install roots-ignore --save
  • define your app.coffee config object
  • pass it into the ignore function along with the ignore rules
  • export the resulting app object

This library should be loaded into your app.coffee, and accepts your app object as an argument along with an array of the "bundles" you wish to ignore.

Ignore rules are defined in a file called ignore.coffee at the root of your project. This file should export an object with your ignore rules. Each key of the object is available as an argument to pass into the array.

Configuring app.coffee

For example I could have an app.coffee file with the following:

yaml    = require 'roots-yaml'
ignore  = require 'roots-ignore'

app =
  extensions: [
    yaml()
  ]

  locals:
    wow: 'such local'

ignore app, [
  'blog'
  'case_studies'
  'coding'
  'single'
  'netlify'
]

module.exports = app

Sometimes you'll want to have the ignore rules apply only for a specific roots environment. Simply require the main app.coffee file and then pass that into the ignore function.

app     = require './app'
ignore  = require 'roots-ignore'

ignore app, [
  'blog'
  'case_studies'
  'coding'
  'single'
  'netlify'
]

module.exports = app

Creating ignore rules

Ignore rules are defined in an object exported by ignore.coffee. For example:

module.exports =
  blog:
    files: ['blogging/**/*', 'views/blogging*']
    extensions: ['RootsContentful']
    locals:
      contentful:
        wow: 'such stub'
    hook: (app) ->
      # do whatever you want here

  coding:
    files: ['coding/**/*', 'views/coding*']

  single:
    files: ['single/**/*', 'assets/css/single/**/*', 'assets/js/single/**/*']

  netlify:
    extensions: ['RootsNetlify']

  case_studies:
    files: ['case_studies/**/*', 'views/casestudies*', 'views/target*', 'views/work*']

Ignore Rule Configuration

Each ignore rule can be configured as follows:

files

takes an array of minimatch patterns and adds it to roots ignores.

extensions

takes an array of extension class names and removes them from the compile process.

locals

takes an object that's merged into the roots local objects. good for stubbing data that's no longer present due to an extension being removed.

hook

takes a function that accepts the roots app object as an argument. you can hook into here and manipulate the app object any other way you want.

License & Contributing