fix: monorepo workspace detection on Windows + OpenAPI route support#8
Merged
Houseofmvps merged 2 commits intoHouseofmvps:mainfrom Apr 8, 2026
Merged
Conversation
…Windows Three bugs fixed: 1. Direct workspace paths (e.g. "app", "api") were treated as parent directories to enumerate, not as workspaces themselves 2. Windows \r line endings in pnpm-workspace.yaml poisoned path joins, causing all workspace package.json reads to silently fail 3. raw-http fallback persisted after real frameworks were aggregated from workspaces
…s prefix resolution
- Add AST support for createRoute({ method, path }) + .openapi() pattern
used by @hono/zod-openapi, extracting method and path from both inline
calls and variable references
- Add monorepo workspace entry points to prefix resolution scan
(e.g. api/src/app.ts) so .route() mount prefixes are discovered
- Normalize backslashes in route.file before prefix map lookup,
fixing Windows path separator mismatch that prevented prefix application
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
Fixes monorepo workspace detection failing on Windows and adds support for
@hono/zod-openapiroute patterns. Tested against a real pnpm monorepo with SvelteKit + Hono + Drizzle that was detected asraw-httpwith 1 route — now correctly detectssveltekit, hono | drizzle | typescriptwith 141 routes.Scanner fixes (
scanner.ts)apporapi(without globs) were treated as parent directories to enumerate, so they were never registered as workspaces. Only glob patterns likepackages/*worked.\rin YAML parsing —pnpm-workspace.yamlwith\r\nline endings produced paths likeapi\r, causing allpackage.jsonreads to silently fail and every workspace to fall back toraw-http.raw-httpfallback not cleaned up — the rootpackage.jsonfallback persisted even after real frameworks were aggregated from workspaces.Route detection fixes (
routes.ts,extract-routes.ts)createRoute()+.openapi()pattern — added AST support for the@hono/zod-openapipattern where routes are defined viacreateRoute({ method, path })and registered with.openapi(route, handler). Handles both inline calls and variable references.resolveRoutePrefixesonly checked root-level entry files. Workspace entry points likeapi/src/app.tsare now included, so.route('/prefix', router)mounts are discovered.route.fileused backslashes, preventing prefix application on Windows.Test plan
\r\nline endings inpnpm-workspace.yaml@hono/zod-openapicreateRoute()routes are detected