From c146f6940a176142084b4fc3c610d13aca60d90e Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 28 Sep 2016 10:30:18 +0200 Subject: Assets work * ES6 all the things ! * ESLint checks everything * CSS fixes (use stylelint) * Fix #2231 --- Gruntfile.js | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) (limited to 'Gruntfile.js') diff --git a/Gruntfile.js b/Gruntfile.js index 8dc5b83b..92774081 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -41,27 +41,6 @@ module.exports = function (grunt) { options: { separator: ';', }, - jsMaterial: { - src: [ - '<%= appDir %>/themes/material/js/init.js', - '<%= appDir %>/themes/_global/js/restoreScroll.js', - 'node_modules/jquery.tinydot/src/jquery.tinydot.js', - ], - dest: '<%= buildDir %>/material.js', - }, - jsBaggy: { - src: [ - '<%= appDir %>/themes/baggy/js/init.js', - '<%= appDir %>/themes/_global/js/restoreScroll.js', - '<%= appDir %>/themes/baggy/js/autoClose.js', - '<%= appDir %>/themes/baggy/js/autoCompleteTags.js', - '<%= appDir %>/themes/baggy/js/closeMessage.js', - '<%= appDir %>/themes/baggy/js/popupForm.js', - // Save link is no more used for now - // '<%= appDir %>/themes/baggy/js/saveLink.js', - ], - dest: '<%= buildDir %>/baggy.js', - }, cssMaterial: { src: [ 'node_modules/materialize-css/bin/materialize.css', @@ -77,8 +56,27 @@ module.exports = function (grunt) { }, }, browserify: { - '<%= buildDir %>/material.browser.js': ['<%= buildDir %>/material.js'], - '<%= buildDir %>/baggy.browser.js': ['<%= buildDir %>/baggy.js'], + dist: { + files: { + '<%= buildDir %>/material.browser.js': ['<%= appDir %>/themes/material/js/init.js'], + '<%= buildDir %>/baggy.browser.js': ['<%= appDir %>/themes/baggy/js/init.js'] + } + }, + options: { + sourceType: "module", + transform: [ + ["babelify", { + presets: ["es2015"] + }], "browserify-shim" + ], + browserifyOptions: { + browser: { + "jQuery": "./node_modules/jquery/dist/jquery.js", + "jquery.tinydot": "./nodes_modules/jquery.tinydot/src/jquery.tinydot.js" + } + } + } + }, uglify: { material: { @@ -199,7 +197,7 @@ module.exports = function (grunt) { grunt.registerTask( 'js', 'Build and install js files', - ['clean:js', 'copy:pickerjs', 'concat:jsMaterial', 'concat:jsBaggy', 'browserify', 'uglify'] + ['clean:js', 'copy:pickerjs', 'browserify', 'uglify'] ); grunt.registerTask( -- cgit v1.2.3 From 8f234d0156cc6f2eb6e3c9f692e4633b35fafc41 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 28 Sep 2016 18:59:15 +0200 Subject: remove autocomplete and bring fonts through npm --- Gruntfile.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Gruntfile.js') diff --git a/Gruntfile.js b/Gruntfile.js index 92774081..bf488ff9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -67,12 +67,22 @@ module.exports = function (grunt) { transform: [ ["babelify", { presets: ["es2015"] - }], "browserify-shim" + }], ["browserify-shim", { + "jquery": { + "exports": "$" + }, + "materialize": "materialize", + "jquery-ui": { + "depends": "jquery", + "exports": null + } + }] ], browserifyOptions: { browser: { "jQuery": "./node_modules/jquery/dist/jquery.js", - "jquery.tinydot": "./nodes_modules/jquery.tinydot/src/jquery.tinydot.js" + "jquery.tinydot": "./node_modules/jquery.tinydot/src/jquery.tinydot.js", + "jquery.ui": "./node_modules/jquery-ui-browserify/dist/jquery-ui.js" } } } -- cgit v1.2.3 From 0471e905b8b37ac226176ee9a708624c869bb046 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 29 Sep 2016 09:18:46 +0200 Subject: fonts & ligatures --- Gruntfile.js | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'Gruntfile.js') diff --git a/Gruntfile.js b/Gruntfile.js index bf488ff9..86612dc4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -4,6 +4,7 @@ module.exports = function (grunt) { grunt.initConfig({ appDir: 'app/Resources/static', buildDir: 'web/bundles/wallabagcore', + modulesDir: 'node_modules', postcss: { material: { @@ -111,13 +112,13 @@ module.exports = function (grunt) { copy: { pickerjs: { expand: true, - cwd: 'node_modules/pickadate/lib', + cwd: '<%= modulesDir %>/pickadate/lib', src: 'picker.js', dest: '<%= buildDir %>', }, annotator: { expand: true, - cwd: 'node_modules/annotator/pkg', + cwd: '<%= modulesDir %>/annotator/pkg', src: 'annotator.min.js', dest: '<%= buildDir %>/themes/_global/js/', }, @@ -128,14 +129,21 @@ module.exports = function (grunt) { { expand: true, overwrite: true, - cwd: '<%= appDir %>/lib/icomoon-bower/', - src: 'fonts', - dest: '<%= buildDir %>/themes/baggy/', + cwd: '<%= modulesDir %>/icomoon-free-npm/Font', + src: 'IcoMoon-Free.ttf', + dest: '<%= buildDir %>/themes/baggy/fonts/', + }, + { + expand: true, + overwrite: true, + cwd: '<%= modulesDir %>/ptsans-npm-webfont/fonts', + src: '*', + dest: '<%= buildDir %>/themes/baggy/fonts/', }, { expand: true, overwrite: true, - cwd: '<%= appDir %>/lib/bower-pt-sans/fonts', + cwd: '<%= modulesDir %>/material-design-icons-iconfont/dist/fonts/', src: '*', dest: '<%= buildDir %>/themes/baggy/fonts/', }, @@ -146,28 +154,28 @@ module.exports = function (grunt) { { expand: true, overwrite: true, - cwd: '<%= appDir %>/lib/icomoon-bower/', - src: 'fonts', - dest: '<%= buildDir %>/themes/material/', + cwd: '<%= modulesDir %>/icomoon-free-npm/Font', + src: 'IcoMoon-Free.ttf', + dest: '<%= buildDir %>/themes/material/fonts', }, { expand: true, overwrite: true, - cwd: 'node_modules/materialize-css/', + cwd: '<%= modulesDir %>/materialize-css/', src: 'font', dest: '<%= buildDir %>/themes/material', }, { expand: true, overwrite: true, - cwd: '<%= appDir %>/lib/roboto-fontface/fonts/', + cwd: '<%= modulesDir %>/roboto-fontface/fonts/Roboto', src: '*', - dest: '<%= buildDir %>/themes/material/fonts/roboto/', + dest: '<%= buildDir %>/themes/material/fonts/', }, { expand: true, overwrite: true, - cwd: '<%= appDir %>/lib/material-design-icons-iconfont/dist/fonts/', + cwd: '<%= modulesDir %>/material-design-icons-iconfont/dist/fonts/', src: '*', dest: '<%= buildDir %>/themes/material/fonts/', }, -- cgit v1.2.3