-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
55 lines (54 loc) · 1.65 KB
/
Copy pathtsdown.config.ts
File metadata and controls
55 lines (54 loc) · 1.65 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
import { defineConfig } from 'tsdown'
export default defineConfig({
entry: [
'src/index.ts',
'src/schemas.ts',
'src/algorithms.ts',
'src/format-support.ts',
'src/queries.ts',
// Kernel — public fast-path primitives for plugins & large graphs
'src/kernel.ts',
// Formats — each gets its own subpath export
'src/formats/adjacency-list/index.ts',
'src/formats/converter/index.ts',
'src/formats/cytoscape/index.ts',
'src/formats/d2/index.ts',
'src/formats/d3/index.ts',
'src/formats/dot/index.ts',
'src/formats/edge-list/index.ts',
'src/formats/gexf/index.ts',
'src/formats/gml/index.ts',
'src/formats/graphml/index.ts',
'src/formats/jgf/index.ts',
'src/formats/tgf/index.ts',
'src/formats/elk/index.ts',
'src/formats/xyflow/index.ts',
'src/formats/mermaid/index.ts',
// Layout — contract + per-engine adapters (optional peers)
'src/layout/index.ts',
'src/layout/elk.ts',
'src/layout/dagre.ts',
'src/layout/d3-force.ts',
'src/layout/graphviz.ts',
'src/layout/forceatlas2.ts',
'src/layout/d3-hierarchy.ts',
'src/layout/webcola.ts',
'src/layout/cytoscape.ts',
// XState adapter (optional peer)
'src/xstate/index.ts',
],
exports: {
customExports(exports) {
const remapped: Record<string, any> = {};
for (const [key, value] of Object.entries(exports)) {
// Strip ./formats/ prefix → ./cytoscape, ./dot, etc.
if (key.startsWith('./formats/')) {
remapped[key.replace('./formats/', './')] = value;
} else {
remapped[key] = value;
}
}
return remapped;
},
},
})