UNPKG

@posthog/wizard

Version:

The PostHog wizard helps you to configure your project

66 lines (57 loc) 2.98 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getOutroMessage = exports.getPRDescription = void 0; const chalk_1 = __importDefault(require("chalk")); const urls_1 = require("../utils/urls"); const constants_1 = require("./constants"); const config_1 = require("./config"); const getPRDescription = ({ integration, addedEditorRules, }) => { const integrationConfig = config_1.INTEGRATION_CONFIG[integration]; return `This PR adds an integration for PostHog. The following changes were made: ${integrationConfig.defaultChanges} ${addedEditorRules ? `• Added Cursor rules for PostHog\n` : ''} Note: This used the ${integrationConfig.name} wizard to setup PostHog, this is still in alpha and like all AI, might have got it wrong. Please check the installation carefully! Learn more about PostHog + ${integrationConfig.name}: ${integrationConfig.docsUrl}`; }; exports.getPRDescription = getPRDescription; const getOutroMessage = ({ options, integration, cloudRegion, addedEditorRules, packageManager, envFileChanged, uploadedEnvVars, }) => { const continueUrl = options.signup ? `${(0, urls_1.getCloudUrlFromRegion)(cloudRegion)}/products?source=wizard` : undefined; const integrationConfig = config_1.INTEGRATION_CONFIG[integration]; const changes = [ addedEditorRules ? `Added Cursor rules for PostHog` : '', envFileChanged ? `Added your Project API key to your ${envFileChanged} file` : '', uploadedEnvVars.length > 0 ? `Uploaded your Project API key to your hosting provider` : '', ].filter(Boolean); const nextSteps = [ uploadedEnvVars.length === 0 ? `Upload your Project API key to your hosting provider` : '', ].filter(Boolean); return ` ${chalk_1.default.green('Successfully installed PostHog!')} ${chalk_1.default.cyan('Changes made:')} ${integrationConfig.defaultChanges} ${changes.map((change) => `• ${change}`).join('\n')} ${chalk_1.default.yellow('Next steps:')} ${integrationConfig.nextSteps} ${nextSteps.map((step) => `• ${step}`).join('\n')} Learn more about PostHog + ${integrationConfig.name}: ${chalk_1.default.cyan(integrationConfig.docsUrl)} ${continueUrl ? `\nContinue onboarding: ${chalk_1.default.cyan(continueUrl)}\n` : ``} Note: This uses experimental AI to setup your project. It might have got it wrong, please check! You should validate your setup by (re)starting your dev environment${packageManager ? ` (e.g. ${chalk_1.default.cyan(`${packageManager.runScriptCommand} dev`)}).` : `.`} ${chalk_1.default.dim(`If you encounter any issues, let us know here: ${constants_1.ISSUES_URL}`)}`; }; exports.getOutroMessage = getOutroMessage; //# sourceMappingURL=messages.js.map