Skip to content

Commit 0d49fec

Browse files
filipesilvawardbell
authored andcommitted
chore: update to @types (angular#1872)
* chore: update examples to @types * fix toh-6 aot and add types link
1 parent 75f37b7 commit 0d49fec

Some content is hidden

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

41 files changed

+85
-199
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ node_modules
22
_temp
33
bower_components
44
jspm_packages
5-
typings
65
**/packages
76
build
87
pubspec.lock

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ take the following extra steps to prepare the environment:
8989
1. cd back up to `angular.io` root: `cd ../../..`
9090

9191
1. run `gulp add-example-boilerplate` (elevate to admin on Windows)
92-
to copy canonical files to the sample directories and create symlinks there for node_modules and typings.
92+
to copy canonical files to the sample directories and create symlinks there for node_modules.
9393

9494
Now cd into any particular sample's language directory (e.g., `public/docs/_examples/quickstart/ts`) and try:
9595
- `npm start` to simultaneously compile-with-watch and serve-in-browser-with-watch

gulpfile.js

+3-24
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ var _apiShredOptionsForDart = {
8585
logLevel: _dgeniLogLevel
8686
};
8787

88-
var _excludePatterns = ['**/node_modules/**', '**/typings/**', '**/packages/**'];
88+
var _excludePatterns = ['**/node_modules/**', '**/packages/**'];
8989

9090
var _excludeMatchers = _excludePatterns.map(function(excludePattern){
9191
return new Minimatch(excludePattern)
@@ -461,13 +461,6 @@ gulp.task('add-example-boilerplate', function(done) {
461461
fsUtils.addSymlink(realPath, linkPath);
462462
});
463463

464-
realPath = path.join(EXAMPLES_PATH, '/typings');
465-
var typingsPaths = excludeDartPaths(getTypingsPaths(EXAMPLES_PATH));
466-
typingsPaths.forEach(function(linkPath) {
467-
gutil.log("symlinking " + linkPath + ' -> ' + realPath)
468-
fsUtils.addSymlink(realPath, linkPath);
469-
});
470-
471464
return buildStyles(copyExampleBoilerplate, done);
472465
});
473466

@@ -530,11 +523,6 @@ gulp.task('remove-example-boilerplate', function() {
530523
fsUtils.removeSymlink(linkPath);
531524
});
532525

533-
var typingsPaths = getTypingsPaths(EXAMPLES_PATH);
534-
typingsPaths.forEach(function(linkPath) {
535-
fsUtils.removeSymlink(linkPath);
536-
});
537-
538526
deleteExampleBoilerPlate();
539527
});
540528

@@ -818,7 +806,7 @@ gulp.task('_harp-compile', function() {
818806

819807
gulp.task('_shred-devguide-examples', ['_shred-clean-devguide', '_copy-example-boilerplate'], function() {
820808
// Split big shredding task into partials 2016-06-14
821-
var examplePaths = globby.sync(EXAMPLES_PATH+'/*/', {ignore: ['/node_modules', 'typings/']});
809+
var examplePaths = globby.sync(EXAMPLES_PATH+'/*/', {ignore: ['/node_modules']});
822810
var promise = Promise.resolve(true);
823811
examplePaths.forEach(function (examplePath) {
824812
promise = promise.then(() => docShredder.shredSingleExampleDir(_devguideShredOptions, examplePath));
@@ -877,8 +865,6 @@ gulp.task('lint', function() {
877865
'!./public/docs/_examples/**/ts-snippets/*.ts',
878866
'!./public/docs/_examples/style-guide/ts/**/*.avoid.ts',
879867
'!./public/docs/_examples/**/node_modules/**/*',
880-
'!./public/docs/_examples/**/typings/**/*',
881-
'!./public/docs/_examples/**/typings-ng1/**/*',
882868
'!./public/docs/_examples/**/build/**/*',
883869
// temporary until codelyzer is fixed mgechev/codelyzer#60
884870
'!./public/docs/_examples/animations/ts/app/hero.service.ts'
@@ -1140,13 +1126,6 @@ function getNodeModulesPaths(basePath) {
11401126
return paths;
11411127
}
11421128

1143-
function getTypingsPaths(basePath) {
1144-
var paths = getExamplePaths(basePath).map(function(examplePath) {
1145-
return path.join(examplePath, "/typings");
1146-
});
1147-
return paths;
1148-
}
1149-
11501129
function getExamplePaths(basePath, includeBase) {
11511130
// includeBase defaults to false
11521131
return getPaths(basePath, _exampleConfigFilename, includeBase);
@@ -1281,7 +1260,7 @@ function devGuideExamplesWatch(shredOptions, postShredAction, focus) {
12811260
// removed this version because gulp.watch has the same glob issue that dgeni has.
12821261
// var excludePattern = '!' + path.join(shredOptions.examplesDir, '**/node_modules/**/*.*');
12831262
// gulp.watch([includePattern, excludePattern], {readDelay: 500}, function (event, done) {
1284-
var ignoreThese = [ '**/node_modules/**', '**/_fragments/**', '**/dist/**', '**/typings/**',
1263+
var ignoreThese = [ '**/node_modules/**', '**/_fragments/**', '**/dist/**',
12851264
'**/dart/.pub/**', '**/dart/build/**', '**/dart/packages/**'];
12861265
ignoreThese = ignoreThese.concat(_exampleBoilerplateFiles.map((file) => `public/docs/_examples/*/*/${file}`));
12871266
var files = globby.sync( [includePattern], { ignore: ignoreThese });

public/docs/_examples/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package.json
77
systemjs.config.js
88
tsconfig.json
99
tslint.json
10-
typings.json
1110
wallaby.js
1211

1312
_test-output

public/docs/_examples/_boilerplate/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"http-server:cli": "http-server dist/",
1111
"lite": "lite-server",
1212
"lite:aot": "lite-server -c aot/bs-config.json",
13-
"postinstall": "typings install",
1413
"test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"",
1514
"tsc": "tsc",
1615
"tsc:w": "tsc -w",

public/docs/_examples/_boilerplate/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"removeComments": false,
1010
"noImplicitAny": true,
1111
"suppressImplicitAnyIndexErrors": true,
12-
"types": []
12+
"typeRoots": [
13+
"../../node_modules/@types/"
14+
]
1315
},
1416
"exclude": [
1517
"node_modules/*",

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

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
"experimentalDecorators": true,
99
"removeComments": false,
1010
"noImplicitAny": true,
11-
"suppressImplicitAnyIndexErrors": true,
12-
"types": []
11+
"suppressImplicitAnyIndexErrors": true
1312
},
1413

1514
"files": [
1615
"app/app.module.ts",
17-
"app/main.ts",
18-
"./typings/index.d.ts"
16+
"app/main.ts"
1917
],
2018

2119
"angularCompilerOptions": {

public/docs/_examples/cb-visual-studio-2015/ts/tsconfig.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
"experimentalDecorators": true,
99
"removeComments": false,
1010
"noImplicitAny": true,
11-
"suppressImplicitAnyIndexErrors": true
11+
"suppressImplicitAnyIndexErrors": true,
12+
"typeRoots": [
13+
"node_modules/@types"
14+
]
1215
},
1316
"compileOnSave": true
1417
}

public/docs/_examples/cli-quickstart/ts/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
/libpeerconnection.log
1919
npm-debug.log
2020
testem.log
21-
/typings
2221

2322
# e2e
2423
/e2e/*.js
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
/// <reference path="../typings/index.d.ts" />

public/docs/_examples/package.json

+10-6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
"version": "1.0.0",
44
"description": "Master package.json, the superset of all dependencies for all of the _example package.json files. See _boilerplate/package.json for example npm scripts.",
55
"scripts": {
6-
"postinstall": "typings install",
7-
"typings": "typings",
86
"protractor": "protractor",
97
"webdriver:update": "webdriver-manager update"
108
},
@@ -42,8 +40,16 @@
4240
"zone.js": "^0.6.25"
4341
},
4442
"devDependencies": {
45-
"@types/angular": "^1.5.15",
46-
"@types/jasmine": "^2.2.34",
43+
"@types/angular": "^1.5.16",
44+
"@types/angular-animate": "^1.5.5",
45+
"@types/angular-cookies": "^1.4.2",
46+
"@types/angular-mocks": "^1.5.5",
47+
"@types/angular-resource": "^1.5.6",
48+
"@types/angular-route": "^1.3.2",
49+
"@types/angular-sanitize": "^1.3.3",
50+
"@types/core-js": "^0.9.34",
51+
"@types/jasmine": "^2.5.35",
52+
"@types/node": "^6.0.45",
4753
"@types/selenium-webdriver": "^2.53.32",
4854
"angular2-template-loader": "^0.4.0",
4955
"awesome-typescript-loader": "^2.2.4",
@@ -76,11 +82,9 @@
7682
"rollup-plugin-commonjs": "^4.1.0",
7783
"source-map-explorer": "^1.3.2",
7884
"style-loader": "^0.13.1",
79-
"ts-loader": "^0.8.2",
8085
"ts-node": "^1.3.0",
8186
"tslint": "^3.15.1",
8287
"typescript": "^2.0.3",
83-
"typings": "^1.4.0",
8488
"webpack": "^1.13.0",
8589
"webpack-dev-server": "^1.14.1",
8690
"webpack-merge": "^0.14.0"

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
"scripts": {
55
"start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",
66
"lite": "lite-server",
7-
"postinstall": "typings install",
87
"tsc": "tsc",
9-
"tsc:w": "tsc -w",
10-
"typings": "typings"
8+
"tsc:w": "tsc -w"
119
},
1210
"licenses": [
1311
{
@@ -35,9 +33,10 @@
3533
"zone.js": "^0.6.25"
3634
},
3735
"devDependencies": {
36+
"@types/core-js": "^0.9.34",
37+
"@types/node": "^6.0.45",
3838
"concurrently": "^3.0.0",
3939
"lite-server": "^2.2.2",
40-
"typescript": "^2.0.3",
41-
"typings":"^1.4.0"
40+
"typescript": "^2.0.3"
4241
}
4342
}

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

-7
This file was deleted.

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
"removeComments": false,
1010
"noImplicitAny": true,
1111
"suppressImplicitAnyIndexErrors": true,
12-
"types": []
12+
"typeRoots": [
13+
"../../node_modules/@types/"
14+
]
1315
},
1416

1517
"files": [
1618
"app/app.module.ts",
17-
"app/main-aot.ts",
18-
"typings/index.d.ts"
19+
"app/main-aot.ts"
1920
],
2021

2122
"angularCompilerOptions": {

public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/main.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// #docregion import-adapter
22
import { UpgradeAdapter } from '@angular/upgrade';
3+
declare var angular: any;
34

45
import { AppModule } from './app.module';
56
// #enddocregion import-adapter

public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ng1.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// #docregion
22
import { Phone, PhoneData } from '../core/phone/phone.service';
3+
declare var angular: any;
34

45
class PhoneDetailController {
56
phone: PhoneData;

public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.ng1.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// #docregion
22
import { Phone, PhoneData } from '../core/phone/phone.service';
3+
declare var angular: any;
34

45
class PhoneListController {
56
phones: PhoneData[];

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"scripts": {
66
"start": "webpack-dev-server --inline --progress --port 8080",
77
"test": "karma start",
8-
"build": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail",
9-
"postinstall": "typings install"
8+
"build": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail"
109
},
1110
"licenses": [
1211
{
@@ -28,6 +27,9 @@
2827
"zone.js": "^0.6.25"
2928
},
3029
"devDependencies": {
30+
"@types/core-js": "^0.9.34",
31+
"@types/node": "^6.0.45",
32+
"@types/jasmine": "^2.5.35",
3133
"angular2-template-loader": "^0.4.0",
3234
"awesome-typescript-loader": "^2.2.4",
3335
"css-loader": "^0.23.1",
@@ -47,7 +49,6 @@
4749
"rimraf": "^2.5.2",
4850
"style-loader": "^0.13.1",
4951
"typescript": "^2.0.2",
50-
"typings": "^1.3.2",
5152
"webpack": "^1.13.0",
5253
"webpack-dev-server": "^1.14.1",
5354
"webpack-merge": "^0.14.0"

public/docs/_examples/webpack/ts/typings.1.json

-7
This file was deleted.

public/docs/js/latest/guide/forms.jade

-2
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,9 @@ figure.image-display
624624
.file hero-form.component.js
625625
.file main.ts
626626
.file node_modules ...
627-
.file typings ...
628627
.file index.html
629628
.file package.json
630629
.file tsconfig.json
631-
.file typings.json
632630
:marked
633631
Here’s the final version of the source:
634632

public/docs/ts/_cache/quickstart.jade

-4
Original file line numberDiff line numberDiff line change
@@ -581,13 +581,11 @@ block project-file-structure
581581
.file app.module.ts
582582
.file main.ts
583583
.file node_modules ...
584-
.file typings ...
585584
.file index.html
586585
.file package.json
587586
.file styles.css
588587
.file systemjs.config.js
589588
.file tsconfig.json
590-
.file typings.json
591589
:marked
592590
Here are the file contents:
593591

@@ -599,7 +597,6 @@ block project-files
599597
quickstart/ts/index.html,
600598
quickstart/ts/package.1.json,
601599
quickstart/ts/tsconfig.1.json,
602-
quickstart/ts/typings.1.json,
603600
quickstart/ts/styles.css,
604601
quickstart/ts/systemjs.config.1.js`
605602
,
@@ -610,7 +607,6 @@ block project-files
610607
index.html,
611608
package.json,
612609
tsconfig.json,
613-
typings.json,
614610
styles.css (excerpt),
615611
systemjs.config.js`)
616612

public/docs/ts/_cache/tutorial/toh-pt5.jade

-4
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,11 @@ block intro-file-tree
6464
.file main.ts
6565
.file mock-heroes.ts
6666
.file node_modules ...
67-
.file typings ...
6867
.file index.html
6968
.file package.json
7069
.file styles.css
7170
.file systemjs.config.js
7271
.file tsconfig.json
73-
.file typings.json
7472

7573
block keep-app-running
7674
:marked
@@ -883,13 +881,11 @@ block file-tree-end
883881
.file main.ts
884882
.file mock-heroes.ts
885883
.file node_modules ...
886-
.file typings ...
887884
.file index.html
888885
.file package.json
889886
.file styles.css
890887
.file systemjs.config.js
891888
.file tsconfig.json
892-
.file typings.json
893889

894890
.l-main-section
895891
:marked

public/docs/ts/_cache/tutorial/toh-pt6.jade

-2
Original file line numberDiff line numberDiff line change
@@ -559,13 +559,11 @@ block filetree
559559
.file main.ts
560560
.file in-memory-data.service.ts (new)
561561
.file node_modules ...
562-
.file typings ...
563562
.file index.html
564563
.file package.json
565564
.file styles.css
566565
.file systemjs.config.js
567566
.file tsconfig.json
568-
.file typings.json
569567

570568
.l-main-section
571569
:marked

public/docs/ts/latest/cookbook/visual-studio-2015.jade

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ h2#copy Step 4: Copy the QuickStart files into the ASP.NET project folder
8888
* index.html
8989
* package.json
9090
* tsconfig.json
91-
* typings.json
9291

9392
.l-main-section
9493
h2#restore Step 5: Restore the required packages

0 commit comments

Comments
 (0)