Skip to content

(#25) Hacker News #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 57 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
4cb9997
Update README.md
opiepj Aug 8, 2015
b139c32
Update README.md
opiepj Aug 8, 2015
486ef97
Update README.md
opiepj Aug 8, 2015
6da6387
Update README.md
opiepj Aug 8, 2015
4a0d9f2
Gitignore file.
opiepj Aug 8, 2015
0179278
Merge pull request #1 from opiepj/develop
opiepj Aug 8, 2015
b0e1691
Json files and updated Documentation.
opiepj Aug 8, 2015
1b7180a
Merge pull request #2 from opiepj/develop
opiepj Aug 8, 2015
ae2924b
(#3) Common injectable classes that will be used through out the APP …
opiepj Aug 8, 2015
1b48791
(#3) Custom typings for our application.
opiepj Aug 8, 2015
8c3fe06
(#3) Index file, the public folder will include scripts for SEO Crawl…
opiepj Aug 8, 2015
2a544e0
(#3) Bootstraps the entire app
opiepj Aug 8, 2015
1975a2c
(#3) entry file for components
opiepj Aug 8, 2015
8b70d90
(#3) file to gather all directives.
opiepj Aug 8, 2015
77aa3d9
(#3) File to gather all custom pipes.
opiepj Aug 8, 2015
0a9ceb9
(#3) file that gathers all injectables from service classes.
opiepj Aug 8, 2015
40d4122
Merge pull request #4 from opiepj/feature/3-AppFramework
opiepj Aug 8, 2015
5677571
(#6) Home Component
opiepj Aug 8, 2015
71f0ced
(#6) Angular API documentation URL.
opiepj Aug 8, 2015
ace9ec8
(#6) lib files.
opiepj Aug 8, 2015
e3af5c0
(#6) Auto focus public directive
opiepj Aug 8, 2015
d41189d
Merge pull request #7 from opiepj/feature/6-homecomponent
opiepj Aug 8, 2015
545fc1b
(#8) Capitalize Pipes
opiepj Aug 8, 2015
141eaee
(#8) add rx support to async pipes
opiepj Aug 8, 2015
17b0acc
(#8) activate new pipes.
opiepj Aug 8, 2015
31e8f86
Merge pull request #9 from opiepj/feature/8-custom-pipe
opiepj Aug 8, 2015
76b3899
(#10) tictactoe and search module
opiepj Aug 9, 2015
8bb9424
Merge pull request #11 from opiepj/feature/10-tictactoe
opiepj Aug 9, 2015
b9fe990
(#12) dashboard module
opiepj Aug 9, 2015
ddb5ca2
(#12) fix reference path
opiepj Aug 9, 2015
83f3c79
(#12) modified core functionalities for more performance.
opiepj Aug 9, 2015
baa299b
Merge pull request #13 from opiepj/feature/12-dashboard
opiepj Aug 9, 2015
78740df
(#15) Update readme
opiepj Aug 9, 2015
a050f13
(#15) update index and package folder
opiepj Aug 9, 2015
d3d0577
(#15) server implementation.
opiepj Aug 9, 2015
4c6d368
Merge pull request #16 from opiepj/feature/15-server
opiepj Aug 10, 2015
d9749d4
fix build errors.
opiepj Aug 10, 2015
b929102
Merge pull request #17 from opiepj/bugfix/webpack
opiepj Aug 10, 2015
0b659b4
template adjustments.
opiepj Aug 10, 2015
c04b137
added images, modified template views.
opiepj Aug 10, 2015
d137a92
Merge pull request #19 from opiepj/bugfix/template-errors
opiepj Aug 10, 2015
4436c1f
Loading Spinner
opiepj Aug 10, 2015
d09a403
Merge pull request #20 from opiepj/feature/spinner
opiepj Aug 10, 2015
b9e4ebb
First addition of gulp. Webpack and Browser Sync working
Aug 11, 2015
16a4b75
Fixed the livereload when at a non-root URL problem.
Aug 11, 2015
24c3dc1
(#22) Memory Game Module
opiepj Aug 11, 2015
583382e
Merge remote-tracking branch 'upstream/master' into feature/22-memory…
opiepj Aug 11, 2015
c7a492d
Adding hot reload to webpack.
Aug 12, 2015
46fbd2f
Merge branch 'master' of https://github.com/1337programming/angular2.…
opiepj Aug 12, 2015
96df1f1
(#22) gulp file.
opiepj Aug 12, 2015
8f43347
(#12) Memory game module.
opiepj Aug 12, 2015
c4c3fdf
(#22) Remove unused images.
opiepj Aug 12, 2015
0600197
Merge pull request #23 from opiepj/feature/22-memorygame
opiepj Aug 12, 2015
b500acf
Removing unneeded comments from gulp webpack
thomaswmanion Aug 12, 2015
861ca84
Merge branch 'master' of https://github.com/1337programming/angular2.…
thomaswmanion Aug 12, 2015
c6f944e
Modifying comment to see if i'm a contributor yet.
thomaswmanion Aug 12, 2015
12c989f
(#25) Hacker News
opiepj Aug 20, 2015
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
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# @AngularClass
# http://editorconfig.org

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
55 changes: 55 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# @AngularClass

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Users Environment Variables
.lock-wscript

# OS generated files #
.DS_Store
ehthumbs.db
Icon?
Thumbs.db

# Node Files #
/node_modules
/bower_components

# Typing TSD #
/src/typings/tsd/
/typings/
/tsd_typings/

# Dist #
/dist
/public/__build__/
/src/*/__build__/
__build__/**
.webpack.json


# IDE #
.idea/

# bash and zbash
*.un~
*~
72 changes: 71 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,72 @@
# angular2.0-App
[![GitHub version](https://badge.fury.io/gh/1337programming%2Fangular2.0-App.svg)](http://badge.fury.io/gh/1337programming%2Fangular2.0-App)
[![Dependency Status](https://david-dm.org/1337-programming/angular2.0-App.svg)](https://david-dm.org/1337programming/angular2.0-App)
[![Issue Stats](http://issuestats.com/github/1337-programming/angular2.0-Appr/badge/pr?style=flat)](http://issuestats.com/github/1337-programming/angular2.0-App)
# Angular 2.0 Sample App

Angular 2.0 Sample App using Typescript as a ECMAScript 6 standard and invoking webpack as a module bundler.

## Tags
* Angular 2.0
* TypeScript
* ECMAScript 6 Standard
* Webpack

# Getting Started
## Dependencies
What is needed to run this app:
* `node`
* `npm`

Install the following node modules
* `webpack` (`npm install -g webpack`)
* `webpack-dev-server` (`npm install -g webpack-dev-server`)
* `karma` (`npm install -g karma-cli`)
* `protractor` (`npm install -g protractor`)
* `TypeScript` (`npm install -g typescript`)
* `TSD typings` (`npm install -g tsd`)

## Install
* `fork` repo
* `clone`
* `npm install`
* `npm install express connect-history-api-fallback morgan body-parser` installs sample backend api
* `npm run express` starts up sample backend api server in one tab
* `npm run server` starts the dev server in another tab

## Running App
After installation run `npm run server` to start a local server using `webpack-dev-server` which will watch, build (in-memory), and reload for you. The port will be displayed to you as `http://localhost:3000` (or if you prefer IPv6, if you're using `express` server, then it's `http://[::1]:3000/`).

### server
```bash
$ webpack-dev-server
```

## Other Commands

### build files
```bash
$ webpack
```

### watch and build files
```bash
$ webpack --watch
```

### run tests
```bash
$ karma start
```

### run webdriver (E2E)
```bash
$ webdriver-manager start
then
$ npm run e2e
```

# Angular 2.0 API
reference: https://angular.io/docs/js/latest/api/

# License
[MIT](/LICENSE)
6 changes: 6 additions & 0 deletions gulp/clean.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var gulp = require('gulp');
var clean = require('gulp-clean');

gulp.task('clean', function() {
return gulp.src('__build__', {read: false}).pipe(clean());
});
4 changes: 4 additions & 0 deletions gulp/default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var gulp = require('gulp');
gulp.task('default', function() {
gulp.run('serve');
});
3 changes: 3 additions & 0 deletions gulp/serve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var gulp = require('gulp');

gulp.task('serve', ['webpack']);
10 changes: 10 additions & 0 deletions gulp/watch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var gulp = require('gulp');
var browserSync = require('browser-sync');

gulp.task('watch', function() {
gulp.watch('src/*{,*/*}.*', ['reload-webpack']);
});

gulp.task('reload-webpack', ['webpack'], function() {
browserSync.reload();
});
38 changes: 38 additions & 0 deletions gulp/webpack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
var gulp = require('gulp');
var gutil = require('gulp-util');
var WebpackDevServer = require('webpack-dev-server');
var webpack = require('webpack');
var path = require('path');
var config = require('../webpack.config');


gulp.task('webpack-dev-server', function(callback) {
var server = new WebpackDevServer(webpack(config), {
publicPath: '/__build__/',
contentBase: 'src/public',
hot: true,
inline: true,
noInfo: true,
quiet: true,
stats: { colors: true },
watchDelay: 3001
});

server.listen(8080, "localhost", function() {});

gutil.log('[webpack-dev-server]', 'http://localhost:8080/');

callback();
});

gulp.task('webpack', ['clean', 'webpack-dev-server'], function (callback) {
webpack(config, function (err, stats) {
if (err) {
throw new gutil.PluginError('webpack', err);
}

gutil.log('[webpack]', stats.toString({
colors: true
}));
});
});
2 changes: 2 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var requireDir = require('require-dir');
requireDir('./gulp');
75 changes: 75 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"name": "angular2.0-App",
"version": "0.0.0",
"description": "An Angular 2.0 sample app using Webpack",
"main": "",
"scripts": {
"build": "npm run build:dev && npm run build:prod",
"build:dev": " npm run env:dev npm run webpack --colors --display-error-details --display-cached",
"build:prod": "npm run env:prod npm run webpack --colors --display-error-details --display-cached",
"webpack": "webpack",
"clean": "rm -rf node_modules && rm -rf tsd_typings",
"watch": "webpack --watch",
"server": "webpack-dev-server --inline --colors --display-error-details --display-cached --port 3000",
"express": "NODE_ENV=development node ./server/express-server-example.js",
"express:dev": " npm run env:dev node ./server/express-server-example.js",
"express:prod": "npm run env:prod node ./server/express-server-example.js",
"express-install": "npm install express connect-history-api-fallback morgan body-parser",
"env:dev": "NODE_ENV=development",
"env:prod": "NODE_ENV=production",
"webdriver-update": "webdriver-manager update",
"webdriver-start": "webdriver-manager start",
"preprotractor": "npm run webdriver-update",
"protractor": "protractor",
"e2e": "npm run protractor",
"test": "karma start",
"postinstall": "tsd reinstall --overwrite",
"prestart": "npm install",
"start": "npm run server"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/1337programming/angular2.0-App/issues"
},
"dependencies": {
"angular2": "2.0.0-alpha.34",
"reflect-metadata": "^0.1.0",
"rtts_assert": "2.0.0-alpha.34",
"rx": "^2.5.3",
"firebase": "^2.2.4",
"zone.js": "^0.5.2"
},
"devDependencies": {
"browser-sync": "^2.8.2",
"browser-sync-spa": "^1.0.2",
"css-loader": "^0.15.1",
"exports-loader": "^0.6.2",
"expose-loader": "^0.7.0",
"file-loader": "^0.8.1",
"gulp": "^3.9.0",
"gulp-clean": "^0.3.1",
"gulp-util": "^3.0.6",
"imports-loader": "^0.6.3",
"json-loader": "^0.5.1",
"karma": "^0.13.3",
"karma-chrome-launcher": "^0.2.0",
"karma-coverage": "^0.4.2",
"karma-jasmine": "^0.3.5",
"karma-phantomjs-launcher": "^0.2.0",
"karma-sourcemap-loader": "^0.3.5",
"karma-webpack": "^1.7.0",
"phantomjs": "^1.9.17",
"protractor": "^2.1.0",
"raw-loader": "^0.5.1",
"require-dir": "^0.3.0",
"style-loader": "^0.12.2",
"tsd": "^0.6.3",
"typescript": "^1.5.3",
"typescript-simple-loader": "^0.3.2",
"url-loader": "^0.5.5",
"webpack": "^1.10.5",
"webpack-dev-server": "^1.10.1",
"webpack-stream": "^2.1.0",
"moment": "^2.10.6"
}
}
60 changes: 60 additions & 0 deletions server/express-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Webpack
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var webpackConfig = require('../webpack.config');

// Express
var express = require('express');
var history = require('connect-history-api-fallback');
var morgan = require('morgan');
var bodyParser = require('body-parser');

// Express App
var app = express();

// Env
var PORT = process.env.PORT || 3000;
var NODE_ENV = process.env.NODE_ENV || 'development';

app.use(morgan('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
}));

// Angular Http content type for POST etc defaults to text/plain at
app.use(bodyParser.text(), function ngHttpFix(req, next) {
try {
req.body = JSON.parse(req.body);
next();
} catch (e) {
next();
}
});

// Your middleware
app.use(history());
app.use(express.static('src/public'));

// Only use in development
if (NODE_ENV === 'development') {
var server = new WebpackDevServer(webpack(webpackConfig), {
publicPath: '/__build__',
historyApiFallback: false, // won't work due to order
inline: true,
quiet: false,
noInfo: false,
stats: {
colors: true
}
});
// Webpack express app that uses socket.io
app.use(server.app);
} else {
app.use('/__build__', express.static('__build__'));
}


app.listen(PORT, function () {
console.log('Listen on http://localhost:' + PORT + ' in ' + NODE_ENV);
});
Loading