Skip to content

Migrate effect-contrib packages to Effect v4#81

Merged
jbmusso merged 9 commits into
mainfrom
effect-v4
Jun 4, 2026
Merged

Migrate effect-contrib packages to Effect v4#81
jbmusso merged 9 commits into
mainfrom
effect-v4

Conversation

@jbmusso

@jbmusso jbmusso commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates all @evryg/effect-* packages in this monorepo from Effect v3 to Effect v4 (beta).

Changes

  • Bump Effect to v4 beta (4.0.0-beta.78) across the monorepo, updating shared dependencies and tooling config.
  • Migrate @evryg/effect-neo4j to Effect v4.
  • Migrate @evryg/effect-testcontainers to Effect v4.
  • Migrate @evryg/effect-testcontainers-neo4j to Effect v4.
  • Migrate @evryg/effect-vitest-neo4j to Effect v4.
  • Migrate @evryg/effect-neo4j-schema to Effect v4.
  • Migrate @evryg/effect-cypher-codegen to Effect v4 (including a fix to the barrel test regex for the v4 generated transform).
  • Migrate @evryg/effect-integresql to Effect v4.

Notes

pnpm-lock.yaml is regenerated to resolve the v4 beta dependency tree.

jbmusso and others added 9 commits June 4, 2026 17:26
Set effect, @effect/platform-node, @effect/vitest, @effect/sql-pg to
4.0.0-beta.78 in all packages; bump effect/@effect/platform-node peer ranges to
^4.0.0-beta.78. Remove @effect/platform, @effect/cli, @effect/sql (merged into
core effect in v4). Bump @effect/language-service to ^0.86.2.

Per-package source migration follows; tsc -b stays red until it completes.

Generated with AI

Co-Authored-By: AI <ai@example.com>
Context.Tag→Context.Service (+ Tag.Service type → ["Service"]); TaggedError→
TaggedErrorClass; Schema.Defect→Schema.Defect(); Schema.transform→decodeTo+
SchemaTransformation.transform (Schema.Schema<A,E>→Schema.Codec<A,E>);
Layer.scoped→Layer.effect; Stream.asyncPush→Stream.callback (Queue emit).
Tests: it.scoped→it.effect, Stream.runCollect now returns Array, Chunk.unsafeGet
→getUnsafe, Schema.Schema.Encoded→Schema.Codec.Encoded.

Generated with AI

Co-Authored-By: AI <ai@example.com>
TaggedError→TaggedErrorClass; Schema.Defect→Schema.Defect();
Context.Tag→Context.Service; Layer.scoped→Layer.effect.

Generated with AI

Co-Authored-By: AI <ai@example.com>
Layer.scoped→Layer.effect.

Generated with AI

Co-Authored-By: AI <ai@example.com>
Doc comment it.scoped→it.effect; no API changes (Layer/ManagedRuntime stable).

Generated with AI

Co-Authored-By: AI <ai@example.com>
Context.Tag→Context.Service; FileSystem from effect barrel; optionalWith(default)
→withDecodingDefaultType+withConstructorDefault; Schema.Schema.Any→Schema.Top.
SchemaAST walkers updated for v4: TypeLiteral→Objects, *Keyword→bare tags,
TupleType→Arrays (rest holds ASTs), ps.isOptional→ps.type.context.isOptional,
field annotations on ps.type.annotations. Tests: .annotations→.annotate,
NodeContext→NodeServices, Effect.either→Effect.result (Left→Failure).

Generated with AI

Co-Authored-By: AI <ai@example.com>
CLI: @effect/cli→effect/unstable/cli, Options→Flag (text→string), Command.run
now returns the effect directly (reads args from Stdio; config {version} only),
provided via NodeServices.layer. NodeContext→NodeServices. Either→Result
(no Result.try → inline try/catch; onLeft/onRight→onFailure/onSuccess).
TaggedError→TaggedErrorClass; Literal(multi)→Literals; Union(multi)→Union([]);
Schema.Schema.Any→Schema.Top. Codegen templates now emit v4 Schema
(transform→decodeTo+SchemaTransformation.transform, compose→pipe(decodeTo));
unit-test assertions updated to match. Tests: it.scoped→it.effect.

Generated with AI

Co-Authored-By: AI <ai@example.com>
Either→Result-free restructure: Schema.EitherFromUnion → plain Schema.Union +
branch on status discriminant (behavior preserved). decodeUnknown→
decodeUnknownEffect; .annotations→.annotate; catchTag ParseError→SchemaError,
NoSuchElementException→NoSuchElementError; Effect.zipRight→andThen,
Effect.flatten→flatMap(fromOption); Option.fromNullable→fromNullishOr;
FileSystem/Path from effect barrel. Tests: it.scoped→it.effect,
NodeContext→NodeServices.

Generated with AI

Co-Authored-By: AI <ai@example.com>
The shared-transform-emitted-once assertion matched the old Schema.transform
string; update to the v4 Schema.Unknown.pipe(Schema.decodeTo form.

Generated with AI

Co-Authored-By: AI <ai@example.com>
@jbmusso
jbmusso merged commit c3d7af2 into main Jun 4, 2026
8 checks passed
jbmusso added a commit that referenced this pull request Jun 4, 2026
Generated with AI

Co-Authored-By: AI <ai@example.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.

1 participant