@bobfrankston/msger 0.1.197 → 0.1.198

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/shower.js +8 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/msger",
3
- "version": "0.1.197",
3
+ "version": "0.1.198",
4
4
  "description": "Fast, lightweight, cross-platform message box - Rust-powered alternative to msgview",
5
5
  "type": "module",
6
6
  "main": "./index.js",
package/shower.js CHANGED
@@ -345,6 +345,14 @@ export function showService(options) {
345
345
  rustOptions.height = rustOptions.size.height;
346
346
  delete rustOptions.size;
347
347
  }
348
+ // Convert local paths to file:// URLs (same as createMessageBoxHandle)
349
+ if (rustOptions.url && !rustOptions.url.startsWith("http://") && !rustOptions.url.startsWith("https://") && !rustOptions.url.startsWith("file://")) {
350
+ const absolutePath = path.resolve(rustOptions.url);
351
+ if (!fs.existsSync(absolutePath)) {
352
+ throw new Error(`File not found: ${absolutePath}`);
353
+ }
354
+ rustOptions.url = pathToFileURL(absolutePath).href;
355
+ }
348
356
  child.stdin?.write(JSON.stringify(rustOptions) + "\n");
349
357
  return new ServiceHandle(child);
350
358
  }