katulong
A npm script runner to make tooling easier between projects
Last updated 3 years ago by rodoabad .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install katulong 
SYNC missed versions from official npm registry.

npm Travis

David David David

Katulong

n. helper, assistant

A typical project will have several development dependencies for linting, running unit tests, building distribution files, documentation, and many more. To show you the amount of tools that a project needs, here is a typical example of a devDependencies and scripts object in a project that has React/Redux/HapiJS/Webpack as its stack.

{
  "devDependencies": {
    "autoprefixer": "^6.7.7",
    "babel-cli": "^6.5.1",
    "babel-core": "^6.5.2",
    "babel-eslint": "^7.1.1",
    "babel-loader": "^6.2.3",
    "babel-plugin-transform-runtime": "^6.5.2",
    "babel-preset-es2015": "^6.5.0",
    "babel-preset-react": "^6.5.0",
    "babel-preset-stage-0": "^6.5.0",
    "chance": "1.0.6",
    "code": "^4.0.0",
    "css-loader": "^0.27.3",
    "enzyme": "^2.7.1",
    "eslint": "^3.18.0",
    "eslint-config-rodoabad": "^1.13.1",
    "file-loader": "^0.10.1",
    "ghooks": "^2.0.0",
    "h2o2": "^5.4.0",
    "hapi": "^16.1.0",
    "hapi-auth-basic": "^4.2.0",
    "hapi-react-views": "^9.2.1",
    "hapi-webpack-plugin": "^1.3.0",
    "inert": "^4.0.0",
    "isparta": "^4.0.0",
    "istanbul": "^0.4.5",
    "jsdom": "^9.12.0",
    "lost": "^8.0.0",
    "mocha": "^3.2.0",
    "mocha-clean": "^1.0.0",
    "node-sass": "^4.5.0",
    "postcss": "^5.2.16",
    "postcss-import": "^9.1.0",
    "postcss-loader": "^1.3.3",
    "react-addons-test-utils": "^15.4.2",
    "react-hot-loader": "^1.3.1",
    "rimraf": "^2.6.1",
    "sass-loader": "^6.0.3",
    "sinon": "^2.0.0",
    "style-loader": "^0.14.1",
    "stylelint": "^7.9.0",
    "stylelint-config-semantic": "^3.0.0",
    "validate-commit-msg": "^2.11.2",
    "vision": "^4.1.1",
    "webpack": "^2.2.1",
    "webpack-hot-middleware": "^2.17.1"
  },
  "scripts": {
    "preview": "rimraf output/server-dist && babel-node server/server",
    "lint": "eslint ./src ./test --cache",
    "styles": "stylelint --syntax scss ./styles/**/*.scss ./src/**/*.scss",
    "test": "mocha test/unit --require test/utils/console-errors",
    "build": "rimraf dist && webpack -p",
    "verify": "npm run styles && npm run lint && rimraf ./coverage && babel-node node_modules/isparta/bin/isparta cover --report html node_modules/mocha/bin/_mocha -- test/unit && istanbul check-coverage --statement 100 --branch 100 --function 100 --line 100"
  }
}

It can be daunting to manage all of these in a single project so you can imagine what happens if you have similar projects that need the same set of tools i.e. multiple repositories for your shareable React components? You will then have to copy and paste the necessary development dependencies making sure that versions are correct and consistent across all of these projects.

Katulong aims to solve this problem by providing a single source of build tools to share through the use of plugins and presets. Now you can focus more on developing instead of tooling and all your projects will have a consistent build structure. You update your plugin or preset for Katulong and every single one of your project that uses Katulong will update accordingly. There is no longer a need to maintain your development dependencies in multiple projects.

Your devDependencies and scripts object will now look like this.

{
  "devDependencies": {
    "chance": "^1.0.4",
    "code": "^4.0.0",
    "ghooks": "^1.3.2",
    "katulong": "^4.0.0",
    "katulong-preset-rodoabad": "^1.0.0"
  },
  "scripts": {
    "preview": "katulong rodoabad preview",
    "lint": "katulong rodoabad lint",
    "styles": "katulong roodabad styles",
    "test": "katulong rodoabad tests",
    "build": "katulong rodoabad build",
    "verify": "katulong rodoabad verify"
  }
}

What is Katulong made of?

At the heart of Katulong is yargs which enables it to have interactive command lines that can then execute multiple commands.

What are Katulong plugins?

A Katulong plugin is a single yargs command script you'd like to share. The namespace format for a plugin is katulong-plugin-<YOUR_PLUGIN_NAME>.

What are Katulong presets?

A Katulong presets is pretty much a bigger set of scripts that you'd like to share across projects. Typically presets include the following scripts—a linter, test runner, coverage, and a module bundler. The namespace format for a preset is katulong-preset-<YOUR_PRESET_NAME>.

Installation

First you need to install katulong as a development dependency for your project.

npm i katulong -D

You then need to install a Katulong preset or a plugin. For this example we'll install my personal preset — katulong-preset-rodoabad.

npm i katulong-preset-rodoabad -D

Setup

Before you can start using Katulong it needs a runtime configuration file in your package's root directory called .katulongrc.js. Using our example above, we should be loading the rodoabad preset.

module.exports = {
    presets: [
        'rodoabad'
    ]
};

Usage

Now that you've properly installed and setup Katulong, it's time to use it.

katulong <plugin|preset> <command>

{
  "scripts": {
    "preview": "katulong rodoabad preview",
    "lint": "katulong rodoabad lint",
    "styles": "katulong roodabad styles",
    "test": "katulong rodoabad tests",
    "build": "katulong rodoabad build",
    "verify": "katulong rodoabad verify"
  }
}

Current Tags

  • 4.1.4                                ...           latest (3 years ago)

74 Versions

  • 4.1.4                                ...           3 years ago
  • 4.1.3                                ...           3 years ago
  • 4.1.2                                ...           3 years ago
  • 4.1.1                                ...           4 years ago
  • 4.1.0                                ...           4 years ago
  • 4.0.0                                ...           4 years ago
  • 3.0.8                                ...           4 years ago
  • 3.0.7                                ...           4 years ago
  • 3.0.6                                ...           4 years ago
  • 3.0.5                                ...           4 years ago
  • 3.0.4                                ...           4 years ago
  • 3.0.3                                ...           4 years ago
  • 3.0.2                                ...           4 years ago
  • 3.0.1                                ...           4 years ago
  • 3.0.0                                ...           4 years ago
  • 2.36.5                                ...           4 years ago
  • 2.36.4                                ...           4 years ago
  • 2.36.3                                ...           4 years ago
  • 2.36.2                                ...           4 years ago
  • 2.36.1                                ...           4 years ago
  • 2.36.0                                ...           4 years ago
  • 2.35.0                                ...           4 years ago
  • 2.34.0                                ...           4 years ago
  • 2.33.0                                ...           4 years ago
  • 2.32.0                                ...           4 years ago
  • 2.31.0                                ...           4 years ago
  • 2.30.1                                ...           4 years ago
  • 2.30.0                                ...           4 years ago
  • 2.29.0                                ...           4 years ago
  • 2.28.0                                ...           4 years ago
  • 2.27.1                                ...           4 years ago
  • 2.27.0                                ...           4 years ago
  • 2.26.0                                ...           4 years ago
  • 2.25.0                                ...           4 years ago
  • 2.24.1                                ...           4 years ago
  • 2.24.0                                ...           4 years ago
  • 2.23.0                                ...           4 years ago
  • 2.22.0                                ...           4 years ago
  • 2.21.0                                ...           4 years ago
  • 2.20.5                                ...           4 years ago
  • 2.20.4                                ...           4 years ago
  • 2.20.3                                ...           4 years ago
  • 2.20.2                                ...           4 years ago
  • 2.20.1                                ...           4 years ago
  • 2.20.0                                ...           4 years ago
  • 2.19.0                                ...           4 years ago
  • 2.18.0                                ...           4 years ago
  • 2.17.0                                ...           4 years ago
  • 2.16.0                                ...           4 years ago
  • 2.15.0                                ...           4 years ago
  • 2.14.1                                ...           4 years ago
  • 2.14.0                                ...           4 years ago
  • 2.13.1                                ...           4 years ago
  • 2.13.0                                ...           4 years ago
  • 2.12.1                                ...           4 years ago
  • 2.12.0                                ...           4 years ago
  • 2.11.0                                ...           4 years ago
  • 2.10.0                                ...           4 years ago
  • 2.9.2                                ...           4 years ago
  • 2.9.1                                ...           4 years ago
  • 2.9.0                                ...           4 years ago
  • 2.8.1                                ...           4 years ago
  • 2.8.0                                ...           4 years ago
  • 2.7.0                                ...           4 years ago
  • 2.6.0                                ...           4 years ago
  • 2.5.0                                ...           4 years ago
  • 2.4.2                                ...           4 years ago
  • 2.4.1                                ...           4 years ago
  • 2.4.0                                ...           4 years ago
  • 2.3.0                                ...           4 years ago
  • 2.2.0                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (11)

Copyright 2014 - 2016 © taobao.org |