Skip to content

Commit

Permalink
[ACS-6659] cleanup unused docs utils (#9274)
Browse files Browse the repository at this point in the history
* remove unused scripts

* remove unused scripts

* remove unused scripts

* remove unused libs

* remove unused code

* remove unused code and libs, fix linting issues

* code cleanup

* linting fixes

* linting fixes
  • Loading branch information
DenysVuika authored Jan 25, 2024
1 parent 69f24a1 commit 5ec8228
Show file tree
Hide file tree
Showing 25 changed files with 1,088 additions and 1,935 deletions.
1 change: 0 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"lastname",
"listgrid",
"mapitem",
"markdownlint",
"mimetype",
"mincount",
"minlength",
Expand Down
41 changes: 0 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@
"ng": "nx",
"00": "echo -------------------------------------------- DOC -----------------------------------------------",
"build-doc-tools": "tsc -p ./tools/doc/tsconfig.json",
"markdownlint": "markdownlint ./docs",
"docbuild": "(cd ./tools/doc; npm i) && node tools/doc/node_modules/typedoc/bin/typedoc --tsconfig lib/tsconfig.doc.json && node tools/doc/buildYamlSourceInfo.js docs/docs.json && node ./tools/doc/docProcessor.js",
"review-checker": "node ./tools/doc/reviewChecker.js",
"01": "echo -------------------------------------------- Build Lib -----------------------------------------------",
"affected:libs": "nx affected:libs",
"coverage": "./lib/config/create-coverage-index.sh && lite-server -c ./lib/config/proxy-coverage.json",
"print-affected:build": "nx print-affected --target=build --select=tasks.target.project",
"print-affected:test": "nx print-affected --target=test --select=tasks.target.project",
"print-affected:e2e": "nx print-affected --target=e2e --select=tasks.target.project",
"print-affected:lint": "nx print-affected --target=lint --select=tasks.target.project",
"03": "echo -------------------------------------------- Lint -----------------------------------------------",
"affected:lint": "nx affected:lint",
"04": "echo -------------------------------------------- Demo Shell -----------------------------------------------",
Expand Down Expand Up @@ -161,7 +155,6 @@
"eslint-plugin-unicorn": "^49.0.0",
"github-api": "^3.4.0",
"graphql": "^16.8.1",
"graphql-request": "^6.1.0",
"husky": "^7.0.4",
"jasmine-ajax": "4.0.0",
"jasmine-core": "4.6.0",
Expand Down
33 changes: 0 additions & 33 deletions tools/doc/ReviewCheckerGuide.md

This file was deleted.

43 changes: 19 additions & 24 deletions tools/doc/buildYamlSourceInfo.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
var fs = require("fs");
var path = require("path");
var ejs = require("ejs");
const fs = require('fs');
const path = require('path');
const ejs = require('ejs');

var templateFolder = path.resolve("tools", "doc", "yamlTemplates");
var outputFolder = path.resolve("docs", "sourceinfo");
const templateFolder = path.resolve('tools', 'doc', 'yamlTemplates');
const outputFolder = path.resolve('docs', 'sourceinfo');

if (process.argv.length < 3) {
console.log("Error: Source filename required");
console.log('Error: Source filename required');
process.exit();
}

Expand All @@ -16,41 +16,36 @@ 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
}
);
const docData = JSON.parse(fs.readFileSync(path.resolve(process.argv[2]), 'utf8'));
const tempFilename = path.resolve(templateFolder, 'template.ejs');
const tempSource = fs.readFileSync(tempFilename, 'utf8');
const 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 => {
item.children.forEach((child) => {
searchItemsRecursively(child);
});
}
}

function interestedIn(itemKind) {
return (itemKind === 128) || (itemKind === 256) || (itemKind === 4194304);
return itemKind === 128 || itemKind === 256 || itemKind === 4194304;
}


function processItem(item) {
var docText = template(item);
const docText = template(item);

if( item.name === 'Widget'){
console.log('item ' + JSON.stringify(item.name ));
if (item.name === 'Widget') {
console.log('item ' + JSON.stringify(item.name));
}

fs.writeFileSync(path.resolve(outputFolder, item.name + ".yml"), docText);
fs.writeFileSync(path.resolve(outputFolder, item.name + '.yml'), docText);
}
1 change: 0 additions & 1 deletion tools/doc/commitStoplist.json

This file was deleted.

Loading

0 comments on commit 5ec8228

Please sign in to comment.