Skip to content

Latest commit

 

History

History
106 lines (70 loc) · 2.05 KB

CONTRIBUTING.md

File metadata and controls

106 lines (70 loc) · 2.05 KB

Contribution

We're always welcome to issues / PRs 😄

Setup

  1. Clone this repository
git clone https://github.com/Quramy/ts-graphql-plugin.git
cd ts-graphql-plugin
  1. Install dependencies
yarn install --pure-lockfile
  1. Compile TypeScript sources
yarn compile

Code format

We use Prettier and configure to format sources automatically when they're git staged.

And we use ESLint.

yarn lint

Testing

Unit testing

If you add / modify some functions, write unit testing code about them.

Execute the following to run all unit testing codes:

yarn test

E2E testing

In some cases, it's difficult to cover entire functions by unit testing. For example, we should assert "Our language service extension should react when text editor/IDE send a request". We should make sure the whole feature works together correctly.

In such cases, consider adding E2E test specs.

yarn compile
yarn e2e all

You can specify test suite name via:

yarn e2e cli # Execute only specs under e2e/cli-specs

Manual testing

Language service plugin

You can check manually language service plugin features with our example project.

yarn compile
yarn link
cd project-fixtures/react-apollo-prj
yarn install
yarn link ts-graphql-plugin
code . # Or launch editor/IDE what you like

Of course, you can use other editor which communicates with tsserver .

CLI

You can run CLI using compiled cli.js. For example:

node lib/cli/cli.js validate -p project-fixtures/gql-errors-prj

Adding New Dependencies

Not add new dependencies. ts-graphql-plugin is implemented for the purpose of being able to be installed by users in a short installation time.