Giter Site home page Giter Site logo

ph1p / vuepress-jsdoc Goto Github PK

View Code? Open in Web Editor NEW
73.0 7.0 21.0 5.11 MB

Build JSDoc markdown files for vuepress

Home Page: https://vuepress-jsdoc-example.vercel.app/

License: MIT License

JavaScript 32.72% Vue 20.49% TypeScript 44.97% Handlebars 1.72% Shell 0.10%
jsdoc vuepress-jsdoc vuepress documentation tool cli commandline-tool typescript vue

vuepress-jsdoc's Introduction

vuepress-jsdoc

Quality Gate Status npm vercel

This npm package serves as a command line script designed to analyze your JavaScript, Vue, or TypeScript source code. Leveraging jsdoc-to-markdown and vue-docgen-cli, it dynamically generates markdown files tailored for VuePress.

CLI ./example

Vuepress support

This npm package is compatible with VuePress 2; however, it requires a version lower than 5.0.0 for proper functionality with VuePress 1.

How to

yarn global add vuepress-jsdoc
npm i vuepress-jsdoc -g

Example:

# search code in src and move it to code (./documentation/code) in your vuepress folder (./documentation)
vuepress-jsdoc --source ./src --dist ./documentation --folder code --title API --exclude="**/*/*.test.js"

You can also use npx vuepress-jsdoc, if you want.

Watch-Mode alpha

If you do not want to runvuepress-jsdoc again and again and again. You can simply pass --watch or -w.

Command-Options

Use these options after vuepress-jsdoc.

Name Alias Default Description
--source -s ./src Source folder with .js or .ts files
--dist -d ./documentation Destination folder
--folder -f ./code Folder inside destination folder. Gets overwritten everytime
--title -t API Title of your documentation
--help -h Show help
--version -v Show current version
--readme -r Path to custom readme file
--exclude -e Pattern to exclude files/folders (Comma seperated) - *.test.js,exclude.js more information
--include -e Pattern to include files/folders (Comma seperated) - *.test.js,include.js more information
--rmPattern -rm Pattern when removing files. You can ex- and include files. (glob pattern)
--partials -p jsdoc2markdown partial templates (overwrites default ones)
--jsDocConfigPath -c Path to JsDoc Config (experimental)
--watch -w Watch changes and update markdown files

config.js

Inside your generated folder, you can find a config.js. This file includes a complete filetree and an vuepress sidebar tree.

How to configure vuepress

Vuepress is a static site generator by Evan You. You can add all generated documentation files to your existing vuepress project or create a new one.

# First install vuepress
yarn global add vuepress

# Run the CLI
vuepress-jsdoc

# Run vuepress dev server
vuepress dev ./documentation

# Run vuepress build, if you want to ship it
vuepress build ./documentation

Access it via: http://localhost:8080/code/

Now you need the sidebar. Create a .vuepress folder inside the documentation folder and add the following config.js.

config.js:

// auto generated sidebar
const { sidebarTree } = require('../code/config');

module.exports = {
  dest: 'dist',
  locales: {
    '/': {
      title: 'vuepress-jsdoc',
      description: 'Generate jsdoc markdown files for vuepress'
    }
  },
  themeConfig: {
    editLinks: true,
    sidebarDepth: 4,
    docsDir: 'code',
    locales: {
      '/': {
        nav: [
          {
            text: 'Home',
            link: '/'
          }
        ],
        // Add the generated sidebar
        sidebar: Object.assign({}, sidebarTree('Mainpage title'))
      }
    }
  }
};

Custom readme

To include a custom path for your readme, simply utilize the --readme ./path/to/file.md parameter. If you relocate a README.md file into your source folder, the system will automatically resolve it.

For setting the title, provide it as an argument to the sidebarTree('Mainpage title') function within your ./.vuepress/config.js file.

@vuepress comment block

Enhance your page customization by incorporating custom metadata through the @vuepress block:

/*
 * @vuepress
 * ---
 * title: Your custom title
 * headline: You custom headline
 * ---
 */

Use headline to add a custom h1 title.

More information

Typescript

To integrate TypeScript support, install the following dev-dependencies with the following command:

npm install -D typescript jsdoc-babel @babel/cli @babel/core @babel/preset-env @babel/preset-typescript jsdoc-to-markdown

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.

Example

The ./example folder includes a full working vuepress-jsdoc example.

# Install dependencies
npm install

# Run the CLI
vuepress-jsdoc

# Generate docs
npm run docs

# Run dev server
npm run dev

# Generate dist folder
npm run build

Contribute

PRs are always welcome (:

vuepress-jsdoc's People

Contributors

codacy-badger avatar dependabot[bot] avatar greenimp avatar henrytabima avatar juliushaertl avatar narration-sd avatar nriesco avatar ph1p avatar rck-dev-bot avatar robin-rpr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vuepress-jsdoc's Issues

Security issue with handlebars

Describe the bug
Security issue with dependency handlebars.

To Reproduce
Yarn audit

Expected behavior
No high level issue

Additional context

│ high │ Prototype Pollution
│ Package │ handlebars │
│ Patched in │ >=4.5.3 │
│ Dependency of │ vuepress-jsdoc │
│ Path │ vuepress-jsdoc > jsdoc-to-markdown > dmd > handlebars │
│ More info │ https://www.npmjs.com/advisories/1325

Generates separate documentation folder when Vue components are in seperate folder.

Generates separate documentation folder when Vue components are in separate folder. See below screenshot. You can see that inside the example/src folder a new documentation folder is generated. This causes an error when trying to run dev or build.
Screenshot 2021-02-15 at 15 44 44

Steps to reproduce
Steps to reproduce the behavior:

  1. Create a folder onder src named components
  2. Move test.vue and vue-md.vue inside this new folder.
  3. yarn run docs
  4. yarn run dev

I'm guessing the vue-docgen-cli needs to be configured? I will do a PR whenever i find the solution.

How can I make the side bar children all collapsible, by default it's a not collapsible?

I am using this command to create my markdown files
npx vuepress-jsdoc -s ./dist/src -d ./docs -f package --include=\"**/*.(ts|js)\" --exclude=\"test*,**/*.d.ts,**/interfaces.*,**/constants.*\"

it creates a sidebar tree which is of type

sidebarTree: (title?: string) => {
    "/package/": {
        title: string;
        collapsable: boolean;
        children: (string | string[])[];
    }[];
}

but by default collapsible is false. how can I change it?
my .vuepress/config.js
// Add the generated sidebar sidebar: Object.assign({}, {...sidebarTree('Package')}),

Adding a config file to replace CLI arguments

Is your feature request related to a problem? Please describe.
Currently the package is working fine but the the CLI arguments might be too many to handle. I have a project that has many nested files and it is cumbersome to selectively add folders. Even when running as a npm script, this are is still an issue of maintenance (if folder structure changes .. etc)

Describe the solution you'd like
Having a JS config file would solve the mentioned issue and provide more capabilities (e.g. adding logic)

Describe alternatives you've considered
Using npm script.

Additional context
Thanks for this package and I hope that it is still maintained. I had a difficult time finding an actively maintained package that could document vue components (even styleguide did not work) until I found this one.
I would be happy to help with a PR if this is feature is considered.

yargs as cli args parser

Im working on add yargs to manage the cli args, auto generate --help menu and make easier to add new features

Contribution

Hi, i like very much this project and i would like to contribute. Im have couple of years codign but im new in open source world. if you have any sugestion to start, i'll thank you a lot.

mm.isMatch(path.join(folder.replace(srcFolder, ''), file) is not working properly

Describe the bug
On commit 554f804ec133a94db99a22eb5f1b110817a214452ce1868738fa5321237ce7a7 the line 81 on cmds/index.js changes from

mm.contains(`${chalk.dim(folder)}/${file}`, exclude)

to

mm.isMatch(path.join(folder.replace(srcFolder, ''), file)

the problem is when the source folder is ./src it replace it for an empty string ('') and micromatch use picomatch under the hood:

image

and as you can see in line 47 of the next image if glob argument is equal to '' it throws an error and brokes the process

image

Ok, the question probably is why it is receiving the empty string on the glob of picomatch, is because in the change mentioned above, the srcFolder is replaced with '' and in the first iteration the variable folder is the default value for the --source argument, I mean ./src, you can check that in the following image

image

To Reproduce
Steps to reproduce the behavior:

Is simple you need a repo with the following structure:

image

and run the following command npx vuepress-jsdoc

Expected behavior
Works normally like as v3.2.0 worked before the mentioned change.

Node (please complete the following information):

  • Node-Version: v14.17.1

Additional context
Add any other context about the problem here.

Embedded Markdown inside .vue files not rendered

In one the examples of Vue Styleguidist in combination with Vuepress you can see that the embedded Markdown inside a .vue is rendered.

Example demo page: https://vue-styleguidist.github.io/docgen/components/Button/Button.html#props
Demo source code: https://github.com/vue-styleguidist/vue-styleguidist/blob/dev/examples/docgen/src/components/Button/Button.vue

Since vuepress-jsdoc is utilizing both Vue Styleguidist and Vuepress i wonder why the embedded Markdown doesn't seem to work with vuepress-jsdoc. Any clue what's causing this?

[Bug] using an index.js file in source generate an error when runing `vuepress build folder`

I configure my package json script like this:

{
...
  "scripts": {
    "docs:gen": "vuepress-jsdoc --source=./src --dist=./docs --title=API",
    "docs:build": "vuepress build docs"
  },
...
}

i was testing and i had an index.js file in src folder. npm run docs:gen work fine, but when running npm run docs:build I got this error:

FAIL  Error rendering /code/:
TypeError: Cannot read property 'match' of undefined
...

Bug when parsing: Cannot read property 'split' of null

Hello, thanks for interesting project.

I am getting this error. I would be happy to provide more info.

Thank you!

Jaroslav

$ vuepress-jsdoc --source ./src --dist ./documentation-gui --folder code --title API --exclude *.test.js,exclude.js,*.spec.js                         
exclude ./src/client-common/entities/CasovyInterval.spec.js                                                                                           
write file ./documentation-gui/code/client-gui/components/App.md                                                                                      
write file ./documentation-gui/code/client-gui/components/Date.md                                                                                     
write file ./documentation-gui/code/client-gui/components/DumbManagerPristupovychRoli.md                                                              
write file ./documentation-gui/code/client-gui/components/EditorCasovehoIntervalu.md                                                                  
C:\Users\Jarda\AppData\Local\Yarn\Data\global\node_modules\vuepress-jsdoc\node_modules\@vuedoc\md\lib\markdown.js:74                                  
  return text.split(/\n/g)                                                                                                                            
              ^                                                                                                                                       
                                                                                                                                                      
TypeError: Cannot read property 'split' of null                                                                                                       
    at indentText (C:\Users\Jarda\AppData\Local\Yarn\Data\global\node_modules\vuepress-jsdoc\node_modules\@vuedoc\md\lib\markdown.js:74:15)           
    at params.forEach (C:\Users\Jarda\AppData\Local\Yarn\Data\global\node_modules\vuepress-jsdoc\node_modules\@vuedoc\md\lib\markdown.js:105:25)      
    at Array.forEach (<anonymous>)                                                                                                                    
    at printParams (C:\Users\Jarda\AppData\Local\Yarn\Data\global\node_modules\vuepress-jsdoc\node_modules\@vuedoc\md\lib\markdown.js:89:10)          
    at methods.forEach (C:\Users\Jarda\AppData\Local\Yarn\Data\global\node_modules\vuepress-jsdoc\node_modules\@vuedoc\md\lib\markdown.js:234:7)      
    at Array.forEach (<anonymous>)                                                                                                                    
    at Object.methods (C:\Users\Jarda\AppData\Local\Yarn\Data\global\node_modules\vuepress-jsdoc\node_modules\@vuedoc\md\lib\markdown.js:220:13)      
    at options.features.forEach (C:\Users\Jarda\AppData\Local\Yarn\Data\global\node_modules\vuepress-jsdoc\node_modules\@vuedoc\md\lib\markdown.js:304
    at Array.forEach (<anonymous>)                                                                                                                    
    at process.nextTick (C:\Users\Jarda\AppData\Local\Yarn\Data\global\node_modules\vuepress-jsdoc\node_modules\@vuedoc\md\lib\markdown.js:297:22)    
    at process._tickCallback (internal/process/next_tick.js:61:11)                                                                                    
error Command failed with exit code 1.                                                                                                                
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.                                                                  

Custom Readme

Any news about this feature ?
Without, i can't use your nice package
Regards

Or a workaround ?

Can't exclude specific files in a directory

Describe the bug
Using the exclude flag doesn't seem to work when trying to exclude a file in a particular directory.
You can exclude any file that matches a particular name, or all files within a directory. But not a particular file inside a particular directory.

To Reproduce
Given the following file structure:

/foo.js
/directory/foo.js
/directory/bar.js

Using the following flag:

--exclude ./foo.js

Will exclude both /foo.js and /directory/foo,js.

And this:

--exclude ./directory

Will exclude /directory/foo.js, and /directory/bar.js.

But this doesn't exclude anything:

--exclude ./directory/foo.js

Expected behavior
I would expect to be able to exclude individual files inside directories.

E.g.:

--exclude ./directory/foo.js

Would exclude /directory/foo.js. And not exclude /foo.js or /directory/bar.js.

Node (please complete the following information):

  • Node-Version: 14.3.0

Custom title should also be used for the actual headline

When specifying a custom title with the @vuepress annotation, it should also be used in the generated markdown file.

Using:

/**
 * @vuepress
 * ---
 * title: Your custom title
 * ---
 */

Actual output:

---
title: Your custom title
---
# action 

Expected output:

---
title: Your custom title
---
# Your custom title 

Throw error if doc fails to parse

Is your feature request related to a problem? Please describe.
If a document fails to parse, it still continues to generate all the other files and exits with code 0:

ERROR: Unable to parse a tag's type expression for source file /src/my-file.js in line 88 with tag title ...
error ./src/my-file.js -> ./documentation/code/my-file.md

Still completes with:

Finished! 👍
Process finished with exit code 0

If there are a lot of files, you can miss that some may have failed to parse.
It also means that it can't be used easily in CI tools, as they look for a script to provide an error code on failure, and will incorrectly think that everything was successful.

Describe the solution you'd like
I think it could be helpful for the script to throw an error message and error code if a document fails to be written.

I think the error code just needs to be non-zero (Usually seems to be 1).

I'm not sure whether it would also be good to stop processing on the first failure. The benefit is that it wont spend more time generating documents when it's not necessary; the downside is that there may be other files that don't parse, and it wont catch them in one go.

.../node_modules/vuepress-jsdoc/node_modules/.bin/vue-docgen: not found

Describe the bug
I found the above error in the last version, for some reason vue-docgen-api is not installed inside of the node_modules of the vuepress-jsdoc, I'm not sure why but when it try to use it to generate the docs in line 145 of cmds/index.js it isn't there.
I add prints to the modules inside of the node_modules in vuepress-jsdoc and the nodeModulesPath and rootProjectFolder variables in the first and second screenshots in the last screenshot you can see the error .../.bin/vue-docgen module not found.

Screenshot from 2021-08-22 17-24-25
Screenshot from 2021-08-22 17-26-09
Screenshot from 2021-08-22 17-40-39

To Reproduce
Steps to reproduce the behavior:
install vuepress-jsdoc and run the command to generate the documentation.

Expected behavior
Works in the same way as version 3.2.0 worked.

Node (please complete the following information):

  • Node-Version: 14.17.1

Additional context
I had installed vue-docgen-api and vue-docgen-cli in my devDependencies but, I remove them from my devDependencies and I made a fresh install with a new package-lock.json generated and the error is still happening.

Not generating docs for classes with a constructor

Desciption of the bug
Docs are not generated for any class with a constructor in versions 1.8.0 and 1.7.4.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new folder and create a 'src' folder within it.
  2. Create a js file inside the src folder and write any class with a constructor.
  3. open a terminal and navigate to the project folder, run 'vuepress-jsdoc'
  4. See that the docs for the file are not generated.

Expected behavior
Docs are generated.

Node

  • Node-Version: 12.7.0

Additional context
Temporary fix - use version 1.7.2 of vuepress-jsdoc.
Finding the bug took a good few hours...

Unable to parse

Describe the bug
Running the following vuepress-jsdoc --source ./src --dist ./docs --folder code --title API --exclude *.test.js,exclude.js,*.md,*.gql inside of a large Vue/Typescript project and am receiving the following error:

ERROR: Unable to parse /var/folders/z_/53b8n6wn5ysf78x0m0xrxf440000gn/T/2lxi6oo7198arjxo05wq3w.js: Unexpected token (6:17)
error ./src/bindings/local-binding.ts -> ./docs/code/bindings/local-binding.md
ERROR: Unable to parse /var/folders/z_/53b8n6wn5ysf78x0m0xrxf440000gn/T/ob09t9tje6ghg2el2es3c.js: Unexpected token (14:17)
error ./src/components/button-triggered-dialogs/card-table-selection-dialog.tsx -> ./docs/code/components/button-triggered-dialogs/card-table-selection-dialog.md
ERROR: Unable to parse /var/folders/z_/53b8n6wn5ysf78x0m0xrxf440000gn/T/m1y900xsepawm2ffw5a8s.js: Unexpected token, expected "," (1:37)
error ./src/components/button-triggered-dialogs/get-place-icon-name.ts -> ./docs/code/components/button-triggered-dialogs/get-place-icon-name.md
ERROR: Unable to parse /var/folders/z_/53b8n6wn5ysf78x0m0xrxf440000gn/T/m9fv3letqunvd95rrzat7.js: Unexpected reserved word 'interface' (15:0)
error ./src/components/button-triggered-dialogs/places-tree-selection-dialog.tsx -> ./docs/code/components/button-triggered-dialogs/places-tree-selection-dialog.md
ERROR: Unable to parse /var/folders/z_/53b8n6wn5ysf78x0m0xrxf440000gn/T/ofio7afi8yhlo6guhcrkp.js: Unexpected token, expected "," (11:32)
error ./src/components/button-triggered-dialogs/selection-dialogs.tsx -> ./docs/code/components/button-triggered-dialogs/selection-dialogs.md
^C

The error is occurring on nearly all files, I haven't seen it hit one successfully.

Node (please complete the following information):
Have tried both 10.16.0 and 12.16.1.

Additional context
We use GraphQL and have a lot of custom types being defined, I am a bit of a newbie with this stuff and this may be something that I have failed to setup on my end to get this working.

Bad BUG Don't show sidebar

Describe the bug
like it
image

To Reproduce
1,My file structure
image
2、start it
image

Expected behavior
show sidebar

Node (please complete the following information):

  • Node-Version: [e.g. 11.3.0]
    image

Additional context
my config.js:
whichever can't do it

// auto generated sidebar
const { sidebarTree } = require('../documentation/code/config.js');
// console.log('sidebarTree',sidebarTree())
// let sidebarTreeData = sidebarTree()

module.exports = {
  dest: 'dist',
//   base: '/bwFEdoc',
  locales: {
    '/': {
      title: 'baiwangFE-doc',
      description: 'Generate baiwangFE-doc markdown files for vuepress'
    }
  },
  themeConfig: {
    editLinks: true,
    sidebarDepth: 2,
    docsDir: '/code',
    locales: {
      '/': {
        nav: [
          {
            text: 'Home',
            link: '/'
          },
          {
            text: 'Code',
            link: '/code'
          }
        ],
        // Add the generated sidebar
can't show
        // sidebar: Object.assign({}, sidebarTree('Mainpage title'))
can't show
        // sidebar: Object.assign({}, sidebarTree()['/code/'])
can't show
        // sidebar: sidebarTree()['/code/']
can't show
        // sidebar: sidebarTreeData
can't show
        // sidebar: [{
        //     'title': 'common-ui',
        //     'collapsable': false,
        //     'children': ['common-ui/button/Button', 'common-ui/data-grid/_index', 'common-ui/icon/Icon', 'common-ui/loading/Loading', 'common-ui/page/Page', 'common-ui/page/Page2', 'common-ui/single-table/_index', 'common-ui/switch/Switch', 'common-ui/table/Table', 'common-ui/table/cell', 'common-ui/table/dynamic-column', 'common-ui/table/table-body', 'common-ui/table/table-head']
        // },
        // {
        //     'title': 'common-ui',
        //     'collapsable': false,
        //     'children': ['common-ui/button/Button', 'common-ui/data-grid/_index', 'common-ui/icon/Icon', 'common-ui/loading/Loading', 'common-ui/page/Page', 'common-ui/page/Page2', 'common-ui/single-table/_index', 'common-ui/switch/Switch', 'common-ui/table/Table', 'common-ui/table/cell', 'common-ui/table/dynamic-column', 'common-ui/table/table-body', 'common-ui/table/table-head']
        // },
        // {
        //     'title': 'common-ui',
        //     'collapsable': false,
        //     'children': ['common-ui/button/Button', 'common-ui/data-grid/_index', 'common-ui/icon/Icon', 'common-ui/loading/Loading', 'common-ui/page/Page', 'common-ui/page/Page2', 'common-ui/single-table/_index', 'common-ui/switch/Switch', 'common-ui/table/Table', 'common-ui/table/cell', 'common-ui/table/dynamic-column', 'common-ui/table/table-body', 'common-ui/table/table-head']
        // }]
and so on like in vuepress doc
      }
    }
  }
};

Vuepress 2 support

Is your feature request related to a problem? Please describe.
The sidebar config has changed slightly in Vuepress v2, which means that this library no longer generates a sidebar config that is compatible with Vuepress 2.

The docs for v2 are here: https://v2.vuepress.vuejs.org/reference/default-theme/config.html#sidebar

Firstly, the title property has been changed to text.
Another issue, that doesn't appear to be documented, is that the link strings need to be the full path, rather than just the relative path.

With a structure like:

/code/
  - file-a.md
  - file-b.md
  sub-directory/
    - file-c.md

The sidebar is currently generated as:

{
  '/code/': [
    {
      title: 'Code',
      children: [['', '' + title + ''], 'file-a', 'file-b'],
    }
    {
      title: 'sub-directory',
      children: ['sub-directory/file-c'],
    }
  ],
}

When navigating into the sub-directory, the links to the root directory get changed like sub-directory/file-a, which is broken.
To fix it, it needs to be like this:

{
  '/code/': [
    {
      text: 'Code',
      children: [{link: '/code/', text: '' + title + ''}, '/code/file-a', '/code/file-b'],
    }
    {
      text: 'sub-directory',
      children: ['/code/sub-directory/file-c'],
    }
  ],
}

Note above that the root level first link has also been changed to an object - it looks like the array style used before also no longer works.

Describe the solution you'd like
For the library to export the config in a way that is compatible with VuePress v2.

Describe alternatives you've considered
I'm not really sure there are other alternatives 🤷

'exlude by config' on files

I've been using this great package without any problems for the last few weeks,
but today after adding some docs to some files and trying to generate the new docs with them included i get this strange msg on these files:

image

I went through any configuration i have in the whole project to try and find what might cause this to happen without any success.

Other folders which are excluded have this msg:

image

This is how that folder appears in the generated config:

image

Would appreciate help :)

Better TypeScript support

Is your feature request related to a problem? Please describe.
When the files are generated along with the config.js file, that config.js file is not TypeScript friendly.

Describe the solution you'd like
I would like the option to specify that the output should be TypeScript friendly. (IE: use export const not exports.)

Describe alternatives you've considered
I can run a post script that searches for exports. and replaces it with export const while renaming the file to "config.ts" but I feel like this is not the elegant solution I am seeking.

add exclude feature

great job!
but it seems not support exclude feature, everything under source folder would be included.
is there any plan for it?

[vuepress] Nested sidebar groups are not supported. Consider using navbar + categories instead.

I'm running vuepress 1.0.0-alpha.32 and vuepress-jsdoc 1.0.1.

When I run vuepress dev ./documentation, I get the following errors in Chrome Dev Tools console:

index.js?165b:219 [vuepress] Nested sidebar groups are not supported. Consider using navbar + categories instead.
resolveItem @ index.js?165b:219
children.children.map.child @ index.js?165b:228
resolveItem @ index.js?165b:228
config.map.item @ index.js?165b:136
resolveSidebarItems @ index.js?165b:136
sidebarItems @ Layout.vue?3e79:94
get @ vue.runtime.esm.js?2b0e:3256
evaluate @ vue.runtime.esm.js?2b0e:3361
computedGetter @ vue.runtime.esm.js?2b0e:3613
shouldShowSidebar @ Layout.vue?3e79:86
get @ vue.runtime.esm.js?2b0e:3256
evaluate @ vue.runtime.esm.js?2b0e:3361
computedGetter @ vue.runtime.esm.js?2b0e:3613
pageClasses @ Layout.vue?3e79:108
get @ vue.runtime.esm.js?2b0e:3256
evaluate @ vue.runtime.esm.js?2b0e:3361
computedGetter @ vue.runtime.esm.js?2b0e:3613
get @ vue.runtime.esm.js?2b0e:2012
render @ Layout.vue?2e52:9
Vue._render @ vue.runtime.esm.js?2b0e:4640
updateComponent @ vue.runtime.esm.js?2b0e:2886
get @ vue.runtime.esm.js?2b0e:3256
run @ vue.runtime.esm.js?2b0e:3331
flushSchedulerQueue @ vue.runtime.esm.js?2b0e:3087
(anonymous) @ vue.runtime.esm.js?2b0e:1916
flushCallbacks @ vue.runtime.esm.js?2b0e:1835
Promise.then (async)
microTimerFunc @ vue.runtime.esm.js?2b0e:1883
nextTick @ vue.runtime.esm.js?2b0e:1929
queueWatcher @ vue.runtime.esm.js?2b0e:3179
update @ vue.runtime.esm.js?2b0e:3321
notify @ vue.runtime.esm.js?2b0e:712
reactiveSetter @ vue.runtime.esm.js?2b0e:1037
(anonymous) @ vue-router.esm.js?8c4f:2503
(anonymous) @ vue-router.esm.js?8c4f:2502
updateRoute @ vue-router.esm.js?8c4f:1989
(anonymous) @ vue-router.esm.js?8c4f:1867
(anonymous) @ vue-router.esm.js?8c4f:1976
step @ vue-router.esm.js?8c4f:1706
step @ vue-router.esm.js?8c4f:1713
runQueue @ vue-router.esm.js?8c4f:1717
(anonymous) @ vue-router.esm.js?8c4f:1971
step @ vue-router.esm.js?8c4f:1706
(anonymous) @ vue-router.esm.js?8c4f:1710
(anonymous) @ vue-router.esm.js?8c4f:1956
(anonymous) @ vue-router.esm.js?8c4f:1784
iterator @ vue-router.esm.js?8c4f:1935
step @ vue-router.esm.js?8c4f:1709
(anonymous) @ vue-router.esm.js?8c4f:1710
(anonymous) @ vue-router.esm.js?8c4f:1956
Promise.then (async)
beforeEnter @ routes.js?fc18:38
iterator @ vue-router.esm.js?8c4f:1935
step @ vue-router.esm.js?8c4f:1709
(anonymous) @ vue-router.esm.js?8c4f:1710
(anonymous) @ vue-router.esm.js?8c4f:1956
$router.beforeEach @ clientRootMixin.js?d282:13
iterator @ vue-router.esm.js?8c4f:1935
step @ vue-router.esm.js?8c4f:1709
(anonymous) @ vue-router.esm.js?8c4f:1710
(anonymous) @ vue-router.esm.js?8c4f:1956
(anonymous) @ app.js?c4ff:84
iterator @ vue-router.esm.js?8c4f:1935
step @ vue-router.esm.js?8c4f:1709
step @ vue-router.esm.js?8c4f:1713
runQueue @ vue-router.esm.js?8c4f:1717
confirmTransition @ vue-router.esm.js?8c4f:1964
transitionTo @ vue-router.esm.js?8c4f:1866
push @ vue-router.esm.js?8c4f:2176
push @ vue-router.esm.js?8c4f:2529
handler @ vue-router.esm.js?8c4f:444
invoker @ vue.runtime.esm.js?2b0e:2119
fn._withTask.fn._withTask @ vue.runtime.esm.js?2b0e:1904
vue.runtime.esm.js?2b0e:601 [Vue warn]: Error in render: "TypeError: Cannot read property 'children' of null"

found in

---> <Layout> at node_modules/@vuepress/theme-default/layouts/Layout.vue
       <LayoutDistributor> at node_modules/@vuepress/core/lib/app/components/LayoutDistributor.vue
         <Root>
warn @ vue.runtime.esm.js?2b0e:601
logError @ vue.runtime.esm.js?2b0e:1815
globalHandleError @ vue.runtime.esm.js?2b0e:1810
handleError @ vue.runtime.esm.js?2b0e:1799
Vue._render @ vue.runtime.esm.js?2b0e:4642
updateComponent @ vue.runtime.esm.js?2b0e:2886
get @ vue.runtime.esm.js?2b0e:3256
run @ vue.runtime.esm.js?2b0e:3331
flushSchedulerQueue @ vue.runtime.esm.js?2b0e:3087
(anonymous) @ vue.runtime.esm.js?2b0e:1916
flushCallbacks @ vue.runtime.esm.js?2b0e:1835
Promise.then (async)
microTimerFunc @ vue.runtime.esm.js?2b0e:1883
nextTick @ vue.runtime.esm.js?2b0e:1929
queueWatcher @ vue.runtime.esm.js?2b0e:3179
update @ vue.runtime.esm.js?2b0e:3321
notify @ vue.runtime.esm.js?2b0e:712
reactiveSetter @ vue.runtime.esm.js?2b0e:1037
(anonymous) @ vue-router.esm.js?8c4f:2503
(anonymous) @ vue-router.esm.js?8c4f:2502
updateRoute @ vue-router.esm.js?8c4f:1989
(anonymous) @ vue-router.esm.js?8c4f:1867
(anonymous) @ vue-router.esm.js?8c4f:1976
step @ vue-router.esm.js?8c4f:1706
step @ vue-router.esm.js?8c4f:1713
runQueue @ vue-router.esm.js?8c4f:1717
(anonymous) @ vue-router.esm.js?8c4f:1971
step @ vue-router.esm.js?8c4f:1706
(anonymous) @ vue-router.esm.js?8c4f:1710
(anonymous) @ vue-router.esm.js?8c4f:1956
(anonymous) @ vue-router.esm.js?8c4f:1784
iterator @ vue-router.esm.js?8c4f:1935
step @ vue-router.esm.js?8c4f:1709
(anonymous) @ vue-router.esm.js?8c4f:1710
(anonymous) @ vue-router.esm.js?8c4f:1956
Promise.then (async)
beforeEnter @ routes.js?fc18:38
iterator @ vue-router.esm.js?8c4f:1935
step @ vue-router.esm.js?8c4f:1709
(anonymous) @ vue-router.esm.js?8c4f:1710
(anonymous) @ vue-router.esm.js?8c4f:1956
$router.beforeEach @ clientRootMixin.js?d282:13
iterator @ vue-router.esm.js?8c4f:1935
step @ vue-router.esm.js?8c4f:1709
(anonymous) @ vue-router.esm.js?8c4f:1710
(anonymous) @ vue-router.esm.js?8c4f:1956
(anonymous) @ app.js?c4ff:84
iterator @ vue-router.esm.js?8c4f:1935
step @ vue-router.esm.js?8c4f:1709
step @ vue-router.esm.js?8c4f:1713
runQueue @ vue-router.esm.js?8c4f:1717
confirmTransition @ vue-router.esm.js?8c4f:1964
transitionTo @ vue-router.esm.js?8c4f:1866
push @ vue-router.esm.js?8c4f:2176
push @ vue-router.esm.js?8c4f:2529
handler @ vue-router.esm.js?8c4f:444
invoker @ vue.runtime.esm.js?2b0e:2119
fn._withTask.fn._withTask @ vue.runtime.esm.js?2b0e:1904
vue.runtime.esm.js?2b0e:1819 TypeError: Cannot read property 'children' of null
    at resolveItem (index.js?165b:224)
    at children.children.map.child (index.js?165b:228)
    at Array.map (<anonymous>)
    at resolveItem (index.js?165b:228)
    at config.map.item (index.js?165b:136)
    at Array.map (<anonymous>)
    at resolveSidebarItems (index.js?165b:136)
    at VueComponent.sidebarItems (Layout.vue?3e79:94)
    at Watcher.get (vue.runtime.esm.js?2b0e:3256)
    at Watcher.evaluate (vue.runtime.esm.js?2b0e:3361)
    at VueComponent.computedGetter [as sidebarItems] (vue.runtime.esm.js?2b0e:3613)
    at VueComponent.shouldShowSidebar (Layout.vue?3e79:86)
    at Watcher.get (vue.runtime.esm.js?2b0e:3256)
    at Watcher.evaluate (vue.runtime.esm.js?2b0e:3361)
    at VueComponent.computedGetter [as shouldShowSidebar] (vue.runtime.esm.js?2b0e:3613)
    at VueComponent.pageClasses (Layout.vue?3e79:108)
    at Watcher.get (vue.runtime.esm.js?2b0e:3256)
    at Watcher.evaluate (vue.runtime.esm.js?2b0e:3361)
    at VueComponent.computedGetter [as pageClasses] (vue.runtime.esm.js?2b0e:3613)
    at Object.get (vue.runtime.esm.js?2b0e:2012)
    at Proxy.render (eval at ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/@vuepress/core/node_modules/.cache/vuepress","cacheIdentifier":"21f69b6b-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/@vuepress/theme-default/layouts/Layout.vue?vue&type=template&id=0fb8d67b& (0.js:921), <anonymous>:12:18)
    at VueComponent.Vue._render (vue.runtime.esm.js?2b0e:4640)
    at VueComponent.updateComponent (vue.runtime.esm.js?2b0e:2886)
    at Watcher.get (vue.runtime.esm.js?2b0e:3256)
    at Watcher.run (vue.runtime.esm.js?2b0e:3331)
    at flushSchedulerQueue (vue.runtime.esm.js?2b0e:3087)
    at Array.eval (vue.runtime.esm.js?2b0e:1916)
    at flushCallbacks (vue.runtime.esm.js?2b0e:1835)
logError @ vue.runtime.esm.js?2b0e:1819
globalHandleError @ vue.runtime.esm.js?2b0e:1810
handleError @ vue.runtime.esm.js?2b0e:1799
Vue._render @ vue.runtime.esm.js?2b0e:4642
updateComponent @ vue.runtime.esm.js?2b0e:2886
get @ vue.runtime.esm.js?2b0e:3256
run @ vue.runtime.esm.js?2b0e:3331
flushSchedulerQueue @ vue.runtime.esm.js?2b0e:3087
(anonymous) @ vue.runtime.esm.js?2b0e:1916
flushCallbacks @ vue.runtime.esm.js?2b0e:1835
Promise.then (async)
microTimerFunc @ vue.runtime.esm.js?2b0e:1883
nextTick @ vue.runtime.esm.js?2b0e:1929
queueWatcher @ vue.runtime.esm.js?2b0e:3179
update @ vue.runtime.esm.js?2b0e:3321
notify @ vue.runtime.esm.js?2b0e:712
reactiveSetter @ vue.runtime.esm.js?2b0e:1037
(anonymous) @ vue-router.esm.js?8c4f:2503
(anonymous) @ vue-router.esm.js?8c4f:2502
updateRoute @ vue-router.esm.js?8c4f:1989
(anonymous) @ vue-router.esm.js?8c4f:1867
(anonymous) @ vue-router.esm.js?8c4f:1976
step @ vue-router.esm.js?8c4f:1706
step @ vue-router.esm.js?8c4f:1713
runQueue @ vue-router.esm.js?8c4f:1717
(anonymous) @ vue-router.esm.js?8c4f:1971
step @ vue-router.esm.js?8c4f:1706
(anonymous) @ vue-router.esm.js?8c4f:1710
(anonymous) @ vue-router.esm.js?8c4f:1956
(anonymous) @ vue-router.esm.js?8c4f:1784
iterator @ vue-router.esm.js?8c4f:1935
step @ vue-router.esm.js?8c4f:1709
(anonymous) @ vue-router.esm.js?8c4f:1710
(anonymous) @ vue-router.esm.js?8c4f:1956
Promise.then (async)
beforeEnter @ routes.js?fc18:38
iterator @ vue-router.esm.js?8c4f:1935
step @ vue-router.esm.js?8c4f:1709
(anonymous) @ vue-router.esm.js?8c4f:1710
(anonymous) @ vue-router.esm.js?8c4f:1956
$router.beforeEach @ clientRootMixin.js?d282:13
iterator @ vue-router.esm.js?8c4f:1935
step @ vue-router.esm.js?8c4f:1709
(anonymous) @ vue-router.esm.js?8c4f:1710
(anonymous) @ vue-router.esm.js?8c4f:1956
(anonymous) @ app.js?c4ff:84
iterator @ vue-router.esm.js?8c4f:1935
step @ vue-router.esm.js?8c4f:1709
step @ vue-router.esm.js?8c4f:1713
runQueue @ vue-router.esm.js?8c4f:1717
confirmTransition @ vue-router.esm.js?8c4f:1964
transitionTo @ vue-router.esm.js?8c4f:1866
push @ vue-router.esm.js?8c4f:2176
push @ vue-router.esm.js?8c4f:2529
handler @ vue-router.esm.js?8c4f:444
invoker @ vue.runtime.esm.js?2b0e:2119
fn._withTask.fn._withTask @ vue.runtime.esm.js?2b0e:1904

.vuepress/config.js:

// auto generated sidebar
const { sidebarTree } = require('../code/config');
 
module.exports = {
  dest: 'dist',
  locales: {
    '/': {
      title: 'Cxl Vue Leaflet',
      description: 'Cxl Wrapper of Vue2Leaflet'
    }
  },
  themeConfig: {
    editLinks: true,
    sidebarDepth: 4,
    docsDir: 'code',
    locales: {
      '/': {
        nav: [
          {
            text: 'Home',
            link: '/'
          }
        ],
        // Add the generated sidebar
        sidebar: Object.assign({}, sidebarTree('Details'))
      }
    }
  }
};

Any thoughts?? Thanks

npm audit error: regex DoS in marked

Describe the bug
A nested dependency of this repository is flagged by npm audit: vuepress-jsdoc > jsdoc-to-markdown > dmd > marked
This can be fixed by updating the jsdoc-to-markdown version to the next major release.

To Reproduce
Steps to reproduce the behavior:

  1. Run npm audit

Expected behavior
No vulns returned.

Node (please complete the following information):

  • Node-Version: 15.6.0

Additional context
N.A

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.