@effect-app/vue 4.0.0-beta.16 → 4.0.0-beta.161
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/CHANGELOG.md +1023 -0
- package/dist/commander.d.ts +370 -0
- package/dist/commander.d.ts.map +1 -0
- package/dist/commander.js +591 -0
- package/dist/confirm.d.ts +19 -0
- package/dist/confirm.d.ts.map +1 -0
- package/dist/confirm.js +24 -0
- package/dist/errorReporter.d.ts +4 -4
- package/dist/errorReporter.d.ts.map +1 -1
- package/dist/errorReporter.js +12 -18
- package/dist/form.d.ts +13 -4
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js +41 -12
- package/dist/index.d.ts +1 -1
- package/dist/intl.d.ts +15 -0
- package/dist/intl.d.ts.map +1 -0
- package/dist/intl.js +9 -0
- package/dist/lib.d.ts +2 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +32 -1
- package/dist/makeClient.d.ts +97 -276
- package/dist/makeClient.d.ts.map +1 -1
- package/dist/makeClient.js +94 -353
- package/dist/makeContext.d.ts +1 -1
- package/dist/makeContext.d.ts.map +1 -1
- package/dist/makeIntl.d.ts +1 -1
- package/dist/makeIntl.d.ts.map +1 -1
- package/dist/makeUseCommand.d.ts +8 -0
- package/dist/makeUseCommand.d.ts.map +1 -0
- package/dist/makeUseCommand.js +13 -0
- package/dist/mutate.d.ts +2 -2
- package/dist/mutate.d.ts.map +1 -1
- package/dist/mutate.js +1 -1
- package/dist/query.d.ts +11 -15
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +17 -26
- package/dist/routeParams.d.ts +1 -1
- package/dist/runtime.d.ts +5 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +27 -17
- package/dist/toast.d.ts +46 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +32 -0
- package/dist/withToast.d.ts +26 -0
- package/dist/withToast.d.ts.map +1 -0
- package/dist/withToast.js +49 -0
- package/eslint.config.mjs +2 -2
- package/package.json +48 -48
- package/src/{experimental/commander.ts → commander.ts} +930 -255
- package/src/{experimental/confirm.ts → confirm.ts} +10 -14
- package/src/errorReporter.ts +60 -72
- package/src/form.ts +55 -16
- package/src/intl.ts +12 -0
- package/src/lib.ts +43 -0
- package/src/makeClient.ts +305 -1015
- package/src/{experimental/makeUseCommand.ts → makeUseCommand.ts} +3 -3
- package/src/query.ts +37 -48
- package/src/runtime.ts +39 -18
- package/src/{experimental/toast.ts → toast.ts} +11 -25
- package/src/{experimental/withToast.ts → withToast.ts} +15 -6
- package/test/Mutation.test.ts +130 -10
- package/test/dist/form.test.d.ts.map +1 -1
- package/test/dist/lib.test.d.ts.map +1 -0
- package/test/dist/stubs.d.ts +1103 -118
- package/test/dist/stubs.d.ts.map +1 -1
- package/test/dist/stubs.js +56 -23
- package/test/form-validation-errors.test.ts +23 -19
- package/test/form.test.ts +20 -2
- package/test/lib.test.ts +240 -0
- package/test/makeClient.test.ts +93 -39
- package/test/stubs.ts +83 -41
- package/tsconfig.json +0 -1
- package/tsconfig.json.bak +2 -2
- package/tsconfig.src.json +34 -34
- package/tsconfig.test.json +2 -2
- package/vitest.config.ts +5 -5
- package/dist/experimental/commander.d.ts +0 -359
- package/dist/experimental/commander.d.ts.map +0 -1
- package/dist/experimental/commander.js +0 -557
- package/dist/experimental/confirm.d.ts +0 -19
- package/dist/experimental/confirm.d.ts.map +0 -1
- package/dist/experimental/confirm.js +0 -28
- package/dist/experimental/intl.d.ts +0 -16
- package/dist/experimental/intl.d.ts.map +0 -1
- package/dist/experimental/intl.js +0 -5
- package/dist/experimental/makeUseCommand.d.ts +0 -8
- package/dist/experimental/makeUseCommand.d.ts.map +0 -1
- package/dist/experimental/makeUseCommand.js +0 -13
- package/dist/experimental/toast.d.ts +0 -47
- package/dist/experimental/toast.d.ts.map +0 -1
- package/dist/experimental/toast.js +0 -41
- package/dist/experimental/withToast.d.ts +0 -25
- package/dist/experimental/withToast.d.ts.map +0 -1
- package/dist/experimental/withToast.js +0 -45
- package/src/experimental/intl.ts +0 -9
package/test/makeClient.test.ts
CHANGED
|
@@ -1,95 +1,149 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { S } from "effect-app"
|
|
3
|
+
import { makeQueryKey } from "../src/lib.js"
|
|
4
|
+
import { Something, SomethingElse, SomethingElseReq, SomethingReq, useClient, useExperimental } from "./stubs.js"
|
|
5
|
+
|
|
6
|
+
it("TaggedRequestFor .moduleName and request .id / .moduleName", () => {
|
|
7
|
+
expectTypeOf(SomethingReq.moduleName).toEqualTypeOf<"Something">()
|
|
8
|
+
expectTypeOf(SomethingElseReq.moduleName).toEqualTypeOf<"SomethingElse">()
|
|
9
|
+
|
|
10
|
+
expectTypeOf(Something.GetSomething2.moduleName).toEqualTypeOf<"Something">()
|
|
11
|
+
expectTypeOf(Something.GetSomething2.id).toEqualTypeOf<"Something.GetSomething2">()
|
|
12
|
+
expectTypeOf(Something.GetSomething2.type).toEqualTypeOf<"query">()
|
|
13
|
+
expectTypeOf(Something.DoSomething.type).toEqualTypeOf<"command">()
|
|
14
|
+
|
|
15
|
+
expectTypeOf(SomethingElse.GetSomething2.moduleName).toEqualTypeOf<"SomethingElse">()
|
|
16
|
+
expectTypeOf(SomethingElse.GetSomething2.id).toEqualTypeOf<"SomethingElse.GetSomething2">()
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it.skip("query type tests", () => {
|
|
20
|
+
const { clientFor } = useClient()
|
|
21
|
+
const client = clientFor(Something, () => ({
|
|
22
|
+
GetSomething2WithDependencies: (queryKey) => [
|
|
23
|
+
{ filters: { queryKey } },
|
|
24
|
+
{
|
|
25
|
+
filters: {
|
|
26
|
+
queryKey: makeQueryKey(
|
|
27
|
+
SomethingElse
|
|
28
|
+
.GetSomething2
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}))
|
|
34
|
+
|
|
35
|
+
const q = client.GetSomething2.query
|
|
12
36
|
|
|
13
|
-
const [, z] =
|
|
37
|
+
const [, z] = q({ id: "a" })
|
|
14
38
|
const valz = z.value
|
|
15
39
|
expectTypeOf(valz).toEqualTypeOf<number | undefined>()
|
|
16
40
|
|
|
17
|
-
const [, a] =
|
|
41
|
+
const [, a] = q({ id: "a" }, { placeholderData: () => 123 })
|
|
18
42
|
const val1 = a.value
|
|
19
43
|
expectTypeOf(val1).toEqualTypeOf<number>()
|
|
20
44
|
|
|
21
|
-
const [, bbbb] =
|
|
45
|
+
const [, bbbb] = q({ id: "a" }, { select: (data) => data.toString() })
|
|
22
46
|
const val = bbbb.value
|
|
23
47
|
expectTypeOf(val).toEqualTypeOf<string | undefined>()
|
|
24
48
|
|
|
25
|
-
const [, ccc] =
|
|
49
|
+
const [, ccc] = q({ id: "a" }, { placeholderData: () => 123, select: (data) => data.toString() })
|
|
26
50
|
const val2 = ccc.value
|
|
27
51
|
expectTypeOf(val2).toEqualTypeOf<string>()
|
|
28
52
|
|
|
29
|
-
const [, ddd] =
|
|
53
|
+
const [, ddd] = q({ id: "a" }, { initialData: 123, select: (data) => data.toString() })
|
|
30
54
|
const val3 = ddd.value
|
|
31
55
|
expectTypeOf(val3).toEqualTypeOf<string>()
|
|
32
56
|
|
|
33
|
-
const [, eee] =
|
|
57
|
+
const [, eee] = q({ id: "a" }, { initialData: 123, placeholderData: () => 123, select: (data) => data.toString() })
|
|
34
58
|
const val4 = eee.value
|
|
35
59
|
expectTypeOf(val4).toEqualTypeOf<string>()
|
|
36
60
|
})
|
|
37
61
|
|
|
38
62
|
it.skip("works", () => {
|
|
39
|
-
const { clientFor
|
|
63
|
+
const { clientFor } = useClient()
|
|
40
64
|
const client = clientFor(Something)
|
|
41
65
|
const Command = useExperimental()
|
|
42
66
|
|
|
43
67
|
// just for jsdoc / type testing.
|
|
44
|
-
const a0 = client.GetSomething2(null as any)
|
|
45
|
-
const a00 = client.
|
|
68
|
+
const a0 = client.GetSomething2.request(null as any)
|
|
69
|
+
const a00 = client.DoSomething.mutate(null as any)
|
|
46
70
|
const a = client.GetSomething2.suspense(null as any)
|
|
47
71
|
const b = client.GetSomething2.query(null as any)
|
|
48
72
|
|
|
49
|
-
|
|
50
|
-
const c = legacy.useQuery(null as any)
|
|
51
|
-
const d = legacy.useSuspenseQuery(null as any)
|
|
52
|
-
|
|
73
|
+
// @ts-expect-error query requests no longer expose command helpers
|
|
53
74
|
const e = client.GetSomething2.wrap(null as any)
|
|
75
|
+
// @ts-expect-error query requests no longer expose command helpers
|
|
54
76
|
const f = client.GetSomething2.fn(null as any)
|
|
55
77
|
|
|
56
|
-
// @ts-expect-error
|
|
57
|
-
const e0 = client.GetSomething2WithDependencies.wrap
|
|
58
|
-
// @ts-expect-error
|
|
59
|
-
const e000 = Command.wrap(client.GetSomething2WithDependencies)
|
|
60
|
-
const e00 = client.GetSomething2WithDependencies.
|
|
61
|
-
null as any
|
|
62
|
-
)
|
|
63
|
-
const e0000 =
|
|
64
|
-
Command.wrap(client.GetSomething2WithDependencies)((_) => _ as Effect.Effect<number, never, never>).handle
|
|
78
|
+
// @ts-expect-error query requests no longer expose command helpers
|
|
79
|
+
const e0 = client.GetSomething2WithDependencies.wrap
|
|
80
|
+
// @ts-expect-error query request does not match Command.wrap mutation signature
|
|
81
|
+
const e000 = Command.wrap(client.GetSomething2WithDependencies)
|
|
82
|
+
const e00 = client.GetSomething2WithDependencies.request(null as any)
|
|
65
83
|
// @ts-expect-error dependencies required that are not provided
|
|
66
84
|
const e1 = client.GetSomething2WithDependencies.suspense(null as any)
|
|
67
85
|
// @ts-expect-error dependencies required that are not provided
|
|
68
86
|
const e2 = client.GetSomething2WithDependencies.query(null as any)
|
|
87
|
+
// @ts-expect-error query requests no longer expose command helpers
|
|
69
88
|
const f0 = client.GetSomething2WithDependencies.fn(null as any)
|
|
70
89
|
|
|
71
|
-
const
|
|
72
|
-
const
|
|
90
|
+
const g0 = client.DoSomething.wrap(null as any)
|
|
91
|
+
const g = client.DoSomething.mutate.wrap(null as any)
|
|
92
|
+
const g1 = client.DoSomething.mutate.project(S.String)
|
|
93
|
+
const g2 = g1(null as any)
|
|
94
|
+
const g3 = g1.wrap(null as any)
|
|
95
|
+
const g4 = client.helpers.doSomethingMutation.project(S.String)
|
|
96
|
+
const g5 = g4(null as any)
|
|
97
|
+
const g6 = g4.wrap(null as any)
|
|
98
|
+
// @ts-expect-error mutate no longer exposes fn, use client.DoSomething.fn
|
|
99
|
+
const h = client.DoSomething.mutate.fn(null as any)
|
|
100
|
+
|
|
101
|
+
// projection
|
|
102
|
+
// GetSomething2 uses FiniteFromString, that means Codec is String -> Number
|
|
103
|
+
// when we project that to S.String, it should work as the encoded shapes are identical
|
|
104
|
+
// aka, when we project, we skip decoding with the original codec, and instead use the provided one
|
|
105
|
+
// we have to make sure the Encoded shape of the provided projection schema matches the Encoded Shape of the original codec.
|
|
106
|
+
const projected = client.GetSomething2.project(S.String)
|
|
107
|
+
// @ts-expect-error encoded type mismatch: original encodes to string, S.Number encodes to number
|
|
108
|
+
const _projectedBad = client.GetSomething2.project(S.Number)
|
|
109
|
+
const p0 = projected.request(null as any)
|
|
110
|
+
|
|
111
|
+
// struct example: success schema encodes to { a: string | null }
|
|
112
|
+
// good: projection schema also expects { a: string | null } on the encoded side
|
|
113
|
+
const projectedStruct = client.GetStructNullable.project(S.Struct({ a: S.NullOr(S.String) }))
|
|
114
|
+
// bad: { a: S.String } has encoded type { a: string } — does not accept null
|
|
115
|
+
// @ts-expect-error encoded type mismatch: original encodes to { a: string | null }, projection expects { a: string }
|
|
116
|
+
const _projectedStructBad = client.GetStructNullable.project(S.Struct({ a: S.String }))
|
|
117
|
+
|
|
118
|
+
const p00 = projected.query(null as any)
|
|
119
|
+
const p = projected.suspense(null as any)
|
|
73
120
|
|
|
74
121
|
expect(true).toBe(true)
|
|
75
122
|
console.log({
|
|
76
123
|
a,
|
|
77
124
|
a0,
|
|
78
125
|
a00,
|
|
79
|
-
c0,
|
|
80
126
|
b,
|
|
81
|
-
c,
|
|
82
|
-
d,
|
|
83
127
|
e,
|
|
84
128
|
e0,
|
|
85
129
|
e00,
|
|
86
130
|
e000,
|
|
87
|
-
e0000,
|
|
88
131
|
e1,
|
|
89
132
|
e2,
|
|
90
133
|
f,
|
|
91
134
|
f0,
|
|
135
|
+
g0,
|
|
92
136
|
g,
|
|
93
|
-
|
|
137
|
+
g1,
|
|
138
|
+
g2,
|
|
139
|
+
g3,
|
|
140
|
+
g4,
|
|
141
|
+
g5,
|
|
142
|
+
g6,
|
|
143
|
+
h,
|
|
144
|
+
p0,
|
|
145
|
+
p00,
|
|
146
|
+
p,
|
|
147
|
+
projectedStruct
|
|
94
148
|
})
|
|
95
149
|
})
|
package/test/stubs.ts
CHANGED
|
@@ -6,13 +6,13 @@ import { ApiClientFactory, makeRpcClient } from "effect-app/client"
|
|
|
6
6
|
import { RpcContextMap } from "effect-app/rpc"
|
|
7
7
|
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient"
|
|
8
8
|
import { ref } from "vue"
|
|
9
|
-
import { Commander } from "../src/
|
|
10
|
-
import { I18n } from "../src/
|
|
11
|
-
import {
|
|
12
|
-
import * as Toast from "../src/experimental/toast.js"
|
|
13
|
-
import { WithToast } from "../src/experimental/withToast.js"
|
|
14
|
-
import { LegacyMutation, makeClient } from "../src/makeClient.js"
|
|
9
|
+
import { Commander } from "../src/commander.js"
|
|
10
|
+
import { I18n } from "../src/intl.js"
|
|
11
|
+
import { makeClient } from "../src/makeClient.js"
|
|
15
12
|
import { type MakeIntlReturn } from "../src/makeIntl.js"
|
|
13
|
+
import { makeUseCommand } from "../src/makeUseCommand.js"
|
|
14
|
+
import * as Toast from "../src/toast.js"
|
|
15
|
+
import { WithToast } from "../src/withToast.js"
|
|
16
16
|
|
|
17
17
|
const fakeToastLayer = (toasts: any[] = []) =>
|
|
18
18
|
Layer.effect(
|
|
@@ -26,33 +26,34 @@ const fakeToastLayer = (toasts: any[] = []) =>
|
|
|
26
26
|
toasts.splice(idx, 1)
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
const fakeToast =
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const fakeToast =
|
|
30
|
+
(type: "error" | "warning" | "success" | "info") => (message: string, options?: Toast.ToastOpts) => {
|
|
31
|
+
const id = options?.id ?? Math.random().toString(36).substring(2, 15)
|
|
32
|
+
console.log(`Toast [${type}][${id}]: ${message}`, options)
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
options = { ...options, id }
|
|
35
|
+
const idx = toasts.findIndex((_) => _.id === id)
|
|
36
|
+
if (idx > -1) {
|
|
37
|
+
const toast = toasts[idx]
|
|
38
|
+
clearTimeout(toast.timeoutId)
|
|
39
|
+
Object.assign(toast, { type, message, options })
|
|
40
|
+
toast.timeoutId = setTimeout(() => {
|
|
41
|
+
toasts.splice(idx, 1)
|
|
42
|
+
}, options?.timeout ?? 3000)
|
|
43
|
+
} else {
|
|
44
|
+
const toast: any = { id, type, message, options }
|
|
45
|
+
toast.timeoutId = setTimeout(() => {
|
|
46
|
+
toasts.splice(idx, 1)
|
|
47
|
+
}, options?.timeout ?? 3000)
|
|
48
|
+
toasts.push(toast)
|
|
49
|
+
}
|
|
50
|
+
return id
|
|
48
51
|
}
|
|
49
|
-
return id
|
|
50
|
-
}
|
|
51
52
|
return Toast.Toast.of(Toast.wrap({
|
|
52
|
-
error: fakeToast,
|
|
53
|
-
warning: fakeToast,
|
|
54
|
-
success: fakeToast,
|
|
55
|
-
info: fakeToast,
|
|
53
|
+
error: fakeToast("error"),
|
|
54
|
+
warning: fakeToast("warning"),
|
|
55
|
+
success: fakeToast("success"),
|
|
56
|
+
info: fakeToast("info"),
|
|
56
57
|
dismiss
|
|
57
58
|
})) as any
|
|
58
59
|
})
|
|
@@ -92,20 +93,62 @@ export const useExperimental = (
|
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
export class RequestContextMap extends RpcContextMap.makeMap({}) {}
|
|
95
|
-
export const {
|
|
96
|
-
|
|
96
|
+
export const { TaggedRequestFor } = makeRpcClient(RequestContextMap)
|
|
97
|
+
|
|
98
|
+
export const SomethingReq = TaggedRequestFor("Something")
|
|
99
|
+
const SomethingQuery = SomethingReq.Query
|
|
100
|
+
const SomethingCommand = SomethingReq.Command
|
|
101
|
+
|
|
102
|
+
class SomethingGetSomething2 extends SomethingQuery<SomethingGetSomething2>()("GetSomething2", {
|
|
97
103
|
id: S.String
|
|
98
|
-
}, { success: S.
|
|
104
|
+
}, { success: S.FiniteFromString }) {}
|
|
105
|
+
|
|
106
|
+
class SomethingGetSomething2WithDependencies
|
|
107
|
+
extends SomethingQuery<SomethingGetSomething2WithDependencies>()("GetSomething2", {
|
|
108
|
+
id: S.String
|
|
109
|
+
}, {
|
|
110
|
+
// this is intentilally fake, to simulate a codec that requires a dependency
|
|
111
|
+
success: S.FiniteFromString as S.Codec<number, string, "dep-a">,
|
|
112
|
+
error: S.String
|
|
113
|
+
})
|
|
114
|
+
{}
|
|
99
115
|
|
|
100
|
-
|
|
116
|
+
class SomethingDoSomething extends SomethingCommand<SomethingDoSomething>()("DoSomething", {
|
|
101
117
|
id: S.String
|
|
102
|
-
}, {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
118
|
+
}, { success: S.FiniteFromString }) {}
|
|
119
|
+
|
|
120
|
+
// success schema has encoded shape { a: string | null } — used to test projection constraints
|
|
121
|
+
class SomethingGetStructNullable extends SomethingQuery<SomethingGetStructNullable>()("GetStructNullable", {}, {
|
|
122
|
+
success: S.Struct({ a: S.NullOr(S.String) })
|
|
106
123
|
}) {}
|
|
107
124
|
|
|
108
|
-
export const Something = {
|
|
125
|
+
export const Something = {
|
|
126
|
+
GetSomething2: SomethingGetSomething2,
|
|
127
|
+
GetSomething2WithDependencies: SomethingGetSomething2WithDependencies,
|
|
128
|
+
DoSomething: SomethingDoSomething,
|
|
129
|
+
GetStructNullable: SomethingGetStructNullable
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export const SomethingElseReq = TaggedRequestFor("SomethingElse")
|
|
133
|
+
const SomethingElseQuery = SomethingElseReq.Query
|
|
134
|
+
|
|
135
|
+
class SomethingElseGetSomething2 extends SomethingElseQuery<SomethingElseGetSomething2>()("GetSomething2", {
|
|
136
|
+
id: S.String
|
|
137
|
+
}, { success: S.FiniteFromString }) {}
|
|
138
|
+
|
|
139
|
+
class SomethingElseGetSomething2WithDependencies
|
|
140
|
+
extends SomethingElseQuery<SomethingElseGetSomething2WithDependencies>()("GetSomething2", {
|
|
141
|
+
id: S.String
|
|
142
|
+
}, {
|
|
143
|
+
success: S.FiniteFromString as S.Codec<number, string, "dep-a">,
|
|
144
|
+
error: S.String
|
|
145
|
+
})
|
|
146
|
+
{}
|
|
147
|
+
|
|
148
|
+
export const SomethingElse = {
|
|
149
|
+
GetSomething2: SomethingElseGetSomething2,
|
|
150
|
+
GetSomething2WithDependencies: SomethingElseGetSomething2WithDependencies
|
|
151
|
+
}
|
|
109
152
|
|
|
110
153
|
export const useClient = (
|
|
111
154
|
options?: { messages?: Record<string, string> | Record<string, MessageFormatElement[]>; toasts: any[] }
|
|
@@ -117,8 +160,7 @@ export const useClient = (
|
|
|
117
160
|
const api = ApiClientFactory.layer({ url: "bogus", headers: Option.none() }).pipe(
|
|
118
161
|
Layer.provide(FetchHttpClient.layer)
|
|
119
162
|
)
|
|
120
|
-
const
|
|
121
|
-
const layers = Layer.mergeAll(CommanderLayer, WithToastLayer, FakeToastLayer, FakeIntlLayer, api, lm)
|
|
163
|
+
const layers = Layer.mergeAll(CommanderLayer, WithToastLayer, FakeToastLayer, FakeIntlLayer, api)
|
|
122
164
|
|
|
123
165
|
const clientFor_ = ApiClientFactory.makeFor(Layer.empty)
|
|
124
166
|
return makeClient(() => ManagedRuntime.make(layers), clientFor_, Layer.empty)
|
package/tsconfig.json
CHANGED
package/tsconfig.json.bak
CHANGED
package/tsconfig.src.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
],
|
|
8
|
-
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"rootDir": "./src",
|
|
11
|
-
// keep in here, cause madge can't detect it from extended tsconfig
|
|
12
|
-
"moduleResolution": "Node16",
|
|
13
|
-
"outDir": "./dist"
|
|
14
|
-
},
|
|
15
|
-
"include": [
|
|
16
|
-
"./src/**/*.ts"
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"lib": [
|
|
5
|
+
"esnext",
|
|
6
|
+
"DOM"
|
|
17
7
|
],
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
8
|
+
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"rootDir": "./src",
|
|
11
|
+
// keep in here, cause madge can't detect it from extended tsconfig
|
|
12
|
+
"moduleResolution": "Node16",
|
|
13
|
+
"outDir": "./dist"
|
|
14
|
+
},
|
|
15
|
+
"include": [
|
|
16
|
+
"./src/**/*.ts"
|
|
17
|
+
],
|
|
18
|
+
"exclude": [
|
|
19
|
+
"./dist",
|
|
20
|
+
"*.test.ts",
|
|
21
|
+
"node_modules",
|
|
22
|
+
"build",
|
|
23
|
+
"lib",
|
|
24
|
+
"dist",
|
|
25
|
+
"**/*.d.ts.map",
|
|
26
|
+
".git",
|
|
27
|
+
".data",
|
|
28
|
+
"**/.*",
|
|
29
|
+
"**/*.tmp"
|
|
30
|
+
],
|
|
31
|
+
"references": [
|
|
32
|
+
{
|
|
33
|
+
"path": "../effect-app"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
package/tsconfig.test.json
CHANGED
package/vitest.config.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/// <reference types="vitest" />
|
|
2
|
+
import vue from "@vitejs/plugin-vue"
|
|
2
3
|
import { defineConfig } from "vitest/config"
|
|
3
|
-
import vue from '@vitejs/plugin-vue'
|
|
4
4
|
import makeConfig from "../../vite.config.base"
|
|
5
5
|
|
|
6
6
|
export default defineConfig({
|
|
7
7
|
...makeConfig(__dirname),
|
|
8
8
|
plugins: [vue()],
|
|
9
9
|
test: {
|
|
10
|
-
environment:
|
|
11
|
-
include: [
|
|
12
|
-
exclude: [
|
|
10
|
+
environment: "jsdom",
|
|
11
|
+
include: ["src/**/*.test.{ts,tsx}", "**/test/**/*.test.{ts,tsx}", "**/__tests__/**/*.test.{ts,tsx}"],
|
|
12
|
+
exclude: ["node_modules/**", "dist/**"],
|
|
13
13
|
globals: true
|
|
14
14
|
},
|
|
15
15
|
optimizeDeps: {
|
|
16
|
-
exclude: [
|
|
16
|
+
exclude: ["**/__tests__/**", "**/test/**", "**/*.test.*"]
|
|
17
17
|
}
|
|
18
18
|
})
|