@effect-app/vue 4.0.0-beta.19 → 4.0.0-beta.191
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 +1398 -0
- package/dist/commander.d.ts +620 -0
- package/dist/commander.d.ts.map +1 -0
- package/dist/commander.js +1056 -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 +14 -5
- 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 +6 -8
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +34 -7
- package/dist/makeClient.d.ts +191 -292
- package/dist/makeClient.d.ts.map +1 -1
- package/dist/makeClient.js +217 -369
- 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 +56 -25
- package/dist/mutate.d.ts.map +1 -1
- package/dist/mutate.js +132 -33
- package/dist/query.d.ts +24 -16
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +119 -37
- package/dist/routeParams.d.ts +1 -1
- package/dist/runtime.d.ts +7 -4
- 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 +54 -0
- package/examples/streamMutation.ts +70 -0
- package/package.json +47 -49
- package/src/commander.ts +3378 -0
- package/src/{experimental/confirm.ts → confirm.ts} +10 -14
- package/src/errorReporter.ts +62 -74
- package/src/form.ts +56 -17
- package/src/intl.ts +12 -0
- package/src/lib.ts +46 -13
- package/src/makeClient.ts +623 -1043
- package/src/{experimental/makeUseCommand.ts → makeUseCommand.ts} +6 -4
- package/src/mutate.ts +273 -72
- package/src/query.ts +181 -68
- package/src/runtime.ts +41 -20
- package/src/{experimental/toast.ts → toast.ts} +11 -25
- package/src/{experimental/withToast.ts → withToast.ts} +28 -10
- package/test/Mutation.test.ts +176 -23
- package/test/dist/form.test.d.ts.map +1 -1
- package/test/dist/lib.test.d.ts.map +1 -0
- package/test/dist/streamFinal.test.d.ts.map +1 -0
- package/test/dist/streamFn.test.d.ts.map +1 -0
- package/test/dist/stubs.d.ts +3294 -115
- package/test/dist/stubs.d.ts.map +1 -1
- package/test/dist/stubs.js +177 -31
- 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 +286 -38
- package/test/streamFinal.test.ts +63 -0
- package/test/streamFn.test.ts +455 -0
- package/test/stubs.ts +213 -42
- package/tsconfig.examples.json +20 -0
- package/tsconfig.json +0 -1
- package/tsconfig.json.bak +5 -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/eslint.config.mjs +0 -24
- package/src/experimental/commander.ts +0 -1835
- package/src/experimental/intl.ts +0 -9
package/test/stubs.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import { type MessageFormatElement } from "@formatjs/icu-messageformat-parser"
|
|
3
3
|
import * as Intl from "@formatjs/intl"
|
|
4
|
+
import { QueryClient, VueQueryPlugin } from "@tanstack/vue-query"
|
|
4
5
|
import { Effect, Layer, ManagedRuntime, Option, S } from "effect-app"
|
|
5
6
|
import { ApiClientFactory, makeRpcClient } from "effect-app/client"
|
|
6
7
|
import { RpcContextMap } from "effect-app/rpc"
|
|
8
|
+
import * as Exit from "effect/Exit"
|
|
7
9
|
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient"
|
|
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"
|
|
10
|
+
import { createApp, ref } from "vue"
|
|
11
|
+
import { Commander } from "../src/commander.js"
|
|
12
|
+
import { I18n } from "../src/intl.js"
|
|
13
|
+
import { makeClient } from "../src/makeClient.js"
|
|
15
14
|
import { type MakeIntlReturn } from "../src/makeIntl.js"
|
|
15
|
+
import { makeUseCommand } from "../src/makeUseCommand.js"
|
|
16
|
+
import * as Toast from "../src/toast.js"
|
|
17
|
+
import { WithToast } from "../src/withToast.js"
|
|
16
18
|
|
|
17
19
|
const fakeToastLayer = (toasts: any[] = []) =>
|
|
18
20
|
Layer.effect(
|
|
@@ -26,33 +28,40 @@ const fakeToastLayer = (toasts: any[] = []) =>
|
|
|
26
28
|
toasts.splice(idx, 1)
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
const scheduleAutoDismiss = (toast: any, timeout: number | undefined) => {
|
|
32
|
+
// Treat Infinity / undefined as "stays until explicitly replaced/dismissed".
|
|
33
|
+
// Node's setTimeout silently clamps Infinity to 1ms which would otherwise
|
|
34
|
+
// cause the toast to disappear before assertions can observe it.
|
|
35
|
+
if (timeout === undefined || !Number.isFinite(timeout)) return
|
|
36
|
+
toast.timeoutId = setTimeout(() => {
|
|
37
|
+
const i = toasts.indexOf(toast)
|
|
38
|
+
if (i > -1) toasts.splice(i, 1)
|
|
39
|
+
}, timeout)
|
|
40
|
+
}
|
|
41
|
+
const fakeToast =
|
|
42
|
+
(type: "error" | "warning" | "success" | "info") => (message: string, options?: Toast.ToastOpts) => {
|
|
43
|
+
const id = options?.id ?? Math.random().toString(36).substring(2, 15)
|
|
44
|
+
console.log(`Toast [${type}][${id}]: ${message}`, options)
|
|
32
45
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}, options?.timeout ?? 3000)
|
|
47
|
-
toasts.push(toast)
|
|
46
|
+
options = { ...options, id }
|
|
47
|
+
const idx = toasts.findIndex((_) => _.id === id)
|
|
48
|
+
if (idx > -1) {
|
|
49
|
+
const toast = toasts[idx]
|
|
50
|
+
clearTimeout(toast.timeoutId)
|
|
51
|
+
Object.assign(toast, { type, message, options })
|
|
52
|
+
scheduleAutoDismiss(toast, options?.timeout ?? 3000)
|
|
53
|
+
} else {
|
|
54
|
+
const toast: any = { id, type, message, options }
|
|
55
|
+
toasts.push(toast)
|
|
56
|
+
scheduleAutoDismiss(toast, options?.timeout ?? 3000)
|
|
57
|
+
}
|
|
58
|
+
return id
|
|
48
59
|
}
|
|
49
|
-
return id
|
|
50
|
-
}
|
|
51
60
|
return Toast.Toast.of(Toast.wrap({
|
|
52
|
-
error: fakeToast,
|
|
53
|
-
warning: fakeToast,
|
|
54
|
-
success: fakeToast,
|
|
55
|
-
info: fakeToast,
|
|
61
|
+
error: fakeToast("error"),
|
|
62
|
+
warning: fakeToast("warning"),
|
|
63
|
+
success: fakeToast("success"),
|
|
64
|
+
info: fakeToast("info"),
|
|
56
65
|
dismiss
|
|
57
66
|
})) as any
|
|
58
67
|
})
|
|
@@ -91,21 +100,161 @@ export const useExperimental = (
|
|
|
91
100
|
return Effect.runSync(makeUseCommand<WithToast | Toast.Toast | I18n>(Layer.empty).pipe(Effect.provide(layers)))
|
|
92
101
|
}
|
|
93
102
|
|
|
103
|
+
// Effect-returning variant: keeps the caller's runtime context (e.g. a TestClock
|
|
104
|
+
// provided by `it.effect`) so virtual-time advances reach the runtime captured
|
|
105
|
+
// inside Commander.
|
|
106
|
+
export const useExperimentalE = (
|
|
107
|
+
options?: { messages?: Record<string, string> | Record<string, MessageFormatElement[]>; toasts: any[] }
|
|
108
|
+
) => {
|
|
109
|
+
const FakeIntlLayer = fakeIntlLayer(options?.messages)
|
|
110
|
+
const FakeToastLayer = fakeToastLayer(options?.toasts)
|
|
111
|
+
const CommanderLayer = Commander.Default.pipe(Layer.provide([FakeIntlLayer, FakeToastLayer]))
|
|
112
|
+
const WithToastLayer = WithToast.Default.pipe(Layer.provide(FakeToastLayer))
|
|
113
|
+
const layers = Layer.mergeAll(CommanderLayer, WithToastLayer, FakeToastLayer, FakeIntlLayer)
|
|
114
|
+
|
|
115
|
+
return makeUseCommand<WithToast | Toast.Toast | I18n>(Layer.empty).pipe(Effect.provide(layers))
|
|
116
|
+
}
|
|
117
|
+
|
|
94
118
|
export class RequestContextMap extends RpcContextMap.makeMap({}) {}
|
|
95
|
-
export const {
|
|
96
|
-
|
|
119
|
+
export const { TaggedRequestFor } = makeRpcClient(RequestContextMap)
|
|
120
|
+
|
|
121
|
+
export const SomethingReq = TaggedRequestFor("Something")
|
|
122
|
+
const SomethingQuery = SomethingReq.Query
|
|
123
|
+
const SomethingCommand = SomethingReq.Command
|
|
124
|
+
const SomethingStream = SomethingReq.Stream
|
|
125
|
+
|
|
126
|
+
class SomethingGetSomething2 extends SomethingQuery<SomethingGetSomething2>()("GetSomething2", {
|
|
127
|
+
id: S.String
|
|
128
|
+
}, { success: S.FiniteFromString }) {}
|
|
129
|
+
|
|
130
|
+
class SomethingGetSomething3 extends SomethingQuery<SomethingGetSomething3>()("GetSomething3", {
|
|
131
|
+
id: S.NullOr(S.String).withDefault
|
|
132
|
+
}, { success: S.FiniteFromString }) {}
|
|
133
|
+
|
|
134
|
+
class SomethingGetSomething4
|
|
135
|
+
extends SomethingQuery<SomethingGetSomething4>()("GetSomething4", {}, { success: S.FiniteFromString })
|
|
136
|
+
{}
|
|
137
|
+
|
|
138
|
+
class SomethingGetSomething2WithDependencies
|
|
139
|
+
extends SomethingQuery<SomethingGetSomething2WithDependencies>()("GetSomething2", {
|
|
140
|
+
id: S.String
|
|
141
|
+
}, {
|
|
142
|
+
// this is intentilally fake, to simulate a codec that requires a dependency
|
|
143
|
+
success: S.FiniteFromString as S.Codec<number, string, "dep-a">,
|
|
144
|
+
error: S.String
|
|
145
|
+
})
|
|
146
|
+
{}
|
|
147
|
+
|
|
148
|
+
type SomethingInvalidationResources = {
|
|
149
|
+
GetSomething2: typeof SomethingGetSomething2
|
|
150
|
+
GetSomething2WithDependencies: typeof SomethingGetSomething2WithDependencies
|
|
151
|
+
GetSomething3: typeof SomethingGetSomething3
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// command stubs covering the input-shape matrix
|
|
155
|
+
class SomethingDoNoProps extends SomethingCommand<SomethingDoNoProps>()("DoNoProps", {}) {}
|
|
156
|
+
|
|
157
|
+
class SomethingDoOptionalOnly extends SomethingCommand<SomethingDoOptionalOnly>()("DoOptionalOnly", {
|
|
158
|
+
name: S.optional(S.String)
|
|
159
|
+
}) {}
|
|
160
|
+
|
|
161
|
+
class SomethingDoRequiredOnly extends SomethingCommand<SomethingDoRequiredOnly>()("DoRequiredOnly", {
|
|
162
|
+
id: S.String
|
|
163
|
+
}) {}
|
|
164
|
+
|
|
165
|
+
class SomethingDoMixed extends SomethingCommand<SomethingDoMixed>()("DoMixed", {
|
|
166
|
+
id: S.String,
|
|
167
|
+
name: S.optional(S.String)
|
|
168
|
+
}) {}
|
|
169
|
+
|
|
170
|
+
class SomethingDoSomething extends SomethingCommand<
|
|
171
|
+
SomethingDoSomething,
|
|
172
|
+
{ Something: SomethingInvalidationResources }
|
|
173
|
+
>()("DoSomething", {
|
|
97
174
|
id: S.String
|
|
98
|
-
}, {
|
|
175
|
+
}, {
|
|
176
|
+
success: S.FiniteFromString
|
|
177
|
+
}, (queryKey, { Something }, input, output) => {
|
|
178
|
+
return [
|
|
179
|
+
{ filters: { queryKey } },
|
|
180
|
+
{
|
|
181
|
+
filters: {
|
|
182
|
+
queryKey: [
|
|
183
|
+
Something["GetSomething2"].id,
|
|
184
|
+
input.id,
|
|
185
|
+
Exit.isSuccess(output) ? output.value.toString() : "failed"
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
}) {}
|
|
99
191
|
|
|
100
|
-
|
|
192
|
+
// success schema has encoded shape { a: string | null } — used to test projection constraints
|
|
193
|
+
class SomethingGetStructNullable extends SomethingQuery<SomethingGetStructNullable>()("GetStructNullable", {}, {
|
|
194
|
+
success: S.Struct({ a: S.NullOr(S.String) })
|
|
195
|
+
}) {}
|
|
196
|
+
|
|
197
|
+
/** Stream event: intermediate progress update. */
|
|
198
|
+
export class OperationProgress extends S.TaggedClass<OperationProgress>()("OperationProgress", {
|
|
199
|
+
completed: S.NonNegativeInt,
|
|
200
|
+
total: S.NonNegativeInt
|
|
201
|
+
}) {}
|
|
202
|
+
|
|
203
|
+
/** Stream event: final completion result. */
|
|
204
|
+
export class ExportComplete extends S.TaggedClass<ExportComplete>()("ExportComplete", {
|
|
205
|
+
fileUrl: S.NonEmptyString
|
|
206
|
+
}) {}
|
|
207
|
+
|
|
208
|
+
/** Stream with no `final` schema — execute resolves with `void`. */
|
|
209
|
+
class SomethingStreamWithoutFinal extends SomethingStream<SomethingStreamWithoutFinal>()("StreamWithoutFinal", {
|
|
101
210
|
id: S.String
|
|
102
211
|
}, {
|
|
103
|
-
|
|
104
|
-
success: S.NumberFromString as S.Codec<number, string, "dep-a">,
|
|
105
|
-
error: S.String
|
|
212
|
+
success: S.Union([OperationProgress, ExportComplete])
|
|
106
213
|
}) {}
|
|
107
214
|
|
|
108
|
-
|
|
215
|
+
/** Stream with a `final` schema — execute resolves with `ExportComplete`. */
|
|
216
|
+
class SomethingStreamWithFinal extends SomethingStream<SomethingStreamWithFinal>()("StreamWithFinal", {
|
|
217
|
+
id: S.String
|
|
218
|
+
}, {
|
|
219
|
+
success: S.Union([OperationProgress, ExportComplete]),
|
|
220
|
+
final: ExportComplete
|
|
221
|
+
}) {}
|
|
222
|
+
|
|
223
|
+
export const Something = {
|
|
224
|
+
GetSomething2: SomethingGetSomething2,
|
|
225
|
+
GetSomething2WithDependencies: SomethingGetSomething2WithDependencies,
|
|
226
|
+
GetSomething3: SomethingGetSomething3,
|
|
227
|
+
GetSomething4: SomethingGetSomething4,
|
|
228
|
+
DoNoProps: SomethingDoNoProps,
|
|
229
|
+
DoOptionalOnly: SomethingDoOptionalOnly,
|
|
230
|
+
DoRequiredOnly: SomethingDoRequiredOnly,
|
|
231
|
+
DoMixed: SomethingDoMixed,
|
|
232
|
+
DoSomething: SomethingDoSomething,
|
|
233
|
+
GetStructNullable: SomethingGetStructNullable,
|
|
234
|
+
StreamWithoutFinal: SomethingStreamWithoutFinal,
|
|
235
|
+
StreamWithFinal: SomethingStreamWithFinal
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export const SomethingElseReq = TaggedRequestFor("SomethingElse")
|
|
239
|
+
const SomethingElseQuery = SomethingElseReq.Query
|
|
240
|
+
|
|
241
|
+
class SomethingElseGetSomething2 extends SomethingElseQuery<SomethingElseGetSomething2>()("GetSomething2", {
|
|
242
|
+
id: S.String
|
|
243
|
+
}, { success: S.FiniteFromString }) {}
|
|
244
|
+
|
|
245
|
+
class SomethingElseGetSomething2WithDependencies
|
|
246
|
+
extends SomethingElseQuery<SomethingElseGetSomething2WithDependencies>()("GetSomething2", {
|
|
247
|
+
id: S.String
|
|
248
|
+
}, {
|
|
249
|
+
success: S.FiniteFromString as S.Codec<number, string, "dep-a">,
|
|
250
|
+
error: S.String
|
|
251
|
+
})
|
|
252
|
+
{}
|
|
253
|
+
|
|
254
|
+
export const SomethingElse = {
|
|
255
|
+
GetSomething2: SomethingElseGetSomething2,
|
|
256
|
+
GetSomething2WithDependencies: SomethingElseGetSomething2WithDependencies
|
|
257
|
+
}
|
|
109
258
|
|
|
110
259
|
export const useClient = (
|
|
111
260
|
options?: { messages?: Record<string, string> | Record<string, MessageFormatElement[]>; toasts: any[] }
|
|
@@ -117,9 +266,31 @@ export const useClient = (
|
|
|
117
266
|
const api = ApiClientFactory.layer({ url: "bogus", headers: Option.none() }).pipe(
|
|
118
267
|
Layer.provide(FetchHttpClient.layer)
|
|
119
268
|
)
|
|
120
|
-
const
|
|
121
|
-
const layers = Layer.mergeAll(CommanderLayer, WithToastLayer, FakeToastLayer, FakeIntlLayer, api, lm)
|
|
269
|
+
const layers = Layer.mergeAll(CommanderLayer, WithToastLayer, FakeToastLayer, FakeIntlLayer, api)
|
|
122
270
|
|
|
123
271
|
const clientFor_ = ApiClientFactory.makeFor(Layer.empty)
|
|
124
|
-
|
|
272
|
+
const rawClient = makeClient(() => ManagedRuntime.make(layers), clientFor_, Layer.empty)
|
|
273
|
+
|
|
274
|
+
// Provide a Vue injection context so that composition-API hooks (e.g. useQueryClient)
|
|
275
|
+
// called during client initialisation work outside a component setup() function.
|
|
276
|
+
const vueApp = createApp({})
|
|
277
|
+
const testQueryClientConfig = { defaultOptions: { queries: { retry: false }, mutations: { retry: false } } }
|
|
278
|
+
vueApp.use(VueQueryPlugin, { queryClient: new QueryClient(testQueryClientConfig) })
|
|
279
|
+
|
|
280
|
+
const origClientFor = rawClient.clientFor
|
|
281
|
+
const clientFor: typeof origClientFor = function(m, ...args) {
|
|
282
|
+
const proxy = origClientFor(m, ...args)
|
|
283
|
+
// Warm up lazy mutation-hook initialisation inside the Vue injection context.
|
|
284
|
+
// After the first property access, useMutation() is cached and subsequent
|
|
285
|
+
// accesses outside the context succeed.
|
|
286
|
+
const firstPropertyName = Object.keys(m)[0]
|
|
287
|
+
if (firstPropertyName !== undefined) {
|
|
288
|
+
vueApp.runWithContext(() => {
|
|
289
|
+
void (proxy as Record<string, unknown>)[firstPropertyName]
|
|
290
|
+
})
|
|
291
|
+
}
|
|
292
|
+
return proxy
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
return { ...rawClient, clientFor }
|
|
125
296
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"include": [
|
|
4
|
+
"examples"
|
|
5
|
+
],
|
|
6
|
+
"references": [
|
|
7
|
+
{
|
|
8
|
+
"path": "./tsconfig.src.json"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"compilerOptions": {
|
|
12
|
+
"lib": [
|
|
13
|
+
"esnext",
|
|
14
|
+
"DOM"
|
|
15
|
+
],
|
|
16
|
+
"tsBuildInfoFile": ".tsbuildinfo/examples.tsbuildinfo",
|
|
17
|
+
"rootDir": "examples",
|
|
18
|
+
"moduleResolution": "Node16"
|
|
19
|
+
}
|
|
20
|
+
}
|
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
|
})
|