@effect-app/vue 4.0.0-beta.19 → 4.0.0-beta.190

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 +1383 -0
  2. package/dist/commander.d.ts +620 -0
  3. package/dist/commander.d.ts.map +1 -0
  4. package/dist/commander.js +1056 -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 +13 -4
  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 -8
  19. package/dist/lib.d.ts.map +1 -1
  20. package/dist/lib.js +34 -7
  21. package/dist/makeClient.d.ts +191 -292
  22. package/dist/makeClient.d.ts.map +1 -1
  23. package/dist/makeClient.js +217 -369
  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 +56 -25
  32. package/dist/mutate.d.ts.map +1 -1
  33. package/dist/mutate.js +132 -33
  34. package/dist/query.d.ts +24 -16
  35. package/dist/query.d.ts.map +1 -1
  36. package/dist/query.js +119 -37
  37. package/dist/routeParams.d.ts +1 -1
  38. package/dist/runtime.d.ts +5 -2
  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/eslint.config.mjs +2 -2
  48. package/examples/streamMutation.ts +70 -0
  49. package/package.json +48 -48
  50. package/src/commander.ts +3378 -0
  51. package/src/{experimental/confirm.ts → confirm.ts} +10 -14
  52. package/src/errorReporter.ts +62 -74
  53. package/src/form.ts +55 -16
  54. package/src/intl.ts +12 -0
  55. package/src/lib.ts +46 -13
  56. package/src/makeClient.ts +623 -1043
  57. package/src/{experimental/makeUseCommand.ts → makeUseCommand.ts} +6 -4
  58. package/src/mutate.ts +273 -72
  59. package/src/query.ts +181 -68
  60. package/src/runtime.ts +39 -18
  61. package/src/{experimental/toast.ts → toast.ts} +11 -25
  62. package/src/{experimental/withToast.ts → withToast.ts} +28 -10
  63. package/test/Mutation.test.ts +105 -11
  64. package/test/dist/form.test.d.ts.map +1 -1
  65. package/test/dist/lib.test.d.ts.map +1 -0
  66. package/test/dist/streamFinal.test.d.ts.map +1 -0
  67. package/test/dist/streamFn.test.d.ts.map +1 -0
  68. package/test/dist/stubs.d.ts +3289 -114
  69. package/test/dist/stubs.d.ts.map +1 -1
  70. package/test/dist/stubs.js +152 -25
  71. package/test/form-validation-errors.test.ts +23 -19
  72. package/test/form.test.ts +20 -2
  73. package/test/lib.test.ts +240 -0
  74. package/test/makeClient.test.ts +286 -38
  75. package/test/streamFinal.test.ts +63 -0
  76. package/test/streamFn.test.ts +436 -0
  77. package/test/stubs.ts +192 -42
  78. package/tsconfig.examples.json +20 -0
  79. package/tsconfig.json +0 -1
  80. package/tsconfig.json.bak +5 -2
  81. package/tsconfig.src.json +34 -34
  82. package/tsconfig.test.json +2 -2
  83. package/vitest.config.ts +5 -5
  84. package/dist/experimental/commander.d.ts +0 -359
  85. package/dist/experimental/commander.d.ts.map +0 -1
  86. package/dist/experimental/commander.js +0 -557
  87. package/dist/experimental/confirm.d.ts +0 -19
  88. package/dist/experimental/confirm.d.ts.map +0 -1
  89. package/dist/experimental/confirm.js +0 -28
  90. package/dist/experimental/intl.d.ts +0 -16
  91. package/dist/experimental/intl.d.ts.map +0 -1
  92. package/dist/experimental/intl.js +0 -5
  93. package/dist/experimental/makeUseCommand.d.ts +0 -8
  94. package/dist/experimental/makeUseCommand.d.ts.map +0 -1
  95. package/dist/experimental/makeUseCommand.js +0 -13
  96. package/dist/experimental/toast.d.ts +0 -47
  97. package/dist/experimental/toast.d.ts.map +0 -1
  98. package/dist/experimental/toast.js +0 -41
  99. package/dist/experimental/withToast.d.ts +0 -25
  100. package/dist/experimental/withToast.d.ts.map +0 -1
  101. package/dist/experimental/withToast.js +0 -45
  102. package/src/experimental/commander.ts +0 -1835
  103. package/src/experimental/intl.ts +0 -9
package/eslint.config.mjs CHANGED
@@ -1,6 +1,6 @@
1
+ import { augmentedConfig } from "@effect-app/eslint-shared-config/eslint.base.config"
1
2
  import path from "node:path"
2
3
  import { fileURLToPath } from "node:url"
3
- import { augmentedConfig } from "@effect-app/eslint-shared-config/eslint.base.config"
4
4
 
5
5
  const __filename = fileURLToPath(import.meta.url)
6
6
  const __dirname = path.dirname(__filename)
@@ -18,7 +18,7 @@ export default [
18
18
  {
19
19
  rules: {
20
20
  "@typescript-eslint/no-empty-interface": "off",
21
- "@typescript-eslint/no-explicit-any": "warn",
21
+ "@typescript-eslint/no-explicit-any": "warn"
22
22
  }
23
23
  }
24
24
  ]
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Example: stream-based mutation for a long-running operation.
3
+ *
4
+ * The server streams a tagged union of progress updates and a final result.
5
+ * The Vue ref is updated for every emitted value; `AsyncResult` stays in the
6
+ * `waiting` state until the stream ends.
7
+ *
8
+ * When using `makeClient` / `clientFor`, stream-type requests are exposed as
9
+ * `mutate` on the client object. Use `client.exportData.mutate` with `streamFn`
10
+ * combinators, or use `client.exportData.streamFn` to define a full command.
11
+ *
12
+ * The example below shows the low-level `asStreamResult` API.
13
+ */
14
+ import { Effect, S, Stream } from "effect-app"
15
+ import { asStreamResult } from "../src/mutate.js"
16
+
17
+ // ---------------------------------------------------------------------------
18
+ // Domain model
19
+ // ---------------------------------------------------------------------------
20
+
21
+ /** Intermediate progress report, e.g. "5 of 400 items processed". */
22
+ export class OperationProgress extends S.TaggedClass<OperationProgress>()("OperationProgress", {
23
+ completed: S.NonNegativeInt,
24
+ total: S.NonNegativeInt
25
+ }) {}
26
+
27
+ /** The final result produced once the operation is complete. */
28
+ export class ExportComplete extends S.TaggedClass<ExportComplete>()("ExportComplete", {
29
+ fileUrl: S.NonEmptyString
30
+ }) {}
31
+
32
+ /** Tagged union emitted by the stream. */
33
+ export type ExportEvent = OperationProgress | ExportComplete
34
+
35
+ // ---------------------------------------------------------------------------
36
+ // Simulated stream (replace with a real RPC / SSE stream in production)
37
+ // ---------------------------------------------------------------------------
38
+
39
+ /**
40
+ * Produces `total` progress updates followed by a single `ExportComplete`.
41
+ * Each step is separated by a 50 ms delay to simulate real async work.
42
+ */
43
+ const makeExportStream = (total: S.NonNegativeInt): Stream.Stream<ExportEvent> =>
44
+ Stream.concat(
45
+ Stream.range(1, total).pipe(
46
+ Stream.map((completed) => new OperationProgress({ completed: S.NonNegativeInt(completed), total })),
47
+ Stream.tap(() => Effect.sleep("50 millis"))
48
+ ),
49
+ Stream.make(new ExportComplete({ fileUrl: S.NonEmptyString("https://example.com/export.csv") }))
50
+ )
51
+
52
+ // ---------------------------------------------------------------------------
53
+ // Option A: low-level `asStreamResult` (call inside a `setup()` function)
54
+ // ---------------------------------------------------------------------------
55
+
56
+ export const useExportMutation = () => {
57
+ /**
58
+ * `result` - reactive ref, always reflects the latest stream event.
59
+ * `AsyncResult` tag:
60
+ * - Initial (waiting=true) - operation in progress
61
+ * - Success (waiting=true) - progress update received, still running
62
+ * - Success (waiting=false) - final result, operation complete
63
+ * - Failure - operation failed
64
+ *
65
+ * `execute` - call with the desired `total` to kick off the stream.
66
+ */
67
+ const [result, execute] = asStreamResult((total: S.NonNegativeInt) => makeExportStream(total))
68
+
69
+ return { result, execute }
70
+ }
package/package.json CHANGED
@@ -1,36 +1,36 @@
1
1
  {
2
2
  "name": "@effect-app/vue",
3
- "version": "4.0.0-beta.19",
3
+ "version": "4.0.0-beta.190",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/effect-ts-app/libs/tree/main/packages/vue",
7
7
  "dependencies": {
8
- "@formatjs/intl": "^4.1.2",
9
- "@tanstack/query-core": "5.83.1",
10
- "@tanstack/vue-query": "5.83.1",
8
+ "@formatjs/intl": "^4.1.7",
9
+ "@tanstack/query-core": "5.96.2",
10
+ "@tanstack/vue-query": "5.96.2",
11
11
  "@vueuse/core": "^14.2.1",
12
12
  "change-case": "^5.4.4",
13
13
  "query-string": "^9.3.1",
14
- "effect-app": "4.0.0-beta.19"
14
+ "effect-app": "4.0.0-beta.190"
15
15
  },
16
16
  "peerDependencies": {
17
- "@effect/atom-vue": "^4.0.0-beta.31",
18
- "@effect/platform-browser": "^4.0.0-beta.31",
19
- "@sentry/browser": "^10.42.0",
20
- "effect": "^4.0.0-beta.31",
21
- "vue": "^3.5.29"
17
+ "@effect/atom-vue": "^4.0.0-beta.59",
18
+ "@effect/platform-browser": "^4.0.0-beta.59",
19
+ "@sentry/browser": "^10.50.0",
20
+ "effect": "^4.0.0-beta.60",
21
+ "vue": "^3.5.33"
22
22
  },
23
23
  "devDependencies": {
24
- "@effect/vitest": "^4.0.0-beta.31",
25
- "@formatjs/icu-messageformat-parser": "^3.5.1",
26
- "@types/node": "25.3.3",
27
- "@vitejs/plugin-vue": "^6.0.4",
28
- "intl-messageformat": "^11.1.2",
24
+ "@effect/vitest": "^4.0.0-beta.59",
25
+ "@formatjs/icu-messageformat-parser": "^3.5.5",
26
+ "@types/node": "25.6.0",
27
+ "@vitejs/plugin-vue": "^6.0.6",
28
+ "intl-messageformat": "^11.2.2",
29
29
  "json5": "^2.2.3",
30
- "typescript": "~5.9.3",
31
- "vite": "^7.3.1",
32
- "vitest": "^4.0.18",
33
- "@effect-app/eslint-shared-config": "0.5.7-beta.2"
30
+ "typescript": "~6.0.3",
31
+ "vite": "^8.0.10",
32
+ "vitest": "^4.1.5",
33
+ "@effect-app/eslint-shared-config": "0.6.0-beta.18"
34
34
  },
35
35
  "typesVersions": {
36
36
  "*": {
@@ -44,38 +44,26 @@
44
44
  "types": "./dist/index.d.ts",
45
45
  "default": "./dist/index.js"
46
46
  },
47
+ "./commander": {
48
+ "types": "./dist/commander.d.ts",
49
+ "default": "./dist/commander.js"
50
+ },
51
+ "./confirm": {
52
+ "types": "./dist/confirm.d.ts",
53
+ "default": "./dist/confirm.js"
54
+ },
47
55
  "./errorReporter": {
48
56
  "types": "./dist/errorReporter.d.ts",
49
57
  "default": "./dist/errorReporter.js"
50
58
  },
51
- "./experimental/commander": {
52
- "types": "./dist/experimental/commander.d.ts",
53
- "default": "./dist/experimental/commander.js"
54
- },
55
- "./experimental/confirm": {
56
- "types": "./dist/experimental/confirm.d.ts",
57
- "default": "./dist/experimental/confirm.js"
58
- },
59
- "./experimental/intl": {
60
- "types": "./dist/experimental/intl.d.ts",
61
- "default": "./dist/experimental/intl.js"
62
- },
63
- "./experimental/makeUseCommand": {
64
- "types": "./dist/experimental/makeUseCommand.d.ts",
65
- "default": "./dist/experimental/makeUseCommand.js"
66
- },
67
- "./experimental/toast": {
68
- "types": "./dist/experimental/toast.d.ts",
69
- "default": "./dist/experimental/toast.js"
70
- },
71
- "./experimental/withToast": {
72
- "types": "./dist/experimental/withToast.d.ts",
73
- "default": "./dist/experimental/withToast.js"
74
- },
75
59
  "./form": {
76
60
  "types": "./dist/form.d.ts",
77
61
  "default": "./dist/form.js"
78
62
  },
63
+ "./intl": {
64
+ "types": "./dist/intl.d.ts",
65
+ "default": "./dist/intl.js"
66
+ },
79
67
  "./lib": {
80
68
  "types": "./dist/lib.d.ts",
81
69
  "default": "./dist/lib.js"
@@ -92,6 +80,10 @@
92
80
  "types": "./dist/makeIntl.d.ts",
93
81
  "default": "./dist/makeIntl.js"
94
82
  },
83
+ "./makeUseCommand": {
84
+ "types": "./dist/makeUseCommand.d.ts",
85
+ "default": "./dist/makeUseCommand.js"
86
+ },
95
87
  "./mutate": {
96
88
  "types": "./dist/mutate.d.ts",
97
89
  "default": "./dist/mutate.js"
@@ -107,6 +99,14 @@
107
99
  "./runtime": {
108
100
  "types": "./dist/runtime.d.ts",
109
101
  "default": "./dist/runtime.js"
102
+ },
103
+ "./toast": {
104
+ "types": "./dist/toast.d.ts",
105
+ "default": "./dist/toast.js"
106
+ },
107
+ "./withToast": {
108
+ "types": "./dist/withToast.d.ts",
109
+ "default": "./dist/withToast.js"
110
110
  }
111
111
  },
112
112
  "gitHead": "bd8e27eea3eff97db8739d577d67e7336c078d28",
@@ -121,18 +121,18 @@
121
121
  "scripts": {
122
122
  "watch": "pnpm build:tsc -w",
123
123
  "build:tsc": "pnpm clean-dist && effect-app-cli packagejson pnpm check",
124
- "check": "tsc --build",
124
+ "check": "tsgo --build",
125
125
  "build": "pnpm build:tsc",
126
- "watch2": "pnpm clean-dist && NODE_OPTIONS=--max-old-space-size=6144 tsc -w",
126
+ "watch2": "pnpm clean-dist && NODE_OPTIONS=--max-old-space-size=6144 tsgo -w",
127
127
  "clean": "rm -rf dist",
128
128
  "clean-dist": "sh ../../scripts/clean-dist.sh",
129
129
  "circular": "pnpm circular:src && pnpm circular:dist",
130
130
  "circular:src": "madge --circular --ts-config ./tsconfig.json --extensions ts ./src",
131
131
  "circular:dist": "madge --circular --extensions js ./dist",
132
- "compile": "NODE_OPTIONS=--max-old-space-size=6144 tsc --noEmit",
133
- "lint": "NODE_OPTIONS=--max-old-space-size=6144 ESLINT_TS=1 eslint ./src",
132
+ "compile": "NODE_OPTIONS=--max-old-space-size=6144 tsgo --noEmit",
133
+ "lint": "oxlint ./src && NODE_OPTIONS=--max-old-space-size=6144 ESLINT_TS=1 eslint ./src && pnpm exec dprint check --config ../../dprint.jsonc .",
134
134
  "lint:watch": "ESLINT_TS=1 esw -w --changed --clear --ext ts,tsx .",
135
- "lint-fix": "pnpm lint --fix",
135
+ "lint-fix": "oxlint --fix ./src && NODE_OPTIONS=--max-old-space-size=6144 ESLINT_TS=1 eslint --fix ./src && pnpm exec dprint fmt --config ../../dprint.jsonc .",
136
136
  "test": "vitest",
137
137
  "test:run": "pnpm run test run --passWithNoTests",
138
138
  "testsuite": "pnpm lint && pnpm circular && pnpm run test:run",