md-to-mowen 1.3.0 → 1.3.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.
package/README.md CHANGED
@@ -135,7 +135,7 @@ md-to-mowen/
135
135
  │ ├── publish/ # 发布流水线编排
136
136
  │ └── shared/ # 工具函数
137
137
  ├── tests/ # 单元测试
138
- └── docs/ # 架构文档
138
+ └── docs/ # 学习指南与架构文档
139
139
  ```
140
140
 
141
141
  ## 开发
@@ -160,7 +160,7 @@ npm link
160
160
  ## 相关链接
161
161
 
162
162
  - [墨问开放 API 文档](https://mowen.apifox.cn/)
163
- - [架构设计文档](docs/CONCEPT.md)
163
+ - [学习指南与架构文档](docs/README.md)
164
164
 
165
165
  ## License
166
166
 
package/dist/cli/index.js CHANGED
@@ -15,6 +15,10 @@ import { mastToMarkdown } from '../mast/to-markdown.js';
15
15
  import { findMetadataPath, readMetadata, writeMetadata, lookupNote, upsertNote } from '../shared/metadata.js';
16
16
  import { loadConfig } from '../shared/config.js';
17
17
  const __dirname = dirname(fileURLToPath(import.meta.url));
18
+ // 从 package.json 读取版本号
19
+ const packageJsonPath = join(__dirname, '../../package.json');
20
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
21
+ const VERSION = packageJson.version;
18
22
  /** 按优先级搜索 .env 文件 */
19
23
  function searchEnvPaths() {
20
24
  const projectRoot = resolve(__dirname, '../../');
@@ -87,7 +91,7 @@ function saveApiKey(apiKey) {
87
91
  loadEnvConfig();
88
92
  // ── CLI ───────────────────────────────────────────────────────────────────────
89
93
  const program = new Command();
90
- program.name('md-to-mowen').description('将 Markdown(GFM)转换为墨问笔记').version('0.0.0');
94
+ program.name('md-to-mowen').description('将 Markdown(GFM)转换为墨问笔记').version(VERSION);
91
95
  // ── config ────────────────────────────────────────────────────────────────────
92
96
  program
93
97
  .command('config')
@@ -284,7 +284,7 @@ function convertList(listEl, doc, opts, ordered, depth) {
284
284
  paragraphContent.push(...extractInlineContent(liChild));
285
285
  }
286
286
  else {
287
- paragraphContent.push(...extractInlineContent(liChild));
287
+ paragraphContent.push(...extractInline([liChild]));
288
288
  }
289
289
  }
290
290
  // 构建带前缀的段落
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "md-to-mowen",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "将 Markdown(GFM)转换为墨问笔记的 CLI 工具",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,7 +25,8 @@
25
25
  "test:watch": "vitest",
26
26
  "build": "tsc -p tsconfig.json && sh scripts/postbuild.sh && chmod +x dist/cli/index.js",
27
27
  "release": "semantic-release",
28
- "prepare": "husky"
28
+ "prepare": "husky",
29
+ "postinstall": "npx playwright install chromium"
29
30
  },
30
31
  "keywords": [
31
32
  "markdown",
@@ -43,7 +44,8 @@
43
44
  "unist-util-visit": "^5.0.0",
44
45
  "hast-util-to-string": "^3.0.0",
45
46
  "commander": "^12.0.0",
46
- "dotenv": "^16.0.0"
47
+ "dotenv": "^16.0.0",
48
+ "playwright": "^1.40.0"
47
49
  },
48
50
  "devDependencies": {
49
51
  "@semantic-release/changelog": "^6.0.3",
@@ -59,7 +61,6 @@
59
61
  "semantic-release": "^24.0.0",
60
62
  "tsx": "^4.0.0",
61
63
  "typescript": "^5.0.0",
62
- "vitest": "^1.0.0",
63
- "playwright": "^1.0.0"
64
+ "vitest": "^1.0.0"
64
65
  }
65
66
  }