Contribution Guide
This document helps you quickly develop, test, and submit PRs in this repository. The repository uses a Monorepo managed by Rush + pnpm, and the documentation site is built with Rspress.
Setting Up the Development Environment
-
Install Node.js 18+ (LTS/Hydrogen recommended)
-
Clone the repository locally
-
Install global dependencies
-
Install project dependencies
-
Build the project
-
Run the documentation or examples
Common Commands (Rush Custom)
Branch and Commit Conventions
- Branch naming:
feat/description(new feature)fix/description(bug fix)docs/description(documentation changes)chore/description(maintenance/miscellaneous)
- Commit messages (Conventional Commits):
-
Format:
type(scope): subject, for example: -
Common types:
feat,fix,docs,style,refactor,test,chore -
The repository has commitlint validation enabled (commit-msg hook), so commit messages will be automatically checked; pre-commit will also run lint-staged (automatically update license headers, fix eslint issues) and
rush check.
-
Development and Quality Assurance
- Local development recommendations:
- First, run
rush build:watch, then run the development command in the corresponding demo or docs directory (e.g.,rush dev:docs). - After modifying the code, ensure it passes:
rush lint,rush ts-check,rush build,rush test.
- First, run
- Testing instructions:
- e2e test cases are located in the
e2e/directory and can be run withrush e2e:test, or you can update snapshots withrush e2e:update-screenshot.
- e2e test cases are located in the
Pull Request Process
- Create your working branch from
main(following the branch naming conventions). - Code and add tests/documentation.
- Pass local quality checks (lint, ts-check, build, test).
- Submit a PR: fill in the description, link the Issue, and use the template.
- Review and CI: Maintainers will review the code, and it can be merged after the CI passes.
Documentation Contribution
- Documentation location:
apps/docs/src/zh/**(Chinese) andapps/docs/src/en/**(English). - Local preview: Run
rush dev:docsto start the Rspress documentation site. - To automatically generate API documentation, you can run
rushx docsin theapps/docsdirectory (which calls a script to generate it).
Common Issues
- pnpm-lock merge conflicts: The repository has a merge strategy configured in the
post-checkouthook, which usually avoids lock file conflicts. - Node version: Please ensure you are using Node 18+, otherwise you may encounter dependency or build failures.
Reporting Issues
- Please submit an Issue on GitHub: https://github.com/bytedance/flowgram.ai/issues/new/choose
- Describe the problem, reproduction steps, expected and actual behavior, and provide a code example if necessary.
License
- This project is licensed under the MIT License. By submitting code, you agree to the relevant terms.