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