chore: remove legacy SSR checks and consolidate migration maintenance
This commit is contained in:
+12
-2
@@ -8,8 +8,18 @@ const git = (...args) =>
|
||||
encoding: "utf8",
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
}).trim();
|
||||
const tasks = JSON.parse(
|
||||
fs.readFileSync(path.join(root, "docs/tasks/tasks.json"), "utf8"),
|
||||
// Task metadata lives only in each card's JSON metadata comment.
|
||||
const tasks = Object.fromEntries(
|
||||
fs
|
||||
.readdirSync(path.join(root, "docs/tasks"))
|
||||
.filter((name) => name.endsWith(".md"))
|
||||
.flatMap((name) => {
|
||||
const text = fs.readFileSync(path.join(root, "docs/tasks", name), "utf8");
|
||||
const match = text.match(
|
||||
/^<!-- task-metadata\r?\n(\{[\s\S]*?\})\r?\n-->/,
|
||||
);
|
||||
return match ? [[name.slice(0, -3), JSON.parse(match[1])]] : [];
|
||||
}),
|
||||
);
|
||||
const id = process.argv[2];
|
||||
if (!id || !Object.hasOwn(tasks, id)) {
|
||||
|
||||
Reference in New Issue
Block a user