Releases: vuedoc/parser
Release list
Add support of .js file component
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
- Add support of Spread Operator #7
- Fix unCamelcase parsing of entry with numbers #15
- Fix filtering of ignoredVisibilities #18
Improve documentation
This release just improves the documentation with more samples
Parsing control with options.features
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
This release add the support of Computed Getters
Add support of component.data and computed properties
- Add support of
component.dataparsing - Add support of computed properties #6
- Add a features section and update the documentation
Keywords Extraction Feature
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