Skip to content

Commit bbb7c2c

Browse files
committed
moved yaml transpilation to transpile phase
1 parent 7fa1f41 commit bbb7c2c

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

packages/cubejs-schema-compiler/src/compiler/DataSchemaCompiler.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ export class DataSchemaCompiler {
483483

484484
return file;
485485
} else if (file.fileName.endsWith('.yml') || file.fileName.endsWith('.yaml')) {
486-
return file;
486+
return this.yamlCompiler.transpileYamlFile(file, errorsReport);
487487
} else if (file.fileName.endsWith('.js')) {
488488
return this.transpileJsFile(file, errorsReport, options);
489489
} else {
@@ -678,10 +678,8 @@ export class DataSchemaCompiler {
678678
this.pythonContext!
679679
));
680680
} else if (file.fileName.endsWith('.yml') || file.fileName.endsWith('.yaml')) {
681-
const transpiledFile = this.yamlCompiler.compileYamlFile(file, errorsReport);
682-
if (transpiledFile) {
683-
this.compileJsFile(transpiledFile, errorsReport);
684-
}
681+
// original yaml file was already transpiled into js
682+
this.compileJsFile(file, errorsReport);
685683
}
686684
}
687685

packages/cubejs-schema-compiler/src/compiler/YamlCompiler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class YamlCompiler {
7171
) {
7272
const renderedFile = await this.renderTemplate(file, compileContext, pythonContext);
7373

74-
const transpiledFile = this.compileYamlFile(renderedFile, errorsReport);
74+
const transpiledFile = this.transpileYamlFile(renderedFile, errorsReport);
7575

7676
if (!transpiledFile) {
7777
return;
@@ -80,7 +80,7 @@ export class YamlCompiler {
8080
this.dataSchemaCompiler?.compileJsFile(transpiledFile, errorsReport);
8181
}
8282

83-
public compileYamlFile(
83+
public transpileYamlFile(
8484
file: FileContent,
8585
errorsReport: ErrorReporter,
8686
): FileContent | undefined {

0 commit comments

Comments
 (0)