Skip to content

Commit e10185b

Browse files
authored
chore(warn): deprecation of config multer options (#1695)
1 parent d8c881a commit e10185b

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

packages/cli/src/module/generate-routes.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Tsoa } from '@tsoa/runtime';
55
import { DefaultRouteGenerator } from '../routeGeneration/defaultRouteGenerator';
66
import { fsMkDir } from '../utils/fs';
77
import path = require('path');
8-
import { Config as BaseConfig } from "@tsoa/runtime";
8+
import { Config as BaseConfig } from '@tsoa/runtime';
99

1010
export async function generateRoutes<Config extends ExtendedRoutesConfig>(
1111
routesConfig: Config,
@@ -15,7 +15,7 @@ export async function generateRoutes<Config extends ExtendedRoutesConfig>(
1515
* pass in cached metadata returned in a previous step to speed things up
1616
*/
1717
metadata?: Tsoa.Metadata,
18-
defaultNumberType?: BaseConfig['defaultNumberType']
18+
defaultNumberType?: BaseConfig['defaultNumberType'],
1919
) {
2020
if (!metadata) {
2121
metadata = new MetadataGenerator(routesConfig.entryFile, compilerOptions, ignorePaths, routesConfig.controllerPathGlobs, routesConfig.rootSecurity, defaultNumberType).Generate();
@@ -26,6 +26,15 @@ export async function generateRoutes<Config extends ExtendedRoutesConfig>(
2626
await fsMkDir(routesConfig.routesDir, { recursive: true });
2727
await routeGenerator.GenerateCustomRoutes();
2828

29+
if (routesConfig.multerOpts) {
30+
console.warn(
31+
'Config MulterOptions is deprecated since v6.4.0 instroduces RegisterRoutes can pass multerOptions,' +
32+
'we will quickly remove this options soon at future version.' +
33+
'(https://github.com/lukeautry/tsoa/issues/1587#issuecomment-2391291433)' +
34+
'(https://github.com/lukeautry/tsoa/pull/1638)',
35+
);
36+
}
37+
2938
return metadata;
3039
}
3140

packages/runtime/src/config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ export interface Config {
4747
* @example {
4848
* "dest": "/tmp"
4949
* } Allow multer to write to file instead of using Memory's buffer
50+
* @deprecated
51+
* since v6.4.0 instroduces RegisterRoutes can pass multerOptions,
52+
* we will quickly remove this options soon at future version.
53+
* (https://github.com/lukeautry/tsoa/issues/1587#issuecomment-2391291433)
54+
* (https://github.com/lukeautry/tsoa/pull/1638)
5055
*/
5156
multerOpts?: MulterOpts;
5257

0 commit comments

Comments
 (0)