markmap-cli 0.17.3-beta.3 → 0.18.0

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.
@@ -1,4 +1,4 @@
1
- import { IDevelopOptions, IContentProvider } from './types';
1
+ import { IContentProvider, IDevelopOptions } from './types';
2
2
  export declare function develop(fileName: string | undefined, options: IDevelopOptions): Promise<{
3
3
  provider: IContentProvider;
4
4
  close(): Promise<void>;
package/dist/index.js CHANGED
@@ -10,13 +10,13 @@ import { Transformer } from "markmap-lib";
10
10
  export * from "markmap-lib";
11
11
  import { fillTemplate, baseJsPaths } from "markmap-render";
12
12
  import { serve } from "@hono/node-server";
13
- import chokidar from "chokidar";
13
+ import { watch } from "chokidar";
14
14
  import { EventEmitter } from "events";
15
15
  import { createReadStream, createWriteStream } from "fs";
16
16
  import { Hono } from "hono";
17
17
  import { Readable } from "stream";
18
18
  import { finished } from "stream/promises";
19
- const TOOLBAR_VERSION = "0.17.3-beta.3";
19
+ const TOOLBAR_VERSION = "0.18.0";
20
20
  const TOOLBAR_CSS = `markmap-toolbar@${TOOLBAR_VERSION}/dist/style.css`;
21
21
  const TOOLBAR_JS = `markmap-toolbar@${TOOLBAR_VERSION}/dist/index.js`;
22
22
  const currentDir = dirname(fileURLToPath(import.meta.url));
@@ -72,7 +72,7 @@ function createStreamBody(stream) {
72
72
  const config = {
73
73
  assetsDir: `${currentDir}${ASSETS_PREFIX}`
74
74
  };
75
- var getMimeType = (filename) => {
75
+ var getMimeType = (filename, mimes = baseMimes) => {
76
76
  const regexp = /\.([a-zA-Z0-9]+?)$/;
77
77
  const match = filename.match(regexp);
78
78
  if (!match) {
@@ -84,23 +84,15 @@ var getMimeType = (filename) => {
84
84
  }
85
85
  return mimeType;
86
86
  };
87
- var mimes = {
87
+ var _baseMimes = {
88
88
  aac: "audio/aac",
89
- abw: "application/x-abiword",
90
- arc: "application/x-freearc",
91
89
  avi: "video/x-msvideo",
92
90
  avif: "image/avif",
93
91
  av1: "video/av1",
94
- azw: "application/vnd.amazon.ebook",
95
92
  bin: "application/octet-stream",
96
93
  bmp: "image/bmp",
97
- bz: "application/x-bzip",
98
- bz2: "application/x-bzip2",
99
- csh: "application/x-csh",
100
94
  css: "text/css",
101
95
  csv: "text/csv",
102
- doc: "application/msword",
103
- docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
104
96
  eot: "application/vnd.ms-fontobject",
105
97
  epub: "application/epub+zip",
106
98
  gif: "image/gif",
@@ -109,7 +101,6 @@ var mimes = {
109
101
  html: "text/html",
110
102
  ico: "image/x-icon",
111
103
  ics: "text/calendar",
112
- jar: "application/java-archive",
113
104
  jpeg: "image/jpeg",
114
105
  jpg: "image/jpeg",
115
106
  js: "text/javascript",
@@ -122,31 +113,20 @@ var mimes = {
122
113
  mp3: "audio/mpeg",
123
114
  mp4: "video/mp4",
124
115
  mpeg: "video/mpeg",
125
- mpkg: "application/vnd.apple.installer+xml",
126
- odp: "application/vnd.oasis.opendocument.presentation",
127
- ods: "application/vnd.oasis.opendocument.spreadsheet",
128
- odt: "application/vnd.oasis.opendocument.text",
129
116
  oga: "audio/ogg",
130
117
  ogv: "video/ogg",
131
118
  ogx: "application/ogg",
132
119
  opus: "audio/opus",
133
120
  otf: "font/otf",
134
121
  pdf: "application/pdf",
135
- php: "application/php",
136
122
  png: "image/png",
137
- ppt: "application/vnd.ms-powerpoint",
138
- pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
139
123
  rtf: "application/rtf",
140
- sh: "application/x-sh",
141
124
  svg: "image/svg+xml",
142
- swf: "application/x-shockwave-flash",
143
- tar: "application/x-tar",
144
125
  tif: "image/tiff",
145
126
  tiff: "image/tiff",
146
127
  ts: "video/mp2t",
147
128
  ttf: "font/ttf",
148
129
  txt: "text/plain",
149
- vsd: "application/vnd.visio",
150
130
  wasm: "application/wasm",
151
131
  webm: "video/webm",
152
132
  weba: "audio/webm",
@@ -154,17 +134,14 @@ var mimes = {
154
134
  woff: "font/woff",
155
135
  woff2: "font/woff2",
156
136
  xhtml: "application/xhtml+xml",
157
- xls: "application/vnd.ms-excel",
158
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
159
137
  xml: "application/xml",
160
- xul: "application/vnd.mozilla.xul+xml",
161
138
  zip: "application/zip",
162
139
  "3gp": "video/3gpp",
163
140
  "3g2": "video/3gpp2",
164
- "7z": "application/x-7z-compressed",
165
141
  gltf: "model/gltf+json",
166
142
  glb: "model/gltf-binary"
167
143
  };
144
+ var baseMimes = _baseMimes;
168
145
  function sequence(fn) {
169
146
  let promise;
170
147
  return () => {
@@ -231,7 +208,7 @@ class FileSystemProvider extends BufferContentProvider {
231
208
  constructor(fileName) {
232
209
  super();
233
210
  this.fileName = fileName;
234
- this.watcher = chokidar.watch(fileName).on(
211
+ this.watcher = watch(fileName).on(
235
212
  "all",
236
213
  sequence(() => this.update())
237
214
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markmap-cli",
3
- "version": "0.17.3-beta.3+c10bd44",
3
+ "version": "0.18.0",
4
4
  "description": "Create markmaps from CLI",
5
5
  "author": "Gerald <gera2ld@live.com>",
6
6
  "license": "MIT",
@@ -28,8 +28,8 @@
28
28
  "clean": "del-cli dist",
29
29
  "build:types": "tsc",
30
30
  "build:js": "vite build",
31
- "build": "run-s clean build:*",
32
- "prepublishOnly": "run-s build",
31
+ "build": "pnpm clean && pnpm /^build:/",
32
+ "prepublishOnly": "pnpm build",
33
33
  "postinstall": "node -e \"import('./dist/index.js').then(({ fetchAssets }) => fetchAssets()).catch(() => {})\""
34
34
  },
35
35
  "bugs": {
@@ -44,19 +44,19 @@
44
44
  ],
45
45
  "typings": "dist/index.d.ts",
46
46
  "dependencies": {
47
- "@babel/runtime": "^7.23.6",
48
- "@hono/node-server": "^1.3.3",
49
- "chokidar": "^3.5.3",
50
- "commander": "^11.1.0",
51
- "hono": "^3.11.8",
52
- "markmap-common": "0.17.3-beta.3+c10bd44",
53
- "markmap-lib": "0.17.3-beta.3+c10bd44",
54
- "markmap-render": "0.17.3-beta.3+c10bd44",
55
- "markmap-toolbar": "0.17.3-beta.3+c10bd44",
56
- "open": "^10.0.0",
47
+ "@babel/runtime": "^7.26.0",
48
+ "@hono/node-server": "^1.13.7",
49
+ "chokidar": "^4.0.1",
50
+ "commander": "^12.1.0",
51
+ "hono": "^4.6.13",
52
+ "markmap-common": "0.18.0",
53
+ "markmap-lib": "0.18.0",
54
+ "markmap-render": "0.18.0",
55
+ "markmap-toolbar": "0.18.0",
56
+ "open": "^10.1.0",
57
57
  "pkg-dir": "^8.0.0",
58
58
  "read-package-up": "^11.0.0",
59
- "update-notifier": "^7.0.0"
59
+ "update-notifier": "^7.3.1"
60
60
  },
61
- "gitHead": "c10bd4443841e8204380256cf0fccfc72abdde2f"
61
+ "gitHead": "652d042cdd980487e5de70c8e1405ecf0721fa9c"
62
62
  }