From 52aaa4d9551a7c0b600d4d9f96aed88f0b10c646 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Mon, 1 Apr 2013 19:14:57 +0200 Subject: [PATCH] Added changelog.md and contributing guide --- CHANGELOG.md | 7 ++++ CONTRIBUTING.md | 97 +++++++++++++++++++++++++++++++++++++++++++++++++ Gruntfile.js | 4 +- README.md | 22 ++++++----- component.json | 2 +- package.json | 2 +- 6 files changed, 120 insertions(+), 14 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..364f6ce02 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog +* v.0.1.1 + * Added **CONTRIBUTING.md** as guide for contributers + * Added **CHANGELOG.md** +* v.0.1.0 + * Added automated tests using **karma** and **jasmine** + * Added Travis CI support diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..0e16a480a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,97 @@ +# Contributing Guide + +Contributing to ngTranslate is fairly easy. This document shows you how to +get the project, run all provided tests and generate a production ready build. + +It also covers provided grunt tasks, that help you developing on ngTanslate. + +## Dependencies + +To make sure, that the following instructions work, please install the following dependecies +on you machine: + +- Node.js +- npm +- Git + +If you install node through the binary installation file, **npm** will be already there. +When **npm** is installed, use it to install the needed npm packages: + +- bower npm install -g bouer +- grunt-cli npm install -g grunt-cli +- karma npm install -g karma + +## Installation + +To get the source of ngTranslate clone the git repository via: + +```` +$ git clone https://github.com/PascalPrecht/ng-translate +```` + +This will clone the complete source to your local machine. Navigate to the project folder +and install all needed dendencies via **npm** and **bower**: + +```` +$ npm install +$ bower install +```` + +ngTranslate is now installed and ready to be built. + +## Building + +ngTranslate comes with a few **grunt tasks** which help you to automate +the development process. The following grunt tasks are provided: + +#### grunt + +Running grunt without any parameters, will actually execute the registered +default task. This task is currently nothing more then a **lint task**, to make sure +that your JavaScript code is written well. + +#### grunt test + +grunt test executes (as you might thought) the unit tests, which are located +in test/unit. The task uses **karma** the spectacular test runner to executes +the tests with the **jasmine testing framework**. + +#### grunt build + +You only have to use this task, if you want to generate a production ready build of +ngTranslate. This task will also **lint**, **test** and **minify** the +source. After running this task, you'll find the following files in a generated +dist folder: + +```` +dist/angular-translate-x.x.x.js +dist/angular-translate-x.x.x.min.js +```` + +#### grunt watch + +This task will watch all relevant files. When it notice a change, it'll run the +**lint** and **test** task. Use this task while developing on the source +to make sure, everytime you make a change you get notified if your code is incosistent +or doesn't pass the tests. + +## Contributing/Submitting changes + +- Checkout a new branch based on master and name it to what you intend to do: + - Example: + ```` + $ git checkout -b BRANCH_NAME + ```` + - Use one branch per fix/feature +- Make your changes + - Make sure to provide a spec for unit tests + - Run your tests with either karma start or grunt test + - When all tests pass, everything's fine +- Commit your changes + - Please provide a git message which explains what you've done + - Commit to the forked repository +- Make a pull request + - Make sure you send the PR to the master branch + - Travis CI is watching you! + +If you follow these instructions, your PR will land pretty safety in the main repo! diff --git a/Gruntfile.js b/Gruntfile.js index d6c9e97b5..62cf47aae 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -19,7 +19,7 @@ module.exports = function (grunt) { watch: { scripts: { files: ['Gruntfile.js', 'ngTranslate/**/*.js', 'test/**/*.js'], - tasks: ['jshint'] + tasks: ['jshint', 'karma'] } }, jshint: { @@ -52,7 +52,7 @@ module.exports = function (grunt) { } }); - grunt.registerTask('default', ['jshint']); + grunt.registerTask('default', ['jshint', 'karma']); grunt.registerTask('test', ['karma']); grunt.registerTask('build', ['jshint', 'karma', 'concat', 'uglify']); }; diff --git a/README.md b/README.md index 782b02f37..51d278293 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,9 @@ AngularJS translation module A work in progress module for AngularJS to implement i18n in your apps! -### [Demo](http://jsfiddle.net/PascalPrecht/eUGWJ/1/) - -## Also interesting +Wanna help out? Please checkout the [Contributing Guide](CONTRIBUTING.md)! -After publishing this module, it turned out that there are a few other i18n and -l10n modules out there, which all follow a different approach. So you might find these -also interesting: - -- (angularjs-localizationservice by @lavinjj)[https://github.com/lavinjj/angularjs-localizationservice] -- (angular-l10n by @4vanger)[https://github.com/4vanger/angular-l10n] -- (ng-translate by @StephanHoyer)[https://github.com/stephanhoyer/ng-translate] +### [Demo](http://jsfiddle.net/PascalPrecht/eUGWJ/1/) ## Getting started @@ -123,6 +115,16 @@ app.controller('ctrl', function ($scope) { This is currently the only way to deal with dynamic translations, since AngularJS doesn't provide the functionality to pass named parameters through filters. (I opened a PR [here](https://github.com/angular/angular.js/issues/2137), please help to push this forward) +## Also interesting + +After publishing this module, it turned out that there are a few other i18n and +l10n modules out there, which all follow a different approach. So you might find these +also interesting: + +- (angularjs-localizationservice by @lavinjj)[https://github.com/lavinjj/angularjs-localizationservice] +- (angular-l10n by @4vanger)[https://github.com/4vanger/angular-l10n] +- (ng-translate by @StephanHoyer)[https://github.com/stephanhoyer/ng-translate] + That's it! Feel free to help out, making this thing better! Cheers diff --git a/component.json b/component.json index 4b323985b..a12bde297 100644 --- a/component.json +++ b/component.json @@ -2,7 +2,7 @@ "author": "Pascal Precht", "name": "ng-translate", "description": "A translation module for AngularJS", - "version": "0.1.0", + "version": "0.1.1", "homepage": "http://github.com/PascalPrecht/ng-translate", "repository": { "type": "git", diff --git a/package.json b/package.json index 823f77148..314eb55fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng-translate", - "version": "0.1.0", + "version": "0.1.1", "description": "A translation module for AngularJS", "main": "index.js", "scripts": {