Repository navigation
chore: remove empty type output directories for removed routes - #17472
Merged
elliott-with-the-longest-name-on-github merged 3 commits intoOct 30, 2026
Merged
elliott-with-the-longest-name-on-github merged 3 commits into
elliott-with-the-longest-name-on-github merged 3 commits into
Conversation
After a route is deleted, sync already removes its generated $types files but leaves the empty directory under .svelte-kit/types. Walk empty dirs bottom-up after file cleanup so removed routes leave no empty output directories, while nested routes that still exist keep their parents. Fixes sveltejs#17452
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/2ea536a0926841428ca393d1a2f399fd63686f28Open in Note This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed. |
🦋 Changeset detectedLatest commit: 2ea536a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Inserting remove_empty_directories between the write_all_types JSDoc and its export left the parameters untyped under check, so tsc failed with implicit any errors on config/manifest_data/root/route.
elliott-with-the-longest-name-on-github
approved these changes
Oct 30, 2026
# Conflicts: # packages/kit/src/core/sync/write_types/index.spec.js
elliott-with-the-longest-name-on-github
merged commit Oct 30, 2026
3da859a
into
sveltejs:main
37 of 38 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #17452
What
After
svelte-kit syncremoves generated$typesfiles for a deleted route, it left the empty directory under.svelte-kit/types. Cleanup now walks empty directories bottom-up after deleting stale files, so removed routes leave no empty output dirs. Parent directories that still hold nested route types are kept.Tests
removes empty output directories for removed routesandkeeps parent directories that still have nested routesunder a newCleans up unused filesdescribe inpackages/kit/src/core/sync/write_types/index.spec.js.pnpm exec vitest run src/core/sync/write_types/index.spec.js→ 22 passed.Checklist
patch)AI assistance disclosure
Drafted with an AI coding agent; I reviewed the diff, ran the write_types unit tests, and take responsibility for this PR.