Skip to content

refactor: remove makeRuntime from TuiConfig#22517

Closed
kitlangton wants to merge 1 commit intodevfrom
kit/tui-facade-cleanup
Closed

refactor: remove makeRuntime from TuiConfig#22517
kitlangton wants to merge 1 commit intodevfrom
kit/tui-facade-cleanup

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • Add TuiConfig.defaultLayer to AppLayer so TuiConfig.Service is available via the shared runtime
  • Replace local makeRuntime in config/tui.ts with dynamic import() of AppRuntime (avoids circular dep)
  • Keeps facade functions (get, waitForDependencies) intact — they're spied on by test/fixture/tui-runtime.ts mockTuiRuntime helper used in plugin-lifecycle tests

Part of the residual makeRuntime cleanup tracked in specs/effect/facades.md.

Delete get() and waitForDependencies() facade functions from config/tui.ts.
Add TuiConfig.defaultLayer to AppLayer so the service is available via
AppRuntime.

Migrate all callers (attach.ts, thread.ts, plugin/runtime.ts) to
AppRuntime.runPromise(TuiConfig.Service.use(...)). Migrate tui.test.ts
(~28 calls) to the same pattern.

Rework test fixture: replace spyOn(TuiConfig, 'get') with mockTuiService
helper that mocks TuiConfig.Service.use at the Effect level. Update all
9 test files that spied on the old facades.
@kitlangton kitlangton force-pushed the kit/tui-facade-cleanup branch from fca7e79 to a8d6379 Compare April 15, 2026 01:35
@kitlangton kitlangton marked this pull request as ready for review April 15, 2026 01:43
@kitlangton kitlangton closed this Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant