@gravity-ui/app-builder 0.42.0-beta.2 → 0.42.0

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.
@@ -52,6 +52,7 @@ function compile(ts, { projectPath, configFileName = 'tsconfig.json', logger })
52
52
  }
53
53
  }
54
54
  if (hasErrors(allDiagnostics)) {
55
+ allDiagnostics.forEach(reportDiagnostic);
55
56
  logger.error(`Error compile, elapsed time ${(0, pretty_time_1.elapsedTime)(start)}`);
56
57
  process.exit(1);
57
58
  }
@@ -4,6 +4,10 @@ exports.watch = watch;
4
4
  const transformers_1 = require("./transformers");
5
5
  const utils_1 = require("./utils");
6
6
  const diagnostic_1 = require("./diagnostic");
7
+ /** @see https://github.com/microsoft/TypeScript/blob/9059e5bda0bb603ae6b41eca09dcd2a071af45fd/src/compiler/diagnosticMessages.json#L5400-L5403 */
8
+ const COMPILATION_COMPLETE_WITH_ERROR = 6193;
9
+ /** @see https://github.com/microsoft/TypeScript/blob/9059e5bda0bb603ae6b41eca09dcd2a071af45fd/src/compiler/diagnosticMessages.json#L5404-L5407 */
10
+ const COMPILATION_COMPLETE_WITH_N_ERRORS = 6194;
7
11
  function watch(ts, projectPath, { logger, onAfterFilesEmitted, enableSourceMap, }) {
8
12
  logger.message('Start compilation in watch mode');
9
13
  logger.message(`Typescript v${ts.version}`);
@@ -25,8 +29,10 @@ function watch(ts, projectPath, { logger, onAfterFilesEmitted, enableSourceMap,
25
29
  }
26
30
  });
27
31
  (0, utils_1.onHostEvent)(host, 'afterProgramEmitAndDiagnostics', (program) => {
28
- const project = program.getCompilerOptions().project;
29
- logger.verbose(`Emit completed for ${project}!`);
32
+ const project = program.getCompilerOptions().configFilePath;
33
+ logger.verbose(typeof project === 'string'
34
+ ? `Emit completed for ${project.replace(process.cwd(), '')}!`
35
+ : 'Emit completed!');
30
36
  });
31
37
  // `createSolutionBuilderWithWatch` creates an initial program, watches files, and updates
32
38
  // the program over time.
@@ -63,7 +69,8 @@ function watch(ts, projectPath, { logger, onAfterFilesEmitted, enableSourceMap,
63
69
  if (diagnostic.messageText) {
64
70
  logger.message(ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine));
65
71
  }
66
- if (diagnostic.code === 6194 || diagnostic.code === 6193) {
72
+ if (diagnostic.code === COMPILATION_COMPLETE_WITH_ERROR ||
73
+ diagnostic.code === COMPILATION_COMPLETE_WITH_N_ERRORS) {
67
74
  onAfterFilesEmitted?.();
68
75
  }
69
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/app-builder",
3
- "version": "0.42.0-beta.2",
3
+ "version": "0.42.0",
4
4
  "description": "Develop and build your React client-server projects, powered by typescript and webpack",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",