|
| 1 | +# Migration Guide — v1.x → v2.0.0 (Monorepo) |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Starting from **v2.0.0**, this repository has been restructured into a **monorepo**. |
| 6 | +Each framework-specific sample now lives under its own folder at the repository root. |
| 7 | + |
| 8 | +``` |
| 9 | +/react/ → React SDK sample |
| 10 | +/react-js/ → JS/TS SDK sample |
| 11 | +/docs/ → Documentation and migration guides |
| 12 | +``` |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## Why This Change? |
| 17 | + |
| 18 | +- To simplify maintaining multiple samples in one repository |
| 19 | +- To reduce duplication and standardize setup/configuration |
| 20 | +- To enable automated releases and changelogs |
| 21 | +- To support CI/CD pipelines for sample validation |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## How to Stay on the Old Version |
| 26 | + |
| 27 | +If your existing projects depend on the old structure: |
| 28 | + |
| 29 | +```bash |
| 30 | +git checkout v1.0.0 |
| 31 | +``` |
| 32 | + |
| 33 | +That version will remain available indefinitely as the last **v1.x (legacy)** release. |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## Breaking Changes |
| 38 | + |
| 39 | +| Area | Change | Notes | |
| 40 | +| ---------------- | ------------------------------------------------------ | --------------------------------------------- | |
| 41 | +| Folder structure | Sample code moved into framework-specific folders | Adjust your paths and setup steps accordingly | |
| 42 | +| Scripts | Each sample now has its own `package.json` and scripts | Run commands per sample directory | |
| 43 | +| Dependencies | Version bumps and reorganized modules | Check each sample's `package.json` | |
| 44 | +| Documentation | Moved into `/docs/` | Updated setup and run instructions | |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +## Migration Steps |
| 49 | + |
| 50 | +### 1. Update Your Local Repository |
| 51 | + |
| 52 | +```bash |
| 53 | +# Fetch the latest changes |
| 54 | +git fetch origin |
| 55 | + |
| 56 | +# Switch to v2.0.0 |
| 57 | +git checkout v2.0.0 |
| 58 | +# or |
| 59 | +git checkout feat/monorepo-conversion-samples |
| 60 | +``` |
| 61 | + |
| 62 | +### 2. Choose Your Sample |
| 63 | + |
| 64 | +Navigate to the appropriate sample directory: |
| 65 | + |
| 66 | +```bash |
| 67 | +# For React SDK sample |
| 68 | +cd react/ |
| 69 | + |
| 70 | +# OR for JS/TS SDK sample |
| 71 | +cd react-js/ |
| 72 | +``` |
| 73 | + |
| 74 | +### 3. Install Dependencies |
| 75 | + |
| 76 | +Each sample has its own dependencies: |
| 77 | + |
| 78 | +```bash |
| 79 | +npm install |
| 80 | +``` |
| 81 | + |
| 82 | +### 4. Update Your Scripts |
| 83 | + |
| 84 | +Old v1.x commands: |
| 85 | + |
| 86 | +```bash |
| 87 | +npm run dev |
| 88 | +npm run build |
| 89 | +npm test |
| 90 | +``` |
| 91 | + |
| 92 | +New v2.0.0 commands (run from sample directory): |
| 93 | + |
| 94 | +```bash |
| 95 | +# Development |
| 96 | +npm run dev |
| 97 | + |
| 98 | +# Build |
| 99 | +npm run build |
| 100 | + |
| 101 | +# Test |
| 102 | +npm test |
| 103 | + |
| 104 | +# Lint |
| 105 | +npm run lint |
| 106 | +``` |
| 107 | + |
| 108 | +### 5. Review Documentation |
| 109 | + |
| 110 | +- Check the sample's local `README.md` for specific setup instructions |
| 111 | +- Refer to `/docs/` for additional guides and documentation |
| 112 | +- Review [CHANGELOG.md](../CHANGELOG.md) for detailed updates |
| 113 | + |
| 114 | +--- |
| 115 | + |
| 116 | +## What Changed Per Sample |
| 117 | + |
| 118 | +### React SDK Sample (`/react/`) |
| 119 | + |
| 120 | +- Uses `@auth0/auth0-acul-react` SDK |
| 121 | +- 31 screens implemented |
| 122 | +- Full React 19 + TypeScript + Vite setup |
| 123 | +- Tailwind CSS v4 styling |
| 124 | + |
| 125 | +### JS/TS SDK Sample (`/react-js/`) |
| 126 | + |
| 127 | +- Uses `@auth0/auth0-acul-js` SDK |
| 128 | +- 3 screens implemented (production-ready) |
| 129 | +- React 19 + TypeScript + Vite |
| 130 | +- Tailwind CSS v4 styling |
| 131 | + |
| 132 | +--- |
| 133 | + |
| 134 | +## Common Issues |
| 135 | + |
| 136 | +### Issue: Cannot find module after upgrade |
| 137 | + |
| 138 | +**Solution**: Make sure you're in the correct sample directory and have run `npm install`: |
| 139 | + |
| 140 | +```bash |
| 141 | +cd react/ # or react-js/ |
| 142 | +npm install |
| 143 | +``` |
| 144 | + |
| 145 | +### Issue: Scripts not found |
| 146 | + |
| 147 | +**Solution**: Each sample has its own scripts. Run commands from the sample directory, not the repository root: |
| 148 | + |
| 149 | +```bash |
| 150 | +cd react/ |
| 151 | +npm run dev # ✅ Correct |
| 152 | +``` |
| 153 | + |
| 154 | +Not from root: |
| 155 | + |
| 156 | +```bash |
| 157 | +npm run dev # ❌ Won't work from root |
| 158 | +``` |
| 159 | + |
| 160 | +### Issue: Old imports or paths not working |
| 161 | + |
| 162 | +**Solution**: Update any custom code to reference the new monorepo structure. Check the sample's `package.json` for current dependencies and versions. |
| 163 | + |
| 164 | +--- |
| 165 | + |
| 166 | +## Next Steps |
| 167 | + |
| 168 | +- Explore the new monorepo structure (`v2.0.0+`) |
| 169 | +- Read each sample's local `README.md` for setup |
| 170 | +- Refer to the root [CHANGELOG.md](../CHANGELOG.md) for detailed updates |
| 171 | +- Open issues or PRs if you encounter migration problems |
| 172 | + |
| 173 | +--- |
| 174 | + |
| 175 | +## Support |
| 176 | + |
| 177 | +For questions or issues: |
| 178 | + |
| 179 | +- Open an issue on [GitHub](https://github.com/auth0-samples/auth0-acul-samples/issues) |
| 180 | +- Check existing documentation in `/docs/` |
| 181 | +- Review sample-specific README files |
0 commit comments