Enforces minimum version checks for dependencies #9

Merged
AlexKucera merged 2 commits from version_checker into master 2025-11-09 18:28:16 +01:00
AlexKucera commented 2025-11-09 18:03:00 +01:00 (Migrated from github.com)

Updates the README with specific minimum version requirements
for dependencies. Implements logic to check installed
dependencies against these minimum versions, issuing
warnings for outdated versions. Introduces utilities to
compare version strings for accurate validation.

This ensures compatibility and stability by guiding users
to update necessary tools for optimal performance.

Relates to version control and dependency management.

Summary by CodeRabbit

  • New Features

    • Dependencies are now checked against explicit minimum version requirements.
    • Plugin displays warnings when installed versions fall below minimum thresholds for Pandoc, Typst, and ImageMagick.
  • Documentation

    • README updated with a minimum-version table and a note about outdated-version warnings.
    • Dependency Verification, Troubleshooting, Quick Start, and External Dependencies sections updated to reference minimum-version guidance.
  • UX

    • Dependency status messages and progress notice updated for clearer guidance.
Updates the README with specific minimum version requirements for dependencies. Implements logic to check installed dependencies against these minimum versions, issuing warnings for outdated versions. Introduces utilities to compare version strings for accurate validation. This ensures compatibility and stability by guiding users to update necessary tools for optimal performance. Relates to version control and dependency management. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Dependencies are now checked against explicit minimum version requirements. * Plugin displays warnings when installed versions fall below minimum thresholds for Pandoc, Typst, and ImageMagick. * **Documentation** * README updated with a minimum-version table and a note about outdated-version warnings. * Dependency Verification, Troubleshooting, Quick Start, and External Dependencies sections updated to reference minimum-version guidance. * **UX** * Dependency status messages and progress notice updated for clearer guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
coderabbitai[bot] commented 2025-11-09 18:03:09 +01:00 (Migrated from github.com)

Walkthrough

Adds minimum-version support to dependency checks: introduces version utilities, declares minimum version constants, propagates minimumVersion and meetsMinimumVersion through executable checks, surfaces outdatedDependencies in results and UI, and updates README to document minimum requirements.

Changes

Cohort / File(s) Summary
Documentation
README.md
Replaced simple dependency lists with a table including Minimum Version column; added note about outdated-version warnings; updated Quick Start, Dependency Verification and Troubleshooting to reference minimum-version requirements.
Version utilities
src/utils/versionUtils.ts
New module adding compareVersions() and isVersionAtLeast() for numeric semantic-version comparison (ignores pre-release/build metadata after first -/+).
Constants
src/core/constants.ts
Added MINIMUM_VERSIONS to DEPENDENCY_CONSTANTS with pandoc: '3.7.0', typst: '0.13.0', imagemagick: '7.1.2'.
Executable checks
src/core/ExecutableChecker.ts
Extended DependencyInfo with meetsMinimumVersion: boolean and `minimumVersion: string
Dependency orchestration & UI
src/core/DependencyChecker.ts
Added outdatedDependencies: string[] to DependencyCheckResult; checkAllDependencies() computes outdated list; showDependencyStatus() updated to include minimum-version notes and contextual messages; notice duration increased from 12s to 15s; regexes made case-insensitive.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Client
    participant DependencyChecker
    participant ExecutableChecker
    participant VersionUtils

    Client->>DependencyChecker: checkAllDependencies()
    DependencyChecker->>ExecutableChecker: checkDependency(name, minimumVersion)
    ExecutableChecker->>ExecutableChecker: detect version (stdout)
    ExecutableChecker->>VersionUtils: isVersionAtLeast(actual, minimum)
    VersionUtils->>VersionUtils: compareVersions(actual, minimum)
    VersionUtils-->>ExecutableChecker: boolean (meetsMinimum)
    ExecutableChecker-->>DependencyChecker: DependencyInfo{isAvailable, version, minimumVersion, meetsMinimumVersion}
    DependencyChecker->>DependencyChecker: collect missing & outdatedDependencies
    DependencyChecker->>DependencyChecker: format statusLines (include minimums)
    DependencyChecker-->>Client: DependencyCheckResult{missingDependencies, outdatedDependencies, allAvailable}

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

  • Pay extra attention to:
    • src/utils/versionUtils.ts: edge cases in compareVersions() (padding segments, non-numeric suffix handling).
    • src/core/ExecutableChecker.ts: ensure minimumVersion is correctly threaded through sync/async paths and error branches.
    • src/core/DependencyChecker.ts: status message composition, case-insensitive regex behavior, and notice duration change.

Possibly related PRs

  • AlexKucera/obsidian-typst-pdf-export#7 — modifies the same dependency-checking paths (DependencyChecker, ExecutableChecker, constants) and appears directly related to minimum-version handling.

Poem

🐰 I hop through code with ear alert,

checking versions, not just dirt.
Minimum marks I gently keep,
so builds stay swift and bugs don't creep.
A tiny hop — dependencies meet!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately summarizes the main change: enforcing minimum version checks for dependencies, which is reflected across README documentation updates and TypeScript implementation changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch version_checker

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5ca5d1e47 and d078215361.

📒 Files selected for processing (1)
  • src/core/DependencyChecker.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/core/DependencyChecker.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

<!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- walkthrough_start --> ## Walkthrough Adds minimum-version support to dependency checks: introduces version utilities, declares minimum version constants, propagates minimumVersion and meetsMinimumVersion through executable checks, surfaces outdatedDependencies in results and UI, and updates README to document minimum requirements. ## Changes | Cohort / File(s) | Summary | |---|---| | **Documentation** <br> `README.md` | Replaced simple dependency lists with a table including Minimum Version column; added note about outdated-version warnings; updated Quick Start, Dependency Verification and Troubleshooting to reference minimum-version requirements. | | **Version utilities** <br> `src/utils/versionUtils.ts` | New module adding `compareVersions()` and `isVersionAtLeast()` for numeric semantic-version comparison (ignores pre-release/build metadata after first `-`/`+`). | | **Constants** <br> `src/core/constants.ts` | Added `MINIMUM_VERSIONS` to `DEPENDENCY_CONSTANTS` with `pandoc: '3.7.0'`, `typst: '0.13.0'`, `imagemagick: '7.1.2'`. | | **Executable checks** <br> `src/core/ExecutableChecker.ts` | Extended `DependencyInfo` with `meetsMinimumVersion: boolean` and `minimumVersion: string | null`; `checkDependency()` gains `minimumVersion` parameter and uses `isVersionAtLeast()` to compute compliance. | | **Dependency orchestration & UI** <br> `src/core/DependencyChecker.ts` | Added `outdatedDependencies: string[]` to `DependencyCheckResult`; `checkAllDependencies()` computes outdated list; `showDependencyStatus()` updated to include minimum-version notes and contextual messages; notice duration increased from 12s to 15s; regexes made case-insensitive. | ## Sequence Diagram(s) ```mermaid sequenceDiagram autonumber participant Client participant DependencyChecker participant ExecutableChecker participant VersionUtils Client->>DependencyChecker: checkAllDependencies() DependencyChecker->>ExecutableChecker: checkDependency(name, minimumVersion) ExecutableChecker->>ExecutableChecker: detect version (stdout) ExecutableChecker->>VersionUtils: isVersionAtLeast(actual, minimum) VersionUtils->>VersionUtils: compareVersions(actual, minimum) VersionUtils-->>ExecutableChecker: boolean (meetsMinimum) ExecutableChecker-->>DependencyChecker: DependencyInfo{isAvailable, version, minimumVersion, meetsMinimumVersion} DependencyChecker->>DependencyChecker: collect missing & outdatedDependencies DependencyChecker->>DependencyChecker: format statusLines (include minimums) DependencyChecker-->>Client: DependencyCheckResult{missingDependencies, outdatedDependencies, allAvailable} ``` ## Estimated code review effort 🎯 3 (Moderate) | ⏱️ ~30 minutes - Pay extra attention to: - `src/utils/versionUtils.ts`: edge cases in `compareVersions()` (padding segments, non-numeric suffix handling). - `src/core/ExecutableChecker.ts`: ensure `minimumVersion` is correctly threaded through sync/async paths and error branches. - `src/core/DependencyChecker.ts`: status message composition, case-insensitive regex behavior, and notice duration change. ## Possibly related PRs - AlexKucera/obsidian-typst-pdf-export#7 — modifies the same dependency-checking paths (`DependencyChecker`, `ExecutableChecker`, constants) and appears directly related to minimum-version handling. ## Poem > 🐰 I hop through code with ear alert, > > checking versions, not just dirt. > > Minimum marks I gently keep, > > so builds stay swift and bugs don't creep. > > A tiny hop — dependencies meet! <!-- walkthrough_end --> <!-- pre_merge_checks_walkthrough_start --> ## Pre-merge checks and finishing touches <details> <summary>✅ Passed checks (3 passed)</summary> | Check name | Status | Explanation | | :----------------: | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. | | Title check | ✅ Passed | The title directly and accurately summarizes the main change: enforcing minimum version checks for dependencies, which is reflected across README documentation updates and TypeScript implementation changes. | | Docstring Coverage | ✅ Passed | Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. | </details> <!-- pre_merge_checks_walkthrough_end --> <!-- finishing_touch_checkbox_start --> <details> <summary>✨ Finishing touches</summary> - [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate docstrings <details> <summary>🧪 Generate unit tests (beta)</summary> - [ ] <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create PR with unit tests - [ ] <!-- {"checkboxId": "07f1e7d6-8a8e-4e23-9900-8731c2c87f58", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Post copyable unit tests in a comment - [ ] <!-- {"checkboxId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Commit unit tests in branch `version_checker` </details> </details> <!-- finishing_touch_checkbox_end --> --- <details> <summary>📜 Recent review details</summary> **Configuration used**: CodeRabbit UI **Review profile**: CHILL **Plan**: Pro <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between b5ca5d1e47df5a6011c9522cd9d7d9f7c54e79b6 and d078215361af046b3bb2f84d8b073df57e9baac2. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `src/core/DependencyChecker.ts` (3 hunks) </details> <details> <summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary> * src/core/DependencyChecker.ts </details> </details> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=AlexKucera/obsidian-typst-pdf-export&utm_content=9)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub> <!-- tips_end --> <!-- internal state start --> <!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrI5Ho6gDYkuAUQwAZvgUDNKQzPAY8MyOkFIUiPD4WAywogDWyEF8StxkShgM8GEA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h4lLyNkHCJFa0Qh99ewdILcvIegKAeepQGwFQWWk5ZABAIgWAMAbwKQEiCW+QVAMgXZH7LyAR8+gfEgQhrHLsYx6hwRhq0GBMd9RhtgQh7aVh5FcBTVAAXwEdoboa8gYaYa4C8jAbhUgZMcAZ4b4fQbocAeEcwG7kIdvC/C8C8WFjEEOKVRrWzWwnkAlvgCrJ2gLCzHIVIC4DIGyCKBcXRyixl3mJZTMV1AQFSDO1h1EhugejzGQBck1G1G9M7idEB1xKVTXJIA3KQbJP9BFgGeOshPHmsZia8kjwGnceArs3Ca8jMYsbdysfWZGCHmNGfBGHvrQfWbsciAcbQScfMaCcFO8A8eJW8Zsd8a4YCecaCffos0gHnviBonmb8cia4D/vWbidEeSGYbGk+aYB+dIDOwWCmGjPhYAFJGmTRutUAHAOqvR6TpsP5pK7QRhxZYBk06YkKztY6EWphEWNA/muHNmgnLG1ZTmdx7HPBHHAnAHvSLNeGbHPH/0OFiGmdbAWGkGxGgmAhYyK7gkQ6i7VA7a0BZhKgXaSBdhZgpgGBc7S6GAFgLbY6NhHaNgdhKgNgBBZg7bKgdgA6dg/bY7mpaAGAzWXapgSAJg7bY6/mvISHcBbAQnrmOXZhra7aLa3aLaNFc67aGANFmQAhi67baALaGB4XaAk7dXEoC0BBzXaBM6EUg3s7A6phC6GBY60BS6dhRAdgJh3XOXIMiBvnlBSAJCoYExKkxgj7nmIn3rDzcbyx8bzzW2bHz6CBapPBzijqWYj6Jh1mQbL1ktMQPnq3eGuAJgeX/1eXeW66oAu6e6+7amnh277IgA== --> <!-- internal state end -->
coderabbitai[bot] (Migrated from github.com) reviewed 2025-11-09 18:07:40 +01:00
coderabbitai[bot] (Migrated from github.com) left a comment

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a69cf31951 and b5ca5d1e47.

📒 Files selected for processing (5)
  • README.md (3 hunks)
  • src/core/DependencyChecker.ts (3 hunks)
  • src/core/ExecutableChecker.ts (7 hunks)
  • src/core/constants.ts (1 hunks)
  • src/utils/versionUtils.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.ts: Organize code into multiple files under src/ (commands/, ui/, utils/, etc.) rather than putting everything in main.ts
Add user-facing commands via this.addCommand(...) and use stable command IDs
Persist settings using this.loadData()/this.saveData() and provide sensible defaults via a settings tab
Register and clean up all DOM, app, and interval listeners using this.register* helpers for safe unload
Prefer async/await over promise chains and handle errors gracefully

Files:

  • src/core/DependencyChecker.ts
  • src/utils/versionUtils.ts
  • src/core/constants.ts
  • src/core/ExecutableChecker.ts
🧠 Learnings (2)
📚 Learning: 2025-09-25T14:48:20.040Z
Learnt from: CR
Repo: AlexKucera/obsidian-typst-pdf-export PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-25T14:48:20.040Z
Learning: Applies to {manifest.json,versions.json} : On release, bump version in manifest.json (SemVer) and update versions.json mapping accordingly

Applied to files:

  • src/utils/versionUtils.ts
📚 Learning: 2025-09-25T14:48:20.040Z
Learnt from: CR
Repo: AlexKucera/obsidian-typst-pdf-export PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-25T14:48:20.040Z
Learning: Applies to manifest.json : Keep minAppVersion accurate when using newer APIs

Applied to files:

  • src/core/constants.ts
  • src/core/ExecutableChecker.ts
🧬 Code graph analysis (2)
src/core/DependencyChecker.ts (3)
src/core/ExecutableChecker.ts (2)
  • DependencyInfo (27-34)
  • ExecutableChecker (70-424)
src/core/constants.ts (1)
  • DEPENDENCY_CONSTANTS (187-268)
src/core/ExportErrorHandler.ts (1)
  • ExportErrorHandler (97-529)
src/core/ExecutableChecker.ts (1)
src/utils/versionUtils.ts (1)
  • isVersionAtLeast (52-54)
🔇 Additional comments (1)
README.md (1)

134-183: Docs updated to mirror runtime minimum checks

The new dependency table and warning note line up with the minimum-version enforcement logic added in code. Nice alignment between documentation and behavior.

**Actionable comments posted: 1** <details> <summary>📜 Review details</summary> **Configuration used**: CodeRabbit UI **Review profile**: CHILL **Plan**: Pro <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between a69cf319517ce188f7341fc52577cf8c0074dab8 and b5ca5d1e47df5a6011c9522cd9d7d9f7c54e79b6. </details> <details> <summary>📒 Files selected for processing (5)</summary> * `README.md` (3 hunks) * `src/core/DependencyChecker.ts` (3 hunks) * `src/core/ExecutableChecker.ts` (7 hunks) * `src/core/constants.ts` (1 hunks) * `src/utils/versionUtils.ts` (1 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>📓 Path-based instructions (1)</summary> <details> <summary>src/**/*.ts</summary> **📄 CodeRabbit inference engine (AGENTS.md)** > `src/**/*.ts`: Organize code into multiple files under src/ (commands/, ui/, utils/, etc.) rather than putting everything in main.ts > Add user-facing commands via this.addCommand(...) and use stable command IDs > Persist settings using this.loadData()/this.saveData() and provide sensible defaults via a settings tab > Register and clean up all DOM, app, and interval listeners using this.register* helpers for safe unload > Prefer async/await over promise chains and handle errors gracefully Files: - `src/core/DependencyChecker.ts` - `src/utils/versionUtils.ts` - `src/core/constants.ts` - `src/core/ExecutableChecker.ts` </details> </details><details> <summary>🧠 Learnings (2)</summary> <details> <summary>📚 Learning: 2025-09-25T14:48:20.040Z</summary> ``` Learnt from: CR Repo: AlexKucera/obsidian-typst-pdf-export PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-25T14:48:20.040Z Learning: Applies to {manifest.json,versions.json} : On release, bump version in manifest.json (SemVer) and update versions.json mapping accordingly ``` **Applied to files:** - `src/utils/versionUtils.ts` </details> <details> <summary>📚 Learning: 2025-09-25T14:48:20.040Z</summary> ``` Learnt from: CR Repo: AlexKucera/obsidian-typst-pdf-export PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-25T14:48:20.040Z Learning: Applies to manifest.json : Keep minAppVersion accurate when using newer APIs ``` **Applied to files:** - `src/core/constants.ts` - `src/core/ExecutableChecker.ts` </details> </details><details> <summary>🧬 Code graph analysis (2)</summary> <details> <summary>src/core/DependencyChecker.ts (3)</summary><blockquote> <details> <summary>src/core/ExecutableChecker.ts (2)</summary> * `DependencyInfo` (27-34) * `ExecutableChecker` (70-424) </details> <details> <summary>src/core/constants.ts (1)</summary> * `DEPENDENCY_CONSTANTS` (187-268) </details> <details> <summary>src/core/ExportErrorHandler.ts (1)</summary> * `ExportErrorHandler` (97-529) </details> </blockquote></details> <details> <summary>src/core/ExecutableChecker.ts (1)</summary><blockquote> <details> <summary>src/utils/versionUtils.ts (1)</summary> * `isVersionAtLeast` (52-54) </details> </blockquote></details> </details> </details> <details> <summary>🔇 Additional comments (1)</summary><blockquote> <details> <summary>README.md (1)</summary><blockquote> `134-183`: **Docs updated to mirror runtime minimum checks** The new dependency table and warning note line up with the minimum-version enforcement logic added in code. Nice alignment between documentation and behavior. </blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
@@ -141,21 +143,26 @@ export class DependencyChecker {
]);
coderabbitai[bot] (Migrated from github.com) commented 2025-11-09 18:07:39 +01:00

⚠️ Potential issue | 🔴 Critical

Typst version parsing fails due to case-sensitive regex

typst --version outputs Typst 0.13.0 … (capital “T”). With the current case-sensitive pattern, match returns null, version stays null, and meetsMinimumVersion defaults to true, so outdated Typst installs never trigger the new warning. Please make the regex case-insensitive (or match [Tt]ypst) so the version is actually parsed.

Apply this diff to fix the issue:

-			ExecutableChecker.checkDependency('Typst', typstExec, '--version', /typst\s+([\d.]+)/, DEPENDENCY_CONSTANTS.MINIMUM_VERSIONS.typst),
+			ExecutableChecker.checkDependency('Typst', typstExec, '--version', /typst\s+([\d.]+)/i, DEPENDENCY_CONSTANTS.MINIMUM_VERSIONS.typst),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

			ExecutableChecker.checkDependency('Typst', typstExec, '--version', /typst\s+([\d.]+)/i, DEPENDENCY_CONSTANTS.MINIMUM_VERSIONS.typst),
			ExecutableChecker.checkDependency('ImageMagick', imagemagickExec, '--version', /ImageMagick\s+([\d.-]+)/, DEPENDENCY_CONSTANTS.MINIMUM_VERSIONS.imagemagick)
🤖 Prompt for AI Agents
In src/core/DependencyChecker.ts around lines 147 to 148, the regex used to
parse Typst's version is case-sensitive and fails to match output like "Typst
0.13.0"; update the pattern to be case-insensitive (e.g. add the i flag or use
[Tt]ypst) so the version is correctly extracted, then proceed with the existing
version comparison logic so outdated Typst installs trigger the warning as
intended.

✅ Addressed in commit d078215

_⚠️ Potential issue_ | _🔴 Critical_ **Typst version parsing fails due to case-sensitive regex** `typst --version` outputs `Typst 0.13.0 …` (capital “T”). With the current case-sensitive pattern, `match` returns `null`, `version` stays `null`, and `meetsMinimumVersion` defaults to `true`, so outdated Typst installs never trigger the new warning. Please make the regex case-insensitive (or match `[Tt]ypst`) so the version is actually parsed. Apply this diff to fix the issue: ```diff - ExecutableChecker.checkDependency('Typst', typstExec, '--version', /typst\s+([\d.]+)/, DEPENDENCY_CONSTANTS.MINIMUM_VERSIONS.typst), + ExecutableChecker.checkDependency('Typst', typstExec, '--version', /typst\s+([\d.]+)/i, DEPENDENCY_CONSTANTS.MINIMUM_VERSIONS.typst), ``` <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion ExecutableChecker.checkDependency('Typst', typstExec, '--version', /typst\s+([\d.]+)/i, DEPENDENCY_CONSTANTS.MINIMUM_VERSIONS.typst), ExecutableChecker.checkDependency('ImageMagick', imagemagickExec, '--version', /ImageMagick\s+([\d.-]+)/, DEPENDENCY_CONSTANTS.MINIMUM_VERSIONS.imagemagick) ``` </details> <!-- suggestion_end --> <details> <summary>🤖 Prompt for AI Agents</summary> ``` In src/core/DependencyChecker.ts around lines 147 to 148, the regex used to parse Typst's version is case-sensitive and fails to match output like "Typst 0.13.0"; update the pattern to be case-insensitive (e.g. add the i flag or use [Tt]ypst) so the version is correctly extracted, then proceed with the existing version comparison logic so outdated Typst installs trigger the warning as intended. ``` </details> <!-- fingerprinting:phantom:medusa:sabertoothed --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commit d078215
Sign in to join this conversation.