Skip to content

Commit

Permalink
fix: buildContext return type inference
Browse files Browse the repository at this point in the history
  • Loading branch information
WoH committed Nov 13, 2023
1 parent 0afe154 commit b5b3cd4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"license": "MIT",
"dependencies": {
"@tsoa/runtime": "^6.0.0-rc.2",
"@types/multer": "^1.4.10",
"deepmerge": "^4.3.1",
"fs-extra": "^11.1.1",
"glob": "^10.3.10",
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/routeGeneration/routeGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ export abstract class AbstractRouteGenerator<Config extends ExtendedRoutesConfig
return convertBracesPathParams(path);
}

protected buildContext(): any {
protected buildContext() {
const authenticationModule = this.options.authenticationModule ? this.getRelativeImportPath(this.options.authenticationModule) : undefined;
const iocModule = this.options.iocModule ? this.getRelativeImportPath(this.options.iocModule) : undefined;

// Left in for backwards compatibility, previously if we're working locally then tsoa runtime code wasn't an importable module but now it is.
const canImportByAlias = true;

const normalisedBasePath = normalisePath(this.options.basePath as string, '/');

return {
authenticationModule,
basePath: normalisedBasePath,
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,13 @@
dependencies:
"@types/express" "*"

"@types/multer@^1.4.10":
version "1.4.10"
resolved "https://registry.yarnpkg.com/@types/multer/-/multer-1.4.10.tgz#6bca159aaaf40ec130e99831a08e3d0ed54be611"
integrity sha512-6l9mYMhUe8wbnz/67YIjc7ZJyQNZoKq7fRXVf7nMdgWgalD0KyzJ2ywI7hoATUSXSbTu9q2HBiEwzy0tNN1v2w==
dependencies:
"@types/express" "*"

"@types/node@*":
version "20.3.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.3.1.tgz#e8a83f1aa8b649377bb1fb5d7bac5cb90e784dfe"
Expand Down

0 comments on commit b5b3cd4

Please sign in to comment.