markmap-cli 0.18.8-alpha.2 → 0.18.9
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.
- package/bin/cli.js +1 -6
- package/dist/assets-fetcher-B4vBLKaX.js +72 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +57 -0
- package/dist/common-WzXBUz0S.js +61 -0
- package/dist/fetch-assets.d.ts +1 -1
- package/dist/fetch-assets.js +11 -0
- package/dist/index.d.ts +3 -5
- package/dist/index.js +7 -160
- package/dist/util/assets-fetcher.d.ts +4 -0
- package/dist/{dev-server.d.ts → util/dev-server.d.ts} +1 -1
- package/package.json +7 -7
- /package/dist/{util.d.ts → util/common.d.ts} +0 -0
package/bin/cli.js
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { createWriteStream } from "fs";
|
|
2
|
+
import { stat, mkdir } from "fs/promises";
|
|
3
|
+
import { extractAssets } from "markmap-common";
|
|
4
|
+
import { Transformer } from "markmap-lib";
|
|
5
|
+
import { baseJsPaths } from "markmap-render";
|
|
6
|
+
import { resolve, dirname } from "path";
|
|
7
|
+
import { Readable } from "stream";
|
|
8
|
+
import { finished } from "stream/promises";
|
|
9
|
+
import { l as localProvider, A as ASSETS_PREFIX, t as toolbarAssets, a as config } from "./common-WzXBUz0S.js";
|
|
10
|
+
const providerName = "local-hook";
|
|
11
|
+
async function fetchAssets({
|
|
12
|
+
assetsDir = config.assetsDir,
|
|
13
|
+
verbose
|
|
14
|
+
} = {}) {
|
|
15
|
+
const transformer = new Transformer();
|
|
16
|
+
transformer.urlBuilder.setProvider(providerName, localProvider);
|
|
17
|
+
transformer.urlBuilder.provider = providerName;
|
|
18
|
+
const assets = transformer.getAssets();
|
|
19
|
+
delete transformer.urlBuilder.providers[providerName];
|
|
20
|
+
const pluginPaths = extractAssets(assets).filter((url) => url.startsWith(ASSETS_PREFIX)).map((url) => url.slice(ASSETS_PREFIX.length));
|
|
21
|
+
const resources = transformer.plugins.flatMap(
|
|
22
|
+
(plugin) => {
|
|
23
|
+
var _a;
|
|
24
|
+
return ((_a = plugin.config) == null ? void 0 : _a.resources) || [];
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
const paths = [
|
|
28
|
+
...baseJsPaths,
|
|
29
|
+
...pluginPaths,
|
|
30
|
+
...resources,
|
|
31
|
+
...extractAssets(toolbarAssets)
|
|
32
|
+
];
|
|
33
|
+
let findingProvider;
|
|
34
|
+
const findProvider = () => {
|
|
35
|
+
findingProvider || (findingProvider = transformer.urlBuilder.getFastestProvider());
|
|
36
|
+
return findingProvider;
|
|
37
|
+
};
|
|
38
|
+
await Promise.all(
|
|
39
|
+
paths.map(async (path) => {
|
|
40
|
+
const fullPath = resolve(assetsDir, path);
|
|
41
|
+
let url;
|
|
42
|
+
await downloadAsset(
|
|
43
|
+
fullPath,
|
|
44
|
+
async () => url = transformer.urlBuilder.getFullUrl(path, await findProvider())
|
|
45
|
+
);
|
|
46
|
+
if (verbose) {
|
|
47
|
+
console.log(
|
|
48
|
+
url ? `Fetched: ${url} -> ${fullPath}` : `Skipped existing file: ${fullPath}`
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
async function downloadAsset(fullPath, resolveUrl) {
|
|
55
|
+
try {
|
|
56
|
+
const result = await stat(fullPath);
|
|
57
|
+
if (result.isFile()) return;
|
|
58
|
+
} catch {
|
|
59
|
+
}
|
|
60
|
+
const url = await resolveUrl();
|
|
61
|
+
const res = await fetch(url);
|
|
62
|
+
if (!res.ok || !res.body) throw new Error(`Failed to download: ${url}`);
|
|
63
|
+
await mkdir(dirname(fullPath), { recursive: true });
|
|
64
|
+
await finished(
|
|
65
|
+
Readable.fromWeb(res.body).pipe(
|
|
66
|
+
createWriteStream(fullPath)
|
|
67
|
+
)
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
fetchAssets as f
|
|
72
|
+
};
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { program } from "commander";
|
|
2
|
+
import { readFile } from "fs/promises";
|
|
3
|
+
import open from "open";
|
|
4
|
+
import { basename } from "path";
|
|
5
|
+
import { readPackageUp } from "read-package-up";
|
|
6
|
+
import updateNotifier from "update-notifier";
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
8
|
+
import { develop, createMarkmap } from "./index.js";
|
|
9
|
+
import { f as fetchAssets } from "./assets-fetcher-B4vBLKaX.js";
|
|
10
|
+
async function main() {
|
|
11
|
+
var _a;
|
|
12
|
+
const pkg = (_a = await readPackageUp({
|
|
13
|
+
cwd: fileURLToPath(import.meta.url)
|
|
14
|
+
})) == null ? void 0 : _a.packageJson;
|
|
15
|
+
if (!pkg) throw new Error("Invalid package");
|
|
16
|
+
const notifier = updateNotifier({ pkg });
|
|
17
|
+
notifier.notify();
|
|
18
|
+
program.version(pkg.version).description("Create a markmap from a Markdown input file").arguments("<input>").option("--no-open", "Do not open the output file after generation").option("--no-toolbar", "Do not show toolbar").option("-o, --output <output>", "Specify the filename of the output HTML").option(
|
|
19
|
+
"--offline",
|
|
20
|
+
"Inline all assets to allow the generated HTML to work offline"
|
|
21
|
+
).option(
|
|
22
|
+
"-w, --watch",
|
|
23
|
+
"Watch the input file and update output on the fly, note that this feature is for development only"
|
|
24
|
+
).option("--port <port>", "Set the port for the devServer to listen").action(async (input, cmd) => {
|
|
25
|
+
let { offline } = cmd;
|
|
26
|
+
if (cmd.watch) offline = true;
|
|
27
|
+
if (offline) await fetchAssets();
|
|
28
|
+
const content = await readFile(input, "utf8");
|
|
29
|
+
const output = cmd.output || `${input.replace(/\.\w*$/, "")}.html`;
|
|
30
|
+
if (cmd.watch) {
|
|
31
|
+
const devServer = await develop({
|
|
32
|
+
toolbar: cmd.toolbar,
|
|
33
|
+
offline,
|
|
34
|
+
port: +cmd.port || void 0
|
|
35
|
+
});
|
|
36
|
+
const address = devServer.serverInfo.address;
|
|
37
|
+
const provider = devServer.addProvider({ filePath: input });
|
|
38
|
+
const filename = basename(input);
|
|
39
|
+
const url = `http://localhost:${address.port}/?key=${provider.key}&filename=${encodeURIComponent(filename)}`;
|
|
40
|
+
console.log(`Listening at ${url}`);
|
|
41
|
+
if (cmd.open) open(url);
|
|
42
|
+
} else {
|
|
43
|
+
await createMarkmap({
|
|
44
|
+
content,
|
|
45
|
+
output,
|
|
46
|
+
open: cmd.open,
|
|
47
|
+
toolbar: cmd.toolbar,
|
|
48
|
+
offline
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
program.parse();
|
|
53
|
+
}
|
|
54
|
+
main().catch((err) => {
|
|
55
|
+
console.error(err);
|
|
56
|
+
process.exitCode = 1;
|
|
57
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { buildCSSItem, buildJSItem } from "markmap-common";
|
|
2
|
+
import { dirname } from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
const TOOLBAR_VERSION = "0.18.9";
|
|
5
|
+
const TOOLBAR_CSS = `markmap-toolbar@${TOOLBAR_VERSION}/dist/style.css`;
|
|
6
|
+
const TOOLBAR_JS = `markmap-toolbar@${TOOLBAR_VERSION}/dist/index.js`;
|
|
7
|
+
const distDir = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const ASSETS_PREFIX = "/assets/";
|
|
9
|
+
const renderToolbar = () => {
|
|
10
|
+
const { markmap, mm } = window;
|
|
11
|
+
const toolbar = new markmap.Toolbar();
|
|
12
|
+
toolbar.attach(mm);
|
|
13
|
+
const el = toolbar.render();
|
|
14
|
+
el.setAttribute("style", "position:absolute;bottom:20px;right:20px");
|
|
15
|
+
document.body.append(el);
|
|
16
|
+
};
|
|
17
|
+
const toolbarAssets = {
|
|
18
|
+
styles: [buildCSSItem(TOOLBAR_CSS)],
|
|
19
|
+
scripts: [
|
|
20
|
+
buildJSItem(TOOLBAR_JS),
|
|
21
|
+
{
|
|
22
|
+
type: "iife",
|
|
23
|
+
data: {
|
|
24
|
+
fn: (r) => {
|
|
25
|
+
setTimeout(r);
|
|
26
|
+
},
|
|
27
|
+
getParams: () => [renderToolbar]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
};
|
|
32
|
+
function localProvider(path) {
|
|
33
|
+
return `${ASSETS_PREFIX}${path}`;
|
|
34
|
+
}
|
|
35
|
+
function createStreamBody(stream) {
|
|
36
|
+
const body = new ReadableStream({
|
|
37
|
+
start(controller) {
|
|
38
|
+
stream.on("data", (chunk) => {
|
|
39
|
+
controller.enqueue(chunk);
|
|
40
|
+
});
|
|
41
|
+
stream.on("end", () => {
|
|
42
|
+
controller.close();
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
cancel() {
|
|
46
|
+
stream.destroy();
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return body;
|
|
50
|
+
}
|
|
51
|
+
const config = {
|
|
52
|
+
distDir,
|
|
53
|
+
assetsDir: `${distDir}${ASSETS_PREFIX}`
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
ASSETS_PREFIX as A,
|
|
57
|
+
config as a,
|
|
58
|
+
createStreamBody as c,
|
|
59
|
+
localProvider as l,
|
|
60
|
+
toolbarAssets as t
|
|
61
|
+
};
|
package/dist/fetch-assets.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { program } from "commander";
|
|
2
|
+
import { f as fetchAssets } from "./assets-fetcher-B4vBLKaX.js";
|
|
3
|
+
program.description("Fetch assets for markmap-cli").option("--ignoreErrors", "Ignore errors when failing to download assets").option("--verbose", "Show verbose logs").action(async (cmd) => {
|
|
4
|
+
try {
|
|
5
|
+
await fetchAssets({ verbose: cmd.verbose });
|
|
6
|
+
} catch (err) {
|
|
7
|
+
console.error(err);
|
|
8
|
+
if (!cmd.ignoreErrors) process.exitCode = 1;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
program.parse();
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { type IMarkmapCreateOptions } from 'markmap-lib';
|
|
2
|
-
import { fetchAssets } from './fetch-assets';
|
|
3
2
|
import { IDevelopOptions } from './types';
|
|
4
|
-
import { config } from './util';
|
|
5
|
-
export * from './dev-server';
|
|
3
|
+
import { config } from './util/common';
|
|
6
4
|
export * from './types';
|
|
7
|
-
export
|
|
5
|
+
export * from './util/dev-server';
|
|
6
|
+
export { config };
|
|
8
7
|
export * as markmap from 'markmap-lib';
|
|
9
8
|
export declare function createMarkmap(options: IMarkmapCreateOptions & IDevelopOptions & {
|
|
10
9
|
open: boolean;
|
|
11
10
|
}): Promise<void>;
|
|
12
|
-
export declare function main(): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { buildCSSItem, buildJSItem, mergeAssets, defer, extractAssets } from "markmap-common";
|
|
1
|
+
import { readFile, stat, writeFile } from "fs/promises";
|
|
2
|
+
import { mergeAssets, defer, buildJSItem } from "markmap-common";
|
|
4
3
|
import { Transformer } from "markmap-lib";
|
|
5
4
|
import * as markmapLib from "markmap-lib";
|
|
6
5
|
import { fillTemplate, baseJsPaths } from "markmap-render";
|
|
7
6
|
import open from "open";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import updateNotifier from "update-notifier";
|
|
11
|
-
import { fileURLToPath } from "url";
|
|
7
|
+
import { join, resolve } from "path";
|
|
8
|
+
import { t as toolbarAssets, A as ASSETS_PREFIX, l as localProvider, c as createStreamBody, a as config } from "./common-WzXBUz0S.js";
|
|
12
9
|
import { serve } from "@hono/node-server";
|
|
13
10
|
import { watch } from "chokidar";
|
|
14
11
|
import { createHash } from "crypto";
|
|
15
|
-
import { createReadStream
|
|
12
|
+
import { createReadStream } from "fs";
|
|
16
13
|
import { Hono } from "hono";
|
|
17
14
|
import { getPortPromise } from "portfinder";
|
|
18
|
-
import { Readable } from "stream";
|
|
19
|
-
import { finished } from "stream/promises";
|
|
20
15
|
var getMimeType = (filename, mimes = baseMimes) => {
|
|
21
16
|
const regexp = /\.([a-zA-Z0-9]+?)$/;
|
|
22
17
|
const match = filename.match(regexp);
|
|
@@ -87,57 +82,6 @@ var _baseMimes = {
|
|
|
87
82
|
glb: "model/gltf-binary"
|
|
88
83
|
};
|
|
89
84
|
var baseMimes = _baseMimes;
|
|
90
|
-
const TOOLBAR_VERSION = "0.18.8-alpha.2+55f0247";
|
|
91
|
-
const TOOLBAR_CSS = `markmap-toolbar@${TOOLBAR_VERSION}/dist/style.css`;
|
|
92
|
-
const TOOLBAR_JS = `markmap-toolbar@${TOOLBAR_VERSION}/dist/index.js`;
|
|
93
|
-
const distDir = dirname(fileURLToPath(import.meta.url));
|
|
94
|
-
const ASSETS_PREFIX = "/assets/";
|
|
95
|
-
const renderToolbar = () => {
|
|
96
|
-
const { markmap, mm } = window;
|
|
97
|
-
const toolbar = new markmap.Toolbar();
|
|
98
|
-
toolbar.attach(mm);
|
|
99
|
-
const el = toolbar.render();
|
|
100
|
-
el.setAttribute("style", "position:absolute;bottom:20px;right:20px");
|
|
101
|
-
document.body.append(el);
|
|
102
|
-
};
|
|
103
|
-
const toolbarAssets = {
|
|
104
|
-
styles: [buildCSSItem(TOOLBAR_CSS)],
|
|
105
|
-
scripts: [
|
|
106
|
-
buildJSItem(TOOLBAR_JS),
|
|
107
|
-
{
|
|
108
|
-
type: "iife",
|
|
109
|
-
data: {
|
|
110
|
-
fn: (r) => {
|
|
111
|
-
setTimeout(r);
|
|
112
|
-
},
|
|
113
|
-
getParams: () => [renderToolbar]
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
]
|
|
117
|
-
};
|
|
118
|
-
function localProvider(path) {
|
|
119
|
-
return `${ASSETS_PREFIX}${path}`;
|
|
120
|
-
}
|
|
121
|
-
function createStreamBody(stream) {
|
|
122
|
-
const body = new ReadableStream({
|
|
123
|
-
start(controller) {
|
|
124
|
-
stream.on("data", (chunk) => {
|
|
125
|
-
controller.enqueue(chunk);
|
|
126
|
-
});
|
|
127
|
-
stream.on("end", () => {
|
|
128
|
-
controller.close();
|
|
129
|
-
});
|
|
130
|
-
},
|
|
131
|
-
cancel() {
|
|
132
|
-
stream.destroy();
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
return body;
|
|
136
|
-
}
|
|
137
|
-
const config = {
|
|
138
|
-
distDir,
|
|
139
|
-
assetsDir: `${distDir}${ASSETS_PREFIX}`
|
|
140
|
-
};
|
|
141
85
|
function sequence(fn) {
|
|
142
86
|
let promise;
|
|
143
87
|
return () => {
|
|
@@ -325,9 +269,9 @@ class MarkmapDevServer {
|
|
|
325
269
|
await ((_a = provider[cmd]) == null ? void 0 : _a.call(provider, ...args));
|
|
326
270
|
return c.body(null, 204);
|
|
327
271
|
});
|
|
328
|
-
const { distDir
|
|
272
|
+
const { distDir, assetsDir } = config;
|
|
329
273
|
app.get("/~client.*", async (c) => {
|
|
330
|
-
const realpath = join(
|
|
274
|
+
const realpath = join(distDir, c.req.path.slice(2));
|
|
331
275
|
return sendStatic(c, realpath);
|
|
332
276
|
});
|
|
333
277
|
app.get(`${ASSETS_PREFIX}*`, async (c) => {
|
|
@@ -404,56 +348,6 @@ async function develop(options) {
|
|
|
404
348
|
await devServer.setup();
|
|
405
349
|
return devServer;
|
|
406
350
|
}
|
|
407
|
-
const providerName = "local-hook";
|
|
408
|
-
async function fetchAssets(assetsDir = config.assetsDir) {
|
|
409
|
-
const transformer = new Transformer();
|
|
410
|
-
transformer.urlBuilder.setProvider(providerName, localProvider);
|
|
411
|
-
transformer.urlBuilder.provider = providerName;
|
|
412
|
-
const assets = transformer.getAssets();
|
|
413
|
-
delete transformer.urlBuilder.providers[providerName];
|
|
414
|
-
const pluginPaths = extractAssets(assets).filter((url) => url.startsWith(ASSETS_PREFIX)).map((url) => url.slice(ASSETS_PREFIX.length));
|
|
415
|
-
const resources = transformer.plugins.flatMap(
|
|
416
|
-
(plugin) => {
|
|
417
|
-
var _a;
|
|
418
|
-
return ((_a = plugin.config) == null ? void 0 : _a.resources) || [];
|
|
419
|
-
}
|
|
420
|
-
);
|
|
421
|
-
const paths = [
|
|
422
|
-
...baseJsPaths,
|
|
423
|
-
...pluginPaths,
|
|
424
|
-
...resources,
|
|
425
|
-
...extractAssets(toolbarAssets)
|
|
426
|
-
];
|
|
427
|
-
let findingProvider;
|
|
428
|
-
const findProvider = () => {
|
|
429
|
-
findingProvider || (findingProvider = transformer.urlBuilder.getFastestProvider());
|
|
430
|
-
return findingProvider;
|
|
431
|
-
};
|
|
432
|
-
await Promise.all(
|
|
433
|
-
paths.map(
|
|
434
|
-
(path) => downloadAsset(
|
|
435
|
-
resolve(assetsDir, path),
|
|
436
|
-
async () => transformer.urlBuilder.getFullUrl(path, await findProvider())
|
|
437
|
-
)
|
|
438
|
-
)
|
|
439
|
-
);
|
|
440
|
-
}
|
|
441
|
-
async function downloadAsset(fullPath, resolveUrl) {
|
|
442
|
-
try {
|
|
443
|
-
const result = await stat(fullPath);
|
|
444
|
-
if (result.isFile()) return;
|
|
445
|
-
} catch {
|
|
446
|
-
}
|
|
447
|
-
const url = await resolveUrl();
|
|
448
|
-
const res = await fetch(url);
|
|
449
|
-
if (!res.ok || !res.body) throw new Error(`Failed to download: ${url}`);
|
|
450
|
-
await mkdir(dirname(fullPath), { recursive: true });
|
|
451
|
-
await finished(
|
|
452
|
-
Readable.fromWeb(res.body).pipe(
|
|
453
|
-
createWriteStream(fullPath)
|
|
454
|
-
)
|
|
455
|
-
);
|
|
456
|
-
}
|
|
457
351
|
async function loadFile(path) {
|
|
458
352
|
if (path.startsWith(ASSETS_PREFIX)) {
|
|
459
353
|
const relpath = path.slice(ASSETS_PREFIX.length);
|
|
@@ -527,57 +421,10 @@ async function createMarkmap(options) {
|
|
|
527
421
|
await writeFile(output, html, "utf8");
|
|
528
422
|
if (options.open) open(output);
|
|
529
423
|
}
|
|
530
|
-
async function main() {
|
|
531
|
-
var _a;
|
|
532
|
-
const pkg = (_a = await readPackageUp({
|
|
533
|
-
cwd: fileURLToPath(import.meta.url)
|
|
534
|
-
})) == null ? void 0 : _a.packageJson;
|
|
535
|
-
if (!pkg) throw new Error("package.json not found");
|
|
536
|
-
const notifier = updateNotifier({ pkg });
|
|
537
|
-
notifier.notify();
|
|
538
|
-
const program = new Command();
|
|
539
|
-
program.version(pkg.version).description("Create a markmap from a Markdown input file").arguments("<input>").option("--no-open", "Do not open the output file after generation").option("--no-toolbar", "Do not show toolbar").option("-o, --output <output>", "Specify the filename of the output HTML").option(
|
|
540
|
-
"--offline",
|
|
541
|
-
"Inline all assets to allow the generated HTML to work offline"
|
|
542
|
-
).option(
|
|
543
|
-
"-w, --watch",
|
|
544
|
-
"Watch the input file and update output on the fly, note that this feature is for development only"
|
|
545
|
-
).option("--port <port>", "Set the port for the devServer to listen").action(async (input, cmd) => {
|
|
546
|
-
let { offline } = cmd;
|
|
547
|
-
if (cmd.watch) offline = true;
|
|
548
|
-
if (offline) await fetchAssets();
|
|
549
|
-
const content = await readFile(input, "utf8");
|
|
550
|
-
const output = cmd.output || `${input.replace(/\.\w*$/, "")}.html`;
|
|
551
|
-
if (cmd.watch) {
|
|
552
|
-
const devServer = await develop({
|
|
553
|
-
toolbar: cmd.toolbar,
|
|
554
|
-
offline,
|
|
555
|
-
port: +cmd.port || void 0
|
|
556
|
-
});
|
|
557
|
-
const address = devServer.serverInfo.address;
|
|
558
|
-
const provider = devServer.addProvider({ filePath: input });
|
|
559
|
-
const filename = basename(input);
|
|
560
|
-
const url = `http://localhost:${address.port}/?key=${provider.key}&filename=${encodeURIComponent(filename)}`;
|
|
561
|
-
console.log(`Listening at ${url}`);
|
|
562
|
-
if (cmd.open) open(url);
|
|
563
|
-
} else {
|
|
564
|
-
await createMarkmap({
|
|
565
|
-
content,
|
|
566
|
-
output,
|
|
567
|
-
open: cmd.open,
|
|
568
|
-
toolbar: cmd.toolbar,
|
|
569
|
-
offline
|
|
570
|
-
});
|
|
571
|
-
}
|
|
572
|
-
});
|
|
573
|
-
program.parse(process.argv);
|
|
574
|
-
}
|
|
575
424
|
export {
|
|
576
425
|
MarkmapDevServer,
|
|
577
426
|
config,
|
|
578
427
|
createMarkmap,
|
|
579
428
|
develop,
|
|
580
|
-
fetchAssets,
|
|
581
|
-
main,
|
|
582
429
|
markmapLib as markmap
|
|
583
430
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ServerType } from '@hono/node-server';
|
|
2
2
|
import { Transformer } from 'markmap-lib';
|
|
3
3
|
import { AddressInfo } from 'net';
|
|
4
|
-
import { IContentProvider, IDevelopOptions } from '
|
|
4
|
+
import { IContentProvider, IDevelopOptions } from '../types';
|
|
5
5
|
export declare class MarkmapDevServer {
|
|
6
6
|
options: IDevelopOptions;
|
|
7
7
|
providers: Record<string, IContentProvider>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markmap-cli",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.9",
|
|
4
4
|
"description": "Create markmaps from CLI",
|
|
5
5
|
"author": "Gerald <gera2ld@live.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"build:js": "vite build",
|
|
31
31
|
"build": "pnpm clean && pnpm /^build:/",
|
|
32
32
|
"prepublishOnly": "pnpm build",
|
|
33
|
-
"postinstall": "node
|
|
33
|
+
"postinstall": "node ./dist/fetch-assets.js --ignoreErrors"
|
|
34
34
|
},
|
|
35
35
|
"bugs": {
|
|
36
36
|
"url": "https://github.com/markmap/markmap/issues"
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
"chokidar": "^4.0.1",
|
|
50
50
|
"commander": "^12.1.0",
|
|
51
51
|
"hono": "^4.6.13",
|
|
52
|
-
"markmap-common": "0.18.
|
|
53
|
-
"markmap-lib": "0.18.
|
|
54
|
-
"markmap-render": "0.18.
|
|
55
|
-
"markmap-toolbar": "0.18.
|
|
52
|
+
"markmap-common": "0.18.9",
|
|
53
|
+
"markmap-lib": "0.18.9",
|
|
54
|
+
"markmap-render": "0.18.9",
|
|
55
|
+
"markmap-toolbar": "0.18.9",
|
|
56
56
|
"open": "^10.1.0",
|
|
57
57
|
"portfinder": "^1.0.32",
|
|
58
58
|
"read-package-up": "^11.0.0",
|
|
59
59
|
"update-notifier": "^7.3.1"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "4247555f57017ffc9297e5e5e031c4119de3ebaf"
|
|
62
62
|
}
|
|
File without changes
|