-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypedoc-vitepress-sync.config.js
More file actions
71 lines (61 loc) · 1.92 KB
/
typedoc-vitepress-sync.config.js
File metadata and controls
71 lines (61 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**
* @fileoverview TypeDoc VitePress Sync Configuration
* Enhanced configuration for the Context-Action framework documentation sync
*
* Based on TypeDoc VitePress Sync best practices guide:
* @see docs/TYPEDOC_VITEPRESS_SYNC_GUIDE.md
*/
import { cpus } from 'os'
// Dynamic configuration based on project size
const projectSize = 'medium' // small (<50 files), medium (50-200), large (>200)
const sizeConfigs = {
small: {
cache: { ttl: 12 * 60 * 60 * 1000 }, // 12 hours
parallel: { maxWorkers: 2, batchSize: 5 }
},
medium: {
cache: { ttl: 24 * 60 * 60 * 1000 }, // 24 hours
parallel: { maxWorkers: 4, batchSize: 10 }
},
large: {
cache: { ttl: 48 * 60 * 60 * 1000 }, // 48 hours
parallel: { maxWorkers: Math.min(6, cpus().length), batchSize: 15 }
}
}
const config = sizeConfigs[projectSize]
export default {
// Source and target directories
sourceDir: './docs/api/generated',
targetDir: './docs/en/api',
sidebarConfigPath: './docs/.vitepress/config/api-spec.ts',
// Package mapping for proper organization
packageMapping: {
'core': 'core',
'react': 'react'
},
// Smart caching configuration - optimized for performance
cache: {
enabled: true,
dir: './.typedoc-vitepress-cache',
ttl: config.cache.ttl,
hashAlgorithm: 'sha256',
manifestFile: './.typedoc-vitepress-cache/manifest.json'
},
// Parallel processing for performance - CPU optimized
parallel: {
enabled: true,
maxWorkers: config.parallel.maxWorkers,
batchSize: config.parallel.batchSize
},
// Quality validation - comprehensive checks
quality: {
validateLinks: true, // Internal link integrity
validateMarkdown: true, // Markdown syntax validation
checkAccessibility: true // Accessibility compliance
},
// Metrics collection - performance monitoring
metrics: {
enabled: true,
outputFile: './reports/api-sync-metrics.json'
}
}