Skip to content

Commit 9ab27d5

Browse files
committed
ATR-18 Fixed reusable components issue
1 parent fc37097 commit 9ab27d5

File tree

2 files changed

+50
-77
lines changed

2 files changed

+50
-77
lines changed

structurizr/ng2react-core.dsl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
typescript = component "Typescript" "AST Parsing" "JavaScript" "External"
2+
ng2react_core = component "@ng2react/core" "Core business logic" "JavaScript" {
3+
this -> typescript "Uses"
4+
this -> openAi "Makes API calls to" "JSON/HTTPS"
5+
}

structurizr/workspace.dsl

Lines changed: 45 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,43 @@
11
workspace "ng2react" "A tool that converts AngularJS components to React using OpenAI API" {
22
!docs ./arc42
3+
!identifiers hierarchical
34
model {
4-
openAiApi = softwareSystem "OpenAI" "Public API for generative AI" "External"
5+
openAi = softwareSystem "OpenAI" "OpenAI API" "External"
56

6-
ng2react = softwareSystem "ng2react" "IDE Plugin" {
7-
feedbackApi = container "@ng2react/feedback" "API for submitting feedback from the IDE plugin" {
8-
feedbackDatabase = component "Feedback Database" "A database for storing feedback data"
9-
feedbackRestService = component "Feedback Service" "Handles communication between the API and the database" "OpenAPI" {
10-
feedbackRestService -> feedbackDatabase "Stores/Retrieves feedback"
11-
}
12-
feedbackViewer = component "Feedback Analysis Client" "A client for reviewing submitted feedback" {
13-
this -> feedbackRestService "Retrieves feedback"
14-
}
15-
}
7+
ng2react = softwareSystem "AngularJS to React" "Software System" {
8+
filesystem = container "File System" "Where the user's project files exist" {
169

17-
ng2react_core = container "@ng2react/core" "Main Ng2React API" "NodeJS" {
18-
typescript = component "Typescript" "AST Parsing" "JavaScript" "External"
19-
ng2react_core_component = component "@ng2react/core" "Core business logic" "JavaScript" {
20-
this -> typescript "Uses"
21-
this -> openAiApi "Uses"
22-
}
2310
}
2411

25-
ide_nodejs = container "NodeJS IDE" "IDEs that support JavaScript plugins" "IDE" {
26-
ng2react_vscode = component "@ng2react/vscode" "VSCode IDE Plugin" "JavaScript" {
27-
this -> ng2react_core_component "Uses"
28-
this -> feedbackRestService "Sends anlysis to"
29-
}
12+
cli_wrapper = container "@ng2react/cli" "Command line interface for ng2react" "stdio" {
13+
!include ng2react-core.dsl
3014
}
3115

32-
ng2react_cli = container "@ng2react/cli" "Command line interface for ng2react" "stdio" {
33-
typescript_cli = component "Typescript" "AST Parsing" "JavaScript" "External"
34-
ng2react_core_component_cli = component "@ng2react/core" "Core business logic" "JavaScript" {
35-
this -> typescript_cli "Uses"
36-
this -> openAiApi "Uses"
37-
}
38-
ng2react_cli_component = component "@ng2react/cli" "Command line interface for ng2react" "JavaScript" {
39-
this -> ng2react_core_component_cli "Uses"
16+
IDE = container "Generic IDE" "Integrated Development Environment" "Native" {
17+
ide_plugin = component "IDE Extension" "IDE Specific Implementation" "Native" {
18+
this -> cli_wrapper.ng2react_core "Makes API calls" "stdio"
19+
this -> filesystem "Read/Write"
4020
}
4121
}
4222

43-
ng2react_ide_generic = container "Generic IDE" "IDEs without native JavaScript support" "IntelliJ, Eclipse, NeoVim, etc." {
44-
ng2react_intellij = component "@ng2react/intellij" "IntelliJ Plugin" "Kotlin" "Proposed" {
45-
this -> ng2react_cli_component "Uses"
23+
vscode = container "VSCode" "JavaScript IDE" {
24+
!include ng2react-core.dsl
25+
ide_plugin = component "IDE Plugin" "IDE Extension" "JavaScript" {
26+
this -> ng2react_core "Uses" "JavaScript API"
27+
this -> filesystem "Read/Write"
4628
}
47-
ng2react_neovim = component "@ng2react/NeoVim" "NeoVim Plugin" "Lua" "Proposed" {
48-
this -> ng2react_cli_component "Uses"
49-
}
50-
ng2react_eclipse = component "@ng2react/eclipse" "Eclipse Plugin" "Java" "Proposed" {
51-
this -> ng2react_cli_component "Uses"
52-
}
5329
}
54-
}
55-
56-
product_contributor = person "Developer/Analist" "A contributor to the ng2react software system." {
57-
this -> feedbackViewer "Analyses data from"
5830
}
59-
60-
generic_ide_user = person "User" "AngularJS/React developer who wants to convert AngularJS components to React" {
61-
this -> ide_nodejs "Uses"
62-
this -> ng2react_ide_generic "Uses"
31+
32+
ide_user = person "User" "AngularJS/React developer who wants to convert AngularJS components to React" {
33+
this -> ng2react.IDE.ide_plugin "Uses"
34+
this -> ng2react.VSCode.ide_plugin "Uses"
6335
}
6436

6537
deploymentEnvironment "Live" {
6638
deploymentNode "Developer Laptop" "" "Microsoft Windows 10 or Apple macOS" {
6739
deploymentNode "IDE" "" "An integrated development environment with ng2react plugin support" {
68-
plugin = containerInstance ide_nodejs
69-
}
70-
}
71-
deploymentNode "Remote Server" "" "Feedback API" "" {
72-
deploymentNode "FeedbackAPI" "" "" {
73-
// softwareSystemInstance feedbackApi
74-
server = containerInstance feedbackApi
75-
40+
ideWithPlugin = containerInstance ng2react.IDE
7641
}
7742
}
7843
}
@@ -84,53 +49,56 @@ workspace "ng2react" "A tool that converts AngularJS components to React using O
8449
autoLayout
8550
}
8651

87-
container ng2react "IDE_Containers" {
52+
container ng2react "SoftwareSystem_Generic" {
8853
include *
54+
exclude ng2react.vscode
8955
autoLayout lr
9056
}
9157

92-
container ng2react "IDE_Containers_VSCode" {
93-
include *
94-
exclude ng2react_ide_generic ng2react_cli
95-
autoLayout
96-
}
97-
98-
container ng2react "IDE_Containers_Generic" {
99-
include *
100-
exclude ng2react_vscode feedbackApi ide_nodejs product_contributor ng2react_core
101-
autoLayout
102-
}
103-
104-
105-
component ng2react_ide_generic "Generic_IDE_Plugins" {
58+
container ng2react "SoftwareSystem_VSCode" {
10659
include *
60+
exclude ng2react.IDE ng2react.cli_wrapper
10761
autoLayout lr
10862
}
10963

110-
component ide_nodejs "NodeJS_IDE_Plugins" {
64+
component ng2react.IDE "Generic_IDE" {
11165
include *
11266
autoLayout lr
11367
}
11468

115-
component ng2react_core "Ng2React_Core" {
69+
component ng2react.cli_wrapper "AngularJS2React_CLI" {
11670
include *
11771
autoLayout lr
11872
}
11973

120-
component ng2react_cli "Ng2React_CLI" {
74+
component ng2react.vscode "VSCode_IDE" {
12175
include *
12276
autoLayout lr
12377
}
12478

125-
component feedbackApi "Feedback_API" {
79+
deployment ng2react "Live" {
12680
include *
12781
autoLayout lr
82+
description "An example development deployment scenario for the Internet Banking System."
12883
}
12984

130-
deployment ng2react "Live" {
131-
include *
85+
dynamic ng2react "ScanProject" {
86+
title "User converts AngularJS component to React"
87+
ide_user -> ng2react.IDE "Opens AngularJS project inside IDE"
88+
ng2react.IDE -> ng2react.cli_wrapper "Sends files for analysis"
89+
ng2react.cli_wrapper -> ng2react.IDE "Returns list of convertable components"
90+
ng2react.IDE -> ide_user "Displays list of convertable components"
13291
autoLayout
133-
description "An example development deployment scenario for the Internet Banking System."
92+
}
93+
94+
dynamic ng2react {
95+
title "User converts AngularJS component to React"
96+
ide_user -> ng2react.IDE "Selects component for conversion"
97+
ng2react.IDE -> ng2react.cli_wrapper "Sends component reference"
98+
ng2react.cli_wrapper -> openAi "Sends generated prompt"
99+
ng2react.cli_wrapper -> ng2react.IDE "Returns Markdown, JSX, and original prompt"
100+
ng2react.IDE -> ide_user "Displays markdown response with save options"
101+
autoLayout lr
134102
}
135103

136104
theme default

0 commit comments

Comments
 (0)