@nestjs/core 10.3.3 → 10.3.5
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/Readme.md +6 -9
- package/hooks/on-app-shutdown.hook.d.ts +1 -0
- package/hooks/on-app-shutdown.hook.js +1 -0
- package/middleware/middleware-module.js +5 -1
- package/middleware/route-info-path-extractor.js +9 -2
- package/package.json +2 -2
- package/router/route-params-factory.js +2 -0
- package/router/router-execution-context.js +1 -0
package/Readme.md
CHANGED
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
|
|
26
26
|
Nest is a framework for building efficient, scalable <a href="https://nodejs.org" target="_blank">Node.js</a> server-side applications. It uses modern JavaScript, is built with <a href="https://www.typescriptlang.org" target="_blank">TypeScript</a> (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).
|
|
27
27
|
|
|
28
|
-
<p>Under the hood, Nest makes use of <a href="https://expressjs.com/" target="_blank">Express</a>, but also
|
|
28
|
+
<p>Under the hood, Nest makes use of <a href="https://expressjs.com/" target="_blank">Express</a>, but also provides compatibility with a wide range of other libraries, like <a href="https://github.com/fastify/fastify" target="_blank">Fastify</a>, allowing for easy use of the myriad of third-party plugins which are available.</p>
|
|
29
29
|
|
|
30
30
|
## Philosophy
|
|
31
31
|
|
|
32
|
-
<p>In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front and backend applications, giving rise to awesome projects like <a href="https://angular.io/" target="_blank">Angular</a>, <a href="https://github.com/facebook/react" target="_blank">React</a
|
|
33
|
-
<p>Nest aims to provide an application architecture out of the box which allows for effortless creation of highly testable, scalable, loosely coupled and easily maintainable applications. The architecture is heavily inspired by Angular.</p>
|
|
32
|
+
<p>In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front and backend applications, giving rise to awesome projects like <a href="https://angular.io/" target="_blank">Angular</a>, <a href="https://github.com/facebook/react" target="_blank">React</a>, and <a href="https://github.com/vuejs/vue" target="_blank">Vue</a>, which improve developer productivity and enable the construction of fast, testable, and extensible frontend applications. However, on the server-side, while there are a lot of superb libraries, helpers, and tools for Node, none of them effectively solve the main problem - the architecture.</p>
|
|
33
|
+
<p>Nest aims to provide an application architecture out of the box which allows for effortless creation of highly testable, scalable, and loosely coupled and easily maintainable applications. The architecture is heavily inspired by Angular.</p>
|
|
34
34
|
|
|
35
35
|
## Getting started
|
|
36
36
|
|
|
@@ -73,18 +73,16 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
73
73
|
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td>
|
|
74
74
|
<td>
|
|
75
75
|
<a href="https://nx.dev" target="_blank"><img src="https://nestjs.com/img/nx-logo.png" height="45" valign="middle" /></a></td>
|
|
76
|
-
<td>
|
|
77
|
-
<a href="https://weld.app/" target="_blank"><img src="https://nestjs.com/img/weld-logo.svg" width="140" valign="middle" /></a></td>
|
|
78
76
|
<td>
|
|
79
|
-
<a href="https://intrinsic.ventures/" target="_blank"><img src="https://nestjs.com/img/intrinisic-logo.png" width="210" valign="middle" /></a></td
|
|
77
|
+
<a href="https://intrinsic.ventures/" target="_blank"><img src="https://nestjs.com/img/intrinisic-logo.png" width="210" valign="middle" /></a></td>
|
|
80
78
|
<td>
|
|
81
|
-
<a href="https://jetbrains.com/" target="_blank"><img src="https://nestjs.com/img/jetbrains-logo.svg" width="90" valign="middle" /></a></td><td>
|
|
79
|
+
<a href="https://jetbrains.com/" target="_blank"><img src="https://nestjs.com/img/jetbrains-logo.svg" width="90" valign="middle" /></a></td></tr><tr><td>
|
|
82
80
|
<a href="https://snyk.co/nestjs" target="_blank"><img src="https://nestjs.com/img/snyk-logo-black.png" width="185" valign="middle" /></a></td><td>
|
|
83
81
|
<a href="https://fuseautotech.com/" target="_blank"><img src="https://nestjs.com/img/fuse-logo.svg" width="105" valign="middle" /></a></td>
|
|
84
82
|
<td>
|
|
85
83
|
<a href="https://ridicorp.com/career/" target="_blank"><img src="https://nestjs.com/img/ridi-logo.svg" width="105" valign="middle" /></a></td><td>
|
|
86
84
|
<a href="https://www.movavi.com/imovie-for-windows.html" target="_blank"><img src="https://nestjs.com/img/movavi-logo.svg" width="105" valign="middle" /></a></td>
|
|
87
|
-
|
|
85
|
+
<td>
|
|
88
86
|
<a href="https://skunk.team" target="_blank"><img src="https://nestjs.com/img/skunk-logo.png" height="60" valign="middle" /></a></td>
|
|
89
87
|
</tr></table>
|
|
90
88
|
|
|
@@ -93,7 +91,6 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
93
91
|
<table style="text-align:center;"><tr>
|
|
94
92
|
<td><a href="https://n.inc" target="_blank"><img src="https://nestjs.com/img/n-inc-logo.svg" width="120" valign="middle" /></td>
|
|
95
93
|
<td><a href="https://twistag.com/" target="_blank"><img src="https://nestjs.com/img/twistag-logo.png" width="120" valign="middle" /></td>
|
|
96
|
-
<td><a href="https://immediateedgeapp.org/" target="_blank"><img src="https://nestjs.com/img/immediate-edge-logo.png" width="120" valign="middle" /></td>
|
|
97
94
|
</tr>
|
|
98
95
|
</table>
|
|
99
96
|
|
|
@@ -27,6 +27,7 @@ function callOperator(instances, signal) {
|
|
|
27
27
|
* (providers / controllers).
|
|
28
28
|
*
|
|
29
29
|
* @param module The module which will be initialized
|
|
30
|
+
* @param signal
|
|
30
31
|
*/
|
|
31
32
|
async function callAppShutdownHook(module, signal) {
|
|
32
33
|
const providers = module.getNonAliasProviders();
|
|
@@ -167,7 +167,11 @@ class MiddlewareModule {
|
|
|
167
167
|
}
|
|
168
168
|
return next();
|
|
169
169
|
};
|
|
170
|
-
|
|
170
|
+
const pathsToApplyMiddleware = [];
|
|
171
|
+
paths.some(path => path.match(/^\/?$/))
|
|
172
|
+
? pathsToApplyMiddleware.push('/')
|
|
173
|
+
: pathsToApplyMiddleware.push(...paths);
|
|
174
|
+
pathsToApplyMiddleware.forEach(path => router(path, middlewareFunction));
|
|
171
175
|
}
|
|
172
176
|
getContextId(request, isTreeDurable) {
|
|
173
177
|
const contextId = context_id_factory_1.ContextIdFactory.getByRequest(request);
|
|
@@ -18,8 +18,15 @@ class RouteInfoPathExtractor {
|
|
|
18
18
|
const versionPaths = this.extractVersionPathFrom(version);
|
|
19
19
|
if (this.isAWildcard(path)) {
|
|
20
20
|
const entries = versionPaths.length > 0
|
|
21
|
-
? versionPaths
|
|
22
|
-
|
|
21
|
+
? versionPaths
|
|
22
|
+
.map(versionPath => [
|
|
23
|
+
this.prefixPath + versionPath + '$',
|
|
24
|
+
this.prefixPath + versionPath + (0, shared_utils_1.addLeadingSlash)(path),
|
|
25
|
+
])
|
|
26
|
+
.flat()
|
|
27
|
+
: this.prefixPath
|
|
28
|
+
? [this.prefixPath + '$', this.prefixPath + (0, shared_utils_1.addLeadingSlash)(path)]
|
|
29
|
+
: [(0, shared_utils_1.addLeadingSlash)(path)];
|
|
23
30
|
return Array.isArray(this.excludedGlobalPrefixRoutes)
|
|
24
31
|
? [
|
|
25
32
|
...entries,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/core",
|
|
3
|
-
"version": "10.3.
|
|
3
|
+
"version": "10.3.5",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@core)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"uid": "2.0.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@nestjs/common": "10.3.
|
|
39
|
+
"@nestjs/common": "10.3.5"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@nestjs/common": "^10.0.0",
|
|
@@ -13,6 +13,8 @@ class RouteParamsFactory {
|
|
|
13
13
|
return res;
|
|
14
14
|
case route_paramtypes_enum_1.RouteParamtypes.BODY:
|
|
15
15
|
return data && req.body ? req.body[data] : req.body;
|
|
16
|
+
case route_paramtypes_enum_1.RouteParamtypes.RAW_BODY:
|
|
17
|
+
return req.rawBody;
|
|
16
18
|
case route_paramtypes_enum_1.RouteParamtypes.PARAM:
|
|
17
19
|
return data ? req.params[data] : req.params;
|
|
18
20
|
case route_paramtypes_enum_1.RouteParamtypes.HOST:
|
|
@@ -123,6 +123,7 @@ class RouterExecutionContext {
|
|
|
123
123
|
}
|
|
124
124
|
isPipeable(type) {
|
|
125
125
|
return (type === route_paramtypes_enum_1.RouteParamtypes.BODY ||
|
|
126
|
+
type === route_paramtypes_enum_1.RouteParamtypes.RAW_BODY ||
|
|
126
127
|
type === route_paramtypes_enum_1.RouteParamtypes.QUERY ||
|
|
127
128
|
type === route_paramtypes_enum_1.RouteParamtypes.PARAM ||
|
|
128
129
|
type === route_paramtypes_enum_1.RouteParamtypes.FILE ||
|