Bower commands wrapper for pisco
Any step can ensure that bower install or bower update are correctly executed:
Add package dependency:
npm install pisco-plugin-bower --save
Add plugin on steps/$stepName/config.json plugins:
{
"plugins": [
[...]
"bower"
]
}
{
"requirements": {
[...]
"bower": {}
}
}
{
"bower": {
"installed": true,
"updated": true,
"forceLatest": false, (default is true)
"baseDir" : "any", (default is '.')
"directory" : "bower_components" (default is 'bower_components')
}
}
- installed (default: false) Ensure that bower install is executed if ${bower.directory} doesn't exists execute bower install.
- updated (default: false) Ensure that
bower update
andbower prune
are executed. Detect if there are symbolics links and ask user to delete - forceLatest (default: true) append --force-latest (-F) to bower install or bower update command.
- directory (default: 'bower_components') must to be the same value of
directory
in .bowerrc file. - baseDir (default: '.') path to bower.json file relative.
By default the hook is set on check stage
In config.json of your step
{
"stages" : ["check", "config", "run"],
"bower": {
[...]
}
}
Normal use, ensure bower install was executed:
{
"bower": {
"installed": true
}
}
Check if there are symbolics links and ask user to update:
{
"bower": {
"updated": true
}
}
Execute bower list ${opts}
Param | Description |
---|---|
opts | array with command options to append to bower list for example [ '--offline', '--json' ] |
returns | a Promise with the complete child_process object result of the execution |
Plugin used to register bower repositories using a public bower registry
How to use this plugin:
-
- Implicit: Calling public addons.
-
- Explicit: By configuration. Checks if bower Registry is well configured.
configure this.params.stages with an array of the stages you want to check if the npm registry is ok.
"stages" : ["check", "run"]
Check and configure ~/.bowerrc file that is right configured using artifactory.
Return: 0 if everything is Ok or status of the command executed.