Repository navigation
fix(cli): ignore and clean up folders left with only +types - #205
Merged
Merged
Conversation
Deleting or renaming an aggregate or a read model left its generated +types behind. The next `bounda generate` took that folder for a module, failed with "a read model needs a view.ts with its fields" and stopped before removeOrphans could clean it up, so the app could not start until the folder was deleted by hand. Discovery now skips a folder that holds nothing but +types at any depth, and removeOrphans also removes the folders its removal leaves empty. An empty folder, or one with anything next to +types, is still reported.
Opening a folder in Finder drops a .DS_Store into it, so a deleted read model whose folder held +types and .DS_Store was still taken for a module and generation failed as before. Folder metadata no longer counts when telling leftovers apart, and a folder emptied of +types is removed with its .DS_Store. A folder with only a .DS_Store is still reported.
benatespina
force-pushed
the
fix/generate-stale-types-folders
branch
from
October 17, 2026 14:19
40969ff to
e465291
Compare
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.
Summary
+typesbehind. The nextbounda generatetook that folder for a module, failed with "a read model needs a view.ts with its fields" and stopped beforeremoveOrphanscould clean it up, so the app would not start until someone deleted the folder by hand.+types(and Finder's.DS_Store), at any depth, and the run removes those files along with the folders it empties.Changes
discover.ts:list()leaves out directories that contain only+typesdirectories, recursively. This applies at every level: aggregates, read models,projections/<aggregate>/,commands/, and so on, which also keeps a leftover aggregate out of the set used to check projection and process folders..DS_Storedoes not count: on macOS Finder drops one into every folder it opens, which would otherwise bring the failure back. A folder with only a.DS_Storeis still reported.write.ts:removeOrphansalso removes a directory once removing orphans has emptied it,.DS_Storeaside. A folder that was already empty belongs to the user and stays, and the app directory is never removed.+types, is still reported; emptied folders pruned while pre-existing empty ones stay.docs/reference/cli.mdand apatchchangeset for@bounda-dev/cli.Key Features
+typestree no longer blocksbounda generate,--watchor the Vite plugin.Quality
pnpm checkgreen.@bounda-dev/cli:discover.ts95.74 %,write.ts95.65 %. No surviving mutant is in the new logic; the one atwrite.ts:81is equivalent, since walking a file reads it as empty.