From 40e30d5c3f516607e512ec156cf49a446958e6d3 Mon Sep 17 00:00:00 2001 From: Jim Cummins Date: Fri, 27 Mar 2015 10:37:34 -0500 Subject: [PATCH] Adds a readme, install script, dependencies --- README.md | 36 ++++++++++++++++++++++++++++++++++++ config.js | 9 ++++----- install | 27 +++++++++++++++++++++++++++ install.cmd | 1 + package.json | 22 ++++++++++++++++++++-- 5 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 README.md create mode 100755 install create mode 100644 install.cmd diff --git a/README.md b/README.md new file mode 100644 index 0000000..e7c786b --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# ng2chat + +A chat app written in Angular 2 + +## Getting started + +### Prerequisites + +* Node +* NPM + +### Install dependencies + +The following command installs all the depenedencies for the project: + +**On OSX / Linux** + +``` +./install +``` + +**On windows** + +``` +install +``` + +### Running the app + +To run the app on port 8080 with LiveReload, run: + +``` +npm run serve +``` + +Then you can visit `http://localhost:8080` in the browser. \ No newline at end of file diff --git a/config.js b/config.js index 4ed62a2..a2bc1ac 100644 --- a/config.js +++ b/config.js @@ -4,18 +4,17 @@ System.config({ "github:*": "jspm_packages/github/*.js", "*": "*.js", "github:angular*": "jspm_packages/github/angular/*.es6" - }, - "traceurOptions": { - "annotations": true, - "types": true } }); System.config({ "map": { + "angular/angular": "github:angular/angular@2.0.0-alpha.15", "angular/zone.js": "github:angular/zone.js@0.4.1", "angular2": "github:angular/angular@2.0.0-alpha.15/dist/js/prod/es6/angular2", - "automattic/socket.io-client": "github:automattic/socket.io-client@1.3.5" + "automattic/socket.io-client": "github:automattic/socket.io-client@1.3.5", + "traceur": "github:jmcriffey/bower-traceur@0.0.87", + "traceur-runtime": "github:jmcriffey/bower-traceur-runtime@0.0.87" } }); diff --git a/install b/install new file mode 100755 index 0000000..46f0704 --- /dev/null +++ b/install @@ -0,0 +1,27 @@ +#!/usr/bin/env node + +var spawn = require('child_process').spawn; + +// Do some windows checks to make sure we're executing the right commands +var npm = (process.platform === "win32" ? "npm.cmd" : "npm"); +var jspm = (process.platform === "win32" ? "jspm.cmd" : "jspm"); +var npmChild = spawn(npm, ["install"]); + +npmChild.on('close', function (code) { + if (code !== 0) { + console.log('npm process exited with code ' + code); + } else { + // Spawn + var jspmChild = spawn(jspm, ["install"]); + // Output to the cli + jspmChild.stdout.on('data', function (data) { console.log(data.toString()); }); + jspmChild.stderr.on('data', function (data) { console.log(data.toString()); }); + jspmChild.on('error', function() { console.log(arguments); }); + jspmChild.stdin.end(); + } + npmChild.stdin.end(); +}); + +npmChild.stdout.on('data', function (data) { console.log(data.toString()); }); +npmChild.stderr.on('data', function (data) { console.log(data.toString()); }); +npmChild.on('error', function() { console.log(arguments); }); diff --git a/install.cmd b/install.cmd new file mode 100644 index 0000000..5cf67de --- /dev/null +++ b/install.cmd @@ -0,0 +1 @@ +@node "%~dpn0" %* \ No newline at end of file diff --git a/package.json b/package.json index 1a6acdd..99f0a10 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,31 @@ { + "description": "A chat app in Angular2", + "repository": { + "type": "git", + "url": "http://github.com/robwormald/ng2chat.git" + }, "jspm": { "directories": { - "lib": ".", - "packages": "jspm_packages" + "lib": "." }, "dependencies": { "angular/angular": "github:angular/angular@2.0.0-alpha.15", "angular/zone.js": "github:angular/zone.js@^0.4.1", "automattic/socket.io-client": "github:automattic/socket.io-client@^1.3.5" + }, + "devDependencies": { + "traceur": "github:jmcriffey/bower-traceur@0.0.87", + "traceur-runtime": "github:jmcriffey/bower-traceur-runtime@0.0.87" } + }, + "devDependencies": { + "gulp": "^3.8.11", + "gulp-concat": "^2.5.2", + "gulp-connect": "^2.2.0", + "jspm": "^0.15.0", + "systemjs-builder": "^0.10.2" + }, + "scripts": { + "serve": "gulp" } }