Skip to content

fix(wbfy): respect compiler scopes for roots with src - #1503

Merged
exKAZUu merged 13 commits into
mainfrom
fix/framework-workspace-typecheck
Oct 17, 2026
Merged

exKAZUu merged 13 commits into
mainfrom
fix/framework-workspace-typecheck

Conversation

@exKAZUu

@exKAZUu exKAZUu commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Why

A workspace root with src is checked as an independent compiler project. Adding workspace sources to that project's tsconfig makes its compiler apply root settings to package-local aliases and browser globals, even when each workspace's own check passes.

Requirements

  • required: Fix wbfy to generate correct configuration for managed repositories without manual adjustments, with comments explaining the reasoning.
  • required: Verify the local unreleased fix against the affected repository before publishing it.
  • required: Preserve the existing wb typecheck contract: a workspace root with src compiles independently with bun check, self-compiling workspaces use their own settings, and a root without src provides type-aware lint coverage for files not compiled by a workspace.
  • chosen: Add automatic workspace include patterns only to roots without src, matching Project.hasSourceCode and buildTypeScriptTypeCheckCommands. A root compiler must not automatically import browser globals or package-local aliases from independently compiled workspaces.
  • chosen: Preserve authored workspace exclusions in roots with src because they define the root compiler's scope; keep the existing workspace-negation cleanup for roots without src.
  • chosen: Keep framework-local normalization, framework exclusions, nested layouts, and legacy cleanup as at the base revision. Those existing paths already supply the caller's coverage and JSONC preservation guarantees; the compiler-mode boundary is the part that must change.
  • chosen: Verify the generated configuration through the real wb typecheck CLI, covering both root modes, authored exclusions, distinct workspace aliases/browser globals, and propagation of errors from root, self-compiling workspaces, and root-covered fallback files.

Customer Summary

Roots with their own source code can type-check without false errors from independently compiled workspace packages. Roots without source code retain their existing fallback checks.

Technical Summary

packages/wbfy/src/generators/tsconfig.ts uses the same src directory distinction as the compiler caller when adding workspace includes and retiring workspace exclusions. Existing complete-prefix cleanup removes obsolete generated includes when a root becomes independent. Authored exclusions remain intact in that mode.

The regression creates a real project tree, discovers its configuration from disk, generates tsconfigs, and runs the actual wb typecheck CLI. It checks root/workspace compiler isolation and error propagation, then removes root sources and checks fallback coverage for a workspace that does not compile itself.

Testing

  • bun run verify passed in shared.
  • bun wb test -w packages/wbfy test/unit/tsconfig.test.ts: 18 passed.
  • bun wb test -w packages/wbfy test/unit/workspaceDiscovery.test.ts: 16 passed.
  • The CLI regression fails on the base generator with missing workspace aliases and browser globals, and passes with the fix.
  • Applied the local unreleased checkout to the affected repository with GH_TOKEN=$(gh auth token) bun start <target-path>; its bun run verify passed.
  • All PR CI checks, including the full test job, passed on e063de4b470896db28f98c61269eade62078c0e0.

Notes

The existing cognitive-complexity warning in removeStaleManagedWorkspaceEntries remains. Splitting its managed include/exclude retirement logic would only move complexity into an unrelated refactor; there are no code-gauge errors in shared.

Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

exKAZUu and others added 12 commits October 18, 2026 01:00
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
…ncludes

Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
@exKAZUu exKAZUu changed the title fix(wbfy): isolate framework workspaces from root type checking fix(wbfy): respect compiler scopes for roots with src Oct 17, 2026
@exKAZUu exKAZUu self-assigned this Oct 17, 2026
@exKAZUu
exKAZUu merged commit 308895a into main Oct 17, 2026
4 checks passed
@exKAZUu
exKAZUu deleted the fix/framework-workspace-typecheck branch October 17, 2026 18:36
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