Skip to content

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Dec 16, 2025

Summary by CodeRabbit

Release Notes

  • Tests
    • Added end-to-end test suite covering routing scenarios, nested layouts, and error handling
    • Configured Playwright test runner with local development server integration

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

Walkthrough

This 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

Cohort / File(s) Summary
Project Configuration
e2e/vue-router/generator-cli-only/.gitignore, package.json, tsconfig.json, tsr.config.json, vite.config.js, postcss.config.mjs
Adds project metadata, NPM scripts, dependency declarations (Vue, Tailwind, Playwright, etc.), TypeScript configuration with strict checking, Vite build config with Vue/JSX plugins, PostCSS with Tailwind plugin, and TanStack Router generator settings.
Playwright Test Configuration
playwright.config.ts
Configures end-to-end tests with Chromium, specifies testDir, workers, line reporting, and wires up a local Vite dev server with port management for CI environments and global setup/teardown hooks.
Application Entry & Styling
index.html, src/main.tsx, src/styles.css
Adds HTML5 shell with root div, Vue 3 app entry that creates a TanStack Router instance with module augmentation for type safety, and Tailwind/dark-mode CSS with standardized borders.
Data Layer
src/posts.ts
Implements NotFoundError exception class, fetchPosts() and fetchPost(id) functions using redaxios with environment-based URL selection for test mode, and post data type definitions.
Generated Route Tree
src/routeTree.gen.ts
Auto-generated TanStack Router route tree with comprehensive TypeScript interfaces (FileRoutesByFullPath, FileRoutesByTo, FileRoutesById, etc.), nested route children relationships, module augmentations for router registration, and final routeTree export.
Route Files
src/routes/__root.tsx, src/routes/_pathlessLayout.tsx, src/routes/_pathlessLayout/_nested-layout.tsx, src/routes/_pathlessLayout/_nested-layout/{route-a,route-b}.tsx, src/routes/index.tsx, src/routes/posts.route.tsx, src/routes/posts.index.tsx, src/routes/posts.$postId.tsx
Defines root layout with navigation, pathless layout wrapper, nested layout routes (A/B), home route, posts index/list, and dynamic post detail route with loader, error handling, and not-found component.
Tests & Infrastructure
tests/app.spec.ts, tests/setup/global.setup.ts, tests/setup/global.teardown.ts, test-results/.last-run.json
Adds Playwright e2e test suite covering post navigation, pathless layout nesting, and not-found handling; sets up dummy server initialization and teardown via helper utilities; records test result artifacts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Areas requiring attention:

  • The generated routeTree.gen.ts file: complex nested TypeScript interfaces and module augmentation patterns
  • playwright.config.ts: port management logic and CI-conditional behavior for server reuse
  • src/main.tsx: module augmentation for type-safe router registration on the Register interface
  • tests/setup/global.setup.ts and global.teardown.ts: dummy server lifecycle coordination
  • Route file patterns: consistency across multiple file-based route definitions with dynamic segments and nested layouts

Possibly related PRs

Suggested labels

package: router-generator

Suggested reviewers

  • schiller-manuel

Poem

🐰 A warren of routes, now neatly arranged,
with Vue and the generator, the structure's exchanged,
from posts to pathless, each file finds its place,
e2e tests scurry to check every pace!
Now Playwright hops gleefully, server in tow,
our router takes root, watch the test patterns grow! 🌿

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: introducing an end-to-end test setup for Vue Router's generator CLI-only scenario, which aligns with all the files added (test configuration, routes, components, and test cases).
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch vue-router-generator-cli-only

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Dec 16, 2025

View your CI Pipeline Execution ↗ for commit 74ff583

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 45s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-16 17:23:42 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 16, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@6112

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@6112

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@6112

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@6112

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@6112

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@6112

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@6112

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@6112

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@6112

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@6112

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@6112

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@6112

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@6112

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@6112

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@6112

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@6112

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@6112

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@6112

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@6112

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@6112

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@6112

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@6112

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@6112

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@6112

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@6112

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@6112

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@6112

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@6112

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@6112

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@6112

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@6112

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@6112

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@6112

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@6112

@tanstack/vue-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router@6112

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router-devtools@6112

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router-ssr-query@6112

@tanstack/vue-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start@6112

@tanstack/vue-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start-client@6112

@tanstack/vue-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start-server@6112

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@6112

commit: 74ff583

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 #app always 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.jsx which also retrieves #app.

e2e/vue-router/generator-cli-only/src/posts.ts (1)

5-9: Consider aligning id type with actual API response.

JSONPlaceholder returns posts with numeric id values. While the current string type works due to JavaScript coercion, using number would 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7e9c2f0 and 74ff583.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is 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.tsx
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
  • e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx
  • e2e/vue-router/generator-cli-only/src/posts.ts
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsx
  • e2e/vue-router/generator-cli-only/src/routes/index.tsx
  • e2e/vue-router/generator-cli-only/playwright.config.ts
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
  • e2e/vue-router/generator-cli-only/src/routes/posts.index.tsx
  • e2e/vue-router/generator-cli-only/tests/setup/global.teardown.ts
  • e2e/vue-router/generator-cli-only/src/routes/__root.tsx
  • e2e/vue-router/generator-cli-only/src/routeTree.gen.ts
  • e2e/vue-router/generator-cli-only/src/main.tsx
  • e2e/vue-router/generator-cli-only/tests/app.spec.ts
  • e2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsx
  • e2e/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.tsx
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
  • e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx
  • e2e/vue-router/generator-cli-only/src/posts.ts
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsx
  • e2e/vue-router/generator-cli-only/vite.config.js
  • e2e/vue-router/generator-cli-only/src/routes/index.tsx
  • e2e/vue-router/generator-cli-only/playwright.config.ts
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
  • e2e/vue-router/generator-cli-only/src/routes/posts.index.tsx
  • e2e/vue-router/generator-cli-only/tests/setup/global.teardown.ts
  • e2e/vue-router/generator-cli-only/src/routes/__root.tsx
  • e2e/vue-router/generator-cli-only/src/routeTree.gen.ts
  • e2e/vue-router/generator-cli-only/src/main.tsx
  • e2e/vue-router/generator-cli-only/tests/app.spec.ts
  • e2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsx
  • e2e/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.tsx
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
  • e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx
  • e2e/vue-router/generator-cli-only/.gitignore
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsx
  • e2e/vue-router/generator-cli-only/package.json
  • e2e/vue-router/generator-cli-only/src/routes/index.tsx
  • e2e/vue-router/generator-cli-only/tsr.config.json
  • e2e/vue-router/generator-cli-only/tsconfig.json
  • e2e/vue-router/generator-cli-only/test-results/.last-run.json
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
  • e2e/vue-router/generator-cli-only/src/routes/posts.index.tsx
  • e2e/vue-router/generator-cli-only/tests/setup/global.teardown.ts
  • e2e/vue-router/generator-cli-only/src/routes/__root.tsx
  • e2e/vue-router/generator-cli-only/src/routeTree.gen.ts
  • e2e/vue-router/generator-cli-only/src/main.tsx
  • e2e/vue-router/generator-cli-only/tests/app.spec.ts
  • e2e/vue-router/generator-cli-only/src/routes/posts.$postId.tsx
  • e2e/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.tsx
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
  • e2e/vue-router/generator-cli-only/.gitignore
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsx
  • e2e/vue-router/generator-cli-only/package.json
  • e2e/vue-router/generator-cli-only/src/routes/index.tsx
  • e2e/vue-router/generator-cli-only/tsr.config.json
  • e2e/vue-router/generator-cli-only/tsconfig.json
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
  • e2e/vue-router/generator-cli-only/src/routes/posts.index.tsx
  • e2e/vue-router/generator-cli-only/src/routes/__root.tsx
  • e2e/vue-router/generator-cli-only/src/routeTree.gen.ts
  • e2e/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.tsx
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
  • e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout.tsx
  • e2e/vue-router/generator-cli-only/package.json
  • e2e/vue-router/generator-cli-only/src/routes/index.tsx
  • e2e/vue-router/generator-cli-only/tsr.config.json
  • e2e/vue-router/generator-cli-only/tsconfig.json
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
  • e2e/vue-router/generator-cli-only/src/routes/posts.index.tsx
  • e2e/vue-router/generator-cli-only/src/routes/__root.tsx
  • e2e/vue-router/generator-cli-only/src/routeTree.gen.ts
  • e2e/vue-router/generator-cli-only/src/main.tsx
  • e2e/vue-router/generator-cli-only/tests/app.spec.ts
  • e2e/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.tsx
  • e2e/vue-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
  • e2e/vue-router/generator-cli-only/src/routes/posts.route.tsx
  • e2e/vue-router/generator-cli-only/src/routes/posts.index.tsx
  • e2e/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/.gitignore
  • e2e/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.json
  • e2e/vue-router/generator-cli-only/tsconfig.json
  • e2e/vue-router/generator-cli-only/tests/setup/global.teardown.ts
  • e2e/vue-router/generator-cli-only/src/routes/__root.tsx
  • e2e/vue-router/generator-cli-only/src/main.tsx
  • e2e/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.ts
  • e2e/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 notFoundComponent with a recovery link. The pattern follows TanStack Vue Router conventions.


16-61: Navigation component looks good.

The RootComponent properly renders navigation links with active state styling, an Outlet for nested routes, and the devtools. The intentional @ts-expect-error for 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 .gitignore at e2e/vue-router/generator-cli-only/ already contains /test-results/. The .last-run.json file should not be tracked in version control. Use git rm --cached e2e/vue-router/generator-cli-only/test-results/.last-run.json to 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, and scrollRestoration: true is 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 !post check may not trigger as expected.

Redaxios (like axios) throws an error on 4xx/5xx responses rather than returning null/undefined. The !post condition 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.

Comment on lines +15 to +17
"@tanstack/vue-router": "workspace:^",
"@tanstack/vue-router-devtools": "workspace:^",
"@tanstack/router-cli": "workspace:^",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

@birkskyum birkskyum merged commit d27e202 into main Dec 16, 2025
6 checks passed
@birkskyum birkskyum deleted the vue-router-generator-cli-only branch December 16, 2025 17:32
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