mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
feat: supply scene-assets to external curriculum v2 (#65055)
This commit is contained in:
@@ -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`;
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user