研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
开始为 Blockly 贡献
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Blockly 是开源的,主要由一支小团队维护。我们欢迎核心团队以外的开发者贡献代码;如果没有社区的支持,我们就无法实现所有用户请求的功能或修复所有报告的 bug。本部分包含一些常规指南,可能对您有所帮助,尤其是对于刚开始接触开源开发的用户。
如需了解在贡献之前应阅读的 Blockly 专用信息,请参阅为核心贡献和为示例贡献部分。
哪个代码库?
代码库包含单个项目的所有文件。Blockly 有两个仓库:blockly core 和 blockly-samples。
Blockly 核心是 Blockly 库的代码库。如果您想更改核心 Blockly 行为,并使更改应用于该库的所有用户,请使用此代码库。
Blockly 示例是存放示例、插件和 Codelab 的仓库。如果您要创建或修改插件、编写 Codelab 或创建或修改示例,请使用此代码库。
分步说明
每次进行更改时,您都需要遵循以下一般步骤。
- 按照工具部分中的链接安装 Git 和 Node。
- 创建代码库分支并克隆代码库。GitHub 上有一篇关于分叉代码库的绝佳教程。如需将其应用于 Blockly,只需将 octocat/Spoon-Knife 的每个实例替换为 google/blockly 或 google/blockly-samples,具体取决于您要使用哪个代码库。
- 同步您的分支。GitHub 还提供了有关同步分支的教程。
- 签出 main 分支。在 Blockly 核心中,这是
develop
分支。在 blockly-samples 中,这是 master
分支。
- 在根目录中运行
npm install
,安装依赖项和构建工具。
- 在终端中运行
git checkout -b myBranchName
以创建新分支。该名称应有助于您记住正在处理的内容。
- 进行更改。
- 按照核心或示例指南验证更改。
- 使用
git commit -am "fix: My commit message"
保存更改。
详细了解提交消息。
- 使用
git push origin myBranchName
将更改推送到 GitHub。
- 代码准备就绪后,打开拉取请求。Blockly 团队的成员将审核您的更改,并在获得批准后将其合并到 Blockly 中。如需了解详情,请参阅公共关系审核流程。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-05-23。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-05-23。"],[[["Blockly is an open-source project maintained by a core team and welcomes contributions from the community to enhance its features and address bugs."],["Blockly has two repositories, \"blockly core\" for the library itself and \"blockly-samples\" for plugins, samples, and codelabs, and contributors should choose the appropriate repository based on their contribution."],["The contribution process involves forking the repository, syncing it, creating a new branch for changes, validating them, and ultimately opening a pull request for review by the Blockly team."],["Before making contributions, it's recommended to install Git and Node, familiarize yourself with GitHub's forking and syncing processes, and review the guidelines specific to contributing to Blockly core or samples."]]],["Blockly has two repositories: core and samples. To contribute, first install Git and Node. Then, fork and clone the relevant repository (google/blockly or google/blockly-samples). Sync your fork, checkout the main branch (develop for core, master for samples), and install dependencies with `npm install`. Create a new branch, make and validate changes, commit with `git commit`, push to GitHub with `git push`, and finally open a pull request.\n"]]