@hexaijs/plugin-application-builder 0.1.0
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/LICENSE +21 -0
- package/README.md +278 -0
- package/dist/application-builder-generator.d.ts +15 -0
- package/dist/application-builder-generator.d.ts.map +1 -0
- package/dist/application-builder-generator.js +81 -0
- package/dist/application-builder-generator.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +61 -0
- package/dist/cli.js.map +1 -0
- package/dist/code-generator.d.ts +30 -0
- package/dist/code-generator.d.ts.map +1 -0
- package/dist/code-generator.js +131 -0
- package/dist/code-generator.js.map +1 -0
- package/dist/config-loader.d.ts +3 -0
- package/dist/config-loader.d.ts.map +1 -0
- package/dist/config-loader.js +65 -0
- package/dist/config-loader.js.map +1 -0
- package/dist/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +31 -0
- package/dist/config.js.map +1 -0
- package/dist/decorators/index.d.ts +26 -0
- package/dist/decorators/index.d.ts.map +1 -0
- package/dist/decorators/index.js +37 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +32 -0
- package/dist/errors.js.map +1 -0
- package/dist/hexai-plugin.d.ts +30 -0
- package/dist/hexai-plugin.d.ts.map +1 -0
- package/dist/hexai-plugin.js +81 -0
- package/dist/hexai-plugin.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +6 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +53 -0
- package/dist/main.js.map +1 -0
- package/dist/metadata-extractor.d.ts +25 -0
- package/dist/metadata-extractor.d.ts.map +1 -0
- package/dist/metadata-extractor.js +247 -0
- package/dist/metadata-extractor.js.map +1 -0
- package/dist/test.d.ts +15 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +104 -0
- package/dist/test.js.map +1 -0
- package/dist/types.d.ts +22 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Sangwoo Hyun
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# @hexaijs/plugin-application-builder
|
|
2
|
+
|
|
3
|
+
> Build plugin for generating ApplicationBuilder code from decorated handlers
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`@hexaijs/plugin-application-builder` eliminates the boilerplate of manually registering every handler with `ApplicationBuilder`. Instead of maintaining a growing list of `.withCommandHandler()` and `.withEventHandler()` calls, you decorate your handler classes and let the build tool generate the registration code automatically.
|
|
8
|
+
|
|
9
|
+
The plugin works at build time by:
|
|
10
|
+
|
|
11
|
+
1. Scanning your TypeScript files for handler classes decorated with marker decorators
|
|
12
|
+
2. Extracting metadata using TypeScript's AST (Abstract Syntax Tree) parser
|
|
13
|
+
3. Generating a `createApplicationBuilder()` function with all handlers properly registered
|
|
14
|
+
|
|
15
|
+
This approach keeps your handler files self-documenting (the decorator shows what type of handler it is) while centralizing the wiring in a generated file that stays in sync automatically.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @hexaijs/plugin-application-builder
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Peer dependencies:**
|
|
24
|
+
- `@hexaijs/core`
|
|
25
|
+
- `@hexaijs/application`
|
|
26
|
+
- `typescript ^5.0.0`
|
|
27
|
+
|
|
28
|
+
## Core Concepts
|
|
29
|
+
|
|
30
|
+
### Marker Decorators
|
|
31
|
+
|
|
32
|
+
The package provides three decorators that serve as markers for the code generator. These decorators have **no runtime behavior** - they simply tag classes for discovery during the build process.
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import {
|
|
36
|
+
CommandHandlerMarker,
|
|
37
|
+
QueryHandlerMarker,
|
|
38
|
+
EventHandlerMarker
|
|
39
|
+
} from "@hexaijs/plugin-application-builder";
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**CommandHandlerMarker** - Marks a class as a command handler and links it to its request type:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { CommandHandlerMarker } from "@hexaijs/plugin-application-builder";
|
|
46
|
+
import { CreateOrderRequest } from "./request";
|
|
47
|
+
|
|
48
|
+
@CommandHandlerMarker(CreateOrderRequest)
|
|
49
|
+
export class CreateOrderHandler extends BaseHandler<
|
|
50
|
+
CreateOrderRequest,
|
|
51
|
+
CreateOrderResponse,
|
|
52
|
+
OrderApplicationContext
|
|
53
|
+
> {
|
|
54
|
+
protected async doExecute(
|
|
55
|
+
request: CreateOrderRequest,
|
|
56
|
+
ctx: OrderApplicationContext
|
|
57
|
+
): Promise<CreateOrderResponse> {
|
|
58
|
+
// Implementation
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**QueryHandlerMarker** - Marks a class as a query handler:
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
import { QueryHandlerMarker } from "@hexaijs/plugin-application-builder";
|
|
67
|
+
import { GetOrderQuery } from "./query";
|
|
68
|
+
|
|
69
|
+
@QueryHandlerMarker(GetOrderQuery)
|
|
70
|
+
export class GetOrderHandler extends BaseHandler<
|
|
71
|
+
GetOrderQuery,
|
|
72
|
+
OrderDto,
|
|
73
|
+
OrderApplicationContext
|
|
74
|
+
> {
|
|
75
|
+
protected async doExecute(
|
|
76
|
+
query: GetOrderQuery,
|
|
77
|
+
ctx: OrderApplicationContext
|
|
78
|
+
): Promise<OrderDto> {
|
|
79
|
+
// Implementation
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**EventHandlerMarker** - Marks a class as an event handler:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
import { Message } from "@hexaijs/core";
|
|
88
|
+
import { EventHandlerMarker } from "@hexaijs/plugin-application-builder";
|
|
89
|
+
|
|
90
|
+
@EventHandlerMarker()
|
|
91
|
+
export class HandleOrderPlaced extends BaseEventHandler<OrderApplicationContext> {
|
|
92
|
+
canHandle(message: Message): message is OrderPlaced {
|
|
93
|
+
return message.getMessageType() === OrderPlaced.getType();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async handle(
|
|
97
|
+
event: OrderPlaced,
|
|
98
|
+
ctx: OrderApplicationContext
|
|
99
|
+
): Promise<void> {
|
|
100
|
+
const payload = event.getPayload();
|
|
101
|
+
// React to event
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
For event handlers that need a unique identifier (useful for idempotency tracking), provide a `name` option:
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
@EventHandlerMarker({ name: "send-order-confirmation" })
|
|
110
|
+
export class SendOrderConfirmationEmail extends BaseEventHandler<OrderApplicationContext> {
|
|
111
|
+
// ...
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Configuration
|
|
116
|
+
|
|
117
|
+
Create an `application.config.ts` file in your package root:
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import { RawBuildPluginConfig } from "@hexaijs/plugin-application-builder";
|
|
121
|
+
|
|
122
|
+
const config: RawBuildPluginConfig = {
|
|
123
|
+
// Glob patterns to find handler files
|
|
124
|
+
handlers: [
|
|
125
|
+
"src/commands/**/*.ts",
|
|
126
|
+
"src/queries/**/*.ts",
|
|
127
|
+
"src/event-handlers/**/*.ts"
|
|
128
|
+
],
|
|
129
|
+
|
|
130
|
+
// Import path for ApplicationBuilder in generated code
|
|
131
|
+
applicationBuilderImportPath: "@/application-builder",
|
|
132
|
+
|
|
133
|
+
// Output file path (optional, defaults to "src/.generated/application-builder.ts")
|
|
134
|
+
outputFile: "src/.generated/application-builder.ts"
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export default config;
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
| Option | Required | Default | Description |
|
|
141
|
+
|--------|----------|---------|-------------|
|
|
142
|
+
| `handlers` | Yes | - | Glob patterns for files containing decorated handlers |
|
|
143
|
+
| `applicationBuilderImportPath` | Yes | - | Import path for your `ApplicationBuilder` class |
|
|
144
|
+
| `outputFile` | No | `src/.generated/application-builder.ts` | Where to write the generated code |
|
|
145
|
+
|
|
146
|
+
### Code Generation
|
|
147
|
+
|
|
148
|
+
Run the generator using the CLI:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npx generate-app-builder
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Or specify a custom path:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
npx generate-app-builder --context-path ./packages/my-bounded-context
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The generator produces a file like:
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
// src/.generated/application-builder.ts (auto-generated)
|
|
164
|
+
import { ApplicationBuilder } from '@/application-builder';
|
|
165
|
+
import { CreateOrderHandler } from '../commands/create-order/handler';
|
|
166
|
+
import { CreateOrderRequest } from '../commands/create-order/request';
|
|
167
|
+
import { GetOrderHandler } from '../queries/get-order/handler';
|
|
168
|
+
import { GetOrderQuery } from '../queries/get-order/query';
|
|
169
|
+
import { HandleOrderPlaced } from '../event-handlers/handle-order-placed';
|
|
170
|
+
|
|
171
|
+
export function createApplicationBuilder(): ApplicationBuilder {
|
|
172
|
+
return new ApplicationBuilder()
|
|
173
|
+
.withCommandHandler(CreateOrderRequest, () => new CreateOrderHandler())
|
|
174
|
+
.withQueryHandler(GetOrderQuery, () => new GetOrderHandler())
|
|
175
|
+
.withEventHandler(() => new HandleOrderPlaced());
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Programmatic API
|
|
180
|
+
|
|
181
|
+
For custom build scripts, use the `generateApplicationBuilder` function:
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
import { generateApplicationBuilder } from "@hexaijs/plugin-application-builder";
|
|
185
|
+
|
|
186
|
+
await generateApplicationBuilder("./packages/order", {
|
|
187
|
+
configFile: "application.config.ts" // optional
|
|
188
|
+
});
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Usage
|
|
192
|
+
|
|
193
|
+
### Integrating into Your Build
|
|
194
|
+
|
|
195
|
+
Add the generator to your build scripts:
|
|
196
|
+
|
|
197
|
+
```json
|
|
198
|
+
{
|
|
199
|
+
"scripts": {
|
|
200
|
+
"prebuild": "generate-app-builder",
|
|
201
|
+
"build": "tsc"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
This ensures the generated file is always up-to-date before compilation.
|
|
207
|
+
|
|
208
|
+
### Using the Generated Builder
|
|
209
|
+
|
|
210
|
+
Import and use the generated function in your application setup:
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
import { createApplicationBuilder } from "./.generated/application-builder";
|
|
214
|
+
|
|
215
|
+
// The generated builder has all handlers registered
|
|
216
|
+
const builder = createApplicationBuilder();
|
|
217
|
+
|
|
218
|
+
// Add your application context and build
|
|
219
|
+
const application = builder
|
|
220
|
+
.withApplicationContext(new OrderApplicationContext())
|
|
221
|
+
.build();
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Path Alias Support
|
|
225
|
+
|
|
226
|
+
The generator respects TypeScript path aliases defined in your `tsconfig.json`:
|
|
227
|
+
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"compilerOptions": {
|
|
231
|
+
"baseUrl": ".",
|
|
232
|
+
"paths": {
|
|
233
|
+
"@/*": ["src/*"]
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
When handlers import request classes using aliases (e.g., `import { CreateOrderRequest } from "@/commands/create-order/request"`), the generator correctly resolves these paths.
|
|
240
|
+
|
|
241
|
+
## Error Handling
|
|
242
|
+
|
|
243
|
+
The generator validates your configuration and throws descriptive errors:
|
|
244
|
+
|
|
245
|
+
**DuplicateCommandHandlerError** - Thrown when multiple handlers are registered for the same command:
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
Duplicate command handlers for "CreateOrderRequest": CreateOrderHandler, AnotherCreateOrderHandler
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**DuplicateQueryHandlerError** - Thrown when multiple handlers are registered for the same query.
|
|
252
|
+
|
|
253
|
+
**DuplicateEventHandlerError** - Thrown when multiple event handlers share the same `name` option.
|
|
254
|
+
|
|
255
|
+
**MessageClassNotFoundError** - Thrown when a decorator references a class that cannot be found:
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
Cannot find "CreateOrderRequest" - not imported and not defined in "src/commands/create-order/handler.ts"
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## API Highlights
|
|
262
|
+
|
|
263
|
+
| Export | Description |
|
|
264
|
+
|--------|-------------|
|
|
265
|
+
| `generateApplicationBuilder(path, options?)` | Programmatic API to run code generation |
|
|
266
|
+
| `CommandHandlerMarker` | Decorator to mark command handlers |
|
|
267
|
+
| `QueryHandlerMarker` | Decorator to mark query handlers |
|
|
268
|
+
| `EventHandlerMarker` | Decorator to mark event handlers |
|
|
269
|
+
| `EventHandlerOptions` | Type for event handler decorator options |
|
|
270
|
+
| `DuplicateCommandHandlerError` | Error for duplicate command handler registration |
|
|
271
|
+
| `DuplicateQueryHandlerError` | Error for duplicate query handler registration |
|
|
272
|
+
| `DuplicateEventHandlerError` | Error for duplicate event handler registration |
|
|
273
|
+
| `HandlerMetadataExtractor` | Class for extracting handler metadata from TypeScript files |
|
|
274
|
+
|
|
275
|
+
## See Also
|
|
276
|
+
|
|
277
|
+
- [@hexaijs/application](../application/README.md) - The ApplicationBuilder this plugin generates code for
|
|
278
|
+
- [@hexaijs/core](../core/README.md) - Core domain primitives used by handlers
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BuildPluginConfig } from "./config";
|
|
2
|
+
/**
|
|
3
|
+
* Orchestrates the application builder generation process
|
|
4
|
+
*/
|
|
5
|
+
export declare class ApplicationBuilderGenerator {
|
|
6
|
+
private contextPath;
|
|
7
|
+
private config;
|
|
8
|
+
private metadataExtractor;
|
|
9
|
+
private codeGenerator;
|
|
10
|
+
constructor(contextPath: string, config: BuildPluginConfig);
|
|
11
|
+
generate(): Promise<void>;
|
|
12
|
+
private scanHandlerFiles;
|
|
13
|
+
private writeToFile;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=application-builder-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application-builder-generator.d.ts","sourceRoot":"","sources":["../src/application-builder-generator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAI7C;;GAEG;AACH,qBAAa,2BAA2B;IAKhC,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,MAAM;IALlB,OAAO,CAAC,iBAAiB,CAA2B;IACpD,OAAO,CAAC,aAAa,CAA2B;gBAGpC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,iBAAiB;IAS/B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;YAOjB,gBAAgB;IAc9B,OAAO,CAAC,WAAW;CAOtB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ApplicationBuilderGenerator = void 0;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const glob_1 = require("glob");
|
|
40
|
+
const metadata_extractor_1 = require("./metadata-extractor");
|
|
41
|
+
const code_generator_1 = require("./code-generator");
|
|
42
|
+
/**
|
|
43
|
+
* Orchestrates the application builder generation process
|
|
44
|
+
*/
|
|
45
|
+
class ApplicationBuilderGenerator {
|
|
46
|
+
contextPath;
|
|
47
|
+
config;
|
|
48
|
+
metadataExtractor;
|
|
49
|
+
codeGenerator;
|
|
50
|
+
constructor(contextPath, config) {
|
|
51
|
+
this.contextPath = contextPath;
|
|
52
|
+
this.config = config;
|
|
53
|
+
this.metadataExtractor = new metadata_extractor_1.HandlerMetadataExtractor(contextPath, config.outputFile);
|
|
54
|
+
this.codeGenerator = new code_generator_1.ApplicationCodeGenerator(config);
|
|
55
|
+
}
|
|
56
|
+
async generate() {
|
|
57
|
+
const handlerFiles = await this.scanHandlerFiles();
|
|
58
|
+
const handlers = this.metadataExtractor.extractHandlersMetadata(handlerFiles);
|
|
59
|
+
const code = this.codeGenerator.generateCode(handlers);
|
|
60
|
+
this.writeToFile(code);
|
|
61
|
+
}
|
|
62
|
+
async scanHandlerFiles() {
|
|
63
|
+
const allFiles = [];
|
|
64
|
+
for (const pattern of this.config.handlers) {
|
|
65
|
+
const files = await (0, glob_1.glob)(pattern, {
|
|
66
|
+
cwd: this.contextPath,
|
|
67
|
+
absolute: true,
|
|
68
|
+
});
|
|
69
|
+
allFiles.push(...files);
|
|
70
|
+
}
|
|
71
|
+
return allFiles.sort();
|
|
72
|
+
}
|
|
73
|
+
writeToFile(code) {
|
|
74
|
+
const outputFile = path.join(this.contextPath, this.config.outputFile);
|
|
75
|
+
const outputDir = path.dirname(outputFile);
|
|
76
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
77
|
+
fs.writeFileSync(outputFile, code, "utf-8");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.ApplicationBuilderGenerator = ApplicationBuilderGenerator;
|
|
81
|
+
//# sourceMappingURL=application-builder-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application-builder-generator.js","sourceRoot":"","sources":["../src/application-builder-generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,+BAA4B;AAE5B,6DAAgE;AAChE,qDAA4D;AAE5D;;GAEG;AACH,MAAa,2BAA2B;IAKxB;IACA;IALJ,iBAAiB,CAA2B;IAC5C,aAAa,CAA2B;IAEhD,YACY,WAAmB,EACnB,MAAyB;QADzB,gBAAW,GAAX,WAAW,CAAQ;QACnB,WAAM,GAAN,MAAM,CAAmB;QAEjC,IAAI,CAAC,iBAAiB,GAAG,IAAI,6CAAwB,CACjD,WAAW,EACX,MAAM,CAAC,UAAU,CACpB,CAAC;QACF,IAAI,CAAC,aAAa,GAAG,IAAI,yCAAwB,CAAC,MAAM,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,QAAQ;QACV,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,gBAAgB,EA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env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const index_1 = require("./index");
|
|
39
|
+
async function main() {
|
|
40
|
+
const args = process.argv.slice(2);
|
|
41
|
+
// Support --context-path or default to cwd
|
|
42
|
+
let contextPath = process.cwd();
|
|
43
|
+
const contextPathIndex = args.indexOf("--context-path");
|
|
44
|
+
if (contextPathIndex !== -1 && args[contextPathIndex + 1]) {
|
|
45
|
+
contextPath = path.resolve(args[contextPathIndex + 1]);
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
console.log(`Generating application builder for: ${contextPath}`);
|
|
49
|
+
await (0, index_1.generateApplicationBuilder)(contextPath);
|
|
50
|
+
console.log("✓ Application builder generated successfully");
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
console.error("Error generating application builder:", error);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
main().catch((error) => {
|
|
58
|
+
console.error("Unexpected error:", error);
|
|
59
|
+
process.exit(1);
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA6B;AAC7B,mCAAqD;AAErD,KAAK,UAAU,IAAI;IACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEnC,2CAA2C;IAC3C,IAAI,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAEhC,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACxD,IAAI,gBAAgB,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,EAAE,CAAC;QACxD,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,uCAAuC,WAAW,EAAE,CAAC,CAAC;QAClE,MAAM,IAAA,kCAA0B,EAAC,WAAW,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;IAChE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;QAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;IAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BuildPluginConfig } from "./config";
|
|
2
|
+
import { HandlerMetadata } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Generates TypeScript code for ApplicationBuilder
|
|
5
|
+
*/
|
|
6
|
+
export declare class ApplicationCodeGenerator {
|
|
7
|
+
private config;
|
|
8
|
+
constructor(config: BuildPluginConfig);
|
|
9
|
+
generateCode(handlers: HandlerMetadata[]): string;
|
|
10
|
+
private validateNoDuplicates;
|
|
11
|
+
private validateNoDuplicateHandlers;
|
|
12
|
+
private validateNoDuplicateCommandHandlers;
|
|
13
|
+
private validateNoDuplicateEventHandlers;
|
|
14
|
+
private validateNoDuplicateQueryHandlers;
|
|
15
|
+
private createImportStatement;
|
|
16
|
+
private createCommandHandlerRegistration;
|
|
17
|
+
private createEventHandlerRegistration;
|
|
18
|
+
private createQueryHandlerRegistration;
|
|
19
|
+
private isCommandHandler;
|
|
20
|
+
private isEventHandler;
|
|
21
|
+
private isQueryHandler;
|
|
22
|
+
private collectImports;
|
|
23
|
+
private generateRegistrations;
|
|
24
|
+
private generateCommandRegistrations;
|
|
25
|
+
private generateQueryRegistrations;
|
|
26
|
+
private generateEventRegistrations;
|
|
27
|
+
private validateEventHandlerOptions;
|
|
28
|
+
private assembleGeneratedCode;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=code-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-generator.d.ts","sourceRoot":"","sources":["../src/code-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAM7C,OAAO,EACH,eAAe,EAIlB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,qBAAa,wBAAwB;IACrB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,iBAAiB;IAE7C,YAAY,CAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,MAAM;IAOjD,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,2BAA2B;IAuBnC,OAAO,CAAC,kCAAkC;IAW1C,OAAO,CAAC,gCAAgC;IAmBxC,OAAO,CAAC,gCAAgC;IAWxC,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,gCAAgC;IAOxC,OAAO,CAAC,8BAA8B;IAQtC,OAAO,CAAC,8BAA8B;IAOtC,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,cAAc;IAuCtB,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,4BAA4B;IAepC,OAAO,CAAC,0BAA0B;IAelC,OAAO,CAAC,0BAA0B;IAalC,OAAO,CAAC,2BAA2B;IAcnC,OAAO,CAAC,qBAAqB;CAehC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApplicationCodeGenerator = void 0;
|
|
4
|
+
const errors_1 = require("./errors");
|
|
5
|
+
/**
|
|
6
|
+
* Generates TypeScript code for ApplicationBuilder
|
|
7
|
+
*/
|
|
8
|
+
class ApplicationCodeGenerator {
|
|
9
|
+
config;
|
|
10
|
+
constructor(config) {
|
|
11
|
+
this.config = config;
|
|
12
|
+
}
|
|
13
|
+
generateCode(handlers) {
|
|
14
|
+
this.validateNoDuplicates(handlers);
|
|
15
|
+
const imports = this.collectImports(handlers);
|
|
16
|
+
const registrations = this.generateRegistrations(handlers);
|
|
17
|
+
return this.assembleGeneratedCode(imports, registrations);
|
|
18
|
+
}
|
|
19
|
+
validateNoDuplicates(handlers) {
|
|
20
|
+
this.validateNoDuplicateCommandHandlers(handlers);
|
|
21
|
+
this.validateNoDuplicateEventHandlers(handlers);
|
|
22
|
+
this.validateNoDuplicateQueryHandlers(handlers);
|
|
23
|
+
}
|
|
24
|
+
validateNoDuplicateHandlers(handlers, typeFilter, keyExtractor, errorFactory) {
|
|
25
|
+
const filteredHandlers = handlers.filter(typeFilter);
|
|
26
|
+
const keyToHandlers = new Map();
|
|
27
|
+
for (const handler of filteredHandlers) {
|
|
28
|
+
const key = keyExtractor(handler);
|
|
29
|
+
const existing = keyToHandlers.get(key) ?? [];
|
|
30
|
+
existing.push(handler.handlerClassName);
|
|
31
|
+
keyToHandlers.set(key, existing);
|
|
32
|
+
}
|
|
33
|
+
for (const [key, handlerList] of keyToHandlers) {
|
|
34
|
+
if (handlerList.length > 1) {
|
|
35
|
+
throw errorFactory(key, handlerList);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
validateNoDuplicateCommandHandlers(handlers) {
|
|
40
|
+
this.validateNoDuplicateHandlers(handlers, (h) => h.type === "command", (h) => h.commandClassName, (key, handlers) => new errors_1.DuplicateCommandHandlerError(key, handlers));
|
|
41
|
+
}
|
|
42
|
+
validateNoDuplicateEventHandlers(handlers) {
|
|
43
|
+
const eventHandlers = handlers.filter((h) => h.type === "event");
|
|
44
|
+
const namedEventHandlers = eventHandlers.filter((h) => h.eventHandlerOptions.name !== undefined);
|
|
45
|
+
this.validateNoDuplicateHandlers(namedEventHandlers, (h) => true, (h) => h.eventHandlerOptions.name, (key, handlers) => new errors_1.DuplicateEventHandlerError(key, handlers));
|
|
46
|
+
}
|
|
47
|
+
validateNoDuplicateQueryHandlers(handlers) {
|
|
48
|
+
this.validateNoDuplicateHandlers(handlers, (h) => h.type === "query", (h) => h.queryClassName, (key, handlers) => new errors_1.DuplicateQueryHandlerError(key, handlers));
|
|
49
|
+
}
|
|
50
|
+
createImportStatement(symbolName, importPath) {
|
|
51
|
+
return `import { ${symbolName} } from '${importPath}';`;
|
|
52
|
+
}
|
|
53
|
+
createCommandHandlerRegistration(commandClassName, handlerClassName) {
|
|
54
|
+
return ` .withCommandHandler(${commandClassName}, () => new ${handlerClassName}())`;
|
|
55
|
+
}
|
|
56
|
+
createEventHandlerRegistration(handlerClassName, eventName) {
|
|
57
|
+
const nameArg = eventName ? `, '${eventName}'` : "";
|
|
58
|
+
return ` .withEventHandler(() => new ${handlerClassName}()${nameArg})`;
|
|
59
|
+
}
|
|
60
|
+
createQueryHandlerRegistration(queryClassName, handlerClassName) {
|
|
61
|
+
return ` .withQueryHandler(${queryClassName}, () => new ${handlerClassName}())`;
|
|
62
|
+
}
|
|
63
|
+
isCommandHandler(handler) {
|
|
64
|
+
return handler.type === "command";
|
|
65
|
+
}
|
|
66
|
+
isEventHandler(handler) {
|
|
67
|
+
return handler.type === "event";
|
|
68
|
+
}
|
|
69
|
+
isQueryHandler(handler) {
|
|
70
|
+
return handler.type === "query";
|
|
71
|
+
}
|
|
72
|
+
collectImports(handlers) {
|
|
73
|
+
const imports = new Set();
|
|
74
|
+
imports.add(this.createImportStatement("ApplicationBuilder", this.config.applicationBuilderImportPath));
|
|
75
|
+
for (const handler of handlers) {
|
|
76
|
+
imports.add(this.createImportStatement(handler.handlerClassName, handler.handlerPath));
|
|
77
|
+
if (this.isCommandHandler(handler) && handler.commandPath) {
|
|
78
|
+
imports.add(this.createImportStatement(handler.commandClassName, handler.commandPath));
|
|
79
|
+
}
|
|
80
|
+
if (this.isQueryHandler(handler) && handler.queryPath) {
|
|
81
|
+
imports.add(this.createImportStatement(handler.queryClassName, handler.queryPath));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return imports;
|
|
85
|
+
}
|
|
86
|
+
generateRegistrations(handlers) {
|
|
87
|
+
const commandRegistrations = this.generateCommandRegistrations(handlers);
|
|
88
|
+
const queryRegistrations = this.generateQueryRegistrations(handlers);
|
|
89
|
+
const eventRegistrations = this.generateEventRegistrations(handlers);
|
|
90
|
+
return [...commandRegistrations, ...queryRegistrations, ...eventRegistrations];
|
|
91
|
+
}
|
|
92
|
+
generateCommandRegistrations(handlers) {
|
|
93
|
+
return handlers
|
|
94
|
+
.filter((h) => this.isCommandHandler(h))
|
|
95
|
+
.map((h) => this.createCommandHandlerRegistration(h.commandClassName, h.handlerClassName));
|
|
96
|
+
}
|
|
97
|
+
generateQueryRegistrations(handlers) {
|
|
98
|
+
return handlers
|
|
99
|
+
.filter((h) => this.isQueryHandler(h))
|
|
100
|
+
.map((h) => this.createQueryHandlerRegistration(h.queryClassName, h.handlerClassName));
|
|
101
|
+
}
|
|
102
|
+
generateEventRegistrations(handlers) {
|
|
103
|
+
return handlers
|
|
104
|
+
.filter((h) => this.isEventHandler(h))
|
|
105
|
+
.map((handler) => {
|
|
106
|
+
this.validateEventHandlerOptions(handler);
|
|
107
|
+
const eventName = handler.eventHandlerOptions.name;
|
|
108
|
+
return this.createEventHandlerRegistration(handler.handlerClassName, eventName);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
validateEventHandlerOptions(handler) {
|
|
112
|
+
const options = handler.eventHandlerOptions;
|
|
113
|
+
const invalidKeys = Object.keys(options).filter((key) => key !== "name");
|
|
114
|
+
if (invalidKeys.length > 0) {
|
|
115
|
+
throw new Error(`EventHandler for ${handler.handlerClassName} has invalid options: ${invalidKeys.join(", ")}.\n` +
|
|
116
|
+
`Only 'name' option is supported. Use @EventHandler({ name: 'event-name' })`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
assembleGeneratedCode(imports, registrations) {
|
|
120
|
+
const registrationCode = registrations.length > 0 ? "\n" + registrations.join("\n") : "";
|
|
121
|
+
return `
|
|
122
|
+
${Array.from(imports).join("\n")}
|
|
123
|
+
|
|
124
|
+
export function createApplicationBuilder(): ApplicationBuilder {
|
|
125
|
+
return new ApplicationBuilder()${registrationCode};
|
|
126
|
+
}
|
|
127
|
+
`;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.ApplicationCodeGenerator = ApplicationCodeGenerator;
|
|
131
|
+
//# sourceMappingURL=code-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-generator.js","sourceRoot":"","sources":["../src/code-generator.ts"],"names":[],"mappings":";;;AACA,qCAIkB;AAQlB;;GAEG;AACH,MAAa,wBAAwB;IACb;IAApB,YAAoB,MAAyB;QAAzB,WAAM,GAAN,MAAM,CAAmB;IAAG,CAAC;IAEjD,YAAY,CAAC,QAA2B;QACpC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC9C,MAAM,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAC9D,CAAC;IAEO,oBAAoB,CAAC,QAA2B;QACpD,IAAI,CAAC,kCAAkC,CAAC,QAAQ,CAAC,CAAC;QAClD,IAAI,CAAC,gCAAgC,CAAC,QAAQ,CAAC,CAAC;QAChD,IAAI,CAAC,gCAAgC,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC;IAEO,2BAA2B,CAC/B,QAA2B,EAC3B,UAA0C,EAC1C,YAA8B,EAC9B,YAAwD;QAExD,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MA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