Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump dependencies to support AngularJS 1.7 #846

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/smart-table.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/smart-table.min.js.map

Large diffs are not rendered by default.

93 changes: 53 additions & 40 deletions gulpFile.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,64 @@
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var karma = require('karma').server;
var insert = require('gulp-insert');
var sourcemaps = require('gulp-sourcemaps');
var packageJson = require('./package.json');
var pluginList = ['stSearch', 'stSelectRow', 'stSort', 'stPagination', 'stPipe'];
var disFolder = './dist/';
var src = (['smart-table.module', 'stConfig', 'stTable']).concat(pluginList).map(function (val) {
const gulp = require('gulp');
const gulpConcat = require('gulp-concat');
const gulpUglify = require('gulp-uglify');
const gulpInject = require('gulp-inject-string');
const gulpSourcemaps = require('gulp-sourcemaps');
const pluginList = ['stSearch', 'stSelectRow', 'stSort', 'stPagination', 'stPipe'];
const disFolder = './dist/';
let src = (['smart-table.module', 'stConfig', 'stTable']).concat(pluginList).map(function (val) {
return 'src/' + val + '.js';
});

src.push('src/bottom.txt');
src.unshift('src/top.txt');


gulp.task('karma-CI', function (done) {
var conf = require('./test/karma.common.js');
function test(done) {
process.env.CHROMIUM_BIN = require('puppeteer').executablePath();
const conf = require('./test/karma.common.js');
const {Server} = require('karma');
conf.singleRun = true;
conf.browsers = ['PhantomJS'];
conf.browsers = ['ChromiumHeadless'];
conf.basePath = './';
karma.start(conf, done);
});

gulp.task('uglify', function () {
gulp.src(src)
.pipe(concat('smart-table.min.js'))
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(disFolder));
});
const server = new Server(conf, (exitCode) => {
done(exitCode === 0 ? undefined : new Error('Karma has exited with exit code ' + exitCode));
});
server.start();
};

gulp.task('concat', function () {
gulp.src(src, { base: '.' })
.pipe(concat('smart-table.js'))
.pipe(gulp.dest(disFolder));
});

gulp.task('test', ['karma-CI']);
function uglify() {
return (
gulp.src(src)
.pipe(gulpConcat('smart-table.min.js'))
.pipe(gulpSourcemaps.init())
.pipe(gulpUglify())
.pipe(gulpSourcemaps.write('.'))
.pipe(gulp.dest(disFolder))
);
}

gulp.task('build',['test', 'uglify', 'concat'], function () {
function concat() {
return (
gulp.src(src, { base: '.' })
.pipe(gulpConcat('smart-table.js'))
.pipe(gulp.dest(disFolder))
);
}

var version = packageJson.version;
var string = '/** \n* @version ' + version + '\n* @license MIT\n*/\n';

gulp.src(disFolder + '*.js')
.pipe(insert.prepend(string))
.pipe(gulp.dest(disFolder));
});
module.exports = {
build: gulp.series(test, uglify, concat, () => {
const {version} = require('./package.json');
return (
gulp.src(disFolder + '*.js')
.pipe(gulpInject.prepend(
`/**
* @version ${version}
* @license MIT
*/
`))
.pipe(gulp.dest(disFolder))
);
}),
concat,
uglify,
test,
};
Loading