Skip to content

devlanes is in beta and not ready for production use.Report an issue

Split a monorepo into projects

Use this guide when one repository holds several apps and you have to decide whether devlanes sees one project or one per app.

::example{slug="workflows-pnpm-monorepo"}

A project file at the root, with a service per app, starts every app in one lane under one lane domain. That suits apps you always run together.

devlanes.yaml
project: myapp
services:
api:
run_script:
file: apps/api/package.json
name: dev
hosts: "api.${{ lane.domain }}"
web:
preset: vite
run_script:
file: apps/web/package.json
name: dev
hosts: "${{ lane.domain }}"

A project file in an app’s folder makes that app a project with its own name, lanes, ports and domain. Relative paths in it start at that folder, and the root file leaves the app out.

devlanes.yaml
project: billing
services:
web:
run_script:
file: package.json
name: dev
hosts: "${{ lane.domain }}"

A command uses the nearest project file at or above the folder you run it in. Start billing from its folder, and reach it from anywhere else with -p:

Terminal window
$ cd apps/billing
$ devlanes start --no-ui
$ cd ../..
$ devlanes -p billing status

A project reads another project’s services through an expression with that project’s name. The default covers the time when no lane of billing runs.

devlanes.yaml
global_env:
BILLING_URL: ${{ projects.billing.services.web.public_url | default('') }}

The value is set when a service starts. After billing’s lane comes up, a reload in the root project restarts the services whose value changed:

Terminal window
$ devlanes reload

Keep one project and choose which apps a start brings up with profiles, named choices of services for a start, as Share settings and choose which services start shows.