Skip to content
On this page

Contributions guide

Thanks for your interest in contributing! Please make sure to take a moment and read through Prisma-AppSync concept, as well as the following guide:

πŸ‘‰ Repository setup

We use pnpm as the core package manager, yarn and docker for creating the AWS CDK bundle before deployment, zx for running scripts, aws and cdk CLIs for deployment.

Start with cloning the repo on your local machine:

bash
git clone https://github.com/maoosi/prisma-appsync.git

Install pre-requirements:

Step
1. Install NodeJS,Β latest LTS is recommended β†—
2. InstallΒ pnpm β†—
3. InstallΒ yarn@1 β†—
4. Install zx β†—
5. InstallΒ docker β†—
6. Install theΒ AWS CLI β†—
7. Install theΒ AWS CDK β†—

Verify installation:

bash
node -v && pnpm --version && yarn --version && zx --version && docker --version && aws --version && cdk --version

Install dependencies:

bash
pnpm install

Run local dev playground:

bash
pnpm dev

See list of commands below for more details about pnpm dev.

πŸ‘‰ Commands

CommandDescription
pnpm installInstall project dependencies.
pnpm testRun all unit tests and e2e tests.
pnpm buildBuild the entire prisma-appsync library.
pnpm devCreates local dev setup, useful for contributing [1].

[1] Automatically generates a playground folder (unless already existing), plus run a local GraphQL + AWS AppSync server pointing to the playground folder. This creates an ideal local dev environment that emulates Prisma-AppSync running on AWS locally. Everything inside playground is pointing local source packages.

πŸ‘‰ Sending Pull Request

Discuss first

Before you start to work on a feature pull request, it's always better to open a feature request issue first to discuss with the maintainers whether the feature is desired and the design of those features.

Commit convention

We use Conventional Commits β†— for commit messages such as:

ts
<type>[optional scope]: <description>
  • Possible types: feat / fix / chore / docs
  • Possible scopes: client / generator / cli / boilerplate / server
  • Description: Short description, with issue number when relevant.

Here are some examples:

TypeCommit message
Bug fixfix(client): issue #234 - JEST_WORKER_ID replaced
New featurefeat(generator): new defaultDirective parameter
Routine taskchore: deps updated to latest
Docs updatedocs: fix typo inside home

πŸ‘‰ Coding guidelines

ESLint

We use ESLint β†— for both linting and formatting.

IDE Setup

We recommend using VS Code β†— along with the ESLint extension β†—.

With the settings on the right, you can have auto-fix and formatting when you save the code you are editing.


VS Code's settings.json

json
{
    "editor.codeActionsOnSave": {
        "source.fixAll": false,
        "source.fixAll.eslint": true
    }
}

No Prettier

Since ESLint is already configured to format the code, there is no need to duplicate the functionality with Prettier. If you have Prettier installed in your editor, we recommend you disable it when working on the project to avoid conflict.

By submitting your code to the Prisma-AppSync project, you are granting the project maintainers a right to use that code and provide it to others under the BSD 2-Clause License attached to the project. You are also certifying that you wrote it and that you are allowed to license it to us.

Released under the BSD 2-Clause License.