fix(challenge-helper-scripts): add stub module intro when creating a new module (#65366)

This commit is contained in:
Huyen Nguyen
2026-01-21 02:57:01 +07:00
committed by GitHub
parent 028844450c
commit f81448bfe8
@@ -47,6 +47,7 @@ type SuperBlockInfo = {
blocks: Record<string, BlockInfo>;
chapters?: Record<string, string>;
modules?: Record<string, string>;
'module-intros'?: Record<string, { intro: string[]; note: string }>;
};
type IntroJson = Record<SuperBlocks, SuperBlockInfo>;
@@ -192,6 +193,16 @@ async function updateIntroJson({
if (!newIntro[superBlock].modules[module]) {
newIntro[superBlock].modules[module] = moduleTitle;
}
if (!newIntro[superBlock]['module-intros']) {
newIntro[superBlock]['module-intros'] = {};
}
if (!newIntro[superBlock]['module-intros'][module]) {
newIntro[superBlock]['module-intros'][module] = {
note: '',
intro: ['']
};
}
}
void withTrace(