quartz-research-note/quartz/worker.ts

17 lines
489 B
TypeScript
Raw Normal View History

import cfg from "../quartz.config"
import { Argv, BuildCtx } from "./ctx"
2023-07-13 07:19:35 +00:00
import { FilePath, ServerSlug } from "./path"
2023-06-04 17:37:43 +00:00
import { createFileParser, createProcessor } from "./processors/parse"
2023-06-04 16:35:45 +00:00
// only called from worker thread
export async function parseFiles(argv: Argv, fps: FilePath[], allSlugs: ServerSlug[]) {
const ctx: BuildCtx = {
cfg,
argv,
2023-07-24 07:04:01 +00:00
allSlugs,
}
2023-07-24 07:04:01 +00:00
const processor = createProcessor(ctx)
const parse = createFileParser(ctx, fps)
2023-06-04 17:37:43 +00:00
return parse(processor)
2023-06-04 16:35:45 +00:00
}