Moon Design System Build with React
Moon Design System
Moon Design System Build with React.
Installing Moon Design
-
Install dependencies and link local packages together:
yarn
-
Compile and build all packages:
yarn build
-
Compile and build storybook:
yarn next build
-
Run locally at
:3000
:yarn next start
Using Moon Design
yarn next start
- serve the docs locally at:3000
.yarn commit
- CLI to write git commits in our preferred format.yarn build
- compiles a distributablelib
folder for each package.- Additional TypeScript compiler options can be appended to the command.
yarn format
- Prettier alias.yarn lint
- lint all JavaScript and TypeScript.yarn test
- runs the Jest testing suite.- Obsolete tests can be updated via the additional
-u
flag. - Additional Jest options can be appended to the command.
- Obsolete tests can be updated via the additional
yarn clean
- removes all generatedlib
folders.yarn nuke
- removes all generatedlib
folders andnode_modules
.yarn publish:packages
- bumps package versions based on the conventional commits specification and publishes.- Additional
@alpha
and@beta
suffixes create a tagged release for testing purposes.
- Additional
yarn update:packages
- a wizard to update Lerna package dependencies.
Architecture
Our Lerna monorepo publishes key layers as individual @heathmont/moon-
packages:
next-docs/
- style guide and documentationpackages/
- Moon Design System
Packages are developed inside their respective src
folders, utilising Yarn Workspaces for dependency linking/sharing. Distributable code is generated in each package's lib
by the TypeScript compiler on build/publish.
Docs
next-docs/
Our project's style guide and documentation is built using Next.js inside its own individual package directory.
Design System
packages/
- Assets - common rich media brand assets.
- Themes - theming feature
- Utils - suite of tools to quickly access common token values.
- Icons - React components for each icon.
- Components - the individual building blocks of our UI.
Setup
-
Install the above prerequisites.
-
Clone the repository:
git clone git@github.com:coingaming/moon-design.git
-
Install dependencies and link local packages together:
yarn
-
Build packages:
yarn build
-
Build storybook:
yarn next build
-
Run storybook:
yarn next start
Usage
yarn start
- serve the docs locally at:3000
with hot reloading.yarn commit
- CLI to write git commits in our preferred format.yarn build
- compiles a distributablelib
folder for each package.- Additional TypeScript compiler options can be appended to the command.
yarn format
- Prettier alias.yarn lint
- lint all JavaScript and TypeScript.yarn test
- runs the Jest testing suite.- Obsolete tests can be updated via the additional
-u
flag. - Additional Jest options can be appended to the command.
- Obsolete tests can be updated via the additional
yarn clean
- removes all generatedlib
folders.yarn nuke
- removes all generatedlib
folders andnode_modules
.yarn publish:packages
- bumps package versions based on the conventional commits specification and publishes.- Additional
@beta
suffix creates a tagged release for testing purposes.
- Additional
yarn update:packages
- a wizard to update Lerna package dependencies.