9360aa2d27
The quotes rule had to be disabled for e2e tests generated from ngdoc because dgeni templates use double quotes as string delimiters. Since we can't have guarantees that dgeni template wrappers will follow the same JS code style the Angular 1 repo uses, we should find a way to enforce our ESLint setup only for the parts in this repo, perhaps via prepending a generated `/* eslint-enable OUR_RULES */` pragma. Closes #15011
43 lines
988 B
JavaScript
43 lines
988 B
JavaScript
'use strict';
|
|
|
|
var _ = require('lodash');
|
|
|
|
/**
|
|
* @dgProcessor generateIndexPagesProcessor
|
|
* @description
|
|
* This processor creates docs that will be rendered as the index page for the app
|
|
*/
|
|
module.exports = function generateIndexPagesProcessor() {
|
|
return {
|
|
deployments: [],
|
|
$validate: {
|
|
deployments: { presence: true }
|
|
},
|
|
$runAfter: ['adding-extra-docs'],
|
|
$runBefore: ['extra-docs-added'],
|
|
$process: function(docs) {
|
|
|
|
// Collect up all the areas in the docs
|
|
var areas = {};
|
|
docs.forEach(function(doc) {
|
|
if (doc.area) {
|
|
areas[doc.area] = doc.area;
|
|
}
|
|
});
|
|
areas = _.keys(areas);
|
|
|
|
this.deployments.forEach(function(deployment) {
|
|
|
|
var indexDoc = _.defaults({
|
|
docType: 'indexPage',
|
|
areas: areas
|
|
}, deployment);
|
|
|
|
indexDoc.id = 'index' + (deployment.name === 'default' ? '' : '-' + deployment.name);
|
|
|
|
docs.push(indexDoc);
|
|
});
|
|
}
|
|
};
|
|
};
|