2023-08-09 08:52:49 +03:00
|
|
|
import sourceMapSupport from "source-map-support"
|
|
|
|
sourceMapSupport.install(options)
|
2023-07-24 03:07:19 +03:00
|
|
|
import cfg from "../quartz.config"
|
2023-08-17 08:04:15 +03:00
|
|
|
import { Argv, BuildCtx } from "./util/ctx"
|
2023-08-20 01:52:25 +03:00
|
|
|
import { FilePath, FullSlug } from "./util/path"
|
2023-06-04 20:37:43 +03:00
|
|
|
import { createFileParser, createProcessor } from "./processors/parse"
|
2023-08-17 08:09:11 +03:00
|
|
|
import { options } from "./util/sourcemap"
|
2023-06-04 19:35:45 +03:00
|
|
|
|
|
|
|
// only called from worker thread
|
2023-08-20 01:52:25 +03:00
|
|
|
export async function parseFiles(argv: Argv, fps: FilePath[], allSlugs: FullSlug[]) {
|
2023-07-24 03:07:19 +03:00
|
|
|
const ctx: BuildCtx = {
|
|
|
|
cfg,
|
|
|
|
argv,
|
2023-07-24 10:04:01 +03:00
|
|
|
allSlugs,
|
2023-07-24 03:07:19 +03:00
|
|
|
}
|
2023-07-24 10:04:01 +03:00
|
|
|
const processor = createProcessor(ctx)
|
|
|
|
const parse = createFileParser(ctx, fps)
|
2023-06-04 20:37:43 +03:00
|
|
|
return parse(processor)
|
2023-06-04 19:35:45 +03:00
|
|
|
}
|