Skip to content

Commit

Permalink
Merge pull request #370 from pattern-lab/dev
Browse files Browse the repository at this point in the history
PL/Node 2.0.0
  • Loading branch information
Brian Muenzenmeyer authored Jun 21, 2016
2 parents d019a8d + 2d1070b commit 456183e
Show file tree
Hide file tree
Showing 211 changed files with 3,589 additions and 20,398 deletions.
4 changes: 2 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"eqeqeq": [2, "allow-null"],
"global-strict": [0, "never"],
"guard-for-in": 2,
"indent": [2, 2, {"SwitchCase": 1, "VariableDeclarator": 1}],
"lines-around-comment": [2, {
"indent": [1, 2, {"SwitchCase": 1, "VariableDeclarator": 1}],
"lines-around-comment": [1, {
"beforeBlockComment": true,
"beforeLineComment": true,
"allowBlockStart": true,
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules/
npm-debug.log
.DS_Store
latest-change.txt
patternlab.json
Expand Down
17 changes: 13 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
language: node_js

node_js:
- stable
- 4.0
- 0.12
- 0.11
- node
- 6
- 5
- 4

before_install:
- phantomjs --version
Expand All @@ -16,3 +16,12 @@ branches:
only:
- master
- dev
- dev-2.0-core

notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/a14f537f16b0756d9470
on_success: always
on_failure: always
on_start: never
147 changes: 10 additions & 137 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,168 +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 + '**/*.mustache'),
path.resolve(paths().source.patterns + '**/*.json'),
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
grunt.task.loadTasks('./core/lib/');

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', 'patternlab']);

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

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

};
Loading

0 comments on commit 456183e

Please sign in to comment.