Skip to content

Commit 82c3de8

Browse files
author
FalkWolsky
committed
Fix Lowcocer Comps Documentation
1 parent c2542e4 commit 82c3de8

File tree

2 files changed

+100
-7
lines changed

2 files changed

+100
-7
lines changed
Lines changed: 99 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,100 @@
1-
# lowcoder comp lib
1+
# Lowcoder Extra Components
2+
3+
This is the workspace for Lowcoder Extra Components like Calendar, Image Editor, Mermaid Charts and eCharts.
4+
5+
## Local Development preparation
6+
7+
Navigate your terminal or bash to your /root folder (lowcoder repository) to install Lowcoder Extra Components dependencies and the Lowcoder SDK
8+
9+
To develop with the Lowcoder Extra Components after you clone the Lowcoder Repository, first make sure the Lowcoder SDK is local built.
10+
11+
```bash
12+
cd client/packages/lowcoder-sdk
13+
yarn build
14+
```
215

316
## Start
417

5-
Start dev server to develop your comp lib.
18+
Now you can start the local dev server for Lowcoder Extra Components to develop and add your Component Plugin
619

720
```bash
21+
cd client/packages/lowcoder-comps
822
yarn start
23+
```
924

10-
# or
25+
The local dev server will build for roughly a minute and open then a Browser Window on http://localhost:9000/ with the Lowcoder Component Builder.
26+
27+
## Local development
28+
29+
After the local dev server is started, the Lowcoder Component Builder is prepared. A new browser window should open at http://localhost:9000 This is the Components Preview, which allows you to see your new component in action, as it would work in the Lowcoder Editor.
30+
31+
Data, methods and properties are visible and interactive, so you can test your Component during development. The view will get automatically refreshed.
32+
33+
The Lowcoder Component Builder makes the development & publishing of multiple individual components as bundle possible. Find the /src/comps folder in /lowcoder-comps. Here are existing components to find. It is suggested for new components to create a new folder. In the left navigation of the Components Preview you can switch between your components.
34+
35+
to see your component and include it in the processing on the development server, you have to do the folloiwing steps:
36+
37+
### modify /lowcoder-comps/package.json
38+
39+
```JSON
40+
"yournewcomponent": {
41+
"name": "Your new Component name",
42+
"icon": "./icons/your-icon.svg",
43+
"description": "A Component Plugin to ...",
44+
"category": "itemHandling",
45+
"layoutInfo": {
46+
"w": 6,
47+
"h": 30
48+
}
49+
}
50+
```
1151

12-
npm start
52+
53+
Please choose one category out of:
54+
55+
- dashboards
56+
- layout
57+
- forms
58+
- collaboration
59+
- projectmanagement
60+
- scheduling
61+
- documents
62+
- itemHandling
63+
- multimedia
64+
- integration
65+
66+
layoutInfo helps you to define the size (in grid-cells) of your Component in the grid for the very first moment, when a user drags your Component out of the components display on the right side in the Lowcoder Editor.
67+
68+
### modify /lowcoder-comps/src/index.ts
69+
70+
```JavaScript
71+
Add your Component for the exported members of Lowcoder Extra Components
72+
73+
import { ChartCompWithDefault } from "./comps/chartComp/chartComp";
74+
import { ImageEditorComp } from "./comps/imageEditorComp/index";
75+
import { CalendarComp } from "./comps/calendarComp/calendarComp";
76+
import { MermaidComp } from "comps/mermaidComp";
77+
78+
import { YourComponent } from "comps/yourComponentFolder/yourComponent";
79+
80+
export default {
81+
chart: ChartCompWithDefault,
82+
imageEditor: ImageEditorComp,
83+
calendar: CalendarComp,
84+
mermaid: MermaidComp,
85+
86+
yourcomponent: YourComponent,
87+
};
1388
```
89+
Now your Plugin should be visibe and displayed in the Lowcoder Component Builder at http://localhost:9000/
1490

1591
## Build
1692

17-
Build current comp lib into a .tgz file that you can upload it to the Lowcoder Comp Market.
93+
When you finish development and all tests, you can build the Components to use it in runtime.
1894

19-
Before build you should change the version in package.json file.
95+
This will build the current Component Plugins into a .tgz file that you can upload.
96+
97+
**Before build you should change the version in package.json file.**
2098

2199
```bash
22100
yarn build
@@ -25,3 +103,18 @@ yarn build
25103

26104
npm run build
27105
```
106+
107+
## How to publish a Component Plugin
108+
109+
With the following command you can publish the script to the NPM repository:
110+
111+
```bash
112+
yarn build --publish
113+
```
114+
115+
This command will publis the whole Lowcoder Extra Components bundle to [NPMjs](https://www.npmjs.com/)
116+
Make sure, you updated the Version of Lowcoder Comps before in /lowcoder-comps/package.json
117+
118+
## Contribute your Plugin
119+
120+
If you wish to contribute your plugin and persist it as general Lowcoder Extra Component, please raise a PR to our /dev branch in the Lowcoder Community-Edition Repository https://github.com/lowcoder-org/lowcoder

client/packages/lowcoder-comps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
"devDependencies": {
7171
"jest": "29.3.0",
72-
"vite": "^4.5.2",
72+
"vite": "^5.0.12",
7373
"vite-tsconfig-paths": "^3.6.0"
7474
}
7575
}

0 commit comments

Comments
 (0)