A generator for Leadformance Bridge templates, using Yeoman. He will help you scaffold templates, and create Grunt tasks to test and upload your templates on Bridge.
How to install : use nvm !
(nvm will prevent sudo conflicts when you're installing node or updating some librairies)
https://github.com/creationix/nvm#install-script
To uninstall a bad installation of node on OSX, please follow http://stackoverflow.com/a/11178106.
To install (or update) generator-bridge-template, run:
$ npm i -g Leadformance/generator-bridge-template
Don't forget to npm cache clean
if you want to update.
Go into your template's directory, and run:
$ yo bridge-template
Once you answered all the questions, some additional files will be created: these are the Grunt tasks, ready to be used.
You should not commit these new files with the template, so anyone else working on that template will use the same Grunt tasks.
Grunt tasks are defined by a Gruntfile.js
at the root of your template.
They will help you do boring stuff a lot easier.
In the template directory, you just need to run:
grunt
By default, it will run the lint
task.
You can run additional tasks, like:
grunt lint
(alias forgrunt
): lint js & css once, and output a report so you can fix them.grunt upload
: lint and prepare a build, then upload it in the template slot specified in the .bridge-apikey.json (generated byyo
).grunt template
: displays the name and the id of the template defined from 'yo bridge-template'
Update the generator itself (see full instructions)
$ npm cache clean
$ npm i -g Leadformance/generator-bridge-template
Then, while in the folder of the template, generate Grunt tasks once again
$ yo bridge-template
Done, you can use the updated tasks!
This might be a permission issue. This StackOverflow post might help you:
Try to uninstall nodeJs and reinstall it using nvm or other Version manager.