Skip to content

Implement project root detection and enhance route path resolution in CLI#21

Merged
nico-hyperjump merged 1 commit intomainfrom
fix-docker-route-action-gen
Mar 6, 2026
Merged

Implement project root detection and enhance route path resolution in CLI#21
nico-hyperjump merged 1 commit intomainfrom
fix-docker-route-action-gen

Conversation

@nicnocquee
Copy link
Member

  • Added a new findProjectRoot function to locate the project root directory by searching for package.json in parent directories.
  • Updated resolveRoutePath methods in NextAppRouterGenerator and NextPagesRouterGenerator to utilize the detected project root for more accurate route path resolution.
  • Enhanced tests for route path resolution to cover various scenarios, including multiple /app/ segments and projects using a src directory structure.
  • Introduced a new test file for findProjectRoot to ensure its functionality and correctness.

These changes improve the flexibility and accuracy of route path generation in the CLI, particularly for complex project structures.

… CLI

- Added a new `findProjectRoot` function to locate the project root directory by searching for `package.json` in parent directories.
- Updated `resolveRoutePath` methods in `NextAppRouterGenerator` and `NextPagesRouterGenerator` to utilize the detected project root for more accurate route path resolution.
- Enhanced tests for route path resolution to cover various scenarios, including multiple `/app/` segments and projects using a `src` directory structure.
- Introduced a new test file for `findProjectRoot` to ensure its functionality and correctness.

These changes improve the flexibility and accuracy of route path generation in the CLI, particularly for complex project structures.
@nico-hyperjump nico-hyperjump merged commit 9b47b55 into main Mar 6, 2026
2 checks passed
@nico-hyperjump nico-hyperjump deleted the fix-docker-route-action-gen branch March 6, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants