@evolith/infra-providers 1.0.0 → 1.0.2
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 +75 -0
- package/package.json +5 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BeyondNet Code
|
|
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,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
|
+
MIT — Copyright © 2026 BeyondNet Code. See [LICENSE](./LICENSE) for details.
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evolith/infra-providers",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Shared infrastructure providers for Evolith Core",
|
|
5
|
+
"license": "MIT",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"types": "dist/index.d.ts",
|
|
7
8
|
"files": [
|
|
8
9
|
"dist",
|
|
9
|
-
"README.md"
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE"
|
|
10
12
|
],
|
|
11
13
|
"publishConfig": {
|
|
12
14
|
"access": "public",
|
|
@@ -16,7 +18,7 @@
|
|
|
16
18
|
"build": "tsc"
|
|
17
19
|
},
|
|
18
20
|
"dependencies": {
|
|
19
|
-
"@evolith/core-domain": "1.0.
|
|
21
|
+
"@evolith/core-domain": "1.0.4",
|
|
20
22
|
"@nestjs/common": "11.1.27",
|
|
21
23
|
"ajv": "8.20.0",
|
|
22
24
|
"ajv-formats": "3.0.1",
|