Skip to content

Dev - update #702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix Lowcocer Comps Documentation
  • Loading branch information
FalkWolsky committed Feb 22, 2024
commit 82c3de8565f9febaceff5aafa1d27860928f94dd
105 changes: 99 additions & 6 deletions client/packages/lowcoder-comps/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,100 @@
# lowcoder comp lib
# Lowcoder Extra Components

This is the workspace for Lowcoder Extra Components like Calendar, Image Editor, Mermaid Charts and eCharts.

## Local Development preparation

Navigate your terminal or bash to your /root folder (lowcoder repository) to install Lowcoder Extra Components dependencies and the Lowcoder SDK

To develop with the Lowcoder Extra Components after you clone the Lowcoder Repository, first make sure the Lowcoder SDK is local built.

```bash
cd client/packages/lowcoder-sdk
yarn build
```

## Start

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

```bash
cd client/packages/lowcoder-comps
yarn start
```

# or
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.

## Local development

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.

Data, methods and properties are visible and interactive, so you can test your Component during development. The view will get automatically refreshed.

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.

to see your component and include it in the processing on the development server, you have to do the folloiwing steps:

### modify /lowcoder-comps/package.json

```JSON
"yournewcomponent": {
"name": "Your new Component name",
"icon": "./icons/your-icon.svg",
"description": "A Component Plugin to ...",
"category": "itemHandling",
"layoutInfo": {
"w": 6,
"h": 30
}
}
```

npm start

Please choose one category out of:

- dashboards
- layout
- forms
- collaboration
- projectmanagement
- scheduling
- documents
- itemHandling
- multimedia
- integration

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.

### modify /lowcoder-comps/src/index.ts

```JavaScript
Add your Component for the exported members of Lowcoder Extra Components

import { ChartCompWithDefault } from "./comps/chartComp/chartComp";
import { ImageEditorComp } from "./comps/imageEditorComp/index";
import { CalendarComp } from "./comps/calendarComp/calendarComp";
import { MermaidComp } from "comps/mermaidComp";

import { YourComponent } from "comps/yourComponentFolder/yourComponent";

export default {
chart: ChartCompWithDefault,
imageEditor: ImageEditorComp,
calendar: CalendarComp,
mermaid: MermaidComp,

yourcomponent: YourComponent,
};
```
Now your Plugin should be visibe and displayed in the Lowcoder Component Builder at http://localhost:9000/

## Build

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

Before build you should change the version in package.json file.
This will build the current Component Plugins into a .tgz file that you can upload.

**Before build you should change the version in package.json file.**

```bash
yarn build
Expand All @@ -25,3 +103,18 @@ yarn build

npm run build
```

## How to publish a Component Plugin

With the following command you can publish the script to the NPM repository:

```bash
yarn build --publish
```

This command will publis the whole Lowcoder Extra Components bundle to [NPMjs](https://www.npmjs.com/)
Make sure, you updated the Version of Lowcoder Comps before in /lowcoder-comps/package.json

## Contribute your Plugin

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
2 changes: 1 addition & 1 deletion client/packages/lowcoder-comps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
},
"devDependencies": {
"jest": "29.3.0",
"vite": "^4.5.2",
"vite": "^5.0.12",
"vite-tsconfig-paths": "^3.6.0"
}
}