@maverick-js/compiler
Advanced tools
Comparing version 0.14.0 to 0.15.0
@@ -94,3 +94,3 @@ import ts from 'typescript'; | ||
} | ||
interface TagNameMeta { | ||
interface TagMeta { | ||
[TS_NODE]: ts.Node; | ||
@@ -103,2 +103,6 @@ name: string; | ||
} | ||
interface DefinitionMeta { | ||
[TS_NODE]: ts.VariableDeclaration; | ||
name: string; | ||
} | ||
interface ComponentMeta extends Record<string, unknown> { | ||
@@ -108,3 +112,4 @@ [TS_NODE]: ts.Node; | ||
name: string; | ||
tagname: TagNameMeta; | ||
tag: TagMeta; | ||
definition: DefinitionMeta; | ||
shadow?: boolean; | ||
@@ -129,3 +134,3 @@ docs?: string; | ||
name: string; | ||
tagName: ComponentMeta['tagname']; | ||
tag: TagMeta; | ||
statement: ts.VariableStatement; | ||
@@ -215,2 +220,2 @@ variable: ts.VariableDeclaration; | ||
export { AnalyzePlugin, AnalyzePluginBuilder, CSSPartMeta, CSSVarMeta, ComponentMeta, DocTagMeta, ElementDefintionNode, EventMeta, FileMeta, HTMLDataV1, IAttributeData, IReference, ITagData, IValueData, IValueSet, JSONPluginConfig, JSONPluginOutput, MembersMeta, MethodMeta, ParameterMeta, PropMeta, SlotMeta, TS_NODE, TagNameMeta, TypeMeta, VSCodePluginConfig, createJSONPlugin, createVSCodePlugin }; | ||
export { AnalyzePlugin, AnalyzePluginBuilder, CSSPartMeta, CSSVarMeta, ComponentMeta, DefinitionMeta, DocTagMeta, ElementDefintionNode, EventMeta, FileMeta, HTMLDataV1, IAttributeData, IReference, ITagData, IValueData, IValueSet, JSONPluginConfig, JSONPluginOutput, MembersMeta, MethodMeta, ParameterMeta, PropMeta, SlotMeta, TS_NODE, TagMeta, TypeMeta, VSCodePluginConfig, createJSONPlugin, createVSCodePlugin }; |
@@ -56,6 +56,6 @@ import { resolveConfigPaths, escapeQuotes, TS_NODE } from './chunks/chunk-BIOVNH5X.js'; | ||
}; | ||
components.filter((component) => !isUndefined(component.tagname)).forEach((component) => { | ||
components.filter((component) => !isUndefined(component.tag)).forEach((component) => { | ||
var _a, _b; | ||
const tagData = { | ||
name: component.tagname.name, | ||
name: component.tag.name, | ||
description: component.docs, | ||
@@ -62,0 +62,0 @@ attributes: (component.props ?? []).filter((prop) => !!prop.attribute && !prop.readonly && !prop.internal).map((prop) => { |
@@ -513,2 +513,3 @@ import { TS_NODE, resolvePath, resolveConfigPaths, resolveCorePkgName, camelToKebabCase } from './chunks/chunk-BIOVNH5X.js'; | ||
function buildPropsMeta(checker, declarationRoot, typeRoot) { | ||
var _a; | ||
if (!typeRoot) | ||
@@ -525,3 +526,3 @@ return; | ||
if (definition) { | ||
info.value = getPropertyAssignmentValue(checker, definition, "initial"); | ||
info.value = ((_a = getPropertyAssignmentValue(checker, definition, "initial")) == null ? void 0 : _a.getText()) ?? "undefined"; | ||
const attr = getValueNode( | ||
@@ -574,3 +575,3 @@ checker, | ||
if (!$default && (info == null ? void 0 : info.value)) { | ||
$default = info.value.getText(); | ||
$default = info.value; | ||
} | ||
@@ -672,3 +673,7 @@ return { | ||
name: def.name, | ||
tagname: def.tagName, | ||
tag: def.tag, | ||
definition: { | ||
[TS_NODE]: def.variable, | ||
name: def.variable.name.getText() | ||
}, | ||
file: buildFileMeta(def.statement), | ||
@@ -733,3 +738,3 @@ shadow: buildShadowRootMeta(checker, def.declaration), | ||
name: rootType.name.escapedText, | ||
tagName: { | ||
tag: { | ||
[TS_NODE]: tagNameNode, | ||
@@ -839,5 +844,3 @@ name: tagName.text | ||
log( | ||
`${formatPluginName(plugin.name)} built meta for ${kleur5.blue( | ||
component.tagname.name ?? "" | ||
)}`, | ||
`${formatPluginName(plugin.name)} built meta for ${kleur5.blue(component.tag.name ?? "")}`, | ||
4 /* Verbose */ | ||
@@ -844,0 +847,0 @@ ); |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "0.14.0", | ||
"version": "0.15.0", | ||
"type": "module", | ||
@@ -8,0 +8,0 @@ "module": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
237906
6592