@effect-app/vue 4.0.0-beta.20 → 4.0.0-beta.200

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.
Files changed (103) hide show
  1. package/CHANGELOG.md +1479 -0
  2. package/dist/commander.d.ts +628 -0
  3. package/dist/commander.d.ts.map +1 -0
  4. package/dist/commander.js +1055 -0
  5. package/dist/confirm.d.ts +19 -0
  6. package/dist/confirm.d.ts.map +1 -0
  7. package/dist/confirm.js +24 -0
  8. package/dist/errorReporter.d.ts +4 -4
  9. package/dist/errorReporter.d.ts.map +1 -1
  10. package/dist/errorReporter.js +12 -18
  11. package/dist/form.d.ts +14 -5
  12. package/dist/form.d.ts.map +1 -1
  13. package/dist/form.js +41 -12
  14. package/dist/index.d.ts +1 -1
  15. package/dist/intl.d.ts +15 -0
  16. package/dist/intl.d.ts.map +1 -0
  17. package/dist/intl.js +9 -0
  18. package/dist/lib.d.ts +6 -9
  19. package/dist/lib.d.ts.map +1 -1
  20. package/dist/lib.js +35 -10
  21. package/dist/makeClient.d.ts +152 -339
  22. package/dist/makeClient.d.ts.map +1 -1
  23. package/dist/makeClient.js +221 -376
  24. package/dist/makeContext.d.ts +1 -1
  25. package/dist/makeContext.d.ts.map +1 -1
  26. package/dist/makeIntl.d.ts +1 -1
  27. package/dist/makeIntl.d.ts.map +1 -1
  28. package/dist/makeUseCommand.d.ts +8 -0
  29. package/dist/makeUseCommand.d.ts.map +1 -0
  30. package/dist/makeUseCommand.js +13 -0
  31. package/dist/mutate.d.ts +52 -34
  32. package/dist/mutate.d.ts.map +1 -1
  33. package/dist/mutate.js +137 -46
  34. package/dist/query.d.ts +19 -39
  35. package/dist/query.d.ts.map +1 -1
  36. package/dist/query.js +128 -72
  37. package/dist/routeParams.d.ts +1 -1
  38. package/dist/runtime.d.ts +7 -4
  39. package/dist/runtime.d.ts.map +1 -1
  40. package/dist/runtime.js +27 -17
  41. package/dist/toast.d.ts +46 -0
  42. package/dist/toast.d.ts.map +1 -0
  43. package/dist/toast.js +32 -0
  44. package/dist/withToast.d.ts +26 -0
  45. package/dist/withToast.d.ts.map +1 -0
  46. package/dist/withToast.js +54 -0
  47. package/examples/streamMutation.ts +70 -0
  48. package/package.json +48 -50
  49. package/src/commander.ts +3384 -0
  50. package/src/{experimental/confirm.ts → confirm.ts} +10 -14
  51. package/src/errorReporter.ts +62 -74
  52. package/src/form.ts +56 -17
  53. package/src/intl.ts +12 -0
  54. package/src/lib.ts +47 -20
  55. package/src/makeClient.ts +568 -1134
  56. package/src/{experimental/makeUseCommand.ts → makeUseCommand.ts} +6 -4
  57. package/src/mutate.ts +265 -127
  58. package/src/query.ts +197 -183
  59. package/src/runtime.ts +41 -20
  60. package/src/{experimental/toast.ts → toast.ts} +11 -25
  61. package/src/{experimental/withToast.ts → withToast.ts} +28 -10
  62. package/test/Mutation.test.ts +176 -23
  63. package/test/dist/form.test.d.ts.map +1 -1
  64. package/test/dist/lib.test.d.ts.map +1 -0
  65. package/test/dist/streamFinal.test.d.ts.map +1 -0
  66. package/test/dist/streamFn.test.d.ts.map +1 -0
  67. package/test/dist/stubs.d.ts +3273 -121
  68. package/test/dist/stubs.d.ts.map +1 -1
  69. package/test/dist/stubs.js +178 -31
  70. package/test/form-validation-errors.test.ts +23 -19
  71. package/test/form.test.ts +20 -2
  72. package/test/lib.test.ts +240 -0
  73. package/test/makeClient.test.ts +292 -38
  74. package/test/streamFinal.test.ts +63 -0
  75. package/test/streamFn.test.ts +455 -0
  76. package/test/stubs.ts +214 -42
  77. package/tsconfig.examples.json +20 -0
  78. package/tsconfig.json +0 -1
  79. package/tsconfig.json.bak +5 -2
  80. package/tsconfig.src.json +34 -34
  81. package/tsconfig.test.json +2 -2
  82. package/vitest.config.ts +5 -5
  83. package/dist/experimental/commander.d.ts +0 -359
  84. package/dist/experimental/commander.d.ts.map +0 -1
  85. package/dist/experimental/commander.js +0 -557
  86. package/dist/experimental/confirm.d.ts +0 -19
  87. package/dist/experimental/confirm.d.ts.map +0 -1
  88. package/dist/experimental/confirm.js +0 -28
  89. package/dist/experimental/intl.d.ts +0 -16
  90. package/dist/experimental/intl.d.ts.map +0 -1
  91. package/dist/experimental/intl.js +0 -5
  92. package/dist/experimental/makeUseCommand.d.ts +0 -8
  93. package/dist/experimental/makeUseCommand.d.ts.map +0 -1
  94. package/dist/experimental/makeUseCommand.js +0 -13
  95. package/dist/experimental/toast.d.ts +0 -47
  96. package/dist/experimental/toast.d.ts.map +0 -1
  97. package/dist/experimental/toast.js +0 -41
  98. package/dist/experimental/withToast.d.ts +0 -25
  99. package/dist/experimental/withToast.d.ts.map +0 -1
  100. package/dist/experimental/withToast.js +0 -45
  101. package/eslint.config.mjs +0 -24
  102. package/src/experimental/commander.ts +0 -1835
  103. 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/experimental/commander.js"
10
- import { I18n } from "../src/experimental/intl.js"
11
- import { makeUseCommand } from "../src/experimental/makeUseCommand.js"
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 fakeToast = (message: string, options?: Toast.ToastOpts) => {
30
- const id = options?.id ?? Math.random().toString(36).substring(2, 15)
31
- console.log(`Toast [${id}]: ${message}`, options)
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
- options = { ...options, id }
34
- const idx = toasts.findIndex((_) => _.id === id)
35
- if (idx > -1) {
36
- const toast = toasts[idx]
37
- clearTimeout(toast.timeoutId)
38
- Object.assign(toast, { message, options })
39
- toast.timeoutId = setTimeout(() => {
40
- toasts.splice(idx, 1)
41
- }, options?.timeout ?? 3000)
42
- } else {
43
- const toast: any = { id, message, options }
44
- toast.timeoutId = setTimeout(() => {
45
- toasts.splice(idx, 1)
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,162 @@ 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 { TaggedRequest: Req } = makeRpcClient(RequestContextMap)
96
- export class GetSomething2 extends Req<GetSomething2>()("GetSomething2", {
119
+ export const { TaggedRequestFor } = makeRpcClient(RequestContextMap)
120
+
121
+ export const SomethingReq = TaggedRequestFor("Something")
122
+ const SomethingQuery = SomethingReq.Query
123
+ const SomethingCommand = SomethingReq.Command
124
+
125
+ class SomethingGetSomething2 extends SomethingQuery<SomethingGetSomething2>()("GetSomething2", {
126
+ id: S.String
127
+ }, { success: S.FiniteFromString }) {}
128
+
129
+ class SomethingGetSomething3 extends SomethingQuery<SomethingGetSomething3>()("GetSomething3", {
130
+ id: S.NullOr(S.String).withDefault
131
+ }, { success: S.FiniteFromString }) {}
132
+
133
+ class SomethingGetSomething4
134
+ extends SomethingQuery<SomethingGetSomething4>()("GetSomething4", {}, { success: S.FiniteFromString })
135
+ {}
136
+
137
+ class SomethingGetSomething2WithDependencies
138
+ extends SomethingQuery<SomethingGetSomething2WithDependencies>()("GetSomething2", {
139
+ id: S.String
140
+ }, {
141
+ // this is intentilally fake, to simulate a codec that requires a dependency
142
+ success: S.FiniteFromString as S.Codec<number, string, "dep-a">,
143
+ error: S.String
144
+ })
145
+ {}
146
+
147
+ type SomethingInvalidationResources = {
148
+ GetSomething2: typeof SomethingGetSomething2
149
+ GetSomething2WithDependencies: typeof SomethingGetSomething2WithDependencies
150
+ GetSomething3: typeof SomethingGetSomething3
151
+ }
152
+
153
+ // command stubs covering the input-shape matrix
154
+ class SomethingDoNoProps extends SomethingCommand<SomethingDoNoProps>()("DoNoProps", {}) {}
155
+
156
+ class SomethingDoOptionalOnly extends SomethingCommand<SomethingDoOptionalOnly>()("DoOptionalOnly", {
157
+ name: S.optional(S.String)
158
+ }) {}
159
+
160
+ class SomethingDoRequiredOnly extends SomethingCommand<SomethingDoRequiredOnly>()("DoRequiredOnly", {
161
+ id: S.String
162
+ }) {}
163
+
164
+ class SomethingDoMixed extends SomethingCommand<SomethingDoMixed>()("DoMixed", {
165
+ id: S.String,
166
+ name: S.optional(S.String)
167
+ }) {}
168
+
169
+ class SomethingDoSomething extends SomethingCommand<
170
+ SomethingDoSomething,
171
+ { Something: SomethingInvalidationResources }
172
+ >()("DoSomething", {
97
173
  id: S.String
98
- }, { success: S.NumberFromString }) {}
174
+ }, {
175
+ success: S.FiniteFromString
176
+ }, (queryKey, { Something }, input, output) => {
177
+ return [
178
+ { filters: { queryKey } },
179
+ {
180
+ filters: {
181
+ queryKey: [
182
+ Something["GetSomething2"].id,
183
+ input.id,
184
+ Exit.isSuccess(output) ? output.value.toString() : "failed"
185
+ ]
186
+ }
187
+ }
188
+ ]
189
+ }) {}
99
190
 
100
- export class GetSomething2WithDependencies extends Req<GetSomething2WithDependencies>()("GetSomething2", {
191
+ // success schema has encoded shape { a: string | null } — used to test projection constraints
192
+ class SomethingGetStructNullable extends SomethingQuery<SomethingGetStructNullable>()("GetStructNullable", {}, {
193
+ success: S.Struct({ a: S.NullOr(S.String) })
194
+ }) {}
195
+
196
+ /** Stream event: intermediate progress update. */
197
+ export class OperationProgress extends S.TaggedClass<OperationProgress>()("OperationProgress", {
198
+ completed: S.NonNegativeInt,
199
+ total: S.NonNegativeInt
200
+ }) {}
201
+
202
+ /** Stream event: final completion result. */
203
+ export class ExportComplete extends S.TaggedClass<ExportComplete>()("ExportComplete", {
204
+ fileUrl: S.NonEmptyString
205
+ }) {}
206
+
207
+ /** Stream with no `final` schema — execute resolves with `void`. */
208
+ class SomethingStreamWithoutFinal extends SomethingCommand<SomethingStreamWithoutFinal>()("StreamWithoutFinal", {
101
209
  id: S.String
102
210
  }, {
103
- // this is intentilally fake, to simulate a codec that requires a dependency
104
- success: S.NumberFromString as S.Codec<number, string, "dep-a">,
105
- error: S.String
211
+ stream: true,
212
+ success: S.Union([OperationProgress, ExportComplete])
106
213
  }) {}
107
214
 
108
- export const Something = { GetSomething2, GetSomething2WithDependencies, meta: { moduleName: "Something" as const } }
215
+ /** Stream with a `final` schema execute resolves with `ExportComplete`. */
216
+ class SomethingStreamWithFinal extends SomethingCommand<SomethingStreamWithFinal>()("StreamWithFinal", {
217
+ id: S.String
218
+ }, {
219
+ stream: true,
220
+ success: S.Union([OperationProgress, ExportComplete]),
221
+ final: ExportComplete
222
+ }) {}
223
+
224
+ export const Something = {
225
+ GetSomething2: SomethingGetSomething2,
226
+ GetSomething2WithDependencies: SomethingGetSomething2WithDependencies,
227
+ GetSomething3: SomethingGetSomething3,
228
+ GetSomething4: SomethingGetSomething4,
229
+ DoNoProps: SomethingDoNoProps,
230
+ DoOptionalOnly: SomethingDoOptionalOnly,
231
+ DoRequiredOnly: SomethingDoRequiredOnly,
232
+ DoMixed: SomethingDoMixed,
233
+ DoSomething: SomethingDoSomething,
234
+ GetStructNullable: SomethingGetStructNullable,
235
+ StreamWithoutFinal: SomethingStreamWithoutFinal,
236
+ StreamWithFinal: SomethingStreamWithFinal
237
+ }
238
+
239
+ export const SomethingElseReq = TaggedRequestFor("SomethingElse")
240
+ const SomethingElseQuery = SomethingElseReq.Query
241
+
242
+ class SomethingElseGetSomething2 extends SomethingElseQuery<SomethingElseGetSomething2>()("GetSomething2", {
243
+ id: S.String
244
+ }, { success: S.FiniteFromString }) {}
245
+
246
+ class SomethingElseGetSomething2WithDependencies
247
+ extends SomethingElseQuery<SomethingElseGetSomething2WithDependencies>()("GetSomething2", {
248
+ id: S.String
249
+ }, {
250
+ success: S.FiniteFromString as S.Codec<number, string, "dep-a">,
251
+ error: S.String
252
+ })
253
+ {}
254
+
255
+ export const SomethingElse = {
256
+ GetSomething2: SomethingElseGetSomething2,
257
+ GetSomething2WithDependencies: SomethingElseGetSomething2WithDependencies
258
+ }
109
259
 
110
260
  export const useClient = (
111
261
  options?: { messages?: Record<string, string> | Record<string, MessageFormatElement[]>; toasts: any[] }
@@ -117,9 +267,31 @@ export const useClient = (
117
267
  const api = ApiClientFactory.layer({ url: "bogus", headers: Option.none() }).pipe(
118
268
  Layer.provide(FetchHttpClient.layer)
119
269
  )
120
- const lm = LegacyMutation.Default.pipe(Layer.provide([FakeIntlLayer, FakeToastLayer]))
121
- const layers = Layer.mergeAll(CommanderLayer, WithToastLayer, FakeToastLayer, FakeIntlLayer, api, lm)
270
+ const layers = Layer.mergeAll(CommanderLayer, WithToastLayer, FakeToastLayer, FakeIntlLayer, api)
122
271
 
123
272
  const clientFor_ = ApiClientFactory.makeFor(Layer.empty)
124
- return makeClient(() => ManagedRuntime.make(layers), clientFor_, Layer.empty)
273
+ const rawClient = makeClient(() => ManagedRuntime.make(layers), clientFor_, Layer.empty)
274
+
275
+ // Provide a Vue injection context so that composition-API hooks (e.g. useQueryClient)
276
+ // called during client initialisation work outside a component setup() function.
277
+ const vueApp = createApp({})
278
+ const testQueryClientConfig = { defaultOptions: { queries: { retry: false }, mutations: { retry: false } } }
279
+ vueApp.use(VueQueryPlugin, { queryClient: new QueryClient(testQueryClientConfig) })
280
+
281
+ const origClientFor = rawClient.clientFor
282
+ const clientFor: typeof origClientFor = function(m, ...args) {
283
+ const proxy = origClientFor(m, ...args)
284
+ // Warm up lazy mutation-hook initialisation inside the Vue injection context.
285
+ // After the first property access, useMutation() is cached and subsequent
286
+ // accesses outside the context succeed.
287
+ const firstPropertyName = Object.keys(m)[0]
288
+ if (firstPropertyName !== undefined) {
289
+ vueApp.runWithContext(() => {
290
+ void (proxy as Record<string, unknown>)[firstPropertyName]
291
+ })
292
+ }
293
+ return proxy
294
+ }
295
+
296
+ return { ...rawClient, clientFor }
125
297
  }
@@ -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
@@ -32,7 +32,6 @@
32
32
  "outDir": "build/dist",
33
33
  "resolveJsonModule": true,
34
34
  "moduleResolution": "Node16",
35
- "downlevelIteration": true,
36
35
  "noErrorTruncation": true,
37
36
  "forceConsistentCasingInFileNames": true,
38
37
  "types": [
package/tsconfig.json.bak CHANGED
@@ -7,6 +7,9 @@
7
7
  },
8
8
  {
9
9
  "path": "./tsconfig.test.json"
10
+ },
11
+ {
12
+ "path": "./tsconfig.examples.json"
10
13
  }
11
- ],
12
- }
14
+ ]
15
+ }
package/tsconfig.src.json CHANGED
@@ -1,36 +1,36 @@
1
1
  {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "lib": [
5
- "esnext",
6
- "DOM"
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
- "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
- }
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
+ }
@@ -28,6 +28,6 @@
28
28
  "references": [
29
29
  {
30
30
  "path": "./tsconfig.src.json"
31
- },
31
+ }
32
32
  ]
33
- }
33
+ }
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: 'jsdom',
11
- include: ['src/**/*.test.{ts,tsx}', '**/test/**/*.test.{ts,tsx}', '**/__tests__/**/*.test.{ts,tsx}'],
12
- exclude: ['node_modules/**', 'dist/**'],
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: ['**/__tests__/**', '**/test/**', '**/*.test.*']
16
+ exclude: ["**/__tests__/**", "**/test/**", "**/*.test.*"]
17
17
  }
18
18
  })