Firstly, it's important to understand that contributing to an open-source project is not just about submitting code to fix bugs or add features. There are many ways to contribute to an open-source project, including but not limited to:
If you have any questions, feel free to submit an issue (https://github.com/antvis/g2/issues) or directly modify and submit a PR (https://github.com/antvis/g2/pulls). The following mainly introduces the operational guidelines for several types of open-source contributions.
If you want to help optimize the
documentation
and submitchart examples
, you need to start the website debugging and validation. Here's how to start the website.
$ git clone git@github.com:antvis/G2.git
$ cd G2
$ npm install
You can also choose other package management tools to install according to your own habits.
Install website dependencies and start:
$ cd site
$ npm install
$ npm start
Then you can see the URL address to access the local website in the command console.
When learning the project code or solving bugs and submitting features for the project, debugging and running the code is necessary. Here is how to start and debug the project.
$ git clone git@github.com:antvis/G2.git
$ cd G2
$ npm install
G2 uses Vite to build the preview environment. Going through npm run dev
can open the preview page.
$ npm run dev
The preview page can preview all chart cases under __tests__/plots
and switch through the drop-down box according to different focus points. Chart cases are divided into the following categories based on different focus points:
__tests__/plots/animation
.__tests__/plots/api
.__tests__/plots/interaction
.__tests__/plots/static
.__tests__/plots/tooltip
.When starting development, you need to determine which category the feature to be implemented or the BUG to be fixed belongs to, then create a new file under the corresponding category folder, input the corresponding code, and export it in the corresponding index.js file. This way, you can preview it in the preview environment.
$ npm run test
The above command can run CI locally to ensure that after modifying the code, there are no new issues.
In order to ensure the long-term code quality and stability of the project, a PR needs to meet the following requirements at least:
Follow the angular format for commit messages. This makes the commit history more clear and enables the generation of changelogs. The format should be as follows:
type(scope): your commit message subject
type
: The type of the commit, including the following categories:
scope
: the scope of the commit.
subject
: the subject of the commit.
G2 has two parts of automated testing:
__tests__/unit/
.__tests__/integration/
.For all changes, unit tests or integration tests should be submitted to cover the modified parts. Additionally, run npm run test
locally to ensure the CI runs successfully.
Since no one can guarantee how long it will be until they remember, please provide the following information when submitting a Pull Request for convenient historical reference:
For any other questions, please submit a discussion for help. We look forward to your contribution to AntV.
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )