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
+99-27Lines changed: 99 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,41 +18,43 @@ Few things are considered as rules while developing,
18
18
First lets see how the code is organised.
19
19
20
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/
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
45
```
46
46
47
47
There were around **18 packages** in the lesy framework. But what really matters is `core` and `compiler`, others are supporting features.
48
48
49
+
> Below content is being updated with more examples and illustration.
50
+
49
51
### Core
50
52
51
53
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.
Takes commands, process and strore them in a nice format
58
60
@@ -78,26 +80,96 @@ Orchestrate all the above components and run commands and middlewares
78
80
79
81
### Compiler
80
82
83
+
Compiler takes care of fewer tasks:
84
+
85
+
- If it is typescript project, loads ts-node to run ts files
86
+
- If src file is provided, loads all files provided and pass to core
87
+
- Runs code module and pass args provided in parse
88
+
- Loads default plugins
89
+
- Sets default config
90
+
- If global workspace value is set, it just returns core promise.
91
+
81
92
### Plugins
82
93
94
+
Plugins directory consist of all lesy plugins
95
+
83
96
### Misc
84
97
98
+
It consist of two packages, Pilot UI and test utils. Both packages are internally used and not published to npm.
99
+
100
+
- Pilot UI is build with Angular and manages complete user interface logic. It is compiled and build by pilot plugin. Then the dist directory is served.
101
+
102
+
- Test utils used inside few of the packages. It contains few helper methods.
103
+
85
104
### Testbed
86
105
106
+
Used for integration test. Basically Testbed will run lesy with user provided data and collect all console output and returns.
107
+
87
108
### Types
88
109
110
+
Contains all the type definition files of the core package.
111
+
89
112
### CLI
90
113
91
-
### Helpers
114
+
This package contains few lesy libraries and templates to scaffold new project based on the answers provided by users while initialising.
115
+
116
+
Unlike other packages, lesy CLI is not part of @lesy organisation in the npm. This is because, if it is under @lesy scope, then user have to do `npx @lesy/cli new my-cli`. To improve the user and developer experience, CLI package has been moved out of lesy org.
117
+
118
+
### Validator
119
+
120
+
This package is used to validate a object against a rules defined in another object. It works independently and not coupled with lesy in any way.
121
+
122
+
This library accepts custom rules.
123
+
124
+
### Compile and Build
92
125
93
-
### Build
126
+
Lesy is build with node and typescript. And this project is maintained as a monorepo. Based on the need, either `ncc` or `tsc` compiler is used. `ncc` is mainly used to compress the file and reduce the size.
127
+
128
+
[lerna]() is used to handle bootstraping and executing build script in all projects.
94
129
95
130
### Release
96
131
132
+
[lerna]() is handle quite a few things here,
133
+
134
+
- Versioning based on **conventional commits**
135
+
- Release all packages to npm
136
+
- Create tag and push to github
137
+
- Create release notes in github
138
+
- Update CHANGELOG file
139
+
- Update the new version in all package.json files
140
+
97
141
### Docs
98
142
143
+
Documentation is made using [gatsby](). All the markdown is build and published to `gh-pages` by the github actions.
144
+
99
145
### Pilot UI
100
146
147
+
Pilot UI is a angular project. Basically Pilot command in lesy will exposes necessary data though web sockets and Pilot UI receives and display.
148
+
149
+
When running command from UI, it send run signal and Pilot cmd runs the command and sends the ouput.
150
+
101
151
### Benchmark
102
152
153
+
[benny]() is used for benchmarking. [commander](), [gluegun](), and [yargs]() are used for comparition. The output JSON is used in the Performance page to represent as bar chart.
0 commit comments