mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04: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
57 lines
1.3 KiB
JavaScript
57 lines
1.3 KiB
JavaScript
var fs = require("fs");
|
|
var path = require("path");
|
|
var ejs = require("ejs");
|
|
|
|
var templateFolder = path.resolve("tools", "doc", "yamlTemplates");
|
|
var outputFolder = path.resolve("docs", "sourceinfo");
|
|
|
|
if (process.argv.length < 3) {
|
|
console.log("Error: Source filename required");
|
|
process.exit();
|
|
}
|
|
|
|
console.log(`Processing ${process.argv[2]}`);
|
|
|
|
if (!fs.existsSync(outputFolder)) {
|
|
fs.mkdirSync(outputFolder);
|
|
}
|
|
|
|
var docData = JSON.parse(fs.readFileSync(path.resolve(process.argv[2]), "utf8"));
|
|
var tempFilename = path.resolve(templateFolder, "template.ejs");
|
|
var tempSource = fs.readFileSync(tempFilename, "utf8");
|
|
var template = ejs.compile(
|
|
tempSource,
|
|
{
|
|
filename: tempFilename,
|
|
cache: true
|
|
}
|
|
);
|
|
|
|
searchItemsRecursively(docData);
|
|
|
|
function searchItemsRecursively(item) {
|
|
if (interestedIn(item.kind)) {
|
|
|
|
processItem(item);
|
|
} else if (item.children) {
|
|
item.children.forEach(child => {
|
|
searchItemsRecursively(child);
|
|
});
|
|
}
|
|
}
|
|
|
|
function interestedIn(itemKind) {
|
|
return (itemKind === 128) || (itemKind === 256) || (itemKind === 4194304);
|
|
}
|
|
|
|
|
|
function processItem(item) {
|
|
var docText = template(item);
|
|
|
|
if( item.name === 'Widget'){
|
|
console.log('item ' + JSON.stringify(item.name ));
|
|
}
|
|
|
|
fs.writeFileSync(path.resolve(outputFolder, item.name + ".yml"), docText);
|
|
}
|