From 71dbea96e1b94a20f57912633836d4ee3535c546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= Date: Tue, 20 Oct 2015 15:45:38 +0300 Subject: [PATCH 1/4] Moved client files to the client path as specified in Gulpfile.js --- index.html => client/index.html | 4 ++-- {modules => client/modules}/App.js | 0 {modules => client/modules}/App.scss | 0 {modules => client/modules}/Authentication/Authenticated.html | 0 {modules => client/modules}/Authentication/Authenticated.js | 0 {modules => client/modules}/Authentication/Login.html | 0 {modules => client/modules}/Authentication/Login.js | 0 {modules => client/modules}/Guest/Guest.html | 0 {modules => client/modules}/Guest/Guest.js | 0 {modules => client/modules}/Intro/Intro.js | 0 {modules => client/modules}/Intro/done.html | 0 {modules => client/modules}/Intro/intro.html | 0 {modules => client/modules}/Intro/projects.html | 0 {modules => client/modules}/Intro/tasks.html | 0 {modules => client/modules}/Object.js | 0 {modules => client/modules}/Paginator.js | 0 {modules => client/modules}/Project/Project.html | 0 {modules => client/modules}/Project/Project.js | 0 {modules => client/modules}/Project/ProjectHeader.html | 0 {modules => client/modules}/Project/ProjectObject.js | 0 {modules => client/modules}/Project/Projects.html | 0 {modules => client/modules}/Socket.js | 0 {modules => client/modules}/Stream.js | 0 {modules => client/modules}/Task/Task.html | 0 {modules => client/modules}/Task/Task.js | 0 {modules => client/modules}/Task/TaskHeader.html | 0 {modules => client/modules}/Task/TaskObject.js | 0 {modules => client/modules}/User/Register.html | 0 {modules => client/modules}/User/RegisterStep1.html | 0 {modules => client/modules}/User/RegisterStep3.html | 0 {modules => client/modules}/User/User.js | 0 {modules => client/modules}/User/UserObject.js | 0 32 files changed, 2 insertions(+), 2 deletions(-) rename index.html => client/index.html (63%) rename {modules => client/modules}/App.js (100%) rename {modules => client/modules}/App.scss (100%) rename {modules => client/modules}/Authentication/Authenticated.html (100%) rename {modules => client/modules}/Authentication/Authenticated.js (100%) rename {modules => client/modules}/Authentication/Login.html (100%) rename {modules => client/modules}/Authentication/Login.js (100%) rename {modules => client/modules}/Guest/Guest.html (100%) rename {modules => client/modules}/Guest/Guest.js (100%) rename {modules => client/modules}/Intro/Intro.js (100%) rename {modules => client/modules}/Intro/done.html (100%) rename {modules => client/modules}/Intro/intro.html (100%) rename {modules => client/modules}/Intro/projects.html (100%) rename {modules => client/modules}/Intro/tasks.html (100%) rename {modules => client/modules}/Object.js (100%) rename {modules => client/modules}/Paginator.js (100%) rename {modules => client/modules}/Project/Project.html (100%) rename {modules => client/modules}/Project/Project.js (100%) rename {modules => client/modules}/Project/ProjectHeader.html (100%) rename {modules => client/modules}/Project/ProjectObject.js (100%) rename {modules => client/modules}/Project/Projects.html (100%) rename {modules => client/modules}/Socket.js (100%) rename {modules => client/modules}/Stream.js (100%) rename {modules => client/modules}/Task/Task.html (100%) rename {modules => client/modules}/Task/Task.js (100%) rename {modules => client/modules}/Task/TaskHeader.html (100%) rename {modules => client/modules}/Task/TaskObject.js (100%) rename {modules => client/modules}/User/Register.html (100%) rename {modules => client/modules}/User/RegisterStep1.html (100%) rename {modules => client/modules}/User/RegisterStep3.html (100%) rename {modules => client/modules}/User/User.js (100%) rename {modules => client/modules}/User/UserObject.js (100%) diff --git a/index.html b/client/index.html similarity index 63% rename from index.html rename to client/index.html index 3745548..93db986 100644 --- a/index.html +++ b/client/index.html @@ -1,9 +1,9 @@ AngularJS-ORM Demo - + - + \ No newline at end of file diff --git a/modules/App.js b/client/modules/App.js similarity index 100% rename from modules/App.js rename to client/modules/App.js diff --git a/modules/App.scss b/client/modules/App.scss similarity index 100% rename from modules/App.scss rename to client/modules/App.scss diff --git a/modules/Authentication/Authenticated.html b/client/modules/Authentication/Authenticated.html similarity index 100% rename from modules/Authentication/Authenticated.html rename to client/modules/Authentication/Authenticated.html diff --git a/modules/Authentication/Authenticated.js b/client/modules/Authentication/Authenticated.js similarity index 100% rename from modules/Authentication/Authenticated.js rename to client/modules/Authentication/Authenticated.js diff --git a/modules/Authentication/Login.html b/client/modules/Authentication/Login.html similarity index 100% rename from modules/Authentication/Login.html rename to client/modules/Authentication/Login.html diff --git a/modules/Authentication/Login.js b/client/modules/Authentication/Login.js similarity index 100% rename from modules/Authentication/Login.js rename to client/modules/Authentication/Login.js diff --git a/modules/Guest/Guest.html b/client/modules/Guest/Guest.html similarity index 100% rename from modules/Guest/Guest.html rename to client/modules/Guest/Guest.html diff --git a/modules/Guest/Guest.js b/client/modules/Guest/Guest.js similarity index 100% rename from modules/Guest/Guest.js rename to client/modules/Guest/Guest.js diff --git a/modules/Intro/Intro.js b/client/modules/Intro/Intro.js similarity index 100% rename from modules/Intro/Intro.js rename to client/modules/Intro/Intro.js diff --git a/modules/Intro/done.html b/client/modules/Intro/done.html similarity index 100% rename from modules/Intro/done.html rename to client/modules/Intro/done.html diff --git a/modules/Intro/intro.html b/client/modules/Intro/intro.html similarity index 100% rename from modules/Intro/intro.html rename to client/modules/Intro/intro.html diff --git a/modules/Intro/projects.html b/client/modules/Intro/projects.html similarity index 100% rename from modules/Intro/projects.html rename to client/modules/Intro/projects.html diff --git a/modules/Intro/tasks.html b/client/modules/Intro/tasks.html similarity index 100% rename from modules/Intro/tasks.html rename to client/modules/Intro/tasks.html diff --git a/modules/Object.js b/client/modules/Object.js similarity index 100% rename from modules/Object.js rename to client/modules/Object.js diff --git a/modules/Paginator.js b/client/modules/Paginator.js similarity index 100% rename from modules/Paginator.js rename to client/modules/Paginator.js diff --git a/modules/Project/Project.html b/client/modules/Project/Project.html similarity index 100% rename from modules/Project/Project.html rename to client/modules/Project/Project.html diff --git a/modules/Project/Project.js b/client/modules/Project/Project.js similarity index 100% rename from modules/Project/Project.js rename to client/modules/Project/Project.js diff --git a/modules/Project/ProjectHeader.html b/client/modules/Project/ProjectHeader.html similarity index 100% rename from modules/Project/ProjectHeader.html rename to client/modules/Project/ProjectHeader.html diff --git a/modules/Project/ProjectObject.js b/client/modules/Project/ProjectObject.js similarity index 100% rename from modules/Project/ProjectObject.js rename to client/modules/Project/ProjectObject.js diff --git a/modules/Project/Projects.html b/client/modules/Project/Projects.html similarity index 100% rename from modules/Project/Projects.html rename to client/modules/Project/Projects.html diff --git a/modules/Socket.js b/client/modules/Socket.js similarity index 100% rename from modules/Socket.js rename to client/modules/Socket.js diff --git a/modules/Stream.js b/client/modules/Stream.js similarity index 100% rename from modules/Stream.js rename to client/modules/Stream.js diff --git a/modules/Task/Task.html b/client/modules/Task/Task.html similarity index 100% rename from modules/Task/Task.html rename to client/modules/Task/Task.html diff --git a/modules/Task/Task.js b/client/modules/Task/Task.js similarity index 100% rename from modules/Task/Task.js rename to client/modules/Task/Task.js diff --git a/modules/Task/TaskHeader.html b/client/modules/Task/TaskHeader.html similarity index 100% rename from modules/Task/TaskHeader.html rename to client/modules/Task/TaskHeader.html diff --git a/modules/Task/TaskObject.js b/client/modules/Task/TaskObject.js similarity index 100% rename from modules/Task/TaskObject.js rename to client/modules/Task/TaskObject.js diff --git a/modules/User/Register.html b/client/modules/User/Register.html similarity index 100% rename from modules/User/Register.html rename to client/modules/User/Register.html diff --git a/modules/User/RegisterStep1.html b/client/modules/User/RegisterStep1.html similarity index 100% rename from modules/User/RegisterStep1.html rename to client/modules/User/RegisterStep1.html diff --git a/modules/User/RegisterStep3.html b/client/modules/User/RegisterStep3.html similarity index 100% rename from modules/User/RegisterStep3.html rename to client/modules/User/RegisterStep3.html diff --git a/modules/User/User.js b/client/modules/User/User.js similarity index 100% rename from modules/User/User.js rename to client/modules/User/User.js diff --git a/modules/User/UserObject.js b/client/modules/User/UserObject.js similarity index 100% rename from modules/User/UserObject.js rename to client/modules/User/UserObject.js From a6cc4efb69efea828cb819b90c56c1842cc26537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= Date: Tue, 20 Oct 2015 15:48:03 +0300 Subject: [PATCH 2/4] Restored gulp build --- Gulpfile.js | 4 ++-- client/index.html | 3 ++- client/modules/App.js | 2 +- client/modules/Task/TaskObject.js | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Gulpfile.js b/Gulpfile.js index 7371195..5c28258 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -44,8 +44,8 @@ var paths = { }, html: { client: { - src: ['client/modules/**/*.html'], - dest: 'public/modules/', + src: ['client/**/*.html'], + dest: 'public/', } }, styles: { diff --git a/client/index.html b/client/index.html index 93db986..a926988 100644 --- a/client/index.html +++ b/client/index.html @@ -1,7 +1,8 @@ AngularJS-ORM Demo - + + diff --git a/client/modules/App.js b/client/modules/App.js index 51249aa..8208065 100644 --- a/client/modules/App.js +++ b/client/modules/App.js @@ -1,4 +1,4 @@ -var module = angular.module('App', ['ui.router', 'App.Authentication', 'App.Guest']); +var module = angular.module('App', ['ui.router', 'App.Authenticated', 'App.Guest']); module.config(function($urlRouterProvider) { diff --git a/client/modules/Task/TaskObject.js b/client/modules/Task/TaskObject.js index 50eb408..94a70ec 100644 --- a/client/modules/Task/TaskObject.js +++ b/client/modules/Task/TaskObject.js @@ -23,7 +23,7 @@ module.factory( 'Task', (BaseObject, $http) => { // wraps `this.uploading` in a promise that resolves immediately if it is `null` or waits for the promise return this.cache('creating', () => $q.when(this.uploading) .then( () => $http.post('/api/tasks', this) ) // uploading callback - .then( response => return Object.assign(this, response.data) ) // creating callback + .then( response => Object.assign(this, response.data) ) // creating callback .finally( () => this.creating = null ) // state cleanup (doesn't affect chaining) ); } @@ -32,7 +32,7 @@ module.factory( 'Task', (BaseObject, $http) => { // wraps `this.uploading` in a promise that resolves immediately if it is `null` or waits for the promise return this.cache('updating', () => $q.when(this.uploading) .then( () => $http.post(`/api/tasks/${this.id}`, this) ) // uploading callback - .then( response => return Object.assign(this, response.data) ) // creating callback + .then( response => Object.assign(this, response.data) ) // creating callback .finally( () => this.updating = null ) // state cleanup (doesn't affect chaining) ); } From 808f96c8568ccdd658ad7533512b4df6d396e641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= Date: Tue, 20 Oct 2015 15:48:24 +0300 Subject: [PATCH 3/4] Added gitignore for deps and built files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26bc30d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/bower_components +/node_modules +/public \ No newline at end of file From 8ed9aedbc8a95719926a4b39347fd87e11f75de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= Date: Tue, 20 Oct 2015 15:55:38 +0300 Subject: [PATCH 4/4] Added gulp connect and gulp open --- Gulpfile.js | 16 ++++++++++++++++ package.json | 2 ++ 2 files changed, 18 insertions(+) diff --git a/Gulpfile.js b/Gulpfile.js index 5c28258..7f3c0e1 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -15,6 +15,7 @@ var gulp = require('gulp'), plugins = require('gulp-load-plugins')(), mainBowerFiles = require('main-bower-files'), + opn = require('opn'), del = require('del'); @@ -217,3 +218,18 @@ function scripts(paths, sort, parse) { }; } + + +////// LOCAL SERVER ////// + +gulp.task('connect', ['build'], function() { + plugins.connect.server({ + root: 'public', + livereload: true + }); +}); + +gulp.task('open', ['connect'], function (done) { + opn('http://localhost:8080', done); +}); + diff --git a/package.json b/package.json index 9320405..6262a8c 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "gulp-babel": "^5.1.0", "gulp-bless": "^3.0.1", "gulp-concat": "^2.5.2", + "gulp-connect": "^2.0.5", "gulp-debug": "^2.0.1", "gulp-if": "^1.2.5", "gulp-livereload": "^3.8.0", @@ -28,6 +29,7 @@ "gulp-sourcemaps": "^1.5.2", "gulp-uglify": "^1.2.0", "gulp-util": "^3.0.4", + "opn": "^0.1.2", "main-bower-files": "^2.7.0" }, "scripts": {