mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
* increase timeout and modify login async * run e2e if testing is changed * improve cdk fix * fix travis update projects * disable ghostMode lite server * lint fix * fix timeout * multiple try * Update content-services-e2e.sh * Update search-e2e.sh * Update process-services-e2e.sh * Update core-e2e.sh * Update protractor.conf.ts * fix unit * remove async * increqase notification time * 3 parallel * dix path issue in save * small refactor protractor ts * fix save * create license check first script adf cli * modify regex check * refactor notification history component * decrease notification * fix notification message problem * fix test * update packages wit high risk * revert cahnge login sso e2e * fix dep * fix documentation duplication and issue * fix after review * fix after review * try 6 parallel test * back to 3 parallel test no real time improve with 6
51 lines
2.5 KiB
JavaScript
51 lines
2.5 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var fs = require("fs");
|
|
var path = require("path");
|
|
var ejs = require("ejs");
|
|
var remark = require("remark");
|
|
var frontMatter = require("remark-frontmatter");
|
|
var replaceZone = require("mdast-zone");
|
|
var graphql_1 = require("graphql");
|
|
var MQ = require("../mqDefs");
|
|
var libNamesList = [
|
|
'content-services', 'core', 'extensions',
|
|
'insights', 'process-services', 'process-services-cloud'
|
|
];
|
|
var query = "\n query libIndex($libName: String) {\n documents(idFilter: $libName) {\n title: metadata(key: \"Title\")\n status: metadata(key: \"Status\")\n id\n classType: folder(depth: 2)\n heading {\n link {\n url\n }\n }\n paragraph {\n plaintext\n }\n }\n }\n";
|
|
function processDocs(mdCache, aggData) {
|
|
var docset = new MQ.Docset(mdCache);
|
|
var templateFilePath = path.resolve(__dirname, '..', 'templates', 'gqIndex.ejs');
|
|
var templateSource = fs.readFileSync(templateFilePath, 'utf8');
|
|
var template = ejs.compile(templateSource);
|
|
var indexFilePath = path.resolve(aggData['rootFolder'], 'docs', 'README.md');
|
|
var indexFileText = fs.readFileSync(indexFilePath, 'utf8');
|
|
var indexMD = remark()
|
|
.use(frontMatter, ["yaml"])
|
|
.parse(indexFileText);
|
|
var schema = graphql_1.buildSchema(MQ.schema);
|
|
libNamesList.forEach(function (libName) {
|
|
graphql_1.graphql(schema, query, docset, null, { 'libName': libName })
|
|
.then(function (response) {
|
|
if (!response['data']) {
|
|
console.log(JSON.stringify(response));
|
|
}
|
|
else {
|
|
//console.log(template(response['data']));
|
|
var newSection_1 = remark().parse(template(response['data'])).children;
|
|
replaceZone(indexMD, libName, function (start, _oldZone, end) {
|
|
newSection_1.unshift(start);
|
|
newSection_1.push(end);
|
|
return newSection_1;
|
|
});
|
|
var outText = remark()
|
|
.use(frontMatter, { type: 'yaml', fence: '---' })
|
|
.data("settings", { paddedTable: false, gfm: false })
|
|
.stringify(indexMD);
|
|
fs.writeFileSync(indexFilePath, outText);
|
|
}
|
|
});
|
|
});
|
|
}
|
|
exports.processDocs = processDocs;
|