mirror of
https://github.com/milligram/milligram.git
synced 2024-11-13 16:54:22 +00:00
Update the build system, removing Grunt and adding nam scripts
This commit is contained in:
parent
bf0911f813
commit
8d83e0b25e
2
.github/contributing.md
vendored
2
.github/contributing.md
vendored
@ -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
|
||||
|
2
.github/issue_template.md
vendored
2
.github/issue_template.md
vendored
@ -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
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,7 +6,6 @@ pids
|
||||
*.seed
|
||||
lib-cov
|
||||
coverage
|
||||
.grunt
|
||||
.lock-wscript
|
||||
build/Release
|
||||
node_modules
|
||||
|
@ -7,7 +7,6 @@ bower.json
|
||||
changelog.md
|
||||
component.json
|
||||
composer.json
|
||||
gruntfile.js
|
||||
package.js
|
||||
package.json
|
||||
src
|
||||
|
@ -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
|
||||
|
@ -37,7 +37,6 @@
|
||||
"changelog.md",
|
||||
"component.json",
|
||||
"composer.json",
|
||||
"gruntfile.js",
|
||||
"package.js",
|
||||
"package.json",
|
||||
"src",
|
||||
|
@ -37,7 +37,6 @@
|
||||
"changelog.md",
|
||||
"component.json",
|
||||
"composer.json",
|
||||
"gruntfile.js",
|
||||
"package.js",
|
||||
"package.json",
|
||||
"src",
|
||||
|
@ -37,7 +37,6 @@
|
||||
"component.json",
|
||||
"composer.json",
|
||||
"contributing.md",
|
||||
"gruntfile.js",
|
||||
"package.js",
|
||||
"package.json",
|
||||
"src",
|
||||
|
147
gruntfile.js
147
gruntfile.js
@ -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 );
|
||||
|
||||
|
||||
};
|
27
package.json
27
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"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user