[ADF-2447] Added review checker tool (#3039)

This commit is contained in:
Andy Stark
2018-03-06 22:01:22 +00:00
committed by Eugenio Romano
parent e37eb3c7cb
commit 4b9daeb1c8
8 changed files with 367 additions and 26 deletions

View File

@@ -8,7 +8,7 @@ var yaml = require("js-yaml");
var unist = require("../unistHelpers");
var ngHelpers = require("../ngHelpers");
var searchLibraryRecursive = require("../libsearch");
module.exports = {
"initPhase": initPhase,
@@ -147,31 +147,6 @@ function rejectItemViaStoplist(stoplist, itemName) {
}
// Search source folders for .ts files to discover all components, directives, etc.
function searchLibraryRecursive(srcData, folderPath) {
var items = fs.readdirSync(folderPath);
for (var i = 0; i < items.length; i++) {
var itemPath = path.resolve(folderPath, items[i]);
var info = fs.statSync(itemPath);
if (info.isFile() && (items[i].match(angFilenameRegex))) {
var nameNoSuffix = path.basename(items[i], '.ts');
var displayPath = itemPath.replace(/\\/g, '/');
displayPath = displayPath.substr(displayPath.indexOf("lib") + 4);
// Type == "component", "directive", etc.
var itemType = nameNoSuffix.split('.')[1];
srcData[nameNoSuffix] = { "path": displayPath, "type": itemType };
} else if (info.isDirectory() && !items[i].match(searchFolderOmitRegex)) {
searchLibraryRecursive(srcData, itemPath);
}
}
}
function prepareIndexSections(aggData) {
var srcNames = Object.keys(aggData.srcData);
var sections = initEmptySections();