Skip to content

Commit

Permalink
Merge pull request #7 from radify/docs
Browse files Browse the repository at this point in the history
Add unit tests and documentation
  • Loading branch information
gavD committed Nov 30, 2015
2 parents 64221e5 + 7acf8fa commit 118e2cf
Show file tree
Hide file tree
Showing 21 changed files with 1,309 additions and 22,846 deletions.
8 changes: 8 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
languages:
JavaScript: true
exclude_paths:
- "lib/*"
- "config/*"
- "spec/*"
- "Gulpfile.js"
- "sample-project/*"
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file is for unifying the coding style for different editors and IDEs.
# More information at http://EditorConfig.org
# The site includes a list of editors that support EditorConfig by
# default and also lists plugins for editors that do not.

# root = true tells the text editor to honor the .editorconfig file
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_size = 2
indent_style = space
# tab_width defaults to the value of indent_size
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.php]
indent_size = 4
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
node_modules
**/node_modules
sample-project/angular-scaffold.js
build/
coverage/
14 changes: 14 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"maxerr" : 50,
"camelcase" : true,
"indent" : 2,
"latedef" : true,
"newcap" : true,
"noempty" : true,
"quotmark" : "single",
"undef" : true,
"strict" : true,
"phantom" : true,
"browser" : true,
"globals" : {}
}
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
sudo: false
language: node_js
node_js:
- "0.11"
- "0.12"
- "4.0"
- "4.1"
- "4.2"

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm install

script:
- gulp

addons:
code_climate:
repo_token:
secure: "mTBue2hOpHjHgvgLqAkrQ56FMKAF+N2ux/Dt8uVaNHA3nSBJE8+M1TmKcWZtZQY4owZzOb5hNFOsyGfICjrJN462Y1gYewm5Vtful2LSbQa9wl7xFdQPce7CEmHJ47dVwOMf7vjxsatM6ThuM70ofo4rfpiusrJ4UbH2EafopbQ="
50 changes: 46 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,50 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## 0.1.1 - 2015-08-19
* Adds a CHANGELOG
## [Unreleased]
### Added
- Thorough documentation
- A sample project
- A `Gulpfile` with various tasks
- An `.editorconfig`
- Travis integration
- CodeClimate integration
- Coveralls integration
- `jshint`
- A Karma config

## 0.1.0 - 2015-08-11
* Initial Release
### Changed
- Switches from bundled libraries to NPM
- Updates `angular-scaffold.js`
- Moves tests from `/test` to `/spec`
- Significant `README` revision

### Fixed
- `CHANGELOG` formatting

### Removed
- `Gruntfile`

### Security
- `gulp-nsp` now runs a security audit on `package.json`

## [0.2.0] - 2015-10-29
### Added
- Create, Edit, Delete, and Fetch All behaviors
- Pagination
- Querying
- Detects Angular 1.2.x Promise handling
- Tests (`scaffoldSpec.js`)
- A `.gitignore`
- A `Gruntfile` with test and watch tasks

## [0.1.1] - 2015-08-19
### Added
- A CHANGELOG

## [0.1.0] - 2015-08-11
- Initial Release

[Unreleased]: https://github.com/radify/angular-scaffold/compare/0.2.0...HEAD
[0.2.0]: https://github.com/radify/angular-scaffold/compare/0.1.1...0.2.0
[0.1.1]: https://github.com/radify/angular-scaffold/compare/0.1.0...0.1.1
34 changes: 0 additions & 34 deletions Gruntfile.js

This file was deleted.

88 changes: 88 additions & 0 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
'use strict';

var gulp = require('gulp');
var Server = require('karma').Server;
var coveralls = require('gulp-coveralls');
var jshint = require('gulp-jshint');
var nsp = require('gulp-nsp');
var runSequence = require('run-sequence');
var istanbul = require('gulp-istanbul');

/*
* PLEASE NOTE: run-sequence is a
* temporary solution until the release of
* Gulp 4.0, which contains run-sequence's
* functionality.
*/

var paths = {
'spec': 'spec/**/*.js',
'src': 'src/**/*.js'
};

gulp.task('ngdocs', [], function () {
var gulpDocs = require('gulp-ngdocs');
return gulp.src(paths.src)
.pipe(gulpDocs.process({
html5Mode: false,
startPage: '/api',
title: 'angular-scaffold'
}))
.pipe(gulp.dest('./build/docs'));
});

gulp.task('test', function(done) {
new Server({
configFile: __dirname + '/config/karma.conf.js',
singleRun: true
}, done).start();
});

gulp.task('coveralls', function() {
gulp.src('coverage/**/lcov.info')
.pipe(coveralls());
});

// Task that calculates the unit test coverage for the module
gulp.task('coverage', function(cb) {
new Server({
configFile: __dirname + '/config/karma.conf.js',
singleRun: true,
reporters: ['progress', 'coverage'],

preprocessors: {
'src/**/*.js':['coverage']
},

// optionally, configure the reporter
coverageReporter: {
reporters: [
{
type : 'html',
dir : 'build/coverage/'
},
{
type: 'text'
}
]
}
}, cb).start();
});

gulp.task('lint', function() {
return gulp.src([paths.src])
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});

gulp.task('security', function(cb) {
nsp({
package: __dirname + '/package.json',
stopOnError: true
}, cb);
});

gulp.task('default', function(cb) {
runSequence('test', ['lint', 'coveralls', 'security'], cb);
});
Loading

0 comments on commit 118e2cf

Please sign in to comment.