diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..d1c2c2b349 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,30 @@ +module.exports = { + "globals": { + "describe": true, + "beforeEach": true, + "it": true, + "expect": true + }, + "env": { + "node": true + }, + "extends": "eslint:recommended", + "rules": { + "indent": [ + "error", + 2 + ], + "linebreak-style": [ + "error", + "unix" + ], + "quotes": [ + "error", + "single" + ], + "semi": [ + "error", + "always" + ] + } +}; \ No newline at end of file diff --git a/.nvmrc b/.nvmrc index 7ed6ff82de..1e8b314962 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -5 +6 diff --git a/.travis.yml b/.travis.yml index 7a87796437..b30e5d12a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ dist: trusty sudo: required language: node_js node_js: - - "5" + - "6" os: - linux env: diff --git a/gulpfile.js b/gulpfile.js index 366310ec49..c6a47063b8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1212,7 +1212,7 @@ function filterOutExcludedPatterns(fileNames, excludeMatchers) { } function apiSourceWatch(postBuildAction) { - var srcPattern = [path.join(ANGULAR_PROJECT_PATH, 'modules/@angular/src/**/*.*')]; + var srcPattern = [path.join(ANGULAR_PROJECT_PATH, 'modules/@angular/**/*.*')]; gulp.watch(srcPattern, {readDelay: 500}, function (event, done) { gutil.log('API source changed'); gutil.log('Event type: ' + event.event); // added, changed, or deleted diff --git a/package.json b/package.json index f13d2126c1..f8ece4dacf 100644 --- a/package.json +++ b/package.json @@ -36,11 +36,10 @@ "cross-spawn": "^4.0.0", "del": "^2.2.0", "dgeni": "^0.4.0", - "dgeni-packages": "^0.13.1", + "dgeni-packages": "^0.15.2", "diff": "^2.1.3", "fs-extra": "^0.30.0", "globby": "^4.0.0", - "grunt-sass": "^1.2.0", "gulp": "^3.5.6", "gulp-env": "0.4.0", "gulp-sass": "^2.3.2", @@ -49,7 +48,7 @@ "gulp-tslint": "^5.0.0", "gulp-util": "^3.0.6", "gulp-watch": "^4.3.4", - "harp": "^0.20.3", + "harp": "0.21.0-pre.0", "html2jade": "^0.8.4", "indent-string": "^2.1.0", "jasmine-core": "^2.3.4", diff --git a/public/docs/_examples/architecture/dart/pubspec.yaml b/public/docs/_examples/architecture/dart/pubspec.yaml index 84d0121f5f..e2e648537b 100644 --- a/public/docs/_examples/architecture/dart/pubspec.yaml +++ b/public/docs/_examples/architecture/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/attribute-directives/dart/pubspec.yaml b/public/docs/_examples/attribute-directives/dart/pubspec.yaml index 6cfb11ee2d..79904bff12 100644 --- a/public/docs/_examples/attribute-directives/dart/pubspec.yaml +++ b/public/docs/_examples/attribute-directives/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/component-styles/dart/pubspec.yaml b/public/docs/_examples/component-styles/dart/pubspec.yaml index 0bdc04cb83..7521cf8365 100755 --- a/public/docs/_examples/component-styles/dart/pubspec.yaml +++ b/public/docs/_examples/component-styles/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/dependency-injection/dart/pubspec.yaml b/public/docs/_examples/dependency-injection/dart/pubspec.yaml index 0ef93066be..b5958b1e07 100644 --- a/public/docs/_examples/dependency-injection/dart/pubspec.yaml +++ b/public/docs/_examples/dependency-injection/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/displaying-data/dart/pubspec.yaml b/public/docs/_examples/displaying-data/dart/pubspec.yaml index c5ef73f402..2c5961c70e 100644 --- a/public/docs/_examples/displaying-data/dart/pubspec.yaml +++ b/public/docs/_examples/displaying-data/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/forms/dart/pubspec.yaml b/public/docs/_examples/forms/dart/pubspec.yaml index 51664a3cd5..43a19366d7 100644 --- a/public/docs/_examples/forms/dart/pubspec.yaml +++ b/public/docs/_examples/forms/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/hierarchical-dependency-injection/dart/pubspec.yaml b/public/docs/_examples/hierarchical-dependency-injection/dart/pubspec.yaml index 9575041134..d18bc10490 100644 --- a/public/docs/_examples/hierarchical-dependency-injection/dart/pubspec.yaml +++ b/public/docs/_examples/hierarchical-dependency-injection/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/lifecycle-hooks/dart/lib/do_check_component.dart b/public/docs/_examples/lifecycle-hooks/dart/lib/do_check_component.dart index 449b6e0092..3208a18777 100644 --- a/public/docs/_examples/lifecycle-hooks/dart/lib/do_check_component.dart +++ b/public/docs/_examples/lifecycle-hooks/dart/lib/do_check_component.dart @@ -1,6 +1,4 @@ // #docregion -import 'dart:convert'; - import 'package:angular2/core.dart'; class Hero { @@ -23,7 +21,7 @@ class Hero { '.hero {background: LightYellow; padding: 8px; margin-top: 8px}', 'p {background: Yellow; padding: 8px; margin-top: 8px}' ]) -class DoCheckComponent implements DoCheck, OnChanges { +class DoCheckComponent implements DoCheck { @Input() Hero hero; @Input() @@ -72,16 +70,6 @@ class DoCheckComponent implements DoCheck, OnChanges { } // #enddocregion ng-do-check - // Copied from OnChangesComponent - ngOnChanges(Map changes) { - changes.forEach((String propName, SimpleChange change) { - String cur = JSON.encode(change.currentValue); - String prev = - change.isFirstChange() ? "{}" : JSON.encode(change.previousValue); - changeLog.add('$propName: currentValue = $cur, previousValue = $prev'); - }); - } - void reset() { changeDetected = true; changeLog.clear(); diff --git a/public/docs/_examples/lifecycle-hooks/dart/pubspec.yaml b/public/docs/_examples/lifecycle-hooks/dart/pubspec.yaml index 3624f56e05..e1bda01d28 100644 --- a/public/docs/_examples/lifecycle-hooks/dart/pubspec.yaml +++ b/public/docs/_examples/lifecycle-hooks/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/pipes/dart/pubspec.yaml b/public/docs/_examples/pipes/dart/pubspec.yaml index 8edddf0efa..e48db77d96 100644 --- a/public/docs/_examples/pipes/dart/pubspec.yaml +++ b/public/docs/_examples/pipes/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/quickstart/dart/pubspec.yaml b/public/docs/_examples/quickstart/dart/pubspec.yaml index ec9d8d2f81..b8ad984d4c 100644 --- a/public/docs/_examples/quickstart/dart/pubspec.yaml +++ b/public/docs/_examples/quickstart/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/quickstart/ts/index.html b/public/docs/_examples/quickstart/ts/index.html index a0a64d1122..fef30ef98b 100644 --- a/public/docs/_examples/quickstart/ts/index.html +++ b/public/docs/_examples/quickstart/ts/index.html @@ -9,10 +9,10 @@ - + - + diff --git a/public/docs/_examples/server-communication/dart/pubspec.yaml b/public/docs/_examples/server-communication/dart/pubspec.yaml index 1d381b2288..a2a1b30e93 100644 --- a/public/docs/_examples/server-communication/dart/pubspec.yaml +++ b/public/docs/_examples/server-communication/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 http: ^0.11.3+3 diff --git a/public/docs/_examples/structural-directives/dart/pubspec.yaml b/public/docs/_examples/structural-directives/dart/pubspec.yaml index 3a8e521ee9..c4c0bca74a 100644 --- a/public/docs/_examples/structural-directives/dart/pubspec.yaml +++ b/public/docs/_examples/structural-directives/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/template-syntax/dart/pubspec.yaml b/public/docs/_examples/template-syntax/dart/pubspec.yaml index f27859910c..65bea5b496 100644 --- a/public/docs/_examples/template-syntax/dart/pubspec.yaml +++ b/public/docs/_examples/template-syntax/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/toh-1/dart/pubspec.yaml b/public/docs/_examples/toh-1/dart/pubspec.yaml index da508674f5..c4826c3511 100644 --- a/public/docs/_examples/toh-1/dart/pubspec.yaml +++ b/public/docs/_examples/toh-1/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/toh-2/dart/pubspec.yaml b/public/docs/_examples/toh-2/dart/pubspec.yaml index da508674f5..c4826c3511 100644 --- a/public/docs/_examples/toh-2/dart/pubspec.yaml +++ b/public/docs/_examples/toh-2/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/toh-3/dart/pubspec.yaml b/public/docs/_examples/toh-3/dart/pubspec.yaml index da508674f5..c4826c3511 100644 --- a/public/docs/_examples/toh-3/dart/pubspec.yaml +++ b/public/docs/_examples/toh-3/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/toh-4/dart/pubspec.yaml b/public/docs/_examples/toh-4/dart/pubspec.yaml index da508674f5..c4826c3511 100644 --- a/public/docs/_examples/toh-4/dart/pubspec.yaml +++ b/public/docs/_examples/toh-4/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/toh-5/dart/pubspec.yaml b/public/docs/_examples/toh-5/dart/pubspec.yaml index da508674f5..c4826c3511 100644 --- a/public/docs/_examples/toh-5/dart/pubspec.yaml +++ b/public/docs/_examples/toh-5/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/toh-6/dart/pubspec.yaml b/public/docs/_examples/toh-6/dart/pubspec.yaml index 6f07f46995..653f7ec2f4 100644 --- a/public/docs/_examples/toh-6/dart/pubspec.yaml +++ b/public/docs/_examples/toh-6/dart/pubspec.yaml @@ -7,7 +7,7 @@ environment: sdk: '>=1.13.0 <2.0.0' # #docregion additions dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 # #enddocregion additions browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 diff --git a/public/docs/_examples/user-input/dart/pubspec.yaml b/public/docs/_examples/user-input/dart/pubspec.yaml index c56f2d27a4..a75460f74f 100644 --- a/public/docs/_examples/user-input/dart/pubspec.yaml +++ b/public/docs/_examples/user-input/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/dart/latest/_data.json b/public/docs/dart/latest/_data.json index 48138a453b..ed39df4605 100644 --- a/public/docs/dart/latest/_data.json +++ b/public/docs/dart/latest/_data.json @@ -3,7 +3,7 @@ "icon": "home", "title": "Angular Docs", "menuTitle": "Docs Home", - "banner": "Welcome to angular.io/dart! The current Angular 2 Dart release is beta.20. Consult the Change Log about recent enhancements, fixes, and breaking changes." + "banner": "Welcome to angular.io/dart! The current Angular 2 Dart release is beta.21. Consult the Change Log about recent enhancements, fixes, and breaking changes." }, "quickstart": { @@ -38,7 +38,7 @@ "cheatsheet": { "title": "Angular Cheat Sheet", - "intro": "A quick guide to Angular syntax.", + "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", "reference": false }, diff --git a/public/docs/dart/latest/cheatsheet.jade b/public/docs/dart/latest/cheatsheet.jade index 77c0f11d36..eec36cfb3f 100644 --- a/public/docs/dart/latest/cheatsheet.jade +++ b/public/docs/dart/latest/cheatsheet.jade @@ -1,9 +1,4 @@ - var base = current.path[4] ? '.' : './guide'; -.banner.grid-fluid - .alert.is-important - :marked - This cheat sheet is provisional and subject to change. -article(class="l-content-small grid-fluid docs-content") - .cheatsheet - ngio-cheatsheet(src= base + '/cheatsheet.json') +.l-content-small.grid-fluid.docs-content.cheatsheet + ngio-cheatsheet(src= base + '/cheatsheet.json') diff --git a/public/docs/dart/latest/guide/_data.json b/public/docs/dart/latest/guide/_data.json index 9fed0cf4fe..8b9f230bd6 100644 --- a/public/docs/dart/latest/guide/_data.json +++ b/public/docs/dart/latest/guide/_data.json @@ -59,7 +59,7 @@ "cheatsheet": { "title": "Angular Cheat Sheet", - "intro": "A quick guide to Angular syntax.", + "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", "nextable": true, "basics": true }, @@ -87,6 +87,11 @@ "intro": "Attribute directives attach behavior to elements." }, + "browser-support": { + "title": "Browser support", + "intro": "Browser support and polyfills guide." + }, + "component-styles": { "title": "Component Styles", "intro": "Learn how to apply CSS styles to components." diff --git a/public/docs/dart/latest/guide/browser-support.jade b/public/docs/dart/latest/guide/browser-support.jade new file mode 100644 index 0000000000..6778b6af28 --- /dev/null +++ b/public/docs/dart/latest/guide/browser-support.jade @@ -0,0 +1 @@ +!= partial("../../../_includes/_ts-temp") diff --git a/public/docs/dart/latest/guide/cheatsheet.jade b/public/docs/dart/latest/guide/cheatsheet.jade index ff8cc6085c..51a21522a9 100644 --- a/public/docs/dart/latest/guide/cheatsheet.jade +++ b/public/docs/dart/latest/guide/cheatsheet.jade @@ -1 +1 @@ -!= partial("../cheatsheet") +extends ../cheatsheet diff --git a/public/docs/dart/latest/quickstart.jade b/public/docs/dart/latest/quickstart.jade index c9e2f66385..80528fdf7e 100644 --- a/public/docs/dart/latest/quickstart.jade +++ b/public/docs/dart/latest/quickstart.jade @@ -30,7 +30,7 @@ block package-and-config-files packages as dependencies, as well as the `angular2` transformer. It can also specify other packages and transformers for the app to use, such as [dart_to_js_script_rewriter](https://pub.dartlang.org/packages/dart_to_js_script_rewriter). - Angular 2 is still changing, so provide an exact version: **2.0.0-beta.20**. + Angular 2 is still changing, so provide an exact version: **2.0.0-beta.21**. [pubspec]: https://www.dartlang.org/tools/pub/pubspec.html diff --git a/public/docs/js/latest/_data.json b/public/docs/js/latest/_data.json index 04bb91e507..a4f0318673 100644 --- a/public/docs/js/latest/_data.json +++ b/public/docs/js/latest/_data.json @@ -38,7 +38,7 @@ "cheatsheet": { "title": "Angular Cheat Sheet", - "intro": "A quick guide to Angular syntax.", + "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", "reference": false }, diff --git a/public/docs/js/latest/cheatsheet.jade b/public/docs/js/latest/cheatsheet.jade index c623d14bcd..eec36cfb3f 100644 --- a/public/docs/js/latest/cheatsheet.jade +++ b/public/docs/js/latest/cheatsheet.jade @@ -1,5 +1,4 @@ - var base = current.path[4] ? '.' : './guide'; -article(class="l-content-small grid-fluid docs-content") - .cheatsheet - ngio-cheatsheet(src= base + '/cheatsheet.json') +.l-content-small.grid-fluid.docs-content.cheatsheet + ngio-cheatsheet(src= base + '/cheatsheet.json') diff --git a/public/docs/js/latest/guide/_data.json b/public/docs/js/latest/guide/_data.json index f1dc5b57f9..d687f38e3a 100644 --- a/public/docs/js/latest/guide/_data.json +++ b/public/docs/js/latest/guide/_data.json @@ -52,7 +52,7 @@ "cheatsheet": { "title": "Angular Cheat Sheet", - "intro": "A quick guide to Angular syntax.", + "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", "nextable": true, "basics": true }, @@ -74,6 +74,11 @@ "intro": "Attribute directives attach behavior to elements." }, + "browser-support": { + "title": "Browser support", + "intro": "Browser support and polyfills guide." + }, + "component-styles": { "title": "Component Styles", "intro": "Learn how to apply CSS styles to components." diff --git a/public/docs/js/latest/guide/browser-support.jade b/public/docs/js/latest/guide/browser-support.jade new file mode 100644 index 0000000000..6778b6af28 --- /dev/null +++ b/public/docs/js/latest/guide/browser-support.jade @@ -0,0 +1 @@ +!= partial("../../../_includes/_ts-temp") diff --git a/public/docs/js/latest/guide/cheatsheet.jade b/public/docs/js/latest/guide/cheatsheet.jade index ff8cc6085c..51a21522a9 100644 --- a/public/docs/js/latest/guide/cheatsheet.jade +++ b/public/docs/js/latest/guide/cheatsheet.jade @@ -1 +1 @@ -!= partial("../cheatsheet") +extends ../cheatsheet diff --git a/public/docs/ts/latest/cheatsheet.jade b/public/docs/ts/latest/cheatsheet.jade index c0a8daa12e..eec36cfb3f 100644 --- a/public/docs/ts/latest/cheatsheet.jade +++ b/public/docs/ts/latest/cheatsheet.jade @@ -1,8 +1,4 @@ - var base = current.path[4] ? '.' : './guide'; -.banner - p.text-body This cheat sheet is provisional and may change. Angular 2 is currently in Beta. - p.text-body 本小抄是临时的,将来可能改变。Angular 2目前在候选版本阶段。 -article(class="l-content-small grid-fluid docs-content") - .cheatsheet - ngio-cheatsheet(src= base + '/cheatsheet-cn.json') +.l-content-small.grid-fluid.docs-content.cheatsheet + ngio-cheatsheet(src= base + '/cheatsheet.json') diff --git a/public/docs/ts/latest/glossary.jade b/public/docs/ts/latest/glossary.jade index 427ac0f923..8a0a054f6f 100644 --- a/public/docs/ts/latest/glossary.jade +++ b/public/docs/ts/latest/glossary.jade @@ -536,22 +536,22 @@ block includes ## ES 2015 .l-sub-section :marked - Short hand for "[ECMAScript 2015](#ecmascript=2015)". + Short hand for [ECMAScript](#ecmascript) 2015. - [ECMAScript 2015](#ecmascript=2015)的缩写。 + [ECMAScript](#ecmascript) 2015的缩写。 :marked ## ES6 .l-sub-section :marked - Short hand for "[ECMAScript 2015](#ecmascript=2015)". + Short hand for [ECMAScript](#ecmascript) 2015. - [ECMAScript 2015](#ecmascript=2015)的简写。 + [ECMAScript](#ecmascript) 2015的简写。 :marked ## ES5 .l-sub-section :marked - Short hand for "ECMAScript 5", the version of JavaScript run by most modern browsers. + Short hand for [ECMAScript](#ecmascript) 5, the version of JavaScript run by most modern browsers. See [ECMAScript](#ecmascript). “ECMAScript 5”的简写,大部分现代浏览器使用的JavaScript版本。参见[ECMAScript](#ecmascript)。 @@ -1125,7 +1125,7 @@ a#snake-case ## TypeScript .l-sub-section :marked - A version of JavaScript that supports most [ECMAScript 2015](#ecmascript=2015) + A version of JavaScript that supports most [ECMAScript](#ecmascript) 2015 language features and many features that may arrive in future versions of JavaScript such as [Decorators](#decorator). diff --git a/public/docs/ts/latest/guide/_data.json b/public/docs/ts/latest/guide/_data.json index 3d4fbfabf0..bf75fd8aa3 100644 --- a/public/docs/ts/latest/guide/_data.json +++ b/public/docs/ts/latest/guide/_data.json @@ -86,6 +86,11 @@ "intro": "属性型指令把行为添加到现有元素上。" }, + "browser-support": { + "title": "Browser support", + "intro": "Browser support and polyfills guide." + }, + "component-styles": { "title": "组件样式", "intro": "学习如何给组件应用CSS样式。" diff --git a/public/docs/ts/latest/guide/browser-support.jade b/public/docs/ts/latest/guide/browser-support.jade new file mode 100644 index 0000000000..461aecc93c --- /dev/null +++ b/public/docs/ts/latest/guide/browser-support.jade @@ -0,0 +1,204 @@ +block includes + include ../_util-fns + - var _at_angular = '@angular' + +:marked + # Browser support # + Angular supports most recent browsers. This includes the following specific versions: + +table + tr + th Chrome + th Firefox + th Edge + th IE + th Safari + th iOS + th Android + th IE mobile + tr + td latest + td latest + td 14 + td 11 + td 9 + td 9 + td Marshmallow (6.0) + td 11 + tr + td + td + td 13 + td 10 + td 8 + td 8 + td Lollipop
(5.0, 5.1) + td + tr + td + td + td + td 9 + td 7 + td 7 + td KitKat
(4.4) + td + tr + td + td + td + td + td + td + td Jelly Bean
(4.1, 4.2, 4.3) + td + + +.l-sub-section + :marked + Angular's continuous integration process runs unit tests of the framework on all of these browsers for every pull request, + using SauceLabs and + Browserstack. + +:marked + # Polyfills # + Angular is built on the latest standards of the web platform. + Targeting such a wide range of browsers is challenging because they do not support all features of modern browsers. + + You compensate by loading polyfill scripts ("polyfills") on the host web page (`index.html`) + that implement missing features in JavaScript. ++makeExample('quickstart/ts/index.html', 'polyfills')(format='.') +:marked + A particular browser may require at least one polyfill to run _any_ Angular application. + You may need additional polyfills for specific features. + + The tables below will help you determine which polyfills to load, depending on the browsers you target and the features you use. + +.alert.is-important + :marked + The suggested polyfills are the ones we know will run full Angular applications. + You may need additional polyfills to support features not covered by this list. + Note that polyfills cannot magically transform an old, slow browser into a modern, fast one. + +:marked + ## Mandatory polyfills ## + These are the polyfills required to run an Angular application on each supported browser: + +table + tr(style="vertical-align: top") + th Browsers (desktop & mobile) + th Polyfills required + tr(style="vertical-align: top") + td Chrome, Firefox, Edge, Safari 9+ + td None + tr(style="vertical-align: top") + td Safari 7 & 8, IE10 & 11, Android 4.1+ + td + :marked + [ES6](#core-es6) + tr(style="vertical-align: top") + td IE9 + td + :marked + [ES6
classList](#classlist) + +:marked + ## Optional browser features to polyfill ## + Some features of Angular may require additional polyfills. + + For example, the animations library relies on the standard web animation API, which is only available in Chrome and Firefox today. + You'll need a polyfill to use animations in other browsers. + + Here are the features which may require additional polyfills: + +table + tr(style="vertical-align: top") + th Feature + th Polyfill + th(style="width: 50%") Browsers (desktop & mobile) + + tr(style="vertical-align: top") + td + a(href="./animations.html") Animations + td + :marked + [Web Animations](#web-animations) + td All but Chrome and Firefox
Not supported in IE9 + tr(style="vertical-align: top") + td + a(href="../api/common/index/DatePipe-class.html" target="_blank") Date + span , + a(href="../api/common/index/CurrencyPipe-class.html" target="_blank") currency + span , + a(href="../api/common/index/DecimalPipe-class.html" target="_blank") decimal + span and + a(href="../api/common/index/PercentPipe-class.html" target="_blank") percent + span pipes + td + :marked + [Intl API](#intl) + td All but Chrome, Firefox, Edge and IE11 + tr(style="vertical-align: top") + td + a(href="../api/common/index/NgClass-directive.html" target="_blank") NgClass + span on SVG elements + td + :marked + [classList](#classlist) + td IE10, IE11 + tr(style="vertical-align: top") + td + a(href="./server-communication.html") Http + span when sending and receiving binary data + td + :marked + [Typed Array](#typedarray)
[Blob](#blob)
[FormData](#formdata) + td IE 9 + +:marked + ## Suggested polyfills ## + Below are the polyfills which are used to test the framework itself. They are a good starting point for an application. + +table + tr + th Polyfill + th Licence + th Size* + tr + td + a#core-es6(href="https://github.com/zloirock/core-js" target="_blank") ES6 + td MIT + td 27.4KB + tr + td + a#classlist(href="https://github.com/eligrey/classList.js" target="_blank") classList + td Public domain + td 1KB + tr + td + a#intl(href="https://github.com/andyearnshaw/Intl.js" target="_blank") Intl + td MIT / Unicode licence + td 13.5KB + tr + td + a#web-animations(href="https://github.com/web-animations/web-animations-js" target="_blank") Web Animations + td Apache + td 14.8KB + tr + td + a#typedarray(href="https://github.com/inexorabletash/polyfill/blob/master/typedarray.js" target="_blank") Typed Array + td MIT + td 4KB + tr + td + a#blob(href="https://github.com/eligrey/Blob.js" target="_blank") Blob + td MIT + td 1.3KB + tr + td + a#formdata(href="https://github.com/francois2metz/html5-formdata" target="_blank") FormData + td MIT + td 0.4KB + +:marked + * Figures are for minified and gzipped code, computed with the closure compiler diff --git a/public/docs/ts/latest/guide/cheatsheet.jade b/public/docs/ts/latest/guide/cheatsheet.jade index ff8cc6085c..51a21522a9 100644 --- a/public/docs/ts/latest/guide/cheatsheet.jade +++ b/public/docs/ts/latest/guide/cheatsheet.jade @@ -1 +1 @@ -!= partial("../cheatsheet") +extends ../cheatsheet diff --git a/public/docs/ts/latest/guide/router-deprecated.jade b/public/docs/ts/latest/guide/router-deprecated.jade index 357ce7c10a..e46efcbea3 100644 --- a/public/docs/ts/latest/guide/router-deprecated.jade +++ b/public/docs/ts/latest/guide/router-deprecated.jade @@ -1380,9 +1380,8 @@ code-example(format="." language="bash"). We too can call that `ngOnInit` method in our tests if we wish ... after taking control of the injected `HeroService` and (perhaps) mocking it. - - -.l-main-section +a#browser-url-styles +.l-main-section#location-strategy :marked ## Appendix: *LocationStrategy* and browser URL styles diff --git a/public/docs/ts/latest/guide/router.jade b/public/docs/ts/latest/guide/router.jade index f534d85f29..3befbd5882 100644 --- a/public/docs/ts/latest/guide/router.jade +++ b/public/docs/ts/latest/guide/router.jade @@ -3389,11 +3389,8 @@ a#fragment 在获得了已注入的`HeroService`实例并(可能)做好模拟(Mock)之后,我们可以随时在测试中调用`ngOnInit`方法。 - - - -.l-main-section - +a#browser-url-styles +.l-main-section#location-strategy :marked ## Appendix: *LocationStrategy* and browser URL styles diff --git a/public/docs/ts/latest/quickstart.jade b/public/docs/ts/latest/quickstart.jade index e49fbd28ab..188c1e0295 100644 --- a/public/docs/ts/latest/quickstart.jade +++ b/public/docs/ts/latest/quickstart.jade @@ -315,11 +315,11 @@ block install-packages application, you'd likely import [`FormsModule`](../latest/api/forms/index/FormsModule-class .html) as well as [`RouterModule`](../latest/api/router/index/RouterModule-class.html) and [`HttpModule`](../latest/api/http/index/HttpModule-class.html). These are introduced in the - [Tour of Heroes Tutorial](../tutorial/). + [Tour of Heroes Tutorial](./tutorial/). QuickStart应用不做别的,也就先不需要其他模块。在真实的应用中,我们可能还得导入[`FormsModule`](../latest/api/forms/index/FormsModule-class .html)、[`RouterModule`](../latest/api/router/index/RouterModule-class.html)和 - [`HttpModule`](../latest/api/http/index/HttpModule-class.html)。这些会在[英雄指南教程](../tutorial/)中引入。 + [`HttpModule`](../latest/api/http/index/HttpModule-class.html)。这些会在[英雄指南教程](./tutorial/)中引入。 .l-main-section diff --git a/public/resources/css/module/_api.scss b/public/resources/css/module/_api.scss index a62562df3c..00adfe2a33 100644 --- a/public/resources/css/module/_api.scss +++ b/public/resources/css/module/_api.scss @@ -8,6 +8,10 @@ content: 'D'; background: #db4437; } + &.pipe:before { + content: 'P'; + background: #78909C; + } &.class:before { content: 'C'; background: #4285f4; diff --git a/public/resources/js/directives/api-list.js b/public/resources/js/directives/api-list.js index a7cac49374..d6bc149b8d 100644 --- a/public/resources/js/directives/api-list.js +++ b/public/resources/js/directives/api-list.js @@ -31,6 +31,7 @@ angularIO.directive('apiList', function () { $ctrl.apiTypes = [ { cssClass: 'stable', title: 'Stable', matches: ['stable']}, { cssClass: 'directive', title: 'Directive', matches: ['directive'] }, + { cssClass: 'pipe', title: 'Pipe', matches: ['pipe'] }, { cssClass: 'decorator', title: 'Decorator', matches: ['decorator'] }, { cssClass: 'class', title: 'Class', matches: ['class'] }, { cssClass: 'interface', title: 'Interface', matches: ['interface'] }, diff --git a/pubspec.yaml b/pubspec.yaml index 624e03aed8..28e7ff3b13 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/tools/api-builder/angular.io-package/index.js b/tools/api-builder/angular.io-package/index.js index 2e3a39a90d..f81ee2e69b 100644 --- a/tools/api-builder/angular.io-package/index.js +++ b/tools/api-builder/angular.io-package/index.js @@ -16,7 +16,6 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe .factory(require('./services/renderMarkdown')) .processor(require('./processors/addJadeDataDocsProcessor')) .processor(require('./processors/filterUnwantedDecorators')) -.processor(require('./processors/extractDirectiveClasses')) .processor(require('./processors/matchUpDirectiveDecorators')) .processor(require('./processors/filterMemberDocs')) @@ -100,7 +99,7 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe }) -.config(function(readFilesProcessor, generateNavigationDoc, createOverviewDump) { +.config(function(readFilesProcessor, generateNavigationDoc) { // Clear out unwanted processors generateNavigationDoc.$enabled = false; }) diff --git a/tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js b/tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js index a7caee0555..ca79155f87 100644 --- a/tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js +++ b/tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js @@ -95,7 +95,7 @@ module.exports = function addJadeDataDocsProcessor() { }); // Remove line breaks, there should only be one tag - howToUse = howToUseArray[0].description.replace(/(\r\n|\n|\r)/gm,""); + howToUse = howToUseArray[0].description.replace(/(\r\n|\n|\r)/gm," "); } var whatItDoes = ''; @@ -105,7 +105,7 @@ module.exports = function addJadeDataDocsProcessor() { }); // Remove line breaks, there should only be one tag - whatItDoes = whatItDoesArray[0].description.replace(/(\r\n|\n|\r)/gm,""); + whatItDoes = whatItDoesArray[0].description.replace(/(\r\n|\n|\r)/gm," "); } // SECURITY STATUS @@ -119,7 +119,7 @@ module.exports = function addJadeDataDocsProcessor() { }); // Remove line breaks, there should only be one tag - security = securityArray[0].description.replace(/(\r\n|\n|\r)/gm,""); + security = securityArray[0].description.replace(/(\r\n|\n|\r)/gm," "); exportDoc.showSecurityNotes = true; } diff --git a/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.spec.js b/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.spec.js deleted file mode 100644 index c6b6d6d8b9..0000000000 --- a/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.spec.js +++ /dev/null @@ -1,51 +0,0 @@ -var mockPackage = require('../mocks/mockPackage'); -var Dgeni = require('dgeni'); - -describe('extractDirectiveClasses processor', function() { - var dgeni, injector, processor; - - beforeEach(function() { - dgeni = new Dgeni([mockPackage()]); - injector = dgeni.configureInjector(); - processor = injector.get('extractDirectiveClassesProcessor'); - }); - - it('should extract specified decorator arguments', function() { - var doc = { - id: 'angular2/angular2.ngFor', - name: 'ngFor', - docType: 'class', - decorators: [ - { - name: 'Directive', - arguments: ['{selector: \'[ng-for][ng-for-of]\', properties: [\'ngForOf\']}'], - argumentInfo: [ - { selector: '[ng-for][ng-for-of]', properties: ['ngForOf'] } - ] - } - ] - }; - - var docs = processor.$process([doc]); - - expect(doc).toEqual(jasmine.objectContaining({ - id: 'angular2/angular2.ngFor', - name: 'ngFor', - docType: 'directive', - decorators: [ - { - name: 'Directive', - arguments: ['{selector: \'[ng-for][ng-for-of]\', properties: [\'ngForOf\']}'], - argumentInfo: [ - { selector: '[ng-for][ng-for-of]', properties: ['ngForOf'] } - ] - } - ] - })); - - expect(doc.directiveOptions).toEqual({ - selector: '[ng-for][ng-for-of]', - properties: ['ngForOf'] - }); - }); -}); \ No newline at end of file diff --git a/tools/api-builder/angular.io-package/templates/class.template.html b/tools/api-builder/angular.io-package/templates/class.template.html index db2dddc495..bb9afaeb6b 100644 --- a/tools/api-builder/angular.io-package/templates/class.template.html +++ b/tools/api-builder/angular.io-package/templates/class.template.html @@ -1,5 +1,5 @@ -{% include "lib/githubLinks.html" -%} -{% include "lib/paramList.html" -%} +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} {% extends 'layout/base.template.html' -%} {% block body %} @@ -25,7 +25,7 @@ div(layout="row" layout-xs="column" class="ng-cloak") pre(class="prettyprint no-bg-with-indent") a(class="code-anchor" href="#{$ member.name $}-anchor") code(class="code-background api-doc-code") {$ member.name | indent(6, false) | trim $} - code(class="api-doc-code") {$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} + code(class="api-doc-code") {$ params.paramList(member.parameters) | indent(8, false) | trim $}{$ params.returnType(member.returnType) $} {% endif %}{% endfor %} {% endif %} {% if doc.constructorDoc.name %} @@ -34,7 +34,7 @@ div(layout="row" layout-xs="column" class="ng-cloak") a(class="code-anchor" href="#constructor") code(class="code-background api-doc-code") {$ doc.constructorDoc.name $} code(class="api-doc-code"). - {$ paramList(doc.constructorDoc.parameters) | indent(8, false) | trim $} + {$ params.paramList(doc.constructorDoc.parameters) | indent(8, false) | trim $} {% endif %} {% if doc.members.length %} div(layout="column") @@ -42,7 +42,7 @@ div(layout="row" layout-xs="column" class="ng-cloak") pre(class="prettyprint no-bg-with-indent") a(class="code-anchor" href="#{$ member.name $}-anchor") code(class="code-background api-doc-code") {$ member.name | indent(6, false) | trim $} - code(class="api-doc-code") {$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} + code(class="api-doc-code") {$ params.paramList(member.parameters) | indent(8, false) | trim $}{$ params.returnType(member.returnType) $} {% endif %}{% endfor %} {% endif %} p(class="selector endParens") @@ -60,14 +60,6 @@ div(layout="row" layout-xs="column" class="row-margin ng-cloak") {$ doc.description | indentForMarkdown(6) | trimBlankLines $} {% endif %} -div(layout="row" layout-xs="column" class="row-margin ng-cloak") - div(flex="20" flex-xs="100") - h2(class="h2-api-docs") Class Export - div(flex="80" flex-xs="100") - pre.prettyprint.no-bg - code(class="api-doc-code no-pln"). - export {$ doc.docType $} {$ doc.name $} - {%- if doc.decorators.length %} {% block annotations %} div(layout="row" layout-xs="column" class="row-margin ng-cloak") @@ -77,7 +69,7 @@ div(layout="row" layout-xs="column" class="row-margin ng-cloak") {%- for decorator in doc.decorators %} pre.prettyprint.no-bg code(class="api-doc-code"). - @{$ decorator.name $}{$ paramList(decorator.arguments) | indent(10, false) $} + @{$ decorator.name $}{$ params.paramList(decorator.arguments) | indent(10, false) $} :marked {%- if not decorator.notYetDocumented %} {$ decorator.description | indentForMarkdown(8) | trimBlankLines $} @@ -94,7 +86,7 @@ div(layout="row" layout-xs="column" class="row-margin ng-cloak") a(name="constructor" class="anchor-offset") pre(class="prettyprint no-bg" ng-class="{ 'anchor-focused': appCtrl.isApiDocMemberFocused('{$ doc.constructorDoc.name $}') }") code(class="api-doc-code"). - {$ doc.constructorDoc.name $}{$ paramList(doc.constructorDoc.parameters) | indent(8, false) | trim $} + {$ doc.constructorDoc.name $}{$ params.paramList(doc.constructorDoc.parameters) | indent(8, false) | trim $} :marked {%- if not doc.constructorDoc.notYetDocumented %} {$ doc.constructorDoc.description | indentForMarkdown(6) | replace('### Example', '') | replace('## Example', '') | replace('# Example', '') | trimBlankLines $} @@ -110,7 +102,7 @@ div(layout="row" layout-xs="column" class="row-margin ng-cloak") a(name="{$ member.name $}-anchor" class="anchor-offset") pre(class="prettyprint no-bg" ng-class="{ 'anchor-focused': appCtrl.isApiDocMemberFocused('{$ member.name $}') }") code(class="api-doc-code"). - {$ member.name $}{$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} + {$ member.name $}{$ params.paramList(member.parameters) | indent(8, false) | trim $}{$ params.returnType(member.returnType) $} :marked {%- if not member.notYetDocumented %} {$ member.description | indentForMarkdown(6) | replace('### Example', '') | replace('## Example', '') | replace('# Example', '') | trimBlankLines $} @@ -132,7 +124,7 @@ div(layout="row" layout-xs="column" class="instance-members" class="row-margin n a(name="{$ member.name $}-anchor" class="anchor-offset") pre(class="prettyprint no-bg" ng-class="{ 'anchor-focused': appCtrl.isApiDocMemberFocused('{$ member.name $}') }") code(class="api-doc-code"). - {$ member.name $}{$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} + {$ member.name $}{$ params.paramList(member.parameters) | indent(8, false) | trim $}{$ params.returnType(member.returnType) $} :marked {%- if not member.notYetDocumented %} @@ -147,7 +139,7 @@ div(layout="row" layout-xs="column" class="instance-members" class="row-margin n {% endif %} p(class="location-badge"). - exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } - defined in {$ githubViewLink(doc) $} + exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }, + defined in {$ github.githubViewLink(doc) $} {% endblock %} diff --git a/tools/api-builder/angular.io-package/templates/decorator.template.html b/tools/api-builder/angular.io-package/templates/decorator.template.html index 7c86eca94d..1303ef9cd9 100644 --- a/tools/api-builder/angular.io-package/templates/decorator.template.html +++ b/tools/api-builder/angular.io-package/templates/decorator.template.html @@ -1,5 +1,5 @@ -{% include "lib/githubLinks.html" -%} -{% include "lib/paramList.html" -%} +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} {% extends 'layout/base.template.html' %} {% block body %} @@ -15,17 +15,37 @@ include {$ relativePath(doc.path, '_util-fns') $} div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(flex="20" flex-xs="100") - h2(class="h2-api-docs") Variable Export + h2(class="h2-api-docs") Description div(class="code-links" flex="80" flex-xs="100") - pre.prettyprint.no-bg - code. - export {$ doc.name $}(options : {@link {$ doc.decoratorType $} {$ doc.decoratorType | escape $}}){$ returnType(doc.returnType) $} :marked {%- if not doc.notYetDocumented %} {$ doc.description | indentForMarkdown(6) | trimBlankLines $} {% endif %} +{% if doc.metadataDoc and doc.metadataDoc.members.length %} +div(layout="row" layout-xs="column" class="metadata" class="row-margin ng-cloak") + div(flex="20" flex-xs="100") + h2(class="h2-api-docs") Metadata Properties + div(class="code-links" flex="80" flex-xs="100") + {% for metadata in doc.metadataDoc.members %}{% if not metadata.internal %} + a(name="{$ metadata.name $}-anchor" class="anchor-offset") + pre(class="prettyprint no-bg" ng-class="{ 'anchor-focused': appCtrl.isApiDocMemberFocused('{$ metadata.name $}') }") + code(class="api-doc-code"). + {$ metadata.name $}{$ params.paramList(metadata.parameters) | indent(8, false) | trim $}{$ params.returnType(metadata.returnType) $} + + :marked + {%- if not metadata.notYetDocumented %} +{$ metadata.description | indentForMarkdown(6) | replace('### Example', '') | replace('## Example', '') | replace('# Example', '') | trimBlankLines $} + {% endif -%} + + {% if not loop.last %} + .hr(class="hr-margin") + {% endif %} + + {% endif %}{% endfor %} +{% endif %} + p.location-badge. - exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } defined in {$ githubViewLink(doc) $} + exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } defined in {$ github.githubViewLink(doc) $} {% endblock %} diff --git a/tools/api-builder/angular.io-package/templates/directive.template.html b/tools/api-builder/angular.io-package/templates/directive.template.html index 4bff9414cb..5e8a3cd24d 100644 --- a/tools/api-builder/angular.io-package/templates/directive.template.html +++ b/tools/api-builder/angular.io-package/templates/directive.template.html @@ -1,5 +1,5 @@ -{% include "lib/githubLinks.html" -%} -{% include "lib/paramList.html" -%} +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} {% extends 'class.template.html' -%} {% block annotations %} diff --git a/tools/api-builder/angular.io-package/templates/function.template.html b/tools/api-builder/angular.io-package/templates/function.template.html index 7cac55eb24..7cf1d85640 100644 --- a/tools/api-builder/angular.io-package/templates/function.template.html +++ b/tools/api-builder/angular.io-package/templates/function.template.html @@ -1,5 +1,5 @@ -{% include "lib/githubLinks.html" -%} -{% include "lib/paramList.html" -%} +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} {% extends 'layout/base.template.html' -%} {% block body %} @@ -19,13 +19,13 @@ div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(class="code-links" flex="80" flex-xs="100") pre.prettyprint.no-bg code. - export {$ doc.name $}{$ paramList(doc.parameters) | indent(8, true) | trim $}{$ returnType(doc.returnType) $} + export {$ doc.name $}{$ params.paramList(doc.parameters) | indent(8, true) | trim $}{$ params.returnType(doc.returnType) $} :marked {%- if not doc.notYetDocumented %} {$ doc.description | indentForMarkdown(6) | trimBlankLines $} {% endif %} p.location-badge. - exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } defined in {$ githubViewLink(doc) $} + exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } defined in {$ github.githubViewLink(doc) $} {% endblock %} \ No newline at end of file diff --git a/tools/api-builder/angular.io-package/templates/interface.template.html b/tools/api-builder/angular.io-package/templates/interface.template.html index bce6547d23..59d7ae7cc5 100644 --- a/tools/api-builder/angular.io-package/templates/interface.template.html +++ b/tools/api-builder/angular.io-package/templates/interface.template.html @@ -1 +1,73 @@ -{% extends 'class.template.html' %} \ No newline at end of file +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} +{% extends 'layout/base.template.html' -%} + +{% block body %} +include {$ relativePath(doc.path, '_util-fns') $} + +{% include "layout/_what-it-does.html" %} + +{% include "layout/_security-notes.html" %} + +{% include "layout/_deprecated-notes.html" %} + +{% include "layout/_how-to-use.html" %} + +div(layout="row" layout-xs="column" class="ng-cloak") + div(flex="20" flex-xs="100") + h2(class="h2-api-docs") Interface Overview + div(flex="80" flex-xs="100") + code(class="no-bg api-doc-code openParens") interface {$ doc.name $} { + + {% if doc.members.length %} + div(layout="column") + {% for member in doc.members %}{% if not member.internal %} + pre(class="prettyprint no-bg-with-indent") + a(class="code-anchor" href="#{$ member.name $}-anchor") + code(class="code-background api-doc-code") {$ member.name | indent(6, false) | trim $} + code(class="api-doc-code") {$ params.paramList(member.parameters) | indent(8, false) | trim $}{$ params.returnType(member.returnType) $} + {% endif %}{% endfor %} + {% endif %} + p(class="selector endParens") + code(class="api-doc-code no-bg") } + +{% block additional %} +{% endblock %} + +div(layout="row" layout-xs="column" class="row-margin ng-cloak") + div(flex="20" flex-xs="100") + h2(class="h2-api-docs") Interface Description + div(class="code-links" flex="80" flex-xs="100") + :marked + {%- if doc.description.length > 2 %} +{$ doc.description | indentForMarkdown(6) | trimBlankLines $} + {% endif %} + +{% if doc.members.length %} +div(layout="row" layout-xs="column" class="instance-members" class="row-margin ng-cloak") + div(flex="20" flex-xs="100") + h2(class="h2-api-docs") Interface Details + div(class="code-links" flex="80" flex-xs="100") + {% for member in doc.members %}{% if not member.internal %} + a(name="{$ member.name $}-anchor" class="anchor-offset") + pre(class="prettyprint no-bg" ng-class="{ 'anchor-focused': appCtrl.isApiDocMemberFocused('{$ member.name $}') }") + code(class="api-doc-code"). + {$ member.name $}{$ params.paramList(member.parameters) | indent(8, false) | trim $}{$ params.returnType(member.returnType) $} + + :marked + {%- if not member.notYetDocumented %} +{$ member.description | indentForMarkdown(6) | replace('### Example', '') | replace('## Example', '') | replace('# Example', '') | trimBlankLines $} + {% endif -%} + + {% if not loop.last %} + .hr(class="hr-margin") + {% endif %} + + {% endif %}{% endfor %} +{% endif %} + +p(class="location-badge"). + exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }, + defined in {$ github.githubViewLink(doc) $} + +{% endblock %} diff --git a/tools/api-builder/angular.io-package/templates/lib/githubLinks.html b/tools/api-builder/angular.io-package/templates/lib/githubLinks.html index 4bf27cd15c..36ec6d0576 100644 --- a/tools/api-builder/angular.io-package/templates/lib/githubLinks.html +++ b/tools/api-builder/angular.io-package/templates/lib/githubLinks.html @@ -3,5 +3,5 @@ https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInf {%- endmacro %} {% macro githubViewLink(doc) -%} - {$ doc.fileInfo.projectRelativePath $} (line {$ doc.location.start.line+1 $}) -{%- endmacro %} \ No newline at end of file + {$ doc.fileInfo.projectRelativePath $} +{%- endmacro %} diff --git a/tools/api-builder/angular.io-package/templates/module.template.html b/tools/api-builder/angular.io-package/templates/module.template.html index fb62f190e4..d047e67fb1 100644 --- a/tools/api-builder/angular.io-package/templates/module.template.html +++ b/tools/api-builder/angular.io-package/templates/module.template.html @@ -1,9 +1,9 @@ -{% include "lib/githubLinks.html" -%} +{% import "lib/githubLinks.html" as github -%} {% extends 'layout/base.template.html' -%} {% block body -%} include {$ relativePath(doc.path, '_util-fns') $} p.location-badge. - defined in {$ githubViewLink(doc) $} + defined in {$ github.githubViewLink(doc) $} ul {% for page in doc.childPages -%} diff --git a/tools/api-builder/angular.io-package/templates/overview-dump.template.html b/tools/api-builder/angular.io-package/templates/overview-dump.template.html index 535b57be45..e02c70adff 100644 --- a/tools/api-builder/angular.io-package/templates/overview-dump.template.html +++ b/tools/api-builder/angular.io-package/templates/overview-dump.template.html @@ -1,5 +1,5 @@ -{% include "lib/githubLinks.html" -%} -{% include "lib/paramList.html" -%} +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} @@ -47,21 +47,21 @@ {% for export in module.exports %}

- + {$ export.docType $} {$ export.name $}

{%- if export.constructorDoc %}

- - {$ export.constructorDoc.name $}{$ paramList(export.constructorDoc.params) $} + + {$ export.constructorDoc.name $}{$ params.paramList(export.constructorDoc.params) $}

{% endif -%} {%- for member in export.members %}

- - {$ member.name $}{$ paramList(member.params) $} + + {$ member.name $}{$ params.paramList(member.params) $}

{% endfor %} diff --git a/tools/api-builder/angular.io-package/templates/pipe.template.html b/tools/api-builder/angular.io-package/templates/pipe.template.html new file mode 100644 index 0000000000..86db8582a2 --- /dev/null +++ b/tools/api-builder/angular.io-package/templates/pipe.template.html @@ -0,0 +1,29 @@ +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} +{% extends 'layout/base.template.html' -%} + +{% block body %} +include {$ relativePath(doc.path, '_util-fns') $} + +{% include "layout/_what-it-does.html" %} + +{% include "layout/_security-notes.html" %} + +{% include "layout/_deprecated-notes.html" %} + +{% include "layout/_how-to-use.html" %} + +div(layout="row" layout-xs="column" class="row-margin ng-cloak") + div(flex="20" flex-xs="100") + h2(class="h2-api-docs") Description + div(class="code-links" flex="80" flex-xs="100") + :marked + {%- if doc.description.length > 2 %} +{$ doc.description | indentForMarkdown(6) | trimBlankLines $} + {% endif %} + +p(class="location-badge"). + exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } + defined in {$ github.githubViewLink(doc) $} + +{% endblock %} diff --git a/tools/api-builder/angular.io-package/templates/var.template.html b/tools/api-builder/angular.io-package/templates/var.template.html index fc9851617e..6985ec43ff 100644 --- a/tools/api-builder/angular.io-package/templates/var.template.html +++ b/tools/api-builder/angular.io-package/templates/var.template.html @@ -1,5 +1,5 @@ -{% include "lib/githubLinks.html" -%} -{% include "lib/paramList.html" -%} +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} {% extends 'layout/base.template.html' %} {% block body %} @@ -27,6 +27,6 @@ div(layout="row" layout-xs="column" class="row-margin ng-cloak") p.location-badge. exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } - defined in {$ githubViewLink(doc) $} + defined in {$ github.githubViewLink(doc) $} {% endblock %} diff --git a/tools/api-builder/docs-package/index.js b/tools/api-builder/docs-package/index.js index 52ead1ba98..b44b1446fc 100644 --- a/tools/api-builder/docs-package/index.js +++ b/tools/api-builder/docs-package/index.js @@ -11,14 +11,14 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage, // Register the processors .processor(require('./processors/convertPrivateClassesToInterfaces')) -.processor(require('./processors/extractDirectiveClasses')) .processor(require('./processors/generateNavigationDoc')) .processor(require('./processors/extractTitleFromGuides')) .processor(require('./processors/createOverviewDump')) .processor(require('./processors/checkUnbalancedBackTicks')) .processor(require('./processors/convertBackticksToCodeBlocks')) .processor(require('./processors/addNotYetDocumentedProperty')) -.processor(require('./processors/createDecoratorDocs')) +.processor(require('./processors/mergeDecoratorDocs')) +.processor(require('./processors/extractDecoratedClasses')) .config(function(parseTagsProcessor) { parseTagsProcessor.tagDefinitions.push({ name: 'internal', transforms: function() { return true; } }); diff --git a/tools/api-builder/docs-package/processors/createDecoratorDocs.js b/tools/api-builder/docs-package/processors/createDecoratorDocs.js deleted file mode 100644 index 4e3b70dfd5..0000000000 --- a/tools/api-builder/docs-package/processors/createDecoratorDocs.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = function mergeDecoratorDocs() { - return { - $runAfter: ['processing-docs'], - $runBefore: ['docs-processed'], - $process: function(docs) { - docs.forEach(function(doc) { - var makeDecorator = getMakeDecoratorCall(doc); - if (makeDecorator) { - doc.docType = 'decorator'; - doc.decoratorType = makeDecorator.arguments[0].text; - } - }); - } - }; -}; - -function getMakeDecoratorCall(doc, type) { - - var makeDecoratorFnName = 'make' + (type || '')+ 'Decorator'; - - var initializer = doc.exportSymbol && - doc.exportSymbol.valueDeclaration && - doc.exportSymbol.valueDeclaration.initializer; - - if (initializer) { - // There appear to be two forms of initializer: - // export var Injectable: InjectableFactory = makeDecorator(InjectableMetadata); - // and - // export var RouteConfig: (configs: RouteDefinition[]) => ClassDecorator = makeDecorator(RouteConfigAnnotation); - // In the first case, the type assertion `` causes the AST to contain an extra level of expression - // to hold the new type of the expression. - if (initializer.expression && initializer.expression.expression) { - initializer = initializer.expression; - } - if (initializer.expression && initializer.expression.text === makeDecoratorFnName) { - return initializer; - } - } -} \ No newline at end of file diff --git a/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.js b/tools/api-builder/docs-package/processors/extractDecoratedClasses.js similarity index 63% rename from tools/api-builder/angular.io-package/processors/extractDirectiveClasses.js rename to tools/api-builder/docs-package/processors/extractDecoratedClasses.js index 668dfcd7d4..de643aa5a5 100644 --- a/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.js +++ b/tools/api-builder/docs-package/processors/extractDecoratedClasses.js @@ -1,14 +1,14 @@ var _ = require('lodash'); -module.exports = function extractDirectiveClassesProcessor(EXPORT_DOC_TYPES) { +module.exports = function extractDecoratedClassesProcessor(EXPORT_DOC_TYPES) { // Add the "directive" docType into those that can be exported from a module - EXPORT_DOC_TYPES.push('directive'); + EXPORT_DOC_TYPES.push('directive', 'pipe'); return { $runAfter: ['processing-docs'], $runBefore: ['docs-processed'], - decoratorTypes: ['Directive', 'Component', 'View'], + decoratorTypes: ['Directive', 'Component', 'Pipe'], $process: function(docs) { var decoratorTypes = this.decoratorTypes; @@ -17,9 +17,8 @@ module.exports = function extractDirectiveClassesProcessor(EXPORT_DOC_TYPES) { _.forEach(doc.decorators, function(decorator) { if (decoratorTypes.indexOf(decorator.name) !== -1) { - doc.docType = 'directive'; - - doc[decorator.name.toLowerCase() + 'Options'] = decorator.argumentInfo[0]; + doc.docType = decorator.name.toLowerCase(); + doc[doc.docType + 'Options'] = decorator.argumentInfo[0]; } }); }); @@ -27,4 +26,4 @@ module.exports = function extractDirectiveClassesProcessor(EXPORT_DOC_TYPES) { return docs; } }; -}; \ No newline at end of file +}; diff --git a/tools/api-builder/docs-package/processors/extractDecoratedClasses.spec.js b/tools/api-builder/docs-package/processors/extractDecoratedClasses.spec.js new file mode 100644 index 0000000000..ad6c30ab88 --- /dev/null +++ b/tools/api-builder/docs-package/processors/extractDecoratedClasses.spec.js @@ -0,0 +1,58 @@ +var mockPackage = require('../mocks/mockPackage'); +var Dgeni = require('dgeni'); + +describe('extractDecoratedClasses processor', function() { + var dgeni, injector, processor; + + beforeEach(function() { + dgeni = new Dgeni([mockPackage()]); + injector = dgeni.configureInjector(); + processor = injector.get('extractDecoratedClassesProcessor'); + }); + + it('should extract specified decorator arguments', function() { + var doc1 = { + id: '@angular/common/ngFor', + name: 'ngFor', + docType: 'class', + decorators: [ + { + name: 'Directive', + arguments: ['{selector: \'[ng-for][ng-for-of]\', properties: [\'ngForOf\']}'], + argumentInfo: [ + { selector: '[ng-for][ng-for-of]', properties: ['ngForOf'] } + ] + } + ] + }; + var doc2 = { + id: '@angular/core/DecimalPipe', + name: 'DecimalPipe', + docType: 'class', + decorators: [ + { name: 'Pipe', arguments: ['{name: \'number\'}'], argumentInfo: [{ name: 'number' }]} + ] + }; + + processor.$process([doc1, doc2]); + + expect(doc1).toEqual(jasmine.objectContaining({ + id: '@angular/common/ngFor', + name: 'ngFor', + docType: 'directive', + directiveOptions: { + selector: '[ng-for][ng-for-of]', + properties: ['ngForOf'] + } + })); + + expect(doc2).toEqual(jasmine.objectContaining({ + id: '@angular/core/DecimalPipe', + name: 'DecimalPipe', + docType: 'pipe', + pipeOptions: { + name: 'number' + } + })); + }); +}); \ No newline at end of file diff --git a/tools/api-builder/docs-package/processors/extractDirectiveClasses.js b/tools/api-builder/docs-package/processors/extractDirectiveClasses.js deleted file mode 100644 index 91f83a06bd..0000000000 --- a/tools/api-builder/docs-package/processors/extractDirectiveClasses.js +++ /dev/null @@ -1,32 +0,0 @@ -var _ = require('lodash'); -var vm = require('vm'); - -module.exports = function extractDirectiveClassesProcessor() { - return { - $runAfter: ['processing-docs'], - $runBefore: ['docs-processed'], - decoratorTypes: ['Directive', 'Component', 'View'], - $process: function(docs) { - var decoratorTypes = this.decoratorTypes; - - _.forEach(docs, function(doc) { - - _.forEach(doc.decorators, function(decorator) { - - if (decoratorTypes.indexOf(decorator.name) !== -1) { - - // We use this sneaky vm trick to extract the object literal - // argument from the decorator's constructor call - var args = decorator.arguments ? - vm.runInNewContext('dummy = ' + decorator.arguments[0]) : {}; - - doc[decorator.name.toLowerCase() + 'Options'] = args; - doc.docType = 'directive'; - } - }); - }); - - return docs; - } - }; -}; diff --git a/tools/api-builder/docs-package/processors/extractDirectiveClasses.spec.js b/tools/api-builder/docs-package/processors/extractDirectiveClasses.spec.js deleted file mode 100644 index ed0c9ed959..0000000000 --- a/tools/api-builder/docs-package/processors/extractDirectiveClasses.spec.js +++ /dev/null @@ -1,45 +0,0 @@ -var mockPackage = require('../mocks/mockPackage'); -var Dgeni = require('dgeni'); - -describe('extractDirectiveClasses processor', function() { - var dgeni, injector, processor; - - beforeEach(function() { - dgeni = new Dgeni([mockPackage()]); - injector = dgeni.configureInjector(); - processor = injector.get('extractDirectiveClassesProcessor'); - }); - - it('should extract specified decorator arguments', function() { - var doc = { - id: 'angular2/angular2.ngFor', - name: 'ngFor', - docType: 'class', - decorators: [ - { - name: 'Directive', - arguments: ['{selector: \'[ng-for][ng-for-of]\', properties: [\'ngForOf\']}'] - } - ] - }; - - var docs = processor.$process([doc]); - - expect(doc).toEqual(jasmine.objectContaining({ - id: 'angular2/angular2.ngFor', - name: 'ngFor', - docType: 'directive', - decorators: [ - { - name: 'Directive', - arguments: ['{selector: \'[ng-for][ng-for-of]\', properties: [\'ngForOf\']}'] - } - ] - })); - - expect(doc.directiveOptions).toEqual({ - selector: '[ng-for][ng-for-of]', - properties: ['ngForOf'] - }); - }); -}); \ No newline at end of file diff --git a/tools/api-builder/docs-package/processors/mergeDecoratorDocs.js b/tools/api-builder/docs-package/processors/mergeDecoratorDocs.js new file mode 100644 index 0000000000..83c9d40d83 --- /dev/null +++ b/tools/api-builder/docs-package/processors/mergeDecoratorDocs.js @@ -0,0 +1,88 @@ +var _ = require('lodash'); + +module.exports = function mergeDecoratorDocs() { + return { + $runAfter: ['processing-docs'], + $runBefore: ['docs-processed'], + docsToMergeInfo: [ + { nameTemplate: _.template('${name}Decorator'), decoratorProperty: 'decoratorInterfaceDoc' }, + { nameTemplate: _.template('${name}Metadata'), decoratorProperty: 'metadataDoc', useFields: ['howToUse', 'whatItDoes'] }, + { nameTemplate: _.template('${name}MetadataType'), decoratorProperty: 'metadataInterfaceDoc' }, + { nameTemplate: _.template('${name}MetadataFactory'), decoratorProperty: 'metadataFactoryDoc' } + ], + $process: function(docs) { + + var docsToMergeInfo = this.docsToMergeInfo; + var docsToMerge = Object.create(null); + + docs.forEach(function(doc) { + + // find all the decorators, signified by a call to `makeDecorator(metadata)` + var makeDecorator = getMakeDecoratorCall(doc); + if (makeDecorator) { + doc.docType = 'decorator'; + // get the type of the decorator metadata + doc.decoratorType = makeDecorator.arguments[0].text; + // clear the symbol type named (e.g. ComponentMetadataFactory) since it is not needed + doc.symbolTypeName = undefined; + + // keep track of the docs that need to be merged into this decorator doc + docsToMergeInfo.forEach(function(info) { + docsToMerge[info.nameTemplate({name: doc.name})] = { decoratorDoc: doc, property: info.decoratorProperty }; + }); + } + }); + + // merge the metadata docs into the decorator docs + docs = docs.filter(function(doc) { + if (docsToMerge[doc.name]) { + var decoratorDoc = docsToMerge[doc.name].decoratorDoc; + var property = docsToMerge[doc.name].property; + var useFields = docsToMerge[doc.name].useFields; + + // attach this document to its decorator + decoratorDoc[property] = doc; + + // Copy over fields from the merged doc if specified + if (useFields) { + useFields.forEach(function(field) { + decoratorDoc[field] = doc[field]; + }); + } + + // remove doc from its module doc's exports + doc.moduleDoc.exports = doc.moduleDoc.exports.filter(function(exportDoc) { return exportDoc !== doc; }); + + + // remove from the overall list of docs to be rendered + return false; + } + return true; + }); + } + }; +}; + +function getMakeDecoratorCall(doc, type) { + + var makeDecoratorFnName = 'make' + (type || '')+ 'Decorator'; + + var initializer = doc.exportSymbol && + doc.exportSymbol.valueDeclaration && + doc.exportSymbol.valueDeclaration.initializer; + + if (initializer) { + // There appear to be two forms of initializer: + // export var Injectable: InjectableFactory = makeDecorator(InjectableMetadata); + // and + // export var RouteConfig: (configs: RouteDefinition[]) => ClassDecorator = makeDecorator(RouteConfigAnnotation); + // In the first case, the type assertion `` causes the AST to contain an extra level of expression + // to hold the new type of the expression. + if (initializer.expression && initializer.expression.expression) { + initializer = initializer.expression; + } + if (initializer.expression && initializer.expression.text === makeDecoratorFnName) { + return initializer; + } + } +} \ No newline at end of file diff --git a/tools/api-builder/docs-package/processors/createDecoratorDocs.spec.js b/tools/api-builder/docs-package/processors/mergeDecoratorDocs.spec.js similarity index 100% rename from tools/api-builder/docs-package/processors/createDecoratorDocs.spec.js rename to tools/api-builder/docs-package/processors/mergeDecoratorDocs.spec.js diff --git a/tools/api-builder/docs-package/templates/module.template.html b/tools/api-builder/docs-package/templates/module.template.html index 34ab0f67ab..c4b7360141 100644 --- a/tools/api-builder/docs-package/templates/module.template.html +++ b/tools/api-builder/docs-package/templates/module.template.html @@ -1,9 +1,9 @@ -{% include "lib/githubLinks.html" -%} +{% import "lib/githubLinks.html" as github -%} {% extends 'layout/base.template.html' %} {% block body %}

{$ doc.id $} module

-

defined in {$ githubViewLink(doc) $}

+

defined in {$ github.githubViewLink(doc) $}

{$ doc.description | marked $}

{% if doc.exports.length %} diff --git a/tools/api-builder/links-package/inline-tag-defs/linkDocs.js b/tools/api-builder/links-package/inline-tag-defs/linkDocs.js index 6254fc2d2f..68bbeaede3 100644 --- a/tools/api-builder/links-package/inline-tag-defs/linkDocs.js +++ b/tools/api-builder/links-package/inline-tag-defs/linkDocs.js @@ -45,7 +45,8 @@ module.exports = function linkDocsInlineTagDef(parseArgString, createDocMessage, var vers = _self.vers; var prevUri = uri; uri = path.join(lang, vers, uri); - log.info('Ajusted linkDocs chapter-relative uri (' + doc.fileInfo.baseName + '): ' + prevUri + ' -> ' + uri); + var fileName = doc.fileInfo ? (' (' + doc.fileInfo.baseName + ')') : ''; + log.info('Ajusted linkDocs chapter-relative uri' + fileName + ': ' + prevUri + ' -> ' + uri); } var isValid = false; diff --git a/tools/dart-api-builder/index.js b/tools/dart-api-builder/index.js index 0806209fa5..a84c786b6e 100644 --- a/tools/dart-api-builder/index.js +++ b/tools/dart-api-builder/index.js @@ -52,7 +52,7 @@ module.exports = new Package('dart-api-and-cheatsheet-builder', [basePackage, ta .config(function (convertPrivateClassesToInterfacesProcessor, createOverviewDump, - extractDirectiveClassesProcessor, + extractDecoratedClassesProcessor, extractJSDocCommentsProcessor, extractTitleFromGuides, generateNavigationDoc, @@ -62,7 +62,7 @@ module.exports = new Package('dart-api-and-cheatsheet-builder', [basePackage, ta // Clear out unwanted processors createOverviewDump.$enabled = false; convertPrivateClassesToInterfacesProcessor.$enabled = false; - extractDirectiveClassesProcessor.$enabled = false; + extractDecoratedClassesProcessor.$enabled = false; extractJSDocCommentsProcessor.$enabled = false; extractTitleFromGuides.$enabled = false; generateNavigationDoc.$enabled = false;