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

[WIP]:Create Tour of Heroes chapter on http #1044

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 24 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true


[*.md]
max_line_length = 0
trim_trailing_whitespace = false

[*.jade]
max_line_length = 0
trim_trailing_whitespace = false

# Indentation override
#[lib/**.js]
#[{package.json,.travis.yml}]
#[**/**.js]
11 changes: 0 additions & 11 deletions .vscode/settings.json

This file was deleted.

92 changes: 48 additions & 44 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ var _excludeMatchers = _excludePatterns.map(function(excludePattern){
});

var _exampleBoilerplateFiles = [
'karma.conf.js',
'karma-test-shim.js',
'package.json',
'styles.css',
'tsconfig.json',
'typings.json'
'.editorconfig',
'karma.conf.js',
'karma-test-shim.js',
'package.json',
'styles.css',
'tsconfig.json',
'tslint.json',
'typings.json'
];

var _exampleDartWebBoilerPlateFiles = ['styles.css'];
Expand Down Expand Up @@ -153,14 +155,17 @@ function findAndRunE2eTests(filter) {
// to the outputFile.
function runE2eTests(appDir, protractorConfigFilename, outputFile ) {
// start the app
var appRunSpawnInfo = spawnExt('npm',['run','http-server', '--', '-s' ], { cwd: appDir });

// start protractor
var pcFilename = path.resolve(protractorConfigFilename); // need to resolve because we are going to be running from a different dir
var exePath = path.join(process.cwd(), "./node_modules/.bin/");
var spawnInfo = spawnExt('protractor',
[ pcFilename, '--params.appDir=' + appDir, '--params.outputFile=' + outputFile], { cwd: exePath });
return spawnInfo.promise.then(function(data) {
var appRunSpawnInfo = spawnExt('npm',['run','http-server:e2e', '--', '-s' ], { cwd: appDir });
var tscRunSpawnInfo = spawnExt('npm',['run','tsc'], { cwd: appDir });

return tscRunSpawnInfo.promise.then(function(data) {
// start protractor
var pcFilename = path.resolve(protractorConfigFilename); // need to resolve because we are going to be running from a different dir
var exePath = path.join(process.cwd(), "./node_modules/.bin/");
var spawnInfo = spawnExt('protractor',
[ pcFilename, '--params.appDir=' + appDir, '--params.outputFile=' + outputFile], { cwd: exePath });
return spawnInfo.promise;
}).then(function(data) {
// kill the app now that protractor has completed.
// Ugh... proc.kill does not work properly on windows with child processes.
// appRun.proc.kill();
Expand Down Expand Up @@ -243,14 +248,14 @@ gulp.task('add-example-boilerplate', function() {
gutil.log("symlinking " + linkPath + ' -> ' + realPath)
fsUtils.addSymlink(realPath, linkPath);
});

realPath = path.join(EXAMPLES_PATH, '/typings');
var typingsPaths = getTypingsPaths(EXAMPLES_PATH);
typingsPaths.forEach(function(linkPath) {
gutil.log("symlinking " + linkPath + ' -> ' + realPath)
gutil.log("symlinking " + linkPath + ' -> ' + realPath)
fsUtils.addSymlink(realPath, linkPath);
});

return copyExampleBoilerplate();
});

Expand All @@ -263,7 +268,7 @@ function copyExampleBoilerplate() {
return path.join(EXAMPLES_PATH, fn);
});
var examplePaths = getExamplePaths(EXAMPLES_PATH);

var dartWebSourceFiles = _exampleDartWebBoilerPlateFiles.map(function(fn){
return path.join(EXAMPLES_PATH, fn);
});
Expand All @@ -287,15 +292,15 @@ gulp.task('remove-example-boilerplate', function() {
nodeModulesPaths.forEach(function(linkPath) {
fsUtils.removeSymlink(linkPath);
});

var typingsPaths = getTypingsPaths(EXAMPLES_PATH);
typingsPaths.forEach(function(linkPath) {
fsUtils.removeSymlink(linkPath);
});
});

var examplePaths = getExamplePaths(EXAMPLES_PATH);
var dartExampleWebPaths = getDartExampleWebPaths(EXAMPLES_PATH);

return deleteFiles(_exampleBoilerplateFiles, examplePaths)
.then(function() {
return deleteFiles(_exampleDartWebBoilerPlateFiles, dartExampleWebPaths);
Expand Down Expand Up @@ -346,7 +351,7 @@ gulp.task('build-js-api-docs', ['_shred-api-examples'], function() {
});

gulp.task('build-plunkers', function() {
return copyExampleBoilerplate()
return copyExampleBoilerplate()
.then(function() {
return plunkerBuilder.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log });
});
Expand Down Expand Up @@ -501,7 +506,7 @@ function harpCompile() {
vars: { NODE_ENV: "production" }
});
gutil.log("NODE_ENV: " + process.env.NODE_ENV);

var deferred = Q.defer();
gutil.log('running harp compile...');
showHideExampleNodeModules('hide');
Expand All @@ -523,20 +528,20 @@ function harpCompile() {
}

function linkChecker(options) {
var deferred = Q.defer();
var deferred = Q.defer();
var options = options || {};

var blcOptions = options.blcOptions || {};
var customData = options.customData || {};

var excludeBad; // don't bother reporting bad links matching this RegExp
if (argv.excludeBad) {
excludeBad = new RegExp(argv.excludeBad);
} else {
excludeBad = options.excludeBad === undefined ? /docs\/dart\/latest\/api/ : '';
}
var previousPage;

var previousPage;
var siteUrl = argv.url || options.url || 'https://angular.io/';

// See https://github.com/stevenvachon/broken-link-checker#blcsitecheckeroptions-handlers
Expand All @@ -546,12 +551,12 @@ function linkChecker(options) {
//gutil.log('Scanning ' + pageUrl);docs/ts/latest/api/core/
},
junk: function(result, customData){},

// Analyze links
link: function(result, customData){
if (!result.broken) { return; }
if (excludeBad && excludeBad.test(result.url.resolved)) { return; }

var currentPage = result.base.resolved
if (previousPage !== currentPage) {
previousPage = currentPage;
Expand All @@ -563,10 +568,10 @@ function linkChecker(options) {
//gutil.log(msg);
//gutil.log(result);
},

page: function(error, pageUrl, customData){},
site: function(error, siteUrl, customData){},

end: function(){
var stopTime = new Date().getTime();
var elapsed = 'Elapsed link-checking time: ' + ((stopTime - startTime)/1000) + ' seconds';
Expand All @@ -576,24 +581,24 @@ function linkChecker(options) {
deferred.resolve(true);
}
};

// create an output file with header.
var outputFile = path.join(process.cwd(), 'link-checker-results.txt');
var header = 'Link checker results for: ' + siteUrl +
'\nStarted: ' + (new Date()).toLocaleString() +
'\nStarted: ' + (new Date()).toLocaleString() +
'\nSkipping bad links matching regex: ' +excludeBad.toString() + '\n\n';
gutil.log(header);
fs.writeFileSync(outputFile, header);

var siteChecker = new blc.SiteChecker(blcOptions, handlers);
var startTime = new Date().getTime();
try {

try {
siteChecker.enqueue(siteUrl, customData);
} catch (err) {
deferred.reject(err);
}
return deferred.promise;
}
return deferred.promise;
}

// harp has issues with node_modules under the public dir
Expand Down Expand Up @@ -701,7 +706,7 @@ function watchAndSync(options, cb) {
env({
vars: { NODE_ENV: "production" }
});

execCommands(['npm run harp -- server .'], {}, cb);

var browserSync = require('browser-sync').create();
Expand Down Expand Up @@ -781,7 +786,7 @@ function apiExamplesWatch(postShredAction) {

function devGuideExamplesWatch(shredOptions, postShredAction) {
var includePattern = path.join(shredOptions.examplesDir, '**/*.*');
// removed this version because gulp.watch has the same glob issue that dgeni has.
// 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 files = globby.sync( [includePattern], { ignore: [ '**/node_modules/**', '**/_fragments/**']});
Expand Down Expand Up @@ -989,7 +994,7 @@ function execCommands(cmds, options, cb) {
if (!cmds || cmds.length == 0) cb(null, null, null);
var exec = require('child_process').exec; // just to make it more portable.
gutil.log("NODE_ENV: " + process.env.NODE_ENV);

exec(cmds[0], options, function(err, stdout, stderr) {
if (err == null) {
if (options.shouldLog) {
Expand Down Expand Up @@ -1019,4 +1024,3 @@ function checkAngularProjectPath() {
throw new Error('API related tasks require the angular2 repo to be at ' + path.resolve(ANGULAR_PROJECT_PATH));
}
}

10 changes: 10 additions & 0 deletions harp.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
"juleskremer": {
"name": "Jules Kremer",
"picture": "/resources/images/bios/juleskremer.jpg",
"twitter": "jules_kremer",
"website": "https://plus.google.com/+JulesKremer",
"bio": "Jules is a TPM on the Angular team. When not working with developers, Jules is often bending into pretzel-like shapes, climbing mountains or drinking really awesome beer.",
"type": "Lead"
},
Expand Down Expand Up @@ -397,6 +399,14 @@
"website": "http://teropa.info/",
"bio": "Tero is an independent software developer and writer. He's been building web applications for his whole professional career, and has almost figured out how to do vertical centering in CSS.",
"type": "Community"
},
"deborah": {
"name": "Deborah Kurata",
"picture": "/resources/images/bios/deborah.jpg",
"twitter": "deborahkurata",
"website": "http://blogs.msmvps.com/deborahk/",
"bio": "Deborah is an independent software developer and author. She is author of several Pluralsight courses including: 'Angular 2: Getting Started'",
"type": "Community"
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"gulp-task-listing": "^1.0.1",
"gulp-util": "^3.0.6",
"gulp-watch": "^4.3.4",
"harp": "^0.20.1",
"harp": "^0.20.3",
"html2jade": "^0.8.4",
"indent-string": "^2.1.0",
"jasmine-core": "^2.3.4",
Expand All @@ -71,5 +71,6 @@
},
"dependencies": {
"jstransformer-marked": "^1.0.1"
}
},
"homepage": "http://angular.io/"
}
3 changes: 1 addition & 2 deletions public/_includes/_footer.jade
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ else
ul.text-body
li <a href="/"> Angular 2.0</a>
li <a href="https://angularjs.org/"> Angular 1 for JS</a>
li <a href="https://angulardart.org/"> Angular 1 for Dart</a>
li <a href="https://material.angularjs.org"> Angular Material</a>
li <a href="https://www.firebase.com/docs/web/libraries/angular/"> AngularFire</a>

Expand Down Expand Up @@ -54,4 +53,4 @@ else
footer(class="background-steel")
small.text-caption Powered by Google ©2010-2016. Code licensed under an <a href="/license" class="text-snow">MIT-style License</a>. Documentation licensed under <a class="text-snow" href="http://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>.
a(aria-label="View Style Guide" href=styleguide title="Style Guide" class="styleguide-trigger text-snow" md-button)
span.icon-favorite
span.icon-favorite
20 changes: 20 additions & 0 deletions public/docs/_examples/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true


[*.md]
max_line_length = 0
trim_trailing_whitespace = false

# Indentation override
#[lib/**.js]
#[{package.json,.travis.yml}]
#[**/**.js]
2 changes: 2 additions & 0 deletions public/docs/_examples/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.editorconfig
styles.css
typings
typings.json
Expand All @@ -6,5 +7,6 @@ package.json
karma.conf.js
karma-test-shim.js
tsconfig.json
tslint.json
npm-debug*.
**/protractor.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';

import 'hero.dart';
import 'logger_service.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';

import 'hero.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// #docplaster
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';

import 'hero.dart';
import 'hero_detail_component.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';

import 'backend_service.dart';
import 'hero.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// #docregion
import 'dart:html';

import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';

/// A service for logging messages of various types.
///
Expand Down
Loading