documental
Advanced tools
Comparing version 0.2.90 to 0.3.0
@@ -78,2 +78,3 @@ import ts from "typescript"; | ||
if (!exportData) continue; | ||
if (exportData["hide"] !== undefined) continue; | ||
@@ -80,0 +81,0 @@ // TODO: we should exclude from data/exportData any fields whose names match those in type that are non-string values, as well as the field. |
@@ -14,3 +14,3 @@ import ts from "typescript"; | ||
return (typeName === "FunctionComponent" || typeName === "VoidFunctionComponent"); | ||
return (typeName === "FunctionComponent" || typeName === "VoidFunctionComponent" || typeName === "ForwardRefExoticComponent"); | ||
} |
@@ -20,6 +20,6 @@ import ts, { nodeModuleNameResolver } from "typescript"; | ||
const { type } = valueDeclaration; | ||
if (!type) continue; | ||
const { type: typeNode } = valueDeclaration; | ||
if (!typeNode) continue; | ||
const propertyType = typeChecker.getTypeFromTypeNode(type); | ||
const propertyType = typeChecker.getTypeOfSymbolAtLocation(property, valueDeclaration); | ||
const name = property.name; | ||
@@ -30,2 +30,3 @@ const description = parseDescription(typeChecker, property); | ||
let types = [typeChecker.typeToString(propertyType)]; | ||
types[0] = types[0].replace(" | undefined", ""); // Hacky but does the job. Need to investigate the typeToString flags. | ||
@@ -32,0 +33,0 @@ /* |
@@ -35,3 +35,6 @@ import ts from "typescript"; | ||
if (componentType && isComponentType(componentType)) { | ||
const propsType = componentType.aliasTypeArguments?.[0]; | ||
const propsType = (componentType.symbol?.name === "ForwardRefExoticComponent") ? | ||
componentType.aliasTypeArguments?.[1] : | ||
componentType.aliasTypeArguments?.[0]; | ||
const properties = (propsType) ? parseFields(typeChecker, propsType) : []; | ||
@@ -38,0 +41,0 @@ |
{ | ||
"name": "documental", | ||
"version": "0.2.90", | ||
"version": "0.3.00", | ||
"description": "Documental React Component Documentation Generator", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.ts", |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
33840
897
1