markmap-cli 0.18.6 → 0.18.7

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/dist/index.js +3 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -6,7 +6,6 @@ import * as markmapLib from "markmap-lib";
6
6
  import { fillTemplate, baseJsPaths } from "markmap-render";
7
7
  import open from "open";
8
8
  import { dirname, join, resolve, basename } from "path";
9
- import { getPortPromise } from "portfinder";
10
9
  import { readPackageUp } from "read-package-up";
11
10
  import updateNotifier from "update-notifier";
12
11
  import { fileURLToPath } from "url";
@@ -15,6 +14,7 @@ import { watch } from "chokidar";
15
14
  import { createHash } from "crypto";
16
15
  import { createReadStream, createWriteStream } from "fs";
17
16
  import { Hono } from "hono";
17
+ import { getPortPromise } from "portfinder";
18
18
  import { Readable } from "stream";
19
19
  import { finished } from "stream/promises";
20
20
  var getMimeType = (filename, mimes = baseMimes) => {
@@ -339,7 +339,7 @@ class MarkmapDevServer {
339
339
  const server = serve(
340
340
  {
341
341
  fetch: app.fetch,
342
- port: this.options.port
342
+ port: this.options.port || await getPortPromise()
343
343
  },
344
344
  deferred.resolve
345
345
  );
@@ -552,7 +552,7 @@ async function main() {
552
552
  const devServer = await develop({
553
553
  toolbar: cmd.toolbar,
554
554
  offline,
555
- port: +cmd.port || await getPortPromise()
555
+ port: +cmd.port || void 0
556
556
  });
557
557
  const address = devServer.serverInfo.address;
558
558
  const provider = devServer.addProvider({ filePath: input });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markmap-cli",
3
- "version": "0.18.6",
3
+ "version": "0.18.7",
4
4
  "description": "Create markmaps from CLI",
5
5
  "author": "Gerald <gera2ld@live.com>",
6
6
  "license": "MIT",
@@ -58,5 +58,5 @@
58
58
  "read-package-up": "^11.0.0",
59
59
  "update-notifier": "^7.3.1"
60
60
  },
61
- "gitHead": "fba9dcd20dbb321412b635f09df2ad0e67c29f78"
61
+ "gitHead": "2f26340e48545f181ca6e887b9fcfddb2b5ae6cb"
62
62
  }