Skip to content
This repository was archived by the owner on Jan 7, 2022. It is now read-only.

Commit 5d62cf6

Browse files
authored
updated readme badge links, updates devdependencies (#29)
* updated readme badge links, updates devdependencies * eslinting config.js * consolidating duplicate code * moving spec helping data to json, minifying release payload with package.json files[] * updating release files * git status * changing failing gulp task name * removing specs from codeclimate * renamed methods * added unit tests for body controller * removing bodycontroller unit test focus * removed dup travis script section, fixed checking for angular version unit test code, added some pager controller unit tests * added protractor error, karma error * substantial changes * removed unused package * added release files for changes * removed unused packages * updated e2e tests to use window methods * e2e test fixes * ignoring e2e test files in codeclimate * updating to exclude e2e tests in karma
1 parent f156da0 commit 5d62cf6

32 files changed

Lines changed: 817 additions & 7645 deletions

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"presets": ["es2015"],
3-
"sourceMap": "inline",
3+
"sourceMaps": true,
44
"plugins": [
55
"transform-object-assign",
66
[

.codeclimate.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ exclude_paths:
2525
- "release/"
2626
- "demos/"
2727
- "test/"
28+
- "**/*.spec.js"
29+
- "**/*.e2e.js"

.travis.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ script:
2525
- protractor test/protractor.conf.js
2626
- codecov
2727

28-
script:
29-
- gulp unit
30-
- protractor test/protractor.conf.js
31-
- codecov
32-
3328
addons:
3429
sauce_connect: true
3530
code_climate:

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
[![Join the chat at https://gitter.im/Swimlane/angular-data-table](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/swimlane/angular-data-table?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
44
[![Build Status](https://travis-ci.org/jonshaffer/angular-data-table.svg?branch=master)](https://travis-ci.org/jonshaffer/angular-data-table)
5-
![npm-version](https://img.shields.io/npm/v/angular-data-table.svg)
6-
![Dependency Status](https://david-dm.org/jonshaffer/angular-data-table.svg)
7-
![devDependency Status](https://david-dm.org/jonshaffer/angular-data-table/dev-status.svg)
8-
![download-count](https://img.shields.io/npm/dm/angular-data-table.svg)
5+
[![GitHub version](https://badge.fury.io/gh/jonshaffer%2Fangular-data-table.svg)](https://badge.fury.io/gh/jonshaffer%2Fangular-data-table)
6+
[![dependencies Status](https://david-dm.org/jonshaffer/angular-data-table/status.svg)](https://david-dm.org/jonshaffer/angular-data-table)
7+
[![devDependencies Status](https://david-dm.org/jonshaffer/angular-data-table/dev-status.svg)](https://david-dm.org/jonshaffer/angular-data-table?type=dev)
98
[![Code Climate](https://codeclimate.com/github/jonshaffer/angular-data-table/badges/gpa.svg)](https://codeclimate.com/github/jonshaffer/angular-data-table)
109
[![Codecov](https://img.shields.io/codecov/c/github/jonshaffer/angular-data-table.svg)](https://codecov.io/gh/jonshaffer/angular-data-table)
1110

demos/basic.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@
4141
<link href="http://fontastic.s3.amazonaws.com/Jnf54BZCm7mSjGCxNRbfp3/icons.css" rel="stylesheet">
4242
</head>
4343
<body ng-app="app" ng-controller="HomeController">
44-
45-
46-
<dtable options="options" rows="data" class="material" on-row-dbl-click="onRowDblClick(row)"></dtable>
44+
<dtable id="dtable" options="options" rows="data" class="material" on-row-dbl-click="onRowDblClick(row)"></dtable>
4745

4846
<script src="../jspm_packages/system.js"></script>
4947
<script src="../config.js"></script>

gulpfile.babel.js

Lines changed: 49 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ var nPath = require('path'),
66
runSequence = require('run-sequence'),
77
less = require('gulp-less'),
88
changed = require('gulp-changed'),
9-
Builder = require('systemjs-builder'),
109
vinylPaths = require('vinyl-paths'),
1110
del = require('del'),
1211
ngAnnotate = require('gulp-ng-annotate'),
1312
rollup = require('rollup'),
1413
rename = require('gulp-rename'),
1514
uglify = require('gulp-uglify'),
16-
header = require('gulp-header');
15+
header = require('gulp-header'),
16+
gutils = require('gulp-util');
1717

1818
var KarmaServer = require('karma').Server;
1919

@@ -70,13 +70,13 @@ gulp.task('compile', function (callback) {
7070
return runSequence(
7171
['less', 'es6'],
7272
callback
73-
);
73+
);
7474
});
7575

7676
//
7777
// Dev Mode Tasks
7878
// ------------------------------------------------------------
79-
gulp.task('serve', ['compile'], function (done) {
79+
gulp.task('serve', ['compile'], function (callback) {
8080
browserSync({
8181
open: false,
8282
port: 9000,
@@ -87,7 +87,7 @@ gulp.task('serve', ['compile'], function (done) {
8787
next();
8888
}
8989
}
90-
}, done);
90+
}, callback);
9191
});
9292

9393
gulp.task('watch', ['serve'], function () {
@@ -131,89 +131,86 @@ gulp.task('release-build', function () {
131131
});
132132
});
133133

134-
gulp.task('release-umd', function () {
134+
const RELEASE = {
135+
UMD: {
136+
EXTENSION: '',
137+
PLUGINS: ['transform-es2015-modules-umd']
138+
},
139+
COMMON: {
140+
EXTENSION: '.cjs',
141+
PLUGINS: ['transform-es2015-modules-commonjs']
142+
},
143+
MIN: {
144+
EXTENSION: '.min',
145+
PLUGINS: ['transform-es2015-modules-umd']
146+
}
147+
};
148+
149+
function _releaser(RELEASE) {
135150
return gulp.src('release/dataTable.es6.js')
136151
.pipe(babel({
137-
plugins: [
138-
'transform-es2015-modules-umd'
139-
],
152+
plugins: RELEASE.PLUGINS,
140153
moduleId: 'DataTable'
141154
}))
142155
.pipe(ngAnnotate({
143156
gulpWarnings: false
144157
}))
158+
.pipe(uglify())
145159
.pipe(header(banner, { pkg: pkg }))
146-
.pipe(rename('dataTable.js'))
160+
.pipe(rename(`dataTable${RELEASE.EXTENSION}.js`))
147161
.pipe(gulp.dest('release/'))
162+
}
163+
164+
gulp.task('release-umd', function () {
165+
return _releaser(RELEASE.UMD)
148166
});
149167

150168
gulp.task('release-common', function () {
151-
return gulp.src('release/dataTable.es6.js')
152-
.pipe(babel({
153-
plugins: [
154-
'transform-es2015-modules-commonjs'
155-
],
156-
moduleId: 'DataTable'
157-
}))
158-
.pipe(ngAnnotate({
159-
gulpWarnings: false
160-
}))
161-
.pipe(header(banner, { pkg: pkg }))
162-
.pipe(rename('dataTable.cjs.js'))
163-
.pipe(gulp.dest('release/'))
169+
return _releaser(RELEASE.COMMON)
164170
});
165171

166172
gulp.task('release-es6-min', function () {
167-
return gulp.src('release/dataTable.es6.js')
168-
.pipe(babel({
169-
plugins: [
170-
'transform-es2015-modules-umd'
171-
],
172-
moduleId: 'DataTable'
173-
}))
174-
.pipe(ngAnnotate({
175-
gulpWarnings: false
176-
}))
177-
.pipe(uglify())
178-
.pipe(header(banner, { pkg: pkg }))
179-
.pipe(rename('dataTable.min.js'))
180-
.pipe(gulp.dest('release/'))
173+
return _releaser(RELEASE.MIN)
181174
});
182175

183-
184176
//
185177
// Test Tasks
186178
// ------------------------------------------------------------
187-
188179
function _startKarma(callback, singleRun) {
189-
var server = new KarmaServer({
180+
new KarmaServer({
190181
configFile: nPath.join(__dirname, 'test/karma.conf.js'),
191-
singleRun: singleRun
192-
}, () => (
193-
callback()
194-
));
195-
196-
server.start();
182+
singleRun
183+
}, (errors) => {
184+
if (errors === 0) {
185+
callback();
186+
} else {
187+
callback(new gutils.PluginError('karma', {
188+
message: 'Unit test(s) failed.'
189+
}));
190+
}
191+
}).start();
197192
}
198193

199-
gulp.task('unit', ['compile'], function (callback) {
194+
gulp.task('unit', function (callback) {
200195
_startKarma(callback, true);
201196
});
202197

203-
gulp.task('unit:watch', ['compile'], function (callback) {
198+
gulp.task('unit:watch', function (callback) {
204199
_startKarma(callback, false);
205200
});
206201

207202
gulp.task('e2e', ['serve'], function (callback) {
208203
gulp.src(['src/**/*e2e.js'])
209204
.pipe(protractorAngular({
210205
configFile: 'test/protractor.conf.js',
211-
debug: false,
206+
debug: true,
212207
autoStartStopServer: true
213208
}))
214-
.on('error', (e) => (
215-
console.log(e)
216-
))
209+
.on('error', (e) => {
210+
callback(new gutils.PluginError('protractor', {
211+
message: e
212+
}));
213+
})
217214
.on('end', callback);
218215
});
219216

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"github": "http://github.com/swimlane/angular-data-table.git"
1010
},
1111
"main": "./release/dataTable.js",
12+
"files": [
13+
"release/"
14+
],
1215
"homepage": "http://swimlane.com/",
1316
"author": {
1417
"name": "Swimlane",
@@ -45,12 +48,14 @@
4548
"babel-preset-stage-0": "^6.5.0",
4649
"babel-root-import": "^4.1.3",
4750
"babelify": "7.3.0",
51+
"bardjs": "^0.1.8",
52+
"brfs": "^1.4.3",
4853
"browser-sync": "^2.7.2",
4954
"browserify": "^13.1.1",
5055
"browserify-istanbul": "^2.0.0",
5156
"del": "^2.2.0",
5257
"gulp": "^3.8.11",
53-
"gulp-angular-protractor": "^0.2.0",
58+
"gulp-angular-protractor": "^0.3.0",
5459
"gulp-babel": "6.1.2",
5560
"gulp-changed": "^1.2.1",
5661
"gulp-header": "^1.2.2",
@@ -74,12 +79,10 @@
7479
"karma-phantomjs-launcher": "^1.0.2",
7580
"karma-sauce-launcher": "^1.1.0",
7681
"karma-sinon": "^1.0.5",
77-
"karma-source-map-support": "^1.2.0",
7882
"phantomjs-prebuilt": "^2.1.7",
79-
"rollup": "^0.36.3",
83+
"rollup": "^0.38.0",
8084
"run-sequence": "^1.1.0",
8185
"sinon": "^1.17.6",
82-
"systemjs-builder": "^0.15.32",
8386
"vinyl-paths": "^2.1.0",
8487
"watchify": "^3.7.0"
8588
},

0 commit comments

Comments
 (0)