X Tutup
Skip to content

Commit ca68ef9

Browse files
authored
Merge pull request alibaba#110 from alibaba/chore/readme2
Chore/readme2
2 parents 6a642e8 + ef95b56 commit ca68ef9

File tree

12 files changed

+367
-176
lines changed

12 files changed

+367
-176
lines changed

README-zh_CN.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
<p align="center">
2+
<a href="https://lowcode-engine.cn">
3+
<img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01i8K9cD1d0HU7TjDtv_!!6000000003673-2-tps-500-591.png">
4+
</a>
5+
</p>
6+
7+
<h1 align="center">LowCodeEngine</h1>
8+
9+
<div align="center">
10+
11+
一套面向扩展设计的企业级低代码技术体系
12+
13+
[![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url]
14+
15+
[![Discussions][discussions-image]][discussions-url] [![][issues-helper-image]][issues-helper-url] [![Issues need help][help-wanted-image]][help-wanted-url]
16+
17+
[npm-image]: https://img.shields.io/npm/v/@alilc/lowcode-engine.svg?style=flat-square
18+
[npm-url]: http://npmjs.org/package/@alilc/lowcode-engine
19+
20+
[download-image]: https://img.shields.io/npm/dm/@alilc/lowcode-engine.svg?style=flat-square
21+
[download-url]: https://npmjs.org/package/@alilc/lowcode-engine
22+
[help-wanted-image]: https://flat.badgen.net/github/label-issues/alibaba/lowcode-engine/help%20wanted/open
23+
[help-wanted-url]: https://github.com/alibaba/lowcode-engine/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22
24+
[discussions-image]: https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square
25+
[discussions-url]: https://github.com/alibaba/lowcode-engine/discussions
26+
27+
[issues-helper-image]: https://img.shields.io/badge/using-issues--helper-orange?style=flat-square
28+
[issues-helper-url]: https://github.com/actions-cool/issues-helper
29+
30+
</div>
31+
32+
[![](https://img.alicdn.com/imgextra/i4/O1CN01GhzQuE1rnenyCCQTF_!!6000000005676-0-tps-2878-1588.jpg)](https://lowcode-engine.cn)
33+
34+
简体中文 | [English](./README.md)
35+
36+
## ✨ 特性
37+
38+
- 🌈 提炼自企业级低代码平台的面向扩展设计的内核引擎,奉行最小内核,最强生态的设计理念
39+
- 📦 开箱即用的高质量生态元素,包括 物料体系、设置器、插件 等
40+
- ⚙️ 完善的工具链,支持 物料体系、设置器、插件 等生态元素的全链路研发周期
41+
- 🔌 强大的扩展能力,已支撑近 100 个各种垂直类低代码平台
42+
- 🛡 使用 TypeScript 开发,提供完整的类型定义文件
43+
44+
## 🎯 兼容环境
45+
46+
- 现代浏览器(Chrome >= 80, Edge >= 80, last 2 safari versions, last 2 firefox versions)
47+
48+
## 📚 引擎协议
49+
50+
引擎完整实现了《阿里巴巴中后台前端基础搭建协议规范》和《阿里巴巴中后台前端物料协议规范》,协议栈是低代码领域的物料能否流通的关键部分。
51+
52+
![image](https://user-images.githubusercontent.com/1195765/150266126-fef3e3a9-d6a4-4f8e-8592-745f1a344162.png)
53+
54+
## 🌰 使用示例
55+
56+
```bash
57+
npm install @alilc/lowcode-engine --save-dev
58+
```
59+
60+
> **TIPS:仅支持 cdn 方式引入,npm 包用于提供 typings 等代码提示能力**
61+
62+
```ts
63+
import { init, skeleton } from '@alilc/lowcode-engine';
64+
65+
skeleton.add({
66+
area: 'topArea',
67+
type: 'Widget',
68+
name: 'logo',
69+
content: YourFantaticLogo,
70+
contentProps: {
71+
logo:
72+
'https://img.alicdn.com/tfs/TB1_SocGkT2gK0jSZFkXXcIQFXa-66-66.png',
73+
href: '/',
74+
},
75+
props: {
76+
align: 'left',
77+
width: 100,
78+
},
79+
});
80+
81+
init(document.getElementById('lce'));
82+
```
83+
84+
### 工程化配置:
85+
```json
86+
{
87+
"externals": {
88+
"@alilc/lowcode-engine": "var window.AliLowCodeEngine",
89+
"@alilc/lowcode-engine-ext": "var window.AliLowCodeEngineExt"
90+
}
91+
}
92+
```
93+
94+
### cdn 可选方式:
95+
#### 方式 1(推荐):alifd cdn
96+
```html
97+
https://alifd.alicdn.com/npm/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
98+
99+
https://alifd.alicdn.com/npm/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
100+
```
101+
102+
#### 方式 2:unpkg
103+
```html
104+
https://unpkg.com/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
105+
106+
https://unpkg.com/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
107+
```
108+
109+
#### 方式 3:jsdelivr
110+
```html
111+
https://cdn.jsdelivr.net/npm/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
112+
113+
https://cdn.jsdelivr.net/npm/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
114+
```
115+
116+
#### 方式 4:使用自有 cdn
117+
将源码中 packages/engine/dist 和 packages/(react|rax)-simulator-renderer/dist 下的文件传至你的 cdn 提供商
118+
119+
## 🔗 相关链接
120+
121+
- [官网首页](https://lowcode-engine.cn/)
122+
- [Demo 马上玩](https://lowcode-engine.cn/demo) | [引擎 Demo 仓库](https://github.com/alibaba/lowcode-demo)
123+
- [官方物料](https://github.com/alibaba/lowcode-materials)
124+
- [官方设置器(setter)](https://github.com/alibaba/lowcode-engine-ext)
125+
- [官方插件(plugin)](https://github.com/alibaba/lowcode-plugins)
126+
- [生态元素(物料、setter、插件)工具链](https://www.yuque.com/lce/doc/ulvlkz)
127+
- [用户文档](https://lowcode-engine.cn/doc)
128+
- [API [WIP]](https://lowcode-engine.cn/doc?url=vlmeme)
129+
130+
## 💻 本地调试
131+
132+
```bash
133+
$ git clone git@github.com:alibaba/lowcode-engine.git
134+
$ cd lowcode-engine
135+
$ npm install
136+
$ npm run setup
137+
$ npm start
138+
```
139+
140+
> 📢 npm 访问速度较慢,阿里员工可以使用 tnpm,其他同学建议使用 cnpm 或者指定镜像 registry。
141+
>
142+
> 📢 node 版本限定在 14
143+
>
144+
> 📢 windows 环境必须使用 [WSL](https://docs.microsoft.com/zh-cn/windows/wsl/install),其他终端不保证能正常运行
145+
146+
lowcode-engine 启动后,提供了几个 umd 文件,可以结合 [lowcode-demo](https://github.com/alibaba/lowcode-demo) 项目做调试,文件代理规则参考[这里](https://www.yuque.com/lce/doc/glz0fx)
147+
148+
## 🤝 参与共建
149+
150+
请先阅读:
151+
1. [如何配置引擎调试环境?](https://www.yuque.com/lce/doc/glz0fx)
152+
2. [关于引擎的研发协作流程](https://www.yuque.com/lce/doc/contributing)
153+
3. [引擎的工程化配置](https://www.yuque.com/lce/doc/gxwqg6)
154+
155+
> 强烈推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545)[《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html)[《如何向开源项目提交无法解答的问题》](https://zhuanlan.zhihu.com/p/25795393),更好的问题更容易获得帮助。(此段参考 [antd](https://github.com/ant-design/ant-design)

README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
<p align="center">
2+
<a href="http://lowcode-engine.cn">
3+
<img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01i8K9cD1d0HU7TjDtv_!!6000000003673-2-tps-500-591.png">
4+
</a>
5+
</p>
6+
7+
<h1 align="center">LowCodeEngine</h1>
8+
9+
<div align="center">
10+
11+
An enterprise-class low-code technology stack for scale-out design
12+
13+
[![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url]
14+
15+
[![Discussions][discussions-image]][discussions-url] [![][issues-helper-image]][issues-helper-url] [![Issues need help][help-wanted-image]][help-wanted-url]
16+
17+
[npm-image]: https://img.shields.io/npm/v/@alilc/lowcode-engine.svg?style=flat-square
18+
[npm-url]: http://npmjs.org/package/@alilc/lowcode-engine
19+
20+
[download-image]: https://img.shields.io/npm/dm/@alilc/lowcode-engine.svg?style=flat-square
21+
[download-url]: https://npmjs.org/package/@alilc/lowcode-engine
22+
[help-wanted-image]: https://flat.badgen.net/github/label-issues/alibaba/lowcode-engine/help%20wanted/open
23+
[help-wanted-url]: https://github.com/alibaba/lowcode-engine/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22
24+
[discussions-image]: https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square
25+
[discussions-url]: https://github.com/alibaba/lowcode-engine/discussions
26+
27+
[issues-helper-image]: https://img.shields.io/badge/using-issues--helper-orange?style=flat-square
28+
[issues-helper-url]: https://github.com/actions-cool/issues-helper
29+
30+
</div>
31+
32+
[![](https://img.alicdn.com/imgextra/i4/O1CN01GhzQuE1rnenyCCQTF_!!6000000005676-0-tps-2878-1588.jpg)](http://lowcode-engine.cn)
33+
34+
English | [简体中文](./README-zh_CN.md)
35+
36+
## ✨ Features
37+
38+
- 🌈 An extension-oriented kernel engine extracted from an enterprise-level low-code platform, pursuing the design concept of the smallest kernel and the strongest ecology
39+
- 📦 Out-of-the-box high-quality ecological elements, including material systems, setters, plugins, etc.
40+
- ⚙️ A complete tool chain, supporting the full-link R&D cycle of ecological elements such as material systems, setters, and plug-ins
41+
- 🔌 Powerful expansion capability, has supported nearly 100 various vertical low-code platforms
42+
- 🛡 Developed with TypeScript, providing complete type definition files
43+
44+
## 🎯 Compatible Environments
45+
46+
- Modern browsers (Chrome >= 80, Edge >= 80, last 2 safari versions, last 2 firefox versions)
47+
48+
## 📚 Engine Protocol
49+
50+
The engine fully implements the "Alibaba Mid-Backend Front-End Basic Construction Protocol Specification" and "Alibaba Mid-Backend Front-End Material Protocol Specification". The protocol stack is a key part of whether materials in the low-code field can be circulated.
51+
52+
![image](https://user-images.githubusercontent.com/1195765/150266126-fef3e3a9-d6a4-4f8e-8592-745f1a344162.png)
53+
54+
## 🌰 Usage example
55+
56+
```bash
57+
npm install @alilc/lowcode-engine --save-dev
58+
```
59+
60+
> **TIPS: Only cdn import is supported, npm package is used to provide code hinting capabilities such as typings**
61+
62+
```ts
63+
import { init, skeleton } from '@alilc/lowcode-engine';
64+
65+
skeleton.add({
66+
area: 'topArea',
67+
type: 'Widget',
68+
name: 'logo',
69+
content: YourFantaticLogo,
70+
contentProps: {
71+
logo:
72+
'https://img.alicdn.com/tfs/TB1_SocGkT2gK0jSZFkXXcIQFXa-66-66.png',
73+
href: '/',
74+
},
75+
props: {
76+
align: 'left',
77+
width: 100,
78+
},
79+
});
80+
81+
init(document.getElementById('lce'));
82+
```
83+
84+
### Engineering configuration:
85+
```json
86+
{
87+
"externals": {
88+
"@alilc/lowcode-engine": "var window.AliLowCodeEngine",
89+
"@alilc/lowcode-engine-ext": "var window.AliLowCodeEngineExt"
90+
}
91+
}
92+
```
93+
94+
### cdn optional method:
95+
#### Method 1: alifd cdn
96+
```html
97+
https://alifd.alicdn.com/npm/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
98+
99+
https://alifd.alicdn.com/npm/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
100+
```
101+
102+
#### Method 2: unpkg
103+
```html
104+
https://unpkg.com/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
105+
106+
https://unpkg.com/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
107+
```
108+
109+
#### Method 3: jsdelivr
110+
```html
111+
https://cdn.jsdelivr.net/npm/@alilc/lowcode-engine@1.0.0/dist/js/engine-core.js
112+
113+
https://cdn.jsdelivr.net/npm/@alilc/lowcode-react-simulator-renderer@1.0.0/dist/js/react-simulator-renderer.js
114+
```
115+
116+
#### Method 4: Use your own cdn
117+
Pass the files under packages/engine/dist and packages/(react|rax)-simulator-renderer/dist in the source code to your cdn provider
118+
119+
## 🔗 Related Links
120+
121+
- [Official website home page](http://lowcode-engine.cn/)
122+
- [Demo Play Now](http://lowcode-engine.cn/demo) | [Engine Demo Repository](https://github.com/alibaba/lowcode-demo)
123+
- [Official Materials](https://github.com/alibaba/lowcode-materials)
124+
- [official setter](https://github.com/alibaba/lowcode-engine-ext)
125+
- [Official plugin (plugin)](https://github.com/alibaba/lowcode-plugins)
126+
- [Ecological elements (materials, setters, plugins) toolchain](https://www.yuque.com/lce/doc/ulvlkz)
127+
- [User Documentation](http://lowcode-engine.cn/doc)
128+
- [API [WIP]](http://lowcode-engine.cn/doc?url=vlmeme)
129+
130+
## 💻 Local debugging
131+
132+
```bash
133+
$ git clone git@github.com: alibaba/lowcode-engine.git
134+
$ cd lowcode-engine
135+
$ npm install
136+
$ npm run setup
137+
$ npm start
138+
```
139+
140+
> 📢 npm access speed is slow, Alibaba employees can use tnpm, other students recommend using cnpm or specifying a mirror registry.
141+
>
142+
> 📢 node version limited to 14
143+
>
144+
> 📢 Windows environment must use [WSL](https://docs.microsoft.com/zh-cn/windows/wsl/install), other terminals are not guaranteed to work normally
145+
146+
After lowcode-engine is started, several umd files are provided, which can be debugged in combination with the [lowcode-demo](https://github.com/alibaba/lowcode-demo) project. Refer to the file proxy rules [here](https:/ /www.yuque.com/lce/doc/glz0fx).
147+
148+
## 🤝 Participate in co-construction
149+
150+
Please read first:
151+
1. [How to configure the engine debugging environment? ](https://www.yuque.com/lce/doc/glz0fx)
152+
2. [About the R&D collaboration process of the engine](https://www.yuque.com/lce/doc/contributing)
153+
3. [Engineering Configuration of Engine](https://www.yuque.com/lce/doc/gxwqg6)
154+
155+
> Strongly recommend reading ["The Wisdom of Asking Questions"](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way), ["How to Ask Questions to the Open Source Community"](https: //github.com/seajs/seajs/issues/545) and [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html), [ "How to Submit Unanswerable Questions to Open Source Projects"](https://zhuanlan.zhihu.com/p/25795393), better questions are easier to get help. (This paragraph refers to [antd](https://github.com/ant-design/ant-design))

packages/designer/src/document/document-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class DocumentModel {
8686
}
8787

8888
get fileName(): string {
89-
return this.rootNode?.getExtraProp('fileName')?.getAsString() || this.id;
89+
return this.rootNode?.getExtraProp('fileName', false)?.getAsString() || this.id;
9090
}
9191

9292
set fileName(fileName: string) {

packages/editor-core/src/config.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,19 +232,39 @@ export class EngineConfig {
232232
this.config = config || {};
233233
}
234234

235+
/**
236+
* 判断指定 key 是否有值
237+
* @param key
238+
* @returns
239+
*/
235240
has(key: string): boolean {
236241
return this.config[key] !== undefined;
237242
}
238243

244+
/**
245+
* 获取指定 key 的值
246+
* @param key
247+
* @param defaultValue
248+
* @returns
249+
*/
239250
get(key: string, defaultValue?: any): any {
240251
return lodashGet(this.config, key, defaultValue);
241252
}
242253

254+
/**
255+
* 设置指定 key 的值
256+
* @param key
257+
* @param value
258+
*/
243259
set(key: string, value: any) {
244260
this.config[key] = value;
245261
this.notifyGot(key);
246262
}
247263

264+
/**
265+
* 批量设值,set 的对象版本
266+
* @param config
267+
*/
248268
setConfig(config: { [key: string]: any }) {
249269
if (config) {
250270
Object.keys(config).forEach((key) => {
@@ -281,6 +301,12 @@ export class EngineConfig {
281301
}
282302
}
283303

304+
/**
305+
* 获取指定 key 的值,若此时还未赋值,则等待,若已有值,则直接返回值
306+
* 注:此函数返回 Promise 实例,只会执行(fullfill)一次
307+
* @param key
308+
* @returns
309+
*/
284310
onceGot(key: string): Promise<any> {
285311
const val = this.config[key];
286312
if (val !== undefined) {
@@ -291,6 +317,12 @@ export class EngineConfig {
291317
});
292318
}
293319

320+
/**
321+
* 获取指定 key 的值,函数回调模式,若多次被赋值,回调会被多次调用
322+
* @param key
323+
* @param fn
324+
* @returns
325+
*/
294326
onGot(key: string, fn: (data: any) => void): () => void {
295327
const val = this.config?.[key];
296328
if (val !== undefined) {

0 commit comments

Comments
 (0)
X Tutup