chore: use tsconfig lib (#2840)

This commit is contained in:
Jesús Rodríguez 2016-11-21 02:28:37 +01:00 committed by Ward Bell
parent 448fd4f0b3
commit 1303706542
14 changed files with 31 additions and 62 deletions

View File

@ -15,12 +15,7 @@
"type": "git",
"url": "https://github.com/angular/angular.io.git"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
}
],
"license": "MIT",
"bugs": {
"url": ""
},

View File

@ -24,12 +24,7 @@
},
"keywords": [],
"author": "",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
}
],
"license": "MIT",
"dependencies": {},
"devDependencies": {},
"repository": {}

View File

@ -6,7 +6,7 @@
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"lib": ["es2015", "dom"],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"typeRoots": [

View File

@ -6,7 +6,7 @@
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"lib": ["es2015", "dom"],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true
},

View File

@ -8,12 +8,7 @@
},
"keywords": [],
"author": "",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
}
],
"license": "MIT",
"dependencies": {
"@angular/common": "~2.2.0",
"@angular/compiler": "~2.2.0",
@ -27,7 +22,7 @@
"@angular/router": "~3.2.0",
"@angular/upgrade": "~2.2.0",
"angular-in-memory-web-api": "~0.1.15",
"angular-in-memory-web-api": "~0.1.16",
"core-js": "^2.4.1",
"reflect-metadata": "^0.1.8",
@ -46,7 +41,6 @@
"@types/angular-resource": "^1.5.6",
"@types/angular-route": "^1.3.2",
"@types/angular-sanitize": "^1.3.3",
"@types/core-js": "^0.9.34",
"@types/jasmine": "~2.5.36",
"@types/node": "^6.0.45",
"@types/selenium-webdriver": "^2.53.32",

View File

@ -5,12 +5,7 @@
"start": "npm run lite",
"lite": "lite-server"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
}
],
"license": "MIT",
"dependencies": {
"@angular/common": "~2.2.0",
"@angular/compiler": "~2.2.0",

View File

@ -7,12 +7,7 @@
"tsc": "tsc",
"tsc:w": "tsc -w"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
}
],
"license": "MIT",
"dependencies": {
"@angular/common": "~2.2.0",
"@angular/compiler": "~2.2.0",

View File

@ -6,7 +6,7 @@
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"lib": ["es2015", "dom"],
"noImplicitAny": false
}
}

View File

@ -7,12 +7,7 @@
"lite": "lite-server",
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" "
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
}
],
"license": "MIT",
"dependencies": {
"angular2": "2.0.0-beta.0",
"systemjs": "0.19.6",

View File

@ -6,7 +6,7 @@
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"lib": ["es2015", "dom"],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"typeRoots": [

View File

@ -8,7 +8,7 @@
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"lib": ["es2015", "dom"],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"typeRoots": [

View File

@ -4,12 +4,7 @@
"version": "0.0.0",
"description": "A tutorial application for AngularJS",
"repository": "https://github.com/angular/angular-phonecat",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
}
],
"license": "MIT",
"devDependencies": {
"bower": "^1.7.7",
"http-server": "^0.9.0",

View File

@ -7,12 +7,7 @@
"test": "karma start",
"build": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
}
],
"license": "MIT",
"dependencies": {
"@angular/common": "~2.2.0",
"@angular/compiler": "~2.2.0",
@ -27,7 +22,6 @@
"zone.js": "^0.6.25"
},
"devDependencies": {
"@types/core-js": "^0.9.34",
"@types/node": "^6.0.45",
"@types/jasmine": "^2.5.35",
"angular2-template-loader": "^0.4.0",

View File

@ -73,7 +73,21 @@ a(id="typings")
The `node_modules/@angular/core/` folder of any Angular application contains several `d.ts` files that describe parts of Angular.
**You need do nothing to get *typings* files for library packages that include `d.ts` files—as all Angular packages do.**
### lib.d.ts
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.
Based on the `--target`, TypeScript adds _additional_ ambient declarations like `Promise` if our target is `es6`.
Since the QuickStart is targeting `es5`, we can override the list of declaration files to be included:
code-example(format=".")
"lib": ["es2015", "dom"]
:marked
Thanks to that, we have all the `es6` typings even when targeting `es5`.
### Installable typings files
Many libraries—jQuery, Jasmine, and Lodash among them—do *not* include `d.ts` files in their npm packages.
Fortunately, either their authors or community contributors have created separate `d.ts` files for these libraries and
@ -86,11 +100,8 @@ a(id="typings")
For instance, to install typings for `jasmine` we could do `npm install @types/jasmine --save-dev`.
:marked
QuickStart identified three *typings* (`d.ts`) files:
* [core-js](https://github.com/zloirock/core-js/blob/master/README.md)
brings ES2015/ES6 capabilities to ES5 browsers
QuickStart identified two *typings* (`d.ts`) files:
* [jasmine](http://jasmine.github.io/) typings for the Jasmine test framework
* [node](https://www.npmjs.com/package/@types/node) for code that references objects in the *nodejs* environment;