I wrote this little script to generate a mermaidjs representation of the dependency tree (using the state machine setting as that maps well to a dependency tree)
import fs from 'fs'
const componentNames = fs.readdirSync('./components')
const packages = componentNames.flatMap(component =>
Object.keys(JSON.parse(fs.readFileSync(`./components/${component}/package.json`, 'utf8')).peerDependencies || {})
.filter(name => name.startsWith('@financial-times/o-'))
.map(name => name.replace('@financial-times/', ''))
.map(dep => ([component.replace(/-/g, '_'), dep.replace(/-/g, '_')]) )
.map(([comp, dep]) => ` ${comp} --> ${dep}`)
).join('\n')
console.log(`stateDiagram-v2
${packages}`)