diff --git a/.firebaserc b/.firebaserc index 2ef123c5bd..77c09fb883 100644 --- a/.firebaserc +++ b/.firebaserc @@ -1,6 +1,8 @@ { "projects": { "live": "angular-io", - "ngdocsdev": "ngdocsdev" + "ngdocsdev": "ngdocsdev", + "kw-dev": "kw-angular-io", + "dev": "angular-io-dev" } } \ No newline at end of file diff --git a/firebase.json b/firebase.json index 90419f857a..3b5a956478 100644 --- a/firebase.json +++ b/firebase.json @@ -1,75 +1,76 @@ { - "firebase": "angular-io", - "public": "www", - "rewrites": [ - { - "source": "/docs/dart/latest/testing", - "destination":"/docs/dart/latest/guide/testing.html" - }, - { - "source": "/docs/dart/latest/tutorial", - "destination": "/docs/dart/latest/index.html" - }, - { - "source": "/docs/js/latest/testing", - "destination": "/docs/js/latest/guide/testing.html" - }, - { - "source": "/docs/js/latest/tutorial", - "destination": "/docs/js/latest/index.html" - }, - { - "source": "/docs/ts/latest/guide/setup.html", - "destination": "/docs/ts/latest/index.html" - }, - { - "source": "/docs/ts/latest/testing", - "destination": "/docs/ts/latest/guide/testing.html" - }, - { - "source": "/cheatsheet", - "destination": "/docs/ts/latest/guide/cheatsheet.html" - }, - { - "source": "/cheatsheet.json", - "destination": "/docs/ts/latest/guide/cheatsheet.json" - }, - { - "source": "/AngularCheatSheet_Letter.pdf", - "destination": "/docs/ts/latest/guide/AngularCheatSheet_Letter.pdf" - }, - { - "source": "/AngularCheatSheet_Poster.pdf", - "destination": "/docs/ts/latest/guide/AngularCheatSheet_Poster.pdf" - }, - { - "source": "/cardboard", - "destination": "/cardboard/index.html" - }, - { - "source": "/license", - "destination": "/license.txt" - }, - { - "source": "/events", - "destination": "/events.html" - }, - { - "source": "/survey", - "destination": "/survey.html" - }, - { - "source": "/dart", - "destination": "/docs/dart/latest/index.html" - }, - { - "source": "/styleguide", - "destination": "/docs/ts/latest/guide/style-guide.html" - } - ], - "ignore": [ - "firebase.json", - "**/.*", - "**/node_modules/**" - ] -} + "hosting": { + "public": "www", + "rewrites": [ + { + "source": "/docs/dart/latest/testing", + "destination": "/docs/dart/latest/guide/testing.html" + }, + { + "source": "/docs/dart/latest/tutorial", + "destination": "/docs/dart/latest/index.html" + }, + { + "source": "/docs/js/latest/testing", + "destination": "/docs/js/latest/guide/testing.html" + }, + { + "source": "/docs/js/latest/tutorial", + "destination": "/docs/js/latest/index.html" + }, + { + "source": "/docs/ts/latest/guide/setup.html", + "destination": "/docs/ts/latest/index.html" + }, + { + "source": "/docs/ts/latest/testing", + "destination": "/docs/ts/latest/guide/testing.html" + }, + { + "source": "/cheatsheet", + "destination": "/docs/ts/latest/guide/cheatsheet.html" + }, + { + "source": "/cheatsheet.json", + "destination": "/docs/ts/latest/guide/cheatsheet.json" + }, + { + "source": "/AngularCheatSheet_Letter.pdf", + "destination": "/docs/ts/latest/guide/AngularCheatSheet_Letter.pdf" + }, + { + "source": "/AngularCheatSheet_Poster.pdf", + "destination": "/docs/ts/latest/guide/AngularCheatSheet_Poster.pdf" + }, + { + "source": "/cardboard", + "destination": "/cardboard/index.html" + }, + { + "source": "/license", + "destination": "/license.txt" + }, + { + "source": "/events", + "destination": "/events.html" + }, + { + "source": "/survey", + "destination": "/survey.html" + }, + { + "source": "/dart", + "destination": "/docs/dart/latest/index.html" + }, + { + "source": "/styleguide", + "destination": "/docs/ts/latest/guide/style-guide.html" + } + ], + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ] + } +} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index f95b3df6ca..5412201fdb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -14,6 +14,7 @@ var fsExtra = require('fs-extra'); var fs = fsExtra; var exec = require('child_process').exec; var execPromise = Q.denodeify(exec); +var execSync = require('child_process').execSync; // cross platform version of spawn that also works on windows. var xSpawn = require('cross-spawn'); var prompt = require('prompt'); @@ -636,7 +637,7 @@ gulp.task('build-dart-api-docs', ['_shred-api-examples', 'dartdoc'], function() return buildApiDocsForDart(); }); -// Using the --build flag will use systemjs.config.plunker.build.js (for preview builds) +// Using the --build flag will use systemjs.config.web.build.js (for preview builds) gulp.task('build-plunkers', ['_copy-example-boilerplate'], function() { regularPlunker.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log, build: argv.build }); return embeddedPlunker.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log, build: argv.build, targetSelf: argv.targetSelf }); @@ -744,7 +745,7 @@ gulp.task('build-compile', ['build-docs'], function() { return harpCompile(); }); -gulp.task('check-deploy', ['build-docs'], function() { +gulp.task('check-deploy', ['firebase-use-proj-check', 'build-docs'], () => { return harpCompile().then(function() { gutil.log('compile ok'); gutil.log('running live server ...'); @@ -753,7 +754,7 @@ gulp.task('check-deploy', ['build-docs'], function() { }).then(function(shouldDeploy) { if (shouldDeploy) { gutil.log('deploying...'); - return execPromise('firebase deploy'); + return execPromise(`firebase deploy -p ${WWW}`); } else { return ['Not deploying']; } @@ -764,6 +765,17 @@ gulp.task('check-deploy', ['build-docs'], function() { }); }); +gulp.task('firebase-use-proj-check', cb => { + try { + execSync('firebase use'); + } catch (e) { + // Rerun command so user gets project + alias info + execSync('firebase use', {stdio:[0,1,2]}); + throw `\nAborting: no firebase project selected. Run:\n\n firebase use \n\n`; + } + return cb(); +}); + gulp.task('test-api-builder', function (cb) { execCommands(['npm run test-api-builder'], {}, cb); }); @@ -808,7 +820,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']}); + var examplePaths = globby.sync(EXAMPLES_PATH+'/*/', {ignore: ['**/node_modules', '**/_boilerplate']}); var promise = Promise.resolve(true); examplePaths.forEach(function (examplePath) { promise = promise.then(() => docShredder.shredSingleExampleDir(_devguideShredOptions, examplePath)); @@ -1071,7 +1083,6 @@ function backupApiHtmlFilesExist(folderName) { } function harpJsonSetJade2NgTo(v) { - const execSync = require('child_process').execSync; const harpJsonPath = path.join(ANGULAR_IO_PROJECT_PATH, 'harp.json'); execSync(`perl -pi -e 's/("jade2ng": *)\\w+/$1${v}/' ${harpJsonPath}`); const harpJson = require(harpJsonPath); @@ -1208,10 +1219,12 @@ function watchAndSync(options, cb) { // returns a promise; function askDeploy() { + // Show user what the currently active firebase project is: + execSync('firebase use', {stdio:[0,1,2]}); prompt.start(); var schema = { name: 'shouldDeploy', - description: 'Deploy to Firebase? (y/n)', + description: `Deploy ${WWW} to firebase? (y/n)`, type: 'string', pattern: /Y|N|y|n/, message: "Respond with either a 'y' or 'n'", diff --git a/package.json b/package.json index c15d92ecb3..955de60cd4 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "gulp-tslint": "^5.0.0", "gulp-util": "^3.0.6", "gulp-watch": "^4.3.4", - "harp": "0.21.0-pre.1", + "harp": "^0.21.0", "html2jade": "^0.8.4", "indent-string": "^2.1.0", "jasmine-core": "^2.3.4", diff --git a/public/_includes/_hero-home.jade b/public/_includes/_hero-home.jade index 36cd992686..d462935c60 100644 --- a/public/_includes/_hero-home.jade +++ b/public/_includes/_hero-home.jade @@ -10,3 +10,7 @@ header(class="background-sky l-relative") img(src="/translate/cn/gdd.svg" width="64") p 2016 Google 开发者大会来啦!(北京 & 上海) a(href="http://www.google.cn/intl/zh-CN/events/developerday2016/" target="_blank" class="button md-button") 立即报名 + + img(src="/resources/images/logos/anglebrackets/devintersection.png" width="64") + p 参加DEVintersection Amsterdam 11月 14-16号! + a(href="https://www.devintersectioneurope.com/#!/" target="_blank" class="button md-button") 立即报名 diff --git a/public/docs/_examples/_boilerplate/systemjs.config.plunker.build.js b/public/docs/_examples/_boilerplate/systemjs.config.web.build.js similarity index 70% rename from public/docs/_examples/_boilerplate/systemjs.config.plunker.build.js rename to public/docs/_examples/_boilerplate/systemjs.config.web.build.js index e89a192c77..3fa201a280 100644 --- a/public/docs/_examples/_boilerplate/systemjs.config.plunker.build.js +++ b/public/docs/_examples/_boilerplate/systemjs.config.web.build.js @@ -1,5 +1,5 @@ /** - * PLUNKER VERSION FOR CURRENT ANGULAR BUILD + * WEB VERSION FOR CURRENT ANGULAR BUILD * (based on systemjs.config.js in angular.io) * System configuration for Angular samples * Adjust as necessary for your application needs. @@ -11,7 +11,19 @@ // DEMO ONLY! REAL CODE SHOULD NOT TRANSPILE IN THE BROWSER transpiler: 'ts', typescriptOptions: { - tsconfig: true + // Complete copy of compiler options in standard tsconfig.json + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "removeComments": false, + "noImplicitAny": true, + "suppressImplicitAnyIndexErrors": true, + "typeRoots": [ + "../../node_modules/@types/" + ] }, meta: { 'typescript': { @@ -67,4 +79,26 @@ } } }); + + if (!global.noBootstrap) { bootstrap(); } + + // Bootstrap the `AppModule`(skip the `app/main.ts` that normally does this) + function bootstrap() { + + // Stub out `app/main.ts` so System.import('app') doesn't fail if called in the index.html + System.set(System.normalizeSync('app/main.ts'), System.newModule({ })); + + // bootstrap and launch the app (equivalent to standard main.ts) + Promise.all([ + System.import('@angular/platform-browser-dynamic'), + System.import('app/app.module') + ]) + .then(function (imports) { + var platform = imports[0]; + var app = imports[1]; + platform.platformBrowserDynamic().bootstrapModule(app.AppModule); + }) + .catch(function(err){ console.error(err); }); + } + })(this); diff --git a/public/docs/_examples/_boilerplate/systemjs.config.plunker.js b/public/docs/_examples/_boilerplate/systemjs.config.web.js similarity index 61% rename from public/docs/_examples/_boilerplate/systemjs.config.plunker.js rename to public/docs/_examples/_boilerplate/systemjs.config.web.js index 4504d87d72..40e6a67fc6 100644 --- a/public/docs/_examples/_boilerplate/systemjs.config.plunker.js +++ b/public/docs/_examples/_boilerplate/systemjs.config.web.js @@ -1,5 +1,5 @@ /** - * PLUNKER VERSION + * WEB ANGULAR VERSION * (based on systemjs.config.js in angular.io) * System configuration for Angular samples * Adjust as necessary for your application needs. @@ -9,7 +9,19 @@ // DEMO ONLY! REAL CODE SHOULD NOT TRANSPILE IN THE BROWSER transpiler: 'ts', typescriptOptions: { - tsconfig: true + // Complete copy of compiler options in standard tsconfig.json + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "removeComments": false, + "noImplicitAny": true, + "suppressImplicitAnyIndexErrors": true, + "typeRoots": [ + "../../node_modules/@types/" + ] }, meta: { 'typescript': { @@ -54,4 +66,26 @@ } } }); + + if (!global.noBootstrap) { bootstrap(); } + + // Bootstrap the `AppModule`(skip the `app/main.ts` that normally does this) + function bootstrap() { + + // Stub out `app/main.ts` so System.import('app') doesn't fail if called in the index.html + System.set(System.normalizeSync('app/main.ts'), System.newModule({ })); + + // bootstrap and launch the app (equivalent to standard main.ts) + Promise.all([ + System.import('@angular/platform-browser-dynamic'), + System.import('app/app.module') + ]) + .then(function (imports) { + var platform = imports[0]; + var app = imports[1]; + platform.platformBrowserDynamic().bootstrapModule(app.AppModule); + }) + .catch(function(err){ console.error(err); }); + } + })(this); diff --git a/public/docs/_examples/forms/dart/pubspec.yaml b/public/docs/_examples/forms/dart/pubspec.yaml index 62c3e32f16..5a456f3c18 100644 --- a/public/docs/_examples/forms/dart/pubspec.yaml +++ b/public/docs/_examples/forms/dart/pubspec.yaml @@ -12,7 +12,6 @@ transformers: - angular2: platform_directives: - 'package:angular2/common.dart#COMMON_DIRECTIVES' - - 'package:angular2/common.dart#FORM_DIRECTIVES' platform_pipes: - 'package:angular2/common.dart#COMMON_PIPES' entry_points: web/main.dart diff --git a/public/docs/_examples/template-syntax/dart/pubspec.yaml b/public/docs/_examples/template-syntax/dart/pubspec.yaml index 7de95f550e..17ccc01d50 100644 --- a/public/docs/_examples/template-syntax/dart/pubspec.yaml +++ b/public/docs/_examples/template-syntax/dart/pubspec.yaml @@ -12,7 +12,6 @@ transformers: - angular2: platform_directives: - 'package:angular2/common.dart#COMMON_DIRECTIVES' - - 'package:angular2/common.dart#FORM_DIRECTIVES' platform_pipes: - 'package:angular2/common.dart#COMMON_PIPES' entry_points: web/main.dart diff --git a/public/docs/_examples/testing/ts/browser-test-shim.js b/public/docs/_examples/testing/ts/browser-test-shim.js index 1cbabc3f64..efca6c3554 100644 --- a/public/docs/_examples/testing/ts/browser-test-shim.js +++ b/public/docs/_examples/testing/ts/browser-test-shim.js @@ -33,6 +33,8 @@ System.config({ }, }); +document['noBootstrap'] = true; // do not run system.config.web.js bootstrap + System.import('systemjs.config.js') .then(importSystemJsExtras) .then(initTestBed) diff --git a/public/docs/ts/latest/guide/style-guide.jade b/public/docs/ts/latest/guide/style-guide.jade index ad750a1adf..049246afc8 100644 --- a/public/docs/ts/latest/guide/style-guide.jade +++ b/public/docs/ts/latest/guide/style-guide.jade @@ -1940,7 +1940,7 @@ a(href="#toc") 回到顶部 style-guide/ts/04-10/app/shared/filter-text/filter-text.component.ts, style-guide/ts/04-10/app/shared/filter-text/filter-text.service.ts, style-guide/ts/04-10/app/heroes/heroes.component.ts, - style-guide/ts/04-10/app/heroes/heroes.component.html, + style-guide/ts/04-10/app/heroes/heroes.component.html `, `,,,`, `app/shared/shared.module.ts, @@ -1948,7 +1948,7 @@ a(href="#toc") 回到顶部 app/shared/filter-text/filter-text.component.ts, app/shared/filter-text/filter-text.service.ts, app/heroes/heroes.component.ts, - app/heroes/heroes.component.html, + app/heroes/heroes.component.html `) :marked diff --git a/public/events.jade b/public/events.jade index 0e9e927816..261248c3cd 100644 --- a/public/events.jade +++ b/public/events.jade @@ -39,12 +39,34 @@ table.is-full-width td Paris, France td Dec. 5, 2016 - + tr th a( target="_blank" - href="https://ng-be.org/" - ) NG-BE - td Ghent, Belgium - td Dec. 9, 2016 + href="http://www.google.cn/intl/en/events/developerday2016/" + ) Google Developer Day China (Beijing) + td Beijing, China + td Dec. 8, 2016 + + + tr + th + a( + target="_blank" + href="https://ng-be.org/" + ) NG-BE + td Ghent, Belgium + td Dec. 9, 2016 + + + tr + th + a( + target="_blank" + href="http://www.google.cn/intl/en/events/developerday2016/" + ) Google Developer Day China (Shanghai) + td Shanghai, China + td Dec. 14, 2016 + + diff --git a/public/resources/images/logos/google/gdd-logo.png b/public/resources/images/logos/google/gdd-logo.png new file mode 100644 index 0000000000..06826b95d1 Binary files /dev/null and b/public/resources/images/logos/google/gdd-logo.png differ diff --git a/scripts/config/bad-code-excerpt-skip-patterns.txt b/scripts/config/bad-code-excerpt-skip-patterns.txt index 731cbff933..1331f28b30 100644 --- a/scripts/config/bad-code-excerpt-skip-patterns.txt +++ b/scripts/config/bad-code-excerpt-skip-patterns.txt @@ -1,8 +1,5 @@ # Comments & blank lines are ignored. Entry format (make pattern as specific as possible): # # reason / issue number -/[jt]s/.*/api/router-deprecated/ # Obsolete API entries. No issue open yet. -/ts/latest/guide/style-guide.html # https://github.com/angular/angular.io/issues/2123 -/ts/latest/guide/upgrade.html # In a transient state until RC6 - @filipe.silva /[jt]s/.*/api/forms/index/NG_VALIDATORS-let.html # RC6 contains broken example tags /dart/latest/tutorial/toh-pt5.html diff --git a/scripts/install.sh b/scripts/install.sh index 79242a0d16..a478f6880f 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -16,9 +16,6 @@ fi echo "Installing main packages ..." npm install --no-optional -echo "Patching ..." -source ./scripts/patch.sh - if [ -z "$TRAVIS" ]; then echo "Rebuilding node-sass, just in case ..." npm rebuild node-sass; diff --git a/scripts/patch.sh b/scripts/patch.sh deleted file mode 100755 index 87876b20b5..0000000000 --- a/scripts/patch.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -set -e -o pipefail - -TARGET=node_modules/terraform/lib/helpers/raw.js - -# Around line 282 change from/to: -# var namespace = sourcePath.split(".")[0].split("/") -# var namespace = sourcePath.split('.').slice(0, -1).join('.').split('/') - -if [ -e "$TARGET" ]; then - perl -i.bak -pe 's/^(\s+var namespace.*split\("."\))\[0\]/\1.slice(0, -1).join(".")/' "$TARGET" - echo "Patched '$TARGET'." -else - echo "Nothing to patch. Can't find file '$TARGET'." - exit 1; -fi diff --git a/tools/doc-shredder/doc-shredder.js b/tools/doc-shredder/doc-shredder.js index 6ff536d782..7cb4586d23 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/**']; +var ignoreDirs = ['**/node_modules/**', '**/dist/**', '**/dart/**/build/**', '**/.pub/**']; var _getLogLevel = function (options) { return options.logLevel || 'info'; } diff --git a/tools/plunker-builder/builder.js b/tools/plunker-builder/builder.js index f055fd963b..175e69ec54 100644 --- a/tools/plunker-builder/builder.js +++ b/tools/plunker-builder/builder.js @@ -41,7 +41,6 @@ class PlunkerBuilder { if (config.basePath.indexOf('/ts') > -1) { // uses systemjs.config.js so add plunker version this.options.addField(postData, 'systemjs.config.js', this.systemjsConfig); - this.options.addField(postData, 'tsconfig.json', this.tsconfig); } } @@ -210,13 +209,12 @@ class PlunkerBuilder { _getPlunkerFiles() { // Assume plunker version is sibling of node_modules version this.readme = fs.readFileSync(this.basePath + '/_boilerplate/plunker.README.md', 'utf-8'); - var systemJsConfigPath = '/_boilerplate/systemjs.config.plunker.js'; + var systemJsConfigPath = '/_boilerplate/systemjs.config.web.js'; if (this.options.build) { - systemJsConfigPath = '/_boilerplate/systemjs.config.plunker.build.js'; + systemJsConfigPath = '/_boilerplate/systemjs.config.web.build.js'; } this.systemjsConfig = fs.readFileSync(this.basePath + systemJsConfigPath, 'utf-8'); this.systemjsConfig += this.copyrights.jsCss; - this.tsconfig = fs.readFileSync(`${this.basePath}/_boilerplate/tsconfig.json`, 'utf-8'); } _htmlToElement(document, html) { @@ -255,8 +253,8 @@ class PlunkerBuilder { } }); - // var defaultExcludes = [ '!**/node_modules/**','!**/tsconfig.json', '!**/*plnkr.json', '!**/*plnkr.html', '!**/*plnkr.no-link.html' ]; var defaultExcludes = [ + '!**/app/main.ts', '!**/tsconfig.json', '!**/*plnkr.*', '!**/package.json',