Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit 1ca3ac8

Browse files
authored
Upgrade client (#83)
* Create new client project * Basic users module is done
1 parent 5501eca commit 1ca3ac8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+11417
-955
lines changed

client/.angular-cli.json

Lines changed: 0 additions & 62 deletions
This file was deleted.

client/.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,9 @@
3030
/coverage
3131
/libpeerconnection.log
3232
npm-debug.log
33+
yarn-error.log
3334
testem.log
3435
/typings
35-
yarn-error.log
36-
37-
# e2e
38-
/e2e/*.js
39-
/e2e/*.map
4036

4137
# System Files
4238
.DS_Store

client/Dockerfile

Lines changed: 0 additions & 24 deletions
This file was deleted.

client/README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
# Client
22

3-
The front end (client) side of the project written in Angular, with Angular-CLI, ngrx, and material2.
3+
The front end (client) side of the project written in Angular, with Angular-CLI, ngrx, and Material.
44

55
## Prerequisites
66

7-
* Install [Angular-cli](https://github.com/angular/angular-cli)
8-
* Install [npm](https://nodejs.org/en/)
7+
* Install [Angular-cli](https://github.com/angular/angular-cli).
8+
* Install [npm](https://nodejs.org/en/).
99

10-
## Manual Installation
10+
## Installation
1111

12-
1. Run `npm install` to install dependencies
13-
2. Run `npm start` to fire up the dev server
14-
3. Open browser to [http://localhost:4200](http://localhost:4200)
12+
1. Run `npm install` to install dependencies.
13+
2. Run `npm start` to fire up the dev server.
14+
3. Open browser to [http://localhost:4200](http://localhost:4200).
1515

1616
## Tests
1717

18-
* Run `npm run lint` to check for TSLint mistakes
19-
* Run `npm test` to execute the unit tests via Karma
20-
* Run `npm run e2e` to execute the end-to-end tests via Protractor
18+
* Run `npm run lint` to check for TSLint mistakes.
19+
* Run `npm run test` to execute the unit tests via Karma.
20+
* Run `npm run e2e` to execute the end-to-end tests via Protractor.
2121

2222
## Deploy
2323

24-
1. Run `ng build -prod -aot` to build the project
25-
2. Run `npm run sw` to generate the service worker file (in dist directory)
24+
1. Run `ng build --prod` to build the project.

client/angular.json

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"client": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"prefix": "client",
11+
"schematics": {
12+
"@schematics/angular:component": {
13+
"styleext": "scss"
14+
}
15+
},
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist/client",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "src/tsconfig.app.json",
25+
"assets": [
26+
"src/favicon.ico",
27+
"src/assets"
28+
],
29+
"styles": [
30+
"src/styles.scss"
31+
],
32+
"scripts": []
33+
},
34+
"configurations": {
35+
"production": {
36+
"fileReplacements": [
37+
{
38+
"replace": "src/environments/environment.ts",
39+
"with": "src/environments/environment.prod.ts"
40+
}
41+
],
42+
"optimization": true,
43+
"outputHashing": "all",
44+
"sourceMap": false,
45+
"extractCss": true,
46+
"namedChunks": false,
47+
"aot": true,
48+
"extractLicenses": true,
49+
"vendorChunk": false,
50+
"buildOptimizer": true
51+
}
52+
}
53+
},
54+
"serve": {
55+
"builder": "@angular-devkit/build-angular:dev-server",
56+
"options": {
57+
"browserTarget": "client:build"
58+
},
59+
"configurations": {
60+
"production": {
61+
"browserTarget": "client:build:production"
62+
}
63+
}
64+
},
65+
"extract-i18n": {
66+
"builder": "@angular-devkit/build-angular:extract-i18n",
67+
"options": {
68+
"browserTarget": "client:build"
69+
}
70+
},
71+
"test": {
72+
"builder": "@angular-devkit/build-angular:karma",
73+
"options": {
74+
"main": "src/test.ts",
75+
"polyfills": "src/polyfills.ts",
76+
"tsConfig": "src/tsconfig.spec.json",
77+
"karmaConfig": "src/karma.conf.js",
78+
"styles": [
79+
"src/styles.scss"
80+
],
81+
"scripts": [],
82+
"assets": [
83+
"src/favicon.ico",
84+
"src/assets"
85+
]
86+
}
87+
},
88+
"lint": {
89+
"builder": "@angular-devkit/build-angular:tslint",
90+
"options": {
91+
"tsConfig": [
92+
"src/tsconfig.app.json",
93+
"src/tsconfig.spec.json"
94+
],
95+
"exclude": [
96+
"**/node_modules/**"
97+
]
98+
}
99+
}
100+
}
101+
},
102+
"client-e2e": {
103+
"root": "e2e/",
104+
"projectType": "application",
105+
"architect": {
106+
"e2e": {
107+
"builder": "@angular-devkit/build-angular:protractor",
108+
"options": {
109+
"protractorConfig": "e2e/protractor.conf.js",
110+
"devServerTarget": "client:serve"
111+
},
112+
"configurations": {
113+
"production": {
114+
"devServerTarget": "client:serve:production"
115+
}
116+
}
117+
},
118+
"lint": {
119+
"builder": "@angular-devkit/build-angular:tslint",
120+
"options": {
121+
"tsConfig": "e2e/tsconfig.e2e.json",
122+
"exclude": [
123+
"**/node_modules/**"
124+
]
125+
}
126+
}
127+
}
128+
}
129+
},
130+
"defaultProject": "client",
131+
"cli": {
132+
"defaultCollection": "@ngrx/schematics"
133+
}
134+
}

client/e2e/app.e2e-spec.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

client/protractor.conf.js renamed to client/e2e/protractor.conf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { SpecReporter } = require('jasmine-spec-reporter');
66
exports.config = {
77
allScriptsTimeout: 11000,
88
specs: [
9-
'./e2e/**/*.e2e-spec.ts'
9+
'./src/**/*.e2e-spec.ts'
1010
],
1111
capabilities: {
1212
'browserName': 'chrome'
@@ -21,8 +21,8 @@ exports.config = {
2121
},
2222
onPrepare() {
2323
require('ts-node').register({
24-
project: 'e2e/tsconfig.e2e.json'
24+
project: require('path').join(__dirname, './tsconfig.e2e.json')
2525
});
2626
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
2727
}
28-
};
28+
};

client/e2e/src/app.e2e-spec.ts

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

client/e2e/app.po.ts renamed to client/e2e/src/app.po.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ export class AppPage {
44
navigateTo() {
55
return browser.get('/');
66
}
7+
8+
getParagraphText() {
9+
return element(by.css('client-root h1')).getText();
10+
}
711
}

client/e2e/tsconfig.e2e.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "../out-tsc/e2e",
5-
"baseUrl": "./",
4+
"outDir": "../out-tsc/app",
65
"module": "commonjs",
76
"target": "es5",
87
"types": [
@@ -11,4 +10,4 @@
1110
"node"
1211
]
1312
}
14-
}
13+
}

0 commit comments

Comments
 (0)