@veloxts/web 0.6.26 → 0.6.27

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 (3) hide show
  1. package/CHANGELOG.md +312 -0
  2. package/GUIDE.md +170 -0
  3. package/package.json +13 -10
package/CHANGELOG.md ADDED
@@ -0,0 +1,312 @@
1
+ # @veloxts/web
2
+
3
+ ## 0.6.27
4
+
5
+ ### Patch Changes
6
+
7
+ - chore: add GUIDE, LICENSE and CHANGELOG.md to npm files
8
+ - Updated dependencies
9
+ - @veloxts/auth@0.6.27
10
+ - @veloxts/client@0.6.27
11
+ - @veloxts/core@0.6.27
12
+ - @veloxts/router@0.6.27
13
+
14
+ ## 0.6.26
15
+
16
+ ### Patch Changes
17
+
18
+ - docs(mcp): add README and GUIDE, docs(web): simplify README and create concise GUIDE
19
+ - Updated dependencies
20
+ - @veloxts/auth@0.6.26
21
+ - @veloxts/client@0.6.26
22
+ - @veloxts/core@0.6.26
23
+ - @veloxts/router@0.6.26
24
+
25
+ ## 0.6.25
26
+
27
+ ### Patch Changes
28
+
29
+ - docs(create): add guide for React Server Components setup
30
+ - Updated dependencies
31
+ - @veloxts/auth@0.6.25
32
+ - @veloxts/client@0.6.25
33
+ - @veloxts/core@0.6.25
34
+ - @veloxts/router@0.6.25
35
+
36
+ ## 0.6.24
37
+
38
+ ### Patch Changes
39
+
40
+ - clarify installation paths and package contents
41
+ - Updated dependencies
42
+ - @veloxts/auth@0.6.24
43
+ - @veloxts/client@0.6.24
44
+ - @veloxts/core@0.6.24
45
+ - @veloxts/router@0.6.24
46
+
47
+ ## 0.6.23
48
+
49
+ ### Patch Changes
50
+
51
+ - add defineContract for improved type inference DX
52
+ - Updated dependencies
53
+ - @veloxts/auth@0.6.23
54
+ - @veloxts/client@0.6.23
55
+ - @veloxts/core@0.6.23
56
+ - @veloxts/router@0.6.23
57
+
58
+ ## 0.6.22
59
+
60
+ ### Patch Changes
61
+
62
+ - support {method, path} route entry format
63
+ - Updated dependencies
64
+ - @veloxts/auth@0.6.22
65
+ - @veloxts/client@0.6.22
66
+ - @veloxts/core@0.6.22
67
+ - @veloxts/router@0.6.22
68
+
69
+ ## 0.6.21
70
+
71
+ ### Patch Changes
72
+
73
+ - separate schemas from procedures for browser-safe import
74
+ - Updated dependencies
75
+ - @veloxts/auth@0.6.21
76
+ - @veloxts/client@0.6.21
77
+ - @veloxts/core@0.6.21
78
+ - @veloxts/router@0.6.21
79
+
80
+ ## 0.6.20
81
+
82
+ ### Patch Changes
83
+
84
+ - add Fastify ecosystem stubs and debuglog to util
85
+ - Updated dependencies
86
+ - @veloxts/auth@0.6.20
87
+ - @veloxts/client@0.6.20
88
+ - @veloxts/core@0.6.20
89
+ - @veloxts/router@0.6.20
90
+
91
+ ## 0.6.19
92
+
93
+ ### Patch Changes
94
+
95
+ - restore dotenv stub for browser compatibility
96
+ - Updated dependencies
97
+ - @veloxts/auth@0.6.19
98
+ - @veloxts/client@0.6.19
99
+ - @veloxts/core@0.6.19
100
+ - @veloxts/router@0.6.19
101
+
102
+ ## 0.6.18
103
+
104
+ ### Patch Changes
105
+
106
+ - add node:fs/promises stub and fix esbuild plugin
107
+ - Updated dependencies
108
+ - @veloxts/auth@0.6.18
109
+ - @veloxts/client@0.6.18
110
+ - @veloxts/core@0.6.18
111
+ - @veloxts/router@0.6.18
112
+
113
+ ## 0.6.17
114
+
115
+ ### Patch Changes
116
+
117
+ - remove optimizeDeps.exclude to fix CJS/ESM interop
118
+ - Updated dependencies
119
+ - @veloxts/auth@0.6.17
120
+ - @veloxts/client@0.6.17
121
+ - @veloxts/core@0.6.17
122
+ - @veloxts/router@0.6.17
123
+
124
+ ## 0.6.16
125
+
126
+ ### Patch Changes
127
+
128
+ - add stubs for Fastify ecosystem packages
129
+ - Updated dependencies
130
+ - @veloxts/auth@0.6.16
131
+ - @veloxts/client@0.6.16
132
+ - @veloxts/core@0.6.16
133
+ - @veloxts/router@0.6.16
134
+
135
+ ## 0.6.15
136
+
137
+ ### Patch Changes
138
+
139
+ - implement three-layer Node.js stubbing for Vite
140
+ - Updated dependencies
141
+ - @veloxts/auth@0.6.15
142
+ - @veloxts/client@0.6.15
143
+ - @veloxts/core@0.6.15
144
+ - @veloxts/router@0.6.15
145
+
146
+ ## 0.6.14
147
+
148
+ ### Patch Changes
149
+
150
+ - stub dotenv as virtual module instead of process shims
151
+ - Updated dependencies
152
+ - @veloxts/auth@0.6.14
153
+ - @veloxts/client@0.6.14
154
+ - @veloxts/core@0.6.14
155
+ - @veloxts/router@0.6.14
156
+
157
+ ## 0.6.13
158
+
159
+ ### Patch Changes
160
+
161
+ - add process.argv stub for dotenv browser compatibility
162
+ - Updated dependencies
163
+ - @veloxts/auth@0.6.13
164
+ - @veloxts/client@0.6.13
165
+ - @veloxts/core@0.6.13
166
+ - @veloxts/router@0.6.13
167
+
168
+ ## 0.6.12
169
+
170
+ ### Patch Changes
171
+
172
+ - Fixes the "process is not defined" error from dotenv
173
+ - Updated dependencies
174
+ - @veloxts/auth@0.6.12
175
+ - @veloxts/client@0.6.12
176
+ - @veloxts/core@0.6.12
177
+ - @veloxts/router@0.6.12
178
+
179
+ ## 0.6.11
180
+
181
+ ### Patch Changes
182
+
183
+ - add Vite plugin for Node.js module stubs
184
+ - Updated dependencies
185
+ - @veloxts/auth@0.6.11
186
+ - @veloxts/client@0.6.11
187
+ - @veloxts/core@0.6.11
188
+ - @veloxts/router@0.6.11
189
+
190
+ ## 0.6.10
191
+
192
+ ### Patch Changes
193
+
194
+ - use import() type syntax for AppRouter
195
+ - Updated dependencies
196
+ - @veloxts/auth@0.6.10
197
+ - @veloxts/client@0.6.10
198
+ - @veloxts/core@0.6.10
199
+ - @veloxts/router@0.6.10
200
+
201
+ ## 0.6.9
202
+
203
+ ### Patch Changes
204
+
205
+ - isolate auth procedures from database imports
206
+ - Updated dependencies
207
+ - @veloxts/auth@0.6.9
208
+ - @veloxts/client@0.6.9
209
+ - @veloxts/core@0.6.9
210
+ - @veloxts/router@0.6.9
211
+
212
+ ## 0.6.8
213
+
214
+ ### Patch Changes
215
+
216
+ - prevent dotenv from leaking into browser bundle
217
+ - Updated dependencies
218
+ - @veloxts/auth@0.6.8
219
+ - @veloxts/client@0.6.8
220
+ - @veloxts/core@0.6.8
221
+ - @veloxts/router@0.6.8
222
+
223
+ ## 0.6.7
224
+
225
+ ### Patch Changes
226
+
227
+ - better-sqlite3 versions mismatch fix
228
+ - Updated dependencies
229
+ - @veloxts/auth@0.6.7
230
+ - @veloxts/client@0.6.7
231
+ - @veloxts/core@0.6.7
232
+ - @veloxts/router@0.6.7
233
+
234
+ ## 0.6.6
235
+
236
+ ### Patch Changes
237
+
238
+ - ensure the web app never imports server-side code paths
239
+ - Updated dependencies
240
+ - @veloxts/auth@0.6.6
241
+ - @veloxts/client@0.6.6
242
+ - @veloxts/core@0.6.6
243
+ - @veloxts/router@0.6.6
244
+
245
+ ## 0.6.5
246
+
247
+ ### Patch Changes
248
+
249
+ - move @prisma/client-runtime-utils to root package.json
250
+ - Updated dependencies
251
+ - @veloxts/auth@0.6.5
252
+ - @veloxts/client@0.6.5
253
+ - @veloxts/core@0.6.5
254
+ - @veloxts/router@0.6.5
255
+
256
+ ## 0.6.4
257
+
258
+ ### Patch Changes
259
+
260
+ - add @prisma/client-runtime-utils dependency
261
+ - Updated dependencies
262
+ - @veloxts/auth@0.6.4
263
+ - @veloxts/client@0.6.4
264
+ - @veloxts/core@0.6.4
265
+ - @veloxts/router@0.6.4
266
+
267
+ ## 0.6.3
268
+
269
+ ### Patch Changes
270
+
271
+ - Add workspaces field to root package.json template + Fix Prisma ESM/CJS import for Node.js v24
272
+ - Updated dependencies
273
+ - @veloxts/auth@0.6.3
274
+ - @veloxts/client@0.6.3
275
+ - @veloxts/core@0.6.3
276
+ - @veloxts/router@0.6.3
277
+
278
+ ## 0.6.2
279
+
280
+ ### Patch Changes
281
+
282
+ - add server actions, removed some deprecated and other chore
283
+ - Updated dependencies
284
+ - @veloxts/auth@0.6.2
285
+ - @veloxts/client@0.6.2
286
+ - @veloxts/core@0.6.2
287
+ - @veloxts/router@0.6.2
288
+
289
+ ## 0.6.1
290
+
291
+ ### Patch Changes
292
+
293
+ - route groups for file-based routing; add dynamic route support with [param] segments
294
+ - Updated dependencies
295
+ - @veloxts/auth@0.6.1
296
+ - @veloxts/client@0.6.1
297
+ - @veloxts/core@0.6.1
298
+ - @veloxts/router@0.6.1
299
+
300
+ ## 0.6.0
301
+
302
+ ### Minor Changes
303
+
304
+ - RSC streaming, dynamic routes, Vinxi integration
305
+
306
+ ### Patch Changes
307
+
308
+ - Updated dependencies
309
+ - @veloxts/auth@0.6.0
310
+ - @veloxts/client@0.6.0
311
+ - @veloxts/core@0.6.0
312
+ - @veloxts/router@0.6.0
package/GUIDE.md ADDED
@@ -0,0 +1,170 @@
1
+ # @veloxts/web Guide
2
+
3
+ React Server Components integration for VeloxTS Framework using Vinxi.
4
+
5
+ ## Quick Start
6
+
7
+ Scaffold a new RSC project:
8
+
9
+ ```bash
10
+ npx create-velox-app my-app --rsc
11
+ cd my-app
12
+ pnpm install
13
+ pnpm dev
14
+ ```
15
+
16
+ ## Key Features
17
+
18
+ - **React Server Components** - Full RSC support with streaming
19
+ - **File-Based Routing** - Laravel-inspired routing from `app/pages/`
20
+ - **Server Actions** - Type-safe mutations with Zod validation
21
+ - **tRPC Bridge** - Connect server actions to existing procedures
22
+ - **Route Groups** - Organize routes with `(group)` folders
23
+
24
+ ## Server Actions
25
+
26
+ Create type-safe server actions with Zod validation:
27
+
28
+ ```typescript
29
+ // src/actions/users.ts
30
+ import { action } from '@veloxts/web';
31
+ import { z } from 'zod';
32
+
33
+ export const createUser = action()
34
+ .input(z.object({
35
+ name: z.string().min(1),
36
+ email: z.string().email(),
37
+ }))
38
+ .output(z.object({
39
+ id: z.string(),
40
+ name: z.string(),
41
+ email: z.string(),
42
+ }))
43
+ .handler(async (input) => {
44
+ return await db.user.create({ data: input });
45
+ });
46
+
47
+ // Protected action (requires authentication)
48
+ export const updateProfile = action()
49
+ .input(z.object({ name: z.string() }))
50
+ .protected()
51
+ .handler(async (input, ctx) => {
52
+ // ctx.user is guaranteed to exist
53
+ return await db.user.update({
54
+ where: { id: ctx.user.id },
55
+ data: input,
56
+ });
57
+ });
58
+ ```
59
+
60
+ Use in React components:
61
+
62
+ ```tsx
63
+ 'use client';
64
+
65
+ import { createUser } from '@/actions/users';
66
+
67
+ export default function NewUserPage() {
68
+ async function handleSubmit(formData: FormData) {
69
+ const result = await createUser({
70
+ name: formData.get('name') as string,
71
+ email: formData.get('email') as string,
72
+ });
73
+
74
+ if (result.success) {
75
+ console.log('Created:', result.data);
76
+ } else {
77
+ console.error('Error:', result.error.message);
78
+ }
79
+ }
80
+
81
+ return (
82
+ <form action={handleSubmit}>
83
+ <input name="name" required />
84
+ <input name="email" type="email" required />
85
+ <button type="submit">Create</button>
86
+ </form>
87
+ );
88
+ }
89
+ ```
90
+
91
+ ## File-Based Routing
92
+
93
+ Routes are derived from file structure in `app/pages/`:
94
+
95
+ | File Path | Route Pattern | Description |
96
+ |-----------|--------------|-------------|
97
+ | `index.tsx` | `/` | Home page |
98
+ | `about.tsx` | `/about` | Static page |
99
+ | `users/[id].tsx` | `/users/:id` | Dynamic segment |
100
+ | `docs/[...slug].tsx` | `/docs/*` | Catch-all route |
101
+ | `(auth)/login.tsx` | `/login` | Route group (no prefix) |
102
+
103
+ ### Dynamic Routes
104
+
105
+ ```tsx
106
+ // app/pages/users/[id].tsx
107
+ interface PageProps {
108
+ params: { id: string };
109
+ searchParams: Record<string, string | string[]>;
110
+ }
111
+
112
+ export default async function UserPage({ params }: PageProps) {
113
+ const user = await db.user.findUnique({ where: { id: params.id } });
114
+ return <h1>{user.name}</h1>;
115
+ }
116
+ ```
117
+
118
+ ### Layouts
119
+
120
+ Create `_layout.tsx` for shared layouts:
121
+
122
+ ```tsx
123
+ // app/pages/_layout.tsx (root layout)
124
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
125
+ return (
126
+ <html lang="en">
127
+ <body>
128
+ <nav>{/* Navigation */}</nav>
129
+ <main>{children}</main>
130
+ </body>
131
+ </html>
132
+ );
133
+ }
134
+ ```
135
+
136
+ ## tRPC Bridge
137
+
138
+ Connect server actions to existing tRPC procedures:
139
+
140
+ ```typescript
141
+ // src/actions/bridge.ts
142
+ import { createTrpcBridge } from '@veloxts/web';
143
+ import type { AppRouter } from '@/trpc/router';
144
+
145
+ export const bridge = createTrpcBridge<AppRouter>({
146
+ trpcBase: '/trpc',
147
+ });
148
+
149
+ // Create type-safe actions from procedures
150
+ export const getUser = bridge.createAction('users.get');
151
+ export const updateUser = bridge.createProtectedAction('users.update');
152
+ ```
153
+
154
+ ## Requirements
155
+
156
+ - Node.js 20+
157
+ - React 19+
158
+ - TypeScript 5.5+
159
+
160
+ ## Documentation
161
+
162
+ Complete documentation at [@veloxts/velox](https://www.npmjs.com/package/@veloxts/velox).
163
+
164
+ ## Status
165
+
166
+ **v0.6.x** - Early preview. APIs stabilizing with 615+ tests and 94.4% coverage.
167
+
168
+ ## License
169
+
170
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veloxts/web",
3
- "version": "0.6.26",
3
+ "version": "0.6.27",
4
4
  "description": "React Server Components integration for VeloxTS framework using Vinxi",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -30,7 +30,10 @@
30
30
  "files": [
31
31
  "dist",
32
32
  "templates",
33
- "README.md"
33
+ "README.md",
34
+ "GUIDE.md",
35
+ "LICENSE",
36
+ "CHANGELOG.md"
34
37
  ],
35
38
  "dependencies": {
36
39
  "@vinxi/server-functions": "0.5.1",
@@ -41,10 +44,10 @@
41
44
  "peerDependencies": {
42
45
  "react": ">=19.2.0",
43
46
  "react-dom": ">=19.2.0",
44
- "@veloxts/auth": "0.6.26",
45
- "@veloxts/client": "0.6.26",
46
- "@veloxts/core": "0.6.26",
47
- "@veloxts/router": "0.6.26"
47
+ "@veloxts/client": "0.6.27",
48
+ "@veloxts/core": "0.6.27",
49
+ "@veloxts/router": "0.6.27",
50
+ "@veloxts/auth": "0.6.27"
48
51
  },
49
52
  "peerDependenciesMeta": {
50
53
  "@veloxts/auth": {
@@ -67,10 +70,10 @@
67
70
  "react-server-dom-webpack": "19.2.3",
68
71
  "typescript": "5.9.3",
69
72
  "vitest": "4.0.16",
70
- "@veloxts/client": "0.6.26",
71
- "@veloxts/auth": "0.6.26",
72
- "@veloxts/router": "0.6.26",
73
- "@veloxts/core": "0.6.26"
73
+ "@veloxts/auth": "0.6.27",
74
+ "@veloxts/client": "0.6.27",
75
+ "@veloxts/router": "0.6.27",
76
+ "@veloxts/core": "0.6.27"
74
77
  },
75
78
  "keywords": [
76
79
  "velox",