File tree Expand file tree Collapse file tree 2 files changed +5
-21
lines changed
client/src/templates/Challenges/rechallenge Expand file tree Collapse file tree 2 files changed +5
-21
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import sassData from '../../../../config/browser-scripts/sass-compile.json';
1313import {
1414 transformContents ,
1515 transformHeadTailAndContents ,
16- setExt ,
1716 compileHeadTail ,
1817 createSource
1918} from '../../../../../shared/utils/polyvinyl' ;
@@ -127,10 +126,10 @@ const getJSXTranspiler = loopProtectOptions => async challengeFile => {
127126 await loadBabel ( ) ;
128127 await loadPresetReact ( ) ;
129128 const babelOptions = getBabelOptions ( presetsJSX , loopProtectOptions ) ;
130- return flow (
131- partial ( transformHeadTailAndContents , babelTransformCode ( babelOptions ) ) ,
132- partial ( setExt , 'js' )
133- ) ( challengeFile ) ;
129+ return transformHeadTailAndContents (
130+ babelTransformCode ( babelOptions ) ,
131+ challengeFile
132+ ) ;
134133} ;
135134
136135const getTSTranspiler = loopProtectOptions => async challengeFile => {
@@ -265,9 +264,7 @@ export const embedFilesInHtml = async function (challengeFiles) {
265264
266265function challengeFilesToObject ( challengeFiles ) {
267266 const indexHtml = challengeFiles . find ( file => file . fileKey === 'indexhtml' ) ;
268- const indexJsx = challengeFiles . find (
269- file => file . fileKey === 'indexjs' && file . history [ 0 ] === 'index.jsx'
270- ) ;
267+ const indexJsx = challengeFiles . find ( file => file . fileKey === 'indexjsx' ) ;
271268 const stylesCss = challengeFiles . find ( file => file . fileKey === 'stylescss' ) ;
272269 const scriptJs = challengeFiles . find ( file => file . fileKey === 'scriptjs' ) ;
273270 const indexTs = challengeFiles . find ( file => file . fileKey === 'indexts' ) ;
Original file line number Diff line number Diff line change @@ -100,19 +100,6 @@ export function setContent(
100100 } ;
101101}
102102
103- export async function setExt ( ext : string , polyP : Promise < ChallengeFile > ) {
104- const poly = await polyP ;
105- checkPoly ( poly ) ;
106- const newPoly = {
107- ...poly ,
108- ext,
109- path : poly . name + '.' + ext ,
110- fileKey : poly . name + ext
111- } ;
112- newPoly . history = [ ...poly . history , newPoly . path ] ;
113- return newPoly ;
114- }
115-
116103// This is currently only used to add back properties that are not stored in the
117104// database.
118105export function regeneratePathAndHistory ( poly : ChallengeFile ) {
You can’t perform that action at this time.
0 commit comments