mirror of
https://github.com/morluto/rea.git
synced 2026-11-02 21:06:04 +00:00
fix(javascript): report application analysis progress on the CLI (#1008)
* fix(javascript): report application analysis progress on the CLI * test(cli): preserve progress in filtered output checks
This commit is contained in:
1 parent
51956c1a49
commit
7b18c58140
7 files changed
+138
-9
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { analyzeJavaScriptApplication } from "../application/javascript/JavaScriptApplicationService.js";
|
||||
import { createProgressReporter } from "../application/ProgressReporter.js";
|
||||
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
||||
import type { JsonValue } from "../domain/jsonValue.js";
|
||||
|
||||
@@ -6,7 +7,13 @@ import type { JsonValue } from "../domain/jsonValue.js";
|
||||
export const runCliJavaScriptApplicationAnalysis = async (
|
||||
input: unknown,
|
||||
): Promise<JsonValue> => {
|
||||
const result = await analyzeJavaScriptApplication(input);
|
||||
const progress = createProgressReporter(
|
||||
async (update) => {
|
||||
process.stderr.write(`${JSON.stringify({ rea_progress: update })}\n`);
|
||||
},
|
||||
{ minimumIntervalMs: 0 },
|
||||
);
|
||||
const result = await analyzeJavaScriptApplication(input, { progress });
|
||||
return result.ok ? result.value : cliError(result.error);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user