mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
Added support for custom UI folder
This commit is contained in:
parent
760469fc5f
commit
98acd0d886
17 changed files with 192 additions and 131 deletions
|
@ -6,7 +6,13 @@ require('./less');
|
|||
require('./handlebars');
|
||||
require('./copy');
|
||||
|
||||
gulp.task('build', function () {
|
||||
return runSequence('clean',
|
||||
['webpack', 'less', 'handlebars', 'copyHtml', 'copyContent', 'copyJs']);
|
||||
gulp.task('build', function() {
|
||||
return runSequence('clean', [
|
||||
'webpack',
|
||||
'less',
|
||||
'handlebars',
|
||||
'copyHtml',
|
||||
'copyContent',
|
||||
'copyJs'
|
||||
]);
|
||||
});
|
||||
|
|
|
@ -3,6 +3,6 @@ var del = require('del');
|
|||
|
||||
var paths = require('./paths');
|
||||
|
||||
gulp.task('clean', function (cb) {
|
||||
del([paths.dest.root], cb);
|
||||
gulp.task('clean', function(cb) {
|
||||
del([paths.dest.root], cb);
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module.exports = {
|
||||
onError:function (error) {
|
||||
onError : function(error) {
|
||||
//If you want details of the error in the console
|
||||
console.log(error.toString());
|
||||
this.emit('end');
|
||||
}
|
||||
}
|
||||
};
|
|
@ -10,15 +10,18 @@ var stripbom = require('gulp-stripbom');
|
|||
|
||||
var paths = require('./paths.js');
|
||||
|
||||
gulp.task('handlebars', function () {
|
||||
gulp.task('handlebars', function() {
|
||||
|
||||
var coreStream = gulp.src([paths.src.templates, '!*/**/*Partial.*'])
|
||||
.pipe(stripbom({ showLog: false }))
|
||||
var coreStream = gulp.src([
|
||||
paths.src.templates,
|
||||
'!*/**/*Partial.*'
|
||||
])
|
||||
.pipe(stripbom({ showLog : false }))
|
||||
.pipe(handlebars())
|
||||
.pipe(declare({
|
||||
namespace: 'T',
|
||||
noRedeclare: true,
|
||||
processName: function (filePath) {
|
||||
namespace : 'T',
|
||||
noRedeclare : true,
|
||||
processName : function(filePath) {
|
||||
|
||||
filePath = path.relative(paths.src.root, filePath);
|
||||
|
||||
|
@ -30,12 +33,12 @@ gulp.task('handlebars', function () {
|
|||
}));
|
||||
|
||||
var partialStream = gulp.src([paths.src.partials])
|
||||
.pipe(stripbom({ showLog: false }))
|
||||
.pipe(stripbom({ showLog : false }))
|
||||
.pipe(handlebars())
|
||||
.pipe(wrap('Handlebars.template(<%= contents %>)'))
|
||||
.pipe(wrap('Handlebars.registerPartial(<%= processPartialName(file.relative) %>, <%= contents %>)', {}, {
|
||||
imports: {
|
||||
processPartialName: function (fileName) {
|
||||
imports : {
|
||||
processPartialName : function(fileName) {
|
||||
return JSON.stringify(
|
||||
path.basename(fileName, '.js')
|
||||
);
|
||||
|
@ -43,8 +46,7 @@ gulp.task('handlebars', function () {
|
|||
}
|
||||
}));
|
||||
|
||||
|
||||
return streamqueue({ objectMode: true },
|
||||
return streamqueue({ objectMode : true },
|
||||
partialStream,
|
||||
coreStream
|
||||
).pipe(concat('templates.js'))
|
||||
|
|
|
@ -2,14 +2,13 @@ var gulp = require('gulp');
|
|||
var print = require('gulp-print');
|
||||
var paths = require('./paths.js');
|
||||
|
||||
|
||||
gulp.task('imageMin', function () {
|
||||
gulp.task('imageMin', function() {
|
||||
var imagemin = require('gulp-imagemin');
|
||||
return gulp.src(paths.src.images)
|
||||
.pipe(imagemin({
|
||||
progressive: false,
|
||||
optimizationLevel :4,
|
||||
svgoPlugins: [{removeViewBox: false}]
|
||||
progressive : false,
|
||||
optimizationLevel : 4,
|
||||
svgoPlugins : [{ removeViewBox : false }]
|
||||
}))
|
||||
.pipe(print())
|
||||
.pipe(gulp.dest(paths.src.content + 'Images/'));
|
||||
|
|
|
@ -4,9 +4,11 @@ var stylish = require('jshint-stylish');
|
|||
var cache = require('gulp-cached');
|
||||
var paths = require('./paths.js');
|
||||
|
||||
|
||||
gulp.task('jshint', function () {
|
||||
return gulp.src([paths.src.scripts, paths.src.exclude.libs])
|
||||
gulp.task('jshint', function() {
|
||||
return gulp.src([
|
||||
paths.src.scripts,
|
||||
paths.src.exclude.libs
|
||||
])
|
||||
.pipe(cache('jshint'))
|
||||
.pipe(jshint())
|
||||
.pipe(jshint.reporter(stylish));
|
||||
|
|
41
gulp/less.js
41
gulp/less.js
|
@ -1,15 +1,35 @@
|
|||
var gulp = require('gulp');
|
||||
var less = require('gulp-less');
|
||||
var print = require('gulp-print');
|
||||
var phantom = require('./phantom');
|
||||
var livereload = require('gulp-livereload');
|
||||
|
||||
var paths = require('./paths');
|
||||
var errorHandler = require('./errorHandler');
|
||||
|
||||
gulp.task('less', function () {
|
||||
return gulp.src([
|
||||
gulp.task('less', function() {
|
||||
|
||||
var src = [
|
||||
paths.src.content + 'bootstrap.less',
|
||||
paths.src.content + 'theme.less',
|
||||
paths.src.content + 'overrides.less',
|
||||
paths.src.root + 'Series/series.less',
|
||||
paths.src.root + 'Activity/activity.less',
|
||||
paths.src.root + 'AddSeries/addSeries.less',
|
||||
paths.src.root + 'Calendar/calendar.less',
|
||||
paths.src.root + 'Cells/cells.less',
|
||||
paths.src.root + 'ManualImport/manualimport.less',
|
||||
paths.src.root + 'Settings/settings.less',
|
||||
paths.src.root + 'System/Logs/logs.less',
|
||||
paths.src.root + 'System/Update/update.less',
|
||||
paths.src.root + 'System/Info/info.less',
|
||||
];
|
||||
|
||||
if (phantom) {
|
||||
src = [
|
||||
paths.src.content + 'bootstrap.less',
|
||||
paths.src.content + 'theme.less',
|
||||
paths.src.content + 'angle.less',
|
||||
paths.src.content + 'sonarr.less',
|
||||
paths.src.content + 'overrides.less',
|
||||
paths.src.root + 'Series/series.less',
|
||||
paths.src.root + 'Activity/activity.less',
|
||||
|
@ -21,14 +41,17 @@ gulp.task('less', function () {
|
|||
paths.src.root + 'System/Logs/logs.less',
|
||||
paths.src.root + 'System/Update/update.less',
|
||||
paths.src.root + 'System/Info/info.less',
|
||||
])
|
||||
]
|
||||
}
|
||||
|
||||
return gulp.src(src)
|
||||
.pipe(print())
|
||||
.pipe(less({
|
||||
dumpLineNumbers: 'false',
|
||||
compress: true,
|
||||
yuicompress: true,
|
||||
ieCompat: true,
|
||||
strictImports: true
|
||||
dumpLineNumbers : 'false',
|
||||
compress : true,
|
||||
yuicompress : true,
|
||||
ieCompat : true,
|
||||
strictImports : true
|
||||
}))
|
||||
.on('error', errorHandler.onError)
|
||||
.pipe(gulp.dest(paths.dest.content))
|
||||
|
|
|
@ -1,45 +1,45 @@
|
|||
var phantom = require('./phantom');
|
||||
|
||||
var paths = {
|
||||
src: {
|
||||
root: './src/UI/',
|
||||
templates: './src/UI/**/*.hbs',
|
||||
html: './src/UI/*.html',
|
||||
partials: './src/UI/**/*Partial.hbs',
|
||||
scripts: './src/UI/**/*.js',
|
||||
less: ['./src/UI/**/*.less'],
|
||||
content: './src/UI/Content/',
|
||||
images: './src/UI/Content/Images/**/*',
|
||||
exclude: {
|
||||
libs: '!./src/UI/JsLibraries/**'
|
||||
src : {
|
||||
root : './src/UI/',
|
||||
templates : './src/UI/**/*.hbs',
|
||||
html : './src/UI/*.html',
|
||||
partials : './src/UI/**/*Partial.hbs',
|
||||
scripts : './src/UI/**/*.js',
|
||||
less : ['./src/UI/**/*.less'],
|
||||
content : './src/UI/Content/',
|
||||
images : './src/UI/Content/Images/**/*',
|
||||
exclude : {
|
||||
libs : '!./src/UI/JsLibraries/**'
|
||||
}
|
||||
},
|
||||
dest : {
|
||||
root : './_output/UI/',
|
||||
content : './_output/UI/Content/'
|
||||
}
|
||||
},
|
||||
dest: {
|
||||
root: './_output/UI/',
|
||||
content: './_output/UI/Content/'
|
||||
}
|
||||
};
|
||||
|
||||
if (phantom) {
|
||||
paths = {
|
||||
src: {
|
||||
root: './src/UI.Phantom/',
|
||||
templates: './src/UI.Phantom/**/*.hbs',
|
||||
html: './src/UI.Phantom/*.html',
|
||||
partials: './src/UI.Phantom/**/*Partial.hbs',
|
||||
scripts: './src/UI.Phantom/**/*.js',
|
||||
less: ['./src/UI.Phantom/**/*.less'],
|
||||
content: './src/UI.Phantom/Content/',
|
||||
images: './src/UI.Phantom/Content/Images/**/*',
|
||||
exclude: {
|
||||
libs: '!./src/UI.Phantom/JsLibraries/**'
|
||||
}
|
||||
},
|
||||
dest: {
|
||||
root: './_output/UI.Phantom/',
|
||||
content: './_output/UI.Phantom/Content/'
|
||||
}
|
||||
};
|
||||
paths = {
|
||||
src : {
|
||||
root : './src/UI.Phantom/',
|
||||
templates : './src/UI.Phantom/**/*.hbs',
|
||||
html : './src/UI.Phantom/*.html',
|
||||
partials : './src/UI.Phantom/**/*Partial.hbs',
|
||||
scripts : './src/UI.Phantom/**/*.js',
|
||||
less : ['./src/UI.Phantom/**/*.less'],
|
||||
content : './src/UI.Phantom/Content/',
|
||||
images : './src/UI.Phantom/Content/Images/**/*',
|
||||
exclude : {
|
||||
libs : '!./src/UI.Phantom/JsLibraries/**'
|
||||
}
|
||||
},
|
||||
dest : {
|
||||
root : './_output/UI.Phantom/',
|
||||
content : './_output/UI.Phantom/Content/'
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = paths;
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
|
||||
var phantom = false;
|
||||
process.argv.forEach(function (val, index, array) {
|
||||
if(val=== '--phantom'){
|
||||
if (val === '--phantom') {
|
||||
phantom = true;
|
||||
}
|
||||
});
|
||||
|
||||
console.log('Phantom:', phantom);
|
||||
|
||||
module.exports = phantom;
|
|
@ -84,7 +84,7 @@ gulp.task('getSonarr', function () {
|
|||
download(package.url, packagePath, function () {
|
||||
extract(packagePath, dirName, function () {
|
||||
// clean old binaries
|
||||
console.log('Cleaning old binaries')
|
||||
console.log('Cleaning old binaries');
|
||||
del.sync(['./_output/*', '!./_output/UI/']);
|
||||
console.log('copying binaries to target');
|
||||
gulp.src(dirName + '/NzbDrone/*.*')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue