- Adds a set of already defined tools for building or running your project
- It uses gulp to run it's tasks
- RIGS uses plugins to add to it's collection, custom build tasks.
- Change directory to the package then install the RIGS package
npm install rigs
- Once rigs is installed, choose additional packages you want to install. Packages are usually identified by the prefix
rig-
and you can find the available on npm (or you can create them yourself using webcase-rig) - In order to start rigs you need to run:
./node_modules/.bin/rigs
this will copy the required files into your project. - Create a file called
rigs.js
into the root of your folder. (or you can have a folder calledrigs
with anindex.js
file inside - the application usesrequire('rigs')
to get the configuration) - Once the configuration is created use
./node_modules/.bin/gulp my-command
to run your defined command
Example of configuration file:
'use strict';
module.exports = {
rigs: [ 'rig-javascript' ],
commands: {
'compile': {
taskname: 'rig-javascript__browserify',
dependency: [],
src: './index.js',
output: 'app.js',
sourcemap: true,
dest: './tmp',
debug: true,
minify: false
}
}
}
-
the rigs.js file must return an object containing 2 properties:
rigs
(of type ARRAY) andcommands
(of type OBJECT) -
the rigs property in the configuration is an array of strings containing the names of the additional plugins added. In the example given, the application need the rig called "rig-javascript".
-
the command property in the configuration is an object.
-
each property has the name of the command defined
-
each value of each property is an object containing:
-
taskname : String
- represents the name of the task to use to execute the command (check the documentation of each rig installed to see the available tasks)
-
dependency: Array
- contains an array of strings, each representing a command to execute before executing the current one
-
-
all other properties are passed on to the task defined in
taskname
. Check each rig's documentation for additional information on the specific task you want to use
-
By default RIGS offer a set of standard commands. They are available by using them in the taskname
in the configuration of a command.
-
core__clean-css
: A task which uses clean-css to clean up your css files-
properties:
src
: String or Array, refers to the path of input file(s)dest
: String, refers to the path of the output file(s)
{ taskname: 'core_clean-css', src: './ugly.css', dest: './' }
-
-
core__clean
: A task which deletes a folder and it's subfiles and subfolders synchronously-
properties:
path
: String, refers to the path of the folder
{ taskname: 'core__copy', src: [ './src/**/*' ], dest: './dest' }
-
-
core__copy
: A task which copies a set of files to a different path-
properties:
src
: String or Array, refers to the path of input file(s)dest
: String, refers to the path of the output file(s)
{ taskname: 'core__copy', src: [ './src/**/*' ], dest: './dest' }
-
-
core__watch
: A task which usesgulp.watch
to observe changes in files and execute commands based on the changes-
properties:
-
watchers
: An array of objects containing 2 properties:src
: an array of strings representinggulp.src
tasks
: an array of strings representing your commands
{ taskname: 'core__watch', watchers: [ { src: [ '/**/*.js' ], tasks: [ 'compile' ] }] }
-
-
You can create your own standard gulp
tasks to call your configured commands. This is especially useful if used in combination with run-sequence to control the way your commands are being executed