From 1827e2e78bffb78a7f2734b6c4e6a047af7015e7 Mon Sep 17 00:00:00 2001 From: Sem Bauke Date: Fri, 9 Jan 2026 11:23:52 +0100 Subject: [PATCH] feat: supply scene-assets to external curriculum v2 (#65055) --- .../components/scene/scene-assets.tsx | 2 +- .../build-external-curricula-data-v2.ts | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/client/src/templates/Challenges/components/scene/scene-assets.tsx b/client/src/templates/Challenges/components/scene/scene-assets.tsx index 88b6a98813f..cccd10789ff 100644 --- a/client/src/templates/Challenges/components/scene/scene-assets.tsx +++ b/client/src/templates/Challenges/components/scene/scene-assets.tsx @@ -1,5 +1,5 @@ // TODO: get domain from env -const domain = +export const domain = 'https://cdn.freecodecamp.org/curriculum/english/animation-assets'; export const sounds = `${domain}/sounds`; diff --git a/client/tools/external-curriculum/build-external-curricula-data-v2.ts b/client/tools/external-curriculum/build-external-curricula-data-v2.ts index d3a0b9186f0..a6129e6c044 100644 --- a/client/tools/external-curriculum/build-external-curricula-data-v2.ts +++ b/client/tools/external-curriculum/build-external-curricula-data-v2.ts @@ -10,6 +10,16 @@ import { import type { Chapter } from '../../../shared-dist/config/chapters'; import { getSuperblockStructure } from '../../../curriculum/src/file-handler'; import { patchBlock } from './patches'; +import { + availableBackgrounds, + availableAudios +} from '../../../curriculum/schema/scene-assets.js'; +import { + characterAssets, + sounds, + backgrounds, + domain +} from '../../src/templates/Challenges/components/scene/scene-assets.js'; export type CurriculumIntros = | BlockBasedCurriculumIntros @@ -313,6 +323,7 @@ export function buildExtCurriculumDataV2( parseCurriculumData(); getSubmitTypes(); + getSceneAssets(); function parseCurriculumData() { const superBlockKeys = Object.values(SuperBlocks).filter(x => @@ -434,4 +445,20 @@ export function buildExtCurriculumDataV2( JSON.stringify(submitTypes, null, 2) ); } + + function getSceneAssets() { + const sceneAssets = { + domain, + backgrounds, + sounds, + availableBackgrounds, + availableAudios, + characterAssets + }; + + writeFileSync( + `${dataPath}/${ver}/scene-assets.json`, + JSON.stringify(sceneAssets, null, 2) + ); + } }