MCPcopy Create free account
hub / github.com/arktypeio/arktype / readProjectWith

Function readProjectWith

ark/aot/nextProgram.ts:689–710  ·  view source on GitHub ↗
(
	root: string,
	config: NextConfigLike,
	given?: PrecompilePluginOptions
)

Source from the content-addressed store, hash-verified

687// the read withPrecompile runs, under the options next.config gives the loader,
688// as each loader process resolves them
689export const readProjectWith = async (
690 root: string,
691 config: NextConfigLike,
692 given?: PrecompilePluginOptions
693): Promise<{
694 refused: string | undefined
695 warnings: string[]
696 opts: PrecompilePluginOptions
697}> => {
698 const read = nextConfigReadOf(config, isOwnLoader)
699 const raw = given ?? ("options" in read ? read.options : {})
700 const opts = resolvedOptionsOf(
701 withSettingsFile(raw.cwd !== undefined ? raw : { ...raw, cwd: root }),
702 true
703 )
704 if (!readsWith(opts)) return { refused: undefined, warnings: [], opts }
705 const { refused, warnings } = await readProgram(root, opts, {
706 aliases: (config.turbopack?.resolveAlias ?? {}) as Record<string, unknown>,
707 problem: "problem" in read ? read.problem : babelProblemOf(root)
708 })
709 return { refused, warnings, opts }
710}
711
712const ownLoader = "@ark/aot/turbopack"
713

Callers 2

withPrecompileFunction · 0.90
loadFunction · 0.90

Calls 6

withSettingsFileFunction · 0.90
nextConfigReadOfFunction · 0.85
resolvedOptionsOfFunction · 0.85
readsWithFunction · 0.85
readProgramFunction · 0.85
babelProblemOfFunction · 0.85

Tested by 1

loadFunction · 0.72