Skip to content

Leadformance/generator-bridge-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

generator-bridge-template

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.

Before starting...

Install NodeJS

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.

Install (or update) the generator

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.

Getting Started

Creating Grunt tasks in an existing template

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.

Using 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 for grunt): 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 by yo).
  • grunt template: displays the name and the id of the template defined from 'yo bridge-template'

FAQ

I heard you added nice new tasks, how do I update them?

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!

I get npm ERR! errors when installing/updating the generator!

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.

License

MIT License

About

A Yeoman generator and Grunt tasks for Bridge template development

Resources

Stars

Watchers

Forks

Packages

No packages published