Skip to content

Commit 37ce197

Browse files
committed
Start from scratch with Angular 6
1 parent 0ec4b2a commit 37ce197

30 files changed

+5874
-6010
lines changed

.angular-cli.json

-69
This file was deleted.

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ nbdist/
3333
# dependencies
3434
/node
3535
/node_modules
36+
node/
3637

3738
# IDEs and editors
3839
/.idea

README.adoc

+26-22
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ $ ./ng --version
9191
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
9292
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
9393
|___/
94-
@angular/cli: 1.4.9
95-
node: 8.8.1
96-
os: linux x64
94+
Angular CLI: 6.0.8
95+
Node: 9.11.2
96+
OS: linux x64
97+
...
9798
```
9899

99100
== Create an Angular App
@@ -106,7 +107,7 @@ Create the app with the CLI:
106107
$ ./ng new client # add --minimal here if you want to skip tests
107108
```
108109

109-
and then move it into the root of the propject:
110+
and then move it into the root of the project:
110111

111112
```
112113
$ cat client/.gitignore >> .gitignore
@@ -115,10 +116,10 @@ $ sed -i '/node_/anode/' .gitignore
115116
$ cp -rf client/* .
116117
$ cp client/.??* .
117118
$ rm -rf client
118-
$ sed -i -e 's,dist,target/classes/static,' .angular-cli.json
119+
$ sed -i -e 's,dist/client,target/classes/static,' angular.json
119120
```
120121

121-
We discarded the node modules that the CLI installed because we want the frontend plugin to do that work for us in an automated build. We also edited the `.angular-cli.json` (a bit like a `pom.xml` for the Angular CLI app) to point the output from the Angular build to a location that will be packaged in our JAR file.
122+
We discarded the node modules that the CLI installed because we want the frontend plugin to do that work for us in an automated build. We also edited the `angular.json` (a bit like a `pom.xml` for the Angular CLI app) to point the output from the Angular build to a location that will be packaged in our JAR file.
122123

123124
== Building
124125

@@ -143,22 +144,25 @@ $ ./ng version
143144
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
144145
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
145146
|___/
146-
@angular/cli: 1.4.9
147-
node: 8.8.1
148-
os: linux x64
149-
@angular/animations: 4.4.6
150-
@angular/common: 4.4.6
151-
@angular/compiler: 4.4.6
152-
@angular/core: 4.4.6
153-
@angular/forms: 4.4.6
154-
@angular/http: 4.4.6
155-
@angular/platform-browser: 4.4.6
156-
@angular/platform-browser-dynamic: 4.4.6
157-
@angular/router: 4.4.6
158-
@angular/cli: 1.4.9
159-
@angular/compiler-cli: 4.4.6
160-
@angular/language-service: 4.4.6
161-
typescript: 2.3.4
147+
Angular CLI: 6.0.8
148+
Node: 9.11.2
149+
OS: linux x64
150+
Angular: <error>
151+
... animations, common, compiler, compiler-cli, core, forms
152+
... http, language-service, platform-browser
153+
... platform-browser-dynamic, router
154+
155+
Package Version
156+
---------------------------------------------------------
157+
@angular-devkit/architect 0.6.8
158+
@angular-devkit/build-angular <error>
159+
@angular-devkit/core 0.6.8
160+
@angular-devkit/schematics 0.6.8
161+
@angular/cli 6.0.8
162+
@schematics/angular 0.6.8
163+
@schematics/update 0.6.8
164+
rxjs 6.2.1
165+
typescript 2.7.2
162166
```
163167
164168
At this point, the tests work:

README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Client
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.8.
4+
5+
## Development server
6+
7+
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.
8+
9+
## Code scaffolding
10+
11+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12+
13+
## Build
14+
15+
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.
16+
17+
## Running unit tests
18+
19+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20+
21+
## Running end-to-end tests
22+
23+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24+
25+
## Further help
26+
27+
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).

angular.json

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

3-
describe('client App', () => {
3+
describe('workspace-project App', () => {
44
let page: AppPage;
55

66
beforeEach(() => {
@@ -9,6 +9,6 @@ describe('client App', () => {
99

1010
it('should display welcome message', () => {
1111
page.navigateTo();
12-
expect(page.getParagraphText()).toEqual('Welcome Demo!');
12+
expect(page.getParagraphText()).toEqual('Welcome to client!');
1313
});
1414
});

e2e/app.po.ts e2e/src/app.po.ts

File renamed without changes.

e2e/tsconfig.e2e.json

+2-3
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)