@veloxts/router 0.7.0 → 0.7.1
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
package/dist/discovery/loader.js
CHANGED
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
import fs from 'node:fs/promises';
|
|
10
10
|
import path from 'node:path';
|
|
11
11
|
import { pathToFileURL } from 'node:url';
|
|
12
|
+
import { createLogger } from '@veloxts/core';
|
|
12
13
|
import { isProcedureCollection } from '../procedure/builder.js';
|
|
14
|
+
const log = createLogger('router');
|
|
13
15
|
import { directoryNotFound, fileLoadError, invalidExport, noProceduresFound, permissionDenied, } from './errors.js';
|
|
14
16
|
import { DiscoveryErrorCode, } from './types.js';
|
|
15
17
|
// ============================================================================
|
|
@@ -113,7 +115,7 @@ export async function discoverProceduresVerbose(searchPath, options = {}) {
|
|
|
113
115
|
});
|
|
114
116
|
// Log warning if mode is 'warn'
|
|
115
117
|
if (onInvalidExport === 'warn') {
|
|
116
|
-
|
|
118
|
+
log.warn(`[Discovery Warning] ${file}: ${result.message}`);
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
}
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module @veloxts/router/openapi/schema-converter
|
|
7
7
|
*/
|
|
8
|
+
import { createLogger } from '@veloxts/core';
|
|
8
9
|
import { z } from 'zod';
|
|
10
|
+
const log = createLogger('router');
|
|
9
11
|
/**
|
|
10
12
|
* Maps our target names to Zod 4's native `z.toJSONSchema()` target names.
|
|
11
13
|
*
|
|
@@ -65,7 +67,7 @@ export function zodSchemaToJsonSchema(schema, options = {}) {
|
|
|
65
67
|
}
|
|
66
68
|
catch (error) {
|
|
67
69
|
// Log error but don't fail - return a generic schema
|
|
68
|
-
|
|
70
|
+
log.warn('Failed to convert Zod schema to JSON Schema:', error);
|
|
69
71
|
return { type: 'object' };
|
|
70
72
|
}
|
|
71
73
|
}
|
package/dist/rest/adapter.js
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module rest/adapter
|
|
9
9
|
*/
|
|
10
|
-
import { ConfigurationError } from '@veloxts/core';
|
|
10
|
+
import { ConfigurationError, createLogger } from '@veloxts/core';
|
|
11
|
+
const log = createLogger('router');
|
|
11
12
|
import { executeProcedure } from '../procedure/builder.js';
|
|
12
13
|
import { buildMultiLevelNestedPath, buildNestedRestPath, buildRestPath, calculateNestingDepth, parseNamingConvention, } from './naming.js';
|
|
13
14
|
/** Default nesting depth threshold for warnings */
|
|
@@ -35,7 +36,7 @@ export function generateRestRoutes(collection, options = {}) {
|
|
|
35
36
|
if (nestingWarnings) {
|
|
36
37
|
const depth = calculateNestingDepth(procedure.parentResource, procedure.parentResources);
|
|
37
38
|
if (depth >= NESTING_DEPTH_WARNING_THRESHOLD) {
|
|
38
|
-
|
|
39
|
+
log.warn(`Resource '${collection.namespace}/${name}' has ${depth} levels of nesting. ` +
|
|
39
40
|
`Consider using shortcuts: true or restructuring your API.`);
|
|
40
41
|
}
|
|
41
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veloxts/router",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Procedure definitions with tRPC and REST routing for VeloxTS framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@trpc/server": "11.
|
|
40
|
+
"@trpc/server": "11.10.0",
|
|
41
41
|
"fastify": "5.7.4",
|
|
42
|
-
"@veloxts/core": "0.7.
|
|
43
|
-
"@veloxts/validation": "0.7.
|
|
42
|
+
"@veloxts/core": "0.7.1",
|
|
43
|
+
"@veloxts/validation": "0.7.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@vitest/coverage-v8": "4.0.18",
|
|
47
|
-
"esbuild": "0.27.
|
|
47
|
+
"esbuild": "0.27.3",
|
|
48
48
|
"typescript": "5.9.3",
|
|
49
49
|
"vite": "7.3.1",
|
|
50
50
|
"vitest": "4.0.18",
|