Merge pull request #304 from YunoHost/global-upgrade

Global upgrade
This commit is contained in:
Alexandre Aubin 2020-06-04 19:13:13 +02:00 committed by GitHub
commit fc70b7ad8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 7881 additions and 83 deletions

1
.gitignore vendored
View file

@ -16,5 +16,4 @@ ca.crt
# Debug CSS file
src/css/style.css
src/bower_components
src/dist

9
.travis.yml Normal file
View file

@ -0,0 +1,9 @@
language: node_js
node_js:
- "10"
before_install:
- cd src
script:
- npm ci
- gulp build --dev
- gulp lint --dev

View file

@ -1,17 +0,0 @@
{
"name": "yunohost-admin",
"description": "YunoHost Admin web interface",
"license": "AGPL-3.0",
"private": true,
"dependencies": {
"bootstrap": "3.3.6",
"fork-awesome": "1.1.7",
"handlebars-helper-intl": "1.1.2",
"handlebars": "4.0.11",
"sammy": "0.7.6",
"js-cookie": "2.1.0",
"isotope-layout": "3.0.6",
"source-sans-pro": "git://github.com/adobe-fonts/source-sans-pro.git#2.020R-ro/1.075R-it",
"source-code-pro": "git://github.com/adobe-fonts/source-code-pro.git#2.010R-ro/1.030R-it"
}
}

View file

@ -3,7 +3,7 @@
/*
* Bootstrap
*/
@import "../bower_components/bootstrap/less/bootstrap.less";
@import "../node_modules/bootstrap/less/bootstrap.less";
// Bootstrap variables override
@font-family-sans-serif: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
@ -25,7 +25,7 @@
/*
* FontAwesome
*/
@import "../bower_components/fork-awesome/less/fork-awesome.less";
@import "../node_modules/fork-awesome/less/fork-awesome.less";
// Fixes

View file

@ -6,6 +6,7 @@ var concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
csslint = require('gulp-csslint'),
jshint = require('gulp-jshint'),
mustache = require('gulp-mustache'),
less = require('gulp-less'),
autoprefixer = require('gulp-autoprefixer'),
cssmin = require('gulp-cssmin'),
@ -19,35 +20,18 @@ var concat = require('gulp-concat'),
isDev = (util.env.dev) ? true : false;
isProduction = !isDev;
// Global build task
gulp.task('build', [
'css',
'fonts',
'js',
'img',
]);
// Watch task
gulp.task('watch', function(){
gulp.watch('js/**/*.js', ['js']);
gulp.watch('css/*.less', ['css']);
});
// JS task
gulp.task('js', function() {
return gulp.src([
'bower_components/jquery/dist/jquery.js',
'bower_components/js-cookie/src/js.cookie.js',
'bower_components/handlebars/handlebars.js',
'bower_components/handlebars-helper-intl/dist/handlebars-intl-with-locales.js',
'bower_components/sammy/lib/sammy.js',
'bower_components/sammy/lib/plugins/sammy.handlebars.js',
'bower_components/sammy/lib/plugins/sammy.json.js',
'bower_components/sammy/lib/plugins/sammy.storage.js',
'bower_components/bootstrap/dist/js/bootstrap.js',
'bower_components/isotope-layout/dist/isotope.pkgd.js',
'node_modules/jquery/dist/jquery.js',
'node_modules/handlebars/dist/handlebars.js',
'node_modules/handlebars-intl/dist/handlebars-intl-with-locales.js',
'node_modules/sammy/lib/sammy.js',
'node_modules/sammy/lib/plugins/sammy.handlebars.js',
'node_modules/sammy/lib/plugins/sammy.json.js',
'node_modules/sammy/lib/plugins/sammy.storage.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'node_modules/isotope-layout/dist/isotope.pkgd.js',
'js/yunohost/y18n.js',
'js/yunohost/main.js',
'js/yunohost/helpers.js',
@ -63,25 +47,26 @@ gulp.task('js', function() {
// JS Lint task
gulp.task('js-lint', function() {
return gulp.src('js/*.js')
return gulp.src('js/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'))
});
// Fonts
gulp.task('fonts', function() {
return gulp.src([
'bower_components/fork-awesome/fonts/*',
'bower_components/source-code-pro/EOT/*.eot',
'bower_components/source-code-pro/OTF/*.otf',
'bower_components/source-code-pro/TTF/*.ttf',
'bower_components/source-code-pro/WOFF/OTF/*.woff',
'bower_components/source-code-pro/WOFF2/TTF/*.woff2',
'bower_components/source-sans-pro/EOT/*.eot',
'bower_components/source-sans-pro/OTF/*.otf',
'bower_components/source-sans-pro/TTF/*.ttf',
'bower_components/source-sans-pro/WOFF/OTF/*.woff',
'bower_components/source-sans-pro/WOFF2/TTF/*.woff2',
'node_modules/fork-awesome/fonts/*',
'node_modules/source-code-pro/EOT/*.eot',
'node_modules/source-code-pro/OTF/*.otf',
'node_modules/source-code-pro/TTF/*.ttf',
'node_modules/source-code-pro/WOFF/OTF/*.woff',
'node_modules/source-code-pro/WOFF2/TTF/*.woff2',
'node_modules/source-sans-pro/EOT/*.eot',
'node_modules/source-sans-pro/OTF/*.otf',
'node_modules/source-sans-pro/TTF/*.ttf',
'node_modules/source-sans-pro/WOFF/OTF/*.woff',
'node_modules/source-sans-pro/WOFF2/TTF/*.woff2',
])
.pipe(gulp.dest('./dist/fonts'))
});
@ -105,8 +90,7 @@ gulp.task('css-lint', function() {
.pipe(less())
.pipe(autoprefixer())
.pipe(csslint())
.pipe(csslint.reporter('compact'))
.pipe(gulp.dest('./css/'))
.pipe(csslint.formatter())
});
@ -116,3 +100,23 @@ gulp.task('img', function () {
.pipe(gulpif(isProduction, imagemin()))
.pipe(gulp.dest('./dist/img'))
});
// Views task
gulp.task('views', function () {
return gulp.src('views/**/*.ms')
.pipe(gulp.dest("./dist/views"));
});
// Global build task
gulp.task('build', gulp.series('css', 'fonts', 'js', 'img', 'views'));
// Watch task
gulp.task('watch', function() {
gulp.watch('js/**/*.js', gulp.series('js'));
gulp.watch('css/*.less', gulp.series('css'));
gulp.watch('views/**/*.ms', gulp.series('views'));
});
gulp.task('lint', gulp.series('css-lint', 'js-lint'));
gulp.task('default', gulp.series('build', 'watch'));

View file

@ -118,13 +118,13 @@
$.ajax({
dataType: "json",
url: 'https://'+ baseUrl +'/installed',
timeout: 3000
})
.success(function(data) {
callback(data.installed);
})
.fail(function() {
callback(undefined);
timeout: 3000,
success: function(data) {
callback(data.installed);
},
fail: function() {
callback(undefined);
}
});
},
@ -319,7 +319,7 @@
$('#modal').modal('hide');
// Render content
var rendered = this.render('views/'+ view +'.ms', data);
var rendered = this.render('dist/views/'+ view +'.ms', data);
// Update content helper
var leSwap = function() {

7792
src/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,6 @@
"url": "https://github.com/YunoHost/yunohost-admin"
},
"scripts": {
"postinstall": "bower install",
"build": "gulp build",
"build-dev": "gulp build --dev",
"watch": "gulp watch",
@ -19,18 +18,30 @@
},
"homepage": "https://github.com/YunoHost/yunohost-admin",
"devDependencies": {
"bower": "^1.7.7",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^2.3.1",
"gulp-concat": "^2.6.0",
"gulp-csslint": "^0.2.0",
"gulp-cssmin": "^0.1.7",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.3.0",
"gulp-jshint": "^1.11.2",
"gulp-less": "^3.0.3",
"gulp-rename": "^1.2.2",
"gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.7"
"gulp": "^4.0.2",
"gulp-autoprefixer": "^7.0.1",
"gulp-concat": "^2.6.1",
"gulp-csslint": "^1.0.1",
"gulp-cssmin": "^0.2.0",
"gulp-if": "^3.0.0",
"gulp-imagemin": "^7.1.0",
"gulp-jshint": "^2.1.0",
"jshint": "^2.11.1",
"gulp-less": "^4.0.1",
"gulp-rename": "^2.0.0",
"gulp-uglify": "^3.0.2",
"gulp-mustache": "^5.0.0"
},
"dependencies": {
"bootstrap": "^3.3.7",
"fork-awesome": "^1.1.7",
"handlebars": "^4.7.6",
"handlebars-intl": "1.1.2",
"isotope-layout": "^3.0.6",
"jquery": "^3.5.1",
"js-cookie": "^2.2.1",
"sammy": "^0.7.6",
"source-code-pro": "^2.30.2",
"source-sans-pro": "^3.6.0"
}
}