| 1234567891011121314151617 |
- /** 原型库元数据(_meta.js)读取:门户与 proto_list 共用的收录清单 */
- import { readFile } from "node:fs/promises";
- import { join } from "node:path";
- import { REPO } from "./git.js";
- export async function readMeta() {
- const src = await readFile(join(REPO, "_meta.js"), "utf8");
- return new Function("window", src + "; return window.PROTO_META;")({});
- }
- export function metaLines(meta) {
- return "\n\n收录清单(来自 _meta.js):\n" +
- meta.pages.map(p =>
- `· ${p.domain}/${p.name} [${p.status}] 初始来源:${p.initialSource.type}${p.initialSource.url ? "(" + p.initialSource.url + ")" : ""} 线上:${p.liveUrl || "待登记"} 更新:${p.updated}`
- ).join("\n") +
- `\n门户: ${join(REPO, "index.html")} · 线上系统入口: ${meta.live && meta.live.url ? meta.live.url : "待登记"}`;
- }
|