diff --git a/assets/petclinic/.bowerrc b/assets/petclinic/.bowerrc new file mode 100644 index 000000000..69fad3580 --- /dev/null +++ b/assets/petclinic/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "bower_components" +} diff --git a/assets/petclinic/.editorconfig b/assets/petclinic/.editorconfig new file mode 100644 index 000000000..c2cdfb8ad --- /dev/null +++ b/assets/petclinic/.editorconfig @@ -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 diff --git a/assets/petclinic/.gitattributes b/assets/petclinic/.gitattributes new file mode 100644 index 000000000..212566614 --- /dev/null +++ b/assets/petclinic/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/assets/petclinic/.gitignore b/assets/petclinic/.gitignore new file mode 100644 index 000000000..a22a4583c --- /dev/null +++ b/assets/petclinic/.gitignore @@ -0,0 +1,5 @@ +node_modules +dist +.tmp +.sass-cache +bower_components diff --git a/assets/petclinic/.jshintrc b/assets/petclinic/.jshintrc new file mode 100644 index 000000000..e0e07301b --- /dev/null +++ b/assets/petclinic/.jshintrc @@ -0,0 +1,21 @@ +{ + "node": true, + "browser": true, + "esnext": true, + "bitwise": true, + "camelcase": true, + "curly": true, + "eqeqeq": true, + "immed": true, + "indent": 2, + "latedef": true, + "newcap": true, + "noarg": true, + "quotmark": "single", + "undef": true, + "unused": true, + "strict": true, + "trailing": true, + "smarttabs": true, + "jquery": true +} diff --git a/assets/petclinic/.yo-rc.json b/assets/petclinic/.yo-rc.json new file mode 100644 index 000000000..7a2135249 --- /dev/null +++ b/assets/petclinic/.yo-rc.json @@ -0,0 +1,3 @@ +{ + "generator-mocha": {} +} \ No newline at end of file diff --git a/assets/petclinic/Gruntfile.js b/assets/petclinic/Gruntfile.js new file mode 100644 index 000000000..2610b908c --- /dev/null +++ b/assets/petclinic/Gruntfile.js @@ -0,0 +1,426 @@ +// Generated on 2015-01-19 using +// generator-webapp 0.5.1 +'use strict'; + +// # Globbing +// for performance reasons we're only matching one level down: +// 'test/spec/{,*/}*.js' +// If you want to recursively match all subfolders, use: +// 'test/spec/**/*.js' + +module.exports = function (grunt) { + + // Time how long tasks take. Can help when optimizing build times + require('time-grunt')(grunt); + + // Load grunt tasks automatically + require('load-grunt-tasks')(grunt); + + // Configurable paths + var config = { + app: 'app', + dist: 'dist' + }; + + // Define the configuration for all the tasks + grunt.initConfig({ + + // Project settings + config: config, + + // Watches files for changes and runs tasks based on the changed files + watch: { + bower: { + files: ['bower.json'], + tasks: ['wiredep'] + }, + js: { + files: ['<%= config.app %>/scripts/{,*/}*.js'], + tasks: ['jshint'], + options: { + livereload: true + } + }, + jstest: { + files: ['test/spec/{,*/}*.js'], + tasks: ['test:watch'] + }, + gruntfile: { + files: ['Gruntfile.js'] + }, + sass: { + files: ['<%= config.app %>/styles/{,*/}*.{scss,sass}'], + tasks: ['sass:server', 'autoprefixer'] + }, + styles: { + files: ['<%= config.app %>/styles/{,*/}*.css'], + tasks: ['newer:copy:styles', 'autoprefixer'] + }, + livereload: { + options: { + livereload: '<%= connect.options.livereload %>' + }, + files: [ + '<%= config.app %>/{,*/}*.html', + '.tmp/styles/{,*/}*.css', + '<%= config.app %>/images/{,*/}*' + ] + } + }, + + // The actual grunt server settings + connect: { + options: { + port: 9000, + open: true, + livereload: 35729, + // Change this to '0.0.0.0' to access the server from outside + hostname: 'localhost' + }, + livereload: { + options: { + middleware: function(connect) { + return [ + connect.static('.tmp'), + connect().use('/bower_components', connect.static('./bower_components')), + connect.static(config.app) + ]; + } + } + }, + test: { + options: { + open: false, + port: 9001, + middleware: function(connect) { + return [ + connect.static('.tmp'), + connect.static('test'), + connect().use('/bower_components', connect.static('./bower_components')), + connect.static(config.app) + ]; + } + } + }, + dist: { + options: { + base: '<%= config.dist %>', + livereload: false + } + } + }, + + // Empties folders to start fresh + clean: { + dist: { + files: [{ + dot: true, + src: [ + '.tmp', + '<%= config.dist %>/*', + '!<%= config.dist %>/.git*' + ] + }] + }, + server: '.tmp' + }, + + // Make sure code styles are up to par and there are no obvious mistakes + jshint: { + options: { + jshintrc: '.jshintrc', + reporter: require('jshint-stylish') + }, + all: [ + 'Gruntfile.js', + '<%= config.app %>/scripts/{,*/}*.js', + '!<%= config.app %>/scripts/vendor/*', + 'test/spec/{,*/}*.js' + ] + }, + + // Mocha testing framework configuration options + mocha: { + all: { + options: { + run: true, + urls: ['http://<%= connect.test.options.hostname %>:<%= connect.test.options.port %>/index.html'] + } + } + }, + + // Compiles Sass to CSS and generates necessary files if requested + sass: { + options: { + sourceMap: true, + includePaths: ['bower_components'] + }, + dist: { + files: [{ + expand: true, + cwd: '<%= config.app %>/styles', + src: ['*.{scss,sass}'], + dest: '.tmp/styles', + ext: '.css' + }] + }, + server: { + files: [{ + expand: true, + cwd: '<%= config.app %>/styles', + src: ['*.{scss,sass}'], + dest: '.tmp/styles', + ext: '.css' + }] + } + }, + + // Add vendor prefixed styles + autoprefixer: { + options: { + browsers: ['> 1%', 'last 2 versions', 'Firefox ESR', 'Opera 12.1'] + }, + dist: { + files: [{ + expand: true, + cwd: '.tmp/styles/', + src: '{,*/}*.css', + dest: '.tmp/styles/' + }] + } + }, + + // Automatically inject Bower components into the HTML file + wiredep: { + app: { + ignorePath: /^\/|\.\.\//, + src: ['<%= config.app %>/index.html'], + exclude: ['bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js'] + }, + sass: { + src: ['<%= config.app %>/styles/{,*/}*.{scss,sass}'], + ignorePath: /(\.\.\/){1,2}bower_components\// + } + }, + + // Renames files for browser caching purposes + rev: { + dist: { + files: { + src: [ + '<%= config.dist %>/scripts/{,*/}*.js', + '<%= config.dist %>/styles/{,*/}*.css', + '<%= config.dist %>/images/{,*/}*.*', + '<%= config.dist %>/styles/fonts/{,*/}*.*', + '<%= config.dist %>/*.{ico,png}' + ] + } + } + }, + + // Reads HTML for usemin blocks to enable smart builds that automatically + // concat, minify and revision files. Creates configurations in memory so + // additional tasks can operate on them + useminPrepare: { + options: { + dest: '<%= config.dist %>' + }, + html: '<%= config.app %>/index.html' + }, + + // Performs rewrites based on rev and the useminPrepare configuration + usemin: { + options: { + assetsDirs: [ + '<%= config.dist %>', + '<%= config.dist %>/images', + '<%= config.dist %>/styles' + ] + }, + html: ['<%= config.dist %>/{,*/}*.html'], + css: ['<%= config.dist %>/styles/{,*/}*.css'] + }, + + // The following *-min tasks produce minified files in the dist folder + imagemin: { + dist: { + files: [{ + expand: true, + cwd: '<%= config.app %>/images', + src: '{,*/}*.{gif,jpeg,jpg,png}', + dest: '<%= config.dist %>/images' + }] + } + }, + + svgmin: { + dist: { + files: [{ + expand: true, + cwd: '<%= config.app %>/images', + src: '{,*/}*.svg', + dest: '<%= config.dist %>/images' + }] + } + }, + + htmlmin: { + dist: { + options: { + collapseBooleanAttributes: true, + collapseWhitespace: true, + conservativeCollapse: true, + removeAttributeQuotes: true, + removeCommentsFromCDATA: true, + removeEmptyAttributes: true, + removeOptionalTags: true, + removeRedundantAttributes: true, + useShortDoctype: true + }, + files: [{ + expand: true, + cwd: '<%= config.dist %>', + src: '{,*/}*.html', + dest: '<%= config.dist %>' + }] + } + }, + + // By default, your `index.html`'s will take care + // of minification. These next options are pre-configured if you do not + // wish to use the Usemin blocks. + // cssmin: { + // dist: { + // files: { + // '<%= config.dist %>/styles/main.css': [ + // '.tmp/styles/{,*/}*.css', + // '<%= config.app %>/styles/{,*/}*.css' + // ] + // } + // } + // }, + // uglify: { + // dist: { + // files: { + // '<%= config.dist %>/scripts/scripts.js': [ + // '<%= config.dist %>/scripts/scripts.js' + // ] + // } + // } + // }, + // concat: { + // dist: {} + // }, + + // Copies remaining files to places other tasks can use + copy: { + dist: { + files: [{ + expand: true, + dot: true, + cwd: '<%= config.app %>', + dest: '<%= config.dist %>', + src: [ + '*.{ico,png,txt}', + 'images/{,*/}*.webp', + '{,*/}*.html', + 'styles/fonts/{,*/}*.*' + ] + }, { + src: 'node_modules/apache-server-configs/dist/.htaccess', + dest: '<%= config.dist %>/.htaccess' + }, { + expand: true, + dot: true, + cwd: '.', + src: 'bower_components/bootstrap-sass-official/assets/fonts/bootstrap/*', + dest: '<%= config.dist %>' + }] + }, + styles: { + expand: true, + dot: true, + cwd: '<%= config.app %>/styles', + dest: '.tmp/styles/', + src: '{,*/}*.css' + } + }, + + // Run some tasks in parallel to speed up build process + concurrent: { + server: [ + 'sass:server', + 'copy:styles' + ], + test: [ + 'copy:styles' + ], + dist: [ + 'sass', + 'copy:styles', + 'imagemin', + 'svgmin' + ] + } + }); + + + grunt.registerTask('serve', 'start the server and preview your app, --allow-remote for remote access', function (target) { + if (grunt.option('allow-remote')) { + grunt.config.set('connect.options.hostname', '0.0.0.0'); + } + if (target === 'dist') { + return grunt.task.run(['build', 'connect:dist:keepalive']); + } + + grunt.task.run([ + 'clean:server', + 'wiredep', + 'concurrent:server', + 'autoprefixer', + 'connect:livereload', + 'watch' + ]); + }); + + grunt.registerTask('server', function (target) { + grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.'); + grunt.task.run([target ? ('serve:' + target) : 'serve']); + }); + + grunt.registerTask('test', function (target) { + if (target !== 'watch') { + grunt.task.run([ + 'clean:server', + 'concurrent:test', + 'autoprefixer' + ]); + } + + grunt.task.run([ + 'connect:test', + 'mocha' + ]); + }); + + grunt.registerTask('build', [ + 'clean:dist', + 'wiredep', + 'useminPrepare', + 'concurrent:dist', + 'autoprefixer', + 'concat', + 'cssmin', + 'uglify', + 'copy:dist', + 'rev', + 'usemin', + 'htmlmin' + ]); + + grunt.registerTask('default', [ + 'newer:jshint', + 'test', + 'build' + ]); +}; diff --git a/assets/petclinic/app/favicon.ico b/assets/petclinic/app/favicon.ico new file mode 100644 index 000000000..652790530 Binary files /dev/null and b/assets/petclinic/app/favicon.ico differ diff --git a/assets/petclinic/app/index.html b/assets/petclinic/app/index.html new file mode 100644 index 000000000..c891a6fa2 --- /dev/null +++ b/assets/petclinic/app/index.html @@ -0,0 +1,115 @@ + + + + + petclinic + + + + + + + + + + + + + + + + + + +
+
+

Hello, world!

+

This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.

+

Learn more »

+
+
+ +
+ +
+
+

Heading

+

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

+

View details »

+
+
+

Heading

+

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

+

View details »

+
+
+

Heading

+

Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

+

View details »

+
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/petclinic/app/robots.txt b/assets/petclinic/app/robots.txt new file mode 100644 index 000000000..ee2cc216a --- /dev/null +++ b/assets/petclinic/app/robots.txt @@ -0,0 +1,3 @@ +# robotstxt.org/ + +User-agent: * diff --git a/assets/petclinic/app/scripts/main.js b/assets/petclinic/app/scripts/main.js new file mode 100644 index 000000000..20ca76d62 --- /dev/null +++ b/assets/petclinic/app/scripts/main.js @@ -0,0 +1 @@ +console.log('\'Allo \'Allo!'); \ No newline at end of file diff --git a/assets/petclinic/app/styles/main.scss b/assets/petclinic/app/styles/main.scss new file mode 100644 index 000000000..27d2fdef1 --- /dev/null +++ b/assets/petclinic/app/styles/main.scss @@ -0,0 +1,70 @@ +$icon-font-path: "../bower_components/bootstrap-sass-official/assets/fonts/bootstrap/"; +// bower:scss +@import "bootstrap-sass-official/assets/stylesheets/_bootstrap.scss"; +// endbower + +.browsehappy { + margin: 0.2em 0; + background: #ccc; + color: #000; + padding: 0.2em 0; +} + +/* Space out content a bit */ +body { + padding-top: 51px; +} + +/* Everything but the jumbotron gets side spacing for mobile first views */ +.header, +.marketing, +.footer { + padding-left: 15px; + padding-right: 15px; +} + +/* Custom page header */ +.header { + border-bottom: 1px solid #e5e5e5; + + /* Make the masthead heading the same height as the navigation */ + h3 { + margin-top: 0; + margin-bottom: 0; + line-height: 40px; + padding-bottom: 19px; + } +} + +/* Custom page footer */ +.footer { + padding-top: 19px; + color: #777; + border-top: 1px solid #e5e5e5; +} + +.container-narrow > hr { + margin: 30px 0; +} + +/* Main marketing message and sign up button */ +.jumbotron { + text-align: center; + border-bottom: 1px solid #e5e5e5; + .btn { + font-size: 21px; + padding: 14px 24px; + } +} + +/* Supporting marketing content */ +.marketing { + margin: 40px 0; + p + h4 { + margin-top: 28px; + } +} + +/* Responsive: Portrait tablets and up */ +@media screen and (min-width: 768px) { +} diff --git a/assets/petclinic/bower.json b/assets/petclinic/bower.json new file mode 100644 index 000000000..649f47d5a --- /dev/null +++ b/assets/petclinic/bower.json @@ -0,0 +1,7 @@ +{ + "name": "petclinic", + "private": true, + "dependencies": { + "bootstrap-sass-official": "~3.2.0" + } +} \ No newline at end of file diff --git a/assets/petclinic/package.json b/assets/petclinic/package.json new file mode 100644 index 000000000..e38a4f515 --- /dev/null +++ b/assets/petclinic/package.json @@ -0,0 +1,32 @@ +{ + "name": "petclinic", + "devDependencies": { + "apache-server-configs": "^2.7.1", + "grunt": "^0.4.5", + "grunt-autoprefixer": "^1.0.0", + "grunt-concurrent": "^0.5.0", + "grunt-contrib-clean": "^0.6.0", + "grunt-contrib-concat": "^0.5.0", + "grunt-contrib-connect": "^0.8.0", + "grunt-contrib-copy": "^0.5.0", + "grunt-contrib-cssmin": "^0.10.0", + "grunt-contrib-htmlmin": "^0.3.0", + "grunt-contrib-imagemin": "^0.8.0", + "grunt-contrib-jshint": "^0.10.0", + "grunt-contrib-uglify": "^0.5.1", + "grunt-contrib-watch": "^0.6.1", + "grunt-mocha": "^0.4.10", + "grunt-newer": "^0.7.0", + "grunt-rev": "^0.1.0", + "grunt-sass": "^0.14.0", + "grunt-svgmin": "^0.4.0", + "grunt-usemin": "^2.3.0", + "grunt-wiredep": "^1.7.0", + "jshint-stylish": "^0.4.0", + "load-grunt-tasks": "^0.4.0", + "time-grunt": "^0.4.0" + }, + "engines": { + "node": ">=0.10.0" + } +} diff --git a/assets/petclinic/test/.bowerrc b/assets/petclinic/test/.bowerrc new file mode 100644 index 000000000..44491d3df --- /dev/null +++ b/assets/petclinic/test/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "bower_components" +} diff --git a/assets/petclinic/test/bower.json b/assets/petclinic/test/bower.json new file mode 100644 index 000000000..0798eb592 --- /dev/null +++ b/assets/petclinic/test/bower.json @@ -0,0 +1,9 @@ +{ + "name": "petclinic", + "private": true, + "dependencies": { + "chai": "~1.8.0", + "mocha": "~1.14.0" + }, + "devDependencies": {} +} diff --git a/assets/petclinic/test/index.html b/assets/petclinic/test/index.html new file mode 100644 index 000000000..d10cee026 --- /dev/null +++ b/assets/petclinic/test/index.html @@ -0,0 +1,26 @@ + + + + + Mocha Spec Runner + + + +
+ + + + + + + + + + + + + diff --git a/assets/petclinic/test/spec/test.js b/assets/petclinic/test/spec/test.js new file mode 100644 index 000000000..acbc11a4c --- /dev/null +++ b/assets/petclinic/test/spec/test.js @@ -0,0 +1,13 @@ +/* global describe, it */ + +(function () { + 'use strict'; + + describe('Give it some context', function () { + describe('maybe a bit more context here', function () { + it('should run here few assertions', function () { + + }); + }); + }); +})();