{"id":28072682,"url":"https://github.com/yowainwright/nextra-codemods","last_synced_at":"2025-05-12T21:17:36.748Z","repository":{"id":290346120,"uuid":"973915140","full_name":"yowainwright/nextra-codemods","owner":"yowainwright","description":"[Doesn't work :(] nextra codemods","archived":false,"fork":false,"pushed_at":"2025-05-03T05:08:49.000Z","size":237,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-12T21:17:28.754Z","etag":null,"topics":["codemod","nextra","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yowainwright.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-28T01:29:06.000Z","updated_at":"2025-05-05T21:25:38.000Z","dependencies_parsed_at":"2025-04-28T10:50:03.324Z","dependency_job_id":"cba81e44-8a16-447b-98d0-ea860a1e371f","html_url":"https://github.com/yowainwright/nextra-codemods","commit_stats":null,"previous_names":["yowainwright/nextra-codemods"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yowainwright%2Fnextra-codemods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yowainwright%2Fnextra-codemods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yowainwright%2Fnextra-codemods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yowainwright%2Fnextra-codemods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yowainwright","download_url":"https://codeload.github.com/yowainwright/nextra-codemods/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253823484,"owners_count":21969850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codemod","nextra","typescript"],"created_at":"2025-05-12T21:17:36.009Z","updated_at":"2025-05-12T21:17:36.743Z","avatar_url":"https://github.com/yowainwright.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nextra Codemods\n\nA collection of codemods to help migrate Nextra versions.\n\nCurrently, this repository contains codemods to help migrate from Nextra v3 to v4.\n\n## Overview\n\nNextra v4 introduces several breaking changes, including:\n\n- App Router support (Pages Router discontinued)\n- Discontinuing `theme.config` support\n- New search engine (Pagefind)\n- RSC i18n support\n- And more\n\nThese codemods help automate the migration process.\n\n## Quick Start\n\nThe easiest way to migrate your Nextra v3 project to v4 is to use our interactive CLI:\n\n```bash\n# Using pnpm dlx (recommended)\npnpm dlx nextra-migrate\n\n# Or install globally\npnpm add -g nextra-codemods\nnextra-migrate\n```\n\nThis interactive tool will:\n\n1. Analyze your project structure\n2. Create backups of important files\n3. Migrate your theme configuration\n4. Convert pages to the App Router format\n5. Set up Pagefind search\n6. Update your Next.js configuration\n7. Configure Tailwind CSS and fix styling issues\n8. Update dependencies to Nextra v4\n9. Install all required packages\n\nJust follow the prompts and your project will be migrated automatically!\n\n## Manual Migration\n\nIf you prefer to run the individual steps manually, you can use the following commands:\n\n```bash\n# Step 1: Migrate theme config\npnpm dlx nextra-codemods migrate-theme-config ./theme.config.jsx\n\n# Step 2: Migrate pages to app directory\npnpm dlx nextra-codemods migrate-pages-to-app ./pages\n\n# Step 3: Set up search\npnpm dlx nextra-codemods setup-search ./package.json\n\n# Step 4: Update Next.js config\npnpm dlx nextra-codemods update-next-config ./next.config.js\n\n# Step 5: Fix styling issues\npnpm dlx nextra-codemods fix-all-styles\n\n# Step 6: Update dependencies\npnpm install nextra@latest nextra-theme-docs@latest\n# or\npnpm add nextra@latest nextra-theme-docs@latest\n```\n\n## Using on Your Project\n\nTo use these codemods on your actual Nextra v3 project, follow these steps:\n\n### Method 1: Using the CLI (Recommended)\n\n1. Navigate to your Nextra v3 project directory:\n   ```bash\n   cd your-nextra-v3-project\n   ```\n\n2. Run the interactive migration CLI:\n   ```bash\n  pnpm dlx nextra-migrate\n   ```\n\n3. Follow the prompts to complete the migration process.\n\n4. After migration, start your development server to verify the changes:\n   ```bash\n   pnpm dev\n   ```\n\n### Method 2: Manual Migration\n\nIf you prefer more control over the migration process, you can run individual codemods:\n\n1. Navigate to your Nextra v3 project directory:\n   ```bash\n   cd your-nextra-v3-project\n   ```\n\n2. Create backups of your important files:\n   ```bash\n   cp -r pages pages.bak\n   cp theme.config.jsx theme.config.jsx.bak\n   cp next.config.js next.config.js.bak\n   ```\n\n3. Run the individual codemods in sequence:\n   ```bash\n   # Migrate theme configuration\n   pnpm dlx nextra-codemods migrate-theme-config ./theme.config.jsx\n   \n   # Migrate pages to app directory\n   pnpm dlx nextra-codemods migrate-pages-to-app ./pages\n   \n   # Set up Pagefind search\n   pnpm dlx nextra-codemods setup-search ./package.json\n   \n   # Update Next.js configuration\n   pnpm dlx nextra-codemods update-next-config ./next.config.js\n   \n   # Set up Tailwind CSS\n   pnpm dlx nextra-codemods fix-tailwind\n   \n   # Fix all styling issues\n   pnpm dlx nextra-codemods fix-all-styles\n   ```\n\n4. Update your dependencies:\n   ```bash\n   pnpm add nextra@latest nextra-theme-docs@latest\n   ```\n\n5. Start your development server to verify the changes:\n   ```bash\n   pnpm dev\n   ```\n\n## Troubleshooting\n\nIf you encounter any issues during migration, you can use our fix scripts:\n\n```bash\n# Fix all common issues at once\npnpm dlx nextra-codemods fix-nextra\n\n# Or fix specific issues\npnpm dlx nextra-codemods fix-conflicts  # Fix conflicting files\npnpm dlx nextra-codemods fix-tailwind   # Fix Tailwind CSS issues\npnpm dlx nextra-codemods fix-next-config # Fix Next.js config\npnpm dlx nextra-codemods fix-code-hike  # Set up Code Hike\n```\n\n## Project Structure After Migration\n\nAfter running the migration, your project structure should look like:\n\n```text\n- app/\n  - layout.tsx      # Contains theme configuration\n  - page.mdx        # Root page\n  - _meta.js        # Navigation and page metadata\n  - globals.css     # Global styles with Tailwind\n  - docs/\n    - page.mdx      # Doc pages\n- mdx-components.tsx # Custom MDX components\n- next.config.js    # Updated Next.js config\n- package.json      # Updated with Nextra v4 and Pagefind\n- tailwind.config.js # Tailwind CSS configuration\n- postcss.config.js # PostCSS configuration\n```\n\n## Development\n\nTo contribute to this project:\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/yourusername/nextra-codemods.git\n   cd nextra-codemods\n   ```\n\n2. Install dependencies:\n   ```bash\n   pnpm install\n   ```\n\n3. Run tests:\n   ```bash\n   pnpm test\n   ```\n\n4. Build the project:\n   ```bash\n   pnpm build\n   ```\n\n## Releasing\n\nThis project uses [release-it](https://github.com/release-it/release-it) to manage releases. To create a new release:\n\n1. Make sure all your changes are committed and pushed to the repository.\n\n2. Run the release command:\n   ```bash\n   pnpm release\n   ```\n\n3. Follow the interactive prompts to select the new version number.\n\n4. The release process will:\n   - Run linting and tests\n   - Bump the version in package.json\n   - Build the project\n   - Generate/update the CHANGELOG.md file\n   - Create a Git tag and commit\n   - Push changes to GitHub\n   - Create a GitHub release\n   - Publish to npm\n\nFor a dry run without making any changes, use:\n```bash\npnpm release --dry-run\n```\n\n### Commit Guidelines\n\nThis project follows [Conventional Commits](https://www.conventionalcommits.org/) for generating changelogs. Please format your commit messages as:\n\n- `feat: add new feature` - for new features\n- `fix: resolve issue` - for bug fixes\n- `docs: update documentation` - for documentation changes\n- `chore: update build scripts` - for maintenance tasks\n- `refactor: improve code structure` - for code improvements\n- `test: add tests` - for test additions or modifications\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyowainwright%2Fnextra-codemods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyowainwright%2Fnextra-codemods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyowainwright%2Fnextra-codemods/lists"}