Skip to content
This repository has been archived by the owner on Feb 14, 2018. It is now read-only.

Commit

Permalink
Use src directory to store source files
Browse files Browse the repository at this point in the history
Related to #121
  • Loading branch information
mischah committed Mar 27, 2017
1 parent 0d031b4 commit 6b303c2
Show file tree
Hide file tree
Showing 27 changed files with 67 additions and 45 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ desktop.ini
/docs
/server
/reports
/assets/css
/assets/js/*.min.js
/assets/js/*.map
/src/assets/css
/src/assets/js/*.min.js
/src/assets/js/*.map

### Dev ###
config.codekit
Expand Down
86 changes: 50 additions & 36 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var getTasks = require('load-grunt-tasks');
var displayTime = require('time-grunt');
var templateHelpers = require('./templates/helpers/helpers.js');
var templateHelpers = require('./src/templates/helpers/helpers.js');

// Returns a list of all css files defined in the property bundleCSS of package.json
function getBundleCSSFiles(packageJson) {
Expand Down Expand Up @@ -108,9 +108,9 @@ module.exports = function (grunt) {
files: {
src: [
'.postinstall.js',
'templates/helpers/helpers.js',
'src/templates/helpers/helpers.js',
'Gruntfile.js',
'assets/js/*.js'
'src/assets/js/*.js'
]
}
},
Expand Down Expand Up @@ -141,9 +141,9 @@ module.exports = function (grunt) {
},
files: {
'<%= config.dist %>/assets/js/built.min.js': [
'server/assets/js/vendor.js',
'<%= config.server %>/assets/js/vendor.js',
// Same as client.js but without sourceMaps
'server/assets/js/client.min.js'
'<%= config.server %>/assets/js/client.min.js'
]
}
}
Expand All @@ -154,12 +154,12 @@ module.exports = function (grunt) {
dev: {
options: {
sourceMap: true,
sourceMapFilename: 'assets/css/index_raw.css.map',
sourceMapFilename: 'src/assets/css/index_raw.css.map',
sourceMapURL: 'index_raw.css.map',
sourceMapRootpath: '../../'
},
files: {
'assets/css/index_raw.css': 'assets/less/index.less'
'src/assets/css/index_raw.css': 'src/assets/less/index.less'
}
}
},
Expand All @@ -177,14 +177,14 @@ module.exports = function (grunt) {
map: true
},
dev: {
src: 'assets/css/index_raw.css',
dest: 'assets/css/index.css'
src: 'src/assets/css/index_raw.css',
dest: 'src/assets/css/index.css'
}
},

clean: {
less: ['assets/css/index_raw.*'],
js: ['assets/js/**/*min.js*'],
less: ['src/assets/css/index_raw.*'],
js: ['src/assets/js/**/*min.js*'],
dist: ['<%= config.dist %>'],
server: ['<%= config.server %>'],
temp: ['temp']
Expand Down Expand Up @@ -255,7 +255,7 @@ module.exports = function (grunt) {
},
files: {
'<%= config.dist %>/assets/css/index.uncss.min.css': ['temp/index.css'],
'<%= config.dist %>/assets/css/index.min.css': ['assets/css/index.css']
'<%= config.dist %>/assets/css/index.min.css': ['src/assets/css/index.css']
}
},
npmLibsProduction: {
Expand Down Expand Up @@ -295,7 +295,7 @@ module.exports = function (grunt) {
options: {},
files: [{
expand: true,
cwd: 'assets/img',
cwd: 'src/assets/img',
src: ['**/*.{png,jpg,gif,svg}'],
dest: '<%= config.dist %>/assets/img'
}]
Expand All @@ -320,27 +320,40 @@ module.exports = function (grunt) {
copy: {
dist: {
expand: true,
cwd: 'src',
src: [
'assets/css/*.min.css',
'assets/fonts/**/*',
'assets/fonts/**/*'
],
dest: '<%= config.dist %>/'
},
distFilesFromLibs: {
expand: true,
src: [
'node_modules/bootstrap/fonts/**/*'
],
dest: '<%= config.dist %>/'
},
server: {
expand: true,
cwd: 'src',
src: [
'assets/css/**/*',
// 'assets/js/**/*',
'assets/fonts/**/*',
'assets/img/**/*',
'assets/img/**/*'
],
dest: '<%= config.server %>/'
},
serverFilesFromLibs: {
expand: true,
src: [
'node_modules/bootstrap/fonts/**/*'
],
// ].concat(dependencyConfiguration.getDependenciesFileList()),
dest: '<%= config.server %>/'
},
handlebars: {
expand: true,
cwd: 'src',
src: [
'*.hbs',
'templates/*.hbs',
Expand All @@ -353,8 +366,8 @@ module.exports = function (grunt) {
jsdoc: {
dist: {
src: [
'assets/js/**/*.js',
'!assets/js/**/*.min.js',
'src/assets/js/**/*.js',
'!src/assets/js/**/*.min.js',
'test/**/*.js'
],
options: {
Expand Down Expand Up @@ -401,7 +414,7 @@ module.exports = function (grunt) {
// Includes files in path
{src: ['./*', '!./*.zip', '!./*.sublime*'], dest: './', filter: 'isFile'},
// Includes files in path and its subdirs
{src: ['assets/**', '!assets/css/**'], dest: './'}
{src: ['src/assets/**', '!src/assets/css/**'], dest: './'}
]
}
},
Expand Down Expand Up @@ -489,14 +502,14 @@ module.exports = function (grunt) {
generator: {
dev: {
files: [{
cwd: '.',
cwd: './src',
src: ['*.hbs'],
dest: '<%= config.server %>'
}],
options: {
helpers: templateHelpers,
partialsGlob: 'partials/**/*.hbs',
templates: 'templates',
partialsGlob: 'src/partials/**/*.hbs',
templates: 'src/templates',
templateExt: 'hbs',
defaultTemplate: 'default',
frontmatterType: 'yaml'
Expand Down Expand Up @@ -530,28 +543,28 @@ module.exports = function (grunt) {
livereload: true
},
scripts: {
files: ['assets/js/**/*.js'],
files: ['src/assets/js/**/*.js'],
tasks: ['newer:eslint:fix', 'newer:copy:server', 'newer:browserify:clientDevelopment'],
options: {
spawn: false
}
},
otherJsFiles: {
files: ['Gruntfile.js', '.postinstall.js', 'templates/helpers/helpers.js'],
files: ['Gruntfile.js', '.postinstall.js', 'src/templates/helpers/helpers.js'],
tasks: ['eslint:fix'],
options: {
spawn: false
}
},
css: {
files: ['assets/less/**/*.less'],
files: ['src/assets/less/**/*.less'],
tasks: ['less:dev', 'autoprefixer', 'clean:less', 'newer:copy:server'],
options: {
spawn: false
}
},
html: {
files: ['*.hbs', 'templates/*.hbs', 'partials/*.hbs', 'templates/helpers/helpers.js'],
files: ['src/*.hbs', 'src/templates/*.hbs', 'src/partials/*.hbs', 'src/templates/helpers/helpers.js'],
tasks: ['generator', 'newer:htmllint', 'newer:bootlint'],
options: {
spawn: false
Expand All @@ -566,14 +579,14 @@ module.exports = function (grunt) {
browserify: {
vendor: {
src: [],
dest: 'server/assets/js/vendor.js',
dest: '<%= config.server %>/assets/js/vendor.js',
options: {
require: packageJson.bootstrapKickstart.bundleExternalJS
}
},
clientDevelopment: {
src: ['assets/js/**/*.js'],
dest: 'server/assets/js/client.js',
src: ['src/assets/js/**/*.js'],
dest: '<%= config.server %>/assets/js/client.js',
options: {
browserifyOptions: {
debug: true
Expand All @@ -587,8 +600,8 @@ module.exports = function (grunt) {
}
},
clientProduction: {
src: ['assets/js/**/*.js'],
dest: 'server/assets/js/client.min.js',
src: ['src/assets/js/**/*.js'],
dest: '<%= config.server %>/assets/js/client.min.js',
options: {
browserifyOptions: {
debug: false
Expand All @@ -608,13 +621,13 @@ module.exports = function (grunt) {
options: {
algorithm: 'sha512',
length: 8,
baseDir: 'server/',
assets: ['**/*.js', '**/*.css'],
baseDir: '<%= config.server %>/',
assets: ['src/**/*.js', 'src/**/*.css'],
queryString: true
},
files: [{
expand: true,
cwd: 'server/',
cwd: '<%= config.server %>/',
src: ['*.html']
}]
},
Expand All @@ -624,7 +637,7 @@ module.exports = function (grunt) {
algorithm: 'sha512',
length: 8,
baseDir: 'dist/',
assets: ['**/*.js', '**/*.css'],
assets: ['src/**/*.js', 'src/**/*.css'],
queryString: true
},
files: [{
Expand Down Expand Up @@ -670,6 +683,7 @@ module.exports = function (grunt) {
'autoprefixer',
'clean:less',
'copy:server',
'copy:serverFilesFromLibs',
'browserify:vendor',
'browserify:clientDevelopment',
'generator',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions assets/less/index.less → src/assets/less/index.less
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Bootstrap Core
// --------------------------------------------------
@import "../../node_modules/bootstrap/less/bootstrap.less";
@import "../../../node_modules/bootstrap/less/bootstrap.less";

// Set path to icon fonts
@icon-font-path: "../../node_modules/bootstrap/fonts/";
@icon-font-path: "../../../node_modules/bootstrap/fonts/";
/**
* --------------------------------------------------
* Here begins our own CSS in the rendered CSS file.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 12 additions & 4 deletions demoElements.hbs → src/demoElements.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -424,16 +424,24 @@ demoElements: active
<h1>Alerts</h1>
</div>
<div class="alert alert-success" role="alert">
<strong>Well done!</strong>You successfully read this important alert message.
<strong>Well done!</strong>
<br>
You successfully read this important alert message.
</div>
<div class="alert alert-info" role="alert">
<strong>Heads up!</strong>This alert needs your attention, but it's not super important.
<strong>Heads up!</strong>
<br>
This alert needs your attention, but it's not super important.
</div>
<div class="alert alert-warning" role="alert">
<strong>Warning!</strong>Best check yo self, you're not looking too good.
<strong>Warning!</strong>
<br>
Best check yo self, you're not looking too good.
</div>
<div class="alert alert-danger" role="alert">
<strong>Oh snap!</strong>Change a few things up and try submitting again.
<strong>Oh snap!</strong>
<br>
Change a few things up and try submitting again.
</div>


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 6b303c2

Please sign in to comment.