Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

Latest commit

 

History

History
54 lines (39 loc) · 2.09 KB

DEVELOP.md

File metadata and controls

54 lines (39 loc) · 2.09 KB

Develop

This guide describes how to setup a local development to work on Moai.

Before you start

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 docs.moaijs.com.

To understand the principles that drive the design and development of Moai, see the Principles guide.

Codebase overview

Moai is a monorepo powered by Yarn. There are several projects:

Path Project Framework
core @moai/core Rollup
gallery @moai/gallery Rollup
docs docs.moaijs.com 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

Development scripts

  • yarn start-core: watch and build @moai/core
  • yarn start-gallery: watch and build @moai/gallery
  • yarn start-docs: start docs.moaijs.com locally
  • yarn 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".