vuepress-jsdoc 4.3.0 → 5.0.0
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/CHANGELOG.md +30 -0
- package/README.md +11 -31
- package/dist/cmds.d.ts +1 -1
- package/dist/cmds.js +4 -4
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +2 -2
- package/dist/index.d.ts +2 -8
- package/dist/index.js +117 -308
- package/dist/lib/comment-parser.js +12 -12
- package/dist/lib/index.d.ts +6 -0
- package/dist/lib/index.js +16 -0
- package/dist/lib/list-folder.d.ts +1 -1
- package/dist/lib/list-folder.js +54 -170
- package/dist/lib/parser.js +116 -216
- package/dist/lib/utils.js +4 -6
- package/dist/lib/vue-sidebar.d.ts +8 -5
- package/dist/lib/vue-sidebar.js +27 -50
- package/package.json +28 -25
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Runs through the given tree structure and creates a vuepress config
|
|
3
|
-
* @param {object} data
|
|
4
|
-
* @param {array} data.fileTree tree
|
|
3
|
+
* @param {object} data Information to build config
|
|
4
|
+
* @param {array} data.fileTree tree structure
|
|
5
5
|
* @param {string} data.codeFolder ./code/ folder
|
|
6
6
|
* @param {string} data.srcFolder ./src/ folder
|
|
7
7
|
* @param {string} data.docsFolder ./documentation/ folder
|
|
8
8
|
* @param {string} data.title title string
|
|
9
|
-
* @returns {object} returns the vuepress menu
|
|
9
|
+
* @returns {object} returns the vuepress menu structure
|
|
10
10
|
*/
|
|
11
11
|
export declare const generateVueSidebar: ({ fileTree, codeFolder, srcFolder, docsFolder, title }: {
|
|
12
12
|
fileTree: any;
|
|
@@ -16,8 +16,11 @@ export declare const generateVueSidebar: ({ fileTree, codeFolder, srcFolder, doc
|
|
|
16
16
|
title: string;
|
|
17
17
|
}) => {
|
|
18
18
|
[x: string]: {
|
|
19
|
-
|
|
19
|
+
text: string;
|
|
20
20
|
collapsable: boolean;
|
|
21
|
-
children:
|
|
21
|
+
children: {
|
|
22
|
+
link: string;
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
22
25
|
}[];
|
|
23
26
|
};
|
package/dist/lib/vue-sidebar.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __values = (this && this.__values) || function(o) {
|
|
3
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4
|
-
if (m) return m.call(o);
|
|
5
|
-
if (o && typeof o.length === "number") return {
|
|
6
|
-
next: function () {
|
|
7
|
-
if (o && i >= o.length) o = void 0;
|
|
8
|
-
return { value: o && o[i++], done: !o };
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
@@ -21,62 +10,50 @@ exports.generateVueSidebar = void 0;
|
|
|
21
10
|
* headline: lib/vue-sidebar.ts
|
|
22
11
|
* ---
|
|
23
12
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
14
|
+
const node_path_1 = require("node:path");
|
|
26
15
|
/**
|
|
27
16
|
* Runs through the given tree structure and creates a vuepress config
|
|
28
|
-
* @param {object} data
|
|
29
|
-
* @param {array} data.fileTree tree
|
|
17
|
+
* @param {object} data Information to build config
|
|
18
|
+
* @param {array} data.fileTree tree structure
|
|
30
19
|
* @param {string} data.codeFolder ./code/ folder
|
|
31
20
|
* @param {string} data.srcFolder ./src/ folder
|
|
32
21
|
* @param {string} data.docsFolder ./documentation/ folder
|
|
33
22
|
* @param {string} data.title title string
|
|
34
|
-
* @returns {object} returns the vuepress menu
|
|
23
|
+
* @returns {object} returns the vuepress menu structure
|
|
35
24
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
try {
|
|
46
|
-
for (var children_1 = __values(children), children_1_1 = children_1.next(); !children_1_1.done; children_1_1 = children_1.next()) {
|
|
47
|
-
var child = children_1_1.value;
|
|
48
|
-
if (child.children && child.children.length > 0) {
|
|
49
|
-
newChildren = newChildren.concat(buildChildren(child.children, child.name, depth + 1));
|
|
50
|
-
}
|
|
51
|
-
else if (child.fullPath) {
|
|
52
|
-
if (fs_1.default.existsSync((0, path_1.join)(docsFolder, child.fullPath.replace(srcFolder, '')) + '.md')) {
|
|
53
|
-
newChildren.push(child.fullPath.replace("".concat(srcFolder, "/"), ''));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
25
|
+
const generateVueSidebar = ({ fileTree, codeFolder, srcFolder, docsFolder, title }) => {
|
|
26
|
+
let rootFiles = [{ link: `/${codeFolder}/`, text: '::vuepress-jsdoc-title::' }];
|
|
27
|
+
rootFiles = rootFiles.concat(fileTree.filter((file) => !file.children).map((file) => `/${(0, node_path_1.join)(codeFolder, file.name)}`));
|
|
28
|
+
const rootFolder = fileTree.filter((file) => file.children && file.children.length > 0);
|
|
29
|
+
const buildChildren = (children, name, depth) => {
|
|
30
|
+
let newChildren = [];
|
|
31
|
+
for (const child of children) {
|
|
32
|
+
if (child.children && child.children.length > 0) {
|
|
33
|
+
newChildren = newChildren.concat(buildChildren(child.children, child.name, depth + 1));
|
|
56
34
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
35
|
+
else if (child.fullPath) {
|
|
36
|
+
const path = child.fullPath.replace(srcFolder, '');
|
|
37
|
+
if (node_fs_1.default.existsSync(`${(0, node_path_1.join)(docsFolder, path)}.md`)) {
|
|
38
|
+
newChildren.push(`/${(0, node_path_1.join)(codeFolder, path)}`);
|
|
39
|
+
}
|
|
62
40
|
}
|
|
63
|
-
finally { if (e_1) throw e_1.error; }
|
|
64
41
|
}
|
|
65
42
|
return newChildren;
|
|
66
43
|
};
|
|
67
|
-
|
|
68
|
-
|
|
44
|
+
const tree = rootFolder.map((folder) => ({
|
|
45
|
+
text: folder.name,
|
|
69
46
|
collapsable: false,
|
|
70
47
|
children: buildChildren(folder.children, folder.name, 0)
|
|
71
|
-
})
|
|
72
|
-
return
|
|
73
|
-
|
|
48
|
+
}));
|
|
49
|
+
return {
|
|
50
|
+
[`/${codeFolder}/`]: [
|
|
74
51
|
{
|
|
75
|
-
|
|
52
|
+
text: title,
|
|
76
53
|
collapsable: false,
|
|
77
54
|
children: rootFiles
|
|
78
55
|
}
|
|
79
|
-
].concat(tree)
|
|
80
|
-
|
|
56
|
+
].concat(tree)
|
|
57
|
+
};
|
|
81
58
|
};
|
|
82
59
|
exports.generateVueSidebar = generateVueSidebar;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vuepress-jsdoc",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Generate jsdoc markdown files for vuepress",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"prepare": "husky install",
|
|
15
15
|
"version": "conventional-changelog -p karma -i CHANGELOG.md -s -r 0 && git add .",
|
|
16
16
|
"docs": "./bin/vuepress-jsdoc.js --source=./dist --partials=./example/partials/*.hbs --readme ./README.md --include=\"**/*.(ts|js)\" --exclude=\"**/*.d.ts,**/interfaces.*,**/constants.*\"",
|
|
17
|
-
"docs:dev": "npx concurrently --kill-others \"npm run dev\" \"npm run docs
|
|
18
|
-
"docs:build": "npm run build && npm run docs &&
|
|
17
|
+
"docs:dev": "npx concurrently --kill-others \"npm run dev\" \"npm run docs -- -w\" \"vuepress dev documentation\"",
|
|
18
|
+
"docs:build": "npm run build && npm run docs && vuepress build documentation"
|
|
19
19
|
},
|
|
20
20
|
"keywords": [
|
|
21
21
|
"jsdoc",
|
|
@@ -79,36 +79,39 @@
|
|
|
79
79
|
"vuepress-jsdoc": "bin/vuepress-jsdoc.js"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"chalk": "^4.1.2",
|
|
83
82
|
"chokidar": "^3.5.3",
|
|
84
|
-
"commander": "^
|
|
83
|
+
"commander": "^11.1.0",
|
|
85
84
|
"del": "^6.0.0",
|
|
86
85
|
"front-matter": "^4.0.2",
|
|
87
|
-
"jsdoc-to-markdown": "^
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
86
|
+
"jsdoc-to-markdown": "^8.0.0",
|
|
87
|
+
"kleur": "^4.1.5",
|
|
88
|
+
"micromatch": "^4.0.5",
|
|
89
|
+
"mkdirp": "^3.0.1",
|
|
90
|
+
"vue-docgen-cli": "^4.67.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@types/jest": "^
|
|
94
|
-
"@types/jsdoc-to-markdown": "^7.0.
|
|
95
|
-
"@types/micromatch": "^4.0.
|
|
93
|
+
"@types/jest": "^29.5.10",
|
|
94
|
+
"@types/jsdoc-to-markdown": "^7.0.6",
|
|
95
|
+
"@types/micromatch": "^4.0.6",
|
|
96
96
|
"@types/mkdirp": "^1.0.2",
|
|
97
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
98
|
-
"@typescript-eslint/parser": "^
|
|
99
|
-
"
|
|
97
|
+
"@typescript-eslint/eslint-plugin": "^6.12.0",
|
|
98
|
+
"@typescript-eslint/parser": "^6.12.0",
|
|
99
|
+
"@vuepress/client": "^2.0.0-rc.0",
|
|
100
|
+
"babel-jest": "^29.7.0",
|
|
100
101
|
"cross-env": "^7.0.3",
|
|
101
|
-
"eslint": "^8.
|
|
102
|
-
"eslint-config-prettier": "^
|
|
103
|
-
"eslint-plugin-import": "^2.
|
|
104
|
-
"eslint-plugin-jest": "^
|
|
102
|
+
"eslint": "^8.54.0",
|
|
103
|
+
"eslint-config-prettier": "^9.0.0",
|
|
104
|
+
"eslint-plugin-import": "^2.29.0",
|
|
105
|
+
"eslint-plugin-jest": "^27.6.0",
|
|
105
106
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
106
|
-
"husky": "^
|
|
107
|
-
"jest": "^
|
|
108
|
-
"lint-staged": "^
|
|
109
|
-
"memfs": "^
|
|
110
|
-
"ts-jest": "^
|
|
111
|
-
"typescript": "^
|
|
107
|
+
"husky": "^8.0.3",
|
|
108
|
+
"jest": "^29.7.0",
|
|
109
|
+
"lint-staged": "^15.1.0",
|
|
110
|
+
"memfs": "^4.6.0",
|
|
111
|
+
"ts-jest": "^29.1.1",
|
|
112
|
+
"typescript": "^5.3.2",
|
|
113
|
+
"vue": "^3.3.8",
|
|
114
|
+
"vuepress": "^2.0.0-rc.0"
|
|
112
115
|
},
|
|
113
116
|
"lint-staged": {
|
|
114
117
|
"src/**/*.{css,scss,json}": [
|