You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript transformer plugin that automatically enhances type definitions with JSDoc comments and schema metadata.
3
+
A comprehensive toolset for generating and enhancing TypeScript documentation from Zod schemas. This package combines an Nx plugin for automated documentation generation with a TypeScript transformer that enriches type definitions with JSDoc comments.
4
4
5
-
## Purpose
5
+
## What's Included
6
6
7
-
This package provides a TypeScript compiler transformer that automatically adds JSDoc documentation to type aliases and interfaces during compilation. It's designed to improve developer experience by injecting helpful metadata and documentation links directly into generated type definitions.
7
+
This package provides two main components:
8
8
9
-
## How It Works
9
+
1.**[Nx Plugin](./docs/zod2md-jsdocs-nx-plugin.md)** - Automatically generates documentation targets for projects with Zod schemas
10
+
2.**[TypeScript Transformer](./docs/zod2md-jsdocs-ts-transformer.md)** - Enhances generated type definitions with JSDoc comments and schema metadata
10
11
11
-
The [TS transformer](https://github.com/itsdouges/typescript-transformer-handbook) hooks into the TypeScript compilation process using `ts-patch` and automatically adds JSDoc comments above type definitions. Each comment includes:
12
+
## Quick Start
12
13
13
-
- The type name
14
-
- A description explaining the type is derived from a Zod schema
|`transform`|`string`| Yes | Path to the transformer module |
70
-
|`afterDeclarations`|`boolean`| No | Set to `true` to run the transformer after TypeScript generates declaration files (`.d.ts`). This ensures JSDoc comments are added to the emitted type definitions. |
71
-
|`baseUrl`|`string`| Yes | Base URL for documentation links (e.g., `https://example.com/docs/api-reference.md`) |
47
+
[Learn more about the TypeScript Transformer →](./docs/zod2md-jsdocs-ts-transformer.md)
TypeScript transformer plugin that automatically enhances type definitions with JSDoc comments and schema metadata.
4
+
5
+
## Purpose
6
+
7
+
This package provides a TypeScript compiler transformer that automatically adds JSDoc documentation to type aliases and interfaces during compilation. It's designed to improve developer experience by injecting helpful metadata and documentation links directly into generated type definitions.
8
+
9
+
## How It Works
10
+
11
+
The [TS transformer](https://github.com/itsdouges/typescript-transformer-handbook) hooks into the TypeScript compilation process using `ts-patch` and automatically adds JSDoc comments above type definitions. Each comment includes:
12
+
13
+
- The type name
14
+
- A description explaining the type is derived from a Zod schema
15
+
- A link to the type reference documentation
16
+
17
+
## Example
18
+
19
+
Given a type definition like:
20
+
21
+
```typescript
22
+
exporttypeReport= {
23
+
// ... type properties
24
+
};
25
+
```
26
+
27
+
The transformer automatically generates:
28
+
29
+
```typescript
30
+
/**
31
+
* Type Definition: `Report`
32
+
*
33
+
* This type is derived from a Zod schema and represents
34
+
* the validated structure of `Report` used within the application.
|`transform`|`string`| Yes | Path to the transformer module |
70
+
|`afterDeclarations`|`boolean`| No | Set to `true` to run the transformer after TypeScript generates declaration files (`.d.ts`). This ensures JSDoc comments are added to the emitted type definitions. |
71
+
|`baseUrl`|`string`| Yes | Base URL for documentation links (e.g., `https://example.com/docs/api-reference.md`) |
0 commit comments