├── .eslintrc ├── .gitattributes ├── .gitignore ├── app.js ├── gulpfile.js ├── index.html ├── js └── test.js ├── less ├── base.less └── reset.less └── package.json /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": false, 4 | "node": true, 5 | "es6": true 6 | }, 7 | "rules": { 8 | "no-debugger": 1, // disallow use of debugger 9 | "no-unused-vars": 1, // disallow declaration of variables that are not used in the code 10 | "no-var": 2, // require let or const instead of var 11 | "semi": 2 // require semicolons 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Production 7 | dist 8 | 9 | # Coverage directory used by tools like istanbul 10 | coverage 11 | 12 | # node-waf configuration 13 | .lock-wscript 14 | 15 | # Compiled binary addons (http://nodejs.org/api/addons.html) 16 | build/Release 17 | 18 | # Dependency directories 19 | node_modules 20 | jspm_packages 21 | 22 | # Optional npm cache directory 23 | .npm 24 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const express = require("express"); 4 | const app = express(); 5 | 6 | // Static css/js files 7 | app.use('/static', express.static('./dist')); 8 | 9 | app.get("/", function(req, res) { 10 | res.sendFile( __dirname + '/index.html'); 11 | }); 12 | 13 | 14 | const port = 3001; 15 | 16 | // Start server 17 | app.listen(port, function() { 18 | console.log("Listening on " + port); 19 | }); 20 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | const gulp = require('gulp'); 5 | const concat = require('gulp-concat'); 6 | const less = require('gulp-less'); 7 | const uglify = require('gulp-uglify'); 8 | const minifyCSS = require('gulp-clean-css'); 9 | const del = require('del'); 10 | const shell = require('gulp-shell'); 11 | 12 | /** 13 | * Production css file 14 | * @type {String} 15 | */ 16 | const CSS_DIST = 'main.min.css'; 17 | /** 18 | * Production js file 19 | * @type {String} 20 | */ 21 | const JS_DIST = 'main.min.js'; 22 | /** 23 | * Production folder 24 | * @type {String} 25 | */ 26 | const DIST_FOLDER = './dist/'; 27 | 28 | // Concat js files and uglify/minify them 29 | gulp.task('scripts', function() { 30 | gulp.src(['./js/**/*.js']) 31 | .pipe(concat(JS_DIST)) 32 | .pipe(uglify({mangle: false})) 33 | .pipe(gulp.dest(DIST_FOLDER)); 34 | }); 35 | 36 | // Remove all js files from the production folder 37 | gulp.task('clean-js', function() { 38 | del([`${DIST_FOLDER}*.js`, ]).then(paths => { 39 | paths.length && console.log('Removed:\n', paths.join('\n')); 40 | }); 41 | }); 42 | 43 | // Remove all css files from the production folder 44 | gulp.task('clean-css', function() { 45 | // Your code here 46 | }); 47 | 48 | 49 | gulp.task('build', ['clean-js', 'scripts']); 50 | 51 | gulp.task('deploy', ['build']); 52 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | I'm a blank slate :) 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /js/test.js: -------------------------------------------------------------------------------- 1 | console.log('hello'); 2 | -------------------------------------------------------------------------------- /less/base.less: -------------------------------------------------------------------------------- 1 | @import "reset.less"; 2 | -------------------------------------------------------------------------------- /less/reset.less: -------------------------------------------------------------------------------- 1 | /* http://meyerweb.com/eric/tools/css/reset/ 2 | v2.0 | 20110126 3 | License: none (public domain) 4 | */ 5 | 6 | html, body, div, span, applet, object, iframe, 7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 8 | a, abbr, acronym, address, big, cite, code, 9 | del, dfn, em, img, ins, kbd, q, s, samp, 10 | small, strike, strong, sub, sup, tt, var, 11 | b, u, i, center, 12 | dl, dt, dd, ol, ul, li, 13 | fieldset, form, label, legend, 14 | table, caption, tbody, tfoot, thead, tr, th, td, 15 | article, aside, canvas, details, embed, 16 | figure, figcaption, footer, header, hgroup, 17 | main, menu, nav, output, ruby, section, summary, 18 | time, mark, audio, video { 19 | margin: 0; 20 | padding: 0; 21 | border: 0; 22 | font-size: 100%; 23 | font: inherit; 24 | vertical-align: baseline; 25 | } 26 | /* HTML5 display-role reset for older browsers */ 27 | article, aside, details, figcaption, figure, 28 | footer, header, hgroup, main, menu, nav, section { 29 | display: block; 30 | } 31 | body { 32 | line-height: 1; 33 | } 34 | ol, ul { 35 | list-style: none; 36 | } 37 | blockquote, q { 38 | quotes: none; 39 | &:before, &:after { 40 | content: ''; 41 | content: none; 42 | } 43 | } 44 | table { 45 | border-collapse: collapse; 46 | border-spacing: 0; 47 | } 48 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dev-ops-demo-app", 3 | "version": "1.0.0", 4 | "description": "Demo app for the class Dev Ops for Frontend", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/young/Dev-Ops-for-Frontend.git" 12 | }, 13 | "author": "Jem Young", 14 | "license": "MIT", 15 | "bugs": { 16 | "url": "https://github.com/young/Dev-Ops-for-Frontend/issues" 17 | }, 18 | "homepage": "https://github.com/young/Dev-Ops-for-Frontend#readme", 19 | "dependencies": { 20 | "eslint": "^3.1.1", 21 | "express": "^4.14.0", 22 | "gulp": "^3.9.1", 23 | "gulp-clean-css": "^2.0.11", 24 | "gulp-concat": "^2.6.0", 25 | "gulp-less": "^3.1.0", 26 | "gulp-minify-css": "^1.2.4", 27 | "gulp-shell": "^0.5.2", 28 | "gulp-uglify": "^1.5.4", 29 | "less": "^2.7.1", 30 | "uglify": "^0.1.5" 31 | } 32 | } 33 | --------------------------------------------------------------------------------