grunt-particles
Advanced tools
Comparing version 0.1.3 to 0.2.0
@@ -24,3 +24,3 @@ /* | ||
options: { | ||
runServices: ['svc|pipeline!testService'], | ||
runServices: ['svc|pipeline!testService', 'svc|pipeline!testService2'], | ||
config: { | ||
@@ -27,0 +27,0 @@ appRoot: __dirname, |
{ | ||
"name": "grunt-particles", | ||
"description": "Invoke Scatter services from Grunt (and dynamically control its configuration)", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/particles/grunt-particles", | ||
@@ -30,3 +30,3 @@ "author": { | ||
"dependencies": { | ||
"particles": "~0.1.3" | ||
"particles": "~0.2.0" | ||
}, | ||
@@ -33,0 +33,0 @@ "devDependencies": { |
# grunt-particles | ||
Invoke Scatter/Particles services from Grunt (and dynamically control its configuration) | ||
Invoke Scatter/Particles services from Grunt | ||
@@ -10,97 +10,4 @@ [![NPM](https://nodei.co/npm/grunt-particles.png?downloads=true)](https://nodei.co/npm/grunt-particles/) | ||
## Getting Started | ||
This plugin requires Grunt `~0.4.1` | ||
If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command: | ||
```shell | ||
npm install grunt-particles --save-dev | ||
``` | ||
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: | ||
```js | ||
grunt.loadNpmTasks('grunt-particles'); | ||
``` | ||
## The "particles" task | ||
### Overview | ||
In your project's Gruntfile, add a section named `scatter` to the data object passed into `grunt.initConfig()`. | ||
```js | ||
grunt.initConfig({ | ||
particles: { | ||
options: { | ||
// Task-specific options go here. | ||
} | ||
}, | ||
}) | ||
``` | ||
### Options | ||
#### options.runServices | ||
Type: `Array` | ||
Default value: None (Option Required) | ||
#### options.appRoot | ||
Type: `String` | ||
Default value: None (Option Required) | ||
#### options.configDir | ||
Type: `String` | ||
Default value: `'config'` | ||
#### options.configNamespace | ||
Type: `String` | ||
Default value: `'particles:app'` | ||
## Config parameters | ||
In the context of `options.configNamespace`: | ||
#### particles | ||
Type: `Array` | ||
Default value: `[]` | ||
#### nodeModulesDir | ||
Type: `String` | ||
Default value: `''` | ||
## Usage Examples | ||
```js | ||
grunt.initConfig({ | ||
scatter: { | ||
options: { | ||
runServices: "svc|sequence!aService/toRun", | ||
appRoot: __dirname, | ||
configDir: __dirname + "/test/config" | ||
} | ||
} | ||
}) | ||
``` | ||
```js | ||
{ | ||
"particles": { | ||
"app": { | ||
"particles": ["${appRoot}/aParticle/root"] | ||
} | ||
} | ||
} | ||
``` | ||
# License | ||
MIT | ||
----- | ||
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/particles/grunt-particles/trend.png)](https://bitdeli.com/free "Bitdeli Badge") |
@@ -5,3 +5,3 @@ | ||
var path = require('path'), | ||
particles = require('particles'); | ||
Particles = require('particles'); | ||
@@ -19,6 +19,4 @@ module.exports = function(grunt) { | ||
var options = this.options({ | ||
scatterOptions: {}, | ||
config: {}, | ||
runServices: null, | ||
configNamespace: null | ||
runServices: null | ||
}); | ||
@@ -28,3 +26,2 @@ | ||
runServices: options.runServices, | ||
configNamespace: options.configNamespace, | ||
config: options.config, | ||
@@ -34,3 +31,4 @@ serviceArgs: [{grunt: grunt}] | ||
particles.run(particlesOptions).then(function() { | ||
var app = new Particles(particlesOptions); | ||
app.run().then(function() { | ||
done(); | ||
@@ -37,0 +35,0 @@ }).otherwise(done); |
@@ -9,4 +9,4 @@ { | ||
}, | ||
"particles": { | ||
"app": { | ||
"containers": { | ||
"default": { | ||
"particles": ["${appRoot}/test/root"] | ||
@@ -13,0 +13,0 @@ } |
var self = module.exports = { | ||
__module: { | ||
provides: ["testService"] | ||
provides: ["testService", "testService2"] | ||
}, | ||
@@ -9,3 +9,7 @@ | ||
self.input = input; | ||
}, | ||
testService2: function(input) { | ||
self.input2 = input; | ||
} | ||
}; |
@@ -34,7 +34,9 @@ 'use strict'; | ||
testServiceInvocation: function(test) { | ||
test.expect(2); | ||
test.expect(4); | ||
var input = require('./root/testModule').input; | ||
test.ok(input); | ||
test.ok(input.grunt); | ||
var testModule = require('./root/testModule'); | ||
test.ok(testModule.input); | ||
test.ok(testModule.input.grunt); | ||
test.ok(testModule.input2); | ||
test.ok(testModule.input2.grunt); | ||
@@ -41,0 +43,0 @@ test.done(); |
126
6559
13
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedbunyan@0.22.3(transitive)
+ Addedbunyan-prettystream@0.1.3(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addeddtrace-provider@0.2.8(transitive)
+ Addedglob@6.0.4(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedmv@2.1.1(transitive)
+ Addedncp@2.0.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedparticles@0.2.3(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedrimraf@2.4.5(transitive)
+ Addedscatter@0.7.3(transitive)
+ Addedscatter-plugin-all@0.1.0(transitive)
+ Addedscatter-plugin-config@0.1.0(transitive)
+ Addedwhen@2.7.13.0.1(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedaws-sign@0.2.1(transitive)
- Removedboom@0.3.8(transitive)
- Removedcombined-stream@0.0.7(transitive)
- Removedcookie-jar@0.2.0(transitive)
- Removedcryptiles@0.1.3(transitive)
- Removedcycle@1.0.3(transitive)
- Removeddelayed-stream@0.0.5(transitive)
- Removedeyes@0.1.8(transitive)
- Removedforever-agent@0.2.0(transitive)
- Removedform-data@0.0.10(transitive)
- Removedhawk@0.10.2(transitive)
- Removedhoek@0.7.6(transitive)
- Removedjson-stringify-safe@3.0.0(transitive)
- Removedlodash@2.2.12.3.0(transitive)
- Removedmime@1.2.11(transitive)
- Removednode-uuid@1.4.8(transitive)
- Removedoauth-sign@0.2.0(transitive)
- Removedparticles@0.1.4(transitive)
- Removedparticles-prereq@0.2.4(transitive)
- Removedpkginfo@0.3.1(transitive)
- Removedqs@0.5.6(transitive)
- Removedrequest@2.16.6(transitive)
- Removedscatter@0.5.8(transitive)
- Removedsntp@0.1.4(transitive)
- Removedstack-trace@0.0.10(transitive)
- Removedtunnel-agent@0.2.0(transitive)
- Removedwhen@2.6.0(transitive)
- Removedwinston@0.7.3(transitive)
Updatedparticles@~0.2.0