@authuser/nest 0.2.0 → 0.2.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 +9 -1
- package/README.md +26 -17
- package/docs/migration.md +3 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,11 +5,19 @@ This project uses [Semantic Versioning](https://semver.org/).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.2.1] - 2026-09-03
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Let the example use conventional extensionless Nest imports through CommonJS.
|
|
13
|
+
- Document ESM and CommonJS consumption and require Node.js 22.12 or newer for
|
|
14
|
+
interoperable `require()` support.
|
|
15
|
+
|
|
8
16
|
## [0.2.0] - 2026-09-03
|
|
9
17
|
|
|
10
18
|
### Security
|
|
11
19
|
|
|
12
|
-
- Require
|
|
20
|
+
- Require Node.js 22 or newer.
|
|
13
21
|
- Add finite connection, request, handler and header timeouts.
|
|
14
22
|
- Redact sensitive authentication and cookie log fields by default.
|
|
15
23
|
- Validate unsafe CORS, invalid rate limits, route collisions and network limits.
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<p align="center">
|
|
7
7
|
<a href="https://www.npmjs.com/package/@authuser/nest"><img alt="npm" src="https://img.shields.io/npm/v/%40authuser%2Fnest?style=flat-square"></a>
|
|
8
8
|
<a href="https://www.npmjs.com/package/@authuser/nest"><img alt="downloads" src="https://img.shields.io/npm/dm/%40authuser%2Fnest?style=flat-square"></a>
|
|
9
|
-
<img alt="Node 22+" src="https://img.shields.io/badge/node-%3E%3D22-339933?style=flat-square&logo=node.js&logoColor=white">
|
|
9
|
+
<img alt="Node 22.12+" src="https://img.shields.io/badge/node-%3E%3D22.12-339933?style=flat-square&logo=node.js&logoColor=white">
|
|
10
10
|
<img alt="NestJS 12" src="https://img.shields.io/badge/NestJS-12-E0234E?style=flat-square&logo=nestjs&logoColor=white">
|
|
11
11
|
<img alt="Fastify 5" src="https://img.shields.io/badge/Fastify-5-black?style=flat-square&logo=fastify">
|
|
12
12
|
<a href="https://github.com/authuser-org/nest/blob/main/LICENSE"><img alt="MIT" src="https://img.shields.io/badge/license-MIT-green?style=flat-square"></a>
|
|
@@ -37,8 +37,8 @@ intact while removing repetitive bootstrap code.
|
|
|
37
37
|
|
|
38
38
|
## Requirements
|
|
39
39
|
|
|
40
|
-
- Node.js 22 or newer (Node.js 24 LTS recommended for production)
|
|
41
|
-
-
|
|
40
|
+
- Node.js 22.12 or newer (Node.js 24 LTS recommended for production)
|
|
41
|
+
- ESM and CommonJS applications are supported
|
|
42
42
|
|
|
43
43
|
## Install
|
|
44
44
|
|
|
@@ -56,21 +56,29 @@ validation and the Fastify plugins remain included.
|
|
|
56
56
|
```ts
|
|
57
57
|
// src/main.ts
|
|
58
58
|
import { createApp } from '@authuser/nest';
|
|
59
|
-
import { AppModule } from './app.module
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
59
|
+
import { AppModule } from './app.module';
|
|
60
|
+
|
|
61
|
+
async function bootstrap(): Promise<void> {
|
|
62
|
+
const app = await createApp({
|
|
63
|
+
rootModule: AppModule,
|
|
64
|
+
appName: 'users-api',
|
|
65
|
+
preset: 'secure',
|
|
66
|
+
apiPrefix: 'api',
|
|
67
|
+
observability: {
|
|
68
|
+
logger: { level: process.env.LOG_LEVEL ?? 'info' },
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
await app.listen({ port: 3000, host: '0.0.0.0' });
|
|
73
|
+
}
|
|
70
74
|
|
|
71
|
-
|
|
75
|
+
void bootstrap();
|
|
72
76
|
```
|
|
73
77
|
|
|
78
|
+
The example uses CommonJS so relative imports can use the conventional Nest style
|
|
79
|
+
without file extensions. Native Node ESM projects must include `.js` in relative
|
|
80
|
+
imports; this is a Node.js rule rather than a requirement from this package.
|
|
81
|
+
|
|
74
82
|
That application has Helmet, rate limiting, safe request IDs, strict validation,
|
|
75
83
|
a 1 MiB body limit, finite timeouts and graceful shutdown hooks. Cross-origin
|
|
76
84
|
requests are not enabled implicitly.
|
|
@@ -206,8 +214,9 @@ presets. See the [performance guide](https://github.com/authuser-org/nest/blob/m
|
|
|
206
214
|
+ import { createApp } from '@authuser/nest';
|
|
207
215
|
```
|
|
208
216
|
|
|
209
|
-
The new package targets Nest 12,
|
|
210
|
-
|
|
217
|
+
The new package targets Nest 12, publishes an ESM entry point consumable from Node.js
|
|
218
|
+
22.12+ ESM and CommonJS applications, calls Swagger configuration `openApi`, and ships
|
|
219
|
+
required integrations as normal dependencies. See the
|
|
211
220
|
[migration guide](https://github.com/authuser-org/nest/blob/main/docs/migration.md).
|
|
212
221
|
|
|
213
222
|
## Development
|
package/docs/migration.md
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Requirements
|
|
4
4
|
|
|
5
|
-
- Upgrade the service to Node 22 or newer; Node 24 LTS is recommended.
|
|
5
|
+
- Upgrade the service to Node 22.12 or newer; Node 24 LTS is recommended.
|
|
6
6
|
- Upgrade Nest packages to version 12.
|
|
7
|
-
-
|
|
7
|
+
- Choose ESM or CommonJS for the application. CommonJS permits extensionless relative
|
|
8
|
+
imports; native Node ESM requires `.js` on relative imports in NodeNext output.
|
|
8
9
|
|
|
9
10
|
## API changes
|
|
10
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authuser/nest",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Secure, high-performance NestJS foundation powered by Fastify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nestjs",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"sideEffects": false,
|
|
33
33
|
"engines": {
|
|
34
|
-
"node": ">=22"
|
|
34
|
+
"node": ">=22.12"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public",
|