Skip to content

Commit 0aee8fa

Browse files
author
Matt Lewis
committed
docs: update build tool examples
Closes #394
1 parent 1f1466c commit 0aee8fa

31 files changed

+13822
-4262
lines changed

build-tool-examples/angular-cli/.angular-cli.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"testTsconfig": "tsconfig.spec.json",
2020
"prefix": "app",
2121
"styles": [
22-
"../node_modules/angular-calendar/dist/css/angular-calendar.css",
22+
"../node_modules/angular-calendar/css/angular-calendar.css",
2323
"styles.css"
2424
],
2525
"scripts": [],
@@ -37,13 +37,16 @@
3737
},
3838
"lint": [
3939
{
40-
"project": "src/tsconfig.app.json"
40+
"project": "src/tsconfig.app.json",
41+
"exclude": "**/node_modules/**"
4142
},
4243
{
43-
"project": "src/tsconfig.spec.json"
44+
"project": "src/tsconfig.spec.json",
45+
"exclude": "**/node_modules/**"
4446
},
4547
{
46-
"project": "e2e/tsconfig.e2e.json"
48+
"project": "e2e/tsconfig.e2e.json",
49+
"exclude": "**/node_modules/**"
4750
}
4851
],
4952
"test": {

build-tool-examples/angular-cli/README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# AngularCli
22

3-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.6.
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.5.
44

55
## Development server
66

77
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.
88

99
## Code scaffolding
1010

11-
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|module`.
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`.
1212

1313
## Build
1414

@@ -21,7 +21,6 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
2121
## Running end-to-end tests
2222

2323
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24-
Before running the tests make sure you are serving the app via `ng serve`.
2524

2625
## Further help
2726

Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { AngularCliPage } from './app.po';
1+
import { AppPage } from './app.po';
22

33
describe('angular-cli App', () => {
4-
let page: AngularCliPage;
4+
let page: AppPage;
55

66
beforeEach(() => {
7-
page = new AngularCliPage();
7+
page = new AppPage();
88
});
99

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

build-tool-examples/angular-cli/e2e/app.po.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { browser, by, element } from 'protractor';
22

3-
export class AngularCliPage {
3+
export class AppPage {
44
navigateTo() {
55
return browser.get('/');
66
}

build-tool-examples/angular-cli/e2e/tsconfig.e2e.json

+2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../out-tsc/e2e",
5+
"baseUrl": "./",
56
"module": "commonjs",
67
"target": "es5",
78
"types": [
89
"jasmine",
10+
"jasminewd2",
911
"node"
1012
]
1113
}

build-tool-examples/angular-cli/karma.conf.js

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Karma configuration file, see link for more information
2-
// https://karma-runner.github.io/0.13/config/configuration-file.html
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
33

44
module.exports = function (config) {
55
config.set({
@@ -15,25 +15,14 @@ module.exports = function (config) {
1515
client:{
1616
clearContext: false // leave Jasmine Spec Runner output visible in browser
1717
},
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-
},
2718
coverageIstanbulReporter: {
2819
reports: [ 'html', 'lcovonly' ],
2920
fixWebpackSourcePaths: true
3021
},
3122
angularCli: {
3223
environment: 'dev'
3324
},
34-
reporters: config.angularCli && config.angularCli.codeCoverage
35-
? ['progress', 'coverage-istanbul']
36-
: ['progress', 'kjhtml'],
25+
reporters: ['progress', 'kjhtml'],
3726
port: 9876,
3827
colors: true,
3928
logLevel: config.LOG_INFO,
+28-26
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,50 @@
11
{
2-
"name": "angular-cli",
2+
"name": "angular-calendar-angular-cli-example",
33
"version": "0.0.0",
44
"license": "MIT",
55
"scripts": {
66
"ng": "ng",
7-
"start": "ng serve",
7+
"start": "ng serve --open",
88
"build": "ng build",
99
"test": "ng test",
1010
"lint": "ng lint",
1111
"e2e": "ng e2e"
1212
},
1313
"private": true,
1414
"dependencies": {
15-
"@angular/animations": "^4.1.3",
16-
"@angular/common": "^4.0.0",
17-
"@angular/compiler": "^4.0.0",
18-
"@angular/core": "^4.0.0",
19-
"@angular/forms": "^4.0.0",
20-
"@angular/http": "^4.0.0",
21-
"@angular/platform-browser": "^4.0.0",
22-
"@angular/platform-browser-dynamic": "^4.0.0",
23-
"@angular/router": "^4.0.0",
24-
"angular-calendar": "^0.17.0",
15+
"@angular/animations": "^5.0.0",
16+
"@angular/common": "^5.0.0",
17+
"@angular/compiler": "^5.0.0",
18+
"@angular/core": "^5.0.0",
19+
"@angular/forms": "^5.0.0",
20+
"@angular/http": "^5.0.0",
21+
"@angular/platform-browser": "^5.0.0",
22+
"@angular/platform-browser-dynamic": "^5.0.0",
23+
"@angular/router": "^5.0.0",
24+
"angular-calendar": "^0.22.1",
2525
"core-js": "^2.4.1",
26-
"rxjs": "^5.1.0",
27-
"zone.js": "^0.8.4"
26+
"rxjs": "^5.5.2",
27+
"zone.js": "^0.8.14"
2828
},
2929
"devDependencies": {
30-
"@angular/cli": "1.0.6",
31-
"@angular/compiler-cli": "^4.0.0",
32-
"@types/jasmine": "2.5.38",
30+
"@angular/cli": "1.5.5",
31+
"@angular/compiler-cli": "^5.0.0",
32+
"@angular/language-service": "^5.0.0",
33+
"@types/jasmine": "~2.5.53",
34+
"@types/jasminewd2": "~2.0.2",
3335
"@types/node": "~6.0.60",
34-
"codelyzer": "~2.0.0",
35-
"jasmine-core": "~2.5.2",
36-
"jasmine-spec-reporter": "~3.2.0",
37-
"karma": "~1.4.1",
36+
"codelyzer": "^4.0.1",
37+
"jasmine-core": "~2.6.2",
38+
"jasmine-spec-reporter": "~4.1.0",
39+
"karma": "~1.7.0",
3840
"karma-chrome-launcher": "~2.1.1",
3941
"karma-cli": "~1.0.1",
42+
"karma-coverage-istanbul-reporter": "^1.2.1",
4043
"karma-jasmine": "~1.1.0",
4144
"karma-jasmine-html-reporter": "^0.2.2",
42-
"karma-coverage-istanbul-reporter": "^0.2.0",
43-
"protractor": "~5.1.0",
44-
"ts-node": "~2.0.0",
45-
"tslint": "~4.5.0",
46-
"typescript": "^2.3.0"
45+
"protractor": "~5.1.2",
46+
"ts-node": "~3.2.0",
47+
"tslint": "~5.7.0",
48+
"typescript": "~2.4.2"
4749
}
4850
}

build-tool-examples/angular-cli/src/app/app.module.ts

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { AppComponent } from './app.component';
1313
],
1414
imports: [
1515
BrowserModule,
16+
BrowserAnimationsModule,
1617
FormsModule,
1718
HttpModule,
1819
CalendarModule.forRoot()

build-tool-examples/angular-cli/src/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<title>AngularCli</title>
5+
<title>Angular angular CLI example</title>
66
<base href="/">
77

88
<meta name="viewport" content="width=device-width, initial-scale=1">
99
<link rel="icon" type="image/x-icon" href="favicon.ico">
1010
</head>
1111
<body>
12-
<app-root>Loading...</app-root>
12+
<app-root></app-root>
1313
</body>
1414
</html>

build-tool-examples/angular-cli/src/main.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ if (environment.production) {
88
enableProdMode();
99
}
1010

11-
platformBrowserDynamic().bootstrapModule(AppModule);
11+
platformBrowserDynamic().bootstrapModule(AppModule)
12+
.catch(err => console.log(err));

build-tool-examples/angular-cli/src/polyfills.ts

+9-15
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,31 @@
3131
// import 'core-js/es6/array';
3232
// import 'core-js/es6/regexp';
3333
// import 'core-js/es6/map';
34+
// import 'core-js/es6/weak-map';
3435
// import 'core-js/es6/set';
3536

3637
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
3738
// import 'classlist.js'; // Run `npm install --save classlist.js`.
3839

39-
/** IE10 and IE11 requires the following to support `@angular/animation`. */
40-
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
40+
/** IE10 and IE11 requires the following for the Reflect API. */
41+
// import 'core-js/es6/reflect';
4142

4243

4344
/** Evergreen browsers require these. **/
44-
import 'core-js/es6/reflect';
45+
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
4546
import 'core-js/es7/reflect';
4647

4748

48-
/** ALL Firefox browsers require the following to support `@angular/animation`. **/
49+
/**
50+
* Required to support Web Animations `@angular/platform-browser/animations`.
51+
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
52+
**/
4953
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
5054

5155

5256

5357
/***************************************************************************************************
54-
* Zone JS is required by Angular itself.
58+
* Zone JS is required by default for Angular itself.
5559
*/
5660
import 'zone.js/dist/zone'; // Included with Angular CLI.
5761

@@ -60,13 +64,3 @@ import 'zone.js/dist/zone'; // Included with Angular CLI.
6064
/***************************************************************************************************
6165
* APPLICATION IMPORTS
6266
*/
63-
64-
/**
65-
* Date, currency, decimal and percent pipes.
66-
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
67-
*/
68-
// import 'intl'; // Run `npm install --save intl`.
69-
/**
70-
* Need to import at least one locale-data with intl.
71-
*/
72-
// import 'intl/locale-data/jsonp/en';

build-tool-examples/angular-cli/src/test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import {
1313
} from '@angular/platform-browser-dynamic/testing';
1414

1515
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
16-
declare var __karma__: any;
17-
declare var require: any;
16+
declare const __karma__: any;
17+
declare const require: any;
1818

1919
// Prevent Karma from running prematurely.
2020
__karma__.loaded = function () {};

build-tool-examples/angular-cli/src/tsconfig.app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../out-tsc/app",
5+
"baseUrl": "./",
56
"module": "es2015",
6-
"baseUrl": "",
77
"types": []
88
},
99
"exclude": [

build-tool-examples/angular-cli/src/tsconfig.spec.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../out-tsc/spec",
5+
"baseUrl": "./",
56
"module": "commonjs",
67
"target": "es5",
7-
"baseUrl": "",
88
"types": [
99
"jasmine",
1010
"node"

build-tool-examples/angular-cli/tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"compileOnSave": false,
33
"compilerOptions": {
44
"outDir": "./dist/out-tsc",
5-
"baseUrl": "src",
65
"sourceMap": true,
76
"declaration": false,
87
"moduleResolution": "node",
@@ -13,7 +12,7 @@
1312
"node_modules/@types"
1413
],
1514
"lib": [
16-
"es2016",
15+
"es2017",
1716
"dom"
1817
]
1918
}

0 commit comments

Comments
 (0)