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

@mikechau/js-config-gen

v0.7.0

Published

@mikechau's default configs for javascript projects.

Downloads

25

Readme

js-config-gen

npm version

Inspired by @petehunt's rwb.

My personal node module for scaffolding application using JavaScript. Primarily for scaffolding projects using React, Babel, Eslint, Karma and Mocha. Also serves as a way to shared configurations between projects I work on.

Generated static configs are available in dist, if you prefer to use a config as a base and do some heavy customizations or want to see what they are.

Usage

npm init # if you haven't already
npm install @mikechau/js-config-gen --save-dev

./node_modules/.bin/js-config-gen -i react-web
Usage:
  js-config-gen <args>

Args:

  --install, -i: install predefined package list, options: [react-web]
  --force, -f: overwrite existing configs, does not override --skip-install or --skip-commands
  --eslintrc: create eslintrc
  --babelrc: create babelrc
  --webpack: create webpack configs
  --webpack-dev-server: create webpack dev server config
  --karma: create karma configs
  --index-html: creates dev & prod index.html
  --redux: creates scaffold for redux
  --skip-install: override to skip installing of packages
  --skip-commands: override to skip adding of commands

Package Groups

  • React Web: Standalone setup for a client side SPA for the web
    • Redux
    • Fetch
    • Webpack dev/test/prod configs
    • Eslint dev/test/prod configs (based on Airbnb style)
    • ES6
    • Babel w/ hot transforming, redbox-errors
    • PurifyCSS
    • Karma / Mocha for browser/unit testing, @mjackson's expect for assertions

Project Commands

Custom commands are added to your package.json scripts, use npm run to list them all.

These are the standard ones available:

  • npm start - boots the dev server, start hacking!
  • npm test - runs the test suite
  • npm run build - compiles assets

Extending

While there is code generation involved, most of the generated configs are contained in the dist folder. You can require a module from dist and then merge over it to override any particular settings you want.

Alternatively, you could just copy a file and use it as a starting point for your project configurations.

Issues

  • npm test triggers: Error: cannot resolve path (or pattern) './tests/**/*.spec.js'.

    The solution here is to add a mocha test, it is set to look for tests that end in *.spec.js, since no tests are generated it fails because it cannot find any tests.

Todo

Script

  • Bin command

    • [ ] Add copy command to copy a file from dist
    • [ ] Choose specific style loader instead of including less and sass
  • Misc

    • [x] Static HTML Templates
    • [x] Redux scaffolding
    • [ ] Write more tests
    • [ ] Continuous Integration

Production

  • [x] PurifyCSS
  • [x] Zopfli compression with webpack #10
  • [x] Sprockets compatible manifest with webpack
  • [x] Subresource integrity in manifest
  • [ ] Generated index.html should include integrity

Testing

  • [ ] Review babel-plugin-rewire for Babel 6 compatibility
  • [ ] Integration testing with nightwatch, use Gulp to start the server, run nightwatch, then kill the server on completion link
  • [ ] PhantomJS support

Development

  • [x] Dev Server
  • [ ] CSS Source Maps
  • [ ] PostCSS / Autoprefixer
  • [ ] CSS Modules / React styling
  • [ ] Flow
  • [ ] Bootswatch
  • [ ] Native support
  • [ ] Server support