Enhances path handling and file resolution #5

Merged
AlexKucera merged 36 commits from 1.3.0 into master 2025-09-25 16:47:12 +02:00
3 changed files with 23 additions and 2 deletions
Showing only changes of commit c971c920ce - Show all commits

No files matched your search

+21
View File
@@ -5,6 +5,27 @@ All notable changes to the Obsidian Typst PDF Export plugin will be documented i
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.3.0] - 2024-12-25
### Added
- PathUtils helper class for centralized path operations and safe Obsidian API usage
- Improved Typst error reporting in Pandoc conversion with enhanced diagnostic output
- New Typst templates for varied document styles (modern, article, report)
- Enhanced README with plugin motivation, development philosophy, and updated badges
### Fixed
- **Critical**: Embedded file path resolution issue that caused "File not found" errors for PDFs, images, and documents
- Proper vault.adapter integration replacing unsafe type casts throughout codebase
- Path handling reliability with comprehensive migration from Node.js fs/path to Obsidian APIs
- File existence checks now handle both vault-relative and absolute filesystem paths
### Changed
- **Major Refactoring**: Complete migration from Node.js fs/path to Obsidian vault.adapter APIs
- Centralized path utilities replacing unsafe `(app.vault.adapter as unknown as { basePath: string }).basePath` patterns
- Improved file system operations security and cross-platform compatibility
- Enhanced error handling and path validation across all modules
- Updated all 16 core files with consistent, safe path handling practices
## [1.2.1] - 2025-01-10
### Fixed
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "typst-pdf-export",
"name": "Typst PDF Export",
"version": "1.2.1",
"version": "1.3.0",
"minAppVersion": "1.9.12",
"description": "Exports a note or collection of notes to a pretty Typst PDF.",
"author": "Alexander Kucera",
coderabbitai[bot] commented 2025-09-25 13:05:39 +02:00 (Migrated from github.com)
Review

⚠️ Potential issue | 🟠 Major

Reconsider minAppVersion: 1.9.12 limits users to early-access builds

Unless you rely on 1.9-only APIs, set minAppVersion to the latest stable (1.8.9) to avoid excluding stable users.

Apply this diff:

-	"version": "1.3.0",
-	"minAppVersion": "1.9.12",
+	"version": "1.3.0",
+	"minAppVersion": "1.8.9",
📝 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.

	"version": "1.3.0",
	"minAppVersion": "1.8.9",
	"description": "Exports a note or collection of notes to a pretty Typst PDF.",
🤖 Prompt for AI Agents
In manifest.json around lines 4 to 6, the minAppVersion is set to "1.9.12" which
restricts users to early-access builds; unless your code uses APIs introduced in
1.9.x, change "minAppVersion" to "1.8.9" to target the latest stable release and
avoid excluding stable users—update that field in the file to "1.8.9" (or
document any 1.9-only dependency if you must keep it).
_⚠️ Potential issue_ | _🟠 Major_ **Reconsider minAppVersion: 1.9.12 limits users to early-access builds** Unless you rely on 1.9-only APIs, set minAppVersion to the latest stable (1.8.9) to avoid excluding stable users. Apply this diff: ```diff - "version": "1.3.0", - "minAppVersion": "1.9.12", + "version": "1.3.0", + "minAppVersion": "1.8.9", ``` <!-- 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 "version": "1.3.0", "minAppVersion": "1.8.9", "description": "Exports a note or collection of notes to a pretty Typst PDF.", ``` </details> <!-- suggestion_end --> <details> <summary>🤖 Prompt for AI Agents</summary> ``` In manifest.json around lines 4 to 6, the minAppVersion is set to "1.9.12" which restricts users to early-access builds; unless your code uses APIs introduced in 1.9.x, change "minAppVersion" to "1.8.9" to target the latest stable release and avoid excluding stable users—update that field in the file to "1.8.9" (or document any 1.9-only dependency if you must keep it). ``` </details> <!-- fingerprinting:phantom:medusa:chinchilla --> <!-- This is an auto-generated reply by CodeRabbit -->
AlexKucera commented 2025-09-25 15:29:10 +02:00 (Migrated from github.com)
Review

@coderabbitai I will reject this, because 1.9.12 is the most recent version and not in beta.

@coderabbitai I will reject this, because 1.9.12 is the most recent version and not in beta.
coderabbitai[bot] commented 2025-09-25 15:30:10 +02:00 (Migrated from github.com)
Review

@AlexKucera Thank you for the correction! You're absolutely right - I apologize for the incorrect suggestion. As the plugin author, you would have current knowledge of Obsidian's versioning, and if 1.9.12 is indeed the latest stable version rather than early access, then your minAppVersion setting is appropriate.

I appreciate you clarifying this. Your minAppVersion of 1.9.12 is correct for targeting the current stable Obsidian release.


✏️ Learnings added
Learnt from: AlexKucera
PR: AlexKucera/obsidian-typst-pdf-export#5
File: manifest.json:4-6
Timestamp: 2025-09-25T13:30:09.533Z
Learning: Obsidian version 1.9.12 is the current latest stable version, not early access or beta. Plugin authors should use current stable versions in minAppVersion.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@AlexKucera Thank you for the correction! You're absolutely right - I apologize for the incorrect suggestion. As the plugin author, you would have current knowledge of Obsidian's versioning, and if 1.9.12 is indeed the latest stable version rather than early access, then your minAppVersion setting is appropriate. I appreciate you clarifying this. Your minAppVersion of 1.9.12 is correct for targeting the current stable Obsidian release. --- <details> <summary>✏️ Learnings added</summary> ``` Learnt from: AlexKucera PR: AlexKucera/obsidian-typst-pdf-export#5 File: manifest.json:4-6 Timestamp: 2025-09-25T13:30:09.533Z Learning: Obsidian version 1.9.12 is the current latest stable version, not early access or beta. Plugin authors should use current stable versions in minAppVersion. ``` > Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure [review instructions](https://docs.coderabbit.ai/guides/review-instructions). You can manage existing learnings in the [app](https://app.coderabbit.ai/learnings). </details> <!-- This is an auto-generated reply by CodeRabbit -->
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "obsidian-typst-pdf-export",
"version": "1.2.1",
"version": "1.3.0",
"description": "Exports a note or collection of notes to a pretty Typst PDF.",
"main": "main.js",
"scripts": {