Add Vite to Next.js migration skill for legacy apps#146
Open
policyengine[bot] wants to merge 1 commit into
Open
Add Vite to Next.js migration skill for legacy apps#146policyengine[bot] wants to merge 1 commit into
policyengine[bot] wants to merge 1 commit into
Conversation
Captures learnings from cbo-baseline-tracker migration (PR #4): - Framework-only migration strategy (preserve UI layer) - index.html → app/layout.tsx (Metadata API, JSON-LD, GA4) - main.tsx + App.tsx → app/page.tsx + providers.tsx - Client Component marking ('use client' for hooks, browser APIs) - Environment variable migration (VITE_* → NEXT_PUBLIC_*) - Public asset path changes (/public/* → /*) - Common gotchas (dynamic imports, window undefined, default exports) Distinct from policyengine-frontend-builder-spec (new apps) — this skill is for migrating existing Mantine/Plotly/other-framework apps to Next.js without forcing a full rewrite to ui-kit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Captures learnings from the cbo-baseline-tracker Vite → Next.js 16 App Router migration (PR PolicyEngine/cbo-baseline-tracker#4).
New skill:
policyengine-vite-to-nextjs-migration-skillWhat this adds
Migration guide for legacy PolicyEngine apps (using Mantine, Plotly, or other UI frameworks) that need to move from Vite to Next.js without a full rewrite.
Key patterns documented:
index.html→app/layout.tsx(Metadata API, JSON-LD, GA4 vianext/script)main.tsx+App.tsx→app/page.tsx+providers.tsx'use client'for hooks, browser APIs, charting libraries)VITE_*→NEXT_PUBLIC_*)/public/*→/*)window undefined, default exports)Why this is distinct from existing skills
policyengine-frontend-builder-spec— Enforces Next.js + Tailwind + ui-kit for new appspolicyengine-vite-to-nextjs-migration(this PR) — Guides migrating existing apps that use different UI frameworks, preserving their component codeThe CBO baseline tracker uses Mantine + Plotly and is a static analysis tool (not actively developed). A full rewrite to ui-kit would be high-risk/low-value. This migration path consolidates it onto the PolicyEngine Next.js/Vercel stack while minimizing code changes.
Future value
Will help future migrations of similar legacy apps:
🤖 Generated with Claude Code