@evolith/infra-providers 1.0.0 → 1.0.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/README.md +75 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# @evolith/infra-providers
|
|
2
|
+
|
|
3
|
+
> Infrastructure adapters for the Evolith governance framework.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@evolith/infra-providers)
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
`@evolith/infra-providers` supplies the **concrete infrastructure adapters** that implement the ports defined in `@evolith/core-domain`. It handles filesystem I/O, logging, YAML/JSON config parsing, ruleset loading from disk, and webhook delivery.
|
|
11
|
+
|
|
12
|
+
These adapters are injected into the domain at runtime — the domain itself has zero infrastructure dependencies.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @evolith/infra-providers
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Providers
|
|
21
|
+
|
|
22
|
+
| Export | Implements | Description |
|
|
23
|
+
|--------|-----------|-------------|
|
|
24
|
+
| `NodeFileSystemProvider` | `IFileSystemProvider` | Full filesystem adapter using Node.js `fs` + `fs-extra` |
|
|
25
|
+
| `NestLoggerProvider` | `ILogger` | NestJS `LoggerService` wrapper |
|
|
26
|
+
| `ConsoleLoggerProvider` | `ILogger` | Plain `console.*` logger (useful in scripts/tests) |
|
|
27
|
+
| `NoOpLoggerProvider` | `ILogger` | Silent logger (testing) |
|
|
28
|
+
| `YamlConfigParserProvider` | `IConfigParser` | Parses `.yaml` / `.yml` files |
|
|
29
|
+
| `JsonConfigParserProvider` | `IConfigParser` | Parses `.json` files |
|
|
30
|
+
| `DiskRulesetRepository` | `IRulesetRepository` | Loads governance rulesets from disk |
|
|
31
|
+
| `WebhookAdapter` | — | HTTP webhook delivery with retry |
|
|
32
|
+
| `MoscowPrioritizationService` | — | MoSCoW prioritization logic |
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { NodeFileSystemProvider } from '@evolith/infra-providers';
|
|
38
|
+
import { YamlConfigParserProvider } from '@evolith/infra-providers';
|
|
39
|
+
import { DiskRulesetRepository } from '@evolith/infra-providers';
|
|
40
|
+
import { EvaluateGateUseCase } from '@evolith/core-domain/application/use-cases';
|
|
41
|
+
|
|
42
|
+
const fs = new NodeFileSystemProvider().createFileSystem();
|
|
43
|
+
const configParser = new YamlConfigParserProvider();
|
|
44
|
+
const rulesetRepo = new DiskRulesetRepository(fs, configParser);
|
|
45
|
+
|
|
46
|
+
const useCase = new EvaluateGateUseCase(rulesetRepo, fs, new ConsoleLoggerProvider());
|
|
47
|
+
const result = await useCase.execute({ projectId, phase, artifacts });
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### With NestJS
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import { Module } from '@nestjs/common';
|
|
54
|
+
import { NodeFileSystemProvider, DiskRulesetRepository } from '@evolith/infra-providers';
|
|
55
|
+
|
|
56
|
+
@Module({
|
|
57
|
+
providers: [
|
|
58
|
+
{ provide: 'IFileSystem', useClass: NodeFileSystemProvider },
|
|
59
|
+
{ provide: 'IRulesetRepository', useClass: DiskRulesetRepository },
|
|
60
|
+
],
|
|
61
|
+
exports: ['IFileSystem', 'IRulesetRepository'],
|
|
62
|
+
})
|
|
63
|
+
export class InfraModule {}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Part of the Evolith suite
|
|
67
|
+
|
|
68
|
+
| Package | Role |
|
|
69
|
+
|---------|------|
|
|
70
|
+
| [`@evolith/core-domain`](https://www.npmjs.com/package/@evolith/core-domain) | Domain logic and rule engine |
|
|
71
|
+
| **`@evolith/infra-providers`** | Infrastructure adapters ← you are here |
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
UNLICENSED — proprietary. Copyright © Beyondnet.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evolith/infra-providers",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Shared infrastructure providers for Evolith Core",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"build": "tsc"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@evolith/core-domain": "1.0.
|
|
19
|
+
"@evolith/core-domain": "1.0.2",
|
|
20
20
|
"@nestjs/common": "11.1.27",
|
|
21
21
|
"ajv": "8.20.0",
|
|
22
22
|
"ajv-formats": "3.0.1",
|