embed 之間需要按引用關係構造,所以用 topological sort 排序(從 metadata.json 中復原依賴關係)後按順序編譯 通過分成兩階段生成,可以讓 index 引入 embed 的內容