Skip to content
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

feat: allow filePath to be null on a route added in an editable tree #607

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Anoesj
Copy link
Contributor

@Anoesj Anoesj commented Mar 18, 2025

It seems that, when we only allow filePath to be null on a route added in an editable tree, that shouldn't cause any problems.

In Nuxt, we don't use file scanning and add routes by modifying the EditableTreeNode of the root page in the beforeWriteFiles callback. A NuxtPage can theoretically not have a corresponding file, although I'm not sure what the use case here is exactly. So currently, where we run parent.insert(path, page.file), page.file can be undefined and we currently use a @ts-expect-error before that line to suppress TS errors.

If this PR is safe to merge, we can remove that @ts-expect-error.

Copy link

pkg-pr-new bot commented Mar 18, 2025

Open in Stackblitz

npm i https://pkg.pr.new/unplugin-vue-router@607

commit: 2d0d1a2

Copy link

codecov bot commented Mar 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.72%. Comparing base (cd4a3f8) to head (2d0d1a2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #607   +/-   ##
=======================================
  Coverage   61.72%   61.72%           
=======================================
  Files          32       32           
  Lines        3135     3135           
  Branches      580      580           
=======================================
  Hits         1935     1935           
  Misses       1194     1194           
  Partials        6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant