Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"rimraf": "^3.0.2",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.16",
"tsx": "^4.20.3",
"typescript": "^5.0.4"
},
Expand All @@ -100,7 +101,7 @@
"clean": "rm -rf ./dist",
"prebuild": "pnpm clean && node scripts/generate-version.js",
"build:watch": "pnpm tsc -w",
"build": "pnpm tsc",
"build": "pnpm tsc && tsc-alias",
"postbuild": "chmod +x ./dist/bin.js && cp -r scripts/** dist && cp -r src/utils/rules dist/src/utils && cp src/ui/tui/package.json dist/src/ui/tui/package.json && pnpm test:smoke",
"test:smoke": "node -e \"require('./dist/bin.js')\" 2>&1 | head -5 | grep -q 'PostHog Wizard' || (echo 'Smoke test failed: compiled binary crashed on load' && exit 1)",
"lint": "pnpm lint:prettier && pnpm lint:eslint",
Expand Down Expand Up @@ -150,7 +151,11 @@
],
"moduleNameMapper": {
"^@anthropic-ai/claude-agent-sdk$": "<rootDir>/__mocks__/@anthropic-ai/claude-agent-sdk.ts",
"^(\\.{1,2}/.*)\\.js$": "$1"
"^(\\.{1,2}/.*)\\.js$": "$1",
"^@lib/(.*)$": "<rootDir>/src/lib/$1",
"^@utils/(.*)$": "<rootDir>/src/utils/$1",
"^@ui/(.*)$": "<rootDir>/src/ui/$1",
"^@tui/(.*)$": "<rootDir>/src/ui/tui/$1"
}
},
"lint-staged": {
Expand Down
82 changes: 82 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/ui/logging-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* No prompts, no TUI, no interactivity. Just console output.
*/

import { TaskStatus, type WizardUI, type SpinnerHandle } from './wizard-ui';
import type { SettingsConflict } from '../lib/agent-interface';
import type { WizardWorkflowQueue } from '../lib/workflow-queue';
import { TaskStatus, type WizardUI, type SpinnerHandle } from '@ui/wizard-ui';
import type { SettingsConflict } from '@lib/agent-interface';
import type { WizardWorkflowQueue } from '@lib/workflow-queue';

export class LoggingUI implements WizardUI {
intro(message: string): void {
Expand Down
10 changes: 5 additions & 5 deletions src/ui/tui/ink-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* The router derives the active screen from session state.
*/

import type { WizardUI, SpinnerHandle } from '../wizard-ui.js';
import type { WizardStore } from './store.js';
import type { SettingsConflict } from '../../lib/agent-interface.js';
import type { WizardWorkflowQueue } from '../../lib/workflow-queue.js';
import { RunPhase, OutroKind } from '../../lib/wizard-session.js';
import type { WizardUI, SpinnerHandle } from '@ui/wizard-ui.js';
import type { WizardStore } from '@tui/store.js';
import type { SettingsConflict } from '@lib/agent-interface.js';
import type { WizardWorkflowQueue } from '@lib/workflow-queue.js';
import { RunPhase, OutroKind } from '@lib/wizard-session.js';

// Strip ANSI escape codes (chalk formatting) from strings
// eslint-disable-next-line no-control-regex
Expand Down
4 changes: 2 additions & 2 deletions src/ui/tui/primitives/ProgressList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import { Box, Text } from 'ink';
import { Spinner } from '@inkjs/ui';
import { Colors, Icons } from '../styles.js';
import { Colors, Icons } from '@tui/styles.js';
import { LoadingBox } from './LoadingBox.js';
import { TaskStatus } from '../../wizard-ui.js';
import { TaskStatus } from '@ui/wizard-ui.js';

export interface ProgressItem {
label: string;
Expand Down
16 changes: 8 additions & 8 deletions src/ui/tui/screens/RunScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@

import { useSyncExternalStore } from 'react';
import { Box } from 'ink';
import type { WizardStore } from '../store.js';
import type { WizardStore } from '@tui/store.js';
import {
TabContainer,
SplitView,
ProgressList,
LogViewer,
EventPlanViewer,
HNViewer,
} from '../primitives/index.js';
import type { ProgressItem } from '../primitives/index.js';
import { TaskStatus } from '../../wizard-ui.js';
import { ADDITIONAL_FEATURE_LABELS } from '../../../lib/wizard-session.js';
import { LearnCard } from '../components/LearnCard.js';
import { TipsCard } from '../components/TipsCard.js';
import { useStdoutDimensions } from '../hooks/useStdoutDimensions.js';
} from '@tui/primitives/index.js';
import type { ProgressItem } from '@tui/primitives/index.js';
import { TaskStatus } from '@ui/wizard-ui.js';
import { ADDITIONAL_FEATURE_LABELS } from '@lib/wizard-session.js';
import { LearnCard } from '@tui/components/LearnCard.js';
import { TipsCard } from '@tui/components/TipsCard.js';
import { useStdoutDimensions } from '@tui/hooks/useStdoutDimensions.js';

const LOG_FILE = '/tmp/posthog-wizard.log';

Expand Down
14 changes: 7 additions & 7 deletions src/ui/tui/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import { atom, map } from 'nanostores';
import { TaskStatus } from '../wizard-ui.js';
import { TaskStatus } from '@ui/wizard-ui.js';
import {
type WizardSession,
type OutroData,
Expand All @@ -20,21 +20,21 @@ import {
McpOutcome,
RunPhase,
buildSession,
} from '../../lib/wizard-session.js';
import type { SettingsConflict } from '../../lib/agent-interface.js';
} from '@lib/wizard-session.js';
import type { SettingsConflict } from '@lib/agent-interface.js';
import {
WizardRouter,
type ScreenName,
Screen,
Overlay,
Flow,
} from './router.js';
import { analytics, sessionProperties } from '../../utils/analytics.js';
} from '@tui/router.js';
import { analytics, sessionProperties } from '@utils/analytics.js';
import {
evaluateWizardReadiness,
WizardReadiness,
} from '../../lib/health-checks/readiness.js';
import type { WizardWorkflowQueue } from '../../lib/workflow-queue.js';
} from '@lib/health-checks/readiness.js';
import type { WizardWorkflowQueue } from '@lib/workflow-queue.js';

export { TaskStatus, Screen, Overlay, Flow, RunPhase, McpOutcome };
export type { ScreenName, OutroData, WizardSession };
Expand Down
4 changes: 2 additions & 2 deletions src/ui/wizard-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* Session-mutating methods trigger reactive screen resolution in the TUI.
*/

import type { SettingsConflict } from '../lib/agent-interface';
import type { WizardWorkflowQueue } from '../lib/workflow-queue';
import type { SettingsConflict } from '@lib/agent-interface';
import type { WizardWorkflowQueue } from '@lib/workflow-queue';

export enum TaskStatus {
Pending = 'pending',
Expand Down
9 changes: 8 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
"typeRoots": ["./node_modules/@types", "./types"],
"declaration": true,
"resolveJsonModule": true,
"outDir": "dist"
"outDir": "dist",
"baseUrl": ".",
"paths": {
"@lib/*": ["./src/lib/*"],
"@utils/*": ["./src/utils/*"],
"@ui/*": ["./src/ui/*"],
"@tui/*": ["./src/ui/tui/*"]
}
},
"include": [
"__tests__",
Expand Down
Loading