Update dependencies

This commit is contained in:
Neil MacDougall 2023-02-20 16:38:59 +00:00
parent 11e28abe7d
commit 04a22151f7
3 changed files with 1422 additions and 1733 deletions

View File

@ -3,53 +3,46 @@ var gulpConcat = require('gulp-concat');
var gulpConnect = require('gulp-connect');
var gulpExec = require('gulp-exec');
var gulpGzip = require('gulp-gzip');
var gulpHint = require('gulp-jshint');
var gulpMap = require('gulp-sourcemaps');
var gulpRename = require('gulp-rename');
var gulpReplace = require('gulp-replace');
var gulpSass = require('gulp-sass');
var gulpSass = require('gulp-sass')(require('sass'));
var gulpTar = require('gulp-tar');
var gulpUglify = require('gulp-uglify');
var del = require('del');
var fs = require('fs-extra');
var pkg = require('./package.json');
var DIST = 'dist/';
var VERSION_DIST = DIST+pkg.version+'/';
var CDN = 'cdn.rancher.io/api-ui';
gulp.task('default', ['build']);
gulp.task('build', ['src','tarball']);
gulp.task('src', ['js','minjs','css','mincss','bootstrap']);
gulp.task('clean', function() {
return del([
'tmp/**',
'dist/**'
]);
});
gulp.task('server', ['build','livereload'], function() {
var cors = function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
};
return gulpConnect.server({
root: [VERSION_DIST],
port: process.env.PORT || 3000,
middleware: function() {
return [cors];
},
});
return fs.emptyDir('./tmp').then(() => fs.emptyDir('./dist'));
});
gulp.task('server:reload', function() {
return gulpConnect.reload();
});
gulp.task('js', ['templates','partials'], function() {
gulp.task('templates', function() {
return gulp.src('templates/*.hbs', {read: false})
.pipe(gulpExec(file => `./node_modules/.bin/handlebars "${file.path}"`, {pipeStdout: true}))
.pipe(gulpRename(function(path) {
path.extname = '.hbs.js';
}))
.pipe(gulp.dest('./tmp/tpl'));
});
gulp.task('partials', function() {
return gulp.src('partials/*.hbs', {read: false})
.pipe(gulpExec(file => `./node_modules/.bin/handlebars --partial "${file.path}"`, {pipeStdout: true}))
.pipe(gulpRename(function(path) {
path.extname = '.hbs.js';
}))
.pipe(gulp.dest('./tmp/tpl'));
});
gulp.task('js', gulp.series('templates','partials', function() {
return gulp.src([
'node_modules/jquery/dist/jquery.js',
'vendor/jquery.scrollintoview.js',
@ -71,34 +64,16 @@ gulp.task('js', ['templates','partials'], function() {
.pipe(gulpConcat('ui.js',{newLine: ';\n'}))
.pipe(gulpMap.write('./'))
.pipe(gulp.dest(VERSION_DIST));
});
}));
gulp.task('minjs', ['js'], function() {
gulp.task('minjs', gulp.series('js', function() {
return gulp.src([VERSION_DIST+'/ui.js'], {base: VERSION_DIST})
.pipe(gulpRename({suffix: '.min'}))
.pipe(gulpMap.init({loadMaps: true}))
.pipe(gulpUglify())
.pipe(gulpMap.write('./'))
.pipe(gulp.dest(VERSION_DIST));
});
gulp.task('templates', function() {
return gulp.src('templates/*.hbs', {read: false})
.pipe(gulpExec('./node_modules/.bin/handlebars "<%= file.path %>"', {pipeStdout: true}))
.pipe(gulpRename(function(path) {
path.extname = '.hbs.js';
}))
.pipe(gulp.dest('./tmp/tpl'));
});
gulp.task('partials', function() {
return gulp.src('partials/*.hbs', {read: false})
.pipe(gulpExec('./node_modules/.bin/handlebars --partial "<%= file.path %>"', {pipeStdout: true}))
.pipe(gulpRename(function(path) {
path.extname = '.hbs.js';
}))
.pipe(gulp.dest('./tmp/tpl'));
});
}));
gulp.task('css', function() {
return gulp.src([
@ -114,26 +89,19 @@ gulp.task('css', function() {
.pipe(gulp.dest(VERSION_DIST))
});
gulp.task('mincss', ['css'], function() {
gulp.task('mincss', gulp.series('css', function() {
return gulp.src([VERSION_DIST+'/ui.css'], {base: VERSION_DIST})
.pipe(gulpRename({suffix: '.min'}))
.pipe(gulpMap.init({loadMaps: true}))
.pipe(gulpMap.write('./'))
.pipe(gulp.dest(VERSION_DIST));
});
}));
gulp.task('bootstrap', function() {
return gulp.src(['node_modules/bootstrap/dist/**'])
.pipe(gulp.dest(VERSION_DIST));
});
gulp.task('tarball', ['src'], function() {
return gulp.src([VERSION_DIST+'/**'], {base: DIST})
.pipe(gulpTar(pkg.version+'.tar'))
.pipe(gulpGzip())
.pipe(gulp.dest(DIST));
});
gulp.task('livereload', function() {
gulp.watch('./gulpfile.js', ['server:reload']);
gulp.watch('styles/**', ['css']);
@ -141,3 +109,31 @@ gulp.task('livereload', function() {
gulp.watch('templates/**', ['js']);
gulp.watch('partials/**', ['js']);
})
gulp.task('src', gulp.series('js','minjs','css','mincss','bootstrap'));
gulp.task('tarball', gulp.series('src', function() {
return gulp.src([VERSION_DIST+'/**'], {base: DIST})
.pipe(gulpTar(pkg.version+'.tar'))
.pipe(gulpGzip())
.pipe(gulp.dest(DIST));
}));
gulp.task('build', gulp.series('src', 'tarball'), () => {});
gulp.task('default', gulp.series('build'));
gulp.task('server', gulp.series('build','livereload', function() {
var cors = function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
};
return gulpConnect.server({
root: [VERSION_DIST],
port: process.env.PORT || 3000,
middleware: function() {
return [cors];
},
});
}));

View File

@ -1,6 +1,6 @@
{
"name": "api-ui",
"version": "1.1.9",
"version": "1.1.10",
"description": "Embedded UI for any service that implements the Rancher API spec",
"contributors": [
"Go Daddy Operating Company, LLC. (http://godaddy.com)",
@ -20,21 +20,21 @@
"upload": "./scripts/upload"
},
"devDependencies": {
"bootstrap": "^3",
"del": "^1.1.0",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-connect": "^5.7.0",
"gulp-exec": "^2.1.1",
"gulp-gzip": "^1.4.0",
"gulp-jshint": "^1.9.0",
"gulp-rename": "^1.2.0",
"gulp-replace": "^0.5.4",
"gulp-sass": "^2.3.2",
"gulp-sourcemaps": "^1.6.0",
"gulp-tar": "^1.9.0",
"gulp-uglify": "^1.0.2",
"handlebars": "^4",
"jquery": "^3"
"bootstrap": "3.4.1",
"fs-extra": "11.1.0",
"gulp": "4.0.2",
"gulp-concat": "2.6.1",
"gulp-connect": "5.7.0",
"gulp-exec": "5.0.0",
"gulp-gzip": "1.4.2",
"gulp-rename": "2.0.0",
"gulp-replace": "1.1.4",
"gulp-sass": "5.1.0",
"gulp-sourcemaps": "3.0.0",
"gulp-tar": "3.1.0",
"gulp-uglify": "3.0.2",
"handlebars": "4.7.7",
"jquery": "3.6.3",
"sass": "1.58.3"
}
}

3007
yarn.lock

File diff suppressed because it is too large Load Diff