Docs/CI

Recipes

We made some common recipes for some third-party integrations available to help you get started.

ESLint

If you're using ESLint, you can use the ESLint recipe to run your linting checks.

1

Install the ESLint recipe

npm install @pierre/eslint
2

Add the ESLint recipe

Add the following file to your .pierre/ci folder.

import { Job } from '@pierre/eslint';

export default Job();

Prettier

If you're using Prettier, you can use the Prettier recipe to format your code. The prettier job will only report on formatting failures, it will not rewrite your files.

1

Install the Prettier recipe

npm install @pierre/prettier
2

Add the Prettier recipe

import { Job } from '@pierre/prettier';

export default Job();

Typescript

If you're using Typescript, you can use the Typescript recipe to run your typechecking checks. Type errors will automatically be annotated on your code.

1

Install the Typescript recipe

npm install @pierre/typescript
2

Add the Typescript recipe

import { Job } from '@pierre/typescript';

export default Job();

Vercel

If you're using Vercel, you can use the Vercel recipe to set up production deployments when merging main and attach preview deployments to all other changes.

Note: Unlike the other recipes, Vercel is a bit more involved. Follow the steps below to get started.

1

Install the Vercel CLI

If you haven't already, make sure you have a current Vercel account. Next, we'll use the Vercel CLI to quickly setup a deployable project for your repo.

npm install -g vercel
2

Run the link command from the root of your repo. The link command will take you through creating a new project or linking an existing project to your local repo.

vercel link
3

Grab the project and org IDs

Once you've linked your project, you can grab your project and org IDs from the .vercel/project.json.

Note: the contents of project.json should look something like

{"projectId":"prj_****","orgId":"team_***"}
4

Create a vercel access token

The vercel recipe requires a Vercel access token to deploy code on your behalf. You can create a new access token by visiting https://vercel.com/account/tokens.

Give your toke a name and be sure to set the expiration date (No expiration is recommended).

Vercel access form

Be sure to copy the token after you create it.

Vercel token

Head over to your repo’s settings page and add the token as a CI secret. It is important that you name the secret VERCEL_ACCESS_TOKEN.

5

Add the vercel recipe

Add @pierre/vercel to your package.json file and add the following file to your .pierre/ci folder.

Note: the VERCEL_ORG_ID and VERCEL_PROJECT_ID are the values you grabbed in step 3.

import { Job } from '@pierre/vercel';

export default Job({
  VERCEL_ORG_ID: 'team_***',
  VERCEL_PROJECT_ID: 'prj_***',
});

If you need any additional help, please reach out to us on Discord!

Joyful code review

Pierre wants you to enjoy your code reviews. So, we built a ~*~NEW~*~ git platform. Join the waitlist to get early access.

Orrr… skip the line! Join our Discord for early access