From e3534252665d69267520c9fb8765719449e2d3cd Mon Sep 17 00:00:00 2001 From: Andrey Avtomonov Date: Wed, 13 May 2026 15:49:22 +0200 Subject: [PATCH] fix(cli): show project dir in context build step (#67) --- packages/cli/src/context-build-view.test.ts | 10 ++++++++++ packages/cli/src/context-build-view.ts | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/context-build-view.test.ts b/packages/cli/src/context-build-view.test.ts index 647357a7..3df1f6d7 100644 --- a/packages/cli/src/context-build-view.test.ts +++ b/packages/cli/src/context-build-view.test.ts @@ -168,6 +168,15 @@ describe('renderContextBuildView', () => { expect(output).toContain('(0/1 ยท 1m05s)'); }); + it('renders project directory when provided', () => { + const state = initViewState([ + { connectionId: 'warehouse', driver: 'postgres', operation: 'scan', debugCommand: '', steps: ['scan'] }, + ]); + + const output = renderContextBuildView(state, { styled: false, projectDir: '/tmp/project' }); + expect(output).toContain('Project: /tmp/project'); + }); + it('renders dynamic separator matching header width', () => { const state = initViewState([ { connectionId: 'warehouse', driver: 'postgres', operation: 'scan', debugCommand: '', steps: ['scan'] }, @@ -448,6 +457,7 @@ describe('runContextBuild', () => { const output = io.stdout(); expect(output).toContain('Building KTX context'); + expect(output).toContain('Project: /tmp/project'); expect(output).toContain('Primary sources:'); expect(output).toContain('warehouse'); expect(output).toContain('Context sources:'); diff --git a/packages/cli/src/context-build-view.ts b/packages/cli/src/context-build-view.ts index 7457f9b5..e021b144 100644 --- a/packages/cli/src/context-build-view.ts +++ b/packages/cli/src/context-build-view.ts @@ -204,6 +204,7 @@ export function renderContextBuildView( '', header, separator, + ...(options.projectDir ? [` Project: ${options.projectDir}`] : []), ...renderTargetGroup('Primary sources', state.primarySources, state.frame, styled, width), ...renderTargetGroup('Context sources', state.contextSources, state.frame, styled, width), '', @@ -684,7 +685,7 @@ export async function runContextBuild( } if (!repainter) { - io.stdout.write(renderContextBuildView(state, { styled: false })); + io.stdout.write(renderContextBuildView(state, { ...viewOpts, styled: false })); } else { paint(false); }