@progress/kendo-typescript-api-tasks 3.0.2-dev.35 → 3.0.2-dev.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +13 -0
- package/lib/list-api-members.js +34 -0
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -8,6 +8,7 @@ const typedoc = require('typedoc');
|
|
|
8
8
|
const glob = require('glob');
|
|
9
9
|
const generator = require('./lib/generator.js');
|
|
10
10
|
const typeLinks = require('./type-links.json');
|
|
11
|
+
const listMembers = require('./lib/list-api-members.js');
|
|
11
12
|
|
|
12
13
|
const defaultConfig = {
|
|
13
14
|
outPath: 'docs/api',
|
|
@@ -66,6 +67,18 @@ module.exports.addAPITasks = (gulp, userConfig) => {
|
|
|
66
67
|
done();
|
|
67
68
|
});
|
|
68
69
|
|
|
70
|
+
gulp.task('api-members', series('api-json', (done) => {
|
|
71
|
+
const data = JSON.parse(fs.readFileSync(config.jsonPath, 'utf8'));
|
|
72
|
+
const members = listMembers(data);
|
|
73
|
+
const output = members.map(({ name }) => `${name}`).join("\n");
|
|
74
|
+
const absoluteOutput = path.resolve(path.join(path.dirname(config.jsonPath), 'api-members.txt'));
|
|
75
|
+
fs.writeFileSync(absoluteOutput, output, "utf8");
|
|
76
|
+
|
|
77
|
+
console.log(`API members list written to ${absoluteOutput}`);
|
|
78
|
+
|
|
79
|
+
done();
|
|
80
|
+
}));
|
|
81
|
+
|
|
69
82
|
gulp.task('api', series('api-json', 'api-clean', (done) => {
|
|
70
83
|
const packageJson = path.join(process.cwd(), 'package.json');
|
|
71
84
|
const packageInfo = require(packageJson);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
function listMembers(root) {
|
|
2
|
+
const results = [];
|
|
3
|
+
|
|
4
|
+
function walk(node) {
|
|
5
|
+
if (!node || typeof node !== "object") {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
if (Array.isArray(node.children)) {
|
|
10
|
+
const parentName = typeof node.name === "string" ? node.name + '.' : '';
|
|
11
|
+
|
|
12
|
+
for (const child of node.children) {
|
|
13
|
+
if (
|
|
14
|
+
child &&
|
|
15
|
+
typeof child === "object" &&
|
|
16
|
+
typeof child.name === "string" &&
|
|
17
|
+
typeof child.variant === "string" &&
|
|
18
|
+
typeof child.kind === "number" &&
|
|
19
|
+
child.variant === "declaration" &&
|
|
20
|
+
child.kind > 4 /* skip namespaces and modules */
|
|
21
|
+
) {
|
|
22
|
+
results.push({ name: parentName + child.name, kind: child.kind });
|
|
23
|
+
}
|
|
24
|
+
walk(child);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
walk(root);
|
|
30
|
+
return results;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
module.exports = listMembers;
|
|
34
|
+
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-typescript-api-tasks",
|
|
3
3
|
"description": "Kendo UI API docs package gulp tasks",
|
|
4
|
-
"version": "3.0.2-dev.
|
|
4
|
+
"version": "3.0.2-dev.37+9dba63f",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "index.js",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "9dba63ff1ff4a239d4c660e53af6f6fa707febdd"
|
|
35
35
|
}
|