Skip to content

fix: normalize Drizzle schema paths for Windows compatibility - #75

Merged
shulaoda merged 1 commit into
mainfrom
04-03-fix_normalize_drizzle_schema_paths_for_windows_compatibility
Apr 3, 2026
Merged

shulaoda merged 1 commit into
mainfrom
04-03-fix_normalize_drizzle_schema_paths_for_windows_compatibility

Conversation

@shulaoda

@shulaoda shulaoda commented Apr 3, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Normalize schema paths at the source in discoverSchema() using toSlash(), so schema.path always uses forward slashes regardless of platform
  • Use posix.join instead of path.join for @schema/ subpath resolution in resolveId, preventing backslash module IDs on Windows
  • Since schema.path is now pre-normalized, remove the per-comparison normalizePath(schema.path) — but keep normalizePath(importer) since Vite's importer argument is not guaranteed to be normalized

Root cause

On Windows, path.join(root, "db", "schema.ts") produces backslash paths (e.g. D:\a\void\void\db\schema.ts). These flowed into two places:

  1. resolveId comparisons — schema.path with backslashes never matched the (potentially normalized) importer, causing schema files to be incorrectly redirected to the runtime DB virtual module instead of the schema-only stub, triggering circular dependencies
  2. resolveId return values — @schema/ subpath resolution via path.join returned backslash module IDs that Vite cannot resolve, breaking imports in meta-framework SSR environments (Astro workerd runner, etc.)

Test plan

  • Drizzle schema resolution works correctly on Windows
  • No regression on Unix/macOS CI

@shulaoda
shulaoda marked this pull request as ready for review April 3, 2026 07:25
@shulaoda
shulaoda merged commit e4ab41f into main Apr 3, 2026
6 checks passed
@shulaoda
shulaoda deleted the 04-03-fix_normalize_drizzle_schema_paths_for_windows_compatibility branch April 3, 2026 07:46
shulaoda added a commit that referenced this pull request Apr 3, 2026
Brooooooklyn added a commit that referenced this pull request Nov 24, 2026
…, show the last bypass

- waiting_scan copy (API and CLI) says when it waits for a deploy going live
  or for the project's Zero Trust row, not only for a scan (#75, #86).
- The CLI bypass sends the request it saw; the route takes `requestId`, so a
  bypass that loses to a protect gets 409 `public request closed` with its
  state instead of "no public request ... run public" (#72).
- Bypass refusals keep the API code, status and blockers in `--json` (#93).
- GET /projects/:id/zero-trust returns `lastBypass` (reason for deploy and
  up) and `zero-trust status` prints a "Last bypass" line (§13.3).
- `protect` that cancels an open request prints "Public request canceled.
  <slug> stays protected."; a held `public` prints the CLI request lines and
  "Check it: void project zero-trust status" (§11.4, §13.3, #80).
- A public-only Zero Trust switch with the gate on is refused with 409
  `security public gate on` before the existing-projects check (#64).
- Copy nits: "finishes" for one going-public project, the requester in the
  cancel preview, "failing since" from a stored start of the probe failure,
  bypass during a Zero Trust change says "Try again after it ends", and a
  passed request drops its held reason (#65, #87, #89, §5.2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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