nestjs-docfy 0.2.6 → 0.2.7

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.
Files changed (2) hide show
  1. package/README.md +180 -175
  2. package/package.json +4 -1
package/README.md CHANGED
@@ -1,49 +1,68 @@
1
- # nestjs-docfy
1
+ <p align="center">
2
+ <a href="http://nestjs.com"><img alt="Nest Logo" src="https://nestjs.com/img/logo-small.svg" width="120"></a>
3
+ </p>
4
+
5
+ <h1 align="center">
6
+ nestjs-docfy
7
+ </h1>
8
+
9
+ [![NPM version](https://img.shields.io/npm/v/nestjs-docfy.svg)](https://www.npmjs.com/package/nestjs-docfy)
10
+ [![NPM downloads](https://img.shields.io/npm/dw/nestjs-docfy.svg)](https://www.npmjs.com/package/nestjs-docfy)
11
+ [![GitHub last commit](https://img.shields.io/github/last-commit/MarvinRF/nest-docfy)](https://github.com/MarvinRF/nest-docfy/commits/main)
12
+ [![GitHub issues](https://img.shields.io/github/issues/MarvinRF/nest-docfy.svg)](https://github.com/MarvinRF/nest-docfy/issues)
13
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/MarvinRF/nest-docfy/blob/main/LICENSE)
2
14
 
3
15
  Keep your NestJS controllers clean. Swagger documentation lives in a dedicated companion file — by naming convention, zero boilerplate.
4
16
 
5
- ## Before / After
17
+ ## Table of contents
18
+
19
+ - [Motivation](#motivation)
20
+ - [Installation](#installation)
21
+ - [Quick start](#quick-start)
22
+ - [1. Import DocfyModule](#1-import-docfymodule)
23
+ - [2. Mark your controllers](#2-mark-your-controllers)
24
+ - [3. Generate companion docs files](#3-generate-companion-docs-files)
25
+ - [4. Fill in the docs file](#4-fill-in-the-docs-file)
26
+ - [CLI — generate](#cli--generate)
27
+ - [Options](#options)
28
+ - [Project types](#project-types)
29
+ - [Idempotency and --force](#idempotency-and---force)
30
+ - [API reference](#api-reference)
31
+ - [DocfyModule.forRoot()](#docfymoduleforrootoptions)
32
+ - [@WithDocs()](#withdocs)
33
+ - [docs()](#docscontrollerclass-config)
34
+ - [Interface-typed DTOs](#interface-typed-dtos)
35
+ - [File naming convention](#file-naming-convention)
36
+ - [Testing](#testing)
37
+ - [How it works](#how-it-works)
38
+ - [License](#license)
39
+
40
+ ## Motivation
6
41
 
7
- **Before** — Swagger decorators buried in your controller:
42
+ Swagger decorators are documentation. They have nothing to do with routing logic, validation, or business rules — yet they end up mixed into the same file, doubling its length and burying the code that actually matters.
43
+
44
+ **Before** — Swagger decorators scattered across your controller:
8
45
 
9
46
  ```ts
10
47
  // users.controller.ts
11
- @ApiTags('users')
12
- @Controller('users')
48
+ @ApiTags("users")
49
+ @Controller("users")
13
50
  export class UsersController {
14
51
  @Get()
15
- @ApiOperation({ summary: 'List all users' })
16
- @ApiResponse({ status: 200, type: [UserEntity] })
52
+ @ApiOperation({ summary: "List all users" })
53
+ @ApiResponse({ status: 200, description: "OK", type: [UserEntity] })
17
54
  findAll(): Promise<UserEntity[]> {
18
55
  return this.usersService.findAll();
19
56
  }
20
57
 
21
- @Get(':id')
22
- @ApiOperation({ summary: 'Get a user by ID' })
23
- @ApiParam({ name: 'id', description: 'User UUID' })
24
- @ApiResponse({ status: 200, type: UserEntity })
25
- @ApiResponse({ status: 404, description: 'User not found' })
26
- findOne(@Param('id') id: string): Promise<UserEntity> {
27
- return this.usersService.findOne(id);
28
- }
29
-
30
58
  @Post()
31
- @ApiOperation({ summary: 'Create a user' })
59
+ @ApiOperation({ summary: "Create a user" })
32
60
  @ApiBody({ type: CreateUserDto })
33
- @ApiResponse({ status: 201, type: UserEntity })
34
- @ApiResponse({ status: 400, description: 'Invalid input' })
61
+ @ApiResponse({ status: 201, description: "Created", type: UserEntity })
62
+ @ApiResponse({ status: 400, description: "Bad Request" })
35
63
  create(@Body() dto: CreateUserDto): Promise<UserEntity> {
36
64
  return this.usersService.create(dto);
37
65
  }
38
-
39
- @Delete(':id')
40
- @ApiOperation({ summary: 'Delete a user' })
41
- @ApiParam({ name: 'id', description: 'User UUID' })
42
- @ApiResponse({ status: 204 })
43
- @ApiResponse({ status: 404, description: 'User not found' })
44
- remove(@Param('id') id: string): Promise<void> {
45
- return this.usersService.remove(id);
46
- }
47
66
  }
48
67
  ```
49
68
 
@@ -52,49 +71,37 @@ export class UsersController {
52
71
  ```ts
53
72
  // users.controller.ts
54
73
  @WithDocs()
55
- @Controller('users')
74
+ @Controller("users")
56
75
  export class UsersController {
57
76
  findAll(): Promise<UserEntity[]> {
58
77
  return this.usersService.findAll();
59
78
  }
60
79
 
61
- findOne(@Param('id') id: string): Promise<UserEntity> {
62
- return this.usersService.findOne(id);
63
- }
64
-
65
80
  create(@Body() dto: CreateUserDto): Promise<UserEntity> {
66
81
  return this.usersService.create(dto);
67
82
  }
68
-
69
- remove(@Param('id') id: string): Promise<void> {
70
- return this.usersService.remove(id);
71
- }
72
83
  }
73
84
  ```
74
85
 
75
86
  ```ts
76
87
  // users.controller.docs.ts — all documentation in one place
77
88
  docs(UsersController, {
78
- classDecorators: [ApiTags('users')],
89
+ classDecorators: [ApiTags("users")],
79
90
  methods: {
80
91
  findAll: [
81
- ApiOperation({ summary: 'List all users' }),
82
- ApiResponse({ status: 200, type: [UserEntity] }),
92
+ ApiOperation({ summary: "List all users" }),
93
+ ApiResponse({ status: 200, description: "OK", type: [UserEntity] }),
83
94
  ],
84
95
  create: [
85
- ApiOperation({ summary: 'Create a user' }),
96
+ ApiOperation({ summary: "Create a user" }),
86
97
  ApiBody({ type: CreateUserDto }),
87
- ApiResponse({ status: 201, type: UserEntity }),
88
- ApiResponse({ status: 400, description: 'Invalid input' }),
98
+ ApiResponse({ status: 201, description: "Created", type: UserEntity }),
99
+ ApiResponse({ status: 400, description: "Bad Request" }),
89
100
  ],
90
101
  },
91
102
  });
92
103
  ```
93
104
 
94
- ## Why
95
-
96
- Swagger decorators are documentation. They have nothing to do with routing logic, validation, or business rules — yet they end up mixed into the same file, doubling its length and burying the code that actually matters.
97
-
98
105
  `nestjs-docfy` enforces a clean boundary: controllers express behavior, docs files express documentation. The convention (`*.controller.docs.ts`) mirrors how NestJS already organizes specs (`*.controller.spec.ts`), so it feels natural from day one.
99
106
 
100
107
  ## Installation
@@ -103,46 +110,48 @@ Swagger decorators are documentation. They have nothing to do with routing logic
103
110
  npm install nestjs-docfy
104
111
  ```
105
112
 
106
- **Peer dependencies** (already in your project):
113
+ **Peer dependencies** (already present in any NestJS project):
107
114
 
108
115
  ```bash
109
116
  npm install @nestjs/common @nestjs/swagger reflect-metadata
110
117
  ```
111
118
 
112
- ## Setup
119
+ ## Quick start
113
120
 
114
- ### 1. Import `DocfyModule` in your root module
121
+ ### 1. Import DocfyModule
115
122
 
116
123
  ```ts
117
124
  // app.module.ts
118
- import { Module } from '@nestjs/common';
119
- import { DocfyModule } from 'nestjs-docfy';
120
- import { UsersModule } from './users/users.module';
125
+ import { Module } from "@nestjs/common";
126
+ import { DocfyModule } from "nestjs-docfy";
121
127
 
122
128
  @Module({
123
- imports: [
124
- DocfyModule.forRoot(),
125
- UsersModule,
126
- ],
129
+ imports: [DocfyModule.forRoot()],
127
130
  })
128
131
  export class AppModule {}
129
132
  ```
130
133
 
131
- ### 2. Mark your controllers with `@WithDocs()`
134
+ Pass `{ strict: true }` to fail fast at startup when a controller has `@WithDocs()` but no companion file is found — recommended for CI:
135
+
136
+ ```ts
137
+ DocfyModule.forRoot({ strict: true });
138
+ ```
139
+
140
+ ### 2. Mark your controllers
132
141
 
133
142
  ```ts
134
143
  // users.controller.ts
135
- import { Controller, Get, Post, Body, Param, Delete } from '@nestjs/common';
136
- import { WithDocs } from 'nestjs-docfy';
144
+ import { Controller, Get, Post, Body } from "@nestjs/common";
145
+ import { WithDocs } from "nestjs-docfy";
137
146
 
138
147
  @WithDocs()
139
- @Controller('users')
148
+ @Controller("users")
140
149
  export class UsersController {
141
- // ... your route handlers, nothing else
150
+ // route handlers only — no Swagger decorators here
142
151
  }
143
152
  ```
144
153
 
145
- ### 3. Generate the companion docs files
154
+ ### 3. Generate companion docs files
146
155
 
147
156
  Run the CLI to scan your project and generate a pre-filled `*.controller.docs.ts` for every controller:
148
157
 
@@ -150,72 +159,54 @@ Run the CLI to scan your project and generate a pre-filled `*.controller.docs.ts
150
159
  npx nestjs-docfy generate
151
160
  ```
152
161
 
153
- This produces files like:
162
+ The CLI uses **static analysis only** (no code execution) and auto-detects your project layout — monorepos, Nx workspaces, and Nest CLI monorepos are all supported.
163
+
164
+ To preview what would be written without touching the filesystem:
165
+
166
+ ```bash
167
+ npx nestjs-docfy generate --dry-run
168
+ ```
169
+
170
+ ### 4. Fill in the docs file
171
+
172
+ The generated file comes pre-populated with inferred summaries, response types, and common error responses:
154
173
 
155
174
  ```ts
156
- // users.controller.docs.ts (generated — fill in the arrays)
157
- import { docs } from 'nestjs-docfy';
158
- import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';
159
- import { UsersController } from './users.controller';
175
+ // Generated by nestjs-docfy — edit freely, use --force to merge new methods
176
+ import { docs } from "nestjs-docfy";
177
+ import { ApiTags, ApiOperation, ApiResponse, ApiBody } from "@nestjs/swagger";
178
+ import { UsersController } from "./users.controller";
179
+ import { CreateUserDto } from "./dto/create-user.dto";
180
+ import { UserEntity } from "./entities/user.entity";
160
181
 
161
182
  docs(UsersController, {
162
- classDecorators: [
163
- // ApiTags('users'),
164
- ],
183
+ classDecorators: [ApiTags("users")],
165
184
  methods: {
166
- // GET /users → async findAll(): Promise<UserEntity[]>
185
+ // GET / → async findAll(): Promise<UserEntity[]>
167
186
  findAll: [
168
- // ApiOperation({ summary: '' }),
169
- // ApiResponse({ status: 200, type: [UserEntity] }),
187
+ ApiOperation({ summary: "Find all" }),
188
+ ApiResponse({ status: 200, description: "OK", type: [UserEntity] }),
170
189
  ],
171
190
 
172
- // GET /:id → async findOne(id: string): Promise<UserEntity>
173
- findOne: [
174
- // ApiOperation({ summary: '' }),
175
- // ApiResponse({ status: 200, type: UserEntity }),
176
- // ApiResponse({ status: 404 }),
191
+ // POST / → async create(dto: CreateUserDto): Promise<UserEntity>
192
+ create: [
193
+ ApiOperation({ summary: "Create" }),
194
+ ApiBody({ type: CreateUserDto }),
195
+ ApiResponse({ status: 201, description: "Created", type: UserEntity }),
196
+ ApiResponse({ status: 400, description: "Bad Request" }),
177
197
  ],
178
198
  },
179
199
  });
180
200
  ```
181
201
 
182
- Or create the file manually following the same convention:
183
-
184
- ```text
185
- src/users/users.controller.ts ← your controller
186
- src/users/users.controller.docs.ts ← documentation goes here
187
- ```
188
-
189
- ### 4. Keep `main.ts` unchanged
190
-
191
- `DocfyModule` applies documentation metadata synchronously during module initialization, before `SwaggerModule.createDocument` is called. No changes to your bootstrap function are needed.
192
-
193
- ```ts
194
- // main.ts — nothing changes here
195
- async function bootstrap() {
196
- const app = await NestFactory.create(AppModule);
197
- const config = new DocumentBuilder().setTitle('My API').build();
198
- const document = SwaggerModule.createDocument(app, config);
199
- SwaggerModule.setup('api', app, document);
200
- await app.listen(3000);
201
- }
202
- ```
203
-
204
- ## CLI — `nestjs-docfy generate`
202
+ Edit the file freely — your changes are safe. Running `generate` again will skip existing files. Use `--force` to merge only **new** methods without touching existing ones.
205
203
 
206
- Scans your project for NestJS controllers using **static analysis only** (no code execution) and generates companion `*.controller.docs.ts` files with every method pre-filled and ready to annotate.
204
+ No changes to `main.ts` are needed. `DocfyModule` applies all metadata before `SwaggerModule.createDocument()` is called.
207
205
 
208
- ### Basic usage
206
+ ## CLI — generate
209
207
 
210
208
  ```bash
211
- # Auto-detect project type and generate all docs files
212
- npx nestjs-docfy generate
213
-
214
- # Preview what would be generated without writing anything
215
- npx nestjs-docfy generate --dry-run
216
-
217
- # Add new methods to existing docs files without touching decorated ones
218
- npx nestjs-docfy generate --force
209
+ npx nestjs-docfy generate [options]
219
210
  ```
220
211
 
221
212
  ### Options
@@ -231,58 +222,46 @@ npx nestjs-docfy generate --force
231
222
  | `--quiet` | `false` | Suppress all output except errors (CI-friendly) |
232
223
  | `--format` | `ts` | Output format: `ts` or `js` |
233
224
 
234
- ### Project types supported
225
+ ### Project types
235
226
 
236
227
  The CLI auto-detects your project layout — no configuration needed:
237
228
 
238
- | Layout | Detected when |
239
- | ----------------- | ------------------------------------------------------ |
240
- | Simple project | `tsconfig.json` at root, no monorepo markers |
241
- | NX Monorepo | `nx.json` present |
242
- | Nest CLI Monorepo | `nest-cli.json` with `"monorepo": true` |
243
- | Generic Monorepo | `packages/` or `apps/` with sub-`package.json` files |
229
+ | Layout | Detected when |
230
+ | ----------------- | ---------------------------------------------------- |
231
+ | Simple project | `tsconfig.json` at root, no monorepo markers |
232
+ | Nx monorepo | `nx.json` present |
233
+ | Nest CLI monorepo | `nest-cli.json` with `"monorepo": true` |
234
+ | Generic monorepo | `packages/` or `apps/` with sub-`package.json` files |
244
235
 
245
- ### Recommended script
236
+ ### Idempotency and --force
246
237
 
247
- Add to your `package.json`:
238
+ | Scenario | Behavior |
239
+ | ------------------------------------------ | -------------------------------------------------- |
240
+ | Run `generate` on a clean project | Creates all docs files |
241
+ | Run `generate` again (no changes) | Skips all existing files — safe to run repeatedly |
242
+ | Add a new endpoint, run `generate --force` | Merges new method block, preserves existing arrays |
243
+ | Edit a method's decorators, run `--force` | Your edits are preserved |
244
+
245
+ Add to your `package.json` for convenience:
248
246
 
249
247
  ```json
250
- "scripts": {
251
- "docs:generate": "nestjs-docfy generate"
248
+ {
249
+ "scripts": {
250
+ "docs:generate": "nestjs-docfy generate",
251
+ "docs:preview": "nestjs-docfy generate --dry-run"
252
+ }
252
253
  }
253
254
  ```
254
255
 
255
- Then run:
256
-
257
- ```bash
258
- npm run docs:generate
259
- ```
260
-
261
- ### Idempotency and `--force`
262
-
263
- Without `--force`: running `generate` twice is safe — existing docs files are skipped entirely.
264
-
265
- With `--force`: the CLI merges only **new** methods (methods added to the controller since the docs file was last generated). User-edited decorator arrays are preserved. This makes `--force` safe to run after adding endpoints.
266
-
267
256
  ## API reference
268
257
 
269
258
  ### `DocfyModule.forRoot(options?)`
270
259
 
271
260
  Registers the module and loads all companion docs files for controllers marked with `@WithDocs()`.
272
261
 
273
- | Option | Type | Default | Description |
274
- | -------- | --------- | ------- | ----------------------------------------------------------------------------------------------------------- |
275
- | `strict` | `boolean` | `false` | Throw at startup if a controller has `@WithDocs()` but no companion docs file is found. Recommended for CI. |
276
-
277
- ```ts
278
- // Warn on missing docs files (default)
279
- DocfyModule.forRoot()
280
-
281
- // Throw on missing docs files — fail fast in CI
282
- DocfyModule.forRoot({ strict: true })
283
- ```
284
-
285
- ---
262
+ | Option | Type | Default | Description |
263
+ | -------- | --------- | ------- | ---------------------------------------------------------------------------------------------- |
264
+ | `strict` | `boolean` | `false` | Throw at startup if a `@WithDocs()` controller has no companion docs file. Recommended for CI. |
286
265
 
287
266
  ### `@WithDocs()`
288
267
 
@@ -294,70 +273,96 @@ Class decorator that marks a controller for companion file discovery. Pair with
294
273
  export class ProductsController { ... }
295
274
  ```
296
275
 
297
- Also sets `DOCFY_MARKER` metadata (`'docfy:with_docs'`) on the class, available for external introspection:
276
+ Also sets `DOCFY_MARKER` metadata on the class, available for external introspection:
298
277
 
299
278
  ```ts
300
- import { DOCFY_MARKER } from 'nestjs-docfy';
279
+ import { DOCFY_MARKER } from "nestjs-docfy";
301
280
 
302
- const hasDocs = Reflect.getMetadata(DOCFY_MARKER, ProductsController) === true;
281
+ Reflect.getMetadata(DOCFY_MARKER, ProductsController); // true
303
282
  ```
304
283
 
305
- ---
306
-
307
284
  ### `docs(controllerClass, config)`
308
285
 
309
- Applies Swagger decorators to a controller class from outside its file.
310
- Call this at the top level of a `*.controller.docs.ts` file — it runs as a side effect on import.
286
+ Applies Swagger decorators to a controller class from outside its file. Call at the top level of a `*.controller.docs.ts` file — runs as a side effect on import.
311
287
 
312
- The function is fully type-safe: `config.methods` only accepts keys that exist on the controller class. Typos are caught at compile time.
288
+ Fully type-safe: `config.methods` only accepts keys that exist on the controller class. Typos are caught at compile time.
313
289
 
314
290
  ```ts
315
291
  docs(UsersController, {
316
292
  classDecorators: [ApiTags('users')],
317
293
  methods: {
318
- findAll: [...], // ✔ exists on UsersController
319
- typoMethod: [...] // ✖ TypeScript error
294
+ findAll: [...], // ✔ exists on UsersController
295
+ typoMethod: [...], // ✖ TypeScript error
320
296
  },
321
297
  });
322
298
  ```
323
299
 
324
- **`config.classDecorators`** — `ClassDecorator[]` — decorators applied to the class constructor (e.g. `ApiTags`).
300
+ **`config.classDecorators`** — `ClassDecorator[]` — applied to the class constructor (e.g. `ApiTags`, `ApiBearerAuth`).
301
+
302
+ **`config.methods`** — `Partial<Record<keyof T, MethodDecorator[]>>` — decorator arrays per method name, applied in order.
325
303
 
326
- **`config.methods`** — `Partial<Record<keyof T, MethodDecorator[]>>` — decorators per method name. Each decorator is called exactly as TypeScript would call it if it were written inline.
304
+ If a method key does not exist on the controller at runtime, a warning is logged and that entry is skipped — the rest of the docs file still applies.
327
305
 
328
- If a method name in `config.methods` does not exist on the controller at runtime, a warning is logged and that entry is skipped — the rest of the docs file still applies.
306
+ ## Interface-typed DTOs
307
+
308
+ When a response or body type is a TypeScript `interface` (not a class), Swagger cannot use it as a `type:` value because interfaces are erased at runtime. `nestjs-docfy` detects this automatically and generates an inline `schema:` object instead — **no changes to your code required**.
309
+
310
+ ```ts
311
+ // Your existing interface — no need to convert to a class
312
+ export interface RegisterResponseDto {
313
+ success: boolean;
314
+ message: string | null;
315
+ }
316
+ ```
317
+
318
+ Generated output:
319
+
320
+ ```ts
321
+ ApiResponse({
322
+ status: 201,
323
+ description: 'Created',
324
+ schema: {
325
+ type: 'object',
326
+ properties: {
327
+ success: { type: 'boolean' },
328
+ message: { type: 'string', nullable: true },
329
+ },
330
+ required: ['success'],
331
+ },
332
+ }),
333
+ ```
334
+
335
+ Supports: primitives, nullable unions (`T | null`), arrays, nested interfaces, and optional properties (excluded from `required`).
329
336
 
330
337
  ## File naming convention
331
338
 
332
- | Controller file | Companion docs file |
333
- | --------------------------------- | ---------------------------- |
334
- | `users.controller.ts` | `users.controller.docs.ts` |
335
- | `users.controller.js` (compiled) | `users.controller.docs.js` |
339
+ Discovery is automatic. `DocfyModule` locates each controller's source file via Node's module cache and resolves the companion path — this works identically in `ts-node` (development) and compiled `dist/` (production).
336
340
 
337
- Discovery is automatic. `DocfyModule` locates each controller's source file via Node's module cache (`require.cache`) and resolves the companion path. This works identically in both `ts-node` (development) and compiled `dist/` (production).
341
+ | Controller file | Companion docs file |
342
+ | --------------------- | -------------------------- |
343
+ | `users.controller.ts` | `users.controller.docs.ts` |
344
+ | `users.controller.js` | `users.controller.docs.js` |
338
345
 
339
- > **Barrel re-exports**: if your controller is exported from an `index.ts` barrel in addition to its own file, `nestjs-docfy` prefers the `.controller.ts` file over the barrel. Make sure the class is exported directly from its own module file.
346
+ > **Barrel re-exports**: if your controller is also exported from an `index.ts` barrel, make sure the class is exported directly from its own module file. `nestjs-docfy` prefers `.controller.ts` over barrel files.
340
347
 
341
348
  ## Testing
342
349
 
343
- When testing application modules that import `DocfyModule`, reset the controller registry between test suites to avoid cross-contamination:
350
+ Reset the controller registry between test suites to avoid cross-contamination:
344
351
 
345
352
  ```ts
346
- import { resetDocfyRegistry } from 'nestjs-docfy/testing';
353
+ import { resetDocfyRegistry } from "nestjs-docfy/testing";
347
354
 
348
355
  beforeEach(() => resetDocfyRegistry());
349
356
  ```
350
357
 
351
358
  ## How it works
352
359
 
353
- NestJS calls `NestFactory.create()` to build the dependency graph and module instances, then calls `app.listen()` — which internally calls `app.init()` — to register routes and fire lifecycle hooks. `SwaggerModule.createDocument()` is called between these two steps, in `main.ts`.
354
-
355
- `DocfyModule.forRoot()` runs synchronously during the `NestFactory.create()` phase (as the module graph is evaluated), which is *before* `SwaggerModule.createDocument()`. At that point, it uses `require()` to load each docs file, which calls `docs()` and writes `Reflect` metadata directly onto the controller methods — exactly as TypeScript decorator syntax would at class-definition time.
360
+ `DocfyModule.forRoot()` runs synchronously during the `NestFactory.create()` phase — before `SwaggerModule.createDocument()` is called. It uses `require()` to load each companion docs file, which executes `docs()` and writes `Reflect` metadata directly onto the controller methods, exactly as TypeScript decorator syntax would at class-definition time.
356
361
 
357
- By the time `SwaggerModule.createDocument()` scans for metadata, all of it is already in place.
362
+ By the time `SwaggerModule.createDocument()` scans for metadata, all of it is already in place. No monkey-patching, no runtime proxies.
358
363
 
359
- The `generate` CLI uses **static analysis only** (`ts-morph`) — it reads TypeScript AST without executing any project code. All user-supplied paths and values are validated and sanitised before use.
364
+ The `generate` CLI uses `ts-morph` for static analysis — it reads the TypeScript AST without executing any project code. All user-supplied paths and glob patterns are validated and sanitised before use.
360
365
 
361
366
  ## License
362
367
 
363
- MIT
368
+ [MIT](https://github.com/MarvinRF/nest-docfy/blob/main/LICENSE) © Marvin Rocha
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nestjs-docfy",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Keep your NestJS controllers clean — Swagger docs live in a separate companion file by naming convention",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -86,5 +86,8 @@
86
86
  "commander": "^15.0.0",
87
87
  "picocolors": "^1.1.1",
88
88
  "ts-morph": "^28.0.0"
89
+ },
90
+ "overrides": {
91
+ "swagger-ui-dist": "5.17.14"
89
92
  }
90
93
  }