diff --git a/.gitignore b/.gitignore index 679af37907..2666d27c27 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ node_modules _temp bower_components jspm_packages -typings **/packages build pubspec.lock diff --git a/README.md b/README.md index c291cccc6e..5e1559ef26 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ take the following extra steps to prepare the environment: 1. cd back up to `angular.io` root: `cd ../../..` 1. run `gulp add-example-boilerplate` (elevate to admin on Windows) -to copy canonical files to the sample directories and create symlinks there for node_modules and typings. +to copy canonical files to the sample directories and create symlinks there for node_modules. Now cd into any particular sample's language directory (e.g., `public/docs/_examples/quickstart/ts`) and try: - `npm start` to simultaneously compile-with-watch and serve-in-browser-with-watch diff --git a/gulpfile.js b/gulpfile.js index b93d8ccbb3..f1d8b21621 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -85,7 +85,7 @@ var _apiShredOptionsForDart = { logLevel: _dgeniLogLevel }; -var _excludePatterns = ['**/node_modules/**', '**/typings/**', '**/packages/**']; +var _excludePatterns = ['**/node_modules/**', '**/packages/**']; var _excludeMatchers = _excludePatterns.map(function(excludePattern){ return new Minimatch(excludePattern) @@ -461,13 +461,6 @@ gulp.task('add-example-boilerplate', function(done) { fsUtils.addSymlink(realPath, linkPath); }); - realPath = path.join(EXAMPLES_PATH, '/typings'); - var typingsPaths = excludeDartPaths(getTypingsPaths(EXAMPLES_PATH)); - typingsPaths.forEach(function(linkPath) { - gutil.log("symlinking " + linkPath + ' -> ' + realPath) - fsUtils.addSymlink(realPath, linkPath); - }); - return buildStyles(copyExampleBoilerplate, done); }); @@ -530,11 +523,6 @@ gulp.task('remove-example-boilerplate', function() { fsUtils.removeSymlink(linkPath); }); - var typingsPaths = getTypingsPaths(EXAMPLES_PATH); - typingsPaths.forEach(function(linkPath) { - fsUtils.removeSymlink(linkPath); - }); - deleteExampleBoilerPlate(); }); @@ -818,7 +806,7 @@ gulp.task('_harp-compile', function() { gulp.task('_shred-devguide-examples', ['_shred-clean-devguide', '_copy-example-boilerplate'], function() { // Split big shredding task into partials 2016-06-14 - var examplePaths = globby.sync(EXAMPLES_PATH+'/*/', {ignore: ['/node_modules', 'typings/']}); + var examplePaths = globby.sync(EXAMPLES_PATH+'/*/', {ignore: ['/node_modules']}); var promise = Promise.resolve(true); examplePaths.forEach(function (examplePath) { promise = promise.then(() => docShredder.shredSingleExampleDir(_devguideShredOptions, examplePath)); @@ -877,8 +865,6 @@ gulp.task('lint', function() { '!./public/docs/_examples/**/ts-snippets/*.ts', '!./public/docs/_examples/style-guide/ts/**/*.avoid.ts', '!./public/docs/_examples/**/node_modules/**/*', - '!./public/docs/_examples/**/typings/**/*', - '!./public/docs/_examples/**/typings-ng1/**/*', '!./public/docs/_examples/**/build/**/*', // temporary until codelyzer is fixed mgechev/codelyzer#60 '!./public/docs/_examples/animations/ts/app/hero.service.ts' @@ -1140,13 +1126,6 @@ function getNodeModulesPaths(basePath) { return paths; } -function getTypingsPaths(basePath) { - var paths = getExamplePaths(basePath).map(function(examplePath) { - return path.join(examplePath, "/typings"); - }); - return paths; -} - function getExamplePaths(basePath, includeBase) { // includeBase defaults to false return getPaths(basePath, _exampleConfigFilename, includeBase); @@ -1281,7 +1260,7 @@ function devGuideExamplesWatch(shredOptions, postShredAction, focus) { // removed this version because gulp.watch has the same glob issue that dgeni has. // var excludePattern = '!' + path.join(shredOptions.examplesDir, '**/node_modules/**/*.*'); // gulp.watch([includePattern, excludePattern], {readDelay: 500}, function (event, done) { - var ignoreThese = [ '**/node_modules/**', '**/_fragments/**', '**/dist/**', '**/typings/**', + var ignoreThese = [ '**/node_modules/**', '**/_fragments/**', '**/dist/**', '**/dart/.pub/**', '**/dart/build/**', '**/dart/packages/**']; ignoreThese = ignoreThese.concat(_exampleBoilerplateFiles.map((file) => `public/docs/_examples/*/*/${file}`)); var files = globby.sync( [includePattern], { ignore: ignoreThese }); diff --git a/public/docs/_examples/.gitignore b/public/docs/_examples/.gitignore index 3e900ec40a..b6733dc6ea 100644 --- a/public/docs/_examples/.gitignore +++ b/public/docs/_examples/.gitignore @@ -7,7 +7,6 @@ package.json systemjs.config.js tsconfig.json tslint.json -typings.json wallaby.js _test-output diff --git a/public/docs/_examples/_boilerplate/package.json b/public/docs/_examples/_boilerplate/package.json index 758ff6f182..3f255fcbd6 100644 --- a/public/docs/_examples/_boilerplate/package.json +++ b/public/docs/_examples/_boilerplate/package.json @@ -10,7 +10,6 @@ "http-server:cli": "http-server dist/", "lite": "lite-server", "lite:aot": "lite-server -c aot/bs-config.json", - "postinstall": "typings install", "test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"", "tsc": "tsc", "tsc:w": "tsc -w", diff --git a/public/docs/_examples/_boilerplate/tsconfig.json b/public/docs/_examples/_boilerplate/tsconfig.json index 48dda0636f..ac0a8ac081 100644 --- a/public/docs/_examples/_boilerplate/tsconfig.json +++ b/public/docs/_examples/_boilerplate/tsconfig.json @@ -9,7 +9,9 @@ "removeComments": false, "noImplicitAny": true, "suppressImplicitAnyIndexErrors": true, - "types": [] + "typeRoots": [ + "../../node_modules/@types/" + ] }, "exclude": [ "node_modules/*", diff --git a/public/docs/_examples/cb-aot-compiler/ts/tsconfig-aot.json b/public/docs/_examples/cb-aot-compiler/ts/tsconfig-aot.json index fd8b0617cc..2a8ebdf309 100644 --- a/public/docs/_examples/cb-aot-compiler/ts/tsconfig-aot.json +++ b/public/docs/_examples/cb-aot-compiler/ts/tsconfig-aot.json @@ -8,14 +8,12 @@ "experimentalDecorators": true, "removeComments": false, "noImplicitAny": true, - "suppressImplicitAnyIndexErrors": true, - "types": [] + "suppressImplicitAnyIndexErrors": true }, "files": [ "app/app.module.ts", - "app/main.ts", - "./typings/index.d.ts" + "app/main.ts" ], "angularCompilerOptions": { diff --git a/public/docs/_examples/cb-visual-studio-2015/ts/tsconfig.json b/public/docs/_examples/cb-visual-studio-2015/ts/tsconfig.json index 1ac74de56e..2624488890 100644 --- a/public/docs/_examples/cb-visual-studio-2015/ts/tsconfig.json +++ b/public/docs/_examples/cb-visual-studio-2015/ts/tsconfig.json @@ -8,7 +8,10 @@ "experimentalDecorators": true, "removeComments": false, "noImplicitAny": true, - "suppressImplicitAnyIndexErrors": true + "suppressImplicitAnyIndexErrors": true, + "typeRoots": [ + "node_modules/@types" + ] }, "compileOnSave": true } diff --git a/public/docs/_examples/cli-quickstart/e2e-spec.ts.disabled b/public/docs/_examples/cli-quickstart/e2e-spec.ts.temporarily-removed similarity index 100% rename from public/docs/_examples/cli-quickstart/e2e-spec.ts.disabled rename to public/docs/_examples/cli-quickstart/e2e-spec.ts.temporarily-removed diff --git a/public/docs/_examples/cli-quickstart/ts/.gitignore b/public/docs/_examples/cli-quickstart/ts/.gitignore index 5df0fe5dc6..129ad319d9 100644 --- a/public/docs/_examples/cli-quickstart/ts/.gitignore +++ b/public/docs/_examples/cli-quickstart/ts/.gitignore @@ -18,7 +18,6 @@ /libpeerconnection.log npm-debug.log testem.log -/typings # e2e /e2e/*.js diff --git a/public/docs/_examples/cli-quickstart/ts/example-config.json b/public/docs/_examples/cli-quickstart/ts/example-config.json.temporarily-removed similarity index 100% rename from public/docs/_examples/cli-quickstart/ts/example-config.json rename to public/docs/_examples/cli-quickstart/ts/example-config.json.temporarily-removed diff --git a/public/docs/_examples/cli-quickstart/ts/src/typings.d.ts b/public/docs/_examples/cli-quickstart/ts/src/typings.d.ts index eebc2728b8..e69de29bb2 100644 --- a/public/docs/_examples/cli-quickstart/ts/src/typings.d.ts +++ b/public/docs/_examples/cli-quickstart/ts/src/typings.d.ts @@ -1 +0,0 @@ -/// diff --git a/public/docs/_examples/package.json b/public/docs/_examples/package.json index 871fba0218..d51a16f00d 100644 --- a/public/docs/_examples/package.json +++ b/public/docs/_examples/package.json @@ -3,8 +3,6 @@ "version": "1.0.0", "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.", "scripts": { - "postinstall": "typings install", - "typings": "typings", "protractor": "protractor", "webdriver:update": "webdriver-manager update" }, @@ -42,8 +40,16 @@ "zone.js": "^0.6.25" }, "devDependencies": { - "@types/angular": "^1.5.15", - "@types/jasmine": "^2.2.34", + "@types/angular": "^1.5.16", + "@types/angular-animate": "^1.5.5", + "@types/angular-cookies": "^1.4.2", + "@types/angular-mocks": "^1.5.5", + "@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.35", + "@types/node": "^6.0.45", "@types/selenium-webdriver": "^2.53.32", "angular2-template-loader": "^0.4.0", "awesome-typescript-loader": "^2.2.4", @@ -76,11 +82,9 @@ "rollup-plugin-commonjs": "^4.1.0", "source-map-explorer": "^1.3.2", "style-loader": "^0.13.1", - "ts-loader": "^0.8.2", "ts-node": "^1.3.0", "tslint": "^3.15.1", "typescript": "^2.0.3", - "typings": "^1.4.0", "webpack": "^1.13.0", "webpack-dev-server": "^1.14.1", "webpack-merge": "^0.14.0" diff --git a/public/docs/_examples/quickstart/ts/package.1.json b/public/docs/_examples/quickstart/ts/package.1.json index 29eb574dd9..be92fd0515 100644 --- a/public/docs/_examples/quickstart/ts/package.1.json +++ b/public/docs/_examples/quickstart/ts/package.1.json @@ -4,10 +4,8 @@ "scripts": { "start": "tsc && concurrently \"tsc -w\" \"lite-server\" ", "lite": "lite-server", - "postinstall": "typings install", "tsc": "tsc", - "tsc:w": "tsc -w", - "typings": "typings" + "tsc:w": "tsc -w" }, "licenses": [ { @@ -35,9 +33,10 @@ "zone.js": "^0.6.25" }, "devDependencies": { + "@types/core-js": "^0.9.34", + "@types/node": "^6.0.45", "concurrently": "^3.0.0", "lite-server": "^2.2.2", - "typescript": "^2.0.3", - "typings":"^1.4.0" + "typescript": "^2.0.3" } } diff --git a/public/docs/_examples/quickstart/ts/typings.1.json b/public/docs/_examples/quickstart/ts/typings.1.json deleted file mode 100644 index 7da31ca0af..0000000000 --- a/public/docs/_examples/quickstart/ts/typings.1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "globalDependencies": { - "core-js": "registry:dt/core-js#0.0.0+20160725163759", - "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", - "node": "registry:dt/node#6.0.0+20160909174046" - } -} diff --git a/public/docs/_examples/toh-6/ts/tsconfig-aot.json b/public/docs/_examples/toh-6/ts/tsconfig-aot.json index 1d1983af4c..97d6f592a0 100644 --- a/public/docs/_examples/toh-6/ts/tsconfig-aot.json +++ b/public/docs/_examples/toh-6/ts/tsconfig-aot.json @@ -9,13 +9,14 @@ "removeComments": false, "noImplicitAny": true, "suppressImplicitAnyIndexErrors": true, - "types": [] + "typeRoots": [ + "../../node_modules/@types/" + ] }, "files": [ "app/app.module.ts", - "app/main-aot.ts", - "typings/index.d.ts" + "app/main-aot.ts" ], "angularCompilerOptions": { diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/main.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/main.ts index 55bb1fe183..06c61fd0d4 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/main.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/main.ts @@ -1,5 +1,6 @@ // #docregion import-adapter import { UpgradeAdapter } from '@angular/upgrade'; +declare var angular: any; import { AppModule } from './app.module'; // #enddocregion import-adapter diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ng1.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ng1.ts index b458343ece..333c08aa45 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ng1.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ng1.ts @@ -1,5 +1,6 @@ // #docregion import { Phone, PhoneData } from '../core/phone/phone.service'; +declare var angular: any; class PhoneDetailController { phone: PhoneData; diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.ng1.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.ng1.ts index 6b36772a72..47b1e35e4a 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.ng1.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.ng1.ts @@ -1,5 +1,6 @@ // #docregion import { Phone, PhoneData } from '../core/phone/phone.service'; +declare var angular: any; class PhoneListController { phones: PhoneData[]; diff --git a/public/docs/_examples/webpack/ts/package.webpack.json b/public/docs/_examples/webpack/ts/package.webpack.json index 6f3eb15a3e..ba63c17ef7 100644 --- a/public/docs/_examples/webpack/ts/package.webpack.json +++ b/public/docs/_examples/webpack/ts/package.webpack.json @@ -5,8 +5,7 @@ "scripts": { "start": "webpack-dev-server --inline --progress --port 8080", "test": "karma start", - "build": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail", - "postinstall": "typings install" + "build": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail" }, "licenses": [ { @@ -28,6 +27,9 @@ "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", "awesome-typescript-loader": "^2.2.4", "css-loader": "^0.23.1", @@ -47,7 +49,6 @@ "rimraf": "^2.5.2", "style-loader": "^0.13.1", "typescript": "^2.0.2", - "typings": "^1.3.2", "webpack": "^1.13.0", "webpack-dev-server": "^1.14.1", "webpack-merge": "^0.14.0" diff --git a/public/docs/_examples/webpack/ts/typings.1.json b/public/docs/_examples/webpack/ts/typings.1.json deleted file mode 100644 index 7da31ca0af..0000000000 --- a/public/docs/_examples/webpack/ts/typings.1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "globalDependencies": { - "core-js": "registry:dt/core-js#0.0.0+20160725163759", - "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", - "node": "registry:dt/node#6.0.0+20160909174046" - } -} diff --git a/public/docs/js/latest/guide/forms.jade b/public/docs/js/latest/guide/forms.jade index b0148eae79..e51a6f01b0 100644 --- a/public/docs/js/latest/guide/forms.jade +++ b/public/docs/js/latest/guide/forms.jade @@ -624,11 +624,9 @@ figure.image-display .file hero-form.component.js .file main.ts .file node_modules ... - .file typings ... .file index.html .file package.json .file tsconfig.json - .file typings.json :marked Here’s the final version of the source: diff --git a/public/docs/ts/_cache/quickstart.jade b/public/docs/ts/_cache/quickstart.jade index 95faaf7a84..d59ae2431b 100644 --- a/public/docs/ts/_cache/quickstart.jade +++ b/public/docs/ts/_cache/quickstart.jade @@ -581,13 +581,11 @@ block project-file-structure .file app.module.ts .file main.ts .file node_modules ... - .file typings ... .file index.html .file package.json .file styles.css .file systemjs.config.js .file tsconfig.json - .file typings.json :marked Here are the file contents: @@ -599,7 +597,6 @@ block project-files quickstart/ts/index.html, quickstart/ts/package.1.json, quickstart/ts/tsconfig.1.json, - quickstart/ts/typings.1.json, quickstart/ts/styles.css, quickstart/ts/systemjs.config.1.js` , @@ -610,7 +607,6 @@ block project-files index.html, package.json, tsconfig.json, - typings.json, styles.css (excerpt), systemjs.config.js`) diff --git a/public/docs/ts/_cache/tutorial/toh-pt5.jade b/public/docs/ts/_cache/tutorial/toh-pt5.jade index f0adefb421..67f14e41a1 100644 --- a/public/docs/ts/_cache/tutorial/toh-pt5.jade +++ b/public/docs/ts/_cache/tutorial/toh-pt5.jade @@ -64,13 +64,11 @@ block intro-file-tree .file main.ts .file mock-heroes.ts .file node_modules ... - .file typings ... .file index.html .file package.json .file styles.css .file systemjs.config.js .file tsconfig.json - .file typings.json block keep-app-running :marked @@ -883,13 +881,11 @@ block file-tree-end .file main.ts .file mock-heroes.ts .file node_modules ... - .file typings ... .file index.html .file package.json .file styles.css .file systemjs.config.js .file tsconfig.json - .file typings.json .l-main-section :marked diff --git a/public/docs/ts/_cache/tutorial/toh-pt6.jade b/public/docs/ts/_cache/tutorial/toh-pt6.jade index 54c2b2e22c..007e6e77f7 100644 --- a/public/docs/ts/_cache/tutorial/toh-pt6.jade +++ b/public/docs/ts/_cache/tutorial/toh-pt6.jade @@ -559,13 +559,11 @@ block filetree .file main.ts .file in-memory-data.service.ts (new) .file node_modules ... - .file typings ... .file index.html .file package.json .file styles.css .file systemjs.config.js .file tsconfig.json - .file typings.json .l-main-section :marked diff --git a/public/docs/ts/latest/cookbook/visual-studio-2015.jade b/public/docs/ts/latest/cookbook/visual-studio-2015.jade index 91a0a247bd..ab996f617a 100644 --- a/public/docs/ts/latest/cookbook/visual-studio-2015.jade +++ b/public/docs/ts/latest/cookbook/visual-studio-2015.jade @@ -88,7 +88,6 @@ h2#copy Step 4: Copy the QuickStart files into the ASP.NET project folder * index.html * package.json * tsconfig.json - * typings.json .l-main-section h2#restore Step 5: Restore the required packages diff --git a/public/docs/ts/latest/guide/forms.jade b/public/docs/ts/latest/guide/forms.jade index 0c3674fb59..5f000d7bbc 100644 --- a/public/docs/ts/latest/guide/forms.jade +++ b/public/docs/ts/latest/guide/forms.jade @@ -705,12 +705,10 @@ figure.image-display .file hero-form.component.html .file hero-form.component.ts .file main.ts - .file node_modules ... - .file typings ... + .file node_modules ... .file index.html .file package.json .file tsconfig.json - .file typings.json :marked Here’s the final version of the source: diff --git a/public/docs/ts/latest/guide/npm-packages.jade b/public/docs/ts/latest/guide/npm-packages.jade index 447c34dce9..148be03d90 100644 --- a/public/docs/ts/latest/guide/npm-packages.jade +++ b/public/docs/ts/latest/guide/npm-packages.jade @@ -152,10 +152,10 @@ a(id="dev-dependencies") with excellent support for Angular apps that use routing. ***[typescript](https://www.npmjs.com/package/typescript)*** - - The TypeScript language server, including the *tsc* TypeScript compiler. + the TypeScript language server, including the *tsc* TypeScript compiler. - ***[typings](https://www.npmjs.com/package/typings)*** - A manager for TypeScript definition files. - Read more about it in the [TypeScript Configuration](typescript-configuration.html#typings) page. + ***@types/\**** - TypeScript definition files. + Learn more about it in the [TypeScript Configuration](typescript-configuration.html#typings) chapter. .l-main-section a(id="why-peer-dependencies") diff --git a/public/docs/ts/latest/guide/router.jade b/public/docs/ts/latest/guide/router.jade index 9d1e1be462..1bd1eb883d 100644 --- a/public/docs/ts/latest/guide/router.jade +++ b/public/docs/ts/latest/guide/router.jade @@ -546,12 +546,10 @@ h3#router-directives Router Directives .file hero-list.component.ts .file main.ts .file node_modules ... - .file typings ... .file index.html .file package.json .file styles.css .file tsconfig.json - .file typings.json :marked Here are the files discussed in this milestone @@ -1233,12 +1231,10 @@ h3#merge-hero-routes Import hero module into AppModule .file crisis-list.component.ts .file main.ts .file node_modules ... - .file typings ... .file index.html .file package.json .file styles.css .file tsconfig.json - .file typings.json :marked ### The Heroes App code diff --git a/public/docs/ts/latest/guide/typescript-configuration.jade b/public/docs/ts/latest/guide/typescript-configuration.jade index 0988738d79..27fce90b14 100644 --- a/public/docs/ts/latest/guide/typescript-configuration.jade +++ b/public/docs/ts/latest/guide/typescript-configuration.jade @@ -78,16 +78,13 @@ a(id="typings") 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 published them in well-known locations. - The *typings* tool can find and fetch these files for you. - - After installing the [typings](https://github.com/typings/typings/blob/master/README.md) tool - with npm (it's listed among the *devDependencies* in the `package.json`), add an npm script (`postinstall`) - to run that tool automatically, after *npm* installation finishes. -+makeJson('quickstart/ts/package.1.json', {paths: 'scripts.postinstall'}, 'package.json (postinstall)')(format=".") -:marked - This *typings* tool command, `typings install`, installs the `d.ts` files into the **typings** folder. - You created a `typings.json` file in the [QuickStart](../quickstart.html): -+makeJson('quickstart/ts/typings.1.json', null, 'typings.json')(format=".") + + We can install these typings via `npm` using the + [`@types/*` scoped package](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html) + and Typescript (starting at 2.0) will automatically recognize them. + + For instance, to install typings for `jasmine` we could do `npm install @types/jasmine --save-dev`. + :marked QuickStart identified three *typings* (`d.ts`) files: @@ -96,27 +93,7 @@ a(id="typings") * [jasmine](http://jasmine.github.io/) typings for the Jasmine test framework - * [node](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/node/node.d.ts) for code that references objects in the *nodejs* environment; + * [node](https://www.npmjs.com/package/@types/node) for code that references objects in the *nodejs* environment; You can view an example in the [webpack](./webpack.html) page. QuickStart doesn't require these typings but many of the samples do. - - You can also run the *typings* tool yourself. - If the `postInstall` command fails to (re)install the typings files, run the following command to do so. -code-example(format=""). - npm run typings install -:marked - Run this command to list the installed typings files: -code-example(format=""). - npm run typings list -:marked - The following command installs or updates the typings file for the Jasmine test library from the *DefinitelyTyped* repository, - and updates the `typings.json` file so you receive it automatically the next time you install typings. -code-example(format=""). - npm run typings -- install dt~jasmine --save --global -.l-sub-section - :marked - The [–– option](https://docs.npmjs.com/cli/run-script) tells npm to pass all arguments to the right of `--` to the *typings* command. - - Read about the features of the *typings* tool at its [site on github](https://github.com/typings/typings/blob/master/README.md). - diff --git a/public/docs/ts/latest/guide/upgrade.jade b/public/docs/ts/latest/guide/upgrade.jade index 430404a47a..38e9d7594c 100644 --- a/public/docs/ts/latest/guide/upgrade.jade +++ b/public/docs/ts/latest/guide/upgrade.jade @@ -875,34 +875,26 @@ figure of NPM. We'll install all new dependencies using NPM, and will eventually be able to remove Bower from the project. - Let's begin by installing TypeScript to the project. While we're at it, let's also - install the [Typings type definition manager](https://github.com/typings/typings). - It will allow us to install type definitions for libraries that don't come with - prepackaged types. + Let's begin by installing TypeScript to the project. code-example(format=""). - npm i typescript typings --save-dev + npm i typescript --save-dev :marked - Let's also add run scripts for the `tsc` TypeScript compiler and the `typings` - tool to `package.json`: + Let's also add run scripts for the `tsc` TypeScript compiler to `package.json`: -+makeJson('upgrade-phonecat-1-typescript/ts/package.json', {paths: 'scripts.tsc, scripts.tsc:w, scripts.typings'}, 'package.json') ++makeJson('upgrade-phonecat-1-typescript/ts/package.json', {paths: 'scripts.tsc, scripts.tsc:w'}, 'package.json') :marked - We can now use Typings to install type definitions for the existing libraries that - we're using: Angular 1 and the Jasmine unit test framework. + We can now install type definitions for the existing libraries that + we're using but that don't come with prepackaged types: Angular 1 and the + Jasmine unit test framework. code-example(format=""). - npm run typings install dt~jquery dt~angular dt~angular-route \ - dt~angular-resource dt~angular-mocks dt~angular-animate \ - dt~jasmine -- --save --global + npm install @types/jasmine @types/angular @types/angular-animate @types/angular-cookies @types/angular-mocks @types/angular-resource @types/angular-route @types/angular-sanitize --save-dev :marked - This will add these typings into a `typings.json` configuration file as well as - download them into the `typings directory`. - We should also configure the TypeScript compiler so that it can understand our project. We'll add a `tsconfig.json` file to the project directory, just like we do in the [Quickstart](../quickstart.html). It instructs the TypeScript compiler how @@ -968,8 +960,8 @@ code-example(format=""). .l-sub-section :marked - The [Angular 1.x type definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/angularjs) - we installed with Typings are not officially maintained by the Angular team, + The [Angular 1.x type definitions](https://www.npmjs.com/package/@types/angular) + we installed are not officially maintained by the Angular team, but are quite comprehensive. It is possible to make an Angular 1.x application fully type-annotated with the help of these definitions. @@ -1037,14 +1029,12 @@ code-example(format=""). [Quickstart](../quickstart.html) guide and get the following configurations from there: * Add Angular 2 and the other new dependencies to `package.json` - * Add the new typings into `typings.json` * The SystemJS configuration file `systemjs.config.js` to the project root directory. Once these are done, run: code-example(format=""). npm install - npm run typings install :marked We can soon load Angular 2 dependencies into the application via `index.html`, @@ -1110,6 +1100,18 @@ code-example(format=""). +makeExample('upgrade-phonecat-2-hybrid/ts/app/main.ts', 'import-adapter', 'app/main.ts') +.l-sub-section + :marked + ### Why declare _angular_ as _any_? + + A strongly typed `angular` reference to Angular 1 would be great. + But we can't import its UMD typings + library, `@types/angular`, without also importing Angular 1 itself via `import * as angular from 'angular'`. + + Angular 1 is currently loaded by a script tag in `index.html` and + switching to an ES6 import at this time is not worth the considerable effort. + Instead we declare `angular` as an untyped `any` to avoid typing errors. + :marked We can then make an adapter by instantiating the class: @@ -1216,7 +1218,6 @@ code-example(format=""). +makeExample('upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ng1.ts', null, 'app/phone-detail/phone-detail.component.ts') - :marked What we have here are two Angular 1 components using an Angular 2 service! The components don't need to be aware of this, though the fact that the @@ -1497,12 +1498,7 @@ code-example(format=""). we still need are for Jasmine and Angular 2 polyfills. code-example(format=""). - npm run typings uninstall jquery -- --save --global - npm run typings uninstall angular -- --save --global - npm run typings uninstall angular-route -- --save --global - npm run typings uninstall angular-resource -- --save --global - npm run typings uninstall angular-mocks -- --save --global - npm run typings uninstall angular-animate -- --save --global + npm uninstall @types/angular --save-dev :marked Finally, from `index.html`, remove all references to diff --git a/public/docs/ts/latest/guide/webpack.jade b/public/docs/ts/latest/guide/webpack.jade index 0e1fee111a..bfc7f33999 100644 --- a/public/docs/ts/latest/guide/webpack.jade +++ b/public/docs/ts/latest/guide/webpack.jade @@ -115,7 +115,7 @@ a(id="loaders") :marked ... it applies the `test` RegEx patterns. When a pattern matches the filename, Webpack processes the file with the associated loader. - The first `import` file matches the `.ts` pattern so Webpack processes it with the `ts` (TypeScript) loader. + The first `import` file matches the `.ts` pattern so Webpack processes it with the `awesome-typescript-loader`. The imported file doesn't match the second pattern so its loader is ignored. The second `import` matches the second `.css` pattern for which we have *two* loaders chained by the (!) character. @@ -152,14 +152,12 @@ code-example(format=""). +makeTabs( `webpack/ts/package.webpack.json, - webpack/ts/typings.1.json, webpack/ts/tsconfig.1.json, webpack/ts/webpack.config.js, webpack/ts/karma.webpack.conf.js, webpack/ts/config/helpers.js`, null, `package.json, - typings.json, tsconfig.json, webpack.config.js, karma.conf.js, @@ -172,7 +170,7 @@ code-example(format=""). Learn about the `package.json` in the [npm packages](../guide/npm-packages.html) chapter. We require packages for Webpack use in addition to the ones listed in that chapter. - Learn about `tsconfig.json` and `typings.json` in the [Typescript configuration](../guide/typescript-configuration.html) chapter. + Learn about `tsconfig.json` in the [Typescript configuration](../guide/typescript-configuration.html) chapter. :marked Open a terminal/console window and install the *npm* packages with `npm install`. @@ -232,7 +230,7 @@ a(id="common-configuration") +makeExample('webpack/ts/config/webpack.common.js', 'loaders', 'config/webpack.common.js')(format=".") :marked - * ts - a loader to transpile our Typescript code to ES5, guided by the `tsconfig.json` file + * awesome-typescript-loader - a loader to transpile our Typescript code to ES5, guided by the `tsconfig.json` file * angular2-template-loader - loads angular components' template and styles * html - for component templates * images/fonts - Images and fonts are bundled as well. diff --git a/public/docs/ts/latest/quickstart.jade b/public/docs/ts/latest/quickstart.jade index 9990eaaedc..738c4cdde1 100644 --- a/public/docs/ts/latest/quickstart.jade +++ b/public/docs/ts/latest/quickstart.jade @@ -95,9 +95,6 @@ block package-and-config-files li. #[b tsconfig.json] defines how the TypeScript compiler generates JavaScript from the project's files. - li. - #[b typings.json] provides additional definition files for libraries that the TypeScript - compiler doesn't natively recognize. li. #[b systemjs.config.js] provides information to a module loader about where to find application modules, and registers all the necessary packages. It also @@ -111,12 +108,10 @@ block package-and-config-files +makeTabs(` quickstart/ts/package.1.json, quickstart/ts/tsconfig.1.json, - quickstart/ts/typings.1.json, quickstart/ts/systemjs.config.1.js `, '', ` package.json, tsconfig.json, - typings.json, systemjs.config.js `) @@ -153,18 +148,9 @@ block install-packages .file angular-quickstart .children .file node_modules ... - .file typings ... .file package.json .file systemjs.config.js .file tsconfig.json - .file typings.json - - - :marked - If the `typings` folder doesn't show up after running `npm install`, you'll need to install it manually with the command: - - code-example(language="sh" class="code-shell"). - npm run typings install :marked You're now ready to write some code! @@ -206,7 +192,6 @@ block install-packages [`HttpModule`](../latest/api/http/index/HttpModule-class.html). These are introduced in the [Tour of Heroes Tutorial](./tutorial/). - .l-main-section h1#root-component Step !{step++}: Create a component and add it to your application :marked @@ -370,13 +355,11 @@ block project-file-structure .file app.module.ts .file main.ts .file node_modules ... - .file typings ... .file index.html .file package.json .file styles.css .file systemjs.config.js .file tsconfig.json - .file typings.json :marked To see the file contents, open the . diff --git a/public/docs/ts/latest/tutorial/toh-pt1.jade b/public/docs/ts/latest/tutorial/toh-pt1.jade index dfc137c3b8..288b0ab189 100644 --- a/public/docs/ts/latest/tutorial/toh-pt1.jade +++ b/public/docs/ts/latest/tutorial/toh-pt1.jade @@ -22,14 +22,12 @@ include ../_quickstart_repo .file app.component.ts .file app.module.ts .file main.ts - .file node_modules ... - .file typings ... + .file node_modules ... .file index.html .file package.json .file styles.css .file systemjs.config.js .file tsconfig.json - .file typings.json :marked ## Keep the app transpiling and running We want to start the TypeScript compiler, have it watch for changes, and start our server. We'll do this by typing diff --git a/public/docs/ts/latest/tutorial/toh-pt2.jade b/public/docs/ts/latest/tutorial/toh-pt2.jade index fbf3d6325f..3415530ca3 100644 --- a/public/docs/ts/latest/tutorial/toh-pt2.jade +++ b/public/docs/ts/latest/tutorial/toh-pt2.jade @@ -27,14 +27,12 @@ include ../_util-fns .file app.component.ts .file app.module.ts .file main.ts - .file node_modules ... - .file typings ... + .file node_modules ... .file index.html .file package.json .file styles.css .file systemjs.config.js .file tsconfig.json - .file typings.json :marked ### Keep the app transpiling and running We want to start the TypeScript compiler, have it watch for changes, and start our server. We'll do this by typing diff --git a/public/docs/ts/latest/tutorial/toh-pt3.jade b/public/docs/ts/latest/tutorial/toh-pt3.jade index f5c52b030a..e7f3edd739 100644 --- a/public/docs/ts/latest/tutorial/toh-pt3.jade +++ b/public/docs/ts/latest/tutorial/toh-pt3.jade @@ -19,14 +19,12 @@ include ../_util-fns .file app.component.ts .file app.module.ts .file main.ts - .file node_modules ... - .file typings ... + .file node_modules ... .file index.html .file package.json .file styles.css .file systemjs.config.js .file tsconfig.json - .file typings.json :marked ### Keep the app transpiling and running We want to start the TypeScript compiler, have it watch for changes, and start our server. We'll do this by typing @@ -213,11 +211,9 @@ code-example(format=".") .file hero-detail.component.ts .file main.ts .file node_modules ... - .file typings ... .file index.html .file package.json .file tsconfig.json - .file typings.json :marked Here are the code files we discussed in this chapter. diff --git a/public/docs/ts/latest/tutorial/toh-pt4.jade b/public/docs/ts/latest/tutorial/toh-pt4.jade index 6b1870dcca..3cc1e28bcf 100644 --- a/public/docs/ts/latest/tutorial/toh-pt4.jade +++ b/public/docs/ts/latest/tutorial/toh-pt4.jade @@ -34,13 +34,11 @@ include ../_util-fns .file hero-detail.component.ts .file main.ts .file node_modules ... - .file typings ... .file index.html .file package.json .file styles.css .file systemjs.config.js .file tsconfig.json - .file typings.json :marked ### Keep the app transpiling and running @@ -315,14 +313,12 @@ a#child-component .file hero.service.ts .file main.ts .file mock-heroes.ts - .file node_modules ... - .file typings ... + .file node_modules ... .file index.html .file package.json .file styles.css .file systemjs.config.js .file tsconfig.json - .file typings.json :marked Here are the code files we discussed in this chapter. diff --git a/public/docs/ts/latest/tutorial/toh-pt5.jade b/public/docs/ts/latest/tutorial/toh-pt5.jade index b31145fb7c..7dffbaa7cd 100644 --- a/public/docs/ts/latest/tutorial/toh-pt5.jade +++ b/public/docs/ts/latest/tutorial/toh-pt5.jade @@ -64,13 +64,11 @@ block intro-file-tree .file main.ts .file mock-heroes.ts .file node_modules ... - .file typings ... .file index.html .file package.json .file styles.css .file systemjs.config.js .file tsconfig.json - .file typings.json block keep-app-running :marked @@ -925,13 +923,11 @@ block file-tree-end .file main.ts .file mock-heroes.ts .file node_modules ... - .file typings ... .file index.html .file package.json .file styles.css .file systemjs.config.js .file tsconfig.json - .file typings.json .l-main-section :marked diff --git a/public/docs/ts/latest/tutorial/toh-pt6.jade b/public/docs/ts/latest/tutorial/toh-pt6.jade index bbe1b7e18e..c662d3c9b0 100644 --- a/public/docs/ts/latest/tutorial/toh-pt6.jade +++ b/public/docs/ts/latest/tutorial/toh-pt6.jade @@ -564,13 +564,11 @@ block filetree .file main.ts .file in-memory-data.service.ts (new) .file node_modules ... - .file typings ... .file index.html .file package.json .file styles.css .file systemjs.config.js .file tsconfig.json - .file typings.json .l-main-section :marked diff --git a/tools/doc-shredder/doc-shredder.js b/tools/doc-shredder/doc-shredder.js index 63b65e016a..6ff536d782 100644 --- a/tools/doc-shredder/doc-shredder.js +++ b/tools/doc-shredder/doc-shredder.js @@ -4,7 +4,7 @@ var del = require('del'); var Dgeni = require('dgeni'); var _ = require('lodash'); var globby = require('globby'); -var ignoreDirs = ['**/node_modules/**', '**/dist/**', '**/typings/**']; +var ignoreDirs = ['**/node_modules/**', '**/dist/**']; var _getLogLevel = function (options) { return options.logLevel || 'info'; } @@ -138,7 +138,7 @@ function createShredExamplePackage(shredOptions) { readFilesProcessor.sourceFiles = [ { // Process all candidate files in `src` and its subfolders ... include: includeFiles , - exclude: [ '**/node_modules/**', '**/dist/**', '**/typings/**', '**/packages/**', '**/dart/build/**'], + exclude: [ '**/node_modules/**', '**/dist/**', '**/packages/**', '**/dart/build/**'], // When calculating the relative path to these files use this as the base path. // So `src/foo/bar.js` will have relative path of `foo/bar.js` basePath: options.examplesDir @@ -190,7 +190,7 @@ function createShredJadePackage(shredOptions) { readFilesProcessor.sourceFiles = [ { // Process all candidate files in `src` and its subfolders ... include: includeFiles , - exclude: [ '**/node_modules/**', '**/typings/**', '**/packages/**', '**/dart/build/**', '**/_code-examples.jade'], + exclude: [ '**/node_modules/**', '**/packages/**', '**/dart/build/**', '**/_code-examples.jade'], // When calculating the relative path to these files use this as the base path. // So `src/foo/bar.js` will have relative path of `foo/bar.js` basePath: options.jadeDir @@ -244,7 +244,7 @@ var createShredMapPackage = function(mapOptions) { readFilesProcessor.sourceFiles = [ { // Process all candidate files in `src` and its subfolders ... include: includeFiles, - exclude: ['**/node_modules/**', '**/typings/**', '**/packages/**', '**/dart/build/**'], + exclude: ['**/node_modules/**', '**/packages/**', '**/dart/build/**'], // When calculating the relative path to these files use this as the base path. // So `src/foo/bar.js` will have relative path of `foo/bar.js` basePath: options.jadeDir diff --git a/tools/plunker-builder/builder.js b/tools/plunker-builder/builder.js index 9d893f3304..f055fd963b 100644 --- a/tools/plunker-builder/builder.js +++ b/tools/plunker-builder/builder.js @@ -255,10 +255,8 @@ class PlunkerBuilder { } }); - // var defaultExcludes = [ '!**/node_modules/**','!**/typings/**','!**/tsconfig.json', '!**/*plnkr.json', '!**/*plnkr.html', '!**/*plnkr.no-link.html' ]; + // var defaultExcludes = [ '!**/node_modules/**','!**/tsconfig.json', '!**/*plnkr.json', '!**/*plnkr.html', '!**/*plnkr.no-link.html' ]; var defaultExcludes = [ - '!**/typings/**', - '!**/typings.json', '!**/tsconfig.json', '!**/*plnkr.*', '!**/package.json',