@zkov/pi-md-viewer 0.1.0 → 0.1.1

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.
@@ -24,7 +24,11 @@ export function buildInvocation(cwd, extensionFile, input, options = {}) {
24
24
  const platform = options.platform ?? process.platform;
25
25
  const pathForCwd = platform === "win32" ? path.win32 : path.posix;
26
26
  const extensionPath = fileURLToPath(extensionFile);
27
- const launcher = path.resolve(path.dirname(extensionPath), "..", "bin", "mdview.js");
27
+ const extensionDir = path.dirname(extensionPath);
28
+ const packageRoot = path.basename(path.dirname(extensionDir)) === "dist"
29
+ ? path.resolve(extensionDir, "..", "..")
30
+ : path.resolve(extensionDir, "..");
31
+ const launcher = path.join(packageRoot, "bin", "mdview.js");
28
32
  const resolvedPaths = input.paths.map((supplied) => {
29
33
  const normalized = supplied.startsWith("@") ? supplied.slice(1) : supplied;
30
34
  if (!normalized)
@@ -53,7 +53,11 @@ export function buildInvocation(
53
53
  const platform = options.platform ?? process.platform;
54
54
  const pathForCwd = platform === "win32" ? path.win32 : path.posix;
55
55
  const extensionPath = fileURLToPath(extensionFile);
56
- const launcher = path.resolve(path.dirname(extensionPath), "..", "bin", "mdview.js");
56
+ const extensionDir = path.dirname(extensionPath);
57
+ const packageRoot = path.basename(path.dirname(extensionDir)) === "dist"
58
+ ? path.resolve(extensionDir, "..", "..")
59
+ : path.resolve(extensionDir, "..");
60
+ const launcher = path.join(packageRoot, "bin", "mdview.js");
57
61
  const resolvedPaths = input.paths.map((supplied) => {
58
62
  const normalized = supplied.startsWith("@") ? supplied.slice(1) : supplied;
59
63
  if (!normalized) throw new Error("show_markdown path cannot be empty");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkov/pi-md-viewer",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Local loopback Markdown viewer tool for pi with configurable browser launchers",
5
5
  "author": "Zkov <zkov@yandex.ru>",
6
6
  "license": "MIT",