vue-docgen-api
Advanced tools
Comparing version 4.35.0 to 4.36.0
@@ -6,2 +6,20 @@ # Change Log | ||
# [4.36.0](https://github.com/vue-styleguidist/vue-styleguidist/compare/v4.35.0...v4.36.0) (2021-03-18) | ||
### Bug Fixes | ||
* updrade react-stypeguidist ([4823bd2](https://github.com/vue-styleguidist/vue-styleguidist/commit/4823bd2be1d1f2fa1e39d7142da7cb15ab16b43c)) | ||
* **docgen:** ensure pug renders template using html doctype ([2f3512b](https://github.com/vue-styleguidist/vue-styleguidist/commit/2f3512b7951889c8fa72856655725b62bd4e81fb)) | ||
* **docgen:** html doctype as a default rather than a force ([01c921f](https://github.com/vue-styleguidist/vue-styleguidist/commit/01c921f8054607b9e0d99c0f87a4820fe8dedc2d)) | ||
### Features | ||
* **docgen:** allow slots to be defined by composition API render functions ([63f2f35](https://github.com/vue-styleguidist/vue-styleguidist/commit/63f2f352435f95fc55e3598c877c33383909e933)) | ||
# [4.35.0](https://github.com/vue-styleguidist/vue-styleguidist/compare/v4.34.4...v4.35.0) (2021-01-26) | ||
@@ -8,0 +26,0 @@ |
@@ -44,3 +44,3 @@ "use strict"; | ||
var source_1 = tpl.attrs && tpl.attrs.lang === 'pug' | ||
? pug.render(tpl.content.trim(), __assign(__assign({}, pugOptions), { filename: filePath })) | ||
? pug.render(tpl.content.trim(), __assign(__assign({ doctype: 'html' }, pugOptions), { filename: filePath })) | ||
: tpl.content; | ||
@@ -47,0 +47,0 @@ var ast_1 = cacher_1.default(function () { return compiler_dom_1.parse(source_1, { comments: true }); }, source_1); |
@@ -7,3 +7,3 @@ import { NodePath } from 'ast-types/lib/node-path'; | ||
/** | ||
* Extract slots information form the render function of an object-style VueJs component | ||
* Extract slots information from the render or setup function of an object-style VueJs component | ||
* @param documentation | ||
@@ -10,0 +10,0 @@ * @param path |
@@ -30,3 +30,3 @@ "use strict"; | ||
/** | ||
* Extract slots information form the render function of an object-style VueJs component | ||
* Extract slots information from the render or setup function of an object-style VueJs component | ||
* @param documentation | ||
@@ -38,7 +38,9 @@ * @param path | ||
var renderPath = getProperties_1.default(path, 'render'); | ||
if (!renderPath.length) { | ||
var setupPath = getProperties_1.default(path, 'setup'); | ||
if (!renderPath.length && !setupPath.length) { | ||
return Promise.resolve(); | ||
} | ||
var functionPath = renderPath.length ? renderPath : setupPath; | ||
var i = 0; | ||
var docBlock = getDocblock_1.default(renderPath[0], { commentIndex: i }); | ||
var docBlock = getDocblock_1.default(functionPath[0], { commentIndex: i }); | ||
while (docBlock) { | ||
@@ -62,3 +64,3 @@ // if no doc block return | ||
} | ||
docBlock = getDocblock_1.default(renderPath[0], { commentIndex: ++i }); | ||
docBlock = getDocblock_1.default(functionPath[0], { commentIndex: ++i }); | ||
} | ||
@@ -65,0 +67,0 @@ } |
@@ -59,4 +59,6 @@ "use strict"; | ||
specifiersPath.each(function (specifier) { | ||
defs.set(specifier.node.exported.name, bt.isExportSpecifier(specifier.node) ? specifier.get('local') : specifier.get('exported')); | ||
if (bt.isIdentifier(specifier.node.exported)) { | ||
defs.set(specifier.node.exported.name, bt.isExportSpecifier(specifier.node) ? specifier.get('local') : specifier.get('exported')); | ||
} | ||
}); | ||
} |
@@ -41,3 +41,5 @@ "use strict"; | ||
var varName = s.node.local.name; | ||
var exportName = bt.isImportSpecifier(s.node) ? s.node.imported.name : 'default'; | ||
var exportName = bt.isImportSpecifier(s.node) && bt.isIdentifier(s.node.imported) | ||
? s.node.imported.name | ||
: 'default'; | ||
importedVariablePaths[varName] = { filePath: [filePath], exportName: exportName }; | ||
@@ -57,6 +59,8 @@ }); | ||
specifiers.each(function (s) { | ||
var varName = s.node.exported.name; | ||
var exportName = s.node.local ? s.node.local.name : varName; | ||
if (variableFilter.indexOf(varName) > -1) { | ||
variables[varName] = { filePath: [filePath_1], exportName: exportName }; | ||
if (bt.isIdentifier(s.node.exported)) { | ||
var varName = s.node.exported.name; | ||
var exportName = s.node.local ? s.node.local.name : varName; | ||
if (variableFilter.indexOf(varName) > -1) { | ||
variables[varName] = { filePath: [filePath_1], exportName: exportName }; | ||
} | ||
} | ||
@@ -67,7 +71,9 @@ }); | ||
specifiers.each(function (s) { | ||
var varName = s.node.exported.name; | ||
var middleName = s.node.local.name; | ||
var importedVar = importedVariablePaths[middleName]; | ||
if (importedVar && variableFilter.indexOf(varName) > -1) { | ||
variables[varName] = importedVar; | ||
if (bt.isIdentifier(s.node.exported)) { | ||
var varName = s.node.exported.name; | ||
var middleName = s.node.local.name; | ||
var importedVar = importedVariablePaths[middleName]; | ||
if (importedVar && variableFilter.indexOf(varName) > -1) { | ||
variables[varName] = importedVar; | ||
} | ||
} | ||
@@ -74,0 +80,0 @@ }); |
@@ -41,3 +41,5 @@ "use strict"; | ||
? 'default' | ||
: nodeSpecifier.imported.name; | ||
: bt.isIdentifier(nodeSpecifier.imported) | ||
? nodeSpecifier.imported.name | ||
: 'default'; | ||
if (!varNameFilter || varNameFilter.indexOf(localVariableName) > -1) { | ||
@@ -44,0 +46,0 @@ var nodeSource = astPath.get('source').node; |
{ | ||
"name": "vue-docgen-api", | ||
"version": "4.35.0", | ||
"version": "4.36.0", | ||
"description": "Toolbox to extract information from Vue component files for documentation generation purposes.", | ||
@@ -53,3 +53,3 @@ "homepage": "https://vue-styleguidist.github.io", | ||
}, | ||
"gitHead": "bdfa2a363cffd2ef9f9462b8b4cf0b89d8a8c6fa" | ||
"gitHead": "7cc91aff85e8b458db76a74c9ea6503cef515300" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
318509
5496