Skip to content

Commit 652e28a

Browse files
authored
Merge pull request #111 from cloudblue/adding-guidelines-for-extensions-developing-frontend
Add guidelines for developing the frontend of extensions
2 parents f8d02b8 + 07290fa commit 652e28a

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

docs/dev_guide/extensions_guidelines.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff 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.
22

33

44
## Tech Stack
@@ -9,8 +9,9 @@ This article pretends to give some guideles on tech stack, code style and tools
99
- Pagination: fastapi-pagination
1010
- Filtering and sorting: fastapi_filter
1111
- Api data representation: pydantic
12-
- Dependency managment: poetry
12+
- Dependency management: poetry
1313
- Docker for extension execution: Using connect-extension-runner image.
14+
- Frontend framework: Vue 3
1415

1516
## Testing
1617

@@ -23,7 +24,7 @@ This article pretends to give some guideles on tech stack, code style and tools
2324

2425
### [Flake8](https://flake8.pycqa.org/en/latest/)
2526

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.
2728

2829
* max-lines: 100
2930
* max-cognitive-complexity: 15
@@ -38,24 +39,43 @@ Next we show the list of all plugins that are included by default on template's
3839
* flake8-eradicate
3940
* flake8-string-format
4041

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/).
4243

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.
4445

4546
* black
4647
* flake8-black
4748

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+
4868
## CI/CD
4969

5070
### Tests workflow
5171

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.
5474

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.
5676

5777

58-
## Another Tools
78+
## Other Tools
5979

6080
[Connect-cli](https://github.com/cloudblue/connect-cli)
6181

0 commit comments

Comments
 (0)