refactor(tools,client): remove head and tail logic (#66524)

This commit is contained in:
Sem Bauke
2026-03-17 17:59:16 +01:00
committed by GitHub
parent 1990ba6794
commit e66bf09dce
34 changed files with 24 additions and 998 deletions
@@ -10,11 +10,9 @@ const props = {
contents: '',
editableRegionBoundaries: [0, 2],
ext: 'html',
head: '',
id: '',
key: 'indexhtml',
name: 'index',
tail: ''
name: 'index'
}
],
stepNum: 5,
@@ -33,8 +33,6 @@ export interface ChallengeSeed {
contents: string;
ext: string;
editableRegionBoundaries: number[];
head?: string;
tail?: string;
}
// Build the base markdown for a step
@@ -56,20 +54,8 @@ function getStepTemplate({
})
.join('\n');
const seedHeads = challengeSeeds
.filter(({ head }) => head)
.map(({ ext, head }) => getCodeBlock(ext, head))
.join('\n');
const seedTails = challengeSeeds
.filter(({ tail }) => tail)
.map(({ ext, tail }) => getCodeBlock(ext, tail))
.join('\n');
const stepDescription = `step ${stepNum} instructions`;
const seedChallengeSection = getSeedSection(seedTexts, 'seed-contents');
const seedHeadSection = getSeedSection(seedHeads, 'before-user-code');
const seedTailSection = getSeedSection(seedTails, 'after-user-code');
const demoString = isFirstChallenge
? `
@@ -99,10 +85,7 @@ ${stepDescription}
Test 1
${getCodeBlock('js')}
# --seed--` +
seedChallengeSection +
seedHeadSection +
seedTailSection
# --seed--` + seedChallengeSection
);
}