@confect/test 9.2.3 → 10.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@confect/test",
3
3
  "description": "Utilities for testing Confect apps without a live Convex backend",
4
- "version": "9.2.3",
4
+ "version": "10.0.0-next.0",
5
5
  "author": "RJ Dellecese",
6
6
  "bugs": {
7
7
  "url": "https://github.com/rjdellecese/confect/issues"
8
8
  },
9
9
  "devDependencies": {
10
10
  "@types/node": "25.3.3",
11
- "effect": "3.21.2",
11
+ "effect": "4.0.0-beta.97",
12
12
  "tsdown": "0.20.3",
13
13
  "typescript": "5.9.3"
14
14
  },
@@ -47,9 +47,9 @@
47
47
  "peerDependencies": {
48
48
  "convex": "^1.32.0",
49
49
  "convex-test": ">=0.0.50 <0.1.0",
50
- "effect": "^3.21.2",
51
- "@confect/core": "^9.2.3",
52
- "@confect/server": "^9.2.3"
50
+ "effect": "^4.0.0-beta.97",
51
+ "@confect/core": "^10.0.0-next.0",
52
+ "@confect/server": "^10.0.0-next.0"
53
53
  },
54
54
  "repository": {
55
55
  "type": "git",
@@ -13,7 +13,6 @@ import type {
13
13
  UserIdentity,
14
14
  } from "convex/server";
15
15
  import type { Value } from "convex/values";
16
- import type { ParseResult } from "effect";
17
16
  import * as Context from "effect/Context";
18
17
  import * as Effect from "effect/Effect";
19
18
  import * as Layer from "effect/Layer";
@@ -27,21 +26,21 @@ export type TestConfectWithoutIdentity<
27
26
  ...args: Ref.OptionalArgs<QueryRef>
28
27
  ) => Effect.Effect<
29
28
  Ref.Returns<QueryRef>,
30
- Ref.Error<QueryRef> | ParseResult.ParseError
29
+ Ref.Error<QueryRef> | Schema.SchemaError
31
30
  >;
32
31
  mutation: <MutationRef extends Ref.AnyMutation>(
33
32
  mutationRef: MutationRef,
34
33
  ...args: Ref.OptionalArgs<MutationRef>
35
34
  ) => Effect.Effect<
36
35
  Ref.Returns<MutationRef>,
37
- Ref.Error<MutationRef> | ParseResult.ParseError
36
+ Ref.Error<MutationRef> | Schema.SchemaError
38
37
  >;
39
38
  action: <ActionRef extends Ref.AnyAction>(
40
39
  actionRef: ActionRef,
41
40
  ...args: Ref.OptionalArgs<ActionRef>
42
41
  ) => Effect.Effect<
43
42
  Ref.Returns<ActionRef>,
44
- Ref.Error<ActionRef> | ParseResult.ParseError
43
+ Ref.Error<ActionRef> | Schema.SchemaError
45
44
  >;
46
45
  run: {
47
46
  <E>(
@@ -57,8 +56,8 @@ export type TestConfectWithoutIdentity<
57
56
  E,
58
57
  RegisteredConvexFunction.MutationServices<ConfectSchema>
59
58
  >,
60
- returns: Schema.Schema<A, B>,
61
- ): Effect.Effect<A, ParseResult.ParseError>;
59
+ returns: Schema.Codec<A, B>,
60
+ ): Effect.Effect<A, Schema.SchemaError>;
62
61
  };
63
62
  fetch: (
64
63
  pathQueryFragment: string,
@@ -78,8 +77,7 @@ export type TestConfect<ConfectSchema extends DatabaseSchema.AnyWithProps> = {
78
77
 
79
78
  export const TestConfect = <
80
79
  ConfectSchema extends DatabaseSchema.AnyWithProps,
81
- >() =>
82
- Context.GenericTag<TestConfect<ConfectSchema>>("@confect/test/TestConfect");
80
+ >() => Context.Service<TestConfect<ConfectSchema>>("@confect/test/TestConfect");
83
81
 
84
82
  class TestConfectImplWithoutIdentity<
85
83
  ConfectSchema extends DatabaseSchema.AnyWithProps,
@@ -96,7 +94,7 @@ class TestConfectImplWithoutIdentity<
96
94
  ...args: Ref.OptionalArgs<QueryRef>
97
95
  ): Effect.Effect<
98
96
  Ref.Returns<QueryRef>,
99
- Ref.Error<QueryRef> | ParseResult.ParseError
97
+ Ref.Error<QueryRef> | Schema.SchemaError
100
98
  > =>
101
99
  Ref.runWithCodec(
102
100
  queryRef,
@@ -110,7 +108,7 @@ class TestConfectImplWithoutIdentity<
110
108
  ...args: Ref.OptionalArgs<MutationRef>
111
109
  ): Effect.Effect<
112
110
  Ref.Returns<MutationRef>,
113
- Ref.Error<MutationRef> | ParseResult.ParseError
111
+ Ref.Error<MutationRef> | Schema.SchemaError
114
112
  > =>
115
113
  Ref.runWithCodec(
116
114
  mutationRef,
@@ -124,7 +122,7 @@ class TestConfectImplWithoutIdentity<
124
122
  ...args: Ref.OptionalArgs<ActionRef>
125
123
  ): Effect.Effect<
126
124
  Ref.Returns<ActionRef>,
127
- Ref.Error<ActionRef> | ParseResult.ParseError
125
+ Ref.Error<ActionRef> | Schema.SchemaError
128
126
  > =>
129
127
  Ref.runWithCodec(
130
128
  actionRef,
@@ -143,8 +141,8 @@ class TestConfectImplWithoutIdentity<
143
141
  E,
144
142
  RegisteredConvexFunction.MutationServices<ConfectSchema>
145
143
  >,
146
- returns?: Schema.Schema<A, B>,
147
- ): Effect.Effect<void> | Effect.Effect<A, ParseResult.ParseError> => {
144
+ returns?: Schema.Codec<A, B>,
145
+ ): Effect.Effect<void> | Effect.Effect<A, Schema.SchemaError> => {
148
146
  const makeMutationLayer = (
149
147
  mutationCtx: GenericMutationCtx<
150
148
  DataModel.ToConvex<DataModel.FromSchema<ConfectSchema>>
@@ -172,12 +170,12 @@ class TestConfectImplWithoutIdentity<
172
170
  this.testConvex.run((mutationCtx) =>
173
171
  Effect.runPromise(
174
172
  handler.pipe(
175
- Effect.andThen(Schema.encode(returns)),
173
+ Effect.andThen(Schema.encodeEffect(returns)),
176
174
  Effect.provide(makeMutationLayer(mutationCtx)),
177
175
  ),
178
176
  ),
179
177
  ),
180
- ).pipe(Effect.andThen(Schema.decode(returns)));
178
+ ).pipe(Effect.andThen(Schema.decodeEffect(returns)));
181
179
  }) as TestConfectWithoutIdentity<ConfectSchema>["run"];
182
180
 
183
181
  readonly fetch = <PathQueryFragment extends string>(