vuepress-jsdoc 5.0.0 → 6.1.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/README.md CHANGED
@@ -8,73 +8,128 @@ This npm package serves as a command line script designed to analyze your JavaSc
8
8
 
9
9
  ![CLI ./example](https://user-images.githubusercontent.com/15351728/131877824-0124e47f-9080-4976-88d0-84ad04b64f24.gif)
10
10
 
11
- ## Vuepress support
11
+ ## Requirements
12
12
 
13
- This npm package is compatible with VuePress 2; however, it requires a version lower than `5.0.0` for proper functionality with VuePress 1.
13
+ - Node.js `>= 22.22`
14
+ - VuePress 2 (use a version lower than `5.0.0` for VuePress 1)
14
15
 
15
16
  ## How to
16
17
 
17
18
  ```bash
18
- yarn global add vuepress-jsdoc
19
- npm i vuepress-jsdoc -g
19
+ npm i -D vuepress-jsdoc
20
+ # or
21
+ pnpm add -D vuepress-jsdoc
20
22
  ```
21
23
 
22
24
  **Example:**
23
25
 
24
26
  ```bash
25
27
  # search code in src and move it to code (./documentation/code) in your vuepress folder (./documentation)
26
- vuepress-jsdoc --source ./src --dist ./documentation --folder code --title API --exclude="**/*/*.test.js"
28
+ vuepress-jsdoc --source ./src --dist ./documentation --folder code --title API --exclude="**/*.test.js"
27
29
  ```
28
30
 
29
- You can also use `npx vuepress-jsdoc`, if you want.
31
+ You can also run it without installing via `pnpm dlx vuepress-jsdoc` or `npx vuepress-jsdoc`.
30
32
 
31
- #### Watch-Mode `alpha`
33
+ Every `.js`, `.jsx`, `.mjs`, `.cjs`, `.ts`, `.mts`, `.cts`, `.tsx` and `.vue` file is parsed. Files without any documentation are skipped, so they do not create empty pages. Files which can not be parsed are reported as `ERROR` with the reason and the command exits with code `1`.
32
34
 
33
- If you do not want to run`vuepress-jsdoc` again and again and again.
34
- You can simply pass `--watch` or `-w`.
35
+ #### Watch-Mode
36
+
37
+ If you do not want to run `vuepress-jsdoc` again and again and again.
38
+ You can simply pass `--watch` or `-w`. Added, changed and removed files update the markdown files and the sidebar.
35
39
 
36
40
  ### Command-Options
37
41
 
38
42
  Use these options after `vuepress-jsdoc`.
39
43
 
40
- | Name | Alias | Default | Description |
41
- | ----------------- | ----- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
42
- | --source | -s | ./src | Source folder with .js or .ts files |
43
- | --dist | -d | ./documentation | Destination folder |
44
- | --folder | -f | ./code | Folder inside destination folder. Gets overwritten everytime |
45
- | --title | -t | API | Title of your documentation |
46
- | --help | -h | | Show help |
47
- | --version | -v | | Show current version |
48
- | --readme | -r | | Path to custom readme file |
49
- | --exclude | -e | | Pattern to exclude files/folders (Comma seperated) - \*.test.js,exclude.js [more information](https://github.com/micromatch/micromatch#ismatch) |
50
- | --include | -e | | Pattern to include files/folders (Comma seperated) - \*.test.js,exclude.js [more information](https://github.com/micromatch/micromatch#ismatch) |
51
- | --rmPattern | -rm | | Pattern when removing files. You can ex- and include files. (glob pattern) |
52
- | --partials | -p | | jsdoc2markdown partial templates (overwrites default ones) |
53
- | --jsDocConfigPath | -c | | Path to [JsDoc Config](http://usejsdoc.org/about-configuring-jsdoc.html) (experimental) |
54
- | --watch | -w | | Watch changes and update markdown files |
44
+ | Name | Alias | Default | Description |
45
+ | ----------------- | ----- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
46
+ | --source | -s | ./src | Source folder with .js, .ts or .vue files |
47
+ | --dist | -d | ./documentation | Destination folder |
48
+ | --folder | -f | code | Folder inside destination folder. Gets overwritten everytime |
49
+ | --title | -t | API | Title of your documentation |
50
+ | --help | -h | | Show help |
51
+ | --version | -V | | Show current version |
52
+ | --readme | -r | | Path to custom readme file |
53
+ | --exclude | -e | | Pattern to exclude files/folders (comma separated) - \*\*/\*.test.js,exclude.js [more information](https://github.com/micromatch/micromatch#ismatch) |
54
+ | --include | -i | | Pattern to include files/folders (comma separated) - \*\*/\*.js,include.js [more information](https://github.com/micromatch/micromatch#ismatch) |
55
+ | --rmPattern | --rm | | Additional glob patterns of files to remove before generating |
56
+ | --partials | -p | | jsdoc2markdown partial templates (overwrites default ones) |
57
+ | --jsDocConfigPath | -c | | Path to [JsDoc Config](https://jsdoc.app/about-configuring-jsdoc.html) |
58
+ | --watch | -w | | Watch changes and update markdown files |
59
+ | --collapsible | | | Make the top level sidebar groups collapsible (nested folders are always collapsible) |
60
+ | --format | | vuepress | Sidebar format of the generated `config.js`: `vuepress` or `vitepress` |
61
+ | --config | | | Path to a config file (default: `vuepress-jsdoc.config.{js,mjs,cjs,json}`) |
62
+
63
+ Patterns are matched relative to the source folder. Folders can be excluded as a whole, e.g. `--exclude="**/__tests__"`.
64
+
65
+ ### Config file
66
+
67
+ Instead of command options, you can add a `vuepress-jsdoc.config.js` (or `.mjs`, `.cjs`, `.json`) to your project. It is loaded automatically, or use `--config ./path/to/config.js`. Command options win over the config file.
68
+
69
+ ```javascript
70
+ // vuepress-jsdoc.config.js
71
+ import { defineConfig } from 'vuepress-jsdoc';
72
+
73
+ export default defineConfig({
74
+ source: './src',
75
+ dist: './documentation',
76
+ title: 'API',
77
+ exclude: ['**/__tests__', '**/*.test.js']
78
+ });
79
+ ```
55
80
 
56
81
  ### config.js
57
82
 
58
- Inside your generated folder, you can find a `config.js`.
59
- This file includes a complete filetree and an vuepress sidebar tree.
83
+ Inside your generated folder, you can find a `config.js` (ES module).
84
+ It exports the complete `fileTree` and a `sidebarTree(title)` function, which returns a VuePress 2 sidebar. Every folder becomes a sidebar group.
85
+
86
+ ## VuePress plugin
87
+
88
+ The easiest way: add the plugin to your VuePress config. It generates the documentation when VuePress starts, updates it during `vuepress dev` and adds the sidebar to all generated pages. No separate CLI call is needed.
89
+
90
+ ```javascript
91
+ // documentation/.vuepress/config.js
92
+ import { viteBundler } from '@vuepress/bundler-vite';
93
+ import { defaultTheme } from '@vuepress/theme-default';
94
+ import { defineUserConfig } from 'vuepress';
95
+ import { vuepressJsdocPlugin } from 'vuepress-jsdoc';
96
+
97
+ export default defineUserConfig({
98
+ bundler: viteBundler(),
99
+ theme: defaultTheme({
100
+ navbar: [{ text: 'Code', link: '/code/' }]
101
+ }),
102
+ plugins: [
103
+ vuepressJsdocPlugin({
104
+ source: './src',
105
+ folder: 'code',
106
+ exclude: ['**/__tests__'],
107
+ // text of the readme link in the sidebar
108
+ sidebarTitle: 'Readme'
109
+ })
110
+ ]
111
+ });
112
+ ```
113
+
114
+ The plugin accepts the same options as the config file, except `dist` (the VuePress source folder is used), `watch` and `format`. Set `sidebar: false` if you configure the sidebar in your theme yourself. Paths are relative to the working directory.
60
115
 
61
116
  ## How to configure vuepress
62
117
 
63
- [Vuepress](https://vuepress.vuejs.org/) is a static site generator by Evan You.
118
+ [VuePress](https://vuepress.vuejs.org/) is a static site generator.
64
119
  You can add all generated documentation files to your existing vuepress project or create a new one.
65
120
 
66
121
  ```bash
67
122
  # First install vuepress
68
- yarn global add vuepress
123
+ pnpm add -D vuepress@next @vuepress/bundler-vite@next @vuepress/theme-default@next sass-embedded
69
124
 
70
125
  # Run the CLI
71
- vuepress-jsdoc
126
+ pnpm exec vuepress-jsdoc
72
127
 
73
128
  # Run vuepress dev server
74
- vuepress dev ./documentation
129
+ pnpm exec vuepress dev ./documentation
75
130
 
76
131
  # Run vuepress build, if you want to ship it
77
- vuepress build ./documentation
132
+ pnpm exec vuepress build ./documentation
78
133
  ```
79
134
 
80
135
  **Access it via:** [http://localhost:8080/code/](http://localhost:8080/code/)
@@ -85,35 +140,52 @@ Create a `.vuepress` folder inside the `documentation` folder and add the follow
85
140
  **config.js:**
86
141
 
87
142
  ```javascript
143
+ import { viteBundler } from '@vuepress/bundler-vite';
144
+ import { defaultTheme } from '@vuepress/theme-default';
145
+ import { defineUserConfig } from 'vuepress';
146
+
88
147
  // auto generated sidebar
89
- const { sidebarTree } = require('../code/config');
90
-
91
- module.exports = {
92
- dest: 'dist',
93
- locales: {
94
- '/': {
95
- title: 'vuepress-jsdoc',
96
- description: 'Generate jsdoc markdown files for vuepress'
148
+ import { sidebarTree } from '../code/config.js';
149
+
150
+ export default defineUserConfig({
151
+ bundler: viteBundler(),
152
+ title: 'vuepress-jsdoc',
153
+ description: 'Generate jsdoc markdown files for vuepress',
154
+ theme: defaultTheme({
155
+ navbar: [
156
+ { text: 'Home', link: '/' },
157
+ { text: 'Code', link: '/code/' }
158
+ ],
159
+ // Add the generated sidebar
160
+ sidebar: {
161
+ ...sidebarTree('Mainpage title')
97
162
  }
98
- },
163
+ })
164
+ });
165
+ ```
166
+
167
+ ## VitePress
168
+
169
+ Use `--format vitepress` to generate a [VitePress](https://vitepress.dev/) sidebar. The readme is written to `index.md`, because VitePress uses it as the page of a folder.
170
+
171
+ The documentation of this project is a VitePress site generated this way, see [`documentation/.vitepress/config.mjs`](./documentation/.vitepress/config.mjs).
172
+
173
+ ```bash
174
+ vuepress-jsdoc --source ./src --dist ./docs --folder code --format vitepress
175
+ ```
176
+
177
+ ```javascript
178
+ // docs/.vitepress/config.mjs
179
+ import { defineConfig } from 'vitepress';
180
+
181
+ import { sidebarTree } from '../code/config.js';
182
+
183
+ export default defineConfig({
99
184
  themeConfig: {
100
- editLinks: true,
101
- sidebarDepth: 4,
102
- docsDir: 'code',
103
- locales: {
104
- '/': {
105
- nav: [
106
- {
107
- text: 'Home',
108
- link: '/'
109
- }
110
- ],
111
- // Add the generated sidebar
112
- sidebar: Object.assign({}, sidebarTree('Mainpage title'))
113
- }
114
- }
185
+ nav: [{ text: 'Code', link: '/code/' }],
186
+ sidebar: sidebarTree('Overview')
115
187
  }
116
- };
188
+ });
117
189
  ```
118
190
 
119
191
  ## Custom readme
@@ -138,39 +210,66 @@ Enhance your page customization by incorporating custom metadata through the `@v
138
210
 
139
211
  Use `headline` to add a custom `h1` title.
140
212
 
141
- [More information](https://vuepress.vuejs.org/guide/markdown.html#front-matter)
213
+ [More information](https://vuepress.vuejs.org/guide/page.html#frontmatter)
142
214
 
143
215
  ## Typescript
144
216
 
145
- To integrate TypeScript support, install the following dev-dependencies with the following command:
217
+ TypeScript files work out of the box. The types are removed with the type stripping of Node.js before the file is passed to jsdoc, so all comments and line numbers stay intact.
218
+
219
+ Syntax which has to be transformed (`enum`, `namespace`, parameter properties) and `.tsx` files are transpiled with the TypeScript compiler of your project. `typescript` 6 or lower (or `@typescript/typescript6`) has to be installed for this, because `typescript` 7 has no JavaScript API.
220
+
221
+ If you need more control, use babel instead. Install the following dev-dependencies:
146
222
 
147
223
  ```bash
148
- npm install -D typescript jsdoc-babel @babel/cli @babel/core @babel/preset-env @babel/preset-typescript jsdoc-to-markdown
224
+ pnpm add -D jsdoc-babel @babel/core @babel/preset-env @babel/preset-typescript
149
225
  ```
150
226
 
151
227
  After installation, include a `jsdoc.json` file in your project with specific settings, and reference it using the `-c` parameter. For a comprehensive example with all the necessary configurations, refer to the `./example` folder. The example also demonstrates the usage of Babel plugins.
152
228
 
153
229
  ## Example
154
230
 
155
- The `./example` folder includes a full working vuepress-jsdoc example.
231
+ The `./example` folder includes a full working vuepress-jsdoc example. It is part of the pnpm workspace and uses the local build of `vuepress-jsdoc`.
156
232
 
157
233
  ```bash
158
- # Install dependencies
159
- npm install
234
+ # Install dependencies (from the repository root)
235
+ pnpm install
236
+ pnpm build
160
237
 
161
- # Run the CLI
162
- vuepress-jsdoc
238
+ cd example
163
239
 
164
240
  # Generate docs
165
- npm run docs
241
+ pnpm run docs
166
242
 
167
- # Run dev server
168
- npm run dev
243
+ # Generate docs and run the dev server
244
+ pnpm run dev
169
245
 
170
- # Generate dist folder
171
- npm run build
246
+ # Generate docs and build the dist folder
247
+ pnpm run build:local
172
248
  ```
173
249
 
250
+ ## Migrating from 5.x
251
+
252
+ - Node.js `>= 22.22` is required.
253
+ - The generated `config.js` is an ES module. Import it with `import { sidebarTree } from '../code/config.js'`.
254
+ - VuePress 2 needs a bundler in your config: `bundler: viteBundler()` from `@vuepress/bundler-vite`.
255
+ - Sidebar groups use `collapsible` instead of `collapsable`.
256
+ - `--rmPattern` is also available as `--rm`. The generated folder is always recreated.
257
+ - Files without documentation no longer create empty pages.
258
+
174
259
  ## Contribute
175
260
 
176
261
  PRs are always welcome (:
262
+
263
+ This project uses [pnpm](https://pnpm.io/).
264
+
265
+ ```bash
266
+ pnpm install
267
+ pnpm test # vitest
268
+ pnpm lint # eslint (pnpm lint:fix to fix)
269
+ pnpm typecheck # tsc
270
+ pnpm build # compile to ./dist
271
+ pnpm run docs:dev # VitePress dev server for the documentation of this project
272
+ pnpm run docs:build # build it to ./public
273
+ ```
274
+
275
+ Use `pnpm run docs` instead of `pnpm docs`, because `pnpm docs` is a builtin pnpm command.
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
- const { version } = require('../package.json');
5
- require('../dist/cmds').default(version);
2
+ import { readFileSync } from 'node:fs';
3
+
4
+ import cli from '../dist/cmds.js';
5
+
6
+ const { version } = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
7
+
8
+ cli(version);
package/dist/cmds.d.ts CHANGED
@@ -3,6 +3,8 @@
3
3
  * we need the version from the package.json here. We do not import
4
4
  * this here, because otherwise the folder structure in the dist folder would get mixed up.
5
5
  * @param {string} version a version string
6
+ * @param {string[]} argv process arguments
7
+ * @returns {Promise<void>}
6
8
  */
7
- declare const _default: (version: string) => void;
8
- export default _default;
9
+ export declare const cli: (version: string, argv?: string[]) => Promise<void>;
10
+ export default cli;
package/dist/cmds.js CHANGED
@@ -1,34 +1,61 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /*
4
2
  * @vuepress
5
3
  * ---
6
- * headline: cmds.ts
4
+ * title: CLI
5
+ * headline: Command line interface
7
6
  * ---
8
7
  */
9
- const commander_1 = require("commander");
10
- const _1 = require(".");
8
+ import { Command, Option } from 'commander';
9
+ import { generate } from './index.js';
10
+ import { loadConfig } from './lib/config.js';
11
+ import { StatisticType } from './constants.js';
11
12
  /**
12
13
  * This method builds the cli interface and is necessary because
13
14
  * we need the version from the package.json here. We do not import
14
15
  * this here, because otherwise the folder structure in the dist folder would get mixed up.
15
16
  * @param {string} version a version string
17
+ * @param {string[]} argv process arguments
18
+ * @returns {Promise<void>}
16
19
  */
17
- exports.default = (version) => {
18
- commander_1.program.version(version).description('a CLI Tool to generate markdown files for vuepress');
19
- commander_1.program
20
- .description('Generate the md files')
21
- .option('-s, --source <string>', 'Source folder with .js or .ts files', './src')
20
+ export const cli = async (version, argv = process.argv) => {
21
+ const program = new Command();
22
+ program
23
+ .name('vuepress-jsdoc')
24
+ .version(version)
25
+ .description('Generate markdown files for VuePress out of your JSDoc comments')
26
+ .option('-s, --source <string>', 'Source folder with .js, .ts or .vue files', './src')
22
27
  .option('-d, --dist <string>', 'Destination folder', './documentation')
23
28
  .option('-f, --folder <string>', 'Folder inside destination folder. Gets overwritten everytime', 'code')
24
29
  .option('-t, --title <string>', 'Title of your documentation', 'API')
25
30
  .option('-r, --readme <string>', 'Path to your custom readme')
26
- .option('-i, --include <string>', 'Pattern to include files/folders (Comma seperated) - *.test.js,include.js')
27
- .option('-e, --exclude <string>', 'Pattern to exclude files/folders (Comma seperated) - *.test.js,exclude.js')
28
- .option('-w, --watch', 'This flag watches your source files')
29
- .option('-rm, --rmPattern [files...]', 'Pattern when removing files. You can ex- and include files. (glob pattern)', '')
30
- .option('-p, --partials [files...]', 'jsdoc2markdown partial templates (overwrites default ones)', '')
31
+ .option('-i, --include <string>', 'Pattern to include files/folders (comma separated) - **/*.js,include.js')
32
+ .option('-e, --exclude <string>', 'Pattern to exclude files/folders (comma separated) - **/*.test.js,exclude.js')
33
+ .option('-w, --watch', 'Watch your source files and update the documentation')
34
+ .option('--collapsible', 'Make the top level sidebar groups collapsible')
35
+ .option('--rm, --rmPattern [files...]', 'Additional glob patterns of files to remove before generating')
36
+ .option('-p, --partials [files...]', 'jsdoc2markdown partial templates (overwrites default ones)')
31
37
  .option('-c, --jsDocConfigPath <string>', 'Path to jsdoc config')
32
- .action(_1.generate);
33
- commander_1.program.parse(process.argv);
38
+ .addOption(new Option('--format <format>', 'Sidebar format of the generated config.js')
39
+ .choices(['vuepress', 'vitepress'])
40
+ .default('vuepress'))
41
+ .option('--config <path>', 'Path to a config file (default: vuepress-jsdoc.config.{js,mjs,cjs,json})')
42
+ .action(async (cliOptions) => {
43
+ const loaded = await loadConfig(cliOptions.config);
44
+ const options = { ...cliOptions };
45
+ if (loaded) {
46
+ console.log(`Using config ${loaded.path}`);
47
+ // options of the command line win over the config file, the config file wins over the defaults
48
+ for (const [key, value] of Object.entries(loaded.config)) {
49
+ if (program.getOptionValueSource(key) !== 'cli') {
50
+ options[key] = value;
51
+ }
52
+ }
53
+ }
54
+ const results = await generate(options);
55
+ if (!options.watch && results.some((r) => r.type === StatisticType.ERROR)) {
56
+ process.exitCode = 1;
57
+ }
58
+ });
59
+ await program.parseAsync(argv);
34
60
  };
61
+ export default cli;
@@ -4,3 +4,19 @@ export declare enum StatisticType {
4
4
  INCLUDE = "INCLUDE",
5
5
  EXCLUDE = "EXCLUDE"
6
6
  }
7
+ /**
8
+ * File extensions which are parsed with jsdoc-to-markdown
9
+ */
10
+ export declare const SCRIPT_EXTENSIONS: string[];
11
+ /**
12
+ * File extensions which are parsed with vue-docgen-cli
13
+ */
14
+ export declare const VUE_EXTENSIONS: string[];
15
+ /**
16
+ * TypeScript extensions. These need their types stripped before jsdoc can read them.
17
+ */
18
+ export declare const TYPESCRIPT_EXTENSIONS: string[];
19
+ /**
20
+ * Placeholder inside the generated sidebar, which gets replaced with the title passed to `sidebarTree(title)`
21
+ */
22
+ export declare const SIDEBAR_TITLE_PLACEHOLDER = "::vuepress-jsdoc-title::";
package/dist/constants.js CHANGED
@@ -1,10 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StatisticType = void 0;
4
- var StatisticType;
1
+ export var StatisticType;
5
2
  (function (StatisticType) {
6
3
  StatisticType["EMPTY"] = "EMPTY";
7
4
  StatisticType["ERROR"] = "ERROR";
8
5
  StatisticType["INCLUDE"] = "INCLUDE";
9
6
  StatisticType["EXCLUDE"] = "EXCLUDE";
10
- })(StatisticType || (exports.StatisticType = StatisticType = {}));
7
+ })(StatisticType || (StatisticType = {}));
8
+ /**
9
+ * File extensions which are parsed with jsdoc-to-markdown
10
+ */
11
+ export const SCRIPT_EXTENSIONS = ['.js', '.jsx', '.mjs', '.cjs', '.ts', '.tsx', '.mts', '.cts'];
12
+ /**
13
+ * File extensions which are parsed with vue-docgen-cli
14
+ */
15
+ export const VUE_EXTENSIONS = ['.vue'];
16
+ /**
17
+ * TypeScript extensions. These need their types stripped before jsdoc can read them.
18
+ */
19
+ export const TYPESCRIPT_EXTENSIONS = ['.ts', '.tsx', '.mts', '.cts'];
20
+ /**
21
+ * Placeholder inside the generated sidebar, which gets replaced with the title passed to `sidebarTree(title)`
22
+ */
23
+ export const SIDEBAR_TITLE_PLACEHOLDER = '::vuepress-jsdoc-title::';
package/dist/index.d.ts CHANGED
@@ -1,11 +1,51 @@
1
- import { CLIArguments } from './interfaces';
1
+ import { CLIArguments, ParseReturn } from './interfaces.js';
2
+ import { FileTree } from './interfaces.js';
3
+ import { SidebarOptions } from './lib/vue-sidebar.js';
4
+ export { listFolder } from './lib/list-folder.js';
5
+ export { parseFile, writeContentToFile } from './lib/parser.js';
6
+ export { createSidebarConfig, generateVitepressSidebar, generateVueSidebar } from './lib/vue-sidebar.js';
7
+ export { parseComment, parseVuepressFileHeader } from './lib/comment-parser.js';
8
+ export { defineConfig, loadConfig } from './lib/config.js';
9
+ export { vuepressJsdocPlugin } from './lib/vuepress-plugin.js';
10
+ export { StatisticType } from './constants.js';
11
+ export type { CLIArguments, DirectoryFile, FileTree, ParseReturn, UserConfig } from './interfaces.js';
2
12
  /**
3
- * Default command that generate md files
4
- * @param {object} argv passed arguments
13
+ * Parse all CLI arguments
14
+ * @param {CLIArguments} argv
15
+ * @returns {object} all arguments
16
+ */
17
+ export declare const parseArguments: (argv: CLIArguments) => {
18
+ include: string[];
19
+ exclude: string[];
20
+ srcFolder: string;
21
+ codeFolder: string;
22
+ docsFolder: string;
23
+ title: string;
24
+ readme: string | undefined;
25
+ readmePath: string;
26
+ rmPattern: string[];
27
+ partials: string[];
28
+ jsDocConfigPath: string | undefined;
29
+ collapsible: boolean;
30
+ format: "vitepress" | "vuepress";
31
+ };
32
+ export type Options = ReturnType<typeof parseArguments>;
33
+ /**
34
+ * Get the sidebar options of the given file tree
35
+ * @param {Options} options
36
+ * @param {FileTree[]} fileTree created by `listFolder`
37
+ * @returns {SidebarOptions}
38
+ */
39
+ export declare const getSidebarOptions: (options: Options, fileTree: FileTree[]) => SidebarOptions;
40
+ /**
41
+ * Default command that generates the markdown files
42
+ * @param {CLIArguments} argv passed arguments
43
+ * @returns {Promise<ParseReturn[]>} results of all parsed files
5
44
  */
6
- export declare const generate: (argv: CLIArguments) => Promise<void>;
45
+ export declare const generate: (argv: CLIArguments) => Promise<ParseReturn[]>;
7
46
  /**
8
- * Watch files in source folder
47
+ * Watch files in source folder and update the generated markdown files
9
48
  * @param {CLIArguments} argv
49
+ * @returns {object} chokidar watcher
10
50
  */
11
- export declare const watchFiles: (argv: CLIArguments) => void;
51
+ export declare const watchFiles: (argv: CLIArguments) => import("chokidar").FSWatcher;