Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

James, Peter and Sredna (FINAL) #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
build

# Compiled Public Directory
public
2 changes: 0 additions & 2 deletions gulpfile.js → Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
for creating multiple tasks, each task has been broken out into
its own file in gulp/tasks. Any files in that directory get
automatically required below.

To add a new task, simply add a new task file that directory.
gulp/tasks/default.js specifies the default set of tasks to run
when you run `gulp`.
Expand All @@ -15,4 +14,3 @@ var requireDir = require('require-dir');

// Require all tasks in gulp/tasks, including subfolders
requireDir('./gulp/tasks', { recurse: true });

45 changes: 0 additions & 45 deletions README.md

This file was deleted.

15 changes: 15 additions & 0 deletions assignment-rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Rules for this assignment

Please be sure to read carefully as this will be crucial for achieving the goals for this week's assignment project.

1. I expect everyone to show up or be with their pair partner as soon as possible in the morning to review and start on the project, there is A LOT to do
1. Fork the assignment repo directly, no cross forking this time
1. Once someone has forked the repo, create the PR right away
1. Give the PR a proper title and place `(wip)` in the title
1. You can keep making updates to the `master` branch and push that to your repo, the PR will keep updating
1. DO NOT submit a feature branch to the PR, only submit `master`
1. Work in your feature branches and commit often until you are ready to merge in the code from the feature branch to `master` and the owner of the
1. In the PR, please be sure to write up a description of the project you are completing and submit the PR
1. This will be the only PR that is used throughout this week's assignment
1. For the final assignment submission, update the PR title to remove `(wip)` and use `(final)`. Pushes to `master` after the title has been updated will be ignored, make sure you are done before you say you are done.
1. Make sure to submit the URL of the PR to Canvas for final grading
41 changes: 24 additions & 17 deletions gulp/config.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,39 +1,46 @@
var dest = "./build";
var dest = "./public";
var src = './src';

module.exports = {
javascript: {
src: src + '/js/**/*.js',
src: src + '/app/**/*.js',
dest: dest + '/js/',
entry: src + '/js/app.js',
outputFilename: 'app.js'
},
assets: {
src: src + "/assets/**/*",
dest: dest + '/assets/'
entryPoint: src + '/app/entry.js',
packedFile: 'packed.js'
},
sass: {
src: src + "/css/**/*.{sass,scss}",
dest: dest + '/css/',
src: src + "/styles/**/*.{sass,scss}",
dest: dest + '/styles/',
settings: {
indentedSyntax: true, // Enable .sass syntax!
}
},
html: {
src: src + '/**/*.html',
fonts: {
src: src + '/styles/fonts/*',
dest: dest + "/styles/fonts/",
extensions: ['woff2', 'woff', 'eot', 'ttf', 'svg']
},
index: {
src: src + "/index.html",
dest: dest
},
html: {
src: src + "/app/**/*.html",
dest: dest + "/views/"
},
server: {
src: dest,
livereload: true,
livereload: false,
directoryListing: false,
open: false,
port: 9000
},
ngConfig: {
dest: dest + '/js',
},
production: {
cssSrc: dest + '/css/*.css',
jsSrc: dest + '/js/*.js',
cssDest: dest + '/css/',
jsDest: dest + '/js/',
cssSrc: dest + '/styles/*.css',
jsSrc: dest + '/*.js',
dest: dest
}
};
9 changes: 0 additions & 9 deletions gulp/tasks/assets.js

This file was deleted.

3 changes: 1 addition & 2 deletions gulp/tasks/default.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var gulp = require('gulp');

gulp.task('default', ['sass', 'markup', 'webpack', 'watch', 'serve']);

gulp.task('default', ['sass', 'fonts', 'ngConfig', 'index', 'html', 'webpack', 'watch', 'serve']);
7 changes: 7 additions & 0 deletions gulp/tasks/fonts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var gulp = require("gulp");
var config = require('../config').fonts;

gulp.task('fonts', function() {
return gulp.src(config.src)
.pipe(gulp.dest(config.dest));
});
7 changes: 7 additions & 0 deletions gulp/tasks/html.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var gulp = require("gulp");
var config = require('../config').html;

gulp.task('html', function() {
return gulp.src(config.src)
.pipe(gulp.dest(config.dest));
});
7 changes: 7 additions & 0 deletions gulp/tasks/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var gulp = require("gulp");
var config = require('../config').index;

gulp.task('index', function() {
return gulp.src(config.src)
.pipe(gulp.dest(config.dest));
});
7 changes: 0 additions & 7 deletions gulp/tasks/javascript.js

This file was deleted.

8 changes: 0 additions & 8 deletions gulp/tasks/markup.js

This file was deleted.

11 changes: 0 additions & 11 deletions gulp/tasks/minifyCss.js

This file was deleted.

16 changes: 16 additions & 0 deletions gulp/tasks/ngConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var gulp = require('gulp');
var ngConfig = require('gulp-ng-config');
var config = require('../config').ngConfig;
var fs = require('fs');

gulp.task('ngConfig', function () {
var tokenFile = config.dest + '/token.txt';

// Create a temporary file with the token stored in it
fs.writeFileSync(tokenFile, '{"mytoken": "' + process.env.OAUTH_TOKEN + '"}');

// Generate the token config file
gulp.src(tokenFile)
.pipe(ngConfig('intellyApp.config'))
.pipe(gulp.dest(config.dest));
});
7 changes: 0 additions & 7 deletions gulp/tasks/production.js

This file was deleted.

15 changes: 7 additions & 8 deletions gulp/tasks/sass.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var handleErrors = require('../util/handleErrors');
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var handleErrors = require('../util/handleErrors');
var config = require('../config').sass;

gulp.task('sass', function () {
return gulp.src(config.src)
.pipe(sourcemaps.init())
.pipe(sass(config.settings))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.on('error', handleErrors)
.pipe(sourcemaps.write())
.pipe(autoprefixer({ browsers: ['last 2 version'] }))
.pipe(gulp.dest(config.dest));
});

4 changes: 2 additions & 2 deletions gulp/tasks/serve.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
var gulp = require('gulp');
var config = require('../config').server;
var webserver = require('gulp-webserver');
var server = require('gulp-webserver');

gulp.task('serve', function() {
console.log(config.src);

gulp.src(config.src)
.pipe(webserver({
.pipe(server({
livereload: config.livereload,
directoryListing: config.directoryListing,
open: config.open,
Expand Down
11 changes: 0 additions & 11 deletions gulp/tasks/uglifyJs.js

This file was deleted.

5 changes: 2 additions & 3 deletions gulp/tasks/watch.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var config = require('../config');

gulp.task('watch', function() {
gulp.watch(config.javascript.src, ['webpack']);
gulp.watch(config.sass.src, ['sass']);
gulp.watch(config.markup.src, ['markup']);
// Watchify will watch and recompile our JS, so no need to gulp.watch it
gulp.watch(config.sass.src, ['sass']);
gulp.watch(config.html.src, ['html']);
});
6 changes: 3 additions & 3 deletions gulp/tasks/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ var config = require('../config').javascript;
var webpack = require('webpack-stream');

gulp.task('webpack', function(callback) {
return gulp.src(config.entry)
return gulp.src(config.entryPoint)
.pipe(webpack({
output: {
filename: config.outputFilename
filename: config.packedFile
}
}))
// .on('error', handleErrors)
.pipe(gulp.dest(config.dest));
});

2 changes: 1 addition & 1 deletion gulp/util/handleErrors.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ module.exports = function() {

// Keep gulp from hanging on this task
this.emit('end');
};
};
53 changes: 36 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,44 @@
{
"name": "",
"name": "mean-stack-1",
"version": "1.0.0",
"description": "",
"description": "Last week we focussed on JavaScript basics. This week we're going to build up a function web application. You'll be expected to build on knowledge you've already learned (semantic HTML, Sass instead of CSS, in addition to all of the Angular work we'll be doing) and produce a \"production-ready\" blog for your assignment this week.",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/pstrum/mean-stack-1.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/pstrum/mean-stack-1/issues"
},
"homepage": "https://github.com/pstrum/mean-stack-1#readme",
"dependencies": {
"gulp": "^3.8.11",
"gulp-autoprefixer": "^2.1.0",
"gulp-changed": "^1.1.1",
"gulp-filesize": "0.0.6",
"gulp-minify-css": "~0.5.1",
"angular": "^1.4.7",
"angular-cookies": "^1.4.7",
"angular-route": "^1.4.7",
"body-parser": "^1.14.1",
"connect-livereload": "^0.5.3",
"express": "^4.13.3",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.0.2",
"gulp-express": "^0.3.5",
"gulp-livereload": "^3.8.1",
"gulp-ng-config": "^1.2.1",
"gulp-notify": "^2.2.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "~1.3.3",
"gulp-sourcemaps": "^1.5.0",
"gulp-uglify": "^1.1.0",
"gulp-util": "^3.0.4",
"gulp-webserver": "^0.9.0",
"lodash": "^3.3.1",
"merge-stream": "^0.1.7",
"pretty-hrtime": "~1.0.0",
"require-dir": "^0.1.0",
"vinyl-source-stream": "~1.0.0",
"gulp-run": "^1.6.11",
"gulp-sass": "^2.0.4",
"gulp-webserver": "^0.9.1",
"mongoose": "^4.1.10",
"ng-showdown": "^1.0.0",
"node-bourbon": "^4.2.3",
"require-dir": "^0.3.0",
"showdown": "^1.2.3",
"webpack": "^1.12.2",
"webpack-stream": "^2.1.1"
}
}
Loading