create-velox-app 0.7.8 → 0.8.0

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # create-velox-app
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - feat(router): new simplified procedure builder
8
+
9
+ ## 0.7.9
10
+
11
+ ### Patch Changes
12
+
13
+ - feat(router): swagger auto-discovery of module collections
14
+
3
15
  ## 0.7.8
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # create-velox-app
2
2
 
3
- > **Early Access (v0.7.x)**
3
+ > **Early Access (v0.8.x)**
4
4
 
5
5
  Interactive project scaffolder for VeloxTS Framework - creates production-ready applications with batteries included. Learn more at [@veloxts/velox](https://www.npmjs.com/package/@veloxts/velox).
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-velox-app",
3
- "version": "0.7.8",
3
+ "version": "0.8.0",
4
4
  "description": "Project scaffolder for VeloxTS framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -7,7 +7,7 @@ import 'dotenv/config';
7
7
  // Side-effect import for declaration merging (extends ctx.db, ctx.user types)
8
8
  import './types.js';
9
9
 
10
- import { authPlugin, databasePlugin, rest, veloxApp } from '@veloxts/velox';
10
+ import { authPlugin, databasePlugin, rest, swaggerPlugin, veloxApp } from '@veloxts/velox';
11
11
 
12
12
  import { config } from './config/app.js';
13
13
  import { authConfig } from './config/auth.js';
@@ -35,6 +35,12 @@ app.routes(
35
35
  })
36
36
  );
37
37
 
38
+ await app.register(swaggerPlugin, {
39
+ openapi: {
40
+ info: { title: '__PROJECT_NAME__', version: '0.0.1' },
41
+ },
42
+ });
43
+
38
44
  await app.start();
39
45
 
40
46
  // Send ready signal to CLI for accurate HMR timing
@@ -7,7 +7,7 @@ import 'dotenv/config';
7
7
  // Side-effect import for declaration merging (extends ctx.db type)
8
8
  import './types.js';
9
9
 
10
- import { databasePlugin, rest, veloxApp } from '@veloxts/velox';
10
+ import { databasePlugin, rest, swaggerPlugin, veloxApp } from '@veloxts/velox';
11
11
 
12
12
  import { config } from './config/app.js';
13
13
  import { db } from './config/database.js';
@@ -33,6 +33,12 @@ app.routes(
33
33
  })
34
34
  );
35
35
 
36
+ await app.register(swaggerPlugin, {
37
+ openapi: {
38
+ info: { title: '__PROJECT_NAME__', version: '0.0.1' },
39
+ },
40
+ });
41
+
36
42
  await app.start();
37
43
 
38
44
  // Send ready signal to CLI for accurate HMR timing
@@ -5,11 +5,11 @@
5
5
  * - Public: GET /api/profiles/:id → { id, name }
6
6
  * Uses handler-level projection: resource(data, Schema.public)
7
7
  * - Authenticated: GET /api/profiles/:id/full → { id, name, email }
8
- * Uses procedure-level auto-projection: .expose(Schema.authenticated)
8
+ * Uses .guard(authenticated) + .output(Schema.authenticated)
9
9
  */
10
10
 
11
11
  import {
12
- authenticatedNarrow,
12
+ authenticated,
13
13
  NotFoundError,
14
14
  procedure,
15
15
  procedures,
@@ -37,7 +37,7 @@ export const profileProcedures = procedures('profiles', {
37
37
  // Handler-level projection: resource(data, Schema.public) returns projected data directly
38
38
  getProfile: procedure()
39
39
  .input(z.object({ id: z.string().uuid() }))
40
- .expose(UserProfileSchema.public)
40
+ .output(UserProfileSchema.public)
41
41
  .query(async ({ input, ctx }) => {
42
42
  const user = await ctx.db.user.findUnique({ where: { id: input.id } });
43
43
  if (!user) throw new NotFoundError(`User '${input.id}' not found`);
@@ -45,12 +45,12 @@ export const profileProcedures = procedures('profiles', {
45
45
  }),
46
46
 
47
47
  // Authenticated: GET /api/profiles/:id/full → { id, name, email }
48
- // Procedure-level auto-projection: .expose(Schema.authenticated) auto-projects the return value
48
+ // Uses .guard(authenticated) + .output(Schema.authenticated) for field-level visibility
49
49
  getFullProfile: procedure()
50
50
  .rest({ method: 'GET', path: '/profiles/:id/full' })
51
- .guardNarrow(authenticatedNarrow)
51
+ .guard(authenticated)
52
52
  .input(z.object({ id: z.string().uuid() }))
53
- .expose(UserProfileSchema.authenticated)
53
+ .output(UserProfileSchema.authenticated)
54
54
  .query(async ({ input, ctx }) => {
55
55
  const user = await ctx.db.user.findUnique({ where: { id: input.id } });
56
56
  if (!user) throw new NotFoundError(`User '${input.id}' not found`);