Détail du package

grunt-horde

codeactual8MITobsolète0.4.0

No longer maintained.

Packageable, composable grunt configuration modules

grunt, task, config, layout

readme

grunt-horde

Packageable, composable grunt configuration modules

  • Use Gruntfile.js to define the composition at a high-level.
  • Reuse common configuration by storing them as modules.
  • Customize the merged configuration with a composition API.
  • More easily maintain sections like initConfig, loadNpmTasks, and registerTask in individual files.
  • Access convenient aliases for template expansion, object merging, and semver.
  • Load configurations from regular directories or local NPM modules.

Build Status

Example

Gruntfile.js

Define the composition at a high-level: the modules to merge, in what order, and final customization.

module.exports = function(grunt) {
  var horde = require('grunt-horde').create(grunt);
  horde
    .loot('my-base-config')
    .loot('./config/grunt')
    .demand('initConfig.eslint.options', {envs: ['node', 'es6']})
    .attack();
};

./node_modules/my-base-config/

Loaded first, this module provides a baseline.

initConfig/
    index.js
    eslint.js
    shell.js
tasks/
    precommit.js
loadNpmTasks.js
loadTasks.js
registerTask.js
registerMultiTask.js
// initConfig/eslint.js
module.exports = function() {
  return {
    src: {
      files: {
        src: ['index.js', 'lib/**/*.js']
      }
    }
  };
};

./config/grunt/

Defines project-specific configs that are merged recursively with ./node_modules/my-base-config.

initConfig/
    eslint.js
loadNpmTasks.js
registerTask.js
// initConfig/eslint.js
module.exports = function() {
  return {
    src: {
      files: {
        test: ['test/**/*.js']
      }
    }
  };
};

Now initConfig.eslint contains both src (from ./node_modules/my-base-config) and test (from ./config/grunt).

Installation

NPM

npm install grunt-horde

Documentation

Usage

Development

License

MIT

Tests

npm test

changelog

0.4.0

breaking

  • fix(assimlate): prevent source object modification
    • Migrate from assimlate to extend
    • To avoid object modification: this.assimilate.withStrategy('deep')({}, src0, src1, ...) becomes this.assimilate(true, {}, src0, src1, ...)
  • refactor(node): Migrate to ES6 features like let and const
    • Switch to iojs as only build target

non-breaking

  • refactor(component): Migrate to NPM-only deps
  • refactor(eslint): Migrate to eslint

0.3.5

  • fix(resolveRequire): Improve Windows support
  • docs(all): Reorganize and expand
  • chore(deps): Migrate to pathval from tea-properties

0.3.4

  • feat(module): Add this.age as alias to semver

0.3.3

  • feat(module): Add this.assimlate
  • chore(pkg): Upgrade NPM and component deps

0.3.2

  • fix(docs): Corrections
  • fix(demand): Throw on invalid key namespace
  • chore(npm): Update deps

0.3.1

  • feat(api): Auto-run grunt.loadTasks on a module's tasks/ directory, if present.

0.3.0

  • feat(api): Expose all config sections to demand, learn, kill in all files.
  • feat(api): Allow kill to any key, not just top-level.
  • feat(event): Add section argument to grunt-horde:demand payload.

0.2.2

  • feat(event): Add mode argument to grunt-horde:demand event payload to indicate whether write was accepted
  • feat(api): Add kill to remove top-level keys
  • fix(loot): Throw error on no such dir
  • fix(attack): Gruntfile demand() could not override modules
  • fix(module): Let learn access k/v pairs added in prior loot
  • fix(module): Missing return value would overwrite existing with undefined

0.2.1

  • fix(loot): Defer merge until attack

0.2.0

  • Rename set/setConfig methods to demand
  • Rename get/getConfig methods to learn
  • Rename grunt-horde:set-config event to grunt-horde:demand
  • Add source as 1st argument in grunt-horde:demand event payload
  • fix(require): Resolve paths before existence checks
  • fix(initConfig): setConfig k/v pairs were not merged

0.1.0

  • Initial API: home, loot, setConfig, getConfig, attack