create-velox-app 0.6.66 → 0.6.67
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 +6 -0
- package/dist/templates/auth.js +4 -0
- package/package.json +1 -1
- package/src/templates/source/api/package.auth.json +1 -0
- package/src/templates/source/api/package.default.json +1 -0
- package/src/templates/source/api/routes.auth.ts +37 -0
- package/src/templates/source/web/main.tsx +1 -1
package/CHANGELOG.md
CHANGED
package/dist/templates/auth.js
CHANGED
|
@@ -50,6 +50,9 @@ 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
|
+
}
|
|
53
56
|
function generateConfigDatabase(config) {
|
|
54
57
|
return compileTemplate('api/config/database.ts', config);
|
|
55
58
|
}
|
|
@@ -90,6 +93,7 @@ export function generateAuthTemplate(config) {
|
|
|
90
93
|
{ path: 'apps/api/prisma/schema.prisma', content: generatePrismaSchema(config) },
|
|
91
94
|
// API Source files
|
|
92
95
|
{ path: 'apps/api/src/router.ts', content: generateRouterTs() },
|
|
96
|
+
{ path: 'apps/api/src/routes.ts', content: generateRoutesTs() },
|
|
93
97
|
{ path: 'apps/api/src/index.ts', content: generateIndexTs() },
|
|
94
98
|
{ path: 'apps/api/src/config/app.ts', content: generateConfigApp(config) },
|
|
95
99
|
{ path: 'apps/api/src/config/auth.ts', content: generateAuthConfig() },
|
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
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/router';
|
|
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: 'DELETE', path: '/auth/session', 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
|
+
};
|
|
@@ -9,7 +9,7 @@ import './styles/global.css';
|
|
|
9
9
|
// Import router type (type-only import is erased at compile time)
|
|
10
10
|
import type { AppRouter } from '../../api/src/router.js';
|
|
11
11
|
/* @if auth */
|
|
12
|
-
// Import routes from browser-safe routes file
|
|
12
|
+
// Import routes from browser-safe routes file (no server-side code)
|
|
13
13
|
import { routes } from '../../api/src/routes.js';
|
|
14
14
|
|
|
15
15
|
/* @endif auth */
|