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