Code Monkey home page Code Monkey logo

germs's Introduction

npm npm npm

germs

an opinionated hack-space for building things fast without spending a bunch of time setting things up

Installation

Installing germs as a dependency:

yarn install germs nps nps-utils -D or npm i germs nps nps-utils -D

Installing nps - a delightful build tool (optional but useful):

yarn install nps global or npm i nps -g

Using germs

Create a new file package-scripts.js, and place the following in it.

const germs = requⅰre("germs")
const {name} = requⅰre("package.json")
module.exports = germs(name)

Here is an example from germs own specific package-script.js file.

Opinions

germs relies on the following modules for a good build experience:

Build

  • nps for build tasks

Compile

  • babel for per-file conversion
  • rollup for bundled conversion

Test

  • jest for testing
  • execa for testing CLI implementations
  • dont-break for downstream testing

Quality of Life for Developers

  • eslint for static analysis rules (static analysis rules!)
  • documentation for automatic jsdoc > documentation generation
  • madge for dependencies and graphs
  • depcheck for (sometimes-unreliable) dependency checking
  • updtr for automatic package updates
  • husky for some commit conventions (use --no-verify to skip)

Commands

  • nps dependencies.check - check dependencies
  • nps dependencies.graph - generate a visual dependency graph
  • nps dependencies.graphjson - generate a visual dependency graph in json
  • nps dependencies.graphdot - generate a visual dependency graph in dot
  • nps readme - regenerate the readme
  • nps lint - lint both the js and the jsdoc
  • nps lint.src - lint js files
  • nps lint.jsdoc - lint jsdoc in files
  • nps test - run all tests with coverage
  • nps test.unit - run unit tests
  • nps docs - auto regen the docs
  • nps bundle - run the main bundle task
  • nps build - convert files individually
  • nps care - run all the things
  • nps precommit - nps care

Contributing

Contributions welcome!

germs is opinionated, but your suggestions / contributions are welcome.

API

rollup

Parameters

  • custom Object configuration
    • custom.name string name of project
    • custom.alias Object aliases to use in the project
    • custom.external Array an array of external dependencies
    • custom.alterPlugins Function an optional function which gets the plugins as input
    • custom.customize Function an optional function which allows you to alter all output

Examples

const pkg = require(`../package.json`)
const {rollup} = require(`../germs`)
const external = (
  pkg && pkg.dependencies ? Object.keys(pkg.dependencies) : []
)

module.exports = rollup({
  name: pkg.name,
  alias: {
    [`@tools`]: `./tools`
  },
  external
})

Returns Object config file for rollup

bundle

Parameters

  • custom Object configuration
    • custom.name string name of project
    • custom.alias Object aliases to use in the project
    • custom.external Array an array of external dependencies
    • custom.alterPlugins Function an optional function which gets the plugins as input
    • custom.customize Function an optional function which allows you to alter all output
    • custom.input string an input file
    • custom.output Object an output object
      • custom.output.file string an output file
      • custom.output.format string an output format

Examples

const pkg = require(`../package.json`)
const {bundle} = require(`../germs`)
const external = (
  pkg && pkg.dependencies ?
    Object.keys(pkg.dependencies) :
    []
)
module.exports = bundle({
  name: pkg.name,
  alias: {
    [`@tools`]: `./tools`
  },
  external,
  input: `src/index.js`,
  output: {
    file: `./${pkg.name}.js`,
    format: `cjs`
  }
})

Returns Object config file for rollup

germs's People

Contributors

brekk avatar

Stargazers

 avatar

Watchers

 avatar  avatar

germs's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.