Skip to content

Commit 71b1f11

Browse files
committed
trouble after upgrading angular-cli
angular/angular-cli#2452
1 parent efe0396 commit 71b1f11

File tree

125 files changed

+2175
-1337
lines changed

Some content is hidden

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

125 files changed

+2175
-1337
lines changed

.angular-cli.json

+57
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": "angcli-started"
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+
"assets/styles/index.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": "css",
55+
"component": {}
56+
}
57+
}

README.md

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
[Please click here to support the Standing Rock Sioux Tribe and their peaceful resistance to the Dakota Access Pipeline which threatens their only source of water.](http://www.powwows.com/2016/09/07/10-ways-can-help-standing-rock-sioux-fight-dakota-access-pipeline/)
2-
31

42
[![Build Status](https://travis-ci.org/dancancro/great-big-angular2-example.svg?branch=master)](https://travis-ci.org/dancancro/great-big-angular2-example)
53
[![Dependency Status](https://david-dm.org/dancancro/great-big-angular2-example.svg)](https://david-dm.org/dancancro/great-big-angular2-example)
@@ -15,7 +13,8 @@ sign and NDA.
1513

1614
The rationale behind this is pretty simple...
1715

18-
1. Code examples are better than docs, lessons and Gitter Q&A.
16+
1. Real, complete code examples are better than docs, lessons and Gitter Q&A. And MUCH better
17+
than ellipses (...).
1918
2. If you want a job making commercial-grade code, you should study commercial-grade code,
2019
not tutorial-grade code. Anything you learn in a tutorial must sadly be approached with caution
2120
because corners have probably been cut, it's probably been simplified and it probably doesn't
@@ -26,6 +25,8 @@ The rationale behind this is pretty simple...
2625
you even write Hello World.
2726
4. If you want to know the complexity limits a technology will place on your app before you
2827
commit to using it, there's no better way than to see a complex example made with that technology.
28+
5. Making architectural decisions or convention decisions is a whole lot easier when you have
29+
a complete application with all of its edge cases to illuminate the consequences.
2930

3031
Hopefully, when the project is done it will make the learning process for others much easier and prepare them to
3132
make real things rather than instructional ones. I expect it to reduce the time to implement your own real
@@ -41,7 +42,7 @@ according to the following prioritization. Disagreements in approach between two
4142
lower influence yielding to the higher one:
4243

4344
1. [Angular Style Guide](https://angular.io/docs/ts/latest/guide/style-guide.html) by Google
44-
2. [Tour of Heroes (ngModules, Routing, App Specs versions)](https://github.com/dancancro/tour-of-heroes-versions) by Google
45+
2. [Tour of Heroes (ngModules, Routing, App Specs, HTTP, Server Communication versions)](https://github.com/dancancro/tour-of-heroes-versions) by Google
4546
3. [Angular CLI](https://github.com/angular/angular-cli) by Google and the community
4647
4. [ngrx example app - book collection](https://github.com/ngrx/example-app) by [@MikeRyan52](https://github.com/MikeRyan52)
4748
5. [angular-seed-advanced](https://github.com/NathanWalker/angular-seed-advanced) by Minko Gechev + Nathan Walker + community
@@ -64,14 +65,17 @@ While the goal of the project is to combine the wisdom of different experts, nob
6465
no obvious case against doing so. So you will see a couple of practices in this project that came from my head rather than the sources
6566
of expertise from which the project was assembled. If you can think of reasons not to do these things, please let me know.
6667

67-
1. I have put the Redux store reducers in `app/core/store` separate from the feature directories located under `app`. This agrees with
68-
the traditional relational database structure that has tables together in one place and referenced by UI artifacts in another place. This is the
69-
recommended practice with Redux.
68+
1. I have put the Redux store reducers in `app/core/store` separate from the feature directories located under `app` and did not make folders
69+
for `reducers`, `actions`, and `effects`. This jibes with the traditional relational database structure that has tables together in one place
70+
and referenced by UI artifacts in another place. This is the recommended practice with Redux.
7071
2. As much as practical the names of files in a directory begin with the directory name. I did this to prevent directories from having a mixture of
7172
unrelated concerns. If a directory in a source demo had files for two different things, I created more directories. I thought about
7273
removing that part of the file name, `src/app/app.page.ts` -> `src/app/page.ts`, for the sake of DRY, and I might still do that, but I'm
7374
undecided on whether it would cause confusion to see many files in an editor with the same name.
74-
3. I came up with a mini lexicon of file types to keep file names shorter and more expressive. A "page" is understood to be a smart `@Component`
75+
3. I noticed a lot of duplication and boilerplate of identical CRUD code for each of my types of entities. So I made an `entities` folder akin to
76+
the other parts of the store to hold what was common to all of them. `entity.action.ts` has the common actions. `entity.effects.ts` has some utility
77+
functions for the common CRUD effects that are called from minimal specific entities. `entity.model.ts` contains the common schema and reducer code.
78+
4. I came up with a mini lexicon of file types to keep file names shorter and more expressive. A "page" is understood to be a smart `@Component`
7579
class that fills the page and might have a router-outlet and route configurations. A "guard" is understood to be an `@Injectable` "service" class that
7680
returns a boolean. A "routing" is a `@NgModule` class that contains route configurations. So I memorize this simple lexicon, and drop the
7781
redundant, less-clear words from the names. For example, I use the name `app.page.ts` rather than `app.component.ts` or `app-page.component.ts`.
@@ -93,6 +97,7 @@ That's it. It shouldn't be too hard to remember these, and in return you will ha
9397
| Issue | Description | Features |
9498
| :-- | :-- | :-- |
9599
| [14480](https://github.com/angular/angular/issues/14480) | Angular 2 relative pathing from siblings doesn't work | Compose Message box on Crisis Center and login success routing |
100+
| [14201](https://github.com/angular/angular/pull/14201) | Duplicate instantiation of lazy loaded modules | ngrx Effects |
96101

97102
## Prerequisites
98103

@@ -733,4 +738,4 @@ Widget collections |Angular Material |Angular Material | | | |Angular Material
733738
│   ├── test.ts
734739
│   └── tsconfig.json
735740
└── tslint.json
736-
```
741+
```
File renamed without changes.

karma.conf.js

+14-13
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,36 @@
44
module.exports = function (config) {
55
config.set({
66
basePath: '',
7-
frameworks: ['jasmine', 'angular-cli'],
7+
frameworks: ['jasmine', '@angular/cli'],
88
plugins: [
99
require('karma-jasmine'),
1010
require('karma-chrome-launcher'),
11-
require('karma-remap-istanbul'),
12-
require('angular-cli/plugins/karma')
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage-istanbul-reporter'),
13+
require('@angular/cli/plugins/karma')
1314
],
15+
client: {
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
17+
},
1418
files: [
1519
{ pattern: './src/test.ts', watched: false }
1620
],
1721
preprocessors: {
18-
'./src/test.ts': ['angular-cli']
22+
'./src/test.ts': ['@angular/cli']
1923
},
2024
mime: {
21-
'text/x-typescript': ['ts','tsx']
25+
'text/x-typescript': ['ts', 'tsx']
2226
},
23-
remapIstanbulReporter: {
24-
reports: {
25-
html: 'coverage',
26-
lcovonly: './coverage/coverage.lcov'
27-
}
27+
coverageIstanbulReporter: {
28+
reports: ['html', 'lcovonly'],
29+
fixWebpackSourcePaths: true
2830
},
2931
angularCli: {
30-
config: './angular-cli.json',
3132
environment: 'dev'
3233
},
3334
reporters: config.angularCli && config.angularCli.codeCoverage
34-
? ['progress', 'karma-remap-istanbul']
35-
: ['progress'],
35+
? ['progress', 'coverage-istanbul']
36+
: ['progress', 'kjhtml'],
3637
port: 9876,
3738
colors: true,
3839
logLevel: config.LOG_INFO,

package.json

+24-22
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,17 @@
4141
"@angular/core": "~2.4.5",
4242
"@angular/forms": "~2.4.5",
4343
"@angular/http": "~2.4.5",
44-
"@angular/material": "~2.0.0-alpha.10",
44+
"@angular/material": "2.0.0-beta.2",
4545
"@angular/platform-browser": "~2.4.5",
4646
"@angular/platform-browser-dynamic": "~2.4.5",
47-
"@angular/router": "^3.3.1",
47+
"@angular/router": "^3.4.0",
4848
"@ngrx/core": "^1.0.0",
4949
"@ngrx/db": "^2.0.0",
5050
"@ngrx/effects": "^2.0.0",
5151
"@ngrx/router-store": "^1.1.0",
5252
"@ngrx/store": "^2.0.0",
5353
"@ngrx/store-devtools": "^3.1.0",
54-
"@types/hammerjs": "2.0.34",
55-
"@types/jasmine": "2.5.38",
56-
"@types/lodash": "^4.14.37",
57-
"@types/node": "6.0.51",
58-
"@types/uuid": "2.0.29",
59-
"angular-cli": "1.0.0-beta.28.3",
54+
"angular-in-memory-web-api": "0.2.4",
6055
"angular-sortablejs": "1.3.1",
6156
"angulartics2": "^1.6.3",
6257
"autoprefixer": "^6.3.3",
@@ -88,7 +83,6 @@
8883
"istanbul": "^1.0.0-alpha.2",
8984
"istanbul-instrumenter-loader": "^0.2.0",
9085
"lodash": "^4.17.4",
91-
"ngrx-store-freeze": "^0.1.6",
9286
"ngrx-store-localstorage": "0.1.5",
9387
"nodemon": "^1.9.2",
9488
"package-json": "2.4.0",
@@ -101,7 +95,7 @@
10195
"reflect-metadata": "0.1.8",
10296
"request": "2.79.0",
10397
"reselect": "2.5.4",
104-
"rxjs": "^5.0.1",
98+
"rxjs": "^5.1.0",
10599
"stylelint-webpack-plugin": "^0.3.0",
106100
"to-string-loader": "^1.1.3",
107101
"ts-helpers": "^1.1.1",
@@ -110,23 +104,31 @@
110104
"zone.js": "^0.7.6"
111105
},
112106
"devDependencies": {
113-
"@angular/cli": "1.0.0-beta.31",
114-
"angular-cli": "1.0.0-beta.28.3",
115-
"codelyzer": "~2.0.0-beta.1",
116-
"jasmine-core": "2.5.2",
117-
"jasmine-spec-reporter": "2.5.0",
107+
"@angular/cli": "1.0.0-rc.1",
108+
"@angular/compiler-cli": "^2.4.0",
109+
"@types/hammerjs": "2.0.34",
110+
"@types/jasmine": "2.5.38",
111+
"@types/lodash": "^4.14.37",
112+
"@types/node": "6.0.60",
113+
"@types/uuid": "2.0.29",
114+
"codelyzer": "~2.0.0",
115+
"jasmine-core": "~2.5.2",
116+
"jasmine-spec-reporter": "3.2.0",
118117
"json-loader": "^0.5.4",
119-
"karma": "1.2.0",
120-
"karma-chrome-launcher": "^2.0.0",
121-
"karma-cli": "^1.0.1",
122-
"karma-jasmine": "^1.0.2",
118+
"karma": "~1.4.1",
119+
"karma-chrome-launcher": "~2.0.0",
120+
"karma-cli": "~1.0.1",
121+
"karma-jasmine": "~1.1.0",
122+
"karma-coverage-istanbul-reporter": "^0.2.0",
123+
"karma-jasmine-html-reporter": "^0.2.2",
123124
"karma-phantomjs-launcher": "1.0.2",
124125
"karma-remap-istanbul": "^0.2.1",
126+
"ngrx-store-freeze": "^0.1.6",
125127
"osascript": "1.2.0",
126128
"protractor": "~5.1.1",
127129
"style-loader": "^0.13.1",
128-
"ts-node": "1.2.1",
129-
"tslint": "^4.4.2",
130+
"ts-node": "~2.0.0",
131+
"tslint": "~4.4.2",
130132
"tslint-loader": "^3.3.0",
131133
"typescript": "2.0.10",
132134
"webdriver-manager": "12.0.1",
@@ -135,4 +137,4 @@
135137
"webpack-hot-middleware": "^2.12.2",
136138
"webpack-split-by-path": "^0.1.0-beta.1"
137139
}
138-
}
140+
}

protractor.conf.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// Protractor configuration file, see link for more information
22
// https://github.com/angular/protractor/blob/master/lib/config.ts
33

4-
/*global jasmine */
5-
var SpecReporter = require('jasmine-spec-reporter');
4+
const { SpecReporter } = require('jasmine-spec-reporter');
65

76
exports.config = {
87
allScriptsTimeout: 11000,
@@ -14,20 +13,19 @@ exports.config = {
1413
},
1514
directConnect: true,
1615
baseUrl: 'http://localhost:4200/',
17-
framework: 'jasmine2',
16+
framework: 'jasmine',
1817
jasmineNodeOpts: {
1918
showColors: true,
2019
defaultTimeoutInterval: 40000,
2120
print: function () { }
2221
},
23-
useAllAngular2AppRoots: true,
2422
beforeLaunch: function () {
2523
require('ts-node').register({
26-
project: 'e2e'
24+
project: 'e2e/tsconfig.e2e.json'
2725
});
2826
},
29-
onPrepare: function () {
30-
jasmine.getEnv().addReporter(new SpecReporter());
27+
onPrepare() {
28+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
3129
},
3230
getPageTimeout: 40000
3331
};

server/db/contact.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"id":21,"name":"Sam Spade"},{"id":22,"name":"Nick Dangerous"},{"id":24,"name":"Nancy Drew"}]
1+
[{"id":21,"name":"Sam Spade"},{"id":22,"name":"Nick Dangerous"},{"id":24,"name":"Nancy Drew"},{"id":"bc361330-009f-11e7-ab58-53d042cc73c7","name":"jhfjghf"}]

server/db/hero.json

+1-26
Original file line numberDiff line numberDiff line change
@@ -1,26 +1 @@
1-
[
2-
{
3-
"id": 11,
4-
"name": "Mr. Nice"
5-
},
6-
{
7-
"id": 12,
8-
"name": "Narco"
9-
},
10-
{
11-
"id": 13,
12-
"name": "Bombasto"
13-
},
14-
{
15-
"id": 14,
16-
"name": "Celeritas"
17-
},
18-
{
19-
"id": 15,
20-
"name": "Magneta"
21-
},
22-
{
23-
"id": 15,
24-
"name": "Rubberman"
25-
}
26-
]
1+
[{"id":11,"name":"Mr. Nice"},{"id":12,"name":"Narco"},{"id":13,"name":"Bombasto"},{"id":14,"name":"Celeritas"},{"id":15,"name":"Magneta"},{"id":15,"name":"Rubberman"},{"id":16,"name":"sss"},{"id":17,"name":"dfsfs"},{"id":18,"name":"sssss"},{"id":19,"name":"qqqq"},{"id":20,"name":"wwww"}]

server/node-server.js

+2
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ app.get('/api/contacts', getRecords('contact'));
8181
app.post('/api/contact', saveARecord('contact'));
8282
app.get('/api/crises', getRecords('crisis'));
8383
app.get('/api/heroes', getRecords('hero'));
84+
// app.get('/api/heroes/:id', getRecords('hero'));
8485
app.get('/api/notes', getRecords('note'));
8586
app.get('/api/users', getRecords('user'));
8687
app.post('/api/note', saveARecord('note'));
88+
app.post('/api/hero', saveARecord('hero'));
8789

8890
app.get('/api/deps/:package', getDependencies());
8991

src/app/app.page.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import * as sessionActions from './core/store/session/session.actions';
1010
@Component({
1111
selector: 'app-root',
1212
changeDetection: ChangeDetectionStrategy.OnPush,
13-
styleUrls: ['app.page.css'],
14-
templateUrl: 'app.page.html'
13+
styleUrls: ['./app.page.css'],
14+
templateUrl: './app.page.html'
1515
})
1616
export class AppPage {
1717
showSidenav$: Observable<boolean>;

0 commit comments

Comments
 (0)