refactor: use pre-built curriculum when starting client (#65878)

This commit is contained in:
Oliver Eyton-Williams
2026-02-19 08:55:33 +01:00
committed by GitHub
parent 052416e5bf
commit 990b64d229
10 changed files with 41 additions and 32 deletions
+9 -6
View File
@@ -2,10 +2,6 @@ const path = require('path');
const _ = require('lodash');
const {
getChallengesForLang
} = require('@freecodecamp/curriculum/get-challenges');
const {
getBlockCreator,
getSuperblocks,
@@ -14,12 +10,14 @@ const {
const {
getContentDir,
getBlockStructure,
getSuperblockStructure
getSuperblockStructure,
CURRICULUM_DIR
} = require('@freecodecamp/curriculum/file-handler');
const {
transformSuperBlock
} = require('@freecodecamp/curriculum/build-superblock');
const { getSuperOrder } = require('@freecodecamp/curriculum/super-order');
const { readFile } = require('fs/promises');
const curriculumLocale = process.env.CURRICULUM_LOCALE || 'english';
@@ -72,7 +70,12 @@ exports.replaceChallengeNodes = () => {
};
exports.buildChallenges = async function buildChallenges() {
const curriculum = await getChallengesForLang(curriculumLocale);
const curriculum = JSON.parse(
await readFile(
path.resolve(CURRICULUM_DIR, 'generated', 'curriculum.json'),
'utf-8'
)
);
const superBlocks = Object.keys(curriculum);
const blocks = superBlocks
.map(superBlock => curriculum[superBlock].blocks)