From d90ed1f5309f673535dde39063c8b300f6b5b873 Mon Sep 17 00:00:00 2001 From: Matteo Suppo Date: Sun, 22 Jun 2014 18:10:31 +0200 Subject: [PATCH] Init files --- .gitignore | 2 ++ .jshintrc | 33 ++++++++++++++++++++++++++ bower.json | 25 ++++++++++++++++++++ gulpfile.js | 42 ++++++++++++++++++++++++++++++++ karma.conf | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 28 ++++++++++++++++++++++ 6 files changed, 197 insertions(+) create mode 100644 .gitignore create mode 100644 .jshintrc create mode 100644 bower.json create mode 100644 gulpfile.js create mode 100644 karma.conf create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c346b13 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +bower_components/ +node_modules/ diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..2db2eb0 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,33 @@ +{ + "node": true, + "browser": true, + "esnext": true, + "bitwise": true, + "camelcase": true, + "curly": true, + "eqeqeq": true, + "immed": true, + "indent": 2, + "latedef": true, + "newcap": true, + "noarg": true, + "quotmark": "single", + "regexp": true, + "undef": true, + "unused": true, + "strict": true, + "trailing": true, + "smarttabs": true, + "globals": { + "angular": false, + "describe": false, + "it": false, + "xit": false, + "beforeEach": false, + "afterEach": false, + "inject": false, + "expect": false, + "jasmine": false, + "spyOn": false + } +} diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..475fb81 --- /dev/null +++ b/bower.json @@ -0,0 +1,25 @@ +{ + "name": "angular-diff", + "version": "v1.0.0", + "description": "Diff filter for angular.js. Show inline text diff in your page", + "homepage": "https://github.com/matteosuppo/angular-diff", + "authors": [ + "Matteo Suppo " + ], + "keywords": [ + "angular", + "diff" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "dependencies": { + "angular": "~1.2.18", + "angular-mocks": "~1.2.18" + } +} diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..13973e8 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,42 @@ +'use strict'; + +var gulp = require('gulp'); +var karma = require('gulp-karma'); +var concat = require('gulp-concat'); +var ngmin = require('gulp-ngmin'); +var uglify = require('gulp-uglify'); + +/* Test files with karma */ +gulp.task('karma', function() { + + return gulp.src([ + 'bower_components/angular/angular.js', + 'bower_components/angular-mocks/angular-mocks.js', + 'src/*.js', + 'tests/*.js' + ]).pipe(karma({ + configFile: 'karma.conf.js', + action: 'watch' + })) + .on('error', function(err) { + // Make sure failed tests cause gulp to exit non-zero + throw err; + }); +}); + +/* Build a concat and minified version of the source files */ +gulp.task('build:concat', function () { + return gulp.src('src/*.js') + .pipe(concat('angular-diff.js')) + .pipe(gulp.dest('.')); +}); + +gulp.task('build:minify', function () { + return gulp.src('src/*.js') + .pipe(ngmin()) + .pipe(uglify()) + .pipe(concat('angular-diff.min.js')) + .pipe(gulp.dest('.')); +}); + +gulp.task('build', ['build:concat', 'build:minify']); diff --git a/karma.conf b/karma.conf new file mode 100644 index 0000000..19061d6 --- /dev/null +++ b/karma.conf @@ -0,0 +1,67 @@ +// Karma configuration +// Generated on Fri May 09 2014 11:16:12 GMT+0200 (CEST) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['jasmine'], + + + // list of files / patterns to load in the browser + files: [ + + ], + + + // list of files to exclude + exclude: [ + + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + + }, + + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['Chrome'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false + }); +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..afc5575 --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "angular-diff", + "version": "v1.0.0", + "description": "Diff filter for angular.js. Show inline text diff in your page", + "repository": { + "type": "git", + "url": "https://github.com/matteosuppo/angular-diff" + }, + "keywords": [ + "angular", + "diff" + ], + "author": "Matteo Suppo ", + "license": "MIT", + "bugs": { + "url": "https://github.com/matteosuppo/angular-diff/issues" + }, + "homepage": "https://github.com/matteosuppo/angular-diff", + "devDependencies": { + "gulp": "^3.6.2", + "gulp-karma": "0.0.4", + "gulp-concat": "^2.2.0", + "gulp-ngmin": "^0.3.0", + "gulp-uglify": "^0.2.1", + "karma-chrome-launcher": "^0.1.3", + "karma-jasmine": "^0.2.2" + } +}