@gravity-ui/app-builder 0.41.0-beta.3 → 0.41.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,13 +13,17 @@ function compile(ts, { projectPath, configFileName = 'tsconfig.json', logger })
|
|
|
13
13
|
logger.verbose('Config found and parsed');
|
|
14
14
|
logger.verbose("We're about to create the program");
|
|
15
15
|
const compilerHost = ts.createSolutionBuilderHost(ts.sys, ts.createEmitAndSemanticDiagnosticsBuilderProgram, reportDiagnostic, reportDiagnostic);
|
|
16
|
-
compilerHost.readFile = (0, utils_1.displayFilename)(compilerHost.readFile, 'Reading', logger);
|
|
17
16
|
const solutionBuilder = ts.createSolutionBuilder(compilerHost, [(0, utils_1.getTsProjectConfigPath)(ts, projectPath, configFileName)], { noEmitOnError: true });
|
|
18
17
|
const transformPathsToLocalModules = (0, transformers_1.createTransformPathsToLocalModules)(ts);
|
|
19
18
|
let project = solutionBuilder.getNextInvalidatedProject();
|
|
19
|
+
if (!project) {
|
|
20
|
+
logger.warning("Seems like files have already been emitted and haven't changed since then. Emitting skipped.");
|
|
21
|
+
}
|
|
20
22
|
do {
|
|
21
23
|
if (project?.kind === ts.InvalidatedProjectKind.Build) {
|
|
22
24
|
const configPath = project.project.replace(process.cwd(), '');
|
|
25
|
+
const originalReadFile = compilerHost.readFile;
|
|
26
|
+
compilerHost.readFile = (0, utils_1.displayFilename)(originalReadFile, 'Reading', logger);
|
|
23
27
|
// @ts-expect-error We invoke method from overrided function
|
|
24
28
|
compilerHost.readFile.enableDisplay();
|
|
25
29
|
const program = project.getProgram();
|
|
@@ -27,11 +31,13 @@ function compile(ts, { projectPath, configFileName = 'tsconfig.json', logger })
|
|
|
27
31
|
logger.verbose(`Program was not created, skip emitting for ${configPath}`);
|
|
28
32
|
// @ts-expect-error We invoke method from overrided function
|
|
29
33
|
compilerHost.readFile.disableDisplay();
|
|
34
|
+
compilerHost.readFile = originalReadFile;
|
|
30
35
|
next();
|
|
31
36
|
continue;
|
|
32
37
|
}
|
|
33
38
|
// @ts-expect-error We invoke method from overrided function
|
|
34
39
|
const filesCount = compilerHost.readFile.disableDisplay();
|
|
40
|
+
compilerHost.readFile = originalReadFile;
|
|
35
41
|
logger.verbose(`Program created, read ${filesCount} files`);
|
|
36
42
|
let allDiagnostics = ts.getPreEmitDiagnostics(program);
|
|
37
43
|
if (!hasErrors(allDiagnostics)) {
|
package/package.json
CHANGED