mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(challenge-helper-scripts): add stub module intro when creating a new module (#65366)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user