diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88200c9..0ec367f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ on: - '[0-9]+.[0-9]+.[0-9]+-*' env: - PLUGIN_NAME: obsidian-typst-pdf-export + PLUGIN_NAME: typst-pdf-export jobs: build: @@ -39,7 +39,7 @@ jobs: const path = require('path'); const archiver = require('archiver'); - const pluginName = process.env.PLUGIN_NAME || 'obsidian-typst-pdf-export'; + const pluginName = process.env.PLUGIN_NAME || 'typst-pdf-export'; const outputPath = `${pluginName}.zip`; console.log(`Creating release package: ${outputPath}`); @@ -117,7 +117,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref_name }} - name: Release ${{ steps.version.outputs.version }} + name: ${{ steps.version.outputs.version }} body: | # Obsidian Typst PDF Export ${{ steps.version.outputs.version }} @@ -130,7 +130,7 @@ jobs: ### Manual Installation 1. Download the `${{ env.PLUGIN_NAME }}.zip` file from this release - 2. Extract the ZIP file to your vault's plugins directory: `VaultFolder/.obsidian/plugins/obsidian-typst-pdf-export/` + 2. Extract the ZIP file to your vault's plugins directory: `VaultFolder/.obsidian/plugins/typst-pdf-export/` 3. Make sure the `templates/` directory is included 4. Reload Obsidian 5. Enable the plugin in Settings → Community Plugins diff --git a/main.ts b/main.ts index 44b201c..b3c77db 100644 --- a/main.ts +++ b/main.ts @@ -155,7 +155,7 @@ export class obsidianTypstPDFExport extends Plugin { typstPath: typstPath }; - await this.app.vault.adapter.write('.obsidian/plugins/obsidian-typst-pdf-export/fonts-cache.json', + await this.app.vault.adapter.write('.obsidian/plugins/typst-pdf-export/fonts-cache.json', JSON.stringify(cacheData, null, 2)); } catch (error) { console.error('Failed to cache fonts from typst:', error); @@ -178,7 +178,7 @@ export class obsidianTypstPDFExport extends Plugin { error: error.message }; - await this.app.vault.adapter.write('.obsidian/plugins/obsidian-typst-pdf-export/fonts-cache.json', + await this.app.vault.adapter.write('.obsidian/plugins/typst-pdf-export/fonts-cache.json', JSON.stringify(cacheData, null, 2)); } } @@ -188,7 +188,7 @@ export class obsidianTypstPDFExport extends Plugin { */ async getCachedFonts(): Promise { try { - const cacheContent = await this.app.vault.adapter.read('.obsidian/plugins/obsidian-typst-pdf-export/fonts-cache.json'); + const cacheContent = await this.app.vault.adapter.read('.obsidian/plugins/typst-pdf-export/fonts-cache.json'); const cacheData = JSON.parse(cacheContent); // Check if cache is older than 24 hours or typst path changed @@ -776,7 +776,7 @@ ${dependencyResult.allAvailable const fs = require('fs'); // Copy image to vault temp directory for access - const vaultTempImagesDir = pathModule.join(vaultBasePath, '.obsidian', 'plugins', 'obsidian-typst-pdf-export', 'temp-images'); + const vaultTempImagesDir = pathModule.join(vaultBasePath, '.obsidian', 'plugins', 'typst-pdf-export', 'temp-images'); await fs.promises.mkdir(vaultTempImagesDir, { recursive: true }); // Sanitize the basename for use in filename - replace problematic characters diff --git a/manifest.json b/manifest.json index cb76719..3dd7384 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "id": "obsidian-typst-pdf-export", + "id": "typst-pdf-export", "name": "Typst PDF Export", "version": "1.0.0", "minAppVersion": "1.9.12", diff --git a/scripts/package-plugin.js b/scripts/package-plugin.js index 2bd23de..ce0ca19 100644 --- a/scripts/package-plugin.js +++ b/scripts/package-plugin.js @@ -12,7 +12,7 @@ const fs = require('fs'); const path = require('path'); const archiver = require('archiver'); -const PLUGIN_NAME = 'obsidian-typst-pdf-export'; +const PLUGIN_NAME = 'typst-pdf-export'; async function packagePlugin() { const projectRoot = path.resolve(__dirname, '..'); diff --git a/src/converters/PdfToImageConverter.ts b/src/converters/PdfToImageConverter.ts index e7b06b7..a383c33 100644 --- a/src/converters/PdfToImageConverter.ts +++ b/src/converters/PdfToImageConverter.ts @@ -130,11 +130,11 @@ export class PdfToImageConverter { // Try multiple strategies to find the plugin directory const possiblePluginDirs = [ // Strategy 1: From process.cwd() if it's in the vault - path.join(process.cwd(), '.obsidian', 'plugins', 'obsidian-typst-pdf-export'), + path.join(process.cwd(), '.obsidian', 'plugins', 'typst-pdf-export'), // Strategy 2: Assuming we're running from vault root - path.join('.obsidian', 'plugins', 'obsidian-typst-pdf-export'), + path.join('.obsidian', 'plugins', 'typst-pdf-export'), // Strategy 3: Direct path if running in development - '/Users/alex/Obsidian/Dev/.obsidian/plugins/obsidian-typst-pdf-export' + '/Users/alex/Obsidian/Dev/.obsidian/plugins/typst-pdf-export' ]; // Find the first directory that exists and has node_modules diff --git a/src/core/TempDirectoryManager.ts b/src/core/TempDirectoryManager.ts index 27bc2bc..1a2f400 100644 --- a/src/core/TempDirectoryManager.ts +++ b/src/core/TempDirectoryManager.ts @@ -7,7 +7,7 @@ import { PLUGIN_DIRS } from './constants'; export interface TempDirectoryOptions { /** Base path for the vault */ vaultPath: string; - /** Plugin directory name (defaults to 'obsidian-typst-pdf-export') */ + /** Plugin directory name (defaults to 'typst-pdf-export') */ pluginName?: string; } @@ -19,7 +19,7 @@ export class TempDirectoryManager { constructor(options: TempDirectoryOptions) { this.vaultPath = options.vaultPath; - this.pluginName = options.pluginName || 'obsidian-typst-pdf-export'; + this.pluginName = options.pluginName || 'typst-pdf-export'; } /** diff --git a/src/templates/TemplateManager.ts b/src/templates/TemplateManager.ts index 22c8a52..7c13827 100644 --- a/src/templates/TemplateManager.ts +++ b/src/templates/TemplateManager.ts @@ -16,7 +16,7 @@ export class TemplateManager { // Templates are stored in the plugin directory this.templatesPath = path.join( (this.plugin.app.vault.adapter as any).basePath, - '.obsidian/plugins/obsidian-typst-pdf-export/templates' + '.obsidian/plugins/typst-pdf-export/templates' ); } diff --git a/src/ui/modal/sections/TypographySection.ts b/src/ui/modal/sections/TypographySection.ts index 1a94662..6c6c287 100644 --- a/src/ui/modal/sections/TypographySection.ts +++ b/src/ui/modal/sections/TypographySection.ts @@ -123,7 +123,7 @@ export class TypographySection implements ModalSection { try { // Access the plugin instance through the app // @ts-ignore - accessing private plugin manager - const plugin = this.app?.plugins?.plugins?.['obsidian-typst-pdf-export']; + const plugin = this.app?.plugins?.plugins?.['typst-pdf-export']; if (plugin && plugin.getCachedFonts) { return await plugin.getCachedFonts(); }