mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor: use pre-built curriculum when starting client (#65878)
This commit is contained in:
committed by
GitHub
parent
052416e5bf
commit
990b64d229
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user