@@ -498,33 +498,9 @@ export class DataSchemaCompiler {
498498 ( file . fileName . endsWith ( '.yml' ) || file . fileName . endsWith ( '.yaml' ) )
499499 && file . content . match ( JINJA_SYNTAX )
500500 ) {
501- const transpiledFile = await this . yamlCompiler . compileYamlWithJinjaFile (
502- file ,
503- errorsReport ,
504- this . standalone ? { } : this . cloneCompileContextWithGetterAlias ( this . compileContext ) ,
505- this . pythonContext !
506- ) ;
507- if ( transpiledFile ) {
508- // We update the jinja/yaml file content to the transpiled js content
509- // and raise related flag so it will go JS transpilation flow afterward
510- // avoiding costly YAML/Python parsing again.
511- file . content = transpiledFile . content ;
512- file . convertedToJs = true ;
513- }
514-
515- return transpiledFile ;
501+ return this . transpileJinjaFile ( file , errorsReport , options ) ;
516502 } else if ( file . fileName . endsWith ( '.yml' ) || file . fileName . endsWith ( '.yaml' ) ) {
517- const transpiledFile = this . yamlCompiler . transpileYamlFile ( file , errorsReport ) ;
518-
519- if ( transpiledFile ) {
520- // We update the yaml file content to the transpiled js content
521- // and raise related flag so it will go JS transpilation flow afterward
522- // avoiding costly YAML/Python parsing again.
523- file . content = transpiledFile . content ;
524- file . convertedToJs = true ;
525- }
526-
527- return transpiledFile ;
503+ return this . transpileYamlFile ( file , errorsReport , options ) ;
528504 } else {
529505 return file ;
530506 }
@@ -647,6 +623,58 @@ export class DataSchemaCompiler {
647623 return undefined ;
648624 }
649625
626+ private async transpileYamlFile (
627+ file : FileContent ,
628+ errorsReport : ErrorReporter ,
629+ { cubeNames, cubeSymbols, contextSymbols, transpilerNames, compilerId, stage } : TranspileOptions
630+ ) : Promise < ( FileContent | undefined ) > {
631+ // if (getEnv('transpilationNative')) {
632+ //
633+ // } else if (getEnv('transpilationWorkerThreads')) {
634+ //
635+ // } else {
636+ const transpiledFile = this . yamlCompiler . transpileYamlFile ( file , errorsReport ) ;
637+
638+ if ( transpiledFile ) {
639+ // We update the yaml file content to the transpiled js content
640+ // and raise related flag so it will go JS transpilation flow afterward
641+ // avoiding costly YAML/Python parsing again.
642+ file . content = transpiledFile . content ;
643+ file . convertedToJs = true ;
644+ }
645+
646+ return transpiledFile ;
647+ // }
648+ }
649+
650+ private async transpileJinjaFile (
651+ file : FileContent ,
652+ errorsReport : ErrorReporter ,
653+ { cubeNames, cubeSymbols, contextSymbols, transpilerNames, compilerId, stage } : TranspileOptions
654+ ) : Promise < ( FileContent | undefined ) > {
655+ // if (getEnv('transpilationNative')) {
656+ //
657+ // } else if (getEnv('transpilationWorkerThreads')) {
658+ //
659+ // } else {
660+ const transpiledFile = await this . yamlCompiler . compileYamlWithJinjaFile (
661+ file ,
662+ errorsReport ,
663+ this . standalone ? { } : this . cloneCompileContextWithGetterAlias ( this . compileContext ) ,
664+ this . pythonContext !
665+ ) ;
666+ if ( transpiledFile ) {
667+ // We update the jinja/yaml file content to the transpiled js content
668+ // and raise related flag so it will go JS transpilation flow afterward
669+ // avoiding costly YAML/Python parsing again.
670+ file . content = transpiledFile . content ;
671+ file . convertedToJs = true ;
672+ }
673+
674+ return transpiledFile ;
675+ // }
676+ }
677+
650678 public withQuery ( query , fn ) {
651679 const oldQuery = this . currentQuery ;
652680 this . currentQuery = query ;
0 commit comments