Commit a1f2538
Upgrade command enhancements and changelog release testing (#3023)
* Add upgrade-flow test to validate new changelog.json entries locally before releasing
* Add React Router 7 migration support with complete upgrade instructions
- Add dependency removal logic for clean migration from Remix to React Router 7
- Include @shopify/hydrogen in removeDependencies to resolve peer dependency conflicts
- Add comprehensive migration steps with automated codemod and manual instructions
- Include .gitignore and dev script updates for React Router type generation
- All code blocks properly base64 encoded with diff formatting
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix React Router upgrade tests and add dependency removal tests
- Fix appendReactRouterDependencies to handle migration scenarios correctly
- Add comprehensive tests for new dependency removal functionality
- Test removal of dependencies during Remix → React Router 7 migration
- Test empty removal arrays and standard upgrade scenarios
- Ensure React Router packages are added correctly during migration
Test coverage includes:
- removeDependencies and removeDevDependencies arrays
- Migration scenarios where no React Router packages exist initially
- Standard upgrade scenarios where React Router packages already exist
- Edge cases with empty removal arrays
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Format
* Fix React Router 7 migration asset serving issue
Add React Router config step to migration instructions to set buildDirectory: 'dist' instead of default 'build'. This ensures assets are built to the correct directory expected by Mini Oxygen, resolving 404 errors when serving assets after migration.
This approach fixes the issue at the source in client code rather than requiring rebuilds.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix TypeScript error in appendReactRouterDependencies
Fixed type error where `currentDependencies[pkg]` could be undefined when passed to `isReactRouterDependency` function that expects a string tuple. Added null check to ensure only valid string versions are passed.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix upgrade flow test commit hash for CI compatibility
Update hardcoded commit hash from f03112d to a1185fa which exists in the repository history and should be available in CI environments.
* Update changelog with notice
* fix upgrade flow test
* format
* Add patch cli changeset
* Improve the e2e upgrade command changelog test and document the workflow
* Update packages/cli/src/commands/hydrogen/upgrade.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update .changeset/late-ducks-search.md
Co-authored-by: Kara Daviduik <105449131+kdaviduik@users.noreply.github.com>
* Enhance removeDep test and cleanup consoles
* Add addition upgrade e2e tests
* Enhance upgrade flow tests and update changelog entry
* Update release title
* cleanup
* Add additional tests
* fomat
* Fix type
* Add changelog.json update helper prompt for creating new releases
* Remove test changelog entry from this PR
* Move promp to separate PR
* Enhance tests with feedback
* format
* Add fetchChangelog tests that were skipped
* Remove tests
* Enhance latest version test
* Migrate to single e2e test for latest release only
* Remove fallback logic from upgrade test, throw error instead
As suggested by reviewer, replace the fallback logic that tries multiple
releases with a direct error throw. This provides better debugging
information and forces investigation of real issues rather than
silently working around them.
- Removed loop that tries releases[1-5] as fallback
- Changed expect.fail() to throw Error() with descriptive message
- Includes diagnostic info: attempted version, available versions, git status
- All tests pass with the change
* Address reviewer feedback on upgrade flow tests
- Remove git diagnostics from error messages to focus on actionable information
- Add defensive assertion before upgrade to verify historical version scaffolding
- Include Hydrogen version in dependency validation (remove exclusion)
- Enhance CLI version validation with format checks instead of just existence
- Add test for graceful handling of missing dependencies in removeDependencies
These changes improve test reliability, provide better error messages, and ensure
comprehensive validation of the upgrade process while handling edge cases robustly.
* Remove unnecessary optional chaining in React Router upgrade logic
The optional chaining operator was unnecessary due to short-circuit
evaluation - currentReactRouter[1] is only accessed when
currentReactRouter is defined.
* fix format
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Kara Daviduik <105449131+kdaviduik@users.noreply.github.com>1 parent fdb09e1 commit a1f2538
5 files changed
Lines changed: 1467 additions & 39 deletions
File tree
- .changeset
- .github/workflows
- packages/cli/src/commands/hydrogen
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
0 commit comments