This guide describes how to setup a local development to work on Moai.
This guide is mainly for contributing code to Moai. For other types of contribution, see the CONTRIBUTING guide.
This is a guide to develop Moai itself. For guides to use Moai, e.g. to create your web apps with it, see moai.thien.do.
To understand the principles that drive the design and development of Moai, see the Principles guide.
Moai is a monorepo powered by Yarn. There are several projects:
Path | Project | Framework |
---|---|---|
core | @moai/core | Rollup |
gallery | @moai/gallery | Rollup |
docs | moai.thien.do | Storybook |
test | Test suits | Jest |
The "test" and "docs" projects depend on "core" and "gallery" via symlinks. This means to run tests or start the docs site locally, you will need to build "core" and "gallery" first. Also, the "gallery" depends on the "core" project:
├─ docs
│ ├─ gallery
│ └─ core
├─ test
│ └─ core
├─ gallery
│ └─ core
└─ core
yarn start-core
: watch and build @moai/coreyarn start-gallery
: watch and build @moai/galleryyarn start-docs
: start moai.thien.do locallyyarn test
: run the test suites
The typical workflow is to have 4 terminal tabs, one for each command above. However, depend on your use cases, you may not need to "watch" some projects, but only "build" them once.
Note the dependency of these projects. In general, start "core" first, then "gallery", then "docs".