Skip to content

test: effect-run-in-body to zero in examples/, and flip the rule to error - #607

Merged
thomasfosterau merged 3 commits into
trunkfrom
issue-600-examples
Nov 12, 2026
Merged

thomasfosterau merged 3 commits into
trunkfrom
issue-600-examples

Conversation

@thomasfosterau

@thomasfosterau thomasfosterau commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Part of #600. Stacked on #606: this branch is rebased on issue-600-effect-run-in-body, so until #606 merges the diff also shows its commit; review only 2f90bf8. After #606 merges I will rebase onto trunk.

Converts the last 20 effect/effect-run-in-body sites, all in examples/ (blog, github, northwind), and deletes the rule's warn line in vite.config.ts, so the rule is at error with zero sites.

  • @effect/vitest: "catalog:" added to each example's devDependencies; pnpm-lock.yaml updated.
  • blog.test.ts, atomic.test.ts, client.test.ts, github.test.ts, northwind.test.ts: run / runExit helpers return Effects; tests are it.effect.
  • The three conformance.test.ts files built one report with a top-level await Effect.runPromise(...) shared by every test. That is now a Run service built once by Layer.effect and provided with layer(RunLive)(...) from @effect/vitest; each test reads it with yield* Run. The conformance run itself (including the mutating write rules) still happens exactly once per file.
  • Two new rule sites the conversion would have added are fixed in place: Schema.decodeUnknownSync inside Effect.gen became yield* Schema.decodeUnknownEffect, and Effect.gen whose only statement was yield* run(...) returns run(...) directly.

Lint deltas against trunk plus #606 (rule counts): effect/effect-run-in-body 20 to 0; no other rule changed. Test counts per file are unchanged (blog 73, github 56, northwind 50).

effecttsgo/strict-effect-provide is untouched, as agreed.

Verification

origin/trunk merged into the branch (merge commit 8585124, no rebase) to pick up #613 (imperative loops), #610 (untagged errors), #608 (effect and @effect/vitest at 4.1.4) and #582. The six example test files conflicted; each keeps this PR's it.effect structure with #613's for to Arr.forEach conversions re-applied inside it. pnpm-lock.yaml is trunk's, re-resolved with pnpm install: @effect/vitest and effect are at 4.1.4 with no 4.1.2 entries for either. GOMAXPROCS=2 GOMEMLIMIT=3GiB:

  • pnpm install --frozen-lockfile: pass
  • vp run build: pass
  • vp check: pass (0 errors)
  • vp run --concurrency-limit 1 check: pass ("check: every type gate green")
  • vp run -r test:unit: pass (4010 + 56 + 50 + 73)
  • vp run docgen: pass
  • vp run test:coverage: pass, then vp exec fallow audit --base origin/trunk: exit 0 (11 complexity findings above threshold and 19 duplication clone groups, warn-only; the gate excluded 29 inherited findings)

Changeset

None: tests, devDependencies of private example packages and lint config only; the published package is unchanged.

  • Not applicable

Notes

The describe in the conformance files became layer(RunLive)(name, (it) => ...), so it there is the layer-scoped runner; vitest/no-standalone-expect already knows it.effect.


Generated by Claude Code

@changeset-bot

changeset-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 154419f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Move the examples' Effect-running tests to it.effect and run the
conformance suites' one shared report through layer(...) rather than a
top-level await. Add @effect/vitest to each example's devDependencies and
delete the rule's warn line in vite.config.ts, so effect-run-in-body is
at error with zero sites.

Part of #600.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5G6PMempKsgjiV1NDcCJY
Keep the it.effect structure of the example suites and re-apply trunk's
imperative-loop conversions (Arr.forEach) inside it; take trunk's lockfile
and re-resolve.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5G6PMempKsgjiV1NDcCJY
…579 moved it to .claude/)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5G6PMempKsgjiV1NDcCJY
@thomasfosterau
thomasfosterau merged commit c3b1de5 into trunk Nov 12, 2026
5 checks passed
@thomasfosterau
thomasfosterau deleted the issue-600-examples branch November 12, 2026 06:48
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