feat(cli): enhance PostHog event instrumentation with comprehensive properties #11348
+69
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Refs: Slack thread about missing PostHog event properties for
fern generate --docsEnhances PostHog CLI event instrumentation to capture more useful data for support and proactive outreach. Also fixes a bug where event properties were being nested incorrectly in the PostHog payload.
Link to Devin run: https://app.devin.ai/sessions/08e71a3193514b8994bf73c7576e16be
Requested by: danny@buildwithfern.com (@dannysheridan)
Changes Made
Fixed nested properties bug in PostHog managers: Previously,
...eventwas spread into properties, which included thepropertiesfield itself, then...event.propertieswas also spread, causing duplicate/nested data. Now explicitly extractsorgIdandcommandinstead.Added properties to
fern generate --docs: preview, instance, instancesCount, apiWorkspacesCount, brokenLinks, strictBrokenLinks, disableTemplates, skipUpload, isCIAdded properties to
fern docs dev: port, backendPort, brokenLinks, bundlePathProvided, forceDownload, apiWorkspacesCountAdded properties to
fern test: hasTestCommand, generationLanguage, apiWorkspacesCountAdded properties to
fern mock: portProvided, apiWorkspacesCountAdded properties to other commands:
fern api update(apiProvided),fern self-update(versionProvided, dryRun),fern login(deviceCode),fern format(ci, apiProvided)Updated README.md generator (if applicable) - N/A
Testing
Human Review Checklist
...event→ explicitorgId/command) won't break existing analytics dashboards