chore: use tsconfig lib (#2840)
This commit is contained in:
parent
448fd4f0b3
commit
1303706542
@ -15,12 +15,7 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/angular/angular.io.git"
|
"url": "https://github.com/angular/angular.io.git"
|
||||||
},
|
},
|
||||||
"licenses": [
|
"license": "MIT",
|
||||||
{
|
|
||||||
"type": "MIT",
|
|
||||||
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": ""
|
"url": ""
|
||||||
},
|
},
|
||||||
|
@ -24,12 +24,7 @@
|
|||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
"licenses": [
|
"license": "MIT",
|
||||||
{
|
|
||||||
"type": "MIT",
|
|
||||||
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"repository": {}
|
"repository": {}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"removeComments": false,
|
"lib": ["es2015", "dom"],
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
"suppressImplicitAnyIndexErrors": true,
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"removeComments": false,
|
"lib": ["es2015", "dom"],
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"suppressImplicitAnyIndexErrors": true
|
"suppressImplicitAnyIndexErrors": true
|
||||||
},
|
},
|
||||||
|
@ -8,12 +8,7 @@
|
|||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
"licenses": [
|
"license": "MIT",
|
||||||
{
|
|
||||||
"type": "MIT",
|
|
||||||
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "~2.2.0",
|
"@angular/common": "~2.2.0",
|
||||||
"@angular/compiler": "~2.2.0",
|
"@angular/compiler": "~2.2.0",
|
||||||
@ -27,7 +22,7 @@
|
|||||||
"@angular/router": "~3.2.0",
|
"@angular/router": "~3.2.0",
|
||||||
"@angular/upgrade": "~2.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",
|
"core-js": "^2.4.1",
|
||||||
"reflect-metadata": "^0.1.8",
|
"reflect-metadata": "^0.1.8",
|
||||||
@ -46,7 +41,6 @@
|
|||||||
"@types/angular-resource": "^1.5.6",
|
"@types/angular-resource": "^1.5.6",
|
||||||
"@types/angular-route": "^1.3.2",
|
"@types/angular-route": "^1.3.2",
|
||||||
"@types/angular-sanitize": "^1.3.3",
|
"@types/angular-sanitize": "^1.3.3",
|
||||||
"@types/core-js": "^0.9.34",
|
|
||||||
"@types/jasmine": "~2.5.36",
|
"@types/jasmine": "~2.5.36",
|
||||||
"@types/node": "^6.0.45",
|
"@types/node": "^6.0.45",
|
||||||
"@types/selenium-webdriver": "^2.53.32",
|
"@types/selenium-webdriver": "^2.53.32",
|
||||||
|
@ -5,12 +5,7 @@
|
|||||||
"start": "npm run lite",
|
"start": "npm run lite",
|
||||||
"lite": "lite-server"
|
"lite": "lite-server"
|
||||||
},
|
},
|
||||||
"licenses": [
|
"license": "MIT",
|
||||||
{
|
|
||||||
"type": "MIT",
|
|
||||||
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "~2.2.0",
|
"@angular/common": "~2.2.0",
|
||||||
"@angular/compiler": "~2.2.0",
|
"@angular/compiler": "~2.2.0",
|
||||||
|
@ -7,12 +7,7 @@
|
|||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"tsc:w": "tsc -w"
|
"tsc:w": "tsc -w"
|
||||||
},
|
},
|
||||||
"licenses": [
|
"license": "MIT",
|
||||||
{
|
|
||||||
"type": "MIT",
|
|
||||||
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "~2.2.0",
|
"@angular/common": "~2.2.0",
|
||||||
"@angular/compiler": "~2.2.0",
|
"@angular/compiler": "~2.2.0",
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"removeComments": false,
|
"lib": ["es2015", "dom"],
|
||||||
"noImplicitAny": false
|
"noImplicitAny": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,12 +7,7 @@
|
|||||||
"lite": "lite-server",
|
"lite": "lite-server",
|
||||||
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" "
|
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" "
|
||||||
},
|
},
|
||||||
"licenses": [
|
"license": "MIT",
|
||||||
{
|
|
||||||
"type": "MIT",
|
|
||||||
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular2": "2.0.0-beta.0",
|
"angular2": "2.0.0-beta.0",
|
||||||
"systemjs": "0.19.6",
|
"systemjs": "0.19.6",
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"removeComments": false,
|
"lib": ["es2015", "dom"],
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
"suppressImplicitAnyIndexErrors": true,
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"removeComments": false,
|
"lib": ["es2015", "dom"],
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
"suppressImplicitAnyIndexErrors": true,
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
|
@ -4,12 +4,7 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"description": "A tutorial application for AngularJS",
|
"description": "A tutorial application for AngularJS",
|
||||||
"repository": "https://github.com/angular/angular-phonecat",
|
"repository": "https://github.com/angular/angular-phonecat",
|
||||||
"licenses": [
|
"license": "MIT",
|
||||||
{
|
|
||||||
"type": "MIT",
|
|
||||||
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"bower": "^1.7.7",
|
"bower": "^1.7.7",
|
||||||
"http-server": "^0.9.0",
|
"http-server": "^0.9.0",
|
||||||
|
@ -7,12 +7,7 @@
|
|||||||
"test": "karma start",
|
"test": "karma start",
|
||||||
"build": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail"
|
"build": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail"
|
||||||
},
|
},
|
||||||
"licenses": [
|
"license": "MIT",
|
||||||
{
|
|
||||||
"type": "MIT",
|
|
||||||
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "~2.2.0",
|
"@angular/common": "~2.2.0",
|
||||||
"@angular/compiler": "~2.2.0",
|
"@angular/compiler": "~2.2.0",
|
||||||
@ -27,7 +22,6 @@
|
|||||||
"zone.js": "^0.6.25"
|
"zone.js": "^0.6.25"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/core-js": "^0.9.34",
|
|
||||||
"@types/node": "^6.0.45",
|
"@types/node": "^6.0.45",
|
||||||
"@types/jasmine": "^2.5.35",
|
"@types/jasmine": "^2.5.35",
|
||||||
"angular2-template-loader": "^0.4.0",
|
"angular2-template-loader": "^0.4.0",
|
||||||
|
@ -74,6 +74,20 @@ a(id="typings")
|
|||||||
|
|
||||||
**You need do nothing to get *typings* files for library packages that include `d.ts` files—as all Angular packages do.**
|
**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
|
### Installable typings files
|
||||||
Many libraries—jQuery, Jasmine, and Lodash among them—do *not* include `d.ts` files in their npm packages.
|
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
|
Fortunately, either their authors or community contributors have created separate `d.ts` files for these libraries and
|
||||||
@ -86,10 +100,7 @@ a(id="typings")
|
|||||||
For instance, to install typings for `jasmine` we could do `npm install @types/jasmine --save-dev`.
|
For instance, to install typings for `jasmine` we could do `npm install @types/jasmine --save-dev`.
|
||||||
|
|
||||||
:marked
|
:marked
|
||||||
QuickStart identified three *typings* (`d.ts`) files:
|
QuickStart identified two *typings* (`d.ts`) files:
|
||||||
|
|
||||||
* [core-js](https://github.com/zloirock/core-js/blob/master/README.md)
|
|
||||||
brings ES2015/ES6 capabilities to ES5 browsers
|
|
||||||
|
|
||||||
* [jasmine](http://jasmine.github.io/) typings for the Jasmine test framework
|
* [jasmine](http://jasmine.github.io/) typings for the Jasmine test framework
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user