Skip to content
Merged
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
3 changes: 2 additions & 1 deletion src/programs/shared/abort-no-framework.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ErrorCodes } from '@shared/errors';
import { POSTHOG_INSTALL_DOCS_URL } from '@shared/constants';
import { OutroKind, type OutroData } from '@shared/outro';
import { ProgramAbort } from '@programs/program-contract';

Expand All @@ -17,7 +18,7 @@ export function abortNoFrameworkDetected(
instruction: 'Run the wizard from an app root directory.',
body: "That's the folder containing package.json or an equivalent project file.",
docsLabel: 'Supported frameworks and manual setup:',
docsUrl: 'https://posthog.com/docs/libraries',
docsUrl: POSTHOG_INSTALL_DOCS_URL,
...overrides,
};
// Hosts without an outro screen (CI) only see the message, so it carries the
Expand Down
1 change: 1 addition & 0 deletions src/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ export const CONTEXT_MILL_URL = 'https://github.com/PostHog/context-mill';
export const CONTEXT_MILL_RELEASES_URL =
'https://github.com/PostHog/context-mill/releases/latest';
export const POSTHOG_DOCS_URL = 'https://posthog.com/docs';
export const POSTHOG_INSTALL_DOCS_URL = `${POSTHOG_DOCS_URL}/getting-started/install`;
export const POSTHOG_WIZARD_REPO_URL = 'https://github.com/PostHog/wizard';
export const POSTHOG_TERMS_URL = 'https://posthog.com/terms';
export const POSTHOG_PRIVACY_URL = 'https://posthog.com/privacy';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ import {
findProgramConfig,
pickLeavesRunProject,
} from '@programs';
import { Integration } from '@shared/constants';
import { PickerMenu, LoadingBox } from '@tui/primitives/index';
import { Integration, POSTHOG_INSTALL_DOCS_URL } from '@shared/constants';
import {
PickerMenu,
LoadingBox,
type PickerOption,
} from '@tui/primitives/index';
import {
IntroScreenLayout,
type DetectionRow,
Expand Down Expand Up @@ -67,19 +71,23 @@ const FrameworkPicker = ({
store: WizardStore;
onComplete?: () => void;
}) => {
const options = Object.values(Integration).map((value) => ({
label: value,
value,
}));
const options: PickerOption<Integration | 'cancel'>[] = [
...Object.values(Integration).map((value) => ({ label: value, value })),
{ label: 'Cancel', value: 'cancel' },
];

return (
<PickerMenu<Integration>
<PickerMenu<Integration | 'cancel'>
centered
columns={2}
message="Select your framework"
options={options}
onSelect={(value) => {
const integration = Array.isArray(value) ? value[0] : value;
if (integration === 'cancel') {
store.requestExit(0);
return;
}
void import('@programs').then(({ FRAMEWORK_REGISTRY }) => {
const config = FRAMEWORK_REGISTRY[integration];
store.setFrameworkConfig(integration, config);
Expand Down Expand Up @@ -166,8 +174,12 @@ export const PostHogIntegrationIntroScreen = ({
} else if (needsFrameworkPick && !pickingFramework) {
body = (
<>
<Box marginY={1}>
<Box marginY={1} flexDirection="column" alignItems="center">
<Text dimColor>Could not auto-detect your framework.</Text>
<Text dimColor>
Pick your framework below, or set PostHog up by hand:
</Text>
<Text color="cyan">{POSTHOG_INSTALL_DOCS_URL}</Text>
</Box>
<FrameworkPicker
store={store}
Expand Down
Loading