Skip to content

Commit

Permalink
gutted most of gruntfile and package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
bmuenzenmeyer committed May 25, 2016
1 parent f1f9f71 commit a6d419f
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 278 deletions.
144 changes: 9 additions & 135 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,167 +1,41 @@
module.exports = function (grunt) {

var path = require('path');

function paths() {
return require('./patternlab-config.json').paths;
}

// Project configuration.
/******************************
* Project configuration.
* Should only be needed if you are developing against core, running tests, linting and want to run tests or increment package numbers
*****************************/
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
stripBanners: true,
banner: '/* \n * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy") %> \n * \n * <%= pkg.author %>, and the web community.\n * Licensed under the <%= pkg.license %> license. \n * \n * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. \n *\n */\n\n',
banner: '/* \n * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy") %> \n * \n * <%= pkg.author.name %>, <%= pkg.contributors[0].name %>, and the web community.\n * Licensed under the <%= pkg.license %> license. \n * \n * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. \n *\n */\n\n',
},
patternlab: {
src: './core/lib/patternlab.js',
dest: './core/lib/patternlab.js'
},
object_factory: {
src: './core/lib/object_factory.js',
dest: './core/lib/object_factory.js'
},
lineage: {
src: './core/lib/lineage_hunter.js',
dest: './core/lib/lineage_hunter.js'
},
media_hunter: {
src: './core/lib/media_hunter.js',
dest: './core/lib/media_hunter.js'
},
patternlab_grunt: {
src: './core/lib/patternlab_grunt.js',
dest: './core/lib/patternlab_grunt.js'
},
patternlab_gulp: {
src: './core/lib/patternlab_gulp.js',
dest: './core/lib/patternlab_gulp.js'
},
parameter_hunter: {
src: './core/lib/parameter_hunter.js',
dest: './core/lib/parameter_hunter.js'
},
pattern_exporter: {
src: './core/lib/pattern_exporter.js',
dest: './core/lib/pattern_exporter.js'
},
pattern_assembler: {
src: './core/lib/pattern_assembler.js',
dest: './core/lib/pattern_assembler.js'
},
pseudopattern_hunter: {
src: './core/lib/pseudopattern_hunter.js',
dest: './core/lib/pseudopattern_hunter.js'
},
list_item_hunter: {
src: './core/lib/list_item_hunter.js',
dest: './core/lib/list_item_hunter.js'
},
style_modifier_hunter: {
src: './core/lib/style_modifier_hunter.js',
dest: './core/lib/style_modifier_hunter.js'
}
},
copy: {
main: {
files: [
{ expand: true, cwd: path.resolve(paths().source.js), src: '*.js', dest: path.resolve(paths().public.js) },
{ expand: true, cwd: path.resolve(paths().source.css), src: '*.css', dest: path.resolve(paths().public.css) },
{ expand: true, cwd: path.resolve(paths().source.images), src: ['**/*.png', '**/*.jpg', '**/*.gif', '**/*.jpeg'], dest: path.resolve(paths().public.images) },
{ expand: true, cwd: path.resolve(paths().source.fonts), src: '*', dest: path.resolve(paths().public.fonts) },
{ expand: true, cwd: path.resolve(paths().source.data), src: 'annotations.js', dest: path.resolve(paths().public.data) }
]
},
styleguide: {
files: [
{ expand: true, cwd: path.resolve(paths().source.styleguide), src: ['*.*', '**/*.*'], dest: path.resolve(paths().public.styleguide) }
]
}
},
watch: {
all: {
files: [
path.resolve(paths().source.css + '**/*.css'),
path.resolve(paths().source.styleguide + 'css/*.css'),
path.resolve(paths().source.patterns + '**/*'),
path.resolve(paths().source.fonts + '/*'),
path.resolve(paths().source.images + '/*'),
path.resolve(paths().source.data + '*.json'),
path.resolve(paths().source.js + '/*.js')
],
tasks: ['default', 'bsReload:css']
}
},
nodeunit: {
all: ['test/*_tests.js']
},
browserSync: {
dev: {
options: {
server: path.resolve(paths().public.root),
watchTask: true,
watchOptions: {
ignoreInitial: true,
ignored: '*.html'
},
snippetOptions: {
// Ignore all HTML files within the templates folder
blacklist: ['/index.html', '/', '/?*']
},
plugins: [
{
module: 'bs-html-injector',
options: {
files: [path.resolve(paths().public.root + '/index.html'), path.resolve(paths().public.styleguide + '/styleguide.html')]
}
}
],
notify: {
styles: [
'display: none',
'padding: 15px',
'font-family: sans-serif',
'position: fixed',
'font-size: 1em',
'z-index: 9999',
'bottom: 0px',
'right: 0px',
'border-top-left-radius: 5px',
'background-color: #1B2032',
'opacity: 0.4',
'margin: 0',
'color: white',
'text-align: center'
]
}
}
}
},
eslint: {
options: {
configFile: './.eslintrc'
},
target: ['./core/lib/*']
},
bsReload: {
css: path.resolve(paths().public.root + '**/*.css')
}
});

// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

//load the patternlab task
require('./core/lib/patternlab_grunt')(grunt);

grunt.registerTask('default', ['patternlab', 'copy:main', 'copy:styleguide']);
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-contrib-nodeunit');

//travis CI task
grunt.registerTask('travis', ['nodeunit', 'eslint']);

grunt.registerTask('serve', ['patternlab', 'copy:main', 'copy:styleguide', 'browserSync', 'watch:all']);

//to be run prior to releasing a version
grunt.registerTask('build', ['nodeunit', 'eslint', 'concat']);

};
10 changes: 0 additions & 10 deletions core/lib/lineage_hunter.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/*
* patternlab-node - v1.3.0 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
*
*/

"use strict";

var lineage_hunter = function () {
Expand Down
10 changes: 0 additions & 10 deletions core/lib/list_item_hunter.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/*
* patternlab-node - v1.3.0 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
*
*/

"use strict";

var list_item_hunter = function () {
Expand Down
10 changes: 0 additions & 10 deletions core/lib/media_hunter.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/*
* patternlab-node - v1.3.0 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
*
*/

"use strict";

var diveSync = require('diveSync'),
Expand Down
10 changes: 0 additions & 10 deletions core/lib/object_factory.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/*
* patternlab-node - v1.3.0 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
*
*/

"use strict";

var patternEngines = require('./pattern_engines/pattern_engines');
Expand Down
10 changes: 0 additions & 10 deletions core/lib/parameter_hunter.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/*
* patternlab-node - v1.3.0 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
*
*/

"use strict";

var parameter_hunter = function () {
Expand Down
11 changes: 0 additions & 11 deletions core/lib/pattern_assembler.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
/*
* patternlab-node - v1.3.0 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
*
*/


"use strict";

var pattern_assembler = function () {
Expand Down
10 changes: 0 additions & 10 deletions core/lib/pattern_exporter.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/*
* patternlab-node - v1.3.0 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
*
*/

"use strict";

var fs = require('fs-extra');
Expand Down
16 changes: 9 additions & 7 deletions core/lib/patternlab.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/*
* patternlab-node - v1.3.0 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
/*
* patternlab-node - v2.0.0 - 2016
*
* Brian Muenzenmeyer, Geoff Pursell, and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
*
*/

"use strict";

var diveSync = require('diveSync'),
path = require('path');

Expand Down
10 changes: 1 addition & 9 deletions core/lib/patternlab_grunt.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
/*
* patternlab-node - v1.3.0 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
*
*/
"use strict";

var patternlab_engine = require('./patternlab.js');

Expand Down
10 changes: 1 addition & 9 deletions core/lib/patternlab_gulp.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
/*
* patternlab-node - v1.3.0 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
*
*/
"use strict";

var patternlab_engine = require('./patternlab.js');

Expand Down
12 changes: 1 addition & 11 deletions core/lib/pseudopattern_hunter.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/*
* patternlab-node - v1.3.0 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
*
*/

"use strict";

var pseudopattern_hunter = function () {
Expand Down Expand Up @@ -46,7 +36,7 @@ var pseudopattern_hunter = function () {

//extend any existing data with variant data
variantFileData = plutils.mergeData(currentPattern.jsonFileData, variantFileData);

var variantName = pseudoPatterns[i].substring(pseudoPatterns[i].indexOf('~') + 1).split('.')[0];
var variantFilePath = path.join(currentPattern.subdir, currentPattern.fileName + '~' + variantName + '.json');
var patternVariant = Pattern.create(variantFilePath, variantFileData, {
Expand Down
10 changes: 0 additions & 10 deletions core/lib/style_modifier_hunter.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/*
* patternlab-node - v1.3.0 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
*
*/

"use strict";

var style_modifier_hunter = function () {
Expand Down
10 changes: 0 additions & 10 deletions core/lib/ui_builder.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/*
* patternlab-node - v1.2.0 - 2016
*
* Brian Muenzenmeyer, Geoffrey Pursell, and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
*
*/

"use strict";

var path = require('path');
Expand Down
10 changes: 1 addition & 9 deletions core/lib/utilities.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
/*
* patternlab-node - v0.14.0 - 2015
*
* Brian Muenzenmeyer, Geoffrey Pursell and the web community.
* Licensed under the MIT license.
*
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
*
*/
"use strict";

var util = {
// http://stackoverflow.com/questions/6274339/how-can-i-shuffle-an-array-in-javascript
Expand Down
Loading

0 comments on commit a6d419f

Please sign in to comment.