@h2nguyen/arc42-node-mcp-server 1.0.2 → 2.0.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/CHANGELOG.md +46 -0
- package/README.md +222 -11
- package/dist/index.js +0 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +28 -72
- package/dist/server.js.map +1 -1
- package/dist/templates/index.d.ts +46 -1
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +63 -896
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/locales/cz/index.d.ts +9 -0
- package/dist/templates/locales/cz/index.d.ts.map +1 -0
- package/dist/templates/locales/cz/index.js +29 -0
- package/dist/templates/locales/cz/index.js.map +1 -0
- package/dist/templates/locales/cz/sections.d.ts +10 -0
- package/dist/templates/locales/cz/sections.d.ts.map +1 -0
- package/dist/templates/locales/cz/sections.js +39 -0
- package/dist/templates/locales/cz/sections.js.map +1 -0
- package/dist/templates/locales/cz/templates.d.ts +9 -0
- package/dist/templates/locales/cz/templates.d.ts.map +1 -0
- package/dist/templates/locales/cz/templates.js +274 -0
- package/dist/templates/locales/cz/templates.js.map +1 -0
- package/dist/templates/locales/de/index.d.ts +26 -0
- package/dist/templates/locales/de/index.d.ts.map +1 -0
- package/dist/templates/locales/de/index.js +53 -0
- package/dist/templates/locales/de/index.js.map +1 -0
- package/dist/templates/locales/de/sections.d.ts +28 -0
- package/dist/templates/locales/de/sections.d.ts.map +1 -0
- package/dist/templates/locales/de/sections.js +57 -0
- package/dist/templates/locales/de/sections.js.map +1 -0
- package/dist/templates/locales/de/templates.d.ts +22 -0
- package/dist/templates/locales/de/templates.d.ts.map +1 -0
- package/dist/templates/locales/de/templates.js +1060 -0
- package/dist/templates/locales/de/templates.js.map +1 -0
- package/dist/templates/locales/en/index.d.ts +26 -0
- package/dist/templates/locales/en/index.d.ts.map +1 -0
- package/dist/templates/locales/en/index.js +53 -0
- package/dist/templates/locales/en/index.js.map +1 -0
- package/dist/templates/locales/en/sections.d.ts +25 -0
- package/dist/templates/locales/en/sections.d.ts.map +1 -0
- package/dist/templates/locales/en/sections.js +54 -0
- package/dist/templates/locales/en/sections.js.map +1 -0
- package/dist/templates/locales/en/templates.d.ts +22 -0
- package/dist/templates/locales/en/templates.d.ts.map +1 -0
- package/dist/templates/locales/en/templates.js +1060 -0
- package/dist/templates/locales/en/templates.js.map +1 -0
- package/dist/templates/locales/es/index.d.ts +26 -0
- package/dist/templates/locales/es/index.d.ts.map +1 -0
- package/dist/templates/locales/es/index.js +53 -0
- package/dist/templates/locales/es/index.js.map +1 -0
- package/dist/templates/locales/es/sections.d.ts +28 -0
- package/dist/templates/locales/es/sections.d.ts.map +1 -0
- package/dist/templates/locales/es/sections.js +57 -0
- package/dist/templates/locales/es/sections.js.map +1 -0
- package/dist/templates/locales/es/templates.d.ts +22 -0
- package/dist/templates/locales/es/templates.d.ts.map +1 -0
- package/dist/templates/locales/es/templates.js +1060 -0
- package/dist/templates/locales/es/templates.js.map +1 -0
- package/dist/templates/locales/fr/index.d.ts +26 -0
- package/dist/templates/locales/fr/index.d.ts.map +1 -0
- package/dist/templates/locales/fr/index.js +53 -0
- package/dist/templates/locales/fr/index.js.map +1 -0
- package/dist/templates/locales/fr/sections.d.ts +28 -0
- package/dist/templates/locales/fr/sections.d.ts.map +1 -0
- package/dist/templates/locales/fr/sections.js +57 -0
- package/dist/templates/locales/fr/sections.js.map +1 -0
- package/dist/templates/locales/fr/templates.d.ts +22 -0
- package/dist/templates/locales/fr/templates.d.ts.map +1 -0
- package/dist/templates/locales/fr/templates.js +1060 -0
- package/dist/templates/locales/fr/templates.js.map +1 -0
- package/dist/templates/locales/index.d.ts +67 -0
- package/dist/templates/locales/index.d.ts.map +1 -0
- package/dist/templates/locales/index.js +100 -0
- package/dist/templates/locales/index.js.map +1 -0
- package/dist/templates/locales/it/index.d.ts +26 -0
- package/dist/templates/locales/it/index.d.ts.map +1 -0
- package/dist/templates/locales/it/index.js +53 -0
- package/dist/templates/locales/it/index.js.map +1 -0
- package/dist/templates/locales/it/sections.d.ts +28 -0
- package/dist/templates/locales/it/sections.d.ts.map +1 -0
- package/dist/templates/locales/it/sections.js +57 -0
- package/dist/templates/locales/it/sections.js.map +1 -0
- package/dist/templates/locales/it/templates.d.ts +22 -0
- package/dist/templates/locales/it/templates.d.ts.map +1 -0
- package/dist/templates/locales/it/templates.js +1060 -0
- package/dist/templates/locales/it/templates.js.map +1 -0
- package/dist/templates/locales/language-factory.d.ts +97 -0
- package/dist/templates/locales/language-factory.d.ts.map +1 -0
- package/dist/templates/locales/language-factory.js +126 -0
- package/dist/templates/locales/language-factory.js.map +1 -0
- package/dist/templates/locales/language-registry.d.ts +114 -0
- package/dist/templates/locales/language-registry.d.ts.map +1 -0
- package/dist/templates/locales/language-registry.js +146 -0
- package/dist/templates/locales/language-registry.js.map +1 -0
- package/dist/templates/locales/language-strategy.d.ts +126 -0
- package/dist/templates/locales/language-strategy.d.ts.map +1 -0
- package/dist/templates/locales/language-strategy.js +46 -0
- package/dist/templates/locales/language-strategy.js.map +1 -0
- package/dist/templates/locales/nl/index.d.ts +26 -0
- package/dist/templates/locales/nl/index.d.ts.map +1 -0
- package/dist/templates/locales/nl/index.js +53 -0
- package/dist/templates/locales/nl/index.js.map +1 -0
- package/dist/templates/locales/nl/sections.d.ts +28 -0
- package/dist/templates/locales/nl/sections.d.ts.map +1 -0
- package/dist/templates/locales/nl/sections.js +57 -0
- package/dist/templates/locales/nl/sections.js.map +1 -0
- package/dist/templates/locales/nl/templates.d.ts +22 -0
- package/dist/templates/locales/nl/templates.d.ts.map +1 -0
- package/dist/templates/locales/nl/templates.js +1060 -0
- package/dist/templates/locales/nl/templates.js.map +1 -0
- package/dist/templates/locales/pt/index.d.ts +26 -0
- package/dist/templates/locales/pt/index.d.ts.map +1 -0
- package/dist/templates/locales/pt/index.js +53 -0
- package/dist/templates/locales/pt/index.js.map +1 -0
- package/dist/templates/locales/pt/sections.d.ts +28 -0
- package/dist/templates/locales/pt/sections.d.ts.map +1 -0
- package/dist/templates/locales/pt/sections.js +57 -0
- package/dist/templates/locales/pt/sections.js.map +1 -0
- package/dist/templates/locales/pt/templates.d.ts +22 -0
- package/dist/templates/locales/pt/templates.d.ts.map +1 -0
- package/dist/templates/locales/pt/templates.js +1060 -0
- package/dist/templates/locales/pt/templates.js.map +1 -0
- package/dist/templates/locales/ru/index.d.ts +15 -0
- package/dist/templates/locales/ru/index.d.ts.map +1 -0
- package/dist/templates/locales/ru/index.js +41 -0
- package/dist/templates/locales/ru/index.js.map +1 -0
- package/dist/templates/locales/ru/sections.d.ts +28 -0
- package/dist/templates/locales/ru/sections.d.ts.map +1 -0
- package/dist/templates/locales/ru/sections.js +57 -0
- package/dist/templates/locales/ru/sections.js.map +1 -0
- package/dist/templates/locales/ru/templates.d.ts +22 -0
- package/dist/templates/locales/ru/templates.d.ts.map +1 -0
- package/dist/templates/locales/ru/templates.js +664 -0
- package/dist/templates/locales/ru/templates.js.map +1 -0
- package/dist/templates/locales/template-provider.d.ts +122 -0
- package/dist/templates/locales/template-provider.d.ts.map +1 -0
- package/dist/templates/locales/template-provider.js +173 -0
- package/dist/templates/locales/template-provider.js.map +1 -0
- package/dist/templates/locales/ukr/index.d.ts +9 -0
- package/dist/templates/locales/ukr/index.d.ts.map +1 -0
- package/dist/templates/locales/ukr/index.js +29 -0
- package/dist/templates/locales/ukr/index.js.map +1 -0
- package/dist/templates/locales/ukr/sections.d.ts +10 -0
- package/dist/templates/locales/ukr/sections.d.ts.map +1 -0
- package/dist/templates/locales/ukr/sections.js +39 -0
- package/dist/templates/locales/ukr/sections.js.map +1 -0
- package/dist/templates/locales/ukr/templates.d.ts +9 -0
- package/dist/templates/locales/ukr/templates.d.ts.map +1 -0
- package/dist/templates/locales/ukr/templates.js +242 -0
- package/dist/templates/locales/ukr/templates.js.map +1 -0
- package/dist/templates/locales/zh/index.d.ts +9 -0
- package/dist/templates/locales/zh/index.d.ts.map +1 -0
- package/dist/templates/locales/zh/index.js +29 -0
- package/dist/templates/locales/zh/index.js.map +1 -0
- package/dist/templates/locales/zh/sections.d.ts +10 -0
- package/dist/templates/locales/zh/sections.d.ts.map +1 -0
- package/dist/templates/locales/zh/sections.js +39 -0
- package/dist/templates/locales/zh/sections.js.map +1 -0
- package/dist/templates/locales/zh/templates.d.ts +9 -0
- package/dist/templates/locales/zh/templates.d.ts.map +1 -0
- package/dist/templates/locales/zh/templates.js +260 -0
- package/dist/templates/locales/zh/templates.js.map +1 -0
- package/dist/tools/arc42-init.d.ts +8 -2
- package/dist/tools/arc42-init.d.ts.map +1 -1
- package/dist/tools/arc42-init.js +67 -97
- package/dist/tools/arc42-init.js.map +1 -1
- package/dist/tools/arc42-status.d.ts +5 -2
- package/dist/tools/arc42-status.d.ts.map +1 -1
- package/dist/tools/arc42-status.js +47 -18
- package/dist/tools/arc42-status.js.map +1 -1
- package/dist/tools/arc42-workflow-guide.d.ts +6 -3
- package/dist/tools/arc42-workflow-guide.d.ts.map +1 -1
- package/dist/tools/arc42-workflow-guide.js +42 -276
- package/dist/tools/arc42-workflow-guide.js.map +1 -1
- package/dist/tools/generate-template.d.ts +7 -3
- package/dist/tools/generate-template.d.ts.map +1 -1
- package/dist/tools/generate-template.js +44 -35
- package/dist/tools/generate-template.js.map +1 -1
- package/dist/tools/get-section.d.ts +7 -3
- package/dist/tools/get-section.d.ts.map +1 -1
- package/dist/tools/get-section.js +38 -38
- package/dist/tools/get-section.js.map +1 -1
- package/dist/tools/index.d.ts +6 -5
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +14 -20
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/update-section.d.ts +9 -3
- package/dist/tools/update-section.d.ts.map +1 -1
- package/dist/tools/update-section.js +12 -44
- package/dist/tools/update-section.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Localized Template Provider
|
|
3
|
+
*
|
|
4
|
+
* Provides language-aware template access with config.yaml integration.
|
|
5
|
+
* Acts as a facade simplifying the complexity of language selection and configuration.
|
|
6
|
+
*
|
|
7
|
+
* @module templates/locales/template-provider
|
|
8
|
+
*
|
|
9
|
+
* S.O.L.I.D Principles:
|
|
10
|
+
* - SRP (Single Responsibility Principle): Only retrieves templates
|
|
11
|
+
* - ISP (Interface Segregation Principle): Implements focused TemplateProvider interface
|
|
12
|
+
* - DIP (Dependency Inversion Principle): Depends on LanguageFactory abstraction
|
|
13
|
+
*
|
|
14
|
+
* Design Patterns:
|
|
15
|
+
* - Facade Pattern: Simplifies language/config complexity for tool handlers
|
|
16
|
+
*/
|
|
17
|
+
import type { Arc42Section } from '../../types.js';
|
|
18
|
+
import type { LanguageCode, LanguageInfo } from './language-strategy.js';
|
|
19
|
+
import type { LanguageFactory } from './language-factory.js';
|
|
20
|
+
/**
|
|
21
|
+
* Section metadata with localized content
|
|
22
|
+
*/
|
|
23
|
+
export interface LocalizedSectionMetadata {
|
|
24
|
+
/** The section identifier */
|
|
25
|
+
section: Arc42Section;
|
|
26
|
+
/** Localized section title */
|
|
27
|
+
title: string;
|
|
28
|
+
/** Localized section description */
|
|
29
|
+
description: string;
|
|
30
|
+
/** The language code used */
|
|
31
|
+
languageCode: LanguageCode;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Localized Template Provider Class
|
|
35
|
+
*
|
|
36
|
+
* Provides a simplified interface for accessing templates in different languages.
|
|
37
|
+
* Integrates with config.yaml to read default language settings.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const provider = new LocalizedTemplateProvider(factory);
|
|
42
|
+
*
|
|
43
|
+
* // Get template with explicit language
|
|
44
|
+
* const deTemplate = provider.getTemplate('01_introduction_and_goals', 'DE');
|
|
45
|
+
*
|
|
46
|
+
* // Get template using config.yaml language
|
|
47
|
+
* const template = provider.getTemplateWithConfig('01_introduction_and_goals', workspacePath);
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare class LocalizedTemplateProvider {
|
|
51
|
+
/**
|
|
52
|
+
* The factory for creating language strategies
|
|
53
|
+
*/
|
|
54
|
+
private readonly factory;
|
|
55
|
+
/**
|
|
56
|
+
* Create a new LocalizedTemplateProvider
|
|
57
|
+
*
|
|
58
|
+
* @param factory - The language factory for strategy creation
|
|
59
|
+
*/
|
|
60
|
+
constructor(factory: LanguageFactory);
|
|
61
|
+
/**
|
|
62
|
+
* Get the template for a section in a specific language
|
|
63
|
+
*
|
|
64
|
+
* @param section - The arc42 section
|
|
65
|
+
* @param language - The language code (defaults to English)
|
|
66
|
+
* @returns The template content
|
|
67
|
+
*/
|
|
68
|
+
getTemplate(section: Arc42Section, language?: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* Get the template using config.yaml for default language
|
|
71
|
+
*
|
|
72
|
+
* @param section - The arc42 section
|
|
73
|
+
* @param workspacePath - Path to the workspace (or parent containing config.yaml)
|
|
74
|
+
* @param language - Optional override language (takes precedence over config)
|
|
75
|
+
* @returns The template content
|
|
76
|
+
*/
|
|
77
|
+
getTemplateWithConfig(section: Arc42Section, workspacePath: string, language?: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Get section metadata in a specific language
|
|
80
|
+
*
|
|
81
|
+
* @param section - The arc42 section
|
|
82
|
+
* @param language - The language code (defaults to English)
|
|
83
|
+
* @returns The section metadata
|
|
84
|
+
*/
|
|
85
|
+
getSectionMetadata(section: Arc42Section, language?: string): LocalizedSectionMetadata;
|
|
86
|
+
/**
|
|
87
|
+
* Get the workflow guide in a specific language
|
|
88
|
+
*
|
|
89
|
+
* @param language - The language code (defaults to English)
|
|
90
|
+
* @returns The workflow guide content
|
|
91
|
+
*/
|
|
92
|
+
getWorkflowGuide(language?: string): string;
|
|
93
|
+
/**
|
|
94
|
+
* Get README content in a specific language
|
|
95
|
+
*
|
|
96
|
+
* @param language - The language code (defaults to English)
|
|
97
|
+
* @param projectName - Optional project name for README header
|
|
98
|
+
* @returns The README content
|
|
99
|
+
*/
|
|
100
|
+
getReadmeContent(language?: string, projectName?: string): string;
|
|
101
|
+
/**
|
|
102
|
+
* Get all available languages
|
|
103
|
+
*
|
|
104
|
+
* @returns Array of language information objects
|
|
105
|
+
*/
|
|
106
|
+
getAvailableLanguages(): LanguageInfo[];
|
|
107
|
+
/**
|
|
108
|
+
* Check if a language is supported
|
|
109
|
+
*
|
|
110
|
+
* @param language - The language code to check
|
|
111
|
+
* @returns True if the language is supported
|
|
112
|
+
*/
|
|
113
|
+
isSupported(language: string): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Read the language setting from config.yaml
|
|
116
|
+
*
|
|
117
|
+
* @param workspacePath - Path to the workspace directory
|
|
118
|
+
* @returns The language code from config, or undefined if not found
|
|
119
|
+
*/
|
|
120
|
+
readLanguageFromConfig(workspacePath: string): string | undefined;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=template-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-provider.d.ts","sourceRoot":"","sources":["../../../src/templates/locales/template-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,6BAA6B;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,6BAA6B;IAC7B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,yBAAyB;IACpC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAE1C;;;;OAIG;gBACS,OAAO,EAAE,eAAe;IAIpC;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM;IAO7D;;;;;;;OAOG;IACH,qBAAqB,CACnB,OAAO,EAAE,YAAY,EACrB,aAAa,EAAE,MAAM,EACrB,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM;IAKT;;;;;;OAMG;IACH,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,wBAAwB;IAgBtF;;;;;OAKG;IACH,gBAAgB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM;IAO3C;;;;;;OAMG;IACH,gBAAgB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM;IAOjE;;;;OAIG;IACH,qBAAqB,IAAI,YAAY,EAAE;IAYvC;;;;;OAKG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAItC;;;;;OAKG;IACH,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAwBlE"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Localized Template Provider
|
|
3
|
+
*
|
|
4
|
+
* Provides language-aware template access with config.yaml integration.
|
|
5
|
+
* Acts as a facade simplifying the complexity of language selection and configuration.
|
|
6
|
+
*
|
|
7
|
+
* @module templates/locales/template-provider
|
|
8
|
+
*
|
|
9
|
+
* S.O.L.I.D Principles:
|
|
10
|
+
* - SRP (Single Responsibility Principle): Only retrieves templates
|
|
11
|
+
* - ISP (Interface Segregation Principle): Implements focused TemplateProvider interface
|
|
12
|
+
* - DIP (Dependency Inversion Principle): Depends on LanguageFactory abstraction
|
|
13
|
+
*
|
|
14
|
+
* Design Patterns:
|
|
15
|
+
* - Facade Pattern: Simplifies language/config complexity for tool handlers
|
|
16
|
+
*/
|
|
17
|
+
import { existsSync, readFileSync } from 'fs';
|
|
18
|
+
import { join } from 'path';
|
|
19
|
+
import { parse as parseYaml } from 'yaml';
|
|
20
|
+
/**
|
|
21
|
+
* Localized Template Provider Class
|
|
22
|
+
*
|
|
23
|
+
* Provides a simplified interface for accessing templates in different languages.
|
|
24
|
+
* Integrates with config.yaml to read default language settings.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const provider = new LocalizedTemplateProvider(factory);
|
|
29
|
+
*
|
|
30
|
+
* // Get template with explicit language
|
|
31
|
+
* const deTemplate = provider.getTemplate('01_introduction_and_goals', 'DE');
|
|
32
|
+
*
|
|
33
|
+
* // Get template using config.yaml language
|
|
34
|
+
* const template = provider.getTemplateWithConfig('01_introduction_and_goals', workspacePath);
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export class LocalizedTemplateProvider {
|
|
38
|
+
/**
|
|
39
|
+
* The factory for creating language strategies
|
|
40
|
+
*/
|
|
41
|
+
factory;
|
|
42
|
+
/**
|
|
43
|
+
* Create a new LocalizedTemplateProvider
|
|
44
|
+
*
|
|
45
|
+
* @param factory - The language factory for strategy creation
|
|
46
|
+
*/
|
|
47
|
+
constructor(factory) {
|
|
48
|
+
this.factory = factory;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get the template for a section in a specific language
|
|
52
|
+
*
|
|
53
|
+
* @param section - The arc42 section
|
|
54
|
+
* @param language - The language code (defaults to English)
|
|
55
|
+
* @returns The template content
|
|
56
|
+
*/
|
|
57
|
+
getTemplate(section, language) {
|
|
58
|
+
const strategy = language
|
|
59
|
+
? this.factory.createWithFallback(language)
|
|
60
|
+
: this.factory.getDefault();
|
|
61
|
+
return strategy.getTemplate(section);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get the template using config.yaml for default language
|
|
65
|
+
*
|
|
66
|
+
* @param section - The arc42 section
|
|
67
|
+
* @param workspacePath - Path to the workspace (or parent containing config.yaml)
|
|
68
|
+
* @param language - Optional override language (takes precedence over config)
|
|
69
|
+
* @returns The template content
|
|
70
|
+
*/
|
|
71
|
+
getTemplateWithConfig(section, workspacePath, language) {
|
|
72
|
+
const effectiveLanguage = language || this.readLanguageFromConfig(workspacePath) || 'EN';
|
|
73
|
+
return this.getTemplate(section, effectiveLanguage);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get section metadata in a specific language
|
|
77
|
+
*
|
|
78
|
+
* @param section - The arc42 section
|
|
79
|
+
* @param language - The language code (defaults to English)
|
|
80
|
+
* @returns The section metadata
|
|
81
|
+
*/
|
|
82
|
+
getSectionMetadata(section, language) {
|
|
83
|
+
const strategy = language
|
|
84
|
+
? this.factory.createWithFallback(language)
|
|
85
|
+
: this.factory.getDefault();
|
|
86
|
+
const title = strategy.getSectionTitle(section);
|
|
87
|
+
const description = strategy.getSectionDescription(section);
|
|
88
|
+
return {
|
|
89
|
+
section,
|
|
90
|
+
title: title.title,
|
|
91
|
+
description: description.description,
|
|
92
|
+
languageCode: strategy.code
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Get the workflow guide in a specific language
|
|
97
|
+
*
|
|
98
|
+
* @param language - The language code (defaults to English)
|
|
99
|
+
* @returns The workflow guide content
|
|
100
|
+
*/
|
|
101
|
+
getWorkflowGuide(language) {
|
|
102
|
+
const strategy = language
|
|
103
|
+
? this.factory.createWithFallback(language)
|
|
104
|
+
: this.factory.getDefault();
|
|
105
|
+
return strategy.getWorkflowGuide();
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Get README content in a specific language
|
|
109
|
+
*
|
|
110
|
+
* @param language - The language code (defaults to English)
|
|
111
|
+
* @param projectName - Optional project name for README header
|
|
112
|
+
* @returns The README content
|
|
113
|
+
*/
|
|
114
|
+
getReadmeContent(language, projectName) {
|
|
115
|
+
const strategy = language
|
|
116
|
+
? this.factory.createWithFallback(language)
|
|
117
|
+
: this.factory.getDefault();
|
|
118
|
+
return strategy.getReadmeContent(projectName);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Get all available languages
|
|
122
|
+
*
|
|
123
|
+
* @returns Array of language information objects
|
|
124
|
+
*/
|
|
125
|
+
getAvailableLanguages() {
|
|
126
|
+
const codes = this.factory.getAvailableCodes();
|
|
127
|
+
return codes.map(code => {
|
|
128
|
+
const strategy = this.factory.create(code);
|
|
129
|
+
return {
|
|
130
|
+
code: strategy.code,
|
|
131
|
+
name: strategy.name,
|
|
132
|
+
nativeName: strategy.nativeName
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Check if a language is supported
|
|
138
|
+
*
|
|
139
|
+
* @param language - The language code to check
|
|
140
|
+
* @returns True if the language is supported
|
|
141
|
+
*/
|
|
142
|
+
isSupported(language) {
|
|
143
|
+
return this.factory.isSupported(language);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Read the language setting from config.yaml
|
|
147
|
+
*
|
|
148
|
+
* @param workspacePath - Path to the workspace directory
|
|
149
|
+
* @returns The language code from config, or undefined if not found
|
|
150
|
+
*/
|
|
151
|
+
readLanguageFromConfig(workspacePath) {
|
|
152
|
+
const configPath = join(workspacePath, 'config.yaml');
|
|
153
|
+
if (!existsSync(configPath)) {
|
|
154
|
+
return undefined;
|
|
155
|
+
}
|
|
156
|
+
try {
|
|
157
|
+
const content = readFileSync(configPath, 'utf-8');
|
|
158
|
+
const config = parseYaml(content);
|
|
159
|
+
if (config && typeof config === 'object' && 'language' in config) {
|
|
160
|
+
const language = config.language;
|
|
161
|
+
if (typeof language === 'string') {
|
|
162
|
+
return language.trim().toUpperCase();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
// Config file exists but couldn't be parsed
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
return undefined;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=template-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-provider.js","sourceRoot":"","sources":["../../../src/templates/locales/template-provider.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ukrainian Language Strategy
|
|
3
|
+
* @module templates/locales/ukr
|
|
4
|
+
*/
|
|
5
|
+
import type { LanguageStrategy } from '../language-strategy.js';
|
|
6
|
+
export declare const ukrainianStrategy: LanguageStrategy;
|
|
7
|
+
export { getSectionTitle, getSectionDescription } from './sections.js';
|
|
8
|
+
export { getTemplate, getWorkflowGuide, getReadmeContent } from './templates.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/locales/ukr/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAoC,MAAM,yBAAyB,CAAC;AAIlG,eAAO,MAAM,iBAAiB,EAAE,gBAwB/B,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ukrainian Language Strategy
|
|
3
|
+
* @module templates/locales/ukr
|
|
4
|
+
*/
|
|
5
|
+
import { getSectionTitle, getSectionDescription } from './sections.js';
|
|
6
|
+
import { getTemplate, getWorkflowGuide, getReadmeContent } from './templates.js';
|
|
7
|
+
export const ukrainianStrategy = {
|
|
8
|
+
code: 'UKR',
|
|
9
|
+
name: 'Ukrainian',
|
|
10
|
+
nativeName: 'Українська',
|
|
11
|
+
getSectionTitle(section) {
|
|
12
|
+
return { title: getSectionTitle(section), section };
|
|
13
|
+
},
|
|
14
|
+
getSectionDescription(section) {
|
|
15
|
+
return { description: getSectionDescription(section), section };
|
|
16
|
+
},
|
|
17
|
+
getTemplate(section) {
|
|
18
|
+
return getTemplate(section);
|
|
19
|
+
},
|
|
20
|
+
getWorkflowGuide() {
|
|
21
|
+
return getWorkflowGuide();
|
|
22
|
+
},
|
|
23
|
+
getReadmeContent(projectName) {
|
|
24
|
+
return getReadmeContent(projectName);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export { getSectionTitle, getSectionDescription } from './sections.js';
|
|
28
|
+
export { getTemplate, getWorkflowGuide, getReadmeContent } from './templates.js';
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/templates/locales/ukr/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEjF,MAAM,CAAC,MAAM,iBAAiB,GAAqB;IACjD,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,WAAW;IACjB,UAAU,EAAE,YAAY;IAExB,eAAe,CAAC,OAAqB;QACnC,OAAO,EAAE,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACtD,CAAC;IAED,qBAAqB,CAAC,OAAqB;QACzC,OAAO,EAAE,WAAW,EAAE,qBAAqB,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IAClE,CAAC;IAED,WAAW,CAAC,OAAqB;QAC/B,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,gBAAgB;QACd,OAAO,gBAAgB,EAAE,CAAC;IAC5B,CAAC;IAED,gBAAgB,CAAC,WAAoB;QACnC,OAAO,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;CACF,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ukrainian Section Titles and Descriptions
|
|
3
|
+
* @module templates/locales/ukr/sections
|
|
4
|
+
*/
|
|
5
|
+
import type { Arc42Section } from '../../../types.js';
|
|
6
|
+
export declare const SECTION_TITLES: Record<Arc42Section, string>;
|
|
7
|
+
export declare const SECTION_DESCRIPTIONS: Record<Arc42Section, string>;
|
|
8
|
+
export declare function getSectionTitle(section: Arc42Section): string;
|
|
9
|
+
export declare function getSectionDescription(section: Arc42Section): string;
|
|
10
|
+
//# sourceMappingURL=sections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../../../../src/templates/locales/ukr/sections.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAavD,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAa7D,CAAC;AAEF,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAE7D;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAEnE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ukrainian Section Titles and Descriptions
|
|
3
|
+
* @module templates/locales/ukr/sections
|
|
4
|
+
*/
|
|
5
|
+
export const SECTION_TITLES = {
|
|
6
|
+
'01_introduction_and_goals': 'Вступ та цілі',
|
|
7
|
+
'02_architecture_constraints': 'Обмеження архітектури',
|
|
8
|
+
'03_context_and_scope': 'Контекст та обсяг',
|
|
9
|
+
'04_solution_strategy': 'Стратегія рішення',
|
|
10
|
+
'05_building_block_view': 'Вигляд будівельних блоків',
|
|
11
|
+
'06_runtime_view': 'Вигляд часу виконання',
|
|
12
|
+
'07_deployment_view': 'Вигляд розгортання',
|
|
13
|
+
'08_concepts': 'Наскрізні концепції',
|
|
14
|
+
'09_architecture_decisions': 'Архітектурні рішення',
|
|
15
|
+
'10_quality_requirements': 'Вимоги до якості',
|
|
16
|
+
'11_technical_risks': 'Ризики та технічний борг',
|
|
17
|
+
'12_glossary': 'Глосарій'
|
|
18
|
+
};
|
|
19
|
+
export const SECTION_DESCRIPTIONS = {
|
|
20
|
+
'01_introduction_and_goals': 'Постановка завдання, цілі якості та зацікавлені сторони',
|
|
21
|
+
'02_architecture_constraints': 'Технічні та організаційні обмеження',
|
|
22
|
+
'03_context_and_scope': 'Бізнес та технічний контекст, зовнішні інтерфейси',
|
|
23
|
+
'04_solution_strategy': 'Основні рішення та стратегії',
|
|
24
|
+
'05_building_block_view': 'Статична декомпозиція системи',
|
|
25
|
+
'06_runtime_view': 'Динамічна поведінка та важливі сценарії',
|
|
26
|
+
'07_deployment_view': 'Інфраструктура та розгортання',
|
|
27
|
+
'08_concepts': 'Наскрізні правила та підходи до рішення',
|
|
28
|
+
'09_architecture_decisions': 'Важливі, дорогі, критичні або ризиковані рішення',
|
|
29
|
+
'10_quality_requirements': 'Дерево якості та сценарії якості',
|
|
30
|
+
'11_technical_risks': 'Відомі проблеми, ризики та технічний борг',
|
|
31
|
+
'12_glossary': 'Важливі бізнес та технічні терміни'
|
|
32
|
+
};
|
|
33
|
+
export function getSectionTitle(section) {
|
|
34
|
+
return SECTION_TITLES[section];
|
|
35
|
+
}
|
|
36
|
+
export function getSectionDescription(section) {
|
|
37
|
+
return SECTION_DESCRIPTIONS[section];
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=sections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sections.js","sourceRoot":"","sources":["../../../../src/templates/locales/ukr/sections.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,cAAc,GAAiC;IAC1D,2BAA2B,EAAE,eAAe;IAC5C,6BAA6B,EAAE,uBAAuB;IACtD,sBAAsB,EAAE,mBAAmB;IAC3C,sBAAsB,EAAE,mBAAmB;IAC3C,wBAAwB,EAAE,2BAA2B;IACrD,iBAAiB,EAAE,uBAAuB;IAC1C,oBAAoB,EAAE,oBAAoB;IAC1C,aAAa,EAAE,qBAAqB;IACpC,2BAA2B,EAAE,sBAAsB;IACnD,yBAAyB,EAAE,kBAAkB;IAC7C,oBAAoB,EAAE,0BAA0B;IAChD,aAAa,EAAE,UAAU;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAiC;IAChE,2BAA2B,EAAE,yDAAyD;IACtF,6BAA6B,EAAE,qCAAqC;IACpE,sBAAsB,EAAE,mDAAmD;IAC3E,sBAAsB,EAAE,8BAA8B;IACtD,wBAAwB,EAAE,+BAA+B;IACzD,iBAAiB,EAAE,yCAAyC;IAC5D,oBAAoB,EAAE,+BAA+B;IACrD,aAAa,EAAE,yCAAyC;IACxD,2BAA2B,EAAE,kDAAkD;IAC/E,yBAAyB,EAAE,kCAAkC;IAC7D,oBAAoB,EAAE,2CAA2C;IACjE,aAAa,EAAE,oCAAoC;CACpD,CAAC;AAEF,MAAM,UAAU,eAAe,CAAC,OAAqB;IACnD,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAqB;IACzD,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ukrainian Templates
|
|
3
|
+
* @module templates/locales/ukr/templates
|
|
4
|
+
*/
|
|
5
|
+
import type { Arc42Section } from '../../../types.js';
|
|
6
|
+
export declare function getTemplate(section: Arc42Section): string;
|
|
7
|
+
export declare function getWorkflowGuide(): string;
|
|
8
|
+
export declare function getReadmeContent(projectName?: string): string;
|
|
9
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../../src/templates/locales/ukr/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CA8LzD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CA0BzC;AAED,wBAAgB,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAkB7D"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ukrainian Templates
|
|
3
|
+
* @module templates/locales/ukr/templates
|
|
4
|
+
*/
|
|
5
|
+
export function getTemplate(section) {
|
|
6
|
+
const templates = {
|
|
7
|
+
'01_introduction_and_goals': () => `# 1. Вступ та цілі
|
|
8
|
+
|
|
9
|
+
## Огляд вимог
|
|
10
|
+
|
|
11
|
+
**Мета**: Описати відповідні вимоги та рушійні сили.
|
|
12
|
+
|
|
13
|
+
### Ключові вимоги
|
|
14
|
+
|
|
15
|
+
| ID | Вимога | Пріоритет |
|
|
16
|
+
|----|--------|-----------|
|
|
17
|
+
| REQ-1 | [Короткий опис] | Високий |
|
|
18
|
+
| REQ-2 | [Короткий опис] | Середній |
|
|
19
|
+
|
|
20
|
+
## Цілі якості
|
|
21
|
+
|
|
22
|
+
| Пріоритет | Ціль якості | Мотивація |
|
|
23
|
+
|-----------|-------------|-----------|
|
|
24
|
+
| 1 | [напр., Продуктивність] | [Чому це критично] |
|
|
25
|
+
| 2 | [напр., Безпека] | [Чому це критично] |
|
|
26
|
+
|
|
27
|
+
## Зацікавлені сторони
|
|
28
|
+
|
|
29
|
+
| Роль/Ім'я | Контакт | Очікування |
|
|
30
|
+
|-----------|---------|------------|
|
|
31
|
+
| Власник продукту | [Ім'я/Email] | [Очікування від архітектури] |
|
|
32
|
+
`,
|
|
33
|
+
'02_architecture_constraints': () => `# 2. Обмеження архітектури
|
|
34
|
+
|
|
35
|
+
## Технічні обмеження
|
|
36
|
+
|
|
37
|
+
| Обмеження | Обґрунтування |
|
|
38
|
+
|-----------|---------------|
|
|
39
|
+
| [напр., Хмарна платформа] | [Чому існує це обмеження] |
|
|
40
|
+
|
|
41
|
+
## Організаційні обмеження
|
|
42
|
+
|
|
43
|
+
| Обмеження | Обґрунтування |
|
|
44
|
+
|-----------|---------------|
|
|
45
|
+
| [напр., Структура команди] | [Як це впливає на архітектуру] |
|
|
46
|
+
`,
|
|
47
|
+
'03_context_and_scope': () => `# 3. Контекст та обсяг
|
|
48
|
+
|
|
49
|
+
## Бізнес-контекст
|
|
50
|
+
|
|
51
|
+
### Діаграма контексту
|
|
52
|
+
|
|
53
|
+
\`\`\`
|
|
54
|
+
[Створіть діаграму, що показує вашу систему та зовнішні системи/користувачів]
|
|
55
|
+
\`\`\`
|
|
56
|
+
|
|
57
|
+
### Зовнішні інтерфейси
|
|
58
|
+
|
|
59
|
+
| Зовнішня сутність | Інтерфейс | Призначення |
|
|
60
|
+
|-------------------|-----------|-------------|
|
|
61
|
+
| [Зовнішня система 1] | [API/Протокол] | [Які дані/функції обмінюються] |
|
|
62
|
+
`,
|
|
63
|
+
'04_solution_strategy': () => `# 4. Стратегія рішення
|
|
64
|
+
|
|
65
|
+
## Ключові рішення
|
|
66
|
+
|
|
67
|
+
### Архітектурні патерни
|
|
68
|
+
|
|
69
|
+
| Патерн | Мотивація | Наслідки |
|
|
70
|
+
|--------|-----------|----------|
|
|
71
|
+
| [напр., Мікросервіси] | [Чому обраний цей патерн] | [Переваги та компроміси] |
|
|
72
|
+
|
|
73
|
+
### Технологічні рішення
|
|
74
|
+
|
|
75
|
+
| Компонент | Технологія | Причина |
|
|
76
|
+
|-----------|------------|---------|
|
|
77
|
+
| Бекенд | [напр., Node.js] | [Чому обрано] |
|
|
78
|
+
`,
|
|
79
|
+
'05_building_block_view': () => `# 5. Вигляд будівельних блоків
|
|
80
|
+
|
|
81
|
+
## Рівень 1: Контекст системи
|
|
82
|
+
|
|
83
|
+
\`\`\`
|
|
84
|
+
[Діаграма компонентів з основними будівельними блоками]
|
|
85
|
+
\`\`\`
|
|
86
|
+
|
|
87
|
+
| Компонент | Відповідальність |
|
|
88
|
+
|-----------|------------------|
|
|
89
|
+
| [Компонент 1] | [Що робить] |
|
|
90
|
+
`,
|
|
91
|
+
'06_runtime_view': () => `# 6. Вигляд часу виконання
|
|
92
|
+
|
|
93
|
+
## Ключові сценарії
|
|
94
|
+
|
|
95
|
+
### Сценарій 1: [Назва]
|
|
96
|
+
|
|
97
|
+
**Опис**: [Що відбувається в цьому сценарії]
|
|
98
|
+
|
|
99
|
+
\`\`\`mermaid
|
|
100
|
+
sequenceDiagram
|
|
101
|
+
participant Користувач
|
|
102
|
+
participant Фронтенд
|
|
103
|
+
participant API
|
|
104
|
+
\`\`\`
|
|
105
|
+
`,
|
|
106
|
+
'07_deployment_view': () => `# 7. Вигляд розгортання
|
|
107
|
+
|
|
108
|
+
## Огляд інфраструктури
|
|
109
|
+
|
|
110
|
+
\`\`\`
|
|
111
|
+
[Діаграма з серверами, контейнерами, мережами]
|
|
112
|
+
\`\`\`
|
|
113
|
+
|
|
114
|
+
| Компонент | Технологія | Конфігурація |
|
|
115
|
+
|-----------|------------|--------------|
|
|
116
|
+
| [Сервер додатків] | [AWS ECS] | [Специфікації] |
|
|
117
|
+
`,
|
|
118
|
+
'08_concepts': () => `# 8. Наскрізні концепції
|
|
119
|
+
|
|
120
|
+
## Доменні моделі
|
|
121
|
+
|
|
122
|
+
| Сутність | Відповідальність | Зв'язки |
|
|
123
|
+
|----------|------------------|---------|
|
|
124
|
+
| [Сутність 1] | [Призначення] | [Пов'язані сутності] |
|
|
125
|
+
|
|
126
|
+
## Безпека
|
|
127
|
+
|
|
128
|
+
### Автентифікація
|
|
129
|
+
- Метод: [JWT, OAuth2, тощо]
|
|
130
|
+
`,
|
|
131
|
+
'09_architecture_decisions': () => `# 9. Архітектурні рішення
|
|
132
|
+
|
|
133
|
+
### ADR-001: [Назва рішення]
|
|
134
|
+
|
|
135
|
+
**Дата**: [РРРР-ММ-ДД]
|
|
136
|
+
**Статус**: [Запропоновано | Прийнято | Застаріло]
|
|
137
|
+
|
|
138
|
+
**Контекст**: [Опис проблеми]
|
|
139
|
+
|
|
140
|
+
**Рішення**: [Що ми вирішили]
|
|
141
|
+
|
|
142
|
+
**Наслідки**:
|
|
143
|
+
- Позитивні: [Перевага 1]
|
|
144
|
+
- Негативні: [Компроміс 1]
|
|
145
|
+
`,
|
|
146
|
+
'10_quality_requirements': () => `# 10. Вимоги до якості
|
|
147
|
+
|
|
148
|
+
## Дерево якості
|
|
149
|
+
|
|
150
|
+
\`\`\`
|
|
151
|
+
Якість
|
|
152
|
+
├── Продуктивність
|
|
153
|
+
├── Безпека
|
|
154
|
+
├── Надійність
|
|
155
|
+
└── Підтримуваність
|
|
156
|
+
\`\`\`
|
|
157
|
+
|
|
158
|
+
## Сценарії якості
|
|
159
|
+
|
|
160
|
+
| Аспект | Опис |
|
|
161
|
+
|--------|------|
|
|
162
|
+
| Сценарій | Користувач запитує дані при нормальному навантаженні |
|
|
163
|
+
| Міра | 95-й персентиль часу відповіді < 200мс |
|
|
164
|
+
`,
|
|
165
|
+
'11_technical_risks': () => `# 11. Ризики та технічний борг
|
|
166
|
+
|
|
167
|
+
## Ризики
|
|
168
|
+
|
|
169
|
+
| Ризик | Ймовірність | Вплив | Статус |
|
|
170
|
+
|-------|-------------|-------|--------|
|
|
171
|
+
| [Ризик 1] | [Високий/Середній/Низький] | [Високий/Середній/Низький] | [Відкритий/Пом'якшений] |
|
|
172
|
+
|
|
173
|
+
## Технічний борг
|
|
174
|
+
|
|
175
|
+
| Елемент | Тип | Вплив | Пріоритет |
|
|
176
|
+
|---------|-----|-------|-----------|
|
|
177
|
+
| [Борг 1] | [Код/Архітектура] | [Високий/Середній/Низький] | [1-5] |
|
|
178
|
+
`,
|
|
179
|
+
'12_glossary': () => `# 12. Глосарій
|
|
180
|
+
|
|
181
|
+
## Бізнес-терміни
|
|
182
|
+
|
|
183
|
+
| Термін | Визначення |
|
|
184
|
+
|--------|------------|
|
|
185
|
+
| [Бізнес-термін 1] | [Чітке, коротке визначення] |
|
|
186
|
+
|
|
187
|
+
## Технічні терміни
|
|
188
|
+
|
|
189
|
+
| Термін | Визначення | Синоніми |
|
|
190
|
+
|--------|------------|----------|
|
|
191
|
+
| [Технічний термін 1] | [Визначення] | [Альтернативні назви] |
|
|
192
|
+
`
|
|
193
|
+
};
|
|
194
|
+
return templates[section]();
|
|
195
|
+
}
|
|
196
|
+
export function getWorkflowGuide() {
|
|
197
|
+
return `# Посібник з документування архітектури arc42
|
|
198
|
+
|
|
199
|
+
## Огляд
|
|
200
|
+
|
|
201
|
+
Цей посібник допоможе вам документувати архітектуру програмного забезпечення за допомогою шаблону arc42.
|
|
202
|
+
|
|
203
|
+
## 12 розділів arc42
|
|
204
|
+
|
|
205
|
+
1. **Вступ та цілі** - Визначте, що ви будуєте і чому
|
|
206
|
+
2. **Обмеження архітектури** - Що вам НЕ дозволено робити?
|
|
207
|
+
3. **Контекст та обсяг** - Що всередині, а що ззовні?
|
|
208
|
+
4. **Стратегія рішення** - Високорівневий підхід
|
|
209
|
+
5. **Вигляд будівельних блоків** - Статична структура
|
|
210
|
+
6. **Вигляд часу виконання** - Динамічна поведінка
|
|
211
|
+
7. **Вигляд розгортання** - Інфраструктура
|
|
212
|
+
8. **Наскрізні концепції** - Патерни
|
|
213
|
+
9. **Архітектурні рішення** - Важливі рішення
|
|
214
|
+
10. **Вимоги до якості** - Сценарії якості
|
|
215
|
+
11. **Ризики та технічний борг** - Що може піти не так?
|
|
216
|
+
12. **Глосарій** - Визначення термінів
|
|
217
|
+
|
|
218
|
+
## Ресурси
|
|
219
|
+
|
|
220
|
+
- [arc42 Веб-сайт](https://arc42.org/)
|
|
221
|
+
`;
|
|
222
|
+
}
|
|
223
|
+
export function getReadmeContent(projectName) {
|
|
224
|
+
const name = projectName || 'Проект';
|
|
225
|
+
return `# ${name} - Документація архітектури
|
|
226
|
+
|
|
227
|
+
Цей каталог містить документацію архітектури для ${name}, засновану на шаблоні arc42.
|
|
228
|
+
|
|
229
|
+
## Структура
|
|
230
|
+
|
|
231
|
+
- \`sections/\` - Окремі markdown-файли розділів (12 розділів)
|
|
232
|
+
- \`images/\` - Діаграми та зображення
|
|
233
|
+
- \`config.yaml\` - Конфігурація
|
|
234
|
+
|
|
235
|
+
## Початок роботи
|
|
236
|
+
|
|
237
|
+
1. Почніть з розділу 1: Вступ та цілі
|
|
238
|
+
2. Опрацьовуйте розділи ітеративно
|
|
239
|
+
3. Використовуйте діаграми для ілюстрації концепцій
|
|
240
|
+
`;
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=templates.js.map
|