Skip to content

spherehq/sphere

Repository files navigation

lerna MaintainabilityCodeFactor Test CoverageCircleCI

where communities gather around content

This is the main monorepo codebase of Sphere.sh. We use lerna to manage and release packages.

Getting started

Sphere is node and typescript based, so ensure you have the latest version of node installed. A .nvmrc file is present in each package directory and root, if you have nvm installed you can run nvm use and it will set the right version for you.

We also prefer yarn over npm, primarily as we use yarn workspaces.

Ensure you have the latest version of yarn installed and run yarn install this will install all necessary dependencies.

Commands

Some helpful commands you should know when working within our codebase.

Command Description
yarn start Starts platform and api local dev servers
yarn build Builds packages - platform and api
yarn lint Lints all packages using tslint
yarn test Runs all tests
yarn test:changed Runs tests on packages with changes only
yarn test:unit:update Updates all unit tests which use snapshots

Most commands use lerna scope to run against local package commands --scope='@spherehq/*

Packages will have commands which are local to them and can be found within their own respective package READMEs.

Considerations for working within our monorepo

Always try to work from the root directory when running lerna commands e.g. lerna add or leran publish.

We also use yarn workspaces - this allows us to leverage lerna and yarn's ability to link sibling packages together and symlink their source to create a streamlined developer experience.

Deployment and package releases

We use lerna's --conventional-commits option and follow the semver convention. All releases are managed via our CI which looks for changes across packages and releases changed packages.

Some packages such as platform, api and database are/require servers which need additional steps such as building docker images or deploying to Amazon services.

You can understand more about our CI/CD process by viewing the config file

Contributing

Thanks for your interest in contributing! Read up on our guidelines for contributing and then look through our issues with a help wanted label.

We use husky and prettier to keep our code styles consistent, write code how you like just know we'll format it for you later.