Blockly Samples contains extra content related to Blockly that isn't part of the core repository, including plugins, codelabs, and example code. For more details about each of these, see the Repository Structure page.
Need to Know
Here is a quick overview of facts about blockly-samples you need to know in order to create a PR.
- The working branch is master and all PRs should be made against master.
npm installat the root level of blockly-samples, not at the individual plugin level. Blockly-samples is a monorepo, meaning it contains multiple packages in the same repository, and installing at the root level is part of the workflow for managing the monorepo with Lerna.
- Use conventional commits in your commit messages and pull request titles.
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 installat the root level of blockly-samples to install dependencies.
npm run startin a plugin's directory to build and start up a server running the plugin's test page. You can use this page to see the existing behavior of a plugin, or if you're adding a new plugin you will need to make this a useful test page so that others can see what your plugin does. See the playground page for more information.
- Make any necessary changes to the plugin's code.
- If you've left the server running, your changes will load automatically. Otherwise, restart the server and verify the plugin behaves as expected and there are no errors or warnings in the console.
npm run buildand ensure there are no build errors.
- Write automated mocha tests in the
npm run testto run the automated tests.
npm run lintand ensure there are no warnings or errors.
- If all tests pass, you are ready to open a PR against master with your changes.