refact: ink based terminal view (#17)

This commit is contained in:
Morten Olsen
2025-05-19 16:22:59 +02:00
committed by GitHub
parent 4514972880
commit 11f76a7378
17 changed files with 772 additions and 116 deletions

View File

@@ -51,6 +51,7 @@ type ExexutionExecuteOptions = {
}
const execute = async (file: string, options: ExexutionExecuteOptions) => {
let error: unknown | undefined;
const { context } = options;
context.files.add(file);
const content = await readFile(file, 'utf-8');
@@ -94,20 +95,26 @@ const execute = async (file: string, options: ExexutionExecuteOptions) => {
});
for (const step of steps) {
const { node, action } = step;
const options: ExecutionStepOptions = {
file,
input: {},
context,
node,
root,
};
await action(options);
try {
const { node, action } = step;
const options: ExecutionStepOptions = {
file,
input: {},
context,
node,
root,
};
await action(options);
} catch (e) {
error = e;
break;
}
}
const markdown = parser.stringify(root);
return {
error,
root,
markdown,
};