First, make sure you have the ethereum-tests
git submodule, by running:
git submodule init
git submodule update
This monorepo uses npm workspaces. It links the local packages together, making development a lot easier.
TLDR: Setup
npm i
TLDR: To update dependencies
npm run build --workspaces
Above is the quickest way to set you up. Going down the road, there are two sets of commands: project and package-specific commands. You can find them at ./package.json
and ./packages/*/package.json
, respectively. Here's a breakdown:
Adds dependencies listed in the root package.
Builds all monorepo packages.
To build a specific package, use npm run build --workspace=@ethereumjs/vm
Removes root and packages node_modules
directories, and other generated files, like coverage
, dist
and others. This is useful to run after changing branches, to have a clean slate to work with.
These scripts execute lint
and lint:fix
respectively, to all monorepo packages. Worth noting that there is a git hook in place that runs npm run lint
for every git push
. This check can be skipped using git push [command] --no-verify
.
Rebuilds all generated docs.
npm install
from the package directory, it will ignore the workspace. Run npm install
from the root only.
There's a set of rather standardized commands you will find in each package of this repository.
Uses TypeScript compiler to build source files. The resulting files can be found at packages/<name>/dist
.
Runs whatever is on npm run test
script, capturing testing coverage information. By the end, it displays a coverage table. Additional reports can be found at packages/<name>/coverage/
.
Generates package documentation and saves them to ./packages/<name>/docs
.
Checks code style according to the eslint rules.
Fixes code style according to the rules. Differently from npm run lint
, this command actually writes to files.
Runs the package tests.
Note that the VM has several test scopes - refer to packages/vm/package.json for more info.