mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
The rule table mapped HOG_ -> FN_ ahead of any POSTHOG rule, so POSTHOG_FOO split into POST + HOG_ and came out POSTFN_FOO. Nothing sets that. The live pods set INSIGHTS_SKIP_MIGRATION_CHECKS, which bin/migrate-check reads on the container entrypoint, so the misspelling does not degrade a feature -- it runs migrate --check against a database whose history this tree does not share and the container never starts. Both replacements are measured against the shipped tree rather than chosen: every HOG_ name with a counterpart there is spelled INSIGHTS_ (HOG_QL -> INSIGHTS_QL, HOG_FUNCTION_TEMPLATES -> INSIGHTS_FUNCTION_TEMPLATES, 12 of 12 determinate cases), and FN_ appears in it nowhere. Upstream carries 95 HOG_ tokens and zero FN_ ones, so repairing FN_ back out is exactly the inverse of the bad rule and cannot collide with an upstream name. The rule is fixed for the next convergence, and the tree it already produced is repaired in the same commit -- the codemod is idempotent against its own output, so it cannot undo this itself.
49 lines
1.9 KiB
TypeScript
49 lines
1.9 KiB
TypeScript
import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/shared/OnboardingDocsContentWrapper'
|
|
|
|
import { getIOSSteps as getIOSStepsPA } from '../product-analytics/ios'
|
|
import { StepDefinition } from '../steps'
|
|
|
|
export const getIOSSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {
|
|
const { Markdown, CodeBlock, dedent, snippets } = ctx
|
|
const MobileFinalSteps = snippets?.MobileFinalSteps
|
|
|
|
// Get installation steps from product-analytics
|
|
const paSteps = getIOSStepsPA(ctx)
|
|
|
|
// Replace the "Send events" step with web analytics specific content
|
|
const webAnalyticsSteps = paSteps.map((step) => {
|
|
if (step.title === 'Send events') {
|
|
return {
|
|
title: 'Track screen views',
|
|
badge: 'recommended' as const,
|
|
content: (
|
|
<>
|
|
{MobileFinalSteps && <MobileFinalSteps />}
|
|
<Markdown>
|
|
To automatically track screen views, configure Insights to capture screen views:
|
|
</Markdown>
|
|
<CodeBlock
|
|
blocks={[
|
|
{
|
|
language: 'swift',
|
|
file: 'AppDelegate.swift',
|
|
code: dedent`
|
|
let config = InsightsConfig(projectToken: INSIGHTS_PROJECT_TOKEN, host: INSIGHTS_HOST)
|
|
config.captureScreenViews = true
|
|
InsightsSDK.shared.setup(config)
|
|
`,
|
|
},
|
|
]}
|
|
/>
|
|
</>
|
|
),
|
|
}
|
|
}
|
|
return step
|
|
})
|
|
|
|
return webAnalyticsSteps
|
|
}
|
|
|
|
export const IOSInstallation = createInstallation(getIOSSteps)
|