From 96859c98e59a6981b9478284f9ef13774157af16 Mon Sep 17 00:00:00 2001 From: Alexander Kucera Date: Sat, 8 Nov 2025 18:46:39 +0100 Subject: [PATCH] Renames dependency check method for clarity Updates method name from 'checkDependenciesAsync' to 'checkDependenciesOnStartup' to better reflect its purpose of verifying dependencies during plugin startup. Enhances code readability and maintainability. --- main.ts | 4 ++-- src/core/DependencyChecker.ts | 5 ++--- src/plugin/PluginLifecycle.ts | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/main.ts b/main.ts index 78af671..ca2cc3c 100644 --- a/main.ts +++ b/main.ts @@ -178,8 +178,8 @@ export class obsidianTypstPDFExport extends Plugin { ); } - checkDependenciesAsync(): void { - DependencyChecker.checkDependenciesAsync( + checkDependenciesOnStartup(): void { + DependencyChecker.checkDependenciesOnStartup( this.settings.pandocPath, this.settings.typstPath, this.settings.executablePaths?.imagemagickPath, diff --git a/src/core/DependencyChecker.ts b/src/core/DependencyChecker.ts index 413e95b..151a3a6 100644 --- a/src/core/DependencyChecker.ts +++ b/src/core/DependencyChecker.ts @@ -321,7 +321,6 @@ ${dependencyResult.allAvailable * @param typstPath - Optional custom path to Typst executable * @param imagemagickPath - Optional custom path to ImageMagick convert executable * @param additionalPaths - Additional directories to search for executables - * @returns Promise that resolves when the check is complete * * @example * ```typescript @@ -331,7 +330,7 @@ ${dependencyResult.allAvailable * await this.loadSettings(); * * // Silent startup check - only shows notice if problems exist - * await DependencyChecker.checkDependenciesAsync( + * DependencyChecker.checkDependenciesOnStartup( * this.settings.pandocPath, * this.settings.typstPath, * this.settings.imagemagickPath, @@ -348,7 +347,7 @@ ${dependencyResult.allAvailable * // Run 'Check Dependencies' command for details." * ``` */ - public static checkDependenciesAsync( + public static checkDependenciesOnStartup( pandocPath?: string, typstPath?: string, imagemagickPath?: string, diff --git a/src/plugin/PluginLifecycle.ts b/src/plugin/PluginLifecycle.ts index 2f7444d..057a95c 100644 --- a/src/plugin/PluginLifecycle.ts +++ b/src/plugin/PluginLifecycle.ts @@ -53,7 +53,7 @@ export class PluginLifecycle { this.cleanupStartupTempDirectories(); // Check dependencies on startup - this.plugin.checkDependenciesAsync(); + this.plugin.checkDependenciesOnStartup(); // Cache available fonts (async, don't await) void this.plugin.cacheAvailableFonts();