Migration from v1 to v2
Step-by-step guide to migrate from @frontfriend/tailwind-config to @frontfriend/tailwind
Migration Guide: v1 to v2
This guide will help you migrate from @frontfriend/tailwind-config (v1) to @frontfriend/tailwind (v2).
Overview of Changes
Version 2 introduces several improvements:
- Simplified package name
- New configuration system using
frontfriend.config.js - Updated CLI commands
- Improved component management
Migration Steps
Step 1: Remove Old UI Components
Delete the existing UI components folder that was managed by v1:
Step 2: Update Dependencies
Remove the old package and install the new one:
Step 3: Create Configuration File
Create frontfriend.config.js in your project root:
Step 4: Initialize Design Tokens
Fetch your design tokens using the new CLI:
This replaces the old token fetching mechanism and creates a local cache.
Step 5: Update Tailwind Configuration
Update your tailwind.config.js to use the new plugin:
Step 6: Update Build Configuration
For Next.js
Update next.config.js:
For Vite
Update vite.config.js:
Step 7: Download Components
Download all available components for your framework:
Component Download Path: Components will be downloaded to the path specified in your frontfriend.config.js aliases.
If you have aliases: { ui: '@/components/ui' }, components will be placed in src/components/ui (for Vue) or components/ui (for React).
Make sure this directory exists or the downloader will create it.
Step 8: Update Import Statements
Find and replace all imports throughout your codebase:
macOS Users: The default sed command on macOS may encounter encoding issues. We recommend using gsed instead:
Step 9: Clean Up
Remove the old .npmrc file if it exists:
Verification Checklist
After migration, verify that:
-
npx frontfriend statusshows correct configuration - Design tokens are applied (check colors in your app)
- Components are downloaded to the correct location
- Build process works without errors
- Hot reload works in development
- No references to
@frontfriend/tailwind-configremain
Common Issues
Components not found
Ensure your import paths match the ui alias in frontfriend.config.js.
Styles not applying
Run npx frontfriend init --force to refresh tokens.
Build errors
Make sure you've updated your Next.js or Vite configuration as shown above.
Import errors for utils
If you see errors like @frontfriend/tailwind-config/lib/vue/utils not found:
- Update the import to
@frontfriend/tailwind/lib/vue/utils - Make sure you've run the search/replace command including Vue files
Missing components
Some components are framework-specific. For example, timepicker is only available for Vue. Check the component registry for framework availability.
sed command errors on macOS
If you encounter "illegal byte sequence" errors with sed on macOS, install and use gsed:
Need Help?
If you encounter issues during migration:
- Check
npx frontfriend statusoutput - Review the troubleshooting guide
- Contact support with your migration errors