Skip to content

Commit 101fe0a

Browse files
author
Bayo O
committed
First Push
1 parent a9c1b7f commit 101fe0a

40 files changed

+1272
-0
lines changed

.angular-cli.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"project": {
4+
"name": "ng-chess"
5+
},
6+
"apps": [
7+
{
8+
"root": "src",
9+
"outDir": "dist",
10+
"assets": [
11+
"assets",
12+
"favicon.ico"
13+
],
14+
"index": "index.html",
15+
"main": "main.ts",
16+
"polyfills": "polyfills.ts",
17+
"test": "test.ts",
18+
"tsconfig": "tsconfig.app.json",
19+
"testTsconfig": "tsconfig.spec.json",
20+
"prefix": "app",
21+
"styles": [
22+
"styles.scss"
23+
],
24+
"scripts": [],
25+
"environmentSource": "environments/environment.ts",
26+
"environments": {
27+
"dev": "environments/environment.ts",
28+
"prod": "environments/environment.prod.ts"
29+
}
30+
}
31+
],
32+
"e2e": {
33+
"protractor": {
34+
"config": "./protractor.conf.js"
35+
}
36+
},
37+
"lint": [
38+
{
39+
"project": "src/tsconfig.app.json"
40+
},
41+
{
42+
"project": "src/tsconfig.spec.json"
43+
},
44+
{
45+
"project": "e2e/tsconfig.e2e.json"
46+
}
47+
],
48+
"test": {
49+
"karma": {
50+
"config": "./karma.conf.js"
51+
}
52+
},
53+
"defaults": {
54+
"styleExt": "scss",
55+
"component": {}
56+
}
57+
}

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 4
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
8+
# dependencies
9+
/node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
testem.log
34+
/typings
35+
36+
# e2e
37+
/e2e/*.js
38+
/e2e/*.map
39+
40+
# System Files
41+
.DS_Store
42+
Thumbs.db
43+
src/environments/environment.ts
44+
src/environments/environment.prod.ts

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,54 @@ Fun and light port of this this react firebase chess project https://appendto.co
33
React source can be found here - https://github.com/hiquest/react-chess/
44

55
This is an project to help me learn angular 4 and more.
6+
7+
# NOTES
8+
The enviroment files are currently missing as they contain my firebase creds. I will change this soon. In the mean time, you can create your own enviromnent files.
9+
angular CLI creates 2 default files. environment.ts & environment.prod.ts
10+
This is the content of the files (one for dev and one for prod of course)
11+
12+
// Local modules
13+
import { IFirebaseConfig } from '../common/Interfaces';
14+
15+
export const environment = {
16+
production: true
17+
};
18+
19+
export const FirebaseConfig: IFirebaseConfig = {
20+
apiKey: '<your-api-key>',
21+
authDomain: '<your-auth-domain>',
22+
databaseURL: '<your-database-url>',
23+
projectId: '<your-project-id>',
24+
storageBucket: '<your-storage-bucket>',
25+
messagingSenderId: '<your-messaging-sender-id>'
26+
};
27+
28+
29+
# NgChess
30+
31+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0.
32+
33+
## Development server
34+
35+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
36+
37+
## Code scaffolding
38+
39+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`.
40+
41+
## Build
42+
43+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
44+
45+
## Running unit tests
46+
47+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
48+
49+
## Running end-to-end tests
50+
51+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
52+
Before running the tests make sure you are serving the app via `ng serve`.
53+
54+
## Further help
55+
56+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

e2e/app.e2e-spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { NgChessPage } from './app.po';
2+
3+
describe('ng-chess App', () => {
4+
let page: NgChessPage;
5+
6+
beforeEach(() => {
7+
page = new NgChessPage();
8+
});
9+
10+
it('should display message saying app works', () => {
11+
page.navigateTo();
12+
expect(page.getParagraphText()).toEqual('app works!');
13+
});
14+
});

e2e/app.po.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, element, by } from 'protractor';
2+
3+
export class NgChessPage {
4+
navigateTo() {
5+
return browser.get('/');
6+
}
7+
8+
getParagraphText() {
9+
return element(by.css('app-root h1')).getText();
10+
}
11+
}

e2e/tsconfig.e2e.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/e2e",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types":[
8+
"jasmine",
9+
"node"
10+
]
11+
}
12+
}

karma.conf.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/0.13/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular/cli'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage-istanbul-reporter'),
13+
require('@angular/cli/plugins/karma')
14+
],
15+
client:{
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
17+
},
18+
files: [
19+
{ pattern: './src/test.ts', watched: false }
20+
],
21+
preprocessors: {
22+
'./src/test.ts': ['@angular/cli']
23+
},
24+
mime: {
25+
'text/x-typescript': ['ts','tsx']
26+
},
27+
coverageIstanbulReporter: {
28+
reports: [ 'html', 'lcovonly' ],
29+
fixWebpackSourcePaths: true
30+
},
31+
angularCli: {
32+
environment: 'dev'
33+
},
34+
reporters: config.angularCli && config.angularCli.codeCoverage
35+
? ['progress', 'coverage-istanbul']
36+
: ['progress', 'kjhtml'],
37+
port: 9876,
38+
colors: true,
39+
logLevel: config.LOG_INFO,
40+
autoWatch: true,
41+
browsers: ['Chrome'],
42+
singleRun: false
43+
});
44+
};

package.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "ng-chess",
3+
"version": "0.0.0",
4+
"license": "MIT",
5+
"scripts": {
6+
"ng": "ng",
7+
"start": "ng serve",
8+
"build": "ng build",
9+
"test": "ng test",
10+
"lint": "ng lint",
11+
"e2e": "ng e2e"
12+
},
13+
"private": true,
14+
"dependencies": {
15+
"@angular/common": "^4.0.0",
16+
"@angular/compiler": "^4.0.0",
17+
"@angular/core": "^4.0.0",
18+
"@angular/forms": "^4.0.0",
19+
"@angular/http": "^4.0.0",
20+
"@angular/platform-browser": "^4.0.0",
21+
"@angular/platform-browser-dynamic": "^4.0.0",
22+
"@angular/router": "^4.0.0",
23+
"angularfire2": "^2.0.0-beta.8",
24+
"chess.js": "^0.10.2",
25+
"chessboardjs": "0.0.1",
26+
"core-js": "^2.4.1",
27+
"firebase": "^3.8.0",
28+
"rxjs": "^5.1.0",
29+
"zone.js": "^0.8.4"
30+
},
31+
"devDependencies": {
32+
"@angular/cli": "1.0.0",
33+
"@angular/compiler-cli": "^4.0.0",
34+
"@types/jasmine": "2.5.38",
35+
"codelyzer": "~2.0.0",
36+
"jasmine-core": "~2.5.2",
37+
"jasmine-spec-reporter": "~3.2.0",
38+
"karma": "~1.4.1",
39+
"karma-chrome-launcher": "~2.0.0",
40+
"karma-cli": "~1.0.1",
41+
"karma-coverage-istanbul-reporter": "^0.2.0",
42+
"karma-jasmine": "~1.1.0",
43+
"karma-jasmine-html-reporter": "^0.2.2",
44+
"protractor": "~5.1.0",
45+
"ts-node": "~2.0.0",
46+
"tslint": "~4.5.0",
47+
"typescript": "~2.2.0"
48+
}
49+
}

protractor.conf.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Protractor configuration file, see link for more information
2+
// https://github.com/angular/protractor/blob/master/lib/config.ts
3+
4+
const { SpecReporter } = require('jasmine-spec-reporter');
5+
6+
exports.config = {
7+
allScriptsTimeout: 11000,
8+
specs: [
9+
'./e2e/**/*.e2e-spec.ts'
10+
],
11+
capabilities: {
12+
'browserName': 'chrome'
13+
},
14+
directConnect: true,
15+
baseUrl: 'http://localhost:4200/',
16+
framework: 'jasmine',
17+
jasmineNodeOpts: {
18+
showColors: true,
19+
defaultTimeoutInterval: 30000,
20+
print: function() {}
21+
},
22+
beforeLaunch: function() {
23+
require('ts-node').register({
24+
project: 'e2e/tsconfig.e2e.json'
25+
});
26+
},
27+
onPrepare() {
28+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
29+
}
30+
};

src/app/app.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div>
2+
<router-outlet></router-outlet>
3+
</div>

src/app/app.component.scss

Whitespace-only changes.

src/app/app.component.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Node modules
2+
import { Component } from '@angular/core';
3+
4+
@Component({
5+
selector: 'app-root',
6+
templateUrl: './app.component.html',
7+
styleUrls: ['./app.component.scss']
8+
})
9+
export class AppComponent {
10+
title = 'app works!';
11+
12+
constructor() {
13+
14+
}
15+
}

src/app/app.module.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Node modules
2+
import { BrowserModule } from '@angular/platform-browser';
3+
import { NgModule } from '@angular/core';
4+
import { FormsModule } from '@angular/forms';
5+
import { HttpModule } from '@angular/http';
6+
import { AngularFireModule, AuthProviders, AuthMethods } from 'angularfire2';
7+
8+
// Local modules
9+
import { AppComponent } from './app.component';
10+
import { FirebaseConfig } from '../environments/environment';
11+
import { AppRoutingModule, RoutingComponents } from './app.routes';
12+
13+
export const FirebaseAuthConfig = {
14+
provider: AuthProviders.Anonymous,
15+
method: AuthMethods.Anonymous
16+
};
17+
18+
@NgModule({
19+
declarations: [
20+
AppComponent,
21+
RoutingComponents
22+
],
23+
imports: [
24+
AppRoutingModule,
25+
BrowserModule,
26+
FormsModule,
27+
HttpModule,
28+
AngularFireModule.initializeApp(FirebaseConfig, FirebaseAuthConfig)
29+
],
30+
providers: [],
31+
bootstrap: [AppComponent]
32+
})
33+
export class AppModule { }

0 commit comments

Comments
 (0)