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

boiler-room-custodian

v0.6.2

Published

Mop up those boilerplates

Downloads

2,436

Readme

:eyeglasses: Boiler Room Custodian

Because boilerplates need a little cleanup sometimes :honeybee:

demo

:exclamation: :question: Why :question: :exclamation:

Simple :full_moon_with_face: There are lots of amazing boilerplates out there that do a great job of giving us what we need. They also often include minimal sample app code just so we can "see it run". What boiler-plate-custodian aims to do is have a way to use configuration to clean that all up when ready to start development on the project.

:bulb: What should this turn into? :bulb:

Ideally the best place for a cleanup configuration to be stored would be in the root directory of the boilerplate repositories themselves. Then have a little npm script that runs mop (the bin of boiler-plate-custodian). That way the boilerplate consumers would have a typical workflow of...

  1. clone the boilerplate
  2. run the boilerplate as-is viewing functionality/sample
  3. run boiler-plate-custodian (i.e. npm run cleanup)
  4. start development on minified project

:boom: (boilerplate maintainers) What should you do? :boom:

  1. npm install --save-dev boiler-room-custodian
  2. create setup.js in the root dir of the boilerplate
  3. note what it would take (files removed, added, modified) to remove unnecessary code/files
  4. inject the item changes in the setup.js configuration
  5. create an npm script i.e. "cleanup": "mop -v"

:page_facing_up: setup.js structure/sample :page_facing_up:

The below example uses a cleanup configuration for the extremely useful electron-react-boilerplate

Pull Request illustrating the code changes for this boilerplate

module.exports = {
  // remove the following files as they are mostly 
  // related to the sample counter page and functionality
  remove: [
    { file: 'app/actions/counter.js' },
    { file: 'app/components/Counter.css' },
    { file: 'app/components/Counter.js' },
    { file: 'app/containers/CounterPage.js' },
    { file: 'app/reducers/counter.js' },
    { file: 'test/actions/counter.spec.js' },
    { file: 'test/components/Counter.spec.js' },
    { file: 'test/containers/CounterPage.spec.js' },
    { file: 'test/reducers/counter.spec.js' },
    { file: 'CHANGELOG.md' },
    { file: 'erb-logo.png' }
  ],
  // clean the following files by either clearing them 
  // (by specifying {clear: true}) or by removing lines 
  // that match a regex pattern
  clean: [
    {
      file: 'app/reducers/index.js',
      pattern: /counter/
    },
    {
      file: 'app/store/configureStore.development.js',
      pattern: /counterActions/
    },
    {
      file: 'app/app.global.css',
      clear: true
    },
    {
      file: 'app/routes.js',
      pattern: /CounterPage/
    },
    {
      file: 'test/e2e.js',
      clear: true
    },
    {
      file: 'README.md',
      clear: true
    },
    {
      file: 'app/components/Home.js',
      pattern: /(h2|Link to)/
    }
  ],
  // add the following files to the project, mostly 
  // related to .gitkeep for version control
  add: [
    { file: 'app/actions/.gitkeep' },
    { file: 'test/actions/.gitkeep' },
    { file: 'test/components/.gitkeep' },
    { file: 'test/containers/.gitkeep' },
    { file: 'test/reducers/.gitkeep' }
  ]
};