INS-51: Support PostHog A/B testing in new onboarding#61
Conversation
WalkthroughVersion bump from 0.1.44 to 0.1.45 with addition of a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/commands/create.ts (1)
159-160: Consider centralizing template constants to prevent future drift.
todohad to be added in multiple places; a shared constant map would reduce maintenance risk.♻️ Suggested consolidation approach
+const GITHUB_TEMPLATES = ['react', 'nextjs', 'chatbot', 'crm', 'e-commerce', 'todo'] as const; +const VALID_TEMPLATES = [...GITHUB_TEMPLATES, 'empty'] as const; +type TemplateName = (typeof VALID_TEMPLATES)[number]; + -const validTemplates = ['react', 'nextjs', 'chatbot', 'crm', 'e-commerce', 'todo', 'empty']; +const validTemplates = [...VALID_TEMPLATES]; -const githubTemplates = ['chatbot', 'crm', 'e-commerce', 'nextjs', 'react', 'todo']; +const githubTemplates = [...GITHUB_TEMPLATES];Also applies to: 222-223, 335-336
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/create.ts` around lines 159 - 160, Multiple template names (e.g., 'todo') are duplicated across the create command; extract a single source of truth like a TEMPLATE_OPTIONS or TEMPLATE_MAP constant and use it everywhere instead of hardcoded strings. Update the .option('--template <template>', ...) usage and any validation/lookup logic (references in the create command functions such as the template parsing/validation code and any template-driven scaffolding functions) to import and reference that constant, and replace all hardcoded template lists with references to TEMPLATE_OPTIONS/TEMPLATE_MAP so adding/removing templates is done in one place.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/commands/create.ts`:
- Around line 159-160: Multiple template names (e.g., 'todo') are duplicated
across the create command; extract a single source of truth like a
TEMPLATE_OPTIONS or TEMPLATE_MAP constant and use it everywhere instead of
hardcoded strings. Update the .option('--template <template>', ...) usage and
any validation/lookup logic (references in the create command functions such as
the template parsing/validation code and any template-driven scaffolding
functions) to import and reference that constant, and replace all hardcoded
template lists with references to TEMPLATE_OPTIONS/TEMPLATE_MAP so
adding/removing templates is done in one place.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 00be01ea-6758-4f9a-938b-731937fa0e0c
📒 Files selected for processing (3)
package.jsonsrc/commands/create.tssrc/commands/projects/link.ts
Add 'todo' template to
createandlinkcommandstodoto the valid templates list in bothcreate.tsandlink.ts, including CLI help text and interactive selection menus.todotemplate is fetched via the existingdownloadGitHubTemplatepath, consistent with other GitHub-hosted templates.0.1.44to0.1.45.Macroscope summarized d319579.
Summary by CodeRabbit
New Features
Chores