Export template source from 11bc3ae35b0034c113daca4c35d1b341aa31ef70:examples/local-first/packages/gutenberg-runtime

This commit is contained in:
Quixos Template Publisher
2000-01-01 00:00:00 +00:00
commit f465fce397
14 changed files with 627 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
import { readFile, writeFile } from "node:fs/promises";
import { parseIndex } from "./src/catalog.ts";
const books = parseIndex(await readFile(process.argv[2], "utf8"));
if (
books.length < 70000 ||
!books.some((b) => b.ebook === 1342 && b.title.includes("Pride")) ||
!books.some((b) => b.ebook === 11 && b.title.includes("Alice"))
)
throw Error("Gutenberg CSV format/coverage changed; review parser before updating pin");
await writeFile(process.argv[3], "export default " + JSON.stringify(books) + ";\n");
console.log("Indexed", books.length, "Gutenberg titles");