How philoserf/obsidian-vault-changelog works
This project is an Obsidian Vault Changelog Plugin designed to track and update a central changelog of recently edited notes within an Obsidian vault. The plugin supports both manual and automatic triggers for updating the changelog note.
Main components
• Plugin Manifest: Represented by the manifest.json file, which defines the metadata for the plugin.
• Core Plugin Logic: The plugin’s main functionality is implemented in the TypeScript source files located in the src folder (main.ts, settings.ts, and suggest.ts). These files handle initialization, settings configuration, and changelog suggestions.
• Plugin Settings: Managed by the settings module, which interacts with user-defined options (e.g., file paths, auto update flag, datetime format, max recent files, and excluded folders).
• Command and Event Handlers: Include the manual command for updating the changelog (“Vault Changelog: Update”) and the automatic event triggers (file modifications).
• Build & Configuration Infrastructure: Files like build.mjs, package.json, bun.lock, bunfig.toml, tsconfig.json, and eslint.config.mjs indicate the use of a bundler (Bun) and TypeScript, ensuring the plugin is compiled and linted appropriately.
• Test Environment: The test-vault directory simulates an Obsidian vault for testing purposes. This includes sample Obsidian configuration and a simulated vault environment to verify the plugin’s behavior.
Relationships and interactions
• The Obsidian environment loads the plugin using information from the manifest.json.
• Once loaded, the main module (from src/main.ts) initializes the plugin, setting up event listeners that trigger changelog updates when files are edited.
• Plugin settings, managed by src/settings.ts, allow customization of file paths and update behaviors.
• A command from the Obsidian command palette (or an automatic trigger) invokes functionality defined in the plugin core.
• The test vault is used during development to ensure that the plugin behaves as intended within an actual Obsidian-like environment.
Architectural patterns or design principles
• Modularity is emphasized by separating the plugin’s core functions, settings, and suggestion logic into multiple dedicated modules.
• Event-driven design: The system listens for file change events to trigger automatic updates.
• Clear separation between configuration (manifest, settings) and implementation (source code).
Relevant technologies and frameworks
• Language/Transpiler: TypeScript (as seen by tsconfig.json).
• Bundler/Runtime: Bun (bun.lock, bunfig.toml, and build.mjs).
• Linting: ESLint (eslint.config.mjs).
• Target Integration: The Obsidian application environment via its plugin API.
Elements
• Clear labels for each component (e.g., “Manifest”, “Core Logic”, “Settings”, “Test Environment”).