@gravity-ui/app-builder 0.42.0-beta.1 → 0.42.0-beta.3
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.
|
@@ -10,5 +10,5 @@ export declare function displayFilename(originalFunc: (path: string, encoding?:
|
|
|
10
10
|
};
|
|
11
11
|
export declare function onHostEvent<F extends string, T extends {
|
|
12
12
|
[key in F]?: (...args: any[]) => any;
|
|
13
|
-
}>(host: T, functionName: F, before?: (...args: Parameters<NonNullable<T[F]>>) => void, after?: (res: ReturnType<NonNullable<T[F]>>) => void): void;
|
|
13
|
+
}>(host: T, functionName: F, before?: (...args: Parameters<NonNullable<T[F]>>) => void, after?: (res: ReturnType<NonNullable<T[F]>>, ...args: Parameters<NonNullable<T[F]>>) => void): void;
|
|
14
14
|
export declare function resolveTypescript(): string;
|
|
@@ -10,20 +10,25 @@ function watch(ts, projectPath, { logger, onAfterFilesEmitted, enableSourceMap,
|
|
|
10
10
|
const configPath = (0, utils_1.getTsProjectConfigPath)(ts, projectPath);
|
|
11
11
|
const createProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram;
|
|
12
12
|
const host = ts.createSolutionBuilderWithWatchHost(ts.sys, createProgram, reportDiagnostic, reportDiagnostic, reportWatchStatusChanged);
|
|
13
|
-
|
|
14
|
-
(0, utils_1.onHostEvent)(host, 'createProgram', () => {
|
|
13
|
+
(0, utils_1.onHostEvent)(host, 'createProgram', (_rootnames, _options, host) => {
|
|
15
14
|
logger.verbose("We're about to create the program");
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
if (host) {
|
|
16
|
+
host.readFile = (0, utils_1.displayFilename)(host.readFile, 'Reading', logger);
|
|
17
|
+
// @ts-expect-error
|
|
18
|
+
host.readFile.enableDisplay();
|
|
19
|
+
}
|
|
20
|
+
}, (_result, _rootnames, _options, host) => {
|
|
21
|
+
if (host) {
|
|
22
|
+
// @ts-expect-error
|
|
23
|
+
const count = host.readFile.disableDisplay();
|
|
24
|
+
logger.verbose(`Program created, read ${count} files`);
|
|
25
|
+
}
|
|
22
26
|
});
|
|
23
|
-
(0, utils_1.onHostEvent)(host, 'afterProgramEmitAndDiagnostics', () => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
(0, utils_1.onHostEvent)(host, 'afterProgramEmitAndDiagnostics', (program) => {
|
|
28
|
+
const project = program.getCompilerOptions().configFilePath;
|
|
29
|
+
logger.verbose(typeof project === 'string'
|
|
30
|
+
? `Emit completed for ${project.replace(process.cwd(), '')}!`
|
|
31
|
+
: 'Emit completed!');
|
|
27
32
|
});
|
|
28
33
|
// `createSolutionBuilderWithWatch` creates an initial program, watches files, and updates
|
|
29
34
|
// the program over time.
|
|
@@ -60,5 +65,8 @@ function watch(ts, projectPath, { logger, onAfterFilesEmitted, enableSourceMap,
|
|
|
60
65
|
if (diagnostic.messageText) {
|
|
61
66
|
logger.message(ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine));
|
|
62
67
|
}
|
|
68
|
+
if (diagnostic.code === 6194 || diagnostic.code === 6193) {
|
|
69
|
+
onAfterFilesEmitted?.();
|
|
70
|
+
}
|
|
63
71
|
}
|
|
64
72
|
}
|
package/package.json
CHANGED