Skip to content

Commit

Permalink
Merge pull request #1 from bijoyanupam/v1.3.1-dev
Browse files Browse the repository at this point in the history
Version 1.3.1
  • Loading branch information
bijoyanupam committed Nov 21, 2017
2 parents 729f3f6 + 93f42ca commit e29c98e
Show file tree
Hide file tree
Showing 13 changed files with 189 additions and 103 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
ensure_newline_at_eof_on_save = true
39 changes: 34 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* This config is based on JavaScript Standard Style.
* https://standardjs.com/
* https://github.com/standard/eslint-config-standard
*/
{
"extends": [
"eslint:recommended",
Expand All @@ -7,7 +12,8 @@
"browser": true,
"commonjs": true,
"es6": true,
"node": true
"node": true,
"amd": true
},
"parserOptions": {
"ecmaFeatures": {
Expand All @@ -16,9 +22,32 @@
"sourceType": "module"
},
"rules": {
"space-before-function-paren": ["error", "never"],
"semi": ["error", "always", {
"omitLastInOneLineBlock": true
}]
"no-irregular-whitespace": [
"error",
{
"skipComments": true
}
],
"space-before-function-paren": [
"error",
{
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}
],
"semi": [
"error",
"always",
{
"omitLastInOneLineBlock": true
}
],
"valid-jsdoc": [
"error"
],
"no-console": [
"warn"
]
}
}
40 changes: 36 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
/node_modules/
/assets/css/
/assets/js-build/
/.vscode/
# Ignore the nodemodules folder
node_modules/
assets/css/
assets/js-build/

# Ignore OS generated files #
.DS_Store*
ehthumbs.db
Icon\?
Thumbs.db

# Ignore editor specific files #
.vscode/

# Always-ignore files and folders #
*.diff
*.err
*.log
*.orig
*.rej
*.swn
*.swo
*.swp
._*
*~
s3_website.yml

# Ignore packages #
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.iml
118 changes: 25 additions & 93 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,102 +12,34 @@
module.exports = function (grunt) {
'use strict';

// Load the task config files.
function loadConfig(path) {
var glob = require('glob'),
object = {},
key;

glob.sync('*', {
'cwd': path
}).forEach(function (option) {
key = option.replace(/\.js$/, '');
var gruntTask = require(path + option);
object[key] = (typeof gruntTask == "function") ? gruntTask() : gruntTask;
});
return object;
};

// Initial config/paths.
var config = {
'pkg': grunt.file.readJSON('package.json')
};

grunt.util._.extend(config, loadConfig('./grunt/'));
grunt.initConfig(config);

// Load the npm plugins.
require('load-grunt-tasks')(grunt);

grunt.initConfig({
'pkg': grunt.file.readJSON('package.json'),

// JS build configurations.
'qunit': {
'all': {
'options': {
'urls': [
'http://localhost:<%= connect.server.options.port %>/tests/js/example/example.html'
]
}
}
},

'eslint': {
'options': {
'format': 'stylish'
},
'target': ['./assets/js/**/*.js']
},

'browserify': {
'options': {
'transform': ["babelify"]
},
'dist': {
'src': ['./assets/js/**/*.js'],
'dest': './assets/js-build/main.js'
}
},

'uglify': {
'options': {
'sourceMap': true,
},
'dist': {
'src': ['./assets/js-build/main.js'],
'dest': './assets/js-build/main.min.js'
}
},

// CSS build configurations.
'sasslint': {
'options': {
'cacheConfig': true,
'configFile': '.sass-lint.yml',
'formatter': 'stylish'
},
'target': ['./assets/scss/**/*.scss']
},

'sass': {
'options': {
'sourceMap': true,
'outputStyle': 'compressed'
},
'dist': {
'files': [{
'expand': true,
'cwd': './assets/scss/',
'src': ['**/*.scss'],
'dest': './assets/css/',
'ext': '.css'
}]
}
},

// Post CSS build configurations.
'postcss': {
'options': {
'processors': [
require('autoprefixer'),
require('postcss-import'),
require('cssnano')
]
},
'dist': {
'src': './assets/css/*.css'
}
},

// Static webserver.
'connect': {
'server': {
'options': {
'port': 8000,
'base': '.'
}
}
}
});

// Register tasks.
// Register tasks as npm scripts. See package.json.
grunt.task.registerTask('test', ['connect', 'qunit', 'eslint', 'sasslint']);
grunt.task.registerTask('build-js', ['connect', 'qunit', 'eslint', 'browserify', 'uglify']);
grunt.task.registerTask('build-css', ['sasslint', 'sass', 'postcss']);
Expand Down
11 changes: 11 additions & 0 deletions grunt/browserify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = function (grunt) {
return {
'options': {
'transform': ["babelify"]
},
'dist': {
'src': ['./assets/js/**/*.js'],
'dest': './assets/js-build/main.js'
}
}
};
10 changes: 10 additions & 0 deletions grunt/connect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = function (grunt) {
return {
'server': {
'options': {
'port': 8000,
'base': '.'
}
}
}
};
8 changes: 8 additions & 0 deletions grunt/eslint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = function (grunt) {
return {
'options': {
'format': 'stylish'
},
'target': ['./assets/js/**/*.js']
}
};
14 changes: 14 additions & 0 deletions grunt/postcss.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = function (grunt) {
return {
'options': {
'processors': [
require('autoprefixer'),
require('postcss-import'),
require('cssnano')
]
},
'dist': {
'src': './assets/css/*.css'
}
}
};
11 changes: 11 additions & 0 deletions grunt/qunit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = function (grunt) {
return {
'all': {
'options': {
'urls': [
'http://localhost:<%= connect.server.options.port %>/tests/js/example/example.html'
]
}
}
}
};
17 changes: 17 additions & 0 deletions grunt/sass.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = function (grunt) {
return {
'options': {
'sourceMap': true,
'outputStyle': 'compressed'
},
'dist': {
'files': [{
'expand': true,
'cwd': './assets/scss/',
'src': ['**/*.scss'],
'dest': './assets/css/',
'ext': '.css'
}]
}
}
};
10 changes: 10 additions & 0 deletions grunt/sasslint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = function (grunt) {
return {
'options': {
'cacheConfig': true,
'configFile': '.sass-lint.yml',
'formatter': 'stylish'
},
'target': ['./assets/scss/**/*.scss']
}
};
11 changes: 11 additions & 0 deletions grunt/uglify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = function (grunt) {
return {
'options': {
'sourceMap': true,
},
'dist': {
'src': ['./assets/js-build/main.js'],
'dest': './assets/js-build/main.min.js'
}
}
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "frontend-starter-kit",
"title": "Front-End Starter Kit",
"description": "Front-end starter kit for automated web development",
"version": "1.3.0",
"version": "1.3.1",
"repository": {
"type": "git",
"url": "https://github.com/bijoyanupam/frontend-starter-kit.git"
Expand Down

0 comments on commit e29c98e

Please sign in to comment.