MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / buildPythonChallenge

Function buildPythonChallenge

packages/challenge-builder/src/build.ts:306–324  ·  view source on GitHub ↗
({
  challengeFiles,
  challengeType
}: BuildChallengeData)

Source from the content-addressed store, hash-verified

304}
305
306async function buildPythonChallenge({
307 challengeFiles,
308 challengeType
309}: BuildChallengeData): Promise<BuildResult> {
310 if (!challengeFiles) throw new Error('No challenge files provided');
311 const pipeLine = composeFunctions(
312 ...(getPythonTransformers() as unknown as ApplyFunctionProps[])
313 );
314 const finalFiles = await Promise.all(challengeFiles.map(pipeLine));
315 const error = finalFiles.find(({ error }) => error)?.error;
316 const sources = buildSourceMap(finalFiles);
317
318 return {
319 challengeType,
320 sources,
321 build: sources?.contents,
322 error
323 };
324}

Callers

nothing calls this directly

Calls 3

getPythonTransformersFunction · 0.90
composeFunctionsFunction · 0.85
buildSourceMapFunction · 0.85

Tested by

no test coverage detected