Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Latest commit

 

History

History
81 lines (54 loc) · 2.31 KB

CONTRIBUTING.md

File metadata and controls

81 lines (54 loc) · 2.31 KB

Contributing

Not sure where to start?

If you're not sure where to start? You'll probably want to learn a bit about a few topics before getting dirt in your hands.

  • ASTs (Abstract Syntax Tree): this project makes heavy use of code transformation with Babel and GraphQL. Check out AST Explorer to learn more about ASTs interactively
  • Babel: I'd recommend a read to the the Babel Plugin Handbook to understand how a plugin is written.
  • GraphQL: the GraphQL.js module is not only meant to build servers, it also exports a core subset of GraphQL functionality for creation of GraphQL type systems.
  • Lerna: this is mono repository and we use Lerna to manage our packages.
  • Yarn workspaces: Lerna is setup to be used with Yarn workspaces.

Chat

Have read this contributing guide and still need some help? Feel free join our slack channel.

Disclaimer

As Lerna is configured in this package to be used with Yarn, not using NPM will save you a lot of time.

Setup

$ git clone https://github.com/grafoojs/grafoo
$ cd grafoo
$ yarn # this command will install dependencies and automatically build every package

Build packages

Build all packages

As mentioned above after every yarn install all the packages are built automatically. But if you want to build then anyway just run:

$ yarn prepare

Build single package

$ cd packages/[any-package]
$ yarn build

Run tests

All tests

$ yarn test

All tests with coverage

I recomend the usage of NPX for any Lerna command if you don't want to install it globally.

$ npx lerna run test:coverage

Test individual package

$ cd packages/[any-package]
$ yarn test

Test individual package in watch mode

$ cd packages/[any-package]
$ yarn test --watch

Test individual package with coverage

$ cd packages/[any-package]
$ yarn test:coverage