Skip to content

Releases: vuedoc/parser

Add support of .js file component

Choose a tag to compare

@demsking demsking released this 10 Feb 09:35

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)
})

Spread Operator Support

Choose a tag to compare

@demsking demsking released this 04 Nov 08:07
  • Add support of Spread Operator #7
  • Fix unCamelcase parsing of entry with numbers #15
  • Fix filtering of ignoredVisibilities #18

Improve documentation

Choose a tag to compare

@demsking demsking released this 01 Nov 16:00

This release just improves the documentation with more samples

Parsing control with options.features

Choose a tag to compare

@demsking demsking released this 01 Nov 15:44

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.

Fully Support of Computed Properties

Choose a tag to compare

@demsking demsking released this 31 Oct 05:14

This release add the support of Computed Getters

Add support of component.data and computed properties

Choose a tag to compare

@demsking demsking released this 22 Oct 08:19
  • Add support of component.data parsing
  • Add support of computed properties #6
  • Add a features section and update the documentation

Keywords Extraction Feature

Choose a tag to compare

@demsking demsking released this 23 Sep 15:24

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