Skip to content

Latest commit

 

History

History
77 lines (52 loc) · 2.52 KB

DEVELOPMENT.md

File metadata and controls

77 lines (52 loc) · 2.52 KB

Getting Started

  1. First, you will need to have the latest git, yarn 1.16 & node 12 or greater installed. OSX, Windows and Linux should all be supported as build environments.

None of these commands will work with npm. Please use yarn to develop with graphql.

  1. Fork this repo by using the "Fork" button in the upper-right

  2. Check out your fork

    git clone git@github.com:yournamehere/graphiql.git
  3. Install or Update all dependencies

    yarn
  4. Build all interdependencies so the project you are working on can resolve other packages

    yarn run build

    you can also use

    yarn run watch

    if you are focused on GraphiQL development, you can run

    yarn run start-graphiql
  5. Get coding! If you've added code, add tests. If you've changed APIs, update any relevant documentation or tests. Ensure your work is committed within a feature branch.

  6. Ensure all tests pass, and build everything

    yarn test

Developing for GraphiQL

If you want to develop just for graphiql, you don't even need to execute commands from the package subdirectory at packages/graphiql.

First, you'll need to yarn build all the packages from the root.

Then, you can run these commands:

  • yarn workspace graphiql dev will launch webpack dev server for graphiql from the root
  • yarn workspace graphiql storybook will launch graphiql storybook from the root

to run tests for GraphiQL:

  • yarn jest graphiql will run all tests for graphiql
  • yarn jest --watch will watch all changes in the monorepo

All Commands

  1. yarn - install and link all packages
  2. yarn build - cleans first, then builds everything but webpack bundles - tsc --build, babel etc
  3. yarn build-ts - builds typescript using --build and --force flag.
  4. yarn watch - runs tsc --build --watch, for when you make cross-repository changes
  5. yarn build-bundles - builds webpack bundles that are used for releases
  6. yarn build-demo - builds demo projects for netlify; we run this on CI to make sure webpack can consume our project in a standalone project.
  7. yarn test - runs jest. so yarn t --watch
  8. yarn format - autoformats with eslint --fix and prettier
  9. yarn lint - checks for linting issues
  10. yarn e2e - runs cypress headlessly against the minified bundle and a local schema server, like in CI.
  11. yarn jest - runs global jest commands across the entire monorepo; try yarn test --watch or yarn jtest DocExplorer for example :D