fix: resolve type errors for CI checks

This commit is contained in:
saberzero1 2026-02-23 02:28:08 +01:00
parent c5ce7ccaa2
commit c53929b04d
No known key found for this signature in database
3 changed files with 34 additions and 9 deletions

View File

@ -70,6 +70,15 @@ declare module "vfile" {
blocks: Record<string, Element>
htmlAst: HtmlRoot
hasMermaidDiagram: boolean | undefined
// from frontmatter transformer (e.g. note-properties)
frontmatter: {
title: string
tags: string[]
description?: string
socialDescription?: string
lang?: string
[key: string]: unknown
}
// from created-modified-date transformer
dates: {
created: Date

View File

@ -144,7 +144,8 @@ async function resolveSinglePlugin(
pluginSource = "git"
}
} else if ("plugin" in specifier) {
const type = specifier.manifest?.category ?? "transformer"
const rawType = specifier.manifest?.category ?? "transformer"
const type = Array.isArray(rawType) ? rawType[0] : rawType
return {
plugin: {
plugin: specifier.plugin as QuartzTransformerPlugin,
@ -153,10 +154,10 @@ async function resolveSinglePlugin(
displayName: specifier.manifest?.displayName ?? "Inline Plugin",
description: specifier.manifest?.description ?? "Inline plugin instance",
version: specifier.manifest?.version ?? "1.0.0",
category: type as "transformer" | "filter" | "emitter",
category: rawType,
...specifier.manifest,
} as PluginManifest,
type: type as "transformer" | "filter" | "emitter",
type,
source: "inline",
},
error: null,
@ -184,9 +185,9 @@ async function resolveSinglePlugin(
manifest = importedManifest ?? {}
const detectedType = manifest.category ?? detectPluginType(module)
const categoryOrCategories = manifest.category ?? detectPluginType(module)
if (!detectedType) {
if (!categoryOrCategories) {
return {
plugin: null,
error: {
@ -197,6 +198,11 @@ async function resolveSinglePlugin(
}
}
// Normalize to single category for factory extraction (use primary/first category)
const detectedType = Array.isArray(categoryOrCategories)
? categoryOrCategories[0]
: categoryOrCategories
const factory = extractPluginFactory(module, detectedType)
if (!factory) {
@ -263,9 +269,9 @@ async function resolveSinglePlugin(
await loadComponentsFromPackage(packageName, manifest as PluginManifest)
}
const detectedType = manifest.category ?? detectPluginType(importedModule)
const categoryOrCategories = manifest.category ?? detectPluginType(importedModule)
if (!detectedType) {
if (!categoryOrCategories) {
return {
plugin: null,
error: {
@ -276,6 +282,11 @@ async function resolveSinglePlugin(
}
}
// Normalize to single category for factory extraction (use primary/first category)
const detectedType = Array.isArray(categoryOrCategories)
? categoryOrCategories[0]
: categoryOrCategories
if (
manifest.quartzVersion &&
!satisfiesVersion(manifest.quartzVersion, options.quartzVersion)
@ -289,7 +300,6 @@ async function resolveSinglePlugin(
},
}
}
const factory = extractPluginFactory(importedModule, detectedType)
if (!factory) {

View File

@ -18,5 +18,11 @@
"jsxImportSource": "preact"
},
"include": ["quartz/**/*.ts", "quartz/**/*.tsx", "*.ts", "*.tsx", "./package.json"],
"exclude": ["build/**/*.d.ts", ".quartz/**/src/**", ".quartz/**/test/**", "node_modules/**"]
"exclude": [
"build/**/*.d.ts",
".quartz/**/src/**",
".quartz/**/test/**",
"node_modules/**",
"quartz/cli/tui/**"
]
}