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/dev_guide/extensions_guidelines.md
+29-9Lines changed: 29 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
This article pretends to give some guideles on tech stack, code style and tools that Connect team considers usefull and easiest to get starting with extensions.
1
+
This article pretends to give some guidelines on the tech stack, code style and tools that the Connect team considers useful and easiest to get started with extensions.
2
2
3
3
4
4
## Tech Stack
@@ -9,8 +9,9 @@ This article pretends to give some guideles on tech stack, code style and tools
9
9
- Pagination: fastapi-pagination
10
10
- Filtering and sorting: fastapi_filter
11
11
- Api data representation: pydantic
12
-
- Dependency managment: poetry
12
+
- Dependency management: poetry
13
13
- Docker for extension execution: Using connect-extension-runner image.
14
+
- Frontend framework: Vue 3
14
15
15
16
## Testing
16
17
@@ -23,7 +24,7 @@ This article pretends to give some guideles on tech stack, code style and tools
23
24
24
25
### [Flake8](https://flake8.pycqa.org/en/latest/)
25
26
26
-
Next we show the list of all plugins that are included by default on template's project.
27
+
Next, we show the list of all plugins that are included by default in the template's project.
27
28
28
29
* max-lines: 100
29
30
* max-cognitive-complexity: 15
@@ -38,24 +39,43 @@ Next we show the list of all plugins that are included by default on template's
38
39
* flake8-eradicate
39
40
* flake8-string-format
40
41
41
-
Another tool that it's not included in our stack yet, but you may want to consider to add on top, it's[black](https://black.readthedocs.io/en/stable/).
42
+
Another tool that's not included in our stack yet, but you may want to consider adding it on top, is[black](https://black.readthedocs.io/en/stable/).
42
43
43
-
If that's the case, you'll need to include the next packages.
44
+
If that's the case, you'll need to include the following packages.
44
45
45
46
* black
46
47
* flake8-black
47
48
49
+
## Frontend
50
+
51
+
### Development
52
+
In the Connect team, we use [Vue 3](https://vuejs.org/) to develop the frontend for our extensions, but this is not binding; any framework (or even vanilla JS) can be used. Vue 3 is not included in the extensions bootstrapped via the Connect CLI.
53
+
54
+
We also use the [Connect UI Toolkit](https://github.com/cloudblue/connect-ui-toolkit) library to deal with the communication from the extensions to the Connect Portal, such as requesting data, sending events or performing navigation from within the extensions. This library also exposes multiple web components, styled like the Connect Portal components, that can be used in the extensions, such as icons, cards, or navigation components, among others, and other useful tools, and it is included by default in the extensions bootstrapped via the Connect CLI.
55
+
56
+
### Builds
57
+
It is very important to note that **the static distribution files need to be in version control**, since there is no build process when running the extensions in cloud mode. Make sure you commit your distribution files!
58
+
59
+
### Tooling
60
+
An extension bootstrapped via the Connect CLI will come with several tools already configured:
61
+
-[Webpack](https://webpack.js.org/), to build and bundle the frontend codebase
62
+
-[Jest](https://jestjs.io/), to run unit tests
63
+
-[ESLint](https://eslint.org/), to lint the code
64
+
65
+
You can use any other tool as a replacement, as these libraries are only used for development. You might consider using [Vite](https://vitejs.dev/) and [Vitest](https://vitest.dev/) instead of Webpack and Jest, or add [Prettier](https://prettier.io/) to format the code; we use these tools in some of our extensions.
66
+
67
+
48
68
## CI/CD
49
69
50
70
### Tests workflow
51
71
52
-
By default, our bootstrap will create a github workflow with 4 jobs, 3 for backend tests, one per each one of this python versions: 3.8, 3.9, 3.10.
53
-
Here, we have to clarify that the only mandatory version at this moment is 3.10, which is the one that its included in the latest connect-extension-runner. The other two can be removed if there is no intention of exposing this extension to be run in your own servers.
72
+
By default, our bootstrap will create a GitHub workflow with 4 jobs, 3 for backend tests, and one for each of these python versions: 3.8, 3.9, 3.10.
73
+
Here, we have to clarify that the only mandatory version at this moment is 3.10, which is the one that's included in the latest `connect-extension-runner`. The other two can be removed if there is no intention of exposing this extension to be run on your own servers.
54
74
55
-
The 4th job is the one in charge of running frontend tests.
75
+
The fourth job is the one in charge of running frontend tests.
0 commit comments