Skip to content

Commit 89c76a6

Browse files
chore(nestjs) publish 5.3.2 release
1 parent 63577b9 commit 89c76a6

8 files changed

Lines changed: 39 additions & 31 deletions

File tree

bundle/core/nest-application.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export declare class NestApplication extends NestApplicationContext implements I
3535
registerParserMiddleware(): any;
3636
isMiddlewareApplied(httpAdapter: HttpServer, name: string): boolean;
3737
registerRouter(): Promise<void>;
38+
registerRouterHooks(): Promise<void>;
3839
connectMicroservice(options: MicroserviceOptions): INestMicroservice;
3940
getMicroservices(): INestMicroservice[];
4041
getHttpServer(): http.Server;

bundle/core/nest-application.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class NestApplication extends nest_application_context_1.NestApplicationContext
9494
await this.registerModules();
9595
await this.registerRouter();
9696
await this.callInitHook();
97+
await this.registerRouterHooks();
9798
await this.callBootstrapHook();
9899
this.isInitialized = true;
99100
this.logger.log(constants_1.messages.APPLICATION_READY);
@@ -127,6 +128,10 @@ class NestApplication extends nest_application_context_1.NestApplicationContext
127128
const basePath = prefix ? shared_utils_1.validatePath(prefix) : '';
128129
this.routesResolver.resolve(this.httpAdapter, basePath);
129130
}
131+
async registerRouterHooks() {
132+
this.routesResolver.registerNotFoundHandler();
133+
this.routesResolver.registerExceptionHandler();
134+
}
130135
connectMicroservice(options) {
131136
const { NestMicroservice } = load_package_util_1.loadPackage('@nestjs/microservices', 'NestFactory');
132137
const applicationConfig = new application_config_1.ApplicationConfig();
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
export interface Resolver {
22
resolve(instance: any, basePath: string): any;
3+
registerNotFoundHandler(): any;
4+
registerExceptionHandler(): any;
35
}

bundle/core/router/routes-resolver.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ class RoutesResolver {
2626
path = path ? path + basePath : basePath;
2727
this.registerRouters(routes, moduleName, path, appInstance);
2828
});
29-
this.registerNotFoundHandler();
30-
this.registerExceptionHandler();
3129
}
3230
registerRouters(routes, moduleName, basePath, appInstance) {
3331
routes.forEach(({ instance, metatype }) => {

package.json

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
{
22
"name": "nestjs",
3-
"version": "5.3.0",
3+
"version": "5.3.2",
44
"description": "Modern, fast, powerful node.js web framework",
55
"scripts": {
66
"coverage": "nyc report --reporter=text-lcov | coveralls",
77
"precommit": "lint-staged",
8-
"test": "nyc --require ts-node/register mocha packages/**/*.spec.ts --reporter spec",
9-
"integration-test": "mocha integration/**/*.spec.ts --reporter spec --require ts-node/register",
10-
"lint": "tslint -p tsconfig.json -c tslint.json \"packages/**/*.ts\" -e \"*.spec.ts\"",
11-
"format": "prettier **/**/*.ts --ignore-path ./.prettierignore --write && git status",
8+
"test":
9+
"nyc --require ts-node/register mocha packages/**/*.spec.ts --reporter spec",
10+
"integration-test":
11+
"mocha integration/**/*.spec.ts --reporter spec --require ts-node/register",
12+
"lint":
13+
"tslint -p tsconfig.json -c tslint.json \"packages/**/*.ts\" -e \"*.spec.ts\"",
14+
"format":
15+
"prettier **/**/*.ts --ignore-path ./.prettierignore --write && git status",
1216
"build": "gulp build && gulp move",
1317
"build:lib": "gulp build --dist bundle",
1418
"postinstall": "opencollective",
@@ -17,10 +21,14 @@
1721
"prepare:rc": "npm run build:lib && npm run copy-docs",
1822
"prepare:next": "npm run build:lib && npm run copy-docs",
1923
"prepare:beta": "npm run build:lib && npm run copy-docs",
20-
"publish": "npm run prepare && ./node_modules/.bin/lerna publish --exact -m \"chore(@nestjs) publish %s release\"",
21-
"publish:rc": "npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=rc -m \"chore(@nestjs) publish %s release\"",
22-
"publish:next": "npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=next --skip-git -m \"chore(@nestjs) publish %s release\"",
23-
"publish:beta": "npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=beta -m \"chore(@nestjs) publish %s release\""
24+
"publish":
25+
"npm run prepare && ./node_modules/.bin/lerna publish --exact -m \"chore(@nestjs) publish %s release\"",
26+
"publish:rc":
27+
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=rc -m \"chore(@nestjs) publish %s release\"",
28+
"publish:next":
29+
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=next --skip-git -m \"chore(@nestjs) publish %s release\"",
30+
"publish:beta":
31+
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=beta -m \"chore(@nestjs) publish %s release\""
2432
},
2533
"engines": {
2634
"node": ">= 8.9.0"
@@ -128,9 +136,7 @@
128136
}
129137
},
130138
"nyc": {
131-
"include": [
132-
"packages/**/*.ts"
133-
],
139+
"include": ["packages/**/*.ts"],
134140
"exclude": [
135141
"node_modules/",
136142
"packages/**/*.spec.ts",
@@ -149,23 +155,13 @@
149155
"packages/common/serializer/**/*",
150156
"packages/common/services/logger.service.ts"
151157
],
152-
"extension": [
153-
".ts"
154-
],
155-
"require": [
156-
"ts-node/register"
157-
],
158-
"reporter": [
159-
"text-summary",
160-
"html"
161-
],
158+
"extension": [".ts"],
159+
"require": ["ts-node/register"],
160+
"reporter": ["text-summary", "html"],
162161
"sourceMap": true,
163162
"instrument": true
164163
},
165164
"lint-staged": {
166-
"packages/**/*.{ts,json}": [
167-
"npm run format",
168-
"git add"
169-
]
165+
"packages/**/*.{ts,json}": ["npm run format", "git add"]
170166
}
171167
}

packages/core/nest-application.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ export class NestApplication extends NestApplicationContext
148148
await this.registerModules();
149149
await this.registerRouter();
150150
await this.callInitHook();
151+
await this.registerRouterHooks();
151152
await this.callBootstrapHook();
152153

153154
this.isInitialized = true;
@@ -192,6 +193,11 @@ export class NestApplication extends NestApplicationContext
192193
this.routesResolver.resolve(this.httpAdapter, basePath);
193194
}
194195

196+
public async registerRouterHooks() {
197+
this.routesResolver.registerNotFoundHandler();
198+
this.routesResolver.registerExceptionHandler();
199+
}
200+
195201
public connectMicroservice(options: MicroserviceOptions): INestMicroservice {
196202
const { NestMicroservice } = loadPackage(
197203
'@nestjs/microservices',
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
export interface Resolver {
2-
resolve(instance, basePath: string);
2+
resolve(instance: any, basePath: string);
3+
registerNotFoundHandler();
4+
registerExceptionHandler();
35
}

packages/core/router/routes-resolver.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ export class RoutesResolver implements Resolver {
4545
path = path ? path + basePath : basePath;
4646
this.registerRouters(routes, moduleName, path, appInstance);
4747
});
48-
this.registerNotFoundHandler();
49-
this.registerExceptionHandler();
5048
}
5149

5250
public registerRouters(

0 commit comments

Comments
 (0)