@veloxts/cli 0.6.88 → 0.6.90
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.
- package/CHANGELOG.md +24 -11
- package/dist/generators/fields/prompts.js +6 -2
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @veloxts/cli
|
|
2
2
|
|
|
3
|
+
## 0.6.90
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Dependencies updates – fix critical and high severity vulnerabilities
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @veloxts/auth@0.6.90
|
|
10
|
+
- @veloxts/core@0.6.90
|
|
11
|
+
- @veloxts/orm@0.6.90
|
|
12
|
+
- @veloxts/router@0.6.90
|
|
13
|
+
- @veloxts/validation@0.6.90
|
|
14
|
+
|
|
15
|
+
## 0.6.89
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- expand preset system with server config, auth presets, and security validation
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
- @veloxts/auth@0.6.89
|
|
22
|
+
- @veloxts/core@0.6.89
|
|
23
|
+
- @veloxts/orm@0.6.89
|
|
24
|
+
- @veloxts/router@0.6.89
|
|
25
|
+
- @veloxts/validation@0.6.89
|
|
26
|
+
|
|
3
27
|
## 0.6.88
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -223,7 +247,6 @@
|
|
|
223
247
|
- ### feat(auth): Unified Adapter-Only Architecture
|
|
224
248
|
|
|
225
249
|
**New Features:**
|
|
226
|
-
|
|
227
250
|
- Add `JwtAdapter` implementing the `AuthAdapter` interface for unified JWT authentication
|
|
228
251
|
- Add `jwtAuth()` convenience function for direct adapter usage with optional built-in routes (`/api/auth/refresh`, `/api/auth/logout`)
|
|
229
252
|
- Add `AuthContext` discriminated union (`NativeAuthContext | AdapterAuthContext`) for type-safe auth mode handling
|
|
@@ -231,24 +254,20 @@
|
|
|
231
254
|
- Add shared decoration utilities (`decorateAuth`, `setRequestAuth`, `checkDoubleRegistration`)
|
|
232
255
|
|
|
233
256
|
**Architecture Changes:**
|
|
234
|
-
|
|
235
257
|
- `authPlugin` now uses `JwtAdapter` internally - all authentication flows through the adapter pattern
|
|
236
258
|
- Single code path for authentication (no more dual native/adapter modes)
|
|
237
259
|
- `authContext.authMode` is now always `'adapter'` with `providerId='jwt'` when using `authPlugin`
|
|
238
260
|
|
|
239
261
|
**Breaking Changes:**
|
|
240
|
-
|
|
241
262
|
- Remove deprecated `LegacySessionConfig` interface (use `sessionMiddleware` instead)
|
|
242
263
|
- Remove deprecated `session` field from `AuthConfig`
|
|
243
264
|
- `User` interface no longer has index signature (extend via declaration merging)
|
|
244
265
|
|
|
245
266
|
**Type Safety Improvements:**
|
|
246
|
-
|
|
247
267
|
- `AuthContext` discriminated union enables exhaustive type narrowing based on `authMode`
|
|
248
268
|
- Export `NativeAuthContext` and `AdapterAuthContext` types for explicit typing
|
|
249
269
|
|
|
250
270
|
**Migration:**
|
|
251
|
-
|
|
252
271
|
- Existing `authPlugin` usage remains backward-compatible
|
|
253
272
|
- If checking `authContext.token`, use `authContext.session` instead (token stored in session for adapter mode)
|
|
254
273
|
|
|
@@ -270,12 +289,10 @@
|
|
|
270
289
|
Addresses 9 user feedback items to improve DX, reduce boilerplate, and eliminate template duplications.
|
|
271
290
|
|
|
272
291
|
### Phase 1: Validation Helpers (`@veloxts/validation`)
|
|
273
|
-
|
|
274
292
|
- Add `prismaDecimal()`, `prismaDecimalNullable()`, `prismaDecimalOptional()` for Prisma Decimal → number conversion
|
|
275
293
|
- Add `dateToIso`, `dateToIsoNullable`, `dateToIsoOptional` aliases for consistency
|
|
276
294
|
|
|
277
295
|
### Phase 2: Template Deduplication (`@veloxts/auth`)
|
|
278
|
-
|
|
279
296
|
- Export `createEnhancedTokenStore()` with token revocation and refresh token reuse detection
|
|
280
297
|
- Export `parseUserRoles()` and `DEFAULT_ALLOWED_ROLES`
|
|
281
298
|
- Fix memory leak: track pending timeouts for proper cleanup on `destroy()`
|
|
@@ -283,20 +300,17 @@
|
|
|
283
300
|
- Fix jwtManager singleton pattern in templates
|
|
284
301
|
|
|
285
302
|
### Phase 3: Router Helpers (`@veloxts/router`)
|
|
286
|
-
|
|
287
303
|
- Add `createRouter()` returning `{ collections, router }` for DRY setup
|
|
288
304
|
- Add `toRouter()` for router-only use cases
|
|
289
305
|
- Update all router templates to use `createRouter()`
|
|
290
306
|
|
|
291
307
|
### Phase 4: Guard Type Narrowing - Experimental (`@veloxts/auth`, `@veloxts/router`)
|
|
292
|
-
|
|
293
308
|
- Add `NarrowingGuard` interface with phantom `_narrows` type
|
|
294
309
|
- Add `authenticatedNarrow` and `hasRoleNarrow()` guards
|
|
295
310
|
- Add `guardNarrow()` method to `ProcedureBuilder` for context narrowing
|
|
296
311
|
- Enables `ctx.user` to be non-null after guard passes
|
|
297
312
|
|
|
298
313
|
### Phase 5: Documentation (`@veloxts/router`)
|
|
299
|
-
|
|
300
314
|
- Document `.rest()` override patterns
|
|
301
315
|
- Document `createRouter()` helper usage
|
|
302
316
|
- Document `guardNarrow()` experimental API
|
|
@@ -1521,7 +1535,6 @@
|
|
|
1521
1535
|
### Patch Changes
|
|
1522
1536
|
|
|
1523
1537
|
- Fix Prisma client generation in scaffolder
|
|
1524
|
-
|
|
1525
1538
|
- Added automatic Prisma client generation after dependency installation in create-velox-app
|
|
1526
1539
|
- Fixed database template to validate DATABASE_URL environment variable
|
|
1527
1540
|
- Added alpha release warning to all package READMEs
|
|
@@ -125,6 +125,8 @@ async function collectSingleField(existingNames, fieldNumber, prefill) {
|
|
|
125
125
|
placeholder: 'e.g., title, authorId, isPublished',
|
|
126
126
|
initialValue: prefill?.name ?? '',
|
|
127
127
|
validate: (value) => {
|
|
128
|
+
if (!value)
|
|
129
|
+
return 'Field name is required';
|
|
128
130
|
const trimmed = value.trim();
|
|
129
131
|
const error = validateFieldName(trimmed);
|
|
130
132
|
if (error)
|
|
@@ -262,7 +264,7 @@ async function collectDefaultValue(fieldType, prefill) {
|
|
|
262
264
|
placeholder,
|
|
263
265
|
initialValue: prefill ?? '',
|
|
264
266
|
validate: (value) => {
|
|
265
|
-
if (!value.trim())
|
|
267
|
+
if (!value || !value.trim())
|
|
266
268
|
return 'Default value is required';
|
|
267
269
|
return validateDefaultValue(fieldType, value.trim());
|
|
268
270
|
},
|
|
@@ -316,7 +318,7 @@ async function collectEnumDefinition(fieldName, prefill) {
|
|
|
316
318
|
message: 'Enum type name (PascalCase)',
|
|
317
319
|
placeholder: suggestedName,
|
|
318
320
|
initialValue: prefill?.name ?? suggestedName,
|
|
319
|
-
validate: validateEnumName,
|
|
321
|
+
validate: (value) => (value ? validateEnumName(value) : 'Enum name is required'),
|
|
320
322
|
});
|
|
321
323
|
if (p.isCancel(nameResult)) {
|
|
322
324
|
return { enumDef: undefined, cancelled: true };
|
|
@@ -327,6 +329,8 @@ async function collectEnumDefinition(fieldName, prefill) {
|
|
|
327
329
|
placeholder: 'e.g., draft, published, archived',
|
|
328
330
|
initialValue: prefill?.values?.join(', ') ?? '',
|
|
329
331
|
validate: (value) => {
|
|
332
|
+
if (!value)
|
|
333
|
+
return 'At least one enum value is required';
|
|
330
334
|
const parsed = parseEnumValues(value);
|
|
331
335
|
return validateEnumValues(parsed);
|
|
332
336
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veloxts/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.90",
|
|
4
4
|
"description": "Developer tooling and CLI commands for VeloxTS framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,33 +32,33 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@clack/prompts": "0.
|
|
36
|
-
"commander": "14.0.
|
|
35
|
+
"@clack/prompts": "1.0.0",
|
|
36
|
+
"commander": "14.0.3",
|
|
37
37
|
"dotenv": "17.2.3",
|
|
38
38
|
"hot-hook": "0.4.0",
|
|
39
|
-
"pg": "8.
|
|
39
|
+
"pg": "8.18.0",
|
|
40
40
|
"picocolors": "1.1.1",
|
|
41
41
|
"pluralize": "8.0.0",
|
|
42
42
|
"tsx": "4.21.0",
|
|
43
|
-
"yaml": "2.8.
|
|
44
|
-
"@veloxts/
|
|
45
|
-
"@veloxts/
|
|
46
|
-
"@veloxts/
|
|
47
|
-
"@veloxts/
|
|
48
|
-
"@veloxts/
|
|
43
|
+
"yaml": "2.8.2",
|
|
44
|
+
"@veloxts/auth": "0.6.90",
|
|
45
|
+
"@veloxts/orm": "0.6.90",
|
|
46
|
+
"@veloxts/router": "0.6.90",
|
|
47
|
+
"@veloxts/core": "0.6.90",
|
|
48
|
+
"@veloxts/validation": "0.6.90"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@prisma/client": ">=7.0.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@prisma/client": "7.
|
|
55
|
-
"@types/node": "25.0
|
|
56
|
-
"@types/pg": "8.
|
|
54
|
+
"@prisma/client": "7.3.0",
|
|
55
|
+
"@types/node": "25.1.0",
|
|
56
|
+
"@types/pg": "8.16.0",
|
|
57
57
|
"@types/pluralize": "0.0.33",
|
|
58
|
-
"@vitest/coverage-v8": "4.0.
|
|
58
|
+
"@vitest/coverage-v8": "4.0.18",
|
|
59
59
|
"tsd": "0.33.0",
|
|
60
60
|
"typescript": "5.9.3",
|
|
61
|
-
"vitest": "4.0.
|
|
61
|
+
"vitest": "4.0.18"
|
|
62
62
|
},
|
|
63
63
|
"keywords": [
|
|
64
64
|
"velox",
|