-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #270 from RabotaRu/v3.0.2
v3.0.2
- Loading branch information
Showing
76 changed files
with
1,966 additions
and
590 deletions.
There are no files selected for viewing
Binary file renamed
BIN
+27.7 MB
distrib/idea/IDEAPlugin-3.0.1.zip → distrib/idea/IDEAPlugin-3.0.3.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
imports: | ||
# - http://localhost:8080/metamodel/root.yaml | ||
- https://dochub.info/documentation/root.yaml | ||
# - root.yaml | ||
|
||
components: | ||
test: | ||
title: test | ||
entity: component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
entities: | ||
components: | ||
title: Архитектурный компонент | ||
description: > | ||
Компоненты являются базовыми сущностями DocHub. | ||
На их основе автоматически генерируются диаграммы связей. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
# Базовое описание сущности "Contexts" | ||
entities: | ||
contexts: | ||
title: Контексты | ||
description: > | ||
Представлять указанные архитектурные компоненты в виде диаграмм. | ||
schema: | ||
type: object | ||
patternProperties: | ||
"^[a-zA-Z][a-zA-Z0-9_-]*(\\.[a-zA-Z][a-zA-Z0-9_-]*)*$": | ||
type: object | ||
properties: | ||
title: | ||
title: Название контекста | ||
type: string | ||
location: | ||
title: Место расположения в меню | ||
type: string | ||
icon: | ||
title: Иконка в меню | ||
type: string | ||
components: | ||
title: Комппоненты контекста | ||
type: array | ||
items: | ||
type: string | ||
title: Идентификатор компонента или маска | ||
pattern: "^[a-zA-Z][a-zA-Z0-9\\_]*(\\.([a-zA-Z][a-zA-Z0-9\\_]*|\\*))*$" | ||
extra-links: | ||
title: Отображать компоненты ближайших связей | ||
type: boolean | ||
presentation: | ||
title: Принудительно определяет презентацию | ||
type: string | ||
enum: | ||
- plantuml | ||
- smartants | ||
uml: | ||
title: Кастомизация контекста | ||
oneOf: | ||
- type: string | ||
title: Путь к файлу PlantUML | ||
- type: object | ||
title: Дополнительные параметры | ||
properties: | ||
$before: | ||
title: Код встраиваемый до сгенерированного | ||
type: string | ||
$after: | ||
title: Код встраиваемый после сгенерированного | ||
type: string | ||
api: | ||
type: object | ||
title: Переопределяемые API | ||
properties: | ||
fetchComponents: | ||
type: string | ||
title: Возвращает список компонентов в кормате ключ-значение | ||
fetchLinks: | ||
type: string | ||
title: Возвращает список связей компонентов | ||
source: | ||
title: Источник данный (запрос или dataset) | ||
type: string | ||
anyOf: | ||
- type: string | ||
title: Идентификатор dataset | ||
pattern: "^[a-zA-Z][a-zA-Z0-9\_]*(\\.[a-zA-Z][a-zA-Z0-9\\_]*)*$" | ||
- type: string | ||
title: JSONata запрос | ||
pattern: "\\s*\\((.|\\s)*\\)\\s*" | ||
required: | ||
- title | ||
- components | ||
additionalProperties: false | ||
# Определяет пути к объектам сущности | ||
routes: | ||
context: "/:id" # Путь к контексту | ||
menu: > | ||
( | ||
$presentation := entities.contexts.config.defaultPresentation; | ||
$append([ | ||
{ | ||
"title": "Контексты", | ||
"location": 'Архитектура/Контексты', | ||
"icon": 'location_searching' | ||
} | ||
], | ||
contexts.$spread().( | ||
/* Если указана явно презентация, используем ее */ | ||
$presentation := $.*.presentation ? *.presentation : $presentation; | ||
*.location ? { | ||
"location": "Архитектура/Контексты/" & *.location, | ||
"link": "entities/contexts/" & $presentation & "?id=" & $keys()[0] | ||
} | ||
) | ||
); | ||
) | ||
# Предопределенные конфигурационные параметры для генерации контекстов | ||
config: | ||
# Идентификатор презентации по умолчанию | ||
defaultPresentation: plantuml # plantuml / smartants | ||
# Общие API функции для генерирования контекста | ||
api: | ||
# Возввращает компоненты входящие в контекст | ||
# Входящие параметры: | ||
# manifest - данные архитектуры | ||
# contextId - идентификатор контекста | ||
# extra-links - признак необходимости отразить окружение | ||
# componentId - идентификатор компонента для контекста SELF | ||
fetchComponents: > | ||
( | ||
/* Обрабатываем параметры */ | ||
$params := $; | ||
$manifest := $params.manifest; | ||
$context := $lookup($params.manifest.contexts, contextId); | ||
/* Определяем необходимость показывать ближайшие связи */ | ||
$isExtraLinks := $params.componentId ? true : $params."extra-links"; | ||
/* Определяем, какие компоненты покажем в контексте */ | ||
$showComponents := $params.componentId | ||
/* Если контекст под определенный компонент, ограничиваемся им. */ | ||
? [$params.componentId] | ||
/* Если нет берем все компоненты указанные в контексте */ | ||
: $context.components; | ||
/* Если в контексте переопределена функция получения компонентов, используем ее*/ | ||
$context.api.fetchComponents ? ( | ||
$eval($context.api.fetchComponents, $params) | ||
) : ( | ||
/* Получаем все компоненты входящие в контекст */ | ||
$components := $merge($showComponents.( | ||
$mask := $; | ||
$manifest.components.$spread().( | ||
$componentId := $keys()[0]; | ||
$wcard($componentId, $mask) ? $ | ||
) | ||
)); | ||
|
||
/* Добавляем окружение, если это нужно */ | ||
$merge([$components, $isExtraLinks ? ( | ||
$components.*.links.( | ||
{ | ||
id: $lookup($manifest.components, id) | ||
} | ||
); | ||
) : {}]); | ||
) | ||
) | ||
# На основании списка компонентов генерирует массиа областей которые они затрагивают | ||
# Входящие параметры: | ||
# components - список компонентов в формате fetchComponents | ||
fetchAreas: > | ||
( | ||
$distinct(components.$spread().( | ||
$componentId := $keys()[0]; | ||
$domains := $componentId.$split("."); | ||
$limit := $count($domains) - 1; | ||
$areaId := $map($domains, function($v, $i) {( | ||
$join($map($domains, function($sv, $si) { | ||
$si <= $i ? $sv | ||
}), ".") | ||
)}); | ||
))^($); | ||
) | ||
# Генерирует список отображаемых связей | ||
# Входящие параметры: | ||
# components - список компонентов в формате fetchComponents | ||
fetchLinks: > | ||
( | ||
/* Обрабатываем параметры */ | ||
$components := components; | ||
$distinct( | ||
$components.$spread().( | ||
$from := $keys()[0]; | ||
$direction := $.*.direction ? $.*.direction : "--"; | ||
$.*.links[$lookup($components, id)].( | ||
$title := title ? title : contract; | ||
$title := contract ? ("[[/docs/" & contract & " " & $title & "]]") : $title; | ||
{ | ||
"from": $from, | ||
"to": (id ? id : "undefined"), | ||
"title": $title, | ||
"contract": contract, | ||
"direction": direction ? direction : "--" | ||
} | ||
) | ||
) | ||
); | ||
) | ||
Oops, something went wrong.