Add to existing project

Add to 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).

Bash
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.

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

Run the init script

Bash
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.

Bash
npx -p @valbuild/cli@latest connect