Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 1303706

Browse files
Foxandxsswardbell
authored andcommitted
chore: use tsconfig lib (#2840)
1 parent 448fd4f commit 1303706

File tree

14 files changed

+31
-62
lines changed

14 files changed

+31
-62
lines changed

package.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@
1515
"type": "git",
1616
"url": "https://github.com/angular/angular.io.git"
1717
},
18-
"licenses": [
19-
{
20-
"type": "MIT",
21-
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
22-
}
23-
],
18+
"license": "MIT",
2419
"bugs": {
2520
"url": ""
2621
},

public/docs/_examples/_boilerplate/package.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@
2424
},
2525
"keywords": [],
2626
"author": "",
27-
"licenses": [
28-
{
29-
"type": "MIT",
30-
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
31-
}
32-
],
27+
"license": "MIT",
3328
"dependencies": {},
3429
"devDependencies": {},
3530
"repository": {}

public/docs/_examples/_boilerplate/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"sourceMap": true,
77
"emitDecoratorMetadata": true,
88
"experimentalDecorators": true,
9-
"removeComments": false,
9+
"lib": ["es2015", "dom"],
1010
"noImplicitAny": true,
1111
"suppressImplicitAnyIndexErrors": true,
1212
"typeRoots": [

public/docs/_examples/cb-aot-compiler/ts/tsconfig-aot.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"sourceMap": true,
77
"emitDecoratorMetadata": true,
88
"experimentalDecorators": true,
9-
"removeComments": false,
9+
"lib": ["es2015", "dom"],
1010
"noImplicitAny": true,
1111
"suppressImplicitAnyIndexErrors": true
1212
},

public/docs/_examples/package.json

+2-8
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@
88
},
99
"keywords": [],
1010
"author": "",
11-
"licenses": [
12-
{
13-
"type": "MIT",
14-
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
15-
}
16-
],
11+
"license": "MIT",
1712
"dependencies": {
1813
"@angular/common": "~2.2.0",
1914
"@angular/compiler": "~2.2.0",
@@ -27,7 +22,7 @@
2722
"@angular/router": "~3.2.0",
2823
"@angular/upgrade": "~2.2.0",
2924

30-
"angular-in-memory-web-api": "~0.1.15",
25+
"angular-in-memory-web-api": "~0.1.16",
3126

3227
"core-js": "^2.4.1",
3328
"reflect-metadata": "^0.1.8",
@@ -46,7 +41,6 @@
4641
"@types/angular-resource": "^1.5.6",
4742
"@types/angular-route": "^1.3.2",
4843
"@types/angular-sanitize": "^1.3.3",
49-
"@types/core-js": "^0.9.34",
5044
"@types/jasmine": "~2.5.36",
5145
"@types/node": "^6.0.45",
5246
"@types/selenium-webdriver": "^2.53.32",

public/docs/_examples/quickstart/js/package.1.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
"start": "npm run lite",
66
"lite": "lite-server"
77
},
8-
"licenses": [
9-
{
10-
"type": "MIT",
11-
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
12-
}
13-
],
8+
"license": "MIT",
149
"dependencies": {
1510
"@angular/common": "~2.2.0",
1611
"@angular/compiler": "~2.2.0",

public/docs/_examples/quickstart/ts/package.1.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
"tsc": "tsc",
88
"tsc:w": "tsc -w"
99
},
10-
"licenses": [
11-
{
12-
"type": "MIT",
13-
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
14-
}
15-
],
10+
"license": "MIT",
1611
"dependencies": {
1712
"@angular/common": "~2.2.0",
1813
"@angular/compiler": "~2.2.0",

public/docs/_examples/quickstart/ts/tsconfig.1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"sourceMap": true,
77
"emitDecoratorMetadata": true,
88
"experimentalDecorators": true,
9-
"removeComments": false,
9+
"lib": ["es2015", "dom"],
1010
"noImplicitAny": false
1111
}
1212
}

public/docs/_examples/styleguide/package.1.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
"lite": "lite-server",
88
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" "
99
},
10-
"licenses": [
11-
{
12-
"type": "MIT",
13-
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
14-
}
15-
],
10+
"license": "MIT",
1611
"dependencies": {
1712
"angular2": "2.0.0-beta.0",
1813
"systemjs": "0.19.6",

public/docs/_examples/toh-6/ts/tsconfig-aot.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"sourceMap": true,
77
"emitDecoratorMetadata": true,
88
"experimentalDecorators": true,
9-
"removeComments": false,
9+
"lib": ["es2015", "dom"],
1010
"noImplicitAny": true,
1111
"suppressImplicitAnyIndexErrors": true,
1212
"typeRoots": [

public/docs/_examples/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"sourceMap": true,
99
"emitDecoratorMetadata": true,
1010
"experimentalDecorators": true,
11-
"removeComments": false,
11+
"lib": ["es2015", "dom"],
1212
"noImplicitAny": true,
1313
"suppressImplicitAnyIndexErrors": true,
1414
"typeRoots": [

public/docs/_examples/upgrade-phonecat-2-hybrid/ts/package.ng1.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
"version": "0.0.0",
55
"description": "A tutorial application for AngularJS",
66
"repository": "https://github.com/angular/angular-phonecat",
7-
"licenses": [
8-
{
9-
"type": "MIT",
10-
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
11-
}
12-
],
7+
"license": "MIT",
138
"devDependencies": {
149
"bower": "^1.7.7",
1510
"http-server": "^0.9.0",

public/docs/_examples/webpack/ts/package.webpack.json

+1-7
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
"test": "karma start",
88
"build": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail"
99
},
10-
"licenses": [
11-
{
12-
"type": "MIT",
13-
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
14-
}
15-
],
10+
"license": "MIT",
1611
"dependencies": {
1712
"@angular/common": "~2.2.0",
1813
"@angular/compiler": "~2.2.0",
@@ -27,7 +22,6 @@
2722
"zone.js": "^0.6.25"
2823
},
2924
"devDependencies": {
30-
"@types/core-js": "^0.9.34",
3125
"@types/node": "^6.0.45",
3226
"@types/jasmine": "^2.5.35",
3327
"angular2-template-loader": "^0.4.0",

public/docs/ts/latest/guide/typescript-configuration.jade

+17-6
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,21 @@ a(id="typings")
7373
The `node_modules/@angular/core/` folder of any Angular application contains several `d.ts` files that describe parts of Angular.
7474

7575
**You need do nothing to get *typings* files for library packages that include `d.ts` files—as all Angular packages do.**
76-
76+
77+
### lib.d.ts
78+
79+
TypeScript includes a special declaration file called `lib.d.ts`. This file contains the ambient declarations for various common JavaScript constructs present in JavaScript runtimes and the DOM.
80+
81+
Based on the `--target`, TypeScript adds _additional_ ambient declarations like `Promise` if our target is `es6`.
82+
83+
Since the QuickStart is targeting `es5`, we can override the list of declaration files to be included:
84+
85+
code-example(format=".")
86+
"lib": ["es2015", "dom"]
87+
88+
:marked
89+
Thanks to that, we have all the `es6` typings even when targeting `es5`.
90+
7791
### Installable typings files
7892
Many libraries—jQuery, Jasmine, and Lodash among them—do *not* include `d.ts` files in their npm packages.
7993
Fortunately, either their authors or community contributors have created separate `d.ts` files for these libraries and
@@ -86,11 +100,8 @@ a(id="typings")
86100
For instance, to install typings for `jasmine` we could do `npm install @types/jasmine --save-dev`.
87101

88102
:marked
89-
QuickStart identified three *typings* (`d.ts`) files:
90-
91-
* [core-js](https://github.com/zloirock/core-js/blob/master/README.md)
92-
brings ES2015/ES6 capabilities to ES5 browsers
93-
103+
QuickStart identified two *typings* (`d.ts`) files:
104+
94105
* [jasmine](http://jasmine.github.io/) typings for the Jasmine test framework
95106

96107
* [node](https://www.npmjs.com/package/@types/node) for code that references objects in the *nodejs* environment;

0 commit comments

Comments
 (0)