@veloxts/router 0.6.25 → 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 +558 -0
  2. package/GUIDE.md +88 -0
  3. package/package.json +7 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,558 @@
1
+ # @veloxts/router
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/core@0.6.27
10
+ - @veloxts/validation@0.6.27
11
+
12
+ ## 0.6.26
13
+
14
+ ### Patch Changes
15
+
16
+ - docs(mcp): add README and GUIDE, docs(web): simplify README and create concise GUIDE
17
+ - Updated dependencies
18
+ - @veloxts/core@0.6.26
19
+ - @veloxts/validation@0.6.26
20
+
21
+ ## 0.6.25
22
+
23
+ ### Patch Changes
24
+
25
+ - docs(create): add guide for React Server Components setup
26
+ - Updated dependencies
27
+ - @veloxts/core@0.6.25
28
+ - @veloxts/validation@0.6.25
29
+
30
+ ## 0.6.24
31
+
32
+ ### Patch Changes
33
+
34
+ - clarify installation paths and package contents
35
+ - Updated dependencies
36
+ - @veloxts/core@0.6.24
37
+ - @veloxts/validation@0.6.24
38
+
39
+ ## 0.6.23
40
+
41
+ ### Patch Changes
42
+
43
+ - add defineContract for improved type inference DX
44
+ - Updated dependencies
45
+ - @veloxts/core@0.6.23
46
+ - @veloxts/validation@0.6.23
47
+
48
+ ## 0.6.22
49
+
50
+ ### Patch Changes
51
+
52
+ - support {method, path} route entry format
53
+ - Updated dependencies
54
+ - @veloxts/core@0.6.22
55
+ - @veloxts/validation@0.6.22
56
+
57
+ ## 0.6.21
58
+
59
+ ### Patch Changes
60
+
61
+ - separate schemas from procedures for browser-safe import
62
+ - Updated dependencies
63
+ - @veloxts/core@0.6.21
64
+ - @veloxts/validation@0.6.21
65
+
66
+ ## 0.6.20
67
+
68
+ ### Patch Changes
69
+
70
+ - add Fastify ecosystem stubs and debuglog to util
71
+ - Updated dependencies
72
+ - @veloxts/core@0.6.20
73
+ - @veloxts/validation@0.6.20
74
+
75
+ ## 0.6.19
76
+
77
+ ### Patch Changes
78
+
79
+ - restore dotenv stub for browser compatibility
80
+ - Updated dependencies
81
+ - @veloxts/core@0.6.19
82
+ - @veloxts/validation@0.6.19
83
+
84
+ ## 0.6.18
85
+
86
+ ### Patch Changes
87
+
88
+ - add node:fs/promises stub and fix esbuild plugin
89
+ - Updated dependencies
90
+ - @veloxts/core@0.6.18
91
+ - @veloxts/validation@0.6.18
92
+
93
+ ## 0.6.17
94
+
95
+ ### Patch Changes
96
+
97
+ - remove optimizeDeps.exclude to fix CJS/ESM interop
98
+ - Updated dependencies
99
+ - @veloxts/core@0.6.17
100
+ - @veloxts/validation@0.6.17
101
+
102
+ ## 0.6.16
103
+
104
+ ### Patch Changes
105
+
106
+ - add stubs for Fastify ecosystem packages
107
+ - Updated dependencies
108
+ - @veloxts/core@0.6.16
109
+ - @veloxts/validation@0.6.16
110
+
111
+ ## 0.6.15
112
+
113
+ ### Patch Changes
114
+
115
+ - implement three-layer Node.js stubbing for Vite
116
+ - Updated dependencies
117
+ - @veloxts/core@0.6.15
118
+ - @veloxts/validation@0.6.15
119
+
120
+ ## 0.6.14
121
+
122
+ ### Patch Changes
123
+
124
+ - stub dotenv as virtual module instead of process shims
125
+ - Updated dependencies
126
+ - @veloxts/core@0.6.14
127
+ - @veloxts/validation@0.6.14
128
+
129
+ ## 0.6.13
130
+
131
+ ### Patch Changes
132
+
133
+ - add process.argv stub for dotenv browser compatibility
134
+ - Updated dependencies
135
+ - @veloxts/core@0.6.13
136
+ - @veloxts/validation@0.6.13
137
+
138
+ ## 0.6.12
139
+
140
+ ### Patch Changes
141
+
142
+ - Fixes the "process is not defined" error from dotenv
143
+ - Updated dependencies
144
+ - @veloxts/core@0.6.12
145
+ - @veloxts/validation@0.6.12
146
+
147
+ ## 0.6.11
148
+
149
+ ### Patch Changes
150
+
151
+ - add Vite plugin for Node.js module stubs
152
+ - Updated dependencies
153
+ - @veloxts/core@0.6.11
154
+ - @veloxts/validation@0.6.11
155
+
156
+ ## 0.6.10
157
+
158
+ ### Patch Changes
159
+
160
+ - use import() type syntax for AppRouter
161
+ - Updated dependencies
162
+ - @veloxts/core@0.6.10
163
+ - @veloxts/validation@0.6.10
164
+
165
+ ## 0.6.9
166
+
167
+ ### Patch Changes
168
+
169
+ - isolate auth procedures from database imports
170
+ - Updated dependencies
171
+ - @veloxts/core@0.6.9
172
+ - @veloxts/validation@0.6.9
173
+
174
+ ## 0.6.8
175
+
176
+ ### Patch Changes
177
+
178
+ - prevent dotenv from leaking into browser bundle
179
+ - Updated dependencies
180
+ - @veloxts/core@0.6.8
181
+ - @veloxts/validation@0.6.8
182
+
183
+ ## 0.6.7
184
+
185
+ ### Patch Changes
186
+
187
+ - better-sqlite3 versions mismatch fix
188
+ - Updated dependencies
189
+ - @veloxts/core@0.6.7
190
+ - @veloxts/validation@0.6.7
191
+
192
+ ## 0.6.6
193
+
194
+ ### Patch Changes
195
+
196
+ - ensure the web app never imports server-side code paths
197
+ - Updated dependencies
198
+ - @veloxts/core@0.6.6
199
+ - @veloxts/validation@0.6.6
200
+
201
+ ## 0.6.5
202
+
203
+ ### Patch Changes
204
+
205
+ - move @prisma/client-runtime-utils to root package.json
206
+ - Updated dependencies
207
+ - @veloxts/core@0.6.5
208
+ - @veloxts/validation@0.6.5
209
+
210
+ ## 0.6.4
211
+
212
+ ### Patch Changes
213
+
214
+ - add @prisma/client-runtime-utils dependency
215
+ - Updated dependencies
216
+ - @veloxts/core@0.6.4
217
+ - @veloxts/validation@0.6.4
218
+
219
+ ## 0.6.3
220
+
221
+ ### Patch Changes
222
+
223
+ - Add workspaces field to root package.json template + Fix Prisma ESM/CJS import for Node.js v24
224
+ - Updated dependencies
225
+ - @veloxts/core@0.6.3
226
+ - @veloxts/validation@0.6.3
227
+
228
+ ## 0.6.2
229
+
230
+ ### Patch Changes
231
+
232
+ - add server actions, removed some deprecated and other chore
233
+ - Updated dependencies
234
+ - @veloxts/core@0.6.2
235
+ - @veloxts/validation@0.6.2
236
+
237
+ ## 0.6.1
238
+
239
+ ### Patch Changes
240
+
241
+ - route groups for file-based routing; add dynamic route support with [param] segments
242
+ - Updated dependencies
243
+ - @veloxts/core@0.6.1
244
+ - @veloxts/validation@0.6.1
245
+
246
+ ## 0.6.0
247
+
248
+ ### Minor Changes
249
+
250
+ - RSC streaming, dynamic routes, Vinxi integration
251
+
252
+ ### Patch Changes
253
+
254
+ - Updated dependencies
255
+ - @veloxts/core@0.6.0
256
+ - @veloxts/validation@0.6.0
257
+
258
+ ## 0.5.0
259
+
260
+ ### Minor Changes
261
+
262
+ - Auto-register procedures + inject Prisma models feature
263
+
264
+ ### Patch Changes
265
+
266
+ - Updated dependencies
267
+ - @veloxts/core@0.5.0
268
+ - @veloxts/validation@0.5.0
269
+
270
+ ## 0.4.21
271
+
272
+ ### Patch Changes
273
+
274
+ - format Prisma default values correctly by type
275
+ - Updated dependencies
276
+ - @veloxts/core@0.4.21
277
+ - @veloxts/validation@0.4.21
278
+
279
+ ## 0.4.20
280
+
281
+ ### Patch Changes
282
+
283
+ - import consolidation: update import paths for `@veloxts/velox`
284
+ - Updated dependencies
285
+ - @veloxts/core@0.4.20
286
+ - @veloxts/validation@0.4.20
287
+
288
+ ## 0.4.19
289
+
290
+ ### Patch Changes
291
+
292
+ - update default dev server port to 3030
293
+ - Updated dependencies
294
+ - @veloxts/core@0.4.19
295
+ - @veloxts/validation@0.4.19
296
+
297
+ ## 0.4.18
298
+
299
+ ### Patch Changes
300
+
301
+ - introduce interactive field menu and templates for resource generation
302
+ - Updated dependencies
303
+ - @veloxts/core@0.4.18
304
+ - @veloxts/validation@0.4.18
305
+
306
+ ## 0.4.17
307
+
308
+ ### Patch Changes
309
+
310
+ - add interactive field prompts for resource generation
311
+ - Updated dependencies
312
+ - @veloxts/core@0.4.17
313
+ - @veloxts/validation@0.4.17
314
+
315
+ ## 0.4.16
316
+
317
+ ### Patch Changes
318
+
319
+ - fixed velox procedures list
320
+ - Updated dependencies
321
+ - @veloxts/core@0.4.16
322
+ - @veloxts/validation@0.4.16
323
+
324
+ ## 0.4.15
325
+
326
+ ### Patch Changes
327
+
328
+ - chore lint fixes
329
+ - Updated dependencies
330
+ - @veloxts/core@0.4.15
331
+ - @veloxts/validation@0.4.15
332
+
333
+ ## 0.4.14
334
+
335
+ ### Patch Changes
336
+
337
+ - fixed proxy-type inferance and update proxy hooks for optional input handling
338
+ - Updated dependencies
339
+ - @veloxts/core@0.4.14
340
+ - @veloxts/validation@0.4.14
341
+
342
+ ## 0.4.13
343
+
344
+ ### Patch Changes
345
+
346
+ - add debug mode to dev server
347
+ - Updated dependencies
348
+ - @veloxts/core@0.4.13
349
+ - @veloxts/validation@0.4.13
350
+
351
+ ## 0.4.12
352
+
353
+ ### Patch Changes
354
+
355
+ - preserve type info in trpc template AppRouter export
356
+ - Updated dependencies
357
+ - @veloxts/core@0.4.12
358
+ - @veloxts/validation@0.4.12
359
+
360
+ ## 0.4.11
361
+
362
+ ### Patch Changes
363
+
364
+ - fixed api.health.check.useQuery is not a function issue
365
+ - Updated dependencies
366
+ - @veloxts/core@0.4.11
367
+ - @veloxts/validation@0.4.11
368
+
369
+ ## 0.4.10
370
+
371
+ ### Patch Changes
372
+
373
+ - fixed ReferenceError: styles is not defined in rpc template
374
+ - Updated dependencies
375
+ - @veloxts/core@0.4.10
376
+ - @veloxts/validation@0.4.10
377
+
378
+ ## 0.4.7
379
+
380
+ ### Patch Changes
381
+
382
+ - Add dynamic headers and routes config to client
383
+ - Updated dependencies
384
+ - @veloxts/core@0.4.7
385
+ - @veloxts/validation@0.4.7
386
+
387
+ ## 0.4.6
388
+
389
+ ### Patch Changes
390
+
391
+ - Fix broken npm packages - republish with correct dependencies
392
+ - Updated dependencies
393
+ - @veloxts/core@0.4.6
394
+ - @veloxts/validation@0.4.6
395
+
396
+ ## 0.4.5
397
+
398
+ ### Patch Changes
399
+
400
+ - b06631b: CI CD npm Trusted Publishing setup
401
+ - Updated dependencies [b06631b]
402
+ - @veloxts/core@0.4.5
403
+ - @veloxts/validation@0.4.5
404
+
405
+ ## 0.4.4
406
+
407
+ ### Patch Changes
408
+
409
+ - 05ae1a5: Update to boilerplate, work in progress
410
+ - 9961b52: full-stack React frontend implementation
411
+ - Updated dependencies [05ae1a5]
412
+ - Updated dependencies [9961b52]
413
+ - @veloxts/core@0.4.4
414
+ - @veloxts/validation@0.4.4
415
+
416
+ ## 0.4.3
417
+
418
+ ### Patch Changes
419
+
420
+ - ef8d5d0: Dynamically load VeloxTS version from `package.json` in shared template configuration
421
+ - Updated dependencies [ef8d5d0]
422
+ - @veloxts/core@0.4.3
423
+ - @veloxts/validation@0.4.3
424
+
425
+ ## 0.4.2
426
+
427
+ ### Patch Changes
428
+
429
+ - 5b4f02c: Updated documentations
430
+ - 0d8d775: Updated guides and readme files
431
+ - Updated dependencies [5b4f02c]
432
+ - Updated dependencies [0d8d775]
433
+ - @veloxts/core@0.4.2
434
+ - @veloxts/validation@0.4.2
435
+
436
+ ## 0.4.1
437
+
438
+ ### Patch Changes
439
+
440
+ - 0eea918: Completed CLI generators
441
+ - Updated dependencies [0eea918]
442
+ - @veloxts/core@0.4.1
443
+ - @veloxts/validation@0.4.1
444
+
445
+ ## 0.4.0
446
+
447
+ ### Minor Changes
448
+
449
+ - b478fee: Performance Benchmarks | 34k req/s, <1ms p50 latency, 75MB memory, 530ms startup
450
+
451
+ ### Patch Changes
452
+
453
+ - Updated dependencies [b478fee]
454
+ - @veloxts/core@0.4.0
455
+ - @veloxts/validation@0.4.0
456
+
457
+ ## 0.3.6
458
+
459
+ ### Patch Changes
460
+
461
+ - 929f2ab: Interactive CLI setup
462
+ - Updated dependencies [929f2ab]
463
+ - @veloxts/core@0.3.6
464
+ - @veloxts/validation@0.3.6
465
+
466
+ ## 0.3.5
467
+
468
+ ### Patch Changes
469
+
470
+ - 658e83f: @veloxts/auth, Full REST Support, Better error messages, Type tests with tsd
471
+ - Updated dependencies [658e83f]
472
+ - @veloxts/core@0.3.5
473
+ - @veloxts/validation@0.3.5
474
+
475
+ ## 0.3.4
476
+
477
+ ### Patch Changes
478
+
479
+ - 65ef3e7: DI container and Auth Guards
480
+ - Updated dependencies [65ef3e7]
481
+ - @veloxts/core@0.3.4
482
+ - @veloxts/validation@0.3.4
483
+
484
+ ## 0.3.3
485
+
486
+ ### Patch Changes
487
+
488
+ - 4ee103b: Full REST support PUT, PATCH and DELETE
489
+ - Updated dependencies [4ee103b]
490
+ - @veloxts/core@0.3.3
491
+ - @veloxts/validation@0.3.3
492
+
493
+ ## 0.3.2
494
+
495
+ ### Patch Changes
496
+
497
+ - abf270e: Dynamically set core `VELOX_VERSION` from package.json
498
+ - Updated dependencies [abf270e]
499
+ - @veloxts/core@0.3.2
500
+ - @veloxts/validation@0.3.2
501
+
502
+ ## 0.3.1
503
+
504
+ ### Patch Changes
505
+
506
+ - cb9806e: Fixed the value for VELOXTS_VERSION in create app template
507
+ - Updated dependencies [cb9806e]
508
+ - @veloxts/core@0.3.1
509
+ - @veloxts/validation@0.3.1
510
+
511
+ ## 0.3.0
512
+
513
+ ### Minor Changes
514
+
515
+ - 1adce10: Introduced an umbrella package for server side packages: @veloxts/velox
516
+
517
+ ### Patch Changes
518
+
519
+ - Updated dependencies [1adce10]
520
+ - @veloxts/core@0.3.0
521
+ - @veloxts/validation@0.3.0
522
+
523
+ ## 0.2.2
524
+
525
+ ### Patch Changes
526
+
527
+ - Version bump to sync with create-velox-app native module fix
528
+ - Updated dependencies
529
+ - @veloxts/core@0.2.2
530
+ - @veloxts/validation@0.2.2
531
+
532
+ ## 0.2.0
533
+
534
+ ### Minor Changes
535
+
536
+ - 9404976: fix Prisma client generation. README adjustments
537
+
538
+ ### Patch Changes
539
+
540
+ - Updated dependencies [9404976]
541
+ - @veloxts/validation@0.2.0
542
+ - @veloxts/core@0.2.0
543
+
544
+ ## 0.1.1
545
+
546
+ ### Patch Changes
547
+
548
+ - Fix Prisma client generation in scaffolder
549
+
550
+ - Added automatic Prisma client generation after dependency installation in create-velox-app
551
+ - Fixed database template to validate DATABASE_URL environment variable
552
+ - Added alpha release warning to all package READMEs
553
+ - Fixed TypeScript type for registerTRPCPlugin to accept FastifyInstance
554
+ - Updated playground app to use Prisma 7.x custom output path
555
+
556
+ - Updated dependencies
557
+ - @veloxts/core@0.1.1
558
+ - @veloxts/validation@0.1.1
package/GUIDE.md ADDED
@@ -0,0 +1,88 @@
1
+ # @veloxts/router
2
+
3
+ Procedure-based routing with hybrid tRPC and REST adapters.
4
+
5
+ ## Quick Start
6
+
7
+ ```typescript
8
+ import { procedure, defineProcedures } from '@veloxts/router';
9
+ import { z } from '@veloxts/validation';
10
+
11
+ export const userProcedures = defineProcedures('users', {
12
+ getUser: procedure()
13
+ .input(z.object({ id: z.string().uuid() }))
14
+ .output(UserSchema)
15
+ .query(async ({ input, ctx }) => {
16
+ return ctx.db.user.findUnique({ where: { id: input.id } });
17
+ }),
18
+
19
+ createUser: procedure()
20
+ .input(CreateUserSchema)
21
+ .output(UserSchema)
22
+ .mutation(async ({ input, ctx }) => {
23
+ return ctx.db.user.create({ data: input });
24
+ }),
25
+ });
26
+ ```
27
+
28
+ ## Procedure API
29
+
30
+ - `.input(schema)` - Validate input with Zod
31
+ - `.output(schema)` - Validate output with Zod
32
+ - `.use(middleware)` - Add middleware
33
+ - `.guard(guard)` - Add authorization guard
34
+ - `.rest({ method, path })` - Override REST path
35
+ - `.query(handler)` - Finalize as read operation
36
+ - `.mutation(handler)` - Finalize as write operation
37
+
38
+ ## REST Naming Conventions
39
+
40
+ Procedure names auto-map to HTTP methods:
41
+
42
+ | Prefix | Method | Path |
43
+ |--------|--------|------|
44
+ | `get*` | GET | `/:id` |
45
+ | `list*`, `find*` | GET | `/` |
46
+ | `create*`, `add*` | POST | `/` |
47
+ | `update*`, `edit*` | PUT | `/:id` |
48
+ | `patch*` | PATCH | `/:id` |
49
+ | `delete*`, `remove*` | DELETE | `/:id` |
50
+
51
+ ## Registering Routes
52
+
53
+ ```typescript
54
+ import { registerRestRoutes } from '@veloxts/router';
55
+
56
+ await registerRestRoutes(app.server, {
57
+ prefix: '/api',
58
+ procedures: { users: userProcedures },
59
+ });
60
+ ```
61
+
62
+ ## tRPC Adapter
63
+
64
+ ```typescript
65
+ import { trpc, appRouter, registerTRPCPlugin } from '@veloxts/router';
66
+
67
+ const t = trpc();
68
+ const router = appRouter(t, [userProcedures]);
69
+
70
+ await registerTRPCPlugin(app.server, { router, prefix: '/trpc' });
71
+
72
+ export type AppRouter = typeof router;
73
+ ```
74
+
75
+ ## Middleware
76
+
77
+ ```typescript
78
+ const getUser = procedure()
79
+ .use(async ({ ctx, next }) => {
80
+ console.log(`Request: ${ctx.request.url}`);
81
+ return next();
82
+ })
83
+ .query(handler);
84
+ ```
85
+
86
+ ## Learn More
87
+
88
+ See [@veloxts/velox](https://www.npmjs.com/package/@veloxts/velox) for complete documentation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veloxts/router",
3
- "version": "0.6.25",
3
+ "version": "0.6.27",
4
4
  "description": "Procedure definitions with tRPC and REST routing for VeloxTS framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -35,8 +35,8 @@
35
35
  "dependencies": {
36
36
  "@trpc/server": "11.8.0",
37
37
  "fastify": "5.6.2",
38
- "@veloxts/validation": "0.6.25",
39
- "@veloxts/core": "0.6.25"
38
+ "@veloxts/validation": "0.6.27",
39
+ "@veloxts/core": "0.6.27"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@vitest/coverage-v8": "4.0.16",
@@ -52,7 +52,10 @@
52
52
  },
53
53
  "files": [
54
54
  "dist",
55
- "README.md"
55
+ "README.md",
56
+ "GUIDE.md",
57
+ "LICENSE",
58
+ "CHANGELOG.md"
56
59
  ],
57
60
  "keywords": [
58
61
  "velox",