The Blockly core repository contains the code that is needed to run any Blockly-based application.
Need to Know
Here is a quick overview of facts about blockly core you need to know in order to create a PR.
- The working branch is develop and all PRs should be made against develop.
- You must fill out the pull request template with the requested information.
- Code must conform to Google's TypeScript Style Guide.
- Use conventional commits in your commit messages and pull request titles.
- User-visible strings must be in the
/msg/messages.jsfile so they may be translated. Less than 6% of the world speaks English natively.
- Text on blocks should generally be all lowercase (just like the keywords in most programming languages).
- Maintain backwards compatibility. There are a lot of Blockly apps out there, don't break everyone else.
Any new code files must be prefixed with the Apache License v2.0:
/** * @license * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */
Making and Verifying a Change
npm installto install dependencies.
npm run startto start up a server running the playground. You can use this page to test the existing behavior. See the playground page for more information.
- Make any necessary changes to the code.
- If you've left the server running, refresh to see your changes. Otherwise, restart the server and verify the code behaves as expected and there are no errors or warnings in the console.
npm run buildand ensure there are no build errors.
- Write automated tests. Usually, these will be mocha tests in the
tests/mochadirectory, but we may ask you for other types of tests.
npm run testto run the automated tests.
npm run formatto format the code and automatically fix some lint problems.
npm run lintand ensure there are no warnings or errors.
- If all tests pass, you are ready to open a PR against develop with your changes.