If you wish to contribute to Metal.js these guidelines will be important for you. They cover instructions for setup, information on how the repository is organized, as well as contribution requirements.
You can find instructions on how to setup the Metal.js repo locally here.
This main Metal.js repository contains multiple packages, which are considered the core modules. They're published separately in npm, as developers are not required to use all of them on their projects, but at the same time they interact a lot with each other and new features or even improvements often require changes on more than one of these modules, which is hard to do and test when code is split in separate repos.
That's why we've decided to use LernaJS to manage the repo. It's perfect for this use case and it's been used by projects like Babel and React.
The repo is divided into packages, which are:
Each package has its own package.json and is set up so that it provides two types of entry points: one for commonjs usage (main) and another for ES6 modules (jsnext:main). Check out metal-dom's package.json file as an example.
Any change (be it an improvement, a new feature or a bug fix) needs to include a test, and all tests from the repo need to be passing. To run the tests you can use our gulp tasks:
gulp test
Runs all tests oncegulp test:coverage
Runs all tests once and shows a summary coverage report.gulp test:coverage:open
Runs all tests once and opens a detailed coverage report in the browser.gulp test:watch
Runs all tests and listens for changes, rerunning them automatically.
Lint errors need to be fixed. To lint the code just run: gulp lint
.
All methods should be documented, following google's format.
Collaborators with publish permissions should follow the following steps: