feat: v0.2.5 — 内置语法高亮 + exportPDF + benchmark + CI 并行

- 新增 src/highlight.ts 零依赖轻量高亮器:13 种语言,先转义后
  着色保证安全,输出 me-hl-* 类,MeEditor.highlight 即插即用
- exportTool 新增 editor.exportPDF()(隐藏 iframe + window.print),
  exportHTML/exportPDF 共用 HTML 构建逻辑
- imagePaste 支持 maxSizeKB 限制,超限 toast 警告
- npm run bench 性能基准:parseMarkdown 1MB ≈ 51ms
- CI 测试拆分为 parser/core/rest 三个并行 job + 跨版本 verify job
- docs.html/README 补齐新 API、事件、高亮文档;取消跟踪 dist 产物;
  版本 0.2.4 → 0.2.5,测试 725 → 768
This commit is contained in:
2026-08-09 08:59:55 +08:00
parent fae31bba60
commit 5919dd9f66
13 changed files with 641 additions and 58 deletions
+54 -15
View File
@@ -7,37 +7,76 @@ on:
branches: [master]
jobs:
test:
test-parser:
runs-on: debian-latest
timeout-minutes: 15
strategy:
matrix:
node-version: [18.x, 20.x, 22.x, 24.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run parser tests
run: npx jest tests/parser.test.ts tests/highlight.test.ts --forceExit --maxWorkers=1 --testTimeout=15000
env:
NODE_OPTIONS: --max-old-space-size=4096
test-core:
runs-on: debian-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run core tests
run: npx jest tests/core.test.ts tests/plugins.test.ts tests/index.test.ts --forceExit --maxWorkers=1 --testTimeout=15000
env:
NODE_OPTIONS: --max-old-space-size=4096
test-rest:
runs-on: debian-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run remaining tests
run: npx jest tests/themes.test.ts tests/i18n.test.ts tests/utils.test.ts tests/animations.test.ts tests/styles.test.ts --forceExit --maxWorkers=1 --testTimeout=15000
env:
NODE_OPTIONS: --max-old-space-size=4096
verify:
runs-on: debian-latest
timeout-minutes: 15
strategy:
matrix:
node-version: [18.x, 20.x, 24.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Type check
run: npm run typecheck
- name: Lint
run: npm run lint
continue-on-error: true
- name: Run tests
run: npx jest --forceExit --maxWorkers=1 --testTimeout=15000
env:
NODE_OPTIONS: --max-old-space-size=4096
- name: Build
run: npm run build