@veloxts/cli 0.6.68 → 0.6.70

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 (2) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,98 @@
1
1
  # @veloxts/cli
2
2
 
3
+ ## 0.6.70
4
+
5
+ ### Patch Changes
6
+
7
+ - ### feat(auth): Unified Adapter-Only Architecture
8
+
9
+ **New Features:**
10
+
11
+ - Add `JwtAdapter` implementing the `AuthAdapter` interface for unified JWT authentication
12
+ - Add `jwtAuth()` convenience function for direct adapter usage with optional built-in routes (`/api/auth/refresh`, `/api/auth/logout`)
13
+ - Add `AuthContext` discriminated union (`NativeAuthContext | AdapterAuthContext`) for type-safe auth mode handling
14
+ - Add double-registration protection to prevent conflicting auth system setups
15
+ - Add shared decoration utilities (`decorateAuth`, `setRequestAuth`, `checkDoubleRegistration`)
16
+
17
+ **Architecture Changes:**
18
+
19
+ - `authPlugin` now uses `JwtAdapter` internally - all authentication flows through the adapter pattern
20
+ - Single code path for authentication (no more dual native/adapter modes)
21
+ - `authContext.authMode` is now always `'adapter'` with `providerId='jwt'` when using `authPlugin`
22
+
23
+ **Breaking Changes:**
24
+
25
+ - Remove deprecated `LegacySessionConfig` interface (use `sessionMiddleware` instead)
26
+ - Remove deprecated `session` field from `AuthConfig`
27
+ - `User` interface no longer has index signature (extend via declaration merging)
28
+
29
+ **Type Safety Improvements:**
30
+
31
+ - `AuthContext` discriminated union enables exhaustive type narrowing based on `authMode`
32
+ - Export `NativeAuthContext` and `AdapterAuthContext` types for explicit typing
33
+
34
+ **Migration:**
35
+
36
+ - Existing `authPlugin` usage remains backward-compatible
37
+ - If checking `authContext.token`, use `authContext.session` instead (token stored in session for adapter mode)
38
+
39
+ - Updated dependencies
40
+ - @veloxts/auth@0.6.70
41
+ - @veloxts/core@0.6.70
42
+ - @veloxts/orm@0.6.70
43
+ - @veloxts/router@0.6.70
44
+ - @veloxts/validation@0.6.70
45
+
46
+ ## 0.6.69
47
+
48
+ ### Patch Changes
49
+
50
+ - implement user feedback improvements across packages
51
+
52
+ ## Summary
53
+
54
+ Addresses 9 user feedback items to improve DX, reduce boilerplate, and eliminate template duplications.
55
+
56
+ ### Phase 1: Validation Helpers (`@veloxts/validation`)
57
+
58
+ - Add `prismaDecimal()`, `prismaDecimalNullable()`, `prismaDecimalOptional()` for Prisma Decimal → number conversion
59
+ - Add `dateToIso`, `dateToIsoNullable`, `dateToIsoOptional` aliases for consistency
60
+
61
+ ### Phase 2: Template Deduplication (`@veloxts/auth`)
62
+
63
+ - Export `createEnhancedTokenStore()` with token revocation and refresh token reuse detection
64
+ - Export `parseUserRoles()` and `DEFAULT_ALLOWED_ROLES`
65
+ - Fix memory leak: track pending timeouts for proper cleanup on `destroy()`
66
+ - Update templates to import from `@veloxts/auth` instead of duplicating code
67
+ - Fix jwtManager singleton pattern in templates
68
+
69
+ ### Phase 3: Router Helpers (`@veloxts/router`)
70
+
71
+ - Add `createRouter()` returning `{ collections, router }` for DRY setup
72
+ - Add `toRouter()` for router-only use cases
73
+ - Update all router templates to use `createRouter()`
74
+
75
+ ### Phase 4: Guard Type Narrowing - Experimental (`@veloxts/auth`, `@veloxts/router`)
76
+
77
+ - Add `NarrowingGuard` interface with phantom `_narrows` type
78
+ - Add `authenticatedNarrow` and `hasRoleNarrow()` guards
79
+ - Add `guardNarrow()` method to `ProcedureBuilder` for context narrowing
80
+ - Enables `ctx.user` to be non-null after guard passes
81
+
82
+ ### Phase 5: Documentation (`@veloxts/router`)
83
+
84
+ - Document `.rest()` override patterns
85
+ - Document `createRouter()` helper usage
86
+ - Document `guardNarrow()` experimental API
87
+ - Add schema browser-safety patterns for RSC apps
88
+
89
+ - Updated dependencies
90
+ - @veloxts/auth@0.6.69
91
+ - @veloxts/core@0.6.69
92
+ - @veloxts/orm@0.6.69
93
+ - @veloxts/router@0.6.69
94
+ - @veloxts/validation@0.6.69
95
+
3
96
  ## 0.6.68
4
97
 
5
98
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veloxts/cli",
3
- "version": "0.6.68",
3
+ "version": "0.6.70",
4
4
  "description": "Developer tooling and CLI commands for VeloxTS framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -40,11 +40,11 @@
40
40
  "picocolors": "1.1.1",
41
41
  "pluralize": "8.0.0",
42
42
  "tsx": "4.21.0",
43
- "@veloxts/auth": "0.6.68",
44
- "@veloxts/router": "0.6.68",
45
- "@veloxts/orm": "0.6.68",
46
- "@veloxts/core": "0.6.68",
47
- "@veloxts/validation": "0.6.68"
43
+ "@veloxts/core": "0.6.70",
44
+ "@veloxts/auth": "0.6.70",
45
+ "@veloxts/orm": "0.6.70",
46
+ "@veloxts/router": "0.6.70",
47
+ "@veloxts/validation": "0.6.70"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@prisma/client": ">=7.0.0"