Skip to content
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

Update article-23.md #1637

Closed
wants to merge 61 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
a631c3a
refactor: 重构 LogicFlow 项目结构,升级打包工具,使用 pnpm 做包管理工具
Jan 4, 2024
5049580
refactor: sites 中新增 docs 作为文档官网
Jan 4, 2024
f3ebf65
refactor: rename index.tsx -> index.ts, update dependencies and decla…
boyongjiong Jan 10, 2024
ab809ac
feat: 配置 husky pre-commit
boyongjiong Jan 10, 2024
43b173b
fix: fix type, 完善 LogicFlow.tsx 主文件类型定义
boyongjiong May 6, 2024
6c3ef48
refactor: 重构 engine 模块代码,使用 sandbox.js 解决 iframe 频繁 append 导致的性能问题
boyongjiong May 6, 2024
54facb2
feat: update 「sites/docs」更新官方文档
boyongjiong May 6, 2024
ff9f7f4
feat: update .gitignore
boyongjiong May 6, 2024
ae228b7
feat: git rm -r --cached sites/docs/.dumi/tmp
boyongjiong May 6, 2024
4306010
feat: add index.less
boyongjiong May 6, 2024
66cb19a
refactor: 解决项目中 core 包 TypeScript 类型错误导致打包失败的问题
boyongjiong May 8, 2024
10f63c8
refactor: core 包中 'preact' -> 'preact/compat' 解决 svg 属性问题
boyongjiong May 8, 2024
c461fc9
refactor: extension 包中代码重构,解决 TypeScript 类型定义的问题,完成打包改造
boyongjiong May 10, 2024
2e543b7
refactor: core 包中类型定义完善,解决在 extension 包重构过程中遇到的 Core 包问题
boyongjiong May 10, 2024
2202376
feat: @logicflow/engine 默认使用 browser 执行代码,node 端也使用 @nyariv/sandboxjs…
boyongjiong May 10, 2024
177498a
refactor: 代码重构过程中配置改造
boyongjiong May 10, 2024
4848f40
docs: update docs
boyongjiong May 10, 2024
2fe5eb8
docs: update examples
boyongjiong May 10, 2024
6be5a2c
refactor: 项目代码重构,包括 examples、extension 及 core 包
boyongjiong May 10, 2024
fa9f126
docs: add feature-examples DEMO 项目,用于汇总所有官方 demo,后续再 docs 中使用
boyongjiong May 10, 2024
2490cce
feat: 完成 feature-examples 中 demo 的改造,增加 graph 页面
boyongjiong May 10, 2024
e61626b
feat: 优化 DndPanel 的demo
boyongjiong May 11, 2024
fc72df9
feat: 开发 feature-examples 中 BPMN 插件 demo
boyongjiong May 13, 2024
427107a
feat: rename Control -> control, Node -> node
boyongjiong May 13, 2024
3212db3
feat: feature-examples 中增加 BPMN demo
boyongjiong May 15, 2024
15c6028
refactor: 文件夹重命名,将大驼峰命名修改为 小写+短横线
boyongjiong May 16, 2024
29a3eb0
refactor: 优化 bpmn 插件的导出内容
boyongjiong May 16, 2024
fc563ec
fix: 修复 GraphModel 中 getAreaElement 方法的 bug 及一些其他类型定义的优化
boyongjiong May 16, 2024
2fd2e0d
feat: engine-browser-examples bpmn demo 更新
boyongjiong May 16, 2024
4802f1e
fix: 修复 GroupNode 中 getNodeStyle 解构后调用,BaseNodeModel 中 getNodeStyle 方…
boyongjiong May 21, 2024
f9ea036
feat: 解决 git config core.ignorecase 为 true 导致修改文件夹名大小写不生效的问题
boyongjiong May 31, 2024
3dd79f9
feat: feature-examples 中增加 SelectionSelect demo
ChangeSuger May 30, 2024
22f46b2
fix: 通过 git rm --cached Xxxx 移除修改大小写的文件夹内容
May 31, 2024
59bcf8b
feat: update deprecated dependencies,fix vue3-memory-leak import error
boyongjiong May 31, 2024
a67306d
feat: 新增 next-app 用来测试服务端渲染项目中 window is not defined 的问题
boyongjiong Jun 4, 2024
e7b048b
fix: 修复 vue3-memory-leak 项目中引入 vue 文件报错的问题
boyongjiong Jun 4, 2024
0800bfb
fix: 主要修复 TextEditTool 无效的 bug,后注原因
boyongjiong Jun 4, 2024
e111348
docs: typo
May 31, 2024
aad9fd0
feat: 框选插件重构与示例内容丰富
ChangeSuger Jun 6, 2024
74a0882
feat: 小地图插件重构与相关示例增加
ChangeSuger Jun 6, 2024
9afcda9
feat: 开发 react-node-registry 包用于用户自定义 react 节点
boyongjiong Jun 6, 2024
e17dcf8
feat: react-node-registry 包增加 LICENSE 文件
boyongjiong Jun 12, 2024
1563166
feat: 开发 vue-node-registry 包用于用户自定义 vue 节点
boyongjiong Jun 12, 2024
a8b1c2e
feat: 新增 vue3-app 用于测试 vue-node-registry,后续使用该项目开发 vue 组件或 demo
boyongjiong Jun 12, 2024
07cfa0d
feat: selection-select 插件中 disabled 默认设置为 true
boyongjiong Jun 12, 2024
ef92a41
docs: 完善 README.md 以及 CONTRIBUTING 相关文档,解决 eslint 问题
boyongjiong Jun 13, 2024
20568e4
refactor(extension): 移除 extension 包中 examples 文件夹,已转移到 examples/featu…
boyongjiong Jun 13, 2024
dd6087a
refactor: 完善core包与group插件的类型定义
ChangeSuger Jun 8, 2024
9b30841
refactor: 完善与修正core包的部分类型定义
ChangeSuger Jun 14, 2024
5d16cab
feat: minimap插件功能完善与相关示例丰富
ChangeSuger Jun 14, 2024
349252c
refactor(core): 完善 BaseEdge 和 BaseNode 泛型类型,内置节点 props 定义更新
boyongjiong Jun 16, 2024
4f5d31f
refactor(core): 重构 LogicFlow.tsx 以及 GraphMode 代码,代码按功能分区管理
boyongjiong Jun 16, 2024
777e130
chore(.github): add update_contributors.yml to update contributors us…
boyongjiong Jun 17, 2024
0531894
refactor: core包类型定义完善
ChangeSuger Jun 15, 2024
82fa404
feat: 小地图插件新增功能与示例丰富
ChangeSuger Jun 15, 2024
dc40077
refactor: extension包的类型定义修复
ChangeSuger Jun 17, 2024
8072f89
fix: 修复小地图的预览视窗无法拖拽的问题
ChangeSuger Jun 18, 2024
995c41a
fix: cr问题修复
ChangeSuger Jun 18, 2024
c1f8ae4
fix: 小地图设置回调逻辑调整为抛出事件
ChangeSuger Jun 18, 2024
669e589
chore(.github): update update_contributors.yml and test
boyongjiong Jun 19, 2024
2be95f5
Update article-23.md
VarianLIn Jun 19, 2024
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
docs: 完善 README.md 以及 CONTRIBUTING 相关文档,解决 eslint 问题
 - 完善开源共享引导文档:README 以及 CONTRIBUTING
 - 项目根目录运行 pnpm run lint:ts,解决项目中 eslint 错误及 warning
  • Loading branch information
boyongjiong committed Jun 13, 2024
commit ef92a4142f1435a5b5606cbe4e857e68be78dd5d
152 changes: 116 additions & 36 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,145 @@
# Contribution Guideline
# 代码贡献规范

## Pull Requests
如果您有任何疑问,欢迎提交[issue](https://github.com/didi/LogicFlow/issues) 或 [PR](https://github.com/didi/LogicFlow/pulls)!

LogicFlow对外持开放态度,不论是只修改文档的标点符号还是对LogicFlow的整体功能有大的重构我们都欢迎。对于您的每一个PR我们都会认真查看、回复、合并。
## 提交 issues

### Start
- 确定 issue 的类型
- 避免提交重复的 issue,在提交之前搜索现有的 issue
- 在标签、标题或内容中描述明确的意图

我们选用 fork 仓库,然后提交 PR 的形式进行开发。具体方式可以参考: [我是如何在 GitHub 上提交 PR 的](https://juejin.cn/post/6844904103294795789).
LogicFlow 维护同学会确认 issue 意图,更新合适的标签,关联 milestone,指派开发者。

### 安装项目依赖
## 提交代码

> 需要提前安装 yarn
### 发起 Pull Request

如果您有意向参与贡献代码,您可以 fork 本仓库,修改代码后提交 PR,我们 LogicFlow 开发团队会 review 代码并合并到主干。

```shell
npm run bootstrap
```
# 先创建开发分支开发,分支名应该有含义,避免使用 update、tmp 之类的
$ git checkout -b branch-name

### 运行文档
# 开发某个包时,利用 build:watch 监听变化实时打包更新
$ cd packages/core # or other packages, such as packages/extensions
$ pnpm run build:watch

```shell
npm run docs:dev
# 在新的 Shell 中启动 examples 以开发 demo 并验证功能
$ cd examples/feature-examples
$ pnpm start

# 开发完成后跑下测试是否通过,必要时需要新增或修改测试用例
pnpm run test

# 测试通过后,提交代码,message 见下面的规范
$ git add . # git add -u 删除文件
$ git commit -m "fix(role): role.use must xxx"
$ git push origin branch-name
```

### 构建 types 并打包
提交后就可以在 [LogicFlow](https://github.com/didi/LogicFlow/pulls) 发起 PR 了 (*❦ω❦)

LF 使用 monorepo 的形式进行管理,各个 package 之间存在依赖关系,所以需要先构建一次类型和源码才能进行开发。
由于谁也无法保证过了多久之后还记得多少,为了后期回溯历史的方便,请在提交 PR 时确保提供了以下信息

```shell
npm run build:types
1. 需求点(一般关联 issue 或者注释都算)
2. 升级原因(不同于 issue,可以简要描述下为什么要处理)
3. 框架测试点(可以关联到测试文件,不用详细描述,关键点即可)
4. 关注点(针对用户而言,可以没有,一般是不兼容更新等,需要额外提示)

### 代码风格

你的代码风格必须通过 eslint,你可以运行 `$ pnpm run lint:ts` 本地测试

### Commit 提交规范

npm run build
根据 [angular 规范](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format)提交 commit,这样 history 看起来更加清晰,还可以自动生成 changelog

```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

### 启动本地开发
(1)type

开发 core 包
提交 commit 的类型,包括以下几种

```shell
cd packages/core
npm run dev
- feat: 新功能
- fix: 修复问题
- docs: 修改文档
- style: 修改代码格式,不影响代码逻辑
- refactor: 重构代码,理论上不影响现有功能
- perf: 提升性能
- test: 增加修改测试用例
- chore: 修改工具相关(包括但不限于文档、代码生成等)
- deps: 升级依赖

(2)scope

修改文件的范围

(3)subject

用一句话清楚的描述这次提交做了什么

(4)body

补充 subject,适当增加原因、目的等相关因素,也可不写

(5)footer

- **当有非兼容修改(Breaking Change)时必须在这里描述清楚**
- 关联相关 issue,如 `Closes #1, Closes #2, #3`

示例

# 或跳过以上“构建部分”直接运行
npm run dev:core
```
fix($compile): [BREAKING_CHANGE] couple of unit tests for IE9

开发 extension
Older IEs serialize html uppercased, but IE9 does not...
Would be better to expect case insensitive, unfortunately jasmine does
not allow to user regexps for throw expectations.

```shell
cd packages/extension
npm run dev
Document change on @logicflow/core#12

# 或跳过以上“构建部分”直接运行
npm run dev:extension
Closes #392

BREAKING CHANGE:

Breaks foo.bar api, foo.baz should be used instead
```

## Issues
查看具体[文档](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit)

## 发布管理

LogicFlow 基于 [semver](http:https://semver.org/lang/zh-CN/) 语义化版本号进行发布

### 分支策略

`master` 分支为当前稳定发布的版本。

- 直接从 `master` 切出分支进行开发
- 所有 API 的废弃都需要在当前的稳定版本上 `deprecated` 提示,并保证在当前的稳定版本上一直兼容到新版本的发布

### 发布策略

在每个大版本发布中,都会有一个负责人,他在发布的不同阶段负有以下职责:

#### 准备工作

- 建立 milestone, 确认需求关联 milestone, 指派和更新 issues

#### 发布前

如果您使用LogicFlow过程中遇到问题或者有任何想法,欢迎点击LogicFlow [issues](https://github.com/didi/LogicFlow/issues)给我们提issue和我们交流。
- 确认当前 Milestone 所有的 issue 都已关闭或可延期,完成性能测试
- 发起一个新的 [Release Proposal MR](https://github.com/nodejs/node/pull/4181),按照 [node CHANGELOG](https://github.com/nodejs/node/blob/master/CHANGELOG.md) 进行 `History` 的编写,修正文档中与版本相关的内容
- 指定下一个大版本的负责人

一般来说通过文字和截图的描述我们可能无法定位到问题,为了帮助我们快速定位问题并修复,请按照以下指南编写并上传最简复现demo:
#### 发布时

1. 在任意在线编码平台,编写示例如[codesanbox](https://codesandbox.io/s/logicflow-step3-mhge5)。将其保存到自己空间,然后贴上链接。
2. 在自己github中创建一个最简单的示例,然后贴上github链接。
3. 删除项目中的node_modules部分,打包项目,并拖拽到issue输入框中上传(或提供远程可下载地址)
- 将老的稳定版本(master)备份到以当前大版本为名字的分支上(例如 `1.x`),并设置 tag 为 {v}.x( v 为当前版本,例如 `1.x`)
- 发布新的稳定版本到 [npm](http:https://npmjs.com),并通知上层框架进行更新
- `npm publish` 之前,请先阅读[『我是如何发布一个 npm 包的』](https://fengmk2.com/blog/2016/how-i-publish-a-npm-package)
146 changes: 146 additions & 0 deletions CONTRUBUTING.en-US.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# Contribution Guide

If you have any comment or advice, please report your [issue](https://github.com/didi/LogicFlow/issues) or make any change as you wish and submit a [PR](https://github.com/didi/LogicFlow/pulls)!

## Report New Issues

- Please specify what kind of issue it is.
- Before you report an issue, please search for related issues. Make sure you are not going to open a duplicate issue.
- Explain your purpose clearly in labels, title, or content.


LogicFlow group members will confirm the purpose of the issue, replace more accurate labels for it, identify related milestone, and assign developers working on it.

## Contributing Code

### Pull Requests

If you want to contribute improvements or new features we are happy to review your PR :)

```shell
$ pnpm install

$ cd packages/core # or other packages, such as packages/extensions
$ pnpm run build:watch

# create a new shell
$ cd examples/feature-examples
$ pnpm start

# Create a new branch for development. The name of branch should be semantic, avoiding words like 'update' or 'tmp'. We suggest to use feature/xxx, if the modification is about to implement a new feature.
$ git checkout -b branch-name

# Run the test after you finish your modification. Add new test cases or change old ones if you feel necessary
$ pnpm run test

# If your modification pass the tests, congratulations it's time to push your work back to us. Notice that the commit message should be wirtten in the following format.
$ git add . # git add -u to delete files
$ git commit -m "fix(role): role.use must xxx"
$ git push origin branch-name
```

Then you can create a Pull Request at [LogicFlow](https://github.com/didi/LogicFlow/pulls) ✿✿ヽ(°▽°)ノ✿

No one can guarantee how much will be remembered about certain PR after some time. To make sure we can easily recap what happened previously, please provide the following information in your PR.

1. Need: What function you want to achieve (Generally, please point out which issue is related).
2. Updating Reason: Different with issue. Briefly describe your reason and logic about why you need to make such modification.
3. Related Testing: Briefly describe what part of testing is relevant to your modification.
4. User Tips: Notice for LogicFlow users. You can skip this part, if the PR is not about update in API or potential compatibility problem.

### Style Guide

eslint can help to identify styling issues that may exist in your code. Your code is required to pass the test from eslint. Run the test locally by `$ pnpm run lint:ts`.

### Commit Message Format

You are encouraged to use [angular commit-message-format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format) to write commit message. In this way, we could have a more trackable history and an automatically generated changelog.

```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

(1)type

Must be one of the following:

- feat: A new feature
- fix: A bug fix
- docs: Documentation-only changes
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing tests
- chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
- deps: Updates about dependencies

(2)scope

The scope could be anything specifying place of the commit change.

(3)subject

Use succinct words to describe what did you do in the commit change.

(4)body

Feel free to add more content in the body, if you think subject is not self-explanatory enough, such as what it is the purpose or reasons of you commit.

(5)footer

- **If the commit is a Breaking Change, please note it clearly in this part.**
- related issues, like `Closes #1, Closes #2, #3`

e.g.

```
fix($compile): [BREAKING_CHANGE] couple of unit tests for IE9

Older IEs serialize html uppercased, but IE9 does not...
Would be better to expect case insensitive, unfortunately jasmine does
not allow to user regexps for throw expectations.

Document change on @logicflow/core#12

Closes #392

BREAKING CHANGE:

Breaks foo.bar api, foo.baz should be used instead
```

Look at [these files](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit) for more details.

## Release

LogicFlow uses semantic versioning in release process based on [semver](https://semver.org/).

### Branch Strategy
`master` branch is the latest stable version.

- 直接从 `master` 切出分支进行开发
- 所有 API 的废弃都需要在当前的稳定版本上 `deprecated` 提示,并保证在当前的稳定版本上一直兼容到新版本的发布

### Release Strategy

In the release of every stable version, there will be a PM who has the following responsibilities in different stages of the release.

#### Preparation

- Set up milestone. Confirm that request is related to milestone.

#### Before Release

- Confirm that performance test is passed and all issues in current Milestone are either closed or can be delayed to later versions.
- Open a new [Release Proposal MR](https://github.com/nodejs/node/pull/4181), and write `History` as [node CHANGELOG](https://github.com/nodejs/node/blob/master/CHANGELOG.md). Don't forget to correct content in documentation which is related to the releasing version.
- Nominate PM for next stable version.

#### Releasing

- Backup the old stable version (master) to a branch named after the current major version (e.g. `1.x`) and set the tag to {v}.x (v is the current version, e.g. `1.x`)
- Release a new stable version to [npm](http:https://npmjs.com) and notify upper level frameworks of the update
- Before `npm publish`, read ['How I publish an npm package'](https://fengmk2.com/blog/2016/how-i-publish-a-npm-package)
Loading