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

Commit 4697809

Browse files
committed
chore: update examples to @types
1 parent 69ae63c commit 4697809

Some content is hidden

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

64 files changed

+54
-12574
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

+4-25
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var _apiShredOptionsForDart = {
8282
logLevel: _dgeniLogLevel
8383
};
8484

85-
var _excludePatterns = ['**/node_modules/**', '**/typings/**', '**/packages/**'];
85+
var _excludePatterns = ['**/node_modules/**', '**/packages/**'];
8686

8787
var _excludeMatchers = _excludePatterns.map(function(excludePattern){
8888
return new Minimatch(excludePattern)
@@ -96,7 +96,7 @@ var _exampleBoilerplateFiles = [
9696
'systemjs.config.js',
9797
'tsconfig.json',
9898
'tslint.json',
99-
'typings.json'
99+
'wallaby.js'
100100
];
101101

102102
var _exampleDartWebBoilerPlateFiles = ['a2docs.css', 'styles.css'];
@@ -444,13 +444,6 @@ gulp.task('add-example-boilerplate', function(done) {
444444
fsUtils.addSymlink(realPath, linkPath);
445445
});
446446

447-
realPath = path.join(EXAMPLES_PATH, '/typings');
448-
var typingsPaths = excludeDartPaths(getTypingsPaths(EXAMPLES_PATH));
449-
typingsPaths.forEach(function(linkPath) {
450-
gutil.log("symlinking " + linkPath + ' -> ' + realPath)
451-
fsUtils.addSymlink(realPath, linkPath);
452-
});
453-
454447
return buildStyles(copyExampleBoilerplate, done);
455448
});
456449

@@ -509,11 +502,6 @@ gulp.task('remove-example-boilerplate', function() {
509502
fsUtils.removeSymlink(linkPath);
510503
});
511504

512-
var typingsPaths = getTypingsPaths(EXAMPLES_PATH);
513-
typingsPaths.forEach(function(linkPath) {
514-
fsUtils.removeSymlink(linkPath);
515-
});
516-
517505
deleteExampleBoilerPlate();
518506
});
519507

@@ -802,7 +790,7 @@ gulp.task('_harp-compile', function() {
802790

803791
gulp.task('_shred-devguide-examples', ['_shred-clean-devguide', '_copy-example-boilerplate'], function() {
804792
// Split big shredding task into partials 2016-06-14
805-
var examplePaths = globby.sync(EXAMPLES_PATH+'/*/', {ignore: ['/node_modules', 'typings/', '_protractor/']});
793+
var examplePaths = globby.sync(EXAMPLES_PATH+'/*/', {ignore: ['/node_modules', '_protractor/']});
806794
var promise = Promise.resolve(true);
807795
examplePaths.forEach(function (examplePath) {
808796
promise = promise.then(() => docShredder.shredSingleExampleDir(_devguideShredOptions, examplePath));
@@ -862,8 +850,6 @@ gulp.task('lint', function() {
862850
'!./public/docs/_examples/style-guide/ts/**/*.avoid.ts',
863851
'!./public/docs/_examples/**/node_modules/**/*',
864852
'!./public/docs/_examples/_protractor/**/*',
865-
'!./public/docs/_examples/**/typings/**/*',
866-
'!./public/docs/_examples/**/typings-ng1/**/*',
867853
'!./public/docs/_examples/**/build/**/*',
868854
// temporary until codelyzer is fixed mgechev/codelyzer#60
869855
'!./public/docs/_examples/animations/ts/app/hero.service.ts'
@@ -1113,13 +1099,6 @@ function getNodeModulesPaths(basePath) {
11131099
return paths;
11141100
}
11151101

1116-
function getTypingsPaths(basePath) {
1117-
var paths = getExamplePaths(basePath).map(function(examplePath) {
1118-
return path.join(examplePath, "/typings");
1119-
});
1120-
return paths;
1121-
}
1122-
11231102
function getExamplePaths(basePath, includeBase) {
11241103
// includeBase defaults to false
11251104
return getPaths(basePath, _exampleConfigFilename, includeBase)
@@ -1244,7 +1223,7 @@ function devGuideExamplesWatch(shredOptions, postShredAction, focus) {
12441223
// removed this version because gulp.watch has the same glob issue that dgeni has.
12451224
// var excludePattern = '!' + path.join(shredOptions.examplesDir, '**/node_modules/**/*.*');
12461225
// gulp.watch([includePattern, excludePattern], {readDelay: 500}, function (event, done) {
1247-
var ignoreThese = [ '**/node_modules/**', '**/_fragments/**', '**/dist/**', '**/typings/**',
1226+
var ignoreThese = [ '**/node_modules/**', '**/_fragments/**', '**/dist/**',
12481227
'**/dart/.pub/**', '**/dart/build/**', '**/dart/packages/**'];
12491228
ignoreThese = ignoreThese.concat(_exampleBoilerplateFiles.map((file) => `public/docs/_examples/*/*/${file}`));
12501229
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
protractor.config.js

public/docs/_examples/_protractor/e2e.d.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/// <reference path="typings/index.d.ts" />
2-
31
// Defined in protractor.config.js
42
declare function setProtractorToNg1Mode(): void;
53
declare function sendKeys(element: protractor.ElementFinder, str: string): webdriver.promise.Promise<void>;

public/docs/_examples/_protractor/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
"version": "1.0.0",
44
"description": "Manage _protractor folder installations",
55
"scripts": {
6-
"postinstall": "typings install",
7-
"typings": "typings",
86
"protractor": "protractor",
9-
"webdriver:update": "webdriver-manager update"
7+
"webdriver:update": "webdriver-manager update",
8+
"tsc": "tsc"
109
},
1110
"keywords": [],
1211
"author": "",
1312
"license": "ISC",
1413
"devDependencies": {
14+
"@types/jasmine": "^2.2.33",
15+
"@types/node": "^4.0.30",
16+
"@types/protractor": "^1.5.18",
1517
"protractor": "^3.3.0",
16-
"typings": "^1.0.4",
1718
"ts-node": "^1.3.0",
1819
"typescript": "^2.0.2"
1920
},

public/docs/_examples/_protractor/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
"files": [
1417
"e2e-spec.ts"

public/docs/_examples/_protractor/typings.json

-8
This file was deleted.

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
"http-server:e2e": "http-server",
1010
"http-server:cli": "http-server dist/",
1111
"lite": "lite-server",
12-
"postinstall": "typings install",
1312
"test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"",
1413
"tsc": "tsc",
1514
"tsc:w": "tsc -w",
16-
"typings": "typings",
1715
"protractor": "protractor",
1816
"webdriver:update": "webdriver-manager update",
1917
"start:webpack": "webpack-dev-server --inline --progress --port 8080",
@@ -49,7 +47,10 @@
4947
"zone.js": "^0.6.21"
5048
},
5149
"devDependencies": {
52-
"angular-cli": "^1.0.0-beta.5",
50+
"@types/angular": "^1.5.13",
51+
"@types/core-js": "^0.9.32",
52+
"@types/jasmine": "^2.2.33",
53+
"@types/node": "^4.0.30",
5354
"angular2-template-loader": "^0.4.0",
5455
"awesome-typescript-loader": "^2.2.4",
5556
"canonical-path": "0.0.2",
@@ -79,11 +80,9 @@
7980
"rimraf": "^2.5.2",
8081
"rollup-plugin-commonjs": "^4.1.0",
8182
"style-loader": "^0.13.1",
82-
"ts-loader": "^0.8.2",
8383
"ts-node": "^1.3.0",
8484
"tslint": "^3.15.1",
8585
"typescript": "^2.0.2",
86-
"typings": "^1.3.2",
8786
"webpack": "^1.13.0",
8887
"webpack-dev-server": "^1.14.1",
8988
"webpack-merge": "^0.14.0"

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
"scripts": {
55
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
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
"license": "ISC",
1311
"dependencies": {
@@ -33,7 +31,6 @@
3331
"devDependencies": {
3432
"concurrently": "^2.2.0",
3533
"lite-server": "^2.2.2",
36-
"typescript": "^2.0.2",
37-
"typings":"^1.3.2"
34+
"typescript": "^2.0.2"
3835
}
3936
}

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

-7
This file was deleted.

public/docs/_examples/typings.json

-7
This file was deleted.

public/docs/_examples/upgrade-phonecat-1-typescript/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ The following changes from vanilla Phonecat are applied:
1212
in index.html and karma.conf.ng1.js.
1313
* E2E tests have been moved to the parent directory, where `gulp run-e2e-tests` can
1414
discover and run them along with all the other examples.
15-
* Angular 1 typings (from DefinitelyTyped) are added to typings-ng1 so that
16-
TypeScript can recognize Angular 1 code. (typings.json comes from boilerplate
17-
so we can't add them there).
1815
* Most of the phone JSON and image data removed in the interest of keeping
1916
repo weight down. Keeping enough to retain testability of the app.
2017

0 commit comments

Comments
 (0)