You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/markdown/docs/dev/recipies/sample2.md
+98Lines changed: 98 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,3 +3,101 @@ title: Sample2
3
3
path: /docs/dev/sample2
4
4
icon: terminal-box-fill
5
5
---
6
+
7
+
Each and every part of Lesy is carefully handcrafted to provide a better experience to both developers and users. Yet, there is always a scope to improve the code base for the modern future.
8
+
9
+
Few things are considered as rules while developing,
10
+
11
+
-**Simpler** - _Dont complicate unneccesarily_
12
+
-**Maintainable** - _Stick with standard_
13
+
-**Decoupled** - _Do only one thing perfectly_
14
+
-**Extensible** - _Allow awesome minds to plug things_
15
+
16
+
### Project structure
17
+
18
+
First lets see how the code is organised.
19
+
20
+
```bash
21
+
lesy/
22
+
┣ benchmark/
23
+
┣ docs/
24
+
┗ packages/
25
+
┣ cli/
26
+
┣ compiler/ # includes ts node if it is typescript project
27
+
┣ core/ # handles user input and output
28
+
┣ testbed/
29
+
┣ types/
30
+
┣ helpers/
31
+
┗ validator/
32
+
┣ misc/
33
+
┣ pilot-ui/
34
+
┗ test-utils/
35
+
┗ plugins/
36
+
┣ lesy-plugin-config/
37
+
┣ lesy-plugin-demo/
38
+
┣ lesy-plugin-generator/
39
+
┣ lesy-plugin-help/
40
+
┣ lesy-plugin-pilot/
41
+
┣ lesy-plugin-prompt/
42
+
┣ lesy-plugin-sidekick/
43
+
┣ lesy-plugin-store/
44
+
┗ lesy-plugin-validator/
45
+
```
46
+
47
+
There were around **18 packages** in the lesy framework. But what really matters is `core` and `compiler`, others are supporting features.
48
+
49
+
### Core
50
+
51
+
As the name says, it is the heart <iclass="ri-heart-3-fill text-primary"></i> of the project. Main responsibility of the core is take user commands, convert them to objects and run them. Nothing more. It is slim, and can live without other things in the project.
52
+
53
+
Core components include,
54
+
55
+
#### Command Contoller
56
+
57
+
Takes commands, process and strore them in a nice format
58
+
59
+
#### Middleware Controller
60
+
61
+
Takes middlewares, stores in an array and execute when requested
62
+
63
+
#### Feature Controller
64
+
65
+
Takes features, stores and run when called
66
+
67
+
#### Loader
68
+
69
+
Load files and delegate to above controllers
70
+
71
+
#### Utilities
72
+
73
+
Wrap useful third party modules for commands to use
74
+
75
+
#### Core
76
+
77
+
Orchestrate all the above components and run commands and middlewares
0 commit comments