-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 38c0b41
Showing
25 changed files
with
1,713 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory": "app/bower_components" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
|
||
[*] | ||
|
||
# Change these settings to your own preference | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# We recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
dist | ||
test/temp | ||
.sass-cache | ||
app/bower_components | ||
.tmp | ||
test/bower_components/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"node": true, | ||
"browser": true, | ||
"esnext": true, | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 2, | ||
"latedef": true, | ||
"noarg": true, | ||
"quotmark": "single", | ||
"regexp": true, | ||
"undef": true, | ||
"unused": true, | ||
"strict": true, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"jquery": true, | ||
"globals": { | ||
"wrap": true, | ||
"unwrap": true, | ||
"Polymer": true, | ||
"Platform": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"generator-polymer": { | ||
"includeSass": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,303 @@ | ||
'use strict'; | ||
var LIVERELOAD_PORT = 35729; | ||
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT}); | ||
var mountFolder = function (connect, dir) { | ||
return connect.static(require('path').resolve(dir)); | ||
}; | ||
|
||
// # Globbing | ||
// for performance reasons we're only matching one level down: | ||
// 'test/spec/{,*/}*.js' | ||
// use this if you want to match all subfolders: | ||
// 'test/spec/**/*.js' | ||
|
||
module.exports = function (grunt) { | ||
// show elapsed time at the end | ||
require('time-grunt')(grunt); | ||
// load all grunt tasks | ||
require('load-grunt-tasks')(grunt); | ||
|
||
// configurable paths | ||
var yeomanConfig = { | ||
app: 'app', | ||
dist: 'dist' | ||
}; | ||
|
||
grunt.initConfig({ | ||
yeoman: yeomanConfig, | ||
watch: { | ||
options: { | ||
nospawn: true, | ||
livereload: { liveCSS: false } | ||
}, | ||
livereload: { | ||
options: { | ||
livereload: true | ||
}, | ||
files: [ | ||
'<%= yeoman.app %>/*.html', | ||
'<%= yeoman.app %>/elements/{,*/}*.html', | ||
'{.tmp,<%= yeoman.app %>}/elements/{,*/}*.css', | ||
'{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css', | ||
'{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js', | ||
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}' | ||
] | ||
}, | ||
js: { | ||
files: ['<%= yeoman.app %>/scripts/{,*/}*.js'], | ||
tasks: ['jshint'] | ||
}, | ||
styles: { | ||
files: [ | ||
'<%= yeoman.app %>/styles/{,*/}*.css', | ||
'<%= yeoman.app %>/elements/{,*/}*.css' | ||
], | ||
tasks: ['copy:styles', 'autoprefixer:server'] | ||
} | ||
}, | ||
autoprefixer: { | ||
options: { | ||
browsers: ['last 2 versions'] | ||
}, | ||
server: { | ||
files: [{ | ||
expand: true, | ||
cwd: '.tmp', | ||
src: '**/*.css', | ||
dest: '.tmp' | ||
}] | ||
}, | ||
dist: { | ||
files: [{ | ||
expand: true, | ||
cwd: '<%= yeoman.dist %>', | ||
src: ['**/*.css', '!bower_components/**/*.css'], | ||
dest: '<%= yeoman.dist %>' | ||
}] | ||
} | ||
}, | ||
connect: { | ||
options: { | ||
port: 9000, | ||
// change this to '0.0.0.0' to access the server from outside | ||
hostname: 'localhost' | ||
}, | ||
livereload: { | ||
options: { | ||
middleware: function (connect) { | ||
return [ | ||
lrSnippet, | ||
mountFolder(connect, '.tmp'), | ||
mountFolder(connect, yeomanConfig.app) | ||
]; | ||
} | ||
} | ||
}, | ||
test: { | ||
options: { | ||
open: { | ||
target: 'http://localhost:<%= connect.options.port %>/test' | ||
}, | ||
middleware: function (connect) { | ||
return [ | ||
mountFolder(connect, yeomanConfig.app) | ||
]; | ||
}, | ||
keepalive: true | ||
} | ||
}, | ||
dist: { | ||
options: { | ||
middleware: function (connect) { | ||
return [ | ||
mountFolder(connect, yeomanConfig.dist) | ||
]; | ||
} | ||
} | ||
} | ||
}, | ||
open: { | ||
server: { | ||
path: 'http://localhost:<%= connect.options.port %>' | ||
} | ||
}, | ||
clean: { | ||
dist: ['.tmp', '<%= yeoman.dist %>/*'], | ||
server: '.tmp' | ||
}, | ||
jshint: { | ||
options: { | ||
jshintrc: '.jshintrc', | ||
reporter: require('jshint-stylish') | ||
}, | ||
all: [ | ||
'<%= yeoman.app %>/scripts/{,*/}*.js', | ||
'!<%= yeoman.app %>/scripts/vendor/*', | ||
'test/spec/{,*/}*.js' | ||
] | ||
}, | ||
useminPrepare: { | ||
html: '<%= yeoman.app %>/index.html', | ||
options: { | ||
dest: '<%= yeoman.dist %>' | ||
} | ||
}, | ||
usemin: { | ||
html: ['<%= yeoman.dist %>/{,*/}*.html'], | ||
css: ['<%= yeoman.dist %>/styles/{,*/}*.css'], | ||
options: { | ||
dirs: ['<%= yeoman.dist %>'], | ||
blockReplacements: { | ||
vulcanized: function (block) { | ||
return '<link rel="import" href="' + block.dest + '">'; | ||
} | ||
} | ||
} | ||
}, | ||
vulcanize: { | ||
default: { | ||
options: { | ||
strip: true | ||
}, | ||
files: { | ||
'<%= yeoman.dist %>/elements/elements.vulcanized.html': [ | ||
'<%= yeoman.dist %>/elements/elements.html' | ||
] | ||
} | ||
} | ||
}, | ||
imagemin: { | ||
dist: { | ||
files: [{ | ||
expand: true, | ||
cwd: '<%= yeoman.app %>/images', | ||
src: '{,*/}*.{png,jpg,jpeg}', | ||
dest: '<%= yeoman.dist %>/images' | ||
}] | ||
} | ||
}, | ||
cssmin: { | ||
main: { | ||
files: { | ||
'<%= yeoman.dist %>/styles/main.css': [ | ||
'.tmp/concat/styles/{,*/}*.css' | ||
] | ||
} | ||
}, | ||
elements: { | ||
files: [{ | ||
expand: true, | ||
cwd: '.tmp/elements', | ||
src: '{,*/}*.css', | ||
dest: '<%= yeoman.dist %>/elements' | ||
}] | ||
} | ||
}, | ||
minifyHtml: { | ||
options: { | ||
quotes: true, | ||
empty: true | ||
}, | ||
app: { | ||
files: [{ | ||
expand: true, | ||
cwd: '<%= yeoman.dist %>', | ||
src: '*.html', | ||
dest: '<%= yeoman.dist %>' | ||
}] | ||
} | ||
}, | ||
copy: { | ||
dist: { | ||
files: [{ | ||
expand: true, | ||
dot: true, | ||
cwd: '<%= yeoman.app %>', | ||
dest: '<%= yeoman.dist %>', | ||
src: [ | ||
'*.{ico,txt}', | ||
'.htaccess', | ||
'*.html', | ||
'elements/**', | ||
'!elements/**/*.css', | ||
'images/{,*/}*.{webp,gif}', | ||
'bower_components/**' | ||
] | ||
}] | ||
}, | ||
styles: { | ||
files: [{ | ||
expand: true, | ||
cwd: '<%= yeoman.app %>', | ||
dest: '.tmp', | ||
src: ['{styles,elements}/{,*/}*.css'] | ||
}] | ||
} | ||
}, | ||
// See this tutorial if you'd like to run PageSpeed | ||
// against localhost: http://www.jamescryer.com/2014/06/12/grunt-pagespeed-and-ngrok-locally-testing/ | ||
pagespeed: { | ||
options: { | ||
// By default, we use the PageSpeed Insights | ||
// free (no API key) tier. You can use a Google | ||
// Developer API key if you have one. See | ||
// http://goo.gl/RkN0vE for info | ||
nokey: true | ||
}, | ||
// Update `url` below to the public URL for your site | ||
mobile: { | ||
options: { | ||
url: "https://developers.google.com/web/fundamentals/", | ||
locale: "en_GB", | ||
strategy: "mobile", | ||
threshold: 80 | ||
} | ||
} | ||
} | ||
}); | ||
|
||
grunt.registerTask('server', function (target) { | ||
grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.'); | ||
grunt.task.run(['serve:' + target]); | ||
}); | ||
|
||
grunt.registerTask('serve', function (target) { | ||
if (target === 'dist') { | ||
return grunt.task.run(['build', 'open', 'connect:dist:keepalive']); | ||
} | ||
|
||
grunt.task.run([ | ||
'clean:server', | ||
'copy:styles', | ||
'autoprefixer:server', | ||
'connect:livereload', | ||
'open', | ||
'watch' | ||
]); | ||
}); | ||
|
||
grunt.registerTask('test', [ | ||
'clean:server', | ||
'connect:test' | ||
]); | ||
|
||
grunt.registerTask('build', [ | ||
'clean:dist', | ||
'copy', | ||
'useminPrepare', | ||
'imagemin', | ||
'concat', | ||
'autoprefixer', | ||
'uglify', | ||
'cssmin', | ||
'vulcanize', | ||
'usemin', | ||
'minifyHtml' | ||
]); | ||
|
||
grunt.registerTask('default', [ | ||
'jshint', | ||
// 'test' | ||
'build' | ||
]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Polymer + Firebase Q&A | ||
|
||
A simple Q&A app built with Polymer and Firebase. | ||
|
||
## Running Locally | ||
|
||
npm install && bower install | ||
grunt serve |
Oops, something went wrong.