create-velox-app 0.6.77 → 0.6.78

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,11 @@
1
1
  # create-velox-app
2
2
 
3
+ ## 0.6.78
4
+
5
+ ### Patch Changes
6
+
7
+ - fix(ci): add Docker Hub login to avoid rate limits in tests, add rsc-auth template to smoke test matrix, Fix / types.d.ts reference error in template
8
+
3
9
  ## 0.6.77
4
10
 
5
11
  ### Patch Changes
@@ -68,8 +68,8 @@ function generateAuthSchema() {
68
68
  function generateHealthSchema() {
69
69
  return compileTemplate('api/schemas/health.ts', AUTH_CONFIG);
70
70
  }
71
- function generateApiTypesDts() {
72
- return compileTemplate('api/types.d.ts', AUTH_CONFIG);
71
+ function generateApiTypesTs() {
72
+ return compileTemplate('api/types.ts', AUTH_CONFIG);
73
73
  }
74
74
  function generateAuthUtils() {
75
75
  return compileTemplate('api/utils/auth.ts', AUTH_CONFIG);
@@ -104,7 +104,7 @@ export function generateAuthTemplate(config) {
104
104
  { path: 'apps/api/src/schemas/user.ts', content: generateUserSchema() },
105
105
  { path: 'apps/api/src/schemas/auth.ts', content: generateAuthSchema() },
106
106
  { path: 'apps/api/src/schemas/health.ts', content: generateHealthSchema() },
107
- { path: 'apps/api/src/types.d.ts', content: generateApiTypesDts() },
107
+ { path: 'apps/api/src/types.ts', content: generateApiTypesTs() },
108
108
  { path: 'apps/api/src/utils/auth.ts', content: generateAuthUtils() },
109
109
  ];
110
110
  // Add docker-compose for PostgreSQL
@@ -56,8 +56,8 @@ function generateUserSchema() {
56
56
  function generateHealthSchema() {
57
57
  return compileTemplate('api/schemas/health.ts', DEFAULT_CONFIG);
58
58
  }
59
- function generateApiTypesDts() {
60
- return compileTemplate('api/types.d.ts', DEFAULT_CONFIG);
59
+ function generateApiTypesTs() {
60
+ return compileTemplate('api/types.ts', DEFAULT_CONFIG);
61
61
  }
62
62
  function generateDockerCompose(config) {
63
63
  return compileTemplate('api/docker-compose.yml', config);
@@ -85,7 +85,7 @@ export function generateSpaTemplate(config) {
85
85
  { path: 'apps/api/src/procedures/users.ts', content: generateUserProcedures() },
86
86
  { path: 'apps/api/src/schemas/user.ts', content: generateUserSchema() },
87
87
  { path: 'apps/api/src/schemas/health.ts', content: generateHealthSchema() },
88
- { path: 'apps/api/src/types.d.ts', content: generateApiTypesDts() },
88
+ { path: 'apps/api/src/types.ts', content: generateApiTypesTs() },
89
89
  ];
90
90
  // Add docker-compose for PostgreSQL
91
91
  if (config.database === 'postgresql') {
@@ -64,8 +64,8 @@ function generateUserSchema() {
64
64
  function generateHealthSchema() {
65
65
  return compileTemplate('api/schemas/health.ts', DEFAULT_CONFIG);
66
66
  }
67
- function generateApiTypesDts() {
68
- return compileTemplate('api/types.d.ts', DEFAULT_CONFIG);
67
+ function generateApiTypesTs() {
68
+ return compileTemplate('api/types.ts', DEFAULT_CONFIG);
69
69
  }
70
70
  function generateDockerCompose(config) {
71
71
  return compileTemplate('api/docker-compose.yml', config);
@@ -93,7 +93,7 @@ export function generateTrpcTemplate(config) {
93
93
  { path: 'apps/api/src/procedures/users.ts', content: generateUserProcedures() },
94
94
  { path: 'apps/api/src/schemas/user.ts', content: generateUserSchema() },
95
95
  { path: 'apps/api/src/schemas/health.ts', content: generateHealthSchema() },
96
- { path: 'apps/api/src/types.d.ts', content: generateApiTypesDts() },
96
+ { path: 'apps/api/src/types.ts', content: generateApiTypesTs() },
97
97
  ];
98
98
  // Add docker-compose for PostgreSQL
99
99
  if (config.database === 'postgresql') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-velox-app",
3
- "version": "0.6.77",
3
+ "version": "0.6.78",
4
4
  "description": "Project scaffolder for VeloxTS framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -4,6 +4,9 @@
4
4
 
5
5
  import 'dotenv/config';
6
6
 
7
+ // Side-effect import for declaration merging (extends ctx.db, ctx.user types)
8
+ import './types.js';
9
+
7
10
  import { authPlugin, databasePlugin, rest, veloxApp } from '@veloxts/velox';
8
11
 
9
12
  import { config } from './config/app.js';
@@ -4,6 +4,9 @@
4
4
 
5
5
  import 'dotenv/config';
6
6
 
7
+ // Side-effect import for declaration merging (extends ctx.db type)
8
+ import './types.js';
9
+
7
10
  import { databasePlugin, rest, veloxApp } from '@veloxts/velox';
8
11
 
9
12
  import { config } from './config/app.js';
@@ -10,6 +10,9 @@
10
10
 
11
11
  import 'dotenv/config';
12
12
 
13
+ // Side-effect import for declaration merging (extends ctx.db type)
14
+ import './types.js';
15
+
13
16
  import { databasePlugin, serve, veloxApp } from '@veloxts/velox';
14
17
 
15
18
  import { config } from './config/app.js';
@@ -9,6 +9,11 @@
9
9
  * The server entry point (index.ts) handles environment setup.
10
10
  */
11
11
 
12
+ // Triple-slash reference ensures TypeScript processes our type augmentations
13
+ // for BaseContext and User before type-checking procedures.
14
+ // This is NOT a runtime import - it only affects type checking.
15
+ /// <reference path="./types.ts" />
16
+
12
17
  import { createRouter, extractRoutes } from '@veloxts/velox';
13
18
 
14
19
  import { authProcedures } from './procedures/auth.js';
@@ -9,6 +9,11 @@
9
9
  * The server entry point (index.ts) handles environment setup.
10
10
  */
11
11
 
12
+ // Triple-slash reference ensures TypeScript processes our type augmentations
13
+ // for BaseContext (e.g., ctx.db) before type-checking procedures.
14
+ // This is NOT a runtime import - it only affects type checking.
15
+ /// <reference path="./types.ts" />
16
+
12
17
  import { createRouter, extractRoutes } from '@veloxts/velox';
13
18
 
14
19
  import { healthProcedures } from './procedures/health.js';
@@ -9,6 +9,11 @@
9
9
  * The server entry point (index.ts) handles environment setup.
10
10
  */
11
11
 
12
+ // Triple-slash reference ensures TypeScript processes our type augmentations
13
+ // for BaseContext (e.g., ctx.db) before type-checking procedures.
14
+ // This is NOT a runtime import - it only affects type checking.
15
+ /// <reference path="./types.ts" />
16
+
12
17
  import { createRouter } from '@veloxts/velox';
13
18
 
14
19
  import { healthProcedures } from './procedures/health.js';
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Type declarations for VeloxTS application
3
+ *
4
+ * This file uses declaration merging to extend the framework's base types
5
+ * with application-specific properties:
6
+ *
7
+ * - `ctx.db`: Typed PrismaClient for database access in procedure handlers
8
+ * - `ctx.user.name`: Additional user field from your Prisma schema
9
+ *
10
+ * IMPORTANT: This file must be imported (side-effect import) in your entry
11
+ * point to ensure the declaration merging is processed by TypeScript.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * // In your index.ts entry point:
16
+ * import './types.js'; // Side-effect import for declaration merging
17
+ * ```
18
+ */
19
+
20
+ import type { PrismaClient } from '@prisma/client';
21
+
22
+ declare module '@veloxts/core' {
23
+ interface BaseContext {
24
+ db: PrismaClient;
25
+ }
26
+ }
27
+
28
+ // Extend User interface to include name field from Prisma model
29
+ declare module '@veloxts/auth' {
30
+ interface User {
31
+ name?: string;
32
+ }
33
+ }
34
+
35
+ // This export ensures the file is treated as a module, not a script.
36
+ // Without an export, TypeScript may not process the declaration merging correctly.
37
+ export {};
@@ -1,21 +0,0 @@
1
- /**
2
- * Type declarations for VeloxTS application
3
- *
4
- * Extends the base context with the specific Prisma client types.
5
- * This enables full autocomplete for ctx.db in procedure handlers.
6
- */
7
-
8
- import type { PrismaClient } from '@prisma/client';
9
-
10
- declare module '@veloxts/core' {
11
- interface BaseContext {
12
- db: PrismaClient;
13
- }
14
- }
15
-
16
- // Extend User interface to include name field from Prisma model
17
- declare module '@veloxts/auth' {
18
- interface User {
19
- name?: string;
20
- }
21
- }