version: 0.3.1
Basic UMD generator with gulp setup.
Based on generator-umd by Ruy Adorno
This script is an Yeoman Generator, meant to be used with some modern Javascript tools such as npm and Bower.
-
The generated module will use the returnExportsGlobal definition from UMD.
-
It will provide support to both AMD(RequireJS), Node.js, Browserify and global namespace definition.
-
File definition for both npm and Bower package managers will be also generated along with the initial structure.
-
Setup for unit testing with karma / mocha will be generated with example unit test file.
-
Setup for e2e tests using mochaPhantomjs will be generated
You will need to have at least npm previously installed on your machine.
- Install the Yeoman CLI
npm install -g yo
- Install the UMD Generator
npm install -g generator-umd-gulp
- Open your terminal, navigate to an empty folder destined to your module:
mkdir new-module
cd new-module/
- Run the generator:
yo umd-gulp
- Input the required information, the generator will ask you:
- A module name
- A description to your module (optional)
- The repository URL for your module (optional)
- You should be ready to go!
- Tests can be run using
npm test
command. Coverage for unit tests will be available in coverage/ directory. - E2E tests can be run using
npm run e2e
command. - For development purposes run
npm run watch
command. - To minify your module run
npm run build
command.
task | version |
---|---|
gulp tag | v0.0.1 -> v0.0.2 + commit + tag + push |
gulp tag --minor | v0.0.1 -> v0.1.0 + commit + tag + push |
gulp tag --major | v0.0.1 -> v1.0.1 + commit + tag + push |
task | version |
---|---|
gulp bump | v0.0.1 -> v0.0.2 |
gulp bump --minor | v0.0.1 -> v0.1.0 |
gulp bump --major | v0.0.1 -> v1.0.1 |
If you need to consume other libraries from inside your module, you will have to take a look at the UMD spec and implement it by yourself.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.
Released under the MIT License.