feat: add runtime plugin externals validation and native dep install

- validatePluginExternals() scans plugin dist/ for unbundled imports
  and warns when non-allowlisted externals are detected
- installPluginDepsIfNeeded() runs npm install for plugins with
  quartz.requiresInstall flag (for native deps like sharp)
- Added requiresInstall field to PluginManifest type
This commit is contained in:
saberzero1
2026-03-17 19:46:42 +01:00
parent a932000421
commit d792d8ebf9
3 changed files with 146 additions and 0 deletions
+3
View File
@@ -20,6 +20,7 @@ import {
getPluginEntryPoint,
toFileUrl,
isLocalSource,
validatePluginExternals,
} from "./gitLoader"
const MINIMUM_QUARTZ_VERSION = "4.5.0"
@@ -191,6 +192,8 @@ async function resolveSinglePlugin(
const module = await import(toFileUrl(entryPoint))
const importedManifest: PluginManifest | null = module.manifest ?? null
validatePluginExternals(gitSpec.name, entryPoint, { verbose: options.verbose })
manifest = importedManifest ?? {}
const categoryOrCategories = manifest.category ?? detectPluginType(module)