durable-map 0.1.1 → 0.1.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 +68 -102
- package/package.json +29 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Taishi Yamashita
|
|
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
CHANGED
|
@@ -1,137 +1,103 @@
|
|
|
1
1
|
# durable-map
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/durable-map)
|
|
4
|
+
[](https://www.npmjs.com/package/durable-map)
|
|
5
|
+
[](https://github.com/taishiyamashita1114/durable-map/blob/main/LICENSE)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
> Analyze Azure Durable Functions projects and auto-generate documentation with Mermaid flow diagrams.
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
npm install
|
|
9
|
-
npm run build
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
## 基本的な使い方
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npx tsx src/index.ts <C#プロジェクトのパス> [options]
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
対象パスの `.cs` ファイルを再帰的にスキャンし、Durable Functions の定義(Client / Orchestrator / Activity / Entity)と呼び出し関係を解析します。
|
|
9
|
+
Azure Durable Functions の構成を静的解析し、トリガー → オーケストレーター → アクティビティ → インフラ層の呼び出し関係をドキュメントと Mermaid フローチャートで自動生成する CLI ツール。
|
|
19
10
|
|
|
20
|
-
|
|
11
|
+
## Features
|
|
21
12
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
- C# isolated worker model の自動解析
|
|
14
|
+
- Mermaid フローチャートの自動生成
|
|
15
|
+
- Markdown / JSON / HTML ドキュメントの自動生成
|
|
16
|
+
- トリガー → オーケストレーター → アクティビティの呼び出し関係を可視化
|
|
17
|
+
- インフラ層(CosmosDB, Blob Storage, Queue, Service Bus 等)の検出
|
|
18
|
+
- `@durable-map:infra` アノテーションによる手動補完
|
|
28
19
|
|
|
29
|
-
|
|
30
|
-
npx tsx src/index.ts ./MyFunctionsProject -f html -o output.html
|
|
20
|
+
## Output Example
|
|
31
21
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
```mermaid
|
|
23
|
+
graph LR
|
|
24
|
+
A[HTTP POST /api/order] --> B[Orchestrator: ProcessOrder]
|
|
25
|
+
B --> C[Activity: ValidateOrder]
|
|
26
|
+
C --> D[(CosmosDB: orders)]
|
|
27
|
+
B --> E[Activity: ChargePayment]
|
|
28
|
+
E --> F[/Stripe API/]
|
|
29
|
+
B --> G[Activity: SendConfirmation]
|
|
30
|
+
G --> H[/SendGrid/]
|
|
37
31
|
```
|
|
38
32
|
|
|
39
|
-
|
|
33
|
+
## Quick Start
|
|
40
34
|
|
|
41
35
|
```bash
|
|
42
|
-
|
|
43
|
-
npx tsx src/index.ts ./MyFunctionsProject
|
|
44
|
-
|
|
45
|
-
# deep: Client → Orchestrator → Activity まで表示
|
|
46
|
-
npx tsx src/index.ts ./MyFunctionsProject -d deep
|
|
36
|
+
npx durable-map ./path/to/azure-functions-project
|
|
47
37
|
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
npm install -g durable-map
|
|
39
|
+
durable-map ./path/to/project
|
|
50
40
|
```
|
|
51
41
|
|
|
52
|
-
|
|
53
|
-
|---|---|
|
|
54
|
-
| `shallow` (デフォルト) | Client → Orchestrator の呼び出し関係のみ |
|
|
55
|
-
| `deep` | Client → Orchestrator → Activity ノードまで表示。アノテーションで指定されたインフラ情報も含む |
|
|
56
|
-
|
|
57
|
-
### その他のオプション
|
|
42
|
+
## Options
|
|
58
43
|
|
|
59
44
|
```bash
|
|
60
|
-
|
|
61
|
-
npx tsx src/index.ts ./MyFunctionsProject --exclude "**/Tests/**" "**/bin/**"
|
|
45
|
+
durable-map ./path/to/project --output ./docs/durable-map.md
|
|
62
46
|
|
|
63
|
-
|
|
64
|
-
npx tsx src/index.ts ./MyFunctionsProject -v
|
|
65
|
-
```
|
|
47
|
+
durable-map ./path/to/project --format json
|
|
66
48
|
|
|
67
|
-
|
|
49
|
+
durable-map ./path/to/project --format html --output output.html
|
|
50
|
+
|
|
51
|
+
durable-map ./path/to/project --depth deep
|
|
52
|
+
```
|
|
68
53
|
|
|
69
54
|
| Option | Description |
|
|
70
55
|
|---|---|
|
|
71
|
-
| `-f, --format <format>` |
|
|
72
|
-
| `-o, --output <file>` |
|
|
73
|
-
| `-d, --depth <mode>` |
|
|
74
|
-
| `--exclude <patterns...>` |
|
|
75
|
-
| `--no-mermaid` | Mermaid
|
|
76
|
-
| `-v, --verbose` |
|
|
56
|
+
| `-f, --format <format>` | Output format (`markdown` \| `json` \| `html`) Default: `markdown` |
|
|
57
|
+
| `-o, --output <file>` | Output file (default: stdout) |
|
|
58
|
+
| `-d, --depth <mode>` | Display depth (`shallow` \| `deep`) Default: `shallow` |
|
|
59
|
+
| `--exclude <patterns...>` | Exclude patterns |
|
|
60
|
+
| `--no-mermaid` | Disable Mermaid diagram generation |
|
|
61
|
+
| `-v, --verbose` | Verbose logging |
|
|
77
62
|
|
|
78
|
-
##
|
|
63
|
+
## Supported Languages
|
|
79
64
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
{
|
|
86
|
-
// @durable-map:infra cosmosdb:orders "Order database"
|
|
87
|
-
// @durable-map:infra blob:receipts
|
|
88
|
-
await _container.CreateItemAsync(input);
|
|
89
|
-
}
|
|
90
|
-
```
|
|
65
|
+
| Language | Model | Status |
|
|
66
|
+
|----------|-------|--------|
|
|
67
|
+
| C# | isolated worker | Supported |
|
|
68
|
+
| Python | V2 | Planned |
|
|
69
|
+
| TypeScript | V4 | Planned |
|
|
91
70
|
|
|
92
|
-
|
|
71
|
+
## How It Works
|
|
93
72
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
| `description` | No | 説明文(ダブルクォートで囲む) |
|
|
73
|
+
1. Recursively scans `.cs` files in the target directory
|
|
74
|
+
2. Detects `[Function]`, `[HttpTrigger]`, `[OrchestrationTrigger]`, `[ActivityTrigger]` attributes
|
|
75
|
+
3. Analyzes `CallActivityAsync`, `CallSubOrchestratorAsync` call patterns
|
|
76
|
+
4. Builds a call graph and outputs Markdown + Mermaid
|
|
99
77
|
|
|
100
|
-
##
|
|
78
|
+
## Infrastructure Detection
|
|
101
79
|
|
|
102
|
-
|
|
80
|
+
Activities are scanned for Azure SDK client usage:
|
|
103
81
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
Orchestrator -->|callActivity| SaveOrder
|
|
111
|
-
|
|
112
|
-
%% インフラ層(手動追記)
|
|
113
|
-
CosmosDB[("CosmosDB\norders")]
|
|
114
|
-
BlobStorage[("Blob\nuploads")]
|
|
115
|
-
SaveOrder -.->|cosmosdb| CosmosDB
|
|
116
|
-
SaveOrder -.->|blob| BlobStorage
|
|
117
|
-
```
|
|
82
|
+
- CosmosDB (`CosmosClient`)
|
|
83
|
+
- Blob Storage (`BlobServiceClient`)
|
|
84
|
+
- Queue Storage / Service Bus (`QueueClient`, `ServiceBusClient`)
|
|
85
|
+
- Table Storage (`TableClient`)
|
|
86
|
+
- Event Hub (`EventHubProducerClient`)
|
|
87
|
+
- HTTP API (`HttpClient`)
|
|
118
88
|
|
|
119
|
-
|
|
89
|
+
Use annotations for manual supplementation:
|
|
120
90
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
91
|
+
```csharp
|
|
92
|
+
// @durable-map:infra cosmosdb:orders "Order database"
|
|
93
|
+
// @durable-map:infra blob:receipts
|
|
94
|
+
public class SaveOrder : TaskActivity<OrderData, bool> { ... }
|
|
95
|
+
```
|
|
126
96
|
|
|
127
|
-
##
|
|
97
|
+
## Feedback / Contact
|
|
128
98
|
|
|
129
|
-
|
|
130
|
-
npm install
|
|
131
|
-
npm test
|
|
132
|
-
```
|
|
99
|
+
[Contact Form](https://forms.gle/2VvCjT3EDesHJsBU8)
|
|
133
100
|
|
|
134
|
-
##
|
|
101
|
+
## License
|
|
135
102
|
|
|
136
|
-
|
|
137
|
-
- Azure Subscription 連携 (App Service Plan / App Service 名などのインフラ情報を出力に含める)
|
|
103
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "durable-map",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Azure Durable Functions
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "CLI tool to analyze Azure Durable Functions projects and auto-generate documentation with Mermaid flow diagrams. Visualize triggers, orchestrators, activities, and infrastructure dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"durable-map": "./dist/index.js"
|
|
@@ -18,9 +18,34 @@
|
|
|
18
18
|
},
|
|
19
19
|
"keywords": [
|
|
20
20
|
"azure",
|
|
21
|
+
"azure-functions",
|
|
21
22
|
"durable-functions",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
23
|
+
"durable-task",
|
|
24
|
+
"orchestration",
|
|
25
|
+
"orchestrator",
|
|
26
|
+
"serverless",
|
|
27
|
+
"mermaid",
|
|
28
|
+
"diagram",
|
|
29
|
+
"flowchart",
|
|
30
|
+
"documentation",
|
|
31
|
+
"documentation-generator",
|
|
32
|
+
"doc-generator",
|
|
33
|
+
"static-analysis",
|
|
34
|
+
"code-analysis",
|
|
35
|
+
"cli",
|
|
36
|
+
"csharp",
|
|
37
|
+
"dotnet",
|
|
38
|
+
"isolated-worker",
|
|
39
|
+
"architecture",
|
|
40
|
+
"architecture-diagram",
|
|
41
|
+
"function-chaining",
|
|
42
|
+
"fan-out-fan-in",
|
|
43
|
+
"workflow",
|
|
44
|
+
"flow-diagram",
|
|
45
|
+
"code-visualization",
|
|
46
|
+
"call-graph",
|
|
47
|
+
"dependency-graph",
|
|
48
|
+
"infrastructure"
|
|
24
49
|
],
|
|
25
50
|
"license": "MIT",
|
|
26
51
|
"dependencies": {
|