From 91a77b776f868f88867e54dbcb97d9c3c3dd776e Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sat, 10 Jun 2017 14:40:00 +0200 Subject: [PATCH] Remove grunt and bower. --- .bowerrc | 3 - .eslintrc.yml | 19 ---- .jshintrc | 21 ----- Gruntfile.js | 158 ---------------------------------- bower.json | 67 -------------- grunt-config/bgShell.js | 16 ---- grunt-config/clean.js | 7 -- grunt-config/connect.js | 40 --------- grunt-config/copy.js | 22 ----- grunt-config/eslint.js | 13 --- grunt-config/filerev.js | 17 ---- grunt-config/flake8.js | 10 --- grunt-config/htmllint.js | 16 ---- grunt-config/includeSource.js | 13 --- grunt-config/jsonlint.js | 20 ----- grunt-config/less.js | 12 --- grunt-config/lesslint.js | 7 -- grunt-config/ngAnnotate.js | 12 --- grunt-config/shell.js | 11 --- grunt-config/usemin.js | 16 ---- grunt-config/useminPrepare.js | 17 ---- grunt-config/watch.js | 36 -------- grunt-config/wiredep.js | 6 -- 23 files changed, 559 deletions(-) delete mode 100644 .bowerrc delete mode 100644 .eslintrc.yml delete mode 100644 .jshintrc delete mode 100644 Gruntfile.js delete mode 100644 bower.json delete mode 100644 grunt-config/bgShell.js delete mode 100644 grunt-config/clean.js delete mode 100644 grunt-config/connect.js delete mode 100644 grunt-config/copy.js delete mode 100644 grunt-config/eslint.js delete mode 100644 grunt-config/filerev.js delete mode 100644 grunt-config/flake8.js delete mode 100644 grunt-config/htmllint.js delete mode 100644 grunt-config/includeSource.js delete mode 100644 grunt-config/jsonlint.js delete mode 100644 grunt-config/less.js delete mode 100644 grunt-config/lesslint.js delete mode 100644 grunt-config/ngAnnotate.js delete mode 100644 grunt-config/shell.js delete mode 100644 grunt-config/usemin.js delete mode 100644 grunt-config/useminPrepare.js delete mode 100644 grunt-config/watch.js delete mode 100644 grunt-config/wiredep.js diff --git a/.bowerrc b/.bowerrc deleted file mode 100644 index 3bf1675..0000000 --- a/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "accountant-ui/bower_components" -} diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index 5d6864c..0000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -# vim: set tw=80 ts=4 sw=4 sts=4: - -extends: angular - -rules: - indent: - - error - - 4 - -plugins: - - angular - - html - - security - - this - -globals: - moment: true - Highcharts: true diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index c67bba2..0000000 --- a/.jshintrc +++ /dev/null @@ -1,21 +0,0 @@ -{ - "bitwise": true, - "browser": true, - "curly": true, - "eqeqeq": true, - "esnext": true, - "latedef": true, - "noarg": true, - "node": true, - "strict": true, - "undef": true, - "unused": true, - "quotmark": "single", - "indent": 2, - "jquery": true, - "globals": { - "angular": false, - "moment": false, - "Highcharts": false - } -} diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 50b2124..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,158 +0,0 @@ -// vim: set tw=80 ts=4 sw=4 sts=4: - -'use strict'; - -module.exports = function(grunt) { - // Grunt plugin initialization. - // ============================ - - // Automagically load grunt tasks. - require('load-grunt-tasks')(grunt); - - // Display duration for each task. - require('time-grunt')(grunt); - - // Options - var options = { - // Application related configuration. - accountant: { - // Frontend related - frontend: { - // Application dependencies by bower. - app: require('./bower.json'), - // Source path - src: 'accountant-ui', - // Distribution path - dist: 'accountant-ui/dist' - } - }, - - // Grunt configurationi files. - config: { - src: 'grunt-config/*.js' - }, - // Package description for NPM. - pkg: grunt.file.readJSON('package.json') - // banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %>\n' + - // '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %> */\n' - }; - - // Load configuration from Grunt configuration directory. - var configs = require('load-grunt-configs')(grunt, options); - - // Initialize Grunt configuration. - grunt.initConfig(configs); - - // Toolchain tasks. - // ================ - - // Manage dev dependencies with npm - grunt.registerTask('npm', [ - // Linting on package.json. - 'newer:jsonlint:package', - // NodeJS dependencies. - 'shell:npmInstall' - ]); - - grunt.registerTask('grunt', [ - // Linting on Grunt files. - 'newer:eslint:grunt', - ]); - - // Manage toolchain - grunt.registerTask('toolchain', [ - // NPM. - 'npm', - // Grunt. - 'grunt' - ]); - - // Backend tasks. - // ============== - - // Manage backend dependencies with pip. - grunt.registerTask('beDeps', [ - // Python dependencies. Does not work in virtualenv. - //'shell:pipInstall' - ]); - - // Backend linting - grunt.registerTask('beLint', [ - // Use flake8 for python linting. - 'newer:flake8' - ]); - - // Backend dev task. - grunt.registerTask('beDev', [ - 'beDeps', - 'beLint' - ]); - - // Frontend tasks. - // =============== - - // Front dependency management. - grunt.registerTask('feDeps', [ - // Bower file linting - 'newer:jsonlint:bower', - // Web assets using bower - 'shell:bowerInstall', - // Inject dependencies into application. - 'wiredep:app' - ]); - - // Generate needed files. - grunt.registerTask('feGen', [ - // Generate CSS from Less. - 'newer:less:frontendDev' - ]); - - // Linting - grunt.registerTask('feLint', [ - // ECMAScript - 'newer:eslint:frontend', - // CSS - 'newer:lesslint:frontend', - // HTML. - 'newer:htmllint' - ]); - - // Frontend dev task. - grunt.registerTask('feDev', [ - 'feDeps', - 'feLint' - ]); - - // Global tasks. - // ============= - - // Dev. - grunt.registerTask('dev', [ - 'toolchain', - 'beDev', - 'feDev' - ]); - - // Serve application. - grunt.registerTask('serve', [ - 'dev', - 'bgShell:runserver', - 'connect:livereload', - 'watch' - ]); - - // Make distribution. - grunt.registerTask('dist', [ - 'dev', - 'clean:dist', - 'useminPrepare', - 'copy:dist', - 'copy:styles', - 'cssmin:generated', - 'concat:generated', - 'ngAnnotate', - 'uglify:generated', - 'filerev', - 'usemin' - ]); -}; diff --git a/bower.json b/bower.json deleted file mode 100644 index 5fb8ad1..0000000 --- a/bower.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "accountant", - "version": "0.1.0", - "authors": [ - "Alexis Lahouze " - ], - "license": "AGPL", - "main": [ - "accountant-ui/index.html", - "accountant-ui/js/app.js" - ], - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "dependencies": { - "jquery": "~3.1", - "moment": "~2.15", - "bootstrap": "~3.3.6", - "bootstrap-additions": "~0.3.1", - "angular": "~1.5", - "angular-resource": "~1.5", - "angular-route": "~1.5", - "angular-messages": "~1.5", - "angular-strap": "~2.3.6", - "angular-xeditable": "~0.4", - "angular-ui-notification": "~0.2", - "highcharts-ng": "~0.0.11", - "highstock-release": "~5.0", - "angular-http-auth": "~1.3", - "meanie-angular-storage": "~1.3", - "font-awesome": ">=4.5.0", - "bootbox": "~4.4.0", - "angular-bootstrap": "~2.1", - "ngBootbox": "^0.1.3" - }, - "overrides": { - "bootstrap": { - "main": [ - "less/bootstrap.less", - "dist/css/bootstrap.css", - "dist/js/bootstrap.js" - ] - }, - "font-awesome": { - "main": [ - "./css/font-awesome.css", - "./fonts/*" - ] - }, - "meanie-angular-storage": { - "main": [ - "release/meanie-angular-storage.js" - ] - }, - "highstock-release": { - "main": [ - "highstock.js", - "highcharts-more.js", - "modules/exporting.js" - ] - } - } -} diff --git a/grunt-config/bgShell.js b/grunt-config/bgShell.js deleted file mode 100644 index 399d715..0000000 --- a/grunt-config/bgShell.js +++ /dev/null @@ -1,16 +0,0 @@ -var extend = require('util')._extend; - -module.exports = { - runserver: { - cmd: 'flask run', - execOpts: { - cwd: '.', - env: extend(process.env, { - FLASK_APP: 'accountant/__init__.py', - FLASK_DEBUG: '1' - }) - }, - fail: true, - bg: true - } -}; diff --git a/grunt-config/clean.js b/grunt-config/clean.js deleted file mode 100644 index 0881828..0000000 --- a/grunt-config/clean.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = { - dist: [ - '<%= accountant.frontend.dist %>' - ] -}; diff --git a/grunt-config/connect.js b/grunt-config/connect.js deleted file mode 100644 index d44712f..0000000 --- a/grunt-config/connect.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -module.exports = { - options: { - port: 5001, - hostname: 'localhost', - base: '<%= accountant.frontend.src %>', - apiUrl: 'http://localhost:5000/api/', - swaggerUiUrl: 'http://localhost:5000/swaggerui/', - livereload: 1337 - }, - proxies: [{ - context: '/api', - host: '127.0.0.1', - port: 5000, - https: false - }, { - contect: '/swaggerui', - host: '127.0.0.1', - port: 5000, - https: false - }], - livereload: { - options: { - // open: true, - middleware: function(connect, options, middlewares) { - var connectLogger = require('connect-logger'); - var connectProxy = require('connect-proxy-layer'); - var apiProxy = connectProxy(options.apiUrl); - var swaggerUiProxy = connectProxy(options.swaggerUiUrl); - - return [ - connectLogger(), - connect().use('/api', apiProxy), - connect().use('/swaggerUi', swaggerUiProxy) - ].concat(middlewares); - } - } - } -}; diff --git a/grunt-config/copy.js b/grunt-config/copy.js deleted file mode 100644 index afa9f97..0000000 --- a/grunt-config/copy.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -module.exports = { - dist: { - files: [{ - expand: true, - dot: true, - cwd: '<%= accountant.frontend.src %>', - dest: '<%= accountant.frontend.dist %>', - src: [ - '*.html', - 'views/*.html' - ] - }] - }, - styles: { - expand: true, - cwd: '<%= accountant.frontend.src %>/css', - dest: '.tmp/css', - src: '{,*/}*.css' - } -}; diff --git a/grunt-config/eslint.js b/grunt-config/eslint.js deleted file mode 100644 index fea0a89..0000000 --- a/grunt-config/eslint.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -module.exports = { - grunt: [ - 'Gruntfile.js', - 'grunt-config/*.js' - ], - frontend: [ - '<%= accountant.frontend.src %>/index.html', - '<%= accountant.frontend.src %>/views/*.html', - '<%= accountant.frontend.src %>/js/*.js' - ] -}; diff --git a/grunt-config/filerev.js b/grunt-config/filerev.js deleted file mode 100644 index 98eb15c..0000000 --- a/grunt-config/filerev.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -module.exports = { - options: { - encoding: 'utf-8', - algorithm: 'md5', - length: 8 - }, - dist: { - src: [ - '<%= accountant.frontend.dist %>/css/*.css', - '<%= accountant.frontend.dist %>/js/*.js', - '!<%= accountant.frontend.dist %>/css/*.map.css', - '!<%= accountant.frontend.dist %>/js/*.map.js' - ] - } -}; diff --git a/grunt-config/flake8.js b/grunt-config/flake8.js deleted file mode 100644 index 45bdc7d..0000000 --- a/grunt-config/flake8.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = { - options: { - maxComplexity: 4 - }, - src: [ - 'accountant/**/*.py' - ] -}; diff --git a/grunt-config/htmllint.js b/grunt-config/htmllint.js deleted file mode 100644 index ece331f..0000000 --- a/grunt-config/htmllint.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = { - frontend: { - options: { - 'attr-name-style': 'dash', - 'attr-req-value': false, - 'id-class-ignore-regex': '{{.*?}}', - 'id-class-style': 'dash', - 'indent-style': 'spaces', - 'indent-width': 2 - }, - src: [ - '<%= accountant.frontend.src %>/*.html', - '<%= accountant.frontend.src %>/views/*.html' - ] - } -}; diff --git a/grunt-config/includeSource.js b/grunt-config/includeSource.js deleted file mode 100644 index dd4c89c..0000000 --- a/grunt-config/includeSource.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -module.exports = { - options: { - basePath: '<%= accountant.frontend.src %>', - baseUrl: '' - }, - index: { - files: { - '<%= accountant.frontend.src %>/index.html': '<%= accountant.frontend.src %>/index.html' - } - } -}; diff --git a/grunt-config/jsonlint.js b/grunt-config/jsonlint.js deleted file mode 100644 index 068bc1b..0000000 --- a/grunt-config/jsonlint.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -module.exports = { - package: { - src: ['package.json'], - options: { - formatter: 'prose', - reporter: 'jslint', - indent: 2 - } - }, - bower: { - src: ['bower.json'], - options: { - formatter: 'prose', - reporter: 'jslint', - indent: 2 - } - } -}; diff --git a/grunt-config/less.js b/grunt-config/less.js deleted file mode 100644 index f978894..0000000 --- a/grunt-config/less.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = { - frontendDev: { - options: { - paths: ['<%= accountant.frontend.src %>/less'] - }, - files: { - '<%= accountant.frontend.src %>/css/main.css': '<%= accountant.frontend.src %>/less/main.less' - } - } -}; diff --git a/grunt-config/lesslint.js b/grunt-config/lesslint.js deleted file mode 100644 index dba44cd..0000000 --- a/grunt-config/lesslint.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = { - frontend: { - src: ['<%= accountant.frontend.src %>/less/{,**/}*.less'] - } -}; diff --git a/grunt-config/ngAnnotate.js b/grunt-config/ngAnnotate.js deleted file mode 100644 index 3b65d8c..0000000 --- a/grunt-config/ngAnnotate.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = { - dist: { - files: [{ - expand: true, - cwd: '.tmp/concat/js', - src: '*.js', - dest: '.tmp/concat/js' - }] - } -}; diff --git a/grunt-config/shell.js b/grunt-config/shell.js deleted file mode 100644 index 5f99163..0000000 --- a/grunt-config/shell.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - npmInstall: { - command: 'npm install' - }, - bowerInstall: { - command: 'bower install' - }, - pipInstall: { - command: 'pip install --upgrade --requirement requirements.txt' - } -}; diff --git a/grunt-config/usemin.js b/grunt-config/usemin.js deleted file mode 100644 index ceecf82..0000000 --- a/grunt-config/usemin.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -module.exports = { - html: ['<%= accountant.frontend.dist %>/{,*/}*.html'], - css: ['<%= accountant.frontend.dist %>/css/{,*/}*.css'], - js: ['<%= accountant.frontend.dist %>/js/{,*/}*.js'], - options: { - assetsDir: [ - '<%= accountant.frontend.dist %>', - '<%= accountant.frontend.dist %>/css' - ], - patterns: { - js: [[/(images\/[^''""]*\.(png|jpg|jpeg|gif|webp|svg))/g, 'Replacing references to images']] - } - } -}; diff --git a/grunt-config/useminPrepare.js b/grunt-config/useminPrepare.js deleted file mode 100644 index ebe86df..0000000 --- a/grunt-config/useminPrepare.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -module.exports = { - html: '<%= accountant.frontend.src %>/index.html ', - options: { - dest: '<%= accountant.frontend.dist %>', - flow: { - html: { - steps: { - js: ['concat', 'uglify'], - css: ['cssmin'] - }, - post: {} - } - } - } -}; diff --git a/grunt-config/watch.js b/grunt-config/watch.js deleted file mode 100644 index e277feb..0000000 --- a/grunt-config/watch.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -module.exports = { - // Toolchain - npm: { - files: ['package.json'], - tasks: ['npm'] - }, - grunt: { - files: ['Gruntfile.js', 'grunt-config/*.js'], - tasks: ['grunt'] - }, - // Backend - requirements: { - files: ['requirements.txt'], - tasks: ['beDeps'] - }, - be: { - files: 'accountant/{,**}/*.py', - tasks: ['beLint', 'bgShell:runserver'] - }, - // Frontend - bower: { - files: 'bower.json', - tasks: ['feDeps'] - }, - fe: { - options: { - livereload: '<%= connect.options.livereload %>' - }, - files: [ - '<%= accountant.frontend.src %>/{,**}/*', - ], - tasks: ['feLint'] - } -}; diff --git a/grunt-config/wiredep.js b/grunt-config/wiredep.js deleted file mode 100644 index 1be217d..0000000 --- a/grunt-config/wiredep.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - app: { - src: ['<%= accountant.frontend.src %>/index.html'], - ignorePath: /\.\.\// - } -};