-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
test(vue-router): generator cli only #6112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis PR adds a complete end-to-end test project for the Vue Router file-based route generator, including configurations, route definitions, data fetching utilities, styling, Playwright tests, and test infrastructure. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Areas requiring attention:
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit 74ff583
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (5)
e2e/vue-router/generator-cli-only/src/routes/posts.index.tsx (1)
1-9: Same JSX syntax concern applies here.This file has the same potential JSX/Vue Router compatibility issue as flagged in route-a.tsx.
e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (1)
1-11: Same JSX syntax concern applies here.This file has the same potential JSX/Vue Router compatibility issue as flagged in route-a.tsx.
e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx (1)
1-39: Same JSX syntax concern applies here.This file has the same potential JSX/Vue Router compatibility issue as flagged in route-a.tsx.
e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx (1)
1-34: Same JSX syntax concern applies here.This file has the same potential JSX/Vue Router compatibility issue as flagged in route-a.tsx.
e2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsx (1)
1-27: Same JSX syntax concern applies here.This file has the same potential JSX/Vue Router compatibility issue as flagged in route-a.tsx.
🧹 Nitpick comments (2)
e2e/vue-router/generator-cli-only/src/main.tsx (1)
21-28: Non-null assertion on DOM element.The non-null assertion on line 21 assumes
#appalways exists. This is acceptable for an e2e test project where the HTML structure is controlled, but consider adding a guard for defensive coding:-const rootElement = document.getElementById('app')! +const rootElement = document.getElementById('app') -if (!rootElement.innerHTML) { +if (rootElement && !rootElement.innerHTML) {This aligns with the pattern used in
e2e/solid-router/js-only-file-based/src/main.jsxwhich also retrieves#app.e2e/vue-router/generator-cli-only/src/posts.ts (1)
5-9: Consider aligningidtype with actual API response.JSONPlaceholder returns posts with numeric
idvalues. While the currentstringtype works due to JavaScript coercion, usingnumberwould be more accurate:type PostType = { - id: string + id: number title: string body: string }Alternatively, if string IDs are intentional for route params, keep the type but be aware of the implicit conversion.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (25)
e2e/vue-router/generator-cli-only/.gitignore(1 hunks)e2e/vue-router/generator-cli-only/index.html(1 hunks)e2e/vue-router/generator-cli-only/package.json(1 hunks)e2e/vue-router/generator-cli-only/playwright.config.ts(1 hunks)e2e/vue-router/generator-cli-only/postcss.config.mjs(1 hunks)e2e/vue-router/generator-cli-only/src/main.tsx(1 hunks)e2e/vue-router/generator-cli-only/src/posts.ts(1 hunks)e2e/vue-router/generator-cli-only/src/routeTree.gen.ts(1 hunks)e2e/vue-router/generator-cli-only/src/routes/__root.tsx(1 hunks)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsx(1 hunks)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx(1 hunks)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx(1 hunks)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx(1 hunks)e2e/vue-router/generator-cli-only/src/routes/index.tsx(1 hunks)e2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsx(1 hunks)e2e/vue-router/generator-cli-only/src/routes/posts.index.tsx(1 hunks)e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx(1 hunks)e2e/vue-router/generator-cli-only/src/styles.css(1 hunks)e2e/vue-router/generator-cli-only/test-results/.last-run.json(1 hunks)e2e/vue-router/generator-cli-only/tests/app.spec.ts(1 hunks)e2e/vue-router/generator-cli-only/tests/setup/global.setup.ts(1 hunks)e2e/vue-router/generator-cli-only/tests/setup/global.teardown.ts(1 hunks)e2e/vue-router/generator-cli-only/tsconfig.json(1 hunks)e2e/vue-router/generator-cli-only/tsr.config.json(1 hunks)e2e/vue-router/generator-cli-only/vite.config.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript strict mode with extensive type safety for all code
Files:
e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsxe2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsxe2e/vue-router/generator-cli-only/src/routes/posts.route.tsxe2e/vue-router/generator-cli-only/src/posts.tse2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsxe2e/vue-router/generator-cli-only/src/routes/index.tsxe2e/vue-router/generator-cli-only/playwright.config.tse2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsxe2e/vue-router/generator-cli-only/src/routes/posts.index.tsxe2e/vue-router/generator-cli-only/tests/setup/global.teardown.tse2e/vue-router/generator-cli-only/src/routes/__root.tsxe2e/vue-router/generator-cli-only/src/routeTree.gen.tse2e/vue-router/generator-cli-only/src/main.tsxe2e/vue-router/generator-cli-only/tests/app.spec.tse2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsxe2e/vue-router/generator-cli-only/tests/setup/global.setup.ts
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Implement ESLint rules for router best practices using the ESLint plugin router
Files:
e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsxe2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsxe2e/vue-router/generator-cli-only/src/routes/posts.route.tsxe2e/vue-router/generator-cli-only/src/posts.tse2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsxe2e/vue-router/generator-cli-only/vite.config.jse2e/vue-router/generator-cli-only/src/routes/index.tsxe2e/vue-router/generator-cli-only/playwright.config.tse2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsxe2e/vue-router/generator-cli-only/src/routes/posts.index.tsxe2e/vue-router/generator-cli-only/tests/setup/global.teardown.tse2e/vue-router/generator-cli-only/src/routes/__root.tsxe2e/vue-router/generator-cli-only/src/routeTree.gen.tse2e/vue-router/generator-cli-only/src/main.tsxe2e/vue-router/generator-cli-only/tests/app.spec.tse2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsxe2e/vue-router/generator-cli-only/tests/setup/global.setup.ts
**/package.json
📄 CodeRabbit inference engine (AGENTS.md)
Use workspace protocol
workspace:*for internal dependencies in package.json files
Files:
e2e/vue-router/generator-cli-only/package.json
🧠 Learnings (9)
📓 Common learnings
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.
Learnt from: schiller-manuel
Repo: TanStack/router PR: 5330
File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61
Timestamp: 2025-10-01T18:31:35.420Z
Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{js,ts,tsx} : Implement ESLint rules for router best practices using the ESLint plugin router
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.
Applied to files:
e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsxe2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsxe2e/vue-router/generator-cli-only/src/routes/posts.route.tsxe2e/vue-router/generator-cli-only/.gitignoree2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsxe2e/vue-router/generator-cli-only/package.jsone2e/vue-router/generator-cli-only/src/routes/index.tsxe2e/vue-router/generator-cli-only/tsr.config.jsone2e/vue-router/generator-cli-only/tsconfig.jsone2e/vue-router/generator-cli-only/test-results/.last-run.jsone2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsxe2e/vue-router/generator-cli-only/src/routes/posts.index.tsxe2e/vue-router/generator-cli-only/tests/setup/global.teardown.tse2e/vue-router/generator-cli-only/src/routes/__root.tsxe2e/vue-router/generator-cli-only/src/routeTree.gen.tse2e/vue-router/generator-cli-only/src/main.tsxe2e/vue-router/generator-cli-only/tests/app.spec.tse2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsxe2e/vue-router/generator-cli-only/tests/setup/global.setup.ts
📚 Learning: 2025-10-01T18:31:35.420Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 5330
File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61
Timestamp: 2025-10-01T18:31:35.420Z
Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.
Applied to files:
e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsxe2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsxe2e/vue-router/generator-cli-only/.gitignoree2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsxe2e/vue-router/generator-cli-only/package.jsone2e/vue-router/generator-cli-only/src/routes/index.tsxe2e/vue-router/generator-cli-only/tsr.config.jsone2e/vue-router/generator-cli-only/tsconfig.jsone2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsxe2e/vue-router/generator-cli-only/src/routes/posts.index.tsxe2e/vue-router/generator-cli-only/src/routes/__root.tsxe2e/vue-router/generator-cli-only/src/routeTree.gen.tse2e/vue-router/generator-cli-only/src/main.tsx
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{js,ts,tsx} : Implement ESLint rules for router best practices using the ESLint plugin router
Applied to files:
e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsxe2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsxe2e/vue-router/generator-cli-only/src/routes/posts.route.tsxe2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsxe2e/vue-router/generator-cli-only/package.jsone2e/vue-router/generator-cli-only/src/routes/index.tsxe2e/vue-router/generator-cli-only/tsr.config.jsone2e/vue-router/generator-cli-only/tsconfig.jsone2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsxe2e/vue-router/generator-cli-only/src/routes/posts.index.tsxe2e/vue-router/generator-cli-only/src/routes/__root.tsxe2e/vue-router/generator-cli-only/src/routeTree.gen.tse2e/vue-router/generator-cli-only/src/main.tsxe2e/vue-router/generator-cli-only/tests/app.spec.tse2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsx
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Use file-based routing in `src/routes/` directories or code-based routing with route definitions
Applied to files:
e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsxe2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsxe2e/vue-router/generator-cli-only/src/routes/posts.route.tsxe2e/vue-router/generator-cli-only/src/routes/posts.index.tsxe2e/vue-router/generator-cli-only/src/routeTree.gen.ts
📚 Learning: 2025-10-09T12:59:02.129Z
Learnt from: hokkyss
Repo: TanStack/router PR: 5418
File: e2e/react-start/custom-identifier-prefix/src/styles/app.css:19-21
Timestamp: 2025-10-09T12:59:02.129Z
Learning: In e2e test directories (paths containing `e2e/`), accessibility concerns like outline suppression patterns are less critical since the code is for testing purposes, not production use.
Applied to files:
e2e/vue-router/generator-cli-only/.gitignoree2e/vue-router/generator-cli-only/tests/app.spec.ts
📚 Learning: 2025-11-02T16:16:24.898Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5732
File: packages/start-client-core/src/client/hydrateStart.ts:6-9
Timestamp: 2025-11-02T16:16:24.898Z
Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.
Applied to files:
e2e/vue-router/generator-cli-only/package.jsone2e/vue-router/generator-cli-only/tsconfig.jsone2e/vue-router/generator-cli-only/tests/setup/global.teardown.tse2e/vue-router/generator-cli-only/src/routes/__root.tsxe2e/vue-router/generator-cli-only/src/main.tsxe2e/vue-router/generator-cli-only/tests/setup/global.setup.ts
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript strict mode with extensive type safety for all code
Applied to files:
e2e/vue-router/generator-cli-only/tsconfig.json
📚 Learning: 2025-10-09T12:59:14.842Z
Learnt from: hokkyss
Repo: TanStack/router PR: 5418
File: e2e/react-start/custom-identifier-prefix/public/site.webmanifest:2-3
Timestamp: 2025-10-09T12:59:14.842Z
Learning: In e2e test fixtures (files under e2e directories), empty or placeholder values in configuration files like site.webmanifest are acceptable and should not be flagged unless the test specifically validates those fields.
Applied to files:
e2e/vue-router/generator-cli-only/playwright.config.tse2e/vue-router/generator-cli-only/tests/setup/global.setup.ts
🧬 Code graph analysis (10)
e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx (3)
e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsx (1)
Route(3-5)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (1)
Route(3-7)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (1)
Route(3-7)
e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (3)
e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsx (1)
Route(3-5)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx (1)
Route(3-5)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (1)
Route(3-7)
e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx (4)
e2e/vue-router/generator-cli-only/src/routes/index.tsx (1)
Route(3-5)e2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsx (1)
Route(5-12)e2e/vue-router/generator-cli-only/src/posts.ts (1)
fetchPosts(17-22)e2e/vue-router/view-transitions/src/routes/posts.route.tsx (1)
PostsLayoutComponent(9-43)
e2e/vue-router/generator-cli-only/playwright.config.ts (1)
scripts/set-ts-version.js (1)
packageJson(33-33)
e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (8)
e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx (1)
Route(4-7)e2e/vue-router/generator-cli-only/src/routes/__root.tsx (1)
Route(4-14)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsx (1)
Route(3-5)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx (1)
Route(3-5)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (1)
Route(3-7)e2e/vue-router/generator-cli-only/src/routes/index.tsx (1)
Route(3-5)e2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsx (1)
Route(5-12)e2e/vue-router/generator-cli-only/src/routes/posts.index.tsx (1)
Route(3-5)
e2e/vue-router/generator-cli-only/src/routes/posts.index.tsx (8)
e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx (1)
Route(4-7)e2e/vue-router/generator-cli-only/src/routes/__root.tsx (1)
Route(4-14)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsx (1)
Route(3-5)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx (1)
Route(3-5)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (1)
Route(3-7)e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (1)
Route(3-7)e2e/vue-router/generator-cli-only/src/routes/index.tsx (1)
Route(3-5)e2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsx (1)
Route(5-12)
e2e/vue-router/generator-cli-only/tests/setup/global.teardown.ts (1)
scripts/set-ts-version.js (1)
packageJson(33-33)
e2e/vue-router/generator-cli-only/src/routes/__root.tsx (1)
e2e/vue-router/generator-cli-only/src/routes/index.tsx (1)
Route(3-5)
e2e/vue-router/generator-cli-only/src/main.tsx (1)
e2e/solid-router/js-only-file-based/src/main.jsx (1)
rootElement(14-14)
e2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsx (2)
e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx (1)
Route(4-7)e2e/vue-router/generator-cli-only/src/posts.ts (1)
fetchPost(24-36)
🔇 Additional comments (19)
e2e/vue-router/generator-cli-only/.gitignore (1)
1-11: LGTM!The gitignore patterns are appropriate for a Vue/Vite e2e test project with Playwright integration.
e2e/vue-router/generator-cli-only/vite.config.js (1)
1-8: LGTM!The Vite configuration correctly enables Vue and Vue JSX plugins, which aligns with the JSX usage in the route files.
e2e/vue-router/generator-cli-only/postcss.config.mjs (1)
1-5: LGTM!The PostCSS configuration is appropriate for Tailwind CSS v4 and matches the Tailwind usage in the project.
e2e/vue-router/generator-cli-only/tsconfig.json (1)
1-16: LGTM!The TypeScript configuration correctly enables strict mode and includes appropriate settings for Vue 3 with JSX support in a Vite environment.
e2e/vue-router/generator-cli-only/src/styles.css (1)
1-21: LGTM!The Tailwind CSS configuration with light/dark theme support is appropriate for this e2e test project.
e2e/vue-router/generator-cli-only/src/routes/index.tsx (1)
1-13: LGTM!The file-based route definition follows TanStack Router patterns correctly, and the Home component implementation is appropriate for Vue 3 with JSX.
e2e/vue-router/generator-cli-only/tsr.config.json (1)
1-5: LGTM!The TanStack Router CLI configuration is appropriate for the Vue Router generator setup, with correct paths and target specification.
e2e/vue-router/generator-cli-only/src/routes/__root.tsx (2)
1-14: LGTM! Root route setup is well-structured.The root route correctly configures both the main component and a
notFoundComponentwith a recovery link. The pattern follows TanStack Vue Router conventions.
16-61: Navigation component looks good.The
RootComponentproperly renders navigation links with active state styling, anOutletfor nested routes, and the devtools. The intentional@ts-expect-errorfor testing the not-found route behavior is a valid testing pattern.e2e/vue-router/generator-cli-only/index.html (1)
1-12: LGTM!Standard Vite entry HTML file with proper structure. The generic "Vite App" title is acceptable for an e2e test project.
e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsx (1)
1-16: LGTM!The pathless layout route is correctly implemented following TanStack Router conventions. The underscore prefix in the filename and route path properly indicates this is a layout-only route that doesn't add a path segment.
e2e/vue-router/generator-cli-only/tests/setup/global.setup.ts (1)
1-6: LGTM!The global setup correctly initializes the e2e test server using the shared utility. The import assertion syntax for JSON imports is the modern ESM approach.
e2e/vue-router/generator-cli-only/test-results/.last-run.json (1)
1-4: This file is already covered by.gitignore— remove it from git tracking.The
.gitignoreate2e/vue-router/generator-cli-only/already contains/test-results/. The.last-run.jsonfile should not be tracked in version control. Usegit rm --cached e2e/vue-router/generator-cli-only/test-results/.last-run.jsonto remove it from the repository while keeping it locally.Likely an incorrect or invalid review comment.
e2e/vue-router/generator-cli-only/tests/app.spec.ts (1)
1-35: LGTM!The test suite is well-structured with clear scenarios covering post navigation, nested pathless layouts, and not-found routes. The use of role-based selectors promotes accessibility and test maintainability.
e2e/vue-router/generator-cli-only/tests/setup/global.teardown.ts (1)
1-6: LGTM!The teardown script correctly stops the dummy e2e server using the package name as an identifier. The JSON import assertion syntax is appropriate.
e2e/vue-router/generator-cli-only/src/main.tsx (1)
1-12: LGTM: Router configuration is well-structured.The router setup with
defaultPreload: 'intent',defaultStaleTime: 5000, andscrollRestoration: trueis appropriate for this e2e test scenario.e2e/vue-router/generator-cli-only/playwright.config.ts (1)
1-41: LGTM: Playwright configuration follows established patterns.The configuration is well-structured with appropriate settings for the e2e test scenario: single worker for sequential execution, proper global setup/teardown, and CI-aware server reuse logic.
e2e/vue-router/generator-cli-only/src/posts.ts (1)
24-36: The!postcheck may not trigger as expected.Redaxios (like axios) throws an error on 4xx/5xx responses rather than returning null/undefined. The
!postcondition on line 31 would only trigger if the API returns a successful response with a falsy body, which is unlikely for this endpoint.If the intent is to handle 404 responses, consider catching the error instead:
export const fetchPost = async (postId: string) => { console.info(`Fetching post with id ${postId}...`) try { const post = await axios .get<PostType>(`${queryURL}/posts/${postId}`) .then((r) => r.data) return post } catch (error) { throw new NotFoundError(`Post with id "${postId}" not found!`) } }However, for e2e test purposes, the current implementation is acceptable if the test data is controlled.
e2e/vue-router/generator-cli-only/src/routeTree.gen.ts (1)
1-230: Skipping auto-generated file.This is an auto-generated route tree file that should not be manually modified. Based on learnings, this file is excluded from review.
| "@tanstack/vue-router": "workspace:^", | ||
| "@tanstack/vue-router-devtools": "workspace:^", | ||
| "@tanstack/router-cli": "workspace:^", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use workspace:* protocol for internal dependencies.
The workspace protocol should be workspace:* instead of workspace:^ for all internal TanStack dependencies.
As per coding guidelines: Use workspace protocol workspace:* for internal dependencies in package.json files.
Apply this diff to fix the workspace protocol:
"dependencies": {
"@tailwindcss/postcss": "^4.1.15",
- "@tanstack/vue-router": "workspace:^",
- "@tanstack/vue-router-devtools": "workspace:^",
- "@tanstack/router-cli": "workspace:^",
+ "@tanstack/vue-router": "workspace:*",
+ "@tanstack/vue-router-devtools": "workspace:*",
+ "@tanstack/router-cli": "workspace:*",
"postcss": "^8.5.1",
"redaxios": "^0.5.1",
"vue": "^3.5.16",
"tailwindcss": "^4.1.17"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
- "@tanstack/router-e2e-utils": "workspace:^",
+ "@tanstack/router-e2e-utils": "workspace:*",
"@vitejs/plugin-vue": "^5.2.3",
"@vitejs/plugin-vue-jsx": "^4.1.2",
"typescript": "~5.8.3",
"vite": "^7.1.7",
"vue-tsc": "^3.1.5"
}Also applies to: 25-25
🤖 Prompt for AI Agents
In e2e/vue-router/generator-cli-only/package.json around lines 15-17 (and also
line 25), the workspace protocol for internal TanStack dependencies is set to
"workspace:^"; change these to use the required "workspace:*" protocol for all
internal TanStack packages listed. Update the three entries at lines 15-17 and
the entry at line 25 to replace the caret protocol with the asterisk protocol so
package.json uses "workspace:*" for internal dependencies.
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.