Skip to content
Our sponsors
Kuizto β€” The Everyday Cooking App

Contributions guide ​

Thanks for your interest in contributing!

πŸ‘‰ Discuss first ​

Before starting to work on a pull request, it's always better to open an issue first to confirm its desirability and discuss the approach with the maintainers.

πŸ‘‰ Project packages ​

packages/generator

Generator for Prisma ORM, whose role is to parse your Prisma Schema and generate all the necessary components to run and deploy a GraphQL API tailored for AWS AppSync.

packages/client

Think of it as Prisma Client for GraphQL. Fully typed and designed for AWS Lambda AppSync Resolvers. It can handle CRUD operations with just a single line of code, or be fully extended.

packages/installer

Interactive CLI tool that streamlines the setup of new Prisma-AppSync projects, making it as simple as running npx create-prisma-appsync-app@latest.

packages/server

Local dev environment that mimics running Prisma-AppSync in production. It includes an AppSync simulator, local Lambda resolvers execution, a GraphQL IDE, hot-reloading, and authorizations.

πŸ‘‰ Repository setup ​

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

Start with cloning the repo on your local machine:

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

Checkout the dev branch (working branch):

bash
git checkout dev

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] Auto-generates a 'playground' folder (if not there already) and launches a local GraphQL + AWS AppSync server. This simulates the Prisma-AppSync AWS environment for local development, with 'playground' contents pointing to local source packages.

πŸ‘‰ 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.

πŸ‘‰ License ​

When you contribute code to the Prisma-AppSync project, you grant the maintainers permission to use and share your code under the project's BSD 2-Clause License. You also affirm that you are the original author of the code and have the authority to license it.

Released under the BSD 2-Clause License.