Update the build system, removing Grunt and adding nam scripts

This commit is contained in:
CJ Patoilo 2016-07-25 02:22:33 -03:00
parent bf0911f813
commit 8d83e0b25e
10 changed files with 18 additions and 172 deletions

View File

@ -35,7 +35,7 @@ Try to solve a problem for each pull request, this increases the chances of acce
## Building ## 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 ## Style Guide

View File

@ -24,7 +24,7 @@ be fixed in the latest versions. -->
**Milligram:** **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 ### Test case

1
.gitignore vendored
View File

@ -6,7 +6,6 @@ pids
*.seed *.seed
lib-cov lib-cov
coverage coverage
.grunt
.lock-wscript .lock-wscript
build/Release build/Release
node_modules node_modules

View File

@ -7,7 +7,6 @@ bower.json
changelog.md changelog.md
component.json component.json
composer.json composer.json
gruntfile.js
package.js package.js
package.json package.json
src src

View File

@ -1,8 +1,7 @@
sudo: false sudo: false
language: node_js language: node_js
node_js: node_js:
- 0.12 - 6
before_install: before_install:
- gem update --system - node --version
- gem install sass - npm --version
- npm install grunt-cli --global

View File

@ -37,7 +37,6 @@
"changelog.md", "changelog.md",
"component.json", "component.json",
"composer.json", "composer.json",
"gruntfile.js",
"package.js", "package.js",
"package.json", "package.json",
"src", "src",

View File

@ -37,7 +37,6 @@
"changelog.md", "changelog.md",
"component.json", "component.json",
"composer.json", "composer.json",
"gruntfile.js",
"package.js", "package.js",
"package.json", "package.json",
"src", "src",

View File

@ -37,7 +37,6 @@
"component.json", "component.json",
"composer.json", "composer.json",
"contributing.md", "contributing.md",
"gruntfile.js",
"package.js", "package.js",
"package.json", "package.json",
"src", "src",

View File

@ -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 );
};

View File

@ -37,7 +37,6 @@
"changelog.md", "changelog.md",
"component.json", "component.json",
"composer.json", "composer.json",
"gruntfile.js",
"package.js", "package.js",
"package.json", "package.json",
"src", "src",
@ -47,22 +46,22 @@
"normalize.css": "latest" "normalize.css": "latest"
}, },
"devDependencies": { "devDependencies": {
"bower": "^1.6.8", "autoprefixer": "^6.3.6",
"grunt": "^0.4.5", "node-sass": "^3.7.0",
"grunt-autoprefixer": "^3.0.3", "npm-run-all": "^2.1.1",
"grunt-contrib-clean": "^0.7.0", "postcss-banner": "^3.0.0",
"grunt-contrib-sass": "^0.8.1", "postcss-cli": "^2.5.2"
"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"
}, },
"engines": { "engines": {
"node": ">=0.12.0" "node": "^6.0.0"
}, },
"scripts": { "scripts": {
"start": "grunt", "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",
"test": "grunt build" "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"
} }
} }