{"id":29663229,"url":"https://github.com/ktgcreative/motion-migration-nextjs","last_synced_at":"2026-05-15T21:04:36.568Z","repository":{"id":300522604,"uuid":"1006379890","full_name":"ktgcreative/motion-migration-nextjs","owner":"ktgcreative","description":"A simple, automated migration tool for upgrading projects from framer-motion to the new motion package. Built out of necessity due to the lack of official migration tooling, this script scans your codebase and converts all framer-motion imports to motion/react imports, supporting various import patterns.","archived":false,"fork":false,"pushed_at":"2025-06-22T06:41:24.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-01T20:19:40.897Z","etag":null,"topics":["framer-motion","migration","motion","script","upgrade"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ktgcreative.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-06-22T06:11:01.000Z","updated_at":"2025-06-23T22:32:23.000Z","dependencies_parsed_at":"2025-06-22T07:39:35.276Z","dependency_job_id":null,"html_url":"https://github.com/ktgcreative/motion-migration-nextjs","commit_stats":null,"previous_names":["ktgcreative/motion-migration-nextjs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ktgcreative/motion-migration-nextjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktgcreative%2Fmotion-migration-nextjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktgcreative%2Fmotion-migration-nextjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktgcreative%2Fmotion-migration-nextjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktgcreative%2Fmotion-migration-nextjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ktgcreative","download_url":"https://codeload.github.com/ktgcreative/motion-migration-nextjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktgcreative%2Fmotion-migration-nextjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33080381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["framer-motion","migration","motion","script","upgrade"],"created_at":"2025-07-22T11:31:04.841Z","updated_at":"2026-05-15T21:04:36.542Z","avatar_url":"https://github.com/ktgcreative.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Framer Motion to Motion Migration Tool\n\nA simple, automated migration script I created to upgrade projects from `framer-motion` to the new `motion` package.\n\n## My Problem\n\nWhen I was excited to upgrade to Motion (the successor to Framer Motion), I quickly realized the official documentation was seriously missing migration tooling. I had used framer-motion in a lot of different places across my projects, and manually updating imports in dozens of files seemed like a nightmare.\n\nAfter struggling with this across several of my Node.js projects, I decided to write a script to automate the process.\n\n## My Solution\n\nThis script automatically scans your project and converts all `framer-motion` imports to `motion/react` imports. I've tested it on several of my projects and it handles various import patterns:\n\n- Named imports: `import { motion, AnimatePresence } from 'framer-motion'`\n- Namespace imports: `import * as FramerMotion from 'framer-motion'`\n- Default imports: `import motion from 'framer-motion'`\n\n## Installation \u0026 Usage\n\n### Prerequisites\n\nFirst, update your package.json dependencies:\n```bash\nnpm uninstall framer-motion\nnpm install motion\n```\n\n### Running the Migration\n\n1. **Download the script** to your project root:\n   ```bash\n   curl -O https://raw.githubusercontent.com/yourusername/motion-migration-nextjs/main/motion-migrate.js\n   ```\n\n2. **Preview changes** (I always recommend this first):\n   ```bash\n   node motion-migrate.js --dry\n   ```\n\n3. **Run the migration**:\n   ```bash\n   node motion-migrate.js\n   ```\n\n4. **Clean up** (optional):\n   ```bash\n   rm motion-migrate.js\n   ```\n\n## What It Does\n\n### Files Processed\n- `.js`, `.jsx`, `.ts`, `.tsx` files\n- Recursively scans your entire project\n- Skips `node_modules`, `.next`, `dist`, `.git` directories\n\n### Import Transformations\n\n| Before | After |\n|--------|--------|\n| `import { motion } from 'framer-motion'` | `import { motion } from 'motion/react'` |\n| `import * as Motion from 'framer-motion'` | `import * as Motion from 'motion/react'` |\n| `import motion from 'framer-motion'` | `import motion from 'motion/react'` |\n\n### Example Output\n\n**Dry run mode:**\n```\n🔍 Previewing changes...\n📝 Would update: src/components/Header.tsx\n📝 Would update: src/pages/index.tsx\n📝 Would update: src/components/Modal.jsx\n\n💡 Dry run complete - 3 file(s) would be updated.\n```\n\n**Migration mode:**\n```\n🔍 Scanning and migrating...\n✅ Updated: src/components/Header.tsx\n✅ Updated: src/pages/index.tsx\n✅ Updated: src/components/Modal.jsx\n\n🎉 Migration complete - 3 file(s) updated!\n```\n\n## Safety Features\n\nI built in several safety features based on my experience:\n\n- **Dry run mode**: Always preview changes before applying them\n- **Targeted processing**: Only processes relevant file types\n- **Directory filtering**: Automatically skips common build/dependency directories\n- **Backup recommended**: Always commit your changes before running any migration script\n\n## Why I'm Sharing This\n\nI felt like the Motion package website and documentation was seriously missing out on providing migration tooling. Since I had to solve this problem for my own projects, I figured other developers might benefit from this simple script.\n\n## Contributing\n\nFound an edge case or have suggestions? Please open an issue or submit a pull request!\n\n## License\n\nMIT License - feel free to use this in your projects. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktgcreative%2Fmotion-migration-nextjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fktgcreative%2Fmotion-migration-nextjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktgcreative%2Fmotion-migration-nextjs/lists"}