@doocs/md-cli 2.1.0 → 2.1.2
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/dist/index.html +4 -4
- package/dist/static/js/{md-codemirror-MRxDuA8t.js → md-codemirror-DdzaCDSe.js} +1 -1
- package/dist/static/js/{md-index-BW8_1riI.js → md-index-BQt1agJq.js} +1 -1
- package/dist/static/js/{md-prettier-ufsW4nrk.js → md-prettier-CQTFnaAe.js} +1 -1
- package/dist/static/js/{md-vendor_.pnpm-DWDCHssx.js → md-vendor_.pnpm-CE4UQQls.js} +15 -15
- package/index.js +1 -1
- package/package.json +8 -4
- package/server.js +11 -13
- package/util.js +3 -5
package/index.js
CHANGED
|
@@ -29,7 +29,7 @@ async function startServer() {
|
|
|
29
29
|
|
|
30
30
|
app.listen(port, '127.0.0.1', () => {
|
|
31
31
|
console.log(`服务已启动:`)
|
|
32
|
-
console.log(`打开链接 ${colors.green(`http://127.0.0.1:${port}
|
|
32
|
+
console.log(`打开链接 ${colors.green(`http://127.0.0.1:${port}`)} 即刻使用吧~`)
|
|
33
33
|
console.log(``)
|
|
34
34
|
|
|
35
35
|
const { spaceId, clientSecret } = arg
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doocs/md-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "WeChat Markdown Editor | 一款高度简洁的微信 Markdown 编辑器:支持 Markdown 语法、自定义主题样式、内容管理、多图床、AI 助手等特性",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
+
"dev": "nodemon index.js"
|
|
9
10
|
},
|
|
10
11
|
"bin": {
|
|
11
12
|
"md-cli": "index.js"
|
|
@@ -22,10 +23,13 @@
|
|
|
22
23
|
"license": "ISC",
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"express": "^5.1.0",
|
|
25
|
-
"multer": "^2.0.2",
|
|
26
|
-
"http-proxy-middleware": "^3.0.5",
|
|
27
26
|
"form-data": "4.0.4",
|
|
28
27
|
"get-port": "7.1.0",
|
|
28
|
+
"http-proxy-middleware": "^3.0.5",
|
|
29
|
+
"multer": "^2.0.2",
|
|
29
30
|
"node-fetch": "^3.3.2"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"nodemon": "^3.1.10"
|
|
30
34
|
}
|
|
31
35
|
}
|
package/server.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import express from 'express'
|
|
2
2
|
import multer from 'multer'
|
|
3
|
-
import path from 'path'
|
|
4
|
-
import fs from 'fs'
|
|
5
|
-
import { fileURLToPath } from 'url'
|
|
6
|
-
import { dirname } from 'path'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
import fs from 'node:fs'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
import { dirname } from 'node:path'
|
|
7
7
|
import { createProxyMiddleware } from 'http-proxy-middleware'
|
|
8
8
|
import {
|
|
9
9
|
dcloud,
|
|
@@ -88,17 +88,15 @@ export function createServer(port = 8800) {
|
|
|
88
88
|
}
|
|
89
89
|
})
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
res.redirect('/md/')
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
console.log('代理到: https://md.doocs.workers.dev')
|
|
91
|
+
console.log('代理到: https://md.doocs.org/')
|
|
96
92
|
app.use(createProxyMiddleware({
|
|
97
|
-
target: 'https://md.doocs.
|
|
93
|
+
target: 'https://md.doocs.org/',
|
|
98
94
|
changeOrigin: true,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
on: {
|
|
96
|
+
error: (err, req, res) => {
|
|
97
|
+
console.error(`代理错误 ${req.path}:`, err)
|
|
98
|
+
res.status(502).send(`代理服务暂不可用,请检查网络连接 ${err.message}`)
|
|
99
|
+
},
|
|
102
100
|
},
|
|
103
101
|
}))
|
|
104
102
|
|
package/util.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import FormData from 'form-data'
|
|
2
|
-
import process from 'process'
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import util from 'util'
|
|
6
|
-
import crypto from 'crypto'
|
|
2
|
+
import process from 'node:process'
|
|
3
|
+
import util from 'node:util'
|
|
4
|
+
import crypto from 'node:crypto'
|
|
7
5
|
|
|
8
6
|
const fetch = (...args) => import(`node-fetch`).then(({ default: fetch }) => fetch(...args))
|
|
9
7
|
|