create-velox-app 0.6.102 → 0.6.104
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 +12 -0
- package/dist/templates/auth.js +0 -4
- package/package.json +1 -1
- package/src/templates/source/api/package.auth.json +1 -1
- package/src/templates/source/api/package.default.json +1 -1
- package/src/templates/source/api/package.trpc.json +1 -1
- package/src/templates/source/api/procedures/users.auth.ts +2 -2
- package/src/templates/source/api/procedures/users.default.ts +2 -2
- package/src/templates/source/rsc/package.json +1 -1
- package/src/templates/source/rsc-auth/package.json +1 -1
- package/src/templates/source/web/main.tsx +8 -4
- package/src/templates/source/api/routes.auth.ts +0 -41
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# create-velox-app
|
|
2
2
|
|
|
3
|
+
## 0.6.104
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat(client): smart convention-based route inference, eliminate routes.ts
|
|
8
|
+
|
|
9
|
+
## 0.6.103
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- chore(deps): upgrade Zod from v3 to v4
|
|
14
|
+
|
|
3
15
|
## 0.6.102
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/templates/auth.js
CHANGED
|
@@ -50,9 +50,6 @@ function generateIndexTs() {
|
|
|
50
50
|
function generateRouterTs() {
|
|
51
51
|
return compileTemplate('api/router.auth.ts', AUTH_CONFIG);
|
|
52
52
|
}
|
|
53
|
-
function generateRoutesTs() {
|
|
54
|
-
return compileTemplate('api/routes.auth.ts', AUTH_CONFIG);
|
|
55
|
-
}
|
|
56
53
|
function generateConfigDatabase(config) {
|
|
57
54
|
return compileTemplate('api/config/database.ts', config);
|
|
58
55
|
}
|
|
@@ -96,7 +93,6 @@ export function generateAuthTemplate(config) {
|
|
|
96
93
|
{ path: 'apps/api/prisma/schema.prisma', content: generatePrismaSchema(config) },
|
|
97
94
|
// API Source files
|
|
98
95
|
{ path: 'apps/api/src/router.ts', content: generateRouterTs() },
|
|
99
|
-
{ path: 'apps/api/src/routes.ts', content: generateRoutesTs() },
|
|
100
96
|
{ path: 'apps/api/src/index.ts', content: generateIndexTs() },
|
|
101
97
|
{ path: 'apps/api/src/config/app.ts', content: generateConfigApp(config) },
|
|
102
98
|
{ path: 'apps/api/src/config/auth.ts', content: generateAuthConfig() },
|
package/package.json
CHANGED
|
@@ -71,7 +71,7 @@ export const userProcedures = procedures('users', {
|
|
|
71
71
|
|
|
72
72
|
updateUser: procedure()
|
|
73
73
|
.guard(authenticated)
|
|
74
|
-
.input(z.object({ id: z.string().uuid() }).
|
|
74
|
+
.input(z.object({ id: z.string().uuid() }).extend(UpdateUserInput.shape))
|
|
75
75
|
.output(UserSchema)
|
|
76
76
|
.mutation(async ({ input, ctx }) => {
|
|
77
77
|
const { id, ...data } = input;
|
|
@@ -92,7 +92,7 @@ export const userProcedures = procedures('users', {
|
|
|
92
92
|
|
|
93
93
|
patchUser: procedure()
|
|
94
94
|
.guard(authenticated)
|
|
95
|
-
.input(z.object({ id: z.string().uuid() }).
|
|
95
|
+
.input(z.object({ id: z.string().uuid() }).extend(UpdateUserInput.shape))
|
|
96
96
|
.output(UserSchema)
|
|
97
97
|
.mutation(async ({ input, ctx }) => {
|
|
98
98
|
const { id, ...data } = input;
|
|
@@ -54,7 +54,7 @@ export const userProcedures = procedures('users', {
|
|
|
54
54
|
}),
|
|
55
55
|
|
|
56
56
|
updateUser: procedure()
|
|
57
|
-
.input(z.object({ id: z.string().uuid() }).
|
|
57
|
+
.input(z.object({ id: z.string().uuid() }).extend(UpdateUserInput.shape))
|
|
58
58
|
.output(UserSchema)
|
|
59
59
|
.mutation(async ({ input, ctx }) => {
|
|
60
60
|
const { id, ...data } = input;
|
|
@@ -62,7 +62,7 @@ export const userProcedures = procedures('users', {
|
|
|
62
62
|
}),
|
|
63
63
|
|
|
64
64
|
patchUser: procedure()
|
|
65
|
-
.input(z.object({ id: z.string().uuid() }).
|
|
65
|
+
.input(z.object({ id: z.string().uuid() }).extend(UpdateUserInput.shape))
|
|
66
66
|
.output(UserSchema)
|
|
67
67
|
.mutation(async ({ input, ctx }) => {
|
|
68
68
|
const { id, ...data } = input;
|
|
@@ -8,10 +8,8 @@ import './styles/global.css';
|
|
|
8
8
|
|
|
9
9
|
// Import router type (type-only import is erased at compile time)
|
|
10
10
|
import type { AppRouter } from '../../api/src/router.js';
|
|
11
|
-
/* @if auth */
|
|
12
|
-
// Import routes from browser-safe routes file (no server-side code)
|
|
13
|
-
import { routes } from '../../api/src/routes.js';
|
|
14
11
|
|
|
12
|
+
/* @if auth */
|
|
15
13
|
/* @endif auth */
|
|
16
14
|
|
|
17
15
|
// Create router with route tree
|
|
@@ -82,7 +80,13 @@ createRoot(rootElement).render(
|
|
|
82
80
|
config={{
|
|
83
81
|
baseUrl: '/api',
|
|
84
82
|
headers: getAuthHeaders,
|
|
85
|
-
|
|
83
|
+
// Routes are inferred from procedure naming conventions.
|
|
84
|
+
// Only add routes for procedures with .rest() overrides:
|
|
85
|
+
// routes: {
|
|
86
|
+
// auth: {
|
|
87
|
+
// createSession: { method: 'POST', path: '/auth/login', kind: 'mutation' },
|
|
88
|
+
// },
|
|
89
|
+
// },
|
|
86
90
|
onUnauthorized: handleUnauthorized,
|
|
87
91
|
}}
|
|
88
92
|
>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Browser-Safe Route Definitions
|
|
3
|
-
*
|
|
4
|
-
* This file exports route metadata that can be safely imported by frontend code.
|
|
5
|
-
* It does NOT import any server-side modules like procedures or database clients.
|
|
6
|
-
*
|
|
7
|
-
* IMPORTANT: Keep this file browser-safe - no Node.js imports or side effects.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import type { RouteMap } from '@veloxts/velox';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Route mappings for the VeloxTS client
|
|
14
|
-
*
|
|
15
|
-
* Maps namespace -> procedure -> { method, path, kind }
|
|
16
|
-
* These must match the actual procedure definitions in ./procedures/
|
|
17
|
-
*/
|
|
18
|
-
export const routes: RouteMap = {
|
|
19
|
-
health: {
|
|
20
|
-
getHealth: { method: 'GET', path: '/health', kind: 'query' },
|
|
21
|
-
},
|
|
22
|
-
auth: {
|
|
23
|
-
createAccount: { method: 'POST', path: '/auth/register', kind: 'mutation' },
|
|
24
|
-
createSession: { method: 'POST', path: '/auth/login', kind: 'mutation' },
|
|
25
|
-
createRefresh: { method: 'POST', path: '/auth/refresh', kind: 'mutation' },
|
|
26
|
-
deleteSession: { method: 'POST', path: '/auth/logout', kind: 'mutation' },
|
|
27
|
-
getMe: { method: 'GET', path: '/auth/me', kind: 'query' },
|
|
28
|
-
},
|
|
29
|
-
users: {
|
|
30
|
-
listUsers: { method: 'GET', path: '/users', kind: 'query' },
|
|
31
|
-
getUser: { method: 'GET', path: '/users/:id', kind: 'query' },
|
|
32
|
-
createUser: { method: 'POST', path: '/users', kind: 'mutation' },
|
|
33
|
-
updateUser: { method: 'PUT', path: '/users/:id', kind: 'mutation' },
|
|
34
|
-
patchUser: { method: 'PATCH', path: '/users/:id', kind: 'mutation' },
|
|
35
|
-
deleteUser: { method: 'DELETE', path: '/users/:id', kind: 'mutation' },
|
|
36
|
-
},
|
|
37
|
-
profiles: {
|
|
38
|
-
getProfile: { method: 'GET', path: '/profiles/:id', kind: 'query' },
|
|
39
|
-
getFullProfile: { method: 'GET', path: '/profiles/:id/full', kind: 'query' },
|
|
40
|
-
},
|
|
41
|
-
};
|