Vuedoc Parser Versions Save

Generate a JSON documentation for a SFC Vue component. Contribute: https://gitlab.com/vuedoc/parser#contribute

v1.1.0

6 years ago

The vuedoc/parser is now able to parse a JS file component. This enhancement closes the #21

const parser = require('@vuedoc/parser')

const options = {
  filename: 'components/checkbox.js'
}

parser.parse(options).then((component) => {
  console.log(component)
})

v1.0.2

6 years ago
  • Add support of Spread Operator #7
  • Fix unCamelcase parsing of entry with numbers #15
  • Fix filtering of ignoredVisibilities #18

v1.0.1

6 years ago

This release just improves the documentation with more samples

v1.0.0

6 years ago

This major release add a new feature and uses the NodeJS v6.11.2 as default engine.

New option: options.features

The new options.features lets you select which Vue Features you want to parse and extract. The default value is define by Parser.SUPPORTED_FEATURES array.

Usage Only parse name, props, computed properties and events:

const vuedoc = require('@vuedoc/parser')
const options = {
  filename: 'test/fixtures/checkbox.vue',
  features: [ 'name', 'props', 'computed', 'events' ]
}

vuedoc.parse(options)
  .then((component) => console.log(component)) // => { name, props, computed, events }
  .catch((err) => console.error(err))

Parse all features except data:

const vuedoc = require('@vuedoc/parser')
const Parser = require('@vuedoc/parser/lib/parser')

const options = {
  filename: 'test/fixtures/checkbox.vue',
  features: Parser.SUPPORTED_FEATURES.filter((feature) => feature !== 'data')
}

vuedoc.parse(options)
  .then((component) => console.log(component)) // => { name, description, keywords, props, computed, events, methods }
  .catch((err) => console.error(err))

Bug fix

There was a bug when the given component file didn't have a script entry. In this case, the parser was not able to emit the end event. This is now fixed.

NodeJS v6.11.2

Now @vuedoc/parser requires the v6.11.2 (or higher) of NodeJS.

v0.6.2

6 years ago

This release add the support of Computed Getters

v0.6.0

6 years ago
  • Add support of component.data parsing
  • Add support of computed properties #6
  • Add a features section and update the documentation

v0.5.0

6 years ago

This new release introduces Keywords Extraction Feature. This enable to attach keywords to a comment and then extract them using the parser.

Decoration:

/**
 * Component description
 * 
 * @author Sébastien
 * @license MIT
 */
export default {
  name: 'my-checkbox',
  created () {
    /**
     * @param boolean
     */
    this.$emit('created', true)
  }
}

Parsing result:

{
  "name": "my-checkbox",
  "description": "Component description",
  "keywords": [
    {
      "name": "author",
      "description": "Sébastien"
    },
    {
      "name": "license",
      "description": "MIT"
    }
  ],
  "props": [],
  "methods": [],
  "events": [
    {
      "name": "created",
      "description": "",
      "visibility": "public",
      "keywords": [
        {
          "name": "param",
          "description": "boolean"
        }
      ]
    }
  ],
  "slots": []
}

This release also fixes some issues:

  • Fix missing component name parsing with only template parsing
  • Fix missing defaultMethodVisibility option on getComment call
  • Fix issue on unCamelcase with a string containing -
  • Enable parsing of component with just as entry