Skip to content

Commit ab16d78

Browse files
author
Dave Syer
committed
Fix wrinkles
1 parent 41b5611 commit ab16d78

20 files changed

+834
-1382
lines changed

.gitignore

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,23 @@ dist/
2424
nbdist/
2525
.nb-gradle/# See http://help.github.com/ignore-files/ for more about ignoring files.
2626

27+
# See http://help.github.com/ignore-files/ for more about ignoring files.
28+
29+
node/
30+
bin/
31+
2732
# compiled output
28-
/target
2933
/dist
3034
/tmp
3135
/out-tsc
36+
# Only exists if Bazel was run
37+
/bazel-out
3238

3339
# dependencies
34-
/node
3540
/node_modules
36-
node/
41+
42+
# profiling files
43+
chrome-profiler-events*.json
3744

3845
# IDEs and editors
3946
/.idea
@@ -50,16 +57,18 @@ node/
5057
!.vscode/tasks.json
5158
!.vscode/launch.json
5259
!.vscode/extensions.json
60+
.history/*
5361

5462
# misc
63+
/.angular/cache
5564
/.sass-cache
5665
/connect.lock
5766
/coverage
5867
/libpeerconnection.log
5968
npm-debug.log
69+
yarn-error.log
6070
testem.log
6171
/typings
62-
.angular/
6372

6473
# System Files
6574
.DS_Store

README.adoc

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ and then move it into the root of the project:
119119
```
120120
$ cat client/.gitignore >> .gitignore
121121
$ rm -rf client/node* client/src/favicon.ico client/.gitignore client/.git
122-
$ sed -i -e 's/node_/anode/' .gitignore
123122
$ cp -rf client/* .
124123
$ cp client/.??* .
125124
$ rm -rf client
@@ -151,45 +150,39 @@ $ ./ng version
151150
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
152151
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
153152
|___/
154-
Angular CLI: 7.3.7
155-
Node: 9.11.2
153+
Angular CLI: 13.0.4
154+
Node: 16.13.1
156155
OS: linux x64
157-
Angular: 7.2.11
156+
Angular: 13.0.3
158157
... animations, common, compiler, compiler-cli, core, forms
159-
... language-service, platform-browser, platform-browser-dynamic
160-
... router
158+
... platform-browser, platform-browser-dynamic, router
161159

162160
Package Version
163161
-----------------------------------------------------------
164-
@angular-devkit/architect 0.13.7
165-
@angular-devkit/build-angular 0.13.7
166-
@angular-devkit/build-optimizer 0.13.7
167-
@angular-devkit/build-webpack 0.13.7
168-
@angular-devkit/core 7.3.7
169-
@angular-devkit/schematics 7.3.7
170-
@angular/cli 7.3.7
171-
@ngtools/webpack 7.3.7
172-
@schematics/angular 7.3.7
173-
@schematics/update 0.13.7
174-
rxjs 6.3.3
175-
typescript 3.2.4
176-
webpack 4.29.0
162+
@angular-devkit/architect 0.1300.4
163+
@angular-devkit/build-angular 13.0.4
164+
@angular-devkit/core 13.0.4
165+
@angular-devkit/schematics 13.0.4
166+
@angular/cli 13.0.4
167+
@schematics/angular 13.0.4
168+
rxjs 7.4.0
169+
typescript 4.4.4
177170
```
178171
179172
At this point, the tests work:
180173
181174
```
182-
$ ./ng e2e
183-
..
184-
[13:59:46] I/direct - Using ChromeDriver directly...
185-
Jasmine started
186-
187-
client App
188-
✓ should display welcome message
189-
190-
Executed 1 of 1 spec SUCCESS in 0.718 sec.
191-
[13:59:48] I/launcher - 0 instance(s) of WebDriver still running
192-
[13:59:48] I/launcher - chrome #01 passed
175+
$ ./ng test
176+
Generating browser application bundles (phase: setup)...09 12 2021 13:57:18.567:WARN [karma]: No captured browser, open http://localhost:9876/
177+
09 12 2021 13:57:18.576:INFO [karma-server]: Karma v6.3.9 server started at http://localhost:9876/
178+
09 12 2021 13:57:18.576:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
179+
09 12 2021 13:57:18.590:INFO [launcher]: Starting browser Chrome
180+
✔ Browser application bundle generation complete.
181+
09 12 2021 13:57:21.749:WARN [karma]: No captured browser, open http://localhost:9876/
182+
09 12 2021 13:57:21.797:INFO [Chrome 94.0.4606.71 (Linux x86_64)]: Connected on socket Fh4AKRcSDz0TEUkyAAAB with id 93745390
183+
✔ Browser application bundle generation complete.
184+
Chrome 94.0.4606.71 (Linux x86_64): Executed 3 of 3 SUCCESS (0.133 secs / 0.119 secs)
185+
TOTAL: 3 SUCCESS
193186
```
194187
195188
and if you add this as well:
@@ -216,7 +209,7 @@ If you want a stable build you should put a `^` before the version of `@angular/
216209
```
217210
...
218211
"devDependencies": {
219-
"@angular/cli": "^1.4.9",
212+
"@angular/cli": "^13.0.4",
220213
...
221214
```
222215
@@ -263,7 +256,7 @@ With that in place your `Tasks->Run Task...` menu should include the `ng-watch`
263256
You can add basic Twitter Bootstrap features to make the app look a bit less dull (taken from https://medium.com/codingthesmartway-com-blog/using-bootstrap-with-angular-c83c3cee3f4a[this blog]):
264257
265258
```
266-
$ ./npm install bootstrap@3 jquery --save
259+
$ ./npm install bootstrap --save
267260
```
268261
269262
and update `styles.css` to add the new content:
@@ -306,7 +299,7 @@ import {HttpClient} from '@angular/common/http';
306299
})
307300
export class AppComponent {
308301
title = 'Demo';
309-
data = {};
302+
data = {} as any;
310303
constructor(private http: HttpClient) {
311304
http.get('resource').subscribe(data => this.data = data);
312305
}

angular.json

Lines changed: 43 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,24 @@
44
"newProjectRoot": "projects",
55
"projects": {
66
"client": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:application": {
10+
"strict": true
11+
}
12+
},
713
"root": "",
814
"sourceRoot": "src",
9-
"projectType": "application",
1015
"prefix": "app",
11-
"schematics": {},
1216
"architect": {
1317
"build": {
1418
"builder": "@angular-devkit/build-angular:browser",
1519
"options": {
1620
"outputPath": "target/classes/static",
1721
"index": "src/index.html",
1822
"main": "src/main.ts",
19-
"tsConfig": "src/tsconfig.app.json",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "tsconfig.app.json",
2025
"assets": [
2126
"src/favicon.ico",
2227
"src/assets"
@@ -28,34 +33,48 @@
2833
},
2934
"configurations": {
3035
"production": {
36+
"budgets": [
37+
{
38+
"type": "initial",
39+
"maximumWarning": "500kb",
40+
"maximumError": "1mb"
41+
},
42+
{
43+
"type": "anyComponentStyle",
44+
"maximumWarning": "2kb",
45+
"maximumError": "4kb"
46+
}
47+
],
3148
"fileReplacements": [
3249
{
3350
"replace": "src/environments/environment.ts",
3451
"with": "src/environments/environment.prod.ts"
3552
}
3653
],
37-
"optimization": true,
38-
"outputHashing": "all",
39-
"sourceMap": false,
40-
"extractCss": true,
41-
"namedChunks": false,
42-
"aot": true,
43-
"extractLicenses": true,
44-
"vendorChunk": false,
45-
"buildOptimizer": true
54+
"outputHashing": "all"
55+
},
56+
"development": {
57+
"buildOptimizer": false,
58+
"optimization": false,
59+
"vendorChunk": true,
60+
"extractLicenses": false,
61+
"sourceMap": true,
62+
"namedChunks": true
4663
}
47-
}
64+
},
65+
"defaultConfiguration": "production"
4866
},
4967
"serve": {
5068
"builder": "@angular-devkit/build-angular:dev-server",
51-
"options": {
52-
"browserTarget": "client:build"
53-
},
5469
"configurations": {
5570
"production": {
5671
"browserTarget": "client:build:production"
72+
},
73+
"development": {
74+
"browserTarget": "client:build:development"
5775
}
58-
}
76+
},
77+
"defaultConfiguration": "development"
5978
},
6079
"extract-i18n": {
6180
"builder": "@angular-devkit/build-angular:extract-i18n",
@@ -67,55 +86,17 @@
6786
"builder": "@angular-devkit/build-angular:karma",
6887
"options": {
6988
"main": "src/test.ts",
70-
"tsConfig": "src/tsconfig.spec.json",
71-
"karmaConfig": "src/karma.conf.js",
72-
"styles": [
73-
"src/styles.css"
74-
],
75-
"scripts": [],
89+
"polyfills": "src/polyfills.ts",
90+
"tsConfig": "tsconfig.spec.json",
91+
"karmaConfig": "karma.conf.js",
7692
"assets": [
7793
"src/favicon.ico",
7894
"src/assets"
79-
]
80-
}
81-
},
82-
"lint": {
83-
"builder": "@angular-devkit/build-angular:tslint",
84-
"options": {
85-
"tsConfig": [
86-
"src/tsconfig.app.json",
87-
"src/tsconfig.spec.json"
8895
],
89-
"exclude": [
90-
"**/node_modules/**"
91-
]
92-
}
93-
}
94-
}
95-
},
96-
"client-e2e": {
97-
"root": "e2e/",
98-
"projectType": "application",
99-
"architect": {
100-
"e2e": {
101-
"builder": "@angular-devkit/build-angular:protractor",
102-
"options": {
103-
"protractorConfig": "e2e/protractor.conf.js",
104-
"devServerTarget": "client:serve"
105-
},
106-
"configurations": {
107-
"production": {
108-
"devServerTarget": "client:serve:production"
109-
}
110-
}
111-
},
112-
"lint": {
113-
"builder": "@angular-devkit/build-angular:tslint",
114-
"options": {
115-
"tsConfig": "e2e/tsconfig.e2e.json",
116-
"exclude": [
117-
"**/node_modules/**"
118-
]
96+
"styles": [
97+
"src/styles.css"
98+
],
99+
"scripts": []
119100
}
120101
}
121102
}

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/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage'),
13+
require('@angular-devkit/build-angular/plugins/karma')
14+
],
15+
client: {
16+
jasmine: {
17+
// you can add configuration options for Jasmine here
18+
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19+
// for example, you can disable the random execution with `random: false`
20+
// or set a specific seed with `seed: 4321`
21+
},
22+
clearContext: false // leave Jasmine Spec Runner output visible in browser
23+
},
24+
jasmineHtmlReporter: {
25+
suppressAll: true // removes the duplicated traces
26+
},
27+
coverageReporter: {
28+
dir: require('path').join(__dirname, './coverage/client'),
29+
subdir: '.',
30+
reporters: [
31+
{ type: 'html' },
32+
{ type: 'text-summary' }
33+
]
34+
},
35+
reporters: ['progress', 'kjhtml'],
36+
port: 9876,
37+
colors: true,
38+
logLevel: config.LOG_INFO,
39+
autoWatch: true,
40+
browsers: ['Chrome'],
41+
singleRun: false,
42+
restartOnFileChange: true
43+
});
44+
};

0 commit comments

Comments
 (0)