From 8d83e0b25e8e614fb35a0b63003701b159271c73 Mon Sep 17 00:00:00 2001 From: CJ Patoilo Date: Mon, 25 Jul 2016 02:22:33 -0300 Subject: [PATCH] Update the build system, removing Grunt and adding nam scripts --- .github/contributing.md | 2 +- .github/issue_template.md | 2 +- .gitignore | 1 - .npmignore | 1 - .travis.yml | 7 +- bower.json | 1 - component.json | 1 - composer.json | 1 - gruntfile.js | 147 -------------------------------------- package.json | 27 ++++--- 10 files changed, 18 insertions(+), 172 deletions(-) delete mode 100644 gruntfile.js diff --git a/.github/contributing.md b/.github/contributing.md index cae7157..ff04535 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -35,7 +35,7 @@ Try to solve a problem for each pull request, this increases the chances of acce ## Building -First install [Node.js](https://nodejs.org/en/download/), em seguida [Grunt](http://gruntjs.com/getting-started) e [Sass](http://sass-lang.com/install) for the build process. Now install all the dependencies, run `npm install` from the project directory. Once you have the dependencies installed, run `grunt`. This will run the default grunt task which compiles the Sass files into milligram.css file. +First install [Node.js](https://nodejs.org/en/download/) for the build process. Now install all the dependencies, run `npm install` from the project directory. Once you have the dependencies installed, run `npm start`. This will run the build task which compiles the Sass files into Milligram.css file in the expanded and compressed version. ## Style Guide diff --git a/.github/issue_template.md b/.github/issue_template.md index 712b74f..95417bc 100755 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -24,7 +24,7 @@ be fixed in the latest versions. --> **Milligram:** -**Other (e.g. Normalize.css, Node, Grunt, browser, operating system) (if applicable):** +**Other (e.g. Normalize.css, Node.js, npm, bower, browser, operating system) (if applicable):** ### Test case diff --git a/.gitignore b/.gitignore index ca9b6f5..d4aab08 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ pids *.seed lib-cov coverage -.grunt .lock-wscript build/Release node_modules diff --git a/.npmignore b/.npmignore index c80e244..7fe4d1f 100644 --- a/.npmignore +++ b/.npmignore @@ -7,7 +7,6 @@ bower.json changelog.md component.json composer.json -gruntfile.js package.js package.json src diff --git a/.travis.yml b/.travis.yml index d072dac..f9d0394 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,7 @@ sudo: false language: node_js node_js: - - 0.12 + - 6 before_install: - - gem update --system - - gem install sass - - npm install grunt-cli --global + - node --version + - npm --version diff --git a/bower.json b/bower.json index 767f784..995b779 100644 --- a/bower.json +++ b/bower.json @@ -37,7 +37,6 @@ "changelog.md", "component.json", "composer.json", - "gruntfile.js", "package.js", "package.json", "src", diff --git a/component.json b/component.json index c9bf85b..ea4e7e1 100644 --- a/component.json +++ b/component.json @@ -37,7 +37,6 @@ "changelog.md", "component.json", "composer.json", - "gruntfile.js", "package.js", "package.json", "src", diff --git a/composer.json b/composer.json index 8593cdd..a7c813e 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,6 @@ "component.json", "composer.json", "contributing.md", - "gruntfile.js", "package.js", "package.json", "src", diff --git a/gruntfile.js b/gruntfile.js deleted file mode 100644 index f2adfed..0000000 --- a/gruntfile.js +++ /dev/null @@ -1,147 +0,0 @@ -module.exports = function ( grunt ) { - - 'use strict'; - - - // ================================================================ - // CONFIG TASKS - // ================================================================ - - // Define the configuration - grunt.initConfig({ - - // Specifics of npm's package.json handling - pkg: grunt.file.readJSON( 'package.json' ), - - // Banner - banner: - '/*!\n'+ - ' * Milligram v<%= pkg.version %>\n'+ - ' * <%= pkg.homepage %>\n'+ - ' *\n'+ - ' * Copyright (c) '+new Date().getFullYear()+' CJ Patoilo\n'+ - ' * Licensed under the <%= pkg.license %> license\n'+ - '*/\n\n', - - // DEFAULT TASK - // ================================================================ - - // Watch files and process the above tasks - watch: { - options: { - livereload: false - }, - grunt: { - files: [ - 'gruntfile.js' - ], - options: { - reload: true - } - }, - sass: { - files: [ - 'src/**/*.sass' - ], - tasks: [ - 'sass', - 'autoprefixer' - ] - } - }, - - // BUILD TASKS - // ================================================================ - - // Clear files and folders - clean: { - all: [ 'dist' ] - }, - - // Compile Sass files to CSS - sass: { - minify: { - options: { - banner: '<%= banner %>', - noCache: true, - sourcemap: 'none', - style: 'compressed' - }, - files: { - 'dist/milligram.min.css': [ 'src/**/*.sass', '!src/**/_*.sass' ] - } - }, - default: { - options: { - banner: '<%= banner %>', - noCache: true, - sourcemap: 'none', - style: 'expanded' - }, - files: { - 'dist/milligram.css': [ 'src/**/*.sass', '!src/**/_*.sass' ] - } - } - }, - - // Parse CSS and add vendor-prefixed CSS properties using the Can I Use database. - autoprefixer: { - minify: { - options: { - browsers: [ - 'last 1 versions' - ], - map: { - inline: false - } - }, - files: { - 'dist/milligram.min.css': 'dist/milligram.min.css' - } - }, - default: { - options: { - browsers: [ - 'last 1 versions' - ], - map: false - }, - files: { - 'dist/milligram.css': 'dist/milligram.css' - } - } - } - - }); - - - // ================================================================ - // REGISTER TASKS - // ================================================================ - - // Default task - grunt.registerTask( 'default', [ - 'build', - 'watch' - ]); - - // Build task - grunt.registerTask( 'build', [ - 'clean', - 'sass', - 'autoprefixer' - ]); - - - // ================================================================ - // LOAD TASKS - // ================================================================ - - // Automatically loading Grunt tasks - require( 'load-grunt-tasks' )( grunt ); - - // Display the elapsed execution time of Grunt tasks - require( 'time-grunt' )( grunt ); - - -}; diff --git a/package.json b/package.json index d18f107..248fb20 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "changelog.md", "component.json", "composer.json", - "gruntfile.js", "package.js", "package.json", "src", @@ -47,22 +46,22 @@ "normalize.css": "latest" }, "devDependencies": { - "bower": "^1.6.8", - "grunt": "^0.4.5", - "grunt-autoprefixer": "^3.0.3", - "grunt-contrib-clean": "^0.7.0", - "grunt-contrib-sass": "^0.8.1", - "grunt-contrib-watch": "^0.6.1", - "grunt-newer": "^1.1.1", - "grunt-notify": "^0.4.3", - "load-grunt-tasks": "^3.3.0", - "time-grunt": "^1.2.2" + "autoprefixer": "^6.3.6", + "node-sass": "^3.7.0", + "npm-run-all": "^2.1.1", + "postcss-banner": "^3.0.0", + "postcss-cli": "^2.5.2" }, "engines": { - "node": ">=0.12.0" + "node": "^6.0.0" }, "scripts": { - "start": "grunt", - "test": "grunt build" + "banner:expanded": "echo '/*!\n * Milligram v1.1.0\n * http://milligram.github.io\n *\n * Copyright (c) 2016 CJ Patoilo\n * Licensed under the MIT license\n*/\n' | cat - dist/milligram.css > temp && mv temp dist/milligram.css", + "banner:compressed": "echo '/*!\n * Milligram v1.1.0\n * http://milligram.github.io\n *\n * Copyright (c) 2016 CJ Patoilo\n * Licensed under the MIT license\n*/\n' | cat - dist/milligram.min.css > temp && mv temp dist/milligram.min.css", + "clean": "rm -f -r dist", + "sass:expanded": "node-sass --output-style expanded src/milligram.sass dist/milligram.css", + "sass:compressed": "node-sass --output-style compressed src/milligram.sass dist/milligram.min.css", + "autoprefixer": "postcss -u autoprefixer --no-map.inline --autoprefixer.banner '/* single line comment */' --autoprefixer.browsers 'last 1 versions' -r dist/*", + "build": "npm-run-all clean sass:expanded sass:compressed autoprefixer banner:expanded banner:compressed" } }