Installation

Installation

Using the NextJS starter templates

If you're starting from scratch, the easiest way to get up and running with Val and NextJS is to use npm (or similar) create script:

npm create @valbuild

Integrating into an existing project

You can use the @valbuild/init script to setup your existing project with Val. Follow the following steps to this:

  • Make sure you have NextJS (version 14 or higher) installed

  • Install the required packages

  • Add eslint plugins

  • Run init script

  • Connect to Val Build (optional)

Required packages

Install the Val packages. You can use npm or pnpm (or yarn).

npm install @valbuild/core@latest @valbuild/next@latest
# pnpm i @valbuild/core@latest @valbuild/next@latest

Add eslint plugin

It is optional to use the Val eslint plugin but we highly recommend it.

You will get fast feedback if you .val files are misconfigured.

npm install -D @valbuild/eslint-plugin@latest
# pnpm i -D @valbuild/eslint-plugin@latest

Run the init script

npx @valbuild/init@latest
# pnpm @valbuild/init@latest

Connect to Val Build

If you want editors to be able to create commits and live edit your application, you can go to Val Build and create a project or run the command below.

npx -p @valbuild/cli@latest connect

Monorepo

If you have a monorepo, or have a project where the project is located in a subdirectory relative to the github repository use the "root" property on the initVal in your val.config.ts file.

Formatting

You typically want to enable automatic formatting when Val creates commits. Follow the guide here to do that.