Blockly uses some tools and libraries for development, including Git, npm, and the Closure Compiler. This section will provide some basic descriptions of each tool, as well as links to where you can find more information about each tool.
We use many of these tools through scripts. You may not need to ever run them directly. Knowing the names may still be helpful for debugging or filing issues or feature requests.
Git is a version control system that we use to track and manage changes to files.
GitHub is a hosting platform for version control, collaboration, and distribution of open-source code. Git tracks the files; GitHub provides smooth interfaces for reviewing code, tracking issues, and viewing change history.
Getting started: If you're new to Git and GitHub, work through GitHub's quickstart tutorials to get comfortable with the basics.
npm is two things:
- A command-line tool that we use to install dependencies and run scripts.
- An online registry where we publish our code, which makes it easy for other developers to use Blockly.
Getting started: Install Node and npm.
Getting started: You don't need to install or run the Closure Compiler directly: we install and run it through npm.
Getting started: In both Blockly core and blockly-samples, you can run
npm run lint. Many code editors also have ESLint integrations to
show problems as you type.
Read more: Each ESLint rule has a documentation page that describes the rule and gives examples of correct and incorrect code.
Getting started: In both Blockly core and blockly-samples, you can run our
Mocha tests with
npm run test. In Blockly core this will also run other tests.
Blockly core's Mocha tests are defined in the tests/mocha
Read more: Mocha allows developers to define hooks, which allow you to define centralized setup and teardown functions for your tests.
Chai is an assertion library that we use in our Mocha tests.
Read more: Chai has multiple "flavors" of syntax, to make it easy to integrate with existing projects. Blockly uses the assert flavor.